473,320 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

secure post with PHP and curl (to Paypal IPN)

HI

I have 2 problems, 1 of which is tied to PHP and 1 loosely tied, so
I'll put this out there.

Got a problem that I have been working on for a while now which
involves implementing the Paypal IPN. I am using PHP 4 to automatically
post back to Paypal and I am using curl package.

I am doing a Custom request and would like to know if anyone has
successfully posted data back to paypal with curl and got something
other than INVALID back. I am always getting INVALID!! :(

I am doign EVRYTHING they tell me to.. ie ordering the parameters and
adding the cmd=_notify-validate

I guess I have 2 questions:

1. Am I using curl properly with this paypal interface or is there
something I am not setting.
2. Has anyone a working version with HTTPS/curl/paypal. I am using the
https://www.eliteweaver.co.uk/testing/ipntest.php to test this.

The code is as follows:

// put all POST variables received from Paypal back into a URL $post =
array();

foreach ($this->paypal_post_vars as $field => $value) {
array_push($post,$field."=".rawurlencode(stripslas hes($value)));
}

array_push($post,"cmd=_notify-validate");
$uri = implode("&",$post);
$ch=curl_init();
$this->error_out($uri);

curl_setopt($ch, CURLOPT_URL, $this->url_string);
curl_setopt($ch, CURLOPT_HEADER, 0);
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, $uri);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);

$this->paypal_response = curl_exec($ch);
$this->error_response = curl_error($ch);
curl_close($ch);

$this->error_out($this->paypal_response);

Sep 20 '05 #1
0 2871

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Adam King | last post by:
Hey, I'm trying to set-up a PayPal Instant Payment Notification backend to a site. The problem is that I cannot post back to PayPal using "fsockopen()" since my service provider (1and1.co.uk)...
5
by: Vinod | last post by:
Hi I am having a payment website which needs to be integrated, i am having the following code which is not working fine. I am having the following script and my notifyurl is not working i...
0
by: rgparkins | last post by:
HI I have 2 problems, 1 of which is tied to PHP and 1 loosely tied, so I'll put this out there. Got a problem that I have been working on for a while now which involves implementing the...
1
by: Greg | last post by:
I have code (below) that was working a year ago that I'm trying to use again and it's now not working. The response is always invalid. Anyone know why? Code: Function GetPayPal() As Boolean...
2
by: #2pencil | last post by:
After some google'n & looking through some PayPal pdfs I'm starting a post here. What I'm trying to find is the method of changing (upgrading or downgrading) members subscription services...
2
by: t0m66 | last post by:
I've got a setup for my online game for upgraded accounts. However, I'm unable to communicate with Paypal's IPN sandbox server. Does anyone have any experience with Paypal's IPN and, if so, can...
2
by: adamjblakey | last post by:
Hi, I have just signed up to paypal pro payments and want to get this set-up on my site. What i want to do is have a form where the customer can fill in their credit card details and when the...
1
by: vjayis | last post by:
Hi i m a working with paypal to integrate it with my website., users can book the hall regarding time basis. so i m sending the amount to paypal by paynow button created through my paypal...
1
by: Ryje | last post by:
Hey guys, I have a small issue. When i send the hidden form to paypal everything is fine. I have a problem when i will recive the datas via POST and not GET. Since im not a Pro in Paypal i...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.