#delgesu1745
1 messages · Page 1 of 1 (latest)
Hi, can you copy and paste the pm_ object id on here so I can further look?
This error is typically surfaced when the object was created in test mode, but you're trying to access that object using your live api key.
You can't mix objects in test or live modes
So how do I get rid of that object in test mode then?
Can I do it through the dashboard?
That appears to be the case. This PaymentMethod, https://dashboard.stripe.com/test/logs/req_cYrNFWdoZcnJ5M was created using your Test API key in test mode. You cannot delete the PaymentMethod object but you can detach it from the custmer, https://stripe.com/docs/api/payment_methods/detach which make it no longer usable.
However, I do not think that is the issue here. You just need to stop making that request where you see this error in live mode using this test mode object.
So that object is a real credit card that I’m using to test that the production side of things is working. So I need to use that card in live mode. Why do you say you don’t think that’s the issue here?
Can you clarify? So if I detach that card it will allow me to use it on the live side?
You can create a Payment Method using your Live Key and then use that in Live mode to process payments.
I'm further looking to your point of being able to use a real card in test mode.
So when I was trying to use that payment method in live mode I was creating a new customer and then capturing that card and storing it as a default card for them.
Can you share the request id for attaching the card to the customer object in live mode?
I don’t see that in the live side!?!?!
I do see a customer create call on the test side though.
The payment method error is on the live side and the test side.
So I’m confused
Can you share the request you made in test mode?
Actually there is no request. That way for something else. I only see the error.
In the logs
You can create a PaymentMethod using your Live mode API key and that real card. Then you can try to make the request to attach it to a customer and charge it in live mode.
Yeah sorry the error is only on the live side
So i think there is no customer created on the live side until the card is captured successfully.
So since I had that card used in test mode it didn’t let my code proceed
Ok, if that’s right then what do i need to do, create a payment method on the live side using that same card?
yeap
But I think that’s what my code was trying to do in the first place
Capture the payment method, then create a customer and attach it to the customer.
That request to create the Payment method was used your pk_test_ key
You'd want to use your Publishable live key
and then capture the payment method using your live secret key
You can see it here, https://dashboard.stripe.com/test/logs/iar_cYrNFWdoZcnJ5M
Wait was it pktest or rktest?
Looks to be a publishable test key, https://stripe.com/docs/keys#obtain-api-keys