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);$transaction = \FedaPay\Transaction::create(...);
$token = $transaction->generateToken()->token;
$mode = 'METHODE_PAIEMENT'; // Exemple : 'mtn', 'moov', 'mtn_ci', 'moov_tg'
$phoneNumber = [ // Ce paramètre n'est pas obligatoire
'number' => '64000001',
'country' => 'bj'
];
$transaction->sendNowWithToken($mode, $token, $phoneNumber);require 'fedapay'
FedaPay.api_key = 'YOUR_SECRET_API_KEY'
FedaPay.environment = 'sandbox'
transaction = FedaPay::Transaction.create(
amount: 1000,
currency: { iso: 'XOF' },
customer: { id: 1 },
description: 'Payment for order #1234',
callback_url: 'https://example.com/callback',
mode: 'mtn_open'
)
puts "Transaction successfully created: #{transaction.inspect}"curl --request POST \
--url https://sandbox-api.fedapay.com/v1/transactions/{mode} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"token": 1,
"phone_number": {
"number": "+22997808080",
"country": "BJ"
}
}
'import requests
url = "https://sandbox-api.fedapay.com/v1/transactions/{mode}"
payload = {
"token": 1,
"phone_number": {
"number": "+22997808080",
"country": "BJ"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.fedapay.com/v1/transactions/{mode}"
payload := strings.NewReader("{\n \"token\": 1,\n \"phone_number\": {\n \"number\": \"+22997808080\",\n \"country\": \"BJ\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.fedapay.com/v1/transactions/{mode}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"token\": 1,\n \"phone_number\": {\n \"number\": \"+22997808080\",\n \"country\": \"BJ\"\n }\n}")
.asString();[
{
"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
}
]Send payment to user
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);$transaction = \FedaPay\Transaction::create(...);
$token = $transaction->generateToken()->token;
$mode = 'METHODE_PAIEMENT'; // Exemple : 'mtn', 'moov', 'mtn_ci', 'moov_tg'
$phoneNumber = [ // Ce paramètre n'est pas obligatoire
'number' => '64000001',
'country' => 'bj'
];
$transaction->sendNowWithToken($mode, $token, $phoneNumber);require 'fedapay'
FedaPay.api_key = 'YOUR_SECRET_API_KEY'
FedaPay.environment = 'sandbox'
transaction = FedaPay::Transaction.create(
amount: 1000,
currency: { iso: 'XOF' },
customer: { id: 1 },
description: 'Payment for order #1234',
callback_url: 'https://example.com/callback',
mode: 'mtn_open'
)
puts "Transaction successfully created: #{transaction.inspect}"curl --request POST \
--url https://sandbox-api.fedapay.com/v1/transactions/{mode} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"token": 1,
"phone_number": {
"number": "+22997808080",
"country": "BJ"
}
}
'import requests
url = "https://sandbox-api.fedapay.com/v1/transactions/{mode}"
payload = {
"token": 1,
"phone_number": {
"number": "+22997808080",
"country": "BJ"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.fedapay.com/v1/transactions/{mode}"
payload := strings.NewReader("{\n \"token\": 1,\n \"phone_number\": {\n \"number\": \"+22997808080\",\n \"country\": \"BJ\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.fedapay.com/v1/transactions/{mode}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"token\": 1,\n \"phone_number\": {\n \"number\": \"+22997808080\",\n \"country\": \"BJ\"\n }\n}")
.asString();[
{
"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
}
]Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de chemin
Transaction mode.
Corps
Réponse
Transaction sent successfully.
Payment intent reference.
"pi_xdc_123456"
Payout amount.
1000
Intent status (e.g., 'pending', 'scheduled', 'sent', 'failed').
"pending"
Currency ID associated with the payout.
840
Payout mode.
"automatic"
Last error code encountered during the payout.
"NO_ERROR"
Date and time of payout creation.
"2024-10-23T14:00:00Z"
Date and time of last payout update.
"2024-10-23T14:00:00Z"
Date and time the payout was sent.
"2024-10-23T14:31:00Z"
Date and time the payout failed.
"2024-10-23T14:32:00Z"
Date and time of payout deletion.
"2024-10-23T14:33:00Z"
Payment method ID used for the payout.
1
Unique key associated with the payout.
"TRANSACTION-XYZ"
Account ID associated with the payout.
5

