webgatetec/omnipay-webdosh

WebDosh Payment Platform Driver for OmniPay

dev-master 2018-04-13 07:06 UTC

This package is not auto-updated.

Last update: 2024-04-13 07:57:13 UTC


README

WebDosh Gateway for the Omnipay PHP payment processing library.

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+.

Basic Usage

Payment requests to the WebDosh Payment Platform Gateway must at least supply the following parameters:

  • merchant_id Your merchant account ID
  • transactionId unique transaction ID
  • amount monetary amount
  • currency currency
$gateway = Omnipay::create('WebDosh');
$gateway->setMerchantId('myTestMerchantId');
$gateway->setMerchantSecret('myTestMerchantSecret');

// Create Omnipay CreditCard
$card = new CreditCard([
    'number'      => $number,
    'firstName'   => $firstName,
    'lastName'    => $lastName,
    'expiryMonth' => $month,
    'expiryYear'  => $year,
    'cvv'         => $cvv
]);

//Make Purchase request
$purchaseTransaction = $this->gateway->purchase([
    'amount'   => 5000,
    'currency' => 'AUD',
    'card'     => $card
]);

//Make Refund request
$refundTransaction = $this->gateway->refund([
    'transaction_id' => 'test-id',
    'amount'         => 5000,
]);

//Make Status request
$statusTransaction = $this->gateway->status([
    'amount'         => 5000,
    'transaction_id' => 'test-id'
]);

//Make Tokenize requset 
$tokenizeRequset = $this->gateway->createCard([
    'currency'    => 'AUD',
    'card'        => $card
]);

//Make Token Payment request
$tokenPaymentTransaction =$this->gateway->tokenPayment([
    'currency'               => 'AUD',
    'amount'                 => 5000,
    'card_verification_code' => 111,
    'token'                  => 'test-token',
]);