forked from stripe/stripe-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: Typescript upgrade + type audit (stripe#837)
- Loading branch information
1 parent
0dd668f
commit d2eb808
Showing
63 changed files
with
1,350 additions
and
1,376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,43 @@ | ||
# CHANGELOG | ||
|
||
- [#837](https://github.com/stripe/stripe-react-native/pull/837) BREAKING CHANGE: Mostly fixes and changes to types, but some method's now accept slightly different parameters: | ||
- Removed `setUrlSchemeOnAndroid` in favor of `setReturnUrlSchemeOnAndroid`. `setReturnUrlSchemeOnAndroid` functions exactly the same, this is just a rename. | ||
- Removed `handleCardAction` in favor of `handleNextAction`. `handleNextAction` functions exactly the same, this is just a rename. | ||
- `createPaymentMethod`'s `billingDetails` and `shippingDetails` parameters no longer accept the `addressPostalCode`, `addressCity`, `addressCountry`, `addressLine1`, `addressLine2`, or `addressState` keys. Instead, they accept an `address` object containing: `city`, `country`, `line1`, `line2`, `postalCode`, `state`. | ||
- `confirmPayment`'s `billingDetails` and `shippingDetails` parameters no longer accept the `addressPostalCode`, `addressCity`, `addressCountry`, `addressLine1`, `addressLine2`, or `addressState` keys. Instead, they accept an `address` object containing: `city`, `country`, `line1`, `line2`, `postalCode`, `state`. | ||
- `BillingDetails` no longer includes `addressPostalCode`, `addressCity`, `addressCountry`, `addressLine1`, `addressLine2`, or `addressState` keys. Instead, it includes an `address` object containing: `city`, `country`, `line1`, `line2`, `postalCode`, `state` keys. | ||
- `ShippingDetails` no longer includes `addressPostalCode`, `addressCity`, `addressCountry`, `addressLine1`, `addressLine2`, or `addressState` keys. Instead, it includes an `address` object containing: `city`, `country`, `line1`, `line2`, `postalCode`, `state` keys. | ||
- `PaymentIntents` was renamed `PaymentIntent`. (If you were using `PaymentIntents.Status`, now you must change it to `PaymentIntent.Status`) | ||
- `SetupIntents` was renamed `SetupIntent`. (If you were using `SetupIntents.Status`, now you must change it to `SetupIntent.Status`) | ||
- (Typescript) `Card.Token` is now `Token.Result` | ||
- (Typescript) `Card.Brand` is now `Token.CardBrand` | ||
- (Typescript) `Card.TokenType` is now `Token.Type` | ||
- (Typescript) `Card.BankAccount` is now `Token.BankAccount` | ||
- (Typescript) `Card.Params` is now `Token.Params` | ||
- (Typescript) `CardFormView.Names` is now `CardFormView.FieldName` | ||
- (Typescript) `CardFieldInput.Names` is now `CardFieldInput.FieldName` | ||
- (Typescript) `ApplePayButtonComponent.Styles` is now `ApplePayButtonComponent.Style` | ||
- (Typescript) `ApplePayButtonComponent.Types` is now `ApplePayButtonComponent.Type` | ||
- (Typescript) `PaymentMethod` is now `PaymentMethod.Result` | ||
- (Typescript) `PaymentIntent` is now `PaymentIntent.Result` | ||
- (Typescript) `SetupIntent` is now `SetupIntent.Result` | ||
- (Typescript) Exports that were under the `Card` namespace are now under `Token` | ||
- (Typescript) `CreateTokenParams` is now `Token.CreateParams` | ||
- (Typescript) `BankAcccountHolderType` is now `Token.BankAcccountHolderType` | ||
- (Typescript) `ThreeDSecureConfigurationParams` is now `ThreeDSecure.ConfigurationParams` | ||
- (Typescript) `PaymentMethodCreateParams.Params` is now `PaymentMethod.CreateParams` | ||
- (Typescript) `PaymentMethodCreateParams.Options` is now `PaymentMethod.ConfirmOptions` | ||
- (Typescript) `CreateTokenParams` is now `Token.CreateParams` | ||
- (Typescript) `ConfirmSetupIntent.Params` is now `SetupIntent.ConfirmParams` | ||
- (Typescript) `ConfirmSetupIntent.Options` is now `SetupIntent.ConfirmOptions` | ||
- (Typescript) `confirmPayment` now accepts the `PaymentIntent.ConfirmParams` (same type, just renamed). | ||
- (Typescript) `BillingDetails` type is now exported directly, instead of under the `PaymentMethodCreateParams` object. | ||
- (Typescript) `presentGooglePay` now accepts `GooglePay.PresentParams` | ||
- (Typescript) `GooglePay.PresentGooglePayParams` is now `GooglePay.PresentParams` | ||
- (Typescript) `GooglePay.PresentGooglePayType` is now `GooglePay.PresentType` | ||
- (Typescript) `GooglePay.IsGooglePaySupportedParams` is now `GooglePay.IsSupportedParams` | ||
- (Typescript) Removed `GooglePay.SetupIntentParams` | ||
|
||
## 0.6.0 | ||
|
||
- [#861](https://github.com/stripe/stripe-react-native/pull/861) BREAKING: This library now supports iOS 12 and up, due to `stripe-ios` increasing the deployment target. If you would like to build for iOS 11, please continue to use `@stripe/[email protected]`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,7 +201,7 @@ describe('Payment scenarios with redirects', () => { | |
$('~payment-screen').waitForDisplayed({ timeout: 30000 }); | ||
|
||
BasicPaymentScreen.pay({ email: '[email protected]' }); | ||
BasicPaymentScreen.authorize(); | ||
BasicPaymentScreen.authorize({ elementType: 'a' }); | ||
BasicPaymentScreen.checkStatus(); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import type { PaymentMethodCreateParams } from '@stripe/stripe-react-native'; | ||
import type { | ||
BillingDetails, | ||
PaymentMethod, | ||
} from '@stripe/stripe-react-native'; | ||
import React, { useState } from 'react'; | ||
import { Alert, StyleSheet, TextInput } from 'react-native'; | ||
import { useConfirmPayment } from '@stripe/stripe-react-native'; | ||
|
@@ -38,21 +41,25 @@ export default function AfterpayClearpayPaymentScreen() { | |
return; | ||
} | ||
|
||
const billingDetails: PaymentMethodCreateParams.BillingDetails = { | ||
const billingDetails: BillingDetails = { | ||
email: '[email protected]', | ||
phone: '+48888000888', | ||
addressCity: 'Houston', | ||
addressCountry: 'US', | ||
addressLine1: '1459 Circle Drive', | ||
addressLine2: 'Texas', | ||
addressPostalCode: '77063', | ||
address: { | ||
city: 'Houston', | ||
country: 'US', | ||
line1: '1459 Circle Drive', | ||
line2: 'Texas', | ||
postalCode: '77063', | ||
}, | ||
name: 'John Doe', | ||
}; | ||
|
||
const shippingDetails: PaymentMethodCreateParams.ShippingDetails = { | ||
addressLine1: '1459 Circle Drive', | ||
addressCountry: 'US', | ||
addressPostalCode: '77063', | ||
const shippingDetails: PaymentMethod.ShippingDetails = { | ||
address: { | ||
country: 'US', | ||
line1: '1459 Circle Drive', | ||
postalCode: '77063', | ||
}, | ||
name: 'John Doe', | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import type { PaymentMethodCreateParams } from '@stripe/stripe-react-native'; | ||
import type { BillingDetails } from '@stripe/stripe-react-native'; | ||
import React, { useState } from 'react'; | ||
import { Alert, StyleSheet, TextInput, View, Text, Switch } from 'react-native'; | ||
import { useConfirmPayment } from '@stripe/stripe-react-native'; | ||
|
@@ -40,7 +40,7 @@ export default function BancontactPaymentScreen() { | |
return; | ||
} | ||
|
||
const billingDetails: PaymentMethodCreateParams.BillingDetails = { | ||
const billingDetails: BillingDetails = { | ||
name: 'John Doe', | ||
email: '[email protected]', | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.