Skip to content

Commit

Permalink
Merge pull request #21 from stripe-ios/yuki/grabpay-sync
Browse files Browse the repository at this point in the history
Change GrabPay to synchronous
  • Loading branch information
yuki-stripe authored Nov 19, 2020
2 parents 1b1b4ad + 072e2e1 commit 8974b51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
8 changes: 5 additions & 3 deletions Stripe/STPPaymentHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,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,
.UPI,
Expand All @@ -511,7 +512,8 @@ public class STPPaymentHandler: NSObject, SFSafariViewControllerDelegate, STPURL
.payPal,
.przelewy24,
.bancontact,
.OXXO:
.OXXO,
.grabPay:
return false

case .unknown:
Expand Down

0 comments on commit 8974b51

Please sign in to comment.