react-native-cashfree-pg-sdk 2.0.7-dev.1 → 2.0.7
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
CHANGED
|
@@ -66,7 +66,7 @@ dependencies {
|
|
|
66
66
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
|
67
67
|
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
|
68
68
|
|
|
69
|
-
implementation 'com.cashfree.pg:api:2.0.
|
|
69
|
+
implementation 'com.cashfree.pg:api:2.0.8'
|
|
70
70
|
|
|
71
71
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_package","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","LINKING_ERROR","Platform","select","ios","default","CashfreePgApi","NativeModules","Proxy","get","Error","CFPaymentGateway","constructor","emitter","OS","NativeEventEmitter","CashfreeEventEmitter","NativeAppEventEmitter","doPayment","checkoutPayment","version","JSON","stringify","doWebPayment","cfSession","setEventSubscriber","cfEventCallback","eventFunction","event","console","log","data","parse","onReceivedEvent","eventName","meta","eventSubscription","addListener","removeEventSubscriber","remove","setCallback","cfCallback","successFunction","orderID","onVerify","failureFunction","error","response","CFErrorResponse","message","fromJSON","onError","successSubscription","failureSubscription","removeCallback","errorString","object","status","code","type","getStatus","getMessage","getCode","getType","exports","CFPaymentGatewayService"],"sources":["index.
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_package","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","LINKING_ERROR","Platform","select","ios","default","CashfreePgApi","NativeModules","Proxy","get","Error","CFPaymentGateway","constructor","emitter","OS","NativeEventEmitter","CashfreeEventEmitter","NativeAppEventEmitter","doPayment","checkoutPayment","version","JSON","stringify","doWebPayment","cfSession","setEventSubscriber","cfEventCallback","eventFunction","event","console","log","data","parse","onReceivedEvent","eventName","meta","eventSubscription","addListener","removeEventSubscriber","remove","setCallback","cfCallback","successFunction","orderID","onVerify","failureFunction","error","response","CFErrorResponse","message","fromJSON","onError","successSubscription","failureSubscription","removeCallback","errorString","object","status","code","type","getStatus","getMessage","getCode","getType","exports","CFPaymentGatewayService"],"sources":["index.js"],"sourcesContent":["import { NativeAppEventEmitter, NativeEventEmitter, NativeModules, Platform, } from 'react-native';\nimport { version } from '../package.json';\nconst LINKING_ERROR = `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';\nconst CashfreePgApi = NativeModules.CashfreePgApi\n ? NativeModules.CashfreePgApi\n : new Proxy({}, {\n get() {\n throw new Error(LINKING_ERROR);\n },\n });\nclass CFPaymentGateway {\n emitter;\n successSubscription = null;\n failureSubscription = null;\n eventSubscription = null;\n constructor() {\n this.emitter =\n Platform.OS === 'ios'\n ? new NativeEventEmitter(NativeModules.CashfreeEventEmitter)\n : NativeAppEventEmitter;\n }\n doPayment(checkoutPayment) {\n checkoutPayment.version = version;\n CashfreePgApi.doPayment(JSON.stringify(checkoutPayment));\n }\n doWebPayment(cfSession) {\n CashfreePgApi.doWebPayment(cfSession);\n }\n setEventSubscriber(cfEventCallback) {\n let eventFunction = (event) => {\n console.log(JSON.stringify(event));\n let data = JSON.parse(event);\n cfEventCallback.onReceivedEvent(data.eventName, data.meta);\n };\n this.eventSubscription = this.emitter.addListener('cfEvent', eventFunction);\n CashfreePgApi.setEventSubscriber();\n }\n removeEventSubscriber() {\n if (this.eventSubscription !== undefined &&\n this.eventSubscription !== null) {\n this.eventSubscription.remove();\n this.eventSubscription = null;\n }\n CashfreePgApi.removeEventSubscriber();\n }\n setCallback(cfCallback) {\n // this.cfCallback = cfCallback;\n let successFunction = (orderID) => {\n console.log('response is : ' + JSON.stringify(orderID));\n cfCallback.onVerify(orderID);\n };\n let failureFunction = (error) => {\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('cfSuccess', successFunction);\n this.failureSubscription = this.emitter.addListener('cfFailure', failureFunction);\n CashfreePgApi.setCallback();\n }\n removeCallback() {\n if (this.successSubscription !== undefined &&\n this.successSubscription !== null) {\n this.successSubscription.remove();\n this.successSubscription = null;\n }\n if (this.failureSubscription !== undefined &&\n this.failureSubscription !== null) {\n this.failureSubscription.remove();\n this.failureSubscription = null;\n }\n }\n}\nexport class CFErrorResponse {\n status = 'FAILED';\n message = 'payment has failed';\n code = 'payment_failed';\n type = 'request_failed';\n fromJSON(errorString) {\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 getStatus() {\n return this.status;\n }\n getMessage() {\n return this.message;\n }\n getCode() {\n return this.code;\n }\n getType() {\n return this.type;\n }\n}\nexport const CFPaymentGatewayService = new CFPaymentGateway();\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAA0C,SAAAE,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC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