You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there, I've been trying to following this guide i have also created the custom Checkout, i am getting data null in payment_intent and setup_intent is there any option i am missing?
Custom Serializer
classCustomCheckoutRequestSerializer(CheckoutRequestSerializer):
"""Handle creation of a custom checkout session where parameters are customized."""defvalidate(self, attrs):
stripe_user=get_or_create_stripe_user(user_id=self.context['request'].user.id)
try:
checkout_session=stripe_api_create_checkout_session(
customer_id=stripe_user.customer_id,
price_id=attrs['price_id'],
trial_end='auto'ifstripe_user.subscription_items.count() ==0elseNone,
payment_method_types=["card"],
checkout_mode="subscription",
)
print(checkout_session)
attrs['session_id'] =checkout_session['id']
attrs['customer_id'] =checkout_session['customer']
attrs['payment_intent'] =checkout_session['payment_intent']
attrs['url'] =checkout_session['url']
exceptStripeErrorase:
raiseValidationError(e.error)
returnattrs
Hey there, I've been trying to following this guide i have also created the custom Checkout, i am getting data null in payment_intent and setup_intent is there any option i am missing?
Custom Serializer
SETTING
The text was updated successfully, but these errors were encountered: