API

Pay2.House

API कुंजी बनाएँ

API कुंजी बनाने के लिए, लिंक पर जाएँ: https://pay2.house/keys/prepare

अनुरोधों का प्राधिकरण

Pay2.House API अनुरोधों को अधिकृत करने के लिए JSON Web Tokens (JWT) का उपयोग करता है।

JSON Web Tokens (JWT) के बारे में अधिक जानकारी के लिए, JWT टोकन गाइड पढ़ने की अनुशंसा की जाती है।

API के साथ काम करने के लिए आपको एक ऐसी लाइब्रेरी इंस्टॉल करनी होगी जो JSON Web Tokens (JWT) जनरेट और प्रोसेस कर सके। निम्न लाइब्रेरी का उपयोग करने की अनुशंसा की जाती है: PHP-JWT

<?php 

    
use Firebase\JWT\JWT;
    use 
Firebase\JWT\Key;
    use 
phpseclib3\Crypt\RSA;


    function 
create_token($data = [])
    {
        
$private_key    = file_get_contents('pay2_test_private.pem');
        
$current_time   = time();

        
$payload = [
            
'iss'   => 'YOUR_KEY_ID', 
            
'iat'   => $current_time,
            
'data'  => $data
        
]; 

        return 
JWT::encode($payload, openssl_pkey_get_private($private_key), 'RS256');
    }

?>

भुगतान बनाएँ

यह API विधि Pay2.House भुगतान सेवा के माध्यम से भुगतान करने के लिए एक नया भुगतान प्रारंभ करने की अनुमति देती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function create_payment($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/create_payment');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'external_number'   => '10001',
        
'amount'            => 1000,
        
'currency_code'     => 'USD',
        
'payment_method'    => 'ALL',
        
'merchant_id'       => 'SN6829106944',
        
'description'       => 'Payment for Merchant.Name',
        
'deadline_seconds'  => 600,
        
'handling_fee'      => 10,
        
'payer_email'       => '[email protected]',
        
'return_url'        => 'https://mysite.com/result',
        
'cancel_url'        => 'https://mysite.com/cancel',
    ]);

    
    
$api_response = create_payment(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['approval_url'])) {
        
header('Location: ' . $api_response['approval_url'], TRUE, 302);
    }

?>

भुगतान जानकारी

यह API विधि Pay2.House भुगतान सिस्टम में आपके भुगतान की जानकारी माँगने की अनुमति देती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function show_payment_details($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/show_payment_details');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'merchant_id'       => 'SN6829106938',
        
'invoice_number'    => 'IN9036982986'
    
]);

    
    
