<?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');
\Stripe\Stripe::setApiKey($_POST['clientSecretKey']);


$product = \Stripe\Product::retrieve($_POST["id"]);
$product->metadata["pluginId"] = $_POST["plugin"];
$product->metadata["pluginTitle"] = $_POST["title"];
$product->metadata["image"] = $_POST["image"];
$product->name = $_POST["name"];
$product->active = $_POST["active"];
$product->save();
echo $product;
?>