-
Notifications
You must be signed in to change notification settings - Fork 850
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
Added OBJECT_NAME constant to all API objects and added missing object #471
Conversation
Hey @nickdnk, thanks the patch! This is quite similar to the setup that we already have in stripe-ruby, so I think this is a reasonable approach. Would you mind seeing if you could update the map in
Thanks! I think it's fine to include invoice line item in here. |
I don't understand why the build is failing with autoload 0. It says it cannot find the InvoiceLineItem class, but I've used it the exact same way as all the other classes in the Util map. |
Thanks for the quick fixes @nickdnk!
Check out |
@brandur-stripe That did the trick. |
lib/Util/Util.php
Outdated
use Stripe\Topup; | ||
use Stripe\Transfer; | ||
use Stripe\TransferReversal; | ||
use Stripe\UsageRecord; |
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.
@nickdnk Pretty minor, but given the size of this list, what do you think about just using the fully qualified path directly on the lines in the map below so we can avoid two of these big lists?
i.e., Something like this:
\Stripe\Account::OBJECT_NAME => 'Stripe\\Account',
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.
Hi @nickdnk! Thanks a lot for the contribution. Would you mind addressing @brandur-stripe's comment above? Once that's done, I think we'll be ready to merge :)
Left one more comment, but awesome work here. Thanks. |
Hey guys |
@nickdnk Brandur is not available today (US bank holiday) but I took a look and I think this looks good, modulo Brandur's comment re. using fully qualified paths so that we have one less list to maintain when a new resource is added. |
… use these. Added InvoiceLineItem object to library
@ob-stripe Done :) Edit: See my comment in InvoiceLineItem. |
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.
Niiiice! LGTM :)
Released in 6.7.2. Thanks again @nickdnk :) |
@ob-stripe Cool. Did you remember to check the use traits on InvoiceLineItem? I was not sure which were applicable to that object. |
Aw, I missed that. So |
Okay cool. Just wanted to make sure you were on top of it. I don't want to introduce issues :) |
Hello guys
As in a previous PR that was a bit more of a mess I added the OBJECT_NAME as we discussed once before. This time the PR is cleaner with only this as focus. To refresh: This is to avoid situations where one may look for
invoice_item
instead ofinvoiceitem
orapplication_fee_refund
instead offee_refund
.I also added the InvoiceLineItem object, which according to the docs is almost the same as Invoice Item. I am not sure why they both exist, but their object property is different ("invoiceitem" vs "line_item") and one has a few properties the other does not, so there must be a case for both of them. If you don't like this let me know and I'll remove it from the PR.