Skip to content

Commit

Permalink
Development (#389)
Browse files Browse the repository at this point in the history
* update

* update

* update

* update fix object data on saved card

* update

* add 5 minute expiry for cc token (#357)

* update reduce gross amount

* update promo velocity error

* decreased gross amount price to 2k (#359)

* update

* Feature/mob 1632 add custom field (#361)

* one custom field

* add multiple input type option

* add new kind for mdalertviewcontroller

* link mdoptionmanager custom field value with the ones for demo merchant client request

* change total amount to 10k then display bank name and logo on saved card view (#360)

* fix nil value checking for custom field (#362)

* update order_id

* update order-id

* fix setting midtrans transaction expire time according to md option (#363)

* update

* update constant and bump version to 1.12.1

* correcting total amount from transaction result (#366)

* Feature/mob 1649 multi currency demo (#365)

* fix no expiry bug

* add midtrans currency, midtrans config, midtrans currency formatter from existing indonesian currency formatter

* use iso country code style

* replace indonesian currency formatter with format iso currency number, apply to demo as well

* add currency field on midtrans v2 transaction detail

* add constants, add models on transaction detail

* reset v2 models, add constants string, helper methods for currency/string conversion

* add currency on request from config

* add md option and option manager for currency

* add icons

* add currency on credit card get token

* add test case for decimal value in demo
make sure when currency=idr/sgd request will send correct decimal value or integer
make sure item details is correct when currency idr/sgd
revert back paymentrequestv2

* make sure format width is +1 from number format string length to give space between idr/sgd and nominal

* remove spaces

* make sure validate string regardless of upper/lower cases

* remove some more spaces

* remove some more spaces for formatter
revert spaces for v2

* revert back for v2

* remove some spaces

* Feature/mob 1649 multi currency demo (#367)

* add currency field on midtrans v2 transaction detail

* add constants, add models on transaction detail

* reset v2 models, add constants string, helper methods for currency/string conversion

* add currency on request from config

* add currency on credit card get token

* remove some more spaces for formatter
revert spaces for v2

* revert back for v2

* make sure decimal handled correctly on transaction detail view total amount popup

* remove reference for indomaret xib and re add again (#369)

* remove reference for indomaret xib and re add again

* handle total amount display when transaction fail

* bump podpecs

* remove reference for indomaret and danamon online, move them to midtranskit resources folder, then re-add them again. (#371)

tested on demo app

* bump to 1.12.3

* fix crash on add new card from saved card controller when payment is one click (#372)

* fix crash on add new card from saved card controller when payment is one click

* remove unused code

* Chore/fix wording (#374)

* fix wording on en_lang and id_lang

* refactor error message/code and localisation

* add indonesian translation

* localize gopay display message

* fix localised NSError translation conditional by description rather than localizedDescription because we want to be sure when comparing English sentences

* refine method localised NSError Midtrans Error message

* add translation for gopay message

* try make testing class for midtrans transaction result

* make sure refactoring alert message is ok, make some test cases

* use vtclass helper on gopay

* fix bug where card list not refreshing on saved card view controller after deleting last card via 'hapus kartu' button on new cc view controller (#375)

* revert back demo settings to config set on MDOptionsViewController (#376)

* fix one click-two click add card when token storage enabled no (#377)

* Bugfix/mob 1671 change idr to rp in ui (#378)

* change currency label on ui for indonesian from IDR to Rp

* add special case for mandiri click pay input2 label display

* bump version 1.13.1 (#379)

* Feature/mob 1630 bin filter (#368)

* add bin filter ui on demo and config save

* fix bin filter demo option

* fix edit filter by bank names

* remove dummy bin filter

* fix bank names

* use compatible bank names from snap

* add filter by bank name function on midtrans client

* handle total amount when case transaction error

* merge development into bin filter, delete the midtransclient bankname func as we dont need it

* Feature/akulaku (#384)

* Feature/mob 1197 klikpay instruction (#308)

* update delegate to strong

* update podpecs-> 1.7.1.4

* update creditcard helper

* Feature/translation cc (#299)

* add localizable.strings

* update locale

* replace uilocalizedstring macro with vtclasshelper gettranslationfromappbundleforstring

* add permata va localization

* update devicehelper

* add mandiri e-cash localization

* add mandiri click pay translation

* changed translation from localized files to plist files with prefix en/id (language code)

* add bca klikpay and klikbca translation

* id bca klikpay

* changed filename of each plist to prefix id/en using function midtransdevicehelper

* update fixing path translation

* add ini va translation

* add bca va translation

* update translation creditcard

* all va translation

* update midtranscreditcardHelper

* add translation

* translation VA

* update translation

* update cimb clicks translation

* update translation

* add translation mandiri click pay

* update cell translation

* fixed wrong plist format for translation, should be array at root instead of dict

* add email placeholder translation on bank transfer

* update translation cc

* fix sms charges notice label translation

* update translation cc

* update translation cc

* fix small leftovers for translation

* update

* fix small leftover translation

* updat

* add leftover small translation

* add small translation leftover

* update cc translation

* update compability on midtransmerchantclient

* release 1.7.2

* update translation

* updating pod pecs

* update core kit

* update podpecs

* fix langungage positiion

* fix langungage positiion

* update podpecs

* update podpecs

* update podpecs

* update add development

* update classhelper to handle location of translation

* update podpecs to 1.7.2.4

* update lang-> lang.json

* update podpecs to 1.7.2.5

* update

* Feature/mob 1192 other atm (#300)

* added icons for atm lainnya

* insert icon image view

* fixed bank icons for bank transfer for others va

* remove some spaces

* just changing the spelling for indonesian text field placeholder (#301)

* update reload save card after delete

* add danamon payment list

* fix crash on other bank transfer

* fix crash on other bank transfer

* update release 1.7.2.6

* Feature/mob 1192 backup for other bank transfer with ui fix (#305)

* added icons for atm lainnya

* insert icon image view

* fixed bank icons for bank transfer for others va

* remove some spaces

* working on ui for other bank list

* fix alpha on midtrans table alert view container

* add title for midtrans table alert view

* fix presenting table alert view

* fix table alert view title and refactor with enum type

* fix ui for table alert

* Feature/mob 1192 backup for other atm (#304)

* added icons for atm lainnya

* insert icon image view

* fixed bank icons for bank transfer for others va

* remove some spaces

* working on ui for other bank list

* fix alpha on midtrans table alert view container

* add title for midtrans table alert view

* fix presenting table alert view

* fix table alert view title and refactor with enum type

* fix ui for table alert

* update fix crash on other bank transfer

* update

* update token storage bug

* update credit card token storage method

* pre-released 1.7.2.7

* handle language if its not id, or english

* update creditcard config when handle nil

* pre-release 1.7.3

* update remove raygun

*  remove temporary raygun

* changes alignment for numbers

* add klikpay new instruction

* update

* Development (#327)

* fixing with adding BNI_VA to plist

* update gopay and paymentlist

* update to 1.9.4

* update

* update BCA VA
update localized about BNI

* updaet vtclasshelper for language

* update

* update mdordercontroller

* update transaction id

* revert to payment normal

* update expire time

* update

* update paymentlist

* update

* update-> TNC bni point

* update

* update fix crash on promos

* update sandbox

* simulate otherVA

* update midtransorderviewcontorller

* update payment order

* bump version to 1.9.5

* update

* update kioson, indomaret

* update virtual account number -> payment code

* change wording when bin is not applicable

* update translation for wrong

* update development expiry date credit card

* update credit card helper

* update

* prepare for release 1.10.0

* bump version to 1.10.0

* update

* update

* update midtrans ui cell to get the promo badge

* update

* update

* update

* Feature/mob 1549 check bin update snap (#332)

* combine local son loading with snap api call

* use only api call for bin number update

* refine

* load local first at view didload for new creditcard view controller

* fix instalment available match bin number method

* update move to mainthread

* update

* update

* update

* move some BINs from bni to bni_debit_online (#334)

* extract and add merchant id from v2response, for mixpanel tracking (#335)

* Bugfix/mob 1549 fix check bin threading (#333)

* fix instalment view threading

* add weak self for configure installment threading

* add transaction id tracking (#339)

* add transaction id tracking

* fix transaction id and order id tracking

* prevent nil

* fix add entries

* fix order id

* fix lower case track event name

* add enabled payments as default parameters for tracking manager (#337)

* add enabled payments as default parameters for tracking manager

* change tracking prefix

* fix lower case without underscore

* Feature/mob 1573 track 1click2click (#341)

* add track event 1 click 2 click additional parameters

* fix 1 click 2 click token available tracking

* fix code convention format

* Feature/mob 1578 tracking installment (#342)

* add installment available and required on tracking manager

* fix installment tracking

* fix installment tracking on load

* add installment tracking on did load for saved card

* fix lower case

* remove this as we no longer use user defaults to store installment data, instead we send it directly on view did load (#343)

* update

* put ui modification code on resetInstallmentIndex to main thread, (#344)

* put ui modification code on resetInstallmentIndex to main thread,
add additional data properly for payment status success

* use strong self

* update

* update

* Feature/mob 1573 add missing properties 1click 2click (#345)

* add missing 1 click 2 click properties for mixpanel tracking on pg success

* add missing installment properties on pg success

* prevent scroll collection view when index is out of bounds (#346)

* self explanatory (#347)

* Bugfix/mob 1573 mixpanel pg success  (#349)

* fix one click two click with user defaults

* prevent add-on addition nil

* bump version to 1.11.0

* update

* Refactor/mob 1608 danamon instruction (#350)

* add first two instruction

* make cell color grey depending index is even/odd

* reduce space on danamon online view controller between sub guide and header instruction label

* Refactor/mob 1609 indomaret post payment (#351)

* make indomaret view controller ui like android, extract to MIDPaymentIndomaretViewController

* resolve conflict between danamon online and indomaret refactoring

* update podpecs

* Development (#352)

* fixing with adding BNI_VA to plist

* update gopay and paymentlist

* update to 1.9.4

* update

* update BCA VA
update localized about BNI

* updaet vtclasshelper for language

* update

* update mdordercontroller

* update transaction id

* revert to payment normal

* update expire time

* update

* update paymentlist

* update

* update-> TNC bni point

* update

* update fix crash on promos

* update sandbox

* simulate otherVA

* update midtransorderviewcontorller

* update payment order

* bump version to 1.9.5

* update

* update kioson, indomaret

* update virtual account number -> payment code

* change wording when bin is not applicable

* update translation for wrong

* update development expiry date credit card

* update credit card helper

* update

* prepare for release 1.10.0

* bump version to 1.10.0

* update

* update

* update midtrans ui cell to get the promo badge

* update

* update

* update

* Feature/mob 1549 check bin update snap (#332)

* combine local son loading with snap api call

* use only api call for bin number update

* refine

* load local first at view didload for new creditcard view controller

* fix instalment available match bin number method

* update move to mainthread

* update

* update

* update

* move some BINs from bni to bni_debit_online (#334)

* extract and add merchant id from v2response, for mixpanel tracking (#335)

* Bugfix/mob 1549 fix check bin threading (#333)

* fix instalment view threading

* add weak self for configure installment threading

* add transaction id tracking (#339)

* add transaction id tracking

* fix transaction id and order id tracking

* prevent nil

* fix add entries

* fix order id

* fix lower case track event name

* add enabled payments as default parameters for tracking manager (#337)

* add enabled payments as default parameters for tracking manager

* change tracking prefix

* fix lower case without underscore

* Feature/mob 1573 track 1click2click (#341)

* add track event 1 click 2 click additional parameters

* fix 1 click 2 click token available tracking

* fix code convention format

* Feature/mob 1578 tracking installment (#342)

* add installment available and required on tracking manager

* fix installment tracking

* fix installment tracking on load

* add installment tracking on did load for saved card

* fix lower case

* remove this as we no longer use user defaults to store installment data, instead we send it directly on view did load (#343)

* update

* put ui modification code on resetInstallmentIndex to main thread, (#344)

* put ui modification code on resetInstallmentIndex to main thread,
add additional data properly for payment status success

* use strong self

* update

* update

* Feature/mob 1573 add missing properties 1click 2click (#345)

* add missing 1 click 2 click properties for mixpanel tracking on pg success

* add missing installment properties on pg success

* prevent scroll collection view when index is out of bounds (#346)

* self explanatory (#347)

* Bugfix/mob 1573 mixpanel pg success  (#349)

* fix one click two click with user defaults

* prevent add-on addition nil

* bump version to 1.11.0

* update

* Refactor/mob 1608 danamon instruction (#350)

* add first two instruction

* make cell color grey depending index is even/odd

* reduce space on danamon online view controller between sub guide and header instruction label

* Refactor/mob 1609 indomaret post payment (#351)

* make indomaret view controller ui like android, extract to MIDPaymentIndomaretViewController

* resolve conflict between danamon online and indomaret refactoring

* update podpecs

* Development (#364)

* update

* update

* update

* update fix object data on saved card

* update

* add 5 minute expiry for cc token (#357)

* update reduce gross amount

* update promo velocity error

* decreased gross amount price to 2k (#359)

* update

* Feature/mob 1632 add custom field (#361)

* one custom field

* add multiple input type option

* add new kind for mdalertviewcontroller

* link mdoptionmanager custom field value with the ones for demo merchant client request

* change total amount to 10k then display bank name and logo on saved card view (#360)

* fix nil value checking for custom field (#362)

* update order_id

* update order-id

* fix setting midtrans transaction expire time according to md option (#363)

* update

* update constant and bump version to 1.12.1

* add icon & guide file

* create akulaku payment object

* impl akulaku in corekit

* impl akulaku in corekit

* impl akulaku in uikit

* update pbxproj

* update payment list

* update client key

* Feature/fix some issues (#385)

* add icon for ipad

* fix spelling

* update Info.plist

* update podspec and doc for integrating akulaku

* Feature/refine gopay (#388)

* impl callback gopay

* fix gopay flow

* refine result handler

* refine handleGopayStatus

* bump version
  • Loading branch information
jukiginanjar authored Nov 5, 2018
1 parent 414be5a commit 105c573
Show file tree
Hide file tree
Showing 15 changed files with 153 additions and 48 deletions.
14 changes: 14 additions & 0 deletions MidtransCoreKit/MidtransCoreKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
0CB8B7C8206B55C10067A0B8 /* MidtransPromoPromos.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CB8B7BB206B558D0067A0B8 /* MidtransPromoPromos.h */; settings = {ATTRIBUTES = (Public, ); }; };
0CB8B7C9206B55C10067A0B8 /* MidtransPromoResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CB8B7BD206B558D0067A0B8 /* MidtransPromoResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
3D85847D2111C52500899462 /* MidtransCoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E5CDEC8A1E9340CA0032DC3B /* MidtransCoreKit.framework */; };
DD1F2A50218AD29100D73039 /* MIDUrlHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = DD1F2A4E218AD29100D73039 /* MIDUrlHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD1F2A51218AD29100D73039 /* MIDUrlHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = DD1F2A4E218AD29100D73039 /* MIDUrlHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD1F2A52218AD29100D73039 /* MIDUrlHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = DD1F2A4F218AD29100D73039 /* MIDUrlHandler.m */; };
DD1F2A53218AD29100D73039 /* MIDUrlHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = DD1F2A4F218AD29100D73039 /* MIDUrlHandler.m */; };
DD1F2A54218AD29100D73039 /* MIDUrlHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = DD1F2A4F218AD29100D73039 /* MIDUrlHandler.m */; };
E546D1F9217EFF4C006D4650 /* MidtransPaymentAkulaku.h in Headers */ = {isa = PBXBuildFile; fileRef = E546D1F7217EFF4B006D4650 /* MidtransPaymentAkulaku.h */; settings = {ATTRIBUTES = (Public, ); }; };
E546D1FA217EFF4C006D4650 /* MidtransPaymentAkulaku.h in Headers */ = {isa = PBXBuildFile; fileRef = E546D1F7217EFF4B006D4650 /* MidtransPaymentAkulaku.h */; settings = {ATTRIBUTES = (Public, ); }; };
E546D1FB217EFF4C006D4650 /* MidtransPaymentAkulaku.m in Sources */ = {isa = PBXBuildFile; fileRef = E546D1F8217EFF4B006D4650 /* MidtransPaymentAkulaku.m */; };
Expand Down Expand Up @@ -437,6 +442,8 @@
30D9ABFA1C76FD1D00F858AE /* MidtransNetworkOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MidtransNetworkOperation.h; sourceTree = "<group>"; };
30D9ABFB1C76FD1D00F858AE /* MidtransNetworkOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MidtransNetworkOperation.m; sourceTree = "<group>"; };
3D8584782111C52500899462 /* MidtransCoreKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MidtransCoreKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
DD1F2A4E218AD29100D73039 /* MIDUrlHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MIDUrlHandler.h; sourceTree = "<group>"; };
DD1F2A4F218AD29100D73039 /* MIDUrlHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MIDUrlHandler.m; sourceTree = "<group>"; };
E50D85D21D0EC64E00F26D2E /* MidtransPaymentMandiriECash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MidtransPaymentMandiriECash.h; sourceTree = "<group>"; };
E50D85D31D0EC64E00F26D2E /* MidtransPaymentMandiriECash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MidtransPaymentMandiriECash.m; sourceTree = "<group>"; };
E50D85E31D0ECB7000F26D2E /* MidtransPaymentBCAKlikpay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MidtransPaymentBCAKlikpay.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -859,6 +866,8 @@
E5FBC7F01E39E3FF006B574D /* MidtransNetworkLogger.m */,
00B827761DDAC76800E5AC17 /* MidtransDeviceHelper.h */,
00B827771DDAC76800E5AC17 /* MidtransDeviceHelper.m */,
DD1F2A4E218AD29100D73039 /* MIDUrlHandler.h */,
DD1F2A4F218AD29100D73039 /* MIDUrlHandler.m */,
);
name = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -953,6 +962,7 @@
E57120581E937A790064F515 /* SNPPointDataModels.h in Headers */,
E57120591E937A790064F515 /* SNPPointResponse.h in Headers */,
E571205A1E937A790064F515 /* MidtransBinDataModels.h in Headers */,
DD1F2A51218AD29100D73039 /* MIDUrlHandler.h in Headers */,
E571205B1E937A790064F515 /* MidtransBinResponse.h in Headers */,
E571205C1E937A790064F515 /* MidtransTransactionExpire.h in Headers */,
E571205D1E937A790064F515 /* MidtransPromo.h in Headers */,
Expand Down Expand Up @@ -1047,6 +1057,7 @@
E55F635B1E934C4700C012C8 /* MidtransCreditCardConfig.h in Headers */,
E55F635C1E934C4700C012C8 /* MidtransHelper.h in Headers */,
E55F635D1E934C4700C012C8 /* MidtransNetworking.h in Headers */,
DD1F2A50218AD29100D73039 /* MIDUrlHandler.h in Headers */,
E55F635E1E934C4700C012C8 /* MidtransNetworkOperation.h in Headers */,
E55F635F1E934C4700C012C8 /* MidtransNetworkLogger.h in Headers */,
E55F63601E934C4700C012C8 /* MidtransDeviceHelper.h in Headers */,
Expand Down Expand Up @@ -1239,6 +1250,7 @@
buildActionMask = 2147483647;
files = (
E546D1FD217EFF4C006D4650 /* MidtransPaymentAkulaku.m in Sources */,
DD1F2A54218AD29100D73039 /* MIDUrlHandler.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1305,6 +1317,7 @@
E57120341E937A2C0064F515 /* MidtransPaymentBankTransfer.m in Sources */,
E57120351E937A2C0064F515 /* MidtransPaymentCIMBClicks.m in Sources */,
E57120361E937A2C0064F515 /* MidtransTransaction.m in Sources */,
DD1F2A53218AD29100D73039 /* MIDUrlHandler.m in Sources */,
0C1B35DC1ED6B3A7003F6806 /* SNPFreeTextPayment.m in Sources */,
E57120371E937A2C0064F515 /* MidtransTransactionDetails.m in Sources */,
E57120381E937A2C0064F515 /* MidtransTokenizeRequest.m in Sources */,
Expand Down Expand Up @@ -1394,6 +1407,7 @@
E55F63D51E934C6400C012C8 /* MidtransPaymentXLTunai.m in Sources */,
E55F63D61E934C6400C012C8 /* MidtransPaymentIndosatDompetku.m in Sources */,
E55F63D71E934C6400C012C8 /* MidtransPaymentKiosOn.m in Sources */,
DD1F2A52218AD29100D73039 /* MIDUrlHandler.m in Sources */,
E55F63D81E934C6400C012C8 /* MIdtransPaymentGCI.m in Sources */,
0C313E1E1FCD2C5A0074366F /* MidtransPaymentGOPAY.m in Sources */,
E5711FF41E9379950064F515 /* SNPPointResponse.m in Sources */,
Expand Down
19 changes: 19 additions & 0 deletions MidtransCoreKit/MidtransCoreKit/MIDUrlHandler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// MIDUrlHandler.h
// MidtransCoreKit
//
// Created by Muhammad.Masykur on 01/11/18.
// Copyright © 2018 Midtrans. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface MIDUrlHandler : NSObject

+ (void)handleUrl:(NSURL *)url;

@end

NS_ASSUME_NONNULL_END
24 changes: 24 additions & 0 deletions MidtransCoreKit/MidtransCoreKit/MIDUrlHandler.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// MIDUrlHandler.m
// MidtransCoreKit
//
// Created by Muhammad.Masykur on 01/11/18.
// Copyright © 2018 Midtrans. All rights reserved.
//

#import "MIDUrlHandler.h"
#import "MidtransConstant.h"

@implementation MIDUrlHandler

+ (void)handleUrl:(NSURL *)url {
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
for (NSString *param in [url.query componentsSeparatedByString:@"&"]) {
NSArray *elts = [param componentsSeparatedByString:@"="];
if([elts count] < 2) continue;
[params setObject:[elts lastObject] forKey:[elts firstObject]];
}

[[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_GOPAY_STATUS object:params];
}
@end
1 change: 1 addition & 0 deletions MidtransCoreKit/MidtransCoreKit/MidtransConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
@property (nonatomic) NSString *customBCASubcompanyCode;
@property (nonatomic) NSString *customPermataVARecipientName;
@property (nonatomic) NSString *customBNIVANumber;
@property (nonatomic) NSString *callbackSchemeURL;

@property (nonatomic) NSArray *customPaymentChannels;
@property (nonatomic) NSDictionary *customFreeText;
Expand Down
1 change: 1 addition & 0 deletions MidtransCoreKit/MidtransCoreKit/MidtransCoreKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ FOUNDATION_EXPORT const unsigned char MidtransCoreKitVersionString[];
#import "MidtransPaymentGOPAY.h"
#import "MidtransPaymentDanamonOnline.h"
#import "MidtransPromoDataModels.h"
#import "MIDUrlHandler.h"
6 changes: 6 additions & 0 deletions MidtransCoreKit/MidtransCoreKit/MidtransMerchantClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,12 @@ - (void)requestTransactionTokenWithTransactionDetails:(nonnull MidtransTransacti
dictionaryParameters[@"enabled_payments"] = CONFIG.customPaymentChannels;
}

if ([CONFIG callbackSchemeURL].length > 0) {
NSDictionary *gopay = @{@"enable_callback": @YES,
@"callback_url": [CONFIG callbackSchemeURL]};
dictionaryParameters[@"gopay"] = gopay;
}

NSError *error;
if (![customerDetails isValidCustomerData:&error]) {
if (completion) completion (nil, error);
Expand Down
6 changes: 3 additions & 3 deletions MidtransCoreKit/MidtransCoreKit/MidtransTransactionResult.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ @interface MidtransTransactionResult()
@property (nonatomic, readwrite) NSString *indomaretPaymentCode;
@property (nonatomic, readwrite) NSString *kiosonExpireTime;
@property (nonatomic, readwrite) NSString *mandiriBillpayCode;
@property (nonatomic,readwrite) NSString *qrcodeUrl;
@property (nonatomic,readwrite) NSString *deeplinkUrl;
@property (nonatomic, readwrite) NSString *qrcodeUrl;
@property (nonatomic, readwrite) NSString *deeplinkUrl;
@property (nonatomic, readwrite) NSString *mandiriBillpayCompanyCode;
@property (nonatomic, readwrite) NSString *virtualAccountNumber;

@property (nonatomic, readwrite) NSURL *redirectURL;

@end

@implementation MidtransTransactionResult
Expand Down
8 changes: 7 additions & 1 deletion MidtransDemo/MidtransDemo/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ - (void)applicationDidEnterBackground:(UIApplication *)application {


- (void)applicationWillEnterForeground:(UIApplication *)application {
[[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_GOPAY_STATUS object:self];


}

Expand All @@ -113,5 +113,11 @@ - (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
NSLog(@"URL: %@", url);
[MIDUrlHandler handleUrl:url];

return YES;
}

@end
15 changes: 14 additions & 1 deletion MidtransDemo/MidtransDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,21 @@
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.11.1</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>None</string>
<key>CFBundleURLName</key>
<string>com.midtrans.demo</string>
<key>CFBundleURLSchemes</key>
<array>
<string>demo.midtrans</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>73</string>
<string>74</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
1 change: 1 addition & 0 deletions MidtransDemo/MidtransDemo/MDAddCardViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#import <ACFloatingTextfield_Objc/ACFloatingTextField.h>
#import <CHRTextFieldFormatter/CHRTextFieldFormatter.h>
#import <CHRTextFieldFormatter/CHRCardNumberMask.h>

@interface MDAddCardViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet ACFloatingTextField *cardNumberTextFIeld;
@property (nonatomic, strong) CHRTextFieldFormatter *cardNumberFormatter;
Expand Down
45 changes: 26 additions & 19 deletions MidtransDemo/MidtransDemo/MDOrderViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ - (void)viewWillAppear:(BOOL)animated {
- (void)viewDidLoad {
[super viewDidLoad];

self.totalAmount = @(10000.55);
self.totalAmount = @(1);
NSString *formattedPrice = [self formattedISOCurrencyNumber:self.totalAmount];
self.totalAmountLabel.text = self.pricePerItemLabel.text = formattedPrice;
[self.payButton setTitle:[NSString stringWithFormat:@"Pay %@", formattedPrice] forState:UIControlStateNormal];
Expand All @@ -60,24 +60,29 @@ - (void)viewDidLoad {
self.progressHUD = [JGProgressHUD progressHUDWithStyle:JGProgressHUDStyleDark];
self.progressHUD.textLabel.text = @"Loading...";

NSString *clientkey;
NSString *merchantServer;
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;
break;
default:
clientkey = @"SB-Mid-client-txZHOj6jPP0_G8En";
merchantServer = @"https://dev-mobile-store.herokuapp.com/";
CC_CONFIG.tokenStorageEnabled = YES;
break;
}
[CONFIG setClientKey:clientkey
environment:MidtransServerEnvironmentSandbox
merchantServerURL:merchantServer];
// NSString *clientkey;
// NSString *merchantServer;
// 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;
// break;
// default:
// clientkey = @"SB-Mid-client-txZHOj6jPP0_G8En";
// merchantServer = @"https://dev-mobile-store.herokuapp.com/";
// CC_CONFIG.tokenStorageEnabled = YES;
// break;
// }
// [CONFIG setClientKey:clientkey
// environment:MidtransServerEnvironmentSandbox
// merchantServerURL:merchantServer];

[CONFIG setClientKey:@"VT-client-yrHf-c8Sxr-ck8tx"
environment:MidtransServerEnvironmentProduction
merchantServerURL:@"https://midtrans-mobile-snap.herokuapp.com"];


//forced to use token storage
UICONFIG.hideStatusPage = NO;
Expand All @@ -104,6 +109,8 @@ - (void)viewDidLoad {
CONFIG.customPermataVANumber = [MDOptionManager shared].permataVAOption.value;
[[MidtransNetworkLogger shared] startLogging];

CONFIG.callbackSchemeURL = @"demo.midtrans://";

self.amountView.backgroundColor = [UIColor mdThemeColor];
__weak MDOrderViewController *wself = self;
defaults_observe_object(@"md_color", ^(NSNotification *note) {
Expand Down
2 changes: 1 addition & 1 deletion MidtransDemo/MidtransDemo/MDProductViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ - (void)viewDidLoad {

CONFIG.currency = [MidtransHelper currencyFromString:[MDOptionManager shared].currencyOption.value];
self.title = @"Product Detail";
NSNumber *price = @(10000.55);
NSNumber *price = @(1);
self.priceLabel.text = [self formattedISOCurrencyNumber:price];
self.navigationItem.backBarButtonItem =
[[UIBarButtonItem alloc] initWithTitle:@""
Expand Down
53 changes: 33 additions & 20 deletions MidtransKit/MidtransKit/classes/MidGopayViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ @interface MidGopayViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic) MidtransDirectHeader *headerView;
@end

@implementation MidGopayViewController
@implementation MidGopayViewController {
MidtransTransactionResult *payResult;
}

@dynamic view;
- (instancetype)initWithToken:(MidtransTransactionTokenResponse *)token
paymentMethodName:(MidtransPaymentListModel *)paymentMethod
Expand All @@ -42,7 +45,7 @@ - (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
NSLog(@"view did appear");
}
- (void)handleGopayStatus{
- (void)handleGopayStatus:(id)sender {
[[MidtransMerchantClient shared] performCheckStatusTransactionWcompletion:^(MidtransTransactionResult * _Nullable result, NSError * _Nullable error) {
if (!error) {
if (result.statusCode == 200) {
Expand All @@ -56,8 +59,9 @@ - (void)handleGopayStatus{
}
- (void)viewDidLoad {
[super viewDidLoad];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleGopayStatus)
selector:@selector(handleGopayStatus:)
name:NOTIFICATION_GOPAY_STATUS
object:nil];

Expand All @@ -81,15 +85,15 @@ - (void)viewDidLoad {
self.view.topWrapperView.hidden = YES;
self.view.topNoticeLabel.text = [VTClassHelper getTranslationFromAppBundleForString:@"Please complete your ‘GO-PAY‘ payment via ‘GO-JEK‘ app"];
} else {
NSURL *gojekUrl = [NSURL URLWithString:MIDTRANS_GOPAY_PREFIX];
if ([[UIApplication sharedApplication] canOpenURL:gojekUrl]) {
self.view.finishPaymentHeightConstraints.constant = 0.0f;
self.view.topWrapperView.hidden = NO;
self.view.transactionBottomDetailConstraints.constant = 0.0f;

} else {
self.view.topWrapperView.hidden = YES;
self.view.gopayTopViewHeightConstraints.constant = 0.0f;
NSURL *gojekUrl = [NSURL URLWithString:MIDTRANS_GOPAY_PREFIX];
if ([[UIApplication sharedApplication] canOpenURL:gojekUrl]) {
self.view.gopayTopViewHeightConstraints.constant = 0.0f;
self.view.topWrapperView.hidden = YES;
} else {
self.view.topWrapperView.hidden = NO;
self.view.transactionBottomDetailConstraints.constant = 0.0f;
self.view.finishPaymentHeightConstraints.constant = 0.0f;
}
}

Expand Down Expand Up @@ -190,7 +194,19 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa
- (IBAction)installGOJEKappButtonDidTapped:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:GOJEK_APP_ITUNES_LINK]];
}
- (void)openGojekAppWithResult:(MidtransTransactionResult *)result {
NSURL *gojekConstructURL = [NSURL URLWithString:[result.additionalData objectForKey:@"deeplink_url"]];
if ([[UIApplication sharedApplication] canOpenURL:gojekConstructURL]) {
[[UIApplication sharedApplication] openURL:gojekConstructURL];
}
}

- (IBAction)finishPaymentButtonDidTapped:(id)sender {
if (payResult) {
[self openGojekAppWithResult:payResult];
return;
}

[self showLoadingWithText:[VTClassHelper getTranslationFromAppBundleForString:@"Processing your transaction"]];
id<MidtransPaymentDetails>paymentDetails;
paymentDetails = [[MidtransPaymentGOPAY alloc] init];
Expand All @@ -210,17 +226,14 @@ - (IBAction)finishPaymentButtonDidTapped:(id)sender {
} else {
NSDictionary *userInfo = @{TRANSACTION_RESULT_KEY:result};
[[NSNotificationCenter defaultCenter] postNotificationName:TRANSACTION_PENDING object:nil userInfo:userInfo];
NSURL *gojekConstructURL = [NSURL URLWithString:[result.additionalData objectForKey:@"deeplink_url"]];
if ([[UIApplication sharedApplication] canOpenURL:gojekConstructURL]) {
[[UIApplication sharedApplication] openURL:gojekConstructURL];
}

payResult = result;

[self openGojekAppWithResult:result];

if (UICONFIG.hideStatusPage) {
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
} else {
[self handleGopayStatus];
}

}

}
Expand Down
2 changes: 1 addition & 1 deletion Podpecs/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.14.0"
s.version = "1.14.1"
s.summary = "Veritrans mobile SDK beta version"
s.homepage = "https://veritrans.co.id/"
s.license = 'MIT'
Expand Down
Loading

0 comments on commit 105c573

Please sign in to comment.