PHPackages                             paymentspring/paymentspring-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. [API Development](/categories/api)
4. /
5. paymentspring/paymentspring-php

AbandonedArchivedPackage[API Development](/categories/api)

paymentspring/paymentspring-php
===============================

PHP library for the PaymentSpring API

v1.0.3(7y ago)9169.4k↓49.6%2GPL-2.0PHPPHP &gt;=5.4

Since Apr 12Pushed 7y agoCompare

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

READMEChangelog (4)DependenciesVersions (5)Used By (0)

PaymentSpring PHP Library
=========================

[](#paymentspring-php-library)

Description
-----------

[](#description)

[PaymentSpring](https://www.paymentspring.com/) is the easiest way to accept payments online, powered by an API designed for developers. This is the official PHP library for the PaymentSpring API.

PaymentSpring API keys are required. [Sign up for a free sandbox account](https://www.paymentspring.com/signup) to get your API keys.

Usage examples can be found in the `index.php` file. You can add your own API keys in that file to test things out. To see all of the available endpoints and parameters, [check out the API docs](https://paymentspring.com/developers).

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

[](#installation)

The easiest way to user this library is with composer.

Or, you can clone this repository. You must require the `init.php` file wherever you're going to use the this library. This is not required if you're using composer.

Usage
-----

[](#usage)

### Set Your API Keys

[](#set-your-api-keys)

```
  // Replace these with your actual keys.
  \PaymentSpring\PaymentSpring::setApiKeys(YOUR_PUBLIC_KEY, YOUR_PRIVATE_KEY);
```

---

### Customers

[](#customers)

#### List Customers

[](#list-customers)

This takes no arguments.

```
	\PaymentSpring\Customer::listCustomers();
```

#### Get a Single Customer

[](#get-a-single-customer)

**Customer ID** integer

```
	\PaymentSpring\Customer::getCustomer($customerID);
```

#### Create a Customer

[](#create-a-customer)

**Customer Parameters** array

```
	\PaymentSpring\Customer::createCustomer($customerDetails);
```

---

### Plans

[](#plans)

#### List Plans

[](#list-plans)

This takes no arguments.

```
	\PaymentSpring\Plan::listPlans();
```

#### Subscribe Customer to Plan

[](#subscribe-customer-to-plan)

**Plan ID** integer
**Customer ID** integer
**Additional Parameters** array *optional*

```
	\PaymentSpring\Plan::subscribeCustomer($planID, $customerID, $options);
```

#### Create and Subscribe Customer

[](#create-and-subscribe-customer)

For when you have a new customer and want to subscribe them to a plan at the same time.

**Customer Details** array
**Plan ID** integer
**Additional Parameters** array *optional*

```
	\PaymentSpring\Plan::createAndSubscribeCustomer(
		$planID,
		$customerID,
		$options
	);
```

---

### Charges

[](#charges)

#### Charge Card

[](#charge-card)

**Charge Details/Parameters** array
**Amount in Cents** integer *(not required if included in parameters)*

```
	$amountInCents = 2500;
	$chargeDetails = array(
		"card_number" => "4111111111111111",
		"card_exp_month" => "01",
		"card_exp_year" => "19",
		"csc" => "123"
	);
	\PaymentSpring\Charge::chargeCard($chargeDetails, $amountInCents);
```

#### Charge Customer

[](#charge-customer)

**Customer ID** integer
**Amount in Cents** integer **Other Parameters** array *(optional)*

```
	\PaymentSpring\Charge::chargeCustomer(
		$customerID,
		$amountInCents,
		$options
	);
```

#### Charge Token

[](#charge-token)

*Note: This library doesn't currently have a built in way of creating or fetching tokens. You could, however, use the `makeRequest` function*

**PaymentSpring Token** string
**Amount in Cents** integer
**Other Parameters** array *(optional)*

```
	\PaymentSpring\Charge::chargeToken($token, $amountInCents, $options);
```

---

### Custom requests

[](#custom-requests)

For any requests that are not yet included in this library, you can make custom requests. To see all of the available endpoints and parameters, [check out the API docs](https://paymentspring.com/developers).

This takes 2-3 arguments.

**Path to request** string
**Parameters** array
**Is POST?** boolean, default false/GET

```
	\PaymentSpring\PaymentSpring::makeRequest(
		"/receipts/templates",
		array(
			  "receipt_text" => "Test template text [Amount]",
			  "name" => "Basic Template",
            "subject" => "thanks for the payment"
       ),
		true
	);
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 78.1% 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 ~172 days

Total

4

Last Release

2897d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1738098?v=4)[Nelnet Payment Services](/maintainers/paymentspring)[@paymentspring](https://github.com/paymentspring)

---

Top Contributors

[![getlunchtray](https://avatars.githubusercontent.com/u/17100440?v=4)](https://github.com/getlunchtray "getlunchtray (25 commits)")[![heathroehr](https://avatars.githubusercontent.com/u/5472253?v=4)](https://github.com/heathroehr "heathroehr (5 commits)")[![andrewek](https://avatars.githubusercontent.com/u/714518?v=4)](https://github.com/andrewek "andrewek (2 commits)")

---

Tags

apipaymentspaymentspring

### Embed Badge

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

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

###  Alternatives

[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60316.6M98](/packages/mollie-mollie-api-php)[transbank/transbank-sdk

Transbank SDK

62698.1k15](/packages/transbank-transbank-sdk)[openbuildings/paypal

PayPal SDK for ExpressCheckout and AdaptivePayments. Supports recurring payments, simple payments, parallel payments and chained payments.

31176.5k](/packages/openbuildings-paypal)[maksekeskus/maksekeskus-php

Maksekeskus PHP SDK

13208.2k](/packages/maksekeskus-maksekeskus-php)

PHPackages © 2026

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