diff --git a/AioSDK/sdk/AllPay.Payment.Integration.php b/AioSDK/sdk/AllPay.Payment.Integration.php index 0fa0ff7..f37aeaa 100644 --- a/AioSDK/sdk/AllPay.Payment.Integration.php +++ b/AioSDK/sdk/AllPay.Payment.Integration.php @@ -146,12 +146,12 @@ abstract class PaymentMethodItem { * 中國信託。 */ const ATM_CHINATRUST = 'CHINATRUST'; - + /** * 土地銀行。 */ const ATM_LAND = 'LAND'; - + /** * 國泰世華銀行。 */ @@ -176,7 +176,7 @@ abstract class PaymentMethodItem { * 第一銀行。 */ const ATM_FIRST = 'FIRST'; - + // 超商類(201~300) /** * 超商代碼繳款。 @@ -349,13 +349,13 @@ abstract class InvoiceState { abstract class CarruerType { // 無載具 const None = ''; - + // 會員載具 const Member = '1'; - + // 買受人自然人憑證 const Citizen = '2'; - + // 買受人手機條碼 const Cellphone = '3'; } @@ -366,7 +366,7 @@ abstract class CarruerType { abstract class PrintMark { // 不列印 const No = '0'; - + // 列印 const Yes = '1'; } @@ -377,7 +377,7 @@ abstract class PrintMark { abstract class Donation { // 捐贈 const Yes = '1'; - + // 不捐贈 const No = '2'; } @@ -388,7 +388,7 @@ abstract class Donation { abstract class ClearanceMark { // 經海關出口 const Yes = '1'; - + // 非經海關出口 const No = '2'; } @@ -399,13 +399,13 @@ abstract class ClearanceMark { abstract class TaxType { // 應稅 const Dutiable = '1'; - + // 零稅率 const Zero = '2'; - + // 免稅 const Free = '3'; - + // 應稅與免稅混合(限收銀機發票無法分辦時使用,且需通過申請核可) const Mix = '9'; } @@ -416,7 +416,7 @@ abstract class TaxType { abstract class InvType { // 一般稅額 const General = '07'; - + // 特種稅額 const Special = '08'; } @@ -424,7 +424,7 @@ abstract class InvType { abstract class EncryptType { // MD5(預設) const ENC_MD5 = 0; - + // SHA256 const ENC_SHA256 = 1; } @@ -499,7 +499,7 @@ function __construct() { 'MerchantTradeNo' => '', 'TradeNo' => '', 'ChargeBackTotalAmount' => 0, 'Remark' => '' ); $this->Capture = array(); - + } //產生訂單 @@ -516,14 +516,14 @@ function CheckOutString($paymentButton = null, $target = "_self") { //取得付款結果通知的方法 function CheckOutFeedback() { - return $arFeedback = CheckOutFeedback::CheckOut($_POST,$this->HashKey,$this->HashIV,0); + return $arFeedback = CheckOutFeedback::CheckOut($_POST,$this->HashKey,$this->HashIV,0); } //訂單查詢作業 function QueryTradeInfo() { return $arFeedback = QueryTradeInfo::CheckOut(array_merge($this->Query,array("MerchantID" => $this->MerchantID)) ,$this->HashKey ,$this->HashIV ,$this->ServiceURL) ; } - + //信用卡定期定額訂單查詢的方法 function QueryPeriodCreditCardTradeInfo() { return $arFeedback = QueryPeriodCreditCardTradeInfo::CheckOut(array_merge($this->Query,array("MerchantID" => $this->MerchantID)) ,$this->HashKey ,$this->HashIV ,$this->ServiceURL); @@ -533,18 +533,18 @@ function QueryPeriodCreditCardTradeInfo() { function DoAction() { return $arFeedback = DoAction::CheckOut(array_merge($this->Action,array("MerchantID" => $this->MerchantID)) ,$this->HashKey ,$this->HashIV ,$this->ServiceURL); } - + //廠商通知退款 function AioChargeback() { return $arFeedback = AioChargeback::CheckOut(array_merge($this->ChargeBack,array("MerchantID" => $this->MerchantID)) ,$this->HashKey ,$this->HashIV ,$this->ServiceURL); } - + function AioCapture(){ return $arFeedback = AioCapture::Capture(array_merge($this->Capture,array("MerchantID" => $this->MerchantID)) ,$this->HashKey ,$this->HashIV ,$this->ServiceURL); } - + } @@ -553,7 +553,7 @@ function AioCapture(){ */ abstract class Aio { - abstract static function CheckOut(); + //abstract static function CheckOut(); protected function ServerPost($parameters ,$ServiceURL) { $ch = curl_init(); @@ -577,39 +577,39 @@ protected function ServerPost($parameters ,$ServiceURL) { * 產生訂單 */ class Send extends Aio -{ +{ //付款方式物件 public static $PaymentObj ; - function process($arParameters = array(),$arExtend = array()) + static function process($arParameters = array(),$arExtend = array()) { //宣告付款方式物件 $PaymentMethod = 'allPay_'.$arParameters['ChoosePayment']; self::$PaymentObj = new $PaymentMethod; - + //檢查參數 $arParameters = self::$PaymentObj->check_string($arParameters); - + //檢查商品 $arParameters = self::$PaymentObj->check_goods($arParameters); //檢查各付款方式的額外參數&電子發票參數 $arExtend = self::$PaymentObj->check_extend_string($arExtend,$arParameters['InvoiceMark']); - + //過濾 $arExtend = self::$PaymentObj->filter_string($arExtend,$arParameters['InvoiceMark']); //合併共同參數及延伸參數 return array_merge($arParameters,$arExtend) ; } - + static function CheckOut($target = "_self",$arParameters = array(),$arExtend = array(),$HashKey='',$HashIV='',$ServiceURL=''){ - + $arParameters = self::process($arParameters,$arExtend); //產生檢查碼 $szCheckMacValue = CheckMacValue::generate($arParameters,$HashKey,$HashIV,$arParameters['EncryptType']); - + //生成表單,自動送出 $szHtml = ''; $szHtml .= '