08-18-2013 11:08 AM
I'm trying to implement the functionality to store the credit card details, charge a credit card and refund the charges, but cannot get a good overview of the process.
From what I was able to deduct from code samples and forums, the approximate steps are (I'm using XML):
1) Create a customer profile (name, email, etc) with createCustomerProfileRequest
2) Get back the "customerProfileId" and create paymentProfile (createCustomerPaymentProfileRequest, updateCustomerPaymentProfileRequest) - only CC number and expiration - what about the card type (MC, Visa, etc)?
3) Get back the "customerPaymentProfileId" and use it to charge the stored credit card with createCustomerProfileTransactionRequest (profileTransAuthCapture)
4) refund with createCustomerProfileTransactionRequest (profileTransRefund)
Are the above steps correct and is there a simpler/faster/better way?
Could somebody point me in the direction of some simple java/jsp code for the above features?
Thanks a lot,
Solved! Go to Solution.
09-03-2013 04:10 AM
You could set validationMode to testMode <validationMode>testMode</validationMode>
But if you do that, it will not validate(run a auth_only transaction) the card before saving.
08-18-2013 04:17 PM
Sounds accurate. There is no credit card type, by the way, because card numbers have the type encoded inside them, so a type field is superfluous. I'm afraid I can't help with Java sample code, but the following -may- help:
09-01-2013 11:46 AM - edited 09-01-2013 11:46 AM
Thanks for the quick reply. I was finally able to integrate the code from XML samples (java_cim/XML/CreateProfilesTest.java) into our system.
When I try to create the customerProfile, I get the "The merchant login ID or password is invalid or the account is inactive." error.
I'm posting to https://apitest.authorize.net/xml/v1/request.api and have double-checked the "name" and "transactionKey" in "merchantAuthentication below, everything is correct:
<?xml version="1.0" encoding="utf-8"?>
Any ideas what else could be wrong?
BTW, there is also a parsing error in the HTML they return:
<HTML><BODY><H3>The following errors have occurred.</H3>(13) The merchant login
ID or password is invalid or the account is inactive.<BR></BODY></HTML>
So, it causes the "sendRequest()" method in "java_cim/XML/APIUtilities.java to return the following error:
[Fatal Error] :1:140: The element type "BR" must be terminated by the matching e
sendRequest: org.xml.sax.SAXParseException: The element type "BR" must be termin
ated by the matching end-tag "</BR>".
Should I bring this to their attention somehow?
09-01-2013 10:20 PM
If you are testing in the sandbox, then be certain that you are using the API Login ID and Transaction Key from your sandbox account and not your live production credentials.
You can obtain a new transaction key by logging into the sandbox at https://sandbox.authorize.net
09-02-2013 03:02 AM
copy the link and replace the loginID and transactionKey, if you are using production account change the url to secure.authorize.net .