2017 © Pedro Peláez
 

library alternativepayments

Official PHP SDK for Alternative Payments API

image

alternativepayments/alternativepayments

Official PHP SDK for Alternative Payments API

  • Friday, May 11, 2018
  • by alternativepayments
  • Repository
  • 2 Watchers
  • 0 Stars
  • 3,288 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 4 % Grown

The README.md

PHP SDK for Alternative Payments RESTful API

Installation

Requirements

PHP 5.3.3 and later. cURL extension., (*1)

Developer Documentation

Official Alternative Payments RESTful API Reference, (*2)

Composer

It's recommended to use composer or you can download the latest release., (*3)

composer require alternativepayments/alternativepayments

Usage

To load the Alternative Payments PHP SDK you have to include autoloader:, (*4)

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

To use Alternative Payments PHP SDK you need to setup your secret integration key:, (*5)

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

SEPA transaction request example:, (*6)

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

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

$customer = new \AlternativePayments\Model\Customer();
$customer->setEmail("john.doe@example.com");
$customer->setCountry("BE");
$customer->setFirstName("John");
$customer->setLastName("Doe");
$payment = new \AlternativePayments\Model\Payment();
$payment->setPaymentOption("SEPA");
$payment->setHolder("John Doe");
$payment->setIBAN("BE88271080782541");
$transaction = new \AlternativePayments\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 = \AlternativePayments\Transaction :: post($transaction);

For more examples check samples folder., (*7)

License

Read License for more licensing information., (*8)

The Versions

11/05 2018

dev-master

9999999-dev http://www.alternativepayments.com

Official PHP SDK for Alternative Payments API

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-curl *

 

27/09 2017

v1.0.3

1.0.3.0 http://www.alternativepayments.com

Official PHP SDK for Alternative Payments API

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-curl *

 

01/09 2016

v1.0.1

1.0.1.0 http://www.alternativepayments.com

Official PHP SDK for Alternative Payments API

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-curl *

 

05/07 2016

v1.0.0

1.0.0.0 http://www.alternativepayments.com

Official PHP SDK for Alternative Payments API

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-curl *