Register device using test account on authorize.net iphone SDK?

三世轮回 提交于 2019-12-20 06:12:37

问题


Can someone provide me a code snippet to register my device using authorize.net test account. I am using aim sdk for iphone.


回答1:


From Authorize.Net support:

If they are referring to the actual app please be advised that currently the app will not work for test accounts but if they are talking about the SDK, they will need to register the phone first by using “MobileDeviceRegistrationRequest” the first time they use a new phone. The phone will show up for approval in their Settings page when they login to their Authorize.Net account. Once they approved it they can login by using “MobileDeviceLoginRequest”.




回答2:


Code For registration of device

MobileDeviceRegistrationRequest *registrationRequest=[MobileDeviceRegistrationRequest mobileDeviceRegistrationRequest];
registrationRequest.anetApiRequest.merchantAuthentication.name= @"Current API Login ID";
registrationRequest.anetApiRequest.merchantAuthentication.password = @"Current Transaction Key";

registrationRequest.mobileDevice.mobileDescription=@"Description";
registrationRequest.mobileDevice.phoneNumber = @"Mobile no.";
registrationRequest.mobileDevice.mobileDeviceId=   @"Device udid";

[AuthNet authNetWithEnvironment:ENV_TEST];
AuthNet *an = [AuthNet getInstance];
[an setDelegate:self];
[an mobileDeviceRegistrationRequest:registrationRequest];

Remember that once device is register from site than comment the below code

[an mobileDeviceRegistrationRequest:registrationRequest];

because once device is registered then no need to register again other wise give give error.



来源:https://stackoverflow.com/questions/8326900/register-device-using-test-account-on-authorize-net-iphone-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!