I am creating some API for stripe payment. I try to create API to getting card token for payment. below is my code
Postman Data
Request Method: POST,
Request URL: https://api.stripe.com/v1/tokens
Headers Data
Content-Type:application/x-www-form-urlencoded
Authorization:Bearer SECRET_KEY
Body x-www-form-urlencoded
card:{"exp_month":12,"exp_year":2020,"number":'4242424242424242',"cvc":'123'}
Response (Output)
{
"error": {
"message": "You must pass full card details to create a token.",
"type": "invalid_request_error"
}
}
Postman screenshots:
Headers
Body
I imported the cURL request from the Stripe documentation into Postman. This request should look like this one below.
Once, you add the Auth Token into the header
- It should then allow you to create the card token (If everything else is ok)
Just for reference, the syntax for the key/value
view, should look like this and not like you have it in your request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With