0

I have a thrivecart confiramtion page that has a URL redirect included. I want the url redirect to expire after 48hrs of the purchase but I want to direct the expired page somewhere specific (or just make the url redirect dead).

Here is an example of a purchase confiramtion page https://goldenteacherfilms.thrivecart.com/dosed-2019/confirm/b28f1269ada260119822886d02e825827045fafdc00b/

I'd like it so that the URL at the bottom is either hidden, the url doesn't redirect, or to redirect the page after 48 hours (must be after 48hrs of purchase and not link click to prevent sharing)

ThriveCart can define how long the link is active however after that time has lapsed, it just looks like a broken link (img attached) which I don't want. Broken Link Redirect Page

If you look at this page as an example, the 48hrs has passed and when you click the link, nothing happens https://checkout.thewisdomoftrauma.com/movie/confirm/f49783708ac2971a0965def5a2424e1b992733df9b6f/

I honestly don't know where to start but here are a few things that I have set up

On the redirected page I have this PHP that passes through during the redirect

<?PHP

$my_thrivecart_secret = 'VPHTQE3TU8Q0'; // @todo Change this value to your ThriveCart secret word

$hash = trim($_GET['thrivecart_hash']); // This is the hash as provided by ThriveCart

// Check if the hash exists, and is 32 characters long
if(empty($hash) || strlen($hash) !== 32) {
die('You cannot access this page without a valid order hash.');
}

// Check that some order data has been passed along too
if(empty($_GET['thrivecart']) || !is_array($_GET['thrivecart'])) {
die('You cannot access this page without valid order info from ThriveCart.');
}

// Verify the hash matches the data provided
$thrivecart = $_GET['thrivecart'];
ksort($thrivecart);

array_walk_recursive($thrivecart, function(&$i) { $i =
rawurlencode($i); });
$local_hash = md5(implode('__', array($my_thrivecart_secret,strtoupper(json_encode($thrivecart)))));

if($hash !== $local_hash) {
die('Your hash does not match up; it looks like your order details are invalid.');
}

// If they get this far, the hash is valid and you can provide the products to the customer or run any additional logic that you need to
echo 'Excellent, your hash matches and you are entitled to your products.';

?>

with this, I have the option to use the following keys (None of which show the date)

  • account_id
  • account_name
  • order_id
  • order_total
  • product_id (the product ID the order relates to; this does not mean that the product was purchased)
  • payment_processor
  • purchases (an array of the product ID,and the string ‘bump’ if the bump offer on that product was purchased)
  • customer (an array containing the customer’s email, firstname, lastname, contactno params if they were provided)

I need a way for the order date to pass through so that I can reference it to determine the 48hr mark.

I believe it stores the order date SOMEHOW as Zapier retrieves that data (zapier screenshot). I don't know how to grab the order date when the transaction is completed and store it in the page.

When I inspect the code on the confirmation page, I see that all the fields above are stored - how can I add the order date so that I can reference that Key in the future?

<script type="text/javascript">
_thrive_order={"customer":{"name":"first last name","email":"email@domain.com"},"raw":{"total":0,"tax":0,"gross":0,"shipping":0},"order":{"id":19544139,"invoice_id":"10","total":0,"total_readable":"0.00","tax":0,"tax_readable":"0.00","gross":0,"gross_readable":"0.00","shipping":"0.00","currency":"USD","affiliate_id":null,"product":{"id":1,"name":"DOSED (2019)","total":0,"total_readable":"0.00","quantity":1,"purchase_type":"pyop"}}};
</script>

It may be worth noting that the confirmation details (bolded) create a unique page link so I am wondering if there is a way to expire or redirect that link 48hrs after the link was created. I honestly just don't know where to start with this. https://goldenteacherfilms.thrivecart.com/dosed-2019/confirm/**b28f1269ada260119822886d02e825827045fafdc00b**/

UPDATE: I see that I can pass through custom values here but I'm not sure how to properly define the order date https://support.thrivecart.com/help/passing-custom-variables-through-the-checkout/

Mellin
  • 1
  • 1

0 Answers0