Skip to content

Commit

Permalink
Updated SDK version to 2.0.2 (#66)
Browse files Browse the repository at this point in the history
* Updated SDK version to 2.0.2

* Updated .podspec version

* Added method for Bank app checking and updated main PBBA bank invoke method

* Renamed banking check method to keep consistency with Android

* Updated sample app

* Added unit tests for new methods
  • Loading branch information
mpetrenco authored Aug 18, 2020
1 parent 337b97d commit 60edf22
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ - (void)handleResponse:(JPResponse *)response error:(NSError *)error {
if (!response) {
return;
}

if ([response.paymentMethod isEqualToString:@"PBBA"] && !response.orderDetails.orderStatus) {
return;
}

__weak typeof(self) weakSelf = self;
[self dismissViewControllerAnimated:YES completion:^{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ @implementation PBBAViewController

- (void)viewDidLoad {
[super viewDidLoad];
[self createButtonProgrammatically];
if (JudoKit.isBankingAppAvailable) {
[self createButtonProgrammatically];
} else {
self.orderIdSuffixLabel.text = @"No PBBA Bank App Found.";
self.orderIdSuffixLabel.hidden = NO;
}
}

- (IBAction)didTapCheckStatus:(id)sender {
Expand Down
4 changes: 2 additions & 2 deletions Examples/ObjectiveCExampleApp/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PODS:
- CocoaDebug (1.3.3)
- DeviceDNA (1.1.2)
- InAppSettingsKit (2.15)
- JudoKit-iOS (2.0.1):
- JudoKit-iOS (2.0.2):
- DeviceDNA
- PayCardsRecognizer
- TrustKit
Expand Down Expand Up @@ -33,7 +33,7 @@ SPEC CHECKSUMS:
CocoaDebug: 610b36f29558ac74fa5653fbbbd1574fc7de54ed
DeviceDNA: 3e72fd28d345a5aa6f218af4287cb46dc74b62cb
InAppSettingsKit: 4890a44f9df7a1742c632920f0ea939cbeb29ea2
JudoKit-iOS: fafc3613c9b7e0d7e3d21e36e3a9a125852d2fa3
JudoKit-iOS: 86ed9835729914f9405afb9084e89ff6d273f2bd
PayCardsRecognizer: 2e4d1b2fdd5f1528fb56064a91e1d58a1af7a2db
TrustKit: 073855e3adecd317417bda4ac9e9ac54a2e3b9f2
ZappMerchantLib: b14bc5814840426d351190309250347ca9b0983d
Expand Down
2 changes: 1 addition & 1 deletion JudoKit-iOS.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'JudoKit-iOS'
s.version = '2.0.1'
s.version = '2.0.2'
s.summary = 'Judo Pay Full iOS Client Kit'
s.homepage = 'https://www.judopay.com/'
s.license = 'MIT'
Expand Down
8 changes: 4 additions & 4 deletions JudoKit_iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3407,7 +3407,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2.0.0;
CURRENT_PROJECT_VERSION = 2.0.2;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_CURRENT_VERSION = 2.0.0;
ENABLE_BITCODE = YES;
Expand Down Expand Up @@ -3469,7 +3469,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2.0.0;
CURRENT_PROJECT_VERSION = 2.0.2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_CURRENT_VERSION = 2.0.0;
ENABLE_BITCODE = YES;
Expand Down Expand Up @@ -3526,7 +3526,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
MODULEMAP_FILE = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.judopay.JudoKit-iOS";
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
Expand Down Expand Up @@ -3574,7 +3574,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.0.1;
MARKETING_VERSION = 2.0.2;
MODULEMAP_FILE = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.judopay.JudoKit-iOS";
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
Expand Down
11 changes: 11 additions & 0 deletions JudoKit_iOSTests/JudoKitTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,15 @@ class JudoKitTest: XCTestCase {
})
waitForExpectations(timeout: 3, handler: nil)
}

/*
* GIVEN: the user wants to check for PBBA supported bank apps
*
* WHEN: the SDK is running on an emulator
*
* THEN: the method should return false
*/
func test_OnBankingAppCheck_WhenRunningEmulator_ReturnFalse() {
XCTAssertFalse(JudoKit.isBankingAppAvailable())
}
}
11 changes: 11 additions & 0 deletions JudoKit_iOSTests/Sevices/PBBA/JPPBBAServiceTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,15 @@ class JPPBBAServiceTest: XCTestCase {
waitForExpectations(timeout: 3, handler: nil)
}

/*
* GIVEN: the user wants to check for PBBA supported bank apps
*
* WHEN: the SDK is running on an emulator
*
* THEN: the method should return false
*/
func test_OnBankingAppCheck_WhenRunningEmulator_ReturnFalse() {
XCTAssertFalse(JPPBBAService.isBankingAppAvailable())
}

}
7 changes: 7 additions & 0 deletions Source/JudoKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ static NSString *__nonnull const JudoKitVersion = @"2.0.1";
configuration:(nonnull JPConfiguration *)configuration
completion:(nullable JPCompletionBlock)completion;

/**
* A method used to determine if there are any PBBA supported bank apps installed on the device
*
* @returns true - if a bank app has been found, false otherwise
*/
+ (bool)isBankingAppAvailable;

/**
* A method which invokes the PBBA which allows users to make pay by bank transactions.
*
Expand Down
4 changes: 4 additions & 0 deletions Source/JudoKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ - (UIViewController *)applePayViewControllerWithMode:(JPTransactionMode)mode
completion:completion];
}

+ (bool)isBankingAppAvailable {
return JPPBBAService.isBankingAppAvailable;
}

- (void)invokePBBAWithConfiguration:(nonnull JPConfiguration *)configuration
completion:(nullable JPCompletionBlock)completion {

Expand Down
7 changes: 7 additions & 0 deletions Source/Services/PBBA/JPPBBAService.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
- (nonnull instancetype)initWithConfiguration:(nonnull JPConfiguration *)configuration
apiService:(nonnull JPApiService *)apiService;

/**
* A method used to determine if there are any PBBA supported bank apps installed on the device
*
* @returns true - if a bank app has been found, false otherwise
*/
+ (bool)isBankingAppAvailable;

/**
* Method used for returning a redirect URL based on the PBBA
*
Expand Down
15 changes: 7 additions & 8 deletions Source/Services/PBBA/JPPBBAService.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ - (void)dealloc {

#pragma mark - Public methods

+ (bool)isBankingAppAvailable {
return PBBAAppUtils.isCFIAppAvailable;
}

- (void)openPBBAMerchantApp:(JPCompletionBlock)completion {

JPBankOrderSaleRequest *request = [JPBankOrderSaleRequest pbbaRequestWithConfiguration:self.configuration];
Expand All @@ -88,14 +92,9 @@ - (void)openPBBAMerchantApp:(JPCompletionBlock)completion {
- (void)handlePBBAResponse:(JPResponse *)response completion:(JPCompletionBlock)completion {
if (response.rawData[@"secureToken"] && response.rawData[@"pbbaBrn"]) {
NSString *secureToken = response.rawData[@"secureToken"];
NSString *brn = response.rawData[@"pbbaBrn"];

[PBBAAppUtils showPBBAPopup:UIApplication.topMostViewController
secureToken:secureToken
brn:brn
expiryInterval:0
delegate:nil];


[PBBAAppUtils openBankingApp:secureToken];

completion(response, nil);
} else {
completion(nil, JPError.judoResponseParseError);
Expand Down

0 comments on commit 60edf22

Please sign in to comment.