Question:
How to add the "at_period_end" argument to the next PHP function according to the relevant Stripe documentation?
DOCUMENTATION:
STRIPE: Unsubscribe
CODE:
<?php require_once('./lib/Stripe.php'); Stripe::setApiKey("$APIKEY"); $cu = Stripe_Customer::retrieve("$CUSTOMER_ID"); $cu->subscriptions->retrieve("$SUBSCRIPTION_ID")->cancel(); ?>
I found the correct solution:
$cu->subscriptions->retrieve("$SUBSCRIPTION_ID")->cancel( array("at_period_end" => true ));
Try specifying the argument as an array like this:
$at_period_end = true; $cu->subscriptions->retrieve("$SUBSCRIPTION_ID")->cancel( array("at_period_end" => $at_period_end));
Source: https://habr.com/ru/post/1202214/More articles:About android Sqlite security in multiprocessor package - androidBitmap scaling scaling for Android on canvas - androidFlask-RESTful custom routes except GET, PUT, POST, DELETE - pythonHow to use private action method in .net mvc? - asp.net-mvcWhy can't the static and non-static method use the same signature? - polymorphismChains of reliable methods with a long zero - ruby-on-railsStoryboard preview differs from simulator - iosAngular testing of $ httpBackend.flush () causes an error - javascriptHow to check if an HTML element is accessible for content from the Chrome extension - javascriptPass an object to a jular angularjs template - javascriptAll Articles