If you have chosen to capture payments manually, for example to charge the customer only when the order is shipped, it will be necessary to use the Capture method.
It is not necessary to indicate the amount to be paid. Just indicate that we put in payment the first installment of the order with "rank": 1. Floa takes care of paying the right amount.
ATTENTION
When a payment is authorized, the funds are only held up to 6 days following the order date.
After 6 days it will still be possible to use the payment capture method without any guarantee of success. It is therefore important to manage the return codes.
This method can be called as many times as you want for the same order if you don't have an OK return.
Example in the integration environment
PUT https://paymentgateway.integration-cb4x.fr/v1/payments/1630398458/operations/capture
Headers
Content-type : application/json
authToken : the token retrieved via the call to the authentication service
Body
{
"merchantId": 189,
"merchantSiteId": 7602,
"attempt": 1,
"rank": 1
}
Response
{
"orderTag": null,
"schedules": [
{
"amount": 7940,
"date": "2021-06-12T00:00:00",
"rank": 1,
"currency": "eur",
"state": "payed",
"capturedAmount": 7940,
"remainingAmount": 0,
"cancelledAmount": 0,
"refundedAmount": 0
},
{
"amount": 7939,
"date": "2021-09-30T00:00:00",
"rank": 2,
"currency": "eur",
"state": "init",
"capturedAmount": 0,
"remainingAmount": 7939,
"cancelledAmount": 0,
"refundedAmount": 0
},
{
"amount": 7939,
"date": "2021-10-30T00:00:00",
"rank": 3,
"currency": "eur",
"state": "init",
"capturedAmount": 0,
"remainingAmount": 7939,
"cancelledAmount": 0,
"refundedAmount": 0
},
{
"amount": 7939,
"date": "2021-11-29T00:00:00",
"rank": 4,
"currency": "eur",
"state": "init",
"capturedAmount": 0,
"remainingAmount": 7939,
"cancelledAmount": 0,
"refundedAmount": 0
}
],
"orderRef": "1630398458",
"responseCode": "success",
"actionType": "capture"
}
Return codes from the capture payment service
- success : successful authorization
- refused : invalid request
- refusedByBank : authorization refused by the bank
- internalFailure : Technical failure
- pending : Pending
- undetermined : Unknown: Undetermined state
- unavailable : Technical failure
Payment Service Error Messages
Code | Message | Description |
---|---|---|
1 | Request could not be processed | The payment could not be made, it was refused by the bank. |
1 | Merchant site identifier unknown | MerchantSiteId unknown. |
1 | Merchant identifier unknown | MerchantId unknown. |
1 | Missing order schedule amount | The amount entered is invalid or missing. The value to be returned in this field is 0: the amount of the order will be found by the service using the order reference provided in the OrderRef field. |
1 | Missing attempt counter | Invalid: the value to be filled in the Attempt field is 1. |
1 | Missing merchant identifier | MerchantId missing. |
1 | Missing merchant site identifier | MerchantSiteId missing. |
1 | Missing order reference | OrderRef missing. |
1 | Missing order schedule rank | Payment schedule does not exist for this order |
1 | No schedule found | No payment schedule has been found for this order |
1 | No schedule is in pending | No payment schedule has been found for this order |
1 | No transaction found for order {0} on merchant {1} and merchant site {2} | No transactions found for order {0} with merchant {1} and merchant site {2}. |
1 | No schedule item found | No installment found |