Php 通道沙箱通道
我正在开发一个网站,连接威威。我试图在沙箱中重新打包客户。但电话中出现了一些错误Php 通道沙箱通道,php,xml,soap,Php,Xml,Soap,我正在开发一个网站,连接威威。我试图在沙箱中重新打包客户。但电话中出现了一些错误 <?php $url = "https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx"; $post_string = '<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.o
<?php
$url = "https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx";
$post_string = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
<eWAYCustomerID>9194****</eWAYCustomerID>
<Username>******@********d.com.sand</Username>
<Password>S******55</Password>
</eWAYHeader>
</soap:Header>
<soap:Body>
<CreateRebillCustomer xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
<customerTitle>Mr</customerTitle>
<customerFirstName>Achintha</customerFirstName>
<customerLastName>Samindika</customerLastName>
<customerAddress>SID Designs</customerAddress>
<customerSuburb>Colombo</customerSuburb>
<customerState>ACT<</customerState>
<customerCompany>SID Con</customerCompany>
<customerPostCode>2111</customerPostCode>
<customerCountry>Australia</customerCountry>
<customerEmail>a****@ymail.com</customerEmail>
<customerFax>0298989898</customerFax>
<customerPhone1>0298989558</customerPhone1>
<customerPhone2>0295489898</customerPhone2>
<customerRef>REF585</customerRef>
<customerJobDesc>Dev</customerJobDesc>
<customerComments>Please Ship ASASP</customerComments>
<customerURL>www.****.com</customerURL>
</CreateRebillCustomer>
</soap:Body>
</soap:Envelope>';
$header = "POST /gateway/rebill/test/manageRebill_test.asmx HTTP/1.1 \r\n";
$header .= "Host: www.eway.com.au \r\n";
$header .= "Content-Type: text/xml; charset=utf-8 \r\n";
$header .= "Content-Length: ".strlen($post_string)." \r\n";
//$header .= 'SOAPAction: "http://www.eway.com.au/gateway/rebill/manageRebill/CreateRebillCustomer"'. "\r\n";
$header .= "Connection: close \r\n\r\n";
$header .= $post_string;
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);
$data = curl_exec($ch);
$status = curl_getinfo($ch);
if(curl_errno($ch))
print curl_error($ch);
else{
curl_close($ch);
echo '<pre>';
print_r($data);
print_r($status);
echo '</pre>';
//echo '<div align="center"><h3>Thank you.</h3></div>';
}
?>
你能试试这个吗。修改了一些标题
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:man="https://www.eway.com.au/gateway/managedpayment">
<soapenv:Header>
<man:eWAYHeader>
<man:eWAYCustomerID></man:eWAYCustomerID>
<man:Username></man:Username>
<man:Password></man:Password>
</man:eWAYHeader>
</soapenv:Header>
<soapenv:Body>
<man:CreateCustomer>
<man:Title></man:Title>
<man:FirstName></man:FirstName>
<man:LastName></man:LastName>
<man:Address></man:Address>
<man:Suburb></man:Suburb>
<man:State></man:State>
<man:Company></man:Company>
<man:PostCode></man:PostCode>
<man:Country></man:Country>
<man:Email></man:Email>
<man:Fax></man:Fax>
<man:Phone></man:Phone>
<man:Mobile></man:Mobile>
<man:CustomerRef></man:CustomerRef>
<man:JobDesc></man:JobDesc>
<man:Comments></man:Comments>
<man:URL></man:URL>
<man:CCNumber></man:CCNumber>
<man:CCNameOnCard></man:CCNameOnCard>
<man:CCExpiryMonth></man:CCExpiryMonth>
<man:CCExpiryYear></man:CCExpiryYear>
</man:CreateCustomer>
</soapenv:Body>
</soapenv:Envelope>
请替换您的占位符。希望有效。请使用以下空格
$data = array('salutation' => 'Mr', 'first_name' => 'Joe', 'last_name' => 'Bloggs', 'address' => 'Bloggs', 'city' => 'Capital City', 'state' => 'ACT', 'company' => 'Bloggs','postcode' => '2111', 'country' => 'Australia', 'email' => 'test3@eway.com.au', 'phone' => '0297979797', 'fax' => '0298989898', 'cusRef' => 'Ref123', 'customerComments' => 'Please Ship ASASP', 'cusURL' => 'https://www.eway.com.au');
$xml = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:man="http://www.eway.com.au/gateway/rebill/manageRebill">
<soap:Header>
<eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
<eWAYCustomerID>SandboxCustomerID</eWAYCustomerID>
<Username>Username</Username>
<Password>Password</Password>
</eWAYHeader>
</soap:Header>
<soap:Body>
<CreateRebillCustomer xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
<customerTitle>' . $data["salutation"] . '</customerTitle>
<customerFirstName>' . $data["first_name"] . '</customerFirstName>
<customerLastName>' . $data["last_name"] . '</customerLastName>
<customerAddress>' . $data["address"] . '</customerAddress>
<customerSuburb>' . $data["city"] . '</customerSuburb>
<customerState>' . $data["state"] . '</customerState>
<customerCompany>' . $data["company"] . '</customerCompany>
<customerPostCode>' . $data["postcode"] . '</customerPostCode>
<customerCountry>' . $data["country"] . '</customerCountry>
<customerEmail>' . $data["email"] . '</customerEmail>
<customerFax>' . $data["fax"] . '</customerFax>
<customerPhone1>' . $data["phone"] . '</customerPhone1>
<customerPhone2/>
<customerRef>' . $data["cusRef"] . '</customerRef>
<customerJobDesc/>
<customerComments>' . $data["customerComments"] . '</customerComments>
<customerURL>' . $data["cusURL"] . '</customerURL>
</CreateRebillCustomer>
</soap:Body>
</soap:Envelope>';
$ch = curl_init('https://www.eway.com.au/gateway/rebill/manageRebill.asmx');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo "<pre>";
print_r($output);
我在中遇到语法错误
ACT
这对我来说非常好
$data=array(“问候语”=>“先生”、“名字”=>“乔”、“姓氏”=>“布洛格斯”、“地址”=>“布洛格斯”、“城市”=>“首都”、“州”=>“法案”、“公司”=>“布洛格斯”、“邮编”=>“2111”、“国家”=>“澳大利亚”、“电子邮件”=>)test3@eway.com.au“,”电话“=>”029797“,”传真“=>”02989898“,”cusRef“=>”Ref123“,”客户指令“=>”请尽快发货P','cusURL'=>'https://www.eway.com.au');
$xml='0
沙盒客户ID
用户名
密码
“.$data[“敬礼”]”
“.$data[“first_name”]”
“.$data[“姓氏”]”
“.$data[“地址”]”
“.$data[“城市”]”
“.$data[“state”]”
“.$data[“公司”]”
“.$data[“邮政编码”]”
“.$data[“国家”]”
“.$data[“电子邮件”]”
“.$data[“传真”]”
“.$data[“phone”]”
“.$data[“cusRef”]”
“.$data[“customerComments”]”
“.$data[“cusURL”]”
';
$ch=curl\u init('https://www.eway.com.au/gateway/rebill/manageRebill.asmx');
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);
卷曲设置($ch,卷曲设置桩,1);
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-Type:text/xml'));
curl_setopt($ch,CURLOPT_POSTFIELDS,“$xml”);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$output=curl\u exec($ch);
卷曲关闭($ch);
回声“;
打印(输出);
它没有插入网关。eway支持人员告知标题格式错误。我需要有关安装eway重新计费支付选项的帮助。只是想知道您是否可以帮我一点忙?请告诉我,谢谢
<?php
$url = "https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx";
$post_string = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
<eWAYCustomerID>9194****</eWAYCustomerID>
<Username>******@********d.com.sand</Username>
<Password>S******55</Password>
</eWAYHeader>
</soap:Header>
<soap:Body>
<CreateRebillCustomer xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
<customerTitle>Mr</customerTitle>
<customerFirstName>Achintha</customerFirstName>
<customerLastName>Samindika</customerLastName>
<customerAddress>SID Designs</customerAddress>
<customerSuburb>Colombo</customerSuburb>
<customerState>ACT</customerState>
<customerCompany>SID Con</customerCompany>
<customerPostCode>2111</customerPostCode>
<customerCountry>Australia</customerCountry>
<customerEmail>a****@ymail.com</customerEmail>
<customerFax>0298989898</customerFax>
<customerPhone1>0298989558</customerPhone1>
<customerPhone2>0295489898</customerPhone2>
<customerRef>REF585</customerRef>
<customerJobDesc>Dev</customerJobDesc>
<customerComments>Please Ship ASASP</customerComments>
<customerURL>www.****.com</customerURL>
</CreateRebillCustomer>
</soap:Body>
</soap:Envelope>';
$header = "POST /gateway/rebill/test/manageRebill_test.asmx HTTP/1.1 \r\n";
$header .= "Host: www.eway.com.au \r\n";
$header .= "Content-Type: text/xml; charset=utf-8 \r\n";
$header .= "Content-Length: ".strlen($post_string)." \r\n";
//$header .= 'SOAPAction: "http://www.eway.com.au/gateway/rebill/manageRebill/CreateRebillCustomer"'. "\r\n";
$header .= "Connection: close \r\n\r\n";
$header .= $post_string;
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);
$data = curl_exec($ch);
$status = curl_getinfo($ch);
if(curl_errno($ch))
print curl_error($ch);
else{
curl_close($ch);
echo '<pre>';
print_r($data);
print_r($status);
echo '</pre>';
//echo '<div align="center"><h3>Thank you.</h3></div>';
}
?>
$data = array('salutation' => 'Mr', 'first_name' => 'Joe', 'last_name' => 'Bloggs', 'address' => 'Bloggs', 'city' => 'Capital City', 'state' => 'ACT', 'company' => 'Bloggs','postcode' => '2111', 'country' => 'Australia', 'email' => 'test3@eway.com.au', 'phone' => '0297979797', 'fax' => '0298989898', 'cusRef' => 'Ref123', 'customerComments' => 'Please Ship ASASP', 'cusURL' => 'https://www.eway.com.au');
$xml = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:man="http://www.eway.com.au/gateway/rebill/manageRebill">
<soap:Header>
<eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
<eWAYCustomerID>SandboxCustomerID</eWAYCustomerID>
<Username>Username</Username>
<Password>Password</Password>
</eWAYHeader>
</soap:Header>
<soap:Body>
<CreateRebillCustomer xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
<customerTitle>' . $data["salutation"] . '</customerTitle>
<customerFirstName>' . $data["first_name"] . '</customerFirstName>
<customerLastName>' . $data["last_name"] . '</customerLastName>
<customerAddress>' . $data["address"] . '</customerAddress>
<customerSuburb>' . $data["city"] . '</customerSuburb>
<customerState>' . $data["state"] . '</customerState>
<customerCompany>' . $data["company"] . '</customerCompany>
<customerPostCode>' . $data["postcode"] . '</customerPostCode>
<customerCountry>' . $data["country"] . '</customerCountry>
<customerEmail>' . $data["email"] . '</customerEmail>
<customerFax>' . $data["fax"] . '</customerFax>
<customerPhone1>' . $data["phone"] . '</customerPhone1>
<customerPhone2/>
<customerRef>' . $data["cusRef"] . '</customerRef>
<customerJobDesc/>
<customerComments>' . $data["customerComments"] . '</customerComments>
<customerURL>' . $data["cusURL"] . '</customerURL>
</CreateRebillCustomer>
</soap:Body>
</soap:Envelope>';
$ch = curl_init('https://www.eway.com.au/gateway/rebill/manageRebill.asmx');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo "<pre>";
print_r($output);