0

我已经使用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"
)
4

1 回答 1

0

市场类型错误(错误 87)

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

这是什么意思

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

于 2013-10-08T13:19:17.543 回答