- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试从 eway(澳大利亚)实现定期 Web 服务。但是我无法让它工作。
我一直在收到消息
“ namespace ‘http://www.eway.com.au/gateway/rebill/manageRebill’中的元素‘rebillCustomerCreate’内容不完整。预期的可能元素列表:‘CustomerRef’。”
这是 WSDL:https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx?wsdl
我是 SOAP 的新手。试图在 PHP 中实现它。谁能指出我做错了什么?
这是我的 php 代码:
<?php
$URL = "https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx?wsdl";
$option = array("trace"=>true);
$client = new SOAPClient($URL, $option);
$functions = $client->__getFunctions();
$headeroptions =array('eWAYCustomerID'=>"87654321",'Username'=>"test@eway.com.au","Password"=>"test");
$header = new SOAPHeader('http://www.eway.com.au/gateway/rebill/manageRebill', 'eWAYHeader',$headeroptions);
$bodyoptions = array(
"customerTitle" => "Mr",
"customerFirstName" => "firstname",
"customerLastName" => "lastname",
"customerAddress" => "address",
"customerSuburb" => "someniceplace",
"customerState" => "somenicestate",
"customerCompany" => "somecompany",
"customerPostCode" => "411026",
"customerCountry" => "australia",
"customerEmail" => "test@eway.com",
"customerFax" => "123456",
"customerPhone1" => "123456",
"customerPhone2" => "123456",
"customerRef" => "abc123",
"customerJobDesc" => "Developer",
"customerComments" => "Make it work",
"customerURL" => "www.nicesite.com"
);
try{
$response = $client->__soapCall("CreateRebillCustomer", $bodyoptions,NULL,$header,$outputHeader);
echo $client->__getLastRequest();
//$response = $client->CreateRebillCustomer($bodyoptions);
var_dump($response);
} catch(SOAPFault $e){
print $e;
}
?>
最佳答案
我尝试创建 eWay 循环计费和客户,希望它能对其他新人有所帮助:)
<?php
$URL = "https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx?wsdl";
$option = array("trace"=>true);
$client = new SOAPClient($URL, $option);
$functions = $client->__getFunctions();
$headeroptions =array('eWAYCustomerID'=>"87654321",'Username'=>"test@eway.com.au","Password"=>"test123");
$header = new SOAPHeader('http://www.eway.com.au/gateway/rebill/manageRebill', 'eWAYHeader',$headeroptions);
$bodyoptions = array(
"CreateRebillCustomer" => array(
"customerTitle" => "Mr",
"customerFirstName"=>"Muhammad",
"customerLastName"=>"Shahzad",
"customerAddress"=>"cust ome rAddress",
"customerSuburb"=>"customer Suburb",
"customerState"=>"ACT",
"customerCompany"=>"customer Company",
"customerPostCode"=>"2345",
"customerCountry"=>">Australia",
"customerEmail"=>"test@gamil.com",
"customerFax"=>"0298989898",
"customerPhone1"=>"0297979797",
"customerPhone2"=>"0297979797",
"customerRef"=>"Ref123",
"customerJobDesc"=>"customerJobDesc",
"customerComments"=>"customerComments",
"customerURL" => "http://www.acme.com.au"
)
);
try{
$response = $client->__soapCall("CreateRebillCustomer", $bodyoptions,NULL,$header,$outputHeader);
//echo $client->__getLastRequest();
//$response = $client->CreateRebillCustomer($bodyoptions);
//echo "<pre>";echo "<br/>";
// print_r($response);
echo $result = $response->CreateRebillCustomerResult->Result;echo "<br/>";
echo $customerId = $response->CreateRebillCustomerResult->RebillCustomerID;echo "<br/>";
echo "<br/>";
if($result=='Success' AND $customerId){
echo 'Member Created at eWay Successfully!...<br/>';
echo 'Creating Recurring Billing Cycle on eWay,Please wait......<br/>';
//$UpdateRebillCustomer = CreateRebillEvent($customerId);
//print_r($UpdateRebillCustomer);
}
else{
echo $ErrorSeverity = $response->CreateRebillCustomerResult->ErrorSeverity;echo "<br/>";
echo $ErrorDetails = $response->CreateRebillCustomerResult->ErrorDetails;echo "<br/>";
}
}
catch(SOAPFault $e){
print $e;
}
if($customerId){
$bodyoptions2 = array(
"CreateRebillEvent " => array(
"RebillCustomerID" => $customerId,
"RebillInvRef" => "Ref123",
"RebillInvDes"=>"description",
"RebillCCName"=>"Mr Andy Person",
"RebillCCNumber"=>"4444333322221111",
"RebillCCExpMonth"=>"12",
"RebillCCExpYear"=>"15",
"RebillInitAmt"=>"100",
"RebillInitDate"=>date('d/m/Y'),
"RebillRecurAmt"=>"200",
"RebillStartDate"=>date('d/m/Y'),
"RebillInterval"=>"31",
"RebillIntervalType"=>"1",
"RebillEndDate"=>"31/12/2013",
)
);
try{
$response = $client->__soapCall("CreateRebillEvent", $bodyoptions2,NULL,$header,$outputHeader);
//echo $client->__getLastRequest();
//print_r($response);
echo "<br/>";
echo $result2 = $response->CreateRebillEventResult->Result;echo "<br/>";
echo $RebillCustomerID = $response->CreateRebillEventResult->RebillCustomerID;echo "<br/>";
if($result2=='Success'){
echo 'Recurring Cycle Created Successfully at eWay!...<br/>';
echo 'Member Id is ===>'.$RebillCustomerID;
//$UpdateRebillCustomer = CreateRebillEvent($customerId);
//print_r($UpdateRebillCustomer);
}
else{
echo $ErrorSeverity = $response->CreateRebillEventResult->ErrorSeverity;echo "<br/>";
echo $ErrorDetails = $response->CreateRebillEventResult->ErrorDetails;echo "<br/>";
}
}
catch(SOAPFault $e){
print $e;
}
}
?>
关于php - eWay支付网关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6028713/
我为此使用 eWay 支付网关,我使用 URL 来发布数据 https://secure-au.sandbox.ewaypayments.com/Process 但得到这样的回应:{"Message"
我目前正在使用一家名为 eWAY 的公司的信用卡 SDK 编写一个 iOS 应用程序。 我试图让它在沙盒测试环境中工作,但我一直收到空错误。 NSLog 输出(“EWAY ERROR”是我的 NSLo
我在表单中创建了 eway paynow 按钮。 Name: 在加载电子支付之前,我需要检查 customer_name 字段是否为空形式。如果 customer_name
我想使用 eWay ( http://eway.com.au ) 作为支付网关,但问题是它不允许在其托管页面上进行太多自定义。我想显示客户会付费的产品,但这是不可能的,所以我想也许只是将托管页面敲入
我在使用 eWay 网络服务时遇到问题。 我通过 wsimport 使用 https://www.eway.com.au/gateway/rebill/test/manageRebill_test.a
我要集成 eway token 支付集成,但我正面临这个问题。 SoapFault exception: [HTTP] Bad Request wsdl文件在这里 https://www.eway.c
我有这个代码: 如何通过 Javascript 函数设置数据量? 最佳答案 你可以试试看 (假设您只对脚本元素设置了 eway-paynow-button 类) document.getEleme
如何使用 js/jquery 动态更改以下脚本的数据量? 最佳答案 $('script.eway-paynow-button').attr('data-amount',
我是一名优秀的程序员,十分优秀!