2017-07-16 18:29:46 +02:00
|
|
|
import React from "react";
|
2017-07-19 01:00:13 +02:00
|
|
|
import { CreditAmount } from "component/common";
|
|
|
|
import CardVerify from "component/cardVerify";
|
2017-07-16 18:29:46 +02:00
|
|
|
|
|
|
|
class UserVerify extends React.PureComponent {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
code: "",
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
handleCodeChanged(event) {
|
|
|
|
this.setState({
|
|
|
|
code: event.target.value,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-07-19 01:00:13 +02:00
|
|
|
onToken(data) {
|
|
|
|
this.props.verifyUserIdentity(data.id);
|
2017-07-16 18:29:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2017-07-19 01:00:13 +02:00
|
|
|
const { errorMessage, isPending, reward } = this.props;
|
2017-07-16 18:29:46 +02:00
|
|
|
return (
|
2017-07-19 01:00:13 +02:00
|
|
|
<div>
|
2017-07-20 03:07:17 +02:00
|
|
|
{(!reward || !reward.transaction_id) &&
|
|
|
|
<p>
|
2017-07-19 01:00:13 +02:00
|
|
|
Please link a credit card to confirm your identity and receive{" "}
|
2017-07-20 03:07:17 +02:00
|
|
|
{reward
|
|
|
|
? <CreditAmount amount={parseFloat(reward.reward_amount)} />
|
|
|
|
: <span>your reward</span>}
|
|
|
|
</p>}
|
2017-07-19 01:00:13 +02:00
|
|
|
<p>{__("This is to prevent abuse. You will not be charged.")}</p>
|
|
|
|
{errorMessage && <p className="form-field__error">{errorMessage}</p>}
|
|
|
|
<CardVerify
|
|
|
|
label={__("Link Card and Finish")}
|
|
|
|
disabled={isPending}
|
|
|
|
token={this.onToken.bind(this)}
|
2017-07-22 00:13:13 +02:00
|
|
|
stripeKey="pk_live_e8M4dRNnCCbmpZzduEUZBgJO"
|
2017-07-16 18:29:46 +02:00
|
|
|
/>
|
2017-07-19 01:00:13 +02:00
|
|
|
</div>
|
2017-07-16 18:29:46 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default UserVerify;
|