Direct capture
You can request a capture of funds using either the Topup Card or an alternate means of payment (specified in the paymentProduct
parameter). This doesn't require an authorization first.
Prerequisites – Steps to do before the capture:
- Tokenize the card
- Create a Topup Card to associate with the user (if needed)
You can then use the usual /v1/payins
request with attributes specific to the Card Acquiring feature as described in this article.
Parameters
Attribute | Type | Description |
---|---|---|
walletId | string | The unique identifier of the Wallet to be credited. |
userId | string | The unique identifier of the User requesting the topup. |
topupCardId | string | The unique identifier of the Topup Card, if any. |
profile | string | Your HiPay Merchant ID. Required if you have multiple MIDs, otherwise empty. |
orderId | string | The unique identifier of the order, guaranteeing the uniqueness of the transaction. Must be unique and abide by the following rules:
|
amount | float | The amount of the operation. |
currency | string | Currency of the operation. Format: ISO-4217. |
acceptUrl | string | The URL to which the user is returned when the payment process is successfully completed. |
declineUrl | string | The URL to which the user is returned when the acquirer declines the payment, |
pendingUrl | string | The URL to which the user is returned when the payment request was submitted to the acquirer but the response is not available yet. |
exceptionUrl | string | The URL to which the user is returned when there is an error or a system failure. |
cancelUrl | string | The URL to which the user is returned when the payment is canceled. |
eci | string | The security level at which the payment information is processed. Can be either 7 or 9 . |
authenticationIndicator | string | Whether 3DS should be performed for the transaction. Set the value to 2 for 3DS. |
description | string | The description of the operation. |
paymentProduct | string | Can be: cb , visa , mastercard , ideal , sofort-uberweisung . |
issuerBankId | string | The Bank Identifier Code of the end user's issuing bank. Only used if the paymentProduct is ideal . |
ipaddr | string | The IP address of the end user's device. |
browserInfo | object | Object containing information regarding the end user's browser. |
firstname | string | The first name of the user. |
lastname | string | The last name of the user. |
email | string | The email of the user. |
phone | string | The phone number of the user. |
streetAddress | string | The residence street name and number of the user. |
city | string | The residence city of the user. |
zipCode | string | The residence city zipcode of the user. |
country | string | The residence country of the user. Format: ISO 3166 alpha-2 |
cardHolder | string | The name associated to the card. |
deviceChannel | integer | The PSD2 Channel through which the transaction is being processed. |
Request
bash
curl -X POST {baseUrl}/v1/payins \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
Here is an example of {payload}
:
json
{
"amount": 10,
"currency": "EUR",
"walletId": "3152544",
"userId": "100655503",
"paymentProduct": "visa",
"topupCardId": "3252046c-6138-44f1-a24d-8807974c7ec3",
"messageToUser": "string",
"acceptUrl": "acceptURL",
"declineUrl": "declineURL",
"pendingUrl": "pendingURL",
"exceptionUrl": "exceptionURL",
"cancelUrl": "cancelURL",
"eci": "9",
"authenticationIndicator": "2",
"orderId": "order_test_1234567878911",
"description": "string",
"deviceChannel": 0,
"browserInfo": {
"javaEnabled": true,
"javascriptEnabled": true,
"ipaddr": "0.0.0.0",
"httpAccept": "string",
"httpUserAgent": "string",
"language": "string",
"colorDepth": 8, // Can be: 1, 4, 8, 15, 16, 32, 48
"screenHeight": 0,
"screenWidth": 0,
"timezone": "string",
"deviceFingerprint": "string"
},
"firstname": "Alex",
"lastname": "Oak",
"email": "aoak@example.com",
"phone": "string",
"streetAddress": "string",
"city": "string",
"zipCode": "string",
"country": "string",
"cardHolder": "A Oak"
}
Returns the following object and sends the authorization.create
, payin.create
, and payin.udpate
webhooks.
json
{
"state": "completed",
"reason": "",
"forwardUrl": "", // Redirect the user to this URL if populated
"test": "true",
"mid": "00001340255",
"attemptId": "1",
"authorizationCode": "test123",
"transactionReference": "800150032845",
"referenceToPay": "",
"dateCreated": "2022-01-26T13:45:11+0000",
"dateUpdated": "2022-01-26T13:45:17+0000",
"dateAuthorized": "2022-01-26T13:45:17+0000",
"status": "118",
"message": "Captured",
"authorizedAmount": "40.99",
"capturedAmount": "40.99",
"refundedAmount": "0.00",
"creditedAmount": "0.00",
"decimals": "2",
"currency": "EUR",
"ipAddress": "0.0.0.0",
"ipCountry": "",
"deviceId": "",
"cdata1": "212707",
"cdata2": "878744",
"cdata3": "1656177",
"cdata4": "",
"cdata5": "",
"cdata6": "",
"cdata7": "",
"cdata8": "",
"cdata9": "",
"cdata10": "",
"avsResult": "",
"eci": "9",
"paymentProduct": "visa",
"paymentMethod": {
"token": "48d8ad7f642bff96387b14f0b060ad6a6194e91debc30aa0b31bdcd5a0a6680a",
"cardId": "9fd81707-8f41-4a01-b6ed-279954336ada",
"brand": "VISA",
"pan": "411111******1111",
"cardHolder": "TOM PES",
"cardExpiryMonth": "12",
"cardExpiryYear": "2025",
"issuer": "JPMORGAN CHASE BANK, N.A.",
"country": "US"
},
"threeDSecure": "",
"fraudScreening": {
"scoring": "0",
"result": "NOT_LAUNCHED",
"review": ""
},
"order": {
"id": "order_test1643204709",
"dateCreated": "2022-01-26T13:45:11+0000",
"attempts": "1",
"amount": "40.00",
"shipping": "0.00",
"tax": "0.00",
"decimals": "2",
"currency": "EUR",
"customerId": "",
"language": "en_US",
"email": ""
},
"debitAgreement": {
"id": "10347296",
"status": "available"
}
}
To know the actual payment status, please see the Payin status
attribute of the authorization.create
, payin.create
and payin.update
webhooks.
If the forwardUrl
attribute is populated in the response, you must redirect the end user to this URL for them to complete the funds capture process. See the list of payment products to know when redirection is necessary.
When a forwarding occurs, Treezor won't send any webhook until the end user has completed the steps available at the forwardUrl
.