Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
quxiu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
quxiu
Commits
366c49b1
Commit
366c49b1
authored
Apr 23, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
6b5d0298
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
wxpay/pay/jsapi-wx.php
+9
-8
No files found.
wxpay/pay/jsapi-wx.php
View file @
366c49b1
<?php
<?php
ini_set
(
'date.timezone'
,
'Asia/Shanghai'
);
ini_set
(
'date.timezone'
,
'Asia/Shanghai'
);
//error_reporting(E_ERROR);
//error_reporting(E_ERROR);
require_once
"../lib/WxPay.Api.php"
;
require_once
"../lib/WxPay.Api.php"
;
...
@@ -40,6 +40,8 @@ $input->SetTime_start(date("YmdHis"));
...
@@ -40,6 +40,8 @@ $input->SetTime_start(date("YmdHis"));
$input
->
SetTime_expire
(
date
(
"YmdHis"
,
time
()
+
600
));
$input
->
SetTime_expire
(
date
(
"YmdHis"
,
time
()
+
600
));
$input
->
SetGoods_tag
(
$uid
);
$input
->
SetGoods_tag
(
$uid
);
$input
->
SetNotify_url
(
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/wxpay/pay/notify_jsapi.php'
);
$input
->
SetNotify_url
(
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/wxpay/pay/notify_jsapi.php'
);
echo
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/wxpay/pay/notify_jsapi.php'
;
die
;
$input
->
SetTrade_type
(
"JSAPI"
);
$input
->
SetTrade_type
(
"JSAPI"
);
$input
->
SetOpenid
(
$openId
);
$input
->
SetOpenid
(
$openId
);
$order
=
WxPayApi
::
unifiedOrder
(
$input
);
$order
=
WxPayApi
::
unifiedOrder
(
$input
);
...
@@ -61,7 +63,7 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
...
@@ -61,7 +63,7 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
<html>
<html>
<head>
<head>
<meta
http-equiv=
"content-type"
content=
"text/html;charset=utf-8"
/>
<meta
http-equiv=
"content-type"
content=
"text/html;charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<title>
微信支付
</title>
<title>
微信支付
</title>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
//调用微信JS api 支付
//调用微信JS api 支付
...
@@ -84,7 +86,7 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
...
@@ -84,7 +86,7 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
window
.
history
.
go
(
-
1
);
window
.
history
.
go
(
-
1
);
},
2000
);
},
2000
);
}
}
}
}
);
);
}
}
...
@@ -95,7 +97,7 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
...
@@ -95,7 +97,7 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
if
(
document
.
addEventListener
){
if
(
document
.
addEventListener
){
document
.
addEventListener
(
'WeixinJSBridgeReady'
,
jsApiCall
,
false
);
document
.
addEventListener
(
'WeixinJSBridgeReady'
,
jsApiCall
,
false
);
}
else
if
(
document
.
attachEvent
){
}
else
if
(
document
.
attachEvent
){
document
.
attachEvent
(
'WeixinJSBridgeReady'
,
jsApiCall
);
document
.
attachEvent
(
'WeixinJSBridgeReady'
,
jsApiCall
);
document
.
attachEvent
(
'onWeixinJSBridgeReady'
,
jsApiCall
);
document
.
attachEvent
(
'onWeixinJSBridgeReady'
,
jsApiCall
);
}
}
}
else
{
}
else
{
...
@@ -112,9 +114,9 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
...
@@ -112,9 +114,9 @@ $jsApiParameters = $tools->GetJsApiParameters($order);
<div
style=
"color: #000;text-align: center;font-weight: bold;line-height:50px;font-size:40px;"
>
<div
style=
"color: #000;text-align: center;font-weight: bold;line-height:50px;font-size:40px;"
>
¥
<?php
echo
$money
;
?>
¥
<?php
echo
$money
;
?>
</div>
</div>
<div
align=
"center"
>
<div
align=
"center"
>
<button
style=
"width:210px; height:50px; border-radius: 5px;background-color:#1aad19; border:0px #179e16 solid; cursor: pointer; color:white; font-size:16px;"
type=
"button"
onclick=
"callpay()"
>
立即支付
</button>
<button
style=
"width:210px; height:50px; border-radius: 5px;background-color:#1aad19; border:0px #179e16 solid; cursor: pointer; color:white; font-size:16px;"
type=
"button"
onclick=
"callpay()"
>
立即支付
</button>
</div>
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment