Skip to content

Commit 44de205

Browse files
[Wise] Show more descriptive error message & fix CAD payout settings (#11927)
## Summary of the problem We don't want to re-process payout holdings that are no longer pending, however we're currently filtering out pending payout holdings with a scope, even though there's already code to filter them out in the job. We're also not storing the Interac email, which can be ambiguous on the operations side and mess up our data if their HCB email address changes. ## Describe your changes This PR removes the `.pending` scope (which prevents `ActiveRecord::RecordNotFound` errors causing a 404) and does away with the "Use the same email for Interac?" checkbox. <img width="497" height="491" alt="image" src="https://github.com/user-attachments/assets/437def81-cf9c-4770-8885-b3a32051ebe6" />
1 parent 6f79455 commit 44de205

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

app/models/concerns/has_wise_recipient.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ def self.information_required_for(currency)
4848
fields << { type: :select, key: "account_type", label: "Account type", options: { "Checking": "checking", "Savings": "savings" } }
4949
elsif currency == "CAD"
5050
fields << { type: :select, key: "account_type", label: "Account type", options: { "Bank Account": "bank_account", "Interac": "interac" } }
51-
fields << { type: :text_field, key: "institution_number", placeholder: "123", label: "Institution number", conditional: "account_type == 'bank_account'" }
52-
fields << { type: :text_field, key: "branch_number", placeholder: "45678", label: "Branch number", conditional: "account_type == 'bank_account'" }
53-
fields << { type: :text_field, key: "account_number", placeholder: "123456789", label: "Account number", conditional: "account_type == 'bank_account'" }
54-
fields << { type: :check_box, key: "use_same_email_for_interac", required: false, label_options: { "x-text": "email ? `Use '${email}' for Interac?` : 'Use the same email for Interac?'" }, conditional: "account_type == 'interac'" }
55-
fields << { type: :text_field, key: "interac_email", placeholder: "[email protected]", label: "Or, enter your Interac email", conditional: "account_type == 'interac' && !use_same_email_for_interac" }
51+
fields << { type: :text_field, key: "institution_number", placeholder: "123", label: "Institution number", conditional: "account_type != 'interac'" }
52+
fields << { type: :text_field, key: "branch_number", placeholder: "45678", label: "Branch number", conditional: "account_type != 'interac'" }
53+
fields << { type: :text_field, key: "account_number", placeholder: "123456789", label: "Account number", conditional: "account_type != 'interac'" }
54+
fields << { type: :text_field, key: "interac_email", placeholder: "[email protected]", label: "Interac email", conditional: "account_type == 'interac'" }
5655
elsif currency == "CLP"
5756
fields << ACCOUNT_NUMBER_FIELD
5857
fields << { type: :text_field, key: "rut_number", placeholder: "12345678-9", label: "RUT number" }

app/services/reimbursement/payout_holding_service/process_single.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def local_hcb_code
4343
end
4444

4545
def payout_holding
46-
@payout_holding ||= Reimbursement::PayoutHolding.pending.find(@payout_holding_id)
46+
@payout_holding ||= Reimbursement::PayoutHolding.find(@payout_holding_id)
4747
end
4848

4949
end

0 commit comments

Comments
 (0)