Viincenttt / MollieApi

This project allows you to easily add the Mollie payment provider to your application.
MIT License
150 stars 85 forks source link

Probleem met API key #61

Closed jbosch111 closed 6 years ago

jbosch111 commented 6 years ago

While creating a payment (like in the example) I always get the error: The provided token isn't an oauth token.

Retreiving a list of payment methods works fine.

What could be the issue ?

lgoudriaan commented 6 years ago

Hi,

You probably have filled the testmode field which is only for Oauth tokens like you can see here: https://github.com/Viincenttt/MollieApi/blob/dcd69373f7b054b0490890ec2e039d2841dd5011/Mollie.Api/Client/PaymentClient.cs#L16-L17

You can just leave this property empty.

Viincenttt commented 6 years ago

Hi jbosch,

Did you manage to resolve this issue?

Kind regards, Vincent

jbosch111 commented 6 years ago

Hi Vincent,

Yes that soved my problem ) Sorry for the late reply, I was kinda busy...

Jim

yadavrg commented 2 years ago

Hi,

You probably have filled the testmode field which is only for Oauth tokens like you can see here:

https://github.com/Viincenttt/MollieApi/blob/dcd69373f7b054b0490890ec2e039d2841dd5011/Mollie.Api/Client/PaymentClient.cs#L16-L17

You can just leave this property empty.

This resolves the issue, but it shouldn't work in this way. We should be able to request with testmode paramter as specified in original Mollie document, otherwise it will always return results in Live mode. https://docs.mollie.com/reference/v2/payments-api/get-payment

testmode boolean OPTIONAL

Viincenttt commented 2 years ago

Hi @yadavrg ,

It depends. If you are using a test api key, you do not need to use the testmode parameter at all. All requests you do, will be in test mode. If you are using a oath access token, you do need to use the Testmode property to specify you are using test mode. This is also explained on the Mollie website: https://docs.mollie.com/overview/testing image

I hope this clears things up. I know this part isn't very well documented. I'll try to update the readme.md to make this a bit more clear.

Kind regards, Vincent

yadavrg commented 2 years ago

@Viincenttt got it now, thanks for clarification so quickly.