Open barryvdh opened 6 years ago
I think the approach should be deciding what the new interface should be, then mapping the old CreditCard
object onto the new interface internally. The CreditCard
object could be deprecated (with longer term support for some time) but ultimately there would be a better interface to use, with a better division of data into value objects: address, person, business, payment types/sources classes (credit card, debit card, direct debit, magnetic stripe, giropay, temporary AJAX token, repeat transaction, saved card token etc). I think V4 gives us a chance to take a step back and look at the whole API with a fresh look, as payment gateways have moved on a long way since Omnipay was first created. Mapping the V3 API to a more robust API would be built-in, or even installed as a separate V3-compatibility extension.
Omnipay does not have to provide all features of all gateways, but have a better idea of what features gateways supply and people want to use, so I believe the interface needs to be abstract enough to be able to plug in custom handling classes for all these features.
That's my 2p worth.
I made a cosmetic change here: https://github.com/thephpleague/omnipay-common/pull/185 Ideally those would be split but that would be a big breaking change.
What is the status of this? And what exactly happened to #80? Thanks.
That was reverted, because we decided to do a minimal 3.x upgrade.
Thanks @barryvdh. What are the plans and timeline to integrate this?
For many projects, the 'CreditCard' object is used for just customerData. We could split it up, but what would be the best way to do this, without BC breaks?
Gateways use
getCard
and users usesetCard
, so we can't just add a Customer object by default.The most that bugs me is the name of the object, and the validation of the object. So could we just use the same object but allow both card and customer as objects? And change the validation a bit?
eg. passing
customer
would behave the same ascard
, by settingcard
internally Andvalidate()
could behave different when parameters are passed.See also https://github.com/thephpleague/omnipay-common/pull/80