2017 © Pedro Peláez
 

library payment

more payment for taiwan pay

image

unisharp/payment

more payment for taiwan pay

  • Tuesday, May 29, 2018
  • by FreedomKnight
  • Repository
  • 9 Watchers
  • 2 Stars
  • 746 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 138 % Grown

The README.md

UniSharp Payment

Provide Cathay, TaiwanPay and more ways to pay, (*1)

Installation

composer require unisharp/payment dev-master, (*2)

Available Gateway

Usages

Initial the gateway, (*3)

$cathay = UniSharp\Payment\Gateways\CathayGateway::create([
    'hashKey'       => 'c7fe1bfba42369ec1add502c9917e14d',
    'hashIV'        => '',
    'merchantId'    => '123456789',
    'version'       => '',
    'actionUrl'     => 'https://sslpayment.uwccb.com.tw/EPOSService/Payment/OrderInitial.aspx',
    'returnUrl'     => 'https://localhost/payment/confirm',
    'notifyUrl'     => 'https://localhost/payment/notify',
    'clientBackUrl' => 'https://localhost/payment/return',
    'paymentInfoUrl'=> 'https://localhost/payment/information',
]);

Generate post form, (*4)

$cathay->newOrder(
    $order->sn,
    $order->total_price,
    $order->name,
    $order->note
);

return $cathay->genForm(true);

Process order result/information, (*5)

$cathay = UniSharp\Payment\Responses\CathayResponse::create([
    'hashKey'       => 'c7fe1bfba42369ec1add502c9917e14d',
    'hashIV'        => '' 
]);

Check the payment response, (*6)

// Check resonse content
$result = $cathay->processOrder('xml');

// Check response success
$cathay->rspOk();

More details on (voicetube/taiwan-payment-gateway)[https://github.com/voicetube/Taiwan-Payment-Gateway], (*7)

The Versions