- Create a header & an implementation class containing the sample code
- If you happen to be using PayPal as well as AuthNet in your code then you may run into some syntactical problems. To resolve any such issues, please have a look at this post on stackoverflow.
- When substituting values in the code, if you provide the "API Login ID" and "Transaction Key" as the name / password values in your call to AuthNet then you will run into the following error as seen in the logs:
- This fails as password and transactionKey are distinctly different variables in the header files.
- So make sure to substitute the sample code with the username and password used with https://developer.authorize.net/ or https://test.authorize.net/
- If you run the code at this point and end up calling loginToGateway, you will run into the following error logs:
- This is not the same as being at the point where you simply need to login to the sandbox (https://test.authorize.net/) and enable the new device. No, this is very different and you need to get past this to get to the next point. So you need to add some additional code which is talked about on the forums as well:
- Now you should be at a point where running the code results in the following error logs:
- This is more like it! So head over to https://test.authorize.net/ and enable your new device. Here are some screenshots: screenshot_1 and screenshot_2
- Sadly we aren't done yet, we see a message about the mobile device being ready for use but we also notice that the sessionToken has come back as null and therefore the next call's response displays an error ... claiming that the request content was incomplete:
- Even I don't have a solution past this point, feel free to follow this forum thread for any progress on the matter.
Saturday, March 24, 2012
AuthNet iOS Integration Part 2
There are quite a few gaps in the sample code provided by AuthNet, we will discuss the logs indicating the problem and what chunk of code needs to be added/removed to get to a complete sample that works. This blog entry assumes that you've cleared the challenges of adding AuthNet binaries to your Xcode project. If not then have a peek at AuthNet iOS Integration Part 1 before continuing.