Start your All-Access Pass to unlock this challenge
Imagine our website provides paid access to content and allows users to subscribe. We integrated a payment system called Stripe that helps with it. When a new user subscribes, we send an API request to Stripe and it returns a response that contains all the necessary info about the user's subscription. The structure of the data looks like this:
$subscriptionData = array(
"id" => "sub_1NiGuB2eZ",
"object" => "subscription",
"items" => array(
"object" => "list",
"data" => array(
array(
"id" => "si_OVHTBQE",
"object" => "subscription_item",
"price" => array(
"id" => "plan_OUwcmF6",
"object" => "price",
"amount" => 24.99,
"currency" => "USD",
),
),
),
),
);
Now we want to print the amount the user just paid on the page. How can we do it?