473,657 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_va rs as $field => $value) {
array_push($pos t,$field."=".ra wurlencode(stri pslashes($value )));
}

array_push($pos t,"cmd=_notif y-validate");
$uri = implode("&",$po st);
$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_VER IFYHOST, 0);
curl_setopt($ch , CURLOPT_SSL_VER IFYPEER, 0);
curl_setopt($ch , CURLOPT_POST, 1);
curl_setopt($ch , CURLOPT_POSTFIE LDS, $uri);
curl_setopt($ch , CURLOPT_FOLLOWL OCATION, 0);
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
curl_setopt($ch , CURLOPT_TIMEOUT , 30);

$this->paypal_respons e = curl_exec($ch);
$this->error_respon se = curl_error($ch) ;
curl_close($ch) ;

$this->error_out($thi s->paypal_respons e);

Sep 20 '05 #1
0 2901

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

Similar topics

0
2118
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) blocks outgoing HTTP connections because this "binds a port". Does anyone know any workaround at all? Have other people using IPN just used fsockopen? is cURL an option? (I assume not but I have no experience whatsoever
5
4763
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 don't know why can guys please help me up <% if SIGNUP_PRICE > 0 then
0
852
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 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
1
2043
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 Dim myRequest As HttpWebRequest = CType(HttpWebRequest.Create("https://www.paypal.com/cgi-bin/webscr"), HttpWebRequest) Dim strToSend As String
2
1840
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 through the PayPal ipn. What I don't want to do is force them to cancle & resubscribe. Anyone know where this documentation is that I have failed to find? Any help would be appreciated!
2
1748
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 someone help me out? case 'validate': // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value =...
2
1547
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 user clicks pay now then it will check with paypal without going off my site to see if the payment is valid or not. I have seen quite a few classes which i think do this but want to know your opinion on the best way to set this up and also what...
1
4656
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 test account. and i inserted the ipn coding in the notify_url specified.
1
2270
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 want the datas from paypal via POST cause vie GET the browser-address show all information and they can be edited. And i want to write the datas in a database to automaticly activate the account which was payed for.
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7320
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.