|
|
@@ -9,6 +9,7 @@ use yii\web\Controller; |
|
|
|
use yii\web\NotFoundHttpException; |
|
|
|
use yii\filters\VerbFilter; |
|
|
|
use common\models\User; |
|
|
|
use common\models\Etablissement; |
|
|
|
use c006\paypal_ipn\PayPal_Ipn; |
|
|
|
|
|
|
|
/** |
|
|
@@ -92,14 +93,6 @@ class PaiementController extends Controller |
|
|
|
$custom = $ipn->getKeyValue('custom'); |
|
|
|
$txn_type = $ipn->getKeyValue('txn_type'); |
|
|
|
|
|
|
|
/*$message = '' ; |
|
|
|
|
|
|
|
foreach($_POST as $key => $val) { |
|
|
|
$message .= $key.' : '.$val."\n" ; |
|
|
|
} |
|
|
|
|
|
|
|
mail('guillaume.bourgeois13@laposte.net','Données IPN', $message) ;*/ |
|
|
|
|
|
|
|
if($txn_type == 'subscr_payment' && $custom) |
|
|
|
{ |
|
|
|
$user = User::findOne($custom) ; |
|
|
@@ -108,13 +101,7 @@ class PaiementController extends Controller |
|
|
|
$etablissement = Etablissement::findOne($user->id_etablissement) ; |
|
|
|
if($etablissement) |
|
|
|
{ |
|
|
|
$date = $etablissement->date_paiement ; |
|
|
|
if(!$date) $date = time() ; |
|
|
|
else $date = strtotime($date) ; |
|
|
|
|
|
|
|
$date += 30*24*60*60 ; |
|
|
|
|
|
|
|
$etablissement->date_paiement = date('Y-m-d H:i:s',$date) ; |
|
|
|
$etablissement->date_paiement = date('Y-m-d H:i:s',time()) ; |
|
|
|
$etablissement->save() ; |
|
|
|
} |
|
|
|
} |