diff --git a/ASDKCore/API Objects/Response/Charge/ASDKChargeResponse.h b/ASDKCore/API Objects/Response/Charge/ASDKChargeResponse.h index 47e7db0..8e64969 100644 --- a/ASDKCore/API Objects/Response/Charge/ASDKChargeResponse.h +++ b/ASDKCore/API Objects/Response/Charge/ASDKChargeResponse.h @@ -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 diff --git a/ASDKCore/API Objects/Response/Charge/ASDKChargeResponse.m b/ASDKCore/API Objects/Response/Charge/ASDKChargeResponse.m index 6c69a0d..0661ac5 100644 --- a/ASDKCore/API Objects/Response/Charge/ASDKChargeResponse.m +++ b/ASDKCore/API Objects/Response/Charge/ASDKChargeResponse.m @@ -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) diff --git a/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.h b/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.h index bfb4bfb..2de2d62 100644 --- a/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.h +++ b/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.h @@ -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 diff --git a/ASDKCore/ASDKAcquiringApi.m b/ASDKCore/ASDKAcquiringApi.m index 64911a1..30f1a62 100644 --- a/ASDKCore/ASDKAcquiringApi.m +++ b/ASDKCore/ASDKAcquiringApi.m @@ -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)