我正在尝试在付款信息部分添加额外数据,例如 银行名称 :xxxxx和 帐号< / em> :xxxxx。但我不知道添加额外数据的确切操作。我遵循的步骤:
在文件app/code/core/Mage/Checkout/etc/wsdl.xml
中添加了两个参数(param1,param2):
<message name="shoppingCartPaymentMethodRequest">
<part name="sessionId" type="xsd:string"/>
<part name="quoteId" type="xsd:int"/>
<part name="method" type="typens:shoppingCartPaymentMethodEntity"/>
<part name="storeId" type="xsd:string"/>
<part name="param1" type="xsd:string"/>
<part name="param2" type="xsd:string"/>
</message>
还为WS-I complience添加了。档案:app/code/core/Mage/Checkout/etc/wsi.xml
<xsd:element name="shoppingCartPaymentMethodRequestParam">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="sessionId" type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="quoteId" type="xsd:int" />
<xsd:element minOccurs="1" maxOccurs="1" name="paymentData" type="typens:shoppingCartPaymentMethodEntity" />
<xsd:element minOccurs="0" maxOccurs="1" name="store" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="param1" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="param2" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
在这里,我试图抓住这样的参数,但没有任何价值。
文件名:app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php
public function setPaymentMethod($quoteId, $paymentData, $store = null, $param1, $param2)
{
Mage::log($param1);
Mage::log($param2);
// extra code
}
以下是我的客户代码order-test.php
:
<?php
$user = 'user';
$password = '123456789';
$proxy = new SoapClient('http://example.com/index.php/api/v2_soap/?wsdl');
$sessionId = $proxy->login($user, $password);
// extra codes
$paymentMethod = array(
'method' => 'checkmo',
// also tried here passing two params (param1, param2)
);
// add payment method
$proxy->shoppingCartPaymentMethod($sessionId, $cartId, $paymentMethod, null, $param1, $param2);
// place the order
$orderId = $proxy->shoppingCartOrder($sessionId, $cartId, null, null);
var_dump($orderId);
?>
有人可以帮忙解决这个问题吗? 谢谢。
注意:没有传递额外的参数,它的工作正常。