Developed with love by KnpLabs Hire us for your project!
17

MasterpassBundle

by marcoshoya

Masterpass Symfony2 Bundle

MasterpassBundle

This Symfony 2 bundle implements the backend calls for Masterpass V7 checkout - Standard and Express flows. For complete Masterpass docs, refer https://developer.mastercard.com/product/masterpass

Build Status
Total Downloads
Latest Stable Version

Install

Add HoyaMasterpassBundle in your composer.json:

{
    "require": {
        "hoya/masterpass-bundle": "~3.0.0"
    }
}

Register the bundle in your appkernel.php file

return array(
   // ...
   new Hoya\MasterpassBundle\HoyaMasterpassBundle(),
   // ...
);

Setup your config.yml file

# app/config/config.yml

hoya_masterpass:
    production_mode: false
    checkoutidentifier: checkout_id
    keys:
        consumerkey: consumer_key_value
        keystorepath: "%kernel.root_dir%/cert/csr_file.p12"
        keystorepassword: changeit

Usage

You may follow some sample code here

Handling Errors

Any error which may happen while calling Masterpass APIs throws an Exception. Hence, it is highly recommended to use try / catch block
In addition, you can check further details on symfony logs.

try {

    $payment = $this->get('hoya_masterpass_service')->getPaymentData($callback, '1234');

} catch (\Exception $e) {
    $this->get('session')->getFlashBag()->add('error', $e->getMessage());
}

Running the Tests

Install the Composer dev dependencies:

php composer.phar install --dev

Then, run the test suite using
PHPUnit:

./phpunit
The MIT License (MIT)

Copyright (c) 2016 Marcos Joia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
hoya_masterpass:
production_mode: false
callback: ~
checkoutidentifier: ~
keys:
consumerkey: ~
keystorepath: ~
keystorepassword: ~
  • Update .travis.yml
    By web-flow, 3 months ago
  • Update .travis.yml
    By web-flow, 3 months ago
  • Merge pull request #8 from marcoshoya/version3
    By web-flow, 3 months ago
  • documenation
    By marcoshoya, 3 months ago
  • adding psp payment data api
    By marcoshoya, 3 months ago
  • moving to debug
    By marcoshoya, 3 months ago
  • log header from request
    By marcoshoya, 3 months ago
  • error message
    By marcoshoya, 3 months ago
  • updating log handled
    By marcoshoya, 3 months ago
  • loging debug
    By marcoshoya, 3 months ago
  • psr logger on dorequest
    By marcoshoya, 3 months ago
  • handling exception
    By marcoshoya, 3 months ago
  • handling exception
    By marcoshoya, 3 months ago
  • removing exception
    By marcoshoya, 3 months ago
  • add preTid to json
    By marcoshoya, 3 months ago
  • removing utf8 encode
    By marcoshoya, 3 months ago
  • fixing media type
    By marcoshoya, 3 months ago
  • logs for fails calls
    By marcoshoya, 3 months ago
  • adding express checkout service
    By marcoshoya, 3 months ago
  • adding precheckout service
    By marcoshoya, 4 months ago
  • making service public
    By marcoshoya, 4 months ago
  • adding pairingId service
    By marcoshoya, 4 months ago
  • handling callback with pairing
    By marcoshoya, 4 months ago
  • moving decode to service class
    By marcoshoya, 4 months ago
  • decrypt with JOSE
    By marcoshoya, 4 months ago
  • fixing symfony compatibility
    By marcoshoya, 4 months ago
  • testing without log
    By marcoshoya, 4 months ago
  • adding jose dependency
    By marcoshoya, 4 months ago
  • add encrypted service
    By marcoshoya, 5 months ago
  • adding transaction service
    By marcoshoya, 5 months ago