Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Update to 8.0.0-beta10 (#3)
Browse files Browse the repository at this point in the history
* Stripe AppInfo added with stripe-android, react-native & android upgrade

AppInfo is needed so that Stripe can identify the transactions that are created through tipsi-stripe

Along with this, the compile and target SDK versions for android have been bumped to v28, stripe-android has been upgraded to 9.3.5, the minSdkVersion has increased to v19 (required).

Example app changes:
- Android compile and target SDK change from 26 -> 28
- Android min SDK change from 16 -> 19
- Android multiDexEnabled true
- Android support libraries upgraded to v28
- React native upgraded to 0.59.10
- React upgraded to 16.8.6
- android.useDeprecatedNdk=true was removed since it is no longer supported.
- android.enableAapt2=false was removed since it is now the default
- Gradle build tools upgraded to 3.4.1.  Gradle wrapper upgraded to v5.5.

* Adding .circleci

* Stripe AppInfo and library upgrades

- CircleCI config (for android)
- Android - Compile SDK version increased from 26 to 28
- Android - Target SDK version increased from 26 to 28
- Android - Min SDK version increased from 16 to 19
- Android - stripe-android increased from 8.1.0 to 9.3.5
- Android - Added Stripe AppInfo to requests

Example app:
- Updated react-native to 0.59.10 from 0.45.0
- Updated react to 16.8.6 from 16.0.x
- Upgraded gradle

Tests:
- Updated test suite to use webdriver 5.x from 4.7.1
- Update appium to 1.14

* stripe-ios AppInfo initial config

* `managedAccountCurrency` is no longer relevant according to the migration guide.

* typo-fixes

* Update Stripe CardForm options to support the "name"-only option in the requiredBillingAddressFields-option

* Dynamically list supported ApplePay networks on this device & write documentation

* Switch eslint-config & allow rules that are already existing patterns in the codebase

* Add missing docs pages, and reorganize the sidebars a little bit

* Add prettier to format the rendered-docs-html making diffing easier, and render the current docs

* Upgrade Example Project to Stripe 16 & Cocoapods changed something

* misc test fix

* React-Native 59 for the Example App for iOS

* ApplePay example tweaks now that it's running

* Got the testapp changes working!

* Prettier Javascript Formatting

* Extract Deprecated Methods to a separate file

* Adds Android confirmPayment, authenticatePayment, createPaymentMethod

Note: This commit breaks iOS - a subsequent commit is needed
Added confirmPayment, authenticatePayment, createPaymentMethod bindings for src/Stripe.js
Upgrade to stripe-android:10.1.1

* Adds Android confirmSetupIntent and authenticateSetup

 Note: This commit breaks iOS - a subsequent commit is needed

* Android changes for confirming a payment intent, with test page

- Confirmation of a payment intent resolves with { status, paymentIntentId }
- status is one of 'CANCELED', 'FAILED', 'SUCCEEDED', 'TIMEDOUT', or 'UNKNOWN'
- test page requires 'STRIPE_BACKEND' env to be defined, and it should contain a URL with a trailing slash pointing to a deployment of https://github.com/mindlapse/example-tipsi-stripe-backend

* Android changes for confirming a payment intent, with test page (cont..)

Wiring in the new example app PaymentIntentScreen

* Prettier configs in subfolders

* Prettier Formatting

* Adds SetupIntentScreen and stripe-android:10.2.1 (contains setupintent fix)

* PaymentIntent demo page updated to include manual entry with the card widget

* Add some jsDocs

* TPSCardField fixes

* iOS: Stub-in new methods, tweak certain bits of lifecycle

* API changes

- Dropped support for 'returnURL' for now (until there is demand for it to be introduced along with proper demo/tests)
- Added experimental Promise handling for authenticateSetup and authenticatePayment
- Allow a payment intent to be confirmed with just the clientSecret (without requiring a payment method to be provided client side)

* iOS: Implement Serializers / Parsers for marshalling parameters/results across the RN Bridge + JSDoc

* JSDoc: Missed a type

* iOS: error case robustness

* iOS: implement authenticatePaymentIntent / authenticateSetupIntent

* Prettier Formatting for PaymentIntent/SetupIntent Test Screens

* Tweak confirmPayment/confirmSetup to check & process 3DSecure Actions

* React 16.9 componentWillMount deleted compatibility

* Get Travis to install Xcode10.3 & Node >= 8.3

* oraclejdk8 is not supported on Travis's Xenial boxes

* Apply suggestions from code review

PRFeedback!

* Update npm to try to fix error

* Fix field focus infinite recursion in keyboardWillShow on > RN 45

Fixes tipsi#408

React-Native removed support for the react(Will|Did)MakeFirstResponder APIs in this commit: facebook/react-native@bc1ea54#diff-3e154f92c7ba4cb47e96785b9dadf3aa

* Fix incorrect test js syntax

* Fixup some issues with ci for ios

* Prettier formatting

* Adds test cards to demo page

Test cards can be found here:

https://stripe.com/docs/testing

* Adding manual confirmation support for Payment Intents

* Merge fixes, updated npm run configure to list rewrite envs

* Doc update - adds Objects > PaymentMethod

* Have new setup & payment intent methods return the status off of the intent itself

* example app: PaymentIntentScreen updates

* Added an extra test card (has no 3ds & always declines)

* Example app: automatic flow error handling update

* Additional test cards

* AddCardDialogFragment changes to support PaymentMethods

* Remove support for sourceId from confirmPayment

* tipsi-stripe iOS Native SDK version to 16.0.6

adrien.teulade-pod-point / timrc discussed this in Discord

* Remove Signatures that React-Native can't resolve at runtime

these are typedefs that revert to NSStrings at runtime, but that means that the name doesn't exist which then fails to pass their check here: https://github.com/facebook/react-native/blob/c20070f10458d48d6ac1eaac49e681e932bfb9fd/React/Base/RCTParserUtils.m#L119

* Example: Prettier (JS Formatting)

* Tighten up some types as per discussion

Discussion Thread: https://github.com/tipsi/tipsi-stripe/pull/515/files#r310823098

* Android: Ensure useStripeSDK is always set to true

* Adds returnURL to confirm calls and 'Intent' suffix to the Stripe.js interface

* Token fix

* Missed prettier-jsx formatting

* Robustness in CardParams parsing from tokens

* jsdoc cardparam.token

* iOS: API Naming Consistency

* iOS: Enable recommended modern iOS Warnings

* Fixup reasonable lint exceptions in the example app

* eslint-based fixes

* Example-app: API Naming Consistency with Native

* PaymentIntent requires_payment_method -> requires_paymentMethod based on iOS

* iOS, JS: fixup IntentStatus values to match Server Docs

* Disabling authenticateSetupIntent until we need it

* PaymentIntent guide - doc update

* Small fix to example app

* Roll 8.0.0-beta.1

* lint & prettier changes

* iOS Fixup `paymentRequestWithCardForm` for stripe-ios Breaking API Changes

* Add metadata support on Android

* Fix JSDocs around PaymentMethod customerId

* JSDoc the PaymentMethodCard Type -- especially Brand

* Misc consistency

* iOS: Don't assert if the paymentMethod is not provided in this helper (reused when a paymentMethodId might be provided)

* iOS: Use the official way to bridge CardBrands to Strings

* Android: Attempt to convert CardBrands instead of exposing the lowercased constant values

* Restored brand slugs for PaymentMethod card serialization

* Change CardBrand handling to expose API differences in Stripe Constant-values

* Card-based APIs expose brand as a Human Presentable Value -- eg "American Express"
* Newer, PaymentMethod:Card-based APIs expose brand as a brand-slug Identifier -- eg "amex"

* Add display utilities around card brands

* JSDoc the PaymentCardTextField Component

* Doc update, re: PaymentIntent API

* Roll 8.0.0-beta.2

* Fix iOS constant-key macro

* stripe-ios 16.0.7

* Removed support for token creation in stripe.paymentRequestWithCardForm

Only PaymentMethod creation is supported

* Removed support for token creation in stripe.paymentRequestWithCardForm

* PaymentCardTextField component, event bubbling issue

* Further Improve JSDocs

* Roll out 8.0.0-beta.3

* Updated changelog & appinfo

* iOS Stripe-AppInfo version to 8.x

* provide a status of unknown in the error state of serializing (Payment/Setup)IntentResults

This matches iOS

* iOS Changelog tweaks

* Make our post-link-ios script suggest stripe-ios 16.x

* Serialize `paymentMethodId` when resolving confirmSetupIntent/authenticateSetupIntent

Related feature request for Android PaymentIntents: stripe/stripe-android#1445

* stripe-android 10.4.0 & paymentMethodId consistency!

* Upgraded stripe-android to 10.4.0 and added paymentMethodId

* nil/null robustness (in case users pass null for this parameter)

* Parse & use the returnURL if provided for relevant APIs

* Quick-Document the returnURL property

* Better Connect Stripe Error Messages through to React-Native

* Roll out 8.0.0-beta.4

* Enable android pay in example app

* Docs: add saving card documentation

* Docs: build new version

* Finish up fixing the PaymentCardTextField Component iOS Lockup

Moots tipsi#508 tipsi#521

* iOS: Support using multiple Stripe accounts with 3DSecure

* Updated confirmSetupIntent error codes

* iOS: Android Error Consistency re: authenticationFailed

* Example app screen improvements

* Expose setStripeAccount to JS (Enable Stripe Connect accounts)

* Fix incorrect method access. Add usage and code to example app

* Roll out 8.0.0-beta.5

* iOS: Fix happy path for cards

* Roll out 8.0.0-beta.6

* iOS: Remove assert forcing paymentMethod/id to be passed to confirmPaymentIntent

Instead of forcing them to re-submit the same paymentMethod/paymentMethodId at the time of confirmPaymentIntent, the user can instead attach the paymentMethod/id on the backend before calling confirm

* Example app - added missing lines

* Fix for <STRIPE_ACCOUNT>

* Revert "Fix for <STRIPE_ACCOUNT>"

This reverts commit 7e61f1a.

* Revert 1a5a5cc

* Revert ee98528

* PropTypes: Allow omitting paymentMethod/paymentMethodId on confirmPaymentIntent

Fixes: tipsi#536

* iOS: Misc readability

* iOS: Treat `requires_capture` as a successful confirmPaymentIntent status

* Move the PaymentIntentStatusRequiresCapture check to the confirmPaymentIntent method

* confirmPaymentIntent: clean up wrong enum copy-paste error

* iOS: Default to useStripeSDK = true

* iOS: Clean up some unnecessary redundant returnURL parsing

* To align with iOS, the confirmPaymentIntent promise is rejected unless the payment intent ends up in `succeeded` or `requires_capture`

* If the resultingStatus of the PaymentIntent is either `succeeded`, or `requires_capture` then resolve the promise with `{ status: 'succeeded', ... }`
* If the resultingStatus of the PaymentIntent is either `canceled`, `requires_action`, or `requires_confirmation`, then consider the payment intent to be `cancelled` and reject the promise.
* Otherwise, consider the payment intent to be `failed` and reject the promise

* Roll out 8.0.0-beta.7

* Upgrade to latest stripe-android on the 10.4 branch

* Allow/Suggest stripe-ios @ 17.0.1 or later

* Android: Allow RequiresConfirmation to be a successful outcome

* Logic cleanup

* Roll out 8.0.0-beta.8

* Switch Statement Robustness -- stripe-ios 17.0.2 compatibility

* Prettier Formatting

* Add setStripeAccount support.

Adds Stripe Connect Support.
new JS method `setStripeAccount` which can be an account id or null.

* Migration doc

* Upgrade tipsi-android to 1.4.6

See: stripe/stripe-android#1654

* Roll 8.0.0-beta.9

* Fix extracting billingDetails

* Fixed compilation error for 8.0.0.beta9 due to fpx issue

* Mark an unsupported entry with a comment

* Fix build on xcode 11.4

See stripe/stripe-ios#1526

* Update npmignore

* Update for AndroidX (#2)

* Saving before trying android studio migrate

* AndroidX conversion tweaks

* AndroidX conversion tweaks

Co-authored-by: Tomas Maly <tmaly1980@gmail.com>

Co-authored-by: Dave MacDonald <mindlapse@gmail.com>
Co-authored-by: Frederic Barthelemy <git@fbartho.com>
Co-authored-by: Kirill Pinchuk <cybergrind@gmail.com>
Co-authored-by: Dave MacDonald <mindlapse@users.noreply.github.com>
Co-authored-by: André Perdigão <andrepcg@gmail.com>
Co-authored-by: Bram Whillock <bramski@gmail.com>
Co-authored-by: Igor Kozlovsky <igor.lemon.kozlovsky@gmail.com>
Co-authored-by: Max Hung <info@maxhung.co.nz>
Co-authored-by: Torres Yang <yangguanhua@gmail.com>
Co-authored-by: Tomas Maly <tmaly1980@gmail.com>
  • Loading branch information
11 people authored Jun 12, 2020
1 parent 67f269b commit aa18511
Show file tree
Hide file tree
Showing 162 changed files with 48,900 additions and 13,512 deletions.
38 changes: 38 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: 2
jobs:
build:

docker:
- image: circleci/node:12.6.0

resource_class: xlarge
working_directory: ~
environment:
COMPILE_API_LEVEL: 28
EMULATOR_API_LEVEL: 24
EMULATOR_TAG: default
EMULATOR_ABI: armeabi-v7a
EMULATOR_NAME: test
ANDROID_BUILD_TOOLS_VERSION: 28.0.3
EMULATOR: system-images;android-24;default;armeabi-v7a
TRAVIS_OS_NAME: linux

steps:

- checkout
# - restore_cache:
# keys:
# - v1-dependencies-{{ checksum "package.json" }}
# # fallback to using the latest cache if no exact match is found
# - v1-dependencies-
- run: env
- run: .travis/before-install.sh
- run: .travis/install.sh
- run:
command: .travis/ci.sh
no_output_timeout: 30m

# - save_cache:
# paths:
# - node_modules
# key: v1-dependencies-{{ checksum "package.json" }}
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"
};
34 changes: 16 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
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_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
language: android
jdk: oraclejdk8
language: node_js
jdk: oraclejdk9
sudo: required
android:
components:
- platform-tools
- tools
- build-tools-25.0.0
- build-tools-26.0.2
- android-21
- android-26
- sys-img-armeabi-v7a-android-21
- extra-android-m2repository
- extra-google-m2repository
- extra-google-google_play_services
env:
- JOB_NAME=ANDROID_5

Expand Down
13 changes: 0 additions & 13 deletions .travis/before-ci.sh
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
#!/bin/bash

case "${TRAVIS_OS_NAME}" in
linux)
echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a --skin WVGA800
emulator -avd test -scale 96dpi -dpi-device 160 -no-audio -no-window &
android-wait-for-emulator
sleep 60
adb shell input keyevent 82 &
;;
esac

