CyberSource / cybersource-sdk-php

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

Function ("createRequest") is not a valid method for this service #22

Open JEmlay opened 8 years ago

JEmlay commented 8 years ago

I already had auth code in place. It's very close to your auth code. Now we want to capture directly after the auth. Using the following URL for CyberSource is does not recognize "createRequest" as a valid method. I see zero "capture" documentation from WF online. Where did you get your capture code?

https://ics2ws.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.26.wsdl

geowulf commented 5 years ago

If you send

        <ccAuthService run="true"/>
        <ccCaptureService run="true"/>

in the same request you get a 'SALE' (or an immediate Auth/Capture)

otherwise you need to send the full capture request like this:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header>
    <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <wsse:UsernameToken>
        <wsse:Username>{{username}}</wsse:Username>
        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">{{password}}</wsse:Password>
      </wsse:UsernameToken>
    </wsse:Security>
  </soapenv:Header>
  <soapenv:Body>
    <requestMessage xmlns="urn:schemas-cybersource-com:transaction-data-{{version}}">
       <merchantID>{{username}}</merchantID>
      <merchantReferenceCode>{{invNumber}}</merchantReferenceCode>
      <purchaseTotals>
         <currency>USD</currency>
         <grandTotalAmount>15.00</grandTotalAmount>
      </purchaseTotals>
      <ccCaptureService run="true">
         <authRequestID>{{REQUEST_ID}}</authRequestID>
      </ccCaptureService>
</requestMessage>
  </soapenv:Body>
</soapenv:Envelope>