eWay支付网关

2023-12-10

我正在尝试实现来自 eway(澳大利亚)的定期网络服务。但是我无法让它工作。

我不断收到消息

“命名空间 ' 中的元素 'rebillCustomerCreate'http://www.eway.com.au/gateway/rebill/manageRebill' 内容不完整。预期的可能元素列表:“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'=>"[email protected]","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" => "[email protected]",
    "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'=>"[email protected]","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"=>"[email protected]",
                          "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;
         }

         }

      ?>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

eWay支付网关 的相关文章

随机推荐

  • MAMP PEAR 配置指向本地目录

    我正在使用 MAMP 2 0 5 升级 PEAR 时遇到问题 MAMP 如何升级 PEAR 问题是 PEAR 始终安装在 本地 PEAR 目录中 而不是 MAMP PEAR 目录中 我的 MAMP PEAR 配置如下 sudo Applic
  • WordPress MD5 密码

    我需要通过 PHP 脚本或 MySQL 将用户插入到 Wordpress 博客中 并且我有一个纯文本密码 我想我可以做这样的事情 query INSERT INTO new db wp users user login user pass
  • 将word文档解析为excel文件

    我有一个 Word 文档 其中包含我想要解析为 Excel 文件的数据 源文件长达数百页 我一直在使用 VBA 但我刚刚开始学习该语言 并且在尝试输入 doc 文件时遇到了很多困难 我已经能够使用Open和线路输入语句从 txt 文件中检索
  • Python 中动态表单的 Web Scraper

    我正在尝试填写该网站的表格http www marutisuzuki com Maruti Price aspx 它由三个下拉列表组成 一是汽车型号 二是州 三是城市 前两个是静态的 第三个城市是根据州的值动态生成的 有一个 onclick
  • 如果任何字段包含 NULL,MySQL CONCAT 将返回 NULL

    我的表 设备 中有以下数据 affiliate name affiliate location model ip os type os version cs1 inter Dell 10 125 103 25 Linux Fedora cs
  • Google Apps 脚本表单:e.namedValues 不记录任何内容

    我有一个非常基本的 Google Apps 表单 其中包含两个问题 资源 带有两个选项的单选按钮 和名称 文本字段 我想在提交时选择表单值 因此我设置了一个触发器 在表单提交时 来调用函数 function onFormSubmit e L
  • Perl,使脚本在x秒后超时?

    我一直在搜索这个问题 但令人惊讶的是很难得到一个直接的答案 因为 php 似乎有关于这个主题的更多信息 我需要让我的 perl 脚本在指定的秒数后终止 因为 就像现在一样 它们运行时间太长并堵塞了我的系统 我怎样才能使整个脚本在指定的秒数后
  • Java-改变秋千背景颜色?

    好的 我得到了一个使用 系统 外观的 Swing 应用程序 现在 我想将主面板的背景颜色更改为黑色 太容易了吧 UIManager put Panel background Color BLACK 是的 除了现在应用程序中的控件看起来很愚蠢
  • 如何获取 Windows 中所有打开的命名管道的列表?

    有没有一种简单的方法来测试命名管道是否正常工作 我想确保从应用程序发送的数据确实已发送 有没有一种快速简便的方法来获取所有命名管道的列表 在 Windows Powershell 控制台中 键入 System IO Directory Ge
  • 无法保存/传递父级对组合对象的引用

    在 C 中 它会是这样的struct A由 组成struct B和一些功能B获取指向父对象的指针A 所以函数为A调用该函数B将简单地通过this指向它的指针 我正在 Rust 中尝试此操作 但未能使其正常工作 这就是我想要实现的目标 str
  • 从经典 ASP 调用 COM 对象

    如何从经典 ASP 调用 COM 对象 我努力尝试但找不到好的教程 有什么建议吗 我在经典 ASP 中使用 C 要在经典 ASP 中实例化 COM 对象 Dim rs Set rs Server CreateObject ADODB Rec
  • lxml.html。读取文件时出错;无法加载外部实体

    我正在尝试使用 lxml html 解析从 YouTube 获取电影预告片 url from lxml import html import lxml html from lxml etree import XPath def get yo
  • solr 数据导入错误:索引失败。回滚所有更改

    当我运行 完全导入并清理 命令时 错误是 索引失败 回滚所有更改 我的数据导入配置文件
  • iAds 不适用于 iPad 应用程序吗?

    我有一个 iPad 应用程序 它需要 iAds 但在库中我找不到广告横幅视图 iAds 不适用于 iPad 吗 我使用的是 iOS SDK 4 1 在 iPad 应用程序中实施的其他替代方案是什么 您需要使用 iOS SDK 4 2 因为
  • ScalaTest 可以在没有同步调用的情况下检测超时吗(比如在无限循环中?)

    在下面的代码中 测试称为sleep优雅地失败 而测试freeze导致测试永远不会结束 import org scalatest FunSuite import org scalatest concurrent TimeLimitedTest
  • 如何将 C++ wstring UTF-8 字符打印到 Mac OS 或 Unix 终端?

    我怎样才能打印一个std wstring using std wcout 我尝试了以下推荐的方法here 但它仅适用于打印此 Hola 但不是这个日本 include
  • 在应用颜色的同时对图像应用阴影

    我正在根据 HSV 的 3 个滑块值更改汽车的颜色 我可以改变颜色 但感觉就像油漆 颜色改变后的图像没有原创性 我如何应用阴影和效果 我如何应用输入图像中的阴影和效果 您好 您可以参考下面的 C 代码 这里我仅更改色调值 如果您想更改饱和度
  • 在 C++ 中的向量向量上使用“unique()”

    我希望这不是一个重复的问题 但如果是 请随时为我指出正确的方向 我有一个vector
  • 当不支持-XX:+PrintFlagsFinal时如何找到默认的MaxPermSize?

    我正在使用一个系统 其中可以同时启动许多作为 Java 应用程序实现的作业 每个作业都在单独的 JVM 中运行 其中一些工作需要比其他工作更大的永久元大小 然而 由于操作系统内存有限 让所有作业都使用最大值是不可行的 因此 我想指定 XX
  • eWay支付网关

    我正在尝试实现来自 eway 澳大利亚 的定期网络服务 但是我无法让它工作 我不断收到消息 命名空间 中的元素 rebillCustomerCreate http www eway com au gateway rebill manageR