PHP SOAP如何传入复杂对象

Paymentexpress有一个SOAP服务方法Check3dsEnrollment(String username,String password, EnrolmentCheckRequest transaction).第三个参数是复杂参数,包括如下属性: acmout,cardNumber,dateExpiry,txnDescription,txnRef,currency

在php SOAP中使用数组来传入复杂参数,代码例如下:

    $soapClient = new SoapClient(‘https://www.paymentexpress.com/WSTest/PXWS.asmx?WSDL‘);
    $transactionDetails = array(
        ‘acmout‘=>‘12.35‘,
        ‘cardNumber‘=>‘‘,
        ‘dateExpiry‘=>‘1010‘,
        ‘txnDescription‘=>‘Payment Test‘,
        ‘txnRef‘=>‘PT937459‘,
        ‘currency‘=>‘USD‘,
    );
    $param=array(
        ‘postUsername‘       => ‘My_Dev‘,
        ‘postPassword‘       => ‘My_Password‘,
        ‘transactionDetails‘ => $transactionDetails,
    );
    $ret  = $soapClient->Check3dsEnrollment($param);
    print_r($ret);

 

PHP SOAP如何传入复杂对象,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。