cancel
Showing results for 
Search instead for 
Did you mean: 

verify credit card using rest api

Options
ymao19
Contributor
Posted on

Is it possible to verify the credit card using rest api?

 

 

4 REPLIES 4

verify credit card using rest api

Options
MTS_Justin
Moderator
Hi,

Make a zero dollar authorization against the card to verify it with the card issuer - https://developer.paypal.com/docs/api/payments/

Was my post helpful? If so, please give me a kudos!

verify credit card using rest api

Options
ymao19
Contributor

Hi,

I did that. and I got the message below:

 

 {"name":"VALIDATION_ERROR","details":[{"field":"transactions[0].amount","issue":"Amount cannot be zero."}],"message":"Invalid request. See details.","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"8526a1caa0951"}

 

verify credit card using rest api

Options
MTS_Justin
Moderator
Hello,

I've ran the same transaction today and received an approved response.

"id": "PAY-25G55489T9942724HLLZQDZY",
"intent": "authorize",
"state": "approved",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card": {
"payer_id": "913158512037377342",
"type": "VISA",
"number": "xxxxxxxxxxxx1293",
"expire_month": "11",
"expire_year": "2018",
"first_name": "Betsy",
"last_name": "Buyer",
"billing_address": {
"line1": "111 First Street",
"line2": "",
"city": "Saratoga",
"state": "CA",
"postal_code": "95070",
"country_code": "US"
}
}
}
]
},
"transactions": [
{
"amount": {
"total": "0.00",
"currency": "USD",
"details": {
"subtotal": "0.00",
"tax": "0.00",
"shipping": "0.00"

Was my post helpful? If so, please give me a kudos!

verify credit card using rest api

Options
ymao19
Contributor

Hi,

 

I still get the same error message.  Am I missing something? Do I need to setup something in my account?  Below is my Json request.

 

{
  "intent": "authorize",
  "payer": {
    "payment_method": "credit_card",
    "funding_instruments": [
      {
        "credit_card": {
          "number": "378282246310005",
          "type": "amex",
          "expire_month": 6,
          "expire_year": 2020,
          "cvv2": "555"
        }
      }
    ]
  },
  "transactions": [
    {
      "amount": {
        "currency": "USD",
        "total": "0"
      },
      "description": "creating a payment with saved credit card",
      "invoice_number": "VERIFY_CC",
      "item_list": {
        "items": [
          {
            "name": "Verify Credit Card",
            "quantity": "1",
            "price": "0",
            "currency": "USD"
          }
        ]
      }
    }
  ]
}

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.