- Posts: 9
- Thank you received: 0
Plugin development: change order status
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.41
hi,
I created a plugin for payments following the directions of your examples, but I do not understand what I do or what I call function to change the order status in confirmed and sending email notification.
help me please
Please Log in or Create an account to join the conversation.
See the call of the function "modifyOrder".
github.com/HikaShop/sample-payment-plugi...b/master/example.php
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
this function:
$this->modifyOrder($order_id, $this->payment_params->verified_status, true, true);
It does not work, I would like to recall the page checkout in function after_end ()
because I can get here with the variables that I need payment accepted.
Please Log in or Create an account to join the conversation.
I can assure you that the modifyOrder function works perfectly when you give it the right parameters.
Without any details about your current implementation it will be more than complicated for us to give you advices or tips.
The sample plugin we published give all requires information to create a plugin ; you can take a look at the other payment plugin provided by the HikaShop package.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
it's called the variable hikashop expects to validate the payment?
that value must have?
the return page is this:http://mydomain.xxx/index.php?option=com_hikashop&ctrl=checkout&task=after_end&PaymentID=9113862441051600&TransID=9905603451051600&order_id=J2T01&postdate=0609&resultcode=APPROVED&auth=999999&Error=&ErrorText=&cardtype=VISA&payinst=VPAS&liability=Y&responsecode=00
that's what gives me the bank
but the status of the order is always created
Please Log in or Create an account to join the conversation.
That's not the link you want to give to your bank for your payment notification.
You want to give it:
mydomain.xxx/index.php?option=com_hikash...tif_payment='.$this- >name.'&tmpl=component
That way, you'll have your payment plugin called in the onPaymentNotification function of your payment plugin, and there, you'll be able to use the modifyOrder function as any other payment plugin. Then, you'll be able to redirect the customer to the normal after_end URL with a redirect call, as explained in the example plugin comments.
From the different bits of information you provided in your message, I don't see why you couldn't use the normal functions of payment plugins.
Please Log in or Create an account to join the conversation.
when i open this page: mydomain.xxx/index.php?option=com_hikash...ample&tmpl=component
sending this variables:
&PaymentID=1476668360951610&TransID=1454898370951610&order_id=L2E34&postdate=0610&resultcode=APPROVED&auth=999999&Error=&ErrorText=&cardtype=VISA&payinst=VPAS&liability=Y&responsecode=00
the result page is empty(white)
I attach the pages of the plugin, configured with the parameters of the test bank
Please Log in or Create an account to join the conversation.
That's normal.
That's what it does by default.
The example plugin will display a blank page on the notification page as this normally is triggered by the payment gateway server, not the user browser.
But if you read the comments in the example plugin's notification function, you'll find this:
In your case, you want to uncomment these redirects so that the plugin redirects the user to the thank you page after confirming the order with the parameters of the notification URL.
Please Log in or Create an account to join the conversation.
i uncomment this line
// $this->app->redirect($cancel_url);
// $this->app->redirect($return_url);
but the result is always white page:
mydomain.xxx/index.php?option=com_hikash...ample&tmpl=component
can you test my page please? i need a solution..
thanks
Please Log in or Create an account to join the conversation.
Yes, it won't work with the url you're using.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
mydomain.xxx/index.php?option=com_hikash...ID=1895301471751620& order_id=256&postdate=0611&resultcode=APPROVED&auth=999999&Error=&ErrorText=&cardtype=VISA&payinst=VPAS&liability=Y&responsecode=00&clientid=
I tried to set order_id, but the result is the same
Please Log in or Create an account to join the conversation.
As Jerome said, the example plugin expects that the order id is given in a parameter called "order" in the URL of the payment notification.
You used order_id instead of order so the plugin will stop at the load of the order at the beginning of the onPaymentNotification function since it couldn't find any order to load and thus the redirects won't be done as they are placed later in the function.
Remember that in order to confirm the order, the plugin needs to know the order_id for which the payment gateway is sending the payment notification, otherwise, it can't confirm the order.
So either you want to change the "order_id" parameter in the notification URL (but you might not be able to as it is your payment gateway redirecting to the user with these parameters in the URL), or you want to change to line:
Please Log in or Create an account to join the conversation.
the return url is
but the result is the same, white page
i attach my new example page
some patience please, help me
Please Log in or Create an account to join the conversation.
Please understand that this is just an example plugin. It doesn't means that you need to keep everything as it is in it, or that you shouldn't change some of the code becasue the payment gateway does things a bit differently. With that example plugin, we're just giving you the most common example.
For example, in the onPaymentNotification function, there is a call to the "example_signature" function which generates a hash out of some expected parameters and compare it to the hash given by the payment gateway. That's often done in order to guarantee the authentication of the payment notification. This is also explained in the comments of the plugin.
In your case, there is no hash in the URL and thus nothing to check. So if you keep the hash signature check in that function the check will fail and thus you'll also get a white page as the process will stop before the code which does the redirect in your onPaymentNotification function.
Please Log in or Create an account to join the conversation.
accepts the payment and order status changes confirmed, but the page is always blank,does not redirect the user.
this url don't change:
if you look at the page and tell me why does not redirect, thank you very much
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
You'll have to redirect him yourself regarding the payment status, If the payment was :
- Successful, you'll have to redirect him through a thank you page
- Cancelled, or if an error occurred, you'll have to redirect him through an error page.
I'll also checked your code, and it seems like you're actually redirecting your customers with that code :
$this->app->redirect($cancel_url);
Or
$this->app->redirect($return);
Your issue is probably coming from the fact the following code isn't executed.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
You might have a PHP fatal error which stop the process of your plugin.
You might have something before in the function which perform a "return false;".
I can assure you that "$this->app->redirect()" is working every time when it's called.
So if you have some troubles with development, I'll recommend you to be helped by a developer.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.