#furbox-php-subscription

1 messages · Page 1 of 1 (latest)

rare dove
#

@rocky sage I'm not sure I follow what you mean. Do you want 30 days of trial and then an entire month not paid until the end of month?

rocky sage
rare dove
#

So what's blocking you exactly?

rocky sage
rare dove
#

How are you creating the subscription exactly?

rocky sage
rare dove
#

That's just Dashboard screenshots

#

All I'm asking is how exactly you create the subscription: what is your code

rocky sage
#

test mode

rare dove
#

damn so many pictures of code

rocky sage
#

jaja

rare dove
#

all I was asking is the exact line of code creating the subscription. You're the dev here, I can't really tweak a picture of code

#

But really the problem is that you are assuming we will use the trial period of the Price (which is fair) but we don't

rocky sage
#

public function checkout($id_product) {
header('Content-Type: application/json');
try {
$prices = \Stripe\Price::all([
// retrieve lookup_key from form data POST body
'lookup_keys' => [$id_product],
'expand' => ['data.product']
]);
$checkout_session = \Stripe\Checkout\Session::create([
'line_items' => [[
'price' => $prices->data[0]->id,
'quantity' => 1,
]],
'mode' => 'subscription',
'success_url' => base_url('success?session_id={CHECKOUT_SESSION_ID}'),
'cancel_url' => base_url('cancel'),
]);

        header("HTTP/1.1 303 See Other");
        header("Location: " . $checkout_session->url);
    } catch (Error $e) {
        http_response_code(500);
        echo json_encode(['error' => $e->getMessage()]);
    }
}
rare dove
rocky sage
#

I think I'm misconfiguring the product with the trial period

rare dove
#

no you did not. We just completely ignore that trial period

#

so don't do it/rely on it and explicitly set the trial on the Checkout Session itself

rocky sage
#

You're right I won't add it

#

Thank you very much I will test

rare dove
#

Let me know if that doesn't fix your issue!