Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
27c9803e
Y
yii2_fecshop
项目概览
OpenDocCN
/
yii2_fecshop
通知
18
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yii2_fecshop
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
27c9803e
编写于
2月 24, 2017
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fecshop支付成功返回的成功页面部分
上级
f2ff95e1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
99 addition
and
5 deletion
+99
-5
app/appfront/modules/Payment/block/success/Index.php
app/appfront/modules/Payment/block/success/Index.php
+40
-0
app/appfront/modules/Payment/controllers/SuccessController.php
...ppfront/modules/Payment/controllers/SuccessController.php
+28
-0
app/appfront/modules/Payment/controllers/paypal/StandardController.php
...modules/Payment/controllers/paypal/StandardController.php
+1
-3
app/appfront/theme/base/front/payment/success/index.php
app/appfront/theme/base/front/payment/success/index.php
+22
-0
config/services/Payment.php
config/services/Payment.php
+2
-2
services/Order.php
services/Order.php
+6
-0
未找到文件。
app/appfront/modules/Payment/block/success/Index.php
0 → 100644
浏览文件 @
27c9803e
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace
fecshop\app\appfront\modules\Payment\block\success
;
use
Yii
;
use
fec\helpers\CModule
;
use
fec\helpers\CRequest
;
use
yii\base\InvalidValueException
;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class
Index
{
public
function
getLastData
(){
$increment_id
=
Yii
::
$service
->
order
->
getSessionIncrementId
();
$order
=
Yii
::
$service
->
order
->
getInfoByIncrementId
(
$increment_id
);
# 清空购物车。这里针对的是未登录用户进行购物车清空。
Yii
::
$service
->
cart
->
clearCart
();
return
[
'increment_id'
=>
$increment_id
,
'order'
=>
$order
,
];
}
}
\ No newline at end of file
app/appfront/modules/Payment/controllers/SuccessController.php
0 → 100644
浏览文件 @
27c9803e
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace
fecshop\app\appfront\modules\Payment\controllers
;
use
Yii
;
use
fec\helpers\CModule
;
use
fec\helpers\CRequest
;
use
fecshop\app\appfront\modules\AppfrontController
;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class
SuccessController
extends
AppfrontController
{
public
function
actionIndex
(){
$data
=
$this
->
getBlock
()
->
getLastData
();
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
}
\ No newline at end of file
app/appfront/modules/Payment/controllers/paypal/StandardController.php
浏览文件 @
27c9803e
...
...
@@ -27,9 +27,7 @@ class StandardController extends AppfrontController
}
public
function
actionSuccess
(){
}
public
function
actionIpn
(){
Yii
::
$service
->
payment
->
paypal
->
receiveIpn
();
...
...
app/appfront/theme/base/front/payment/success/index.php
0 → 100644
浏览文件 @
27c9803e
<style>
.paypal_success
{
line-height
:
24px
;}
</style>
<div
class=
"main container one-column"
>
<div
class=
"col-main"
>
<div
class=
"paypal_success"
>
<div
class=
"page-title"
>
</div>
<h2
class=
"sub-title"
>
Your order has been received,Thank you for your purchase!
</h2>
<p>
Your order # is:
<?=
$increment_id
?>
.
</p>
<p>
You will receive an order confirmation email with details of your order and a link to track its progress.
</p>
<div
class=
"buttons-set"
>
<button
type=
"button"
class=
"button"
title=
"Continue Shopping"
onclick=
"window.location='
<?=
Yii
::
$service
->
url
->
homeUrl
();
?>
'"
><span><span>
Continue Shopping
</span></span></button>
</div>
<?php
// var_dump($order); ?>
</
div
>
</
div
>
</
div
>
\ No newline at end of file
config/services/Payment.php
浏览文件 @
27c9803e
...
...
@@ -16,7 +16,7 @@ return [
'supplement'
=>
'Off-line Money Payments'
,
# 补充
'style'
=>
'<style></style>'
,
# 补充css
'start_url'
=>
'@homeUrl/payment/checkmoney/start'
,
'success_redirect_url'
=>
'@homeUrl/payment/
checkmoney/
success'
,
'success_redirect_url'
=>
'@homeUrl/payment/success'
,
],
'paypal_standard'
=>
[
'label'
=>
'PayPal Website Payments Standard'
,
...
...
@@ -27,7 +27,7 @@ return [
# 接收IPN消息的页面。
'IPN_url'
=>
'@homeUrl/payment/paypal/standard/ipn'
,
# 在第三方支付成功后,跳转到网站的页面
'success_redirect_url'
=>
'@homeUrl/payment/
paypal/standard/
success'
,
'success_redirect_url'
=>
'@homeUrl/payment/success'
,
# 进入paypal支付页面,点击取消进入网站的页面。
'cancel_url'
=>
'@homeUrl/payment/paypal/standard/cancel'
,
...
...
services/Order.php
浏览文件 @
27c9803e
...
...
@@ -324,6 +324,12 @@ class Order extends Service
$orderModel
->
save
();
Yii
::
$service
->
order
->
item
->
saveOrderItems
(
$cartInfo
[
'products'
],
$order_id
,
$cartInfo
[
'store'
]);
$this
->
setSessionIncrementId
(
$increment_id
);
# 如果是登录用户,那么,在生成订单后,需要清空购物车。
Yii
::
$service
->
cart
->
clearCart
();
# 扣除库存。
# (备注)需要另起一个脚本,用来处理半个小时后,还没有支付的订单,将订单取消,然后将订单里面的产品库存返还。
# 如果是无限库存(没有库存就去采购的方式),那么不需要跑这个脚本,将库存设置的非常大即可。
return
true
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录