2017 © Pedro Peláez
 

symfony-bundle fxpay

Payment gateway

image

twodudes/fxpay

Payment gateway

  • Thursday, October 6, 2016
  • by megawilddaddy
  • Repository
  • 2 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

FXPay

Payment gateway designed with forex in mind. Currently work in progres..., (*1)

Installation

Installation with composer:, (*2)

composer require twodudes\fxpay

How does it work?

The system consists of:, (*3)

MerchantConfig - stores the merchant configuration for the given vendor, (*4)

HandlerStrategy - describes the strategy of dealing with the vendor, (*5)

Request:

PaymentRequest - stores the request parameters, you want to send to the vendor, (*6)

RequestBuilder - builds the array of parameters, needed to be passed to the vendor, (*7)

Response:

ResponseValidator - validates the response, based on the merchants rules, (*8)

ResponseBuilder - builds the payment response object, containing information about the transaction, once you got the merchant notification from the vendors system, (*9)

For the workflow check the TwoDudes\FXPay\HandlerStrategy\FormWithRedirectStrategy, (*10)

I don't want to read, give me a sample

Check the tests, (*11)

How to use the event manager?

There is a build in events system. You can use the built in event manager (the simpliest possible), or include your own one, if you want, (*12)

$this->strategy = new FormWithRedirectStrategy($config);
$this->strategy->setEventManager(new EventManager());

If you want your custom event manager, just make sure, that it implements the TwoDudes\FXPay\Events\EventManagerInterface, (*13)

What event do you have?

Creating Request:, (*14)

AfterRequestBuildEvent - fires, once the request builder built the params to generate the form. Here you can modify the generated params, (*15)

AfterFormBuildEvent - fires, once the html content with the hidden form was built. Here you can modify the form html., (*16)

Processing response:, (*17)

BeforeProcessResponseEvent - fires before any processing took place., (*18)

AfterBuildVendorResponseEvent - fires in the very end, once the VendorResponse is ready., (*19)

How to attach a new event
$this->strategy->getEventManager()->attach(BeforeProcessResponseEvent::getName(), function(BeforeProcessResponseEvent $event) {
    $params = $event->getParams();
    ...
    do something with the params
    ...
    $event->setParams($params);
});

The Versions

06/10 2016

dev-master

9999999-dev

Payment gateway

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

by Vasily Sokolov

payment gateway fasapay cardpay forex