-
Notifications
You must be signed in to change notification settings - Fork 57
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
Bill for non-catalog items #263
Bill for non-catalog items #263
Conversation
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
- This allows to minimize the effort needed by developers to customize without the need to grow the constructor or adding additional classes
… constructor instead
Thanks @AcTiv3MineD. Drafting this until I get a chance to review. |
@AcTiv3MineD finally found some time. I adjusted the API a little bit. Now you can do like in previous Cashier Paddle v1: $user->charge(1000, 'T-shirt', ['quantity' => 5]); I didn't test this and will need your help verifying this will work. |
@driesvints Thanks for the changes, I like the new structure, I will be testing it during the week. I have 2 comments about the new changes: 1 - About the 2 - These changes remove the option of creating subscriptions for non-catalog items. Should we add a method called Let me know if it is a good idea, or maybe the subscription part should be addressed in a different PR as we would need more testing for compatibility for swap, pause, cancel, etc.. or maybe document that some subscription operations might not be compatible with standard subscription model. |
$user->newSubscription(1000, 'Gym subscription')
->yearly()
->quantity(3) // Seats
->checkout(); Could you try this all out and let me know if it works? |
fix: allow null on price description
@driesvints Did some minor fixes. 1 - Price description is required and must be filled I have tested locally both subscription and one-off. It works as expected. |
Thanks @AcTiv3MineD. I've further refined this and made the API a bit more simpler. Description is now optional again. Here's your updated description: Product Checkout// Charges 10.00
$user->charge(1000, 'T-shirt', ['quantity' => 5]); Product subscription// Charges 10.00 each year
$user->newSubscription(1000, 'Gym subscription')
->yearly()
->quantity(3) // Seats
->checkout(); The default currency is USD, to change it, you can either: 1 - Set // Charges 10.00
$user->charge(1000, 'T-shirt', ['price' => ['unit_price' => ['currency_code' => 'EUR']]], quantity' => 5]); |
I tested this and it works fine. Let me know if you have any further thoughts @AcTiv3MineD. |
@driesvints Just tested on my side, looks good to me 👍 |
Released now. Thanks a bunch for your help @AcTiv3MineD. If you're up for it, we'd also appreciate a PR to the docs! |
Sure!, I can work on that @driesvints |
The documentation is ready for review: |
This PR covers the functionality needed on this issue: #230
NEW PR DESCRIPTION
Product Checkout
Specify quantity
Product subscription
The default currency is USD, to change it, you can either:
1 - Set
CASHIER_CURRENCY=currency
on your .env2 - Pass currency as an option, ex:
OLD PR DESCRIPTION
Notes:
1- Right now, only the option of calling the create transaction api is supported, adding the new structure of items as a attribute on the html does not work. I have contacted Paddle's team and they say that they don't have a date set for this functionality.
This has a drawback, as:
A- Every time we render the button, it creates an incomplete transaction on Paddle.
B- Each time we call the button component, an api request is made to paddle, thus, it would slow the rendering time.
2-This solution allows to use the exiting cashier functionality, plus create custom transactions, allowing to create custom pricing subscriptions and checkout, ex: