Skip to content

Commit

Permalink
chore: update SDK’s to latest, prepare for OSS
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Mar 7, 2022
1 parent aa3181f commit c40de14
Show file tree
Hide file tree
Showing 1,880 changed files with 141,441 additions and 11,460 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TODO: place your license here and we'll include it in the module distribution
UNLICENSED
107 changes: 0 additions & 107 deletions README

This file was deleted.

15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Titanium Stripe

Use the native Stripe SDK's (iOS/Android) in Titanium!

## Example

See the [./example/app.js](app.js) for a detailed example.

## Author

Hans Knöchel

## License

UNLICENSED
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies {
implementation 'com.stripe:stripe-android:16.0.0'
implementation 'com.stripe:stripe-android:19.2.2'
}
3 changes: 0 additions & 3 deletions android/src/ti/stripe/TitaniumStripeModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@
import org.appcelerator.kroll.annotations.Kroll;

import org.appcelerator.titanium.TiApplication;
import org.appcelerator.kroll.common.Log;
import org.appcelerator.kroll.common.TiConfig;
import org.jetbrains.annotations.NotNull;

import com.stripe.android.CustomerSession;
import com.stripe.android.PaymentConfiguration;
import com.stripe.android.EphemeralKeyProvider;
import com.stripe.android.PaymentSession;
import com.stripe.android.PaymentSessionConfig;
import com.stripe.android.PaymentSessionData;
Expand Down
12 changes: 6 additions & 6 deletions example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ function initialize() {

function updatePaymentDetails() {
Stripe.updatePaymentDetails({
currency: 'EUR',
country: 'DE',
currency: 'USD',
country: 'US',
items: [{
label: 'Einkauf für Hans',
amount: 12.50
label: 'Apples & Oranges',
amount: 6.50
}, {
label: 'Abwicklungsgebühr (1.9% + 0.25€',
amount: 0.49
label: 'Beer & Fuse',
amount: 9.99
}]
});
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "stripe/stripe-ios" ~> 19.0.1
github "stripe/stripe-ios" ~> 21.12.0
2 changes: 1 addition & 1 deletion ios/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "stripe/stripe-ios" "v19.0.1"
github "stripe/stripe-ios" "21.12.0"
13 changes: 7 additions & 6 deletions ios/Classes/TiStripeModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Stripe
import TitaniumKit
import PassKit
import UIKit

@objc(TiStripeModule)
Expand All @@ -31,24 +32,24 @@ class TiStripeModule: TiModule {

ephemeralKeyAPIURL = params["ephemeralKeyAPIURL"] as? String

STPPaymentConfiguration.shared().companyName = companyName
STPAPIClient.shared().publishableKey = publishableKey
STPPaymentConfiguration.shared.companyName = companyName
STPAPIClient.shared.publishableKey = publishableKey

customerContext = STPCustomerContext(keyProvider: self)
paymentContext = STPPaymentContext(customerContext: customerContext!)

if let styles = params["styles"] as? [String: Any] {
if let primaryBackgroundColor = styles["primaryBackgroundColor"] {
STPTheme.default().primaryBackgroundColor = TiUtils.colorValue(primaryBackgroundColor)?.color
STPTheme.defaultTheme.primaryBackgroundColor = TiUtils.colorValue(primaryBackgroundColor)!.color
}
if let primaryForegroundColor = styles["primaryForegroundColor"] {
STPTheme.default().primaryForegroundColor = TiUtils.colorValue(primaryForegroundColor)?.color
STPTheme.defaultTheme.primaryForegroundColor = TiUtils.colorValue(primaryForegroundColor)!.color
}
if let secondaryForegroundColor = styles["secondaryForegroundColor"] {
STPTheme.default().secondaryForegroundColor = TiUtils.colorValue(secondaryForegroundColor)?.color
STPTheme.defaultTheme.secondaryForegroundColor = TiUtils.colorValue(secondaryForegroundColor)!.color
}
if let accentColor = styles["accentColor"] {
STPTheme.default().accentColor = TiUtils.colorValue(accentColor)?.color
STPTheme.defaultTheme.accentColor = TiUtils.colorValue(accentColor)!.color
}
}

Expand Down
40 changes: 0 additions & 40 deletions ios/platform/Stripe.framework/Headers/FauxPasAnnotations.h

This file was deleted.

This file was deleted.

Loading

0 comments on commit c40de14

Please sign in to comment.