From 0495bebdc1d980d2ddeb5d37b894c26b7de9d3e5 Mon Sep 17 00:00:00 2001 From: nwithan8 Date: Thu, 14 Sep 2023 12:55:20 -0600 Subject: [PATCH] - Fix referral customer cassettes --- .../recording.har | 72 ++++++++++--------- .../recording.har | 22 +++--- .../recording.har | 14 ++-- .../recording.har | 30 ++++---- .../recording.har | 28 ++++---- test/services/referral_customer.test.js | 2 +- 6 files changed, 86 insertions(+), 82 deletions(-) diff --git a/test/cassettes/ReferralCustomer-Service_3380152635/add-a-referral-user-credit-card_1978527022/recording.har b/test/cassettes/ReferralCustomer-Service_3380152635/add-a-referral-user-credit-card_1978527022/recording.har index 5115e46d3..08db780f5 100644 --- a/test/cassettes/ReferralCustomer-Service_3380152635/add-a-referral-user-credit-card_1978527022/recording.har +++ b/test/cassettes/ReferralCustomer-Service_3380152635/add-a-referral-user-credit-card_1978527022/recording.har @@ -74,7 +74,7 @@ }, { "name": "x-ep-request-uuid", - "value": "b9d2c49c64f8bb01e79b0620001cf383" + "value": "255d6663650356b7e779980800031f66" }, { "name": "cache-control", @@ -98,7 +98,7 @@ }, { "name": "x-runtime", - "value": "0.023275" + "value": "0.017592" }, { "name": "content-encoding", @@ -110,11 +110,11 @@ }, { "name": "x-node", - "value": "bigweb35nuq" + "value": "bigweb40nuq" }, { "name": "x-version-label", - "value": "easypost-202309052324-fe928dc813-master" + "value": "easypost-202309141829-6768203179-master" }, { "name": "x-backend", @@ -139,8 +139,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2023-09-06T17:46:41.583Z", - "time": 641, + "startedDateTime": "2023-09-14T18:53:43.000Z", + "time": 265, "timings": { "blocked": -1, "connect": -1, @@ -148,7 +148,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 641 + "wait": 265 } }, { @@ -189,11 +189,11 @@ "url": "https://api.stripe.com/v1/tokens?card%5Bnumber%5D=4536410136126170&card%5Bexp_month%5D=05&card%5Bexp_year%5D=2028&card%5Bcvc%5D=778" }, "response": { - "bodySize": 738, + "bodySize": 740, "content": { "mimeType": "application/json", - "size": 738, - "text": "{\"id\":\"tok_0NnPoMDqT4huGUvdq5Emrdc1\",\"object\":\"token\",\"card\":{\"id\":\"card_0NnPoMDqT4huGUvd0qGnXQxC\",\"object\":\"card\",\"address_city\":null,\"address_country\":null,\"address_line1\":null,\"address_line1_check\":null,\"address_line2\":null,\"address_state\":null,\"address_zip\":null,\"address_zip_check\":null,\"brand\":\"Visa\",\"country\":\"US\",\"cvc_check\":\"unchecked\",\"dynamic_last4\":null,\"exp_month\":5,\"exp_year\":2028,\"funding\":\"credit\",\"last4\":\"6170\",\"name\":null,\"tokenization_method\":null,\"wallet\":null},\"client_ip\":\"\",\"created\":1694022402,\"livemode\":true,\"type\":\"card\",\"used\":false}" + "size": 740, + "text": "{\"id\":\"tok_0NqKfbDqT4huGUvdN05G7bhk\",\"object\":\"token\",\"card\":{\"id\":\"card_0NqKfbDqT4huGUvdBO8bzXI9\",\"object\":\"card\",\"address_city\":null,\"address_country\":null,\"address_line1\":null,\"address_line1_check\":null,\"address_line2\":null,\"address_state\":null,\"address_zip\":null,\"address_zip_check\":null,\"brand\":\"Visa\",\"country\":\"US\",\"cvc_check\":\"unchecked\",\"dynamic_last4\":null,\"exp_month\":5,\"exp_year\":2028,\"funding\":\"credit\",\"last4\":\"6170\",\"name\":null,\"tokenization_method\":null,\"wallet\":null},\"client_ip\":\"\",\"created\":1694717623,\"livemode\":true,\"type\":\"card\",\"used\":false}" }, "cookies": [], "headers": [ @@ -203,7 +203,7 @@ }, { "name": "date", - "value": "Wed, 06 Sep 2023 17:46:42 GMT" + "value": "Thu, 14 Sep 2023 18:53:43 GMT" }, { "name": "content-type", @@ -211,7 +211,7 @@ }, { "name": "content-length", - "value": "738" + "value": "740" }, { "name": "connection", @@ -223,7 +223,7 @@ }, { "name": "access-control-allow-methods", - "value": "GET, POST, HEAD, OPTIONS, DELETE" + "value": "GET,HEAD,PUT,PATCH,POST,DELETE" }, { "name": "access-control-allow-origin", @@ -243,15 +243,15 @@ }, { "name": "idempotency-key", - "value": "e813444a-6e67-4d7e-a2db-9b27ae4a5ef4" + "value": "1a46527c-e3f3-4e09-b8f6-cb7eb292c29e" }, { "name": "original-request", - "value": "req_w6y8vfruRxBeZn" + "value": "req_iZQ4AFJIyHCIvh" }, { "name": "request-id", - "value": "req_w6y8vfruRxBeZn" + "value": "req_iZQ4AFJIyHCIvh" }, { "name": "stripe-should-retry", @@ -261,6 +261,10 @@ "name": "stripe-version", "value": "2020-08-27" }, + { + "name": "vary", + "value": "Origin" + }, { "name": "x-stripe-routing-context-priority-tier", "value": "livemode-critical" @@ -270,14 +274,14 @@ "value": "max-age=63072000; includeSubDomains; preload" } ], - "headersSize": 776, + "headersSize": 788, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2023-09-06T17:46:42.229Z", - "time": 435, + "startedDateTime": "2023-09-14T18:53:43.271Z", + "time": 653, "timings": { "blocked": -1, "connect": -1, @@ -285,11 +289,11 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 435 + "wait": 653 } }, { - "_id": "486644a3a965019bc24e40bf746a3b95", + "_id": "6b25e05e7abef9b1868ccb0d2bee7515", "_order": 0, "cache": {}, "request": { @@ -323,18 +327,18 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"credit_card\":{\"stripe_object_id\":\"tok_0NnPoMDqT4huGUvdq5Emrdc1\",\"priority\":\"primary\"}}" + "text": "{\"credit_card\":{\"stripe_object_id\":\"tok_0NqKfbDqT4huGUvdN05G7bhk\",\"priority\":\"primary\"}}" }, "queryString": [], "url": "https://api.easypost.com/v2/credit_cards" }, "response": { - "bodySize": 448, + "bodySize": 212, "content": { "encoding": "base64", "mimeType": "application/json; charset=utf-8", - "size": 448, - "text": "{\"id\":974393902712771600,\"public_id\":\"card_3edcf1bb1c4d411dbdbb3a8a3131a53f\",\"external_reference_id\":\"card_0NnPoMDqT4huGUvd0qGnXQxC\",\"payment_gateway_id\":56205,\"created_at\":\"2023-09-06T17:46:44Z\",\"updated_at\":\"2023-09-06T17:46:44Z\",\"disabled_at\":null,\"type\":\"credit_card\",\"fingerprint\":\"orogTATbHCLF2hsX\",\"bank_name\":null,\"brand\":\"Visa\",\"exp_month\":5,\"exp_year\":2028,\"address_zip_check\":null,\"cvc_check\":\"pass\",\"country\":\"US\",\"last4\":\"6170\",\"verified\":null}" + "size": 212, + "text": "{\"id\":\"card_26ee055ac731452eac91a4123ab76d14\",\"disabled_at\":null,\"object\":\"CreditCard\",\"name\":null,\"last4\":\"6170\",\"exp_month\":5,\"exp_year\":2028,\"brand\":\"Visa\"}" }, "cookies": [], "headers": [ @@ -364,7 +368,7 @@ }, { "name": "x-ep-request-uuid", - "value": "b9d2c49e64f8bb03e79b0622001cf3e2" + "value": "255d6669650356b8e779980b00031fbc" }, { "name": "cache-control", @@ -384,11 +388,11 @@ }, { "name": "etag", - "value": "W/\"9ef6592d86cb6442593e24fe8b337f7e\"" + "value": "W/\"ea37619956488238247db6c06ccac416\"" }, { "name": "x-runtime", - "value": "2.492384" + "value": "2.730606" }, { "name": "content-encoding", @@ -400,11 +404,11 @@ }, { "name": "x-node", - "value": "bigweb35nuq" + "value": "bigweb40nuq" }, { "name": "x-version-label", - "value": "easypost-202309052324-fe928dc813-master" + "value": "easypost-202309141829-6768203179-master" }, { "name": "x-backend", @@ -412,7 +416,7 @@ }, { "name": "x-proxied", - "value": "intlb2nuq 2bcb349163, extlb2nuq 003ad9bca0" + "value": "intlb1nuq 2bcb349163, extlb2nuq 003ad9bca0" }, { "name": "strict-transport-security", @@ -429,8 +433,8 @@ "status": 201, "statusText": "Created" }, - "startedDateTime": "2023-09-06T17:46:42.669Z", - "time": 2934, + "startedDateTime": "2023-09-14T18:53:43.929Z", + "time": 2981, "timings": { "blocked": -1, "connect": -1, @@ -438,7 +442,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 2934 + "wait": 2981 } } ], diff --git a/test/cassettes/ReferralCustomer-Service_3380152635/creates-a-referral-user_159009729/recording.har b/test/cassettes/ReferralCustomer-Service_3380152635/creates-a-referral-user_159009729/recording.har index 24c9aa4b6..56507ab84 100644 --- a/test/cassettes/ReferralCustomer-Service_3380152635/creates-a-referral-user_159009729/recording.har +++ b/test/cassettes/ReferralCustomer-Service_3380152635/creates-a-referral-user_159009729/recording.har @@ -48,12 +48,12 @@ "url": "https://api.easypost.com/v2/referral_customers" }, "response": { - "bodySize": 736, + "bodySize": 740, "content": { "encoding": "base64", "mimeType": "application/json; charset=utf-8", - "size": 736, - "text": "{\"id\":\"user_197711ade1a34eeea6c0826516296a81\",\"object\":\"User\",\"parent_id\":null,\"name\":\"Test Referral\",\"phone_number\":\"\",\"verified\":true,\"created_at\":\"2023-09-06T17:46:37Z\",\"default_carbon_offset\":false,\"has_elevate_access\":false,\"balance\":\"0.00000\",\"price_per_shipment\":\"0.00000\",\"recharge_amount\":null,\"secondary_recharge_amount\":null,\"recharge_threshold\":null,\"has_billing_method\":null,\"cc_fee_rate\":\"0.0375\",\"default_insurance_amount\":\"50.00\",\"insurance_fee_rate\":\"0.005\",\"insurance_fee_minimum\":\"0.25\",\"email\":\"\",\"children\":[],\"api_keys\":[{\"object\":\"ApiKey\",\"key\":\"\",\"mode\":\"test\",\"created_at\":\"2023-09-06T17:46:37Z\",\"active\":true,\"id\":\"ak_6b0b026470db4b46928cd802ffbdec04\"},{\"object\":\"ApiKey\",\"key\":\"\",\"mode\":\"production\",\"created_at\":\"2023-09-06T17:46:37Z\",\"active\":true,\"id\":\"ak_de9ba32ffe5e4e0eabef4b9a35f9f899\"}]}" + "size": 740, + "text": "{\"id\":\"user_7c5e68c3579d46b5a7be93b29e82de25\",\"object\":\"User\",\"parent_id\":null,\"name\":\"Test Referral\",\"phone_number\":\"\",\"verified\":true,\"created_at\":\"2023-09-14T18:53:39Z\",\"default_carbon_offset\":false,\"has_elevate_access\":false,\"balance\":\"0.00000\",\"price_per_shipment\":\"0.00000\",\"recharge_amount\":null,\"secondary_recharge_amount\":null,\"recharge_threshold\":null,\"has_billing_method\":null,\"cc_fee_rate\":\"0.0375\",\"default_insurance_amount\":\"50.00\",\"insurance_fee_rate\":\"0.005\",\"insurance_fee_minimum\":\"0.25\",\"email\":\"\",\"children\":[],\"api_keys\":[{\"object\":\"ApiKey\",\"key\":\"\",\"mode\":\"test\",\"created_at\":\"2023-09-14T18:53:40Z\",\"active\":true,\"id\":\"ak_0eada1ecf8a341d18b80ef90c2d57668\"},{\"object\":\"ApiKey\",\"key\":\"\",\"mode\":\"production\",\"created_at\":\"2023-09-14T18:53:40Z\",\"active\":true,\"id\":\"ak_bbaf7f688e684c779a50254a8fa46ad7\"}]}" }, "cookies": [], "headers": [ @@ -83,7 +83,7 @@ }, { "name": "x-ep-request-uuid", - "value": "b9d2c49e64f8bafde79b030a001cf19f" + "value": "255d6668650356b3e77997ea00031e7d" }, { "name": "cache-control", @@ -103,11 +103,11 @@ }, { "name": "etag", - "value": "W/\"9a5f0932560f978c6ea5b133943b92ea\"" + "value": "W/\"bc2d8dcda4de3b31c52a58e632458769\"" }, { "name": "x-runtime", - "value": "0.956863" + "value": "1.084568" }, { "name": "content-encoding", @@ -119,11 +119,11 @@ }, { "name": "x-node", - "value": "bigweb33nuq" + "value": "bigweb38nuq" }, { "name": "x-version-label", - "value": "easypost-202309052324-fe928dc813-master" + "value": "easypost-202309141829-6768203179-master" }, { "name": "x-backend", @@ -148,8 +148,8 @@ "status": 201, "statusText": "Created" }, - "startedDateTime": "2023-09-06T17:46:36.805Z", - "time": 1427, + "startedDateTime": "2023-09-14T18:53:39.331Z", + "time": 1417, "timings": { "blocked": -1, "connect": -1, @@ -157,7 +157,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 1427 + "wait": 1417 } } ], diff --git a/test/cassettes/ReferralCustomer-Service_3380152635/retrieves-all-referral-users_447651186/recording.har b/test/cassettes/ReferralCustomer-Service_3380152635/retrieves-all-referral-users_447651186/recording.har index 044e58c04..26faebf01 100644 --- a/test/cassettes/ReferralCustomer-Service_3380152635/retrieves-all-referral-users_447651186/recording.har +++ b/test/cassettes/ReferralCustomer-Service_3380152635/retrieves-all-referral-users_447651186/recording.har @@ -79,7 +79,7 @@ }, { "name": "x-ep-request-uuid", - "value": "b9d2c49d64f8bafee79b030b001cf211" + "value": "255d6668650356b5e77997eb00031ecb" }, { "name": "cache-control", @@ -103,7 +103,7 @@ }, { "name": "x-runtime", - "value": "0.259426" + "value": "0.177487" }, { "name": "content-encoding", @@ -115,11 +115,11 @@ }, { "name": "x-node", - "value": "bigweb31nuq" + "value": "bigweb40nuq" }, { "name": "x-version-label", - "value": "easypost-202309052324-fe928dc813-master" + "value": "easypost-202309141829-6768203179-master" }, { "name": "x-backend", @@ -144,8 +144,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2023-09-06T17:46:38.241Z", - "time": 705, + "startedDateTime": "2023-09-14T18:53:40.758Z", + "time": 405, "timings": { "blocked": -1, "connect": -1, @@ -153,7 +153,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 705 + "wait": 405 } } ], diff --git a/test/cassettes/ReferralCustomer-Service_3380152635/retrieves-next-page-of-referral-customer_33395404/recording.har b/test/cassettes/ReferralCustomer-Service_3380152635/retrieves-next-page-of-referral-customer_33395404/recording.har index 55c00dec8..7a614ac55 100644 --- a/test/cassettes/ReferralCustomer-Service_3380152635/retrieves-next-page-of-referral-customer_33395404/recording.har +++ b/test/cassettes/ReferralCustomer-Service_3380152635/retrieves-next-page-of-referral-customer_33395404/recording.har @@ -79,7 +79,7 @@ }, { "name": "x-ep-request-uuid", - "value": "b9d2c49964f8baffe79b030d001cf24a" + "value": "255d6667650356b5e77997ec00031ee4" }, { "name": "cache-control", @@ -103,7 +103,7 @@ }, { "name": "x-runtime", - "value": "0.251158" + "value": "0.257584" }, { "name": "content-encoding", @@ -115,11 +115,11 @@ }, { "name": "x-node", - "value": "bigweb31nuq" + "value": "bigweb42nuq" }, { "name": "x-version-label", - "value": "easypost-202309052324-fe928dc813-master" + "value": "easypost-202309132132-7353506ccf-master" }, { "name": "x-backend", @@ -144,8 +144,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2023-09-06T17:46:38.955Z", - "time": 809, + "startedDateTime": "2023-09-14T18:53:41.170Z", + "time": 489, "timings": { "blocked": -1, "connect": -1, @@ -153,7 +153,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 809 + "wait": 489 } }, { @@ -232,7 +232,7 @@ }, { "name": "x-ep-request-uuid", - "value": "b9d2c49864f8bb00e79b061d001cf2a9" + "value": "255d666a650356b5e77997ed00031f01" }, { "name": "cache-control", @@ -256,7 +256,7 @@ }, { "name": "x-runtime", - "value": "0.270923" + "value": "0.290175" }, { "name": "content-encoding", @@ -268,11 +268,11 @@ }, { "name": "x-node", - "value": "bigweb40nuq" + "value": "bigweb31nuq" }, { "name": "x-version-label", - "value": "easypost-202309052324-fe928dc813-master" + "value": "easypost-202309141829-6768203179-master" }, { "name": "x-backend", @@ -280,7 +280,7 @@ }, { "name": "x-proxied", - "value": "intlb1nuq 2bcb349163, extlb2nuq 003ad9bca0" + "value": "intlb2nuq 2bcb349163, extlb2nuq 003ad9bca0" }, { "name": "strict-transport-security", @@ -297,8 +297,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2023-09-06T17:46:39.769Z", - "time": 714, + "startedDateTime": "2023-09-14T18:53:41.663Z", + "time": 527, "timings": { "blocked": -1, "connect": -1, @@ -306,7 +306,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 714 + "wait": 527 } } ], diff --git a/test/cassettes/ReferralCustomer-Service_3380152635/updates-a-referral-user_2206325082/recording.har b/test/cassettes/ReferralCustomer-Service_3380152635/updates-a-referral-user_2206325082/recording.har index 2518fc638..78fd295cd 100644 --- a/test/cassettes/ReferralCustomer-Service_3380152635/updates-a-referral-user_2206325082/recording.har +++ b/test/cassettes/ReferralCustomer-Service_3380152635/updates-a-referral-user_2206325082/recording.har @@ -79,7 +79,7 @@ }, { "name": "x-ep-request-uuid", - "value": "b9d2c49e64f8bb00e79b061e001cf2f6" + "value": "255d6669650356b6e77997ef00031f2f" }, { "name": "cache-control", @@ -103,7 +103,7 @@ }, { "name": "x-runtime", - "value": "0.188229" + "value": "0.174550" }, { "name": "content-encoding", @@ -115,11 +115,11 @@ }, { "name": "x-node", - "value": "bigweb36nuq" + "value": "bigweb34nuq" }, { "name": "x-version-label", - "value": "easypost-202309052324-fe928dc813-master" + "value": "easypost-202309132132-7353506ccf-master" }, { "name": "x-backend", @@ -144,8 +144,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2023-09-06T17:46:40.494Z", - "time": 584, + "startedDateTime": "2023-09-14T18:53:42.198Z", + "time": 423, "timings": { "blocked": -1, "connect": -1, @@ -153,7 +153,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 584 + "wait": 423 } }, { @@ -232,7 +232,7 @@ }, { "name": "x-ep-request-uuid", - "value": "b9d2c49d64f8bb01e79b061f001cf34d" + "value": "255d6669650356b6e779980700031f4e" }, { "name": "cache-control", @@ -256,7 +256,7 @@ }, { "name": "x-runtime", - "value": "0.108025" + "value": "0.108729" }, { "name": "content-encoding", @@ -272,7 +272,7 @@ }, { "name": "x-version-label", - "value": "easypost-202309052324-fe928dc813-master" + "value": "easypost-202309141829-6768203179-master" }, { "name": "x-backend", @@ -280,7 +280,7 @@ }, { "name": "x-proxied", - "value": "intlb2nuq 2bcb349163, extlb2nuq 003ad9bca0" + "value": "intlb1nuq 2bcb349163, extlb2nuq 003ad9bca0" }, { "name": "strict-transport-security", @@ -297,8 +297,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2023-09-06T17:46:41.082Z", - "time": 493, + "startedDateTime": "2023-09-14T18:53:42.627Z", + "time": 363, "timings": { "blocked": -1, "connect": -1, @@ -306,7 +306,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 493 + "wait": 363 } } ], diff --git a/test/services/referral_customer.test.js b/test/services/referral_customer.test.js index a22e19362..d4fd8186c 100644 --- a/test/services/referral_customer.test.js +++ b/test/services/referral_customer.test.js @@ -87,7 +87,7 @@ describe('ReferralCustomer Service', function () { creditCardDetails.cvc, ); - expect(paymentMethod.public_id).to.match(/^card_/); + expect(paymentMethod.id).to.match(/^card_/); expect(paymentMethod.last4).to.equal('6170'); }); });