Coder Social home page Coder Social logo

txnpay-php's Introduction

TraxionPay PHP SDK

Table of Contents

Installation

composer install txnpay

Usage

Initialize

After installing, initialize by importing the package and using the public and secret keys.

use txnpay\TraxionPay;

$traxionpay = new TraxionPay($yourApiKey, $yourSecretKey);

Cash in

# Sample arguments are the bare minimum for cash_in
$response = $traxionpay->cashIn([
    'merchant_id' => 6328,
    'merchant_ref_no' => 'ABC123DEF456',
    'merchant_additional_data' => (object)array("payment_code" => "ABC123DEF456"),
    'description' => 'My test payment',
    'amount' => 1500.0,
    'status_notification_url' => 'https://devapi.traxionpay.com/callback',
    'success_page_url' => 'https://dev.traxionpay.com', 
    'failure_page_url' => 'https://dev.traxionpay.com', 
    'cancel_page_url' => 'https://dev.traxionpay.com',
    'pending_page_url' => 'https://dev.traxionpay.com',
    'billing_details' => array(
      'billing_email' => '[email protected]'
    )
]);

Cash out

$otp = $traxionpay->fetchOTP();
$response = $traxionpay->cashOut([
    'OTP' => $otp->code,
    'amount' => 100.0,
    'bank_account' => 413
]);

Link a bank account

$response = $traxionpay->linkBankAccount([
  'bank' => '6311',
  'bank_type' => 'savings',
  'account_number' => '9012345678',
  'account_name' => 'John Doe'
]);

Fetch Cash Out OTP

$otp = $traxionpay->fetchOTP();

Fetch bank accounts

$bankAccounts = $traxionpay->fetchBankAccounts();

Fetch banks

$banks = $traxionpay->fetchBanks();

txnpay-php's People

Contributors

johnvalle avatar jvalle-traxion avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.