Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Adds Android confirmPayment, authenticatePayment, createPaymentMethod #515

Closed
wants to merge 152 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
7188a12
Update google-pay docs.
cybergrind Jun 24, 2019
d1c1c09
docs: regenerate docs
cybergrind Jun 24, 2019
e4574bf
Stripe AppInfo added with stripe-android, react-native & android upgrade
mindlapse Jul 5, 2019
14b41b2
Roll 7.5.1
cybergrind Jul 22, 2019
19c3f8c
Adding .circleci
mindlapse Jul 24, 2019
5670ade
Readme: add discord link
cybergrind Jul 31, 2019
26902bd
stripe-ios AppInfo initial config
fbartho Jul 30, 2019
a3c76f2
`managedAccountCurrency` is no longer relevant according to the migra…
fbartho Jul 30, 2019
82a00a3
typo-fixes
fbartho Jul 31, 2019
1483850
Update Stripe CardForm options to support the "name"-only option in t…
fbartho Jul 31, 2019
4b62ea2
Dynamically list supported ApplePay networks on this device & write d…
fbartho Jul 31, 2019
e3ef588
Switch eslint-config & allow rules that are already existing patterns…
fbartho Jul 31, 2019
9df384f
Add missing docs pages, and reorganize the sidebars a little bit
fbartho Jul 31, 2019
a55c4db
Add prettier to format the rendered-docs-html making diffing easier, …
fbartho Jul 31, 2019
20b5cf7
Upgrade Example Project to Stripe 16 & Cocoapods changed something
fbartho Jul 31, 2019
a4c5ca5
misc test fix
fbartho Jul 31, 2019
a588ed6
React-Native 59 for the Example App for iOS
fbartho Jul 31, 2019
15320e2
ApplePay example tweaks now that it's running
fbartho Jul 31, 2019
8d5f244
Got the testapp changes working!
fbartho Aug 1, 2019
dff3001
Prettier Javascript Formatting
fbartho Aug 1, 2019
ab6efce
Extract Deprecated Methods to a separate file
fbartho Aug 1, 2019
ad6f9c6
Adds Android confirmPayment, authenticatePayment, createPaymentMethod
mindlapse Aug 4, 2019
6625d21
Adds Android confirmSetupIntent and authenticateSetup
mindlapse Aug 4, 2019
272a49b
Merge remote-tracking branch 'tipsi/experimental' into fb/unified-nat…
fbartho Aug 5, 2019
cb32219
Android changes for confirming a payment intent, with test page
mindlapse Aug 5, 2019
feb1e03
Android changes for confirming a payment intent, with test page (cont..)
mindlapse Aug 5, 2019
6c9d49c
Prettier configs in subfolders
fbartho Aug 5, 2019
f14ea10
Prettier Formatting
fbartho Aug 5, 2019
11b478e
Adds SetupIntentScreen and stripe-android:10.2.1 (contains setupinten…
mindlapse Aug 6, 2019
eec9088
Merge remote-tracking branch 'tipsi/experimental' into fb/unified-nat…
fbartho Aug 6, 2019
68956ee
PaymentIntent demo page updated to include manual entry with the card…
mindlapse Aug 6, 2019
d3b9f89
Add some jsDocs
fbartho Aug 7, 2019
ad84efb
TPSCardField fixes
fbartho Aug 7, 2019
aa551e5
iOS: Stub-in new methods, tweak certain bits of lifecycle
fbartho Aug 7, 2019
6f563ab
API changes
mindlapse Aug 7, 2019
95e7ac9
Merge remote-tracking branch 'tipsi/experimental' into fb/ios-stripe-…
fbartho Aug 7, 2019
ee21d01
iOS: Implement Serializers / Parsers for marshalling parameters/resul…
fbartho Aug 7, 2019
faf6ca3
JSDoc: Missed a type
fbartho Aug 7, 2019
e131c84
iOS: error case robustness
fbartho Aug 7, 2019
167252d
iOS: implement authenticatePaymentIntent / authenticateSetupIntent
fbartho Aug 7, 2019
7f7a1f0
SCA plans - raising awareness
mindlapse Aug 8, 2019
d919856
Prettier Formatting for PaymentIntent/SetupIntent Test Screens
fbartho Aug 8, 2019
1c6010a
Tweak confirmPayment/confirmSetup to check & process 3DSecure Actions
fbartho Aug 8, 2019
4c2ea2e
React 16.9 componentWillMount deleted compatibility
fbartho Aug 8, 2019
20ba9c0
Get Travis to install Xcode10.3 & Node >= 8.3
fbartho Aug 9, 2019
9d721c9
oraclejdk8 is not supported on Travis's Xenial boxes
fbartho Aug 9, 2019
4044dcb
Apply suggestions from code review
fbartho Aug 9, 2019
a55b99e
Update npm to try to fix error
fbartho Aug 9, 2019
b4623dc
Fix field focus infinite recursion in keyboardWillShow on > RN 45
fbartho Jul 23, 2019
15e6fcd
Fix incorrect test js syntax
fbartho Aug 9, 2019
0416669
Fixup some issues with ci for ios
fbartho Aug 9, 2019
33d98b5
Prettier formatting
fbartho Aug 9, 2019
a6f0686
Adds test cards to demo page
mindlapse Aug 12, 2019
e122b0b
Merge branch 'fb/ios-stripe-updates' into experimental
mindlapse Aug 13, 2019
de41bb1
Adding manual confirmation support for Payment Intents
mindlapse Aug 13, 2019
455e4fa
Merge fixes, updated npm run configure to list rewrite envs
mindlapse Aug 13, 2019
cbb3eaf
Doc update - adds Objects > PaymentMethod
mindlapse Aug 14, 2019
015f5f6
Have new setup & payment intent methods return the status off of the …
mindlapse Aug 14, 2019
cd1fda5
example app: PaymentIntentScreen updates
mindlapse Aug 14, 2019
11f7653
Added an extra test card (has no 3ds & always declines)
mindlapse Aug 14, 2019
0f9e861
Example app: automatic flow error handling update
mindlapse Aug 14, 2019
613331c
Additional test cards
mindlapse Aug 14, 2019
a0bb7c7
AddCardDialogFragment changes to support PaymentMethods
mindlapse Aug 19, 2019
deb3d73
Remove support for sourceId from confirmPayment
mindlapse Aug 19, 2019
cdd6fe7
tipsi-stripe iOS Native SDK version to 16.0.6
fbartho Aug 19, 2019
fae47db
Remove Signatures that React-Native can't resolve at runtime
fbartho Aug 19, 2019
cea1028
Example: Prettier (JS Formatting)
fbartho Aug 19, 2019
626ea1d
Tighten up some types as per discussion
fbartho Aug 19, 2019
4a2e9f0
Android: Ensure useStripeSDK is always set to true
mindlapse Aug 19, 2019
a62f871
Merge branch 'experimental' of github.com:tipsi/tipsi-stripe into exp…
mindlapse Aug 19, 2019
0945c6a
Adds returnURL to confirm calls and 'Intent' suffix to the Stripe.js …
mindlapse Aug 21, 2019
63f0528
Token fix
mindlapse Aug 21, 2019
f9d73ca
Merge branch 'experimental' of github.com:tipsi/tipsi-stripe into exp…
fbartho Aug 21, 2019
fc43f77
Merge remote-tracking branch 'tipsi/iosTokenFix' into experimental
fbartho Aug 21, 2019
02a657f
Missed prettier-jsx formatting
fbartho Aug 21, 2019
4dffe36
Robustness in CardParams parsing from tokens
fbartho Aug 21, 2019
d73faec
Merge remote-tracking branch 'tipsi/apiNameChange' into experimental
fbartho Aug 21, 2019
99e113e
jsdoc cardparam.token
fbartho Aug 21, 2019
9432218
iOS: API Naming Consistency
fbartho Aug 21, 2019
fc5e606
iOS: Enable recommended modern iOS Warnings
fbartho Aug 21, 2019
15baba9
Fixup reasonable lint exceptions in the example app
fbartho Aug 21, 2019
86b5224
eslint-based fixes
fbartho Aug 21, 2019
4eddc15
Example-app: API Naming Consistency with Native
fbartho Aug 21, 2019
c39926c
PaymentIntent requires_payment_method -> requires_paymentMethod based…
fbartho Aug 21, 2019
2f0d3b7
iOS, JS: fixup IntentStatus values to match Server Docs
fbartho Aug 21, 2019
064cbcd
Disabling authenticateSetupIntent until we need it
mindlapse Aug 21, 2019
c4a5b0b
PaymentIntent guide - doc update
mindlapse Aug 22, 2019
b7bde88
Small fix to example app
mindlapse Aug 22, 2019
47f9cc2
Roll 8.0.0-beta.1
cybergrind Aug 22, 2019
a2a996a
lint & prettier changes
fbartho Aug 22, 2019
30bdcff
iOS Fixup `paymentRequestWithCardForm` for stripe-ios Breaking API Ch…
fbartho Aug 22, 2019
b03a721
Add metadata support on Android
mindlapse Aug 22, 2019
6844041
Fix JSDocs around PaymentMethod customerId
fbartho Aug 24, 2019
bbec563
JSDoc the PaymentMethodCard Type -- especially Brand
fbartho Aug 24, 2019
3b2233a
Misc consistency
fbartho Aug 24, 2019
d270585
iOS: Don't assert if the paymentMethod is not provided in this helper…
fbartho Aug 24, 2019
248c3a2
iOS: Use the official way to bridge CardBrands to Strings
fbartho Aug 24, 2019
5d8f176
Android: Attempt to convert CardBrands instead of exposing the lowerc…
fbartho Aug 24, 2019
9f269d7
Merge pull request #528 from tipsi/fb/android-card-brand-consistency
mindlapse Aug 25, 2019
21ed4fa
Restored brand slugs for PaymentMethod card serialization
mindlapse Aug 25, 2019
f212d82
Change CardBrand handling to expose API differences in Stripe Constan…
fbartho Aug 25, 2019
30a97da
Add display utilities around card brands
fbartho Aug 25, 2019
6ebf619
JSDoc the PaymentCardTextField Component
fbartho Aug 25, 2019
4ea4573
Doc update, re: PaymentIntent API
mindlapse Aug 26, 2019
cd16223
Roll 8.0.0-beta.2
cybergrind Aug 26, 2019
95f6f66
Fix iOS constant-key macro
fbartho Aug 26, 2019
bec6d0f
stripe-ios 16.0.7
fbartho Aug 26, 2019
81a403e
Removed support for token creation in stripe.paymentRequestWithCardForm
mindlapse Aug 26, 2019
cfc1375
Removed support for token creation in stripe.paymentRequestWithCardForm
mindlapse Aug 26, 2019
0b0c49a
PaymentCardTextField component, event bubbling issue
fbartho Aug 26, 2019
7f144a1
Further Improve JSDocs
fbartho Aug 28, 2019
03e82fc
Roll out 8.0.0-beta.3
cybergrind Aug 28, 2019
3350646
Updated changelog & appinfo
mindlapse Aug 28, 2019
abe0647
iOS Stripe-AppInfo version to 8.x
fbartho Aug 28, 2019
fb3af26
provide a status of unknown in the error state of serializing (Paymen…
fbartho Aug 28, 2019
0f552c5
iOS Changelog tweaks
fbartho Aug 29, 2019
a696b98
Make our post-link-ios script suggest stripe-ios 16.x
fbartho Aug 29, 2019
95049c6
Serialize `paymentMethodId` when resolving confirmSetupIntent/authent…
fbartho Aug 28, 2019
68f1731
Merge branch 'experimental' into experimental+paymentMethodIdForConfi…
fbartho Aug 29, 2019
694f652
stripe-android 10.4.0 & paymentMethodId consistency!
fbartho Aug 29, 2019
5a351c8
Upgraded stripe-android to 10.4.0 and added paymentMethodId
mindlapse Aug 29, 2019
b7c293b
Merge pull request #530 from tipsi/experimental+paymentMethodIdForCon…
mindlapse Aug 29, 2019
8f4c7ed
nil/null robustness (in case users pass null for this parameter)
fbartho Aug 29, 2019
91a801e
Parse & use the returnURL if provided for relevant APIs
fbartho Aug 29, 2019
7986ae3
Quick-Document the returnURL property
fbartho Aug 29, 2019
c73f7c7
Better Connect Stripe Error Messages through to React-Native
fbartho Aug 30, 2019
bfde692
Reverting to stripe-android 10.2.1
mindlapse Aug 30, 2019
6957916
Merge branch 'experimental' of github.com:tipsi/tipsi-stripe into exp…
mindlapse Aug 30, 2019
1ba4336
Merge branch 'master' into experimental
mindlapse Aug 30, 2019
8f518b8
Roll out 8.0.0-beta.4
cybergrind Sep 2, 2019
f8a55f0
Enable android pay in example app
mindlapse Sep 2, 2019
08a74a1
Merge branch 'experimental' of github.com:tipsi/tipsi-stripe into exp…
mindlapse Sep 2, 2019
7386b5a
Docs: add saving card documentation
cybergrind Sep 3, 2019
5ec9248
Docs: build new version
cybergrind Sep 3, 2019
18991e8
Finish up fixing the PaymentCardTextField Component iOS Lockup
fbartho Sep 4, 2019
2e32889
iOS: Support using multiple Stripe accounts with 3DSecure
fbartho Sep 4, 2019
0bd2d6c
Updated confirmSetupIntent error codes
mindlapse Sep 5, 2019
98d49af
iOS: Android Error Consistency re: authenticationFailed
fbartho Sep 5, 2019
4c84bbe
Example app screen improvements
mindlapse Sep 5, 2019
ee98528
Expose setStripeAccount to JS (Enable Stripe Connect accounts)
andrepcg Sep 5, 2019
1a5a5cc
Fix incorrect method access. Add usage and code to example app
andrepcg Sep 5, 2019
1f1dd21
Roll out 8.0.0-beta.5
cybergrind Sep 5, 2019
b03924d
iOS: Fix happy path for cards
fbartho Sep 5, 2019
1c8161c
Roll out 8.0.0-beta.6
cybergrind Sep 6, 2019
1867361
Merge remote-tracking branch 'setoptions/connect-account' into experi…
mindlapse Sep 6, 2019
9ab012f
iOS: Remove assert forcing paymentMethod/id to be passed to confirmPa…
fbartho Sep 6, 2019
e0e9b9d
Example app - added missing lines
mindlapse Sep 6, 2019
7e61f1a
Fix for <STRIPE_ACCOUNT>
mindlapse Sep 6, 2019
5ce6c58
Merge branch 'experimental' of github.com:tipsi/tipsi-stripe into exp…
mindlapse Sep 6, 2019
e001986
Revert "Fix for <STRIPE_ACCOUNT>"
mindlapse Sep 6, 2019
9b24269
Revert 1a5a5cc4982af1453da89aba8d3e0fe1586e596a
mindlapse Sep 6, 2019
9729430
Revert ee98528ba984b2ac5090997a50b388bd4cec957a
mindlapse Sep 6, 2019
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
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

42 changes: 42 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
"extends": [
"tipsi",
"plugin:prettier/recommended",
"prettier/react"
],
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jest": true,
"node": true
},
"rules": {
"jsx-a11y/href-no-hash": ["off"],
"react/jsx-filename-extension": ["warn", { "extensions": [".js", ".jsx"] }],
"max-len": [
"warn",
{
"code": 100,
"tabWidth": 2,
"comments": 100,
"ignoreComments": false,
"ignoreTrailingComments": true,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
// We have some utility methods exposed on the Stripe JS Class
// These don't reference 'this', so this rule doesn't apply in our library
'class-methods-use-this': 0,
// This would prevent the ForInStatement which has been in the codebase for
// 2 years, so we're overriding the tipsi-style to allow this
"no-restricted-syntax": 0,

// This would prevent the typeSpecs.hasOwnProperty which has been in the
// codebase for 2 years
"no-prototype-builtins": 0
},
}
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# React Native
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
*.jsbundle

# OSX
#
.DS_Store
Expand Down Expand Up @@ -70,10 +78,11 @@ android/gradle/wrapper/gradle-wrapper.properties

# node.js
#
node_modules/
**/node_modules/
npm-debug.log

tmp
example_tmp
example_podspec
*.tgz
*~
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
printWidth: 100,
singleQuote: true

// Don't set these at the global level,
// semi: false, -- breaks TypeScript
// arrowParens: "always"
};
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
env:
global:
- COMPILE_API_LEVEL=28
- EMULATOR_API_LEVEL=24 # It seems emulator levels 25,26,27 from main repos have google_apis by default, and do not support armeabi-v7a. Check commit comment.
- EMULATOR_TAG=default # Possible values are default, google_apis, android-tv, android-wear, android-wear-cn
- EMULATOR_ABI=armeabi-v7a # Default is armeabi-v7a, possible options are: x86, x86_64, mips, arm64-v8a, armeabi-v7a. Note: check commit comment
- EMULATOR_API_LEVEL=24 # It seems emulator levels 25,26,27 from main repos have google_apis by default, and do not support armeabi-v7a. Check commit comment.
- EMULATOR_TAG=default # Possible values are default, google_apis, android-tv, android-wear, android-wear-cn
- EMULATOR_ABI=armeabi-v7a # Default is armeabi-v7a, possible options are: x86, x86_64, mips, arm64-v8a, armeabi-v7a. Note: check commit comment
- EMULATOR_NAME=test
- ANDROID_BUILD_TOOLS_VERSION=28.0.3 # Match build-tools version used in build.gradle
- EMULATOR="system-images;android-${EMULATOR_API_LEVEL};${EMULATOR_TAG};${EMULATOR_ABI}" # Used to install/create emulator

matrix:
include:
- os: osx
language: objective-c
osx_image: xcode9.1
language: node_js
osx_image: xcode10.3
env:
- JOB_NAME=DEFAULT_IOS
- os: osx
language: objective-c
osx_image: xcode9.1
language: node_js
osx_image: xcode10.3
install: echo "PODSPEC install"
before_script: echo "PODSPEC before_script"
script: .travis/podspec/ci.sh
env:
- JOB_NAME=PODSPEC_IOS
- os: linux
jdk: oraclejdk8
language: node_js
jdk: oraclejdk9
sudo: required
env:
- JOB_NAME=ANDROID_5
Expand Down
Empty file added .travis/before-ci.sh
Empty file.
8 changes: 2 additions & 6 deletions .travis/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ init_new_example_project() {
done
}

# NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4,
# please use NODEJS_ORG_MIRROR
export NODEJS_ORG_MIRROR=http://nodejs.org/dist

sudo apt-get install openjdk-8-jdk

echo "Installing npm@6.10.2"
sudo npm i npm@6.10.2 -g
echo "Installing npm@6.10.3"
sudo npm i npm@6.10.3 -g


case "${TRAVIS_OS_NAME}" in
Expand Down Expand Up @@ -131,6 +129,4 @@ rm -rf *.tgz
echo "Creating a new tarball"
npm pack

cp -f tipsi-stripe-$(node -p "require('./package.json').version").tgz tipsi-stripe-latest.tgz

init_new_example_project
2 changes: 1 addition & 1 deletion .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ case "${TRAVIS_OS_NAME}" in
esac

rm -rf node_modules && npm ci
npm i tipsi-stripe@../tipsi-stripe-latest.tgz --save
npm i tipsi-stripe@../tipsi-stripe-$(node -p "require('../package.json').version").tgz --save

echo "Unlinking $library_name"
react-native unlink $library_name
Expand Down
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
# Changelog

## [8.0.0] - 2019-09-01

### Android

- Compile SDK Version increased from 26 -> 28
- Target SDK Version increased from 26 -> 28
- Min SDK Version increased from 16 -> 19
- Support libraries increased from 27.1.0 to 28.0.0
- `stripe-android` upgraded from 8.1.0 to 10.4.0

### iOS

- Minimum compatible `stripe-ios` sdk -> 16.0.0, but recommended 16.0.6 or later (update your `Podfile` or vendored `stripe-ios`!)
- Xcode version: recommended 10.3.1 or later

### New SCA-ready APIs

- `stripe.createPaymentMethod(…)`
- `stripe.confirmPaymentIntent(…)`
- `stripe.confirmSetupIntent(…)`
- `stripe.authenticatePaymentIntent(…)` (only used with manual confirmation mode)
- `stripe.potentiallyAvailableNativePayNetworks(…)`

### Common

- **Breaking** The Card form now returns a PaymentMethod. The Card form will no longer return a token (or Source)
- **Warning** Supports React Native 59.x (*other versions at your own risk*)
- JSDoc-annotated API Descriptions for the new APIs
- Helper methods `stripe.slugForCardBrand(…)` and `stripe.presentableStringForCardBrand(…)` to normalize Card Brand Strings that change values depending on which API you're working with. (Stripe API oddity)

### Bug fixes

- Prevented toErrorCode from itself causing an error

### Examples

- The example app has new PaymentIntent and SetupIntent screens that can be used to test various card scenarios
- The example app requires a backend for those screens, which can be forked and one-click deployed to Heroku from:
- [mindlapse/example-tipsi-stripe-backend](https://github.com/mindlapse/example-tipsi-stripe-backend)
- You need to set the environment variable BACKEND_URL to the location it is deployed

### Dev tooling

- Added .circleci config
- Added eslint & prettier config


## [7.5.0] - 2019-04-22

- [Google pay: capture email](https://github.com/tipsi/tipsi-stripe/pull/469)
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@

React Native Stripe binding for iOS/Android platforms

## Strong Customer Authentication (SCA) support
### PaymentIntents & SetupIntents

Have no fear, it's on its way!

We are actively preparing for a September 1 stable release in time for the European SCA regulation deadline of September 14.

In the meantime, if your company would like early access to the beta and help with the new changes,
please sign up here and let us know what company it is for:
https://github.com/tipsi/tipsi-stripe/issues/448

Then, join our Discord channel to access the beta, to get support from the contributors, and to help us
be aware of any issues you find. Here is the invite link: https://discord.gg/8g6ppq2

We'll make notifications on that channel as new beta releases are published, along with sharing
documentation and handling questions.

p.s. if you are skilled at writing Appium tests, please raise your hand on the channel!

Cheers!


## Documentation

https://tipsi.github.io/tipsi-stripe/docs/index.html
Expand Down Expand Up @@ -44,6 +66,11 @@ npm run start-docs
npm run build-docs
```

## Community

[Discord](https://discord.gg/vmBxnBw)


## License

tipsi-stripe is available under the MIT license. See the [LICENSE](https://github.com/tipsi/tipsi-stripe/tree/master/LICENSE) file for more info.
23 changes: 21 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@

buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}

apply plugin: 'com.android.library'

def DEFAULT_COMPILE_SDK_VERSION = 28
Expand Down Expand Up @@ -36,10 +47,18 @@ dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "com.google.android.gms:play-services-wallet:$googlePlayServicesVersion"
implementation "com.google.firebase:firebase-core:$firebaseVersion"
implementation 'com.stripe:stripe-android:9.3.5'
implementation 'com.stripe:stripe-android:10.2.1'
implementation 'com.github.tipsi:CreditCardEntry:1.5.1'
}

repositories {
google()
mavenCentral()
maven {
url "https://jitpack.io"
}
jcenter()
// maven {
// // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
// url "$rootDir/../example/node_modules/react-native/android"
// }
}
6 changes: 5 additions & 1 deletion android/src/main/java/com/gettipsi/stripe/Errors.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public final class Errors {

private static final Map<String, String> exceptionNameToErrorCode = new HashMap<>();

public static final String CANCELLED = "cancelled";
public static final String AUTHENTICATION_FAILED = "authenticationFailed";
public static final String UNEXPECTED = "unexpected";

static {
exceptionNameToErrorCode.put("APIConnectionException", "apiConnection");
exceptionNameToErrorCode.put("StripeException", "stripe");
Expand All @@ -27,7 +31,7 @@ public final class Errors {
exceptionNameToErrorCode.put("APIException", "api");
}

static String toErrorCode(@NonNull Exception exception) {
public static String toErrorCode(@NonNull Exception exception) {
ArgCheck.nonNull(exception);
String simpleName = exception.getClass().getSimpleName();
String errorCode = exceptionNameToErrorCode.get(simpleName);
Expand Down
Loading