From 8e998a4a7db4b8861176324a2d94d848bdc63f64 Mon Sep 17 00:00:00 2001 From: Pedro Pablo Aste Kompen Date: Mon, 26 Feb 2024 11:59:24 -0300 Subject: [PATCH] refactor(ramp): add provider name to sell tx events --- .../UI/Ramp/Views/SendTransaction/SendTransaction.test.tsx | 4 ++++ .../UI/Ramp/Views/SendTransaction/SendTransaction.tsx | 3 ++- app/components/UI/Ramp/types/analytics.ts | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.test.tsx b/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.test.tsx index 7f8d13ca8cf..e32fbe12f3d 100644 --- a/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.test.tsx +++ b/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.test.tsx @@ -378,6 +378,7 @@ describe('SendTransaction View', () => { "fiat_out": 0, "order_id": "test-id-1", "payment_method_id": "/payments/instant-bank-transfer", + "provider_offramp": "Test (Staging)", }, ] `); @@ -432,6 +433,7 @@ describe('SendTransaction View', () => { "fiat_out": 0, "order_id": "test-id-1", "payment_method_id": "/payments/instant-bank-transfer", + "provider_offramp": "Test (Staging)", }, ] `); @@ -479,6 +481,7 @@ describe('SendTransaction View', () => { "fiat_out": 0, "order_id": "test-id-1", "payment_method_id": "/payments/instant-bank-transfer", + "provider_offramp": "Test (Staging)", }, ] `); @@ -529,6 +532,7 @@ describe('SendTransaction View', () => { "fiat_out": 0, "order_id": "test-id-1", "payment_method_id": "/payments/instant-bank-transfer", + "provider_offramp": "Test (Staging)", }, ] `); diff --git a/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx b/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx index 7db84663a0e..4bf46677aba 100644 --- a/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx +++ b/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx @@ -92,13 +92,14 @@ function SendTransaction() { const transactionAnalyticsPayload = useMemo( () => ({ - crypto_amount: orderData?.cryptoAmount, + crypto_amount: orderData?.cryptoAmount as string, chain_id_source: orderData?.cryptoCurrency.network.chainId, fiat_out: orderData?.fiatAmount, payment_method_id: orderData?.paymentMethod.id, currency_source: orderData?.cryptoCurrency.symbol, currency_destination: orderData?.fiatCurrency.symbol, order_id: order?.id, + provider_offramp: orderData?.provider.name, }), [order?.id, orderData], ); diff --git a/app/components/UI/Ramp/types/analytics.ts b/app/components/UI/Ramp/types/analytics.ts index d358b29786b..6e5b5602061 100644 --- a/app/components/UI/Ramp/types/analytics.ts +++ b/app/components/UI/Ramp/types/analytics.ts @@ -278,6 +278,7 @@ interface RampTransaction { currency_source: string; currency_destination: string; order_id?: string; + provider_offramp: string; } export interface AnalyticsEvents {