#davidcharles9114

1 messages ยท Page 1 of 1 (latest)

quartz impBOT
pearl forum
#

Hi there, what's the payment intent ID?

knotty egret
#

I use payment hosted stripe by creating session

#

And it will return session.url for pointing to Hosted stripe payment

pearl forum
#

What's the checkout session ID?

knotty egret
pearl forum
#

I can take a look if you share with me the checkout session ID

knotty egret
#

How to get checkout session ID from Dashboard? can you let me know,

pearl forum
knotty egret
#

You can look

#

cs_test_a1cYzCOxzCv3h4zZuPPi5ZIA9RRivxqpqUSiXlVHSE4tcPtIE4zs3iLH8c

pearl forum
#

Ok the relevant PaymentIntent is pi_3OGvunJPUdcPKYWO16mLZci6" and it doesn't have a shipping address, that's why the radar rule didn't match for this payment.

knotty egret
#

Why the UI redirect have shipping address to I filling,

pearl forum
knotty egret
#

Yes, so you mean, the shipping_address_collection only working for mode payment, not subscription

#

when create checkout session, is that right?

#

Radar rule

pearl forum
#

No. I mean this payment doesn't have a shipping address, and that's why it doesn't match the radar rule that you created.

knotty egret
#

Can you tell me the reason, why form have Shipping address to filing data, While payment response Log not have address info?

pearl forum
#

Did you fill in the shipping address during checkout?

knotty egret
#

Yes,

pearl forum
knotty egret
#

You mean I will pass mode payment or subscription in here?

#

or both mode can working in this case

pearl forum
#

Hmm wait a second, that param I provided earlier is for payement mode only.

#

Ok. Another way is to listen to invoice.created event, and programmatically set the shipping (https://stripe.com/docs/api/payment_intents/update#update_payment_intent-shipping) before finalizing the ivnoice. In this way, the payment_intent would have the shipping info that can match the radar rule.

knotty egret
#

I want shipping address country dynamic on UI, by user filling,

#

not passing from API,

#

Such as, I can select Vietnam, or US that I want shipping

#

For mode subscription

pearl forum
#

I know. Upon checkout completion, Checkout will set the shipping info to the customer object. So that you can set the same shipping info to payment_intent when handling invoice.created events

knotty egret
#

So for this code, I will add more which param to support this, Can you help?

#
    line_items: [
      {
        price:
          subscriptionPlan === SubscriptionPlan.monthly
            ? env.STRIPE_MONTHLY_SUBSCRIPTION_PRICE_ID
            : env.STRIPE_ANNUAL_SUBSCRIPTION_PRICE_ID,
        quantity: 1
      }
    ],
    metadata: {},
    mode: 'subscription',
    customer_email: email,
    success_url: `${env.STRIPE_CHECKOUT_SUCCESS_URL}?session_id={CHECKOUT_SESSION_ID}&user_id=${userId}`,
    shipping_address_collection: {
      allowed_countries: allowedCountries,
    },```
pearl forum
#

No, you don't need to add anything here.

quartz impBOT
knotty egret
#

Don't know the webhook will have any related to creating Session in here?

#

My final purpose is want to create Radar rule for Block payment when Shipping Address Country is US,

#

That mean Stripe will reject payment if Shipping Address Country is US,

strong surge
knotty egret
#

Yes, I seen.

#

Have any thing I need focus in this?

#

I created Checkout session with mode Payment, the radar rule working

#

But for subscription mode, the radar rule not working,

#

Differ between Subscription and Payment. Have session Shipping

strong surge
#

How do you setup your rule? Does it block on Shipping Address but not looking at Billing Address?

knotty egret
#

My radar rule just block Block if :shipping_address_country: IN ('US', 'DE', 'AE')

strong surge
#

What if you block using billing address instead? As you already collec it on Checkout Session

knotty egret
#

My final purpose is want to create Radar rule for Block payment when Shipping Address Country is US,

#

So use billing address instead is fine in this case,

strong surge
#

Sorry didn't follow. Have you tried changed from Shipping -> Billing address and see if it works?

knotty egret
#

Why we use Billing address instead?

#

If we don't check Billing address is same as shipping, and select another,

#

So please help confirm me the final, For subscription mode, the radar rule shipping_address_country will not working? is that right,

#

And we will use billing_address_country instead,

strong surge
# knotty egret

Hi, sorry let's take a step back. Could you provide 2 PI Ids in this screenshot side by side? Will look closer

knotty egret
#

One for subscription mode

strong surge
#

And the one in payment mode?

knotty egret
strong surge
#

Okie I can see the differences now. Sorry for the back and forth. Discord is busy and I believe we would need more time to look closer into it, so please write to Support and mention this Discord thread.

#

We would follow up from the email conversation

knotty egret
#

Where I can find Support,