#danmatthews-subscription-connect

1 messages ยท Page 1 of 1 (latest)

fathom aspen
#

@pine prism do you have an example subscription id?

pine prism
#

sub_1Jmh3H2aeyeYuWjZDoAy76pD

fathom aspen
#

the invoice is for $0

#

so in that case there's no PaymentIntent

pine prism
#

Ah ok, is it because the price is too low

fathom aspen
#

in that case you want to use the pending_setup_intent instead

pine prism
#

i think the price is $0.12

fathom aspen
#

yes correct!

pine prism
#

ahhhhh ok

#

brilliant, thanks

#

i'll sort that out

pine prism
#

Thanks - it's now complaining the customer has no payment

#

just wondering why it's not working even though this is the way it's suggested in

atomic bloom
pine prism
#

req_8TPubdnPz1ePFD

#

thanks!

#

koopajah mentioend above that i probably need to use pending_setup_intent but i'm almost positive this was working previously when i tested the connect integration originally

#

i'm using the same code, so i feel like i'm going a little crazy

atomic bloom
#

Looking, thanks

pine prism
#

thank you

atomic bloom
#

Can you try adding that?

#

Otherwise you can collect a payment method for the customer first and provide that for the subscription before creating it

pine prism
#

Oh no, i think that was there and i removed it ๐Ÿ˜ฆ

#

I'm an idiot

#

Cool, so that's better, now i'm getting "no such payment intent" error

#
$subscription = $stripe->subscriptions->create(
                [
                    "customer" => $customer->id,
                    "metadata" => [],
                    "items" => [
                        [
                            "price" => $price->id,
                        ],
                    ],
                    "payment_behavior" => "default_incomplete",
                    "expand" => ["latest_invoice.payment_intent"],
                ],
                ["stripe_account" => $teamStripeConnection->stripe_account_id]
            );

            $intent_secret =
                $subscription->latest_invoice->payment_intent->client_secret;
#

just for reference this is the subscription create code

#

Is there something extra that needs to be added to confirmCardPayment in the JS for connect payments?

atomic bloom
#

Ok this is likely because of the connect request, you need to ensure you initialize Stripe.js the same way: use the platform PK + provide the stripeAccount parameter

pine prism
#

ahh ok

atomic bloom
#

const stripe = Stripe('pk_test_123platform', {stripeAccount: 'acct_567connected'})

pine prism
#

Ah i totally missed that! Sorry

#

it's late here

#

damn, right, thank you SO much for your help

atomic bloom
#

np! its a tricky little hobbit

#

very welcome! hope its working and you get to sleep soon ๐Ÿ˜„