@@ -23,14 +23,12 @@ public class ReactCardIOModule extends ReactContextBaseJavaModule implements Act
23
23
private android .widget .Toast mostRecentToast ;
24
24
private static final int REQUEST_CARD_SCAN = 10 ;
25
25
26
- private ReactApplicationContext reactContext ;
27
26
private Callback successCallback , failureCallback ;
28
27
private Promise promise ;
29
28
30
29
public ReactCardIOModule (ReactApplicationContext reactContext ) {
31
30
super (reactContext );
32
- this .reactContext = reactContext ;
33
- this .reactContext .addActivityEventListener (this );
31
+ getReactApplicationContext ().addActivityEventListener (this );
34
32
}
35
33
36
34
@ Override
@@ -52,7 +50,7 @@ public void canScan(Promise promise) throws JSONException {
52
50
public void scan (ReadableMap options , Promise promise ) {
53
51
this .promise = promise ;
54
52
55
- Intent scanIntent = new Intent (this . reactContext , CardIOActivity .class );
53
+ Intent scanIntent = new Intent (getReactApplicationContext () , CardIOActivity .class );
56
54
scanIntent .putExtra (CardIOActivity .EXTRA_REQUIRE_EXPIRY , this .getOptionBoolean (options , "requireExpiry" , false )); // default: false
57
55
scanIntent .putExtra (CardIOActivity .EXTRA_REQUIRE_CVV , this .getOptionBoolean (options , "requireCVV" , false )); // default: false
58
56
scanIntent .putExtra (CardIOActivity .EXTRA_REQUIRE_POSTAL_CODE , this .getOptionBoolean (options , "requirePostalCode" , false )); // default: false
@@ -69,7 +67,7 @@ public void scan(ReadableMap options, Promise promise) {
69
67
scanIntent .putExtra (CardIOActivity .EXTRA_SUPPRESS_CONFIRMATION , this .getOptionBoolean (options , "suppressConfirmation" , false )); // default: false
70
68
scanIntent .putExtra (CardIOActivity .EXTRA_HIDE_CARDIO_LOGO , this .getOptionBoolean (options , "hideCardIOLogo" , false )); // default: false
71
69
72
- this . reactContext .startActivityForResult (scanIntent , REQUEST_CARD_SCAN , null );
70
+ getReactApplicationContext () .startActivityForResult (scanIntent , REQUEST_CARD_SCAN , null );
73
71
}
74
72
75
73
@ Override
0 commit comments