You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.
The text was updated successfully, but these errors were encountered:
zqstack
changed the title
Why is my preprocessor for variable prices not working?
Why is my preprocessor for variable prices not working correctly?
Sep 25, 2020
First of all, it would help a lot if you remove all of your logs from the code. Second, I think you don't need to implement PreprocessesOrderItems. That's up to cashier. You just need to extend BaseOrderItemPreprocessor and write the logic for handle()to modify your OrderItems. And finally, to solve your isssue. Preprocessors are not invoked when creating a new subscription, as you can see in the create() method of a MandatedSubscriptionBuilder:
The preprocessors are only invoked when processing a subscription right before a mollie payment is created. You could therefore start a subscription with a price of your choice and always change the unit_price whenever such a subscription would be billed using the preprocessor you've created.
I have a similar situation and thanks @lexdewilligen you for the tips, I have the PaymentPreprocessors working now.
One question remains. How can I change the price of the firstPayment?
I have a custom plan in my cashier_plans.php but the price is dynamic and is per client different. So i would like to change the amount of the firstPayment per user.
I've found some more information in this thread #177
But i cannot find out how to use the FirstPaymentBuilder manually in a controller.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Dear Developer,
Do you know why my preprocessor for variable prices is not working correctly?
It seems to work for swapping plans, but for new subscriptions, it keeps asking for the original price. Am I missing something?
Here is my code:
cashier_plans.php:
MyPreprocessor.php:
Thank you for your help!
zqstack
The text was updated successfully, but these errors were encountered: