Code Docs

ZEENPE: Revolutionizing Payments with Unified UPI and Crypto Solutions

INTIATE EXAMPLES
CURL Example
curl -X POST "https://zeenpe.com/api/payment" \
     -H "Content-Type: application/json" \
     -H "Referer: https://example.com/current/page" \
     -H "Authorization: Bearer 8902e2036d9b88dfc9632ba7b4ccab77" \
     -d '{
           "amount": "100",
           "order_id": "your_dynamic_order_id",
           "currency": "USD",
           "paymentMethod": "all",
           "esign": "your_generated_esign"
         }'

        
PHP Example

MAKE lib.php FILE

 
class INFOZEENPG {
    private $endpointUrl;
    private $authorizationToken;

    public function __construct($endpointUrl, $authorizationToken) {
        $this->endpointUrl = $endpointUrl;
        $this->authorizationToken = $authorizationToken;
    }

    public function initiatePayment($data) {
        $orderId = uniqid();
$data["order_id"]=$orderId;
        $postData = json_encode($data);
        $esign = base64_encode(md5($postData . $this->authorizationToken));
        $data["esign"] = $esign;

        $response = $this->sendRequest($data);
        return $response;
    }

    public function retrieveTransaction($esign) {
        $data = json_encode([
            'esign' => $esign
        ]);

        $response = $this->sendRequest($data, 'POST');
        return $response;
    }

    private function sendRequest($data, $method = 'POST') {
             $url = $this->endpointUrl;
        
$current_url = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

        $ch = curl_init($url);

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        if ($method === 'POST') {
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        } elseif ($method === 'GET') {
            curl_setopt($ch, CURLOPT_HTTPGET, true);
        }

        curl_setopt($ch, CURLOPT_HTTPHEADER, [
            'Authorization: Bearer ' . $this->authorizationToken,
                    'Referer: ' . $current_url,

            'Content-Type: application/json'
        ]);

        $response = curl_exec($ch);

        if (curl_errno($ch)) {
            echo 'Error:' . curl_error($ch);
        } else {
            return $response;
        }

        curl_close($ch);
    }
}
        

INCLUDE lib.php FILE AND MAKE intiate.php FILE

  include "lib.php";
  
 $endpointUrl = "https://zeenpe.com/api/payment";
$authorizationToken = "8902e2036d9b88dfc9632ba7b4ccab77";

$gateway = new INFOZEENPG($endpointUrl, $authorizationToken);


$data = [
"amount" => $amount,
"currency" => $currency,
"paymentMethod" => $paymentMethod
];

$response = $gateway->initiatePayment($data);
echo $response;
        
TRANSACTION EXAMPLES
CURL Example
curl -X POST "https://zeenpe.com/api/transaction" \
     -H "Authorization: Bearer 8902e2036d9b88dfc9632ba7b4ccab77" \
     -H "Content-Type: application/json" \
     -d '{"esign": "NjJkMWM1ODYyYzQzNGY2YmI1MzA2Y2U1MmIyZTkwNDI="}'
        
PHP Example

INCLUDE lib.php FILE AND MAKE verify.php FILE

 include "lib.php";
   
 $endpointUrl = "https://zeenpe.com/api/transaction";
$authorizationToken = "8902e2036d9b88dfc9632ba7b4ccab77";

$gateway = new INFOZEENPG($endpointUrl, $authorizationToken);


$esign = $_GET['esign']; // Replace with actual esign
$response = $gateway->retrieveTransaction($esign);
echo $response;