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

CardTypes: Adding card type to gateways #5384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

javierpedrozaing
Copy link
Collaborator

Description

This commit is a script to add card types to gateways

The script update the gateway classes adding the new card type in supported_cardtypes variable, additionally update the gateway test file to validate card types supported

Update all gateways:
/script/generate card_type new_card_type

Update specific gateways:
./script/generate card_type new_card_type --gateways stripe authorize_net paypal

Update a single gateway:
./script/generate card_type new_card_type --gateways stripe

File.write(path, updated_content)
end

def update_test_file(path, new_card_type)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 Comment

This is the world we live in now, a proper prompt will compete with our best Regex:

prompt =>
I want add a new type of card called "dava" to the list of supported types for the 3 gateways listed, I also want to update the corresponding unit tests adding "dava" to the list of cards that the test checks

Screenshot 2025-01-20 at 4 34 16 PM

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-01-20 at 4 37 09 PM

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-01-20 at 4 37 42 PM

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it would be great to figure out how we can automate this kind of update using scripts or prompts like this

Description
-------------------------
This commit introduces a script to add new card types to gateways.

The script updates the gateway classes by adding the new card type to the supported_cardtypes variable.
Additionally, it updates the gateway test files to validate the supported card types.

Update all gateways:
`/script/generate card_type new_card_type`

Update specific gateways:
`./script/generate card_type new_card_type --gateways stripe authorize_net paypal`

Update a single gateway:
`./script/generate card_type new_card_type --gateways stripe`
@javierpedrozaing javierpedrozaing force-pushed the add_card_types_to_gateway branch from 8df8f79 to 01ee43f Compare January 27, 2025 14:26
@javierpedrozaing javierpedrozaing marked this pull request as ready for review January 27, 2025 14:35
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.

2 participants