diff --git a/README.md b/README.md index dff6b4c..cc5fb3b 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ var request = { } }; Cashfree.PGCreateOrder("2022-09-01", request).then((response) => { - console.log('Order fetched successfully:',response.data) + console.log('Order Created successfully:',response.data) }).catch((error) => { console.error('Error:', error.response.data.message); }); diff --git a/api.ts b/api.ts index 7b30b5f..43424d9 100644 --- a/api.ts +++ b/api.ts @@ -1760,6 +1760,57 @@ export const InstrumentEntityInstrumentStatusEnum = { export type InstrumentEntityInstrumentStatusEnum = typeof InstrumentEntityInstrumentStatusEnum[keyof typeof InstrumentEntityInstrumentStatusEnum]; +/** + * Instrument webhook object + * @export + * @interface InstrumentWebhook + */ +export interface InstrumentWebhook { + /** + * + * @type {InstrumentWebhookData} + * @memberof InstrumentWebhook + */ + 'data'?: InstrumentWebhookData; +} +/** + * + * @export + * @interface InstrumentWebhookData + */ +export interface InstrumentWebhookData { + /** + * + * @type {InstrumentWebhookDataEntity} + * @memberof InstrumentWebhookData + */ + 'data'?: InstrumentWebhookDataEntity; + /** + * + * @type {string} + * @memberof InstrumentWebhookData + */ + 'event_time'?: string; + /** + * + * @type {string} + * @memberof InstrumentWebhookData + */ + 'type'?: string; +} +/** + * data entity in webhook + * @export + * @interface InstrumentWebhookDataEntity + */ +export interface InstrumentWebhookDataEntity { + /** + * + * @type {InstrumentEntity} + * @memberof InstrumentWebhookDataEntity + */ + 'instrument'?: InstrumentEntity; +} /** * Payment link customer entity * @export @@ -3160,42 +3211,240 @@ export interface PaymentModeDetails { 'code'?: number; } /** - * object for payment success webhook + * URL for payment retrieval for an order + * @export + * @interface PaymentURLObject + */ +export interface PaymentURLObject { + /** + * + * @type {string} + * @memberof PaymentURLObject + */ + 'url'?: string; +} +/** + * payment webhook object * @export - * @interface PaymentSuccessWebhook + * @interface PaymentWebhook */ -export interface PaymentSuccessWebhook { +export interface PaymentWebhook { /** * - * @type {WHdata} - * @memberof PaymentSuccessWebhook + * @type {PaymentWebhookDataEntity} + * @memberof PaymentWebhook */ - 'data'?: WHdata; + 'data'?: PaymentWebhookDataEntity; /** * * @type {string} - * @memberof PaymentSuccessWebhook + * @memberof PaymentWebhook */ 'event_time'?: string; /** * * @type {string} - * @memberof PaymentSuccessWebhook + * @memberof PaymentWebhook */ 'type'?: string; } /** - * URL for payment retrieval for an order + * customer details object in webhook * @export - * @interface PaymentURLObject + * @interface PaymentWebhookCustomerEntity */ -export interface PaymentURLObject { +export interface PaymentWebhookCustomerEntity { /** * * @type {string} - * @memberof PaymentURLObject + * @memberof PaymentWebhookCustomerEntity */ - 'url'?: string; + 'customer_name'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookCustomerEntity + */ + 'customer_id'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookCustomerEntity + */ + 'customer_email'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookCustomerEntity + */ + 'customer_phone'?: string; +} +/** + * data entity in webhook + * @export + * @interface PaymentWebhookDataEntity + */ +export interface PaymentWebhookDataEntity { + /** + * + * @type {PaymentWebhookOrderEntity} + * @memberof PaymentWebhookDataEntity + */ + 'order'?: PaymentWebhookOrderEntity; + /** + * + * @type {PaymentEntity} + * @memberof PaymentWebhookDataEntity + */ + 'payment'?: PaymentEntity; + /** + * + * @type {PaymentWebhookCustomerEntity} + * @memberof PaymentWebhookDataEntity + */ + 'customer_details'?: PaymentWebhookCustomerEntity; + /** + * + * @type {PaymentWebhookErrorEntity} + * @memberof PaymentWebhookDataEntity + */ + 'error_details'?: PaymentWebhookErrorEntity; + /** + * + * @type {PaymentWebhookGatewayDetailsEntity} + * @memberof PaymentWebhookDataEntity + */ + 'payment_gateway_details'?: PaymentWebhookGatewayDetailsEntity; + /** + * + * @type {Array} + * @memberof PaymentWebhookDataEntity + */ + 'payment_offers'?: Array; +} +/** + * data entity in webhook + * @export + * @interface PaymentWebhookDataEntity1 + */ +export interface PaymentWebhookDataEntity1 { + /** + * + * @type {RefundEntity} + * @memberof PaymentWebhookDataEntity1 + */ + 'refund'?: RefundEntity; +} +/** + * error details present in the webhook + * @export + * @interface PaymentWebhookErrorEntity + */ +export interface PaymentWebhookErrorEntity { + /** + * + * @type {string} + * @memberof PaymentWebhookErrorEntity + */ + 'error_code'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookErrorEntity + */ + 'error_description'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookErrorEntity + */ + 'error_reason'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookErrorEntity + */ + 'error_source'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookErrorEntity + */ + 'error_code_raw'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookErrorEntity + */ + 'error_description_raw'?: string; +} +/** + * payment gatewat details present in the webhook response + * @export + * @interface PaymentWebhookGatewayDetailsEntity + */ +export interface PaymentWebhookGatewayDetailsEntity { + /** + * + * @type {string} + * @memberof PaymentWebhookGatewayDetailsEntity + */ + 'gateway_name'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookGatewayDetailsEntity + */ + 'gateway_order_id'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookGatewayDetailsEntity + */ + 'gateway_payment_id'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookGatewayDetailsEntity + */ + 'gateway_status_code'?: string; + /** + * + * @type {string} + * @memberof PaymentWebhookGatewayDetailsEntity + */ + 'gateway_settlement'?: string; +} +/** + * order entity in webhook + * @export + * @interface PaymentWebhookOrderEntity + */ +export interface PaymentWebhookOrderEntity { + /** + * + * @type {string} + * @memberof PaymentWebhookOrderEntity + */ + 'order_id'?: string; + /** + * + * @type {number} + * @memberof PaymentWebhookOrderEntity + */ + 'order_amount'?: number; + /** + * + * @type {string} + * @memberof PaymentWebhookOrderEntity + */ + 'order_currency'?: string; + /** + * Custom Tags in thr form of {\"key\":\"value\"} which can be passed for an order. A maximum of 10 tags can be added + * @type {{ [key: string]: string; }} + * @memberof PaymentWebhookOrderEntity + */ + 'order_tags'?: { [key: string]: string; }; } /** * Error when rate limit is breached for your api @@ -3741,6 +3990,31 @@ export interface RefundURLObject { */ 'url'?: string; } +/** + * refund webhook object + * @export + * @interface RefundWebhook + */ +export interface RefundWebhook { + /** + * + * @type {PaymentWebhookDataEntity1} + * @memberof RefundWebhook + */ + 'data'?: PaymentWebhookDataEntity1; + /** + * + * @type {string} + * @memberof RefundWebhook + */ + 'event_time'?: string; + /** + * + * @type {string} + * @memberof RefundWebhook + */ + 'type'?: string; +} /** * Card instrument meta information * @export @@ -4174,6 +4448,44 @@ export interface SettlementURLObject { */ 'url'?: string; } +/** + * Settlement webhook object + * @export + * @interface SettlementWebhook + */ +export interface SettlementWebhook { + /** + * + * @type {SettlementWebhookDataEntity} + * @memberof SettlementWebhook + */ + 'data'?: SettlementWebhookDataEntity; + /** + * + * @type {string} + * @memberof SettlementWebhook + */ + 'event_time'?: string; + /** + * + * @type {string} + * @memberof SettlementWebhook + */ + 'type'?: string; +} +/** + * data entity in webhook + * @export + * @interface SettlementWebhookDataEntity + */ +export interface SettlementWebhookDataEntity { + /** + * + * @type {SettlementEntity} + * @memberof SettlementWebhookDataEntity + */ + 'settlement'?: SettlementEntity; +} /** * Use this if you are creating an order for cashfree\'s softPOS * @export @@ -4479,93 +4791,6 @@ export interface VendorSplit { */ 'percentage'?: number; } -/** - * customer details object in webhook - * @export - * @interface WHcustomerDetails - */ -export interface WHcustomerDetails { - /** - * - * @type {string} - * @memberof WHcustomerDetails - */ - 'customer_name'?: string; - /** - * - * @type {string} - * @memberof WHcustomerDetails - */ - 'customer_id'?: string; - /** - * - * @type {string} - * @memberof WHcustomerDetails - */ - 'customer_email'?: string; - /** - * - * @type {string} - * @memberof WHcustomerDetails - */ - 'customer_phone'?: string; -} -/** - * webhook object - * @export - * @interface WHdata - */ -export interface WHdata { - /** - * - * @type {WHorder} - * @memberof WHdata - */ - 'order'?: WHorder; - /** - * - * @type {PaymentEntity} - * @memberof WHdata - */ - 'payment'?: PaymentEntity; - /** - * - * @type {WHcustomerDetails} - * @memberof WHdata - */ - 'customer_details'?: WHcustomerDetails; -} -/** - * order entity in webhook - * @export - * @interface WHorder - */ -export interface WHorder { - /** - * - * @type {string} - * @memberof WHorder - */ - 'order_id'?: string; - /** - * - * @type {number} - * @memberof WHorder - */ - 'order_amount'?: number; - /** - * - * @type {string} - * @memberof WHorder - */ - 'order_currency'?: string; - /** - * Custom Tags in thr form of {\"key\":\"value\"} which can be passed for an order. A maximum of 10 tags can be added - * @type {{ [key: string]: string; }} - * @memberof WHorder - */ - 'order_tags'?: { [key: string]: string; }; -} /** * * @export @@ -4638,7 +4863,7 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -4712,7 +4937,7 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -4786,7 +5011,7 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -4860,7 +5085,7 @@ const EligibilityApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -5034,7 +5259,7 @@ const OffersApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -5107,7 +5332,7 @@ const OffersApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -5244,7 +5469,7 @@ const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -5317,7 +5542,7 @@ const OrdersApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -5456,7 +5681,7 @@ const PGReconciliationApiAxiosParamCreator = function (configuration?: Configura localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -5577,7 +5802,7 @@ const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -5650,7 +5875,7 @@ const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -5723,7 +5948,7 @@ const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -5795,7 +6020,7 @@ const PaymentLinksApiAxiosParamCreator = function (configuration?: Configuration - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -5972,7 +6197,7 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -6035,7 +6260,7 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -6112,7 +6337,7 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -6184,7 +6409,7 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -6242,7 +6467,7 @@ const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -6441,7 +6666,7 @@ const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -6518,7 +6743,7 @@ const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -6590,7 +6815,7 @@ const RefundsApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -6749,7 +6974,7 @@ const SettlementReconciliationApiAxiosParamCreator = function (configuration?: C localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -6825,7 +7050,7 @@ const SettlementReconciliationApiAxiosParamCreator = function (configuration?: C localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -6966,7 +7191,7 @@ const SettlementsApiAxiosParamCreator = function (configuration?: Configuration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -7085,7 +7310,7 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -7159,7 +7384,7 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { localVarHeaderParameter['Content-Type'] = 'application/json'; - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -7232,7 +7457,7 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -7314,7 +7539,7 @@ const SoftPOSApiAxiosParamCreator = function (configuration?: Configuration) { - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -7491,7 +7716,7 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -7567,7 +7792,7 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -7646,7 +7871,7 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -7722,7 +7947,7 @@ const TokenVaultApiAxiosParamCreator = function (configuration?: Configuration) - localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.0'; + localVarHeaderParameter['x-sdk-platform'] = 'nodejssdk-3.1.1'; if (x_api_version != null && x_api_version != undefined) { localVarHeaderParameter['x-api-version'] = x_api_version; } @@ -7855,6 +8080,19 @@ class Environment { public SANDBOX = CFEnvironment.SANDBOX; } +export class PGWebhookEvent { + + type: string; + raw: string; + object: any; + + constructor(type: string, rawBody: string, object: any) { + this.type = type; + this.raw = rawBody + this.object = object; + } +} + export class Cashfree { static axios: AxiosInstance; static basePath: string; @@ -7865,9 +8103,30 @@ export class Cashfree { static XClientSignature?: string; static XPartnerMerchantId?: string; static XEnvironment: CFEnvironment; + static XEnableErrorAnalytics: boolean = true; + static XApiVersion: string = "2022-09-01"; static Environment = new Environment(); + /** + * Use this API to verify your webhook signature once you receive from Cashfree's server. + * @summary Verify Webhook Signatures + * @param {string} signature that is present in the header of the webhook ("x-webhook-signature") + * @param {string} rawBody is the entire body sent to the server in string format + * @param {string} timestamp that is present in the header of the webhook ("x-webhook-timestamp") + * @throws {Error} + */ + public static PGVerifyWebhookSignature(signature: string, rawBody: string, timestamp: string) { + const body = timestamp + rawBody + const secretKey = Cashfree.XClientId; + let generatedSignature = crypto.createHmac('sha256', secretKey).update(body).digest("base64"); + if(generatedSignature === signature) { + let jsonObject = JSON.parse(rawBody) + return new PGWebhookEvent(jsonObject.type, rawBody, jsonObject); + } + throw new Error("Generated signature and received signature did not match."); + } + /** * Use this API to get eligible Cardless EMI Payment Methods available for a customer on an order basis their phone number. @@ -7881,6 +8140,7 @@ export class Cashfree { * @memberof EligibilityApi */ public static PGEligibilityFetchCardlessEMI(x_api_version: string, EligibilityFetchCardlessEMIRequest: EligibilityFetchCardlessEMIRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -7899,7 +8159,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -7912,12 +8175,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return EligibilityApiFp().pGEligibilityFetchCardlessEMI(x_api_version, EligibilityFetchCardlessEMIRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -7934,6 +8200,7 @@ export class Cashfree { * @memberof EligibilityApi */ public static PGEligibilityFetchOffers(x_api_version: string, EligibilityFetchOffersRequest: EligibilityFetchOffersRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -7952,7 +8219,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -7965,12 +8235,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return EligibilityApiFp().pGEligibilityFetchOffers(x_api_version, EligibilityFetchOffersRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -7987,6 +8260,7 @@ export class Cashfree { * @memberof EligibilityApi */ public static PGEligibilityFetchPaylater(x_api_version: string, EligibilityFetchPaylaterRequest: EligibilityFetchPaylaterRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8005,7 +8279,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8018,12 +8295,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return EligibilityApiFp().pGEligibilityFetchPaylater(x_api_version, EligibilityFetchPaylaterRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8040,6 +8320,7 @@ export class Cashfree { * @memberof EligibilityApi */ public static PGEligibilityFetchPaymentMethods(x_api_version: string, EligibilityFetchPaymentMethodsRequest: EligibilityFetchPaymentMethodsRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8058,7 +8339,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8071,12 +8355,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return EligibilityApiFp().pGEligibilityFetchPaymentMethods(x_api_version, EligibilityFetchPaymentMethodsRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8093,6 +8380,7 @@ export class Cashfree { * @memberof OffersApi */ public static PGCreateOffer(x_api_version: string, CreateOfferRequest: CreateOfferRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8111,7 +8399,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8124,12 +8415,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return OffersApiFp().pGCreateOffer(x_api_version, CreateOfferRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8146,6 +8440,7 @@ export class Cashfree { * @memberof OffersApi */ public static PGFetchOffer(x_api_version: string, offer_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8164,7 +8459,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8177,12 +8475,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return OffersApiFp().pGFetchOffer(x_api_version, offer_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8199,6 +8500,7 @@ export class Cashfree { * @memberof OrdersApi */ public static PGCreateOrder(x_api_version: string, CreateOrderRequest: CreateOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8217,7 +8519,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8230,12 +8535,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return OrdersApiFp().pGCreateOrder(x_api_version, CreateOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8252,6 +8560,7 @@ export class Cashfree { * @memberof OrdersApi */ public static PGFetchOrder(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8270,7 +8579,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8283,12 +8595,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return OrdersApiFp().pGFetchOrder(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8307,6 +8622,7 @@ export class Cashfree { * @memberof PGReconciliationApi */ public static PGFetchRecon(x_api_version: string, FetchReconRequest: FetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8325,7 +8641,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8338,12 +8657,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return PGReconciliationApiFp().pGFetchRecon(x_api_version, FetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8360,6 +8682,7 @@ export class Cashfree { * @memberof PaymentLinksApi */ public static PGCancelLink(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8378,7 +8701,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8391,12 +8717,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return PaymentLinksApiFp().pGCancelLink(x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8413,6 +8742,7 @@ export class Cashfree { * @memberof PaymentLinksApi */ public static PGCreateLink(x_api_version: string, CreateLinkRequest: CreateLinkRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8431,7 +8761,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8444,12 +8777,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return PaymentLinksApiFp().pGCreateLink(x_api_version, CreateLinkRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8466,6 +8802,7 @@ export class Cashfree { * @memberof PaymentLinksApi */ public static PGFetchLink(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8484,7 +8821,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8497,12 +8837,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return PaymentLinksApiFp().pGFetchLink(x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8519,6 +8862,7 @@ export class Cashfree { * @memberof PaymentLinksApi */ public static PGLinkFetchOrders(x_api_version: string, link_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8537,7 +8881,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8550,12 +8897,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return PaymentLinksApiFp().pGLinkFetchOrders(x_api_version, link_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8573,6 +8923,7 @@ export class Cashfree { * @memberof PaymentsApi */ public static PGAuthorizeOrder(x_api_version: string, order_id: string, AuthorizeOrderRequest: AuthorizeOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8591,7 +8942,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8604,12 +8958,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return PaymentsApiFp().pGAuthorizeOrder(x_api_version, order_id, AuthorizeOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8627,6 +8984,7 @@ export class Cashfree { * @memberof PaymentsApi */ public static PGOrderAuthenticatePayment(x_api_version: string, cf_payment_id: string, OrderAuthenticatePaymentRequest: OrderAuthenticatePaymentRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8645,7 +9003,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8658,12 +9019,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return PaymentsApiFp().pGOrderAuthenticatePayment(x_api_version, cf_payment_id, OrderAuthenticatePaymentRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8681,6 +9045,7 @@ export class Cashfree { * @memberof PaymentsApi */ public static PGOrderFetchPayment(x_api_version: string, order_id: string, cf_payment_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8699,7 +9064,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8712,12 +9080,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return PaymentsApiFp().pGOrderFetchPayment(x_api_version, order_id, cf_payment_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8734,6 +9105,7 @@ export class Cashfree { * @memberof PaymentsApi */ public static PGOrderFetchPayments(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8752,7 +9124,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8765,12 +9140,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return PaymentsApiFp().pGOrderFetchPayments(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8787,6 +9165,7 @@ export class Cashfree { * @memberof PaymentsApi */ public static PGPayOrder(x_api_version: string, PayOrderRequest: PayOrderRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8805,7 +9184,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8818,12 +9200,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return PaymentsApiFp().pGPayOrder(x_api_version, PayOrderRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8841,6 +9226,7 @@ export class Cashfree { * @memberof RefundsApi */ public static PGOrderCreateRefund(x_api_version: string, order_id: string, OrderCreateRefundRequest: OrderCreateRefundRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8859,7 +9245,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8872,12 +9261,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return RefundsApiFp().pGOrderCreateRefund(x_api_version, order_id, OrderCreateRefundRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8895,6 +9287,7 @@ export class Cashfree { * @memberof RefundsApi */ public static PGOrderFetchRefund(x_api_version: string, order_id: string, refund_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8913,7 +9306,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8926,12 +9322,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return RefundsApiFp().pGOrderFetchRefund(x_api_version, order_id, refund_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -8948,6 +9347,7 @@ export class Cashfree { * @memberof RefundsApi */ public static PGOrderFetchRefunds(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -8966,7 +9366,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -8979,12 +9382,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return RefundsApiFp().pGOrderFetchRefunds(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9003,6 +9409,7 @@ export class Cashfree { * @memberof SettlementReconciliationApi */ public static PGFetchSettlements(x_api_version: string, FetchSettlementsRequest: FetchSettlementsRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9021,7 +9428,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9034,12 +9444,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return SettlementReconciliationApiFp().pGFetchSettlements(x_api_version, FetchSettlementsRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9058,6 +9471,7 @@ export class Cashfree { * @memberof SettlementReconciliationApi */ public static PGSettlementFetchRecon(x_api_version: string, SettlementFetchReconRequest: SettlementFetchReconRequest, Content_Type?: string, x_request_id?: string, x_idempotency_key?: string, Accept?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9076,7 +9490,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9089,12 +9506,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return SettlementReconciliationApiFp().pGSettlementFetchRecon(x_api_version, SettlementFetchReconRequest, Content_Type, x_request_id, x_idempotency_key, Accept, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9111,6 +9531,7 @@ export class Cashfree { * @memberof SettlementsApi */ public static PGOrderFetchSettlement(x_api_version: string, order_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9129,7 +9550,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9142,12 +9566,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return SettlementsApiFp().pGOrderFetchSettlement(x_api_version, order_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9164,6 +9591,7 @@ export class Cashfree { * @memberof SoftPOSApi */ public static SposCreateTerminal(x_api_version: string, CreateTerminalRequest: CreateTerminalRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9182,7 +9610,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9195,12 +9626,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return SoftPOSApiFp().sposCreateTerminal(x_api_version, CreateTerminalRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9217,6 +9651,7 @@ export class Cashfree { * @memberof SoftPOSApi */ public static SposCreateTerminalTransaction(x_api_version: string, CreateTerminalTransactionRequest: CreateTerminalTransactionRequest, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9235,7 +9670,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9248,12 +9686,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return SoftPOSApiFp().sposCreateTerminalTransaction(x_api_version, CreateTerminalTransactionRequest, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9270,6 +9711,7 @@ export class Cashfree { * @memberof SoftPOSApi */ public static SposFetchTerminal(x_api_version: string, terminal_phone_no: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9288,7 +9730,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9301,12 +9746,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return SoftPOSApiFp().sposFetchTerminal(x_api_version, terminal_phone_no, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9324,6 +9772,7 @@ export class Cashfree { * @memberof SoftPOSApi */ public static SposFetchTerminalQRCodes(x_api_version: string, terminal_phone_no: string, cf_terminal_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9342,7 +9791,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9355,12 +9807,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return SoftPOSApiFp().sposFetchTerminalQRCodes(x_api_version, terminal_phone_no, cf_terminal_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9378,6 +9833,7 @@ export class Cashfree { * @memberof TokenVaultApi */ public static PGCustomerDeleteInstrument(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9396,7 +9852,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9409,12 +9868,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return TokenVaultApiFp().pGCustomerDeleteInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9432,6 +9894,7 @@ export class Cashfree { * @memberof TokenVaultApi */ public static PGCustomerFetchInstrument(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9450,7 +9913,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9463,12 +9929,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return TokenVaultApiFp().pGCustomerFetchInstrument(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9486,6 +9955,7 @@ export class Cashfree { * @memberof TokenVaultApi */ public static PGCustomerFetchInstruments(x_api_version: string, customer_id: string, instrument_type: PGCustomerFetchInstrumentsInstrumentTypeEnum, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9504,7 +9974,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9517,12 +9990,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return TokenVaultApiFp().pGCustomerFetchInstruments(x_api_version, customer_id, instrument_type, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } @@ -9540,6 +10016,7 @@ export class Cashfree { * @memberof TokenVaultApi */ public static PGCustomerInstrumentsFetchCryptogram(x_api_version: string, customer_id: string, instrument_id: string, x_request_id?: string, x_idempotency_key?: string, options?: AxiosRequestConfig) { + if(Cashfree.XEnableErrorAnalytics) { Sentry.init({ dsn: 'https://ad7936cb4d7f4f2b99c6571a8e7a4df7@o330525.ingest.sentry.io/4505085005725696', // Performance Monitoring @@ -9558,7 +10035,10 @@ export class Cashfree { const filteredDomains = stackTrace.frames.filter((x) => x.filename.includes("cashfree-pg")).map((x) => x.filename); if (filteredDomains[0].includes("cashfree-pg")) { - return event; + if(Cashfree.XEnableErrorAnalytics) { + return event; + } + return null; } } } @@ -9571,12 +10051,15 @@ export class Cashfree { } else { scope.setExtra('environment', 'production'); } - scope.setExtra('release', "3.1.0"); + scope.setExtra('release', "3.1.1"); }); + } try { return TokenVaultApiFp().pGCustomerInstrumentsFetchCryptogram(x_api_version, customer_id, instrument_id, x_request_id, x_idempotency_key, options).then((request) => request(Cashfree.axios, Cashfree.basePath)); } catch (error) { - Sentry.captureException(error); + if(Cashfree.XEnableErrorAnalytics) { + Sentry.captureException(error); + } throw error; } } diff --git a/package.json b/package.json index ad30c0d..8798757 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cashfree-pg", - "version": "3.1.0", + "version": "3.1.1", "description": "Cashfree client for cashfree-pg", "author": "Cashfree Payments", "repository": {