react-native-cashfree-pg-sdk 2.0.0-dev.1 → 2.0.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -3
- package/android/src/main/java/com/reactnativecashfreepgsdk/CashfreePgApiModule.java +45 -3
- package/ios/CashfreePgApi.swift +2 -1
- package/lib/commonjs/index.js +23 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +23 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/index.d.ts +7 -1
- package/package.json +4 -4
- package/src/index.js +19 -2
- package/src/{index.tsx → index.ts} +39 -12
package/android/build.gradle
CHANGED
|
@@ -50,15 +50,14 @@ repositories {
|
|
|
50
50
|
}
|
|
51
51
|
google()
|
|
52
52
|
mavenCentral()
|
|
53
|
-
jcenter()
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
rootProject.allprojects {
|
|
57
56
|
repositories {
|
|
58
57
|
google()
|
|
59
58
|
mavenCentral()
|
|
60
|
-
jcenter()
|
|
61
59
|
maven { url 'https://maven.cashfree.com/release'}
|
|
60
|
+
maven { url 'https://maven.cashfree.com/development'}
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
|
|
@@ -69,7 +68,7 @@ dependencies {
|
|
|
69
68
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
|
70
69
|
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
|
71
70
|
|
|
72
|
-
implementation 'com.cashfree.pg:api:2.0.
|
|
71
|
+
implementation 'com.cashfree.pg:api:2.0.1-rc1'
|
|
73
72
|
|
|
74
73
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
75
74
|
}
|
|
@@ -4,8 +4,12 @@ import android.app.Activity;
|
|
|
4
4
|
import android.util.Log;
|
|
5
5
|
|
|
6
6
|
import androidx.annotation.NonNull;
|
|
7
|
+
import androidx.annotation.Nullable;
|
|
7
8
|
|
|
8
9
|
import com.cashfree.pg.api.CFPaymentGatewayService;
|
|
10
|
+
import com.cashfree.pg.cf_analytics.CFAnalyticsService;
|
|
11
|
+
import com.cashfree.pg.cf_analytics.CFEventsSubscriber;
|
|
12
|
+
import com.cashfree.pg.core.api.base.CFPayment;
|
|
9
13
|
import com.cashfree.pg.core.api.callback.CFCheckoutResponseCallback;
|
|
10
14
|
import com.cashfree.pg.core.api.exception.CFException;
|
|
11
15
|
import com.cashfree.pg.core.api.utils.CFErrorResponse;
|
|
@@ -20,8 +24,10 @@ import com.cashfree.pg.api.util.DropPaymentParser;
|
|
|
20
24
|
import org.json.JSONException;
|
|
21
25
|
import org.json.JSONObject;
|
|
22
26
|
|
|
27
|
+
import java.util.Map;
|
|
28
|
+
|
|
23
29
|
@ReactModule(name = CashfreePgApiModule.NAME)
|
|
24
|
-
public class CashfreePgApiModule extends ReactContextBaseJavaModule implements CFCheckoutResponseCallback {
|
|
30
|
+
public class CashfreePgApiModule extends ReactContextBaseJavaModule implements CFCheckoutResponseCallback, CFEventsSubscriber {
|
|
25
31
|
public static final String NAME = "CashfreePgApi";
|
|
26
32
|
|
|
27
33
|
public CashfreePgApiModule(ReactApplicationContext reactContext) {
|
|
@@ -40,8 +46,8 @@ public class CashfreePgApiModule extends ReactContextBaseJavaModule implements C
|
|
|
40
46
|
try {
|
|
41
47
|
Activity activity = getCurrentActivity();
|
|
42
48
|
CFDropCheckoutPayment cfDropCheckoutPayment = DropPaymentParser.getDropCheckoutPayment(cfPaymentString);
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
cfDropCheckoutPayment.setCfsdkFramework(CFPayment.CFSDKFramework.REACT_NATIVE);
|
|
50
|
+
cfDropCheckoutPayment.setCfSDKFlavour(CFPayment.CFSDKFlavour.DROP);
|
|
45
51
|
if (activity != null) {
|
|
46
52
|
CFPaymentGatewayService.getInstance().doPayment(activity, cfDropCheckoutPayment);
|
|
47
53
|
} else {
|
|
@@ -60,6 +66,22 @@ public class CashfreePgApiModule extends ReactContextBaseJavaModule implements C
|
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
|
|
69
|
+
@ReactMethod
|
|
70
|
+
public void setEventSubscriber() {
|
|
71
|
+
try {
|
|
72
|
+
CFAnalyticsService.getInstance().setSubscriber(this);
|
|
73
|
+
} catch (Exception ignored) {
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@ReactMethod
|
|
78
|
+
public void removeEventSubscriber() {
|
|
79
|
+
try {
|
|
80
|
+
CFAnalyticsService.getInstance().removeSubscriber();
|
|
81
|
+
} catch (Exception ignored) {
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
63
85
|
@Override
|
|
64
86
|
public void onPaymentVerify(String orderID) {
|
|
65
87
|
this.getReactApplicationContext()
|
|
@@ -80,4 +102,24 @@ public class CashfreePgApiModule extends ReactContextBaseJavaModule implements C
|
|
|
80
102
|
.getJSModule(RCTNativeAppEventEmitter.class)
|
|
81
103
|
.emit("cfFailure", jsonObject.toString());
|
|
82
104
|
}
|
|
105
|
+
|
|
106
|
+
@Override
|
|
107
|
+
public void receivedEvent(String s, @Nullable Map<String, String> map) {
|
|
108
|
+
JSONObject jsonObject = new JSONObject();
|
|
109
|
+
JSONObject jsonMeta = new JSONObject();
|
|
110
|
+
try {
|
|
111
|
+
if (map != null) {
|
|
112
|
+
for (String key : map.keySet()) {
|
|
113
|
+
jsonMeta.put(key, map.get(key));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
jsonObject.put("eventName", s);
|
|
117
|
+
jsonObject.put("meta", jsonMeta);
|
|
118
|
+
} catch (JSONException e) {
|
|
119
|
+
e.printStackTrace();
|
|
120
|
+
}
|
|
121
|
+
this.getReactApplicationContext()
|
|
122
|
+
.getJSModule(RCTNativeAppEventEmitter.class)
|
|
123
|
+
.emit("cfEvent", jsonObject.toString());
|
|
124
|
+
}
|
|
83
125
|
}
|
package/ios/CashfreePgApi.swift
CHANGED
|
@@ -44,7 +44,8 @@ class CashfreePgApi: NSObject {
|
|
|
44
44
|
.setTheme(theme!)
|
|
45
45
|
.setComponent(component!)
|
|
46
46
|
.build()
|
|
47
|
-
|
|
47
|
+
// let systemVersion = UIDevice.current.systemVersion
|
|
48
|
+
// nativePayment.setPlatform("irnx-d-" + (((output["version"]) as? String) ?? "") + "-3.3.9-m-s-x-i-\(systemVersion.prefix(4))")
|
|
48
49
|
return nativePayment
|
|
49
50
|
|
|
50
51
|
} catch let e {
|
package/lib/commonjs/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var _package = require("../package.json");
|
|
|
12
12
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
13
|
|
|
14
14
|
const LINKING_ERROR = `The package 'react-native-cashfree-pg-api' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
15
|
-
ios:
|
|
15
|
+
ios: '- You have run \'pod install\'\n',
|
|
16
16
|
default: ''
|
|
17
17
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
18
18
|
const CashfreePgApi = _reactNative.NativeModules.CashfreePgApi ? _reactNative.NativeModules.CashfreePgApi : new Proxy({}, {
|
|
@@ -30,6 +30,8 @@ class CFPaymentGateway {
|
|
|
30
30
|
|
|
31
31
|
_defineProperty(this, "failureSubscription", null);
|
|
32
32
|
|
|
33
|
+
_defineProperty(this, "eventSubscription", null);
|
|
34
|
+
|
|
33
35
|
this.emitter = _reactNative.Platform.OS === 'ios' ? new _reactNative.NativeEventEmitter(_reactNative.NativeModules.CashfreeEventEmitter) : _reactNative.NativeAppEventEmitter;
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -38,6 +40,25 @@ class CFPaymentGateway {
|
|
|
38
40
|
CashfreePgApi.doPayment(JSON.stringify(checkoutPayment));
|
|
39
41
|
}
|
|
40
42
|
|
|
43
|
+
setEventSubscriber(cfEventCallback) {
|
|
44
|
+
let eventFunction = event => {
|
|
45
|
+
let data = JSON.parse(event);
|
|
46
|
+
cfEventCallback.onReceivedEvent(data.eventName, data.meta);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
this.eventSubscription = this.emitter.addListener('cfEvent', eventFunction);
|
|
50
|
+
CashfreePgApi.setEventSubscriber();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
removeEventSubscriber() {
|
|
54
|
+
if (this.eventSubscription !== undefined && this.eventSubscription !== null) {
|
|
55
|
+
this.eventSubscription.remove();
|
|
56
|
+
this.eventSubscription = null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
CashfreePgApi.removeEventSubscriber();
|
|
60
|
+
}
|
|
61
|
+
|
|
41
62
|
setCallback(cfCallback) {
|
|
42
63
|
// this.cfCallback = cfCallback;
|
|
43
64
|
let successFunction = orderID => {
|
|
@@ -114,6 +135,6 @@ class CFErrorResponse {
|
|
|
114
135
|
}
|
|
115
136
|
|
|
116
137
|
exports.CFErrorResponse = CFErrorResponse;
|
|
117
|
-
|
|
138
|
+
const CFPaymentGatewayService = new CFPaymentGateway();
|
|
118
139
|
exports.CFPaymentGatewayService = CFPaymentGatewayService;
|
|
119
140
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","CashfreePgApi","NativeModules","Proxy","get","Error","CFPaymentGateway","constructor","emitter","OS","NativeEventEmitter","CashfreeEventEmitter","NativeAppEventEmitter","doPayment","checkoutPayment","version","JSON","stringify","setCallback","cfCallback","successFunction","orderID","console","log","onVerify","failureFunction","error","response","CFErrorResponse","message","
|
|
1
|
+
{"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","CashfreePgApi","NativeModules","Proxy","get","Error","CFPaymentGateway","constructor","emitter","OS","NativeEventEmitter","CashfreeEventEmitter","NativeAppEventEmitter","doPayment","checkoutPayment","version","JSON","stringify","setEventSubscriber","cfEventCallback","eventFunction","event","data","parse","onReceivedEvent","eventName","meta","eventSubscription","addListener","removeEventSubscriber","undefined","remove","setCallback","cfCallback","successFunction","orderID","console","log","onVerify","failureFunction","error","response","CFErrorResponse","message","fromJSON","onError","successSubscription","failureSubscription","removeCallback","errorString","object","status","code","type","getStatus","getMessage","getCode","getType","CFPaymentGatewayService"],"sources":["index.ts"],"sourcesContent":["import {\n EmitterSubscription,\n EventEmitter,\n NativeAppEventEmitter,\n NativeEventEmitter,\n NativeModules,\n Platform,\n} from 'react-native';\nimport { version } from '../package.json';\nimport type { CheckoutPayment } from 'cashfree-pg-api-contract';\n\nconst LINKING_ERROR =\n `The package 'react-native-cashfree-pg-api' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: '- You have run \\'pod install\\'\\n', default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst CashfreePgApi = NativeModules.CashfreePgApi\n ? NativeModules.CashfreePgApi\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n },\n );\n\nclass CFPaymentGateway {\n private emitter: EventEmitter;\n private successSubscription: EmitterSubscription | null = null;\n private failureSubscription: EmitterSubscription | null = null;\n private eventSubscription: EmitterSubscription | null = null;\n\n constructor() {\n this.emitter =\n Platform.OS === 'ios'\n ? new NativeEventEmitter(NativeModules.CashfreeEventEmitter)\n : NativeAppEventEmitter;\n }\n\n doPayment(checkoutPayment: CheckoutPayment) {\n checkoutPayment.version = version;\n CashfreePgApi.doPayment(JSON.stringify(checkoutPayment));\n }\n\n setEventSubscriber(cfEventCallback: CFEventCallback) {\n let eventFunction = (event: string) => {\n let data = JSON.parse(event);\n cfEventCallback.onReceivedEvent(data.eventName, data.meta);\n };\n this.eventSubscription = this.emitter.addListener(\n 'cfEvent',\n eventFunction,\n );\n CashfreePgApi.setEventSubscriber();\n }\n\n removeEventSubscriber() {\n if (\n this.eventSubscription !== undefined &&\n this.eventSubscription !== null\n ) {\n this.eventSubscription.remove();\n this.eventSubscription = null;\n }\n CashfreePgApi.removeEventSubscriber();\n }\n\n setCallback(cfCallback: CFCallback) {\n // this.cfCallback = cfCallback;\n let successFunction = (orderID: string) => {\n console.log('response is : ' + JSON.stringify(orderID));\n cfCallback.onVerify(orderID);\n };\n let failureFunction = (error: string) => {\n console.log('reason: ' + JSON.stringify(error));\n const response = new CFErrorResponse();\n // @ts-ignore\n const message = JSON.parse(error);\n response.fromJSON(message.error);\n // @ts-ignore\n cfCallback.onError(response, message.orderID);\n };\n this.successSubscription = this.emitter.addListener(\n 'cfSuccess',\n successFunction,\n );\n this.failureSubscription = this.emitter.addListener(\n 'cfFailure',\n failureFunction,\n );\n CashfreePgApi.setCallback();\n }\n\n removeCallback() {\n if (\n this.successSubscription !== undefined &&\n this.successSubscription !== null\n ) {\n this.successSubscription.remove();\n this.successSubscription = null;\n }\n if (\n this.failureSubscription !== undefined &&\n this.failureSubscription !== null\n ) {\n this.failureSubscription.remove();\n this.failureSubscription = null;\n }\n }\n}\n\nexport interface CFCallback {\n onVerify(orderID: string): void;\n\n onError(error: CFErrorResponse, orderID: string): void;\n}\n\nexport interface CFEventCallback {\n onReceivedEvent(eventName: string, map: Map<string, string>): void;\n}\n\nexport class CFErrorResponse {\n private status: string = 'FAILED';\n private message: string = 'payment has failed';\n private code: string = 'payment_failed';\n private type: string = 'request_failed';\n\n fromJSON(errorString: string) {\n console.log('errorString :' + errorString);\n const object = JSON.parse(errorString);\n console.log('errorStringObject :' + object);\n this.status = object.status;\n this.message = object.message;\n this.code = object.code;\n this.type = object.type;\n }\n\n getStatus(): string {\n return this.status;\n }\n\n getMessage(): string {\n return this.message;\n }\n\n getCode(): string {\n return this.code;\n }\n\n getType(): string {\n return this.type;\n }\n}\nexport const CFPaymentGatewayService = new CFPaymentGateway();\n"],"mappings":";;;;;;;AAAA;;AAQA;;;;AAGA,MAAMA,aAAa,GAChB,uFAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,kCAA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ADE;;IAAA,iCAED,oBAFC;;IAAA,8BAGJ,gBAHI;;IAAA,8BAIJ,gBAJI;EAAA;;EAM3BE,QAAQ,CAACK,WAAD,EAAsB;IAC5Bb,OAAO,CAACC,GAAR,CAAY,kBAAkBY,WAA9B;IACA,MAAMC,MAAM,GAAGlC,IAAI,CAACO,KAAL,CAAW0B,WAAX,CAAf;IACAb,OAAO,CAACC,GAAR,CAAY,wBAAwBa,MAApC;IACA,KAAKC,MAAL,GAAcD,MAAM,CAACC,MAArB;IACA,KAAKR,OAAL,GAAeO,MAAM,CAACP,OAAtB;IACA,KAAKS,IAAL,GAAYF,MAAM,CAACE,IAAnB;IACA,KAAKC,IAAL,GAAYH,MAAM,CAACG,IAAnB;EACD;;EAEDC,SAAS,GAAW;IAClB,OAAO,KAAKH,MAAZ;EACD;;EAEDI,UAAU,GAAW;IACnB,OAAO,KAAKZ,OAAZ;EACD;;EAEDa,OAAO,GAAW;IAChB,OAAO,KAAKJ,IAAZ;EACD;;EAEDK,OAAO,GAAW;IAChB,OAAO,KAAKJ,IAAZ;EACD;;AA9B0B;;;AAgCtB,MAAMK,uBAAuB,GAAG,IAAIpD,gBAAJ,EAAhC"}
|
package/lib/module/index.js
CHANGED
|
@@ -3,7 +3,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
3
3
|
import { NativeAppEventEmitter, NativeEventEmitter, NativeModules, Platform } from 'react-native';
|
|
4
4
|
import { version } from '../package.json';
|
|
5
5
|
const LINKING_ERROR = `The package 'react-native-cashfree-pg-api' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
6
|
-
ios:
|
|
6
|
+
ios: '- You have run \'pod install\'\n',
|
|
7
7
|
default: ''
|
|
8
8
|
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
9
9
|
const CashfreePgApi = NativeModules.CashfreePgApi ? NativeModules.CashfreePgApi : new Proxy({}, {
|
|
@@ -21,6 +21,8 @@ class CFPaymentGateway {
|
|
|
21
21
|
|
|
22
22
|
_defineProperty(this, "failureSubscription", null);
|
|
23
23
|
|
|
24
|
+
_defineProperty(this, "eventSubscription", null);
|
|
25
|
+
|
|
24
26
|
this.emitter = Platform.OS === 'ios' ? new NativeEventEmitter(NativeModules.CashfreeEventEmitter) : NativeAppEventEmitter;
|
|
25
27
|
}
|
|
26
28
|
|
|
@@ -29,6 +31,25 @@ class CFPaymentGateway {
|
|
|
29
31
|
CashfreePgApi.doPayment(JSON.stringify(checkoutPayment));
|
|
30
32
|
}
|
|
31
33
|
|
|
34
|
+
setEventSubscriber(cfEventCallback) {
|
|
35
|
+
let eventFunction = event => {
|
|
36
|
+
let data = JSON.parse(event);
|
|
37
|
+
cfEventCallback.onReceivedEvent(data.eventName, data.meta);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
this.eventSubscription = this.emitter.addListener('cfEvent', eventFunction);
|
|
41
|
+
CashfreePgApi.setEventSubscriber();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
removeEventSubscriber() {
|
|
45
|
+
if (this.eventSubscription !== undefined && this.eventSubscription !== null) {
|
|
46
|
+
this.eventSubscription.remove();
|
|
47
|
+
this.eventSubscription = null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
CashfreePgApi.removeEventSubscriber();
|
|
51
|
+
}
|
|
52
|
+
|
|
32
53
|
setCallback(cfCallback) {
|
|
33
54
|
// this.cfCallback = cfCallback;
|
|
34
55
|
let successFunction = orderID => {
|
|
@@ -103,5 +124,5 @@ export class CFErrorResponse {
|
|
|
103
124
|
}
|
|
104
125
|
|
|
105
126
|
}
|
|
106
|
-
export
|
|
127
|
+
export const CFPaymentGatewayService = new CFPaymentGateway();
|
|
107
128
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeAppEventEmitter","NativeEventEmitter","NativeModules","Platform","version","LINKING_ERROR","select","ios","default","CashfreePgApi","Proxy","get","Error","CFPaymentGateway","constructor","emitter","OS","CashfreeEventEmitter","doPayment","checkoutPayment","JSON","stringify","setCallback","cfCallback","successFunction","orderID","console","log","onVerify","failureFunction","error","response","CFErrorResponse","message","
|
|
1
|
+
{"version":3,"names":["NativeAppEventEmitter","NativeEventEmitter","NativeModules","Platform","version","LINKING_ERROR","select","ios","default","CashfreePgApi","Proxy","get","Error","CFPaymentGateway","constructor","emitter","OS","CashfreeEventEmitter","doPayment","checkoutPayment","JSON","stringify","setEventSubscriber","cfEventCallback","eventFunction","event","data","parse","onReceivedEvent","eventName","meta","eventSubscription","addListener","removeEventSubscriber","undefined","remove","setCallback","cfCallback","successFunction","orderID","console","log","onVerify","failureFunction","error","response","CFErrorResponse","message","fromJSON","onError","successSubscription","failureSubscription","removeCallback","errorString","object","status","code","type","getStatus","getMessage","getCode","getType","CFPaymentGatewayService"],"sources":["index.ts"],"sourcesContent":["import {\n EmitterSubscription,\n EventEmitter,\n NativeAppEventEmitter,\n NativeEventEmitter,\n NativeModules,\n Platform,\n} from 'react-native';\nimport { version } from '../package.json';\nimport type { CheckoutPayment } from 'cashfree-pg-api-contract';\n\nconst LINKING_ERROR =\n `The package 'react-native-cashfree-pg-api' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: '- You have run \\'pod install\\'\\n', default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst CashfreePgApi = NativeModules.CashfreePgApi\n ? NativeModules.CashfreePgApi\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n },\n );\n\nclass CFPaymentGateway {\n private emitter: EventEmitter;\n private successSubscription: EmitterSubscription | null = null;\n private failureSubscription: EmitterSubscription | null = null;\n private eventSubscription: EmitterSubscription | null = null;\n\n constructor() {\n this.emitter =\n Platform.OS === 'ios'\n ? new NativeEventEmitter(NativeModules.CashfreeEventEmitter)\n : NativeAppEventEmitter;\n }\n\n doPayment(checkoutPayment: CheckoutPayment) {\n checkoutPayment.version = version;\n CashfreePgApi.doPayment(JSON.stringify(checkoutPayment));\n }\n\n setEventSubscriber(cfEventCallback: CFEventCallback) {\n let eventFunction = (event: string) => {\n let data = JSON.parse(event);\n cfEventCallback.onReceivedEvent(data.eventName, data.meta);\n };\n this.eventSubscription = this.emitter.addListener(\n 'cfEvent',\n eventFunction,\n );\n CashfreePgApi.setEventSubscriber();\n }\n\n removeEventSubscriber() {\n if (\n this.eventSubscription !== undefined &&\n this.eventSubscription !== null\n ) {\n this.eventSubscription.remove();\n this.eventSubscription = null;\n }\n CashfreePgApi.removeEventSubscriber();\n }\n\n setCallback(cfCallback: CFCallback) {\n // this.cfCallback = cfCallback;\n let successFunction = (orderID: string) => {\n console.log('response is : ' + JSON.stringify(orderID));\n cfCallback.onVerify(orderID);\n };\n let failureFunction = (error: string) => {\n console.log('reason: ' + JSON.stringify(error));\n const response = new CFErrorResponse();\n // @ts-ignore\n const message = JSON.parse(error);\n response.fromJSON(message.error);\n // @ts-ignore\n cfCallback.onError(response, message.orderID);\n };\n this.successSubscription = this.emitter.addListener(\n 'cfSuccess',\n successFunction,\n );\n this.failureSubscription = this.emitter.addListener(\n 'cfFailure',\n failureFunction,\n );\n CashfreePgApi.setCallback();\n }\n\n removeCallback() {\n if (\n this.successSubscription !== undefined &&\n this.successSubscription !== null\n ) {\n this.successSubscription.remove();\n this.successSubscription = null;\n }\n if (\n this.failureSubscription !== undefined &&\n this.failureSubscription !== null\n ) {\n this.failureSubscription.remove();\n this.failureSubscription = null;\n }\n }\n}\n\nexport interface CFCallback {\n onVerify(orderID: string): void;\n\n onError(error: CFErrorResponse, orderID: string): void;\n}\n\nexport interface CFEventCallback {\n onReceivedEvent(eventName: string, map: Map<string, string>): void;\n}\n\nexport class CFErrorResponse {\n private status: string = 'FAILED';\n private message: string = 'payment has failed';\n private code: string = 'payment_failed';\n private type: string = 'request_failed';\n\n fromJSON(errorString: string) {\n console.log('errorString :' + errorString);\n const object = JSON.parse(errorString);\n console.log('errorStringObject :' + object);\n this.status = object.status;\n this.message = object.message;\n this.code = object.code;\n this.type = object.type;\n }\n\n getStatus(): string {\n return this.status;\n }\n\n getMessage(): string {\n return this.message;\n }\n\n getCode(): string {\n return this.code;\n }\n\n getType(): string {\n return this.type;\n }\n}\nexport const CFPaymentGatewayService = new CFPaymentGateway();\n"],"mappings":";;AAAA,SAGEA,qBAHF,EAIEC,kBAJF,EAKEC,aALF,EAMEC,QANF,QAOO,cAPP;AAQA,SAASC,OAAT,QAAwB,iBAAxB;AAGA,MAAMC,aAAa,GAChB,uFAAD,GACAF,QAAQ,CAACG,MAAT,CAAgB;EAAEC,GAAG,EAAE,kCAAP;EAA2CC,OAAO,EAAE;AAApD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,aAAa,GAAGP,aAAa,CAACO,aAAd,GAClBP,aAAa,CAACO,aADI,GAElB,IAAIC,KAAJ,CACA,EADA,EAEA;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;EACD;;AAHH,CAFA,CAFJ;;AAWA,MAAMQ,gBAAN,CAAuB;EAMrBC,WAAW,GAAG;IAAA;;IAAA,6CAJ4C,IAI5C;;IAAA,6CAH4C,IAG5C;;IAAA,2CAF0C,IAE1C;;IACZ,KAAKC,OAAL,GACEZ,QAAQ,CAACa,EAAT,KAAgB,KAAhB,GACI,IAAIf,kBAAJ,CAAuBC,aAAa,CAACe,oBAArC,CADJ,GAEIjB,qBAHN;EAID;;EAEDkB,SAAS,CAACC,eAAD,EAAmC;IAC1CA,eAAe,CAACf,OAAhB,GAA0BA,OAA1B;IACAK,aAAa,CAACS,SAAd,CAAwBE,IAAI,CAACC,SAAL,CAAeF,eAAf,CAAxB;EACD;;EAEDG,kBAAkB,CAACC,eAAD,EAAmC;IACnD,IAAIC,aAAa,GAAIC,KAAD,IAAmB;MACrC,IAAIC,IAAI,GAAGN,IAAI,CAACO,KAAL,CAAWF,KAA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|
private successSubscription;
|
|
5
5
|
private failureSubscription;
|
|
6
|
+
private eventSubscription;
|
|
6
7
|
constructor();
|
|
7
8
|
doPayment(checkoutPayment: CheckoutPayment): void;
|
|
9
|
+
setEventSubscriber(cfEventCallback: CFEventCallback): void;
|
|
10
|
+
removeEventSubscriber(): void;
|
|
8
11
|
setCallback(cfCallback: CFCallback): void;
|
|
9
12
|
removeCallback(): void;
|
|
10
13
|
}
|
|
@@ -12,6 +15,9 @@ export interface CFCallback {
|
|
|
12
15
|
onVerify(orderID: string): void;
|
|
13
16
|
onError(error: CFErrorResponse, orderID: string): void;
|
|
14
17
|
}
|
|
18
|
+
export interface CFEventCallback {
|
|
19
|
+
onReceivedEvent(eventName: string, map: Map<string, string>): void;
|
|
20
|
+
}
|
|
15
21
|
export declare class CFErrorResponse {
|
|
16
22
|
private status;
|
|
17
23
|
private message;
|
|
@@ -23,5 +29,5 @@ export declare class CFErrorResponse {
|
|
|
23
29
|
getCode(): string;
|
|
24
30
|
getType(): string;
|
|
25
31
|
}
|
|
26
|
-
export declare
|
|
32
|
+
export declare const CFPaymentGatewayService: CFPaymentGateway;
|
|
27
33
|
export {};
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-cashfree-pg-sdk",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.2",
|
|
4
4
|
"description": "Cashfree PG Plugin for React Native",
|
|
5
|
-
"main": "lib/commonjs/index",
|
|
6
|
-
"module": "lib/module/index",
|
|
5
|
+
"main": "lib/commonjs/index.js",
|
|
6
|
+
"module": "lib/module/index.js",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
8
8
|
"react-native": "src/index",
|
|
9
9
|
"source": "src/index",
|
|
@@ -145,6 +145,6 @@
|
|
|
145
145
|
]
|
|
146
146
|
},
|
|
147
147
|
"dependencies": {
|
|
148
|
-
"cashfree-pg-api-contract": "
|
|
148
|
+
"cashfree-pg-api-contract": "2.0.0-dev.1"
|
|
149
149
|
}
|
|
150
150
|
}
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NativeAppEventEmitter, NativeEventEmitter, NativeModules, Platform, } from 'react-native';
|
|
2
2
|
import { version } from '../package.json';
|
|
3
3
|
const LINKING_ERROR = `The package 'react-native-cashfree-pg-api' doesn't seem to be linked. Make sure: \n\n` +
|
|
4
|
-
Platform.select({ ios:
|
|
4
|
+
Platform.select({ ios: '- You have run \'pod install\'\n', default: '' }) +
|
|
5
5
|
'- You rebuilt the app after installing the package\n' +
|
|
6
6
|
'- You are not using Expo managed workflow\n';
|
|
7
7
|
const CashfreePgApi = NativeModules.CashfreePgApi
|
|
@@ -15,6 +15,7 @@ class CFPaymentGateway {
|
|
|
15
15
|
emitter;
|
|
16
16
|
successSubscription = null;
|
|
17
17
|
failureSubscription = null;
|
|
18
|
+
eventSubscription = null;
|
|
18
19
|
constructor() {
|
|
19
20
|
this.emitter =
|
|
20
21
|
Platform.OS === 'ios'
|
|
@@ -25,6 +26,22 @@ class CFPaymentGateway {
|
|
|
25
26
|
checkoutPayment.version = version;
|
|
26
27
|
CashfreePgApi.doPayment(JSON.stringify(checkoutPayment));
|
|
27
28
|
}
|
|
29
|
+
setEventSubscriber(cfEventCallback) {
|
|
30
|
+
let eventFunction = (event) => {
|
|
31
|
+
let data = JSON.parse(event);
|
|
32
|
+
cfEventCallback.onReceivedEvent(data.eventName, data.meta);
|
|
33
|
+
};
|
|
34
|
+
this.eventSubscription = this.emitter.addListener('cfEvent', eventFunction);
|
|
35
|
+
CashfreePgApi.setEventSubscriber();
|
|
36
|
+
}
|
|
37
|
+
removeEventSubscriber() {
|
|
38
|
+
if (this.eventSubscription !== undefined &&
|
|
39
|
+
this.eventSubscription !== null) {
|
|
40
|
+
this.eventSubscription.remove();
|
|
41
|
+
this.eventSubscription = null;
|
|
42
|
+
}
|
|
43
|
+
CashfreePgApi.removeEventSubscriber();
|
|
44
|
+
}
|
|
28
45
|
setCallback(cfCallback) {
|
|
29
46
|
// this.cfCallback = cfCallback;
|
|
30
47
|
let successFunction = (orderID) => {
|
|
@@ -84,4 +101,4 @@ export class CFErrorResponse {
|
|
|
84
101
|
return this.type;
|
|
85
102
|
}
|
|
86
103
|
}
|
|
87
|
-
export
|
|
104
|
+
export const CFPaymentGatewayService = new CFPaymentGateway();
|
|
@@ -11,25 +11,26 @@ import type { CheckoutPayment } from 'cashfree-pg-api-contract';
|
|
|
11
11
|
|
|
12
12
|
const LINKING_ERROR =
|
|
13
13
|
`The package 'react-native-cashfree-pg-api' doesn't seem to be linked. Make sure: \n\n` +
|
|
14
|
-
Platform.select({ ios:
|
|
14
|
+
Platform.select({ ios: '- You have run \'pod install\'\n', default: '' }) +
|
|
15
15
|
'- You rebuilt the app after installing the package\n' +
|
|
16
16
|
'- You are not using Expo managed workflow\n';
|
|
17
17
|
|
|
18
18
|
const CashfreePgApi = NativeModules.CashfreePgApi
|
|
19
19
|
? NativeModules.CashfreePgApi
|
|
20
20
|
: new Proxy(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
{},
|
|
22
|
+
{
|
|
23
|
+
get() {
|
|
24
|
+
throw new Error(LINKING_ERROR);
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
28
|
|
|
29
29
|
class CFPaymentGateway {
|
|
30
30
|
private emitter: EventEmitter;
|
|
31
31
|
private successSubscription: EmitterSubscription | null = null;
|
|
32
32
|
private failureSubscription: EmitterSubscription | null = null;
|
|
33
|
+
private eventSubscription: EmitterSubscription | null = null;
|
|
33
34
|
|
|
34
35
|
constructor() {
|
|
35
36
|
this.emitter =
|
|
@@ -43,6 +44,29 @@ class CFPaymentGateway {
|
|
|
43
44
|
CashfreePgApi.doPayment(JSON.stringify(checkoutPayment));
|
|
44
45
|
}
|
|
45
46
|
|
|
47
|
+
setEventSubscriber(cfEventCallback: CFEventCallback) {
|
|
48
|
+
let eventFunction = (event: string) => {
|
|
49
|
+
let data = JSON.parse(event);
|
|
50
|
+
cfEventCallback.onReceivedEvent(data.eventName, data.meta);
|
|
51
|
+
};
|
|
52
|
+
this.eventSubscription = this.emitter.addListener(
|
|
53
|
+
'cfEvent',
|
|
54
|
+
eventFunction,
|
|
55
|
+
);
|
|
56
|
+
CashfreePgApi.setEventSubscriber();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
removeEventSubscriber() {
|
|
60
|
+
if (
|
|
61
|
+
this.eventSubscription !== undefined &&
|
|
62
|
+
this.eventSubscription !== null
|
|
63
|
+
) {
|
|
64
|
+
this.eventSubscription.remove();
|
|
65
|
+
this.eventSubscription = null;
|
|
66
|
+
}
|
|
67
|
+
CashfreePgApi.removeEventSubscriber();
|
|
68
|
+
}
|
|
69
|
+
|
|
46
70
|
setCallback(cfCallback: CFCallback) {
|
|
47
71
|
// this.cfCallback = cfCallback;
|
|
48
72
|
let successFunction = (orderID: string) => {
|
|
@@ -60,11 +84,11 @@ class CFPaymentGateway {
|
|
|
60
84
|
};
|
|
61
85
|
this.successSubscription = this.emitter.addListener(
|
|
62
86
|
'cfSuccess',
|
|
63
|
-
successFunction
|
|
87
|
+
successFunction,
|
|
64
88
|
);
|
|
65
89
|
this.failureSubscription = this.emitter.addListener(
|
|
66
90
|
'cfFailure',
|
|
67
|
-
failureFunction
|
|
91
|
+
failureFunction,
|
|
68
92
|
);
|
|
69
93
|
CashfreePgApi.setCallback();
|
|
70
94
|
}
|
|
@@ -93,6 +117,10 @@ export interface CFCallback {
|
|
|
93
117
|
onError(error: CFErrorResponse, orderID: string): void;
|
|
94
118
|
}
|
|
95
119
|
|
|
120
|
+
export interface CFEventCallback {
|
|
121
|
+
onReceivedEvent(eventName: string, map: Map<string, string>): void;
|
|
122
|
+
}
|
|
123
|
+
|
|
96
124
|
export class CFErrorResponse {
|
|
97
125
|
private status: string = 'FAILED';
|
|
98
126
|
private message: string = 'payment has failed';
|
|
@@ -125,5 +153,4 @@ export class CFErrorResponse {
|
|
|
125
153
|
return this.type;
|
|
126
154
|
}
|
|
127
155
|
}
|
|
128
|
-
|
|
129
|
-
export var CFPaymentGatewayService = new CFPaymentGateway();
|
|
156
|
+
export const CFPaymentGatewayService = new CFPaymentGateway();
|