Mohammed Khalid Khan
Mohammed Khalid Khan

Reputation: 147

Ezidebit Payment Gateway createSchedule not working

I am facing below error while calling Ezidebit SOAP call.

a:ActionNotSupportedThe message with Action 'https://api.demo.ezidebit.com.au/v3-5/nonpci' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None)

Here is the link of EZIDEBIT createSchedule:

https://www.getpayments.com/docs/#createschedule

$xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:px="https://px.ezidebit.com.au/">
            <soapenv:Header />
            <soapenv:Body>
              <px:CreateSchedule>
                <px:DigitalKey>49A67D1B-DF3F-4013-B13A-A5E9E41E8873</px:DigitalKey>
                <px:EziDebitCustomerID />
                <px:YourSystemReference>102</px:YourSystemReference>
                <px:ScheduleStartDate>2011-03-05</px:ScheduleStartDate>
                <px:SchedulePeriodType>W</px:SchedulePeriodType>
                <px:DayOfWeek>MON</px:DayOfWeek>
                <px:DayOfMonth>5</px:DayOfMonth>
                <px:FirstWeekOfMonth>Y</px:FirstWeekOfMonth>
                <px:SecondWeekOfMonth>Y</px:SecondWeekOfMonth>
                <px:ThirdWeekOfMonth>Y</px:ThirdWeekOfMonth>
                <px:FourthWeekOfMonth>Y</px:FourthWeekOfMonth>
                <px:PaymentAmountInCents>4000</px:PaymentAmountInCents>
                <px:LimitToNumberOfPayments>4</px:LimitToNumberOfPayments>
                <px:LimitToTotalAmountInCents>0</px:LimitToTotalAmountInCents>
                <px:KeepManualPayments>NO</px:KeepManualPayments>
                <px:Username>WebServiceUser</px:Username>
              </px:CreateSchedule>
            </soapenv:Body>
          </soapenv:Envelope>';   // data from the form, e.g. some ID number

       $headers = array(
                    "Content-type: text/xml;charset=\"utf-8\"",
                    "Accept: text/xml",
                    "Cache-Control: no-cache",
                    "Pragma: no-cache",
                    "SOAPAction: https://api.demo.ezidebit.com.au/v3-5/nonpci", 
                    "Content-length: ".strlen($xml_post_string),
                ); //SOAPAction: your op URL

        $url = "https://api.demo.ezidebit.com.au/v3-5/nonpci";

        // PHP cURL  for https connection with auth
        $soap_do = curl_init();
        curl_setopt($soap_do, CURLOPT_URL, $url );
        curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
        curl_setopt($soap_do, CURLOPT_TIMEOUT,        10);
        curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
        curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($soap_do, CURLOPT_POST,true);
        curl_setopt($soap_do, CURLOPT_POSTFIELDS, $xml_post_string);
        curl_setopt($soap_do, CURLOPT_HTTPHEADER, $headers);
        $content  = curl_exec($soap_do);
        if(curl_exec($soap_do) === false) {
          $err = 'Curl error: ' . curl_error($soap_do);
          curl_close($soap_do);
          print $err;
        } else {
          curl_close($soap_do);

        }
        print_r($content);
        // converting
        $response1 = str_replace("<soap:Body>","",$content);
        $response2 = str_replace("</soap:Body>","",$response1);

        // convertingc to XML
        $parser = simplexml_load_string($response2);

        // user $parser to get your data out of XML response and to display it.

Upvotes: 0

Views: 592

Answers (2)

Peter Scott
Peter Scott

Reputation: 1316

Expanding on Mohammed's comment advising that he had resolved the issue which was related to the soapActionURL http header value being the root cause I searched and came across Ezidebit EditCustomerDetails not working which suggested that the SoapAction should look something like https://px.ezidebit.com.au/INonPCIService/EditCustomerDetails

I found that by looking at https://api.demo.ezidebit.com.au/v3-5/nonpci?wsdl I was able to construct the correct soapActionURL value which in the case of createSchedule would look be https://px.ezidebit.com.au/INonPCIService/CreateSchedule

Upvotes: 1

Ezidebit
Ezidebit

Reputation: 1

I work in the Integration Services Team at Ezidebit and this does sound like a TLS related issue.

Could you confirm if you version OpenSSL supports TLS1.2? The error message could indicate that you are not connecting with the correct security protocol. For more information on Ezidebit regarding SSL changes please refer to this link https://www.ezidebit.com/en-au/ssl-infrastructure, otherwise our helpful integration services team can assist further with your integration by raising a service request https://ezidebit.secure.force.com/online/contactus?country=au

Regards,

George

Upvotes: 0

Related Questions