hps / heartland-php

Heartland Payment Systems Payment Gateway PHP SDK
https://developer.heartlandpaymentsystems.com/SecureSubmit/
GNU General Public License v2.0
25 stars 23 forks source link

Is it possible to get the payment card bin number as part of the charge response? #40

Open roggio opened 5 years ago

roggio commented 5 years ago

We are using your javascript from your tokenization demo. Then using this PHP SDK we are calling the charge method of the CreditService class.

Is it possible to get the payment card bin number as part of that request? Is there another way to get the payment card bin number with a different request?

Thank you

eric-vest commented 5 years ago

Hi Roggio,

You can get card type (brand) and last four from the token response. If you need the bin specifically, you can retrieve it through a transaction summary.

Here's an example of retrieving a transaction summary using the transactionId https://github.com/hps/heartland-php/blob/fc727dac99f4b57733c8fc58d494fce0c9ac1993/tests/integration/CertificationTests/EcommerceTest.php#L940-L943

The field you're looking for in the response is "maskedCardNumber".

Hope this helps!