### Install SumUp PHP SDK with Composer Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/README.md Use Composer, the PHP dependency manager, to install the SumUp Ecommerce PHP SDK. This command adds the SDK package to your project. ```Shell composer require sumup/sumup-ecom-php-sdk ``` -------------------------------- ### Getting Custom Service Instance in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/SumUp.md Retrieves an instance of the `\SumUp\Services\Custom` service. This method allows access to custom service functionalities within the SDK. Optionally accepts an application configuration. ```php public function getCustomService(\SumUp\Application\ApplicationConfigurationInterface $config = null): \SumUp\Services\Custom ``` -------------------------------- ### Getting Response Body (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Response.md This method returns the body of the HTTP response. The type of the returned object varies depending on the specific service call's response structure. ```php public function getBody(): mixed ``` -------------------------------- ### Retrieving Customer Information using SumUp SDK in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Customers.md The get method fetches details for a specific customer. It requires the customer ID as input and returns a Response object containing the customer's information or throws an exception if the customer is not found. ```php public function get(string $customerId): \SumUp\HttpClients\Response ``` -------------------------------- ### Getting HTTP Response Code (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Response.md This method returns the HTTP status code of the response as an integer. ```php public function getHttpResponseCode(): int ``` -------------------------------- ### Defining getPayouts Method Signature in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Payouts.md This snippet provides the method signature for the getPayouts function, which retrieves information about payouts. It accepts start and end dates, an optional limit, order preference, and format, returning a Response object or throwing an exception. ```php public function getPayouts( string $startDate, string $endDate, int $limit = 10, bool $descendingOrder = true, string $format = 'json' ): \SumUp\HttpClients\Response ``` -------------------------------- ### Getting Access Token Scopes in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/AccessToken.md This method returns an array listing the permissions or scopes that the access token is authorized for. ```php public function getScopes(): array ``` -------------------------------- ### Processing a Checkout with Tokenized Card (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Checkouts.md Processes a checkout using a tokenized card for a specific customer. Requires the checkout ID, customer ID, and card token. An optional parameter allows specifying the number of installments. Returns a \SumUp\HttpClients\Response object on success or throws an exception. ```php public function pay( string $checkoutId, string $customerId, string $cardToken, int $installments = 1 ): \SumUp\HttpClients\Response ``` -------------------------------- ### Getting Access Token Type in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/AccessToken.md This method returns the type of authentication scheme associated with the access token, such as 'Bearer'. ```php public function getType(): string ``` -------------------------------- ### Getting Access Token Value in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/AccessToken.md This method returns the raw string value of the access token that is used for authentication in API requests. ```php public function getValue(): string ``` -------------------------------- ### Defining getTransactions Method Signature in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Payouts.md This snippet provides the method signature for the getTransactions function, used to retrieve information about transactions included in payouts. It takes start and end dates, an optional limit, order preference, and format, returning a Response object or throwing an exception. ```php public function getTransactions( string $startDate, string $endDate, int $limit = 10, boo $descendingOrder = true, string $format = 'json' ): \SumUp\HttpClients\Response ``` -------------------------------- ### Getting SumUp Transaction History in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Transactions.md This method signature shows how to retrieve a list of transactions. It accepts an optional array of filters to refine the results and returns a \SumUp\HttpClients\Response object or throws an exception. ```php public function getTransactionHistory(array $filters = []): \SumUp\HttpClients\Response ``` -------------------------------- ### Getting Access Token Refresh Token in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/AccessToken.md This method returns the associated refresh token string, if one was provided during the token issuance, which can be used to obtain a new access token. ```php public function getRefreshToken(): ?string ``` -------------------------------- ### Defining SumUp Custom Service Request Method in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Custom.md Defines the `request` method of the `\SumUp\Services\Custom` class. This method sends a custom request to a SumUp API endpoint using the specified HTTP method (`GET`, `POST`, `PUT`, `DELETE`), relative path, and optional payload. It returns a response object. ```php public function request( string $method, string $relativePath, array $payload = null ): \SumUp\HttpClients\Response ``` -------------------------------- ### Getting Access Token Expiry Time in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/AccessToken.md This method returns the duration in seconds for which the access token remains valid from the time it was issued. ```php public function getExpiresIn(): int ``` -------------------------------- ### Getting SumUp Transaction Receipt in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Transactions.md This method signature shows how to retrieve receipt data for a specific transaction. It requires the transaction ID and the merchant ID, returning a \SumUp\HttpClients\Response object or throwing an exception. ```php public function getReceipt(string $transactionId, string $merchantId): \SumUp\HttpClients\Response ``` -------------------------------- ### Basic SDK Initialization Configuration in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/SumUp.md This snippet shows the basic structure for initializing the SumUpSumUp service by passing an array of configuration options. These options control authentication flow and credentials. ```php $sumup = new \SumUp\SumUp([ // 'config-name': 'config-value' ]); ``` -------------------------------- ### Initialize SDK and Create Checkout in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/SumUp.md This snippet demonstrates initializing the SumUp SDK with client credentials and an authorization code, then obtaining the CheckoutService instance to create a checkout. Includes basic exception handling for SDK errors. ```php try { $sumup = new \SumUp\SumUp([ 'app_id' => 'YOUR-CLIENT-ID', 'app_secret' => 'YOUR-CLIENT-SECRET', 'code' => 'YOUR-AUTHORIZATION-CODE' ]); } catch(\SumUp\Exceptions\SumUpSDKException $e) { echo 'SumUp SDK error: ' . $e->getMessage(); } try { $checkoutService = $sumup->getCheckoutService(); $checkoutResponse = $checkoutService->create(/* pass here the required arguments */); // use the variable $checkoutResponse } catch(\SumUp\Exceptions\SumUpSDKException $e) { echo 'SumUp SDK error: ' . $e->getMessage(); } ``` -------------------------------- ### Initializing SumUp Merchant Service in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Merchant.md This snippet demonstrates how to create a new instance of the \SumUp\Services\Merchant service. It requires an implementation of \SumUp\HttpClients\SumUpHttpClientInterface and an \SumUp\Authentication\AccessToken object as dependencies. ```php $merchantService = new \SumUp\Services\Merchant( \SumUp\HttpClients\SumUpHttpClientInterface $client, \SumUp\Authentication\AccessToken $accessToken ); ``` -------------------------------- ### Create SumUp Checkout in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/README.md Demonstrates initializing the SumUp SDK with credentials and creating a new checkout using the checkout service. Includes basic error handling for authentication, response, and SDK exceptions. ```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(); } ``` -------------------------------- ### Initializing SumUp Checkouts Service (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Checkouts.md Instantiates the \SumUp\Services\Checkouts service. Requires an implementation of \SumUp\HttpClients\SumUpHttpClientInterface and an \SumUp\Authentication\AccessToken. ```php $checkoutService = new \SumUp\Services\Checkouts( \SumUp\HttpClients\SumUpHttpClientInterface $client, \SumUp\Authentication\AccessToken $accessToken ); ``` -------------------------------- ### Initializing SumUp SDK with Authorization Code Flow (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/HowToAuthorize.md Initializes the SumUp SDK using the authorization code flow. This requires obtaining an authorization code first by sending the merchant through the SumUp authorization flow. The snippet demonstrates how to pass the necessary parameters, including the authorization code, to the SumUp class constructor and retrieve the access and refresh tokens. ```php $sumup = new \SumUp\SumUp([ 'app_id' => 'YOUR-CLIENT-ID', 'app_secret' => 'YOUR-CLIENT-SECRET', 'grant_type' => 'authorization_code', 'scopes' => ['payments', 'transactions.history', 'user.app-settings', 'user.profile_readonly'], 'code' => 'YOUR-AUTHORIZATION-CODE' ]); $accessToken = $sumup->getAccessToken(); $refreshToken = $accessToken->getRefreshToken(); $value = $accessToken->getValue(); ``` -------------------------------- ### Reusing Existing Access Token (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/HowToAuthorize.md Shows how to initialize the SumUp SDK by providing an already valid access token. This is useful if you have stored a valid token and want to reuse it without performing a full authorization or refresh flow. ```php $sumup = new \SumUp\SumUp([ 'app_id' => 'YOUR-CLIENT-ID', 'app_secret' => 'YOUR-CLIENT-SECRET', 'scopes' => ['payments', 'transactions.history', 'user.app-settings', 'user.profile_readonly'], 'access_token' => 'VALID-ACCESS-TOKEN' ]); ``` -------------------------------- ### Initializing SumUp Transactions Service in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Transactions.md This snippet demonstrates how to create a new instance of the \SumUp\Services\Transactions service. It requires an implementation of \SumUp\HttpClients\SumUpHttpClientInterface and an \SumUp\Authentication\AccessToken object as dependencies. ```php $transactionService = new \SumUp\Services\Transactions( \SumUp\HttpClients\SumUpHttpClientInterface $client, \SumUp\Authentication\AccessToken $accessToken ); ``` -------------------------------- ### Overriding Access Token for a Specific Service (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/HowToAuthorize.md Illustrates how to initialize a specific service instance (like the Checkout Service) with an access token that is different from the one associated with the main SumUp SDK instance. ```php $checkoutService = $sumup->getCheckoutService('ACCESS-TOKEN-INSTANCE'); ``` -------------------------------- ### Refreshing Access Token with Refresh Token (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/HowToAuthorize.md Demonstrates how to obtain a new access token using a previously acquired refresh token. The refresh token is passed during the SDK initialization, and the `refreshToken()` method is called to perform the token refresh operation. ```php $sumup = new \SumUp\SumUp([ 'app_id' => 'YOUR-CLIENT-ID', 'app_secret' => 'YOUR-CLIENT-SECRET', 'scopes' => ['payments', 'transactions.history', 'user.app-settings', 'user.profile_readonly'], 'refresh_token' => 'REFRESH-TOKEN' ]); // you need to call the method `refreshToken()` to get a new access token $refreshedAccessToken = $sumup->refreshToken(); $value = $refreshedAccessToken->getValue(); ``` -------------------------------- ### Creating a Checkout with SumUp (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Checkouts.md Creates a new checkout. Requires amount, currency, a unique checkout reference ID, and the email to pay to. Optional parameters include description, pay-from email, and return URL. Returns a \SumUp\HttpClients\Response object on success or throws an exception. ```php public function create( float $amount, string $currency, string $checkoutRef, string $payToEmail, string $description = '', string $payFromEmail = null, string $returnURL = null ): \SumUp\HttpClients\Response ``` -------------------------------- ### Initializing SumUp SDK with Client Credentials Flow (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/HowToAuthorize.md Initializes the SumUp SDK using the client credentials flow. This flow uses only the client ID and client secret. Note that access tokens obtained via this flow may not be valid for all API endpoints. ```php $sumup = new \SumUp\SumUp([ 'app_id' => 'YOUR-CLIENT-ID', 'app_secret' => 'YOUR-CLIENT-SECRET', 'grant_type' => 'client_credentials', 'scopes' => ['payments', 'transactions.history', 'user.app-settings', 'user.profile_readonly'] ]); $accessToken = $sumup->getAccessToken(); $value = $accessToken->getValue(); ``` -------------------------------- ### Instantiating SumUp Authorization Service (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Authorization.md This snippet shows how to create an instance of the `\SumUp\Services\Authorization` class, which is used to manage access tokens for the SumUp API. It requires an implementation of `\SumUp\HttpClients\SumUpHttpClientInterface` and an `\SumUp\Application\ApplicationConfiguration` object as dependencies. ```php $authService = new \SumUp\Services\Authorization( \SumUp\HttpClients\SumUpHttpClientInterface $client, \SumUp\Application\ApplicationConfiguration $configuration ); ``` -------------------------------- ### Instantiating the Customers Service in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Customers.md This snippet shows how to create a new instance of the SumUpServicesCustomers class, which requires a SumUp HTTP client interface implementation and an AccessToken object for authentication. ```php $customerService = new \SumUp\Services\Customers( \SumUp\HttpClients\SumUpHttpClientInterface $client, \SumUp\Authentication\AccessToken $accessToken ); ``` -------------------------------- ### Instantiating SumUp Payouts Service in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Payouts.md This snippet shows how to create a new instance of the SumUpServicesPayouts service, which requires a SumUp HTTP client implementing SumUpHttpClientInterface and an AccessToken object. ```php $payoutService = new \SumUp\Services\Payouts( \SumUp\HttpClients\SumUpHttpClientInterface $client, \SumUp\Authentication\AccessToken $accessToken ); ``` -------------------------------- ### Creating a Customer using SumUp SDK in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Customers.md The create method is used to register a new customer. It requires a unique customer ID and optionally accepts arrays for customer details and address information. It returns a Response object upon success or throws an exception. ```php public function create( string $customerId, array $customerDetails = [], array $customerAddress = [] ): \SumUp\HttpClients\Response ``` -------------------------------- ### Initializing SumUp Custom Service in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Custom.md Initializes the `\SumUp\Services\Custom` service instance. This service allows interaction with SumUp API endpoints not directly supported by the SDK. It requires a SumUp HTTP client instance and an access token. ```php $customService = new \SumUp\Services\Custom( \SumUp\HttpClients\SumUpHttpClientInterface $client, \SumUp\Authentication\AccessToken $accessToken ); ``` -------------------------------- ### Handling SumUp SDK Exceptions in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/ExceptionsHandling.md This snippet demonstrates how to use a try-catch block to handle specific exceptions that may be thrown by the SumUp PHP SDK, such as authentication, response, or general SDK errors. It shows how to catch different exception types and access their code and message properties. ```php try { $sumup = new \SumUp\SumUp($config); } catch (\SumUp\Exceptions\SumUpAuthenticationException $e) { echo $e->getCode() . ': ' . $e->getMessage(); } catch (\SumUp\Exceptions\SumUpResponseException $e) { echo $e->getCode() . ': ' . $e->getMessage(); } catch (\SumUp\Exceptions\SumUpSDKException $e) { echo $e->getCode() . ': ' . $e->getMessage(); } ``` -------------------------------- ### SumUp Authorization getToken Method Signature (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Authorization.md Signature for the `getToken` method of the `\SumUp\Services\Authorization` class. This method attempts to return an access token based on the initial configuration or throws an exception if unsuccessful. ```php public function getToken(): \SumUp\Authentication\AccessToken ``` -------------------------------- ### Updating Customer Information using SumUp SDK in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Customers.md This method allows updating existing customer information. It requires the customer ID and accepts optional arrays for updated details and address. It returns a Response object or throws an exception. ```php public function update( string $customerId, array $customerDetails = [], array $customerAddress = [] ): \SumUp\HttpClients\Response ``` -------------------------------- ### Defining getDoingBusinessAs Method in SumUp PHP Merchant Service Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Merchant.md This is the method signature for the getDoingBusinessAs method in the \SumUp\Services\Merchant class. It is used to retrieve the merchant's doing-business-as profile and returns a \SumUp\HttpClients\Response object upon success or throws an exception on failure. ```php public function getDoingBusinessAs(): \SumUp\HttpClients\Response ``` -------------------------------- ### Retrieving Access Token in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns the current access token string. The access token is used to authenticate subsequent API requests and may return null if not yet obtained. ```php public function getAccessToken(): ?string ``` -------------------------------- ### Retrieving Customer Payment Instruments using SumUp SDK in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Customers.md This method retrieves the payment instruments associated with a particular customer. It requires the customer ID and returns a Response object containing the list of payment instruments or throws an exception. ```php public function getPaymentInstruments(string $customerId): \SumUp\HttpClients\Response ``` -------------------------------- ### Retrieving App ID in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns the configured application identifier as a string. The app ID is a required configuration parameter for interacting with the SumUp API. ```php public function getAppId(): string ``` -------------------------------- ### Retrieving Formatted Scopes in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns a string containing the authorization scopes formatted for use in API requests, typically space-separated. ```php public function getFormattedScopes(): string ``` -------------------------------- ### Retrieving Scopes in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns an array of strings representing the requested authorization scopes. Scopes define the permissions granted to the application. ```php public function getScopes(): array ``` -------------------------------- ### Refunding SumUp Transaction in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Transactions.md This method signature shows how to process a refund for a transaction, either fully or partially. It requires the transaction ID and an optional amount for partial refunds, returning a \SumUp\HttpClients\Response or throwing an exception. ```php public function refund(string $transactionId, float $amount = null): \SumUp\HttpClients\Response ``` -------------------------------- ### Defining updateDoingBusinessAs Method in SumUp PHP Merchant Service Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Merchant.md This is the method signature for the updateDoingBusinessAs method in the \SumUp\Services\Merchant class. It accepts an array of data to update the merchant's doing-business-as profile and returns a \SumUp\HttpClients\Response object upon success or throws an exception on failure. ```php public function updateDoingBusinessAs(array $data): \SumUp\HttpClients\Response ``` -------------------------------- ### Retrieving Authorization Code in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns the authorization code string, which is required for obtaining an access token using the `authorization_code` grant type. It may return null if not set. ```php public function getCode(): ?string ``` -------------------------------- ### SumUp Authorization getTokenByClientCredentials Method Signature (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Authorization.md Signature for the `getTokenByClientCredentials` method of the `\SumUp\Services\Authorization` class. This method obtains an access token using the client credentials grant type, returning an `AccessToken` object or throwing an exception. ```php public function getTokenByClientCredentials(): \SumUp\Authentication\AccessToken ``` -------------------------------- ### SumUp Authorization refreshToken Method Signature (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Authorization.md Signature for the `refreshToken` method of the `\SumUp\Services\Authorization` class. This method uses a provided refresh token to obtain a new access token, returning an `AccessToken` object or throwing an exception. ```php public function refreshToken($refreshToken): \SumUp\Authentication\AccessToken ``` -------------------------------- ### Finding SumUp Transaction by Transaction Code in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Transactions.md This method signature shows how to find a transaction using its transaction code. It returns a \SumUp\HttpClients\Response object upon success or throws an exception on failure. ```php public function findByTransactionCode(string $transactionCode): \SumUp\HttpClients\Response ``` -------------------------------- ### SumUp Authorization getTokenByPassword Method Signature (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Authorization.md Signature for the `getTokenByPassword` method of the `\SumUp\Services\Authorization` class. This method obtains an access token using the password grant type, returning an `AccessToken` object or throwing an exception. ```php public function getTokenByPassword(): \SumUp\Authentication\AccessToken ``` -------------------------------- ### Retrieving Refresh Token in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns the refresh token string, which can be used to obtain a new access token when the current one expires. It may return null if not available. ```php public function getRefreshToken(): ?string ``` -------------------------------- ### Finding a Checkout by ID with SumUp (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Checkouts.md Searches for a checkout using its unique ID. Returns a \SumUp\HttpClients\Response object containing the checkout details on success or throws an exception if not found or an error occurs. ```php public function findById(string $checkoutId): \SumUp\HttpClients\Response ``` -------------------------------- ### SumUp Authorization getTokenByCode Method Signature (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Authorization.md Signature for the `getTokenByCode` method of the `\SumUp\Services\Authorization` class. This method is used to obtain an access token using the authorization code grant type, returning an `AccessToken` object or throwing an exception. ```php public function getTokenByCode(): \SumUp\Authentication\AccessToken ``` -------------------------------- ### Retrieving Password for Password Grant in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns the password string required for authorization using the `password` grant type. It may return null if a different grant type is used. ```php public function getPassword(): ?string ``` -------------------------------- ### Finding a Checkout by Reference ID with SumUp (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Checkouts.md Searches for a checkout using its unique checkout reference ID (checkout_reference_id). Returns a \SumUp\HttpClients\Response object containing the checkout details on success or throws an exception. ```php public function findByReferenceId(string $referenceId): \SumUp\HttpClients\Response ``` -------------------------------- ### Defining updateProfile Method in SumUp PHP Merchant Service Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Merchant.md This is the method signature for the updateProfile method in the \SumUp\Services\Merchant class. It accepts an array of data to update the merchant's profile and returns a \SumUp\HttpClients\Response object upon success or throws an exception on failure. ```php public function updateProfile(array $data): \SumUp\HttpClients\Response ``` -------------------------------- ### Defining getProfile Method in SumUp PHP Merchant Service Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Merchant.md This is the method signature for the getProfile method in the \SumUp\Services\Merchant class. It is used to retrieve the merchant's profile information and returns a \SumUp\HttpClients\Response object upon success or throws an exception on failure. ```php public function getProfile(): \SumUp\HttpClients\Response ``` -------------------------------- ### Checking Guzzle Usage Preference in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns a boolean value indicating whether the SDK is configured to force the use of GuzzleHttp instead of the default cURL for making HTTP requests. ```php public function getForceGuzzle(): bool ``` -------------------------------- ### Retrieving App Secret in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns the configured application secret as a string. The app secret is a sensitive credential used for authentication with the SumUp API. ```php public function getAppSecret(): string ``` -------------------------------- ### Retrieving Grant Type in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns a string indicating the OAuth 2.0 grant type being used for authorization. Possible values include `authorization_code`, `client_credentials`, or `password`. ```php public function getGrantType(): string ``` -------------------------------- ### Retrieving Username for Password Grant in SumUp PHP SDK Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/ApplicationConfiguration.md This method returns the username string required for authorization using the `password` grant type. It may return null if a different grant type is used. ```php public function getUsername(): ?string ``` -------------------------------- ### Finding SumUp Transaction by Internal ID in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Transactions.md This method signature shows how to find a transaction using its internal ID. It returns a \SumUp\HttpClients\Response object upon success or throws an exception on failure. ```php public function findByInternalId(string $internalId): \SumUp\HttpClients\Response ``` -------------------------------- ### Finding SumUp Transaction by ID in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Transactions.md This method signature shows how to find a specific transaction using its unique transaction ID. It returns a \SumUp\HttpClients\Response object upon success or throws an exception on failure. ```php public function findById(string $transactionId): \SumUp\HttpClients\Response ``` -------------------------------- ### Finding SumUp Transaction by Foreign ID in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Transactions.md This method signature shows how to find a transaction using its foreign transaction ID. It returns a \SumUp\HttpClients\Response object upon success or throws an exception on failure. ```php public function findByForeignId(string $foreignId): \SumUp\HttpClients\Response ``` -------------------------------- ### Deactivating Customer Payment Instrument using SumUp SDK in PHP Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Customers.md The deletePaymentInstruments method is used to deactivate a specific payment instrument for a customer. It requires both the customer ID and the card token of the instrument to be deactivated. It returns a Response object or throws an exception. ```php public function deletePaymentInstruments( string $customerId, string $cardToken ): \SumUp\HttpClients\Response ``` -------------------------------- ### Deactivating a Checkout with SumUp (PHP) Source: https://github.com/sumup/sumup-ecom-php-sdk/blob/master/docs/reference/Checkouts.md Deactivates a checkout identified by its unique ID. This effectively cancels the checkout. Returns a \SumUp\HttpClients\Response object on success or throws an exception. ```php public function delete(string $checkoutId): \SumUp\HttpClients\Response ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.