Pārlūkot izejas kodu

Système de paiement

Mise en place d'un système de paiement via Paypal.
prodstable
keun pirms 8 gadiem
vecāks
revīzija
491ebcf87a
5 mainītis faili ar 92 papildinājumiem un 0 dzēšanām
  1. +58
    -0
      backend/controllers/PaiementController.php
  2. +8
    -0
      backend/views/paiement/annuler.php
  3. +18
    -0
      backend/views/paiement/index.php
  4. +8
    -0
      backend/views/paiement/succes.php
  5. Binārs
      frontend/web/img/laboulange-paypal.png

+ 58
- 0
backend/controllers/PaiementController.php Parādīt failu

@@ -0,0 +1,58 @@
<?php

namespace backend\controllers;

use Yii;
use yii\filters\AccessControl;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use common\models\User;


/**
* ProduitController implements the CRUD actions for Produit model.
*/
class PaiementController extends Controller
{
var $enableCsrfValidation = false ;
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
],
],
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'],
'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
}
]
],
],
];
}

/**
* Lists all Produit models.
* @return mixed
*/
public function actionIndex()
{

return $this->render('index', [
]);
}
}

+ 8
- 0
backend/views/paiement/annuler.php Parādīt failu

@@ -0,0 +1,8 @@
<?php

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/


+ 18
- 0
backend/views/paiement/index.php Parādīt failu

@@ -0,0 +1,18 @@
<?php

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

?>

<h1>Paiement</h1>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="K96K2WLBSBDSA">
<input type="image" src="https://www.paypalobjects.com/fr_FR/FR/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal, le réflexe sécurité pour payer en ligne">
<img alt="" border="0" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
</form>

+ 8
- 0
backend/views/paiement/succes.php Parādīt failu

@@ -0,0 +1,8 @@
<?php

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/


Binārs
frontend/web/img/laboulange-paypal.png Parādīt failu

Pirms Pēc
Platums: 60  |  Augstums: 60  |  Izmērs: 2.0KB

Notiek ielāde…
Atcelt
Saglabāt