PHPackages                             alexcode/sumup-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. alexcode/sumup-php

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

alexcode/sumup-php
==================

SumUp PHP Library

v0.0.5(8y ago)121.4k8[1 issues](https://github.com/alexcode/sumup-php/issues)1MITPHPPHP &gt;=5.6.0

Since Feb 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/alexcode/sumup-php)[ Packagist](https://packagist.org/packages/alexcode/sumup-php)[ RSS](/packages/alexcode-sumup-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (4)Used By (1)

SumUp PHP SDK
=============

[](#sumup-php-sdk)

[![Build Status](https://camo.githubusercontent.com/c325041dedb3b6766128b4febce0b853146ce6cef7ecddd1abb65f0b10138be2/68747470733a2f2f7472617669732d63692e6f72672f616c6578636f64652f73756d75702d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alexcode/sumup-php)[![Latest Stable Version](https://camo.githubusercontent.com/143ee2ce008214ab50c4fbb8635119bbe7693dde25608f0855da1c5a9559242b/68747470733a2f2f706f7365722e707567782e6f72672f616c6578636f64652f73756d75702d7068702f762f737461626c65)](https://packagist.org/packages/alexcode/sumup-php)[![Total Downloads](https://camo.githubusercontent.com/b651f80b36008c8d1f466ea2f5496382706f4a874aedc820bb1740dffbfa9800/68747470733a2f2f706f7365722e707567782e6f72672f616c6578636f64652f73756d75702d7068702f646f776e6c6f616473)](https://packagist.org/packages/alexcode/sumup-php)[![Latest Unstable Version](https://camo.githubusercontent.com/3b29cca4e7c6ef52bcbfc56e2108ca64ae25f1b6dd3c03ee503c4d7caaeebaaf/68747470733a2f2f706f7365722e707567782e6f72672f616c6578636f64652f73756d75702d7068702f762f756e737461626c65)](https://packagist.org/packages/alexcode/sumup-php)[![License](https://camo.githubusercontent.com/092046686970583dda92a974b7646d20fd5cc732e23d986da14e4e387c787e01/68747470733a2f2f706f7365722e707567782e6f72672f616c6578636f64652f73756d75702d7068702f6c6963656e7365)](https://packagist.org/packages/alexcode/sumup-php)

**This repo is archived, please use the [official Sumup PHP SDK](https://github.com/sumup/sumup-ecom-php-sdk).**

Requirements
------------

[](#requirements)

PHP 5.6 and later.

Composer
--------

[](#composer)

You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:

```
composer require alexcode/sumup-php
```

Basic Usage
-----------

[](#basic-usage)

Setup your credentials

```
Sumup\Sumup::setClientSecret('MY_CLIENT_SECRET');
Sumup\Sumup::setClientId('MY_CLIENT_ID');
Sumup\Sumup::setRedirectUri('MY_OAUTH_REDIRECT');
```

### OAuth

[](#oauth)

> As a merchant, you will need to Authorize your app to make requests on your behalf with OAuth

#### Authorization Code Grant

[](#authorization-code-grant)

Get the authorize Url to redirect your merchant to.

SumUp doc [Authorization Code Grant](http://docs.sumup.com/oauth/#header-authorization-code-grant)

```
Sumup\OAuth::authorizeUrl(['scope' => 'payments']);
// https://api.sumup.com/authorize?scope=payments&client_id=MY_CLIENT_ID&redirect_uri=MY_OAUTH_REDIRECT&response_type=code
```

Upon accepting the dialog, the merchant browser will hit your redirect URI with the code in the GET parameter (ex: http://MY\_OAUTH\_REDIRECT/?code=246d97b0b730c61f5929drfb3a444948fd54c058d0416019)

Therefore, you can create an Access Token to act on behalf of your Merchant.

#### Get Access Token

[](#get-access-token)

```
$access_token = Sumup\OAuth::getToken([
  'grant_type' => 'authorization_code',
  'code' => '246d97b0b730c61f5929drfb3a444948fd54c058d0416019'
]);
```

#### Refresh Access Token

[](#refresh-access-token)

SumUp doc [Refresh Tokens](http://docs.sumup.com/oauth/#header-refresh-tokens)

```
$refreshed = Sumup\OAuth::refreshToken($access_token);
```

Checkout
--------

[](#checkout)

### Create the checkout server-side

[](#create-the-checkout-server-side)

SumUp doc [Create checkout API](http://docs.sumup.com/rest-api/checkouts-api/#checkouts-create-checkout-post)

```
$checkout = Sumup\Checkout::create([
  'amount' => 20,
  'currency' => 'EUR',
  'checkout_reference' => 'MY_REF',
  'pay_to_email' => 'MY_CUSTOMER_EMAIL',
]);

echo $checkout->getCompleteUrl();
// https://api.sumup.com/v0.1/checkouts/123456
```

### Complete the checkout client-side

[](#complete-the-checkout-client-side)

Use the URL to complete the payment in the client browser. Therefore, no PCI data is ever hitting your server.

SumUp doc [Complete checkout API](http://docs.sumup.com/rest-api/checkouts-api/#checkouts-complete-checkout)

```
PUT https://api.sumup.com/v0.1/checkouts/123456

body:
{
  "payment_type": "card",
  "card": {
    "name": "...",
    "number": "...",
    "expiry_year": "...",
    "expiry_month": "...",
    "cvv": "..."
  }
}
```

Note that a checkout can be completed in a browser only from a domain that is present in your OAuth setup as an authorized javascript origin(s).

List of currently implemented SumUp API
---------------------------------------

[](#list-of-currently-implemented-sumup-api)

#### Checkouts API

[](#checkouts-api)

- Create checkout
- Complete checkout
- Create customer
- Get payment instruments
- Create payment instrument
- Disable payment instrument

#### Transactions API

[](#transactions-api)

- Transaction history
- Transaction details
- Refund transaction
- Receipt data

#### Accounts API

[](#accounts-api)

- Get account
- Get personal profile
- Create personal profile
- Get merchant profile
- Create merchant profile
- Get DBA
- Edit DBA
- Get Bank Accounts
- Create Bank Accounts
- Payouts Get settings
- Payouts Edit settings

###### Accounts API Employee

[](#accounts-api-employee)

- Create Employee
- Get Employees
- Change employee credentials

###### Accounts API Shelf

[](#accounts-api-shelf)

- Get shelves
- Create shelf
- Create shelf
- Edit shelf
- Delete shelf

###### Accounts API Product

[](#accounts-api-product)

- Get products
- Create product
- Get product
- Edit product
- Delete product
- Get product prices
- Create product price
- Get product price
- Edit product price
- Delete product price

###### Accounts API Application Settings

[](#accounts-api-application-settings)

- Application Get settings
- Application Edit settings

Credits
-------

[](#credits)

This Library is loosely inspired from [Stripe PHP](https://github.com/stripe/stripe-php)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~31 days

Total

3

Last Release

2940d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a014ad260a463805d9d5834640acedf51e5e9974b7eb48aa74d34f83f587bfb4?d=identicon)[alexcode](/maintainers/alexcode)

---

Top Contributors

[![alexcode](https://avatars.githubusercontent.com/u/430031?v=4)](https://github.com/alexcode "alexcode (18 commits)")[![luizvaz](https://avatars.githubusercontent.com/u/691612?v=4)](https://github.com/luizvaz "luizvaz (2 commits)")

---

Tags

paymentsdksumuprestsumup

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/alexcode-sumup-php/health.svg)

```
[![Health](https://phpackages.com/badges/alexcode-sumup-php/health.svg)](https://phpackages.com/packages/alexcode-sumup-php)
```

###  Alternatives

[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.3M14](/packages/xeroapi-xero-php-oauth2)[cybercog/youtrack-rest-php

YouTrack REST API PHP Client.

37149.2k3](/packages/cybercog-youtrack-rest-php)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client

Documentation for all of Ory Hydra's APIs.

17435.9k](/packages/ory-hydra-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
