PHP SDK for 2000charge API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Lib/AlternativePayments
samples
tests
.gitignore
LICENSE
README.md
composer.json

README.md

PHP SDK for 2000Charge RESTful API

Installation

Requirements

PHP 5.3.3 and later. cURL extension.

Developer Documentation

Official 2000Charge RESTful API Reference

Composer

It's recommended to use composer or you can download the latest release.

composer require 2000charge/2000charge

Usage

To load the 2000Charge PHP SDK you have to include autoloader:

require_once '/path/to/your-project/vendor/autoload.php';

To use 2000Charge PHP SDK you need to setup your secret integration key:

use AP\Config;
Config :: setApiKey("sk_test_rHErfsdjgfk9.....lFbfdsgh3mv0M");

SEPA transaction request example:

require_once '../vendor/autoload.php';

use AP\Config;
Config :: setApiKey("sk_test_rHErfsdjgfk9.....lFbfdsgh3mv0M");

$customer = new \AP\Model\Customer();
$customer->setEmail("john.doe@example.com");
$customer->setCountry("BE");
$customer->setFirstName("John");
$customer->setLastName("Doe");
$payment = new \AP\Model\Payment();
$payment->setPaymentOption("SEPA");
$payment->setHolder("John Doe");
$payment->setIBAN("BE88271080782541");
$transaction = new \AP\Model\Transaction();
$transaction->setCustomer($customer);
$transaction->setPayment($payment);
$transaction->setAmount(4500);
$transaction->setCurrency("EUR");
$transaction->setDescription("test sepa php sdk");
$transaction->setMerchantPassThruData("test_sepa_123");
$transaction->setIPAddress("127.0.0.1");
$res = \AP\Transaction :: post($transaction);

For more examples check samples folder.

License

Read License for more licensing information.