question

mlyon avatar image
mlyon asked David Marginian Deactivated commented

incomplete record returned from /v1/charges/id endpoint

Hi there,

The API reference shows that the information returned about a charge from the /v1/charges endpoint should include a lot more information about the card in the 'source' data, such as the card expiry month/year, whether or not the CVC check passed, the card type (funding), etc. However all I'm getting back is the brand and the first 6 / last 4 digits.

I'd really like to be able to retrieve the expiry month/year. Is there a way to get that information? Does the 'expand' parameter help here? I still can't figure out how to use that parameter, the documentation doesn't give any details about what is valid for that parameter.

Thanks.

Sandboxe-commerce api
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

That data is available in the charge response. I can look into why it isn't returned on subsequent retrieval. Here is the response I am getting for a charge using the Discover test card on sandbox:

    "source": {
        "id": "clv_1TSTSBQyEKRHdcKRPyU18L5Y",
        "address_line1_check": "unavailable",
        "address_zip": "80919",
        "address_zip_check": "pass",
        "brand": "DISCOVER",
        "cvc_check": "pass",
        "exp_month": "08",
        "exp_year": "2021",
        "first6": "601136",
        "last4": "6668"
    },

It contains all the data your are looking for except name, which I don't think is guaranteed to be available.

6 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mlyon avatar image mlyon commented ·

Hmm.. when I create a token from the /v1/tokens endpoint, and then charge the token, and then retrieve the charge afterwards, this is what I get back:

{
  "id" : "HG0F3ZD3MQCMC",
  "amount" : 100,
  "currency" : "cad",
  "created" : 1613785424000,
  "description" : "testing",
  "captured" : false,
  "customer" : "156KM8DYMHQW6",
  "order" : "WV2SFYX0KZ2QC",
  "outcome" : {
    "network_status" : "approved_by_network",
    "type" : "authorized"
  },
  "paid" : true,
  "status" : "succeeded",
  "source" : {
    "id" : "clv_1TSTSRb6DoEAZaJCD8U68RbK",
    "brand" : "VISA",
    "first6" : "424242",
    "last4" : "4242"
  }
}

The card expiry and cvc are being sent to the /v1/tokens endpoint.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ mlyon commented ·

Do you have PCI DSS certification? If not, you need to be using the iframe - https://docs.clover.com/docs/ecommerce-generating-a-card-token. I do notice that I get less data when I tokenize via the API. I will ask the ecomm team about that next week.

0 Likes 0 ·
mlyon avatar image mlyon David Marginian ♦♦ commented ·

We're using the iframe for live transactions, but have been generating tokens using the API on the sandbox just for testing various things with our backend client code, seeding in sample data, etc. I didn't anticipate there would be any difference between that and the iframe in terms of how that data would be returned by the charges endpoint afterwards. That seems rather odd, but thank you for the clarification!

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community