Sending back the payment method nonce
How to send the payment method nonce you receive from Braintree back to Commerce Layer
Problem
Solution
Example
curl -g -X PATCH \
http://yourdomain.commercelayer.io/api/braintree_payments/vdDEAsZYzR \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "braintree_payments",
"id": "vdDEAsZYzR",
"attributes": {
"payment_method_nonce": "aaaaaa-bbb-ccc-ddd-eeeeee"
}
}
}'{
"data": {
"id": "vdDEAsZYzR",
"type": "braintree_payments",
"links": {
"self": "https://yourdomain.commercelayer.io/api/braintree_payments/vdDEAsZYzR"
},
"attributes": {
"client_token": "xxxx.yyyy.zzzz==",
"payment_method_nonce": "aaaaaa-bbb-ccc-ddd-eeeeee",
"payment_id": null,
"local": false,
"options": {},
"payment_instrument":{...},
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": null,
"reference_origin": null,
"metadata": {}
},
"relationships": {
"order": {
"links": {...}
}
},
"meta": {
"mode": "test"
}
}
}More to read
Placing the orderLast updated