PayMe Developers Section

PayMe is modern payment platform with alot of features. Some of this features you can use for your needs. You simple can integrate our payment platform in your website and allow your customers to pay directly to your account.

Merchant Checkout


HTML Integration

This is a simple integration to e-shops, forex, trading platforms, exchangers and etc. Code is based on PHP and HTML.



<?php
$order  = [];
$order['merchant_name']  = 'Example Laravel Shop'; // Your SCI Name
$order['merchant_id'] = '1cb8f76f-0b88-442d-9287-2c967eed6edb'; // Your SCI ID
$order['secret_key'] = 'a3fbdafd-7537-457f-ad9c-670c36522022'; // Your SCI Secret Key
$order['encryption_key'] = 'adf87a6d-0af1-4484-ba19-62d568a21529'; // Your Encryption Key
$order['item_number'] = '1'; // Order ID
$order['item_name'] = 'Order iPhone 14 Pro'; // Order Name
$order['item_price'] = '1300'; // Order Amount
$order['item_currency'] = 'USD'; // Order currency can be USD, EUR, BTC, ETH and etc...

$arHash = [
    $order['merchant_name'],
    $order['item_number'],
    $order['item_price'],
    $order['item_currency'],
    $order['item_name'],
    $order['secret_key']
];

$key = md5($order['encryption_key'].$order['item_number']);

$order['params'] = @urlencode(base64_encode(openssl_encrypt(json_encode($arHash), 'AES-256-CBC', $key, OPENSSL_RAW_DATA)));

$order['sign'] = strtoupper(hash('sha256', implode(':', $arHash)));
?>
<form action="http://paymescript.com/checkout/create" method="POST">
    <input type="hidden" name="merchant_name" value="<?php echo $order['merchant_name']; ?>">
    <input type="hidden" name="merchant_id" value="<?php echo $order['merchant_id']; ?>">
    <input type="hidden" name="item_number" value="<?php echo $order['item_number']; ?>">
    <input type="hidden" name="item_name" value="<?php echo $order['item_name']; ?>">
    <input type="hidden" name="item_price" value="<?php echo $order['item_price']; ?>">
    <input type="hidden" name="item_currency" value="<?php echo $order['item_currency']; ?>">
    <input type="hidden" name="hash_verify" value="<?php echo $order['sign']; ?>">
    <input type="hidden" name="params" value="<?php echo $order['params']; ?>">
    <input type="hidden" name="return_ipn" value="http://yourwebsite.com/ipn.php">
    <input type="hidden" name="return_success" value="http://yourwebsite.com/success.php">
    <input type="hidden" name="return_fail" value="http://yourwebsite.com/fail.php">
    <button type="submit">Pay via PayMe</button>
</form>
                                


IPN Callback

IPN (Instant Payment Notification) will be sent to return_ipn parameter when payment is made successfully.That will inform merchant to update order status.

                                
                                
<?php
if (!in_array($_SERVER['REMOTE_ADDR'], array('13.59.100.205'))) return;

if (isset($_POST['operation_id']) && isset($_POST['verify_sign']))
{
	$secret_key = 'Your secret key';

	$arHash = array(
		$_POST['operation_id'], // Return Payment Transaction ID
		$_POST['operation_date'], // Return Date
		$_POST['operation_pay_date'], // Return Date when payment was made
		$_POST['merchant_id'], // Return API ID
		$_POST['item_number'], // Return Order number
		$_POST['item_price'], // Return Item Amount
		$_POST['item_currency'], // Return Item Currency
		$_POST['item_name'], // Return Item Name
		$_POST['operation_status'] // Return Payment Status
	);

	if (isset($_POST['params']))
	{
		$arHash[] = $_POST['params'];
	}

	$arHash[] = $secret_key;

	$sign_hash = strtoupper(hash('sha256', implode(':', $arHash)));

	if ($_POST['verify_sign'] == $sign_hash && $_POST['operation_status'] == 'success')
	{
		ob_end_clean(); exit($_POST['item_number'].'|success');
	}

	ob_end_clean(); exit($_POST['item_number'].'|error');
}
?>
API


Authentication

Our API is based on CURL queries. Post and Get requests are processed through an authorization token that you can create through your account. Here is a simple curl query to check is your token works. All responses are returned in json format.

GET Request

<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "http://paymescript.com/api/auth",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_POSTFIELDS => "",
    CURLOPT_HTTPHEADER => [
    "Authorization: Bearer bce4af44-e1ea-4cb0-86bd-fab923cbb0ef"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
?>

  • SUCCESS Response
    
    {
        "success": true,
        "message": "Authorized"
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "The bearer token field is required."
            ]
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "Bearer token is not active."
            ]
        }
    }
    


Get Accounts

If you have allowed your token to show your account addresses. This is the request you must send to receive a response from our API with your account addresses.

GET Request