example_tmp/node_modules/.bin/appium --session-override > appium.out &
83 changes: 74 additions & 9 deletions .travis/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ init_new_example_project() {
files_to_copy=(
.appiumhelperrc
package.json
package-lock.json
index.{ios,android}.js
android/appium-config.json
android/build.gradle
android/app/build.gradle
android/gradle/wrapper/gradle-wrapper.properties
Expand All @@ -27,41 +29,104 @@ init_new_example_project() {
react-native init $proj_dir_old --version $react_native_version
rm -rf $proj_dir_old/__tests__
cd ..
rm -rf $proj_dir_new
mv tmp/$proj_dir_old $proj_dir_new
rm -rf tmp

echo "Copying $proj_dir_old files into $proj_dir_new"
for i in ${files_to_copy[@]}; do
if [ -e $proj_dir_old/$i ]; then
cp -Rp $proj_dir_old/$i $proj_dir_new/$i
fi
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

$HOME/.nvm/nvm.sh
nvm install 8.9.0
npm i npm@6 -g
sudo apt-get install openjdk-8-jdk

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


case "${TRAVIS_OS_NAME}" in
osx)
echo "Installing cocoapods"
gem install cocoapods -v 1.4.0
travis_wait pod repo update --silent
;;
linux)

ANDROID_TOOLS=4333796 # android-28
export ANDROID_HOME=~/android-sdk
export ANDROID_SDK_ROOT=~/android-sdk

echo "### Downloading android tools"
wget -q "https://dl.google.com/android/repository/sdk-tools-linux-$ANDROID_TOOLS.zip" -O android-sdk-tools.zip

echo "### Unzipping android tools"
sudo apt install -y unzip
unzip -oq android-sdk-tools.zip -d ${ANDROID_HOME}

echo "### Removing android-sdk-tools.zip"
rm android-sdk-tools.zip

export PATH=${PATH}:${ANDROID_HOME}/emulator:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
echo "### PATH set to $PATH"

# Silence warning.
mkdir -p ~/.android
touch ~/.android/repositories.cfg


echo "### Installing platforms;android-${COMPILE_API_LEVEL} required by compiler"
yes | sdkmanager "platforms;android-${COMPILE_API_LEVEL}" > /dev/null

echo "### Installing platforms;${EMULATOR_API_LEVEL}"
yes | sdkmanager "platforms;android-${EMULATOR_API_LEVEL}" > /dev/null

echo "### Installing tools"
yes | sdkmanager "tools" > /dev/null

echo "### Installing platform-tools"
yes | sdkmanager "platform-tools" > /dev/null

echo "### Installing emulator"
yes | sdkmanager "emulator" > /dev/null

echo "### Installing extras;android;m2repository"
yes | sdkmanager "extras;android;m2repository" > /dev/null

echo "### Installing extras;google;m2repository"
yes | sdkmanager "extras;google;m2repository" > /dev/null

echo "### Installing extras;google;google_play_services"
yes | sdkmanager "extras;google;google_play_services" > /dev/null

echo "### Installing build-tools;${ANDROID_BUILD_TOOLS_VERSION}"
yes | sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" > /dev/null

echo "### Installing ${EMULATOR} system image"
yes | sdkmanager "${EMULATOR}" > /dev/null

sdkmanager --list | head -30 # Print out package list for debug purposes
;;
esac

npm install -g react-native-cli
echo "Installing react-native-cli"
sudo npm install -g react-native-cli

# Test propTypes
npm install
echo "Calling npm ci"
npm ci

echo "Calling npm test"
npm test

# Remove existing tarball
echo "Removing existing tarball"
rm -rf *.tgz

# Create new tarball
echo "Creating a new tarball"
npm pack

init_new_example_project
Loading

0 comments on commit aa18511

Please sign in to comment.