Omnipay: Webpay
webpay.jp payment processing driver for the Omnipay PHP payment processing library, (*1)
Important note: at the moment, only the '$gateway->authorize()' is implemented.., (*2)
, (*3)
Omnipay is a framework agnostic, multi-gateway payment
processing library for PHP 5.3+. This package implements Webpay support for Omnipay. Please see the Webpay main site (Japanese) for more information., (*4)
Installation
Omnipay is installed via Composer. To install, simply add it
to your composer.json
file:, (*5)
{
"require": {
"tshalif/omnipay-webpay": "~2.0"
}
}
And run composer to update your dependencies:, (*6)
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update
Basic Usage
The following gateways are provided by this package:, (*7)
$gateway = Omnipay\Omnipay::create('Webpay');
$gateway->setAuthToken('test_secret_xxxxxxxxxxxxxxxxxxxxxxxx');
$card = new Omnipay\Common\CreditCard();
$card->setNumber("4242424242424242");
$card->setExpiryMonth("10");
$card->setExpiryYear("2020");
$card->setCvv("123");
$card->setName("ZAPHOD BEEBLEBROX");
try {
$params = array(
'amount' => 4200,
'card' => $card,
);
$response = $gateway->authorize($params)->send();
if ($response->isSuccessful()) {
// successful
} else {
throw new ApplicationException($response->getMessage());
}
} catch (ApplicationException $e) {
throw new ApplicationException($e->getMessage());
}
For general usage instructions, please see the main Omnipay
repository., (*8)
Support
If you are having general issues with Omnipay, we suggest posting on
Stack Overflow. Be sure to add the
omnipay tag so it can be easily found., (*9)
If you want to keep up to date with release anouncements, discuss ideas for the project,
or ask more detailed questions, there is also a mailing list which
you can subscribe to., (*10)
If you believe you have found a bug, please report it using the GitHub issue tracker,
or better yet, fork the library and submit a pull request., (*11)