I'm in the process of going between step4 and step5 of https://developer.authorize.net/integration/fifteenminutes/ios
It seems that the sessionToken is being returned as null !
Here's some proof that its null:
MobileDeviceLoginResponse: MobileDeviceLoginResponse.anetApiResponse = ANetApiResponse.refId = (null) ANetApiResponse.messages = Messages.resultCode = Ok Messages.message = ( "Message.code = I00006\nMessage.text = The mobile device is approved and ready for use.\nMessage.description = (null)\n" ) MobileDeviceLoginResponse.sessionToken = (null)
And here's why that trips me up:
Create Transaction response The element 'merchantAuthentication' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'name, transactionKey, sessionToken, password' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
Solved! Go to Solution.
โ03-22-2012 07:24 PM
I confirm that the solution above is correct. I commented out the registration code
the second time and left the login code and the session now is no longer null.
//[an mobileDeviceRegistrationRequest:mobileDeviceRegistrationRequest];
[an mobileDeviceLoginRequest: mobileDeviceLoginRequest];
Thanks to everyone! Now does anyone know what the next steps are?
โ01-01-2013 03:15 AM
The session token has absolutely not been deprecated. I can't say that I fully understand the first block of code that you posted, but it doesn't appear to me that you are actually running the mobileDeviceLoginRequest in this sample and instead you are going directly to reading the mobileDeviceLoginResponse. It is true that the token would appear to be null in this scenario.
โ03-23-2012 02:32 PM
...
MobileDeviceLoginRequest *mobileDeviceLoginRequest = [MobileDeviceLoginRequest mobileDeviceLoginRequest]; mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.name = @"username"; mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.password = @"password"; mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.mobileDeviceId = [[[UIDevice currentDevice] uniqueIdentifier] stringByReplacingOccurrencesOfString:@"-" withString:@"_"]; // Set up an AuthNet instance. AuthNet *an = [AuthNet getInstance]; [an setDelegate:self]; // Process a mobile device registration request. [an mobileDeviceRegistrationRequest:mobileDeviceRegistrationRequest]; // Process a mobile device login request. [an mobileDeviceLoginRequest:mobileDeviceLoginRequest];
2012-03-22 20:40:47.391 Mobile Device Login Response 2012-03-22 20:40:47.392 <?xml version="1.0" encoding="utf-8"?><mobileDeviceRegistrationResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</resultCode><message><code>I00006</code><text>The mobile device is approved and ready for use.</text></message></messages></mobileDeviceRegistrationResponse> 2012-03-22 20:40:47.394 Error = (null) 2012-03-22 20:40:47.395 Message: Message.code = I00006 Message.text = The mobile device is approved and ready for use. Message.description = (null) 2012-03-22 20:40:47.396 Messages: Messages.resultCode = Ok Messages.message = ( "Message.code = I00006\nMessage.text = The mobile device is approved and ready for use.\nMessage.description = (null)\n" ) 2012-03-22 20:40:47.397 MerchantContact = MerchantContact.merchantName = (null) MerchantContact.merchantAddress = (null) MerchantContact.merchantCity = (null) MerchantContact.merchantState = (null) MerchantContact.merchantZip = (null) MerchantContact.merchantPhone = (null) 2012-03-22 20:40:47.398 MobileDeviceLoginResponse: MobileDeviceLoginResponse.anetApiResponse = ANetApiResponse.refId = (null) ANetApiResponse.messages = Messages.resultCode = Ok Messages.message = ( "Message.code = I00006\nMessage.text = The mobile device is approved and ready for use.\nMessage.description = (null)\n" ) MobileDeviceLoginResponse.sessionToken = (null) MobileDeviceLoginResponse.merchantContact = MerchantContact.merchantName = (null) MerchantContact.merchantAddress = (null) MerchantContact.merchantCity = (null) MerchantContact.merchantState = (null) MerchantContact.merchantZip = (null) MerchantContact.merchantPhone = (null) MobileDeviceLoginResponse.userPermissions = ( ) 2012-03-22 20:40:47.403 Create Transaction Request: <?xml version="1.0" encoding="utf-8"?><createTransactionRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication></merchantAuthentication><transactionRequest><transactionType>authCaptureTransaction</transactionType><amount>1.00</amount><payment><creditCard><cardNumber>4111111111111111</cardNumber><expirationDate>1212</expirationDate><cardCode>100</cardCode></creditCard></payment><order></order><lineItems><lineItem><itemId>1</itemId><name>Soda</name><description>Soda</description><quantity>1</quantity><unitPrice>1.00</unitPrice><taxable>false</taxable></lineItem></lineItems><tax><amount>0</amount><name>Tax</name></tax><shipping><amount>0</amount><name>Shipping</name></shipping><customer></customer><billTo></billTo><shipTo></shipTo><transactionSettings></transactionSettings><userFields></userFields></transactionRequest></createTransactionRequest> 2012-03-22 20:40:47.685 Create Transaction response 2012-03-22 20:40:47.686 <?xml version="1.0" encoding="utf-8"?><ErrorResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error</resultCode><message><code>E00003</code><text>The element 'merchantAuthentication' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'name, transactionKey, sessionToken, password' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.</text></message></messages></ErrorResponse> 2012-03-22 20:40:47.688 Message: Message.code = E00003 Message.text = The element 'merchantAuthentication' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'name, transactionKey, sessionToken, password' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. Message.description = (null)
โ03-23-2012 03:19 PM
Any thoughts? Did the paste overload scare folks away?
โ03-24-2012 06:11 PM
The active posters on the forum don't integrate mobile devices, I'm afraid. I'm a PHP guy myself.
โ03-25-2012 01:45 AM
That's cool, so from even a PHP client perspective, what reason can you think of to get back a null sessionToken?
โ03-25-2012 05:58 PM
In the spirit of sharing, I wrote a comprehensive mobile device setup tutorial:
part 1 - http://pulkitsinghal.blogspot.com/2012/03/authnet-ios-integration.html
part 2 - http://pulkitsinghal.blogspot.com/2012/03/authnet-ios-integration-part-2.html
But I still need the community's help to get over that last wall of the null sessionToken :)
โ03-25-2012 06:42 PM
I know that this is a late response, but I wanted to follow up since this thread never really got a resolution. It appears that the issue here came down to a conflict between the design of the SDK and the way that you were trying to use it. The current implementation of the iOS SDK does not allow concurrent requests. Your code is running the mobileDeviceLoginRequest before the mobileDeviceRegistrationRequest has been completed and closed out. Simply changing the request pattern should resolve the null response.
โ04-26-2012 02:07 PM
I confirm that the solution above is correct. I commented out the registration code
the second time and left the login code and the session now is no longer null.
//[an mobileDeviceRegistrationRequest:mobileDeviceRegistrationRequest];
[an mobileDeviceLoginRequest: mobileDeviceLoginRequest];
Thanks to everyone! Now does anyone know what the next steps are?
โ01-01-2013 03:15 AM
Hey Did You Solve This Proble...I also Get this typeOutput..i m Stuck At here,,,i also get null SessionToken On MobileDeviceLoginSucceed ...Is There Any Solution.....??????????????????:(
Reply.....
โ05-16-2013 04:11 AM