Vasilis

several fixes

......@@ -358,7 +358,7 @@ WL_VERSION_INTERFACE()
- (void) redeemCouponSetsWithSuccessBlock:(NSString*) uuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void) validateCoupoWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void) validateCouponWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
/*!
@abstract Get the full page add accordint to the display_type of a campaign.
......
......@@ -1548,8 +1548,18 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
- (void) getCouponSetsWithSuccessBlock:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
{
NSDictionary *postDictionary = @{@"coupon": @{@"action": @"retrieve_multilingual", @"language": LANG, @"active": active, @"visible": visible, @"language": LANG, @"uuids": uuids}};
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:postDictionary options:0 error:NULL];
NSMutableDictionary* data = [[NSMutableDictionary alloc] init];
[data setValue:active forKey:@"active"];
[data setValue:@"retrieve_multilingual" forKey:@"action"];
[data setValue:visible forKey:@"visible"];
[data setValue:LANG forKey:@"language"];
if (uuids && [uuids count] > 0) {
[data setValue:uuids forKey:@"uuids"];
}
NSMutableDictionary* dataCoupons = [[NSMutableDictionary alloc] init];
[dataCoupons setValue:data forKey:@"coupon"];
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dataCoupons options:0 error:NULL];
[self sendContext:jsonData successBlock:^(NSDictionary *contextResponse) {
if (success) {
success(contextResponse);
......@@ -1599,7 +1609,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}];
}
- (void) validateCoupoWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
- (void) validateCouponWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure
{
NSDictionary *postDictionary = @{@"coupon": @{@"action": @"validate", @"coupon": coupon}};
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:postDictionary options:0 error:NULL];
......
......@@ -1088,7 +1088,7 @@ NSString *LANG;
__block NSDictionary *resp = [NSDictionary alloc];
__block BOOL isRunLoopNested = NO;
__block BOOL isOperationCompleted = NO;
[[Warply sharedService] validateCoupoWithSuccessBlock:coupon :^(NSDictionary *response) {
[[Warply sharedService] validateCouponWithSuccessBlock:coupon :^(NSDictionary *response) {
resp = response;
isOperationCompleted = YES;
if (isRunLoopNested) {
......