Skip to content

Add payment information fields#28

Open
JustShah wants to merge 4 commits into
enhance-pickup-fieldsfrom
add-payment-information-fields
Open

Add payment information fields#28
JustShah wants to merge 4 commits into
enhance-pickup-fieldsfrom
add-payment-information-fields

Conversation

@JustShah

Copy link
Copy Markdown

This pull request includes several enhancements and updates related to the handling of trade-in orders, specifically focusing on adding payment information fields and improving parameter handling in the checkout process.

Changes Included:

  1. Update Order Decorator to Refactor trade_in_order? Method:

    • Moved the trade_in_order? method to the public section of the class for better accessibility.
    • This refactoring ensures that the method is easily accessible for checking if an order contains trade-in products.
  2. Add Controller Decorator for Checkout Params Handling:

    • Added a new decorator for the CheckoutsController to handle permitted parameters based on the checkout state.
    • Included customer metadata in the permitted parameters for the delivery state.
    • This update ensures that the necessary parameters are correctly handled during the checkout process.
  3. Add Payment Info Fields Partial for Trade-In Orders:

    • Created a new partial to render payment information fields specifically for trade-in orders.
    • Included fields for payment method, account holder, and payment account.
    • Added a legend for better section identification.
    • Updated labels and select inputs to use localized strings.
    • This enhancement improves the user experience by providing a clear and organized way to input payment information for trade-in orders.

These changes enhance the functionality and user experience for trade-in orders by ensuring proper parameter handling and providing a dedicated section for entering payment information.
paymenet info
payment info with shipping

@fthobe

fthobe commented Mar 10, 2025

Copy link
Copy Markdown

@JustShah Looks much better now, one thing:
Pickup and shipment method radio buttons should be attached together and payment info at the bottom

@JustShah
JustShah force-pushed the add-payment-information-fields branch from 2e139f2 to d50df8b Compare March 10, 2025 09:46
@fthobe

fthobe commented Mar 10, 2025

Copy link
Copy Markdown

Please also consider this comment:

Not now
That hides the fields.

Radio buttons are usually made in following order
All options alphabetically
Negative or form field option at the end.

So the correct way would be:

  • Bank Transfer
  • Paypal
  • Not now

This is how I would do it:

H1 "Trade-In Payment Information"

"Please specify how you want to get paid. Please note that you can communicate your choice later, but it may delay your Trade-In."

  • Bank Transfer
  • PayPal
  • Not now

Not now hides all related formfields.

Also the shipping form field is vertical, we should do the same (do not invent style).

@JustShah
JustShah force-pushed the add-payment-information-fields branch 2 times, most recently from ab8700e to 32d901c Compare March 10, 2025 10:30
@JustShah
JustShah force-pushed the enhance-pickup-fields branch from abf2d14 to 4983a1d Compare March 10, 2025 10:35
@JustShah
JustShah force-pushed the add-payment-information-fields branch 2 times, most recently from afb1d8b to 333497c Compare March 10, 2025 11:57
@JustShah

JustShah commented Mar 10, 2025

Copy link
Copy Markdown
Author
  • form with pickup fields
    with pickup
  • radio not now selected
    nn
  • radio paypal selected
    paypal
  • radio bank transfer selected
    bt
  • no radio selected
    init

@JustShah
JustShah force-pushed the add-payment-information-fields branch 2 times, most recently from fdb588a to e4eb82f Compare March 10, 2025 12:35
@JustShah
JustShah force-pushed the enhance-pickup-fields branch from 4983a1d to 6bd9652 Compare March 10, 2025 13:11
- Created a new partial to render payment information fields for trade-in orders.
- Included fields for payment method, account holder, and payment account.
- Added a legend for better section identification.
- Updated labels and select inputs to use localized strings.
- Added a new decorator for the CheckoutsController to handle permitted parameters based on the checkout state.
- Included customer metadata in the permitted parameters for the delivery state.
- Moved the `trade_in_order?` method to the public section of the class for better accessibility.
- Added a JavaScript file to toggle the visibility of payment information fields based on the selected payment method.
- Updated the install generator to include the new JavaScript file and append it to the solidus_starter_frontend.js manifest.
- Updated the initializer template to set default configuration values for SolidusEasypost
@JustShah
JustShah force-pushed the add-payment-information-fields branch from e4eb82f to 2716721 Compare March 10, 2025 13:28
@JustShah

Copy link
Copy Markdown
Author
  • radio selected
    radio selected
  • no radio selected
    init2

@JustShah JustShah linked an issue Apr 3, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collect payment information if order_type is trade-in

2 participants