<?php
session_start();

$rateuser 	=  $_SESSION['amount1'];

 
 

require 'vendor/autoload.php';
require 'vendor/stripe/stripe-php/init.php';

require_once 'stripe/Stripe.php';
\Stripe\Stripe::setApiKey('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');

header('Content-Type: application/json');

//YOUR_DOMAIN = 'https://nhc2020.com';

$checkout_session = \Stripe\Checkout\Session::create([
  'payment_method_types' => ['card'],
  'line_items' => [[
    'price_data' => [
      'currency' => 'usd',
      'unit_amount' =>  $rateuser,  
      'product_data' => [
        'name' => 'Registration Fee',
        'images' => ["https://innovinc.org/Innovinc%20Logos_2.png"],
      ],
    ],
    'quantity' => 1,
  ]],
  'mode' => 'payment',
  'success_url' => 'webinar/home/ordersuccess',
  'cancel_url' => 'webinar/home/orderfailed',
]);

echo json_encode(['id' => $checkout_session->id]);
?>