PayXpert - User documentation
How to call PayXpress APM via Android Intent
1. Introduction
This document lists all the PayXpress APM features available from an Android Intent call. The following features are available:
Debit transactions
Refund transactions
Direct Refund transactions (allow to refund a transaction without having to scan or enter manualy a transaction id)
Requirements:
The APM app must be installed.
It is possible to call APM with our parameters only via Intent calls.
APM version must be greater than or equal to 2.7.5
2. Calling APM from another Android application
To call APM, you should use an Intent with a Component.
The package should be io.payxpress.android.apm and the class com.payxpert.merchant.MainActivity.
There are 2 possible actions for this Intent:
Perform a sale transaction
Perform a refund transaction
Perform a direct refund transaction
Here is an example for an Intent starting a transaction:
val intent = Intent()
intent.component = ComponentName("io.payxpress.android.apm",
"com.payxpert.merchant.MainActivity")
intent.putExtra("is_refund", false)
intent.putExtra("payment_request_from_another_app", true)Parameter | Description | Format | Type | Mandatory |
|---|---|---|---|---|
| Indicates whether the transaction is a refund. If this field is missing, then the default is debit |
| Boolean | No for debit yes for direct refund |
| Describes where the transaction comes from. This parameter should always be set to true. |
| Boolean | Yes |
| Indicates whether the transaction is a direct refund. The field |
| Boolean | No |
See the following section to know which extras you should add depending on the action.
2.1 Transactions
To trigger a transaction in APM, you should pass to the Intent some extra parameters with the
description of the transaction you want to do.
intent.putExtra("amount", 15.10)
intent.putExtra("transaction_id", "1p5jiofow7-1duh") //only needed for refundParameter | Description | Format | Type | Mandatory |
|---|---|---|---|---|
| Amount of the transaction. |
| Double | Yes |
| Transaction identifier required for refund. | 1p5jiofow7-1duh | String | Yes in the case of refund and direct refund. No otherwise |
3. Retrieve transaction result
When a transaction has been triggered via Intent, it is possible to wait for the transaction result to know the outcome of it.
Here is a list of the available key to retrieved in the intent result
Key | Format/Example Value | Type | Description |
|---|---|---|---|
alternative_payment_type | "ALIPAY" | String | Payment method used (e.g., ALIPAY, WeChat) |
transaction_id | "1p5jiofow7-1duh" | String | Unique identifier of the transaction |
alternative_payment_amount | 1500 | Int | Total amount of the transaction (tip included), in cents |
alternative_tip_payment_amount | 200 | Int | Amount of the tip only, in cents |
success | true | Boolean | Indicates if the transaction was successful |
Here is an example of how to retrieve the result:
intent?.getBooleanExtra("success", false)
intent?.getStringExtra("transaction_id")
intent?.getIntExtra("alternative_payment_amount", 0)