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

deleteCard with cardReference #62

Open
runia1 opened this issue Nov 9, 2016 · 3 comments
Open

deleteCard with cardReference #62

runia1 opened this issue Nov 9, 2016 · 3 comments

Comments

@runia1
Copy link

runia1 commented Nov 9, 2016

deleting cards does not work when your provide a cardReference string.

In order to fix this, please add these three lines at the top of the getData() method in CIMDeletePaymentProfileRequest.

$cardRef = $this->getCardReference(false);
$this->setCustomerProfileId($cardRef->getCustomerProfileId());
$this->setCustomerPaymentProfileId($cardRef->getPaymentProfileId());

Place these before the call to validate(). This will parse the string and get the customerProfileId and customerPaymentProfileId from the card reference json string.

Can submit a pull request if needed, let me know.

@judgej
Copy link
Member

judgej commented Feb 5, 2017

If I am reading this right, this fix assumes only the card reference is supplied, and overwrites the customerProfileId and customerPaymentProfileId regardless of whether they are set. Is this the intended action?

@runia1
Copy link
Author

runia1 commented Feb 10, 2017

Yes, you are correct. The whole point of using omnipay is to provide a universal interface to use when performing common actions on any flavor of gateway. It has been my experience that many of the drivers were not fully developed with this in mind. Deleting a card is one of these common actions that should be universal without any gateway specific dependencies needing to be set. You should be able to pass in a cardReference and have the gateway take care of the rest without having to set any special properties gateway to gateway.

@judgej
Copy link
Member

judgej commented Oct 8, 2017

Coming back to this after a long time...I know.

My query was really concerning people who are already using this driver, and are setting the customerProfileId and customerPaymentProfileId fields explicitly. This change would break their applications. My suggestion is to check whether the fields are already set before overwriting them.

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.

2 participants