Getting card_type From When Adding a Card to a Customer

Hello!

Saw on this page that there is a card_type field (in beta) that is returned when adding a card to a customer.

I’m not seeing this field returned when I use this same end point. Do I need to sign up for beta access to gain access to this field or something like that?

Thank you!

This is just a Card object, but the field (card_type) states:

The Card object includes this field only in response to Payments API calls.

so, it will not be returned in the CreateCustomerCard response (since it’s the Customer API), only in the Payment API at this time.

I see–thank you.

We collect a card and charge it later, and would like to limit the cards we collect to only credit card (i.e. no debit cards). Is it possible to determine if a card is a credit card ahead of charging it or is there a better way to handle this?

Thank you!

You can definitely set autocomplete=false in the CreatePayment, which is basically a delayed capture. This will authorize the card, and create the Payment object, without charging the card. So, you can then check the type of the card, and choose to cancel it (CancelPayment) instead of completing it (CompletePayment).

Thank you–I will give that a shot!

1 Like