Emulation
Emulation features are only available in sandbox
environment.
When you are in Sandbox environment, all endpoints are interconnected with your HiPay staging environment (HiPay's equivalent to the Treezor Sandbox).
This means that you can emulate the full acquiring process without changing endpoints or payloads.
Authorization
To emulate an Authorization you may use the following request.
The status
attribute can take the following values :
109
Authentication failed110
Blocked111
Denied112
Authorized and Pending113
Refused114
Expired115
Canceled116
Authorized (Default)142
Authorization Requested143
Authorization Cancelled175
Authorization Cancellation Requested
bash
curl -X POST {baseUrl}/simulation/topups/cards/notification/authorizations \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
Here is a {payload}
example:
json
{
"amount": {amount},
"currency": "EUR",
"walletId": "{walletId}",
"userId": "{userId}", // Optional
"cardPaymentMethod": { // Mandatoy for 116 status only. Omit otherwise.
"brand": "string",
"cardExpiryMonth": "string",
"cardExpiryYear": "string",
"cardHolder": "string",
"country": "string",
"issuer": "string",
"maskedPan": "string",
"token": "string"
},
"status": {statusOfTheSimulatedNotification}, // optional
"transactionReference": "{transactionReference}", // Mandatory for all statuses except 116
"profile": "{profile}" // Mandatory for multi-MID
}
Returns the following.
json
{
"transactionReference": "string",
"authorizationId": "string"
}
Payin
To emulate a Payin you may use the following request.
The status
attribute can take the following values :
117
Capture Requested118
Captured (Default)173
Capture Refused
bash
curl -X POST {baseUrl}/simulation/topups/cards/notification/payins \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
Here is a {payload}
example:
json
{
"amount": {amount},
"currency": "EUR",
"walletId": "{walletId}",
"userId": "{userId}", // Optional
// "cardPaymentMethod": "{cardPaymentMethod}", // Omit, for status 116 only
"status": {statusOfTheSimulatedNotification}, // optional
"transactionReference": "{transactionReference}", // Mandatory (except 116)
"profile": "{profile}" // Mandatory for multi-MID
}
Returns the following:
json
{
"transactionReference": "string",
"payinId": "string"
}
Refund
To emulate a Refund you may use the following request.
The status
attribute can take the following values :
124
Refund Requested125
Refunded (Default)126
Partially Refunded165
Refund Refused
bash
curl -X POST {baseUrl}/simulation/topups/cards/notification/refunds \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
Here is a {payload}
example:
json
{
"amount": {amount},
"currency": "EUR",
"walletId": "{walletId}",
"userId": "{userId}", // Optional
// "cardPaymentMethod": "{cardPaymentMethod}", // Omit, for status 116 only
"status": {statusOfTheSimulatedNotification}, // optional
"transactionReference": "{transactionReference}", // Mandatory (except 116)
"profile": "{profile}" // Mandatory for multi-MID
}
Returns the following.
json
{
"transactionReference": "string",
"refundId": "string"
}
Chargeback
To emulate a Chargeback you only need the transactionReference
.
The transaction reference is provided in response to the authorization step, or in response to the payin creation step if you have skipped the authorization step.
The following request emulates a Chargeback for the full amount of the transaction.
bash
curl -X POST {baseUrl}/simulation/topups/cards/notification/chargebacks \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
Here is a {payload}
example:
json
{
"transactionReference": "{transactionReference}"
}
Returns an object containing the chargebackId
:
json
{
"transactionReference": "string",
"chargebackId": "string"
}
Card Acquisition Legacy
You may emulate a Card Acquisition using the following request. Please note emulated payins can't be refunded.
Parameters
userId
the User's id (expected as astring
)walletId
the User's Wallet id (expected as astring
)amount
the amount to credit (expected as afloat
)currency
must beEUR
status
(expected as ainteger
)109
for an authentication failure110
for a rejection due to fraud suspicion113
for a refusal by the payment institution115
for a payment timeout116
for an authorization request117
for a capture request118
for a successful Card Acquisition129
for a chargeback173
for a refused capture
transactionReference
an arbitrary reference, optional but mandatory when emulating a complete flow composed of multiple requests
Request
To emulate a complete flow, you can set a status
= 117
followed by a 118
while specifying the same transactionReference
for both requests.
bash
curl -X POST {baseUrl}/simulation/acquiring/payin \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{
"userId": {userId},
"walletId": {walletId},
"amount": 100,
"currency": "EUR",
"status": 118,
"transactionReference" : "{temporaryHiPayTransactionReference}"
}'