Skip to content

Commit 55012c6

Browse files
committed
source-braintree-native: update capture snapshot & redact frequently changing values
A lot of fields frequently change in the capture snapshot. I'm guessing this is due to the recurring nature of subscriptions somehow. Redacting a lot of fields makes the test more resilient to these changes at the price of obscuring what the actual values of those fields should look like. I do find it sometimes helpful to know when certain fields are added or removed, either by the SaaS provider or changes we make to the connector. I made a helper function redact_nested_fields so we still snapshot the fields within lists & dictionaries while being able to redact nested primitive types.
1 parent 3fbe5d2 commit 55012c6

File tree

2 files changed

+122
-79
lines changed

2 files changed

+122
-79
lines changed

source-braintree-native/tests/snapshots/snapshots__capture__capture.stdout.json

+76-78
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
"uuid": "DocUUIDPlaceholder-329Bb50aa48EAa9ef"
99
},
1010
"amount": "7.00",
11-
"created_at": "2024-12-02T16:02:33Z",
11+
"created_at": "redacted",
1212
"description": "",
13-
"id": "2c7b",
13+
"id": "redacted",
1414
"kind": "discount",
1515
"merchant_id": "7bsbj4jzqs733j2f",
1616
"name": "test_discount",
1717
"never_expires": true,
1818
"number_of_billing_cycles": null,
19-
"updated_at": "2024-12-02T16:02:33Z"
19+
"updated_at": "redacted"
2020
}
2121
],
2222
[
@@ -28,15 +28,15 @@
2828
"uuid": "DocUUIDPlaceholder-329Bb50aa48EAa9ef"
2929
},
3030
"amount": "8.00",
31-
"created_at": "2024-12-02T20:59:46Z",
31+
"created_at": "redacted",
3232
"description": "",
33-
"id": "g9km",
33+
"id": "redacted",
3434
"kind": "add_on",
3535
"merchant_id": "7bsbj4jzqs733j2f",
3636
"name": "test_add_on",
3737
"never_expires": true,
3838
"number_of_billing_cycles": null,
39-
"updated_at": "2024-12-02T20:59:46Z"
39+
"updated_at": "redacted"
4040
}
4141
],
4242
[
@@ -50,19 +50,19 @@
5050
"add_ons": [],
5151
"billing_day_of_month": null,
5252
"billing_frequency": 1,
53-
"created_at": "2024-11-26T15:43:33Z",
53+
"created_at": "redacted",
5454
"currency_iso_code": "USD",
5555
"description": "Some test subscription",
5656
"discounts": [],
57-
"id": "38py",
57+
"id": "redacted",
5858
"merchant_id": "7bsbj4jzqs733j2f",
5959
"name": "Test Subscriptoin",
6060
"number_of_billing_cycles": null,
6161
"price": "11.00",
6262
"trial_duration": null,
6363
"trial_duration_unit": null,
6464
"trial_period": false,
65-
"updated_at": "2024-11-26T15:43:33Z"
65+
"updated_at": "redacted"
6666
}
6767
],
6868
[
@@ -89,7 +89,7 @@
8989
"currency_iso_code": "USD",
9090
"default": true,
9191
"funding_details": {},
92-
"id": "estuary",
92+
"id": "redacted",
9393
"individual_details": {
9494
"address_details": {}
9595
},
@@ -129,7 +129,7 @@
129129
"amount": "11.00",
130130
"amount_requested": null,
131131
"authorization_adjustments": [],
132-
"authorization_expires_at": "2024-12-03T16:29:00Z",
132+
"authorization_expires_at": "redacted",
133133
"authorized_transaction_global_id": null,
134134
"authorized_transaction_id": null,
135135
"avs_error_response_code": null,
@@ -176,7 +176,7 @@
176176
"street_address": null
177177
},
178178
"channel": null,
179-
"created_at": "2024-11-26T16:29:00Z",
179+
"created_at": "redacted",
180180
"credit_card": {
181181
"account_balance": null,
182182
"account_type": null,
@@ -276,22 +276,22 @@
276276
"url": null
277277
},
278278
"disbursement_details": {
279-
"disbursement_date": "2024-11-28",
280-
"funds_held": false,
281-
"settlement_amount": "11.00",
282-
"settlement_base_currency_exchange_rate": "1",
283-
"settlement_currency_exchange_rate": "1",
284-
"settlement_currency_iso_code": "USD",
285-
"success": true
279+
"disbursement_date": "redacted",
280+
"funds_held": "redacted",
281+
"settlement_amount": "redacted",
282+
"settlement_base_currency_exchange_rate": "redacted",
283+
"settlement_currency_exchange_rate": "redacted",
284+
"settlement_currency_iso_code": "redacted",
285+
"success": "redacted"
286286
},
287287
"discount_amount": null,
288288
"discounts": [],
289289
"disputes": [],
290290
"escrow_status": null,
291291
"gateway_rejection_reason": null,
292-
"global_id": "dHJhbnNhY3Rpb25fMmdid2ZxNXQ",
293-
"graphql_id": "dHJhbnNhY3Rpb25fMmdid2ZxNXQ",
294-
"id": "2gbwfq5t",
292+
"global_id": "redacted",
293+
"graphql_id": "redacted",
294+
"id": "redacted",
295295
"installment_count": null,
296296
"installments": [],
297297
"master_merchant_account_id": null,
@@ -309,42 +309,42 @@
309309
"merchant_name": "DESCRIPTORNAME",
310310
"network_response_code": "XX",
311311
"network_response_text": "sample network response text",
312-
"network_transaction_id": "020241126162900",
312+
"network_transaction_id": "redacted",
313313
"order_id": null,
314314
"partial_settlement_transaction_global_ids": [],
315315
"partial_settlement_transaction_ids": [],
316316
"payment_instrument_type": "credit_card",
317317
"payment_receipt": {
318-
"account_balance": null,
319-
"amount": "11.00",
320-
"card_last_4": "1881",
321-
"card_type": "Visa",
322-
"currency_iso_code": "USD",
323-
"global_id": "dHJhbnNhY3Rpb25fMmdid2ZxNXQ",
324-
"id": "2gbwfq5t",
318+
"account_balance": "redacted",
319+
"amount": "redacted",
320+
"card_last_4": "redacted",
321+
"card_type": "redacted",
322+
"currency_iso_code": "redacted",
323+
"global_id": "redacted",
324+
"id": "redacted",
325325
"merchant_address": {
326-
"locality": "Braintree",
327-
"phone": "5555555555",
328-
"postal_code": "02184",
329-
"region": "MA",
330-
"street_address": ""
326+
"locality": "redacted",
327+
"phone": "redacted",
328+
"postal_code": "redacted",
329+
"region": "redacted",
330+
"street_address": "redacted"
331331
},
332-
"merchant_identification_number": "123456789012",
333-
"merchant_name": "DESCRIPTORNAME",
334-
"network_identification_code": null,
335-
"pin_verified": false,
336-
"processing_mode": null,
337-
"processor_authorization_code": "HNS5PM",
338-
"processor_response_code": "1000",
339-
"processor_response_text": "Approved",
340-
"terminal_identification_number": "00000001",
341-
"type": "sale"
332+
"merchant_identification_number": "redacted",
333+
"merchant_name": "redacted",
334+
"network_identification_code": "redacted",
335+
"pin_verified": "redacted",
336+
"processing_mode": "redacted",
337+
"processor_authorization_code": "redacted",
338+
"processor_response_code": "redacted",
339+
"processor_response_text": "redacted",
340+
"terminal_identification_number": "redacted",
341+
"type": "redacted"
342342
},
343343
"pin_verified": false,
344344
"plan_id": "38py",
345345
"processed_with_network_token": false,
346346
"processing_mode": null,
347-
"processor_authorization_code": "HNS5PM",
347+
"processor_authorization_code": "redacted",
348348
"processor_response_code": "1000",
349349
"processor_response_text": "Approved",
350350
"processor_response_type": "approved",
@@ -368,7 +368,7 @@
368368
"risk_data": null,
369369
"sca_exemption_requested": null,
370370
"service_fee_amount": null,
371-
"settlement_batch_id": "2024-11-26_estuary_1cbf4has",
371+
"settlement_batch_id": "redacted",
372372
"shipping": {
373373
"company": null,
374374
"country_code_alpha2": null,
@@ -417,34 +417,32 @@
417417
"status": "settled",
418418
"status_history": [
419419
{
420-
"amount": "11.00",
421-
"status": "authorized",
422-
"timestamp": "2024-11-26T16:29:00Z",
423-
"transaction_source": "recurring",
424-
420+
"amount": "redacted",
421+
"status": "redacted",
422+
"timestamp": "redacted",
423+
"transaction_source": "redacted"
425424
},
426425
{
427-
"amount": "11.00",
428-
"status": "submitted_for_settlement",
429-
"timestamp": "2024-11-26T16:29:00Z",
430-
"transaction_source": "recurring",
431-
426+
"amount": "redacted",
427+
"status": "redacted",
428+
"timestamp": "redacted",
429+
"transaction_source": "redacted"
432430
},
433431
{
434-
"amount": "11.00",
435-
"status": "settled",
436-
"timestamp": "2024-11-28T03:07:16Z",
437-
"transaction_source": ""
432+
"amount": "redacted",
433+
"status": "redacted",
434+
"timestamp": "redacted",
435+
"transaction_source": "redacted"
438436
}
439437
],
440438
"sub_merchant_account_id": null,
441439
"subscription": {
442-
"billing_period_end_date": "2024-12-25",
443-
"billing_period_start_date": "2024-11-26"
440+
"billing_period_end_date": "redacted",
441+
"billing_period_start_date": "redacted"
444442
},
445443
"subscription_details": {
446-
"billing_period_end_date": "2024-12-25",
447-
"billing_period_start_date": "2024-11-26"
444+
"billing_period_end_date": "redacted",
445+
"billing_period_start_date": "redacted"
448446
},
449447
"subscription_id": "95jzxv",
450448
"surcharge_amount": null,
@@ -453,7 +451,7 @@
453451
"terminal_identification_number": "00000001",
454452
"three_d_secure_info": null,
455453
"type": "sale",
456-
"updated_at": "2024-11-28T03:07:16Z",
454+
"updated_at": "redacted",
457455
"voice_referral_number": null
458456
}
459457
],
@@ -468,7 +466,7 @@
468466
"amount_won": "0.00",
469467
"case_number": "CB262657160630",
470468
"chargeback_protection_level": null,
471-
"created_at": "2024-11-26T14:24:31Z",
469+
"created_at": "redacted",
472470
"currency_iso_code": "USD",
473471
"date_opened": "2024-11-26",
474472
"date_won": null,
@@ -499,9 +497,9 @@
499497
}
500498
],
501499
"evidence_submittable": false,
502-
"global_id": "ZGlzcHV0ZV9jM3BmdzVxeGJ0NXJnMzhw",
503-
"graphql_id": "ZGlzcHV0ZV9jM3BmdzVxeGJ0NXJnMzhw",
504-
"id": "c3pfw5qxbt5rg38p",
500+
"global_id": "redacted",
501+
"graphql_id": "redacted",
502+
"id": "redacted",
505503
"kind": "chargeback",
506504
"merchant_account_id": "estuary",
507505
"original_dispute_id": null,
@@ -560,7 +558,7 @@
560558
"payment_instrument_subtype": "Visa",
561559
"purchase_order_number": "123654"
562560
},
563-
"updated_at": "2025-01-31T06:18:52Z"
561+
"updated_at": "redacted"
564562
}
565563
],
566564
[
@@ -574,7 +572,7 @@
574572
"billing_day_of_month": 26,
575573
"billing_period_end_date": "redacted",
576574
"billing_period_start_date": "redacted",
577-
"created_at": "2024-11-26T16:29:00Z",
575+
"created_at": "redacted",
578576
"current_billing_cycle": 0,
579577
"days_past_due": null,
580578
"description": null,
@@ -586,7 +584,7 @@
586584
"discounts": [],
587585
"failure_count": 0,
588586
"first_billing_date": "2024-11-26",
589-
"id": "95jzxv",
587+
"id": "redacted",
590588
"merchant_account_id": "estuary",
591589
"never_expires": true,
592590
"next_bill_amount": "11.00",
@@ -962,7 +960,7 @@
962960
},
963961
"addresses": [],
964962
"company": "MyCompany",
965-
"created_at": "2024-11-26T14:24:31Z",
963+
"created_at": "redacted",
966964
"credit_cards": [
967965
{
968966
"billing_address": null,
@@ -1005,9 +1003,9 @@
10051003
"email": "[email protected]",
10061004
"fax": "",
10071005
"first_name": "Jane",
1008-
"global_id": "Y3VzdG9tZXJfMTEzODM4MDcwNjQ",
1009-
"graphql_id": "Y3VzdG9tZXJfMTEzODM4MDcwNjQ",
1010-
"id": "11383807064",
1006+
"global_id": "redacted",
1007+
"graphql_id": "redacted",
1008+
"id": "redacted",
10111009
"international_phone": {
10121010
"country_code": null,
10131011
"national_number": null
@@ -1053,7 +1051,7 @@
10531051
}
10541052
],
10551053
"phone": "98765432310",
1056-
"updated_at": "2024-11-26T14:24:31Z",
1054+
"updated_at": "redacted",
10571055
"website": ""
10581056
}
10591057
]

0 commit comments

Comments
 (0)