We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How to receive third party POST data

Development and Programming

AlteredState's avatar
AlteredState
57 posts
11 years ago
AlteredState's avatar AlteredState

Hi

I’m having a third party POST data to a URI in my EE site automatically on an order completion.

I know how to manipulate the data once I’ve got it, but I don’t know how to code the receiving file/template.

I currently have the following PHP in an EE template to receive the data:

<?php
 $salt  = '123456abcdef';
 $order_src = 'source_name';
 $chk_order_key = sha1($order_src.$salt);
 $order_key  = ee()->input->post('order_key', FALSE);
 $order_ref  = ee()->input->post('order_ref', TRUE);
 $order_value  = ee()->input->post('order_value', TRUE);
 $order_name = ee()->input->post('order_name', TRUE);
 $order_ip  = ee()->input->post('order_ip', TRUE);

 if($order_key!=$chk_order_key)
 {
  echo 'failed';
 } else {
  echo 'success!';
 }
?>

…but testing with a form just throws up an EE error - presumably relating to the lack of an XID on submit.

So, do I need to setup a separate standalone PHP file to receive the data and insert the data into the EE database outside of EE? Or do I need to create an EE module or something?

I’m not sure what to do, so any help would be appreciated 😊

Thanks Steve

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.