gpt4 book ai didi

IOS Paypal : How to allow user to Enter any amount on payment page of PayPal

转载 作者:太空宇宙 更新时间:2023-11-03 16:16:27 25 4
gpt4 key购买 nike

我使用以下代码将 Paypal 集成到我的应用程序中:

- (IBAction)MakePayment:(id)sender
{
PayPalItem * item1 = [PayPalItem itemWithName:@"Item" withQuantity:1 withPrice:[NSDecimalNumber decimalNumberWithString:@"0.04"] withCurrency:@"USD" withSku:@"SKU-Item"];

NSArray * items = @[item1];
NSDecimalNumber * subtotal = [PayPalItem totalPriceForItems:items];

NSDecimalNumber * shipping = [[NSDecimalNumber alloc]initWithString:@"0.0"];
NSDecimalNumber * tax = [[NSDecimalNumber alloc]initWithString:@"0.0"];

PayPalPaymentDetails * paymentDetails = [PayPalPaymentDetails paymentDetailsWithSubtotal:subtotal withShipping:shipping withTax:tax];

NSDecimalNumber * total = [[subtotal decimalNumberByAdding:shipping]decimalNumberByAdding:tax];

PayPalPayment * payment = [[PayPalPayment alloc]init];
payment.amount = total;

payment.currencyCode = @"USD";
payment .shortDescription = @"My Payment";

payment.items = items;
payment.paymentDetails = paymentDetails;

if(!payment.processable)
{

}

PayPalPaymentViewController * paymentViewController = [[PayPalPaymentViewController alloc]initWithPayment:payment configuration:self.payPalconfig delegate:self];
[self presentViewController:paymentViewController animated:YES completion:nil];

}

在此代码中,我通过代码输入了金额。但根据要求,用户必须在付款页面上手动输入任何金额。请给我建议任何代码,我可以通过这些代码允许用户通过显示金额字段在付款页面上手动输入金额。

最佳答案

如果您想让您的用户输入或选择价格,请在出现 paypal Controller 之前要求用户使用文本字段手动输入。

您不能在 paypal Controller 中输入价格。然后你可以在 paypal Controller 中传递价格值。

关于IOS Paypal : How to allow user to Enter any amount on payment page of PayPal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42993578/

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