Giter Club home page Giter Club logo

networkintl's Introduction

Network International - Ngenius Payment Gateway Wrapper For Laravel

jeybin/networkintl is a wrapper package or in other words a helper package for implementing the Network International (NGENIUS) payment gateway in Laravel Projects.

Features

  • Easier create order
  • Webhook helpers

Installation

Requires PHP v7.0+ to run. Install the jeybin/networkintl using the command

composer require jeybin/networkintl

After installation publish the config and service providers using

php artisan ngenius:install

Once everything publishes, run the migration command to create the required tables

php artisan ngenius:migrate

If you want to copy the Job files from the package run the command below, this will create the Jobs files required for the webhook listener. (path : App\Jobs\NgeniusWebhooks)

php artisan ngenius:ngenius-webhooks

Once all the installation procedures are done there will be two tables available in your database one will be called as ngenius_gateway this table holds the configurations for the gateway

Columns Description
id Auto increment value (Primary Key) of the table
active 1 or 0 for assigning the active gateway if have multiple
type The type of configuration, accepting values are live/sandbox
api_key Api from network international
reference_id Reference id from Network international
base_url Api base url (different base urls in live and sandbox)

Other table is ngenius_gateway_webhooks this table will save the data received in the webhook URL.

Columns Description
id Auto increment value (Primary Key) of the table
event_id Event id (payload->eventId)
event_name Event name (payload->eventName)
order_reference Order reference (payload->order->reference)
merchant_order_reference Merchant order reference (payload->order->merchantOrderReference)
email Email of the payer (payload->order->emailAddress)
currency Payment currency (payload->order->amount->currencyCode)
amount Payment amount (payload->order->amount->amount)
payload Full payload data received inside the webhook url in JSON format (payload)
exception Save exception if any

Usage

To create purchase order import use Jeybin\Networkintl\Ngenius to the class

Ngenius::type('create-order')
       ->request($paymentUrlRequest)
       ->execute()
       ->json()

The payment request ($paymentUrlRequest) is an array with following keys.

Key Description
amount Payment amount in merchant currency
payer_email Email address of the payer
order_reference Merchant order reference number
redirect_url Redirection path once the payment is successed
cancel_url Redirection path once the payment is cancelled
cancel_text The text need to be shown in the cancel button
merchant_defined Array of details you want like to pass like product name etc
language Gateway language, default is English, allowed parameters en,ar and fr
billing Required, Array of billing array details parameters are first_name, last_name , address,city,country
skip_confirmation_page Boolean value, by default false
skip3DS Boolean value, by default false

To check the status of an order simply pass order-status as type with order reference number in the request

       Ngenius::type('order-status')
              ->request('order-reference-number')
              ->execute()
              ->json();

Reference

License

MIT

networkintl's People

Contributors

aditha-sansa avatar jeybin 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.