### Install SumUp React Native SDK Source: https://developer.sumup.com/llms-full.txt Commands to install the SumUp React Native Payment SDK and its dependency `react-native-webview` using npm or yarn. ```bash npm i sumup-react-native-alpha npm i react-native-webview ``` ```bash yarn add sumup-react-native-alpha yarn add react-native-webview ``` -------------------------------- ### Install SumUp PHP SDK with Composer Source: https://developer.sumup.com/llms-small.txt This command uses Composer, a dependency manager for PHP, to install the SumUp eCom PHP SDK. Ensure Composer is installed on your system before running this command. This is the primary method for adding the SDK to your PHP project. ```bash composer require sumup/sumup-ecom-php-sdk ``` -------------------------------- ### Install SumUp React Native SDK (npm/yarn) Source: https://developer.sumup.com/llms-small.txt Instructions for installing the SumUp React Native Payment SDK and its dependencies using npm or yarn. It also includes installing react-native-webview and react-native-localization, which are required for certain SDK functionalities. ```bash npm i sumup-react-native-alpha npm i react-native-webview yarn add sumup-react-native-alpha yarn add react-native-webview ``` -------------------------------- ### Google Pay Integration Source: https://developer.sumup.com/llms-full.txt Guide to integrating Google Pay directly with SumUp. Covers prerequisites and setup. ```APIDOC ## Google Pay Integration Guide This guide explains how to integrate Google Pay directly with SumUp. Google Pay is also available via the SumUp Payment Widget. ### Prerequisites Before you begin: * Ensure you have a merchant profile with SumUp and have completed your profile details. * If you need to test payments without using real funds, create a test profile. * Review the Google Pay API terms of service. * Complete the domain onboarding setup in your SumUp Dashboard under **Settings** > **For developers** > **Payment wallets**. Refer to Google's tutorial on Google Pay for Payments for detailed requirements. ``` -------------------------------- ### Wrap Payment Screen with SumUpProvider Source: https://developer.sumup.com/llms-full.txt Example of initializing the SumUp SDK by wrapping the main payment screen component with `SumUpProvider`. This requires an `apiKey` obtained from the SumUp developer portal. ```javascript import { SumUpProvider } from 'sumup-react-native-alpha'; export default function App() { return ( ); } ``` -------------------------------- ### Install Native Modules for iOS Source: https://developer.sumup.com/llms-full.txt Command to navigate to the 'ios' directory and install native modules using CocoaPods, a necessary step after installing React Native libraries. ```bash cd ios pod install ``` -------------------------------- ### Accept Payments with PrestaShop Source: https://developer.sumup.com/llms-small.txt Guide on accepting payments using the SumUp Payment module plugin for PrestaShop, including prerequisites and installation steps. ```APIDOC ## Accept payments with PrestaShop ### Description This guide details how to accept payments using the SumUp Payment module plugin for PrestaShop. It covers the necessary prerequisites and installation steps. ### Prerequisites 1. An active SumUp account. 2. Verified business information as required by SumUp's legal and verification policies. 3. Ensure your business model is supported by SumUp. ### Installation 1. Obtain client credentials by registering an application via the [register application guide](/tools/authorization/register-app). 2. Download the client credentials JSON file from the [access client credentials section](/tools/authorization/register-app/#4-access-the-client-credentials). 3. Upload the JSON file to the "Module Configuration" page in your PrestaShop Backoffice. 4. Contact SumUp support to request enabling of the online payments scope for your store after your account is fully verified. ### Note The minimum transaction amount accepted through SumUp is 1 EUR (or equivalent). ``` -------------------------------- ### Create Checkout for Recurring Payments (Bash) Source: https://developer.sumup.com/llms-small.txt This example shows how to create a checkout resource intended for setting up recurring payments. It includes essential details like amount, currency, customer ID, and crucially, sets the 'purpose' to 'SETUP_RECURRING_PAYMENT' for tokenization. ```bash curl -X POST \ https://api.sumup.com/v0.1/checkouts \ -H "Authorization: Bearer $SUMUP_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "checkout_reference": "MYCHECKOUT", "amount": 100, "currency": "EUR", "merchant_code": "MDEERENR", "description": "My checkout", "customer_id": "MYCUSTOMERID-123", "purpose": "SETUP_RECURRING_PAYMENT" }' ``` -------------------------------- ### Initialize LLMtxt SDK Source: https://developer.sumup.com/llms-small.txt Initializes the LLMtxt SDK, providing the access token. This method should be called once at the application's start. It returns a `Result` object indicating success or failure. ```kotlin ```kotlin // Assumes an init function is defined elsewhere // Example placeholder: // fun init(accessToken: String): Result ``` ``` -------------------------------- ### Start Payment Process Source: https://developer.sumup.com/llms-full.txt Initiates a payment transaction. Takes `CheckoutData` and a boolean to skip the success screen. Returns a `Flow` of `PaymentEvent`s or throws an exception on error. ```kotlin suspend fun startPayment( checkoutData: CheckoutData, skipSuccessScreen: Boolean ): Flow ``` -------------------------------- ### Solo Terminal API - Reader Checkout Request Example Source: https://developer.sumup.com/llms-full.txt An example of how to include Affiliate Key details in a Solo Terminal API Reader Checkout Request. ```APIDOC ## Solo Terminal API - Reader Checkout Request ### Description This request demonstrates the inclusion of affiliate information, specifically the `app_id` and `key`, within the `affiliate` object for a Solo Terminal API checkout request. ### Method POST ### Endpoint (Specific endpoint for creating checkout not provided in text, assumed for example) ### Parameters #### Request Body - **affiliate** (object) - Required - Contains affiliate identification details. - **app_id** (string) - Required - The application ID or Bundle ID. - **key** (string) - Required - The unique Affiliate key. - **checkout** (object) - Required - Details of the checkout. - **amount** (number) - Required - The transaction amount. - **currency** (string) - Required - The currency of the transaction (e.g., "EUR"). - **description** (string) - Optional - A description for the transaction. ### Request Example ```json { "affiliate": { "app_id": "your_application_id", "key": "your_affiliate_key" }, "checkout": { "amount": 10.0, "currency": "EUR", "description": "Test Transaction" } } ``` ### Response #### Success Response (200) (Response structure not provided in text) #### Response Example (Response example not provided in text) ``` -------------------------------- ### Install react-native-localization SDK Source: https://developer.sumup.com/llms-full.txt Commands to install the `react-native-localization` library using npm or yarn, which helps in automatically detecting the user's system language for the SDK. ```bash npm i react-native-localization ``` ```bash yarn add react-native-localization ``` -------------------------------- ### Create and Complete a Checkout Source: https://developer.sumup.com/llms-full.txt Guides on how to create a checkout and then complete it for a payment with a customer-entered card. Useful for quick payment processing without storing customer data. ```APIDOC ## Create and Complete a Checkout ### Description This guide explains how to make a single payment using a customer's card details without associating it with a saved customer profile. This is ideal for scenarios where customer account data is not stored or managed. ### Steps 1. **Create a checkout**: Initiate a checkout process. 2. **Complete a checkout**: Finalize the payment using the customer's card information. ### Response Handling - **Successful requests**: Indicated by `2xx` HTTP status codes (e.g., `200 OK`, `201 Created`, `202 Accepted`, `204 No Content`). Response bodies may vary or be absent. - **Client-side issues**: Indicated by `4xx` codes, usually due to invalid requests, incorrect values, or missing parameters. The response body will detail the error. - **Server-side issues**: Indicated by `5xx` codes, suggesting temporary server problems. Retrying the request is recommended. ### Example Success Response Body ```json { "next_step": { "url": "https://dummy-3ds-gateway.com/cap?RID=1233&VAA=A", "method": "POST", "redirect_url": "https://mysite.com/completed_purchase", "mechanism": "iframe", "payload": { "PaReq": "eJxVUttu2zAM/RXDr4MjyY5dO6BVuE27FZuDZHGG9VGRmMSFb/..f16+jLt/gPhUvGGw==", "MD": "b1a536c0-29b9-11eb-adc1-0242ac120002" } } } ``` ### Example Error Response Body (4xx) ```json { "message": "Validation error", "error_code": "MISSING", "param": "merchant_code" } ``` ``` -------------------------------- ### JavaScript Example for CSP with Nonce Source: https://developer.sumup.com/llms-small.txt This Node.js Express example demonstrates how to set the 'Content-Security-Policy' header dynamically with a generated nonce to allow inline scripts and styles required by the SumUp Payment Widget. It whitelists necessary SumUp domains for API connections, images, scripts, and frames. ```javascript const express = require("express"); const app = express(); const http = require("http"); const server = http.createServer(app); const port = process.env.PORT || 4000; const crypto = require("crypto"); // Resources const apisToConnect = ["https://gateway.sumup.com", "https://api.sumup.com"]; const imagesResources = [ "data:", // inline icons "https://static.sumup.com", // For generated barcodes "https://api.sumup.com", ]; const scriptsResources = [ "https://gateway.sumup.com", // PLUS nonce-$HASH ]; const stylesResources = [ // nonce-$HASH ]; const framesResources = ["https://gateway.sumup.com"]; app.get("/", (req, res) => { const nonce = crypto.randomBytes(16).toString("base64"); res.setHeader( "Content-Security-Policy", `default-src 'self';` + ` connect-src 'self' ${apisToConnect.join(" ")};` + ` img-src 'self' ${imagesResources.join(" ")};` + ` script-src 'self' ${scriptsResources.join(" ")} 'nonce-${nonce}';` + ` style-src 'self' 'nonce-${nonce}';` + ` frame-src 'self' ${framesResources.join(" ")};` ); // res.send( `

