Giter Site home page Giter Site logo

tap-payment-gateway-laravel's Introduction

Tap payment gateway laravel

Latest Version on Packagist Total Downloads GitHub Actions

Tap Payment SDK Package for PHP Laravel

Installation

You can install the package via composer:

composer require bamalik1996/tap-payment-gateway-laravel

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

TAP_PAYMENT_MODE = 'sandbox' // production

TAP_PAYMENT_SECRET_KEY

TAP_PAYMENT_PUBLISH_KEY

TAP_PAYMENT_SANDBOX_SECRET_KEY

TAP_PAYMENT_SANDBOX_PUBLISH_KEY## Documentation (Charge)

Charge Create

use Bamalik1996\TapPaymentGateway\TapPaymentGateway;
    $trans_object["amount"]                   =  123;
    $trans_object["currency"]                 = 'AED';
    $trans_object["threeDsecure"]             = true;
    $trans_object["save_card"]                = false;
    $trans_object["description"]              = "ORDER ID :" . 1;
    $trans_object["statement_descriptor"]     = 'Sample';
    $trans_object["metadata"]["udf1"]          = 'test';
    $trans_object["metadata"]["udf2"]          = 'test';
    $trans_object["reference"]["transaction"]  = 'txn_0000' . 2;
    $trans_object["reference"]["order"]        = 2;
    $trans_object["receipt"]["email"]          = false;
    $trans_object["receipt"]["sms"]            = true;
    $trans_object["customer"]["first_name"]    = 'auth()->user()->last_name';
    $trans_object["customer"]["last_name"]    = 'auth()->user()->first_name';
    $trans_object["customer"]["email"]        = 'auth()->user()->email';
    $trans_object["customer"]["phone"]["country_code"]       = '';
    $trans_object["customer"]["phone"]["number"] = '';
    $trans_object["source"]["id"] = 'src_all';
    $trans_object["post"]["url"] = '1';
    $trans_object["redirect"]["url"] =  'v';
    $tapPaymentGateway = new TapPaymentGateway;
    return ($tapPaymentGateway->charges()->create($trans_object));

Charge Update

use Bamalik1996\TapPaymentGateway\TapPaymentGateway;

    $tapPaymentGateway = new TapPaymentGateway;

    return $tapPaymentGateway->charges()->update($id,[
        "description"=> "test",
        "receipt"=> [
            "email"=> false,
            "sms"=> true
        ],
        "metadata"=> [
            "udf2"=> "testing update"
        ]
    ]);

Charge Retrieve

use Bamalik1996\TapPaymentGateway\TapPaymentGateway;

    $tapPaymentGateway = new TapPaymentGateway;

    return $tapPaymentGateway->charges()->retrieve($id);

Charge Delete

use Bamalik1996\TapPaymentGateway\TapPaymentGateway;

    $tapPaymentGateway = new TapPaymentGateway;

    return $tapPaymentGateway->charges()->delete($id);

Charge All

use Bamalik1996\TapPaymentGateway\TapPaymentGateway;

    $tapPaymentGateway = new TapPaymentGateway;

    return $tapPaymentGateway->charges()->all([
        "period"=> [
            "date"=> [
            "from"=> time() - (30 * 24 * 60 * 60),//last 30 days
            "to"=> time()//today
            ]
        ],
        "status"=> "",
        "starting_after"=> "",
        "limit"=> 25
    ]);

Documentation (Custom)

Customer Create

use Bamalik1996\TapPaymentGateway\TapPaymentGateway;
    $params = array (
        'first_name' => 'test',
        'middle_name' => 'test',
        'last_name' => 'test',
        'email' => '[email protected]',
        'phone' =>
        array (
            'country_code' => '965',
            'number' => '51234567',
        ),
        'description' => 'test',
        'metadata' =>
        array (
            'sample string 1' => 'string1',
            'sample string 3' => 'string2',
        ),
        'currency' => 'KWD',
    );

    $tapPaymentGateway = new TapPaymentGateway;
    return ($tapPaymentGateway->customers()->create($params));

Customer Update

use Bamalik1996\TapPaymentGateway\TapPaymentGateway;

    $tapPaymentGateway = new TapPaymentGateway;

    return $tapPaymentGateway->customers()->update($id,[
      'first_name' => 'test',
        'middle_name' => 'test',
        'last_name' => 'test',
        'email' => '[email protected]',
        'phone' =>
        array (
            'country_code' => '965',
            'number' => '51234567',
        ),
        'description' => 'test',
        'metadata' =>
        array (
            'sample string 1' => 'string1',
            'sample string 3' => 'string2',
        ),
        'currency' => 'KWD',
    ]);

Customer Retrieve

use Bamalik1996\TapPaymentGateway\TapPaymentGateway;

    $tapPaymentGateway = new TapPaymentGateway;

    return $tapPaymentGateway->customers()->retrieve($id);

Customer Delete

use Bamalik1996\TapPaymentGateway\TapPaymentGateway;

    $tapPaymentGateway = new TapPaymentGateway;

    return $tapPaymentGateway->customers()->delete($id);

Customer All

use Bamalik1996\TapPaymentGateway\TapPaymentGateway;

    $tapPaymentGateway = new TapPaymentGateway;

    return $tapPaymentGateway->customers()->all([
        "period"=> [
            "date"=> [
            "from"=> time() - (30 * 24 * 60 * 60),//last 30 days
            "to"=> time()//today
            ]
        ],
        "status"=> "",
        "starting_after"=> "",
        "limit"=> 25
    ]);

More Help

tap-payment-gateway-laravel's People

Contributors

bamalik1996 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.