@@ -46668,6 +46668,7 @@ function (_Component) {
4666846668 errors: Object.assign(this.state.errors, stripe_fields_defineProperty({}, fieldName, errorMessage)),
4666946669 dataAvailable: Object.assign(this.state.dataAvailable, stripe_fields_defineProperty({}, fieldName, !e.empty))
4667046670 });
46671+ e.complete ? this.props.setStripeFormComplete(true) : this.props.setStripeFormComplete(false);
4667146672 this.checkDataValidity();
4667246673 }
4667346674 }, {
@@ -46727,10 +46728,10 @@ function stripe_payment_createClass(Constructor, protoProps, staticProps) { if (
4672746728
4672846729function stripe_payment_possibleConstructorReturn(self, call) { if (call && (stripe_payment_typeof(call) === "object" || typeof call === "function")) { return call; } return stripe_payment_assertThisInitialized(self); }
4672946730
46730- function stripe_payment_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
46731-
4673246731function stripe_payment_getPrototypeOf(o) { stripe_payment_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return stripe_payment_getPrototypeOf(o); }
4673346732
46733+ function stripe_payment_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
46734+
4673446735function stripe_payment_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) stripe_payment_setPrototypeOf(subClass, superClass); }
4673546736
4673646737function stripe_payment_setPrototypeOf(o, p) { stripe_payment_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return stripe_payment_setPrototypeOf(o, p); }
@@ -46752,11 +46753,15 @@ function (_Component) {
4675246753 stripe_payment_classCallCheck(this, StripePayment);
4675346754
4675446755 _this = stripe_payment_possibleConstructorReturn(this, stripe_payment_getPrototypeOf(StripePayment).call(this, props));
46756+ _this.state = {
46757+ stripeFormComplete: false
46758+ };
4675546759 _this.AddressBook = component_mapping('AddressBook');
4675646760 _this.AddressForm = component_mapping('AddressForm');
4675746761 _this.Button = component_mapping('Button');
4675846762 _this.Checkbox = component_mapping('Checkbox');
4675946763 _this.StripeWrapper = component_mapping('StripeWrapper');
46764+ _this.setStripeFormComplete = _this.setStripeFormComplete.bind(stripe_payment_assertThisInitialized(_this));
4676046765 return _this;
4676146766 }
4676246767
@@ -46771,14 +46776,21 @@ function (_Component) {
4677146776 "aria-label": "Review Your Order",
4677246777 className: "c-address-form__button o-button--sml",
4677346778 label: "Review Your Order",
46774- status: this.props.nextStepAvailable() ? 'positive' : 'disabled',
46779+ status: this.state.stripeFormComplete ? 'positive' : 'disabled',
4677546780 type: "primary",
46776- disabled: !this.props.nextStepAvailable() ,
46781+ disabled: !this.state.stripeFormComplete ,
4677746782 onClick: function onClick() {
4677846783 return _this2.props.nextSection('complete');
4677946784 }
4678046785 }));
4678146786 }
46787+ }, {
46788+ key: "setStripeFormComplete",
46789+ value: function setStripeFormComplete(value) {
46790+ this.setState({
46791+ stripeFormComplete: value
46792+ });
46793+ }
4678246794 }, {
4678346795 key: "render",
4678446796 value: function render() {
@@ -46808,7 +46820,8 @@ function (_Component) {
4680846820 billingAddress: checkout.billingAddress,
4680946821 cardTokenRequested: cardTokenRequested,
4681046822 onCardTokenReceived: onCardTokenReceived,
46811- setCardErrors: setCardErrors
46823+ setCardErrors: setCardErrors,
46824+ setStripeFormComplete: this.setStripeFormComplete
4681246825 }), external_react_default.a.createElement("div", {
4681346826 className: "o-form__input-group"
4681446827 }, external_react_default.a.createElement("label", null, "Billing address *")), external_react_default.a.createElement(this.Checkbox, {
@@ -46924,14 +46937,16 @@ function (_Component) {
4692446937 billingAddress = _this$props.billingAddress,
4692546938 cardTokenRequested = _this$props.cardTokenRequested,
4692646939 onCardTokenReceived = _this$props.onCardTokenReceived,
46927- setCardErrors = _this$props.setCardErrors;
46940+ setCardErrors = _this$props.setCardErrors,
46941+ setStripeFormComplete = _this$props.setStripeFormComplete;
4692846942 return external_react_default.a.createElement(react_stripe_elements_es["StripeProvider"], {
4692946943 apiKey: stripeApiKey
4693046944 }, external_react_default.a.createElement(react_stripe_elements_es["Elements"], null, external_react_default.a.createElement(this.StripeFields, {
4693146945 billingAddress: billingAddress,
4693246946 cardTokenRequested: cardTokenRequested,
4693346947 onCardTokenReceived: onCardTokenReceived,
46934- setCardErrors: setCardErrors
46948+ setCardErrors: setCardErrors,
46949+ setStripeFormComplete: setStripeFormComplete
4693546950 })));
4693646951 }
4693746952 }, {
0 commit comments