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

Disable bank for CAD #209

Merged
merged 3 commits into from
Jan 23, 2023
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.4.0
16.19.0
7 changes: 7 additions & 0 deletions frontend/src/element/signup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ button {
font-size: 20px;
}

button[disabled] {
border-color: constants.$gray-80;
color: constants.$gray-80;
opacity: 0.7;
cursor: default;
}

.invalidatable {
input:invalid,
select:invalid {
Expand Down
26 changes: 25 additions & 1 deletion frontend/src/element/signup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ export class Signup extends LitElement {

cardElement: StripeCardElement;

// TODO(#208): Temporary until bank accounts are supported for Canada.
@state()
protected bankSupported = true;

@state()
protected paymentMethod: 'bank' | 'card' | 'plaid' = 'plaid';

Expand Down Expand Up @@ -329,15 +333,28 @@ export class Signup extends LitElement {

private paymentTemplate(): TemplateResult {
return html` <h2>Payment</h2>

${this.bankSupported
? ''
: html` <div class="field full-width">
<div class="title">
Currently only card payment is supported in Canada. Please email
jonahbron marked this conversation as resolved.
Show resolved Hide resolved
<a href="mailto:[email protected]">
[email protected]</a
>
after you've completed sign-up and we can manually switch you over
jonahbron marked this conversation as resolved.
Show resolved Hide resolved
to bank payment if you prefer.
</div>
</div>`}
<div class="payment-method-toggle full-width">
<button
?disabled=${!this.bankSupported}
class=${classMap({ selected: this.isMethod('plaid') })}
@click=${this.setMethod('plaid')}
>
Bank account
</button>
<button
?disabled=${!this.bankSupported}
class=${classMap({ selected: this.isMethod('bank') })}
@click=${this.setMethod('bank')}
>
Expand Down Expand Up @@ -1163,6 +1180,13 @@ export class Signup extends LitElement {
if (this.billingCountry != null) {
this.billingCountry.value = this.mailingCountry.value;
}
// TODO(#208): Temporary until bank accounts are supported for Canada.
if (this.mailingCountry.value === 'Canada') {
this.paymentMethod = 'card';
this.bankSupported = false;
} else {
this.bankSupported = true;
}
this.requestUpdate();
}

Expand Down