Preparing the payment for execution
How to make a payment ready to be executed on Paypal
Problem
Solution
Example
curl -g -X PATCH \
'http://yourdomain.commercelayer.io/api/paypal_payments/qaZPVIyoeg' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "paypal_payments",
"id": "qaZPVIyoeg",
"attributes": {
"paypal_payer_id": "aaabbbccc123"
}
}
}{
"data": {
"id": "qaZPVIyoeg",
"type": "paypal_payments",
"links": {
"self": "https://yourdomain.commercelayer.io/api/paypal_payments/qaZPVIyoeg"
},
"attributes": {
"return_url": "https://checkout.yourdomain.com/jNbQLhMeqo/paypal",
"cancel_url": "https://checkout.yourdomain.com/jNbQLhMeqo",
"note_to_payer": null,
"paypal_payer_id": "aaabbbccc123",
"name": "aaabbbccc123",
"paypal_id": "PAYID-xxxxyyyyzzzz",
"status": "created",
"approval_url": "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-123abc456",
"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": {
"self": "https://commerce-layer.commercelayer.co/api/paypal_payments/qaZPVIyoeg/relationships/order",
"related": "https://commerce-layer.commercelayer.co/api/paypal_payments/qaZPVIyoeg/order"
}
}
},
"meta": {
"mode": "test"
}
}
}More to read
Placing the orderLast updated