#rp-invoice-paymentmethod
1 messages ยท Page 1 of 1 (latest)
looking
thank you!
If you look at that object it has source: 'card_123' which is part of a legacy integration overall
Hmm is that because my stripe API version is behind then?
It seems you did this manually from the Dashboard maybe which uses an older integration path to not break existing merchants
rp-invoice-paymentmethod
no not really related to your API version, just you manually testing in the Dashboard from what I can tell
This should have been created via the stripe API
Hmm yeah just double checked, I'm almost certain we created this invoice through the stripe API
you paid it in the Dashboard right?
you also attached that card in the Dashboard
and that flow uses an older integration path sadly
Got it, that makes sense
so you kinda have to account for both situations in this case
So in this case, we should be looking at the Source field?
Is there a way to find documentation on it? I can't see it in the docs https://stripe.com/docs/api/payment_intents/object
And thanks for the explanation! I didn't realize those actions had taken place in the dashboard
none of this is documented unfortunately it's really legacy ๐ฆ
Ah gotcha
Is there a way to migrate this object to the payment_method field?
if its possible, we'll make sure not to do this again in the future
You can update the Customer and set invoice_settings[default_payment_method]: 'card_123' if you do that it will use the right integration path
so maybe your code should listen for Customer related Events like customer.created and customer.updated so that whenever a new "card" gets attached in the Dashboard you can see default_source: 'card_123' on that Customer (old and legacy but what the Dashboard does) and the go and immediately update the parameter I mentioned above to fix it
Hmm gotcha, that would fix it for future invoices created on the Customer right?
Is there a way to fix this on the existing invoice?
What do you mean by fix, specifically?
For already paid invoices, there's nothing you can change
You'll need to check both payment_method and source
Gotcha, hmm
We're using the go SDK and the source field doesn't exist in the generated struct types at all, so I was hoping we could somehow migrate the existing invoice to the payment_method field
Gotcha, that makes it a little harder because yes it's been deprecated
But you can access that field from the raw response data
Unfortunately I think it'll be a huge lift to pipe the raw response through to all the places we're accessing the invoice struct type, but we'll find another workaround
thanks for the explanation, appreciate the help ๐
pi, _ := paymentintent.Get("pi_123", nil)
var rawData map[string]interface{}
_ = json.Unmarshal(pi.LastResponse.RawJSON, &rawData)
rawData["source"] // might need to be cast
We provide LastResponse.RawJSON so you should be able to traverse that as needed, the above is just an example
NP!