OFBiz-alipay配置文档

锁柱写的集成支付宝的文档

OFBiz-alipay配置文档
1.将支付宝的src下的com文件夹复制到本模块的src文件夹下,再把filters文件夹复制到刚才的com.alipay下.
2.在ecommerce模块的controller.xml中加入下面的代码:

<request-map uri="checkExternalPayment">
        <security https="true" direct-request="false"/>
        <event type="java" path="org.ofbiz.order.shoppingcart.CheckOutEvents" invoke="checkExternalPayment"/>
        <response name="none" type="request" value="emailorder"/>
        <response name="offline" type="request" value="emailorder"/>
        <response name="worldpay" type="request" value="callWorldPay"/>
        <response name="paypal" type="request" value="callPayPal"/>
        
        <response name="alipay" type="request" value="callAlipay"/><!-- Wang Suozhu 2009-07-07 addtion -->
        
        <response name="billact" type="request" value="emailorder"/>
        <response name="cod" type="request" value="emailorder"/>
        <response name="error" type="view" value="checkoutreview"/>
    </request-map>

    <request-map uri="callAlipay">
        <security https="true" direct-request="false"/>
        <event type="java" path="org.langhua.ofbiz.alipay.AlipayEvents" invoke="callAlipay"/>
        <response name="success" type="none"/>
        <response name="error" type="view" value="checkoutreview"/>
    </request-map>
    <request-map uri="alipay_return">
        <security https="false" auth="false"/>
        <event type="java" path="org.langhua.ofbiz.alipay.AlipayServices" invoke="alipayReturn"/>
        <response name="success" type="view" value="alipay_return"/>
    </request-map>
    <request-map uri="alipay_notify">
        <security https="false" auth="false"/>
        <event type="java" path="org.langhua.ofbiz.alipay.AlipayServices" invoke="alipayNotify"/>
        <response name="success" type="view" value="alipay_notify"/>
    </request-map>
   
<view-map name="alipay_return" type="screen" page="component://alipay/widget/alipay/AlipayScreens.xml#alipay_return"/>
    <view-map name="alipay_notify" type="screen" page="component://alipay/widget/alipay/AlipayScreens.xml#alipay_notify"/>

 
 
3.在PaymentMethodType 实体里加入支付宝这种字符方式(EXT_ALIPAY)

将支付宝这种支付方式加入产品店铺



4.在下面的付款方式页面中(checkoutopptions.ftl)加入支付宝的支付方式

代码如下:

<#if productStorePaymentMethodTypeIdMap.EXT_ALIPAY?exists>
                  <tr>
                    <td width="1%">
                      <input type="radio" name="checkOutPaymentId" value="EXT_ALIPAY" <#if "EXT_ALIPAY" == checkOutPaymentId>checked="checked"</#if>/>
                    </td>
                    <td width="50%">
                      <span class="tabletext">支付宝</span>
                    </td>
                  </tr>
                  </#if>

猜你喜欢

转载自jiasudu.iteye.com/blog/1768606