Using PayPal IPN with Yii2

You are viewing revision #2 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version.

next (#3) »

I'm using PayPal's script from

https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.php

To create IPN. I'm using Yii2 framework. In my sandbox account I'm trying to test IPN but I'm keep getting error:

We could not send an IPN due to an HTTP error: 400: Bad Request

It is not cookie problem because I tried to use different browsers.

I fixed it by adding:

public $enableCsrfValidation = false;

To my XYZController. It's not safe to do it, but it worked, I'm using different controllers just for IPN, so it's fine. Read more here: [Yii Forum]( http://www.yiiframework.com/forum/index.php/topic/21146-yii-and-paypal-ipn-400-bad-request-via-ipn-simulator/page__gopid__268890#entry268890 " http://www.yiiframework.com/forum/index.php/topic/21146-yii-and-paypal-ipn-400-bad-request-via-ipn-simulator/page__gopid__268890#entry268890")

0 0
1 follower
Viewed: 12 972 times
Version: Unknown (update)
Category: Tips
Written by: darioo
Last updated by: darioo
Created on: Feb 28, 2015
Last updated: 9 years ago
Update Article

Revisions

View all history