eWay Payment Gateway

后端 未结 3 632
说谎
说谎 2021-01-20 04:00

I\'m trying to implement the recurring web service from eway(australia).How ever I could not get it to work.

I keep on getting the messeage

\"The element \'

3条回答
  •  半阙折子戏
    2021-01-20 04:24

    What I tried to create eWay recurring billing and customer, hope it will help for others new :)

       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 "
    ";echo "
    "; // print_r($response); echo $result = $response->CreateRebillCustomerResult->Result;echo "
    "; echo $customerId = $response->CreateRebillCustomerResult->RebillCustomerID;echo "
    "; echo "
    "; if($result=='Success' AND $customerId){ echo 'Member Created at eWay Successfully!...
    '; echo 'Creating Recurring Billing Cycle on eWay,Please wait......
    '; //$UpdateRebillCustomer = CreateRebillEvent($customerId); //print_r($UpdateRebillCustomer); } else{ echo $ErrorSeverity = $response->CreateRebillCustomerResult->ErrorSeverity;echo "
    "; echo $ErrorDetails = $response->CreateRebillCustomerResult->ErrorDetails;echo "
    "; } } 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 "
    "; echo $result2 = $response->CreateRebillEventResult->Result;echo "
    "; echo $RebillCustomerID = $response->CreateRebillEventResult->RebillCustomerID;echo "
    "; if($result2=='Success'){ echo 'Recurring Cycle Created Successfully at eWay!...
    '; echo 'Member Id is ===>'.$RebillCustomerID; //$UpdateRebillCustomer = CreateRebillEvent($customerId); //print_r($UpdateRebillCustomer); } else{ echo $ErrorSeverity = $response->CreateRebillEventResult->ErrorSeverity;echo "
    "; echo $ErrorDetails = $response->CreateRebillEventResult->ErrorDetails;echo "
    "; } } catch(SOAPFault $e){ print $e; } } ?>

提交回复
热议问题