iOS中的Authorize.net TransactionResponse错误

时间:2013-10-08 10:26:59

标签: ios transactions authorize.net

我使用 purchaseWithRequest 创建了测试交易请求,我总是收到错误

  

此系统无法处理此市场类型的交易

我的代码:

- (void) createTransaction {
    AuthNet *an = [AuthNet getInstance];

    [an setDelegate:self];
    CreditCardType *creditCardType = [CreditCardType creditCardType];
    creditCardType.cardNumber = @"4007000000027";
    creditCardType.cardCode = @"100";
    creditCardType.expirationDate = @"0215";

    PaymentType *paymentType = [PaymentType paymentType];
    paymentType.creditCard = creditCardType;

    ExtendedAmountType *extendedAmountTypeTax = [ExtendedAmountType extendedAmountType];
    extendedAmountTypeTax.amount = @"0";
    extendedAmountTypeTax.name = @"Tax";

    ExtendedAmountType *extendedAmountTypeShipping = [ExtendedAmountType extendedAmountType];
    extendedAmountTypeShipping.amount = @"0";
    extendedAmountTypeShipping.name = @"Shipping";

    LineItemType *lineItem = [LineItemType lineItem];
    lineItem.itemName = @"Soda";
    lineItem.itemDescription = @"Soda";
    lineItem.itemQuantity = @"1";
    lineItem.itemPrice = @"1.00";
    lineItem.itemID = @"1";

    TransactionRequestType *requestType = [TransactionRequestType transactionRequest];
    requestType.lineItems = [NSMutableArray arrayWithObject:lineItem];
    requestType.amount = @"1.00";
    requestType.payment = paymentType;
    requestType.tax = extendedAmountTypeTax;
    requestType.shipping = extendedAmountTypeShipping;

    CreateTransactionRequest *request = [CreateTransactionRequest createTransactionRequest];
    request.transactionRequest = requestType;
    request.transactionType = AUTH_ONLY;
    request.anetApiRequest.merchantAuthentication.mobileDeviceId =
    [[Utility getDeviceID]
     stringByReplacingOccurrencesOfString:@"-" withString:@"_"];
    request.anetApiRequest.merchantAuthentication.sessionToken = sessionToken;
    [an purchaseWithRequest:request];
}

回调此委托方法,

- (void)requestFailed:(AuthNetResponse *)response {     //处理失败的请求     //获取此方法的回调 }

- (void) connectionFailed:(AuthNetResponse *)response {
    // Handle a failed connection
}

- (void) paymentSucceeded:(CreateTransactionResponse *) response {
    // Handle payment success
}

注意:我的mobileDeviceRegistrationSucceeded和mobileDeviceLoginSucceeded,只有purchaseWithRequestFailed

TransactionResponse.errors = (
    "Error.errorCode = 87\nError.errorText = Transactions of this market type cannot be processed on this system.\n"
)

1 个答案:

答案 0 :(得分:0)

市场类型错误(错误87)

错误文字(87)此系统无法处理此市场类型的交易。

意味着什么

此错误表示您正在使用的帐户是为Card Present(零售)交易创建的,但您尝试集成到我们的Card Not Present(电子商务)API,反之亦然。解决此问题的唯一方法是使用正确的市场类型打开新的测试帐户。如果真实帐户发生错误,商家需要致电客户支持以了解如何获得正确的帐户。 在接下来的几个月中,Authorize.Net将支持支持Card Present和Card Not Present交易的混合账户,这将消除此错误。当这些帐户可用时,我们将在新闻和公告板上发布公告。