Skip to content

Commit

Permalink
chore: upgrade native stripe libraries (#801)
Browse files Browse the repository at this point in the history
* fix: upgrade underlying native stripe libraries

* chore: pod install

* chore: support android 12 in example

* fix: some breaking upgrade changes, add back test,rm unused gradle props

* chore: changelog
  • Loading branch information
charliecruzan-stripe committed Feb 9, 2022
1 parent da13d69 commit b6bfec8
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 49 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CHANGELOG

- Upgraded `stripe-ios` to v21.11.1. Upgraded `stripe-android` to v19.1.+. Added Android 12 support to example.

## Unreleased

- [#774](https://github.com/stripe/stripe-react-native/pull/774) feat: Add `currencyCode` support to `initPaymentSheet` for Google Pay & Setup Intents
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ dependencies {
api 'com.facebook.react:react-native:+'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"
implementation 'com.stripe:stripe-android:18.1.+'
implementation 'com.stripe:stripe-android:19.1.+'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0'
}
3 changes: 0 additions & 3 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
StripeSdk_kotlinVersion=1.5.10
StripeSdk_compileSdkVersion=28
StripeSdk_buildToolsVersion=28.0.3
StripeSdk_targetSdkVersion=28
4 changes: 2 additions & 2 deletions android/src/main/java/com/reactnativestripesdk/Errors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package com.reactnativestripesdk

import com.facebook.react.bridge.WritableMap
import com.facebook.react.bridge.WritableNativeMap
import com.stripe.android.exception.APIException
import com.stripe.android.core.exception.APIException
import com.stripe.android.exception.AuthenticationException
import com.stripe.android.exception.CardException
import com.stripe.android.exception.InvalidRequestException
import com.stripe.android.core.exception.InvalidRequestException
import com.stripe.android.model.PaymentIntent
import com.stripe.android.model.SetupIntent

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class StripeSdkCardView(private val context: ThemedReactContext) : FrameLayout(c
override fun onCardComplete() {}
override fun onExpirationComplete() {}
override fun onCvcComplete() {}
override fun onPostalCodeComplete() {}

override fun onFocusChange(focusField: CardInputListener.FocusField) {
if (mEventDispatcher != null) {
Expand Down
18 changes: 9 additions & 9 deletions e2e/paymentsWithRedirects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,17 @@ describe('Payment scenarios with redirects', () => {
BasicPaymentScreen.checkStatus();
});

// it('Alipay payment scenario', function () {
// this.retries(2);
// homeScreen.goTo('Wallets');
// homeScreen.goTo('Alipay');
it('Alipay payment scenario', function () {
this.retries(2);
homeScreen.goTo('Wallets');
homeScreen.goTo('Alipay');

// $('~payment-screen').waitForDisplayed({ timeout: 30000 });
$('~payment-screen').waitForDisplayed({ timeout: 30000 });

// BasicPaymentScreen.pay({ email: 'test@stripe.com' });
// BasicPaymentScreen.authorize();
// BasicPaymentScreen.checkStatus();
// });
BasicPaymentScreen.pay({ email: 'test@stripe.com' });
BasicPaymentScreen.authorize();
BasicPaymentScreen.checkStatus();
});

it('Grabpay payment scenario', function () {
this.retries(2);
Expand Down
3 changes: 2 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ buildscript {
ext {
buildToolsVersion = "30.0.3"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
}
repositories {
Expand Down
30 changes: 15 additions & 15 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,19 @@ PODS:
- RNScreens (3.10.2):
- React-Core
- React-RCTImage
- Stripe (21.9.1):
- Stripe/Stripe3DS2 (= 21.9.1)
- StripeCore (= 21.9.1)
- StripeUICore (= 21.9.1)
- Stripe (21.11.1):
- Stripe/Stripe3DS2 (= 21.11.1)
- StripeCore (= 21.11.1)
- StripeUICore (= 21.11.1)
- stripe-react-native (0.2.3):
- React-Core
- Stripe (~> 21.9.0)
- Stripe/Stripe3DS2 (21.9.1):
- StripeCore (= 21.9.1)
- StripeUICore (= 21.9.1)
- StripeCore (21.9.1)
- StripeUICore (21.9.1):
- StripeCore (= 21.9.1)
- Stripe (~> 21.11.1)
- Stripe/Stripe3DS2 (21.11.1):
- StripeCore (= 21.11.1)
- StripeUICore (= 21.11.1)
- StripeCore (21.11.1)
- StripeUICore (21.11.1):
- StripeCore (= 21.11.1)
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down Expand Up @@ -459,10 +459,10 @@ SPEC CHECKSUMS:
RNCMaskedView: c298b644a10c0c142055b3ae24d83879ecb13ccd
RNCPicker: cb57c823d5ce8d2d0b5dfb45ad97b737260dc59e
RNScreens: d6da2b9e29cf523832c2542f47bf1287318b1868
Stripe: 22c1b8da5ee20a1aaf40fd198160efa72e71644a
stripe-react-native: 980f3d19f52a7dc4b373c6c20d30ebd760bc39e5
StripeCore: 91ea038ac0abbb72f11014044dfd1e5d39089714
StripeUICore: 7edf64b24c9c178bfd97e988f2cffdbb7a7628b0
Stripe: f2bed8369154c35c8ec794704e042e05240d6f21
stripe-react-native: 6b54d3978a5599c5004f9ab286184f3c809714ea
StripeCore: 36571be19dae15e90c8ad47e1af45712aea93f5a
StripeUICore: 1b32566d6a69581be786609a032872b0fb5a6823
Yoga: e7dc4e71caba6472ff48ad7d234389b91dadc280

PODFILE CHECKSUM: 36578772e693cd3f5c59e5bd4fd36997ba0f865b
Expand Down
28 changes: 13 additions & 15 deletions stripe-react-native.podspec
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
require "json"
require 'json'

package = JSON.parse(File.read(File.join(__dir__, "package.json")))
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = "stripe-react-native"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]
s.name = 'stripe-react-native'
s.version = package['version']
s.summary = package['description']
s.homepage = package['homepage']
s.license = package['license']
s.authors = package['author']

s.platforms = { :ios => "11.0" }
s.source = { :git => "https://github.com/stripe/stripe-react-native.git", :tag => "#{s.version}" }
s.platforms = { ios: '11.0' }
s.source = { git: 'https://github.com/stripe/stripe-react-native.git', tag: s.version.to_s }

s.source_files = 'ios/**/*.{h,m,mm,swift}'

s.source_files = "ios/**/*.{h,m,mm,swift}"


s.dependency "React-Core"
s.dependency 'Stripe', '~> 21.9.0'
s.dependency 'React-Core'
s.dependency 'Stripe', '~> 21.11.1'
end

0 comments on commit b6bfec8

Please sign in to comment.