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?
#Payments and refunds in testmode
1 messages ยท Page 1 of 1 (latest)
Hey there!
If you are using API keys, you have a separated key for live and test mode ๐
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
There's no need to provide a testmode param when using the test API key. Can you try it without?
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?
Can you share the requests you make (without API key) and the Payment ID which the API returns? ๐
Yes, give me a minute
This is the response on method client.payment.create - I think it is using under the hood - https://api.mollie.com/v2/payments - POST
then I am trying to get payment info on that id - tr_4kGzJQ7ckf
and receiving that error. I am using client.payments.get - it is using GET https://api.mollie.com/v2/payments/*id*
And after that, I am trying to make a refund on that payment - using client.paymentRefunds.create - it is using POST https://api.mollie.com/v2/payments/*id*/refunds
Hmm, that error message is not the v2 for sure
Maybe a silly question, but did you change the GET url to https://api.mollie.com/v2/payments/tr_4kGzJQ7ckf
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?
you could try to see if it works with Postman if you call the api directly..
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.
can you share some of the code where you try to get the payment info?
Yes, that makes sense since the payment is still open
You have to set it as paid first by following the checkoutUrl
So, that is smth like 3d -secure confirmation?
No, in testmode you have to choose an endstate, otherwise it remains open (and eventually expire) ๐
See our docs here: https://docs.mollie.com/overview/testing
Yep, I had confirmed payment with "paid" status
Cool, then it's refundable
It is interesting for me, why it is working with postman directly, but not with npm
Could be something in the package. Feel free to create an issue on GitHub
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
Sorry, I do not understand your question.
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.
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 ๐
Thank you all, Yes, I am trying to create a mandate for credit card