The Aerapay Checkout method enables merchants to receive payments within the Aerapay platform and gives customers additional payment methods. Online shoppers can pay using their Aerapay balance or load funds using their debit/credit card. The following depicts the integration for your e-Commerce system.
- Can choose Aerapay Checkout by selecting Checkout with Aerapay
- Logs into Aerapay and authenticates his or her identity
- Selects a payment method and reviews the transaction within Aerapay
- Confirms the order and pays from your site
- Submit all payment details to Aerapay via
POSTto/checkoutand receives a payment token - Redirect the buyer to the Aerapay checkout page
- Recieve the result, and if successful payment and payer information
- Complete the payment via
POSTto/complete
| Environment | URL |
|---|---|
| Live | contact Aerapay for the URL |
| Test | https://payment.staging.aerapay.com/ |
Aerapay will provide an API_ID and an API_SECRET to sign the API requests.
Attach the following custom headers to your API calls
| Custom Header | Value |
|---|---|
| X-API-ID | Your API_ID |
| X-API-Signature | sha256( ( REQUEST_BODY as JSON-String ) + API_SECRET ) as Base64 |
Content-Type: application/json
Request
| Field | Type | Required | Description |
|---|---|---|---|
| redirectUrl | String | Yes | Redirect url for the payment result |
| notificationUrl | String | No | Url for payment status notifications |
| merchant | Object | No | |
| merchant.name | String | No | Name of the merchant |
| merchant.email | String | No | Support email address |
| merchant.website | String | No | URL of the merchant's website |
| merchant.image | String | No | URL to the merchant's logo |
| order | Object | Yes | |
| order.currency | String | Yes | Currencies (1) |
| order.total | String | Yes | Total amount of the order |
| order.shipping | String | No | Total shipping costs |
| order.items | Array | No | |
| order.items[n].id | String | No | Identifier of the item |
| order.items[n].name | String | No | Name of the item |
| order.items[n].amount | String | No | Amount of the item |
| order.items[n].quantity | String | No | Number of items |
| attachment | Object | No | Will be attached to each direct or indirect response |
Response
| Field | Type | Description |
|---|---|---|
| token | String | Token to identitfy and access payment |
| result | Object | |
| result.code | Number | Result codes (2) |
| result.message | String | Detailed message |
| payment | Object | |
| payment.id | Object | Identifier of the payment |
| payment.status | String | Payment status (3) |
| payment.currency | String | Currencies (1) |
| payment.total | String | Total amount of the payment |
| attachment | Object | Your defined attachment |
(2) Result Codes
| Code | Description | HTTP Status |
|---|---|---|
| 13 | Authentication failed | 400 |
| 20 | Payment approved | 200 |
| 23 | Payment rejected | 400 |
| 44 | Validation error | 400 |
| 57 | Order total invalid | 400 |
Once your payment got approved, build the checkout URL and redirect the buyer to the Aerapay checkout page.
https://AERAPAY_ENVIRONMENT/?token=TOKEN
Attached is a base64 encoded JSON String as URL parameter named „result“. Decode and parse.
| Field | Type | Description |
|---|---|---|
| token | String | Token to identitfy and access payment |
| result.code | Number | Result codes (4) |
| result.message | String | Detailed message |
| payment | Object | |
| payment.id | Object | Identifier of the payment |
| payment.status | String | Payment status (3) |
| payment.method | String | Payment methods (5) |
| payment.currency | String | Currencies (1) |
| payment.total | String | Total amount of the payment |
| payment.fee | String | Total fees for the merchant |
| payer | Object | |
| payer.id | String | Aerapay account number |
| payer.username | String | Aerapay username |
| payer.first_name | String | First name |
| payer.last_name | String | Last name |
| payer.account_type | String | Account types (7) |
| payer.email | String | Aerapay account email |
| payer.address | Object | |
| payer.address.street | String | Street name |
| payer.address.postal | String | Postal code |
| payer.address.city | String | City |
| payer.address.state | String | State |
| payer.address.country | String | Country |
| payer.nationality | String | Nationality of the payer |
| attachment | Object | Your defined attachment |
(4) Result Codes
| Code | Description |
|---|---|
| 21 | Payment confirmed |
| 22 | Payment canceled |
| 24 | Payment failed |
Content-Type: application/json
Request
| Field | Type | Required | Description |
|---|---|---|---|
| token | String | Yes | Payment token |
Response
| Field | Type | Description |
|---|---|---|
| token | String | Token to identitfy and access payment |
| result.code | Number | Result codes (6) |
| result.message | String | Detailed message |
| payment | Object | |
| payment.id | Object | Identifier of the payment |
| payment.status | String | Payment status (3) |
| payment.method | String | Payment methods (5) |
| payment.currency | String | Currencies¹ |
| payment.total | String | Total amount of the payment |
| payment.fee | String | Total fees for the merchant |
| payer | Object | |
| payer.id | String | Aerapay account number |
| payer.username | String | Aerapay username |
| payer.first_name | String | First name |
| payer.last_name | String | Last name |
| payer.account_type | String | Account types (7) |
| payer.email | String | Aerapay account email |
| payer.address | Object | |
| payer.address.street | String | Street name |
| payer.address.postal | String | Postal code |
| payer.address.city | String | City |
| payer.address.state | String | State |
| payer.address.country | String | Country |
| payer.nationality | String | Nationality of the payer |
| attachment | Object | Your defined attachment |
(6) Result Codes
| Code | Description | HTTP Status |
|---|---|---|
| 13 | Authentication failed | 400 |
| 29 | Payment token invalid | 400 |
| 27 | Completion successful | 200 |
| 28 | Completion failed | 400 |
(1) Currencies
| Value | Description |
|---|---|
| AUD | Australian Dollar |
| CAD | Canadian Dollar |
| CNY | Yuan Renminbi |
| EUR | Euro |
| GBP | British Pound |
| HKD | Hong Kong Dollar |
| SGD | Singapore Dollar |
| USD | US Dollar |
(3) Payment status
| Value | Description |
|---|---|
| pending | Awaiting payer confirmation |
| in progress | Awaiting payment completion |
| awaiting | Successful but awaiting bank transfer |
| settling | Successful but awaiting settlement |
| settled | Successful and settled |
| canceled | Has been canceled |
| failed | Has failed |
| expired | Expired |
(5) Payment methods
| Value | Description |
|---|---|
| credit | Debit / Credit Card |
| transfer | Aerapay Transfer |
| bank | Bank Transfer |
(7) Account types
| Value | Description |
|---|---|
| personal | Personal Account |
| company | Corporate Account |