<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: X-Requested-With, content-type, X-Token, x-token');
require_once('vendor/autoload.php');

$data = json_decode(file_get_contents('php://input'), true);

\Stripe\Stripe::setApiKey( $data['clientSecretKey']);

$plan = \Stripe\SKU::create(array(
  "metadata" => array("name"=>$data["nickname"]),
  "product" => $data["product"],
  "id" => $data["id"],
  "currency" => $data["currency"],
  "price" => $data["price"],
    "inventory" => array(
    "type" => "infinite")
));
        
?>