thephpleague / omnipay-common

Core components for the Omnipay PHP payment processing library
MIT License
329 stars 243 forks source link

Address requirement #43

Closed NoelDavies closed 5 years ago

NoelDavies commented 9 years ago

There are some cases in which the card has been sent over a JS api (Like Stripe) but the address is still required for risk check. The only place currently to put the address is the CreditCard class, but then calling validate on that will throw exceptions. Is there any way around this without passing the credit card information through my web server?

judgej commented 9 years ago

Can you provide any examples? I'm having difficulty just understanding what the architecture is here. Are you saying that you can't create a credit card object without a credit card in? If you can, and something is accepting a CreditCard object that does not require a credit card, and it raising an error due to the missing credit card, then it sounds like there is an issue to fix there. If you have an example, it may be clearer where this is happening. Please bear with me :-)

judgej commented 8 years ago

Have reread: you cannot pass an address to the front end without filling out the credit card details too.

This has been discussed - splitting the class into a separate card and address class for OmniPay v3.0. I cannot for the life of me remember where it was discussed, so I'll leave this ticket open for now.

hugohenrique commented 8 years ago

Any news? Already can be closed?

judgej commented 5 years ago

I think this can be closed - it's not been updated for a long time.

The credit card class has a validate method, and if that is called, then a valid credit card details must be set in that object to pass validation. Now, it is up to the gateway driver to call that validation method or not. If it knows a credit card token has been passed in, then it should not validate the credit card object.

So it is down to individual drivers to call the validation that it needs to call only. Issues for this should be targeted at the drivers having problems. If there is a general documentation problem here, then a PR or suggestions on how it could be improved would be great.