samerton / Nameless-Resources

Resources module for NamelessMC v2
MIT License
10 stars 13 forks source link

Question and problem #42

Closed xthomas6428 closed 3 years ago

xthomas6428 commented 3 years ago

Hello, is it normal that modules/Resources/paypal.php will delete everything that has in it after having put the Paypal Client ID and the Paypal Client Secret?

samerton commented 3 years ago

I don't know why that would happen I'm afraid.

You can create the file manually by copying modules/Resources/paypal_default.php and renaming the copy to modules/Resources/paypal.php - then replace {client_id} and {client_secret} near the top of the file accordingly.

Note, the file modules/Resources/paypal_default.php needs to stay, so make sure you copy + rename instead of simply renaming the original.

xthomas6428 commented 3 years ago

Okay, I followed what I said but I always have a mistake when I order a resource Screenshot_33333 Screenshot_4444444 unknown (1)

xthomas6428 commented 3 years ago

So?

samerton commented 3 years ago

Can you remove { and } from around your client ID and secret?

xthomas6428 commented 3 years ago

No there is always the error Screenshot_3

samerton commented 3 years ago

Can you please edit the file modules/Resources/pages/resources/purchase.php in a text editor, delete all code inside and replace with this new code: https://gist.githubusercontent.com/samerton/f92247e925e0a52a71d1d1cdfc4c6f6c/raw/37f3eb495a6d8261698ab2f9550b15219c1e90f9/purchase.php

Then, when you try purchasing a resource, the full error message should appear on screen.

xthomas6428 commented 3 years ago

The Error is : {"error":"invalid_client","error_description":"Client Authentication failed"}1

xthomas6428 commented 3 years ago

Screenshot_2

samerton commented 3 years ago

The client ID and secret are incorrect.

Can you ensure you are using a real client ID and secret, and not the sandbox credentials

xthomas6428 commented 3 years ago

I put his : Screenshot_3

samerton commented 3 years ago

As you can see, they are the sandbox API credentials, which will not work on the live PayPal API environment.

Try to find the area where you can generate credentials for the live API, not the sandbox API.

xthomas6428 commented 3 years ago

That's it ? image

xthomas6428 commented 3 years ago

image

samerton commented 3 years ago

Yes, that looks correct

xthomas6428 commented 3 years ago

Ok thanks i will try

xthomas6428 commented 3 years ago

Okay ! It works, thank you!

samerton commented 3 years ago

No problem - you can revert the contents of the file modules/Resources/pages/resources/purchase.php back to its original code now

xthomas6428 commented 3 years ago

Yes ^^