digistorm / omnipay-bpoint
BPoint driver for the Omnipay payment processing library
Installs: 1 260
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- nesbot/carbon: ^3.8
- omnipay/common: ^3
- symfony/http-client: ^7.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- http-interop/http-factory-guzzle: ^1.2
- omnipay/tests: ^4
- phpstan/phpstan: ^1.12
- phpstan/phpstan-strict-rules: ^1.6
- rector/rector: ^1.2
- spaze/phpstan-disallowed-calls: ^3.5
This package is auto-updated.
Last update: 2025-03-01 00:14:07 UTC
README
BPoint v3 driver for the Omnipay PHP payment processing library
BPoint v3 API: https://www.bpoint.com.au/developers/v3/index.htm#!#api
Currently only supports tokenized purchases with two available methods:
- createToken()
- purchase()
Usage
<?php use Omnipay\Omnipay; use Omnipay\Common\CreditCard; // Create a gateway for the Bpoint Gateway // (routes to GatewayFactory::create) /* @var \Omnipay\Bpoint\Gateway $gateway */ $gateway = Omnipay::create('Bpoint'); $gateway->setTestMode(true); $gateway->setUsername('usernameValue'); $gateway->setPassword('passwordValue'); $gateway->setMerchantNumber('merchantIdValue'); // Tokenize a card /* @var \Omnipay\Bpoint\Message\Response $response */ $response = $gateway->createToken([ 'card' => new CreditCard([ 'number' => '4987654321098769', 'cvv' => '987', 'expiryMonth' => '03', 'expiryYear' => '2026', 'firstName' => 'John', 'lastName' => 'Doe', ]), 'crn1' => '12345', 'crn2' => '', 'crn3' => null, ])->send(); if (!$response->isSuccessful()) { // handle errors } // Charge using a token /* @var \Omnipay\Bpoint\Message\Response $response */ $response = $gateway->purchase([ 'card' => new CreditCard([ 'number' => $response->getToken(), 'cvv' => '987', 'expiryMonth' => '03', 'expiryYear' => '2026', 'firstName' => 'John', 'lastName' => 'Doe', ]), 'amount' => '50.00', 'currency' => 'AUD', 'description' => 'Merchant Reference', 'crn1' => '12345', 'crn2' => '', 'crn3' => null, ])->send();