Skip to content

TeamSushiSui/payfrica-backend-new

Repository files navigation

Endpoints for Payfrica still under review

1. Verify Transaction

  • Method: POST
  • URL: /convert/verify
  • Request Body:
    {
      "transactionId": "string",
      "walletAddress": "string"
    }
  • Response:
    • Success (200):
      {
        "message": "success",
        "transactionId": "string",
        "amountPaid": "number",
        "amountSent": "number",
        "walletAddress": "string"
      }
    • Error (400):
      {
        "message": "Transaction ID {transactionId} is not valid"
      }
    • Error (500):
      {
        "message": "Please contact customer service with the ID {transactionId}"
      }

2. Create Card

  • Method: POST
  • URL: /pay/createCard
  • Request Body:
    {
      "password": "string",
      "walletAddress": "string"
    }
  • Response:
    • Success (200):
      {
        "encrypted_mnemonic": "string",
        "walletAddressPublicKey": "string"
      }
    • Error (500):
      {
        "message": "create wallet failed"
      }

3. Buy Amount

  • Method: POST
  • URL: /convert/mockBuy
  • Request Body:
    {
      "amount": "number"
    }
  • Response:
    • Success (200):
      {
        "message": "success",
        "transactionId": "string"
      }
    • Error (500):
      {
        "message": "Can't mock pay at the moment"
      }

4. Decrypt Keyphrase

  • Method: POST
  • URL: /pay/decryptKey
  • Request Body:
    {
      "encryptedData": "string",
      "password": "string",
      "amount": "number",
      "walletAddress": "string",
      "recipientAddress": "string"
    }
  • Response:
    • Success (200):
      {
        "message": "Decryption successful",
        "result": "any"
      }
    • Error (400):
      {
        "errors": [
          {
            "msg": "encryptedData is required",
            "param": "encryptedData"
          },
          {
            "msg": "password is required",
            "param": "password"
          },
          {
            "msg": "amount must be a number",
            "param": "amount"
          },
          {
            "msg": "walletAddress is required",
            "param": "walletAddress"
          },
          {
            "msg": "recipientAddress is required",
            "param": "recipientAddress"
          }
        ]
      }
    • Error (500):
      {
        "message": "Decryption failed"
      }

5. Get Naira to USD Rate

  • Method: GET
  • URL: /convert
  • Response:
    • Success (200):
      {
        "usd": "number"
      }
    • Error (500):
      {
        "message": "Could not get current rate"
      }

Notes

  • Ensure that the server is running on the specified base URL before making requests.
  • All endpoints require proper validation of input data.
  • Error messages may vary based on the implementation and error handling in the codebase.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published