2017 © Pedro Peláez
 

library omnipay-otphu

Experimental Omnipay v2.5 Payment Gateway for https://www.otpbank.hu

image

clapp/omnipay-otphu

Experimental Omnipay v2.5 Payment Gateway for https://www.otpbank.hu

  • Monday, November 13, 2017
  • by dsge
  • Repository
  • 1 Watchers
  • 3 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

clapp/omnipay-otphu Build Status Coverage Status

Experimental package, not recommended for production., (*1)

Install

composer require clapp/omnipay-otphu:dev-master

Usage Example

<?php
include 'vendor/autoload.php';

$gateway = Omnipay\Omnipay::create("\\".Clapp\OtpHu\Gateway::class);

$gateway->setShopId("0199123456");
$gateway->setPrivateKey(file_get_contents('myShopKey.privKey.pem'));
$gateway->setTestMode(false);

try {
    $request = $gateway->purchase([
        'amount' => '100.00',
        'currency' => 'HUF',
        'returnUrl' => 'https://www.example.com/processing-your-payment',
    ]);
    $response = $request->send();

    if ($response->isRedirect()){
        $redirectionUrl = $response->getRedirectUrl();
        $transactionId = $response->getTransactionId();
        /**
         * redirect the user to $redurectionUrl and store $transactionId for later use
         */
    }
}catch(Exception $e){
    /**
     * something went wrong
     */
}
// after the user is redirected back to our site by OTP
<?php
include 'vendor/autoload.php';

$gateway = Omnipay\Omnipay::create("\\".Clapp\OtpHu\Gateway::class);

$gateway->setShopId("0199123456");
$gateway->setPrivateKey(file_get_contents('myShopKey.privKey.pem'));
$gateway->setTestMode(false);

try {
    $response = $gateway->completePurchase([
        'transactionId' => 'myTransactionId',
    ])->send();

    if ($response->isSuccessful()){
        /**
         * the user's payment was successful
         */
    }
    if ($response->isPending()){
        /**
         * the user's payment is still pending, we should try $gateway->completePurchase() later
         */
    }
    if ($response->isCancelled()){
        /**
         * the user cancelled the payment
         */
    }
    if ($response->isRejected()){
        /**
         * the payment gateway rejected the user's payment
         */
         $reasonCode = $response->getTransaction()->getRejectionReasonCode(); //OTP's error code string
         $reasonMessage = $response->getTransaction()->getRejectionReasonMessage(); //human readable string
    }
}catch(Exception $e){
    /**
     * something went wrong
     */
}

Documentation

In the /docs folder or on Github Pages., (*2)

The Versions

13/11 2017

dev-master

9999999-dev

Experimental Omnipay v2.5 Payment Gateway for https://www.otpbank.hu

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gergely Sárosi

payment pay merchant purchase omnipay otp otpbank hungary magyar

21/12 2016

dev-analysis-8mwQKV

dev-analysis-8mwQKV

Experimental Omnipay v2.5 Payment Gateway for https://www.otpbank.hu

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gergely Sárosi

payment pay merchant purchase omnipay otp otpbank hungary magyar

10/12 2016

1.0.0-alpha2

1.0.0.0-alpha2

Experimental Omnipay v2.5 Payment Gateway for https://www.otpbank.hu

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gergely Sárosi

payment pay merchant purchase omnipay otp otpbank hungary magyar

05/12 2016

1.0.0-alpha1

1.0.0.0-alpha1

Experimental Omnipay v2.5 Payment Gateway for https://www.otpbank.hu

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gergely Sárosi

payment pay merchant purchase omnipay otp otpbank hungary magyar