quocnht / payjp-php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PAY.JP for PHP

Build Status

Requirements

PHP 5.3.3 and later.

Composer

You can install the bindings via Composer. Add this to your composer.json:

{
  "require": {
    "payjp/payjp-php": "0.0.x"
  }
}

Then install via:

composer install

To use the bindings, use Composer's autoload:

require_once 'vendor/autoload.php';

Manual Installation

If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the init.php file.

require_once '/path/to/payjp-php/init.php';

Getting Started

Simple usage looks like:

\Payjp\Payjp::setApiKey('sk_test_c62fade9d045b54cd76d7036');
$myCard = array('number' => '4242424242424242', 'exp_month' => 5, 'exp_year' => 2020);
$charge = \Payjp\Charge::create(array('card' => $myCard, 'amount' => 2000, 'currency' => 'jpy'));
echo $charge;

Documentation

Tests

In order to run tests first install PHPUnit via Composer:

composer update --dev

To run the test suite:

./vendor/bin/phpunit

About

License:MIT License


Languages

Language:PHP 100.0%