Skip to content

Commit

Permalink
Merge pull request #556 from veritrans/release/release-1.20.1
Browse files Browse the repository at this point in the history
Release/release 1.20.1
  • Loading branch information
uziwuzzy authored Dec 14, 2021
2 parents 5a5bdc5 + 24bf8c7 commit 853d1ba
Show file tree
Hide file tree
Showing 23 changed files with 135 additions and 48 deletions.
2 changes: 1 addition & 1 deletion MidtransCoreKit.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MidtransCoreKit"
s.version = "1.20.0"
s.version = "1.20.1"
s.summary = "Veritrans mobile SDK beta version"
s.homepage = "https://veritrans.co.id/"
s.license = 'MIT'
Expand Down
4 changes: 3 additions & 1 deletion MidtransCoreKit/MidtransCoreKit/Midtrans3DSController.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ - (UIViewController *)rootViewController {

- (void)viewDidLoad {
[super viewDidLoad];

if (@available(iOS 13.0, *)) {
self.navigationController.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
}
self.title =self.titleOveride.length?self.titleOveride:NSLocalizedString(@"3D Secure", nil);
self.title = @"Credit Card";

Expand Down
2 changes: 1 addition & 1 deletion MidtransCoreKit/MidtransCoreKit/MidtransConstant.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* error domain
*/

static NSString * const MIDTRANS_SDK_CURRENT_VERSION = @"1.20.0";
static NSString * const MIDTRANS_SDK_CURRENT_VERSION = @"1.20.1";
static NSString * const MIDTRANS_CUSTOMFIELD_1 = @"custom_field1";
static NSString * const MIDTRANS_CUSTOMFIELD_2 = @"custom_field2";
static NSString * const MIDTRANS_CUSTOMFIELD_3 = @"custom_field3";
Expand Down
6 changes: 3 additions & 3 deletions MidtransDemo/MidtransDemo/MDOrderViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ - (void)viewDidLoad {
merchantServer = PROMO_MERCHANT_SERVER_URL_SANDBOX;
break;
default:
clientkey = THREE_DS_CLIENT_KEY_URL_STAGING;
merchantServer = THREE_DS_MERCHANT_SERVER_URL_STAGING;
clientkey = PROMO_MERCHANT_CLIENT_KEY_SANDBOX;
merchantServer = PROMO_MERCHANT_SERVER_URL_SANDBOX;
break;
}
[CONFIG setClientKey:clientkey
environment:MidtransServerEnvironmentUat
environment:MidtransServerEnvironmentSandbox
merchantServerURL:merchantServer];

UICONFIG.hideStatusPage = NO;
Expand Down
4 changes: 2 additions & 2 deletions MidtransKit.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MidtransKit"
s.version = "1.20.0"
s.version = "1.20.1"
s.summary = "Veritrans mobile SDK beta version"
s.homepage = "https://veritrans.co.id/"
s.license = 'MIT'
Expand All @@ -17,7 +17,7 @@ s.source_files = 'MidtransKit/MidtransKit/**/*.{h,m}'
s.resource_bundles = {
'MidtransKit' => ['MidtransKit/MidtransKit/resources/*']
}
s.dependency 'MidtransCoreKit', '1.20.0'
s.dependency 'MidtransCoreKit', '1.20.1'
s.static_framework = true
s.default_subspec = 'UI'

Expand Down
18 changes: 18 additions & 0 deletions MidtransKit/MidtransKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,12 @@
DD64CE6C253EA6560069F4B4 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = DD64CE67253EA6550069F4B4 /* [email protected] */; };
DD64CE6D253EA6560069F4B4 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = DD64CE68253EA6560069F4B4 /* [email protected] */; };
DD64CE6E253EA6560069F4B4 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = DD64CE68253EA6560069F4B4 /* [email protected] */; };
DDA485FC27630B0800D9A0AC /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = DDA485F627630B0700D9A0AC /* [email protected] */; };
DDA485FD27630B0800D9A0AC /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = DDA485FA27630B0700D9A0AC /* [email protected] */; };
DDA485FE27630B0800D9A0AC /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = DDA485FB27630B0700D9A0AC /* [email protected] */; };
DDA485FF27630B1000D9A0AC /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = DDA485FA27630B0700D9A0AC /* [email protected] */; };
DDA4860027630B1000D9A0AC /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = DDA485F627630B0700D9A0AC /* [email protected] */; };
DDA4860127630B1000D9A0AC /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = DDA485FB27630B0700D9A0AC /* [email protected] */; };
DDB1F7222536FD5100379F50 /* MidShopeePayViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DDB1F7212536FD5100379F50 /* MidShopeePayViewController.xib */; };
DDB1F7232536FD5100379F50 /* MidShopeePayViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DDB1F7212536FD5100379F50 /* MidShopeePayViewController.xib */; };
DDB1F7252537284700379F50 /* MidShopeePayViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = DDB1F7242537284700379F50 /* MidShopeePayViewController.h */; };
Expand Down Expand Up @@ -1729,6 +1735,9 @@
DD64CE66253EA6550069F4B4 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "resources/[email protected]"; sourceTree = "<group>"; };
DD64CE67253EA6550069F4B4 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "resources/[email protected]"; sourceTree = "<group>"; };
DD64CE68253EA6560069F4B4 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "resources/[email protected]"; sourceTree = "<group>"; };
DDA485F627630B0700D9A0AC /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "resources/[email protected]"; sourceTree = "<group>"; };
DDA485FA27630B0700D9A0AC /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "resources/[email protected]"; sourceTree = "<group>"; };
DDA485FB27630B0700D9A0AC /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "resources/[email protected]"; sourceTree = "<group>"; };
DDB1F7212536FD5100379F50 /* MidShopeePayViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MidShopeePayViewController.xib; path = MidtransKit/resources/MidShopeePayViewController.xib; sourceTree = SOURCE_ROOT; };
DDB1F7242537284700379F50 /* MidShopeePayViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MidShopeePayViewController.h; path = classes/MidShopeePayViewController.h; sourceTree = "<group>"; };
DDB1F7262537285D00379F50 /* MidShopeePayViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MidShopeePayViewController.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2742,6 +2751,9 @@
DDD96207255C6CC400E81AE5 /* [email protected] */,
DDD96208255C6CC400E81AE5 /* [email protected] */,
DDD96206255C6CC400E81AE5 /* [email protected] */,
DDA485FB27630B0700D9A0AC /* [email protected] */,
DDA485F627630B0700D9A0AC /* [email protected] */,
DDA485FA27630B0700D9A0AC /* [email protected] */,
E5EBC2BE1EB0726700A568D1 /* [email protected] */,
E5EBC2BF1EB0726700A568D1 /* [email protected] */,
3D40893B1F75130300B9A2EC /* alto_preview.png */,
Expand Down Expand Up @@ -3716,6 +3728,7 @@
E571248D1E9381320064F515 /* MidtransPaymentGCIViewController.xib in Resources */,
3D4089181F74E35800B9A2EC /* id_paymentMethods.plist in Resources */,
3D4089141F74E35800B9A2EC /* id_bca_va.plist in Resources */,
DDA485FC27630B0800D9A0AC /* [email protected] in Resources */,
0CE1D2B91F67BA53003A012F /* [email protected] in Resources */,
3D4089111F74E35800B9A2EC /* en_permata_va.plist in Resources */,
3D4089131F74E35800B9A2EC /* id_bca_klikpay.plist in Resources */,
Expand All @@ -3741,6 +3754,7 @@
3D4089161F74E35800B9A2EC /* id_mandiri_clickpay.plist in Resources */,
3D4089101F74E35800B9A2EC /* en_mandiri_clickpay.plist in Resources */,
E519C9731E9B6F2100EF70DF /* [email protected] in Resources */,
DDA485FD27630B0800D9A0AC /* [email protected] in Resources */,
0C9634E51FE11A1400EF89DF /* [email protected] in Resources */,
E571248F1E9381320064F515 /* MidtransPaymentStatusViewController.xib in Resources */,
E57124901E9381320064F515 /* MidtransPromoView.xib in Resources */,
Expand Down Expand Up @@ -3943,6 +3957,7 @@
3D40894C1F75133200B9A2EC /* [email protected] in Resources */,
0CCD624C2005D0BA006936E5 /* [email protected] in Resources */,
ECB0218F221A9C6C0037C0E1 /* en_alfamart.plist in Resources */,
DDA485FE27630B0800D9A0AC /* [email protected] in Resources */,
0C9634F31FE11A1400EF89DF /* reload.png in Resources */,
E58FCE0B1E94CFD500632085 /* [email protected] in Resources */,
DDD96241255C715D00E81AE5 /* [email protected] in Resources */,
Expand Down Expand Up @@ -4153,6 +4168,7 @@
0CC900351F70244A0058E93C /* en_bri_epay.plist in Resources */,
3DECDFE91F9DAE610001AC9A /* [email protected] in Resources */,
0C9634F51FE11A1F00EF89DF /* [email protected] in Resources */,
DDA4860127630B1000D9A0AC /* [email protected] in Resources */,
3DECDFE51F9DAE610001AC9A /* download.png in Resources */,
DDD96228255C715D00E81AE5 /* [email protected] in Resources */,
E57ACD88217F009500A9977F /* id_akulaku.plist in Resources */,
Expand Down Expand Up @@ -4193,6 +4209,7 @@
E58FCE1C1E94CFD600632085 /* mega.png in Resources */,
E58FCE681E94CFD600632085 /* [email protected] in Resources */,
0C9635061FE11A1F00EF89DF /* ic_no_gopay.png in Resources */,
DDA4860027630B1000D9A0AC /* [email protected] in Resources */,
E58FCE7A1E94CFD600632085 /* visa-mastercard-amex.png in Resources */,
E519C9621E9B6F2000EF70DF /* [email protected] in Resources */,
E5F1BB761E93701100ED659D /* VTIndomaretSuccessController.xib in Resources */,
Expand Down Expand Up @@ -4273,6 +4290,7 @@
ECB021B3221D251B0037C0E1 /* MIDAlfamartPostPaymentViewController.xib in Resources */,
E58FCE081E94CFD500632085 /* [email protected] in Resources */,
0C9634FD1FE11A1F00EF89DF /* ic_chevron_down.png in Resources */,
DDA485FF27630B1000D9A0AC /* [email protected] in Resources */,
E58FCDF01E94CFD500632085 /* [email protected] in Resources */,
E58FCE6E1E94CFD600632085 /* [email protected] in Resources */,
0CDAA763203EA19D009419B3 /* gopay_scan_1.png in Resources */,
Expand Down
8 changes: 7 additions & 1 deletion MidtransKit/MidtransKit/MidShopeePayViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,13 @@ - (void)backButtonDidTapped:(id)sender {
[alertController addAction:okAction];
[self presentViewController:alertController animated:YES completion:nil];
} else {
[self.navigationController popViewControllerAnimated:YES];
if (self.isDirectPayment == YES) {
[self.navigationController dismissViewControllerAnimated:YES completion:^{
[[NSNotificationCenter defaultCenter] postNotificationName:TRANSACTION_CANCELED object:nil];
}];
} else {
[self.navigationController popViewControllerAnimated:YES];
}
}
}

