Jhon Quimbo
Jhon Quimbo

Reputation: 3

Error Authorize.net

I have created a test account with authorize.net.

I have read its documentation and readme files and followed all the steps. Still I am facing an error "The mobile device is not registered with this merchant account."

- (void)loginToGateway{
MobileDeviceLoginRequest *mobileDeviceLoginRequest =
[MobileDeviceLoginRequest mobileDeviceLoginRequest];
mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.name = @"xxxx";
mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.password = @"xxxx";
mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.mobileDeviceId =
[[[UIDevice currentDevice] uniqueIdentifier]
 stringByReplacingOccurrencesOfString:@"-" withString:@"_"];

AuthNet *an = [AuthNet getInstance];
[an setDelegate:self];
[an mobileDeviceLoginRequest: mobileDeviceLoginRequest];

 }

NSLog:

  MobileDeviceLoginResponse: MobileDeviceLoginResponse.anetApiResponse =    ANetApiResponse.refId = (null)
  ANetApiResponse.messages = Messages.resultCode = Error
  Messages.message = (
 "Message.code = E00054\nMessage.text = The mobile device is not registered with this  merchant account.\nMessage.description = (null)\n"
  )

I ran the code first time and checked.

Home > Account (Settings) > Security Settings (Mobile Device Management)

but there is no devices displayed..

is there any way to register device ?

because i follow same instruction mentioned in the https://developer.authorize.net/integration/fifteenminutes/ios in step 4..

Help please.

Upvotes: 0

Views: 390

Answers (2)

shripad20
shripad20

Reputation: 858

you can register your device by using following method:

- (void)mobileDeviceRegistrationRequest {

    //------------ Mobile Device Registration Code ----------

    MobileDeviceRegistrationRequest *mobileDeviceRegistrationRequest =
    [MobileDeviceRegistrationRequest mobileDeviceRegistrationRequest];
    mobileDeviceRegistrationRequest.mobileDevice.mobileDeviceId = idfv;
    mobileDeviceRegistrationRequest.mobileDevice.mobileDescription = @"iPhone";

    // Login id of sandbox.authorize.net
    mobileDeviceRegistrationRequest.anetApiRequest.merchantAuthentication.name = MERCHANT_LOGIN_NAME;

    // Password of sandbox.authorize.net account
    mobileDeviceRegistrationRequest.anetApiRequest.merchantAuthentication.password = MERCHANT_LOGIN_PSW;

    AuthNet *an = [AuthNet getInstance];
    [an setDelegate:self];

    [an mobileDeviceRegistrationRequest:mobileDeviceRegistrationRequest];
}

and then try mobileDeviceLogin code. :) Happy Coding...

Upvotes: 1

Saleh
Saleh

Reputation: 380

You need to register the device first by sending a separate MobileDeviceRegistrationRequest.

Upvotes: 0

Related Questions