1
0
Fork 0
mirror of https://github.com/janickiy/yii2-nomer synced 2025-02-15 03:11:58 +00:00
yii2-nomer/views/pay/success.php
2020-02-05 06:34:26 +03:00

40 lines
No EOL
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/* @var $this \yii\web\View */
use yii\helpers\Html;
use yii\helpers\Url;
$this->title = "Счет успешно пополнен";
$payment = \app\models\Payment::find()->where(["user_id" => \Yii::$app->getUser()->getId()])->orderBy(["id" => SORT_DESC])->one();
?>
<div class="registration">
<div class="cont clfix">
<h2>Счет успешно пополнен</h2>
<button type="button" onclick="location.href='/'" class="inpBtn payBtn">Начать поиск</button>
</div>
</div>
<?php if($payment): ?>
<script>
ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
'id': '<?=$payment->id;?>', // Transaction ID. Required.
'affiliation': '<?=\Yii::$app->name;?>', // Affiliation or store name.
'revenue': '<?=$payment->sum;?>', // Grand Total.
'shipping': '5', // Shipping.
'tax': '0' // Tax.
});
ga('ecommerce:addItem', {
'id': '<?=$payment->id;?>',
'name': 'Пополнение на <?=$payment->sum;?> руб.',
'sku': '<?=$payment->sum;?>',
'category': 'balance',
'price': '<?=$payment->sum;?>',
'quantity': '1',
'currency': 'RUB' // local currency code.
});
ga('ecommerce:send');
</script>
<?php endif; ?>