Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $tx = $_GET['tx'];
- $ID = $_GET['cm'];
- $amount = $_GET['amt'];
- $currency = $_GET['cc'];
- $identity = '###########################################';
- // Init cURL
- $ch = curl_init();
- // Set request options
- $url = 'https:www.paypal.com/cgi-bin/webscr';
- $fields = array(
- 'cmd' => '_notify-synch',
- 'tx' => $tx,
- 'at' => $identity,
- );
- curl_setopt($ch,CURLOPT_URL, $url);
- curl_setopt($ch,CURLOPT_POST, count($fields));
- curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER, TRUE);
- curl_setopt($ch,CURLOPT_HEADER, FALSE);
- // Execute request and get response and status code
- $response = curl_exec($ch);
- $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- // Close connection
- curl_close($ch);
- if($status == 200 AND strpos($response, 'SUCCESS') === 0)
- {
- wp_redirect(home_url('/account'));
- exit;
- } else {
- wp_redirect(home_url());
- exit;
- }
- $url = 'https:www.paypal.com/cgi-bin/webscr';
- $url = 'https://www.paypal.com/cgi-bin/webscr';
- curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
- curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($fields));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement