NodeJs
const { FedaPay, Transaction } = require('fedapay');
/* Replace YOUR_SECRETE_API_KEY with your real API key */
FedaPay.setApiKey("YOUR_SECRETE_API_KEY");
/* Specify whether you want to run your query in test mode or live mode */
FedaPay.setEnvironment('sandbox'); //or setEnvironment('live');
/* Update a transaction */
const transaction = await Transaction.update(ID, params = {}, headers = {});\FedaPay\Fedapay::setApiKey(MY_API_KEY);
\FedaPay\Transaction::update(ID, params = {}, headers = {});require 'fedapay';
# configure FedaPay library
FedaPay.api_key = '' # Your secret api key
FedaPay.environment = '' # sandbox or live
# Update a transaction instance
transaction.amount = 5000;
transaction.save;
# Update a transaction by id
FedaPay::Transaction.update(ID, amount: 5000);curl --request PUT \
--url https://sandbox-api.fedapay.com/v1/transactions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"amount": 123,
"callback_url": "<string>",
"status": "<string>"
}
'import requests
url = "https://sandbox-api.fedapay.com/v1/transactions/{id}"
payload = {
"description": "<string>",
"amount": 123,
"callback_url": "<string>",
"status": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(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/{id}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"amount\": 123,\n \"callback_url\": \"<string>\",\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://sandbox-api.fedapay.com/v1/transactions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"amount\": 123,\n \"callback_url\": \"<string>\",\n \"status\": \"<string>\"\n}")
.asString();{
"id": 123,
"reference": "<string>",
"amount": 123,
"description": "<string>",
"callback_url": "<string>",
"status": "<string>",
"customer_id": 123,
"currency_id": 123,
"metadata": {},
"commission": 123,
"fees": 123,
"fixed_commission": 123,
"amount_transferred": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"declined_at": "2023-11-07T05:31:56Z",
"refunded_at": "2023-11-07T05:31:56Z",
"transferred_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"last_error_code": "<string>",
"custom_metadata": {},
"amount_debited": 123,
"receipt_url": "<string>",
"payment_method_id": 123,
"sub_accounts_commissions": "<array>",
"transaction_key": "<string>",
"merchant_reference": "<string>",
"account_id": 123,
"balance_id": 123
}Collects
Update a transaction
PUT
/
transactions
/
{id}
NodeJs
const { FedaPay, Transaction } = require('fedapay');
/* Replace YOUR_SECRETE_API_KEY with your real API key */
FedaPay.setApiKey("YOUR_SECRETE_API_KEY");
/* Specify whether you want to run your query in test mode or live mode */
FedaPay.setEnvironment('sandbox'); //or setEnvironment('live');
/* Update a transaction */
const transaction = await Transaction.update(ID, params = {}, headers = {});\FedaPay\Fedapay::setApiKey(MY_API_KEY);
\FedaPay\Transaction::update(ID, params = {}, headers = {});require 'fedapay';
# configure FedaPay library
FedaPay.api_key = '' # Your secret api key
FedaPay.environment = '' # sandbox or live
# Update a transaction instance
transaction.amount = 5000;
transaction.save;
# Update a transaction by id
FedaPay::Transaction.update(ID, amount: 5000);curl --request PUT \
--url https://sandbox-api.fedapay.com/v1/transactions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"amount": 123,
"callback_url": "<string>",
"status": "<string>"
}
'import requests
url = "https://sandbox-api.fedapay.com/v1/transactions/{id}"
payload = {
"description": "<string>",
"amount": 123,
"callback_url": "<string>",
"status": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(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/{id}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"amount\": 123,\n \"callback_url\": \"<string>\",\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://sandbox-api.fedapay.com/v1/transactions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"amount\": 123,\n \"callback_url\": \"<string>\",\n \"status\": \"<string>\"\n}")
.asString();{
"id": 123,
"reference": "<string>",
"amount": 123,
"description": "<string>",
"callback_url": "<string>",
"status": "<string>",
"customer_id": 123,
"currency_id": 123,
"metadata": {},
"commission": 123,
"fees": 123,
"fixed_commission": 123,
"amount_transferred": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"declined_at": "2023-11-07T05:31:56Z",
"refunded_at": "2023-11-07T05:31:56Z",
"transferred_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"last_error_code": "<string>",
"custom_metadata": {},
"amount_debited": 123,
"receipt_url": "<string>",
"payment_method_id": 123,
"sub_accounts_commissions": "<array>",
"transaction_key": "<string>",
"merchant_reference": "<string>",
"account_id": 123,
"balance_id": 123
}Autorisations
Corps
application/json
Réponse
Transaction updated successfully.

