Showing
4 changed files
with
15 additions
and
5 deletions
... | @@ -358,7 +358,7 @@ WL_VERSION_INTERFACE() | ... | @@ -358,7 +358,7 @@ WL_VERSION_INTERFACE() |
358 | 358 | ||
359 | - (void) redeemCouponSetsWithSuccessBlock:(NSString*) uuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 359 | - (void) redeemCouponSetsWithSuccessBlock:(NSString*) uuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; |
360 | 360 | ||
361 | -- (void) validateCoupoWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 361 | +- (void) validateCouponWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; |
362 | 362 | ||
363 | /*! | 363 | /*! |
364 | @abstract Get the full page add accordint to the display_type of a campaign. | 364 | @abstract Get the full page add accordint to the display_type of a campaign. | ... | ... |
... | @@ -1548,8 +1548,18 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) | ... | @@ -1548,8 +1548,18 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) |
1548 | 1548 | ||
1549 | - (void) getCouponSetsWithSuccessBlock:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure | 1549 | - (void) getCouponSetsWithSuccessBlock:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure |
1550 | { | 1550 | { |
1551 | - NSDictionary *postDictionary = @{@"coupon": @{@"action": @"retrieve_multilingual", @"language": LANG, @"active": active, @"visible": visible, @"language": LANG, @"uuids": uuids}}; | 1551 | + NSMutableDictionary* data = [[NSMutableDictionary alloc] init]; |
1552 | - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:postDictionary options:0 error:NULL]; | 1552 | + |
1553 | + [data setValue:active forKey:@"active"]; | ||
1554 | + [data setValue:@"retrieve_multilingual" forKey:@"action"]; | ||
1555 | + [data setValue:visible forKey:@"visible"]; | ||
1556 | + [data setValue:LANG forKey:@"language"]; | ||
1557 | + if (uuids && [uuids count] > 0) { | ||
1558 | + [data setValue:uuids forKey:@"uuids"]; | ||
1559 | + } | ||
1560 | + NSMutableDictionary* dataCoupons = [[NSMutableDictionary alloc] init]; | ||
1561 | + [dataCoupons setValue:data forKey:@"coupon"]; | ||
1562 | + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dataCoupons options:0 error:NULL]; | ||
1553 | [self sendContext:jsonData successBlock:^(NSDictionary *contextResponse) { | 1563 | [self sendContext:jsonData successBlock:^(NSDictionary *contextResponse) { |
1554 | if (success) { | 1564 | if (success) { |
1555 | success(contextResponse); | 1565 | success(contextResponse); |
... | @@ -1599,7 +1609,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) | ... | @@ -1599,7 +1609,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) |
1599 | }]; | 1609 | }]; |
1600 | } | 1610 | } |
1601 | 1611 | ||
1602 | -- (void) validateCoupoWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure | 1612 | +- (void) validateCouponWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure |
1603 | { | 1613 | { |
1604 | NSDictionary *postDictionary = @{@"coupon": @{@"action": @"validate", @"coupon": coupon}}; | 1614 | NSDictionary *postDictionary = @{@"coupon": @{@"action": @"validate", @"coupon": coupon}}; |
1605 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:postDictionary options:0 error:NULL]; | 1615 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:postDictionary options:0 error:NULL]; | ... | ... |
No preview for this file type
... | @@ -1088,7 +1088,7 @@ NSString *LANG; | ... | @@ -1088,7 +1088,7 @@ NSString *LANG; |
1088 | __block NSDictionary *resp = [NSDictionary alloc]; | 1088 | __block NSDictionary *resp = [NSDictionary alloc]; |
1089 | __block BOOL isRunLoopNested = NO; | 1089 | __block BOOL isRunLoopNested = NO; |
1090 | __block BOOL isOperationCompleted = NO; | 1090 | __block BOOL isOperationCompleted = NO; |
1091 | - [[Warply sharedService] validateCoupoWithSuccessBlock:coupon :^(NSDictionary *response) { | 1091 | + [[Warply sharedService] validateCouponWithSuccessBlock:coupon :^(NSDictionary *response) { |
1092 | resp = response; | 1092 | resp = response; |
1093 | isOperationCompleted = YES; | 1093 | isOperationCompleted = YES; |
1094 | if (isRunLoopNested) { | 1094 | if (isRunLoopNested) { | ... | ... |
-
Please register or login to post a comment