繁体   English   中英

Prestashop 1.7付款模块

[英]Prestashop 1.7 Payment module

我正在为prestashop 1.7创建信用卡支付模块

如果交易成功或失败,我不知道如何在外部网址上发送帖子值并接收其响应。

你必须做这样的事情:

  • 制作一个模块( https://validator.prestashop.com/generator )并使用PaymentModule扩展它,而不仅仅是Module。
  • 注册有趣的钩子( 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)。
  • 知道如何做的一个好方法是下载Paypal模块(它是免费的)并查看他们是如何做到的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM