Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

v4.0.0

Compare
Choose a tag to compare
@dweedon-stripe dweedon-stripe released this 11 Jul 10:54
· 90 commits to master since this release

New Features

  • Renamed CardCVCElement to CardCvcElement which better mirrors the Elements
    API. We will keep the old component name around as an alias until 5.0.0.

  • Added support for stripe.handleCardSetup

      stripe.handleCardSetup(
        clientSecret: string,
        data?: Object
      ): Promise<{error?: Object, setupIntent?: Object}>

    For more information, please review the Stripe Docs:

Deprecations

  • CardCVCElement has been renamed to CardCvcElement. CardCVCElement will
    be removed in version 5.0.0.

Breaking Changes

  • If you were already using handleCardSetup with react-stripe-elements, you
    should upgrade your integration. This method will now automatically find and
    use valid Elements.

    Old Way

    <CardElement
      ...
      onReady={this.handleReady}
    />
    
    handleReady = (element) => {
      this.setState({cardElement: element}) ;
    };
    
    const {setupIntent, error} = await this.props.stripe.handleCardSetup(
      intent.client_secret, this.state.cardElement, {}
    );

    New Way

    <CardElement />;
    
    const {setupIntent, error} = await this.props.stripe.handleCardSetup(
      intent.client_secret,
      {}
    );