-
-
Notifications
You must be signed in to change notification settings - Fork 243
[3.0]: Abstract Customer object #80
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
It is good to see this split up. Just a few thoughts:
|
I think a Customer + CreditCard is good. A Customer object doesn't need to have all parameters set, but it's probably good to keep them together. CreditCard is indeed pretty generic for the 'old style' CreditCard gateways, but don't think it's bad. The tokens from Stripe etc are all different right? So not sure if a Interface is needed, or just agree to use the same parameter key for that (eg. So can we still use the array definition in the Request for Customer? $request->purchase([
'customer' => [
'name'= 'Barry',
]
]); |
@@ -29,6 +29,7 @@ | |||
"require": { | |||
"php": ">=5.6", | |||
"alcohol/iso4217": "^3.1", | |||
"beberlei/assert": "^2.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you actually using this library? Don't see it used in this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, no, I need to remove that. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
Would it be worth it to break an The idea behind abstracting out the credit card was to allow for bank account transfer and/or other payment methods. I could see the usefulness of possibly having a PaymentMethodInterface for them to adhere to, but I'd need to look at it more closely. |
I guess it would probably make sense to have an Address object, instead of duplicate parameters for billing/shipping. |
Some gateways have more addresses than just billing and shipping, even. Obviously that would be gateway specific, but to have an address object to throw in would be immensely useful. Again - and I keep wittering on about this - interfaces are so key to flexibility down the line. Whatever we think needs to be in an address now, another gateway will want something additional, and so a user of OmniPay may need to use their own address class, which may be a simple extension of the OmniPay |
* Set Card Title. | ||
* | ||
* @param string $value Parameter value | ||
* @return CreditCard provides a fluent interface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong phpdoc, probably a copy/paste issue (in many places)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed, replaced them with $this
[3.0]: Abstract Customer object
Does the Customer object still belong in the card, or should we just make it a standalone option, and nothing in the CreditCard? |
The Each |
Or maybe a person has a postal address, rather than the other way around. But there are instances where an API could want any one of a person, postal address or credit card detail, without any of the others. |
Yeah I agree, but we shouldn't make it to difficult for people. Right now, it's easy to just fill in 1 array with all the users details + creditcard. I agree that Customer should be seperate from the Creditard. The CC is a very specific set. We have te be aware of certain duplications, for example, the Name. Is it the creditcard owner name the same as the Billing name? Should it be inserted twice, or should it be inherited from the customer? An Address also has a name etc, so do you have to set it on the Customer or the BillingAddress etc? It's important to note that we primarily just provide a means to map data to the gateway. And some gateways just want the name to show in the logs, others want 2 address to provide shipping or something. We shouldn't make it too hard to understand.. |
Two main things here: