Capturing payments

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

(1630398458 in the example is the reference of the order)

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

CodeMessageDescription
1Request could not be processedThe payment could not be made, it was refused by the bank.
1Merchant site identifier unknownMerchantSiteId unknown.
1Merchant identifier unknownMerchantId unknown.
1Missing order schedule amountThe 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.
1Missing attempt counterInvalid: the value to be filled in the Attempt field is 1.
1Missing merchant identifierMerchantId missing.
1Missing merchant site identifierMerchantSiteId missing.
1Missing order referenceOrderRef missing.
1Missing order schedule rankPayment schedule does not exist for this order
1No schedule foundNo payment schedule has been found for this order
1No schedule is in pendingNo payment schedule has been found for this order
1No 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}.
1No schedule item foundNo installment found