#Benjamin Carrera
1 messages · Page 1 of 1 (latest)
Moving this:
// Create the subscription.
$subscription = $stripe->subscriptions->create([
'customer' => $customer_id,
'items' => [
[
'price' => $price_id,
'quantity' => $quantity,
],
],
'trial_period_days' => 7,
]);This is not returning "$subscription->latest_invoice->payment_intent->client_secret" so I can use it for collecting the payment information with the js API:
stripe.confirmCardPayment(client_secret, {
payment_method: {
card: cardNumber,
billing_details: {
"address": {
"city": billing.city,
"country": 'US',
"line1": billing.address,
"line2": billing.addressTwo,
"postal_code": billing.zipcode,
"state": billing.state
},
name: name,
},
}
}).then((result) => {
$("#loader").hide();
console.log(result);
if(result.error) {
$('#show-error div').html("Payment failed: " + result.error.message);
$('#show-error').show();
} else {
// Redirect the customer to their account page
//$('#messages').html('Success! Redirecting to your account.');
window.location = "register-thankyou.html";
}
});Can you help me to accomplish this?
Hi, can you share the request id for your subscription creation with me?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I see the issue, you'd need to use expand, https://stripe.com/docs/expand on your subscription creation, https://dashboard.stripe.com/test/logs/req_lGKVU6tkLFglrf