Reputation: 504
QUESTION:
How does one append the "at_period_end" argument to the following PHP function in accordance with the relevant Stripe documentation ?
DOCUMENTATION:
CODE:
<?php
require_once('./lib/Stripe.php');
Stripe::setApiKey("$APIKEY");
$cu = Stripe_Customer::retrieve("$CUSTOMER_ID");
$cu->subscriptions->retrieve("$SUBSCRIPTION_ID")->cancel();
?>
Upvotes: 6
Views: 5230
Reputation: 9268
Try specify the argument as an array like this:
$at_period_end = true;
$cu->subscriptions->retrieve("$SUBSCRIPTION_ID")->cancel(
array("at_period_end" => $at_period_end));
Upvotes: 7
Reputation: 504
I found the correct solution to be:
$cu->subscriptions->retrieve("$SUBSCRIPTION_ID")->cancel(
array("at_period_end" => true ));
Upvotes: 15