<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "http://paymescript.com/api/get/accounts",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_POSTFIELDS => "",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer bce4af44-e1ea-4cb0-86bd-fab923cbb0ef"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

  • SUCCESS Response
    
    {
        "success": true,
        "accounts": {
            "newwww": {
                "wallet_id": "55fe046f-ae31-4158-9eab-6eda7f4984d5",
                "address": "US22LRVL16832833217872",
                "available_balance": "49218.57",
                "pending_balance": "0",
                "onhold_balance": null,
                "currency": "USD"
            }
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "The bearer token field is required."
            ]
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "Bearer token is not active."
            ]
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "Bearer token no have access to get accounts."
            ]
        }
    }
    


Send Transaction

If you have allowed your token to send transactions from your account. This is the request you must send to receive a response from our API.

POST Request

<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "http://paymescript.com/api/send/transaction",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{
    \n\t\"secret_key\": \"4f601d33-e405-4d6f-9b61-1e9489d6abd9\",
    \n\t\"wallet_id\": \"55fe046f-ae31-4158-9eab-6eda7f4984d5\",
    \n\t\"recipient\": \"US81LRVL16832844436127\",
    \n\t\"amount\": 200,
    \n\t\"description\": \"test\"\n
    }",
    CURLOPT_HTTPHEADER => [
    "Authorization: Bearer bce4af44-e1ea-4cb0-86bd-fab923cbb0ef"
    "Content-Type: application/json"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
?>

  • SUCCESS Response
    
    {
        "success": true,
        "transaction_id": "13a3dbe1-6338-4ec2-9b75-1fdce7998dd6"
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "The bearer token field is required."
            ]
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "Bearer token is not active."
            ]
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "Bearer token no have access to send transaction."
            ]
        }
    }
    


Get Transaction

If you have allowed your token to get transaction details from your account. This is the request you must send to receive a response from our API.

GET Request

<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "http://paymescript.com/api/get/transaction/13a3dbe1-6338-4ec2-9b75-1fdce7998dd6",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_POSTFIELDS => "",
    CURLOPT_HTTPHEADER => [
    "Authorization: Bearer bce4af44-e1ea-4cb0-86bd-fab923cbb0ef"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
?>

  • SUCCESS Response
    
    {
        "success": true,
        "transaction": {
            "id": 3,
            "hash": "13a3dbe1-6338-4ec2-9b75-1fdce7998dd6",
            "type": "send_fiat",
            "add": false,
            "activity": "Send",
            "amount": "200",
            "currency": "USD",
            "from_wallet": "US22LRVL16832833217872",
            "to_wallet": "US81LRVL16832844436127",
            "description": "test",
            "is_crypto": false,
            "icon": "",
            "custom": {
                "fee": "7.00",
                "recipient_name": "username",
                "recipient_email": "[email protected]"
            },
            "status_text": "Completed",
            "status_class": "success",
            "created_at": "2023-05-05T11:08:19.000000Z"
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "The bearer token field is required."
            ]
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "Bearer token is not active."
            ]
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "Bearer token no have access to get transaction."
            ]
        }
    }
    


List Transactions

If you have allowed your token to show your account transactions. This is the request you must send to receive a response from our API with your account addresses.

GET Request

<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "http://paymescript.com/api/list/transactions/-offset-/-limit-",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_POSTFIELDS => "",
    CURLOPT_HTTPHEADER => [
    "Authorization: Bearer bce4af44-e1ea-4cb0-86bd-fab923cbb0ef"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
?>

  • SUCCESS Response
    
    {
        "success": true,
        "transactions": [
            {
                "id": 3,
                "hash": "13a3dbe1-6338-4ec2-9b75-1fdce7998dd6",
                "type": "send_fiat",
                "add": false,
                "activity": "Send",
                "amount": "200",
                "currency": "USD",
                "from_wallet": "US22LRVL16832833217872",
                "to_wallet": "US81LRVL16832844436127",
                "description": "test",
                "is_crypto": false,
                "icon": "",
                "custom": {
                    "fee": "7.00",
                    "recipient_name": "username",
                    "recipient_email": "[email protected]"
                },
                "status_text": "Completed",
                "status_class": "success",
                "created_at": "2023-05-05T11:08:19.000000Z"
            },
            {
                "id": 1,
                "hash": "4086bbd2-30c0-4f18-a309-78749cacfe77",
                "type": "send_fiat",
                "add": false,
                "activity": "Send",
                "amount": "555",
                "currency": "USD",
                "from_wallet": "US22LRVL16832833217872",
                "to_wallet": "US81LRVL16832844436127",
                "description": "15125",
                "is_crypto": false,
                "icon": "",
                "custom": {
                    "fee": "19.43",
                    "recipient_name": "username",
                    "recipient_email": "[email protected]"
                },
                "status_text": "Completed",
                "status_class": "success",
                "created_at": "2023-05-05T11:07:59.000000Z"
            }
        ],
        "offset": 0,
        "limit": 10,
        "on_this_page": 2,
        "total_transactions": 2
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "The bearer token field is required."
            ]
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "Bearer token is not active."
            ]
        }
    }
    
  • ERROR Response
    
    {
        "success": false,
        "message": "The given data was invalid.",
        "errors": {
            "bearer_token": [
                "Bearer token no have access to list transactions."
            ]
        }
    }