Skip to content

Add standard getCreateToken/setCreateToken request methods #275

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

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

Conversation

leith
Copy link
Contributor

@leith leith commented Aug 6, 2025

Most payment processors seem to have a "please store my card details" feature, where they pass back a token to the merchant to represent the card. We already have standard getToken() and getCardReference() methods for this parameter if it exists to pass along instead of card details, but no standard method for indicating that the token should be created as a part of the request in the first place.

Usually this means it ends up as an implementation detail with whatever the parameter is called (tokenize, tokenMode, storeCard, etc.) and is one more detail that must be accounted for per-processor rather than something that can be relied on at a higher level to be a consistent flag.

This PR standardizes that flag as getCreateToken() and setCreateToken() (the same as https://github.com/thephpleague/omnipay-sagepay/) so we can reliably set it once and know the driver will convert it appropriately.

@leith leith force-pushed the add-create-token-support branch from 991a9ac to d792023 Compare August 6, 2025 10:14
@leith
Copy link
Contributor Author

leith commented Aug 6, 2025

The CI failure message is:

No filter is configured, code coverage will not be processed

This seems to be unrelated to the branch - higher versions of PHP (8.1+) are using newer versions of PHPUnit, which have a different XML configuration format. I've made a separate PR (#276) to fix the CI pipeline in case that's needed before this can be evaluated.

@leith leith force-pushed the add-create-token-support branch from d792023 to 0b1a1d3 Compare August 7, 2025 01:05
@leith
Copy link
Contributor Author

leith commented Aug 7, 2025

With #276 now merged, CI is running and all passing as well. 👍

@leith
Copy link
Contributor Author

leith commented Aug 8, 2025

@judgej since this is largely based on your work on the sagepay driver, what do you think about making this a common flag?

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.

1 participant