<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$walletId = 'wlt_m_01K3K8QFMNRKSNED3S3EN8EF2X';
$pagination = new \MangoPay\Pagination(1, 10);
$filter = new \MangoPay\FilterTransactions();
$filter->ScaContext = "USER_PRESENT";
$response = $api->Wallets->GetTransactions($walletId, $pagination, $filter);
print_r($response);
} catch (\MangoPay\Libraries\ResponseException $exception) {
print_r($exception->GetErrorDetails()->Data['RedirectUrl']);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let myWallet = {
Id: "wlt_m_01JZ8DKE83Y06860JZRKAM259V",
};
const listWalletTransactions = async (walletId) => {
return await mangopay.Wallets.getTransactions(walletId, {
parameters: {
ScaContext: "USER_PRESENT", // SCA every 180 days for wallet access
},
resolveWithFullResponse: true, // to retrieve www-authenticate header with PendingUserAction RedirectUrl
})
.then((response) => {
console.info(response);
return response;
})
.catch((err) => {
console.log(err);
return false;
});
};
listWalletTransactions(myWallet.Id);
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def listWalletTransactions(walletId)
begin
response = MangoPay::Wallet.transactions(walletId, {'ScaContext': 'USER_PRESENT'})
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch wallet transactions: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myWallet = {
Id: 'wlt_m_01JXJ25HVXF2RRAC41A3RBY4XZ'
}
listWalletTransactions(myWallet[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.FilterTransactions;
import com.mangopay.core.Pagination;
import com.mangopay.core.Sorting;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.SortDirection;
import com.mangopay.entities.Transaction;
import com.mangopay.entities.Wallet;
import java.util.List;
public class ListWalletTransactions {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var walletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV";
// Pagination: 20 per page, starting at page 1
Pagination pagination = new Pagination(1, 20);
// Filter with ScaContext
FilterTransactions filter = new FilterTransactions();
filter.setScaContext("USER_PRESENT");
// Sorting: CreationDate DESC
Sorting sorting = new Sorting();
sorting.addField("CreationDate", SortDirection.desc);
List<Transaction> transactions = mangopay.getWalletApi().getTransactions(walletId, pagination, filter, sorting);
for (Transaction transaction : transactions) {
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(transaction);
System.out.println(prettyJson);
}
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Wallet, Transaction, NaturalUserSca
natural_user = NaturalUserSca.get('user_m_01K884VNR86ZHV9RA6G602AXZW')
user_wallet = Wallet.get('wlt_m_01JYEJCS18438SEW2773PSNWCV')
try:
transactions = Transaction.all(user_id=natural_user.id, wallet_id=user_wallet.id, ScaContext='USER_PRESENT')
except APIError as ex:
print(ex.headers.get('www-authenticate'))
using MangoPay.SDK;
using MangoPay.SDK.Core;
using MangoPay.SDK.Entities;
using Newtonsoft.Json;
public class ListWalletTransactionsSca
{
public void Run()
{
Task.Run(async () =>
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-mangopay-client-id";
api.Config.ClientPassword = "your-mangopay-api-key";
var walletId = "wlt_m_01JY53GESY8V2HBV7EBD6J8FKX";
var pagination = new Pagination(1, 100);
var filter = new FilterTransactions
{
ScaContext = "USER_PRESENT"
};
try
{
await api.Wallets.GetTransactionsAsync(walletId, pagination, filter);
}
catch (ResponseException ex)
{
Dictionary<string, string> data = ex.ResponseError.Data;
string prettyPrint = JsonConvert.SerializeObject(data, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}).GetAwaiter().GetResult();
}
}
[
{
"Id": "xfer_m_01J8F1J0KBFTRP5CMYMFFTG4W4",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1727081808,
"AuthorId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
"CreditedUserId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
"DebitedFunds": {
"Currency": "EUR",
"Amount": 500
},
"CreditedFunds": {
"Currency": "EUR",
"Amount": 490
},
"Fees": {
"Currency": "EUR",
"Amount": 10
},
"Status": "SUCCEEDED",
"ResultCode": "000000",
"ResultMessage": "Success",
"ExecutionDate": 1727081809,
"Type": "TRANSFER",
"Nature": "REGULAR",
"CreditedWalletId": "wlt_m_01HT03YR6YRBT1EGK1FYDDBZM9",
"DebitedWalletId": "wlt_m_01HW8AS48VH6MRXVT44RKK5RW1",
"DepositId": null
},
{
"Id": "refund_m_01J8F1JZ6XCEFCZ71W34N9DWRR",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1727081839,
"AuthorId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
"CreditedUserId": null,
"DebitedFunds": {
"Currency": "EUR",
"Amount": 490
},
"CreditedFunds": {
"Currency": "EUR",
"Amount": 500
},
"Fees": {
"Currency": "EUR",
"Amount": -10
},
"Status": "SUCCEEDED",
"ResultCode": "000000",
"ResultMessage": "Success",
"ExecutionDate": 1727081840,
"Type": "TRANSFER",
"Nature": "REFUND",
"CreditedWalletId": "wlt_m_01HW8AS48VH6MRXVT44RKK5RW1",
"DebitedWalletId": "wlt_m_01HT03YR6YRBT1EGK1FYDDBZM9",
"DepositId": null
}
]
// No response body, redirectUrl returned in WWW-Authenticate response header
Transactions
List Transactions for a Wallet
GET
/
v2.01
/
{ClientId}
/
wallets
/
{WalletId}
/
transactions
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$walletId = 'wlt_m_01K3K8QFMNRKSNED3S3EN8EF2X';
$pagination = new \MangoPay\Pagination(1, 10);
$filter = new \MangoPay\FilterTransactions();
$filter->ScaContext = "USER_PRESENT";
$response = $api->Wallets->GetTransactions($walletId, $pagination, $filter);
print_r($response);
} catch (\MangoPay\Libraries\ResponseException $exception) {
print_r($exception->GetErrorDetails()->Data['RedirectUrl']);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let myWallet = {
Id: "wlt_m_01JZ8DKE83Y06860JZRKAM259V",
};
const listWalletTransactions = async (walletId) => {
return await mangopay.Wallets.getTransactions(walletId, {
parameters: {
ScaContext: "USER_PRESENT", // SCA every 180 days for wallet access
},
resolveWithFullResponse: true, // to retrieve www-authenticate header with PendingUserAction RedirectUrl
})
.then((response) => {
console.info(response);
return response;
})
.catch((err) => {
console.log(err);
return false;
});
};
listWalletTransactions(myWallet.Id);
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def listWalletTransactions(walletId)
begin
response = MangoPay::Wallet.transactions(walletId, {'ScaContext': 'USER_PRESENT'})
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch wallet transactions: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myWallet = {
Id: 'wlt_m_01JXJ25HVXF2RRAC41A3RBY4XZ'
}
listWalletTransactions(myWallet[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.FilterTransactions;
import com.mangopay.core.Pagination;
import com.mangopay.core.Sorting;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.SortDirection;
import com.mangopay.entities.Transaction;
import com.mangopay.entities.Wallet;
import java.util.List;
public class ListWalletTransactions {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var walletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV";
// Pagination: 20 per page, starting at page 1
Pagination pagination = new Pagination(1, 20);
// Filter with ScaContext
FilterTransactions filter = new FilterTransactions();
filter.setScaContext("USER_PRESENT");
// Sorting: CreationDate DESC
Sorting sorting = new Sorting();
sorting.addField("CreationDate", SortDirection.desc);
List<Transaction> transactions = mangopay.getWalletApi().getTransactions(walletId, pagination, filter, sorting);
for (Transaction transaction : transactions) {
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(transaction);
System.out.println(prettyJson);
}
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Wallet, Transaction, NaturalUserSca
natural_user = NaturalUserSca.get('user_m_01K884VNR86ZHV9RA6G602AXZW')
user_wallet = Wallet.get('wlt_m_01JYEJCS18438SEW2773PSNWCV')
try:
transactions = Transaction.all(user_id=natural_user.id, wallet_id=user_wallet.id, ScaContext='USER_PRESENT')
except APIError as ex:
print(ex.headers.get('www-authenticate'))
using MangoPay.SDK;
using MangoPay.SDK.Core;
using MangoPay.SDK.Entities;
using Newtonsoft.Json;
public class ListWalletTransactionsSca
{
public void Run()
{
Task.Run(async () =>
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-mangopay-client-id";
api.Config.ClientPassword = "your-mangopay-api-key";
var walletId = "wlt_m_01JY53GESY8V2HBV7EBD6J8FKX";
var pagination = new Pagination(1, 100);
var filter = new FilterTransactions
{
ScaContext = "USER_PRESENT"
};
try
{
await api.Wallets.GetTransactionsAsync(walletId, pagination, filter);
}
catch (ResponseException ex)
{
Dictionary<string, string> data = ex.ResponseError.Data;
string prettyPrint = JsonConvert.SerializeObject(data, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}).GetAwaiter().GetResult();
}
}
[
{
"Id": "xfer_m_01J8F1J0KBFTRP5CMYMFFTG4W4",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1727081808,
"AuthorId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
"CreditedUserId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
"DebitedFunds": {
"Currency": "EUR",
"Amount": 500
},
"CreditedFunds": {
"Currency": "EUR",
"Amount": 490
},
"Fees": {
"Currency": "EUR",
"Amount": 10
},
"Status": "SUCCEEDED",
"ResultCode": "000000",
"ResultMessage": "Success",
"ExecutionDate": 1727081809,
"Type": "TRANSFER",
"Nature": "REGULAR",
"CreditedWalletId": "wlt_m_01HT03YR6YRBT1EGK1FYDDBZM9",
"DebitedWalletId": "wlt_m_01HW8AS48VH6MRXVT44RKK5RW1",
"DepositId": null
},
{
"Id": "refund_m_01J8F1JZ6XCEFCZ71W34N9DWRR",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1727081839,
"AuthorId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
"CreditedUserId": null,
"DebitedFunds": {
"Currency": "EUR",
"Amount": 490
},
"CreditedFunds": {
"Currency": "EUR",
"Amount": 500
},
"Fees": {
"Currency": "EUR",
"Amount": -10
},
"Status": "SUCCEEDED",
"ResultCode": "000000",
"ResultMessage": "Success",
"ExecutionDate": 1727081840,
"Type": "TRANSFER",
"Nature": "REFUND",
"CreditedWalletId": "wlt_m_01HW8AS48VH6MRXVT44RKK5RW1",
"DebitedWalletId": "wlt_m_01HT03YR6YRBT1EGK1FYDDBZM9",
"DepositId": null
}
]
// No response body, redirectUrl returned in WWW-Authenticate response header
This call returns the transactions (pay-in, transfers, conversions, and payouts) of a given wallet.
Caution - ScaContext default value changingOn this endpoint, the default value for
ScaContext is changing to USER_PRESENT on Dec 15, 2025 (Dec 1 in Sandbox).From this date, if the PendingUserAction.RedirectUrl value is returned, then you need to redirect the user to perform SCA.With approval from Mangopay, your platform may be able to use the USER_NOT_PRESENT value provided you also have a legal proxy in place with the user and the user’s consent to access wallet balances and transactions on their behalf (read more about proxy management).Note – SCA triggered by this endpointThis endpoint requires the user to perform SCA to authenticate the access to their wallet, unless SCA for wallet access was successfully completed in the last 180 days (or unless your platform is using a proxy and user consent).When SCA is required, this endpoint returns a 401 - Unauthorized response.To let the user complete the SCA session on the Mangopay-hosted webpage, your platform needs to retrieve the
RedirectUrl from the WWW-Authenticate response header, add an encoded returnUrl query parameter, and redirect the user. Read more about how to redirect them in the SCA session guide.In Sandbox, you can bypass SCA by including the word accept in the Email value of the Natural User or the LegalRepresentative.Email value of the Legal User – for example accept@example.com or john.doe+accept@example.com.Path parameters
string
required
The unique identifier of the wallet.
Query parameters
string
Possible values:
USER_PRESENT, USER_NOT_PRESENTThe SCA context of the request, which is required if the user’s UserCategory is OWNER:USER_PRESENT– The user is taking the SCA-triggering action of accessing their wallet. The platform must redirect the user using thePendingUserAction.RedirectUrlreturned so that the user can complete the SCA session (unless exempted because a successful SCA session for wallet access occurred in the last 180 days, so no redirection link was returned).USER_NOT_PRESENT– The platform is taking the action under proxy from the user and the user has previously given consent to Mangopay (via the SCA hosted experience) to allow the action. If the user has not given (or has revoked) their consent, thenUSER_NOT_PRESENTreturns a 403 error.
OWNER, and the default value will become USER_PRESENT from Dec 15, 2025 (Dec 1 in Sandbox)string
Possible values:
CreationDate:ASC, CreationDate:DESCDefault value: CreationDate:ASCIndicates the direction in which to sort the list.integer
Min. value:
1; max. value: 100Default value: 10Indicates the number of items returned for each page of the pagination.integer
Start value:
1Default value: 1Indicates the index of the page for the pagination.string
Allowed values:
CREATED, SUCCEEDED, FAILEDThe status of the transaction. You can filter on multiple values by separating them with a comma.string
The code indicating the result of the operation. You can filter on multiple values by separating them with a comma.
Unix timestamp
The date before which the transaction was created (based on the transaction’s
CreationDate parameter). You can filter on a specific time range by using both the AfterDate and BeforeDate query parameters.Unix timestamp
The date after which the transaction was created (based on the transaction’s
CreationDate parameter). You can filter on a specific time range by using both the AfterDate and BeforeDate query parameters.string
Allowed values:
PAYIN, TRANSFER, CONVERSION, PAYOUTThe type of the transaction. You can filter on multiple values by separating them with a comma.string
Allowed values:
REGULAR, REPUDIATION, REFUND, SETTLEMENTThe nature of the transaction, providing more information about the context in which the transaction occurred. You can filter on multiple values by separating them with a comma.Responses
200
200
array
The list of transactions created by the platform.
Show properties
Show properties
object
The transaction created by the platform.
Show properties
Show properties
string
Max length: 128 characters (see data formats for details)The unique identifier of the object.
string
Max. length: 255 charactersCustom data that you can add to this object.
For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform.
For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform.
Unix timestamp
The date and time at which the object was created.
string
The unique identifier of the user at the source of the transaction.
string
Default value: The unique identifier of the owner of the credited wallet.The unique identifier of the user whose wallet is credited.
object
Information about the debited funds.
Show properties
Show properties
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the debited funds (the sell currency).
integer
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).During a conversion, (DebitedFunds.Amount - Fees) * MarketRate = CreditedFunds.Amount. object
Information about the credited funds (
CreditedFunds = DebitedFunds - Fees).Show properties
Show properties
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the credited funds.
integer
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).object
Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet).
Show properties
Show properties
string
Returned values: The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings).The currency of the fees.
integer
An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as
1260 whereas JPY 12 would be represented as just 12).string
Returned values:
CREATED, SUCCEEDED, FAILEDThe status of the transaction.string
The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes.
string
The explanation of the result code.
Unix timestamp
The date and time at which the status changed to
SUCCEEDED, indicating that the transaction occurred. The statuses CREATED and FAILED return an ExecutionDate of null.string
The type of transaction.
string
Returned values:
REGULAR, REPUDIATION, REFUND, SETTLEMENTThe nature of the transaction, providing more information about the context in which the transaction occurred:REGULAR– Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow.REPUDIATION– Automatic withdrawal of funds from the platform’s repudiation wallet as part of the dispute process (when the user has requested a chargeback).REFUND– Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay).SETTLEMENT– Transfer made to the repudiation wallet by the platform to settle a lost dispute.
string
The unique identifier of the credited wallet.
string
The unique identifier of the debited wallet.
401 - SCA required
401 - SCA required
When SCA is required for wallet access, this endpoint returns a 401 - Unauthorized response code with the In this case, your platform needs to retrieve the URL value, encode and add a
redirectUrl in the WWW-Authenticate response header:401 response header
WWW-Authenticate: PendingUserAction redirectUrl=https://sca.sandbox.mangopay.com/?token=0193cf51ed367151a0cb1c59def21e13
returnUrl query parameter, and redirect the user.Read more about SCA redirection and SCA on wallet access →[
{
"Id": "xfer_m_01J8F1J0KBFTRP5CMYMFFTG4W4",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1727081808,
"AuthorId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
"CreditedUserId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
"DebitedFunds": {
"Currency": "EUR",
"Amount": 500
},
"CreditedFunds": {
"Currency": "EUR",
"Amount": 490
},
"Fees": {
"Currency": "EUR",
"Amount": 10
},
"Status": "SUCCEEDED",
"ResultCode": "000000",
"ResultMessage": "Success",
"ExecutionDate": 1727081809,
"Type": "TRANSFER",
"Nature": "REGULAR",
"CreditedWalletId": "wlt_m_01HT03YR6YRBT1EGK1FYDDBZM9",
"DebitedWalletId": "wlt_m_01HW8AS48VH6MRXVT44RKK5RW1",
"DepositId": null
},
{
"Id": "refund_m_01J8F1JZ6XCEFCZ71W34N9DWRR",
"Tag": "Created using Mangopay API Postman Collection",
"CreationDate": 1727081839,
"AuthorId": "user_m_01HSDQD2RPPQ8NMM36EDGYBMEY",
"CreditedUserId": null,
"DebitedFunds": {
"Currency": "EUR",
"Amount": 490
},
"CreditedFunds": {
"Currency": "EUR",
"Amount": 500
},
"Fees": {
"Currency": "EUR",
"Amount": -10
},
"Status": "SUCCEEDED",
"ResultCode": "000000",
"ResultMessage": "Success",
"ExecutionDate": 1727081840,
"Type": "TRANSFER",
"Nature": "REFUND",
"CreditedWalletId": "wlt_m_01HW8AS48VH6MRXVT44RKK5RW1",
"DebitedWalletId": "wlt_m_01HT03YR6YRBT1EGK1FYDDBZM9",
"DepositId": null
}
]
// No response body, redirectUrl returned in WWW-Authenticate response header
<?php
require_once 'vendor/autoload.php';
use MangoPay\MangoPayApi;
$api = new MangoPayApi();
$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';
try {
$walletId = 'wlt_m_01K3K8QFMNRKSNED3S3EN8EF2X';
$pagination = new \MangoPay\Pagination(1, 10);
$filter = new \MangoPay\FilterTransactions();
$filter->ScaContext = "USER_PRESENT";
$response = $api->Wallets->GetTransactions($walletId, $pagination, $filter);
print_r($response);
} catch (\MangoPay\Libraries\ResponseException $exception) {
print_r($exception->GetErrorDetails()->Data['RedirectUrl']);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
let myWallet = {
Id: "wlt_m_01JZ8DKE83Y06860JZRKAM259V",
};
const listWalletTransactions = async (walletId) => {
return await mangopay.Wallets.getTransactions(walletId, {
parameters: {
ScaContext: "USER_PRESENT", // SCA every 180 days for wallet access
},
resolveWithFullResponse: true, // to retrieve www-authenticate header with PendingUserAction RedirectUrl
})
.then((response) => {
console.info(response);
return response;
})
.catch((err) => {
console.log(err);
return false;
});
};
listWalletTransactions(myWallet.Id);
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def listWalletTransactions(walletId)
begin
response = MangoPay::Wallet.transactions(walletId, {'ScaContext': 'USER_PRESENT'})
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch wallet transactions: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myWallet = {
Id: 'wlt_m_01JXJ25HVXF2RRAC41A3RBY4XZ'
}
listWalletTransactions(myWallet[:Id])
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.FilterTransactions;
import com.mangopay.core.Pagination;
import com.mangopay.core.Sorting;
import com.mangopay.core.Money;
import com.mangopay.core.enumerations.SortDirection;
import com.mangopay.entities.Transaction;
import com.mangopay.entities.Wallet;
import java.util.List;
public class ListWalletTransactions {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var walletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV";
// Pagination: 20 per page, starting at page 1
Pagination pagination = new Pagination(1, 20);
// Filter with ScaContext
FilterTransactions filter = new FilterTransactions();
filter.setScaContext("USER_PRESENT");
// Sorting: CreationDate DESC
Sorting sorting = new Sorting();
sorting.addField("CreationDate", SortDirection.desc);
List<Transaction> transactions = mangopay.getWalletApi().getTransactions(walletId, pagination, filter, sorting);
for (Transaction transaction : transactions) {
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(transaction);
System.out.println(prettyJson);
}
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Wallet, Transaction, NaturalUserSca
natural_user = NaturalUserSca.get('user_m_01K884VNR86ZHV9RA6G602AXZW')
user_wallet = Wallet.get('wlt_m_01JYEJCS18438SEW2773PSNWCV')
try:
transactions = Transaction.all(user_id=natural_user.id, wallet_id=user_wallet.id, ScaContext='USER_PRESENT')
except APIError as ex:
print(ex.headers.get('www-authenticate'))
using MangoPay.SDK;
using MangoPay.SDK.Core;
using MangoPay.SDK.Entities;
using Newtonsoft.Json;
public class ListWalletTransactionsSca
{
public void Run()
{
Task.Run(async () =>
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-mangopay-client-id";
api.Config.ClientPassword = "your-mangopay-api-key";
var walletId = "wlt_m_01JY53GESY8V2HBV7EBD6J8FKX";
var pagination = new Pagination(1, 100);
var filter = new FilterTransactions
{
ScaContext = "USER_PRESENT"
};
try
{
await api.Wallets.GetTransactionsAsync(walletId, pagination, filter);
}
catch (ResponseException ex)
{
Dictionary<string, string> data = ex.ResponseError.Data;
string prettyPrint = JsonConvert.SerializeObject(data, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}).GetAwaiter().GetResult();
}
}
Was this page helpful?
⌘I