cancel
Showing results for 
Search instead for 
Did you mean: 

Process CC Payment with CIM Using Customer Profile ID and Payment Profile ID Numbers Only

Hi,

 

I am almost finished with a desktop application using SOAP and can create a CC payment transaction, get the transaction number back and go on and successfully create a new Customer Profile ID and Payment Profile ID in Authorize.net CIM.

 

All I am looking for now is a code example to now process a CC payment transaction using only the Customer Profile numbers that I already have obtained when creating the new customer profile.  I should be now able to create a CC payment transaction and only pass the two 8 digit numbers for the Customer and the CC with a total amount and process the payment.

 

My isssue is not coding or understanding how to code to Authorize.net, creating XML files, use POST, etc.  My issues seem to be weeding through the hundreds of pages, code samples, download PDF guides and pin-pointing the example I need.

 

Looking high an low for the code example above now for well over one hour and cannot find it.

 

Any links to point me in the correct location or directly would be greatly appreciated.

 

Pete,

psass
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

It's possible to use SOAP or XML, whichever you prefer.  Our API Reference provides an XML example.  Use the the Try It tab to test an actual transaction.

 

In particular, here is the XML structure on the Try It tab for creating a transaction using using a customer profile.  Please note where the customer profile and payment profile ID are located within the structure.

 

<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <merchantAuthentication>
    <name>API_LOGIN_ID</name>
    <transactionKey>API_TRANSACTION_KEY</transactionKey>
  </merchantAuthentication>
  <refId>123456</refId>
  <transactionRequest>
    <transactionType>authCaptureTransaction</transactionType>
    <amount>5</amount>
    <profile>
      <customerProfileId>27388924</customerProfileId>
      <paymentProfile>
        <paymentProfileId>25000332</paymentProfileId>
      </paymentProfile>
    </profile>
    <lineItems>
      <lineItem>
        <itemId>1</itemId>
        <name>vase</name>
        <description>Cannes logo </description>
        <quantity>18</quantity>
        <unitPrice>45.00</unitPrice>
      </lineItem>
    </lineItems>
    <poNumber>456654</poNumber>
    <shipTo>
      <firstName>China</firstName>
      <lastName>Bayles</lastName>
      <company>Thyme for Tea</company>
      <address>12 Main Street</address>
      <city>Pecan Springs</city>
      <state>TX</state>
      <zip>44628</zip>
      <country>USA</country>
    </shipTo>
    <customerIP>192.168.1.1</customerIP>
    <order>
      <invoiceNumber>INV-12345</invoiceNumber>
      <description>Product Description</description>
    </order>
  </transactionRequest>
</createTransactionRequest>

View solution in original post

4 REPLIES 4

Hello @psass

 

Our API Reference is a good place to look under Payment Transactions.  In particular, using createTransactionRequest and a profile to process a payment.

 

http://developer.authorize.net/api/reference/#payment-transactions-charge-a-customer-profile

 

Richard

RichardH
Administrator Administrator
Administrator

Hi Richard,

 

That I found earlier this morning.  But do I not need a SOAP version of this?  My code is being called out of a desktop application and all my other calls into Authorize.net needed a SOAP version and I created an SOAP:XML file and posted the XML file to Authorize.net and obtained a XML formatted string back that I parsed out to get the Customer Profile ID and Customer Payment ID for the credit card and store in a local SQL Server table. 

 

So now I want to do the same thing only bill to the Profile numbers and a total amount for the CC payment. 

 

Now to I use this example without SOAP?

Sorry for asking these questions, but I tried this code example and not go.

 

As an example, here is what I am doing in your SOAP examples and they all work 100%:

* --- BELOW IS SOAP VERSION OF XML FILE - (Simple Object Access Protocol)

* --- Build the CreateCustomerProfileFromTransaction XML string manually.

gcXML1='' && Nill out just in case not clear.

gcXML1=gcXML1+'<?xml version="1.0" encoding="UTF-8"?>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'<soapenv:Envelope xmlns:v1="https://api.authorize.net/soap/v1/"'+CHR(13)+CHR(10)

gcXML1=gcXML1+'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">'+CHR(13)+CHR(10)

gcXML1=gcXML1+'<soapenv:Header/>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'<soapenv:Body>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'<v1:CreateCustomerProfileFromTransaction>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'<v1:merchantAuthentication>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'<v1:name>&lcAPI_LOGIN</v1:name>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'<v1:transactionKey>&lcTRANSACTION_KEY</v1:transactionKey>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'</v1:merchantAuthentication>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'<v1:transId>&lcAUTHTRANS_ID</v1:transId>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'</v1:CreateCustomerProfileFromTransaction>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'</soapenv:Body>'+CHR(13)+CHR(10)

