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

[FEAT] Extraneous customer_email field on TokenBaseCardCreateInput #9

Open
damienwebdev opened this issue Mar 18, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@damienwebdev
Copy link
Contributor

💡 Feature request

Feature Name

TokenBaseCardCreateInput API Clean up

The Desired Behavior

"customer_email" on TokenBaseCardCreateInput is no longer a required field.

Your Use Case

As a developer, I would like to not send customer_email when creating a tokenbase card.

Environment



TokenBase version: 4.5.5
Magento version: 2.4.5-p5
PHP version: PHP 8.1.18 (cli) (built: Apr 14 2023 04:39:07) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies


I was reviewing some code and noted that this field was in a request body. I was concerned that this could be leveraged to add cards to another customer's account. This is, luckily, not the case.

It appears that this is used because ParadoxLabs\TokenBase\Model\Api\GraphQL\UpdateCard allows for guest cards to be created (which I find a little surprising).

That being said, looking at this API it feels like it violates the "Interface Segregation" Principle since the field is not required for authenticated customers. I would suggest another operation like createTokenbaseCardForCustomer or createTokenbaseCardForGuest to clarify this API.

@damienwebdev damienwebdev changed the title [FEAT] Extraneous fields on TokenBaseCardCreateInput [FEAT] Extraneous customer_email field on TokenBaseCardCreateInput Mar 18, 2024
@rhoerr rhoerr added the enhancement New feature or request label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants