Skip to content

Commit

Permalink
Merge pull request #18 in MTIP/asdk-ios from bugfix/8240 to develop_1.4
Browse files Browse the repository at this point in the history
* commit '879154c33b68dceecf71f4d5c4704295a278af64':
  create payment info in init for ASDKChargeResponse
  refactor from property to init
  add rebill id into output
  • Loading branch information
Zverev Aleksey Yuryevich committed Dec 5, 2019
2 parents 7cc3599 + 879154c commit 6ff2f12
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ASDKCore/API Objects/Response/Charge/ASDKChargeResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@
#import "ASDKPaymentInfo.h"
#import "ASDKThreeDsData.h"

NS_ASSUME_NONNULL_BEGIN

@interface ASDKChargeResponse : ASDKAcquiringResponse

- (instancetype)initWithDictionary:(NSDictionary *)dictionary
rebillId:(nullable NSNumber *)rebillId;

@property (nonatomic, strong) ASDKPaymentInfo *paymentInfo;
@property (nonatomic, strong) ASDKThreeDsData *threeDsData;

@end

NS_ASSUME_NONNULL_END
11 changes: 11 additions & 0 deletions ASDKCore/API Objects/Response/Charge/ASDKChargeResponse.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@

@implementation ASDKChargeResponse

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
rebillId:(NSNumber *)rebillId {
self = [super initWithDictionary:dictionary];
if (!self) {
return nil;
}
_paymentInfo = [[ASDKPaymentInfo alloc] initWithDictionary:_dictionary];
_paymentInfo.rebillId = rebillId;
return self;
}

- (ASDKThreeDsData *)threeDsData
{
if (!_threeDsData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
@property (nonatomic, copy) NSString *orderId;
@property (nonatomic, strong) NSNumber *amount;
@property (nonatomic, strong) NSString *status;
@property (nonatomic, strong) NSNumber *rebillId;

@end
2 changes: 1 addition & 1 deletion ASDKCore/ASDKAcquiringApi.m
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ - (void)chargeWithRequest:(ASDKChargeRequest *)request
[self apiVersion:APIVersion_v2 path:kASDKAPIPathCharge parameters:parameters
success:^(NSDictionary *responseDictionary, NSURLResponse *response)
{
ASDKChargeResponse *responseObject = [[ASDKChargeResponse alloc] initWithDictionary:responseDictionary];
ASDKChargeResponse *responseObject = [[ASDKChargeResponse alloc] initWithDictionary:responseDictionary rebillId:request.rebillId];
success(responseObject.paymentInfo, responseObject.status);
}
failure:^(ASDKAcquringApiError *error)
Expand Down

0 comments on commit 6ff2f12

Please sign in to comment.