gcXML1=gcXML1+'</soapenv:Envelope>'+CHR(13)+CHR(10)

* --- Covert the XML string into a physical XML file. Left in for debugging purposes.

lnCreateXML = STRTOFILE(gcXML1, "createCustomerProfileRequest.XML")

 

Note: I had to pad in at the end of each XML line a hard carriage return and a line feed :  +CHR(13)+CHR(10)

 

I manually create the XML file wrapped in the SOAP header and body, call a string to file function to create the XML file and post it to Authorize.net server.  My response comes back and I have all the details in the repsonse string.

 

So I have a CC payment working inputting the CC # and CCV # and Name on Card and Zipcode plus total amount.  Now I am struggling with the very last thing to do, create a CC payment for a reoccuring customer using the 2 8 digit customer profile numbers, but cannot seem ot find the correct SOAP:XML code example.

 

Or are you telling me that I can take the XML code example "no SOAP calls at all" and this will work?

 

Pete,

 

 

 

 

Pete,

 

 

 

It's possible to use SOAP or XML, whichever you prefer.  Our API Reference provides an XML example.  Use the the Try It tab to test an actual transaction.

 

In particular, here is the XML structure on the Try It tab for creating a transaction using using a customer profile.  Please note where the customer profile and payment profile ID are located within the structure.

 

<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <merchantAuthentication>
    <name>API_LOGIN_ID</name>
    <transactionKey>API_TRANSACTION_KEY</transactionKey>
  </merchantAuthentication>
  <refId>123456</refId>
  <transactionRequest>
    <transactionType>authCaptureTransaction</transactionType>
    <amount>5</amount>
    <profile>
      <customerProfileId>27388924</customerProfileId>
      <paymentProfile>
        <paymentProfileId>25000332</paymentProfileId>
      </paymentProfile>
    </profile>
    <lineItems>
      <lineItem>
        <itemId>1</itemId>
        <name>vase</name>
        <description>Cannes logo </description>
        <quantity>18</quantity>
        <unitPrice>45.00</unitPrice>
      </lineItem>
    </lineItems>
    <poNumber>456654</poNumber>
    <shipTo>
      <firstName>China</firstName>
      <lastName>Bayles</lastName>
      <company>Thyme for Tea</company>
      <address>12 Main Street</address>
      <city>Pecan Springs</city>
      <state>TX</state>
      <zip>44628</zip>
      <country>USA</country>
    </shipTo>
    <customerIP>192.168.1.1</customerIP>
    <order>
      <invoiceNumber>INV-12345</invoiceNumber>
      <description>Product Description</description>
    </order>
  </transactionRequest>
</createTransactionRequest>

Hi Richard,

 

And the very good news for today is  . . . . see response return below:

<?xml version="1.0" encoding="utf-8"?><createTransactionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><refId>123456</refId>

<messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages>

<transactionResponse><responseCode>1</responseCode><authCode>2X1NOZ</authCode><avsResultCode>Y</avsResultCode><cvvResultCode />

<cavvResultCode>2</cavvResultCode><transId>2232425206</transId><refTransID /><transHash>CB87525BCAB10EF157920D7781985469</transHash>

<testRequest>0</testRequest><accountNumber>XXXX2011</accountNumber><accountType>Visa</accountType><messages><message><code>1</code>

<description>This transaction has been approved.</description></message></messages></transactionResponse></createTransactionResponse>

 

The XML worked right off the bat on the first try and I just created a CC payment transaction against the customer profile id + the payment profile CC id.  Got an "Ok" with return code of I00001.  Successful. nice to see.  So I am a thinking once you get use to using these API calls the rest of it follows pretty easily.  As I may have mentioned, my newbie issue is not coded or understanding what to do once I have the correct code example to use as my template, my issues is I am fumbling around finding things still.

 

By the way my main programming background is C++, C# and a lot of web.  You may have seen my first posting several weeks ago and this is the project with the software company in the US that have their entire POS and appointment applications coded in Visual FoxPro.  So I am kind of struggling a bit as well as I could not find one person anywhere that has integrated into your  Authorize.net CIM system using Visual FoxPro.

I think I maybe the first.

Back in the 80's I was programming in Clipper and have a fair amount of xBase experience as well.

 

Pete,