#Payments and refunds in testmode

1 messages ยท Page 1 of 1 (latest)

vagrant tide
#

I need some additional info about using test mode. What I am trying to do - is to make a payment, and than make a refund in test mode. When I am trying to add "testmode" parameter to create payment, it says, "Non-existent body parameter "testmode" for this API call. And if I try to get that payment, made without that parameter, I receive an another error - "The payment id is invalid", and if I am trying to make a refund on this payment, I receive an error : "The payment is already refunded or has not been paid for yet". I dig inside Mollie npm, and found, that testmode is not required param, but I can't use it. What I am doing wrong?

stray steppe
#

Hey there!

If you are using API keys, you have a separated key for live and test mode ๐Ÿ™‚

vagrant tide
#

Hi Rick, yes, I am using test mode api key

#

So, I cant get a payment info, it says that id is invalid. I tried to create some new payments, and get that info, using payment id from response, but every time it says, that id is invalid. I was thinking, that issue is about using test mode param, becouse I can't find some ways to fix that in docs

stray steppe
#

There's no need to provide a testmode param when using the test API key. Can you try it without?

vagrant tide
#

Yes, I am trying without it, I am getting an error about invalid id. May be I can give you some screenshots or some additional info?

stray steppe
#

Can you share the requests you make (without API key) and the Payment ID which the API returns? ๐Ÿ™‚

vagrant tide
#

Yes, give me a minute

vagrant tide
#

then I am trying to get payment info on that id - tr_4kGzJQ7ckf

stray steppe
#

Hmm, that error message is not the v2 for sure

robust veldt
vagrant tide
#

Hi Joost, I am using node package functionality, but, watching logs, I see, that link I am using looks same as you said

#

Maybe it is npm package troubles?

robust veldt
#

you could try to see if it works with Postman if you call the api directly..

vagrant tide
#

Using postman, I can't make a refund, but I can het a payment info, and from npm I can't get that info, it is strange.

robust veldt
#

can you share some of the code where you try to get the payment info?

vagrant tide
#

Using postman directly - in refund I still get that error

stray steppe
#

Yes, that makes sense since the payment is still open

#

You have to set it as paid first by following the checkoutUrl

vagrant tide
#

So, that is smth like 3d -secure confirmation?

stray steppe
#

No, in testmode you have to choose an endstate, otherwise it remains open (and eventually expire) ๐Ÿ™‚

vagrant tide
#

Yep, I had confirmed payment with "paid" status

stray steppe
#

Cool, then it's refundable

vagrant tide
#

It is interesting for me, why it is working with postman directly, but not with npm

stray steppe
#

Could be something in the package. Feel free to create an issue on GitHub

vagrant tide
#

Okay, thank you. I just want to make payment and refund to create a customer id, and save it , to make recurring payments. Am I doing that right? From docs, I realized that I nedd to do it that way

stray steppe
#

Sorry, I do not understand your question.

brave lichen
#

If I understand it correctly MoonLayt wants to create a mandate for recurring payments. And he tries to do it through creating a 'normal' payment and refund that.

stray steppe
#

Aha! Well, in that case, it's an option. A first payment for a mandate is only required for credit cards. If you want to use SEPA Direct Debit, you can also create mandates yourself via the Mandates API ๐Ÿ™‚

vagrant tide
#

Thank you all, Yes, I am trying to create a mandate for credit card

stray steppe
#

Yes, then a first payment is required.

#

Be aware that you pay fees for the payment and refund