I managed to install an API so that customers can subscribe, but now I have to pass the data of the subscription form once validated to another page, which is actually a page made also with another API. How could that be done?
I think the function should be implemented in the file that the API calls checkout.php:
$subscription = $result->subscription();
// var_dump($subscription);
$queryParameters = "subscription_id=" . urlencode($subscription->id);
$jsonResp["forward"] = "thankyou?" . $queryParameters;
//echo json_encode($jsonResp, true);
echo "<div class='respuesta'><h1>Thanks for subscribing</h1></div>";
// header('Status: 301 Moved Permanently', false, 301);
header("Location: https://aem-author-proda4.bmw.com/content/bmw/marketAT/bmw_at/de_AT/campaign/bmw-prime/thank-you.html?wcmmode=disabled" );
exit();
} catch(ChargeBee_InvalidRequestException $e) {
handleInvalidRequestErrors($e, "plan_id");
} catch(Exception $e) {
handleGeneralErrors($e);
}
?>