artmin96/omnipay-telcell

TelCell gateway for Omnipay payment processing library

1.1 2023-09-19 19:59 UTC

This package is auto-updated.

Last update: 2024-12-19 22:32:40 UTC


README

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

Basic Usage

  1. Use Omnipay gateway class:
    use Omnipay\Omnipay;
  1. Initialize TelCell gateway:
    $gateway = Omnipay::create('Telcell');
    $gateway->setShopId(env('SHOP_ID'));
    $gateway->setShopKey(env('SHOP_KEY'));
    $gateway->setSum(10); // Amount to charge
    $gateway->setInfo([]); // Additional information
    $gateway->setTransactionId(XXXX); // Transaction ID from your system
  1. Call purchase, it will automatically redirect to TelCell's hosted page
    $purchase = $gateway->purchase()->send();
    $purchase->redirect();
  1. Create a webhook controller to handle the callback request at your RETURN_URL and catch the webhook as follows
    $gateway = Omnipay::create('Telcell');
    $gateway->setShopId(env('SHOP_ID'));
    $gateway->setShopKey(env('SHOP_KEY'));
    
    $purchase = $gateway->completePurchase()->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.