yproximite / payum-axepta-bnp
Axepta gateway for Payum
Installs: 1 084
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 6
Forks: 1
Open Issues: 3
Requires
- php: >=7.4
- payum/core: ^1.5
- phpseclib/phpseclib: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.19.0
- php-http/guzzle6-adapter: ^1.0
- phpstan/phpstan: ^0.12.86
- phpstan/phpstan-strict-rules: ^0.12.9
- phpunit/phpunit: ^9.5.4
- twig/twig: ^2.6
This package is auto-updated.
Last update: 2024-10-18 14:13:08 UTC
README
A Payum gateway to use Axepta (a French payment system)
Requirements
- PHP 7.4+
- Payum
- Optionally PayumBundle and Symfony 3 or 4+
Installation
$ composer require yproximite/payum-axepta-bnp
Configuration
With PayumBundle (Symfony)
First register the gateway factory in your services definition:
# config/services.yaml or app/config/services.yml services: yproximite.axepta_gateway_factory: class: Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder arguments: [ Yproximite\Payum\Axepta\AxeptaGatewayFactory ] tags: - { name: payum.gateway_factory_builder, factory: axepta }
Then configure the gateway:
# config/packages/payum.yaml or app/config/config.yml payum: gateways: axepta: factory: axepta merchant_id: 'change it' # required hmac: 'change it' # required crypt_key: 'change it' # required
With Payum
<?php //config.php use Payum\Core\PayumBuilder; use Payum\Core\Payum; /** @var Payum $payum */ $payum = (new PayumBuilder()) ->addDefaultStorages() ->addGateway('gatewayName', [ 'factory' => 'axepta', 'merchant_id' => 'change it', // required 'hmac' => 'change it', // required 'crypt_key' => 'change it', // required ]) ->getPayum() ;
Usage
Make sure your Payment
entity overrides getNumber()
method like this:
<?php namespace App\Entity\Payment; use Doctrine\ORM\Mapping as ORM; use Payum\Core\Model\Payment as BasePayment; /** * @ORM\Table * @ORM\Entity */ class Payment extends BasePayment { /** * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") * * @var int */ protected $id; /** * {@inheritdoc} */ public function getNumber() { return (string) $this->id; } }
By doing this, the library will be able to pick the payment's id and use it for the payment with Axepta.