Skip to content

Commit

Permalink
Merge pull request #481 from veritrans/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Fauzan Erich Emmerling authored Dec 5, 2019
2 parents eb959db + 5c5a12c commit 5a06e88
Show file tree
Hide file tree
Showing 19 changed files with 2,810 additions and 213 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.16.1"
s.version = "1.16.2"
s.summary = "Veritrans mobile SDK beta version"
s.homepage = "https://veritrans.co.id/"
s.license = 'MIT'
Expand Down
2 changes: 1 addition & 1 deletion MidtransCoreKit/MidtransCoreKit/Midtrans3DSController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import "MidtransConstant.h"
#import "MidtransMerchantClient.h"
#import "MidtransTransaction.h"
@interface Midtrans3DSController() <WKNavigationDelegate, UIAlertViewDelegate>
@interface Midtrans3DSController() <WKNavigationDelegate>
@property (nonatomic) NSURL *secureURL;
@property (nonatomic) NSString *token;
@property (nonatomic) UIViewController *rootViewController;
Expand Down
38 changes: 20 additions & 18 deletions MidtransCoreKit/MidtransCoreKit/MidtransPaymentWebController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import "MidtransConstant.h"
#import <WebKit/WebKit.h>

@interface MidtransPaymentWebController () <WKNavigationDelegate, UIAlertViewDelegate>
@interface MidtransPaymentWebController () <WKNavigationDelegate>
@property (nonatomic) WKWebView *webView;
@property (nonatomic) NSString *paymentIdentifier;
@property (nonatomic, readwrite) MidtransTransactionResult *result;
Expand Down Expand Up @@ -78,13 +78,25 @@ - (void)viewDidLoad {
}

- (void)closePressed:(id)sender {

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Confirm Navigation", nil)
message:NSLocalizedString(@"Are you sure want to leave this page?", nil)
delegate:self
cancelButtonTitle:NSLocalizedString(@"NO", nil)
otherButtonTitles:NSLocalizedString(@"YES", nil), nil];
[alert show];
UIAlertController *alert = [UIAlertController
alertControllerWithTitle:NSLocalizedString(@"Confirm Navigation", nil)
message:NSLocalizedString(@"Are you sure want to leave this page?", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *noButton = [UIAlertAction
actionWithTitle:NSLocalizedString(@"NO", nil)
style:UIAlertActionStyleDefault
handler:nil];
UIAlertAction *yesButton = [UIAlertAction
actionWithTitle:NSLocalizedString(@"YES", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
if ([self.delegate respondsToSelector:@selector(webPaymentController_transactionPending:)]) {
[self.delegate webPaymentController_transactionPending:self];
}
}];
[alert addAction:noButton];
[alert addAction:yesButton];
[self presentViewController:alert animated:YES completion:nil];
}

- (NSError *)transactionError {
Expand Down Expand Up @@ -127,14 +139,4 @@ - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigati
}
decisionHandler(WKNavigationActionPolicyAllow);
}

#pragma mark - UIAlertViewDelegate

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
if ([self.delegate respondsToSelector:@selector(webPaymentController_transactionPending:)]) {
[self.delegate webPaymentController_transactionPending:self];
}
}
}
@end
14 changes: 5 additions & 9 deletions MidtransDemo/MidtransDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@
E56436F11E83A72F008726D0 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = G92YEQF267;
ProvisioningStyle = Manual;
ProvisioningStyle = Automatic;
};
E5C751651E8B912F001F47D9 = {
CreatedOnToolsVersion = 8.2.1;
Expand Down Expand Up @@ -875,9 +875,7 @@
baseConfigurationReference = 5C11021525267A24FA5F14A7 /* Pods-MidtransDemo.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer: Nanang Rafsanjani (77WYT367ML)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Nanang Rafsanjani (77WYT367ML)";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = G92YEQF267;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -889,7 +887,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.midtrans.demo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "SDK Demo Dev";
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -899,9 +897,7 @@
baseConfigurationReference = F724BE8B0AB574A14BDDE958 /* Pods-MidtransDemo.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Distribution: MIDTRANS, PT (G92YEQF267)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: MIDTRANS, PT (G92YEQF267)";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = G92YEQF267;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -912,7 +908,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.midtrans.demo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "SDK Demo Adhoc";
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
4 changes: 4 additions & 0 deletions MidtransDemo/MidtransDemo/MDOptionsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,13 @@ - (void)initConfiguration{
if (type == MTCreditCardPaymentTypeOneclick) {
[opt3ds selectOptionAtIndex:1];
[optSaveCard selectOptionAtIndex:1];
[optAuth selectOptionAtIndex:3];
[opt3ds selectOptionAtIndex:1];
}
else if (type == MTCreditCardPaymentTypeTwoclick) {
[optSaveCard selectOptionAtIndex:1];
[opt3ds selectOptionAtIndex:0];
[optAuth selectOptionAtIndex:0];
}
});

Expand Down
25 changes: 17 additions & 8 deletions MidtransDemo/MidtransDemo/MDOrderViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ - (void)viewDidLoad {
CC_CONFIG.paymentType = [[MDOptionManager shared].ccTypeOption.value integerValue];
switch (CC_CONFIG.paymentType) {
case MTCreditCardPaymentTypeOneclick:
clientkey = @"VT-client-E4f1bsi1LpL1p5cF";
merchantServer = @"https://rakawm-snap.herokuapp.com";
CC_CONFIG.tokenStorageEnabled = NO;
clientkey = @"SB-Mid-client-61XuGAwQ8Bj8LxSS";
merchantServer = @"https://fauzi-one-click-sandbox.herokuapp.com/";
break;
default:
clientkey = @"SB-Mid-client-txZHOj6jPP0_G8En";
merchantServer = @"https://dev-mobile-store.herokuapp.com/";
CC_CONFIG.tokenStorageEnabled = YES;
clientkey = @"SB-Mid-client-zt7XrRxPQXZNvuBY";
merchantServer = @"https://charmenzy-mid-mobile-sandbox.herokuapp.com/";
break;
}
[CONFIG setClientKey:clientkey
environment:MidtransServerEnvironmentSandbox
merchantServerURL:merchantServer];

UICONFIG.hideStatusPage = NO;
CC_CONFIG.secure3DEnabled = [[MDOptionManager shared].secure3DOption.value boolValue];
CC_CONFIG.authenticationType = [[MDOptionManager shared].authTypeOption.value integerValue];
CC_CONFIG.saveCardEnabled =[[MDOptionManager shared].saveCardOption.value boolValue];
CC_CONFIG.acquiringBank = [[MDOptionManager shared].issuingBankOption.value integerValue];
CC_CONFIG.predefinedInstallment = [MDOptionManager shared].installmentOption.value;
Expand Down Expand Up @@ -203,8 +203,17 @@ - (IBAction)bayarPressed:(id)sender {

{
if (error) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil];
[alert show];

UIAlertController *alert = [UIAlertController
alertControllerWithTitle:@"Error"
message:error.localizedDescription
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okButton = [UIAlertAction
actionWithTitle:@"Close"
style:UIAlertActionStyleDefault
handler:nil];
[alert addAction:okButton];
[self presentViewController:alert animated:YES completion:nil];
}
else {

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.16.1"
s.version = "1.16.2"
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.16.1'
s.dependency 'MidtransCoreKit', '1.16.2'
s.static_framework = true
s.default_subspec = 'UI'

Expand Down
Loading

0 comments on commit 5a06e88

Please sign in to comment.