この問題を解決しようとして大きな問題を抱えているので、この仕事を手伝ってくれる人に+500の報奨金を与えたいと思います。
基本的に、私はNusoapを使用してこのWebサービスを呼び出そうとしています。
https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx?op=QueryCustomer
これは私がこれまでに得たものです:
class Eway
{
var $username = 'test@eway.com.au';
var $pw = 'test123';
var $customerId = '87654321';
private function setHeaders($client)
{
$headers = <<<EOT
<eWAYHeader xmlns="http://www.eway.com.au/gateway/managedPayment">
<eWAYCustomerID>$this->customerId</eWAYCustomerID>
<Username>$this->username</Username>
<Password>$this->pw</Password>
</eWAYHeader>
EOT;
$client->setHeaders($headers);
return $client;
}
function getCustomer($ewayId = 9876543211000)
{
$url = 'https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx?WSDL';
$client = new Nusoap_client($url, true);
$this->setHeaders($client);
$args['QueryCustomer'] = array('managedCustomerID'=>$ewayId);
$result = $client->call('QueryCustomer', $args);
print_r($result);
}
}
このコードを実行すると$eway->getCustomer()
、次のエラーが発生しますか?
Array
(
[faultcode] => soap:Client
[faultstring] => eWayCustomerID, Username and Password needs to be specified in the soap header.
)
私は何が間違っているのですか?
私のクラスを修正し、テスト顧客IDを使用してQueryCustomerメソッドを実行し、その情報を返すことができる作業コードを提供していただければ、+500の担当者と私の永遠の感謝の気持ちをお伝えできることをうれしく思います。バウンティを開始できるようになるまでには明らかに48時間かかりますが、私はそれを行うことを約束します。