diff --git a/Demo/VTDirectDemo/AppDelegate.m b/Demo/VTDirectDemo/AppDelegate.m index 76fc37802..21370d4aa 100755 --- a/Demo/VTDirectDemo/AppDelegate.m +++ b/Demo/VTDirectDemo/AppDelegate.m @@ -34,6 +34,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [VTConfig setClientKey:@"VT-client-wRhLUazn8LGHLP6Q" merchantServerURL:@"https://vt-merchant.coralshop.top/api" serverEnvironment:VTServerEnvironmentSandbox]; + +// [VTConfig setClientKey:@"VT-client-wCSALF27ZAHMVa2U" +// merchantServerURL:@"http://tapri.ayopop.com/payments/ccPayment" +// serverEnvironment:VTServerEnvironmentSandbox]; #endif BOOL enableOneclick = [[[NSUserDefaults standardUserDefaults] objectForKey:@"enable_oneclick"] boolValue]; diff --git a/Demo/VTDirectDemo/ViewController.m b/Demo/VTDirectDemo/ViewController.m index b816f67d2..c5b0695de 100755 --- a/Demo/VTDirectDemo/ViewController.m +++ b/Demo/VTDirectDemo/ViewController.m @@ -70,14 +70,16 @@ - (IBAction)settingPressed:(UIBarButtonItem *)sender { } - (IBAction)checkoutPressed:(UIBarButtonItem *)sender { + [[VTCardControllerConfig sharedInstance] setEnableOneClick:YES]; + [[VTCardControllerConfig sharedInstance] setEnable3DSecure:YES]; NSData *encoded = [[NSUserDefaults standardUserDefaults] objectForKey:@"vt_customer"]; VTCustomerDetails *customerDetails = [NSKeyedUnarchiver unarchiveObjectWithData:encoded]; VTTransactionDetails *transactionDetails = [[VTTransactionDetails alloc] initWithOrderID:[NSString randomWithLength:20] andGrossAmount:[self grossAmountOfItemDetails:self.itemDetails]]; if (customerDetails) { - VTAddCardController *vc = [[VTAddCardController alloc] initWithCustomerDetails:customerDetails itemDetails:self.itemDetails transactionDetails:transactionDetails]; - // VTCardListController *vc = [[VTCardListController alloc] initWithCustomerDetails:customerDetails itemDetails:self.itemDetails transactionDetails:transactionDetails]; +// VTAddCardController *vc = [[VTAddCardController alloc] initWithCustomerDetails:customerDetails itemDetails:self.itemDetails transactionDetails:transactionDetails]; + VTCardListController *vc = [[VTCardListController alloc] initWithCustomerDetails:customerDetails itemDetails:self.itemDetails transactionDetails:transactionDetails]; [vc presentOnViewController:self]; // [[VTCardControllerConfig sharedInstance] setEnableOneClick:YES]; diff --git a/MidtransKit/MidtransKit.xcodeproj/project.pbxproj b/MidtransKit/MidtransKit.xcodeproj/project.pbxproj index 604aa700b..5cbf38ba8 100755 --- a/MidtransKit/MidtransKit.xcodeproj/project.pbxproj +++ b/MidtransKit/MidtransKit.xcodeproj/project.pbxproj @@ -182,6 +182,8 @@ E5591A481CEF0DB0005A2DB1 /* VTVASuccessStatusController.h in Headers */ = {isa = PBXBuildFile; fileRef = E5591A451CEF0DB0005A2DB1 /* VTVASuccessStatusController.h */; }; E5591A491CEF0DB0005A2DB1 /* VTVASuccessStatusController.m in Sources */ = {isa = PBXBuildFile; fileRef = E5591A461CEF0DB0005A2DB1 /* VTVASuccessStatusController.m */; }; E5591A4A1CEF0DB7005A2DB1 /* VTVASuccessStatusController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E5591A471CEF0DB0005A2DB1 /* VTVASuccessStatusController.xib */; }; + E573CE451DAF75B5007531E0 /* VTNavigationViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = E573CE431DAF75B5007531E0 /* VTNavigationViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E573CE461DAF75B5007531E0 /* VTNavigationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E573CE441DAF75B5007531E0 /* VTNavigationViewController.m */; }; E578DD061CFBED7A0091760A /* vaother@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E578DD051CFBED7A0091760A /* vaother@2x.png */; }; E578DD0A1CFBF6480091760A /* UIView+Toast.h in Headers */ = {isa = PBXBuildFile; fileRef = E578DD081CFBF6480091760A /* UIView+Toast.h */; }; E578DD0B1CFBF6480091760A /* UIView+Toast.m in Sources */ = {isa = PBXBuildFile; fileRef = E578DD091CFBF6480091760A /* UIView+Toast.m */; }; @@ -423,6 +425,8 @@ E5591A451CEF0DB0005A2DB1 /* VTVASuccessStatusController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTVASuccessStatusController.h; sourceTree = ""; }; E5591A461CEF0DB0005A2DB1 /* VTVASuccessStatusController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VTVASuccessStatusController.m; sourceTree = ""; }; E5591A471CEF0DB0005A2DB1 /* VTVASuccessStatusController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VTVASuccessStatusController.xib; sourceTree = ""; }; + E573CE431DAF75B5007531E0 /* VTNavigationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTNavigationViewController.h; sourceTree = ""; }; + E573CE441DAF75B5007531E0 /* VTNavigationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VTNavigationViewController.m; sourceTree = ""; }; E578DD051CFBED7A0091760A /* vaother@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "vaother@2x.png"; path = "../MidtransResources/vaother@2x.png"; sourceTree = ""; }; E578DD081CFBF6480091760A /* UIView+Toast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Toast.h"; sourceTree = ""; }; E578DD091CFBF6480091760A /* UIView+Toast.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Toast.m"; sourceTree = ""; }; @@ -838,6 +842,8 @@ children = ( 3068387F1C7EE7220064A305 /* VTPaymentViewController.h */, 306838801C7EE7220064A305 /* VTPaymentViewController.m */, + E573CE431DAF75B5007531E0 /* VTNavigationViewController.h */, + E573CE441DAF75B5007531E0 /* VTNavigationViewController.m */, 30E77E831C8401DC0090D228 /* Payment */, 00F61AE61D1459F300C93DA0 /* Payment List */, ); @@ -1013,6 +1019,7 @@ E525E12A1CFD75D1009448A5 /* UIViewController+Modal.h in Headers */, E503AECD1C8E889C00F097FF /* VTVAListController.h in Headers */, E517C2D81C96B610009AE6AA /* VTHudView.h in Headers */, + E573CE451DAF75B5007531E0 /* VTNavigationViewController.h in Headers */, 30BB9C811C7DA6410012BB2A /* VTTextField.h in Headers */, 3005E2A81C7C239A00064169 /* VTClassHelper.h in Headers */, E583AFF51C8D6DD300C04512 /* VTSuccessStatusController.h in Headers */, @@ -1267,6 +1274,7 @@ 30E713231C859D6100AFB7B4 /* MBXPageViewController_vt.m in Sources */, 30BB9C821C7DA6410012BB2A /* VTTextField.m in Sources */, E50D86081D0ECBC500F26D2E /* VTIndomaretSuccessController.m in Sources */, + E573CE461DAF75B5007531E0 /* VTNavigationViewController.m in Sources */, 3056A21E1C7EA3660015B3CC /* VTItemViewModel.m in Sources */, 00F61AEA1D145A2B00C93DA0 /* VTPaymentListView.m in Sources */, 30E7131A1C85816B00AFB7B4 /* VTDetailedTitleController.m in Sources */, diff --git a/MidtransKit/MidtransKit/VTAddCardController.m b/MidtransKit/MidtransKit/VTAddCardController.m index a5d448ffc..b83bccc42 100755 --- a/MidtransKit/MidtransKit/VTAddCardController.m +++ b/MidtransKit/MidtransKit/VTAddCardController.m @@ -12,6 +12,7 @@ #import "VTCvvInfoController.h" #import "VTCCFrontView.h" #import "VTSuccessStatusController.h" +#import "VTNavigationViewController.h" #import "VTErrorStatusController.h" #import "IHKeyboardAvoiding_vt.h" #import "UIViewController+Modal.h" @@ -60,7 +61,7 @@ - (void)dealloc { } - (void)presentOnViewController:(UIViewController *)viewController { - UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:self]; + VTNavigationViewController *nvc = [[VTNavigationViewController alloc] initWithRootViewController:self]; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop target:self action:@selector(closePressed:)]; [viewController presentViewController:nvc animated:YES completion:nil]; } diff --git a/MidtransKit/MidtransKit/VTCardListController.m b/MidtransKit/MidtransKit/VTCardListController.m index ab7526263..1da1646b5 100755 --- a/MidtransKit/MidtransKit/VTCardListController.m +++ b/MidtransKit/MidtransKit/VTCardListController.m @@ -25,29 +25,30 @@ #import "VTErrorStatusController.h" #import "VTConfirmPaymentController.h" #import "UIViewController+Modal.h" +#import "VTNavigationViewController.h" #import //#import @interface VTCardListController () - @property (strong, nonatomic) IBOutlet UIPageControl *pageControl; - - @property (strong, nonatomic) IBOutlet UIView *emptyCardView; - @property (strong, nonatomic) IBOutlet UIView *cardsView; - @property (strong, nonatomic) IBOutlet UILabel *amountLabel; - @property (strong, nonatomic) IBOutlet UIButton *addCardButton; - - @property (nonatomic) IBOutlet NSLayoutConstraint *addCardButtonHeight; - - @property (nonatomic) NSMutableArray *cards; - @property (nonatomic) BOOL editingCell; - @end +@property (strong, nonatomic) IBOutlet UIPageControl *pageControl; + +@property (strong, nonatomic) IBOutlet UIView *emptyCardView; +@property (strong, nonatomic) IBOutlet UIView *cardsView; +@property (strong, nonatomic) IBOutlet UILabel *amountLabel; +@property (strong, nonatomic) IBOutlet UIButton *addCardButton; + +@property (nonatomic) IBOutlet NSLayoutConstraint *addCardButtonHeight; + +@property (nonatomic) NSMutableArray *cards; +@property (nonatomic) BOOL editingCell; +@end @implementation VTCardListController { VTHudView *_hudView; } - + - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. @@ -78,21 +79,21 @@ - (void)viewDidLoad { } - (void)presentOnViewController:(UIViewController *)viewController { - UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:self]; + VTNavigationViewController *nvc = [[VTNavigationViewController alloc] initWithRootViewController:self]; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop target:self action:@selector(closePressed:)]; [viewController presentViewController:nvc animated:YES completion:nil]; } - + - (void)closePressed:(id)sender { [self dismissViewControllerAnimated:YES completion:nil]; } - + - (void)setEditingCell:(BOOL)editingCell { _editingCell = editingCell; [_collectionView reloadData]; } - + - (void)startEditing:(id)sender { self.editingCell = true; } @@ -118,8 +119,8 @@ - (void)reloadMaskedCards { [self updateView]; }]; } - - + + - (void)updateView { if (self.cards.count) { _addCardButton.hidden = true; @@ -133,42 +134,42 @@ - (void)updateView { _cardsView.hidden = true; } } - + - (void)cardsUpdated:(id)sender { [self reloadMaskedCards]; } - + - (void)setCards:(NSMutableArray *)cards { _cards = cards; [_pageControl setNumberOfPages:[cards count]]; [_collectionView reloadData]; } - + - (IBAction)addCardPressed:(id)sender { VTAddCardController *vc = [[VTAddCardController alloc] initWithCustomerDetails:self.customerDetails itemDetails:self.itemDetails transactionDetails:self.transactionDetails]; vc.delegate = self; [self.navigationController pushViewController:vc animated:YES]; } - + - (id)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController*)fromVC toViewController:(UIViewController*)toVC - { - if (operation == UINavigationControllerOperationPush) { - return [PushAnimator new];; - } - - return nil; +{ + if (operation == UINavigationControllerOperationPush) { + return [PushAnimator new];; } + return nil; +} + #pragma mark - UICollectionViewDataSource - + - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return [_cards count]; } - + - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { VTCardCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"VTCardCell" forIndexPath:indexPath]; cell.delegate = self; @@ -176,16 +177,16 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell cell.editing = self.editingCell; return cell; } - + #pragma mark - UICollectionViewDelegate - + - (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGFloat pageWidth = scrollView.frame.size.width; // you need to have a **iVar** with getter for scrollView float fractionalPage = scrollView.contentOffset.x / pageWidth; NSInteger page = lround(fractionalPage); self.pageControl.currentPage = page; // you need to have a **iVar** with getter for pageControl } - + - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { if (self.editingCell) { self.editingCell = false; return; @@ -206,9 +207,9 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa [self.navigationController pushViewController:vc animated:YES]; } } - + #pragma mark - Helper - + - (void)payWithToken:(NSString *)token { [_hudView showOnView:self.navigationController.view]; @@ -230,16 +231,16 @@ - (void)payWithToken:(NSString *)token { } }]; } - + #pragma mark - VTAddCardControllerDelegate - + - (void)viewController:(VTAddCardController *)viewController didRegisterCard:(VTMaskedCreditCard *)registeredCard { [self.navigationController popViewControllerAnimated:YES]; [self reloadMaskedCards]; } - + #pragma mark - VTCardCellDelegate - + - (void)cardCellShouldRemoveCell:(VTCardCell *)cell { NSIndexPath *indexPath = [_collectionView indexPathForCell:cell]; VTMaskedCreditCard *card = _cards[indexPath.row]; @@ -263,76 +264,11 @@ - (void)cardCellShouldRemoveCell:(VTCardCell *)cell { [self updateView]; }]; } - + #pragma MARK - UICollectionViewDelegateFlowLayout - + - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { return CGSizeMake(self.view.frame.size.width, 200); } - - /* - #pragma mark - Navigation - - // In a storyboard-based application, you will often want to do a little preparation before navigation - - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. - } - */ - - /* - - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { - if (buttonIndex == 0) { - VTAddCardController *vc = [[VTAddCardController alloc] initWithCustomerDetails:self.customerDetails itemDetails:self.itemDetails transactionDetails:self.transactionDetails]; - vc.delegate = self; - [self.navigationController pushViewController:vc animated:YES]; - } else if (buttonIndex == 1) { - CardIOPaymentViewController *scanViewController = [[CardIOPaymentViewController alloc] initWithPaymentDelegate:self]; - [self presentViewController:scanViewController animated:YES completion:nil]; - } - } - */ - - /* - #pragma mark - CardIOPaymentViewControllerDelegate - - /// This method will be called if the user cancels the scan. You MUST dismiss paymentViewController. - /// @param paymentViewController The active CardIOPaymentViewController. - - (void)userDidCancelPaymentViewController:(CardIOPaymentViewController *)paymentViewController { - [self dismissViewControllerAnimated:YES completion:nil]; - } - - /// This method will be called when there is a successful scan (or manual entry). You MUST dismiss paymentViewController. - /// @param cardInfo The results of the scan. - /// @param paymentViewController The active CardIOPaymentViewController. - - (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)cardInfo inPaymentViewController:(CardIOPaymentViewController *)paymentViewController { - - NSString *year = cardInfo.expiryYear < 10 ? [NSString stringWithFormat:@"0%lu", (unsigned long)cardInfo.expiryYear] : [NSString stringWithFormat:@"%lu", (unsigned long)cardInfo.expiryYear]; - NSString *month = cardInfo.expiryMonth < 10 ? [NSString stringWithFormat:@"0%lu", (unsigned long)cardInfo.expiryMonth] : [NSString stringWithFormat:@"%lu", (unsigned long)cardInfo.expiryMonth]; - - VTCreditCard *creditCard = [[VTCreditCard alloc] initWithNumber:cardInfo.cardNumber - expiryMonth:month - expiryYear:year - cvv:cardInfo.cvv]; - - [[VTClient sharedClient] registerCreditCard:creditCard completion:^(VTMaskedCreditCard *maskedCreditCard, NSError *error) { - [_hudView hide]; - - if (error) { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil]; - [alert show]; - } else { - [[VTMerchantClient sharedClient] saveRegisteredCard:maskedCreditCard completion:^(id result, NSError *error) { - if (error) { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil]; - [alert show]; - } else { - [self reloadMaskedCards]; - [self dismissViewControllerAnimated:YES completion:nil]; - } - }]; - } - }]; - } - */ - @end + +@end diff --git a/MidtransKit/MidtransKit/VTNavigationViewController.h b/MidtransKit/MidtransKit/VTNavigationViewController.h new file mode 100644 index 000000000..d018e9d91 --- /dev/null +++ b/MidtransKit/MidtransKit/VTNavigationViewController.h @@ -0,0 +1,13 @@ +// +// VTNavigationViewController.h +// MidtransKit +// +// Created by Nanang Rafsanjani on 10/13/16. +// Copyright © 2016 Veritrans. All rights reserved. +// + +#import + +@interface VTNavigationViewController : UINavigationController + +@end diff --git a/MidtransKit/MidtransKit/VTNavigationViewController.m b/MidtransKit/MidtransKit/VTNavigationViewController.m new file mode 100644 index 000000000..881034e7d --- /dev/null +++ b/MidtransKit/MidtransKit/VTNavigationViewController.m @@ -0,0 +1,27 @@ +// +// VTNavigationViewController.m +// MidtransKit +// +// Created by Nanang Rafsanjani on 10/13/16. +// Copyright © 2016 Veritrans. All rights reserved. +// + +#import "VTNavigationViewController.h" +#import "VTFontManager.h" + +@interface VTNavigationViewController () + +@end + +@implementation VTNavigationViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.navigationBar.translucent = false; + + self.navigationBar.titleTextAttributes = @{NSFontAttributeName:[[VTFontManager shared] semiBoldFontWithSize:17], NSForegroundColorAttributeName:[UIColor colorWithRed:3/255. green:3/255. blue:3/255. alpha:1]}; + self.navigationBar.barTintColor = [UIColor whiteColor]; +} + +@end diff --git a/MidtransKit/MidtransKit/VTPaymentController.m b/MidtransKit/MidtransKit/VTPaymentController.m index ead868eb0..2cfb5c6ed 100644 --- a/MidtransKit/MidtransKit/VTPaymentController.m +++ b/MidtransKit/MidtransKit/VTPaymentController.m @@ -14,12 +14,12 @@ #import "VTSingleGuideController.h" @interface VTPaymentController () - @property (nonatomic) VTHudView *hudView; - @property (nonatomic) VTKeyboardAccessoryView *keyboardAccessoryView; - @end +@property (nonatomic) VTHudView *hudView; +@property (nonatomic) VTKeyboardAccessoryView *keyboardAccessoryView; +@end @implementation VTPaymentController - + - (instancetype)initWithCustomerDetails:(VTCustomerDetails *)customerDetails itemDetails:(NSArray *)itemDetails transactionDetails:(VTTransactionDetails *)transactionDetails { @@ -37,7 +37,7 @@ - (instancetype)initWithCustomerDetails:(VTCustomerDetails *)customerDetails } return self; } - + - (instancetype)initWithCustomerDetails:(VTCustomerDetails *)customerDetails itemDetails:(NSArray *)itemDetails transactionDetails:(VTTransactionDetails *)transactionDetails paymentMethodName:(VTPaymentListModel *)paymentMethod; { @try { @@ -55,10 +55,14 @@ - (instancetype)initWithCustomerDetails:(VTCustomerDetails *)customerDetails ite } return self; } - + - (void)viewDidLoad { [super viewDidLoad]; + if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) { + self.edgesForExtendedLayout = UIRectEdgeNone; + } + self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle: UILocalizedString(@"Back", nil) style:UIBarButtonItemStylePlain target:nil @@ -66,30 +70,30 @@ - (void)viewDidLoad { self.hudView = [[VTHudView alloc] init]; } - + - (void)addNavigationToTextFields:(NSArray *)fields { _keyboardAccessoryView = [[VTKeyboardAccessoryView alloc] initWithFrame:CGRectZero fields:fields]; } - + - (void)showLoadingHud { [self.hudView showOnView:self.navigationController.view]; } - + - (void)hideLoadingHud { [self.hudView hide]; } - + - (void)handleTransactionError:(NSError *)error { VTErrorStatusController *vc = [[VTErrorStatusController alloc] initWithError:error]; [self.navigationController pushViewController:vc animated:YES]; } - + - (void)handleTransactionSuccess:(VTTransactionResult *)result { VTPaymentStatusViewModel *vm = [[VTPaymentStatusViewModel alloc] initWithTransactionResult:result]; VTSuccessStatusController *vc = [VTSuccessStatusController controllerWithSuccessViewModel:vm]; [self.navigationController pushViewController:vc animated:YES]; } - + - (void)showGuideViewController { if ([self.paymentMethod.internalBaseClassIdentifier isEqualToString:VT_VA_BCA_IDENTIFIER] || [self.paymentMethod.internalBaseClassIdentifier isEqualToString:VT_VA_MANDIRI_IDENTIFIER] || @@ -103,5 +107,5 @@ - (void)showGuideViewController { [self.navigationController pushViewController:vc animated:YES]; } } - - @end + +@end diff --git a/MidtransKit/MidtransKit/VTPaymentViewController.h b/MidtransKit/MidtransKit/VTPaymentViewController.h index ede15e9f3..1d2d3dc7c 100755 --- a/MidtransKit/MidtransKit/VTPaymentViewController.h +++ b/MidtransKit/MidtransKit/VTPaymentViewController.h @@ -7,6 +7,7 @@ // #import +#import "VTNavigationViewController.h" #import @class VTPaymentViewController; @@ -18,7 +19,7 @@ - (void)paymentViewController:(VTPaymentViewController *)viewController paymentFailed:(NSError *)error; @end -@interface VTPaymentViewController : UINavigationController +@interface VTPaymentViewController : VTNavigationViewController - (instancetype)initWithCustomerDetails:(VTCustomerDetails *)customerDetails itemDetails:(NSArray *)itemDetails diff --git a/MidtransKit/MidtransKit/VTPaymentViewController.m b/MidtransKit/MidtransKit/VTPaymentViewController.m index 0b07695af..cf80e1492 100755 --- a/MidtransKit/MidtransKit/VTPaymentViewController.m +++ b/MidtransKit/MidtransKit/VTPaymentViewController.m @@ -22,7 +22,10 @@ @implementation VTPaymentViewController @dynamic delegate; - (instancetype)initWithCustomerDetails:(VTCustomerDetails *)customerDetails itemDetails:(NSArray *)itemDetails transactionDetails:(VTTransactionDetails *)transactionDetails { - VTPaymentListController *vc = [[VTPaymentListController alloc] initWithCustomerDetails:customerDetails itemDetails:itemDetails transactionDetails:transactionDetails paymentMethodName:nil]; + VTPaymentListController *vc = [[VTPaymentListController alloc] initWithCustomerDetails:customerDetails + itemDetails:itemDetails + transactionDetails:transactionDetails + paymentMethodName:nil]; self = [[VTPaymentViewController alloc] initWithRootViewController:vc]; if (self) { [VTFontManager registerSourceSansProFonts]; @@ -32,8 +35,8 @@ - (instancetype)initWithCustomerDetails:(VTCustomerDetails *)customerDetails ite - (void)viewDidLoad { [super viewDidLoad]; + self.navigationBar.translucent = false; - // Do any additional setup after loading the view. self.navigationBar.titleTextAttributes = @{NSFontAttributeName:[[VTFontManager shared] semiBoldFontWithSize:17], NSForegroundColorAttributeName:[UIColor colorWithRed:3/255. green:3/255. blue:3/255. alpha:1]}; self.navigationBar.barTintColor = [UIColor whiteColor]; diff --git a/MidtransKit/MidtransResources/VTConfirmPaymentController.xib b/MidtransKit/MidtransResources/VTConfirmPaymentController.xib index bdd4c4ff8..86be5ac5a 100644 --- a/MidtransKit/MidtransResources/VTConfirmPaymentController.xib +++ b/MidtransKit/MidtransResources/VTConfirmPaymentController.xib @@ -1,9 +1,10 @@ - + - + + @@ -19,11 +20,9 @@ - - + - - + @@ -93,7 +87,7 @@ - + @@ -102,25 +96,22 @@ - - + @@ -131,7 +122,7 @@ - + @@ -140,13 +131,12 @@ - +