Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ios1x
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
ios1x
Commits
acbdb5ce
Commit
acbdb5ce
authored
Jun 20, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
4dc523d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
KWMPayUtil.m
iCemarose/Class/Util/KWMPayUtil.m
+14
-6
No files found.
iCemarose/Class/Util/KWMPayUtil.m
View file @
acbdb5ce
...
@@ -32,13 +32,17 @@
...
@@ -32,13 +32,17 @@
+
(
NSDictionary
*
)
wechatPayParameters
:(
BUYCheckout
*
)
checkout
{
+
(
NSDictionary
*
)
wechatPayParameters
:(
BUYCheckout
*
)
checkout
{
//这是测试商店的单,先用来测试
//这是测试商店的单,先用来测试
#if DEBUG
NSString
*
checkout_token
=
@"bfa0423b2b51657098d581a93e78bc00"
;
NSString
*
checkout_token
=
@"bfa0423b2b51657098d581a93e78bc00"
;
NSString
*
total_price
=
@"127.00"
;
NSString
*
total_price
=
@"127.00"
;
//NSString *checkout_token = checkout.token;
//NSString *total_price = [NSString stringWithFormat:@"%.2f",checkout.totalPrice.floatValue];
NSString
*
ip_address
=
@"127.0.0.1"
;
//先写test,后面改成正式的订单描述
//先写test,后面改成正式的订单描述
NSString
*
subject
=
@"test"
;
NSString
*
subject
=
@"test"
;
#else
NSString
*
checkout_token
=
checkout
.
token
;
NSString
*
total_price
=
checkout
.
totalPrice
.
stringValue
;
NSString
*
subject
=
@""
;
#endif
NSString
*
ip_address
=
@"127.0.0.1"
;
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&ip_address=%@&subject=%@&total_price=%@&key=%@"
,
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&ip_address=%@&subject=%@&total_price=%@&key=%@"
,
checkout_token
,
ip_address
,
subject
,
total_price
,
User_Pay_KEY
];
checkout_token
,
ip_address
,
subject
,
total_price
,
User_Pay_KEY
];
NSString
*
base64String
=
[
KWMStringUtil
BASE64
:
before_sign
];
NSString
*
base64String
=
[
KWMStringUtil
BASE64
:
before_sign
];
...
@@ -56,11 +60,15 @@
...
@@ -56,11 +60,15 @@
+
(
NSDictionary
*
)
aliPayParameters
:(
BUYCheckout
*
)
checkout
{
+
(
NSDictionary
*
)
aliPayParameters
:(
BUYCheckout
*
)
checkout
{
//这是测试商店的单,先用来测试
//这是测试商店的单,先用来测试
#if DEBUG
NSString
*
checkout_token
=
@"bfa0423b2b51657098d581a93e78bc00"
;
NSString
*
checkout_token
=
@"bfa0423b2b51657098d581a93e78bc00"
;
NSString
*
total_price
=
@"127.00"
;
NSString
*
total_price
=
@"127.00"
;
//NSString *checkout_token = checkout.token;
//NSString *total_price = [NSString stringWithFormat:@"%.2f",checkout.totalPrice.floatValue];
NSString
*
subject
=
@"test"
;
NSString
*
subject
=
@"test"
;
#else
NSString
*
checkout_token
=
checkout
.
token
;
NSString
*
total_price
=
checkout
.
totalPrice
.
stringValue
;
NSString
*
subject
=
@""
;
#endif
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&subject=%@&total_price=%@&key=%@"
,
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&subject=%@&total_price=%@&key=%@"
,
checkout_token
,
subject
,
total_price
,
User_Pay_KEY
];
checkout_token
,
subject
,
total_price
,
User_Pay_KEY
];
NSString
*
base64String
=
[
KWMStringUtil
BASE64
:
before_sign
];
NSString
*
base64String
=
[
KWMStringUtil
BASE64
:
before_sign
];
...
@@ -83,7 +91,7 @@
...
@@ -83,7 +91,7 @@
request
.
prepayId
=
wechatData
.
prepayid
;
request
.
prepayId
=
wechatData
.
prepayid
;
request
.
package
=
wechatData
.
package
;
request
.
package
=
wechatData
.
package
;
request
.
nonceStr
=
wechatData
.
noncestr
;
request
.
nonceStr
=
wechatData
.
noncestr
;
request
.
timeStamp
=
wechatData
.
timestamp
;
request
.
timeStamp
=
(
UInt32
)
wechatData
.
timestamp
;
request
.
sign
=
wechatData
.
sign
;
request
.
sign
=
wechatData
.
sign
;
[
WXApi
sendReq
:
request
];
[
WXApi
sendReq
:
request
];
}
}
...
...
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