Javascript
const transaction = await Transaction.create(...); const token = transaction.generateToken().token; const mode = 'METHODE_PAIEMENT'; // Exemple : 'mtn', 'moov', 'mtn_ci', 'moov_tg' const phoneNumber = { // Ce paramètre n'est pas obligatoire number: '64000001', country: 'bj' }; await transaction.sendNowWithToken(mode, token, phoneNumber);
[ { "reference": "pi_xdc_123456", "amount": 1000, "status": "pending", "currency_id": 840, "mode": "automatic", "last_error_code": "NO_ERROR", "created_at": "2024-10-23T14:00:00Z", "updated_at": "2024-10-23T14:00:00Z", "approved_at": "2024-10-23T14:31:00Z", "canceled_at": "2024-10-23T14:32:00Z", "deleted_at": "2024-10-23T14:33:00Z", "payment_method_id": 1, "transaction_key": "TRANSACTION-XYZ", "account_id": 5 } ]
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Transaction mode.
Transaction sent successfully.
The response is of type object[].
object[]