Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show error if Stripe publishable key is not configured #1042

Merged
merged 4 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/forms/PayoutDetailsForm/PayoutDetailsForm.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,7 @@
padding-bottom: 2px;
}
}

.missingStripeKey {
color: var(--failColor);
}
6 changes: 5 additions & 1 deletion src/forms/PayoutDetailsForm/PayoutDetailsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const PayoutDetailsFormComponent = props => (
</ExternalLink>
);

return (
return config.stripe.publishableKey ? (
<Form className={classes} onSubmit={handleSubmit}>
{usesOldAPI ? (
<div className={css.sectionContainer}>
Expand Down Expand Up @@ -184,6 +184,10 @@ const PayoutDetailsFormComponent = props => (
</React.Fragment>
) : null}
</Form>
) : (
<div className={css.missingStripeKey}>
<FormattedMessage id="PayoutDetailsForm.missingStripeKey" />
</div>
);
}}
/>
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@
"PayoutDetailsForm.lastNameLabel": "Last name",
"PayoutDetailsForm.lastNamePlaceholder": "Doe",
"PayoutDetailsForm.lastNameRequired": "This field is required",
"PayoutDetailsForm.missingStripeKey": "You need to configure the Stripe publishable key to continue.",
Copy link
Contributor

@Gnito Gnito Mar 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Providers see this message, so I think this should be changed to something like:
"Marketplace operator has not configured Stripe publishable key to this marketplace. Unfortunately, you can't publish listings yet."

"PayoutDetailsForm.personalDetailsAdditionalOwnerTitle": "Additional owner details",
"PayoutDetailsForm.personalDetailsTitle": "Personal details",
"PayoutDetailsForm.personalIdNumberTitle": "Personal id number",
Expand Down