Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync with React Native 0.38.3 #1866

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/stripe_android/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.8.0'
ext.stripe_version = '20.44.+'
ext.stripe_version = '20.48.+'

repositories {
google()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.reactnativestripesdk

Check warning on line 1 in packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt

View workflow job for this annotation

GitHub Actions / Typo CI

Filename: packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt

"reactnativestripesdk" in the filename is a typo. Did you mean "representativeness"?

import android.app.Activity
import android.app.Application
Expand Down Expand Up @@ -43,7 +43,7 @@
private var confirmPromise: Promise? = null
private var presentPromise: Promise? = null
private var paymentSheetTimedOut = false
internal val paymentSheetIntentCreationCallback = CompletableDeferred<ReadableMap>()
internal var paymentSheetIntentCreationCallback = CompletableDeferred<ReadableMap>()

override fun onCreateView(
inflater: LayoutInflater,
Expand Down Expand Up @@ -148,6 +148,8 @@
stripeSdkModule.sendEvent(context, "onConfirmHandlerCallback", params)

val resultFromJavascript = paymentSheetIntentCreationCallback.await()
// reset the completable
paymentSheetIntentCreationCallback = CompletableDeferred<ReadableMap>()

return@CreateIntentCallback resultFromJavascript.getString("clientSecret")?.let {
CreateIntentResult.Success(clientSecret = it)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.reactnativestripesdk.pushprovisioning

Check warning on line 1 in packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt

View workflow job for this annotation

GitHub Actions / Typo CI

Filename: packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt

"reactnativestripesdk" in the filename is a typo. Did you mean "representativeness"?

import android.app.Activity
import android.app.Activity.RESULT_OK
Expand Down Expand Up @@ -65,7 +65,7 @@
)
}
} catch (e: Exception) {
Log.e(TAG, "PushProvisioning dependency not found")
Log.e(TAG, "There was a problem using Stripe Android PushProvisioning: " + e.message)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.reactnativestripesdk.pushprovisioning

Check warning on line 1 in packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt

View workflow job for this annotation

GitHub Actions / Typo CI

Filename: packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt

"reactnativestripesdk" in the filename is a typo. Did you mean "representativeness"?

import android.app.Activity
import android.util.Log
Expand Down Expand Up @@ -28,7 +28,7 @@

listTokensMethod.invoke(client) as Task<List<Any>>
} catch (e: Exception) {
Log.e(TAG, "Google TapAndPay dependency not found")
Log.e(TAG, "There was a problem listing tokens with Google TapAndPay: " + e.message)
null
}
}
Expand All @@ -39,7 +39,7 @@
val existingFpanLastFour = getFpanLastFourMethod.invoke(token) as String
existingFpanLastFour == newLastFour
} catch (e: Exception) {
Log.e(TAG, "There was a problem finding the class com.google.android.gms.tapandpay.issuer.TokenInfo. Make sure you've included Google's TapAndPay dependency.")
Log.e(TAG, "There was a problem getting the FPAN with Google TapAndPay: " + e.message)
false
}
}
Expand Down Expand Up @@ -79,7 +79,7 @@
token.getInt("network"),
REQUEST_CODE_TOKENIZE)
} catch (e: Exception) {
Log.e(TAG, "Google TapAndPay dependency not found.")
Log.e(TAG, "There was a problem tokenizing with Google TapAndPay: " + e.message)
}
}

Expand Down Expand Up @@ -114,8 +114,7 @@
"serviceProvider",
tokenInfoClass.getMethod("getTokenServiceProvider").invoke(it) as Int)
} catch (e: Exception) {
Log.e(TAG,
"There was a problem finding the class com.google.android.gms.tapandpay.issuer.TokenInfo. Make sure you've included Google's TapAndPay dependency.")
Log.e(TAG, "There was a problem mapping the token information with Google TapAndPay: " + e.message)
}
}
return result
Expand All @@ -134,8 +133,7 @@
else -> "UNKNOWN"
}
} catch (e: Exception) {
Log.e(TAG,
"There was a problem finding Google's TapAndPay dependency.")
Log.e(TAG, "There was a problem mapping the token state with Google TapAndPay: " + e.message)
return "UNKNOWN"
}
}
Expand Down
11 changes: 8 additions & 3 deletions packages/stripe_ios/ios/Classes/Stripe Sdk/CardFormView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class CardFormView: UIView, STPCardFormViewDelegate {
@objc var disabled: Bool = false
@objc var preferredNetworks: Array<Int>? {
didSet {
if let preferredNetworks = preferredNetworks {
cardForm?.preferredNetworks = preferredNetworks.map(Mappers.intToCardBrand).compactMap { $0 }
}
setPreferredNetworks()
}
}

Expand All @@ -36,6 +34,7 @@ class CardFormView: UIView, STPCardFormViewDelegate {
self.cardForm = _cardForm
self.addSubview(_cardForm)
setStyles()
setPreferredNetworks()
}

@objc var cardStyle: NSDictionary = NSDictionary() {
Expand Down Expand Up @@ -107,6 +106,12 @@ class CardFormView: UIView, STPCardFormViewDelegate {
// }
}

func setPreferredNetworks() {
if let preferredNetworks = preferredNetworks {
cardForm?.preferredNetworks = preferredNetworks.map(Mappers.intToCardBrand).compactMap { $0 }
}
}

override init(frame: CGRect) {
super.init(frame: frame)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/stripe_ios/ios/stripe_ios.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint stripe_ios.podspec' to validate before publishing.
#
stripe_version = '~> 23.27.0'
stripe_version = '~> 23.28.0'
Pod::Spec.new do |s|
s.name = 'stripe_ios'
s.version = '0.0.1'
Expand Down
Loading