diff --git a/README.md b/README.md index 02e7783..5e64896 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,12 @@ Plugin for Cordova to use the [native android SDK](https://github.com/stripe/str ## Installing the plugin ## ``` -cordova plugin add cordova-plugin-filepickerio --save +cordova plugin add cordova-plugin-stripe-payments --save ``` +### NOTE: +This plugin now requires Cordova 9 as of version 0.1.1. If you are using Cordova 8 or lower, please use the 0.0.8 version of this plugin. + ## Using the plugin ## diff --git a/package.json b/package.json index da0b8a3..6b02715 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cordova-plugin-stripe-payments", "description": "Stripe Card Entry plugin for Cordova. Available for Android and iOS.", - "version": "0.0.8", + "version": "0.1.1", "homepage": "https://github.com/rolamix/cordova-plugin-stripe-payments#readme", "author": "Rolamix (https://rolamix.com)", "license": "MIT", @@ -33,4 +33,4 @@ "ach", "credit card" ] -} \ No newline at end of file +} diff --git a/plugin.xml b/plugin.xml index f389162..1438caa 100644 --- a/plugin.xml +++ b/plugin.xml @@ -3,7 +3,7 @@ + version="0.1.1"> Stripe Payments Cordova plugin for Stripe payments using the native Android/iOS SDKs. Supports Apple Pay and card payments. @@ -14,15 +14,15 @@ https://github.com/rolamix/cordova-plugin-stripe-payments/issues - - + + - + @@ -71,20 +71,22 @@ + + - + diff --git a/src/ios/StripePaymentsPlugin.swift b/src/ios/StripePaymentsPlugin.swift index 9063dea..9f2cef4 100644 --- a/src/ios/StripePaymentsPlugin.swift +++ b/src/ios/StripePaymentsPlugin.swift @@ -82,7 +82,7 @@ import Stripe paymentContext.hostViewController = self.viewController } - customerContext.clearCachedCustomer() + customerContext.clearCache() } @@ -235,19 +235,23 @@ import Stripe print("[StripePaymentsPlugin].paymentContextDidChange: \(resultMsg)") successCallback(paymentStatusCallback, resultMsg, keepCallback: true) } - + // This callback is triggered when requestPayment() completes successfully to create a Source. // This Source can then be used by the app to process a payment (create a charge, subscription etc.) - func paymentContext(_ paymentContext: STPPaymentContext, didCreatePaymentResult paymentResult: STPPaymentResult, completion: @escaping STPErrorBlock) { + func paymentContext(_ paymentContext: STPPaymentContext, didCreatePaymentResult paymentResult: STPPaymentResult, completion: @escaping STPPaymentStatusBlock) { // Create charge using payment result let resultMsg: [String : Any] = [ "status": "PAYMENT_CREATED", - "source": paymentResult.source.stripeID + "source": paymentResult.paymentMethod.stripeId + // "source": paymentResult.source.stripeID ] print("[StripePaymentsPlugin].paymentContext.didCreatePaymentResult: \(resultMsg)") successCallback(paymentStatusCallback, resultMsg, keepCallback: true) - completion(nil) + + // This is here to, for example, inform the context that the user canceled payment (if we were processing it + // from the native side). However we are not handling it here. + completion(STPPaymentStatus.success, nil) } // This callback triggers due to: @@ -313,4 +317,3 @@ import Stripe } } -