ptuchik/omnipay-yandex

Yandex Money gateway for Omnipay payment processing library

1.0.1 2018-07-31 21:17 UTC

This package is auto-updated.

Last update: 2024-11-14 03:41:09 UTC


README

Yandex Money 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 Yandex Money support for Omnipay.

Installation

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

{
    "require": {
        "ptuchik/omnipay-yandex": "~1.0"
    }
}

And run composer to update your dependencies:

composer update

Or you can simply run

composer require ptuchik/omnipay-yandex

Basic Usage

  1. Use Omnipay gateway class:
    use Omnipay\Omnipay;
  1. Initialize Yandex gateway and make a purchase:
    $gateway = Omnipay::create('Yandex');
    $gateway->setShopId(env('SHOP_ID'));
    $gateway->setSecretKey(env('SECRET_KEY'));
    $gateway->setReturnUrl(env('RETURN_URL'));
    $gateway->setAmount(10); // Amount to charge
    $gateway->setCurrency('RUB'); // Currency
    $purchase = $gateway->purchase()->send();
    
    if ($purchase->isSuccessful()) {
        // Do your logic
    } else {
        throw new Exception($purchase->getMessage());
    }
    
  1. Initialize Yandex gateway and make a refund:
    $gateway = Omnipay::create('Yandex');
    $gateway->setShopId(env('SHOP_ID'));
    $gateway->setSecretKey(env('SECRET_KEY'));
    $gateway->setReturnUrl(env('RETURN_URL'));
    $gateway->setAmount(10); // Amount to refund
    $gateway->setTransactionReference(10); // Payment ID
    $refund = $gateway->refund()->send();
    
    if ($refund->isSuccessful()) {
        // Do your logic
    } else {
        throw new Exception($refund->getMessage());
    }
    

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 anouncements, 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.