Skip to content

Commit

Permalink
CDS-2412 - Add sendcard flag in login success callback for step
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikunjp1904 committed Nov 5, 2024
1 parent fa5f559 commit 488423d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ public void onExit() {
}

@Override
public void onEvent(String eventName, String merchantName, String taskId) {
public void onEvent(String eventName, String merchantName, String taskId, Boolean sendCard) {
WritableMap params = Arguments.createMap();
params.putString("event", eventName);
params.putString("merchant", merchantName);
if (taskId != null && !taskId.trim().isEmpty()) {
params.putString("taskId", taskId);
}
params.putBoolean("sendCard", sendCard != null ? sendCard : false);
sendEvent(getReactApplicationContext(), prefix + "onEvent", params);
}
};
Expand Down
5 changes: 3 additions & 2 deletions ios/Knotapi.mm
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ @implementation Knotapi
[strongSelf sendEventWithName:@"CardSwitcher-onSuccess" body:@{@"merchant": merchant}];
};

self.cardOnFileSwitcherSession.onEvent = ^(NSString * event, NSString * message, NSString * _Nullable taskId) {
self.cardOnFileSwitcherSession.onEvent = ^(NSString * event, NSString * message, NSString * _Nullable taskId, NSNumber * _Nullable sendCard) {
NSMutableDictionary *body = [@{@"event": event, @"merchant": message} mutableCopy];
if (taskId != nil) {
body[@"taskId"] = taskId;
}
body[@"sendCard"] = sendCard != nil ? sendCard : @NO;
Knotapi * strongSelf = weakSelf;
[strongSelf sendEventWithName:@"CardSwitcher-onEvent" body:body];
};
Expand Down Expand Up @@ -109,7 +110,7 @@ @implementation Knotapi
[strongSelf sendEventWithName:@"SubscriptionManager-onSuccess" body:@{@"merchant": merchant}];
};

self.subscriptionManagerSession.onEvent = ^(NSString * event, NSString * message, NSString * _Nullable taskId) {
self.subscriptionManagerSession.onEvent = ^(NSString * event, NSString * message, NSString * _Nullable taskId, NSNumber * _Nullable sendCard) {
NSMutableDictionary *body = [@{@"event": event, @"merchant": message} mutableCopy];
if (taskId != nil) {
body[@"taskId"] = taskId;
Expand Down

0 comments on commit 488423d

Please sign in to comment.