-
Notifications
You must be signed in to change notification settings - Fork 0
Payment Api
Example: /api/v1/loginGetCode/enclotester
Returns: A string code that is valid for 15 minutes to post in this project: https://scratch.mit.edu/projects/277404510/
RUN /api/v1/loginGetCode first
Accepts: json object => {"username": "username being logged in"}
Will return the api key for a user if the user posted the code returned by /api/v1/loginGetCode/:username on the project correctly. If api is called and the code doesnt exist or nobody commented, it will return a json object with an object named newCode containing a new code for the user to post on the project, otherwise if successful it will return an apiKey object containing a string with the apiKey for mattcoin
OnSuccess: json object => {"username": "your-username", "apiKey": "your-api-key"}
OnFail: json object => {"Error": "error-produced", "newCode": "new-code-for-mattcoin-verification-project"}
**Example: ** /api/v1/loginGetCode/EncloTester/myapikey/200
Will return a json object containing a list of a users payment history. For example, if you provide lid with a number like 100, it will get message 100 to message 90 in the json object.
Returns: json object => {"obj": "the-array-with-the-user-payment-history", "dipped": "boolean-that-returns-true-or-false-based-on-if-the-lid-dipped-below-0", "lid": "new-lid"}
**Example: ** /api/v1/loginGetCode/EncloTester/myapikey
Will get basic user data, including balance among other things
Returns: json object => {
"apiKey": "your-api-key",
"balance": "your-balance",
"banned": "boolean-stating-if-youre-banned-or-not",
"chargeBacks": "the-amount-of-times-support-has-taking-money-from-you-for-commiting-a-scam",
"iconLink": "a-link-to-your-user-icon-on-scrath",
"scratchVerified": "boolean-that-returns-if-user-has-used-mattcoin", "securityAnswer": "answer-to-security-question",
"securityQuestion": "a-question-only-you-know-the-answer-to-to-recover-your-mattcoin-account-with-support",
"strikes":"the-amount-of-warnings-given-to-an-account-for-fradulent-activity (3 equals a ban)"
}
Accepts: json object => {"username": "your-username", "topay":"the-user-you-are-paying", "amount": "the-amount-you-are-paying", "message": "the-message-the-payment-will-contain"}
Pays a user, returns an error if the payment is unsuccessful
OnSuccess: json object => {"response": true}
OnFail: json object => {"Error": "error-produced"}
Accepts: json object => {"username": "your-username", "apiKey": "your-api-key"}
Clears a user's payment history.
OnSuccess: json object => {"response": true}
OnFail: json object => {"Error": "error-produced"}
Example: /api/v1/verifyLoginIntegrity/EncloTester/myapikey
Boolean that checks if the api key corresponds with a username
OnSuccess: json object => {"response": true}
OnFail: json object => {"Error": "error-produced"}