Horje
ipn listener paypel php Code Example
ipn listener paypel php
   // example for laravel
	public function listener(Request $request)
    {

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'https://ipnpb.sandbox.paypal.com/cgi-bin/webscr');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, "cmd=_notify-validate&" . http_build_query($_POST));
        $response = curl_exec($ch);
        curl_close($ch);


        if ($response == "VERIFIED") {

            $this->payerEmail = $_POST['payer_email'];
            $this->name = $_POST['first_name'] . " " . $_POST['last_name'];
            $this->price = $_POST['mc_gross'];
            $this->currency = $_POST['mc_currency'];
            $this->paymentStatus = $_POST['payment_status'];
            $this->amount = $_POST['quantity'];
            $this->purchase_id = $_POST['txn_id']; 
            //$this->other
            //$this->other1
            if ($this->paymentStatus == "Completed") {
						// code if
            } else {
             
                // code else
            }
        }
    }




Php

Related
wp-config.php define home page Code Example wp-config.php define home page Code Example
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes Code Example SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes Code Example
how to add hour minute seconds in php datetime Code Example how to add hour minute seconds in php datetime Code Example
SQLSTATE[42000]: Syntax error or access violation: 1071 Code Example SQLSTATE[42000]: Syntax error or access violation: 1071 Code Example
merge two objects in php Code Example merge two objects in php Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9