FIX: Payments could not complete (#28)

Due to putting the Stripe Elements HTML inside an if block in the
template, this caused state to be funky. As a result, calling
`this.stripe.createToken` failed to return a promise. Opted instead to
hide the elements via CSS for anonymous users to prevent this
showstopping bug.
This commit is contained in:
Justin DiRose 2020-10-29 10:21:14 -05:00 committed by GitHub
parent 1ad5b17640
commit b950926538
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -26,12 +26,13 @@
<hr> <hr>
{{subscribe-card cardElement=cardElement}}
{{#if loading}} {{#if loading}}
{{loading-spinner}} {{loading-spinner}}
{{else if isAnonymous}} {{else if isAnonymous}}
{{login-required}} {{login-required}}
{{else}} {{else}}
{{subscribe-card cardElement=cardElement}}
{{d-button {{d-button
disabled=loading disabled=loading

View File

@ -14,6 +14,10 @@
width: 100%; width: 100%;
} }
.anon #card-element {
display: none;
}
.StripeElement { .StripeElement {
box-sizing: border-box; box-sizing: border-box;