Changes

m
no edit summary
Line 1: Line 1:  +
<!-- BEGIN interlang links -->
 +
<!-- Do NOT edit this section
 +
    Links below are automatically managed by PolyglotBot
 +
    You can edit links on the English source page : Online_payment_system -->
 +
[[en:Online_payment_system]]
 +
<!-- END interlang links -->
 +
 
{{Template开发文档}}
 
{{Template开发文档}}
   −
Dolibarr provide native modules to make online payments of your invoices, orders, membership, registration to events...
+
Dolibarr提供原生模块来在线支付您的发票,订单,会员资格,活动注册费...  
The native payment modules are Paypal and Stripe. But you can add you own modules to support other payment services.
     −
For this, you must create a module ([[Module_development]]) that implement the following hooks for the context "newpayment" :
+
原生支付模块是Paypal和Stripe。但您可以添加自己的模块来支持其他支付服务。
 +
 
 +
= Main process =
 +
 
 +
为此,您必须创建一个模块([[Module_development]]),该模块为上下文“newpayment”实现以下hooks:
    
*doValidatePayment
 
*doValidatePayment
Line 12: Line 22:  
*isPaymentOK
 
*isPaymentOK
    +
==Hook doValidatePayment==
 +
返回您的支付模式的代码(用在不同的申请地)
 +
 +
==Hook doCheckStatus==
 +
未使用
 +
 +
==Hook doAddButton==
 +
定义要添加到付款页面 '''/public/payments/newpayment.php''' 的按钮
   −
== Hook doValidatePayment ==
+
==Hook doPayment==
To return a code for your payment mode (used at different place of Application)
+
显示付款表单。在页面'''/public/payments/newpayment.php''' 上选择您的支付服务后,将显示该表单。
   −
== Hook doCheckStatus ==
+
此页必须设置会话变量 $_SESSION['TRANSACTIONID'](例如"YYYYMMDDHHMMSS-abc")和 $_SESSION["FinalPaymentAmt"](例如"123")以及 $_SESSION['currencyCodeType'](例如"USD")。
Not usefull
     −
== Hook doAddButton ==
+
它们将由付款后调用的页面 '''/public/payment/paymentok.php''' 使用。
To define the button to add on the payment page '''/public/payments/newpayment.php'''
     −
== Hook doPayment ==
+
==Hook isPaymentOK==
To show a form to show to make the payment. The form will be show after selecting your payment service on the page '''/public/payments/newpayment.php.''' This page must set the session variable $_SESSION['TRANSACTIONID'] (For example "YYYYMMDDHHMMSS-abc") and $_SESSION["FinalPaymentAmt"] (For example "123") and $_SESSION['currencyCodeType']  (for example "USD"). They will be used by the page called after payment '''/public/payment/paymentok.php'''
+
在进入回退页面 '''/public/payment/paymentok.php''' 时判断付款是否正常。
   −
== Hook isPaymentOK ==
+
如果正常,则完成其余的常见操作(注册付款,修改对象状态),如果不正常,则除了显示错误消息之外什么也不做。
to say if a payment is ok or not when entering the fallbackpage  '''/public/payment/paymentok.php'''. If ok, the rest of common actions are done (payment registered, status of object modified), if not nothing is done except showing an error message.