seta0909 / lumen-pay2go by seta0909

pay2go payment for lumen 5.6
67
0
2
Package Data
Maintainer Username: seta0909
Maintainer Contact: seta0909@gmail.com (Seta)
Package Create Date: 2018-06-01
Package Last Update: 2018-06-29
Language: PHP
License: MIT
Last Refreshed: 2024-11-23 03:12:33
Package Statistics
Total Downloads: 67
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

lumen-pay2go

pay2go lumen service

Install

  1. composer require seta0909/lumen-pay2go
  2. add service provider to app.php
$app->configure('pay2go');
and 
$app->register(Pay2go\Pay2goServiceProvider::class);
  1. add config/pay2go.php
<?php
return [
    'merchant_id' => env('MERCHANT_ID', null),

    'merchant_key' => env('MERCHANT_KEY', null),

    'merchant_iv' => env('MERCHANT_IV', null),

    'is_prod' => env('MERCHANT_PROD', false)
];

Usage

Pay for token

use Pay2go\CreditCard
$checkout = app(Pay2go::class);
$request = [];

$request['MerchantOrderNo'] = 1;
$request['Amt'] = 100;
$request['ProdDesc'] = 'this is a production description';
$request['PayerEmail'] = 'email@test.com';

$response = $checkout->createOrder($request)
                     ->setVersion(1.4)
                     ->setToken($memberToken->token_value, $memberToken->token_term)
                     ->payForToken();