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

Fix Xcode 12 build #297

Merged
merged 1 commit into from
Nov 10, 2020
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: 1 addition & 1 deletion RazorpayCheckout.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RazorpayCheckout {
rejectFn(data);
removeSubscriptions();
});
NativeModules.RazorpayCheckout.open(options);
NativeModules.RNRazorpayCheckout.open(options);
});
}
static onExternalWalletSelection(externalWalletCallback) {
Expand Down
8 changes: 4 additions & 4 deletions android/src/main/java/com/razorpay/rn/RazorpayModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public RazorpayModule(ReactApplicationContext reactContext) {

@Override
public String getName() {
return "RazorpayCheckout";
return "RNRazorpayCheckout";
}

@ReactMethod
Expand All @@ -65,7 +65,7 @@ public void open(ReadableMap options) {
currentActivity.startActivityForResult(intent, Checkout.RZP_REQUEST_CODE);
} catch (Exception e) {}
}

public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
onActivityResult(requestCode, resultCode, data);
}
Expand All @@ -85,7 +85,7 @@ private void sendEvent(String eventName, WritableMap params) {

@Override
public void onPaymentSuccess(String razorpayPaymentId, PaymentData paymentData) {
sendEvent("Razorpay::PAYMENT_SUCCESS", Utils.jsonToWritableMap(paymentData.getData()));
sendEvent("Razorpay::PAYMENT_SUCCESS", Utils.jsonToWritableMap(paymentData.getData()));
}

@Override
Expand All @@ -100,7 +100,7 @@ public void onPaymentError(int code, String description, PaymentData paymentData
sendEvent("Razorpay::PAYMENT_ERROR", Utils.jsonToWritableMap(paymentDataJson));
}

@Override
@Override
public void onExternalWalletSelected(String walletName, PaymentData paymentData){
sendEvent("Razorpay::EXTERNAL_WALLET_SELECTED", Utils.jsonToWritableMap(paymentData.getData()));
}
Expand Down
2 changes: 1 addition & 1 deletion ios/RazorpayCheckout.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

#import "RCTBridgeModule.h"

@interface RazorpayCheckout : NSObject <RCTBridgeModule>
@interface RNRazorpayCheckout : NSObject <RCTBridgeModule>

@end
8 changes: 4 additions & 4 deletions ios/RazorpayCheckout.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@

typedef RazorpayCheckout Razorpay;

@interface RazorpayCheckout () <RazorpayPaymentCompletionProtocolWithData,
@interface RNRazorpayCheckout () <RazorpayPaymentCompletionProtocolWithData,
ExternalWalletSelectionProtocol>

@end

@implementation RazorpayCheckout
@implementation RNRazorpayCheckout

RCT_EXPORT_MODULE()

RCT_EXPORT_METHOD(open : (NSDictionary *)options) {

NSString *keyID = (NSString *)[options objectForKey:@"key"];
dispatch_sync(dispatch_get_main_queue(), ^{
Razorpay *razorpay = [Razorpay initWithKey:keyID
andDelegateWithData:self];
[razorpay setExternalWalletSelectionDelegate:self];

NSMutableDictionary * tempOptions = [[NSMutableDictionary alloc] initWithDictionary:options];
// tempOptions[@"integration_version"] = [self findReactNativeVersion];
tempOptions[@"integration"] = @"react-native";
Expand Down