From 4030ceb16b8c4415b9555cb6046d887d4deefe15 Mon Sep 17 00:00:00 2001 From: Yuki Tokuhiro Date: Wed, 18 Nov 2020 10:13:09 -0800 Subject: [PATCH] Change GrabPay to synchronous --- .../GrabPayExampleViewController.swift | 2 +- Stripe/STPPaymentHandler.swift | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Example/Non-Card Payment Examples/GrabPayExampleViewController.swift b/Example/Non-Card Payment Examples/GrabPayExampleViewController.swift index c69158c55f8..35813f64882 100644 --- a/Example/Non-Card Payment Examples/GrabPayExampleViewController.swift +++ b/Example/Non-Card Payment Examples/GrabPayExampleViewController.swift @@ -84,7 +84,7 @@ class GrabPayExampleViewController: UIViewController { self.delegate?.exampleViewController(self, didFinishWithMessage: "Payment failed. \(String(describing: error?.localizedDescription))") return case .succeeded: - self.delegate?.exampleViewController(self, didFinishWithMessage: "Your order was received and is awaiting payment confirmation.") + self.delegate?.exampleViewController(self, didFinishWithMessage: "Payment succeeded!") @unknown default: fatalError() } diff --git a/Stripe/STPPaymentHandler.swift b/Stripe/STPPaymentHandler.swift index 4ebed78fe95..8a8aa7530be 100644 --- a/Stripe/STPPaymentHandler.swift +++ b/Stripe/STPPaymentHandler.swift @@ -483,13 +483,14 @@ public class STPPaymentHandler: NSObject, SFSafariViewControllerDelegate, STPURL /// because the funds can take up to 14 days to transfer from the customer's bank. class func _isProcessingIntentSuccess(for type: STPPaymentMethodType) -> Bool { switch type { + /* Asynchronous */ case .SEPADebit, .bacsDebit /* Bacs Debit takes 2-3 business days */, .AUBECSDebit, - .sofort, - .grabPay /* Asynchronous */: + .sofort: return true + /* Synchronous */ case .alipay, .card, .iDEAL, @@ -500,7 +501,8 @@ public class STPPaymentHandler: NSObject, SFSafariViewControllerDelegate, STPURL .payPal, .przelewy24, .bancontact, - .OXXO: + .OXXO, + .grabPay: return false case .unknown: