Context: Using default shopify payment gateway. All requests leading up to the checkout completion have been made.
I start by sending a request to the Shopify credit card vault:
POST: https://elb.deposit.shopifycs.com
Body:
{
"credit_card": {
"number": "{credit-card}",
"first_name": "Bob",
"last_name": "Joe",
"month": "5",
"year": "2020",
"verification_value": "123"
}
}
I receive a normal response from this.
However, when I send a request to complete the checkout, I receive a 422 error.
Request to complete checkout:
POST: https://shopify.myshopify.com/admin/checkouts/{token}/payments.json
Body:
{
"payment": {
"request_details": {
"ip_address": "123.1.1.1",
"accept_language": "en-US,en;q=0.8,fr;q=0.6",
"user_agent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/54.0.2840.98 Safari\/537.36"
},
"amount": "100.00",
"session_id": "{session-id}",
"unique_token": "vaRS23"
}
}
Response is a 422 error:
{
"errors": {
"credit_card": [
{
"code": "invalid",
"message": "is invalid",
"options": {}
}
]
}
}
Any help is appreciated!