paysafegroup / paysafe_sdk_php

Paysafe PHP SDK
MIT License
10 stars 41 forks source link

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

Open davidwebca opened 3 years ago

davidwebca commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.