payum-tw / mypay
The Payum extension. MyPay金流
Installs: 548
Dependents: 0
Suggesters: 1
Security: 0
Stars: 3
Watchers: 3
Forks: 6
Open Issues: 0
Type:project
Requires
- guzzlehttp/psr7: ^1.3
- payum/core: ^1.3.6
- php-http/message: ^1.4
- phpseclib/phpseclib: ^2.0
Requires (Dev)
- mockery/mockery: ~0.9.4|~1.0
- nesbot/carbon: ~1.20
- php-http/guzzle6-adapter: ^1.1
- phpunit/phpunit: ~4.8|~5.4|~6.1|~7.0
README
The Payum extension to rapidly build new extensions.
- Create new project
$ composer create-project payum-tw/mypay
- Replace all occurrences of
payum
with your vendor name. It may be your github name, for now let's say you choose:acme
. - Replace all occurrences of
mypay
with a payment gateway name. For example Stripe, Paypal etc. For now let's say you choose:mypay
. - Register a gateway factory to the payum's builder and create a gateway:
<?php use Payum\Core\PayumBuilder; use Payum\Core\GatewayFactoryInterface; $defaultConfig = []; $payum = (new PayumBuilder) ->addGatewayFactory('mypay', function(array $config, GatewayFactoryInterface $coreGatewayFactory) { return new \PayumTW\Allpay\AllpayGatewayFactory($config, $coreGatewayFactory); }) ->addGateway('mypay', [ 'factory' => 'mypay', 'MerCode' => null, 'MerKey' => null, 'MerName' => null, 'Account' => null, 'sandbox' => true, ]) ->getPayum() ;
- While using the gateway implement all method where you get
Not implemented
exception:
<?php use Payum\Core\Request\Capture; $mypay = $payum->getGateway('mypay'); $model = new \ArrayObject([ // ... ]); $mypay->execute(new Capture($model));
Resources
License
Skeleton is released under the MIT License.