1. Go to this page and download the library: Download fall1600/newebpay library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fall1600 / newebpay example snippets
$info = new \fall1600\Package\Newebpay\Info\Period\BasicInfo($order, $payer, $periodStartType, $version);
$info = new ReturnUrl($info, 'https://your.return.url');
$info = new NotifyUrl($info, 'https://your.notify.url');
$info = new BackUrl($info, 'https://your.back.url');
$info = new Memo($info, 'your memo here');
namespace Your\Namespace;
use fall1600\Package\Newebpay\Contracts\Period\OrderInterface;
class Order implements OrderInterface
{
// your order detail...
}
namespace Your\Namespace;
use fall1600\Package\Newebpay\Contracts\Period\ContactInterface;
class Member implements ContactInterface
{
// your member detail...
}
$info = new BasicInfo($merchantId, $notifyUrl, $order, $payer);
// 啟用信用卡
$info = new EnableCredit($info);
// 啟用3, 6, 12 期分期付款
$info = new PayInInstallments($info, '3,6,12');
// 啟用超商條碼
$info = new EnableBarcode($info);
// 啟用Google Pay
$info = new EnableGooglePay($info);
// 啟用Web ATM
$info = new EnableWebAtm($info);
// 搭配非即時交易, 設定藍新通知付款資訊的callback url, 以及繳費期限
$info = new OfflinePay($info, $customerUrl, $ttl);
// 在藍新交易完成後導回的網址
$info = new PayComplete($info, $returnUrl);
// 設定讓消費者在付款頁按下返回時可以回導的頁面
$info = new PayCancel($info, $clientBackUrl);
// 文件末有付款方式對應表