#Nepho-subscriptions

1 messages ยท Page 1 of 1 (latest)

worldly heart
summer rune
#

Hello! For the record I'm using the official Node.js library for backend, and official react-native library for frontend.

worldly heart
#

hi there!
yep if you use a trial period the subscription is immediately created in the trialing status, payment/card information is not needed upfront.

There's no PaymentIntent because there's no payment required.

If you want to collect payment info from the customer, you would look at the pending_setup_intent field on the Subscription, return the client secret of that SetupIntent to the frontend, and call confirmSetup there

summer rune
#

Thanks for the answer ๐Ÿ™‚
OK, so I need to:

  1. Create the subscription with trial_from_plan: true
  2. Get pending_setup_intent from the response
  3. Retrieve the setup intent using the seti_ identifier
  4. Send the client_secret contained in this setup intent to the client?
    This seems easy enough, thanks for the info
worldly heart
#

for step 3 you can just expand it you don't need an extra API call

#

expand : ["latest_invoice.payment_intent", "pending_setup_intent"]

summer rune
#

Oh, sweet! Thanks

#

Now I have an issue in the mobile application ๐Ÿ˜…
The documentation: https://github.com/stripe/stripe-react-native/blob/master/docs/GooglePay.md#present-google-pay-sheet
Says to "present Google Pay" by using presentGooglePay with the forSetupIntent: true option. This options doesn't exist in recent versions of the library.
If I just pass the client_secret I got in the pendingSetupIntent from the backend's response, I get the following error client-side:

Any idea what's wrong? Thanks in advance!

worldly heart
#

I think it's presentGooglePay({clientSecret:"seti_xxx_secret_yyy"}) I would guess

cerulean halo
#

@summer rune

#

Are you passing useSetupIntent: true?

summer rune
#

Nope, it seems like a deprecated param. presentGooglePay only takes clientSecret it seems

#

Oh wait, I see that it also takes PresentGooglePayType options... Wondering why my typescript autocomplete doesn't suggest anything from this type

#

Ah, actually it does ๐Ÿค”

#

I don't know why I didn't see it the first time

#

Sorry for bothering you, it should work properly now

cerulean halo
#

Np!