Coder Social home page Coder Social logo

ipay88's Introduction


Installation

composer require napoleon/ipay88 dev-master

Example code

To generate form fields that are hidden, this will use in page hopping.

<?php

use Napoleon\IPay88\IPay88;

$payment = new IPay88;

$payment->setRequestParameters([
    'PaymentId' => 1,
    'RefNo' => 'your-unique-ref-code',
    'Amount' => 15,
    'ProdDesc' => 'The description',
    'UserName' => 'John Doe',
    'UserEmail' => '[email protected]',
    'UserContact' => '09123456789',
    'ResponseURL' => 'www.your-response-url.com',
    'BackendURL' => 'www.your-backend-url.com'
]);

$payment->render();

Or you can simply chain $payment->setRequestParamaters([...])->render()


To be able the IPay88 to do an action for your record, it needs an API comming from you. You can use the Response::class to initiate. see example below.

<?php

use Napoleon\IPay88\Response;

$response = new Response;

$response->run( function($success) {
    if ($success) {
        return # Do something if it succeed
    }
    
    return # Do something if it fails
});

$response->run() function expects 1 parameter to be a callback function.

$success variable is the boolean status of the transaction record made by the user.

$response->getFields() will return ALL the data available from IPay88, the function optionally wants an string data, to be specify what field you want to get.

Todos:

  • function to send a http request.
  • function that requery the transaction

Note:

Feel free to edit this doc and create PR for the missing todos.

ipay88's People

Contributors

napoleon101392 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tolagithub

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.