Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCLI-2 #8

Merged
merged 2 commits into from
Aug 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Library/Model/SPITransaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

- (NSInteger)getTipAmount;

- (NSInteger)getSurchargeAmount;

- (NSInteger)getCashoutAmount;

- (NSInteger)getBankNonCashAmount;
Expand Down
7 changes: 6 additions & 1 deletion Library/Model/SPITransaction.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ - (NSInteger)getBankCashAmount {
return [self.message getDataIntegerValue:@"bank_cash_amount"];
}

- (NSInteger)getSurchargeAmount {
return [self.message getDataIntegerValue:@"surcharge_amount"];
}

- (NSDictionary *)toPaymentSummary {
return @{
@"account_type": [self getAccountType],
Expand All @@ -181,7 +185,8 @@ - (NSDictionary *)toPaymentSummary {
@"scheme_name": _schemeName,
@"terminal_id": [self getTerminalId],
@"terminal_ref_id": [self getTerminalReferenceId],
@"tip_amount": [NSNumber numberWithInteger:[self getTipAmount]]
@"tip_amount": [NSNumber numberWithInteger:[self getTipAmount]],
@"surcharge_amount": [NSNumber numberWithInteger:[self getSurchargeAmount]]
};
}

Expand Down
8 changes: 1 addition & 7 deletions Library/SPIClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,7 @@ - (void)pairingCancel {
if (_state.flow != SPIFlowPairing || _state.pairingFlowState.isFinished) return;

if (_state.pairingFlowState.isAwaitingCheckFromPos && !_state.pairingFlowState.isAwaitingCheckFromEftpos) {
SPIMessage *message = [[[SPIDropKeysRequest alloc] init] toMessage];

__weak __typeof(& *self) weakSelf = self;

dispatch_async(self.queue, ^{
[weakSelf send:message];
});
[self send:[[[SPIDropKeysRequest alloc] init] toMessage]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you no longer doing this asynchronously? What changed?

Copy link
Contributor Author

@metinavc1 metinavc1 Aug 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is as follows.

When pairing with a terminal from an iOS library, if you confirm pairing from the POS but rejected from the terminal, the terminal shows a disconnected status when it should unpair itself from the terminal.

Terminal disconnected before unpaired.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, fair enough. Just checking that it was an intentional change.

}

[self onPairingFailed];
Expand Down