Testing
Existing User MFA Scenario
In order to test the /confirmUser endpoint, the scenario where you're creating a user that already exists in the Aeropay ecosystem, you'll need to unverify a user you've already created in sandbox. You can do so by using the /userMerchantVerification endpoint, which unverifies a user at your merchant.
Once unverified, you can proceed with calling POST /user (X-API-Version 1.1) with that user's details to test the /confirmUser flow.
Example Request
curl --request DELETE \
--url https://staging-api.aeropay.com/userMerchantVerification \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'authorizationToken: Bearer {{merchant token}}' \
--data '
{
"userId": "12973",
"merchantId": "1522"
}
'
Example Response
{
"success": true,
"error": null,
"message": "Success! User is unverified. You can re-authenticate this user.",
"userId": "12973"
}
Transaction Decline Scenarios
You may use the following key words when creating transactions in our sandbox environment to simulate a declined transaction. To run an Exception Scenario transaction, run a regular POST /transaction with an extra ‘exceptionScenario’ value in the body. The transaction will produce the desired output exactly as it would happen if the transaction hit that error through its regular execution.
When you trigger a decline scenario, users will automatically become blocked until the payment is resolved. You can resolve test payments in the sandbox environment from your Aeropay merchant portal.
exceptionScenario | Use Case |
---|---|
returnInsufficient | Triggers an R01, insufficient funds decline. |
returnAccount | Triggers an R02, account issue decline. |
returnDispute | Triggers an R07, dispute decline. |
Example request
{
"amount" : "5.00",
"merchantId" : "931",
"exceptionScenario": "balanceInsufficient"
}
Example response
Note: In these scenarios, the POST /transaction
call will succeed, but the transaction will shortly after be declined with a returnCode
corresponding to the exceptionScenario.
{
"success": true,
"error": null,
"message": "The scenario transaction is being created and declined. Please wait a few seconds to see it reflected in the merchant portal.",
"amount": {
"currency": "USD",
"value": "5.0"
},
"merchantCategories": [
"NACHA"
],
"storeAddress": "1426 W Leland Ave, Chicago, IL",
"scenarioReturnCode": "R02",
"uuid": "6185e2a7-230b-464b-8bef-57f2df2aa810",
"merchantName": "Green Dispensary STG"
}
Blocked Transaction Scenarios
You may use the following key words when creating transactions in our sandbox environment to simulate a blocked transaction. To run an Exception Scenario transaction, run a regular POST /transaction with an extra ‘exceptionScenario’ value in the body. The transaction will produce the desired output exactly as it would happen if the transaction hit that error through its regular execution.
exceptionScenario | Use Case |
---|---|
delinquent | Triggers an AP109 error code, invoked when a user has been blocked by Aeropay, likely due to outstanding declined payments or a bad bank account. |
riskEngine | Triggers an AP307 error code, invoked when our risk engine blocks a payment. |
balanceInsufficient | Triggers an AP302 error code, invoked when a user does not have sufficient funds to cover the payment total. |
Example request
{
"amount" : "5.00",
"merchantId" : "931",
"exceptionScenario": "delinquent"
}
Example response
{
"success": false,
"code": "AP109",
"error": "We've detected delinquent activity on your account. Reach out to [email protected] to reactivate your account."
}
Updated about 2 months ago