#stevec0583
1 messages ยท Page 1 of 1 (latest)
This error is usually thrown when you use secret key from account A to access the payment intent from account B
pi_3NcGv9RT28QMR5HW08kJIjDU was created on connected account acct_1NZyqWRT28QMR5HW using platform key with Stripe-Account header
(random, unrelated observation, but I noticed your profile pic and my github profile pic are very similar: https://github.com/stevecondylios)
When you retrieve the Payment Intent, you should also use Stripe-Account in your request
Okay I'll double check the stripe account. It's stripe connect and I can't see any problems with keys.
Unless it's not possible for the platform to retrieve a payment intent for a connected user? (I can't understand why that would be a problem though)
It's possible to retrieve a Payment Intent on a connected account, but your code should use Stripe-Account as the connected account ID in the retrieval request: https://stripe.com/docs/api/expanding_objects?lang=ruby
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Gotcha. Kinda annoying that it's necessary (since PI's are globally unique) but that's okay, I'll give it a shot now.
With Connect integration, it's necessary to send the connected account ID under Stripe-Account header in the request
Gotcha. I checked and it works.
Thanks for the help!
No problem! Happy to help ๐
Is it possible to get a url to a receipt for payments on stripe connect? When someone pays on the platform, I'd like to send them a confirmation email with a few details, including (if possible) a link to their receipt.
In your retrieval request,latest_chargeshould b expanded and you will be able to find receipt URL underlatest_charge.receipt_url
Expanding an object: https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ohh.. I'll try now. (I almost thought it wasn't possible due to most answers here: https://stackoverflow.com/questions/28814791/stripe-receipt-url)
This SO has an update in 2019 that:
UPDATE: As of January 17 2019, this is now possible to do. The Charge object has the receipt_url property that lets you access this information whether an email receipt was sent or not!
Which is the same as what I recommended
Sorry, got caught on something else. Just checking now. Will report back in a min
Brilliant, it works, thanks very much for the help!
No problem! Happy to help ๐
It worked, thanks a lot for the help. I posted an answer to the question to hopefully help others in the future: https://stackoverflow.com/a/76848387/5783745
If I made any mistake or if anything's poorly worded I can edit it (just let me know)
the stripe account id as an option
Stripe account ID is only required if Connect is used. For non-Connect, it's not required to set connected account ID asStripe-Account
Great to know. If not using connect, is
Stripe::PaymentIntent.retrieve(
{ id: payment_intent_id, expand: ['latest_charge'] }
)
enough?
Yes! This looks good
Awesome. Thanks a lot for all your help!