#impactfx(REAL)
1 messages · Page 1 of 1 (latest)
the code we are using looks like this
customer=customer.id,
items=[
{
"price": subscription.stripe_price_id,
"quantity": 2 if is_couple == True else 1,
"metadata":{
"omegawave-subscription-type":subscription.slug,
"is_couple":is_couple
},
}
],
coupon = couponId,
metadata = subscriptionMetaData,
payment_behavior='default_incomplete',
payment_settings={
'save_default_payment_method': 'on_subscription',
},
automatic_tax={
'enabled':True
},
expand=['latest_invoice.payment_intent'],
)```
we then pass this data back to the frontend
'customer_id':customer.id,
'subscription_id': customer_subscription.id,
'payment_intent':customer_subscription.latest_invoice.payment_intent,
'client_secret': customer_subscription.latest_invoice.payment_intent.client_secret,
},```
but the payment_intent is none and it dies
hello! that's expected behaviour, since the amount is $0, no payment is necessary. You should probably be referring to the Invoice object instead e.g. refer to the invoice.paid event
but you need a payment intent client_secrete to use the frontend payment
there is no way to finalize the frontend transaction
So i dont see how "its intended" to not allow for a stripe element to work if you have a 100% coupon that is for one month.
if you have a 100% discount coupon, then no payment is required, because the amount is $0
but its only for one month
so yes.. we need to collect there card details still for the next month
can you share an example subscription id?
sub_1MnWZKLXvJT74HZxqMvA7ekg
Stripe automatically creates SetupIntents for subscriptions that don’t require an initial payment. So what you do in such a scenario would be to expand the pending_setup_intent and use the client_secret for that to collect the payment method details instead : https://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ah
thank you
ill look into that, appreciate it
didnt see that option
i'm running into another issue now that I am using that new method,
can i post it here?
sure
it seems to there is no way to update a pending_intent?
we store a bunch of meta data in our payment intents for later use in our application.
However using our tested code, we are getting
Request req_mnqIxaKP0ljtJK: No such payment_intent: 'seti_1MnWrgLXvJT74HZxuCzLgXp7'
Is there a way to predefine meta data on a "pending_intent"
seti_1MnWrgLXvJT74HZxuCzLgXp7 is a SetupIntent
try updating the metadata using https://stripe.com/docs/api/setup_intents/update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So i can manipulate that model and it will convert to a intent when ready?
hmm seems setup intents dont have a shipping property..
were gunna have to try and figure out i guess how to use this new model with our current flow
i'm not sure what you mean by "convert to a intent when ready" - a SetupIntent is used to setup a PaymentMethod for future use : https://stripe.com/docs/payments/setup-intents
it's different from PaymentIntents
Well becase we store at time of transaction meta data that is important for us
i was hoping the meta data of the "setup intent" would be migrated over when that intent needs to be paid
I have never used this SetupIntent before so i'm a little unclear on the way its used
like i mentioned, a SetupIntent is used to setup a PaymentMethod.
If you want to store metadata, then i would suggest storing it on the Subscription : https://stripe.com/docs/api/subscriptions/create#create_subscription-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.