PHPackages                             sebastianwalker/paysafecard-php-api - 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. [Payment Processing](/categories/payments)
4. /
5. sebastianwalker/paysafecard-php-api

ActiveLibrary[Payment Processing](/categories/payments)

sebastianwalker/paysafecard-php-api
===================================

A PHP wrapper for the Paysafecard Payments REST API

v1.0(8y ago)4157.6k—0%3PHP

Since Aug 5Pushed 8y ago2 watchersCompare

[ Source](https://github.com/hiwye/paysafecard-php-api)[ Packagist](https://packagist.org/packages/sebastianwalker/paysafecard-php-api)[ RSS](/packages/sebastianwalker-paysafecard-php-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

paysafecard-php-api
===================

[](#paysafecard-php-api)

A PHP wrapper for the [Paysafecard](https://www.paysafecard.com) Payments REST API

Installation
------------

[](#installation)

Install the library using composer:

```
composer require sebastianwalker/paysafecard-php-api

```

Usage
-----

[](#usage)

### Initiating a payment

[](#initiating-a-payment)

```
// Set up the API Client
$client = new Client("psc_apikey_goes_here");
$client->setUrls(new Urls("http://localhost/examples/CapturePayment.php?payment_id={payment_id}"));
$client->setTestingMode(true);

// Initiate the payment
$amount = new Amount(20.00, "EUR");
$payment = new Payment($amount, "customer123");
$payment->create($client);

// Redirect to Paysafecard payment page
header("Location: ".$payment->getAuthUrl());
```

### Capturing a payment

[](#capturing-a-payment)

```
// Set up the API Client
$client = new Client("psc_apikey_goes_here");
$client->setTestingMode(true);

// Find the payment the user was redirected from
$payment = Payment::find($_GET["payment_id"], $client);

// Check if the payment was authorized
if($payment->isAuthorized()){
    // ... and capture it
    $payment->capture($client);

    if($payment->isSuccessful()){
        echo "Capture Successful!";
    }else{
        echo "Payment Failed (".$payment->getStatus().")";
    }

} else if($payment->isFailed()){
    echo "Payment Failed (".$payment->getStatus().")";

} else{
    echo "Other Status (".$payment->getStatus().")";

}
```

API
---

[](#api)

### Setup Client

[](#setup-client)

```
// Create new client object
$client = new Client([string $apiKey], [Urls $urls], [bool $testingMode]);

// Getters and setters
$client->setApiKey(string $apiKey);
$client->setUrls(Urls $urls);
$client->setTestingMode(bool $testingMode);
```

### Setup Payment

[](#setup-payment)

```
// Create new payment object
$payment = new Payment(Amount $amount, string $customerId);

// Find existing payment
$payment = Payment::find(string $id, Client $client);

// Initiate payment
$payment->create(Client $client);

// Capture payment
$payment->capture(Client $client);

// Getter and setters
$payment->setAmount(Amount $amount);
$payment->getAmount();
$payment->setCustomerId(string $customerId);
$payment->getCustomerId();
$payment->getAuthUrl(bool $testingMode);
$payment->getStatus();

// Checking for standard payment statuses
$payment->isInitiated();
$payment->isRedirected();
$payment->isCancelled();
$payment->isExpired();
$payment->isAuthorized();
$payment->isSuccessful();

// Shorthands
$payment->isFailed(); // cancelled or expired
$payment->isWaiting(); // initiated or redirected
```

### Setup Amount

[](#setup-amount)

```
// Create new amount object
$amount = new Amount(double $amount, string $currency); // e.g. (10.00, "EUR")

// Getters and setters
$amount->setAmount(double $amount);
$amount->getAmount();
$amount->setCurrency(string $currency);
$amount->getCurrency();
```

### Setup URLs

[](#setup-urls)

```
// Create new url object
$urls = new Urls(string $url); // use given URL for success + failure + notification
$urls = new Urls(string $url, string $url2); // use first URL for success + failure, second for notification
$urls = new Urls(string $url, string $url2, string $url3); // use first URL for success, second for failure, third for notification

// Getters and setters
$urls->setSuccessUrl(string $url);
$urls->getSuccessUrl();
$urls->setFailureUrl(string $url);
$urls->getFailure();
$urls->setNotificationUrl(string $url);
$urls->getNotificationUrl();
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% 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

Unknown

Total

1

Last Release

3209d ago

### Community

Maintainers

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

---

Top Contributors

[![sebwalk](https://avatars.githubusercontent.com/u/6324895?v=4)](https://github.com/sebwalk "sebwalk (5 commits)")[![Tanariel](https://avatars.githubusercontent.com/u/1983686?v=4)](https://github.com/Tanariel "Tanariel (1 commits)")

### Embed Badge

![Health badge](/badges/sebastianwalker-paysafecard-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/sebastianwalker-paysafecard-php-api/health.svg)](https://phpackages.com/packages/sebastianwalker-paysafecard-php-api)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[dnetix/redirection

Library to connect with PlacetoPay Checkout service

17123.3k2](/packages/dnetix-redirection)

PHPackages © 2026

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