Migration
Below are the major changes for update from legacy to active
Interfaces
Most of the changes in the library are because ngx-stripe will no longer maintain its own types. Instead, it will make use of the official Stripe types.
Changes in the interfaces should always be for the best, no mismatch between Stripe and ngx-stripe. Always up to the date the last changes.
The main change will be in terms of naming. The following table aims to be a guide reference:
Legacy | Active |
---|---|
Options | StripeConstructorOptions |
StripeJS | Stripe |
ElementsOptions | StripeElementsOptions |
Element | StripeElement |
Elements | StripeElements |
PaymentRequestOptions | PaymentRequestOptions |
PaymentIntentResult | { paymentIntent?: PaymentIntent; error?: StripeError; } |
CardSetupResult | { setupIntent?: SetupIntent; error?: StripeError; } |
SourceData | CreateSourceData |
SourceParams | RetrieveSourceParam |
SourceResult | { source?: Source; error?: StripeError } |
TokenResult | { token?: Token; error?: StripeError } |
PiiData | CreateTokenPiiData |
BankAccountData | CreateTokenBankAccountData |
CardDataOptions | CreateTokenCardData |
Account | TokenCreateParams.Account |
NOTE: In legacy types were imported from ngx-stripe, while in active they are imported from @stripe/stripe-js
NOTE 2: Please if you notice any missing type, open an issue or a PR and we will try to address it as soon as possible
Stripe Service
Now the good news. The Stripe Service has been updated to include all the new APIs from StripeJS. No problems should arise here, since basically what we have done is add missing methods. Nothing has been removed. Issue will be likely type related.
For more information about the API please check the docs
This is a list comparing the available methods in both legacy and active: