-
Notifications
You must be signed in to change notification settings - Fork 114
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
paypal error after redirect to site. #258
Comments
I think the problem here is: DefaultMoney class. I am not sure about it but, if i am removing the render part than it starts working. so my thinking is: we are using inside mail generation the same twig instance which breaks template generation. (twig thinks the render is already started.) i hope you can look into this. or at least you could use somehow an another twig instance. I see the boot that you create mall.twig.environment but i think this still crashes with the main twig render. what do you think? what should i provide for recreating the problem? |
one more info, if i remove all this type of methods {{ item.totalPostTaxes() | raw }} from mall.order.table than it starts working. |
Yes, the problem here is the currency rendering. The custom twig
environment should solve this issue. It's a problem with October that needs
to be sorted.
Papp Péter <notifications@github.com> schrieb am Do., 30. Mai 2019, 17:57:
… one more info, if i remove all this type of methods {{
item.totalPostTaxes() | raw }} from mall.order.table than it starts working.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#258?email_source=notifications&email_token=ACBTTXMSZLHUYDLLPSVRNN3PX72PZA5CNFSM4HREWHPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWSXETQ#issuecomment-497381966>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACBTTXLJH6SN6XOQXD65PM3PX72PZANCNFSM4HREWHPA>
.
|
Hi, do you know the issue where octobercms team is working on this? |
ok i did found it. octobercms/october#3341 but i am on the latest october version, or i hope at least. do you have any suggestion what should i check? "name": "october/system", |
Hi Tobias, i found out a solution:
why are you using this differently? i saw in your code "paymentMethod.renderInstructions" i think that method is just working as expected. what do you think? in this case you don't need twig booting process at all. i did tested with paypal, and it was working for me, total table was displayed correctly. |
Also got Using standard Twig in boot process makes |
hi, @Eoler where does it reappear? for me it works as expected... but maybe i miss something |
Your version of rendering DefaultMoney in Twig throws exception in new order checkout for offline payment providers. |
i see... can you suggest how i could create a test for this? it is hard to do it over and over. another question, is it working for you at all? should i try a fresh install? |
Hi, i have another question, what happen is we are using Money class only one way. It should work as a filter in twig, and we should not give back formatted trough pricePostTaxes() would it maybe solve this issue? Or we should not use it as filter... unfortuantely i don't see the difference between default money and paymentmethod twig usage. |
Your solution works and solves exception on postback from remote payment provider, but it creates another one in offline payment provider (that probably IS a reason why Tobias implemented it differently). My current workaround is setting up async queue (to be run from scheduler) and changing DefaultMoney method to:
|
hi, thanks for your code part! how do i set up async queue, do you have the document link for it? so than all the mails will go over queue? |
It depends on your server: https://octobercms.com/docs/services/queues#running-the-queue-worker
|
This is a nasty issue that I have already spent many hours on. The solution provided by @papppeter was my initial solution that introduced the The problem should not appear if you are using a separate queue worker since twig is only loaded once. When the sync queue worker is used, Twig is loaded once by the CMS part of October and then the custom twig environment for Mall is not loaded completely because of how Twig caches things ‒ this leads to the I'll have to further look into this... 🙄 |
could you build up some testing env? where it would be easier to recreate this problem? for me the hardest part was that i needed to go trough all the payment process to land on this page... maybe the another sollution could be not using twig for money formatting. i don't think i would miss it if i could have same basic formatting. (currency prefix, postfix, how number function should called.) |
Yeah, that's what make this a time consuming problem for me as well. I tried to dig into the call stack and isolate the issue but the whole Twig/October boot cycle is a huge rabbit hole and not that easy to follow.
I'd rather fix the issue upstream than re-inventing the wheel. Having the full feature set of Twig at hand provides many benefits. |
Rabbit hole indeed, my workaround with async queued mails dropped me into one (templates are sent with EN translations): rainlab/translate-plugin#285 |
HI, i just tried to long, now i removed that feature from my fork. Please write here if you could create a test area, or if you could fix the issue. thanks! my solution is: protected function render($contents, array $vars)
{
return number_format($vars['price'],$vars['currency']->decimals, ',', ' ').' '.$vars['currency']->symbol;
} |
Hey there, same issue for me, |
For the time being, you'd have to replace these lines and not rely on the twig environment: See papppeter's comment from above. If you don't need different formatting for different currencies this is very easy to implement. |
Thank you for your response, |
|
Can someone who has developed this custom module share it with the community? |
I might be able to tackle this issue in the next few days. It's possible that we need to find an alternative to rendering the currency format using the |
I did open a issue with a proof of this problem: https://github.com/octobercms/october/issues/4874 Let's see if someone from the community is able to help. |
Hello guys. I confirm the issue, and I confirm that the workaround explained up here is working flawlessly. Thank you for sharing, and thank you for your work! |
Hey, |
So we've got a great workaround from @jacobdekeizer over in https://github.com/octobercms/support/issues/35 See c5075fd, let me know if the problem persists! |
Twig token error after payment.
paypal was in sandbox mode. in paypal i could finalize the payment. after redirect back to cart i got this error.
payment was successfully registered.
The text was updated successfully, but these errors were encountered: