API Documentation

1. api/payment.php

Description

This endpoint processes withdrawal transactions by querying specific parameters.

Parameters

ParameterTypeDescription
pub_keyStringThe public key of the account initiating the withdrawal.
sec_keyStringThe secret key for authenticating the withdrawal request.
receiverStringThe identifier of the account or entity receiving the withdrawal using email(payer@example).
amountDecimalThe amount to withdraw.
currencyStringThe currency in which the amount is denominated.
unique_idStringA unique identifier for the transaction to prevent duplicates.

Usage

HTTP Method: GET

POST /api/payment.php HTTP/1.1
Content-Type: application/json

{
  "pub_key": "public_key_value",
  "sec_key": "secret_key_value",
  "receiver": "receiver_id",
  "amount": 100.00,
  "currency": "USD",
  "unique_id": "txn12345"
}

2. api/payint.php

Description

This endpoint queries internal payment details using specific parameters.

Parameters

ParameterTypeDescription
public_keyStringThe public key of the account making the query.
unique_idStringThe unique identifier for the transaction.

Usage

HTTP Method: GET

GET https://donebypay.com/api/payint.php?public_key=public_key_value&unique_id=txn12345 HTTP/1.1

3. payment.php

Description

This webpage interface allows users to initiate payments using specified parameters, with an optional comment for the transaction.

Parameters

ParameterTypeDescription
public_keyStringThe public key of the payer's account.
unique_IDStringA unique identifier for the transaction.
currencyStringThe currency in which the payment is made.
amountDecimalThe amount to be paid.
payerStringThe identifier of the payer's account using email(payer@example.com).
commentString(Optional) A comment or note regarding the transaction.
redirectURLString(Optional) A redirectURL forwards users to a specified web address.

Usage

HTTP Method: GET

GET https://donebypay.com/payment.php?public_key=public_key_value&unique_ID=txn12345¤cy=USD&amount=50.00&payer=payer@example.com&comment=Payment+for+services&redirectURL=https://example.com HTTP/1.1

Error Handling

Common Error Responses

Error CodeMessageDescription
400Invalid ParametersOne or more required parameters are missing or invalid.
401UnauthorizedAuthentication failed due to invalid keys.
404Transaction Not FoundNo transaction found for the given unique_id.
500Internal Server ErrorAn unexpected error occurred on the server.

Best Practices

  1. Always validate the parameters before making requests to the scripts.
  2. Use secure connections (e.g., HTTPS) to protect sensitive data such as pub_key and sec_key.
  3. Implement rate limiting to prevent abuse of the APIs.
  4. Ensure unique values for unique_id to avoid duplicate transactions.