Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
* development: (74 commits)
  update bump version to corekit
  update
  bump version to 1.12.0
  update x-header-source
  Chore/fix textual mismatch (#355)
  Refactor/mob 1608 remove extra linebreak (#354)
  update
  Refactor/mob 1610 refactor klikbca (#353)
  update
  update remove ! from gojek
  update podpecs
  Refactor/mob 1609 indomaret post payment (#351)
  Refactor/mob 1608 danamon instruction (#350)
  update
  bump version to 1.11.0
  Bugfix/mob 1573 mixpanel pg success  (#349)
  self explanatory (#347)
  prevent scroll collection view when index is out of bounds (#346)
  Feature/mob 1573 add missing properties 1click 2click (#345)
  update
  ...

# Conflicts:
#	MidtransDemo/MidtransDemo/MDOrderViewController.m
#	MidtransKit/MidtransKit/classes/MidtransDirectHeader.h
#	MidtransKit/MidtransKit/classes/MidtransNewCreditCardViewController.m
#	MidtransKit/MidtransKit/resources/MidtransDirectHeader.xib
#	MidtransKit/MidtransResources/MIDDanamonOnlineViewController.xib
#	Podpecs/MidtransCoreKit.podspec
#	Podpecs/MidtransKit.podspec
  • Loading branch information
bontangster committed Jun 5, 2018
2 parents dc39930 + 2d75d66 commit fa87e4d
Show file tree
Hide file tree
Showing 22 changed files with 108 additions and 99 deletions.
1 change: 1 addition & 0 deletions MidtransCoreKit/MidtransCoreKit/MidtransConstant.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* error domain
*/

static NSString * const MIDTRANS_SDK_CURRENT_VERSION = @"1.12.0";
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
4 changes: 4 additions & 0 deletions MidtransCoreKit/MidtransCoreKit/MidtransMerchantClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
@param completion A callback that will be executed when the transaction finishes. If the transaction succeeded, the `result` variable will contain all the information provided from the server.
*/

- (void)performTransaction:(MidtransTransaction *_Nonnull)transaction completion:(void(^_Nullable)(MidtransTransactionResult *_Nullable result, NSError *_Nullable error))completion;
- (void)performCheckStatusRBA:(MidtransTransaction *_Nonnull)transaction completion:(void(^_Nullable)(MidtransTransactionResult *_Nullable result, NSError *_Nullable error))completion;
- (void)performCheckStatusTransactionWcompletion:(void(^_Nullable)(MidtransTransactionResult *_Nullable result, NSError *_Nullable error))completion;
Expand All @@ -60,6 +61,9 @@
/*
* updated method, snapping
*/
- (void)requestTransacationWithCurrentToken:(NSString *_Nonnull)token
completion:(void (^_Nullable)(MidtransTransactionTokenResponse *_Nullable token, NSError *_Nullable error))completion;

- (void)requestTransactionTokenWithTransactionDetails:(nonnull MidtransTransactionDetails *)transactionDetails
itemDetails:(nullable NSArray<MidtransItemDetail*> *)itemDetails
customerDetails:(nullable MidtransCustomerDetails *)customerDetails
Expand Down
5 changes: 5 additions & 0 deletions MidtransCoreKit/MidtransCoreKit/MidtransMerchantClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ - (void)requestCustomerPointWithToken:(NSString * _Nonnull )token
}


}
- (void)requestTransacationWithCurrentToken:(NSString *_Nonnull)token
completion:(void (^_Nullable)(MidtransTransactionTokenResponse *_Nullable token, NSError *_Nullable error))completion {

//NSString *URL = [NSString stringWithFormat:@"%@/%@", [CONFIG merchantURL], MIDTRANS_CORE_SNAP_MERCHANT_SERVER_CHARGE];
}
- (void)requestTransactionTokenWithTransactionDetails:(nonnull MidtransTransactionDetails *)transactionDetails
itemDetails:(nullable NSArray<MidtransItemDetail*> *)itemDetails
Expand Down
4 changes: 3 additions & 1 deletion MidtransCoreKit/MidtransCoreKit/MidtransNetworking.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ - (void)deleteFromURL:(NSString *)URL
[request addValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request addValue:@"mobile-ios" forHTTPHeaderField:@"X-Source"];
[request addValue:@"ios" forHTTPHeaderField:@"X-Mobile-Platform"];

[request addValue:MIDTRANS_SDK_CURRENT_VERSION forHTTPHeaderField:@"X-Source-Version"];
for (NSString *key in [header allKeys]) {
[request addValue:header[key] forHTTPHeaderField:key];
}
Expand All @@ -139,6 +139,7 @@ - (void)postToURL:(NSString *)URL header:(NSDictionary *)header parameters:(id)p
[request addValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request addValue:@"mobile-ios" forHTTPHeaderField:@"X-Source"];
[request addValue:@"ios" forHTTPHeaderField:@"X-Mobile-Platform"];
[request addValue:MIDTRANS_SDK_CURRENT_VERSION forHTTPHeaderField:@"X-Source-Version"];

for (NSString *key in [header allKeys]) {
[request addValue:header[key] forHTTPHeaderField:key];
Expand Down Expand Up @@ -178,6 +179,7 @@ - (void)getFromURL:(NSString *)URL
timeoutInterval:[CONFIG timeoutInterval]];
[request addValue:@"mobile-ios" forHTTPHeaderField:@"X-Source"];
[request addValue:@"ios" forHTTPHeaderField:@"X-Mobile-Platform"];
[request addValue:MIDTRANS_SDK_CURRENT_VERSION forHTTPHeaderField:@"X-Source-Version"];

for (NSString *key in [header allKeys]) {
[request addValue:header[key] forHTTPHeaderField:key];
Expand Down
4 changes: 2 additions & 2 deletions MidtransDemo/MidtransDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.9.1</string>
<string>1.11.1</string>
<key>CFBundleVersion</key>
<string>GOPAY-05</string>
<string>GOPAY-07</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
6 changes: 3 additions & 3 deletions MidtransDemo/MidtransDemo/MDOrderViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ - (void)viewDidLoad {
merchantServerURL:merchantServer];

//forced to use token storage
UICONFIG.hideStatusPage = NO;
UICONFIG.hideStatusPage = YES;
CC_CONFIG.tokenStorageEnabled = NO;
CC_CONFIG.authenticationType = [[MDOptionManager shared].authTypeOption.value integerValue];

Expand All @@ -83,7 +83,7 @@ - (void)viewDidLoad {
CC_CONFIG.predefinedInstallment = [MDOptionManager shared].installmentOption.value;
CC_CONFIG.preauthEnabled = [[MDOptionManager shared].preauthOption.value boolValue];
CC_CONFIG.promoEnabled = [[MDOptionManager shared].promoOption.value boolValue];
CC_CONFIG.showFormCredentialsUser = YES;
//CC_CONFIG.showFormCredentialsUser = YES;

/*set custom free text for bca*/
NSDictionary *inquiryConstructor=@{@"en":@"inquiry text in English",@"id":@"inquiry Text in ID"};
Expand All @@ -92,7 +92,7 @@ - (void)viewDidLoad {

NSDictionary *freeText = @{@"inquiry":@[inquiryConstructor,inquiryConstructor2],@"payment":@[paymentConstructor]};
CONFIG.customFreeText = freeText;
UICONFIG.hideStatusPage = NO;
UICONFIG.hideStatusPage = YES;
CONFIG.customPaymentChannels = [[MDOptionManager shared].paymentChannel.value valueForKey:@"type"];
CONFIG.customBCAVANumber = [MDOptionManager shared].bcaVAOption.value;
CONFIG.customBNIVANumber = [MDOptionManager shared].bniVAOption.value;
Expand Down
1 change: 1 addition & 0 deletions MidtransKit/MidtransKit/classes/MidtransDirectHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
@property (strong, nonatomic) IBOutlet MidtransUITextField *emailTextField;
@property (strong, nonatomic) IBOutlet UILabel *descLabel;
@property (strong, nonatomic) IBOutlet UILabel *tutorialTitleLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *descriptionHeightConstraint;
@property (weak, nonatomic) IBOutlet UIButton *showInstructionsButton;
@end
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,15 @@ - (void)viewDidLoad {

self.isSaveCard = [CC_CONFIG setDefaultCreditSaveCardEnabled];
self.showUserForm = [CC_CONFIG showFormCredentialsUser];
self.view.userDetailViewWrapper.hidden = YES;
self.view.userDetailViewWrapper.alpha = 0.0;
self.view.userDetailViewWrapperConstraints.constant = 0.0f;
self.view.contactEmailTextField.text = self.responsePayment.customerDetails.email;
self.view.contactPhoneNumberTextField.text = self.responsePayment.customerDetails.phone;
if (self.showUserForm) {
self.view.contactEmailTextField.text = self.responsePayment.customerDetails.email;
self.view.contactPhoneNumberTextField.text = self.responsePayment.customerDetails.phone;
self.view.userDetailViewWrapper.hidden = NO;
self.view.userDetailViewWrapper.alpha = 1.0f;
self.view.userDetailViewWrapperConstraints.constant = 150.0f;
}
if ([CC_CONFIG saveCardEnabled] && (self.maskedCreditCard == nil)) {
Expand Down
4 changes: 2 additions & 2 deletions MidtransKit/MidtransKit/classes/MidtransUIPaymentDirectView.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
return self.headerView;
}
VTGuideCell *cell = [tableView dequeueReusableCellWithIdentifier:@"VTGuideCell"];
if(indexPath.row %2 ==0) {
if(indexPath.row % 2 > 0) {
cell.backgroundColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1.0];
}
[cell setInstruction:self.guides[indexPath.row-1] number:indexPath.row];
Expand Down Expand Up @@ -128,7 +128,7 @@ - (void)initViewWithPaymentID:(NSString *)paymentMethodID email:(NSString *)emai

if ([paymentMethodID isEqualToString:MIDTRANS_PAYMENT_KLIK_BCA]) {
self.headerView.emailTextField.placeholder = [VTClassHelper getTranslationFromAppBundleForString:@"KlikBCA User ID"];
self.headerView.descLabel.text = [VTClassHelper getTranslationFromAppBundleForString:@"payment.klikbca.userid-note"];
self.headerView.descriptionHeightConstraint.constant = 0.0f;
}
else if ([paymentMethodID isEqualToString:MIDTRANS_PAYMENT_TELKOMSEL_CASH]) {
self.headerView.emailTextField.placeholder = [VTClassHelper getTranslationFromAppBundleForString:@"payment.telkomsel-cash.token-placeholder"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ - (void)viewDidLoad {
self.view.topConstraints.constant = 0.0f;
self.view.topViewConstraints.constant = 0.0f;
if ([self.paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_KLIK_BCA]) {
self.view.topConstraints.constant = 40.0f;
self.view.topViewConstraints.constant = 40.0f;
self.view.disclosureButtonImage.hidden = YES;
} else if ([self.paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_KIOS_ON] ||
[self.paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_BCA_KLIKPAY] ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ - (void)viewDidLoad {
self.title = self.paymentMethod.title;
self.view.tokenViewConstraints.constant = 0.0f;
self.view.topConstraints.constant = 0.0f;
if ([self.paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_KLIK_BCA] || [self.paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_BRI_EPAY]|| [self.paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_BCA_KLIKPAY]) {
if ([self.paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_BRI_EPAY]|| [self.paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_BCA_KLIKPAY]) {
if ([self.paymentMethod.internalBaseClassIdentifier isEqualToString:MIDTRANS_PAYMENT_BCA_KLIKPAY]) {
self.view.tokenViewLabel.text = [VTClassHelper getTranslationFromAppBundleForString:@"SMS Charges may be applied for this payment method"];
[self.view.tokenViewIcon setImage:[[UIImage imageNamed:@"sms" inBundle:VTBundle compatibleWithTraitCollection:nil] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
Expand Down
26 changes: 13 additions & 13 deletions MidtransKit/MidtransKit/classes/VTGuideCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ @interface VTGuideCell()
@implementation VTGuideCell

- (void)setInstruction:(VTInstruction *)instruction number:(NSInteger)number {
self.numberLabel.text = [NSString stringWithFormat:@"%li", (long)number];
self.numberLabel.text = [NSString stringWithFormat:@"%li.", (long)number];
if ([[instruction.content stringsBetween:@"**" and:@"**"] count]) {
NSString *boldLabel = [[instruction.content stringsBetween:@"**" and:@"**"] firstObject];
NSString *cleanString = [[instruction.content stringByReplacingOccurrencesOfString:@"**" withString:@""] stringByReplacingOccurrencesOfString:@"**" withString:@""];
Expand Down Expand Up @@ -72,12 +72,12 @@ - (void)setInstruction:(VTInstruction *)instruction number:(NSInteger)number {
[attrString endEditing];
self.contentLabel.attributedText = attrString;
}
else if ([instruction.content containsString:@"Enter"]) {
else if ([instruction.content containsString:@"Next"]) {
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:instruction.content];
[attrString beginEditing];
[attrString addAttribute:NSFontAttributeName
value:[UIFont fontWithName:FONT_NAME_BOLD size:12.0]
range:[attrString.string rangeOfString:@"Enter"]];
range:[attrString.string rangeOfString:@"Next"]];

[attrString endEditing];
self.contentLabel.attributedText = attrString;
Expand Down Expand Up @@ -122,16 +122,16 @@ - (void)setInstruction:(VTInstruction *)instruction number:(NSInteger)number {
[attrString endEditing];
self.contentLabel.attributedText = attrString;
}
else if ([instruction.content containsString:@"Correct"]) {
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:instruction.content];
[attrString beginEditing];
[attrString addAttribute:NSFontAttributeName
value:[UIFont fontWithName:FONT_NAME_BOLD size:12.0]
range:[attrString.string rangeOfString:@"Correct"]];
[attrString endEditing];
self.contentLabel.attributedText = attrString;
}
else if ([instruction.content containsString:@"Correct"]) {
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:instruction.content];
[attrString beginEditing];
[attrString addAttribute:NSFontAttributeName
value:[UIFont fontWithName:FONT_NAME_BOLD size:12.0]
range:[attrString.string rangeOfString:@"Correct"]];

[attrString endEditing];
self.contentLabel.attributedText = attrString;
}
else if ([instruction.content containsString:@"Transfer"]) {
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:instruction.content];
[attrString beginEditing];
Expand Down
12 changes: 8 additions & 4 deletions MidtransKit/MidtransKit/resources/MidtransDirectHeader.xib
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<customFonts key="customFonts">
Expand Down Expand Up @@ -35,13 +35,16 @@
</userDefinedRuntimeAttributes>
</textField>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="200" verticalHuggingPriority="200" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" text="We will also send the payment instruction to your email" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zWa-c7-bsk">
<rect key="frame" x="15" y="56" width="345" height="55"/>
<rect key="frame" x="15" y="56" width="345" height="53.5"/>
<constraints>
<constraint firstAttribute="height" constant="53.5" id="aaf-uE-0ng"/>
</constraints>
<fontDescription key="fontDescription" name="SourceSansPro-Regular" family="Source Sans Pro" pointSize="13"/>
<color key="textColor" red="0.42745098040000001" green="0.42745098040000001" blue="0.44705882349999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UVd-yL-tEd">
<rect key="frame" x="15" y="127" width="291" height="17.5"/>
<rect key="frame" x="15" y="125.5" width="291" height="19"/>
<fontDescription key="fontDescription" name="SourceSansPro-Regular" family="Source Sans Pro" pointSize="15"/>
<color key="textColor" red="0.42745098040000001" green="0.42745098040000001" blue="0.44705882349999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -72,6 +75,7 @@
</tableViewCellContentView>
<connections>
<outlet property="descLabel" destination="zWa-c7-bsk" id="Ddh-oI-NZw"/>
<outlet property="descriptionHeightConstraint" destination="aaf-uE-0ng" id="2aG-IN-3T0"/>
<outlet property="emailTextField" destination="898-UK-m0i" id="cPL-gZ-gfm"/>
<outlet property="showInstructionsButton" destination="Xlw-yQ-Oaw" id="FHm-90-eVG"/>
<outlet property="tutorialTitleLabel" destination="UVd-yL-tEd" id="gqd-zI-uFx"/>
Expand Down
Loading

0 comments on commit fa87e4d

Please sign in to comment.