pub struct SumUpClient { /* private fields */ }Implementations§
Source§impl SumUpClient
impl SumUpClient
Sourcepub async fn list_checkouts(
&self,
checkout_reference: Option<&str>,
) -> Result<Vec<Checkout>>
pub async fn list_checkouts( &self, checkout_reference: Option<&str>, ) -> Result<Vec<Checkout>>
Lists created checkout resources according to the applied checkout_reference.
§Arguments
checkout_reference- Unique ID of the payment checkout specified by the client application.
§Examples
use sumup_rs::SumUpClient;
let client = SumUpClient::new("your-api-key".to_string(), true)?;
// List all checkouts
let checkouts = client.list_checkouts(None).await?;
println!("Found {} checkouts", checkouts.len());
// List checkouts with specific reference
let checkouts = client.list_checkouts(Some("order-123")).await?;
println!("Found {} checkouts with reference 'order-123'", checkouts.len());Sourcepub async fn list_checkouts_with_query(
&self,
query: &CheckoutListQuery,
) -> Result<Vec<Checkout>>
pub async fn list_checkouts_with_query( &self, query: &CheckoutListQuery, ) -> Result<Vec<Checkout>>
Lists created checkout resources with advanced query parameters.
§Arguments
query- Query parameters for filtering and pagination
§Examples
use sumup_rs::{SumUpClient, CheckoutListQuery};
let client = SumUpClient::new("your-api-key".to_string(), true)?;
// Create a query to filter checkouts
let query = CheckoutListQuery {
checkout_reference: Some("order-123".to_string()),
status: Some("PAID".to_string()),
merchant_code: Some("merchant123".to_string()),
customer_id: Some("customer456".to_string()),
limit: Some(10),
offset: Some(0),
};
let checkouts = client.list_checkouts_with_query(&query).await?;
println!("Found {} checkouts matching criteria", checkouts.len());Sourcepub async fn create_checkout(
&self,
body: &CreateCheckoutRequest,
) -> Result<Checkout>
pub async fn create_checkout( &self, body: &CreateCheckoutRequest, ) -> Result<Checkout>
Creates a new payment checkout resource.
§Arguments
body- The request body containing the details for the new checkout.
Sourcepub async fn retrieve_checkout(&self, checkout_id: &str) -> Result<Checkout>
pub async fn retrieve_checkout(&self, checkout_id: &str) -> Result<Checkout>
Retrieves an identified checkout resource.
§Arguments
checkout_id- The unique ID of the checkout resource.
Sourcepub async fn process_checkout(
&self,
checkout_id: &str,
body: &ProcessCheckoutRequest,
) -> Result<ProcessCheckoutResponse>
pub async fn process_checkout( &self, checkout_id: &str, body: &ProcessCheckoutRequest, ) -> Result<ProcessCheckoutResponse>
Processing a checkout will attempt to charge the provided payment instrument. This can result in immediate success or require a 3DS redirect.
§Arguments
checkout_id- The unique ID of the checkout resource to process.body- The request body containing payment details.
Sourcepub async fn deactivate_checkout(
&self,
checkout_id: &str,
) -> Result<DeletedCheckout>
pub async fn deactivate_checkout( &self, checkout_id: &str, ) -> Result<DeletedCheckout>
Deactivates an identified checkout resource.
§Arguments
checkout_id- The unique ID of the checkout resource to deactivate.
Sourcepub async fn get_available_payment_methods(
&self,
merchant_code: &str,
amount: Option<f64>,
currency: Option<&str>,
) -> Result<AvailablePaymentMethodsResponse>
pub async fn get_available_payment_methods( &self, merchant_code: &str, amount: Option<f64>, currency: Option<&str>, ) -> Result<AvailablePaymentMethodsResponse>
Gets available payment methods for a merchant.
§Arguments
merchant_code- The merchant’s unique code.amount- The transaction amount (optional).currency- The transaction currency (optional).
Source§impl SumUpClient
impl SumUpClient
Sourcepub async fn create_customer(
&self,
body: &CreateCustomerRequest,
) -> Result<Customer>
pub async fn create_customer( &self, body: &CreateCustomerRequest, ) -> Result<Customer>
Creates a new saved customer resource.
§Arguments
body- The request body containing the customer_id and personal details.
Sourcepub async fn retrieve_customer(&self, customer_id: &str) -> Result<Customer>
pub async fn retrieve_customer(&self, customer_id: &str) -> Result<Customer>
Retrieves an identified saved customer resource.
§Arguments
customer_id- The unique ID of the customer.
Sourcepub async fn update_customer(
&self,
customer_id: &str,
body: &UpdateCustomerRequest,
) -> Result<Customer>
pub async fn update_customer( &self, customer_id: &str, body: &UpdateCustomerRequest, ) -> Result<Customer>
Updates an identified saved customer resource’s personal details.
§Arguments
customer_id- The unique ID of the customer.body- The customer details to update.
Sourcepub async fn list_customer_payment_instruments(
&self,
customer_id: &str,
) -> Result<Vec<PaymentInstrument>>
pub async fn list_customer_payment_instruments( &self, customer_id: &str, ) -> Result<Vec<PaymentInstrument>>
Lists all payment instrument resources that are saved for an identified customer.
§Arguments
customer_id- The unique ID of the customer.
Sourcepub async fn deactivate_customer_payment_instrument(
&self,
customer_id: &str,
token: &str,
) -> Result<()>
pub async fn deactivate_customer_payment_instrument( &self, customer_id: &str, token: &str, ) -> Result<()>
Deactivates an identified card payment instrument resource for a customer. A successful deactivation returns a 204 No Content response.
§Arguments
customer_id- The unique ID of the customer.token- The token of the payment instrument to deactivate.
Source§impl SumUpClient
impl SumUpClient
Sourcepub async fn list_members(
&self,
merchant_code: &str,
) -> Result<MemberListResponse>
pub async fn list_members( &self, merchant_code: &str, ) -> Result<MemberListResponse>
Lists all members for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifier.
Sourcepub async fn create_member(
&self,
merchant_code: &str,
body: &CreateMemberRequest,
) -> Result<Member>
pub async fn create_member( &self, merchant_code: &str, body: &CreateMemberRequest, ) -> Result<Member>
Creates a new member resource for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifier.body- The member details to create.
Sourcepub async fn retrieve_member(
&self,
merchant_code: &str,
member_id: &str,
) -> Result<Member>
pub async fn retrieve_member( &self, merchant_code: &str, member_id: &str, ) -> Result<Member>
Retrieves an identified member resource for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifier.member_id- The unique member identifier.
Sourcepub async fn update_member(
&self,
merchant_code: &str,
member_id: &str,
body: &UpdateMemberRequest,
) -> Result<Member>
pub async fn update_member( &self, merchant_code: &str, member_id: &str, body: &UpdateMemberRequest, ) -> Result<Member>
Updates an identified member resource for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifier.member_id- The unique member identifier.body- The member details to update.
Source§impl SumUpClient
impl SumUpClient
Sourcepub async fn list_memberships(&self) -> Result<Vec<Membership>>
pub async fn list_memberships(&self) -> Result<Vec<Membership>>
Lists all memberships for the authenticated user.
Source§impl SumUpClient
impl SumUpClient
Sourcepub async fn get_merchant_profile(&self) -> Result<MerchantProfileDetails>
pub async fn get_merchant_profile(&self) -> Result<MerchantProfileDetails>
Retrieves the authenticated merchant’s profile.
This endpoint returns the profile of the currently authenticated merchant. The merchant_code is automatically determined from the API key.
Sourcepub async fn get_merchant(&self, merchant_code: &str) -> Result<Merchant>
pub async fn get_merchant(&self, merchant_code: &str) -> Result<Merchant>
Retrieves a specific merchant’s profile.
§Arguments
merchant_code- The unique merchant code identifier.
Sourcepub async fn list_merchants(&self) -> Result<Vec<Membership>>
pub async fn list_merchants(&self) -> Result<Vec<Membership>>
Lists all merchant accounts the authenticated user is a member of. This is the correct way to “list merchants” according to the API spec.
Note: This uses the memberships endpoint as the API doesn’t have a direct “list merchants” endpoint. The memberships contain merchant information.
Source§impl SumUpClient
impl SumUpClient
Sourcepub async fn list_payouts(
&self,
_query: &PayoutListQuery,
) -> Result<PayoutListResponse>
👎Deprecated since 0.2.0: Use list_merchant_payouts instead. The /me/payouts endpoint does not exist.
pub async fn list_payouts( &self, _query: &PayoutListQuery, ) -> Result<PayoutListResponse>
Lists all payouts for the authenticated merchant.
§Arguments
query- Query parameters including required start_date and end_date
Note: This endpoint requires a merchant_code. Use list_merchant_payouts instead. The /v1.0/me/payouts endpoint does not exist in the SumUp API.
Sourcepub async fn list_merchant_payouts(
&self,
merchant_code: &str,
query: &PayoutListQuery,
) -> Result<PayoutListResponse>
pub async fn list_merchant_payouts( &self, merchant_code: &str, query: &PayoutListQuery, ) -> Result<PayoutListResponse>
Lists payouts for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifierquery- Query parameters including required start_date and end_date
Sourcepub async fn retrieve_payout(&self, payout_id: &str) -> Result<Payout>
pub async fn retrieve_payout(&self, payout_id: &str) -> Result<Payout>
Source§impl SumUpClient
impl SumUpClient
Sourcepub async fn list_readers(&self) -> Result<ReaderListResponse>
👎Deprecated since 0.2.0: The /me/readers endpoint does not exist. Use list_merchant_readers instead.
pub async fn list_readers(&self) -> Result<ReaderListResponse>
Lists all readers for the authenticated merchant.
Note: The /v0.1/me/readers endpoint does not exist in the SumUp API. Use list_merchant_readers with a merchant_code instead.
Sourcepub async fn list_merchant_readers(
&self,
merchant_code: &str,
) -> Result<ReaderListResponse>
pub async fn list_merchant_readers( &self, merchant_code: &str, ) -> Result<ReaderListResponse>
Lists readers for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifier
Sourcepub async fn create_reader(&self, _body: &CreateReaderRequest) -> Result<Reader>
👎Deprecated since 0.2.0: The /me/readers endpoint does not exist. Use create_merchant_reader instead.
pub async fn create_reader(&self, _body: &CreateReaderRequest) -> Result<Reader>
Creates a new reader resource.
§Arguments
body- The reader details to create
Note: The /v0.1/me/readers endpoint does not exist in the SumUp API. Use create_merchant_reader with a merchant_code instead.
Sourcepub async fn create_merchant_reader(
&self,
merchant_code: &str,
body: &CreateReaderRequest,
) -> Result<Reader>
pub async fn create_merchant_reader( &self, merchant_code: &str, body: &CreateReaderRequest, ) -> Result<Reader>
Creates a reader for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifierbody- The reader details to create
Sourcepub async fn retrieve_reader(&self, _reader_id: &str) -> Result<Reader>
👎Deprecated since 0.2.0: The /me/readers/{reader_id} endpoint does not exist. Use retrieve_merchant_reader instead.
pub async fn retrieve_reader(&self, _reader_id: &str) -> Result<Reader>
Retrieves an identified reader resource.
§Arguments
reader_id- The unique reader identifier
Note: The /v0.1/me/readers/{reader_id} endpoint does not exist in the SumUp API. Use retrieve_merchant_reader with a merchant_code instead.
Sourcepub async fn retrieve_merchant_reader(
&self,
merchant_code: &str,
reader_id: &str,
) -> Result<Reader>
pub async fn retrieve_merchant_reader( &self, merchant_code: &str, reader_id: &str, ) -> Result<Reader>
Retrieves a reader for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifierreader_id- The unique reader identifier
Sourcepub async fn update_reader(
&self,
_reader_id: &str,
_body: &UpdateReaderRequest,
) -> Result<Reader>
👎Deprecated since 0.2.0: The /me/readers/{reader_id} endpoint does not exist. Use update_merchant_reader instead.
pub async fn update_reader( &self, _reader_id: &str, _body: &UpdateReaderRequest, ) -> Result<Reader>
Updates an identified reader resource.
§Arguments
reader_id- The unique reader identifierbody- The reader details to update
Note: The /v0.1/me/readers/{reader_id} endpoint does not exist in the SumUp API. Use update_merchant_reader with a merchant_code instead.
Sourcepub async fn update_merchant_reader(
&self,
merchant_code: &str,
reader_id: &str,
body: &UpdateReaderRequest,
) -> Result<Reader>
pub async fn update_merchant_reader( &self, merchant_code: &str, reader_id: &str, body: &UpdateReaderRequest, ) -> Result<Reader>
Updates a reader for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifierreader_id- The unique reader identifierbody- The reader details to update
Sourcepub async fn delete_reader(&self, _reader_id: &str) -> Result<()>
👎Deprecated since 0.2.0: The /me/readers/{reader_id} endpoint does not exist. Use delete_merchant_reader instead.
pub async fn delete_reader(&self, _reader_id: &str) -> Result<()>
Deletes an identified reader resource.
§Arguments
reader_id- The unique reader identifier
Note: The /v0.1/me/readers/{reader_id} endpoint does not exist in the SumUp API. Use delete_merchant_reader with a merchant_code instead.
Sourcepub async fn delete_merchant_reader(
&self,
merchant_code: &str,
reader_id: &str,
) -> Result<()>
pub async fn delete_merchant_reader( &self, merchant_code: &str, reader_id: &str, ) -> Result<()>
Deletes a reader for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifierreader_id- The unique reader identifier
Sourcepub async fn create_reader_checkout(
&self,
_reader_id: &str,
_body: &CreateReaderCheckoutRequest,
) -> Result<ReaderCheckoutResponse>
👎Deprecated since 0.2.0: The /me/readers/{reader_id}/checkout endpoint does not exist. Use create_merchant_reader_checkout instead.
pub async fn create_reader_checkout( &self, _reader_id: &str, _body: &CreateReaderCheckoutRequest, ) -> Result<ReaderCheckoutResponse>
Creates a checkout for a specific reader (in-person payment).
§Arguments
reader_id- The unique reader identifierbody- The checkout request details
Note: The /v0.1/me/readers/{reader_id}/checkout endpoint does not exist in the SumUp API. Use create_merchant_reader_checkout with a merchant_code instead.
Sourcepub async fn create_merchant_reader_checkout(
&self,
merchant_code: &str,
reader_id: &str,
body: &CreateReaderCheckoutRequest,
) -> Result<ReaderCheckoutResponse>
pub async fn create_merchant_reader_checkout( &self, merchant_code: &str, reader_id: &str, body: &CreateReaderCheckoutRequest, ) -> Result<ReaderCheckoutResponse>
Creates a checkout for a specific reader and merchant (in-person payment).
§Arguments
merchant_code- The unique merchant code identifierreader_id- The unique reader identifierbody- The checkout request details
Sourcepub async fn terminate_reader_checkout(
&self,
_reader_id: &str,
_checkout_id: &str,
) -> Result<()>
👎Deprecated since 0.2.0: The /me/readers/{reader_id}/checkout/{checkout_id} endpoint does not exist. Use terminate_merchant_reader_checkout instead.
pub async fn terminate_reader_checkout( &self, _reader_id: &str, _checkout_id: &str, ) -> Result<()>
Terminates a reader checkout.
§Arguments
reader_id- The unique reader identifiercheckout_id- The unique checkout identifier
Note: The /v0.1/me/readers/{reader_id}/checkout/{checkout_id} endpoint does not exist in the SumUp API. Use terminate_merchant_reader_checkout with a merchant_code instead.
Sourcepub async fn terminate_merchant_reader_checkout(
&self,
merchant_code: &str,
reader_id: &str,
checkout_id: &str,
) -> Result<()>
pub async fn terminate_merchant_reader_checkout( &self, merchant_code: &str, reader_id: &str, checkout_id: &str, ) -> Result<()>
Terminates a reader checkout for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifierreader_id- The unique reader identifiercheckout_id- The unique checkout identifier
Source§impl SumUpClient
impl SumUpClient
Sourcepub async fn list_receipts(
&self,
_query: &ReceiptListQuery,
) -> Result<ReceiptListResponse>
👎Deprecated since 0.2.0: The /v1.1/receipts list endpoint does not exist. Use retrieve_receipt for individual receipts.
pub async fn list_receipts( &self, _query: &ReceiptListQuery, ) -> Result<ReceiptListResponse>
Lists all receipts for the authenticated merchant.
§Arguments
query- Query parameters including required mid
Note: The /v1.1/receipts list endpoint does not exist in the SumUp API. Only individual receipt retrieval is supported.
Sourcepub async fn list_merchant_receipts(
&self,
_merchant_code: &str,
_query: &ReceiptListQuery,
) -> Result<ReceiptListResponse>
👎Deprecated since 0.2.0: The merchant receipts list endpoint does not exist. Use retrieve_merchant_receipt for individual receipts.
pub async fn list_merchant_receipts( &self, _merchant_code: &str, _query: &ReceiptListQuery, ) -> Result<ReceiptListResponse>
Lists receipts for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifierquery- Query parameters including required mid
Note: The /v1.1/merchants/{merchant_code}/receipts list endpoint does not exist in the SumUp API. Only individual receipt retrieval is supported.
Sourcepub async fn retrieve_receipt(
&self,
receipt_id: &str,
query: &ReceiptRetrieveQuery,
) -> Result<Receipt>
pub async fn retrieve_receipt( &self, receipt_id: &str, query: &ReceiptRetrieveQuery, ) -> Result<Receipt>
Retrieves an identified receipt resource.
§Arguments
receipt_id- The unique receipt identifierquery- Query parameters including required mid
Sourcepub async fn retrieve_merchant_receipt(
&self,
merchant_code: &str,
receipt_id: &str,
query: &ReceiptRetrieveQuery,
) -> Result<Receipt>
pub async fn retrieve_merchant_receipt( &self, merchant_code: &str, receipt_id: &str, query: &ReceiptRetrieveQuery, ) -> Result<Receipt>
Retrieves a receipt for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifierreceipt_id- The unique receipt identifierquery- Query parameters including required mid
Source§impl SumUpClient
impl SumUpClient
Sourcepub async fn list_roles(&self, merchant_code: &str) -> Result<RoleListResponse>
pub async fn list_roles(&self, merchant_code: &str) -> Result<RoleListResponse>
Lists all roles for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifier.
Sourcepub async fn create_role(
&self,
merchant_code: &str,
body: &CreateRoleRequest,
) -> Result<Role>
pub async fn create_role( &self, merchant_code: &str, body: &CreateRoleRequest, ) -> Result<Role>
Creates a new role resource for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifier.body- The role details to create.
Sourcepub async fn retrieve_role(
&self,
merchant_code: &str,
role_id: &str,
) -> Result<Role>
pub async fn retrieve_role( &self, merchant_code: &str, role_id: &str, ) -> Result<Role>
Retrieves an identified role resource for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifier.role_id- The unique role identifier.
Sourcepub async fn update_role(
&self,
merchant_code: &str,
role_id: &str,
body: &UpdateRoleRequest,
) -> Result<Role>
pub async fn update_role( &self, merchant_code: &str, role_id: &str, body: &UpdateRoleRequest, ) -> Result<Role>
Updates an identified role resource for a specific merchant.
§Arguments
merchant_code- The unique merchant code identifier.role_id- The unique role identifier.body- The role details to update.
Source§impl SumUpClient
impl SumUpClient
Sourcepub async fn list_transactions_history(
&self,
merchant_code: &str,
query: &TransactionHistoryQuery<'_>,
) -> Result<TransactionHistoryResponse>
pub async fn list_transactions_history( &self, merchant_code: &str, query: &TransactionHistoryQuery<'_>, ) -> Result<TransactionHistoryResponse>
Lists detailed history of all transactions associated with the merchant profile. Uses the modern v2.1 endpoint.
§Arguments
merchant_code- The merchant’s unique code.query- A struct with query parameters for filtering and pagination.
Sourcepub async fn retrieve_transaction_by_id(
&self,
merchant_code: &str,
transaction_id: &str,
) -> Result<Transaction>
pub async fn retrieve_transaction_by_id( &self, merchant_code: &str, transaction_id: &str, ) -> Result<Transaction>
Retrieves the full details of an identified transaction. Uses the modern v2.1 endpoint.
§Arguments
merchant_code- The merchant’s unique code.transaction_id- The transaction’s unique ID.
Sourcepub async fn refund_transaction(
&self,
merchant_code: &str,
transaction_id: &str,
amount: Option<f64>,
reason: &str,
) -> Result<Transaction>
pub async fn refund_transaction( &self, merchant_code: &str, transaction_id: &str, amount: Option<f64>, reason: &str, ) -> Result<Transaction>
Refunds a transaction.
§Arguments
merchant_code- The merchant’s unique code.transaction_id- The transaction’s unique ID.amount- The amount to refund (optional, defaults to full amount).reason- The reason for the refund.
Source§impl SumUpClient
impl SumUpClient
Sourcepub fn get_next_page_url_from_history(
history: &TransactionHistoryResponse,
) -> Option<String>
pub fn get_next_page_url_from_history( history: &TransactionHistoryResponse, ) -> Option<String>
Extracts the next page URL from a transaction history response.
Returns None if there are no more pages.
§Arguments
history- The transaction history response to extract from
§Returns
Some(url)- The URL for the next page, if availableNone- If there are no more pages
§Examples
use sumup_rs::{SumUpClient, TransactionHistoryQuery};
let client = SumUpClient::new("your-api-key".to_string(), true)?;
let query = TransactionHistoryQuery {
limit: Some(10),
order: Some("desc"),
newest_time: None,
oldest_time: None,
};
let history = client.list_transactions_history("merchant123", &query).await?;
if let Some(next_url) = SumUpClient::get_next_page_url_from_history(&history) {
println!("Next page available at: {}", next_url);
} else {
println!("No more pages available");
}Sourcepub fn get_previous_page_url_from_history(
history: &TransactionHistoryResponse,
) -> Option<String>
pub fn get_previous_page_url_from_history( history: &TransactionHistoryResponse, ) -> Option<String>
Extracts the previous page URL from a transaction history response.
Returns None if there is no previous page.
§Arguments
history- The transaction history response to extract from
§Returns
Some(url)- The URL for the previous page, if availableNone- If there is no previous page
§Examples
use sumup_rs::{SumUpClient, TransactionHistoryQuery};
let client = SumUpClient::new("your-api-key".to_string(), true)?;
let query = TransactionHistoryQuery {
limit: Some(10),
order: Some("desc"),
newest_time: None,
oldest_time: None,
};
let history = client.list_transactions_history("merchant123", &query).await?;
if let Some(prev_url) = SumUpClient::get_previous_page_url_from_history(&history) {
println!("Previous page available at: {}", prev_url);
} else {
println!("No previous page available");
}Sourcepub fn has_next_page_from_history(history: &TransactionHistoryResponse) -> bool
pub fn has_next_page_from_history(history: &TransactionHistoryResponse) -> bool
Checks if there are more pages available in a transaction history response.
§Arguments
history- The transaction history response to check
§Returns
true- If there are more pages availablefalse- If this is the last page
§Examples
use sumup_rs::{SumUpClient, TransactionHistoryQuery};
let client = SumUpClient::new("your-api-key".to_string(), true)?;
let query = TransactionHistoryQuery {
limit: Some(10),
order: Some("desc"),
newest_time: None,
oldest_time: None,
};
let history = client.list_transactions_history("merchant123", &query).await?;
if SumUpClient::has_next_page_from_history(&history) {
println!("More pages available");
} else {
println!("This is the last page");
}Sourcepub async fn list_all_transactions_history(
&self,
merchant_code: &str,
order: Option<&str>,
max_pages: Option<usize>,
) -> Result<Vec<Transaction>>
pub async fn list_all_transactions_history( &self, merchant_code: &str, order: Option<&str>, max_pages: Option<usize>, ) -> Result<Vec<Transaction>>
Fetches all transactions for a merchant by automatically handling pagination. This is a convenience method that fetches all pages and combines the results.
§Arguments
merchant_code- The merchant’s unique codeorder- Sort order (e.g., “asc”, “desc”)max_pages- Maximum number of pages to fetch (None for unlimited)
§Returns
Vec<Transaction>- All transactions from all pages
§Examples
use sumup_rs::SumUpClient;
let client = SumUpClient::new("your-api-key".to_string(), true)?;
// Fetch all transactions (up to 5 pages to avoid overwhelming the API)
let all_transactions = client.list_all_transactions_history("merchant123", Some("desc"), Some(5)).await?;
println!("Fetched {} transactions", all_transactions.len());
// Fetch all transactions without page limit (use with caution)
let all_transactions = client.list_all_transactions_history("merchant123", Some("desc"), None).await?;
println!("Fetched {} transactions", all_transactions.len());Source§impl SumUpClient
impl SumUpClient
Sourcepub fn new(api_key: String, use_sandbox: bool) -> Result<Self>
pub fn new(api_key: String, use_sandbox: bool) -> Result<Self>
Creates a new client for the SumUp API.
§Arguments
api_key- Your SumUp API key (or OAuth token).use_sandbox- Set totrueto use the sandbox environment.