Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sumup Ecom Php Sdk Laravel Package

sumup/sumup-ecom-php-sdk

View on GitHub
Deep Wiki
Context7

SumUp service for the SumUp Ecommerce SDK for PHP

\SumUp\SumUp

The \SumUp\SumUp service is the main entry point for the SDK. From it you can get an instance to every other service (this is the recommended way of using it).

Every time when an instance of \SumUp\SumUp is created a call to SumUp's servers is made to acquire an access token. If don't need this you can pass configuration with an existing access token or a refresh token.

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();
}

Configurations

$sumup = new \SumUp\SumUp([
//  'config-name': 'config-value'
]);
Name Description Value Default value Required
app_id This is the client id that you receive after you register your application in SumUp string No default value Yes
app_secret This is the client secret that corresponds to the client id string No default value Yes
grant_type This indicates which authorization flow should be used to acquire OAuth token One of: authorization_code, client_credentials, password 'authorization_code' No
scopes This is an array with all the authorization scopes that you need for your application array with possible values: payments, transactions.history, user.app-settings, user.profile_readonly, user.profile, user.subaccounts, user.payout-settings, balance, products ['payments', 'transactions.history', 'user.app-settings', 'user.profile_readonly'] No
code This is the code returned at the last step from authorization code flow string null Conditional (required only if grant_type => 'authorization_code')
username This is your SumUp's username if you want to use password authorization flow string null Conditional (required only if grant_type => 'password')
password This is your SumUp's password if you want to use password authorization flow string null Conditional (required only if grant_type => 'password')
access_token This is the value of a valid access token that is acquired through other methods. It is used if you don't want to request new access token string null No
refresh_token This is the refresh token through which can be requested new access token string null No
use_guzzlehttp_over_curl This is a configuration whether to use GuzzleHttp if both GuzzleHttp library and cURL module are installed. bool false No

Instance Methods

getAccessToken()

public function getAccessToken(): \SumUp\Authentication\AccessToken

Returns a \SumUp\Authentication\AccessToken object.

refreshToken()

public function refreshToken(string $refreshToken = null): \SumUp\Authentication\AccessToken

Returns a \SumUp\Authentication\AccessToken or throws an exception.

getAuthorizationService()

public function getAuthorizationService(\SumUp\Application\ApplicationConfigurationInterface $config = null): \SumUp\Services\Authorization

Returns an instance of \SumUp\Services\Authorization.

getCheckoutService()

public function getCheckoutService(\SumUp\Application\ApplicationConfigurationInterface $config = null): \SumUp\Services\Checkouts

Returns an instance of \SumUp\Services\Checkouts.

getCustomerService()

public function getCustomerService(\SumUp\Application\ApplicationConfigurationInterface $config = null): \SumUp\Services\Customers

Returns an instance of \SumUp\Services\Customers.

getTransactionService()

public function getTransactionService(\SumUp\Application\ApplicationConfigurationInterface $config = null): \SumUp\Services\Transactions

Returns an instance of \SumUp\Services\Transactions.

getMerchantService()

public function getMerchantService(\SumUp\Application\ApplicationConfigurationInterface $config = null): \SumUp\Services\Merchant

Returns an instance of \SumUp\Services\Merchant.

getPayoutService()

public function getPayoutService(\SumUp\Application\ApplicationConfigurationInterface $config = null): \SumUp\Services\Payouts

Returns an instance of \SumUp\Services\Payouts.

getCustomService()

public function getCustomService(\SumUp\Application\ApplicationConfigurationInterface $config = null): \SumUp\Services\Custom

Returns an instance of \SumUp\Services\Custom.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo