Skip to content

Commit

Permalink
Merge pull request #8 from khipu/ios
Browse files Browse the repository at this point in the history
Fixing ios issues
  • Loading branch information
NaNtrack authored May 4, 2020
2 parents 5afd2b6 + b223b17 commit 10e543e
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions ios/RNKhenshin.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#import "RNKhenshin.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
Expand All @@ -14,8 +13,6 @@ - (dispatch_queue_t)methodQueue

- (void) configureEngine {
@try {
__typeof(self) __weak welf = self;

[KhenshinInterface initWithBuilderBlock:^(KhenshinBuilder *builder) {
builder.APIUrl = @"https://khipu.com/app/enc/";
builder.allowCredentialsSaving = YES;
Expand Down Expand Up @@ -43,24 +40,21 @@ - (void) configureEngine {
: (RCTResponseSenderBlock) callback
) {
[[NSOperationQueue mainQueue] addOperationWithBlock:^{

if (![KhenshinInterface validateInitialization]) {

[self configureEngine];
}

[KhipuKhenshinInterface startEngineWithPaymentExternalId:paymentId
userIdentifier:@""
isExternalPayment:NO
animated:YES
success:^(NSURL *returnURL) {
DebugLog(@"¡Hemos vuelto!");
callback(@[ @"CONCILIATING", @"{\"success\": true}" ]);
}
failure:^(NSURL *returnURL) {
DebugLog(@"¡Hemos vuelto con error!");
callback(@[ @"TASK_DUMPED", @"{\"success\": false}" ]);
}];
[self configureEngine];
}

[KhenshinInterface startEngineWithPaymentExternalId:paymentId
userIdentifier:@""
isExternalPayment:NO
animated:YES
success:^(NSURL *returnURL) {
callback(@[ @"CONCILIATING", @"{\"success\": true}" ]);
}
failure:^(NSURL *returnURL) {
callback(@[ @"TASK_DUMPED", @"{\"success\": false}" ]);
}
];
}];
}

Expand Down

0 comments on commit 10e543e

Please sign in to comment.