$stripe = new \Stripe\StripeClient(
'secret key'
);
$producto = $stripe->products->create([
'name' => 'Producto',
]);
$precio = $stripe->prices->create([
'unit_amount' => 2000,
'currency' => 'mxn',
'recurring' => ['interval' => 'month'],
'product' => 'prod_M5wGTae8k3MU9A',
]);
$stripe->prices->retrieve(
'price_1LNkNaAImbzwVJupc9Z01SRC',
[]
);
$subscription = $stripe->subscriptions->retrieve(
'sub_1LPZTlAImbzwVJupR1gBjp6d',
[]
);
$actualizar_sus = $stripe->subscriptions->update('sub_1LPZTlAImbzwVJupR1gBjp6d', [
'cancel_at_period_end' => false,
'proration_behavior' => 'create_prorations',
'items' => [
[
'id' => $subscription->items->data[0]->id,
'price' => 'price_1LPUDeAImbzwVJuprGUVjFX0',
],
],
]);
$cancelar = $stripe->subscriptions->cancel(
'sub_1LQDgCAImbzwVJupRC3D4HpP',
[]
);