1. Go to this page and download the library: Download fall1600/ecpay 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 / ecpay example snippets
$info = new BasicInfo($merchantId, $returnUrl, $order, $paymentType = 'ALL');
// 反向的設定概念, 依需求關閉付款方式(可參考PaymentType 付款方式)
$info = new IgnorePayment($info, 'ATM', 'BARCODE');
// 信用卡設定, quickCredit 可開啟記憶信用卡(需實作QuickCreditInterface), 以及設定紅利折抵
$info = new Credit($info, $quickCredit, true);
// 信用卡分期付款設定
$info = new PayInInstallments($info, '3,6,12,18,24');
// 虛擬ATM 繳費設定, 接收取號的webhook url, 要號完成的回導位置, 繳費期限(天), 預設3天
$info = new Atm($info, $paymentInfoUrl, $clientRedirectUrl, 10);
// 超商繳費設定, 繳費期限(分鐘), 預設10080分鐘=7天
$info = new Cvs($info, $paymentInfoUrl, $clientRedirectUrl, 30);
// 超商條碼繳費設定, 繳費期限(天), 預設7天
$info = new Barcode($info, $paymentInfoUrl, $clientRedirectUrl, 3);
// 是否需要額外的付款資訊
$info = new ExtraInfo($info);
// 特店子商城id
$info = new SubMerchant($info, $subMerchantId);