Skip to content

Commit

Permalink
Fixed skipScreenOptions for Android and iOS after checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
ital0 committed Mar 16, 2018
1 parent 7fed1c8 commit a82e393
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ios/RNSumUp.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ @implementation RCTConvert (SMPPaymentOptions)

@end

@implementation RCTConvert (SMPSkipScreenOptions)
RCT_ENUM_CONVERTER(SMPSkipScreenOptions, (@{@"1" : @(SMPSkipScreenOptionSuccess)}), SMPSkipScreenOptionSuccess, integerValue);
@end

@implementation RNSumUp

- (NSDictionary *)constantsToExport
Expand Down Expand Up @@ -116,10 +120,13 @@ - (NSDictionary *)constantsToExport
NSString *title = [RCTConvert NSString:request[@"title"]];
NSString *currencyCode = [RCTConvert NSString:request[@"currencyCode"]];
NSUInteger paymentOption = [RCTConvert SMPPaymentOptions:request[@"paymentOption"]];
NSUInteger skipScreen = [RCTConvert SMPSkipScreenOptions:@"1"];

SMPCheckoutRequest *checkoutRequest = [SMPCheckoutRequest requestWithTotal:total
title:title
currencyCode:currencyCode
paymentOptions:paymentOption];
checkoutRequest.skipScreenOptions = skipScreen;
dispatch_sync(dispatch_get_main_queue(), ^{
UIViewController *rootViewController = UIApplication.sharedApplication.delegate.window.rootViewController;
[SMPSumUpSDK checkoutWithRequest:checkoutRequest
Expand Down

0 comments on commit a82e393

Please sign in to comment.