2013-10-08 36 views
0

我創建使用purchaseWithRequest測試交易請求,總是我得到錯誤Authorize.net TransactionResponse錯誤

這個市場類型的交易無法在此係統上進行處理

我的代碼:

- (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]; 
} 

w^HICH給回電話給該委託方法,

- (空)requestFailed:(AuthNetResponse *)響應{ //處理失敗的請求 //獲取回調此方法 }

- (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" 
) 
+0

使用上述代碼獲取關注錯誤。消息編號= E00027 Message.text =交易不成功。 任何解決方案? – Tarang

回答

0

A市場類型錯誤(錯誤87)

錯誤文本:這個市場類型的(87)事務不能在此係統上被處理。

這意味着什麼

此錯誤表明您正在使用的帳戶被卡的禮物(零售)交易產生,但你試圖整合到我們的無卡(電子商務)的API或相反亦然。解決這個問題的唯一方法是用正確的市場類型開設一個新的測試賬戶。如果錯誤發生在真實賬戶中,商家需要致電客戶支持部門查看如何獲取正確的賬戶。 在接下來的幾個月中,Authorize.Net將支持支持卡存在和卡不存在交易的混合賬戶,這將消除這種錯誤。當這些賬戶可用時,我們會在新聞和公告板發佈公告。