2017-07-04 86 views
0

我創建一個信用卡支付模塊的Prestashop 1.7的Prestashop 1.7支付模塊

我不知道如何發送針對外部URL我的崗位值,如果該交易就是成功或失敗的接收其響應。

回答

0

你必須做出這樣的事情:

  • 做一個模塊(https://validator.prestashop.com/generator),並與PaymentModule,而不僅僅是模塊擴展 它。
  • 註冊有趣的掛鉤(http://build.prestashop.com/news/module-development-changes-in-17/),使這樣的功能您的模塊中:

    public function hookHookName($params) { 
        // Do things here 
    } 
    
  • 播放與此掛鉤專門(第一部分是鉤的名字和第二是$ params)方法:

    Hook::exec('actionValidateOrder', array(
        'cart' => $this->context->cart, 
        'order' => $order, 
        'customer' => $this->context->customer, 
        'currency' => $this->context->currency, 
        'orderStatus' => $order_status 
    )); 
    
  • 在驗證任何內容之前,在該時刻撥打電話(例如curl/file_get_contents)。
  • 知道如何做到這一點的好方法可能是下載貝寶模塊(免費),看看他們是如何做到的。