Raiffeisen bank payment gateway for Phoca cart

Phoca Cart - complex e-commerce extension
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 493
Joined: 07 Nov 2018, 14:55

Raiffeisen bank payment gateway for Phoca cart

Post by Nidzo »

I am adapting the Raiffeisen bank payment gateway for Phoca cart.

I have already made it possible to make a payment as well as a refund from the bank application, but I want to go one step further and enable a refund from the Phoca cart admin part.

Is it possible to make an AJAX call from a custom button inside the admin order edit view (com_phocacart, view=phocacartorder, layout=edit) without triggering the Joomla form submit?

What is the recommended way to add custom functionality (like a payment refund button) to the order edit page in admin?


Image
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49328
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Raiffeisen bank payment gateway for Phoca cart

Post by Jan »

Hi, you can use standard joomla com_ajax feature to run your own script per AJAX (of course security testing needs to be done there), The button needs to be then displayed per some Phoca Cart event in the order view.

So the way is to add this button per event and trigger com_ajax and run the plugin code per ajax (unfortunately no more clue advice from me as I don't know how your plugin works)

We have one event: GetPaymentBranchInfoAdminList in orders list, unfortunately no such in edit of the order, isn't it possible to have such button directly in orders list for each order?

Jan
If you find Phoca extensions useful, please support the project
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 493
Joined: 07 Nov 2018, 14:55

Re: Raiffeisen bank payment gateway for Phoca cart

Post by Nidzo »

We have one event: GetPaymentBranchInfoAdminList in orders list, unfortunately no such in edit of the order, isn't it possible to have such button directly in orders list for each order?
That is the solution that I am focused now.

Do you have any suggestions because I'm currently unable to display anything in orders list?

Also I want to share this project for free. It is functional now for payments, Phoca Cart status changes, Refunds from bank control panel.

It will be available on GitHub soon.
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 493
Joined: 07 Nov 2018, 14:55

Re: Raiffeisen bank payment gateway for Phoca cart

Post by Nidzo »

How does a pcp plugin register a listener for GetPaymentBranchInfoAdminList? I implemented onPCPgetPaymentBranchInfoAdminList method but it's never called. What should I use?

GitHub
https://github.com/nidzo80/Raiffeisen-P ... Phoca-Cart
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49328
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Raiffeisen bank payment gateway for Phoca cart

Post by Jan »

Hi, the event should be displayed when you select some payment method, then the orders get information about the additional payment. The question is, what exactly do you need? If only to display some part of html/js, maybe we can add some event to display specific html/js plugin code in edit view :idea:

Jan
If you find Phoca extensions useful, please support the project
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 493
Joined: 07 Nov 2018, 14:55

Re: Raiffeisen bank payment gateway for Phoca cart

Post by Nidzo »

Thank you Jan! Two questions:

Regarding GetPaymentBranchInfoAdminList — orders do have payment_id set and params_payment contains {"method":"raiaccept",...}. The event fires (I can see it in the template code) but plugin method onPCPgetPaymentBranchInfoAdminList is never called. Could you share a minimal example of how a pcp plugin should implement this method in Joomla 6? I suspect the issue is in the PSR-14 event listener is registered.

Yes, a new event for the edit view would be very helpful! I need to display a small HTML form (amount input + button) that triggers a refund via com_ajax. Something like onPCPgetPaymentBranchInfoAdminEdit would be perfect.
Post Reply