feat(analytics): Add refund sessionized metrics for Analytics V2 dashboard#6616
feat(analytics): Add refund sessionized metrics for Analytics V2 dashboard#6616likhinbopanna merged 21 commits intomainfrom
Conversation
This reverts commit 0369df6. revert sessionized_refunds_distribution metric
…eason distribution
| res.push(ReasonsResult { | ||
| reason: val.refund_reason, | ||
| count: val.count, | ||
| percentage: (perc * 100.0).round() / 100.0, |
There was a problem hiding this comment.
Why the multiplication and division by 100?
If it's to only have 2 decimal places, be aware of the concerns with how floats are represented in computers, so the resulting number may be slightly off.
If you just need a string representation of this, you can use format!() (this even does the rounding):
format!("{perc:.02}");Or if you need to perform further calculation, you can use a crate that handles decimals, such as the rust_decimal crate.
There was a problem hiding this comment.
The string representation is not required, need it to be an f64 itself.
Multiplication by 100, allows us to round it to the nearest integer, and again dividing by 100 will give us 2 decimal places, which is the desired behaviour.
There was a problem hiding this comment.
The reason why we'd have to be careful of doing floating point arithmetic like this is due to the gotchas involved: https://floating-point-gui.de/ (including a link in case you weren't aware already).
If we are completely sure that such arithmetic is safe, then we can proceed with it, no worries. Otherwise, we may have to consider handling it better.
There was a problem hiding this comment.
Understood, and I believe the arithmetic is safe. Thanks for the additional documentation link regarding this issue.
crates/analytics/src/refunds/distribution/sessionized_distribution/mod.rs
Show resolved
Hide resolved
crates/analytics/src/refunds/distribution/sessionized_distribution/refund_error_message.rs
Show resolved
Hide resolved
| res.push(ReasonsResult { | ||
| reason: val.refund_reason, | ||
| count: val.count, | ||
| percentage: (perc * 100.0).round() / 100.0, |
There was a problem hiding this comment.
The reason why we'd have to be careful of doing floating point arithmetic like this is due to the gotchas involved: https://floating-point-gui.de/ (including a link in case you weren't aware already).
If we are completely sure that such arithmetic is safe, then we can proceed with it, no worries. Otherwise, we may have to consider handling it better.
Type of Change
Description
Adding metrics, and support for Refund Page in Analytics V2 Dashboard through sessionizer.
The metrics added are as follows:
This PR also adds support for refunds distribution, similar to payments distribution, which may be needed in the future for more advanced analytics.
The following distributions are added:
Additional Changes
Motivation and Context
Provide more insights into Refunds data for the merchants to make important business decisions
How did you test it?
Refunds Success Rate:
Response:
{ "queryData": [ { "successful_refunds": 6, "total_refunds": 10, "refund_success_rate": 60.0, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": null, "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": 60.0, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 0, "total_refund_error_message_count": 0 } ] }Fields to be tested:
Total Refunds Processed (Amount)
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 1800, "refund_processed_amount_in_usd": 21, "refund_processed_count": 3, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": "INR", "refund_status": null, "connector": null, "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 1800, "refund_processed_amount_in_usd": 1800, "refund_processed_count": 3, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": "USD", "refund_status": null, "connector": null, "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 3600, "total_refund_processed_amount_in_usd": 1821, "total_refund_processed_count": 6, "total_refund_reason_count": 0, "total_refund_error_message_count": 0 } ] }Fields to be tested:
Successful Refunds:
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": 6, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": null, "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 0, "total_refund_error_message_count": 0 } ] }Fields to be tested:
Failed Refunds
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": 4, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": null, "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 0, "total_refund_error_message_count": 0 } ] }Fields to be tested:
Pending Refunds
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": 0, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": null, "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 0, "total_refund_error_message_count": 0 } ] }Fields to be tested:
Refund Success Rate series graph is similar to Refund Success Rate above, granularity will be added.
Refund Processed Amount and Count series graph is similar to the one above, granularity will be added.
Successful Refunds Distribution by connector:
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": 7, "refund_success_count": 6, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "stripe_test", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": 3, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 0, "total_refund_error_message_count": 0 } ] }Fields to be tested and taken into account:
Failed Refunds Distribution by connector:
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": 7, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "stripe_test", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": 3, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 0, "total_refund_error_message_count": 0 } ] }Fields to be tested and taken into account:
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": 3, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": 1, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "stripe_test", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 0, "total_refund_error_message_count": 0 } ] }Fields to be tested and taken into account:
From the two API calls, failed refunds and total refunds can be calculated for every connector, and the failed refunds distribution can be plotted and displayed.
Refund Reasons:
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 1, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "stripe_test", "refund_type": null, "profile_id": null, "refund_reason": "Test REFUND - 1", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 6, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "stripe_test", "refund_type": null, "profile_id": null, "refund_reason": "Customer returned product", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 1, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": "Test Refund - 3", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 2, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": "Test Refund - 2", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 10, "total_refund_error_message_count": 0 } ] }Fields to be tested:
Failed Refund Reasons:
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 2, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": "Test Refund - 2", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 1, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "stripe_test", "refund_type": null, "profile_id": null, "refund_reason": "Customer returned product", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 1, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": "Test Refund - 3", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 4, "total_refund_error_message_count": 0 } ] }Fields to be tested:
Failed Refund Error Message:
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 1, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": "The refund failed due to test-failure 3.", "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 1, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": "The refund failed due to test-failure.", "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 0, "total_refund_error_message_count": 2 } ] }Fields to be tested:
Refund Reasons Distribution:
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": [ { "reason": "Test REFUND - 1", "count": 1, "percentage": 14.29 } ], "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "stripe_test", "refund_type": null, "profile_id": null, "refund_reason": "Test REFUND - 1", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": [ { "reason": "Test Refund - 2", "count": 2, "percentage": 66.67 } ], "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": "Test Refund - 2", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": [ { "reason": "Test Refund - 3", "count": 1, "percentage": 33.33 } ], "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": "Test Refund - 3", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": [ { "reason": "Customer returned product", "count": 6, "percentage": 85.71 } ], "refund_error_message_distribution": null, "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "stripe_test", "refund_type": null, "profile_id": null, "refund_reason": "Customer returned product", "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 0, "total_refund_error_message_count": 0 } ] }Fields to be tested:
Refund Error Message Distribution:
Response:
{ "queryData": [ { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": [ { "error_message": "The refund failed due to test-failure 3.", "count": 1, "percentage": 33.33 } ], "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": "The refund failed due to test-failure 3.", "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": [ { "error_message": "", "count": 1, "percentage": 33.33 } ], "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": [ { "error_message": "The refund failed due to test-failure.", "count": 1, "percentage": 33.33 } ], "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "adyen", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": "The refund failed due to test-failure.", "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" }, { "successful_refunds": null, "total_refunds": null, "refund_success_rate": null, "refund_count": null, "refund_success_count": null, "refund_processed_amount": 0, "refund_processed_amount_in_usd": null, "refund_processed_count": null, "refund_reason_distribution": null, "refund_error_message_distribution": [ { "error_message": "", "count": 1, "percentage": 100.0 } ], "refund_reason_count": 0, "refund_error_message_count": 0, "currency": null, "refund_status": null, "connector": "stripe_test", "refund_type": null, "profile_id": null, "refund_reason": null, "refund_error_message": null, "time_range": { "start_time": "2024-11-01T09:00:00.000Z", "end_time": "2024-11-29T09:30:39.000Z" }, "time_bucket": "2024-11-01 09:00:00" } ], "metaData": [ { "total_refund_success_rate": null, "total_refund_processed_amount": 0, "total_refund_processed_amount_in_usd": 0, "total_refund_processed_count": 0, "total_refund_reason_count": 0, "total_refund_error_message_count": 0 } ] }Fields to be tested:
Checklist
cargo +nightly fmt --allcargo clippy