Test CSP

Test using generated nonce: ${nonce}
See without nonce
Footer
` ); }); server.listen(port, () => { console.log("listening on:", port); }); ``` -------------------------------- ### Community and Support Source: https://developer.sumup.com/llms-small.txt Information on how to get help and contact the SumUp integration team. ```APIDOC ## Community Got questions or found a bug? Get in contact with our integration team by sending an email to . ``` -------------------------------- ### Initialize Payment Sheet with Apple Pay Source: https://developer.sumup.com/llms-full.txt Provides instructions for enabling and configuring Apple Pay for the payment sheet, including merchant ID registration and Xcode setup. ```APIDOC ## Initialize Payment Sheet with Apple Pay ### Description This section outlines the steps required to enable Apple Pay for the SumUp payment sheet. It includes registering an Apple Merchant ID, configuring your Xcode project, and providing the necessary details during payment sheet initialization. **Note:** The backend does not currently process Apple Pay payments, and a fix is in progress. ### Method Asynchronous function call within JavaScript after setup. ### Endpoint N/A (Client-side function) ### Parameters #### Apple Merchant ID Registration 1. Register for a new Merchant ID on the Apple Developer website. 2. Create a new Apple Pay certificate (requires implementation). #### Xcode Configuration 1. Open your target settings in Xcode. 2. Navigate to the "Signing & Capabilities" tab. 3. Click "Add Capability" and select your Merchant Identifier. #### `initPaymentSheet` options - **applePay** (object) - Optional - Configuration object for Apple Pay. - **merchantIdentifier** (string) - Required - Your registered Apple Merchant ID (e.g., `merchant.com.YOUR_APP_NAME`). - **label** (string) - Optional - The label displayed to the user (default is 'Pay'). ### Request Example ```javascript await initPaymentSheet({ // Other configuration options... applePay: { merchantIdentifier: 'merchant.com.{{YOUR_APP_NAME}}', label: 'Pay', }, }); ``` ### Response No direct response, this function initializes the SDK's state. ``` -------------------------------- ### Example Client Credentials JSON Source: https://developer.sumup.com/llms-small.txt This JSON structure represents the client credentials obtained after registering an application with SumUp. It includes essential information like the client ID, client secret, and redirect URIs needed for authentication and API interactions. ```json { "id": "CCCFAXYD", "name": "My Online Store Name", "client_id": "fOcmczrYtYMJ7Li5GjMLLcUeC9dN", "client_secret": "717bd571b54297494cd7a79b491e8f2c1da6189c4cc2d3481380e8366eef539c", "application_type": "web", "redirect_uris": ["https://mywebsite.com/callback"] } ``` -------------------------------- ### Next Steps Source: https://developer.sumup.com/llms-small.txt Resources for further learning and integration. ```APIDOC ## What’s Next? Check other resources we have, such as: * [SumUp Android SDK](https://github.com/sumup/sumup-android-sdk) * Our [Postman REST API collection](https://github.com/sumup/sumup-postman) ``` -------------------------------- ### Initialize SumUp iOS SDK with Affiliate Key (Objective-C) Source: https://developer.sumup.com/llms-full.txt Initializes the SumUp iOS SDK with the given Affiliate Key. The setup should occur on the main thread and might be delayed until post-app launch due to its impact on location services. Verify `info.plist` for usage descriptions and that the Bundle Identifier is correctly configured in the SumUp developer portal. ```objc #import "SUSAppDelegate.h" #import @implementation SUSAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [SMPSumUpSDK setupWithAPIKey:@"sup_afk_abcqwerty"]; return YES; } ``` -------------------------------- ### Initialization and Mounting Source: https://developer.sumup.com/llms-small.txt Initializes and renders the payment form using the `mount` method. This method accepts a JSON object with configuration options. ```APIDOC ## POST /payment/card ### Description Initializes and renders the payment form. ### Method POST ### Endpoint /payment/card ### Parameters #### Query Parameters - **locale** (string) - Optional - Specifies the formatting of the `amount` and `currency` according to the given locale. Example: `"en-GB"` - **country** (string) - Optional - Sets the country where the user account is from. Example: `"GB"` - **googlePay** (object) - Optional - Required for accepting payments with the widget via Google Pay. Should contain `merchantId` and `merchantName`. - **merchantId** (string) - Required - A value provided by Google. - **merchantName** (string) - Required - Visible to the customer on the Google Pay payment flow. #### Request Body - **configuration** (object) - Required - JSON object with configuration options. - **checkoutId** (string) - Required - The ID of the checkout. - **email** (string) - Required - The email of the customer. - **amount** (number) - Required - The payment amount. - **currency** (string) - Required - The currency of the payment (e.g., "EUR"). - **installments** (number) - Optional - Number of installments for the payment (available only for merchants in Brazil). - **showSubmitButton** (boolean) - Optional - Whether to show the default submit button. Defaults to true. - **skipBinLookup** (boolean) - Optional - Skips the BIN lookup process. - **paymentMethodsView** (object) - Optional - Configuration for payment methods view. - **analyticsId** (string) - Optional - ID for analytics tracking. ### Request Example ```json { "configuration": { "checkoutId": "2ceffb63-cbbe-4227-87cf-0409dd191a98", "email": "customer@example.com", "amount": 100, "currency": "EUR", "installments": 3, "showSubmitButton": false } } ``` ### Response #### Success Response (200) - **submit** (function) - Method to submit the form. - **unmount** (function) - Method to destroy the card. - **update** (function) - Method to dynamically change some configurations. Accepts an object with configuration keys like `checkoutId`, `email`, `amount`, `currency`, or `installments`. #### Response Example ```json { "submit": "function() { ... }", "unmount": "function() { ... }", "update": "function(newConfig) { ... }" } ``` ``` -------------------------------- ### SumUp API Checkout Creation Response Source: https://developer.sumup.com/llms-full.txt Example of a successful 201 Created response from the SumUp API after creating a checkout resource for recurring payment setup. Includes details about the checkout and associated merchant and customer information. ```json { "amount": 100, "checkout_reference": "MYCHECKOUT", "checkout_type": "checkout", "currency": "EUR", "customer_id": "MYCUSTOMERID-123", "date": "2025-10-29T15:09:11.550+00:00", "description": "My checkout", "id": "7164c99b-13cb-42a1-8ba1-3c2c46a29de7", "merchant_code": "MDEERENR", "merchant_country": "PL", "merchant_name": "Test Account", "pay_to_email": "a8e019f9bb2f49159182e8bd61eb5ea6@developer.sumup.com", "purpose": "SETUP_RECURRING_PAYMENT", "status": "PENDING", "transactions": [] } ``` -------------------------------- ### Present Tap to Pay Activation UI (Objective-C) Source: https://developer.sumup.com/llms-full.txt Initiates the activation process for Tap to Pay on iPhone. This method presents a modal view controller to guide the merchant through the setup, linking their Apple ID to their SumUp account. It requires the `com.apple.developer.proximity-reader.payment.acceptance` entitlement and specific iOS versions. ```objc + (void)presentTapToPayActivationFromViewController:(UIViewController *)fromViewController animated:(BOOL)animated completionBlock:(nullable SMPCompletionBlock)block; ``` -------------------------------- ### Initialize SumUp iOS SDK with Affiliate Key (Swift) Source: https://developer.sumup.com/llms-full.txt Sets up the SumUp iOS SDK using the provided Affiliate Key. This function should be called on the main thread, potentially after app launch, as it initiates location updates. Ensure necessary location descriptions are in `info.plist` and the Bundle Identifier is registered. ```swift import SumUpSDK import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { SumUpSDK.setup(withAPIKey: "sup_afk_abcqwerty") return true } } ``` -------------------------------- ### Make Partial Refund using Go Source: https://developer.sumup.com/llms-small.txt This Go code example shows how to initiate a partial refund for a transaction using the SumUp client library. It requires authentication with an API key and specifies the transaction ID and the refund amount. The function handles context and client initialization. ```go ctx := context.Background() client := sumup.NewClient().WithAuth(os.Getenv("SUMUP_API_KEY")) amount := 12.24 client.Transactions.Refund(ctx, "sa", sumup.RefundTransactionBody{ Amount: &amount, }) ``` -------------------------------- ### Create Checkout Resource with Go Source: https://developer.sumup.com/llms-full.txt This Go code snippet shows how to use the SumUp Go client library to create a checkout. It initializes the client with an API key and calls the `Create` method with the necessary checkout details. ```go ctx := context.Background() client := sumup.NewClient().WithAuth(os.Getenv("SUMUP_API_KEY")) checkout, err := client.Checkouts.Create(ctx, sumup.CreateCheckoutBody{ Amount: 19, CheckoutReference: "CO746453", Currency: "EUR", MerchantCode: "MK0001", }) ``` -------------------------------- ### Installments Source: https://developer.sumup.com/llms-full.txt When using SMPProcessAsCredit, the number of installments must be obtained from the customer via your UI and assigned to the numberOfInstallments field in SMPCheckoutRequest. ```APIDOC ## Installments When `SMPProcessAsCredit` is used, you should obtain the number of installments from the customer using your own UI. Assign the positive, non-zero value to `numberOfInstallments` on `SMPCheckoutRequest`. ``` -------------------------------- ### Start SumUp MCP Server Locally (Shell) Source: https://developer.sumup.com/llms-small.txt This command initiates the SumUp Model Context Protocol (MCP) server locally. It requires an API key, which can be provided via the SUMUP_API_KEY environment variable or directly as an argument. The server enables AI agents to interact with the SumUp API and knowledge base. ```sh SUMUP_API_KEY='sup_sk_MvxmLOl0...' npx -y @sumup/mcp ``` -------------------------------- ### Basic PHP SDK Usage for Creating a Checkout Source: https://developer.sumup.com/llms-full.txt This PHP code demonstrates the basic usage of the SumUp PHP SDK to create a checkout. It initializes the SDK with your credentials and authorization code, then uses the CheckoutService to initiate a payment. Error handling for authentication and response exceptions is included. ```php try { $sumup = new \SumUp\SumUp([ 'app_id' => 'YOUR-CLIENT-ID', 'app_secret' => 'YOUR-CLIENT-SECRET', 'code' => 'YOUR-AUTHORIZATION-CODE' ]); $checkoutService = $sumup->getCheckoutService(); $checkoutResponse = $checkoutService->create($amount, $currency, $checkoutRef, $payToEmail); $checkoutId = $checkoutResponse->getBody()->id; // pass the $chekoutId to the front-end to be processed } catch (\SumUp\Exceptions\SumUpAuthenticationException $e) { echo 'Authentication error: ' . $e->getMessage(); } catch (\SumUp\Exceptions\SumUpResponseException $e) { echo 'Response error: ' . $e->getMessage(); } catch(\SumUp\Exceptions\SumUpSDKException $e) { echo 'SumUp SDK error: ' . $e->getMessage(); } ``` -------------------------------- ### Set Number of Installments for SumUp Credit Payments Source: https://developer.sumup.com/llms-small.txt Assigns a positive, non-zero value to the `numberOfInstallments` property on `SMPCheckoutRequest` when `SMPProcessAsCredit` is used. This is necessary to obtain the number of installments from the customer, typically after prompting them via your own UI. ```Objective-C // Assign the positive, non-zero value to `numberOfInstallments` on `SMPCheckoutRequest`. ``` -------------------------------- ### Install SumUp iOS SDK with Cocoapods Source: https://developer.sumup.com/llms-small.txt This snippet shows how to add the SumUp iOS SDK to your project using Cocoapods. It specifies the SDK name and version constraint. Ensure you have Cocoapods installed and configured in your project. ```ruby target '' do pod 'SumUpSDK', '~> 6.0' end ``` -------------------------------- ### Boleto Payment Artifact Example Source: https://developer.sumup.com/llms-small.txt An example of the artifact data received for a 'boleto' payment. This typically includes a barcode for payment, a URL to generate the boleto, and its validity period. The `artefacts` array may contain the PDF document for the boleto. ```JSON { "boleto": { "barcode": "23790001246004987209031123456704579990000010000", "url": "https://api.sumup.com/v0.1/checkouts/19c11c6c-be1d-4dd6-b718-2798878117cb/boletos/1044833949", "valid_until": "2022-02-01T17:57:10.442+00:00", "artefacts": [ { "name": "invoice", "content_type": "application/pdf", "location": "h" } ] } } ``` -------------------------------- ### Initialize SumUp SDK with Affiliate Key in Swift Source: https://developer.sumup.com/llms-small.txt Initializes the SumUp SDK using your Affiliate Key. This method should be called on the main thread, preferably after app launch, as it may request location permissions. Ensure your app's Bundle Identifier is registered in the SumUp developer portal. ```swift import SumUpSDK import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Setup the SumUpSDK with your Affiliate Key SumUpSDK.setup(withAPIKey: "sup_afk_abcqwerty") return true } } ``` -------------------------------- ### SumUp API Client-Side Error (4xx) Example Source: https://developer.sumup.com/llms-small.txt This JSON example illustrates a typical client-side error response (4xx) from the SumUp API. It indicates a validation failure, specifying the error message, a unique error code, and the parameter that caused the issue. ```json { "message": "Validation error", "error_code": "MISSING", "param": "merchant_code" } ``` -------------------------------- ### Present Payment Sheet Source: https://developer.sumup.com/llms-full.txt Demonstrates how to initialize and present the payment sheet, handling success and error callbacks. ```APIDOC ## Present Payment Sheet ### Description This function `presentPaymentSheet()` displays the payment interface to the user. Upon completion of a payment, it returns a callback with either success or error details. ### Method Asynchronous function call within JavaScript. ### Endpoint N/A (Client-side function) ### Parameters None directly for `presentPaymentSheet()`. ### Request Example ```javascript const showPaymentSheet = async () => { const { error } = await presentPaymentSheet(); if (error) { Alert.alert( error.status, error.status === "failure" ? error.message : undefined ); } else { Alert.alert("Payment successfully was processed"); } }; // Usage within a component: return (