0
我的PayPal融入我的應用程序的支付頁面上的任何金額:IOS貝寶:如何讓用戶通過使用下面的代碼進入貝寶
- (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];
}
在這段代碼中我通過代碼輸入量。但根據要求,用戶必須在付款頁面上手動輸入任何金額。 請給我建議任何代碼,我可以讓用戶通過顯示金額字段在付款頁面上手動輸入金額。
感謝您的回答 – Abhi
歡迎@Abhi :) –