I want to use the following PHP IPN package:
https://github.com/mike182uk/paypal-ipn-listener
Now here is the example code from github:
$request = new PayPal\Ipn\Request\Curl();
$request->secure(true); //dont need to do this as its done by default, just demonstrating configuring the request component
$listener = new PayPal\Ipn\Listener($request);
$listener->setMode('sandbox');
try {
$status = $listener->verifyIpn();
}
catch (Exception $e) {
$error = $e->getMessage();
$status = false;
}
if ($status) {
// verified...
}
else {
// invalid...
$report = $listener->getReport();
}
So since it looks like the request and the listener are executed in the same action, how would this work with routing? I thought you'd set a post or data variable ipn_notification_url to the url where your ipn was at but it looks like if I set it to the same route as this above that it would resend the request?
I just don't see how the initial request is made (thru a form/post?) I'd like it to work with a cart so I'd imagine you'd send it to a route that feeds the cart contents array to the data field to initialize the $request. But with the example above it looks like the ipn listener is in the same route as the initial request?
I'm sorry for the newbness but small examples help noobs along way