trigger shipping plugin after payment

  • Posts: 51
  • Thank you received: 4
6 years 7 months ago #277100

-- Error-message(debug-mod must be tuned on) -- : Please advise, how can I get back to the shipping plugin I am writing after successful payment to actually book the pickup of the products, by the shipping company via their API?

Please advise, how can I get back to the shipping plugin I am writing after successful payment to actually book the pickup of the products, by the shipping company via their API?

Please Log in or Create an account to join the conversation.

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
6 years 7 months ago #277104

Hi,

You want to implement the onAfterOrderUpdate trigger of our order API and check the order_status of the order so that if the order is being changed from "created" to "confirmed" you can do your processing for the booking of the pickup.
www.hikashop.com/support/documentation/6...mentation.html#order

Please Log in or Create an account to join the conversation.

  • Posts: 51
  • Thank you received: 4
6 years 7 months ago #277188

I added function onAfterOrderUpdate()
to my shipping plugin and it is only triggered when the admin changes the status of the order, so it cannot be automatically executed to get the courier to come.
I need this to be dynamic after payment.

Any other ideas?
I tested with the paypal plugin and it doesn't hit the method.
I tested by changing status in the admin and hit the method.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
6 years 7 months ago #277202

Hello,

Please advise, how can I get back to the shipping plugin I am writing after successful payment to actually book the pickup of the products, by the shipping company via their API?


If you want your function to be triggered after your order status changes to "Confirmed" then you'll have to use the "onAfterOrderUpdate" trigger which will be called every time the status of your order changes.

Can you give us more information about what you want to achieve ?

Thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 51
  • Thank you received: 4
6 years 7 months ago #277550

what I am trying to achieve.
I have added the onAfterOrderUpdate method to my shipping plugin.
Currently it just creates a text log file to show that the method is being hit during processing.

when a purchase is made, the shipping plugin calls the shiper api to get a price for the delivery and adds it to the car prior to payment. This is fine.
If I have the product in stock, I want the system to book the pickup immediately after payment.
Then once it's picked up, I can change the status to picked up.
via cron, or some other method, I need the system to check if the product has been delivered, dynamically, and change the status to delivered.

However, currently, the new method in the shipping plugin is not being hit when payments are made.
I have tested it with paypal. No log file created.
I tested it in the admin area and changed an order status, and it was hit.

Please Log in or Create an account to join the conversation.

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
6 years 7 months ago #277556

Hi,

If the PayPal plugin changes the status of the order when receiving the payment notification, then your plugin will be triggered.
So if you say it's not triggered, then there must be a problem with the code of your plugin or your PayPal plugin is not confirming the orders automatically or something due to a problem on the server.

Please Log in or Create an account to join the conversation.

Time to create page: 0.071 seconds
Powered by Kunena Forum