$api_response = show_payment_details(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {
            echo 
'Amount: ' . $api_response['amount'] . '<br />';
            echo 
'Fee: ' . $api_response['handling_fee'] . '<br />';
            echo 
'Currency Code: ' . $api_response['currency_code'] . '<br />';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

ट्रांसफर बनाएँ

यह API विधि Pay2.House सिस्टम में आंतरिक खाते में एक नया ट्रांसफर प्रारंभ करने की अनुमति देती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function transfer_create($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/transfers/create');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'sender_account'    => 'P2U49984694',
        
'recipient_account' => 'P2U93380055',
        
'amount'            => 50,
        
'comment'           => 'Transfer of funds to the client\'s account.'
    
]);

    
    
$api_response = transfer_create(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {
            echo 
'Payment successfully processed.';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

ट्रांसफर जानकारी

यह API विधि ट्रांसफर की विस्तृत जानकारी प्राप्त करने की अनुमति देती है, जिसमें स्थिति, राशि, निष्पादन की तारीख और समय, साथ ही अन्य संबंधित डेटा शामिल हैं।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function transfer_details($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/transfers/details');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'transaction_number' => 'TN4395601712'
    
]);

    
    
$api_response = transfer_details(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {
        
        if (
$api_response['status'] == 'success') {
            
            echo 
'Transaction Number: ' . $api_response['transaction_number'] . '<br />';
            echo 
'Status: ' . $api_response['transaction_status'] . '<br />';
            echo 
'Time Created: ' . $api_response['time_created'] . '<br />';
            echo 
'Date Created: ' . $api_response['date_created'] . '<br />';
            echo 
'Sender Account: ' . $api_response['sender_account'] . '<br />';
            echo 
'Recipient Account: ' . $api_response['recipient_account'] . '<br />';
            echo 
'Amount: ' . $api_response['amount'] . '<br />';
            echo 
'Fee Amount: ' . $api_response['fee_amount'] . '<br />';
            echo 
'Currency Code: ' . $api_response['currency_code'] . '<br />';
            echo 
'Payment Method: ' . $api_response['payment_method'] . '<br />';
            echo 
'Confirm Method:  ' . $api_response['confirm_method'] . '<br />';
            echo 
'Payment Type: ' . $api_response['payment_type'] . '<br />';
            echo 
'Transaction Type: ' . $api_response['transaction_type'] . '<br />';
            echo 
'Comment: ' . $api_response['comment'] . '<br />';
            echo 
'Error Message: ' . $api_response['error_message'] . '<br />';
            
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }

    } else {
        echo 
'Unknown Error';
    }

?>

ट्रांसफर इतिहास

यह API विधि ट्रांज़ैक्शन सूची माँगने की अनुमति देती है, जिसमें सभी किए गए ट्रांसफरों की जानकारी दी जाती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function get_transfers($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/transfers');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'per_page'  => 10,
        
'page'      => 1,
        
'status'    => 'confirmed'
    
]);

    
    
$api_response = get_transfers(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {

            echo 
'Count Transactions: ' . $api_response['count'] . '<br />';
        
            if ( ! empty(
$api_response['transactions'])) {
                foreach(
$api_response['transactions'] AS $item) {
                    echo 
'----------------------------------------';
                    echo 
'Transaction Number: ' . $item['transaction_number'] . '<br />';
                    echo 
'Status: ' . $item['transaction_status'] . '<br />';
                    echo 
'Time Created: ' . $item['time_created'] . '<br />';
                    echo 
'Date Created: ' . $item['date_created'] . '<br />';
                    echo 
'Sender Account: ' . $item['sender_account'] . '<br />';
                    echo 
'Recipient Account: ' . $item['recipient_account'] . '<br />';
                    echo 
'Amount: ' . $item['amount'] . '<br />';
                    echo 
'Fee Amount: ' . $item['fee_amount'] . '<br />';
                    echo 
'Currency Code: ' . $item['currency_code'] . '<br />';
                    echo 
'Payment Method: ' . $item['payment_method'] . '<br />';
                    echo 
'Confirm Method:  ' . $item['confirm_method'] . '<br />';
                    echo 
'Payment Type: ' . $item['payment_type'] . '<br />';
                    echo 
'Transaction Type: ' . $item['transaction_type'] . '<br />';
                    echo 
'Comment: ' . $item['comment'] . '<br />';
                    echo 
'Error Message: ' . $item['error_message'] . '<br />';
                    echo 
'----------------------------------------';
                    echo 
'<br />';
                }
            } else {
                echo 
'No Transactions Found.';
            }
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

खातों की सूची प्राप्त करें

यह API विधि Pay2.House सिस्टम में आपके अकाउंट से जुड़े सभी खातों की सूची माँगने की अनुमति देती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function get_wallets($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/wallets');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'delete_flag'   => 0,
        
'currency_code' => 'USD'
    
]);

    
    
$api_response = get_wallets(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {

            echo 
'Count Wallets: ' . $api_response['count'] . '<br />';
        
            if ( ! empty(
$api_response['wallets'])) {
                foreach(
$api_response['wallets'] AS $item) {
                    echo 
'----------------------------------------';
                    echo 
'Account Number: ' . $item['account_number'] . '<br />';
                    echo 
'Name: ' . $item['name'] . '<br />';
                    echo 
'Time Created: ' . $item['time_created'] . '<br />';
                    echo 
'Date Created: ' . $item['date_created'] . '<br />';
                    echo 
'Balance: ' . $item['balance'] . '<br />';
                    echo 
'Bonus: ' . $item['bonus'] . '<br />';
                    echo 
'Currency Code: ' . $item['currency_code'] . '<br />';
                    echo 
'Currency Symbol: ' . $item['currency_symbol'] . '<br />';
                    echo 
'Address TRC20: ' . $item['trc20_address'] . '<br />';
                    echo 
'----------------------------------------';
                    echo 
'<br />';
                }
            } else {
                echo 
'No Wallets Found.';
            }
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

खाता बनाएँ

यह API विधि अद्वितीय खाते बनाने की अनुमति देती है, जिन्हें Pay2.House सिस्टम के भीतर भुगतान और ट्रांज़ैक्शन के लिए उपयोग किया जा सकता है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function wallet_create($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/wallets/create');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'name'          => 'Your Wallet Name',
        
'currency_code' => 'USD'
    
]);

    
    
$api_response = wallet_create(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {
            echo 
'Wallet created successfully.';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

खाता जानकारी

यह API विधि Pay2.House भुगतान सिस्टम में आपके खाते की जानकारी माँगने की अनुमति देती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function wallet_details($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/wallets/details');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'account_number' => 'P2U49984694'
    
]);

    
    
$api_response = wallet_details(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {
        
        if (
$api_response['status'] == 'success') {
            echo 
'Account Number: ' . $api_response['account_number'] . '<br />';
            echo 
'Name: ' . $api_response['name'] . '<br />';
            echo 
'Time Created: ' . $api_response['time_created'] . '<br />';
            echo 
'Date Created: ' . $api_response['date_created'] . '<br />';
            echo 
'Balance: ' . $api_response['balance'] . '<br />';
            echo 
'Bonus: ' . $api_response['bonus'] . '<br />';
            echo 
'Currency Code: ' . $api_response['currency_code'] . '<br />';
            echo 
'Currency Symbol: ' . $api_response['currency_symbol'] . '<br />';
            echo 
'Address TRC20: ' . $api_response['trc20_address'] . '<br />';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }

    } else {
        echo 
'Unknown Error';
    }

?>

खाता स्टेटमेंट प्राप्त करें

यह API विधि चयनित खाते का विस्तृत statement प्राप्त करने की अनुमति देती है, जिसमें सभी ट्रांज़ैक्शन और बैलेंस बदलावों की जानकारी शामिल होती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function wallet_statement($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/wallets/statement');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'account_number' => 'P2U49984694'
    
]);

    
    
$api_response = wallet_statement(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {
        
        if (
$api_response['status'] == 'success') {
            
header('Location: ' . $api_response['download_url'], TRUE, 302);
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }

    } else {
        echo 
'Unknown Error';
    }

?>

BIN सूची प्राप्त करें

यह API विधि Pay2.House सिस्टम में virtual cards जारी करने के लिए उपलब्ध BIN की सूची प्राप्त करने की अनुमति देती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function cards_bins($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/bins');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'currency_code'     => 'USD',
        
'country_code'      => 'HK',
        
'card_type'         => 'virtual',
        
'card_network'      => 'mastercard',
        
'card_product_type' => 'standard',
    ]);


    
$api_response = cards_bins(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {

            echo 
'Count Bins: ' . $api_response['count'] . '<br />';

            if ( ! empty(
$api_response['bins'])) {
                foreach(
$api_response['bins'] AS $item) {
                    echo 
'BIN: ' . $item['bin'] . '<br />';
                    echo 
'Currency Code: ' . $item['currency_code'] . '<br />';
                    echo 
'Country Code: ' . $item['country_code'] . '<br />';
                    echo 
'Card Type: ' . $item['card_type'] . '<br />';
                    echo 
'Card Network: ' . $item['card_network'] . '<br />';
                    echo 
'Card Product Type: ' . $item['card_product_type'] . '<br />';
                    echo 
'Card Tier: ' . $item['card_tier'] . '<br />';
                    echo 
'3DS Support: ' . $item['is_3ds_supported'] . '<br />';
                    echo 
'Verification Required: ' . $item['verification_required'] . '<br />';
                    echo 
'----------------------------------------';
                    echo 
'<br />';
                }
            } else {
                echo 
'No Bins Found.';
            }

        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्डों की सूची प्राप्त करें

यह API विधि Pay2.House सिस्टम में आपके अकाउंट पर जारी virtual cards की सूची माँगने की अनुमति देती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function get_cards($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'per_page'  => 10,
        
'page'      => 1,
        
'status'    => 'active'
    
]);

    
    
$api_response = get_cards(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {

            echo 
'Count Cards: ' . $api_response['count'] . '<br />';
        
            if ( ! empty(
$api_response['cards'])) {
                foreach(
$api_response['cards'] AS $item) {
                    echo 
'----------------------------------------';
                    echo 
'Card Name: ' . $item['card_name'] . '<br />';
                    echo 
'Card Number: ' . $item['card_number'] . '<br />';
                    echo 
'Card ID: ' . $item['card_id'] . '<br />';
                    echo 
'CVV: ' . $item['cvv'] . '<br />';
                    echo 
'Expire Date: ' . $item['expiration_date'] . '<br />';
                    echo 
'3DS Password: ' . $item['password'] . '<br />';
                    echo 
'Currency Code: ' . $item['currency_code'] . '<br />';
                    echo 
'Currency Symbol: ' . $item['currency_symbol'] . '<br />';
                    echo 
'Time Created: ' . $item['time_created'] . '<br />';
                    echo 
'Date Created: ' . $item['date_created'] . '<br />';
                    echo 
'Time Renewal: ' . $item['time_renewal'] . '<br />';
                    echo 
'Date Renewal: ' . $item['date_renewal'] . '<br />';
                    echo 
'Email: ' . $item['email'] . '<br />';
                    echo 
'Phone Number: ' . $item['phone_number'] . '<br />';
                    echo 
'Address Line 1: ' . $item['address_line_1'] . '<br />';
                    echo 
'City: ' . $item['city'] . '<br />';
                    echo 
'Country Code: ' . $item['country_code'] . '<br />';
                    echo 
'Post Code: ' . $item['post_code'] . '<br />';
                    echo 
'First Name: ' . $item['first_name'] . '<br />';
                    echo 
'Last Name: ' . $item['last_name'] . '<br />';
                    echo 
'Sur Name: ' . $item['sur_name'] . '<br />';
                    echo 
'Date Birth: ' . $item['date_birth'] . '<br />';
                    echo 
'Card Status: ' . $item['card_status'] . '<br />';
                    echo 
'Balance: ' . $item['balance'] . '<br />';
                    echo 
'Issuance Cost: ' . $item['issuance_cost'] . '<br />';
                    echo 
'Renewal Cost: ' . $item['renewal_cost'] . '<br />';
                    echo 
'Recharge Cost: ' . $item['recharge_cost'] . '<br />';
                    echo 
'Recharge Type: ' . $item['recharge_type'] . '<br />';
                    echo 
'Account Refund Cost: ' . $item['account_refund_cost'] . '<br />';
                    echo 
'Account Refund Type: ' . $item['account_refund_type'] . '<br />';
                    echo 
'Refund Min Amount: ' . $item['refund_min_amount'] . '<br />';
                    echo 
'Min Recharge Amount: ' . $item['min_recharge_amount'] . '<br />';
                    echo 
'Max Recharge Amount: ' . $item['max_recharge_amount'] . '<br />';
                    echo 
'Block Status: ' . $item['block_status'] . '<br />';
                    echo 
'Time Blocked: ' . $item['time_blocked'] . '<br />';
                    echo 
'Date Blocked: ' . $item['date_blocked'] . '<br />';
                    echo 
'----------------------------------------';
                    echo 
'<br />';
                }
            } else {
                echo 
'No Cards Found.';
            }
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड जारी करें

यह API विधि Pay2.House सिस्टम में नया virtual card जारी करने की अनुमति देती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function card_issue($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/issue');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'account_number'    => 'P2U48633413',
        
'first_name'        => 'John',
        
'last_name'         => 'Doe',
        
'sur_name'          => 'Smith',
        
'date_birth'        => '01.01.1991',
        
'phone_number'      => '+380990000000',
        
'address'           => 'Kyiv, Ukraine',
        
'city'              => 'Kyiv',
        
'region'            => 'Kyiv',
        
'country_code'      => 'UA',
        
'post_code'         => '01001',
        
'email'             => '[email protected]',
        
'bin_number'        => '1122334455667788',
    ]);

    
    
$api_response = card_issue(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {
            echo 
'Card Number: ' . $api_response['card_number'] . '<br />';
            echo 
'Card ID: ' . $api_response['card_id'] . '<br />';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड जानकारी

यह API विधि virtual card की विस्तृत जानकारी प्राप्त करने की अनुमति देती है, जिसमें कार्ड नंबर, status, issue date और अन्य संबंधित डेटा शामिल है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function card_details($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/details');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'card_id' => 'VC7914059264'
    
]);

    
    
$api_response = card_details(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {
            echo 
'Card Name: ' . $api_response['card_name'] . '<br />';
            echo 
'Card Number: ' . $api_response['card_number'] . '<br />';
            echo 
'Card ID: ' . $api_response['card_id'] . '<br />';
            echo 
'CVV: ' . $api_response['cvv'] . '<br />';
            echo 
'Expire Date: ' . $api_response['expiration_date'] . '<br />';
            echo 
'3DS Password: ' . $api_response['password'] . '<br />';
            echo 
'Currency Code: ' . $api_response['currency_code'] . '<br />';
            echo 
'Currency Symbol: ' . $api_response['currency_symbol'] . '<br />';
            echo 
'Time Created: ' . $api_response['time_created'] . '<br />';
            echo 
'Date Created: ' . $api_response['date_created'] . '<br />';
            echo 
'Time Renewal: ' . $api_response['time_renewal'] . '<br />';
            echo 
'Date Renewal: ' . $api_response['date_renewal'] . '<br />';
            echo 
'Email: ' . $api_response['email'] . '<br />';
            echo 
'Phone Number: ' . $api_response['phone_number'] . '<br />';
            echo 
'Address Line 1: ' . $api_response['address_line_1'] . '<br />';
            echo 
'City: ' . $api_response['city'] . '<br />';
            echo 
'Country Code: ' . $api_response['country_code'] . '<br />';
            echo 
'Post Code: ' . $api_response['post_code'] . '<br />';
            echo 
'First Name: ' . $api_response['first_name'] . '<br />';
            echo 
'Last Name: ' . $api_response['last_name'] . '<br />';
            echo 
'Sur Name: ' . $api_response['sur_name'] . '<br />';
            echo 
'Date Birth: ' . $api_response['date_birth'] . '<br />';
            echo 
'Card Status: ' . $api_response['card_status'] . '<br />';
            echo 
'Balance: ' . $api_response['balance'] . '<br />';
            echo 
'Issuance Cost: ' . $api_response['issuance_cost'] . '<br />';
            echo 
'Renewal Cost: ' . $api_response['renewal_cost'] . '<br />';
            echo 
'Recharge Cost: ' . $api_response['recharge_cost'] . '<br />';
            echo 
'Recharge Type: ' . $api_response['recharge_type'] . '<br />';
            echo 
'Account Refund Cost: ' . $api_response['account_refund_cost'] . '<br />';
            echo 
'Account Refund Type: ' . $api_response['account_refund_type'] . '<br />';
            echo 
'Refund Min Amount: ' . $api_response['refund_min_amount'] . '<br />';
            echo 
'Min Recharge Amount: ' . $api_response['min_recharge_amount'] . '<br />';
            echo 
'Max Recharge Amount: ' . $api_response['max_recharge_amount'] . '<br />';
            echo 
'Block Status: ' . $api_response['block_status'] . '<br />';
            echo 
'Time Blocked: ' . $api_response['time_blocked'] . '<br />';
            echo 
'Date Blocked: ' . $api_response['date_blocked'] . '<br />';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड का नाम बदलें

यह API विधि Pay2.House सिस्टम में वर्चुअल कार्ड का नाम बदलने की अनुमति देती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function card_rename($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/rename');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'card_id' => 'VC7914059264',
        
'name'    => 'New Card Name'
    
]);

    
    
$api_response = card_rename(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {
            echo 
'Card Name: ' . $api_response['card_name'] . '<br />';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड टॉप-अप

यह API विधि आपके आंतरिक खाते का उपयोग करके virtual card balance top up करने की अनुमति देती है।

टॉप-अप अनुरोध बनाने के 2-3 मिनट के भीतर funds कार्ड पर credited हो जाएँगे।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function card_top_up($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/top_up');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'card_id'           => 'VC7914059264',
        
'account_number'    => 'P2U48633413',
        
'amount'            => 50
    
]);

    
    
$api_response = card_top_up(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {
        
        if (
$api_response['status'] == 'success') {
            echo 
'Transaction Number: ' . $api_response['transaction_number'] . '<br />';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड से धनवापसी

यह API विधि virtual card से आपके आंतरिक खाते में धनवापसी शुरू करने की अनुमति देती है।

धन उसी खाते में वापस किया जाता है जिससे कार्ड जारी किया गया था।

आपको कार्ड tariffs के अनुसार refund fee काटकर राशि प्राप्त होगी।

उदाहरण के लिए, यदि आप $10 की धनवापसी करते हैं और refund fee 3% है, तो $10 × 3% = $0.30 शुल्क के रूप में काटा जाएगा और आपके खाते में $9.70 जमा होगा।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function card_refund($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/refund');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'card_id'   => 'VC7914059264',
        
'amount'    => 10
    
]);

    
    
$api_response = card_refund(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {
            echo 
'Transaction Number: ' . $api_response['transaction_number'] . '<br />';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड संचालन इतिहास

यह API विधि आपके virtual card के साथ की गई सभी operations की पूरी सूची तक पहुँच प्रदान करती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function cards_history($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/history');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'card_id'   => 'VC7914059264',
        
'per_page'  => 10,
        
'page'      => 3
    
]);

    
    
$api_response = cards_history(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {

            echo 
'Count Transactions: ' . $api_response['count'] . '<br />';
        
            if ( ! empty(
$api_response['transactions'])) {
                foreach(
$api_response['transactions'] AS $item) {
                    echo 
'Transaction Time: ' . $item['transaction_time'] . '<br />';
                    echo 
'Transaction Number: ' . $item['transaction_number'] . '<br />';
                    echo 
'Status: ' . $item['status'] . '<br />';
                    echo 
'Type: ' . $item['type'] . '<br />';
                    echo 
'Transaction Amount: ' . $item['transaction_amount'] . '<br />';
                    echo 
'Transaction Currency Code: ' . $item['transaction_currency_code'] . '<br />';
                    echo 
'Account Amount: ' . $item['account_amount'] . '<br />';
                    echo 
'Account Currency Code: ' . $item['account_currency_code'] . '<br />';
                    echo 
'Merchant Name: ' . $item['merchant_name'] . '<br />';
                    echo 
'Merchant Url: ' . $item['merchant_url'] . '<br />';
                    echo 
'Merchant Domain: ' . $item['merchant_domain'] . '<br />';
                    echo 
'Merchant Icon Url: ' . $item['merchant_icon_url'] . '<br />';
                    echo 
'Error Message: ' . $item['error_message'] . '<br />';
                    echo 
'----------------------------------------';
                    echo 
'<br />';
                }
            } else {
                echo 
'No Transactions Found.';
            }

        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड बैलेंस अपडेट करें

यह API विधि virtual card balance update शुरू करने की अनुमति देती है, जिससे कार्ड पर funds की वर्तमान स्थिति का up-to-date डेटा प्राप्त होता है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function card_balance_refresh($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/balance/refresh');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'card_id' => 'VC7914059264'
    
]);

    
    
$api_response = card_balance_refresh(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {
            echo 
'Card Balance: ' . $api_response['balance'] . '<br />';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड पुष्टि कोड

यह API विधि virtual card operations को authorize करने के लिए आवश्यक confirmation codes की सूची प्राप्त करने की अनुमति देती है।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function card_confirmation_codes($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/confirmation_codes');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'card_id' => 'VC7914059264'
    
]);

    
    
$api_response = card_confirmation_codes(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {
        
        if (
$api_response['status'] == 'success') {

            if ( ! empty(
$api_response['codes'])) {
                foreach(
$api_response['codes'] AS $item) {
                    echo 
'Time Created: ' . $item['time_created'] . '<br />';
                    echo 
'Date Created: ' . $item['date_created'] . '<br />';
                    echo 
'Otp Code: ' . $item['otp_code'] . '<br />';
                    echo 
'----------------------------------------';
                    echo 
'<br />';
                }
            } else {
                echo 
'No Confirmation Codes Found.';
            }

        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड ब्लॉक करें

यह API विधि virtual card को block करने की अनुमति देती है, जिससे उसका आगे उपयोग बंद हो जाता है।

यदि कार्ड balance में funds हैं, तो वे refund tariffs के अनुसार उसी आंतरिक खाते में वापस किए जाएँगे जिससे कार्ड जारी किया गया था।

हालाँकि, यदि fee काटने के बाद refund amount न्यूनतम refund amount से कम है, तो ऐसे funds कार्ड balance से debit कर दिए जाएँगे।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function cards_block($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/block');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'card_id' => 'VC7914059264'
    
]);

    
    
$api_response = cards_block(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {
            echo 
'Card Blocked Successfully.';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड बंद करें

यह API विधि virtual card को close करने की अनुमति देती है, जिससे उसका आगे उपयोग बंद हो जाता है।

यह ध्यान रखना महत्वपूर्ण है कि यदि कार्ड पर funds शेष हैं, तो इस विधि का उपयोग कार्ड बंद करने के लिए नहीं किया जा सकता।

निम्न पते पर POST अनुरोध भेजें:

Response parameters:

<?php 


    
function card_close($request_body = [])
    {
        
$curl = curl_init('https://pay2.house/api/cards/close');
        
curl_setopt($curl, CURLOPT_POST, TRUE);
        
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request_body));
        
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
        
$body = curl_exec($curl);
        
$info = curl_getinfo($curl);

        
curl_close($curl);

        if ( ! empty(
$info['http_code']) && $info['http_code'] === 200) {
            return 
json_decode($body, TRUE);
        }
    }


    
$sign_token = create_token([
        
'card_id' => 'VC7914059264'
    
]);

    
    
$api_response = card_close(['sign_token' => $sign_token, 'api_key' => 'YOUR_API_KEY']);
    if ( ! empty(
$api_response['status'])) {

        if (
$api_response['status'] == 'success') {
            echo 
'Card Closed Successfully.';
        } else {
            echo 
'Error Code: ' . $api_response['code'] . '<br />';
            echo 
'Error Message: ' . $api_response['msg'] . '<br />';
        }
        
    } else {
        echo 
'Unknown Error';
    }

?>

कार्ड ब्लॉकिंग स्थितियाँ

संभावित card blocking statuses और उनके अर्थों का विवरण।

Webhook Events

जैसे ही भुगतान स्थिति "Paid" में बदलती है, Pay2.House आपके merchant के लिए पहले से सेट किए गए Webhook URL पर webhook फ़ॉर्मेट में notifications automatically भेजता है।

हम notification 100 बार भेजेंगे, जब तक हमें HTTP status 200 और response text "OK" प्राप्त नहीं हो जाता।

इसके अलावा, हमारा सिस्टम request header में "Pay2-House-Signature" parameter को unique token के साथ automatically शामिल करता है। आप इस token का उपयोग request की authenticity verify करने के लिए कर सकते हैं।

<?php 

    
// Function for decoding webhook data
    
function decrypt_webhook($data = NULL, $secret_key = NULL) 
    {
        
$decoded_data = base64_decode($data);

        if (
$decoded_data === FALSE) {
            return 
FALSE;
        }

        list(
$iv, $signature, $encrypted_data) = explode('|', $decoded_data);
        
$calculated_signature = hash_hmac('sha256', $iv . '|' . $encrypted_data, $secret_key);

        if (
hash_equals($calculated_signature, $signature)) {
            
$decoded_encrypted_data = openssl_decrypt(
                
base64_decode($encrypted_data), 
                
'AES-256-CBC', 
                
hex2bin(hash('sha256', $secret_key)), 
                
0, 
                
hex2bin(bin2hex(hex2bin($iv)))
            );
            if (
$decoded_encrypted_data !== FALSE) {
                return 
$decoded_encrypted_data;
            }
        }

        return 
FALSE;
    }

    
    
// Retrieving the webhook request body and decoding the JSON
    
$payload_body   = file_get_contents('php://input');
    
$payload_decode = json_decode($payload_body, TRUE);


    
// Checking for the presence of a signature in the request header
    
if ( ! empty($_SERVER['HTTP_PAY2_HOUSE_SIGNATURE'])) {
        
// Decoding webhook data and outputting the decoded data
        
$decrypt_webhook = decrypt_webhook($_SERVER['HTTP_PAY2_HOUSE_SIGNATURE'], 'YOUR_API_KEY');
        if (
$decrypt_webhook !== FALSE) {
            
$webhook_decode = json_decode($decrypt_webhook, TRUE);
        }
    }


    
// Example print of $payload_decode and $webhook_decode
    // Array
    // (
    //     [invoice_number] => IN4063112032
    //     [external_number] => test
    //     [amount] => 10
    //     [handling_fee] => 0
    //     [currency_code] => EUR
    //     [description] => Test Payment for Pay2.House
    //     [status] => paid
    // )


    // Setting HTTP status 200 and terminating the script with the response text "OK"
    
http_response_code(200);
    exit(
'OK');
?>

संभावित त्रुटियाँ

API का उपयोग करते समय होने वाली कुछ संभावित त्रुटियाँ यहाँ दी गई हैं।

वेबसाइट बेहतर बनाने के लिए हम कुकीज़ इस्तेमाल करते हैं। इसका उपयोग जारी रखकर आप हमारी गोपनीयता नीति और सेवा के नियमों से सहमत होते हैं।