thephpleague / omnipay-common

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

Add support for a third address line parameter #236

Open leith opened 3 years ago

leith commented 3 years ago

Some payment gateways support an additional address line for more complex addresses. Rather than making additional accessors just for one line of addressing when everything else is supported by the CreditCard object, we can add support here directly.

kabudu commented 3 years ago

This is very useful!

judgej commented 3 years ago

How would you see this working with existing drivers that would never look at the address3 property? I can see if the driver is aware of it, and the application is aware that the driver is aware of it, if can be used. But for drivers that only use address1 and address2, the application is going to need to merge it into address1 and address2 anyway. Just wondering if there are any thoughts on this.

leith commented 3 years ago

So in this scenario, the application wants to use address3, it's supported by the gateway, but the driver only supports address1 and address2?

I think the options here are the same as usual with any drivers, you would either fork the driver to add support for address3 and open a PR (this is my preferred approach), or you'd have to put the data into another field, which as you say is likely to be shoehorned into address1 or address2. Or I guess just accept a loss of accuracy in address going to the gateway (which may or may not be an issue depending on the gateway).

leith commented 3 years ago

The CI tests are failing for a reason unrelated to this branch (they're failing for master as well): https://github.com/thephpleague/omnipay-common/pull/239

Is there anything I can do to help progress this PR?

leith commented 3 years ago

@barryvdh any chance of a review on this one?

leith commented 3 years ago

Had another gateway with the additional address line item requirement and am having to keep using this fork in order to make it play nice. Is there anything I can do to progress this PR?