solidusio / solidusio/solidus

Remove `Spree::CreditCard` naming from legacy backend payment forms

Open
#5,014 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

changelog:solidus_backend
Dominant language
Ruby
Stars
5.3k
Forks
1.4k
Avg merge
1d 22h
Merged PRs (30d)
62

Description

Introduction

The implementation of a new payment method in Solidus Backend requires the addition of a dedicated source form to support a payment source creation/reuse.

Desired Behavior

A more generic integration approach (that maintains the logic of payment sources) is needed.

Many payment platforms currently support several types of payment methods.
So for the same Spree::PaymentMethod, we should be able to create payment sources of different types, such as cards, bank debits, bank redirects, bank transfers, etc.
For this reason, the partial source form view should be as generic as possible without specific references to the type of payment source.

Current Behavior

However, the current behavior in Solidus Backend is lacking in clearly marking these distinctions, with several references to the Spree::CreditCard payment source integration still present within views and controllers.

Some points related to what was mentioned:

Additional notes

  • This problem was experienced during the implementation of a source_form in solidus_stripe: https://github.com/solidusio/solidus_stripe/issues/280
  • ℹ️ This doesn't create implementation problems but only nomenclature problems.
  • All that said mainly refers to Stripe, but I think the same concept can be applied to different payment platforms.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with backend/app/views/spree/admin/payments/_form.html.erb, backend/app/controllers/spree/admin/payments_controller.rb, and backend/app/views/spree/admin/payments/source_forms/_gateway.html.erb, following the linked references. Review how previous_cards and card are passed into source forms, then update the naming so the integration is generic while preserving payment-source creation and reuse behavior. Confirm the legacy CreditCard-specific names are no longer required.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, payments
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.