gpt4 book ai didi

ios - authorize.net ios sdk 中的 "The authentication type is not allowed for this method call"错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:08:48 25 4
gpt4 key购买 nike

我正在尝试在我的应用程序中使用授权 ios sdk 作为支付网关。我已成功集成,但测试帐户出现上述错误。

AuthNet *an = [AuthNet getInstance];

[an setDelegate:self];

CreditCardType *creditCardType = [CreditCardType creditCardType];
creditCardType.cardNumber = @"38000000000006";
creditCardType.cardCode = @"100";
creditCardType.expirationDate = @"121213";

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 = [NSArray 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 =
[[[UIDevice currentDevice] uniqueIdentifier]
stringByReplacingOccurrencesOfString:@"-" withString:@"_"];
request.anetApiRequest.merchantAuthentication.sessionToken = sessionToken;
//[an authorizeWithRequest:request];
[an purchaseWithRequest:request];

最佳答案

如果您的设备已经注册评论设备注册码
下面一行是注册,请评论

[an mobileDeviceRegistrationRequest:mobileDeviceRegistrationRequest];

希望这对您有所帮助。如果还有其他问题,请告诉我。

关于ios - authorize.net ios sdk 中的 "The authentication type is not allowed for this method call"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14712946/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com