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
6c19ff05
Commit
6c19ff05
authored
Jul 05, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
5a894330
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
11 deletions
+6
-11
KWMAPIManager.m
iCemarose/Class/Api/KWMAPIManager.m
+1
-1
KWMBeforePayVC.m
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
+1
-0
KWMPayUtil.m
iCemarose/Class/Util/KWMPayUtil.m
+4
-10
No files found.
iCemarose/Class/Api/KWMAPIManager.m
View file @
6c19ff05
...
...
@@ -677,7 +677,7 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
-
(
NSURLSessionDataTask
*
)
getExchangeRate
:
(
NSDictionary
*
)
parameters
success
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
KWMExchangeRateResult
*
result
))
success
failure
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
NSError
*
error
))
failure
{
NSString
*
apiPath
=
[
NSString
stringWithFormat
:
@"https://%@/app/exchange/rate"
,
Additional
_API_DOMAIN
];
NSString
*
apiPath
=
[
NSString
stringWithFormat
:
@"https://%@/app/exchange/rate"
,
Pay
_API_DOMAIN
];
// NSString *sign = [KWMStringUtil MD5:[KWMStringUtil BASE64:@"currency=EUR&key=bd3f58f5cd3d7a217ac8c8e655ab52f8"]];
// NSLog(@"rate sign: %@",sign);
// NSDictionary *params = @{@"currency":@"EUR",@"sign":sign};
...
...
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
View file @
6c19ff05
...
...
@@ -660,6 +660,7 @@
return
;
}
if
(
!
result
.
code
||
result
.
code
.
integerValue
!=
1000
){
NSLog
(
@"error: %@"
,
result
.
message
);
return
;
}
NSString
*
alipayData
=
(
NSString
*
)
result
.
message
;
...
...
iCemarose/Class/Util/KWMPayUtil.m
View file @
6c19ff05
...
...
@@ -38,23 +38,20 @@
NSString
*
checkout_token
=
checkout
.
token
;
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
//先写test,后面改成正式的订单描述
NSString
*
subject
=
@"test"
;
#else
NSString
*
checkout_token
=
checkout
.
token
;
//需要保留小数点后两位(包括小数点后的.00),以保持与后台一致,从而验证通过
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
NSString
*
subject
=
[
NSString
stringWithFormat
:
@"Cemarose订单-%@"
,
checkout
.
token
];
#endif
NSString
*
ip_address
=
@"127.0.0.1"
;
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&ip_address=%@&
subject=%@&
total_price=%@&key=%@"
,
checkout_token
,
ip_address
,
subject
,
total_price
,
User_Pay_KEY
];
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&ip_address=%@&total_price=%@&key=%@"
,
checkout_token
,
ip_address
,
total_price
,
User_Pay_KEY
];
NSString
*
base64String
=
[
KWMStringUtil
BASE64
:
before_sign
];
NSString
*
sign
=
[
KWMStringUtil
MD5
:
base64String
];
NSDictionary
*
parameters
=
@{
@"ip_address"
:
ip_address
,
@"checkout_token"
:
checkout_token
,
@"subject"
:
subject
,
@"total_price"
:
total_price
,
@"sign"
:
sign
};
...
...
@@ -66,21 +63,18 @@
#if DEBUG
NSString
*
checkout_token
=
checkout
.
token
;
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
NSString
*
subject
=
@"test"
;
#else
NSString
*
checkout_token
=
checkout
.
token
;
//需要保留小数点后两位(包括小数点后的.00),以保持与后台一致,从而验证通过
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
NSString
*
subject
=
[
NSString
stringWithFormat
:
@"Cemarose订单-%@"
,
checkout
.
token
];
#endif
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&
subject=%@&
total_price=%@&key=%@"
,
checkout_token
,
subject
,
total_price
,
User_Pay_KEY
];
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&total_price=%@&key=%@"
,
checkout_token
,
total_price
,
User_Pay_KEY
];
NSString
*
base64String
=
[
KWMStringUtil
BASE64
:
before_sign
];
NSString
*
sign
=
[
KWMStringUtil
MD5
:
base64String
];
NSDictionary
*
parameters
=
@{
@"checkout_token"
:
checkout_token
,
@"subject"
:
subject
,
@"total_price"
:
total_price
,
@"sign"
:
sign
};
...
...
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