Migration


Below are the major changes for update from legacy to active ngx-stripe

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 mistach 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 aim to be a guide reference:

LegacyActive
OptionsStripeConstructorOptions
StripeJSStripe
ElementsOptionsStripeElementsOptions
ElementStripeElement
ElementsStripeElements
PaymentRequestOptionsPaymentRequestOptions
PaymentIntentResult{ paymentIntent?: PaymentIntent; error?: StripeError; }
CardSetupResult{ setupIntent?: SetupIntent; error?: StripeError; }
SourceDataCreateSourceData
SourceParamsRetrieveSourceParam
SourceResult{ source?: Source; error?: StripeError }
TokenResult{ token?: Token; error?: StripeError }
PiiDataCreateTokenPiiData
BankAccountDataCreateTokenBankAccountData
CardDataOptionsCreateTokenCardData
AccountTokenCreateParams.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 notices 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 shoudl 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: