Compare commits
2 Commits
feat/updat
...
master
Author | SHA1 | Date | |
---|---|---|---|
05aaffd2d8 | |||
1bfc60a01d |
@ -3,12 +3,9 @@ Plugin for Cordova to use the [native android SDK](https://github.com/stripe/str
|
|||||||
|
|
||||||
## Installing the plugin ##
|
## Installing the plugin ##
|
||||||
```
|
```
|
||||||
cordova plugin add cordova-plugin-stripe-payments --save
|
cordova plugin add cordova-plugin-filepickerio --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 ##
|
## Using the plugin ##
|
||||||
|
|
||||||
|
|
||||||
|
17
package.json
17
package.json
@ -1,19 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "cordova-plugin-stripe-payments",
|
"name": "cordova-plugin-stripe-payments-netsyms",
|
||||||
"description": "Stripe Card Entry plugin for Cordova. Available for Android and iOS.",
|
"description": "Stripe Card Entry plugin for Cordova. Available for Android and iOS.",
|
||||||
"version": "0.1.1",
|
"version": "0.0.9",
|
||||||
"homepage": "https://github.com/rolamix/cordova-plugin-stripe-payments#readme",
|
"homepage": "https://source.netsyms.com/Netsyms/cordova-plugin-stripe-payments",
|
||||||
"author": "Rolamix <contact@rolamix.com> (https://rolamix.com)",
|
"contributors": [
|
||||||
|
"Rolamix <contact@rolamix.com> (https://rolamix.com)",
|
||||||
|
"Netsyms Technologies <opensource@netsyms.com> (https://netsyms.com)"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/rolamix/cordova-plugin-stripe-payments.git"
|
"url": "git+https://source.netsyms.com/Netsyms/cordova-plugin-stripe-payments.git"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/rolamix/cordova-plugin-stripe-payments/issues"
|
"url": "https://source.netsyms.com/Netsyms/cordova-plugin-stripe-payments/issues"
|
||||||
},
|
},
|
||||||
"cordova": {
|
"cordova": {
|
||||||
"id": "cordova-plugin-stripe-payments",
|
"id": "cordova-plugin-stripe-payments-netsyms",
|
||||||
"platforms": [
|
"platforms": [
|
||||||
"android",
|
"android",
|
||||||
"ios"
|
"ios"
|
||||||
|
29
plugin.xml
29
plugin.xml
@ -2,27 +2,27 @@
|
|||||||
|
|
||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
id="cordova-plugin-stripe-payments"
|
id="cordova-plugin-stripe-payments-netsyms"
|
||||||
version="0.1.1">
|
version="0.0.9">
|
||||||
|
|
||||||
<name>Stripe Payments</name>
|
<name>Stripe Payments</name>
|
||||||
<description>Cordova plugin for Stripe payments using the native Android/iOS SDKs. Supports Apple Pay and card payments.</description>
|
<description>Cordova plugin for Stripe payments using the native Android/iOS SDKs. Supports Apple Pay and card payments.</description>
|
||||||
<author>Rolamix, Inc.</author>
|
<author>Rolamix, Inc., Netsyms Technologies</author>
|
||||||
<license>MIT</license>
|
<license>MIT</license>
|
||||||
<keywords>cordova,stripe,payments,apple pay,ach,google pay,cards,credit cards,checkout</keywords>
|
<keywords>cordova,stripe,payments,apple pay,ach,google pay,cards,credit cards,checkout</keywords>
|
||||||
<repo>https://github.com/rolamix/cordova-plugin-stripe-payments</repo>
|
<repo>https://source.netsyms.com/Netsyms/cordova-plugin-stripe-payments</repo>
|
||||||
<issue>https://github.com/rolamix/cordova-plugin-stripe-payments/issues</issue>
|
<issue>https://source.netsyms.com/Netsyms/cordova-plugin-stripe-payments/issues</issue>
|
||||||
|
|
||||||
<engines>
|
<engines>
|
||||||
<engine name="cordova" version=">=9.0.0"/>
|
<engine name="cordova" version=">=7.1.0"/>
|
||||||
<engine name="cordova-android" version=">=8.0.0"/>
|
<engine name="cordova-android" version=">=7.1.0"/>
|
||||||
<!-- If installing on Cordova IOS 5.0, make sure to add
|
<!-- If installing on Cordova IOS 5.0, make sure to add
|
||||||
<preference name="SwiftVersion" value="4.1" />
|
<preference name="SwiftVersion" value="4.1" />
|
||||||
to your config.xml under the ios platform section.
|
to your config.xml under the ios platform section.
|
||||||
If installing on Cordova iOS < 5.0, you need to add cordova-plugin-add-swift-support
|
If installing on Cordova iOS < 5.0, you need to add cordova-plugin-add-swift-support
|
||||||
to your project and specify <preference name="UseSwiftLanguageVersion" value="4" />
|
to your project and specify <preference name="UseSwiftLanguageVersion" value="4" />
|
||||||
in your config.xml file under the ios platform section. -->
|
in your config.xml file under the ios platform section. -->
|
||||||
<engine name="cordova-ios" version=">=5.0.0"/>
|
<engine name="cordova-ios" version=">=4.5.0"/>
|
||||||
</engines>
|
</engines>
|
||||||
|
|
||||||
<js-module src="www/StripePaymentsPlugin.js" name="StripePaymentsPlugin">
|
<js-module src="www/StripePaymentsPlugin.js" name="StripePaymentsPlugin">
|
||||||
@ -50,7 +50,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</config-file>
|
</config-file>
|
||||||
|
|
||||||
<framework src="com.stripe:stripe-android:8.7.0" />
|
<framework src="com.stripe:stripe-android:20.25.7" />
|
||||||
<framework src="src/android/build-extras-stripe-payments.gradle" custom="true" type="gradleReference" />
|
<framework src="src/android/build-extras-stripe-payments.gradle" custom="true" type="gradleReference" />
|
||||||
|
|
||||||
<source-file src="src/android/RetrofitFactory.java" target-dir="src/com/rolamix/plugins/stripe/" />
|
<source-file src="src/android/RetrofitFactory.java" target-dir="src/com/rolamix/plugins/stripe/" />
|
||||||
@ -71,22 +71,19 @@
|
|||||||
</feature>
|
</feature>
|
||||||
</config-file>
|
</config-file>
|
||||||
|
|
||||||
<!--
|
<framework src="Stripe" type="podspec" spec="~> 23.9.2" />
|
||||||
<framework src="Stripe" type="podspec" spec="~> 15.0.0" />
|
|
||||||
<framework src="Alamofire" type="podspec" spec="~> 4.8.1" />
|
<framework src="Alamofire" type="podspec" spec="~> 4.8.1" />
|
||||||
<framework src="CardIO" type="podspec" spec="~> 5.4.1" /> -->
|
|
||||||
|
|
||||||
<!-- https://github.com/cordova-develop/cordova-plugin-pods3/blob/master/plugin.xml -->
|
<!-- https://github.com/cordova-develop/cordova-plugin-pods3/blob/master/plugin.xml -->
|
||||||
<podspec>
|
<!-- <podspec>
|
||||||
<config>
|
<config>
|
||||||
<source url="https://github.com/CocoaPods/Specs.git"/>
|
<source url="https://github.com/CocoaPods/Specs.git"/>
|
||||||
</config>
|
</config>
|
||||||
<pods use-frameworks="true">
|
<pods use-frameworks="true">
|
||||||
<pod name="Stripe" spec="~> 17.0.1" />
|
<pod name="Stripe" spec="~> 15.0.0" />
|
||||||
<pod name="CardIO" spec="~> 5.4.1" />
|
<pod name="CardIO" spec="~> 5.4.1" />
|
||||||
<pod name="Alamofire" spec="~> 4.8.1" swift-version="4.2" />
|
<pod name="Alamofire" spec="~> 4.8.1" swift-version="4.2" />
|
||||||
</pods>
|
</pods>
|
||||||
</podspec>
|
</podspec> -->
|
||||||
|
|
||||||
<source-file src="src/ios/StripeAPIClient.swift" />
|
<source-file src="src/ios/StripeAPIClient.swift" />
|
||||||
<source-file src="src/ios/StripePaymentOptions.swift" />
|
<source-file src="src/ios/StripePaymentOptions.swift" />
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.stripe:stripe-android:8.7.0'
|
implementation 'com.stripe:stripe-android:20.25.7'
|
||||||
// Not integrating Google Pay just yet due to Google's requirements for launching
|
// Not integrating Google Pay just yet due to Google's requirements for launching
|
||||||
// We can do this later.
|
// We can do this later.
|
||||||
// implementation 'com.google.android.gms:play-services-wallet:16.0.1'
|
// implementation 'com.google.android.gms:play-services-wallet:16.0.1'
|
||||||
|
|
||||||
/* Cordova doesn't support AndroidX support libraries yet */
|
/* Cordova doesn't support AndroidX support libraries yet */
|
||||||
implementation 'com.android.support:support-v4:28.+'
|
// implementation 'com.android.support:support-v4:28.+'
|
||||||
implementation 'com.android.support:appcompat-v7:28.+'
|
// implementation 'com.android.support:appcompat-v7:28.+'
|
||||||
|
|
||||||
/* Needed for RxAndroid */
|
/* Needed for RxAndroid */
|
||||||
implementation 'io.reactivex:rxandroid:1.2.1'
|
implementation 'io.reactivex:rxandroid:1.2.1'
|
||||||
|
@ -82,7 +82,7 @@ import Stripe
|
|||||||
paymentContext.hostViewController = self.viewController
|
paymentContext.hostViewController = self.viewController
|
||||||
}
|
}
|
||||||
|
|
||||||
customerContext.clearCache()
|
customerContext.clearCachedCustomer()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -235,23 +235,19 @@ import Stripe
|
|||||||
print("[StripePaymentsPlugin].paymentContextDidChange: \(resultMsg)")
|
print("[StripePaymentsPlugin].paymentContextDidChange: \(resultMsg)")
|
||||||
successCallback(paymentStatusCallback, resultMsg, keepCallback: true)
|
successCallback(paymentStatusCallback, resultMsg, keepCallback: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This callback is triggered when requestPayment() completes successfully to create a Source.
|
// 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.)
|
// 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 STPPaymentStatusBlock) {
|
func paymentContext(_ paymentContext: STPPaymentContext, didCreatePaymentResult paymentResult: STPPaymentResult, completion: @escaping STPErrorBlock) {
|
||||||
// Create charge using payment result
|
// Create charge using payment result
|
||||||
let resultMsg: [String : Any] = [
|
let resultMsg: [String : Any] = [
|
||||||
"status": "PAYMENT_CREATED",
|
"status": "PAYMENT_CREATED",
|
||||||
"source": paymentResult.paymentMethod.stripeId
|
"source": paymentResult.source.stripeID
|
||||||
// "source": paymentResult.source.stripeID
|
|
||||||
]
|
]
|
||||||
|
|
||||||
print("[StripePaymentsPlugin].paymentContext.didCreatePaymentResult: \(resultMsg)")
|
print("[StripePaymentsPlugin].paymentContext.didCreatePaymentResult: \(resultMsg)")
|
||||||
successCallback(paymentStatusCallback, resultMsg, keepCallback: true)
|
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:
|
// This callback triggers due to:
|
||||||
@ -317,3 +313,4 @@ import Stripe
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user