#Reyansh Sharma

1 messages ยท Page 1 of 1 (latest)

jaunty fulcrumBOT
dire barn
rare meadow
#

Thanks also the way I am setting up the subscription is as follows (I was talking to someone about this in the past):

  1. Creating the subscription with payment_behavior: 'default_incomplete' (Don't have the payment method etc while creating the payment.
  2. Send the client secret of the first invoice created for the subscription to TerminalJS.
  3. Using terminal.[collectPaymentMethod] & sending the intentId to server-side API where I need to [Capture] the payment if not already.
dire barn
#

does that work?

#

I wouldn't expect it to, since the PaymentIntent from the Subscription Invoice doesn't have card_present as a payment_method_type but maybe you are manually setting it

rare meadow
#

Nope because there is no payment method attached to the customer

dire barn
#

you don't need a payment method attached to the customer when creating the subscription unless you're doing something wrong. What's the specific error message and request ID req_xxx ?

rare meadow
#

Let me check what I can get from the response

#

@dire barn SubscriptionIds created will work?

dire barn
#

sure

rare meadow
#

Thanks so two different scenarios:
Subscription added for a customer already exists on stripe: Subscription ID--> sub_1M7zDFIXPl35VUO685O89H8d

#

Payment intent status is requires_confirmation

#

In the second scenario: If the customer is not already available on stripe (We created a new customer) like for subscription [sub_1M7zIIIXPl35VUO60ro2dmTo] got the status payment_method_reqired

dire barn
#

ok well let's do one at a time

#

sub_1M7zDFIXPl35VUO685O89H8d cool, so you created that. So the next step is

  1. Send the client secret of the first invoice created for the subscription to TerminalJS.
  2. Using terminal.[collectPaymentMethod]
    and also, you need to process the payment
#

you seem to have skipped that part in your explanation above

rare meadow
#

Yes & sorry for that

dire barn
#

i.e. needing to do await terminal.processPayment(paymentIntent);

#

again, I have no idea if this will work or if it's meant to work, we don't document this as being possible(using Terminal to start a subscription) I think

#

but anyway, if you try it, what happens?

rare meadow
#

So after sending the subscription invoice --> PaymentIntent --> clientSecret calling [collectPaymentMethod] & getting the paymentintent object back.

dire barn
#

I don't know what ' & getting the paymentintent object back.' refers to

#

to be clear, you can't just use collectPaymentMethod to get a card and send it your backend server and use it there, that's not what it's for

rare meadow
#

๐Ÿ™‚

dire barn
#

it's a step as part of processing a payment with the reader, you always call terminal.processPayment after calling collectPaymentMethod

rare meadow
#

Thanks, Yes using the same for one-time payment where we don't need subs.
I was having some issues while doing that earlier so removed the step I believe. Checking that now.

dire barn
#

it wil probably fail because the PaymentIntent doesn't have card_present in the payment_method_types

#

and it looks like you can't change that, so there doesn't seem to be a way to have that work, you can't pay the invoice from the subscription using Terminal.

rare meadow
#

Yes I believe that was what happening.

dire barn
rare meadow
#

Yes I was getting that exception ๐Ÿ˜ฆ

dire barn
#

so you could maybe do a one-off Terminal PaymentIntent, and then when that succeeds, you create a subscription, with a trial period to skip the first payment, as kind of a hack

rare meadow
#

Haha yes that was the alternate I was thinking of

dire barn
#

you'd also need to make sure the generated_card thingy is saved to the customer properly so future payments work

rare meadow
#

The only problem was when someone will check the subscription it will be one invoice short.

#

So was not going that way. Anyway, though this seems to be the only workaround so might have to do that.

#

Thanks for all the help. Going to do that now.

blissful hinge
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

rare meadow
#

No that's all for now. Thanks again