2012-08-04 118 views
1

我正在开发iOS应用程序,其中我已经使用auth.net iOS API集成了authorize.net支付网关。 我遵循他们的文档中提到的每一个步骤。现在,每次当交易请求发送到真实环境中的auth.net服务器时,它都会给我提供错误(代码E00007),即“由于无效认证值导致用户认证失败”。 我检查了登录ID和交易密钥,这些都是正确的。 即使我尝试与Auth.net支持人员,但仍然没有解决。 测试环境和要求是成功的。但在现场环境。它给我的问题iOS Authorize.net集成问题

我的代码如下: 对于设备注册: 在这里我把XXXX ....而不是真正的交易密钥和登录ID。

MobileDeviceRegistrationRequest *mobileDeviceRegistrationRequest = 
[MobileDeviceRegistrationRequest mobileDeviceRegistrationRequest]; 
mobileDeviceRegistrationRequest.mobileDevice.mobileDeviceId = 
[[[UIDevice currentDevice] uniqueIdentifier] 
stringByReplacingOccurrencesOfString:@"-" withString:@"_"]; 
mobileDeviceRegistrationRequest.mobileDevice.mobileDescription = @"iPhone"; 
mobileDeviceRegistrationRequest.anetApiRequest.merchantAuthentication.name = @"XXXXXXXXX"; 
mobileDeviceRegistrationRequest.anetApiRequest.merchantAuthentication.password = @"XXXXXXXXXXXXXX"; 

[AuthNet authNetWithEnvironment:ENV_LIVE]; 
AuthNet *an = [AuthNet getInstance]; 
[an mobileDeviceRegistrationRequest:mobileDeviceRegistrationRequest]; 

之后,对于支付请求的代码:

MobileDeviceLoginRequest *mobileDeviceLoginRequest = [MobileDeviceLoginRequest mobileDeviceLoginRequest]; 
    mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.name = @"XXXXX"; 
    mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.password = @"XXXXXX"; 
    mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.mobileDeviceId = 
    [[[UIDevice currentDevice] uniqueIdentifier] stringByReplacingOccurrencesOfString:@"-" withString:@"_"]; 

    // Set up an AuthNet instance. 
    [AuthNet authNetWithEnvironment:ENV_LIVE]; 

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

    // Process a mobile device login request. 
    [an mobileDeviceLoginRequest:mobileDeviceLoginRequest]; 

但在初始登录请求我收到了故障,错误代码E00007。我错过了什么设置?

+1

你的用户名和密码,无论是原来的用户名和密码或任何其它API密钥的位置,在适当的密码使用什么。是它我们在xcode中使用原始密码时安全吗? – ArunMak 2013-11-18 12:10:59

回答

1

请提供关键的交易

mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.transactionKey = @"XXXXXX"; 

它为我工作

+2

这似乎正是我们不应该鼓励人们公开发布的那种数据! – Hbcdev 2012-11-13 11:20:05

+0

如何获取TransactionKey? – Tarang 2014-02-10 13:06:49

+0

@MohammadArsalan我们必须添加应用程序登录ID的位置?这是我们必须输入的名称和密码?因为商家不会给开发者提供密码! – 2014-07-25 10:24:35