Expand Down
8 changes: 7 additions & 1 deletion MidtransKit/MidtransKit/classes/MidGopayViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,13 @@ - (void)backButtonDidTapped:(id)sender {
[alertController addAction:okAction];
[self presentViewController:alertController animated:YES completion:nil];
} else {
[self.navigationController popViewControllerAnimated:YES];
if (self.isDirectPayment == YES) {
[self.navigationController dismissViewControllerAnimated:YES completion:^{
[[NSNotificationCenter defaultCenter] postNotificationName:TRANSACTION_CANCELED object:nil];
}];
} else {
[self.navigationController popViewControllerAnimated:YES];
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions MidtransKit/MidtransKit/classes/MidtransUIListCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ - (void)configurePaymetnList:(MidtransPaymentListModel *)paymentList withFullPay
if ([paymentList.internalBaseClassIdentifier isEqualToString:@"echannel"]) {
imagePath = @"mandiri_va";
}
if ([paymentList.internalBaseClassIdentifier isEqualToString:@"bri_epay"]) {
imagePath = @"brimo";
}
if ([paymentList.internalBaseClassIdentifier isEqualToString:@"credit_card"]) {
if (response.promos.promos.count) {
self.promoNotificationView.hidden = NO;
Expand Down
4 changes: 4 additions & 0 deletions MidtransKit/MidtransKit/classes/MidtransUIPaymentController.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@
@interface MidtransUIPaymentController : MidtransUIBaseViewController
@property (nonatomic,strong) MidtransTransactionTokenResponse *token;
@property (nonatomic,strong) MidtransPaymentListModel *paymentMethod;
@property (nonatomic, readonly) BOOL isDirectPayment;

-(instancetype)initWithToken:(MidtransTransactionTokenResponse *)token
paymentMethodName:(MidtransPaymentListModel *)paymentMethod;
-(instancetype)initWithToken:(MidtransTransactionTokenResponse *)token
paymentMethodName:(MidtransPaymentListModel *)paymentMethod
directPaymentFeature:(BOOL)isDirectPayment;

-(void)showBackButton:(BOOL)show;
-(void)showDismissButton:(BOOL)show;
Expand Down
15 changes: 15 additions & 0 deletions MidtransKit/MidtransKit/classes/MidtransUIPaymentController.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ @interface MidtransUIPaymentController () <SNPMaintainViewDelegate>
@property (nonatomic) MidtransLoadingView *loadingView;
@property (nonatomic) SNPMaintainView *maintainView;
@property (nonatomic) BOOL dismissButton;
@property (nonatomic) BOOL isDirectPayment;


@end

Expand All @@ -48,6 +50,19 @@ -(instancetype)initWithToken:(MidtransTransactionTokenResponse *)token paymentMe
return self;
}

-(instancetype)initWithToken:(MidtransTransactionTokenResponse *)token
paymentMethodName:(MidtransPaymentListModel *)paymentMethod
directPaymentFeature:(BOOL)isDirectPayment{
self = [[[self class] alloc] initWithNibName:NSStringFromClass([self class]) bundle:VTBundle];
if (self) {
self.token = token;
self.paymentMethod = paymentMethod;
self.isDirectPayment = isDirectPayment;
}
return self;

}

-(void)showBackButton:(BOOL)show {
if (show) {
if (!self.backBarButton) {
Expand Down
48 changes: 35 additions & 13 deletions MidtransKit/MidtransKit/classes/MidtransUIPaymentViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,7 @@ - (void)viewWillAppear:(BOOL)animated{
}
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationBar.translucent = false;
// to remove 1 px border below nav bar

[self.navigationBar setBackgroundImage:[UIImage new]
forBarPosition:UIBarPositionAny
barMetrics:UIBarMetricsDefault];
[self.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
[self.navigationBar setShadowImage:[[UIImage alloc] init]];
self.navigationBar.titleTextAttributes = @{NSFontAttributeName:[[MidtransUIThemeManager shared].themeFont fontRegularWithSize:17],
NSForegroundColorAttributeName:[UIColor colorWithRed:3/255. green:3/255. blue:3/255. alpha:1]};
self.navigationBar.barTintColor = [UIColor whiteColor];
self.navigationBar.tintColor = [[MidtransUIThemeManager shared] themeColor];

[self setupNavigationBar];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(transactionSuccess:) name:TRANSACTION_SUCCESS object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(transactionFailed:) name:TRANSACTION_FAILED object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(transactionDeny:) name:TRANSACTION_DENY object:nil];
Expand All @@ -148,6 +136,40 @@ - (void)saveCardSuccess:(NSNotification *)sender {
[self.paymentDelegate paymentViewController:self saveCard:sender.userInfo[TRANSACTION_RESULT_KEY]];
}
}

- (void)setupNavigationBar {
self.navigationBar.translucent = NO;
[self.navigationBar setBackgroundImage:[UIImage new]
forBarPosition:UIBarPositionAny
barMetrics:UIBarMetricsDefault];
[self.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
[self.navigationBar setShadowImage:[[UIImage alloc] init]];
self.navigationBar.tintColor = [[MidtransUIThemeManager shared] themeColor];

if (@available(iOS 15.0, *)) {
self.navigationBar.backgroundColor = [UIColor whiteColor];
self.navigationBar.titleTextAttributes = @{NSFontAttributeName:[[MidtransUIThemeManager shared].themeFont fontRegularWithSize:17],
NSForegroundColorAttributeName:[UIColor colorWithRed:3/255. green:3/255. blue:3/255. alpha:1]};
UIView * statusBarView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, [[UIApplication sharedApplication] statusBarFrame].size.height)];
statusBarView.backgroundColor = [UIColor whiteColor];
statusBarView.tag = MIDTRANS_UI_PAYMENT_STATUS_BAR_TAG;
[self.view addSubview:statusBarView];
} else {
self.navigationBar.titleTextAttributes = @{NSFontAttributeName:[[MidtransUIThemeManager shared].themeFont fontRegularWithSize:17],
NSForegroundColorAttributeName:[UIColor colorWithRed:3/255. green:3/255. blue:3/255. alpha:1]};
self.navigationBar.barTintColor = [UIColor whiteColor];
}
}

- (UIStatusBarStyle)preferredStatusBarStyle
{
if (@available(iOS 13.0, *)) {
return UIStatusBarStyleDarkContent;
} else {
return UIStatusBarStyleDefault;
}
}

- (void)saveCardFailed:(NSNotification *)sender {
[self dismissDemoBadge];
if ([self.paymentDelegate respondsToSelector:@selector(paymentViewController:saveCardFailed:)]) {
Expand Down
2 changes: 2 additions & 0 deletions MidtransKit/MidtransKit/classes/VTKITConstant.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ static NSString * const FONT_NAME_DEFAULT = @"SourceSansPro-Regular";
static NSString * const FONT_NAME_MEDIUM = @"SourceSansPro-Semibold";
static NSString * const FONT_NAME_BOLD = @"SourceSansPro-Bold";
static NSString * const FONT_NAME_THIN = @"SourceSansPro-Light";

static NSInteger const MIDTRANS_UI_PAYMENT_STATUS_BAR_TAG = 1001;
6 changes: 2 additions & 4 deletions MidtransKit/MidtransKit/classes/VTPaymentListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,11 @@ - (void)redirectToPaymentMethodAtIndex:(NSInteger)index {
[self.navigationController pushViewController:vc animated:!self.singlePayment];
}
else if ([paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_GOPAY]) {
MidGopayViewController *midGopayVC = [[MidGopayViewController alloc] initWithToken:self.token paymentMethodName:paymentMethod];
[midGopayVC showDismissButton:self.singlePayment];
MidGopayViewController *midGopayVC = [[MidGopayViewController alloc] initWithToken:self.token paymentMethodName:paymentMethod directPaymentFeature:self.singlePayment];
[self.navigationController pushViewController:midGopayVC animated:!self.singlePayment];
}
else if ([paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_SHOPEEPAY] ||[paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_QRIS_SHOPEEPAY] ) {
MidShopeePayViewController *midShopeepayVC = [[MidShopeePayViewController alloc] initWithToken:self.token paymentMethodName:paymentMethod];
[midShopeepayVC showDismissButton:self.singlePayment];
MidShopeePayViewController *midShopeepayVC = [[MidShopeePayViewController alloc] initWithToken:self.token paymentMethodName:paymentMethod directPaymentFeature:self.singlePayment];
[self.navigationController pushViewController:midShopeepayVC animated:!self.singlePayment];
}
else if ([paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_INDOMARET]) {
Expand Down
3 changes: 3 additions & 0 deletions MidtransKit/MidtransKit/classes/VTPaymentListView.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ - (void)awakeFromNib {
self.tableView.dataSource = self;
self.tableView.delegate = self;
self.tableView.tableFooterView = [UIView new];
if (@available(iOS 15, *)){
[self.tableView setSectionHeaderTopPadding:0];
}
[self.tableView registerNib:[UINib nibWithNibName:@"MidtransUIListCell" bundle:VTBundle] forCellReuseIdentifier:@"MidtransUIListCell"];
}

Expand Down
Loading

0 comments on commit 853d1ba

Please sign in to comment.