【问题标题】:Customer's Billing Information not showing in Authorize.NetAuthorize.Net 中未显示客户的帐单信息
【发布时间】:2017-05-21 02:05:14
【问题描述】:

我正在我的应用中实施 Authorize.Net 付款方式。它工作正常付款成功完成,但我无法将用户的详细信息发送到进行付款的服务器。 交易后收到的成功邮件显示空值

==== CUSTOMER BILLING INFORMATION ===
Customer ID :
First Name :
Last Name :
Company :
Address :
City :
State/Province :
Zip/Postal Code :
Country :
Phone :
Fax :
E-Mail :

我正在使用以下代码来创建交易

- (void) createTransaction
{
    AuthNet *an = [AuthNet authNetWithEnvironment:ENV_TEST];//[AuthNet getInstance];

    [an setDelegate:self];

    CreditCardType *creditCardType = [CreditCardType creditCardType];
    creditCardType.cardNumber = @"4111111111111111";
    creditCardType.cardCode = CvvNumberTxt.text;//@"100";
    creditCardType.expirationDate = ExpiryDateTxt.text; //@"1218";



    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";


    CustomerDataType *c = [CustomerDataType customerDataType];
    c.type = @"Artist";
    c.email = @"abc@gmail.com";


    CustomerAddressType *customerAddressType = [CustomerAddressType customerAddressType];
    customerAddressType.firstName = @"Abc";
    customerAddressType.lastName = @"Xyz";
    customerAddressType.country = @"India";
    customerAddressType.state = @"Delhi";
    customerAddressType.city = @"New Delhi";
    customerAddressType.phoneNumber = @"9999999999";


    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 = amountTxt.text;  //@"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] identifierForVendor] UUIDString];


    request.anetApiRequest.merchantAuthentication.sessionToken = sessionToken;
    [an purchaseWithRequest:request];

}

【问题讨论】:

  • HI @Abhi 我想在我的应用程序中使用 authorise.net,但没有获得目标 c 中的代码,请帮助
  • 我在使用 PHP API 时遇到了同样的问题。我找不到任何答案。

标签: ios objective-c payment-gateway authorize.net


【解决方案1】:

我认为您需要在 requestType.shipping = extendedAmountTypeShipping; 下或附近的 TransactionRequest 调用中添加一行行:

requestType.billing = CustomerAddressType;

我不是 Objective C 程序员,我不熟悉他们的 iOS API,但我忽略了与 PHP API 完全相同的事情。仔细检查该 requestType.billing 的文档。我只是猜到了!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-02-11
    • 1970-01-01
    • 2014-01-16
    • 2012-08-29
    • 1970-01-01
    • 1970-01-01
    • 2017-09-24
    • 2014-02-01
    相关资源
    最近更新 更多