Jump to content

Advice on sending a data to a .net application on successful purchase.


Pedram

Recommended Posts

Hello,

I'm a .net Developer , as well as a Prestashop owner,

I have already made a program to do everything i need in C# and Automate all my work,

The only part which is not automated yet is that i have to manually check site for Order Details and Status and give it to my C# Application.

 

So i have 2 approach in my mind , but I want advice on which is better or is there any better way other than this two ?

 

 

So my first idea is, I can set some timer or something on my app and use prestashop's webservice and check for the new Orders, when app hit a new Successful Purchase, it would then take the info and proceed to do the rest of the works.

 

and my 2nd idea , well it came from the Telegram Bot I made last months for my site .

just like how it sent new updates through a Json string from a link, I could do the same

and make a secret url that show empty results

{"ok":true,"result":[]}

until there is a new successful purchase which would show up with the details in the result section , and my App would then proceed to do the works and send back a POST to my link to remove the result back to empty [ ].

 

 

So which one of these methods is best or is there any better idea ?

 

also is there a way to make a call to the application only when we got a new Successful purchase ?

 

 

btw, my knowledge of php is not advanced, my best ever creation yet in php, was a custom payment method modules for prestashop.

but I'm good at C#.

 

Thanks.

Edited by Pedram (see edit history)
Link to comment
Share on other sites

Hi Pedram, you don't need to setup a timer app from your .net app. Prestashop provides the action hooks, you can use the action hook to make an auto update to your .net app when new orders are placed. Please go through the link to know about prestashop hooks http://doc.prestashop.com/display/PS15/Hooks+in+PrestaShop+1.5 . For your case you can create a simple presta module with registering orderConfirmation hook, and write the logic that makes call to your .net app with php xml rpc inside the orderConfirmation hook function. I hope this will be a good and preferred method, because the call to .net app will be happen only when new orders are placed. 

 

 

 

Thanks,

Abdulla Chozhimadathil

Link to comment
Share on other sites

Hi Pedram, you don't need to setup a timer app from your .net app. Prestashop provides the action hooks, you can use the action hook to make an auto update to your .net app when new orders are placed. Please go through the link to know about prestashop hooks http://doc.prestashop.com/display/PS15/Hooks+in+PrestaShop+1.5 . For your case you can create a simple presta module with registering orderConfirmation hook, and write the logic that makes call to your .net app with php xml rpc inside the orderConfirmation hook function. I hope this will be a good and preferred method, because the call to .net app will be happen only when new orders are placed. 

 

 

 

Thanks,

Abdulla Chozhimadathil

 

Hi, Thanks for reply,

I read about Actions hooks before briefly , I know they can Do something after something else is done , like an Event in C#.

 

But the problem is that I have no idea , how i can make an action hook send something to my .net app.

Well, the only way i can think of is sending a POST to a IP or url , which my .net app is located, but it will be the same as my second method I guess ?

coz my program have to be on constant check to receive the POST or something ...

 

btw I forgot to mention, If it was a .net Web Application I knew what to do, but it's a Windows Application.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...