Commit 6c19ff05 by lee

u

parent 5a894330
......@@ -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};
......
......@@ -660,6 +660,7 @@
return;
}
if(!result.code || result.code.integerValue != 1000){
NSLog(@"error: %@",result.message);
return;
}
NSString *alipayData = (NSString *)result.message;
......
......@@ -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
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment