简体   繁体   English

在iOS中使用授权的.net付款网关

[英]Working with authorized .net payment gateway in ios

i am working with authorized .net payement gateway in ios In the following method 我正在使用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];
}

i am getting the response as 我得到回应

Create Transaction response 2012-07-26 19:14:00.131 Authorized[2355:207] Error E00003 The element 'merchantAuthentication' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'mobileDeviceId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. Create Transaction Response 2012-07-26 19:14:00.131 Authorized [2355:207]错误E00003名称空间'AnetApi / xml / v1 / schema / AnetApiSchema.xsd'中的元素'merchantAuthentication'在名称空间中具有无效的子元素'mobileDeviceId' 'AnetApi / xml / v1 / schema / AnetApiSchema.xsd'。 List of possible elements expected: 'name, transactionKey, sessionToken, password' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. 可能的元素列表:名称空间“ AnetApi / xml / v1 / schema / AnetApiSchema.xsd”中的“名称,transactionKey,sessionToken,密码”。 namespace warning : xmlns: URI AnetApi/xml/v1/schema/AnetApiSchema.xsd is not absolute 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 output is Message.code = E00003 Message.text = The element 'merchantAuthentication' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'mobileDeviceId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'name, transactionKey, sessionToken, password' in namespace '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”中的元素“ merchantAuthentication”在名称空间“ AnetApi / xml / v1 / schema / AnetApiSchema.xsd”中具有无效的子元素“ mobileDeviceId”。可能的元素列表:“名称” ,transactionKey,sessionToken,密码”在命名空间“ AnetApi / xml / v1 / schema / AnetApiSchema.xsd”中。

Is there any alternative to the above problem and how the transactions are going to be stored in authorized .net (i created my test account, i am giving those credentials, i approved my device but later i am getting the above error) 是否有上述问题的替代方案,以及如何将交易存储在授权的.net中(我创建了我的测试帐户,我提供了这些凭据,我批准了我的设备,但后来又出现了以上错误)

Thanks in advance 提前致谢

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM