1. 程式人生 > 實用技巧 >PayPal Express Checkout Button 快捷支付在OPENCART中的使用

PayPal Express Checkout Button 快捷支付在OPENCART中的使用

參考:https://blog.csdn.net/shenenhua/article/details/102544931

第1步:登入 OpenCart 後臺,找到 “Extensions” > “Payments”找到“PayPal Express Checkout”,啟用它。

第2步:從官網找到金鑰, 填入 “API Details” 中對應的 API Username, Password, Signature

注:API 金鑰獲取地址:https://www.paypal.com/us/cgi-bin/webscr?cmd=_login-api-run

第3步:設定基本資訊

Test Mode:是否開啟沙盒模式 No

Debug Logging, 記錄相關技術報錯

Transaction Methods: Sale(直接銷售), Authorization (預授權), Order (訂購)

Total: 單筆最少結算金額

Geo Zone:All Zones

Default Currency: 預設貨幣

Status:Enabled (使用該模組)

Sort Order ,0 (0 最高優先)

Allow Customers to cancel Profiles (適用於 Recurring Payment 週期付款的客戶, 是否允許他們在網站取消 “週期付款”.)

Allow Notes, 是否允許買家留言

page background color

Logo, 公司標示

下面是最關鍵的地方了

找到伺服器中OPENCART的安裝檔案:

/catalog/view/theme/default/template/checkout/cart.tpl

在第127行處的<div class="pull-right">的後面,新增如下程式碼:

  1. <a href="http://www.你的域名.com/index.php?route=payment/pp_express/express" title="PayPal Express Checkout" style="text-decoration:none;">
  2. <img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-medium.png" alt="PayPal Express Checkout" style="float:left;"></a>

快取重新整理,大功告成。

3.0 在購物車設定按鈕:
/catalog/view/theme/default/template/checkout/cart.twig

<div class="pull-right"><a href="{{ checkout }}" class="btn btn-primary">{{ button_checkout }}</a>
<a href="/index.php?route=extension/payment/pp_express/express" title="PayPal Express Checkout" style="text-decoration:none;">
<img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-medium.png" alt="PayPal Express Checkout" style="float:left;"></a>
</div>
在 詳情頁設定按鈕: