The Payum extension to rapidly build new extensions.
- Create new project
$ composer create-project payum-tw/ecpay
- Replace all occurrences of
payum
with your vendor name. It may be your github name, for now let's say you choose:ecpay
. - Replace all occurrences of
ecpay
with a payment gateway name. For example Stripe, Paypal etc. For now let's say you choose:ecpay
. - 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('ecpay', function(array $config, GatewayFactoryInterface $coreGatewayFactory) {
return new \PayumTW\Ecpay\EcpayGatewayFactory($config, $coreGatewayFactory);
})
->addGateway('ecpay', [
'factory' => 'ecpay',
'MerchantID' => '2000132',
'HashKey' => '5294y06JbISpM5x9',
'HashIV' => 'v77hoKGq4kWxNNIS',
'sandbox' => true,
])
->getPayum();
- While using the gateway implement all method where you get
Not implemented
exception:
<?php
use Payum\Core\Request\Capture;
$ecpay = $payum->getGateway('ecpay');
$model = new \ArrayObject([
// ...
]);
$ecpay->execute(new Capture($model));
Skeleton is released under the MIT License.