Skip to content

Commit a41c497

Browse files
author
Ives van Hoorne
committed
Fix Stripe subscribing
1 parent 6cdcf86 commit a41c497

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app/components/user/SubscribeForm/CheckoutForm.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import styled from 'styled-components';
33

44
import { injectStripe, CardElement } from 'react-stripe-elements';
55

6+
import reportError from 'app/utils/error';
7+
68
import Input from 'app/components/Input';
79
import Button from 'app/components/buttons/Button';
810

@@ -84,7 +86,7 @@ class CheckoutForm extends React.PureComponent {
8486
// Within the context of `Elements`, this call to createToken knows which Element to
8587
// tokenize, since there's only one in this group.
8688
const { token, error } = await this.props.stripe.createToken({
87-
name: this.props.name,
89+
name: this.state.name,
8890
});
8991
if (error) {
9092
return this.setState({
@@ -98,6 +100,8 @@ class CheckoutForm extends React.PureComponent {
98100
try {
99101
await this.props.subscribe(token.id);
100102
} catch (e) {
103+
reportError(e);
104+
101105
return this.setState({
102106
loading: false,
103107
errors: {

0 commit comments

Comments
 (0)