Manual validation payment
By default, orders are validated automatically during step 2 of the payment (during GET <url>/execute).
It is also possible to dissociate the steps of payment authorization from those of a transaction capture.
This allows to make authorizations while the final transfer of cart items between the seller amount and the Marketplace fee amount is not yet known.
Step 1
In order to enable this feature, all you need to do is add the awaiting_validation attribute when creating the order and assigning it the true value.
Example of a POST ORDER creation call in manual validation mode:
POST https://secure.lyra.com/marketplace/orders?expand=items
{ "marketplace": "ebfb36ab-2d30-4326-adb9-e16b0c9a89f3", "reference": "MKP BURO example", "description": "Office supplies order", "currency": "EUR", "url_return": "https://URLreturn.com", "awaiting_validation" : true, "items": [ { "seller": "5d0ef88c-3345-4b33-948e-80e23d553b73", "reference": "STB1", "description": "blue pens "amount": 1150, "is_commission": false } ], "buyer": { "type": "PRIVATE", "email": "john.smith@buyer.com", "phone_number": "33 (0)1 11 22 33 44", "reference": "ZhIsYM" }, "shipping": { "shipping_method": "RELAY_POINT" } }
In this example, the amount of the item (buyer amount) is known, but not the percentage of the sub-merchant and the operator fee (Marketplace).
Step 2
Step 2 is executed in the same way as in case of standard payment and the redirection URL for proceeding to the payment is returned.
Example of a GET call to fix the order:
GET https://secure.lyra.com/marketplaces/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427/execute
Since the order is waiting for validation, the verification steps of the minimum fee amount are not executed.
Step 3
Once the payment has been successfully made, the order status changes to PENDING and the status of the corresponding transactions changes to TO_VALIDATE.
Step 4
This optional step allows to the amount of the operator fees if they were not provided in step 1.
- a fee item
- and/or fees for items (see corresponding paragraph).
One or several items can also be deleted (standard function).
The total amount of the order can be decreased but not increased.
On the other hand, the awaiting_validation attribute cannot be modified.
Step 5
The process is finalized with the validation of the order. During this step one can make sure that the amount of the fee is sufficient.
In order to validate an order, make a POST to the URL of the order, validate attribute.
Example of a POST ORDER call for manually validating it:
POST https://secure.lyra.com/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427/validate
Example of the validate POST ORDER response:
The order details are returned. The awaiting_validation attribute of the order then takes the false value and the status of the corresponding transactions changes from TO_VALIDATE to PENDING.
{ "uuid": "7fac13b0-7ab9-4382-9073-11ddb38d4427", "href": "https://secure.lyra.com/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427", "created_at": "2019-05-27T09:30:24.434556Z", "updated_at": "2019-05-27T09:36:06.500936Z", "marketplace": "ebfb36ab-2d30-4326-adb9-e16b0c9a89f3", "reference": “MKP BURO 2 Example", "description": “Order of supplies", "alias": null, "awaiting_validation": false, "buyer": [ { "reference": "ZhIsYM", "title": null, "type": "PRIVATE", "first_name": null, "last_name": null, "legal_name": null, "phone_number": "33 (0)1 11 22 33 44", "email": "john.mith@buyer.com", "address": null } ], "shipping": [ { "shipping_method": "RELAY_POINT", "delivery_company_name": null, "shipping_speed": null, "shipping_delay": null, "type": null, "first_name": null, "last_name": null, "legal_name": null, "phone_number": null, "address": { "street_number": "37", "street": "rue Marcel Philippe", "district": "Wallis-et-Futuna", "zipcode": "59259", "city": "Dupont", "state": "Meurthe-et-Moselle", "country": "FR" } } ], "payment_config": "SINGLE", "amount": 1150, "initial_amount": 1150, "currency": "EUR", "status": "PENDING", "webhook_result": 200, "url_return": "https://URLreturn.com", "links": { "items": { "href": "https://secure.lyra.com/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427/items" }, "transactions": { "href": "https://secure.lyra.com/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427/transactions" }, "refunds": { "href": "https://secure.lyra.com/marketplace/orders/7fac13b0-7ab9-4382-9073-11ddb38d4427/refunds" } }, "vads_transaction_id": 600001, "vads_transaction_date": "20190527093234", "expected_capture_date": "20190530093235", "capture_delay": 3 }