Search code examples
c#payment-gatewayopayo

sage pay integration How to check whether a card is a credit card or debit card


We are using sage pay gateway to take money from our customers which is working smoothly.but we are unable to identify whether its credit or debit card when they enter the card number in our application.


Solution

  • Use the reporting API (https://www.sagepay.co.uk/file/6946/download-document/Reporting_and_Admin_API_Integration_Guideline_31012014.pdf) to call 'getCardDetails' - just pass the first 9 digits, and Sage Pay will return whether it is a credit / debit card (among other things).