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

CustomerVault doesn't have singleUseToken in updateCard() #33

Open
davidwebca opened this issue Apr 2, 2021 · 2 comments · May be fixed by #34
Open

CustomerVault doesn't have singleUseToken in updateCard() #33

davidwebca opened this issue Apr 2, 2021 · 2 comments · May be fixed by #34

Comments

@davidwebca
Copy link

Function updateCard in CustomerVault filters out singleUseToken as it doesn't allow it even as a facultative param.

https://github.com/paysafegroup/paysafe_sdk_php/blob/master/source/Paysafe/CustomerVaultService.php#L408

This prevents updating cards with a single use token through the customer vault.

@davidwebca
Copy link
Author

My bad, it doesn't get filtered out, but actually triggers another error instead: cardExpiry may not be null which, apparently from the docs, isn't supposed to happen.

@davidwebca
Copy link
Author

Found the actual problem.

setOptionalFields will not let it pass if singleUseToken is specified because there's a check on optional fields (instead of actually being optional as the name suggests). setOptionalFields needs to be set on fields that are expected. If singleUseToken is specified, it won't work. I'm making a fork and pull request to be able to pull the dependency with composer since I need this right now.

davidwebca added a commit to davidwebca/paysafe_sdk_php that referenced this issue Apr 2, 2021
updateCard fails because there's no way to pass singleUseToken as outlined in paysafegroup#33. Closes paysafegroup#33.

I had initially created a check inside updateCard for the singleUseToken, but I am now noticing the pattern already initialized with createCardFromSingleUseToken to have different functions and I applied it here too.
@davidwebca davidwebca linked a pull request Apr 2, 2021 that will close this issue
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 a pull request may close this issue.

1 participant