最新のPayPal APIを実装しましたが、PayPalのサンドボックスから支払いを実行しようとするたびに、支払いが「処理中」に固執します。完全に困惑した。ありがとう!PayPalによる支払い処理が「処理済み」
-(void)payWithPayPal {
NSString *shortDescription = [NSString stringWithFormat:@"%i %@", [Global sharedInstance].currentOrder.itemQuantity, [Global sharedInstance].currentOrder.boozeBrand];
NSDecimalNumber *paymentDecimal = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.02f", [Global sharedInstance].currentOrder.itemPrice]];
NSString *sku = [NSString stringWithFormat:@"DBAR-%i", [Global sharedInstance].currentOrder.orderNumber];
NSString *name = [NSString stringWithFormat:@"%@", [Global sharedInstance].currentOrder.boozeBrand];
PayPalItem *item = [PayPalItem itemWithName:name
withQuantity:[Global sharedInstance].currentOrder.itemQuantity
withPrice:paymentDecimal
withCurrency:@"USD"
withSku:sku];
float priceFloat = [item.price floatValue];
float totalFloat = priceFloat * item.quantity;
NSDecimalNumber *total = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.02f", totalFloat]];
PayPalPayment *payment = [[PayPalPayment alloc] init];
payment.amount = total;
payment.currencyCode = @"USD";
payment.shortDescription = shortDescription;
payment.items = nil; // if not including multiple items, then leave payment.items as nil
payment.paymentDetails = nil; // if not including payment details, then leave payment.paymentDetails as nil
if (!payment.processable) {NSLog(@"Payment not processable.");}
// Update payPalConfig re accepting credit cards.
PayPalPaymentViewController *paymentViewController = [[PayPalPaymentViewController alloc] initWithPayment:payment configuration:self.payPalConfiguration delegate:self];
[self presentViewController:paymentViewController animated:YES completion:nil];
}
#pragma mark - PayPalDelegate
-(void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController willCompletePayment:(PayPalPayment *)completedPayment completionBlock:(PayPalPaymentDelegateCompletionBlock)completionBlock {
NSLog(@"Payment processing.");
//Stuck on this forever - this is what I'm trying to get past
}
-(void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController didCompletePayment:(PayPalPayment *)completedPayment {
//Never gets here
}
どこにステップが貼り付けられましたか?ログインポップアップが表示されたのですか?また、あなたの資格情報でもデモでこれが起こりますか? – HardikDG
ログインウィンドウが正常で、資格情報が渡された後、支払いを選択した画面にポップバックします。私は支払いを選択し、それはちょうど処理に固執しています。彼らのデモでは、私の資格情報でうまく動作します。 –