Giter VIP home page Giter VIP logo

omnipay-liqpay's Introduction

Omnipay: LiqPay

LiqPay driver for the Omnipay Laravel payment processing library

Latest Stable Version Total Downloads

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.5+. This package implements LiqPay support for Omnipay.

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "taron96/omnipay-liqpay": "v1.0.0"
    }
}

And run composer to update your dependencies:

composer update

Or you can simply run

composer require taron96/omnipay-liqpay

Basic Usage

  1. Use Omnipay gateway class:
    use Omnipay\Omnipay;
  1. Initialize LiqPay gateway:
    $gateway = Omnipay::create('LiqPay');
    $gateway->setPublicKey(env('LIQPAY_PUBLIC_KEY'));
    $gateway->setPrivateKey(env('LIQPAY_PRIVATE_KEY'));
  1. Call purchase, pass all necessary data and call sendData. It will return Response object which will contain all necessary data for form submission.
    $request = $gateway->purchase();

    $request->setAmount(10);
    $request->setCurrency('USD');
    $request->setDescription('Product payment.');
    $request->setOrderId(XXXX);
    $request->setResultUrl(env('LIQPAY_RETURN_URL'));
    
    $response = $request->sendData($request->getData());
  1. Create a webhook controller to handle the callback request at your LIQPAY_RETURN_URL and catch the webhook as follows
    $gateway = Omnipay::create('LiqPay');
    $gateway->setPublicKey(env('LIQPAY_PUBLIC_KEY'));
    $gateway->setPrivateKey(env('LIQPAY_PRIVATE_KEY'));
    
    $request = $this->gateway->fetchTransaction();

    $request->setOrderId(XXXX);

    $purchase = $request->send();
    
    // Do the rest with $purchase and response with 'OK'
    if ($purchase->isSuccessful()) {
        // Your logic
    }
    
    return new Response('OK');

For general usage instructions, please see the main Omnipay repository.

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag, so it can be easily found.

If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

omnipay-liqpay's People

Contributors

taron96 avatar

Stargazers

Yehor Smoliakov 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.