#delgesu1745

1 messages · Page 1 of 1 (latest)

prisma socketBOT
neat bramble
#

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

velvet cape
#

So how do I get rid of that object in test mode then?

#

Can I do it through the dashboard?

neat bramble
velvet cape
#

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?

neat bramble
#

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.

velvet cape
#

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.

neat bramble
#

Can you share the request id for attaching the card to the customer object in live mode?

velvet cape
#

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

neat bramble
#

Can you share the request you made in test mode?

velvet cape
#

Actually there is no request. That way for something else. I only see the error.

#

In the logs

neat bramble
#

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.

velvet cape
#

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?

neat bramble
#

yeap

velvet cape
#

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.

neat bramble
#

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

velvet cape
#

Oh where do you see that?

#

Oh shoot that’s the problem!

neat bramble
velvet cape
#

I’m using the test public key

#

I didn’t realize that.

neat bramble
#

"key": "pk_test_

#

No problem, let me know if you run into any issues.

velvet cape
#

Wait was it pktest or rktest?

neat bramble
velvet cape
#

Yeah, some other dev had it hardcoded on the front end instead of using the .env. Ugh.

#

Ok, I think that should fix it. I’ll let you know if I get the same error again after updating the code. Thanks for the help!