0

我正在使用 ios 中的授权 .net 支付网关,方法如下

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

    [an setDelegate:self];

    CreditCardType *creditCardType = [CreditCardType creditCardType];
    creditCardType.cardNumber = @"4111111111111111";
    NSLog(@"babul cardNumber is %@",creditCardType.cardNumber);
    creditCardType.cardCode = @"100";
    NSLog(@"babul cardCode is %@",creditCardType.cardCode);
    creditCardType.expirationDate = @"1212";
    NSLog(@"babul expirationDate is %@",creditCardType.expirationDate);
    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] uniqueGlobalDeviceIdentifier]
     stringByReplacingOccurrencesOfString:@"-" withString:@"_"];
    request.anetApiRequest.merchantAuthentication.sessionToken = sessionToken;
    [an purchaseWithRequest:request];
}

我得到的回应是

创建事务响应 2012-07-26 19:14:00.131 Authorized[2355:207] 错误E00003命名空间“AnetApi/xml/v1/schema/AnetApiSchema.xsd”中的元素“merchantAuthentication”在命名空间“AnetApi/xml/v1/schema/AnetApiSchema.xsd”中具有无效的子元素“mobileDeviceId”。预期的可能元素列表:命名空间“AnetApi/xml/v1/schema/AnetApiSchema.xsd”中的“名称、事务密钥、会话令牌、密码”。命名空间警告:xmlns:URI AnetApi/xml/v1/schema/AnetApiSchema.xsd 不是绝对的 ttp://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd" ^ 2012-07-26 19:14:00.131 Authorized[2355:207] Error = (null) 2012-07-26 19:14:00.247 Authorized[2355:207] babul 输出为 Message.code = E00003 Message.text = The元素“商家身份验证” 在命名空间“AnetApi/xml/v1/schema/AnetApiSchema.xsd”中,在命名空间“AnetApi/xml/v1/schema/AnetApiSchema.xsd”中有无效的子元素“mobileDeviceId”。预期的可能元素列表:命名空间“AnetApi/xml/v1/schema/AnetApiSchema.xsd”中的“名称、事务密钥、会话令牌、密码”。

上述问题是否有任何替代方法以及交易将如何存储在授权的 .net 中(我创建了我的测试帐户,我提供了这些凭据,我批准了我的设备,但后来我收到了上述错误)

提前致谢

4

1 回答 1

1

我认为您需要进行应用内购买,因为 Apple 不会通过任何网络服务或 API 批准应用程序付款。

于 2012-09-26T19:29:04.623 回答