#localpath

1 messages · Page 1 of 1 (latest)

fickle pagodaBOT
sage lava
#

hello! the pending_setup_intent would only have a value if the first payment is $0. for that event that you've shared, the first payment for the Subscription isn't $0

cosmic blade
#

Hello. So Google Pay and Apple Pay have slightly different behavior then? Here is the Google Pay one with a pending_setup_intent that works as expected for us
evt_1Oh2RMEd62mULYc9Sb92RDD8

#

We essentially just start the subscriptions using a future anchor date so there is no charge at the time the subscription is created but the subscriptions first charge will be for the subscribed value.

sage lava
#

no, this logic shouldn't have anything to do with Google or Apple pay. Gimme a while to take a look

cosmic blade
#

Ok thank you so much for helping. If you need any more of our Express config or settings I can provide it

sage lava
#

if i compare the requests that you're making, i see one of them defines a billing_cycle_anchor and the other one doesn't

#

if you make the request with the same parameters, the behaviour should be the same

cosmic blade
#

Oh you think could it be bc we're attempting to start the sub the same day as today and we have some logic to calculate that anchor

#

We're doing this to get our anchor

/**
   * If the provided start date is today, we'll leave startDateInSeconds
   * undefined and let Stripe automatically handle the start date.
   * @param startDate The provided startDate
   */
  private calculateStartDateInSeconds(startDate: Date) {
    const startDateInSeconds =
      startDate && !dayjs(startDate).isToday()
        ? Math.floor(startDate.getTime() / 1000)
        : undefined;

    return startDateInSeconds;
  }
#

That would make perfect sense. I think the fix for us would be don't allow Subscriptions to start today and we'll get that behavior. I think the Google Pay tests I was making were all future dates so it was throwing us off

sage lava
#

you can see the requests you're making in the Dashboard e.g. https://dashboard.stripe.com/test/logs/req_lCU2MKzbkziDO9 and https://dashboard.stripe.com/test/logs/req_I9PUd2hVsY7dtk if that helps

cosmic blade
#

I'll get my other dev to test the flow again using a future date

#

Thanks so much. This was super informative and great reminder to check my request logs!

#

If we do choose to do the sub starting today w/o the anchor, would we use a payment intent instead of setup intent?

fickle pagodaBOT
sage lava
cosmic blade
#

Ok got it. Thanks will review this!

sage lava
cosmic blade
#

That's a sore subject bc our Api integration was built using Sources and some deprecated or not so great legacy methods of handling subscriptions

#

To your point its what we probably need to move our code to using now that we're introducing intents and refactoring out creating sources and cloning those sources for payment methods in some other areas outside these Digital Wallets that were adding ow

#

now *

sage lava
#

ah i see, migrating, testing everything to make sure it works well will take quite a bit of effort and time depending on your code

#

anyway, feel free to reach out again in case you have more questions 😄