Reply
Member
Posts: 4
Registered: ‎07-27-2011
Accepted Solution

inegration of authorize.net with salesforce

Hi,

       i write a following class in salesforce for integration of salesforce with authorize.net.

 

 

 

Public class callExternalWS

 {

     public void invokeExternalWs()  

    {

         HttpRequest req = new HttpRequest();

   req.setMethod('POST');

   req.setEndpoint('https://api.authorize.net/soap/v1/Service.asmx');

 req.setHeader('Content-Type', 'text/xml; charset=utf-8');

 req.setHeader('SOAPAction', 'https://api.authorize.net/soap/v1/CreateCustomerProfile');

 string b ='<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CreateCustomerProfile xmlns="https://api.authorize.net/soap/v1/"><merchantAuthentication><name>4eU6Z2uy</name><transactionKey>74kZnM38y6PCz2x7</transactionKey></merchantAuthentication><profile><merchantCustomerId>98765421</merchantCustomerId><description>sample merchant</description><email>sravni_g@dskvap.com</email><paymentProfiles><CustomerPaymentProfileType><customerType>individual</customerType><payment><creditCard><cardNumber>6011000000000012</cardNumber><expirationDate>2012-12</expirationDate></creditCard></payment></CustomerPaymentProfileType></paymentProfiles></profile></CreateCustomerProfile></soap:Body></soap:Envelope>';   

       req.setBody(b);

         Http http = new Http();   

      try {   

                   HTTPResponse res = http.send(req);            

           System.debug(res.toString());

           System.debug('STATUS:'+res.getStatus());  

          System.debug('STATUS_CODE:'+res.getStatusCode()); 

        System.debug('response:'+res.getBody());    

        }

catch(System.CalloutException e)

{    

  }      

  }  }

 

 

 

 

i got a response message like this

 

 

 

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CreateCustomerProfileResponse xmlns="https://api.authorize.net/soap/v1/"><CreateCustomerProfileResult><resultCode>Error</resultCode><messages><MessagesTypeMessage><code>E00007</code><text>User authentication failed due to invalid authentication values.</text></MessagesTypeMessage></messages><customerProfileId>0</customerProfileId></CreateCustomerProfileResult></CreateCustomerProfileResponse></soap:Body></soap:Envelope>

 

 

how to fix this one.

 can any one help me.

 

thanks in advance


Accepted Solutions
Solution
Accepted by topic author sravani
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: inegration of authorize.net with salesforce

Sound like your are trying to use test account loginID and TransactionKey to the production server.

Change your post location to the test server https://apitest.authorize.net/soap/v1/Service.asmx

View solution in original post

Solution
Accepted by topic author sravani
‎08-21-2015 01:58 AM
Member
Posts: 4
Registered: ‎07-27-2011

Re: inegration of authorize.net with salesforce

thank u for ur reply

View solution in original post


All Replies
Solution
Accepted by topic author sravani
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: inegration of authorize.net with salesforce

Sound like your are trying to use test account loginID and TransactionKey to the production server.

Change your post location to the test server https://apitest.authorize.net/soap/v1/Service.asmx

Solution
Accepted by topic author sravani
‎08-21-2015 01:58 AM
Member
Posts: 4
Registered: ‎07-27-2011

Re: inegration of authorize.net with salesforce

thank u for ur reply

Contributor
Posts: 35
Registered: ‎01-15-2013

Re: inegration of authorize.net with salesforce

Can anyone guide me up in integration of authroize.net with salesforce.I have created an Merchant account in authorize.net.Need Guidance in integration with salesforce

 

 

 

Thanks,

Atif.

Member
Posts: 2
Registered: ‎06-06-2013

Re: inegration of authorize.net with salesforce

Hi Sravani,

 

 from where you are providing amount and user information in this implement. Can you provide the code to implement?