payum-tw / collect
The Payum extension. 統一客樂得黑貓宅急便金流
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 9
Open Issues: 0
Type:project
Requires
- nesbot/carbon: ~1.20
- payum/core: ^1.3.6
Requires (Dev)
- mockery/mockery: ~0.9.4
- php-http/guzzle6-adapter: ^1.0
- phpunit/phpunit: ~4.8|~5.4
README
The Payum extension to rapidly build new extensions.
- Create new project
$ composer create-project payum-tw/collect
- Replace all occurrences of
payum
with your vendor name. It may be your github name, for now let's say you choose:collect
. - Replace all occurrences of
collect
with a payment gateway name. For example Stripe, Paypal etc. For now let's say you choose:collect
. - 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('collect', function(array $config, GatewayFactoryInterface $coreGatewayFactory) { return new \PayumTW\Collect\CollectGatewayFactory($config, $coreGatewayFactory); }) ->addGateway('collect', [ 'factory' => 'collect', 'link_id' => null, 'hash_base' => null, ]) ->getPayum();
- While using the gateway implement all method where you get
Not implemented
exception:
<?php use Payum\Core\Request\Capture; $collect = $payum->getGateway('collect'); $model = new \ArrayObject([ // ... ]); $collect->execute(new Capture($model));
Resources
License
Skeleton is released under the MIT License.