CyberSource / cybersource-sdk-php

PHP SDK for Cybersource SOAP Toolkit API
Other
55 stars 57 forks source link

missingField ics_applications #31

Open juniormc opened 6 years ago

juniormc commented 6 years ago

Hello! I'm trying use runTransactionFromXml but when but when execute return this message from desision manager:

REJECT missingField => ics_applications

How to add field in xml string?

I run the subscription.php example and I have the same message

Thanks for your help.

itsdarrylnorris commented 6 years ago

Same issue

antonioandrade commented 6 years ago

I ran into the same issue when implementing eCheck debits using this SDK - no sample code would work as expected. After some back and forth, I was able to get transactions through. The key change was adding:

<ics_applications>ics_ecp_debit</ics_applications>

$client = new CybsSoapClient();
$merchantId = 'MERCHANT_ID';
$refCode = 'REF-' . time();

$xmlRequest = <<<XML
<requestMessage>
    <merchantID>{$merchantId}</merchantID>
    <merchantReferenceCode>{$refCode}</merchantReferenceCode>
    <billTo>
        <firstName>First</firstName>
        <lastName>Last</lastName>
        <street1>Address</street1>
        <city>City</city>
        <state>State</state>
        <postalCode>1234</postalCode>
        <country>Country</country>
        <phoneNumber>000-000-0000</phoneNumber>
        <email>email@example.org</email>
    </billTo>
    <purchaseTotals>
        <currency>USD</currency>
        <grandTotalAmount>10</grandTotalAmount>
    </purchaseTotals>
    <check>
        <accountNumber>111</accountNumber>
        <accountType>c</accountType>
        <bankTransitNumber>021000021</bankTransitNumber>
    </check>
    <ics_applications>ics_ecp_debit</ics_applications>
    <ecDebitService run="true"/>
</requestMessage>
XML;

$reply = $client->runTransactionFromXml($xmlRequest, $refCode);

This is clearly under-documented but you can find reference to the _icsapplications field on this document (page 123 for instance): http://apps.cybersource.com/library/documentation/dev_guides/Electronic_Checks_IG/Electronic_Checks_ENT.pdf

rhoerr commented 4 years ago

For anyone else that runs into this error: ics_applications is an internal processing thing on CyberSource's side, and is not indicative of the actual input error.

In my case, it was because PHP SoapClient was converting my ccAuthService run="true" boolean into ccAuthService run="1" for the actual request. It has to be literal true or false. Getting that changed from boolean true to string true worked fine.

<ccAuthService run="true" />