From acc3d143bf2412c67360c5018773e48eebbfdf67 Mon Sep 17 00:00:00 2001 From: Bruno Vieira Date: Mon, 30 Oct 2023 15:29:57 +0000 Subject: [PATCH] support cursor based pagination, update to v3.3.1 (#144) * support cursor based pagination, update to v3.3.1 --- .gitignore | 3 +- changelog.md | 8 + chartmogul-ruby.gemspec | 2 +- .../creates_contact_correctly.yml | 134 ----- .../destroys_contact_correctly.yml | 99 ---- .../merges_contact_correctly.yml | 105 ---- .../API_Interactions/paginates_correctly.yml | 133 ----- .../updates_contact_correctly.yml | 102 ---- .../adds_custom_attributes.yml | 80 --- .../API_Interactions/adds_required_tags.yml | 79 --- .../can_page_through_search_endpoint.yml | 43 -- .../correctly_handles_a_422_response.yml | 50 -- .../correctly_interracts_with_the_API.yml | 192 ------ ...ct_belonging_to_the_customer_correctly.yml | 72 --- ...ts_belonging_to_the_customer_correctly.yml | 72 --- .../API_Interactions/merges_customers.yml | 185 ------ .../raises_401_if_invalid_credentials.yml | 38 -- ...aises_422_for_update_with_invalid_data.yml | 86 --- .../removes_custom_attributes.yml | 80 --- .../API_Interactions/removes_tags.yml | 80 --- ..._camel_case_for_all_customers_endpoint.yml | 45 -- ...ll_customers_through_list_all_endpoint.yml | 47 -- ...rns_customer_through_retrieve_endpoint.yml | 42 -- ...ight_customers_through_search_endpoint.yml | 43 -- .../updates_custom_attributes.yml | 81 --- .../API_Interactions/updates_customer.yml | 139 ----- .../updates_customer_using_class_method.yml | 53 -- .../returns_matching_user_if_exists.yml | 102 ---- ...returns_nil_if_customer_does_not_exist.yml | 101 ---- .../correctly_interracts_with_the_API.yml | 337 ----------- .../API_Interactions/deletes_an_invoice.yml | 37 -- .../deletes_an_invoice_with_class_method.yml | 37 -- .../retrieves_existing_invoice_by_uuid.yml | 50 -- ...all_invoices_through_list_all_endpoint.yml | 46 -- .../should_be_pageable.yml | 44 -- .../should_have_Activity_entries.yml | 44 -- .../should_be_pageable.yml | 41 -- .../should_have_Activity_entries.yml | 41 -- .../should_be_pageable.yml | 40 -- .../should_have_Subscription_entries.yml | 40 -- .../correctly_handles_a_422_error.yml | 51 -- .../correctly_interacts_with_the_API.yml | 152 ----- .../deletes_existing_plan.yml | 198 ------- .../retrieves_existing_plan_by_uuid.yml | 151 ----- .../updates_existing_plan.yml | 198 ------- ...dates_existing_plan_using_class_method.yml | 164 ------ .../correctly_handles_a_422_error.yml | 50 -- .../API_interactions/deletes_a_plan_group.yml | 293 ---------- .../retrieves_existing_plan_group_by_uuid.yml | 251 -------- .../returns_an_array_of_plan_groups.yml | 357 ----------- .../updates_existing_plan_group_name.yml | 304 ---------- ...sting_plan_group_name_via_class_method.yml | 297 ---------- .../updates_existing_plan_group_plans.yml | 411 ------------- ...ns_an_array_of_plans_in_the_plan_group.yml | 252 -------- .../correctly_interracts_with_the_API.yml | 340 ----------- lib/chartmogul/api/actions/custom.rb | 3 +- .../concerns/pageable_with_cursor.rb | 4 + lib/chartmogul/contact.rb | 5 +- lib/chartmogul/customer.rb | 14 +- lib/chartmogul/customer_invoices.rb | 6 +- lib/chartmogul/enrichment/customer.rb | 1 + lib/chartmogul/invoice.rb | 1 + lib/chartmogul/metrics/activity.rb | 5 +- lib/chartmogul/metrics/customers/activity.rb | 5 + .../metrics/customers/subscription.rb | 5 + lib/chartmogul/plan.rb | 1 + lib/chartmogul/plan_group.rb | 1 + lib/chartmogul/plan_groups/plans.rb | 11 + lib/chartmogul/subscription.rb | 5 + lib/chartmogul/subscription_event.rb | 1 + lib/chartmogul/version.rb | 2 +- spec/chartmogul/account_spec.rb | 21 +- spec/chartmogul/contact_spec.rb | 207 ++++--- spec/chartmogul/customer_invoices_spec.rb | 83 ++- spec/chartmogul/customer_spec.rb | 553 +++++++++--------- spec/chartmogul/data_source_spec.rb | 21 +- spec/chartmogul/invoice_spec.rb | 128 ++-- spec/chartmogul/metrics/activities_spec.rb | 11 + .../metrics/customers/activities_spec.rb | 14 +- .../metrics/customers/subscriptions_spec.rb | 13 +- spec/chartmogul/plan_group_spec.rb | 180 +++--- spec/chartmogul/plan_groups/plans_spec.rb | 71 ++- spec/chartmogul/plan_spec.rb | 157 ++--- spec/chartmogul/subscription_event_spec.rb | 16 +- spec/chartmogul/subscription_spec.rb | 28 +- .../works_in_a_threaded_environment.yml | 0 .../works_when_credentials_are_updated.yml | 0 .../returns_details_of_current_account.yml | 0 .../creates_the_contact_correctly.yml | 36 ++ .../destroys_the_contact_correctly.yml | 34 ++ .../API_Actions/merges_contacts_correctly.yml | 37 ++ .../retrieves_the_contact_correctly.yml | 36 ++ ...ontact_correctly_with_the_class_method.yml | 36 ++ .../paginates_correctly.yml | 70 +++ .../paginates_correctly.yml | 37 ++ .../adds_custom_attributes_correctly.yml | 37 ++ .../API_Actions/adds_tags_correctly.yml | 36 ++ ...ct_belonging_to_the_customer_correctly.yml | 36 ++ .../creates_the_customer_correctly.yml | 37 ++ .../destroys_the_customer_correctly.yml | 30 + ...ts_belonging_to_the_customer_correctly.yml | 36 ++ ...es_belonging_to_the_customer_correctly.yml | 60 ++ ...ns_belonging_to_the_customer_correctly.yml | 56 ++ ...tomers_correctly_with_the_class_method.yml | 34 ++ ...ers_correctly_with_the_instance_method.yml | 106 ++++ ...rching_for_customers_does_not_find_any.yml | 22 +- .../removes_custom_attributes_correctly.yml | 32 + .../API_Actions/removes_tags_correctly.yml | 36 ++ .../retrieves_the_customer_correctly.yml | 37 ++ .../searches_for_customers_correctly.yml | 41 ++ .../updates_custom_attributes_correctly.yml | 37 ++ ...stomer_correctly_with_the_class_method.yml | 38 ++ ...mer_correctly_with_the_instance_method.yml | 73 +++ .../paginates_correctly.yml | 79 +++ .../search_endpoint_correctly.yml | 41 ++ .../paginates_correctly.yml | 41 ++ .../search_endpoint_correctly.yml | 37 ++ .../returns_matching_user_if_exists.yml | 41 ++ ...returns_nil_if_customer_does_not_exist.yml | 34 +- ...creates_the_customer_invoice_correctly.yml | 234 ++++++++ ...stroys_all_customer_invoices_correctly.yml | 48 ++ .../paginates_correctly.yml | 113 ++++ .../paginates_correctly.yml | 60 ++ .../correctly_interracts_with_the_API.yml | 0 .../correctly_raises_errors_on_404.yml | 0 .../correctly_raises_errors_on_422.yml | 0 ...ves_existing_data_source_matching_uuid.yml | 0 .../destroys_the_invoice_correctly.yml | 48 ++ ...invoice_correctly_with_instance_method.yml | 105 ++++ .../retrieves_the_invoice_correctly.yml | 60 ++ .../paginates_correctly.yml | 117 ++++ .../paginates_correctly.yml | 60 ++ .../should_have_summary.yml | 0 .../should_have_entries.yml | 0 .../should_have_summary.yml | 0 .../should_have_entries.yml | 0 .../should_have_summary.yml | 0 .../should_have_entries.yml | 0 .../get_activities_export.yml | 0 .../post_activities_export.yml | 0 .../ChartMogul_Metrics_Activity.yml | 0 .../should_be_pageable.yml | 43 ++ .../should_have_Activity_entries.yml | 43 ++ ...ate_using_cursor_when_called_with_next.yml | 70 +++ .../should_have_entries.yml | 0 .../should_have_summary.yml | 0 .../should_have_summary.yml | 0 .../should_have_entries.yml | 0 .../should_have_summary.yml | 0 .../should_have_entries.yml | 0 .../should_be_pageable.yml | 37 ++ .../should_have_Activity_entries.yml | 37 ++ ...ate_using_cursor_when_called_with_next.yml | 71 +++ .../should_be_pageable.yml | 37 ++ .../should_have_Subscription_entries.yml | 37 ++ ...ate_using_cursor_when_called_with_next.yml | 70 +++ .../should_have_summary.yml | 0 .../should_have_entries.yml | 0 .../should_have_summary.yml | 0 .../should_have_entries.yml | 0 .../should_have_summary.yml | 0 .../should_have_entries.yml | 0 .../and_fails_on_incorrect_credentials.yml | 0 ...d_fails_with_500_internal_server_error.yml | 0 ...d_fails_with_504_gateway_timeout_error.yml | 0 .../pings/when_credentials_correct.yml | 0 .../creates_the_plan_correctly.yml | 57 ++ .../destroys_the_plan_correctly.yml | 48 ++ .../retrieves_the_plan_correctly.yml | 56 ++ ...e_plan_correctly_with_the_class_method.yml | 53 ++ ...lan_correctly_with_the_instance_method.yml | 107 ++++ .../paginates_correctly.yml | 110 ++++ .../paginates_correctly.yml | 57 ++ .../correctly_handles_a_422_error.yml | 54 ++ .../creates_a_plan_group_correctly.yml | 110 ++++ .../destroys_a_plan_group_correctly.yml | 101 ++++ .../retrieves_the_plan_group_correctly.yml | 56 ++ .../updates_a_plan_group_plans.yml | 216 +++++++ ..._group_correctly_with_the_class_method.yml | 56 ++ ...oup_correctly_with_the_instance_method.yml | 109 ++++ .../paginates_correctly.yml | 109 ++++ .../paginates_correctly.yml | 56 ++ .../paginates_correctly.yml | 109 ++++ .../paginates_correctly.yml | 56 ++ .../connects_subscriptions.yml | 0 .../correctly_interracts_with_the_API.yml | 309 ++++++++++ .../API_Interactions/has_multiple_aliases.yml | 0 ...ate_using_cursor_when_called_with_next.yml | 109 ++++ ...cancellation_dates_of_the_subscription.yml | 0 .../raises_an_exception.yml | 0 ...cancellation_dates_of_the_subscription.yml | 0 ...all_and_removes_the_cancellation_dates.yml | 0 .../creates_a_new_subscription_event.yml | 0 ...scription_event_through_initialization.yml | 0 .../deletes_the_subscription_event.yml | 0 .../lists_all_subscription_events.yml | 121 ++-- ...ate_using_cursor_when_called_with_next.yml | 109 ++++ .../updates_the_subscription_event.yml | 0 .../correctly_interracts_with_the_API.yml | 0 spec/spec_helper.rb | 2 +- 200 files changed, 5601 insertions(+), 7297 deletions(-) delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/creates_contact_correctly.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/destroys_contact_correctly.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/merges_contact_correctly.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/paginates_correctly.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/updates_contact_correctly.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_custom_attributes.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_required_tags.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/can_page_through_search_endpoint.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_handles_a_422_response.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_interracts_with_the_API.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/creates_a_contact_belonging_to_the_customer_correctly.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/lists_the_contacts_belonging_to_the_customer_correctly.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/merges_customers.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_401_if_invalid_credentials.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_422_for_update_with_invalid_data.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_custom_attributes.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_tags.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/respects_camel_case_for_all_customers_endpoint.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_all_customers_through_list_all_endpoint.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_customer_through_retrieve_endpoint.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_custom_attributes.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer_using_class_method.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice_with_class_method.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/retrieves_existing_invoice_by_uuid.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/returns_all_invoices_through_list_all_endpoint.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_PageableWithAnchor/should_be_pageable.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/behaves_like_Pageable/should_be_pageable.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_have_Activity_entries.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/behaves_like_Pageable/should_be_pageable.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_have_Subscription_entries.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_handles_a_422_error.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_interacts_with_the_API.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan_using_class_method.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/correctly_handles_a_422_error.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/deletes_a_plan_group.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/retrieves_existing_plan_group_by_uuid.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/returns_an_array_of_plan_groups.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name_via_class_method.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_plans.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_interactions/given_a_plan_group_uuid_returns_an_array_of_plans_in_the_plan_group.yml delete mode 100644 fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_APIResource/connection/works_in_a_threaded_environment.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_APIResource/connection/works_when_credentials_are_updated.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Account/returns_details_of_current_account.yml (100%) create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/creates_the_contact_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/destroys_the_contact_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/merges_contacts_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/retrieves_the_contact_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/updates_the_contact_correctly_with_the_class_method.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/with_new_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/with_old_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/adds_custom_attributes_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/adds_tags_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/creates_a_contact_belonging_to_the_customer_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/creates_the_customer_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/destroys_the_customer_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_contacts_belonging_to_the_customer_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_invoices_belonging_to_the_customer_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_subscriptions_belonging_to_the_customer_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/merges_customers_correctly_with_the_class_method.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/merges_customers_correctly_with_the_instance_method.yml rename fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_404_if_no_customers_found.yml => spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/raises_a_HTTP_404_if_searching_for_customers_does_not_find_any.yml (68%) create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/removes_custom_attributes_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/removes_tags_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/retrieves_the_customer_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/searches_for_customers_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_custom_attributes_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_customer_correctly_with_the_class_method.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_the_customer_correctly_with_the_instance_method.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_new_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_new_pagination/paginates_the_/search_endpoint_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_old_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_old_pagination/paginates_the_/search_endpoint_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/returns_matching_user_if_exists.yml rename fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/raises_error_on_deleting_non-existing_invoice.yml => spec/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/returns_nil_if_customer_does_not_exist.yml (50%) create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/creates_the_customer_invoice_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/destroys_all_customer_invoices_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/with_new_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/with_old_pagination/paginates_correctly.yml rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_DataSource/API_Interactions/retrieves_existing_data_source_matching_uuid.yml (100%) create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/destroys_the_invoice_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/destroys_the_invoice_correctly_with_instance_method.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/retrieves_the_invoice_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/with_new_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/with_old_pagination/paginates_correctly.yml rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/get_activities_export.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/post_activities_export.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_Activity.yml (100%) create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_PageableWithAnchor/should_be_pageable.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_paginate_using_cursor_when_called_with_next.yml rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_summary.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml (100%) create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/behaves_like_Pageable/should_be_pageable.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_have_Activity_entries.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_paginate_using_cursor_when_called_with_next.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/behaves_like_Pageable/should_be_pageable.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_have_Subscription_entries.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_paginate_using_cursor_when_called_with_next.yml rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Ping/pings/and_fails_on_incorrect_credentials.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_500_internal_server_error.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_504_gateway_timeout_error.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Ping/pings/when_credentials_correct.yml (100%) create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/creates_the_plan_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/destroys_the_plan_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/retrieves_the_plan_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/updates_the_plan_correctly_with_the_class_method.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/updates_the_plan_correctly_with_the_instance_method.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/with_new_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/with_old_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/correctly_handles_a_422_error.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/creates_a_plan_group_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/destroys_a_plan_group_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/retrieves_the_plan_group_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_a_plan_group_plans.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_the_plan_group_correctly_with_the_class_method.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_the_plan_group_correctly_with_the_instance_method.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/with_new_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/with_old_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_Actions/with_new_pagination/paginates_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_Actions/with_old_pagination/paginates_correctly.yml rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Subscription/API_Interactions/connects_subscriptions.yml (100%) create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Subscription/API_Interactions/has_multiple_aliases.yml (100%) create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/should_paginate_using_cursor_when_called_with_next.yml rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_has_time_objects/is_setting_the_cancellation_dates_of_the_subscription.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_invalid_entries/raises_an_exception.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_valid_entries/is_setting_the_cancellation_dates_of_the_subscription.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_is_empty/makes_an_API_call_and_removes_the_cancellation_dates.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event_through_initialization.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/deletes_the_subscription_event.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/lists_all_subscription_events.yml (64%) create mode 100644 spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/should_paginate_using_cursor_when_called_with_next.yml rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/updates_the_subscription_event.yml (100%) rename {fixtures => spec/fixtures}/vcr_cassettes/ChartMogul_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml (100%) diff --git a/.gitignore b/.gitignore index 5657b8e..f9a2922 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ /tmp/ *.swp vendor/bundle -/.idea \ No newline at end of file +/.idea +.DS_Store diff --git a/changelog.md b/changelog.md index 86de824..2d5dd2b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # chartmogul-ruby Change Log +## Version 3.3.1 - October 27 2023 +- Add support for cursor based pagination to `.all` endpoints. +- Add `.next` pagination method for all supported cursor based endpoints. +- Move `fixtures/` folder inside the `spec/` folder. +- Update `.merge!` methods to always return `true` when successful. +- Add new attributes to `ChartMogul::Customer` resource. +- Do not error when the server returns an empty body from `.custom!` methods. + ## Version 3.3.0 - August 14 2023 - Fix an issue with creating using `SubscriptionEvents.create!(attrs)`. diff --git a/chartmogul-ruby.gemspec b/chartmogul-ruby.gemspec index 4c174a2..f07dbad 100644 --- a/chartmogul-ruby.gemspec +++ b/chartmogul-ruby.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'faraday-retry', '~> 2.2' spec.add_development_dependency 'bundler', '~> 2' - spec.add_development_dependency 'pry', '~> 0.12.2' + spec.add_development_dependency 'pry', '~> 0.14.2' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec', '~> 3.0' spec.add_development_dependency 'rubocop', '0.79' diff --git a/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/creates_contact_correctly.yml b/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/creates_contact_correctly.yml deleted file mode 100644 index 2e3256a..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/creates_contact_correctly.yml +++ /dev/null @@ -1,134 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Customer Test Data Source"}' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 03:41:54 GMT - content-length: - - '163' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","name":"Customer - Test Data Source","system":"Import API","created_at":"2023-03-10T03:41:54.419Z","status":"idle"}' - http_version: - recorded_at: Fri, 10 Mar 2023 03:41:54 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/customers - body: - encoding: UTF-8 - string: '{"external_id":"X1234","name":"Test Customer","email":"test@example.com","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba"}' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 03:41:55 GMT - content-length: - - '785' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"id":102680322,"uuid":"cus_80ec0c06-bef5-11ed-a88c-974c518fc467","external_id":"X1234","name":"Test - Customer","email":"test@example.com","status":"New Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","data_source_uuids":["ds_80251880-bef5-11ed-a88b-db28feaa7eba"],"external_ids":["X1234"],"company":"","country":null,"state":null,"city":"","zip":null,"lead_created_at":null,"free_trial_started_at":null,"address":{"country":null,"state":null,"city":"","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#/customers/102680322-Test_Customer","billing-system-type":"Import - API","currency":"USD","currency-sign":"$","owner":null}' - http_version: - recorded_at: Fri, 10 Mar 2023 03:41:56 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/contacts - body: - encoding: UTF-8 - string: '{"email":"test@example.com"}' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - content-type: - - application/json - date: - - Fri, 10 Mar 2023 03:41:57 GMT - content-length: - - '393' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"con_2f7b28ba-bef6-11ed-941f-075fbe6af258","customer_uuid":"cus_00b714f0-9e33-11ed-a815-77795aac7785","customer_external_id":"scus_b9373adf50d6ab86e96653b4443efb78","data_source_uuid":"ds_87832fac-ab61-11ec-a8d8-6fb18044a151","position":23,"first_name":null,"last_name":null,"title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}' - http_version: - recorded_at: Fri, 10 Mar 2023 03:41:57 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts/con_2f7b28ba-bef6-11ed-941f-075fbe6af258 - body: - encoding: UTF-8 - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - content-type: - - application/json - date: - - Fri, 10 Mar 2023 03:41:57 GMT - content-length: - - '505' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"con_16470f98-bef7-11ed-9208-7b08a40f3049","customer_uuid":"cus_80ec0c06-bef5-11ed-a88c-974c518fc467","customer_external_id":"123","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","position":1,"first_name":null,"last_name":null,"title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}' - http_version: - recorded_at: Fri, 10 Mar 2023 03:41:57 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/destroys_contact_correctly.yml b/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/destroys_contact_correctly.yml deleted file mode 100644 index 119377f..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/destroys_contact_correctly.yml +++ /dev/null @@ -1,99 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts/con_e2894d28-9189-11ed-8100-ffadd676801d - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 09:30:33 GMT - content-length: - - '436' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"con_e2894d28-9189-11ed-8100-ffadd676801d","customer_uuid":"cus_19580b15-1ab7-40ec-bdb9-638b81354b9e","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":9,"first_name":"Foo","last_name":"Bar","title":"CTO","email":"test2@example.com","phone":"+9876543210","linked_in":"https://linkedin.com/about","twitter":"https://twitter.com/about","notes":null,"custom":{"Toggle":true}}' - http_version: - recorded_at: Fri, 10 Mar 2023 09:30:33 GMT -- request: - method: delete - uri: https://api.chartmogul.com/v1/contacts/con_e2894d28-9189-11ed-8100-ffadd676801d - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 09:30:34 GMT - content-length: - - '2' - connection: - - keep-alive - body: - encoding: UTF-8 - string: "{}" - http_version: - recorded_at: Fri, 10 Mar 2023 09:30:34 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts/con_e2894d28-9189-11ed-8100-ffadd676801d - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 404 - message: Not Found - headers: - content-type: - - application/json - date: - - Fri, 10 Mar 2023 09:30:35 GMT - content-length: - - '111' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"code":404,"message":"Contact \"7c4c3152-9192-11ed-b18e-efa6b954f7e6\" - does not exist","param":"contact_uuid"}' - http_version: - recorded_at: Fri, 10 Mar 2023 09:30:35 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/merges_contact_correctly.yml b/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/merges_contact_correctly.yml deleted file mode 100644 index 0c2a751..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/merges_contact_correctly.yml +++ /dev/null @@ -1,105 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts/con_f4ef7c64-bf27-11ed-92ad-a7d034bf3085 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 10:03:12 GMT - content-length: - - '390' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"con_f4ef7c64-bf27-11ed-92ad-a7d034bf3085","customer_uuid":"cus_80ec0c06-bef5-11ed-a88c-974c518fc467","customer_external_id":"X1234","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","position":1,"first_name":"Merged - 1 First","last_name":"Merged 1 Last","title":"","email":"","phone":"","linked_in":"https://linkedin.com/merged1","twitter":"","notes":"Hello","custom":{}}' - http_version: - recorded_at: Fri, 10 Mar 2023 10:03:12 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts/con_33dd5606-bf2a-11ed-a7d0-17036209bd22 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 10:03:14 GMT - content-length: - - '420' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"con_33dd5606-bf2a-11ed-a7d0-17036209bd22","customer_uuid":"cus_80ec0c06-bef5-11ed-a88c-974c518fc467","customer_external_id":"X1234","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","position":4,"first_name":"Merged - 2 First","last_name":"Merged 2 Last","title":"CTO","email":"test6@example.com","phone":"123435412","linked_in":null,"twitter":"https://twitter.com/merged2","notes":"World","custom":{}}' - http_version: - recorded_at: Fri, 10 Mar 2023 10:03:14 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/contacts/con_f4ef7c64-bf27-11ed-92ad-a7d034bf3085/merge/con_33dd5606-bf2a-11ed-a7d0-17036209bd22 - body: - encoding: UTF-8 - string: "{}" - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 10:03:15 GMT - content-length: - - '414' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"con_f4ef7c64-bf27-11ed-92ad-a7d034bf3085","customer_uuid":null,"customer_external_id":"X1234","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","position":1,"first_name":"Merged - 1 First","last_name":"Merged 1 Last","title":"CTO","email":"test6@example.com","phone":"123435412","linked_in":"https://linkedin.com/merged1","twitter":"https://twitter.com/merged2","notes":"Hello World","custom":{}}' - http_version: - recorded_at: Fri, 10 Mar 2023 10:03:15 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/paginates_correctly.yml b/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/paginates_correctly.yml deleted file mode 100644 index db2997d..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/paginates_correctly.yml +++ /dev/null @@ -1,133 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 08:51:16 GMT - vary: - - Accept-Encoding - transfer-encoding: - - chunked - connection: - - keep-alive - body: - encoding: ASCII-8BIT - string: '{ - "entries":[ - {"uuid":"con_1922c172-9174-11ed-b655-47c5fb422d6c","customer_uuid":"cus_19580b15-1ab7-40ec-bdb9-638b81354b9e","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":1,"first_name":"contact1","last_name":"contact","title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}, - {"uuid":"con_c12a64ea-9180-11ed-b6ec-9752d090f315","customer_uuid":"cus_19580b15-1ab7-40ec-bdb9-638b81354b9e","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":2,"first_name":"contact2","last_name":"contact","title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}, - {"uuid":"con_1fe21a32-9181-11ed-b536-7f856d6a5b2d","customer_uuid":"cus_19580b15-1ab7-40ec-bdb9-638b81354b9e","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":3,"first_name":"contact3","last_name":"contact","title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}, - {"uuid":"con_e2894d28-9189-11ed-8100-ffadd676801d","customer_uuid":"cus_19580b15-1ab7-40ec-bdb9-638b81354b9e","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":4,"first_name":"contact4","last_name":"contact","title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}, - {"uuid":"con_2019ea66-9190-11ed-bb5a-779d25c759d0","customer_uuid":"cus_189e19d1-9893-4afe-b035-42e23c4799a6","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":5,"first_name":"contact5","last_name":"contact","title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}} - ], - "cursor":"MjAyMy0wMS0xMVQwNzoyNToyOS4wMDI5MzIwMDBaJmNvbl8xZmUyMWEzMi05MTgxLTExZWQtYjUzNi03Zjg1NmQ2YTViMmQ=", - "has_more":false - }' - http_version: - recorded_at: Fri, 10 Mar 2023 08:51:16 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts?per_page=3 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 08:51:17 GMT - vary: - - Accept-Encoding - content-length: - - '570' - connection: - - keep-alive - body: - encoding: ASCII-8BIT - string: '{ - "entries":[ - {"uuid":"con_1922c172-9174-11ed-b655-47c5fb422d6c","customer_uuid":"cus_19580b15-1ab7-40ec-bdb9-638b81354b9e","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":1,"first_name":"contact1","last_name":"contact","title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}, - {"uuid":"con_c12a64ea-9180-11ed-b6ec-9752d090f315","customer_uuid":"cus_19580b15-1ab7-40ec-bdb9-638b81354b9e","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":2,"first_name":"contact2","last_name":"contact","title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}, - {"uuid":"con_1fe21a32-9181-11ed-b536-7f856d6a5b2d","customer_uuid":"cus_19580b15-1ab7-40ec-bdb9-638b81354b9e","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":3,"first_name":"contact3","last_name":"contact","title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}} - ], - "cursor":"MjAyMy0wMS0xMVQwNzoyNToyOS4wMDI5MzIwMDBaJmNvbl8xZmUyMWEzMi05MTgxLTExZWQtYjUzNi03Zjg1NmQ2YTViMmQ=", - "has_more":true - }' - http_version: - recorded_at: Fri, 10 Mar 2023 08:51:18 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts?cursor=MjAyMy0wMS0xMVQwNzoyNToyOS4wMDI5MzIwMDBaJmNvbl8xZmUyMWEzMi05MTgxLTExZWQtYjUzNi03Zjg1NmQ2YTViMmQ%3D&per_page=3 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 08:51:19 GMT - vary: - - Accept-Encoding - content-length: - - '532' - connection: - - keep-alive - body: - encoding: ASCII-8BIT - string: '{ - "entries":[ - {"uuid":"con_e2894d28-9189-11ed-8100-ffadd676801d","customer_uuid":"cus_19580b15-1ab7-40ec-bdb9-638b81354b9e","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":4,"first_name":"contact4","last_name":"contact","title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}, - {"uuid":"con_2019ea66-9190-11ed-bb5a-779d25c759d0","customer_uuid":"cus_189e19d1-9893-4afe-b035-42e23c4799a6","customer_external_id":"scus_021","data_source_uuid":"ds_2b98cb2c-5bf0-11ec-a5d0-07b36dac065d","position":5,"first_name":"contact5","last_name":"contact","title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}} - ], - "cursor":"MjAyMy0wMS0xMVQwOToyOTo0NS40ODYzNTkwMDBaJmNvbl83YzRjMzE1Mi05MTkyLTExZWQtYjE4ZS1lZmE2Yjk1NGY3ZTY=", - "has_more":false - }' - http_version: - recorded_at: Fri, 10 Mar 2023 08:51:19 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/updates_contact_correctly.yml b/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/updates_contact_correctly.yml deleted file mode 100644 index 8c57cd1..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Contact/API_Interactions/updates_contact_correctly.yml +++ /dev/null @@ -1,102 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts/con_8305e66c-bf2f-11ed-a4cb-db537410c51b - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 10:38:00 GMT - content-length: - - '346' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"con_8305e66c-bf2f-11ed-a4cb-db537410c51b","customer_uuid":"cus_80ec0c06-bef5-11ed-a88c-974c518fc467","customer_external_id":"X1234","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","position":6,"first_name":null,"last_name":null,"title":null,"email":null,"phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}' - http_version: - recorded_at: Fri, 10 Mar 2023 10:38:00 GMT -- request: - method: patch - uri: https://api.chartmogul.com/v1/contacts/con_8305e66c-bf2f-11ed-a4cb-db537410c51b - body: - encoding: UTF-8 - string: '{"customer_external_id":"X1234","position":9,"first_name":"Foo","last_name":"Bar","title":"CTO","email":"test2@example.com","phone":"+9876543210","linked_in":"https://linkedin.com/about","twitter":"https://twitter.com/about","custom":[{"key":"Toggle","value":false}]}' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 10:38:01 GMT - content-length: - - '434' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"con_8305e66c-bf2f-11ed-a4cb-db537410c51b","customer_uuid":"cus_80ec0c06-bef5-11ed-a88c-974c518fc467","customer_external_id":"X1234","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","position":9,"first_name":"Foo","last_name":"Bar","title":"CTO","email":"test2@example.com","phone":"+9876543210","linked_in":"https://linkedin.com/about","twitter":"https://twitter.com/about","notes":null,"custom":{"Toggle":false}}' - http_version: - recorded_at: Fri, 10 Mar 2023 10:38:01 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts/con_8305e66c-bf2f-11ed-a4cb-db537410c51b - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 10:38:03 GMT - content-length: - - '434' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"con_8305e66c-bf2f-11ed-a4cb-db537410c51b","customer_uuid":"cus_80ec0c06-bef5-11ed-a88c-974c518fc467","customer_external_id":"X1234","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","position":9,"first_name":"Foo","last_name":"Bar","title":"CTO","email":"test2@example.com","phone":"+9876543210","linked_in":"https://linkedin.com/about","twitter":"https://twitter.com/about","notes":null,"custom":{"Toggle":false}}' - http_version: - recorded_at: Fri, 10 Mar 2023 10:38:03 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_custom_attributes.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_custom_attributes.yml deleted file mode 100644 index 89c6b40..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_custom_attributes.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047 - body: - encoding: UTF-8 - string: '{}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:09 GMT - content-type: - - application/json - content-length: - - '567' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam - Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":["example","another-tag"]},"address":{"country":"United - States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:09 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047/attributes/custom - body: - encoding: UTF-8 - string: '{"custom":[{"type":"String","key":"StringKey","value":"String Value"},{"type":"Integer","key":"integer_key","value":1234},{"type":"Timestamp","key":"timestamp_key","value":"2016-01-31 - 00:00:00 UTC"},{"type":"Boolean","key":"boolean_key","value":true}]}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:09 GMT - content-type: - - application/json - content-length: - - '121' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"custom":{"StringKey":"String Value","integer_key":1234,"timestamp_key":"2016-01-31T00:00:00.000Z","boolean_key":true}}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:09 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_required_tags.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_required_tags.yml deleted file mode 100644 index 0964e31..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/adds_required_tags.yml +++ /dev/null @@ -1,79 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047 - body: - encoding: UTF-8 - string: '{}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:08 GMT - content-type: - - application/json - content-length: - - '544' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam - Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":[]},"address":{"country":"United - States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20268060-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:08 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047/attributes/tags - body: - encoding: UTF-8 - string: '{"tags":["example","another-tag"]}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:08 GMT - content-type: - - application/json - content-length: - - '34' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"tags":["example","another-tag"]}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:08 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/can_page_through_search_endpoint.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/can_page_through_search_endpoint.yml deleted file mode 100644 index 97e4118..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/can_page_through_search_endpoint.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/search?email=adam%40smith.com&page=2&per_page=1 - body: - encoding: UTF-8 - string: '{}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:11 GMT - content-type: - - application/json - content-length: - - '740' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"entries":[{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam - Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":["another-tag"],"custom":{"string_key":"Another - String Value","integer_key":"5678","timestamp_key":"2016-02-01 00:00:00 UTC","boolean_key":"f"}},"address":{"country":"United - States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}],"has_more":false,"per_page":1,"page":2}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:11 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_handles_a_422_response.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_handles_a_422_response.yml deleted file mode 100644 index 1681fda..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_handles_a_422_response.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/customers - body: - encoding: UTF-8 - string: '{"data_source_uuid":null,"external_id":null,"name":null,"email":null,"company":null,"country":null,"state":null,"city":null,"zip":null}' - headers: - User-Agent: - - Faraday v0.9.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 422 - message: - headers: - server: - - nginx/1.9.10 - date: - - Mon, 06 Jun 2016 15:26:39 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - cache-control: - - no-cache - x-request-id: - - db053e91-1f33-45fe-a8f2-d06c507e8066 - x-runtime: - - '0.033493' - body: - encoding: UTF-8 - string: '{"errors":{"external_id":"A unique external ID is required for each - customer.","name":"A name is required for each customer.","data_source_uuid":"A - valid data source UUID is required for each customer."}}' - http_version: - recorded_at: Mon, 06 Jun 2016 15:26:39 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_interracts_with_the_API.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_interracts_with_the_API.yml deleted file mode 100644 index 717994f..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/correctly_interracts_with_the_API.yml +++ /dev/null @@ -1,192 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Customer Test Data Source"}' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - server: - - nginx/1.10.1 - date: - - Tue, 16 Mar 2021 12:27:18 GMT - content-type: - - application/json - transfer-encoding: - - chunked - connection: - - keep-alive - status: - - 201 Created - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"uuid":"ds_f2f67ad0-8652-11eb-a9f8-37471a677085","name":"Customer - Test Data Source","system":"Import API","created_at":"2021-03-16T12:27:18.630Z","status":"idle"}' - http_version: - recorded_at: Tue, 16 Mar 2021 12:27:18 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/customers - body: - encoding: UTF-8 - string: '{"external_id":"X1234","name":"Test Customer","email":"test@example.com","country":"DE","city":"Berlin","data_source_uuid":"ds_f2f67ad0-8652-11eb-a9f8-37471a677085","lead_created_at":"2016-10-01 - 23:55:00 UTC","free_trial_started_at":"2016-10-12 11:12:00 UTC"}' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - server: - - nginx/1.10.1 - date: - - Tue, 16 Mar 2021 12:27:19 GMT - content-type: - - application/json - transfer-encoding: - - chunked - connection: - - keep-alive - status: - - 201 Created - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":93760512,"uuid":"cus_f340970a-8652-11eb-a9f8-cfc7971a103f","external_id":"X1234","name":"Test - Customer","email":"test@example.com","status":"Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_f2f67ad0-8652-11eb-a9f8-37471a677085","data_source_uuids":["ds_f2f67ad0-8652-11eb-a9f8-37471a677085"],"external_ids":["X1234"],"company":"","country":"DE","state":null,"city":"Berlin","zip":null,"lead_created_at":"2016-10-01T23:55:00.000Z","free_trial_started_at":"2016-10-12T11:12:00.000Z","address":{"country":"Germany","state":null,"city":"Berlin","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/93760512-Test_Customer","billing-system-type":"Import - API","currency":"USD","currency-sign":"$"}' - http_version: - recorded_at: Tue, 16 Mar 2021 12:27:19 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/customers - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - server: - - nginx/1.10.1 - date: - - Tue, 16 Mar 2021 12:27:19 GMT - content-type: - - application/json - transfer-encoding: - - chunked - connection: - - keep-alive - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: ASCII-8BIT - string: '{"entries":[{"id":93760512,"uuid":"cus_f340970a-8652-11eb-a9f8-cfc7971a103f","external_id":"X1234","name":"Test - Customer","email":"test@example.com","status":"Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_f2f67ad0-8652-11eb-a9f8-37471a677085","data_source_uuids":["ds_f2f67ad0-8652-11eb-a9f8-37471a677085"],"external_ids":["X1234"],"company":"","country":"DE","state":null,"city":"Berlin","zip":null,"lead_created_at":"2016-10-01T23:55:00.000Z","free_trial_started_at":"2016-10-12T11:12:00.000Z","address":{"country":"Germany","state":null,"city":"Berlin","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/93760512-Test_Customer","billing-system-type":"Import - API","currency":"USD","currency-sign":"$"}],"current_page":1,"total_pages":1,"has_more":false,"per_page":200,"page":1}' - http_version: - recorded_at: Tue, 16 Mar 2021 12:27:19 GMT -- request: - method: delete - uri: https://api.chartmogul.com/v1/customers/cus_f340970a-8652-11eb-a9f8-cfc7971a103f - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v1.0.1 - Authorization: - - Basic hidden - response: - status: - code: 204 - message: No Content - headers: - server: - - nginx/1.10.1 - date: - - Tue, 16 Mar 2021 12:28:19 GMT - connection: - - keep-alive - status: - - 204 No Content - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Tue, 16 Mar 2021 12:28:19 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/customers - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - server: - - nginx/1.10.1 - date: - - Tue, 16 Mar 2021 12:28:20 GMT - content-type: - - application/json - transfer-encoding: - - chunked - connection: - - keep-alive - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: ASCII-8BIT - string: '{"entries":[],"current_page":1,"total_pages":1,"has_more":false,"per_page":200,"page":1}' - http_version: - recorded_at: Tue, 16 Mar 2021 12:28:20 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/creates_a_contact_belonging_to_the_customer_correctly.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/creates_a_contact_belonging_to_the_customer_correctly.yml deleted file mode 100644 index 189f836..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/creates_a_contact_belonging_to_the_customer_correctly.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_54cde7bc-bf30-11ed-a51a-2325f065834f - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 11:02:57 GMT - content-length: - - '769' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"id":102689329,"uuid":"cus_54cde7bc-bf30-11ed-a51a-2325f065834f","external_id":"11234","name":"","email":"","status":"New - Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","data_source_uuids":["ds_80251880-bef5-11ed-a88b-db28feaa7eba"],"external_ids":["11234"],"company":"Test - customer","country":null,"state":null,"city":"","zip":null,"lead_created_at":null,"free_trial_started_at":null,"address":{"country":null,"state":null,"city":"","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#/customers/102689329-Test_customer","billing-system-type":"Import - API","currency":"USD","currency-sign":"$","owner":null}' - http_version: - recorded_at: Fri, 10 Mar 2023 11:02:57 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/contacts - body: - encoding: UTF-8 - string: '{"customer_uuid":"cus_54cde7bc-bf30-11ed-a51a-2325f065834f","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","email":"new_contact@example.com"}' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 11:02:58 GMT - content-length: - - '367' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"uuid":"con_1e366712-bf33-11ed-84e6-9bba0516ad5f","customer_uuid":"cus_54cde7bc-bf30-11ed-a51a-2325f065834f","customer_external_id":"11234","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","position":2,"first_name":null,"last_name":null,"title":null,"email":"new_contact@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}' - http_version: - recorded_at: Fri, 10 Mar 2023 11:02:59 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/lists_the_contacts_belonging_to_the_customer_correctly.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/lists_the_contacts_belonging_to_the_customer_correctly.yml deleted file mode 100644 index 36a08d9..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/lists_the_contacts_belonging_to_the_customer_correctly.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_54cde7bc-bf30-11ed-a51a-2325f065834f - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 10:43:38 GMT - content-length: - - '769' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"id":102689329,"uuid":"cus_54cde7bc-bf30-11ed-a51a-2325f065834f","external_id":"11234","name":"","email":"","status":"New - Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","data_source_uuids":["ds_80251880-bef5-11ed-a88b-db28feaa7eba"],"external_ids":["11234"],"company":"Test - customer","country":null,"state":null,"city":"","zip":null,"lead_created_at":null,"free_trial_started_at":null,"address":{"country":null,"state":null,"city":"","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#/customers/102689329-Test_customer","billing-system-type":"Import - API","currency":"USD","currency-sign":"$","owner":null}' - http_version: - recorded_at: Fri, 10 Mar 2023 10:43:38 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/contacts?customer_uuid=cus_54cde7bc-bf30-11ed-a51a-2325f065834f - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - chartmogul-ruby/3.0.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - access-control-allow-credentials: - - 'true' - content-type: - - application/json - date: - - Fri, 10 Mar 2023 10:43:40 GMT - content-length: - - '490' - connection: - - keep-alive - body: - encoding: UTF-8 - string: '{"entries":[{"uuid":"con_6342518e-bf30-11ed-8542-5fe570cf19d7","customer_uuid":"cus_54cde7bc-bf30-11ed-a51a-2325f065834f","customer_external_id":"11234","data_source_uuid":"ds_80251880-bef5-11ed-a88b-db28feaa7eba","position":1,"first_name":"Test","last_name":"Again","title":null,"email":null,"phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}],"cursor":"MjAyMy0wMy0xMFQxMDo0MzoyNi4yOTE4ODgwMDBaJmNvbl82MzQyNTE4ZS1iZjMwLTExZWQtODU0Mi01ZmU1NzBjZjE5ZDc=","has_more":false}' - http_version: - recorded_at: Fri, 10 Mar 2023 10:43:40 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/merges_customers.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/merges_customers.yml deleted file mode 100644 index 3679825..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/merges_customers.yml +++ /dev/null @@ -1,185 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_35da5436-a730-11e6-a5a0-d32f2a781b50 - body: - encoding: UTF-8 - string: "{}" - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 10 Nov 2016 10:32:07 GMT - content-type: - - application/json - content-length: - - '496' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":6474477,"uuid":"cus_35da5436-a730-11e6-a5a0-d32f2a781b50","external_id":"8b5b6aff-ca49-4079-9273-1268a64ac462","name":"from@merge.com","email":"from@merge.com","status":"Lead","customer-since":null,"attributes":{"tags":[]},"address":{"country":"Comoros","state":null,"city":null,"address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/6474477-from_merge_com","billing-system-type":"Manual","currency":"UGX","currency-sign":null}' - http_version: - recorded_at: Thu, 10 Nov 2016 10:32:07 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_fc5451ee-a72f-11e6-9019-3b1a0ecf3c73 - body: - encoding: UTF-8 - string: "{}" - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 10 Nov 2016 10:32:07 GMT - content-type: - - application/json - content-length: - - '495' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":6474475,"uuid":"cus_fc5451ee-a72f-11e6-9019-3b1a0ecf3c73","external_id":"7ea39c1b-2286-4cb7-b1c8-9a63e8358875","name":"into@merge.com","email":"into@merge.com","status":"Lead","customer-since":null,"attributes":{"tags":[]},"address":{"country":"Angola","state":null,"city":null,"address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/6474475-into_merge_com","billing-system-type":"Manual","currency":"UGX","currency-sign":null}' - http_version: - recorded_at: Thu, 10 Nov 2016 10:32:07 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/customers/merges - body: - encoding: UTF-8 - string: '{"from":{"customer_uuid":"cus_35da5436-a730-11e6-a5a0-d32f2a781b50"},"into":{"customer_uuid":"cus_fc5451ee-a72f-11e6-9019-3b1a0ecf3c73"}}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 202 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 10 Nov 2016 10:32:07 GMT - content-type: - - application/json - content-length: - - '2' - connection: - - close - status: - - 202 Accepted - body: - encoding: UTF-8 - string: "{}" - http_version: - recorded_at: Thu, 10 Nov 2016 10:32:07 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_35da5436-a730-11e6-a5a0-d32f2a781b50 - body: - encoding: UTF-8 - string: "{}" - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 404 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 10 Nov 2016 10:37:08 GMT - content-type: - - application/json - content-length: - - '111' - connection: - - close - status: - - 404 Not Found - body: - encoding: UTF-8 - string: '{"code":404,"message":"Customer \"35da5436-a730-11e6-a5a0-d32f2a781b50\" - does not exist","param":"customer_id"}' - http_version: - recorded_at: Thu, 10 Nov 2016 10:37:08 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_fc5451ee-a72f-11e6-9019-3b1a0ecf3c73 - body: - encoding: UTF-8 - string: "{}" - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 10 Nov 2016 10:45:35 GMT - content-type: - - application/json - content-length: - - '512' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":6474475,"uuid":"cus_fc5451ee-a72f-11e6-9019-3b1a0ecf3c73","external_id":"7ea39c1b-2286-4cb7-b1c8-9a63e8358875","name":"into@merge.com","email":"into@merge.com","status":"Lead","customer-since":null,"attributes":{"tags":["merged-customer"]},"address":{"country":"Angola","state":null,"city":null,"address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/6474475-into_merge_com","billing-system-type":"Manual","currency":"UGX","currency-sign":null}' - http_version: - recorded_at: Thu, 10 Nov 2016 10:45:35 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_401_if_invalid_credentials.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_401_if_invalid_credentials.yml deleted file mode 100644 index 8518f68..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_401_if_invalid_credentials.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers?per_page=10 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.10.0 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 401 - message: - headers: - server: - - nginx/1.10.1 - date: - - Wed, 28 Dec 2016 17:04:19 GMT - content-type: - - application/json - content-length: - - '63' - connection: - - close - status: - - 401 Unauthorized - body: - encoding: UTF-8 - string: '{"code":401,"message":"No valid API key provided","param":null}' - http_version: - recorded_at: Wed, 28 Dec 2016 17:04:19 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_422_for_update_with_invalid_data.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_422_for_update_with_invalid_data.yml deleted file mode 100644 index 98e0256..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_422_for_update_with_invalid_data.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e - body: - encoding: UTF-8 - string: "{}" - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 10 Nov 2016 14:35:00 GMT - content-type: - - application/json - content-length: - - '1104' - connection: - - close - vary: - - Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":6474391,"uuid":"cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e","external_id":"14c58821-ad87-467d-956f-95f35f2cdd3d","name":"Currywurst","email":"curry@wurst.com","status":"Lead","customer-since":null,"attributes":{"tags":["wurst"],"clearbit":{"company":{"category":{"industry":"Commercial - Services \u0026 Supplies","industryGroup":"Commercial \u0026 Professional - Services","sector":"Industrials","subIndustry":"Corporate \u0026 Business"},"geo":{"city":"Lakewood","country":"United - States","postalCode":"80228","state":"Colorado","streetName":"South Union - Boulevard","streetNumber":"165","subPremise":"260"},"metrics":{"alexaGlobalRank":3418524,"alexaUsRank":793393},"name":"CCG","timeZone":"America/Denver","twitter":{"followers":1449,"handle":"CustomerProfit"},"type":"private","utcOffset":-7}},"custom":{"meinung":["lecker"]}},"address":{"country":"Germany","state":"New - York","city":"Berlin","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/6474391-Currywurst","billing-system-type":"Manual","currency":"UGX","currency-sign":null}' - http_version: - recorded_at: Thu, 10 Nov 2016 14:35:00 GMT -- request: - method: patch - uri: https://api.chartmogul.com/v1/customers/cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e - body: - encoding: UTF-8 - string: '{"name":"Currywurst","email":"schnitzel.com","attributes":{"tags":["wurst"],"clearbit":{"company":{"category":{"industry":"Commercial - Services & Supplies","industry_group":"Commercial & Professional Services","sector":"Industrials","sub_industry":"Corporate - & Business"},"geo":{"city":"Lakewood","country":"United States","postal_code":"80228","state":"Colorado","street_name":"South - Union Boulevard","street_number":"165","sub_premise":"260"},"metrics":{"alexa_global_rank":3418524,"alexa_us_rank":793393},"name":"CCG","time_zone":"America/Denver","twitter":{"followers":1449,"handle":"CustomerProfit"},"type":"private","utc_offset":-7}},"custom":{"meinung":["lecker"]}}}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 422 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 10 Nov 2016 14:35:00 GMT - content-type: - - application/json - content-length: - - '104' - connection: - - close - status: - - 422 Unprocessable Entity - body: - encoding: UTF-8 - string: '{"code":422,"message":"The value provided does not appear to be a valid - email address.","param":"email"}' - http_version: - recorded_at: Thu, 10 Nov 2016 14:35:00 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_custom_attributes.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_custom_attributes.yml deleted file mode 100644 index 6838cb6..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_custom_attributes.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047 - body: - encoding: UTF-8 - string: '{}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 13:57:20 GMT - content-type: - - application/json - content-length: - - '685' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam - Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":["another-tag"],"custom":{"string_key":"Another - String Value","integer_key":"5678","timestamp_key":"2016-02-01 00:00:00 UTC","boolean_key":"f"}},"address":{"country":"United - States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20268060-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}' - http_version: - recorded_at: Wed, 29 Jun 2016 13:57:20 GMT -- request: - method: delete - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047/attributes/custom - body: - encoding: UTF-8 - string: '{"custom":["string_key","integer_key","timestamp_key","boolean_key"]}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 13:57:20 GMT - content-type: - - application/json - content-length: - - '2' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{}' - http_version: - recorded_at: Wed, 29 Jun 2016 13:57:20 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_tags.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_tags.yml deleted file mode 100644 index d08d5b1..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/removes_tags.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047 - body: - encoding: UTF-8 - string: '{}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:10 GMT - content-type: - - application/json - content-length: - - '695' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam - Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":["example","another-tag"],"custom":{"string_key":"Another - String Value","integer_key":"5678","timestamp_key":"2016-02-01 00:00:00 UTC","boolean_key":"f"}},"address":{"country":"United - States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20268060-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:10 GMT -- request: - method: delete - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047/attributes/tags - body: - encoding: UTF-8 - string: '{"tags":["example"]}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:11 GMT - content-type: - - application/json - content-length: - - '24' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"tags":["another-tag"]}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:11 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/respects_camel_case_for_all_customers_endpoint.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/respects_camel_case_for_all_customers_endpoint.yml deleted file mode 100644 index 24921a4..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/respects_camel_case_for_all_customers_endpoint.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers?per_page=10 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:45:27 GMT - content-type: - - application/json - content-length: - - '1297' - connection: - - close - vary: - - Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"entries":[{"id":20286023,"uuid":"cus_db011fbe-b8d5-46d4-9949-dff12fe0744b","external_id":"cus_0001","name":"Zuora - Customer","email":"zuora@customer.com","status":"Active","customer-since":"2015-08-01T00:00:00+00:00","attributes":{"tags":["another-tag"],"custom":{"String_key":"String - Value","integer_key":1234,"timestamp_key":"2016-01-31T00:00:00.000Z","boolean_key":true}},"address":{"country":"United - States","state":null,"city":"San Francisco","address_line1":null,"address_line2":null,"address_zip":""},"mrr":7500,"arr":90000,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20286023-Zuora_Customer","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}],"has_more":false,"per_page":10,"page":1}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:45:27 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_all_customers_through_list_all_endpoint.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_all_customers_through_list_all_endpoint.yml deleted file mode 100644 index 5f44c90..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_all_customers_through_list_all_endpoint.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers?per_page=10 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:45:27 GMT - content-type: - - application/json - content-length: - - '1297' - connection: - - close - vary: - - Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"entries":[{"id":20286023,"uuid":"cus_db011fbe-b8d5-46d4-9949-dff12fe0744b","external_id":"cus_0001","name":"Zuora - Customer","email":"zuora@customer.com","status":"Active","customer-since":"2015-08-01T00:00:00+00:00","attributes":{"tags":["another-tag"],"custom":{"string_key":"String - Value","integer_key":1234,"timestamp_key":"2016-01-31T00:00:00.000Z","boolean_key":true}},"address":{"country":"United - States","state":null,"city":"San Francisco","address_line1":null,"address_line2":null,"address_zip":""},"mrr":7500,"arr":90000,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20286023-Zuora_Customer","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"},{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam - Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":[]},"address":{"country":"United - States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20268060-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}],"has_more":false,"per_page":10,"page":1}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:45:27 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_customer_through_retrieve_endpoint.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_customer_through_retrieve_endpoint.yml deleted file mode 100644 index c55cd02..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_customer_through_retrieve_endpoint.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047 - body: - encoding: UTF-8 - string: '{}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:08 GMT - content-type: - - application/json - content-length: - - '544' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam - Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":[]},"address":{"country":"United - States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20268060-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:08 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml deleted file mode 100644 index 88b642a..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/returns_right_customers_through_search_endpoint.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/search?email=adam%40smith.com - body: - encoding: UTF-8 - string: '{}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:11 GMT - content-type: - - application/json - content-length: - - '740' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"entries":[{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam - Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":["another-tag"],"custom":{"string_key":"Another - String Value","integer_key":"5678","timestamp_key":"2016-02-01 00:00:00 UTC","boolean_key":"f"}},"address":{"country":"United - States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}],"has_more":false,"per_page":200,"page":1}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:11 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_custom_attributes.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_custom_attributes.yml deleted file mode 100644 index 2f6d30c..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_custom_attributes.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047 - body: - encoding: UTF-8 - string: '{}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:09 GMT - content-type: - - application/json - content-length: - - '687' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":20268060,"uuid":"cus_07393ece-aab1-4255-8bcd-0ef11e24b047","external_id":"cus_0001","name":"Adam - Smith","email":"adam@smith.com","status":"Cancelled","customer-since":"2016-05-01T12:00:00+00:00","attributes":{"tags":["example","another-tag"],"custom":{"string_key":"String - Value","integer_key":1234,"timestamp_key":"2016-01-31T00:00:00.000Z","boolean_key":true}},"address":{"country":"United - States","state":null,"city":"New York","address_line1":null,"address_line2":null,"address_zip":""},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/20268060-Adam_Smith","billing-system-type":"ImportApi","currency":"USD","currency-sign":"$"}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:09 GMT -- request: - method: put - uri: https://api.chartmogul.com/v1/customers/cus_07393ece-aab1-4255-8bcd-0ef11e24b047/attributes/custom - body: - encoding: UTF-8 - string: '{"custom":{"StringKey":"Another String Value","integer_key":5678,"timestamp_key":"2016-02-01 - 00:00:00 UTC","boolean_key":false}}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:09 GMT - content-type: - - application/json - content-length: - - '129' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"custom":{"StringKey":"Another String Value","integer_key":5678,"timestamp_key":"2016-02-01T00:00:00.000Z","boolean_key":false}}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:09 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer.yml deleted file mode 100644 index 308699a..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer.yml +++ /dev/null @@ -1,139 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e - body: - encoding: UTF-8 - string: "{}" - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 10 Nov 2016 12:35:59 GMT - content-type: - - application/json - content-length: - - '1069' - connection: - - close - vary: - - Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":6474391,"uuid":"cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e","external_id":"14c58821-ad87-467d-956f-95f35f2cdd3d","name":"Update - Customer","email":"update@customer.com","status":"Lead","customer-since":null,"attributes":{"tags":[],"clearbit":{"company":{"category":{"industry":"Commercial - Services \u0026 Supplies","industryGroup":"Commercial \u0026 Professional - Services","sector":"Industrials","subIndustry":"Corporate \u0026 Business"},"geo":{"city":"Lakewood","country":"United - States","postalCode":"80228","state":"Colorado","streetName":"South Union - Boulevard","streetNumber":"165","subPremise":"260"},"metrics":{"alexaGlobalRank":3418524,"alexaUsRank":793393},"name":"CCG","timeZone":"America/Denver","twitter":{"followers":1449,"handle":"CustomerProfit"},"type":"private","utcOffset":-7}}},"address":{"country":"Armenia","state":null,"city":null,"address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/6474391-Update_Customer","billing-system-type":"Manual","currency":"UGX","currency-sign":null}' - http_version: - recorded_at: Thu, 10 Nov 2016 12:36:00 GMT -- request: - method: patch - uri: https://api.chartmogul.com/v1/customers/cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e - body: - encoding: UTF-8 - string: '{"name":"Currywurst","email":"curry@wurst.com","company":"Curry 36","country":"DE","state":"NY","city":"Berlin","lead_created_at":"2016-01-01 - 14:30:00 UTC","free_trial_started_at":"2016-02-02 22:40:00 UTC","attributes":{"tags":["wurst"],"clearbit":{"company":{"category":{"industry":"Commercial - Services & Supplies","industry_group":"Commercial & Professional Services","sector":"Industrials","sub_industry":"Corporate - & Business"},"geo":{"city":"Lakewood","country":"United States","postal_code":"80228","state":"Colorado","street_name":"South - Union Boulevard","street_number":"165","sub_premise":"260"},"metrics":{"alexa_global_rank":3418524,"alexa_us_rank":793393},"name":"CCG","time_zone":"America/Denver","twitter":{"followers":1449,"handle":"CustomerProfit"},"type":"private","utc_offset":-7}},"custom":{"meinung":["lecker"]}}}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 10 Nov 2016 12:36:00 GMT - content-type: - - application/json - content-length: - - '1354' - connection: - - close - vary: - - Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":6474391,"uuid":"cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e","external_id":"14c58821-ad87-467d-956f-95f35f2cdd3d","name":"Currywurst","email":"curry@wurst.com","status":"Lead","customer-since":null,"attributes":{"custom":{"meinung":["lecker"]},"clearbit":{"company":{"category":{"industry":"Commercial - Services & Supplies","industryGroup":"Commercial & Professional Services","sector":"Industrials","subIndustry":"Corporate - & Business"},"geo":{"city":"Lakewood","country":"United States","postalCode":"80228","state":"Colorado","streetName":"South - Union Boulevard","streetNumber":"165","subPremise":"260"},"metrics":{"alexaGlobalRank":3418524,"alexaUsRank":793393},"name":"CCG","timeZone":"America/Denver","twitter":{"followers":1449,"handle":"CustomerProfit"},"type":"private","utcOffset":-7}},"stripe":{},"tags":["wurst"]},"company":"Curry - 36","country":"DE","state":"NY","city":"Berlin","zip":null,"lead_created_at":"2016-01-01T14:30:00.000Z","free_trial_started_at":"2016-02-02T22:40:00.000Z","address":{"country":"DE","state":"New - York","city":"Berlin","address_zip":null},"mrr":0,"arr":0,"chartmogul-url":"https://app.chartmogul.com/#customers/6474391-Currywurst","data_source_uuid":"ds_5ef7f768-62ea-11e6-8299-5bf2ca7f76bb","data_source_uuids":["ds_5ef7f768-62ea-11e6-8299-5bf2ca7f76bb"],"external_ids":["14c58821-ad87-467d-956f-95f35f2cdd3d"]}' - http_version: - recorded_at: Thu, 10 Nov 2016 12:36:00 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e - body: - encoding: UTF-8 - string: "{}" - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 10 Nov 2016 12:36:00 GMT - content-type: - - application/json - content-length: - - '1104' - connection: - - close - vary: - - Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":6474391,"uuid":"cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e","external_id":"14c58821-ad87-467d-956f-95f35f2cdd3d","name":"Currywurst","email":"curry@wurst.com","status":"Lead","customer-since":null,"attributes":{"tags":["wurst"],"clearbit":{"company":{"category":{"industry":"Commercial - Services \u0026 Supplies","industryGroup":"Commercial \u0026 Professional - Services","sector":"Industrials","subIndustry":"Corporate \u0026 Business"},"geo":{"city":"Lakewood","country":"United - States","postalCode":"80228","state":"Colorado","streetName":"South Union - Boulevard","streetNumber":"165","subPremise":"260"},"metrics":{"alexaGlobalRank":3418524,"alexaUsRank":793393},"name":"CCG","timeZone":"America/Denver","twitter":{"followers":1449,"handle":"CustomerProfit"},"type":"private","utcOffset":-7}},"custom":{"meinung":["lecker"]}},"address":{"country":"Germany","state":"New - York","city":"Berlin","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/6474391-Currywurst","billing-system-type":"Manual","currency":"UGX","currency-sign":null}' - http_version: - recorded_at: Thu, 10 Nov 2016 12:36:00 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer_using_class_method.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer_using_class_method.yml deleted file mode 100644 index f9e13da..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/updates_customer_using_class_method.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -http_interactions: -- request: - method: patch - uri: https://api.chartmogul.com/v1/customers/cus_a29bbcb6-43ed-11e9-9bff-a3a747d175b1 - body: - encoding: UTF-8 - string: '{"attributes":{"custom":{"company_size":"just me"},"tags":["foobar"]},"email":"curry@example.com","company":"Curry - 42","country":"IN","state":"NY","city":"Berlin","free_trial_started_at":"2020-02-02 - 22:40:00 UTC"}' - headers: - User-Agent: - - Faraday v0.17.3 - Content-Type: - - application/json - Authorization: - - Basic hidden - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx/1.10.1 - Date: - - Fri, 17 Jul 2020 12:10:11 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Accept-Encoding - - Accept-Encoding - Status: - - 200 OK - Access-Control-Allow-Credentials: - - 'true' - body: - encoding: ASCII-8BIT - string: '{"id":33802170,"uuid":"cus_a29bbcb6-43ed-11e9-9bff-a3a747d175b1","external_id":"HngTohkREePdXBIx","name":"Currywurst","email":"curry@example.com","status":"Past - due","customer-since":"2018-12-29T00:00:00+00:00","attributes":{"custom":{"company_size":"just - me","Users":"1"},"clearbit":{},"stripe":{},"tags":["foobar"]},"data_source_uuid":"ds_b835f746-43eb-11e9-8169-9333ac374c59","data_source_uuids":["ds_b835f746-43eb-11e9-8169-9333ac374c59"],"external_ids":["HngTohkREePdXBIx"],"company":"Curry - 42","country":"IN","state":"NY","city":"Berlin","zip":null,"lead_created_at":"2018-12-15T00:00:00.000Z","free_trial_started_at":"2020-02-02T22:40:00.000Z","address":{"country":"India","state":"New - York","city":"Berlin","address_zip":null},"mrr":4900,"arr":58800,"billing-system-url":"HngTohkREePdXBIx","chartmogul-url":"https://app.chartmogul.com/#customers/33802170-Currywurst","billing-system-type":"Chargebee","currency":"USD","currency-sign":"$"}' - http_version: null - recorded_at: Fri, 17 Jul 2020 12:10:11 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml deleted file mode 100644 index 2d73d33..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_matching_user_if_exists.yml +++ /dev/null @@ -1,102 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/customers - body: - encoding: UTF-8 - string: '{"data_source_uuid":"ds_154b9620-a22a-478a-8b44-198d11cc9a85","external_id":"X1234","name":"Test - Customer","email":"test@example.com","company":null,"country":"DE","state":null,"city":"Berlin","zip":null}' - headers: - User-Agent: - - Faraday v0.9.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Mon, 06 Jun 2016 15:26:39 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"2bb61213c73b74bf7e3094b3a2814b1c" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 7a43eb0b-0099-4cef-b620-a6ac687ace2f - x-runtime: - - '0.202425' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"cus_c4babf63-3eb9-4125-8687-2a0d781b0af2","external_id":"X1234","name":"Test - Customer","company":"","email":"test@example.com","city":"Berlin","state":"","country":"DE","zip":"","data_source_uuid":"ds_154b9620-a22a-478a-8b44-198d11cc9a85"}' - http_version: - recorded_at: Mon, 06 Jun 2016 15:26:39 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/customers?external_id=X1234 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.1 - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Mon, 06 Jun 2016 15:26:40 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"f8b194be146b71827424808d2de63994" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - aa0a64af-9cd4-4b7d-9d43-d3b7c08ac7d1 - x-runtime: - - '0.020597' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"entries":[{"uuid":"cus_c4babf63-3eb9-4125-8687-2a0d781b0af2","external_id":"X1234","name":"Test - Customer","company":"","email":"test@example.com","city":"Berlin","state":"","country":"DE","zip":"","data_source_uuid":"ds_154b9620-a22a-478a-8b44-198d11cc9a85"}],"current_page":1,"total_pages":1}' - http_version: - recorded_at: Mon, 06 Jun 2016 15:26:40 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml b/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml deleted file mode 100644 index 7e16546..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/when_external_id_is_provided/returns_nil_if_customer_does_not_exist.yml +++ /dev/null @@ -1,101 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/customers - body: - encoding: UTF-8 - string: '{"data_source_uuid":"ds_154b9620-a22a-478a-8b44-198d11cc9a85","external_id":"X1234","name":"Test - Customer","email":"test@example.com","company":null,"country":"DE","state":null,"city":"Berlin","zip":null}' - headers: - User-Agent: - - Faraday v0.9.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Mon, 06 Jun 2016 15:26:39 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"2bb61213c73b74bf7e3094b3a2814b1c" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 7a43eb0b-0099-4cef-b620-a6ac687ace2f - x-runtime: - - '0.202425' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"cus_c4babf63-3eb9-4125-8687-2a0d781b0af2","external_id":"X1234","name":"Test - Customer","company":"","email":"test@example.com","city":"Berlin","state":"","country":"DE","zip":"","data_source_uuid":"ds_154b9620-a22a-478a-8b44-198d11cc9a85"}' - http_version: - recorded_at: Mon, 06 Jun 2016 15:26:39 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/customers?external_id=nope - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.1 - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Mon, 06 Jun 2016 15:26:40 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"f8b194be146b71827424808d2de63994" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - aa0a64af-9cd4-4b7d-9d43-d3b7c08ac7d1 - x-runtime: - - '0.020597' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"entries":[]}' - http_version: - recorded_at: Mon, 06 Jun 2016 15:26:40 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml b/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml deleted file mode 100644 index 603d96f..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Interactions/correctly_interracts_with_the_API.yml +++ /dev/null @@ -1,337 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Customer Invoices Test Data Source"}' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - server: - - nginx/1.10.1 - date: - - Fri, 14 Aug 2020 08:21:40 GMT - content-type: - - application/json - transfer-encoding: - - chunked - connection: - - keep-alive - status: - - 201 Created - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"uuid":"ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05","name":"Customer - Invoices Test Data Source","system":"Import API","created_at":"2020-08-14T08:21:40.103Z","status":"idle"}' - http_version: - recorded_at: Fri, 14 Aug 2020 08:21:40 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/customers - body: - encoding: UTF-8 - string: '{"external_id":"test_cus_ext_id","name":"Test Customer","email":"test@customer.com","country":"DE","city":"Berlin","data_source_uuid":"ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05"}' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - server: - - nginx/1.10.1 - date: - - Fri, 14 Aug 2020 08:21:40 GMT - content-type: - - application/json - transfer-encoding: - - chunked - connection: - - keep-alive - status: - - 201 Created - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"id":58654367,"uuid":"cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf","external_id":"test_cus_ext_id","name":"Test - Customer","email":"test@customer.com","status":"Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05","data_source_uuids":["ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05"],"external_ids":["test_cus_ext_id"],"company":"","country":"DE","state":null,"city":"Berlin","zip":null,"lead_created_at":null,"free_trial_started_at":null,"address":{"country":"Germany","state":null,"city":"Berlin","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#customers/58654367-Test_Customer","billing-system-type":"Import - API","currency":"USD","currency-sign":"$"}' - http_version: - recorded_at: Fri, 14 Aug 2020 08:21:40 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"Test Plan","interval_count":7,"interval_unit":"day","external_id":"test_cus_pl_ext_id","data_source_uuid":"ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05"}' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - server: - - nginx/1.10.1 - date: - - Fri, 14 Aug 2020 08:21:41 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - keep-alive - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - x-download-options: - - noopen - x-permitted-cross-domain-policies: - - none - referrer-policy: - - strict-origin-when-cross-origin - etag: - - W/"1d19bf324f0b6bf397ba8851cb55543c" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - cbb7d1e3-f3a4-4ba2-b85c-7d3eed91922d - x-runtime: - - '0.350185' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"test_cus_pl_ext_id","name":"Test Plan","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05","uuid":"pl_2e010ebf-de07-11ea-a4dd-8bf0a8234993"}' - http_version: - recorded_at: Fri, 14 Aug 2020 08:21:41 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/import/customers/cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf/invoices - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - server: - - nginx/1.10.1 - date: - - Fri, 14 Aug 2020 08:21:41 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - keep-alive - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - x-download-options: - - noopen - x-permitted-cross-domain-policies: - - none - referrer-policy: - - strict-origin-when-cross-origin - etag: - - W/"aeef59b540af9e5982db384f237518a2" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 47e6129d-8195-4273-9c31-170905e27755 - x-runtime: - - '0.179805' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"customer_uuid":"cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf","invoices":[],"current_page":1,"total_pages":0}' - http_version: - recorded_at: Fri, 14 Aug 2020 08:21:42 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/import/customers/cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf/invoices - body: - encoding: UTF-8 - string: '{"invoices":[{"date":"2016-01-01 12:00:00 UTC","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"test_cus_sub_ext_id","service_period_start":"2016-01-01 - 12:00:00 UTC","service_period_end":"2016-02-01 12:00:00 UTC","amount_in_cents":1000,"cancelled_at":"2016-01-15 - 12:00:00 UTC","prorated":false,"quantity":5,"discount_amount_in_cents":1200,"discount_code":"DISCCODE","tax_amount_in_cents":200,"external_id":"test_cus_li_ext_id","plan_uuid":"pl_2e010ebf-de07-11ea-a4dd-8bf0a8234993"}],"transactions":[{"type":"payment","date":"2016-01-01 - 12:00:00 UTC","result":"successful","external_id":"test_cus_tr_ext_id"}],"external_id":"test_cus_inv_ext_id","customer_external_id":"test_cus_ext_id","due_date":"2016-01-07 - 12:00:00 UTC"}],"customer_uuid":"cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf"}' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: Created - headers: - server: - - nginx/1.10.1 - date: - - Fri, 14 Aug 2020 08:21:43 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - keep-alive - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - x-download-options: - - noopen - x-permitted-cross-domain-policies: - - none - referrer-policy: - - strict-origin-when-cross-origin - etag: - - W/"2f2be4d16bccef7180e8df0515ebfd2f" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - ccdcc2fb-0a04-4307-94c8-f8482ec6bd09 - x-runtime: - - '1.437992' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"invoices":[{"uuid":"inv_deb98a20-3e71-49df-a49a-ac9d29c004be","date":"2016-01-01T12:00:00.000Z","due_date":"2016-01-07T12:00:00.000Z","external_id":"test_cus_inv_ext_id","currency":"USD","line_items":[{"uuid":"li_ffa7fad8-c393-45d2-aec4-2a869ece67c5","external_id":"test_cus_li_ext_id","type":"subscription","subscription_uuid":"sub_f3fa6a4e-8fc8-4843-95f2-062bc17826c6","subscription_external_id":"test_cus_sub_ext_id","prorated":false,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","plan_uuid":"pl_2e010ebf-de07-11ea-a4dd-8bf0a8234993","amount_in_cents":1000,"quantity":5,"discount_code":"DISCCODE","discount_amount_in_cents":1200,"tax_amount_in_cents":200,"transaction_fees_in_cents":0,"account_code":""}],"transactions":[{"uuid":"tr_ff121f19-ef39-4bc8-824e-225d1b33e5da","external_id":"test_cus_tr_ext_id","type":"payment","date":"2016-01-01T12:00:00.000Z","result":"successful"}]}]}' - http_version: - recorded_at: Fri, 14 Aug 2020 08:21:43 GMT -- request: - method: delete - uri: https://api.chartmogul.com/v1/data_sources/ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05/customers/cus_2e010ebe-de07-11ea-a4dd-ff06789b4dcf/invoices - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v1.0.1 - Authorization: - - Basic hidden - response: - status: - code: 204 - message: No Content - headers: - server: - - nginx/1.10.1 - date: - - Fri, 14 Aug 2020 08:21:44 GMT - connection: - - keep-alive - status: - - 204 No Content - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - x-download-options: - - noopen - x-permitted-cross-domain-policies: - - none - referrer-policy: - - strict-origin-when-cross-origin - cache-control: - - no-cache - x-request-id: - - c03bcf86-5a42-4655-b015-76ffc653ec91 - x-runtime: - - '0.353793' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Fri, 14 Aug 2020 08:21:44 GMT -- request: - method: delete - uri: https://api.chartmogul.com/v1/data_sources/ds_2db7bab6-de07-11ea-a4dd-7f82d51c3d05 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v1.0.1 - Authorization: - - Basic hidden - response: - status: - code: 204 - message: No Content - headers: - server: - - nginx/1.10.1 - date: - - Fri, 14 Aug 2020 08:21:44 GMT - connection: - - keep-alive - status: - - 204 No Content - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Fri, 14 Aug 2020 08:21:44 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice.yml b/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice.yml deleted file mode 100644 index b518402..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.chartmogul.com/v1/invoices/inv_123 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 204 - message: No content - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:45:27 GMT - content-length: - - '0' - connection: - - close - vary: - - Accept-Encoding - status: - - 204 No content - access-control-allow-credentials: - - 'true' - http_version: - recorded_at: Wed, 29 Jun 2016 12:45:27 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice_with_class_method.yml b/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice_with_class_method.yml deleted file mode 100644 index f142d81..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/deletes_an_invoice_with_class_method.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.chartmogul.com/v1/invoices/inv_12345 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 204 - message: No content - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:45:27 GMT - content-length: - - '0' - connection: - - close - vary: - - Accept-Encoding - status: - - 204 No content - access-control-allow-credentials: - - 'true' - http_version: - recorded_at: Wed, 29 Jun 2016 12:45:27 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/retrieves_existing_invoice_by_uuid.yml b/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/retrieves_existing_invoice_by_uuid.yml deleted file mode 100644 index ad4ca95..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/retrieves_existing_invoice_by_uuid.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/invoices/inv_1234-5678-9012-34567 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.1 - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"2122e94312ef92cc077db62910743655" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 1286c5a2-596a-4bc2-9e24-cfccc393e589 - x-runtime: - - '0.018019' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"date":"2016-01-01 12:00:00","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"sub_ext_id","plan_uuid":"pl_1234-5678-9012-34567","service_period_start":"2016-01-01 12:00:00","service_period_end":"2016-02-01 12:00:00","amount_in_cents":1000,"cancelled_at":"2016-01-15 12:00:00","prorated":false,"quantity":5,"discount_amount_in_cents":1200,"discount_code":"DISCCODE","tax_amount_in_cents":200,"external_id":"one_time_ext_id","uuid":"li_1234-5678-9012-34567","subscription_uuid":"sub_1234-5678-9012-34567"},{"type":"one_time","amount_in_cents":1000,"description":"Dummy Description","quantity":5,"discount_amount_in_cents":1200,"discount_code":"DISCCODE","tax_amount_in_cents":200,"external_id":"one_time_ext_id","uuid":"li_1234-5678-9012-34567"}],"transactions":[{"type":"payment","date":"2016-01-01 12:00:00","result":"successful","external_id":"pay_ext_id","uuid":"tr_1234-5678-9012-34567"},{"type":"refund","date":"2016-01-01 12:00:00","result":"successful","external_id":"ref_ext_id","uuid":"tr_1234-5678-9012-34567"}],"external_id":"inv_ext_id","due_date":"2016-02-01 12:00:00","uuid":"inv_1234-5678-9012-34567"}' - http_version: - recorded_at: Sun, 05 Jun 2016 19:47:08 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/returns_all_invoices_through_list_all_endpoint.yml b/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/returns_all_invoices_through_list_all_endpoint.yml deleted file mode 100644 index 8f8616a..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/returns_all_invoices_through_list_all_endpoint.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/invoices?external_id=invoice_eid&per_page=10 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:45:27 GMT - content-type: - - application/json - content-length: - - '1297' - connection: - - close - vary: - - Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"invoices":[{"date":"2016-01-01 12:00:00 +0000","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"test_cus_sub_ext_id", "subscription_set_external_id":"test_cus_set_ext_id","plan_uuid":"pl_209e4674-1258-4a35-8378-9b15c4086965","service_period_start":"2016-01-01 - 12:00:00 +0000","service_period_end":"2016-02-01 12:00:00 +0000","amount_in_cents":1000,"cancelled_at":"2016-01-15 - 12:00:00 +0000","prorated":false,"quantity":5,"discount_amount_in_cents":1200,"discount_code":"DISCCODE","tax_amount_in_cents":200,"external_id":"test_cus_li_ext_id"}],"transactions":[{"type":"payment","date":"2016-01-01 - 12:00:00 +0000","result":"successful","external_id":"test_cus_tr_ext_id"}],"external_id":"invoice_eid","due_date":"2016-01-07 - 12:00:00 +0000","customer_uuid":"customer_uuid"}]}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:45:27 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_PageableWithAnchor/should_be_pageable.yml b/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_PageableWithAnchor/should_be_pageable.yml deleted file mode 100644 index ef4ccdf..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_PageableWithAnchor/should_be_pageable.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/activities?per_page=2 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - server: - - nginx/1.10.1 - date: - - Fri, 18 Jun 2021 11:59:07 GMT - content-type: - - application/json - transfer-encoding: - - chunked - connection: - - keep-alive - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: ASCII-8BIT - string: '{"entries":[{"description":"purchased the Basic1 plan","activity-mrr-movement":4478,"activity-mrr":4478,"activity-arr":53736,"date":"2016-08-01T06:28:25+00:00","type":"new_biz","currency":"EUR","subscription-external-id":"si_18dZuXAN0YShtow4jjqxxNnW","plan-external-id":"a3e832e1-1bd1-4889-8466-8efdbfbdd94b","customer-name":"Customer - for test@example.com","customer-uuid":"6456e930-8c8e-11eb-a506-0ff43d2cc026","customer-external-id":"cus_8vQm8XjeEOw75p","billing-connector-uuid":"decdeb4c-8c8d-11eb-a506-b3974867f58c","uuid":"2f545d5f-f241-458c-8e99-38c0e5a6e6ff"},{"description":"purchased - the Basic1 plan","activity-mrr-movement":4425,"activity-mrr":4425,"activity-arr":53100,"date":"2016-08-17T09:28:10+00:00","type":"new_biz","currency":"EUR","subscription-external-id":"si_18jQLGAN0YShtow4kFWpOMVX","plan-external-id":"a3e832e1-1bd1-4889-8466-8efdbfbdd94b","customer-name":"Customer - for test@example.com","customer-uuid":"63ad1285-8c8e-11eb-a506-47d6b1cc7553","customer-external-id":"cus_91TH9rjhhYCpai","billing-connector-uuid":"decdeb4c-8c8d-11eb-a506-b3974867f58c","uuid":"9d5ba7fd-e06d-4750-a8f6-2983f3a30fb2"}],"has_more":true,"per_page":2}' - recorded_at: Fri, 18 Jun 2021 11:59:07 GMT -recorded_with: VCR 6.0.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml b/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml deleted file mode 100644 index ef4ccdf..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/activities?per_page=2 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v1.0.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: OK - headers: - server: - - nginx/1.10.1 - date: - - Fri, 18 Jun 2021 11:59:07 GMT - content-type: - - application/json - transfer-encoding: - - chunked - connection: - - keep-alive - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: ASCII-8BIT - string: '{"entries":[{"description":"purchased the Basic1 plan","activity-mrr-movement":4478,"activity-mrr":4478,"activity-arr":53736,"date":"2016-08-01T06:28:25+00:00","type":"new_biz","currency":"EUR","subscription-external-id":"si_18dZuXAN0YShtow4jjqxxNnW","plan-external-id":"a3e832e1-1bd1-4889-8466-8efdbfbdd94b","customer-name":"Customer - for test@example.com","customer-uuid":"6456e930-8c8e-11eb-a506-0ff43d2cc026","customer-external-id":"cus_8vQm8XjeEOw75p","billing-connector-uuid":"decdeb4c-8c8d-11eb-a506-b3974867f58c","uuid":"2f545d5f-f241-458c-8e99-38c0e5a6e6ff"},{"description":"purchased - the Basic1 plan","activity-mrr-movement":4425,"activity-mrr":4425,"activity-arr":53100,"date":"2016-08-17T09:28:10+00:00","type":"new_biz","currency":"EUR","subscription-external-id":"si_18jQLGAN0YShtow4kFWpOMVX","plan-external-id":"a3e832e1-1bd1-4889-8466-8efdbfbdd94b","customer-name":"Customer - for test@example.com","customer-uuid":"63ad1285-8c8e-11eb-a506-47d6b1cc7553","customer-external-id":"cus_91TH9rjhhYCpai","billing-connector-uuid":"decdeb4c-8c8d-11eb-a506-b3974867f58c","uuid":"9d5ba7fd-e06d-4750-a8f6-2983f3a30fb2"}],"has_more":true,"per_page":2}' - recorded_at: Fri, 18 Jun 2021 11:59:07 GMT -recorded_with: VCR 6.0.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/behaves_like_Pageable/should_be_pageable.yml b/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/behaves_like_Pageable/should_be_pageable.yml deleted file mode 100644 index 5ad328f..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/behaves_like_Pageable/should_be_pageable.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_91af761e-9d0a-11e5-b514-1feab446feac/activities - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Fri, 01 Jul 2016 14:47:49 GMT - content-type: - - application/json - content-length: - - '278' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"entries":[{"id":16664702,"description":"purchased the Yael Cohen - plan","activity-mrr-movement":10871,"activity-mrr":10871,"activity-arr":130452,"date":"2015-04-16T13:38:29+00:00","type":"new_biz","currency":"USD","currency-sign":"$","subscription_external_id":"si_IJxVS1c1TjSB0s"}],"has_more":false,"per_page":200,"page":1}' - http_version: - recorded_at: Fri, 01 Jul 2016 14:47:49 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_have_Activity_entries.yml b/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_have_Activity_entries.yml deleted file mode 100644 index 5ad328f..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_have_Activity_entries.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_91af761e-9d0a-11e5-b514-1feab446feac/activities - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Fri, 01 Jul 2016 14:47:49 GMT - content-type: - - application/json - content-length: - - '278' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"entries":[{"id":16664702,"description":"purchased the Yael Cohen - plan","activity-mrr-movement":10871,"activity-mrr":10871,"activity-arr":130452,"date":"2015-04-16T13:38:29+00:00","type":"new_biz","currency":"USD","currency-sign":"$","subscription_external_id":"si_IJxVS1c1TjSB0s"}],"has_more":false,"per_page":200,"page":1}' - http_version: - recorded_at: Fri, 01 Jul 2016 14:47:49 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/behaves_like_Pageable/should_be_pageable.yml b/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/behaves_like_Pageable/should_be_pageable.yml deleted file mode 100644 index 5776468..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/behaves_like_Pageable/should_be_pageable.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_91af761e-9d0a-11e5-b514-1feab446feac/subscriptions - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Fri, 01 Jul 2016 14:47:48 GMT - content-type: - - application/json - content-length: - - '308' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"entries":[{"id":9201273,"plan":"Yael Cohen","quantity":1,"mrr":10871,"arr":130452,"status":"active","billing-cycle":"day","billing-cycle-count":7,"start-date":"2015-10-15T13:41:40+00:00","end-date":"2015-10-22T13:41:40+00:00","currency":"USD","currency-sign":"$"}],"has_more":false,"per_page":200,"page":1}' - http_version: - recorded_at: Fri, 01 Jul 2016 14:47:48 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_have_Subscription_entries.yml b/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_have_Subscription_entries.yml deleted file mode 100644 index 61c1f4c..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_have_Subscription_entries.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.chartmogul.com/v1/customers/cus_91af761e-9d0a-11e5-b514-1feab446feac/subscriptions - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Fri, 01 Jul 2016 14:47:47 GMT - content-type: - - application/json - content-length: - - '308' - connection: - - close - status: - - 200 OK - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"entries":[{"id":9201273,"plan":"Yael Cohen","quantity":1,"mrr":10871,"arr":130452,"status":"active","billing-cycle":"day","billing-cycle-count":7,"start-date":"2015-10-15T13:41:40+00:00","end-date":"2015-10-22T13:41:40+00:00","currency":"USD","currency-sign":"$"}],"has_more":false,"per_page":200,"page":1}' - http_version: - recorded_at: Fri, 01 Jul 2016 14:47:47 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_handles_a_422_error.yml b/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_handles_a_422_error.yml deleted file mode 100644 index a08a651..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_handles_a_422_error.yml +++ /dev/null @@ -1,51 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"data_source_uuid":null,"name":null,"interval_count":null,"interval_unit":null,"external_id":null}' - headers: - User-Agent: - - Faraday v0.9.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 422 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - cache-control: - - no-cache - x-request-id: - - 72fc5d2e-0e09-4d62-b0b6-c10299d79c0a - x-runtime: - - '0.026567' - body: - encoding: UTF-8 - string: '{"errors":{"name":"A unique name is required for each plan.","interval_count":"is - not a number","interval_unit":"Only ''day'', ''month'' or ''year'' are valid - values for interval_unit.","data_source_uuid":"A valid data source UUID is - required for each plan."}}' - http_version: - recorded_at: Sun, 05 Jun 2016 19:47:08 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_interacts_with_the_API.yml b/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_interacts_with_the_API.yml deleted file mode 100644 index 3a1e356..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/correctly_interacts_with_the_API.yml +++ /dev/null @@ -1,152 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Another Data Source"}' - headers: - User-Agent: - - Faraday v0.9.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"05335923b74e9c38a5a5fe8e83ac0f79" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - e163c0c6-e937-4427-a0c8-78bd5e3f1711 - x-runtime: - - '0.509776' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"Another Data - Source","created_at":"2016-06-05T19:47:08.020Z","status":"never_imported"}' - http_version: - recorded_at: Sun, 05 Jun 2016 19:47:08 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"A - Test Plan","interval_count":1,"interval_unit":"month","external_id":null}' - headers: - User-Agent: - - Faraday v0.9.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"7086a2e8b932cc1ce3b47f8de5fdfdb8" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 6e97fa02-8bc1-4d2f-8718-8473a58e4254 - x-runtime: - - '0.120821' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}' - http_version: - recorded_at: Sun, 05 Jun 2016 19:47:08 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plans - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.1 - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"2122e94312ef92cc077db62910743655" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 1286c5a2-596a-4bc2-9e24-cfccc393e589 - x-runtime: - - '0.018019' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"plans":[{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}],"current_page":1,"total_pages":1}' - http_version: - recorded_at: Sun, 05 Jun 2016 19:47:08 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml b/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml deleted file mode 100644 index 75dbfb5..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/deletes_existing_plan.yml +++ /dev/null @@ -1,198 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Another Data Source"}' - headers: - User-Agent: - - Faraday v0.10.0 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"05335923b74e9c38a5a5fe8e83ac0f79" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - e163c0c6-e937-4427-a0c8-78bd5e3f1711 - x-runtime: - - '0.509776' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"Another Data - Source","created_at":"2016-06-05T19:47:08.020Z","status":"never_imported"}' - http_version: - recorded_at: Wed, 04 Jan 2017 02:32:48 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"A - Test Plan","interval_count":1,"interval_unit":"month","external_id":null}' - headers: - User-Agent: - - Faraday v0.9.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"7086a2e8b932cc1ce3b47f8de5fdfdb8" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 6e97fa02-8bc1-4d2f-8718-8473a58e4254 - x-runtime: - - '0.120821' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}' - http_version: - recorded_at: Sun, 05 Jun 2016 19:47:08 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plans/pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.1 - Authorization: - - Basic hidden - response: - status: - code: 404 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"2122e94312ef92cc077db62910743655" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 1286c5a2-596a-4bc2-9e24-cfccc393e589 - x-runtime: - - '0.018019' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"error": "Plan not found"}' - http_version: - recorded_at: Wed, 04 Jan 2017 02:32:48 GMT -- request: - method: delete - uri: https://api.chartmogul.com/v1/plans/pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.1 - Authorization: - - Basic hidden - response: - status: - code: 204 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"2122e94312ef92cc077db62910743655" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 1286c5a2-596a-4bc2-9e24-cfccc393e589 - x-runtime: - - '0.018019' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{}' - http_version: - recorded_at: Wed, 04 Jan 2017 02:32:48 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml b/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml deleted file mode 100644 index 866d9ec..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/retrieves_existing_plan_by_uuid.yml +++ /dev/null @@ -1,151 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Another Data Source"}' - headers: - User-Agent: - - Faraday v0.10.0 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"05335923b74e9c38a5a5fe8e83ac0f79" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - e163c0c6-e937-4427-a0c8-78bd5e3f1711 - x-runtime: - - '0.509776' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"Another Data - Source","created_at":"2016-06-05T19:47:08.020Z","status":"never_imported"}' - http_version: - recorded_at: Tue, 03 Jan 2017 23:45:27 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"A - Test Plan","interval_count":1,"interval_unit":"month","external_id":null}' - headers: - User-Agent: - - Faraday v0.9.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"7086a2e8b932cc1ce3b47f8de5fdfdb8" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 6e97fa02-8bc1-4d2f-8718-8473a58e4254 - x-runtime: - - '0.120821' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}' - http_version: - recorded_at: Sun, 05 Jun 2016 19:47:08 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plans/pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.1 - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"2122e94312ef92cc077db62910743655" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 1286c5a2-596a-4bc2-9e24-cfccc393e589 - x-runtime: - - '0.018019' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}' - http_version: - recorded_at: Sun, 05 Jun 2016 19:47:08 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml b/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml deleted file mode 100644 index ad105ff..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan.yml +++ /dev/null @@ -1,198 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Another Data Source"}' - headers: - User-Agent: - - Faraday v0.10.0 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"05335923b74e9c38a5a5fe8e83ac0f79" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - e163c0c6-e937-4427-a0c8-78bd5e3f1711 - x-runtime: - - '0.509776' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"Another Data - Source","created_at":"2016-06-05T19:47:08.020Z","status":"never_imported"}' - http_version: - recorded_at: Wed, 04 Jan 2017 02:32:48 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e","name":"A - Test Plan","interval_count":1,"interval_unit":"month","external_id":null}' - headers: - User-Agent: - - Faraday v0.9.1 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"7086a2e8b932cc1ce3b47f8de5fdfdb8" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 6e97fa02-8bc1-4d2f-8718-8473a58e4254 - x-runtime: - - '0.120821' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"pl_ba808f0b-4c1c-4824-8705-a6736efa96dc","external_id":null,"name":"A - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}' - http_version: - recorded_at: Sun, 05 Jun 2016 19:47:08 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plans/pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.1 - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"2122e94312ef92cc077db62910743655" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 1286c5a2-596a-4bc2-9e24-cfccc393e589 - x-runtime: - - '0.018019' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072","external_id":null,"name":"A Test Plan","interval_count":2,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}' - http_version: - recorded_at: Wed, 04 Jan 2017 02:32:48 GMT -- request: - method: patch - uri: https://api.chartmogul.com/v1/plans/pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.1 - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Sun, 05 Jun 2016 19:47:08 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"2122e94312ef92cc077db62910743655" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 1286c5a2-596a-4bc2-9e24-cfccc393e589 - x-runtime: - - '0.018019' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072","external_id":null,"name":"A Test Plan","interval_count":2,"interval_unit":"month","data_source_uuid":"ds_77eb401d-fff6-43be-94dc-2cbc2e96e31e"}' - http_version: - recorded_at: Wed, 04 Jan 2017 02:32:48 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan_using_class_method.yml b/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan_using_class_method.yml deleted file mode 100644 index e3c37a6..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Plan/API_Interactions/updates_existing_plan_using_class_method.yml +++ /dev/null @@ -1,164 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Another Data Source"}' - headers: - User-Agent: - - Faraday v0.17.3 - Content-Type: - - application/json - Authorization: - - Basic hidden - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 201 - message: Created - headers: - Server: - - nginx/1.10.1 - Date: - - Thu, 23 Jul 2020 12:33:56 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Status: - - 201 Created - Access-Control-Allow-Credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"uuid":"ds_c65f219c-cce0-11ea-a43a-8745a9a809c7","name":"Another Data - Source","system":"Import API","created_at":"2020-07-23T12:33:56.076Z","status":"idle"}' - http_version: null - recorded_at: Thu, 23 Jul 2020 12:33:56 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"pro","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_c65f219c-cce0-11ea-a43a-8745a9a809c7"}' - headers: - User-Agent: - - Faraday v0.17.3 - Content-Type: - - application/json - Authorization: - - Basic hidden - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 201 - message: Created - headers: - Server: - - nginx/1.10.1 - Date: - - Thu, 23 Jul 2020 12:33:57 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Status: - - 201 Created - X-Frame-Options: - - SAMEORIGIN - X-Xss-Protection: - - 1; mode=block - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - strict-origin-when-cross-origin - Etag: - - W/"ea419983710a24c40e13cc17133cfad5" - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - 8c6f92d6-c5f2-47ec-9bca-bb42bf2906bd - X-Runtime: - - '0.107610' - Strict-Transport-Security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"b37d52c0-af0e-0138-9570-42eead14b4ad","name":"pro","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_c65f219c-cce0-11ea-a43a-8745a9a809c7","uuid":"pl_b37d52c0-af0e-0138-9570-42eead14b4ad"}' - http_version: null - recorded_at: Thu, 23 Jul 2020 12:33:57 GMT -- request: - method: patch - uri: https://api.chartmogul.com/v1/plans/pl_b37d52c0-af0e-0138-9570-42eead14b4ad - body: - encoding: UTF-8 - string: '{"name":"really pro","interval_count":2}' - headers: - User-Agent: - - Faraday v0.17.3 - Content-Type: - - application/json - Authorization: - - Basic hidden - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 202 - message: Accepted - headers: - Server: - - nginx/1.10.1 - Date: - - Thu, 23 Jul 2020 12:33:58 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Status: - - 202 Accepted - X-Frame-Options: - - SAMEORIGIN - X-Xss-Protection: - - 1; mode=block - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - strict-origin-when-cross-origin - Cache-Control: - - no-cache - X-Request-Id: - - fcc52966-8abd-442b-a9cd-e14a35988163 - X-Runtime: - - '0.125362' - body: - encoding: UTF-8 - string: '{"external_id":"b37d52c0-af0e-0138-9570-42eead14b4ad","name":"really - pro","interval_count":2,"interval_unit":"month","data_source_uuid":"ds_c65f219c-cce0-11ea-a43a-8745a9a809c7","uuid":"pl_b37d52c0-af0e-0138-9570-42eead14b4ad"}' - http_version: null - recorded_at: Thu, 23 Jul 2020 12:33:58 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/correctly_handles_a_422_error.yml b/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/correctly_handles_a_422_error.yml deleted file mode 100644 index 31b8203..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/correctly_handles_a_422_error.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/plan_groups - body: - encoding: UTF-8 - string: "{}" - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 422 - message: - headers: - server: - - nginx/1.10.1 - date: - - Wed, 12 Feb 2020 17:06:03 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 422 Unprocessable Entity - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - cache-control: - - no-cache - x-request-id: - - 829dd1b4-e36e-49ec-8647-187294a7cb00 - x-runtime: - - '0.654937' - body: - encoding: UTF-8 - string: '{"plans":["Please provide uuids of the plans in the plan group"]}' - http_version: - recorded_at: Wed, 12 Feb 2020 17:06:03 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/deletes_a_plan_group.yml b/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/deletes_a_plan_group.yml deleted file mode 100644 index d99d4cf..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/deletes_a_plan_group.yml +++ /dev/null @@ -1,293 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Data Source #1"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Wed, 12 Feb 2020 16:50:58 GMT - content-type: - - application/json - content-length: - - '152' - connection: - - close - status: - - 201 Created - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"uuid":"ds_d7af0870-4db7-11ea-a748-3b84121ebe17","name":"Data Source - #1","system":"Import API","created_at":"2020-02-12T16:50:57.869Z","status":"idle"}' - http_version: - recorded_at: Wed, 12 Feb 2020 16:50:58 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d7af0870-4db7-11ea-a748-3b84121ebe17"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Wed, 12 Feb 2020 16:50:59 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"e53de700ad9f3d935b0f624a5aa9dd75" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - f50dbc50-74e2-434e-a410-4601fdabd841 - x-runtime: - - '0.723144' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"c49a57f0-2fe5-0138-b4fb-4e501129bd4a","name":"A Test - Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d7af0870-4db7-11ea-a748-3b84121ebe17","uuid":"pl_c49a57f0-2fe5-0138-b4fb-4e501129bd4a"}' - http_version: - recorded_at: Wed, 12 Feb 2020 16:50:59 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d7af0870-4db7-11ea-a748-3b84121ebe17"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Wed, 12 Feb 2020 16:50:59 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"6ee867f025f592d30a68042391ca1e58" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 24f68b11-c333-407b-be3d-9419055fec95 - x-runtime: - - '0.138718' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"c4eade70-2fe5-0138-c99d-42eead14b4ad","name":"A another - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d7af0870-4db7-11ea-a748-3b84121ebe17","uuid":"pl_c4eade70-2fe5-0138-c99d-42eead14b4ad"}' - http_version: - recorded_at: Wed, 12 Feb 2020 16:50:59 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plan_groups - body: - encoding: UTF-8 - string: '{"name":"My plan group","plans":["pl_c49a57f0-2fe5-0138-b4fb-4e501129bd4a","pl_c4eade70-2fe5-0138-c99d-42eead14b4ad"]}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Wed, 12 Feb 2020 16:50:59 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"e5a42fa30f5931fa83c95f2b73f6747f" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 9d3b5349-86d5-40d4-89fc-a681a2fe7e10 - x-runtime: - - '0.097957' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My plan group","uuid":"plg_ca20004e-ed97-4942-9b7f-567a17bbbe31","plans":[{"name":"A - Test Plan","uuid":"pl_c49a57f0-2fe5-0138-b4fb-4e501129bd4a","data_source_uuid":"ds_d7af0870-4db7-11ea-a748-3b84121ebe17","interval_count":1,"interval_unit":"month","external_id":"c49a57f0-2fe5-0138-b4fb-4e501129bd4a"},{"name":"A - another Test Plan","uuid":"pl_c4eade70-2fe5-0138-c99d-42eead14b4ad","data_source_uuid":"ds_d7af0870-4db7-11ea-a748-3b84121ebe17","interval_count":1,"interval_unit":"month","external_id":"c4eade70-2fe5-0138-c99d-42eead14b4ad"}]}' - http_version: - recorded_at: Wed, 12 Feb 2020 16:50:59 GMT -- request: - method: delete - uri: https://api.chartmogul.com/v1/plan_groups/plg_ca20004e-ed97-4942-9b7f-567a17bbbe31 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.15.4 - Authorization: - - Basic hidden - response: - status: - code: 204 - message: - headers: - server: - - nginx/1.10.1 - date: - - Wed, 12 Feb 2020 16:50:59 GMT - connection: - - close - status: - - 204 No Content - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - cache-control: - - no-cache - x-request-id: - - 86734092-41ca-4332-a0a5-7171ad0215f8 - x-runtime: - - '0.160735' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Wed, 12 Feb 2020 16:50:59 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plan_groups/plg_ca20004e-ed97-4942-9b7f-567a17bbbe31 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 404 - message: - headers: - server: - - nginx/1.10.1 - date: - - Wed, 12 Feb 2020 16:51:00 GMT - content-type: - - text/html; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - etag: - - W/"5e4412e9-7aa2" - body: - encoding: ASCII-8BIT - string: |- - Oops! That page doesn't exist.

Oops! That page doesn't exist.

We're usually good at connecting the dots but we couldn't find this page.

404 Not Found

Homepage Contact Support

- http_version: - recorded_at: Wed, 12 Feb 2020 16:51:00 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/retrieves_existing_plan_group_by_uuid.yml b/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/retrieves_existing_plan_group_by_uuid.yml deleted file mode 100644 index 72db26b..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/retrieves_existing_plan_group_by_uuid.yml +++ /dev/null @@ -1,251 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Data Source #1"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:14:53 GMT - content-type: - - application/json - content-length: - - '152' - connection: - - close - status: - - 201 Created - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"uuid":"ds_829c448a-5404-11ea-ab18-db11706d03de","name":"Data Source - #1","system":"Import API","created_at":"2020-02-20T17:14:53.542Z","status":"idle"}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:14:53 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_829c448a-5404-11ea-ab18-db11706d03de"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:14:54 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"902ad62e9093abc28f236ceffb652454" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 5e5445aa-cfaf-4b3f-b609-c06bdcdabf07 - x-runtime: - - '0.105219' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"6f5f2e80-3632-0138-ca32-42eead14b4ad","name":"A Test - Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_829c448a-5404-11ea-ab18-db11706d03de","uuid":"pl_6f5f2e80-3632-0138-ca32-42eead14b4ad"}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:14:54 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_829c448a-5404-11ea-ab18-db11706d03de"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:14:54 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"7b328c6d0ef318c67e036f598a2b2554" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 0143f23d-cf20-4172-8821-e663d34e3ea3 - x-runtime: - - '0.171744' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"6f8e4b20-3632-0138-f01e-62b37fb4c770","name":"A another - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_829c448a-5404-11ea-ab18-db11706d03de","uuid":"pl_6f8e4b20-3632-0138-f01e-62b37fb4c770"}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:14:54 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plan_groups - body: - encoding: UTF-8 - string: '{"name":"My plan group","plans":["pl_6f5f2e80-3632-0138-ca32-42eead14b4ad","pl_6f8e4b20-3632-0138-f01e-62b37fb4c770"]}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:14:54 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"8d079567f75302f08e366740c2dd92f4" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - cc79c4d5-9a2a-4bda-ad92-1a935efe7938 - x-runtime: - - '0.073698' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My plan group","uuid":"plg_b53fdbfc-c5eb-4a61-a589-85146cf8d0ab","plans_count":2}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:14:54 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plan_groups/plg_b53fdbfc-c5eb-4a61-a589-85146cf8d0ab - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:14:54 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"8d079567f75302f08e366740c2dd92f4" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 8174e86d-fbe3-4deb-89bb-74267418428d - x-runtime: - - '0.069583' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My plan group","uuid":"plg_b53fdbfc-c5eb-4a61-a589-85146cf8d0ab","plans_count":2}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:14:54 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/returns_an_array_of_plan_groups.yml b/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/returns_an_array_of_plan_groups.yml deleted file mode 100644 index be200ba..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/returns_an_array_of_plan_groups.yml +++ /dev/null @@ -1,357 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Data Source #1"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:42:18 GMT - content-type: - - application/json - content-length: - - '152' - connection: - - close - status: - - 201 Created - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"uuid":"ds_aa7503e8-53cd-11ea-aae9-e734eaddcf1d","name":"Data Source - #1","system":"Import API","created_at":"2020-02-20T10:42:17.984Z","status":"idle"}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:42:18 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_aa7503e8-53cd-11ea-aae9-e734eaddcf1d"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:42:18 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"054766b8d387cec3ef504b2ff6a997b6" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 1e8faf16-56cb-4e75-9dac-b456653676e7 - x-runtime: - - '0.194130' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"97490c90-35fb-0138-f016-62b37fb4c770","name":"A Test - Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_aa7503e8-53cd-11ea-aae9-e734eaddcf1d","uuid":"pl_97490c90-35fb-0138-f016-62b37fb4c770"}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:42:18 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_aa7503e8-53cd-11ea-aae9-e734eaddcf1d"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:42:19 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"e4f2a6e82a1a1e8dbe25c9a0ab1c7707" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 6b6f5af3-5a77-4bbd-a6c1-23f9866f4677 - x-runtime: - - '0.135728' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"9781a5d0-35fb-0138-3705-364318904ce3","name":"A another - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_aa7503e8-53cd-11ea-aae9-e734eaddcf1d","uuid":"pl_9781a5d0-35fb-0138-3705-364318904ce3"}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:42:19 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plan_groups - body: - encoding: UTF-8 - string: '{"name":"My plan group","plans":["pl_97490c90-35fb-0138-f016-62b37fb4c770","pl_9781a5d0-35fb-0138-3705-364318904ce3"]}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:42:19 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"53b233ebc77584ca11ba27522debed3a" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 36def44d-7c26-4446-9609-a48836ad5195 - x-runtime: - - '0.113148' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My plan group","uuid":"plg_3c2b0732-cff0-437f-9f8d-a575ccc8b7e9","plans_count":2}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:42:19 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_aa7503e8-53cd-11ea-aae9-e734eaddcf1d"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:42:19 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"6903fe5a1ce6d99a70cde43e818d327a" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - bb1fe96f-6288-4b86-9a3e-2122666c9573 - x-runtime: - - '0.146997' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"97e04cd0-35fb-0138-b58f-4e501129bd4a","name":"A another - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_aa7503e8-53cd-11ea-aae9-e734eaddcf1d","uuid":"pl_97e04cd0-35fb-0138-b58f-4e501129bd4a"}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:42:19 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plan_groups - body: - encoding: UTF-8 - string: '{"name":"My second plan group","plans":["pl_9781a5d0-35fb-0138-3705-364318904ce3","pl_97e04cd0-35fb-0138-b58f-4e501129bd4a"]}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:42:19 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"72125c9c54ed510796063eb63630e929" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - fa72a972-80bf-411a-bedf-75a4790cb505 - x-runtime: - - '0.071034' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My second plan group","uuid":"plg_1d960363-a335-4e21-90cd-f3686c143453","plans_count":2}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:42:19 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plan_groups - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:42:20 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"8f193c3d2a8b1865b2e2ca5f425c11f8" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - b87e4ab8-ef16-476a-accf-1caa595abcb1 - x-runtime: - - '0.117165' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"plan_groups":[{"name":"My plan group","uuid":"plg_3c2b0732-cff0-437f-9f8d-a575ccc8b7e9","plans_count":2},{"name":"My - second plan group","uuid":"plg_1d960363-a335-4e21-90cd-f3686c143453","plans_count":2}],"current_page":1,"total_pages":1}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:42:20 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name.yml b/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name.yml deleted file mode 100644 index 183bc89..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name.yml +++ /dev/null @@ -1,304 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Data Source #1"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:13:29 GMT - content-type: - - application/json - content-length: - - '152' - connection: - - close - status: - - 201 Created - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"uuid":"ds_502f5a1e-5404-11ea-ab18-ffd72d6e41ca","name":"Data Source - #1","system":"Import API","created_at":"2020-02-20T17:13:28.947Z","status":"idle"}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:13:29 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_502f5a1e-5404-11ea-ab18-ffd72d6e41ca"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:13:29 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"b1925828957c62f22be7e57b394db7be" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - a0de0538-ef46-410c-a782-59ffc8909ef4 - x-runtime: - - '0.133357' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"3cf5d690-3632-0138-b59b-4e501129bd4a","name":"A Test - Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_502f5a1e-5404-11ea-ab18-ffd72d6e41ca","uuid":"pl_3cf5d690-3632-0138-b59b-4e501129bd4a"}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:13:29 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_502f5a1e-5404-11ea-ab18-ffd72d6e41ca"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:13:29 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"b23dd9ce0e237a70626d7d389a44fc7c" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 0accd7b9-9001-4b89-a38c-a52b60ffc09e - x-runtime: - - '0.203924' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"3d3199f0-3632-0138-f01d-62b37fb4c770","name":"A another - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_502f5a1e-5404-11ea-ab18-ffd72d6e41ca","uuid":"pl_3d3199f0-3632-0138-f01d-62b37fb4c770"}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:13:29 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plan_groups - body: - encoding: UTF-8 - string: '{"name":"My plan group","plans":["pl_3cf5d690-3632-0138-b59b-4e501129bd4a","pl_3d3199f0-3632-0138-f01d-62b37fb4c770"]}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:13:30 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"b64c5d68668419bcbb91a96e0ed6c00d" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 2cf1076a-1c68-49f7-b7d9-38cb98ab84e8 - x-runtime: - - '0.070373' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My plan group","uuid":"plg_44f41eeb-f61a-4aef-b95d-f78841d61f1b","plans_count":2}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:13:30 GMT -- request: - method: patch - uri: https://api.chartmogul.com/v1/plan_groups/plg_44f41eeb-f61a-4aef-b95d-f78841d61f1b - body: - encoding: UTF-8 - string: '{"name":"A new plan group_name"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:13:30 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"6396163c6308c50b2dca74e3cc508a5b" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 8aa04eab-de86-4946-8d43-759c08b7291e - x-runtime: - - '0.076873' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"A new plan group_name","uuid":"plg_44f41eeb-f61a-4aef-b95d-f78841d61f1b","plans_count":2}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:13:30 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plan_groups/plg_44f41eeb-f61a-4aef-b95d-f78841d61f1b - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:13:30 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"6396163c6308c50b2dca74e3cc508a5b" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - ff9effdc-277e-4672-9503-43397a999624 - x-runtime: - - '0.031658' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"A new plan group_name","uuid":"plg_44f41eeb-f61a-4aef-b95d-f78841d61f1b","plans_count":2}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:13:30 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name_via_class_method.yml b/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name_via_class_method.yml deleted file mode 100644 index 8788982..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_name_via_class_method.yml +++ /dev/null @@ -1,297 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Data Source #1"}' - headers: - User-Agent: - - Faraday v0.17.3 - Content-Type: - - application/json - Authorization: - - Basic hidden - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 201 - message: Created - headers: - Server: - - nginx/1.10.1 - Date: - - Thu, 23 Jul 2020 12:34:26 GMT - Content-Type: - - application/json - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Status: - - 201 Created - Access-Control-Allow-Credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"uuid":"ds_d83adf5a-cce0-11ea-a43a-0bee9fce502d","name":"Data Source - #1","system":"Import API","created_at":"2020-07-23T12:34:26.033Z","status":"idle"}' - http_version: null - recorded_at: Thu, 23 Jul 2020 12:34:26 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d83adf5a-cce0-11ea-a43a-0bee9fce502d"}' - headers: - User-Agent: - - Faraday v0.17.3 - Content-Type: - - application/json - Authorization: - - Basic hidden - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 201 - message: Created - headers: - Server: - - nginx/1.10.1 - Date: - - Thu, 23 Jul 2020 12:34:27 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Status: - - 201 Created - X-Frame-Options: - - SAMEORIGIN - X-Xss-Protection: - - 1; mode=block - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - strict-origin-when-cross-origin - Etag: - - W/"c69ec995cb9bab078fd6c88a194a33e0" - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - 21bb8417-4520-4b9f-aded-46d155615e98 - X-Runtime: - - '0.119008' - Strict-Transport-Security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"c5723000-af0e-0138-d912-62b37fb4c770","name":"A Test - Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d83adf5a-cce0-11ea-a43a-0bee9fce502d","uuid":"pl_c5723000-af0e-0138-d912-62b37fb4c770"}' - http_version: null - recorded_at: Thu, 23 Jul 2020 12:34:27 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d83adf5a-cce0-11ea-a43a-0bee9fce502d"}' - headers: - User-Agent: - - Faraday v0.17.3 - Content-Type: - - application/json - Authorization: - - Basic hidden - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 201 - message: Created - headers: - Server: - - nginx/1.10.1 - Date: - - Thu, 23 Jul 2020 12:34:28 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Status: - - 201 Created - X-Frame-Options: - - SAMEORIGIN - X-Xss-Protection: - - 1; mode=block - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - strict-origin-when-cross-origin - Etag: - - W/"392434626ecc2ec07e9bb64179d07e58" - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - f9570c06-bfc2-4cce-b9e2-ec2ad88e2a1a - X-Runtime: - - '0.114808' - Strict-Transport-Security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"c61dc800-af0e-0138-1702-4e501129bd4a","name":"A another - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_d83adf5a-cce0-11ea-a43a-0bee9fce502d","uuid":"pl_c61dc800-af0e-0138-1702-4e501129bd4a"}' - http_version: null - recorded_at: Thu, 23 Jul 2020 12:34:28 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plan_groups - body: - encoding: UTF-8 - string: '{"name":"My plan group","plans":["pl_c5723000-af0e-0138-d912-62b37fb4c770","pl_c61dc800-af0e-0138-1702-4e501129bd4a"]}' - headers: - User-Agent: - - Faraday v0.17.3 - Content-Type: - - application/json - Authorization: - - Basic hidden - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx/1.10.1 - Date: - - Thu, 23 Jul 2020 12:34:29 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Accept-Encoding - - Accept-Encoding - Status: - - 200 OK - X-Frame-Options: - - SAMEORIGIN - X-Xss-Protection: - - 1; mode=block - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - strict-origin-when-cross-origin - Etag: - - W/"1b33f81c506f9371501c358293e5c25e" - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - 96425a8f-ad6a-4d43-883a-28809e5e8fd2 - X-Runtime: - - '0.055173' - Strict-Transport-Security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My plan group","uuid":"plg_36d737ca-b021-4fc7-a8ee-8636fb6db2cc","plans_count":2}' - http_version: null - recorded_at: Thu, 23 Jul 2020 12:34:29 GMT -- request: - method: patch - uri: https://api.chartmogul.com/v1/plan_groups/plg_36d737ca-b021-4fc7-a8ee-8636fb6db2cc - body: - encoding: UTF-8 - string: '{"name":"A new group name"}' - headers: - User-Agent: - - Faraday v0.17.3 - Content-Type: - - application/json - Authorization: - - Basic hidden - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx/1.10.1 - Date: - - Thu, 23 Jul 2020 12:34:30 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Accept-Encoding - - Accept-Encoding - Status: - - 200 OK - X-Frame-Options: - - SAMEORIGIN - X-Xss-Protection: - - 1; mode=block - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - strict-origin-when-cross-origin - Etag: - - W/"b12ead83619d709fd1285016e6daec9b" - Cache-Control: - - max-age=0, private, must-revalidate - X-Request-Id: - - 27ca96d6-4e17-4c89-b030-6fcae8131bb3 - X-Runtime: - - '0.044140' - Strict-Transport-Security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"A new group name","uuid":"plg_36d737ca-b021-4fc7-a8ee-8636fb6db2cc","plans_count":2}' - http_version: null - recorded_at: Thu, 23 Jul 2020 12:34:30 GMT -recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_plans.yml b/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_plans.yml deleted file mode 100644 index 7728ad0..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_interactions/updates_existing_plan_group_plans.yml +++ /dev/null @@ -1,411 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Data Source #1"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:57:21 GMT - content-type: - - application/json - content-length: - - '152' - connection: - - close - status: - - 201 Created - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"uuid":"ds_c4fdc7a2-53cf-11ea-aae9-cba10afd2cab","name":"Data Source - #1","system":"Import API","created_at":"2020-02-20T10:57:21.537Z","status":"idle"}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:57:22 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_c4fdc7a2-53cf-11ea-aae9-cba10afd2cab"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:57:22 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"680bf36b1c4f2dff6428304f51e2c5d1" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 98cf8d71-2a0a-464f-8580-4d7584f05c28 - x-runtime: - - '0.093243' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"b1d2e190-35fd-0138-b593-4e501129bd4a","name":"A another - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_c4fdc7a2-53cf-11ea-aae9-cba10afd2cab","uuid":"pl_b1d2e190-35fd-0138-b593-4e501129bd4a"}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:57:22 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_c4fdc7a2-53cf-11ea-aae9-cba10afd2cab"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:57:22 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"b8310c5c76d0a1261ae0e170774c8317" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - a350a73c-a056-4f06-9f9c-809439bf6019 - x-runtime: - - '0.147289' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"b1fa8e50-35fd-0138-b594-4e501129bd4a","name":"A Test - Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_c4fdc7a2-53cf-11ea-aae9-cba10afd2cab","uuid":"pl_b1fa8e50-35fd-0138-b594-4e501129bd4a"}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:57:22 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_c4fdc7a2-53cf-11ea-aae9-cba10afd2cab"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:57:22 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"f7b6f9160ce0ef3a1548ce6ce684d83e" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 251b2e7c-bbe3-4259-859d-39cbd6e29aa0 - x-runtime: - - '0.133838' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"b225c9f0-35fd-0138-b595-4e501129bd4a","name":"A another - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_c4fdc7a2-53cf-11ea-aae9-cba10afd2cab","uuid":"pl_b225c9f0-35fd-0138-b595-4e501129bd4a"}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:57:22 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plan_groups - body: - encoding: UTF-8 - string: '{"name":"My plan group","plans":["pl_b1fa8e50-35fd-0138-b594-4e501129bd4a","pl_b225c9f0-35fd-0138-b595-4e501129bd4a"]}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:57:23 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"7c591e7d5ee581e4ae49ffccb4165863" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - aaf768b5-e7b3-4e8a-892b-4c4e313cc409 - x-runtime: - - '0.077071' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My plan group","uuid":"plg_de7adee5-7a1e-4e3f-ac11-978c9294427a","plans_count":2}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:57:23 GMT -- request: - method: patch - uri: https://api.chartmogul.com/v1/plan_groups/plg_de7adee5-7a1e-4e3f-ac11-978c9294427a - body: - encoding: UTF-8 - string: '{"name":"My plan group","plans_count":2,"plans":["pl_b1fa8e50-35fd-0138-b594-4e501129bd4a","pl_b225c9f0-35fd-0138-b595-4e501129bd4a","pl_b1d2e190-35fd-0138-b593-4e501129bd4a"]}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:57:23 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"5cd2492b2cccc2503702e906a10a0dab" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 7efb2bc8-85e8-45c9-aa26-0df590228126 - x-runtime: - - '0.131806' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My plan group","uuid":"plg_de7adee5-7a1e-4e3f-ac11-978c9294427a","plans_count":3}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:57:23 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plan_groups/plg_de7adee5-7a1e-4e3f-ac11-978c9294427a - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:57:23 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"5cd2492b2cccc2503702e906a10a0dab" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - fe9819d4-9413-4430-8648-298c8c24ab95 - x-runtime: - - '0.043397' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My plan group","uuid":"plg_de7adee5-7a1e-4e3f-ac11-978c9294427a","plans_count":3}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:57:23 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plan_groups/plg_de7adee5-7a1e-4e3f-ac11-978c9294427a/plans - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 10:57:23 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"9d72543d2f2e6ffba5e5b8db51920b40" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - f876000c-f4b2-4e85-b033-76bd3a44a4fb - x-runtime: - - '0.108157' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"plans":[{"name":"A another Test Plan","uuid":"pl_b1d2e190-35fd-0138-b593-4e501129bd4a","data_source_uuid":"ds_c4fdc7a2-53cf-11ea-aae9-cba10afd2cab","interval_count":1,"interval_unit":"month","external_id":"b1d2e190-35fd-0138-b593-4e501129bd4a"},{"name":"A - Test Plan","uuid":"pl_b1fa8e50-35fd-0138-b594-4e501129bd4a","data_source_uuid":"ds_c4fdc7a2-53cf-11ea-aae9-cba10afd2cab","interval_count":1,"interval_unit":"month","external_id":"b1fa8e50-35fd-0138-b594-4e501129bd4a"},{"name":"A - another Test Plan","uuid":"pl_b225c9f0-35fd-0138-b595-4e501129bd4a","data_source_uuid":"ds_c4fdc7a2-53cf-11ea-aae9-cba10afd2cab","interval_count":1,"interval_unit":"month","external_id":"b225c9f0-35fd-0138-b595-4e501129bd4a"}],"current_page":1,"total_pages":1}' - http_version: - recorded_at: Thu, 20 Feb 2020 10:57:23 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_interactions/given_a_plan_group_uuid_returns_an_array_of_plans_in_the_plan_group.yml b/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_interactions/given_a_plan_group_uuid_returns_an_array_of_plans_in_the_plan_group.yml deleted file mode 100644 index 60ab64c..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_interactions/given_a_plan_group_uuid_returns_an_array_of_plans_in_the_plan_group.yml +++ /dev/null @@ -1,252 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Data Source #1"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:20:15 GMT - content-type: - - application/json - content-length: - - '152' - connection: - - close - status: - - 201 Created - access-control-allow-credentials: - - 'true' - body: - encoding: UTF-8 - string: '{"uuid":"ds_424b9628-5405-11ea-ab18-e3a0f4f45097","name":"Data Source - #1","system":"Import API","created_at":"2020-02-20T17:20:15.102Z","status":"idle"}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:20:15 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_424b9628-5405-11ea-ab18-e3a0f4f45097"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:20:16 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"de6a4357349f1e696cf670b8cb1d3a91" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 1d0fbf42-e22c-42ac-b068-3fc78e615d0b - x-runtime: - - '0.613620' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"2f7f4360-3633-0138-f01f-62b37fb4c770","name":"A Test - Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_424b9628-5405-11ea-ab18-e3a0f4f45097","uuid":"pl_2f7f4360-3633-0138-f01f-62b37fb4c770"}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:20:16 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"name":"A another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_424b9628-5405-11ea-ab18-e3a0f4f45097"}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:20:17 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - status: - - 201 Created - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"3928a3336f01663683f92bdda358c877" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 8f90c8e4-8902-4c82-9ac2-b9e466d35b85 - x-runtime: - - '0.492792' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"external_id":"3011ead0-3633-0138-f020-62b37fb4c770","name":"A another - Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_424b9628-5405-11ea-ab18-e3a0f4f45097","uuid":"pl_3011ead0-3633-0138-f020-62b37fb4c770"}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:20:17 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plan_groups - body: - encoding: UTF-8 - string: '{"name":"My plan group","plans":["pl_2f7f4360-3633-0138-f01f-62b37fb4c770","pl_3011ead0-3633-0138-f020-62b37fb4c770"]}' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:20:17 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"b36573ce415d939f61a58648b6d930cf" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - a48672ef-8c37-459e-ac45-189f0e79c575 - x-runtime: - - '0.079833' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"name":"My plan group","uuid":"plg_f7e7ee61-4cff-47a5-ab45-3127cbfdde0b","plans_count":2}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:20:17 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/plan_groups/plg_f7e7ee61-4cff-47a5-ab45-3127cbfdde0b/plans - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.15.4 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.10.1 - date: - - Thu, 20 Feb 2020 17:20:18 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - vary: - - Accept-Encoding, Accept-Encoding - status: - - 200 OK - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"5e8f9b0b2fde5db47f62e9150c0bcdad" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 58983eb3-fc9a-4d32-8a9f-10e6a0d82a9f - x-runtime: - - '0.366925' - strict-transport-security: - - max-age=15768000 - body: - encoding: ASCII-8BIT - string: '{"plans":[{"name":"A Test Plan","uuid":"pl_2f7f4360-3633-0138-f01f-62b37fb4c770","data_source_uuid":"ds_424b9628-5405-11ea-ab18-e3a0f4f45097","interval_count":1,"interval_unit":"month","external_id":"2f7f4360-3633-0138-f01f-62b37fb4c770"},{"name":"A - another Test Plan","uuid":"pl_3011ead0-3633-0138-f020-62b37fb4c770","data_source_uuid":"ds_424b9628-5405-11ea-ab18-e3a0f4f45097","interval_count":1,"interval_unit":"month","external_id":"3011ead0-3633-0138-f020-62b37fb4c770"}],"current_page":1,"total_pages":1}' - http_version: - recorded_at: Thu, 20 Feb 2020 17:20:18 GMT -recorded_with: VCR 3.0.3 diff --git a/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml b/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml deleted file mode 100644 index b8e0141..0000000 --- a/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml +++ /dev/null @@ -1,340 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.chartmogul.com/v1/data_sources - body: - encoding: UTF-8 - string: '{"name":"Subscription Test Data Source"}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Thu, 23 Jun 2016 20:46:05 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"d9f558c2b556b28cdcc9c323d3ac66dd" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 4333819d-8abb-4310-b475-1c6b4adb5c9f - x-runtime: - - '0.507565' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"ds_55ab11fb-53e6-4468-aa95-bd582f14cac6","name":"Subscription - Test Data Source","created_at":"2016-06-23T20:46:05.645Z","status":"never_imported"}' - http_version: - recorded_at: Thu, 23 Jun 2016 20:46:05 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/customers - body: - encoding: UTF-8 - string: '{"data_source_uuid":"ds_55ab11fb-53e6-4468-aa95-bd582f14cac6","external_id":"test_cus_ext_id","name":"Test - Customer"}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Thu, 23 Jun 2016 20:46:06 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"056f26f774245e913872879340e8dd36" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - b3bc5b32-a587-49e8-8588-a54b9fa048a2 - x-runtime: - - '0.295099' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"cus_510b1395-4fe8-4d35-ae23-0e61f9a51e33","external_id":"test_cus_ext_id","name":"Test - Customer","company":"","email":"","city":"","state":"","country":"","zip":"","data_source_uuid":"ds_55ab11fb-53e6-4468-aa95-bd582f14cac6"}' - http_version: - recorded_at: Thu, 23 Jun 2016 20:46:06 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/plans - body: - encoding: UTF-8 - string: '{"data_source_uuid":"ds_55ab11fb-53e6-4468-aa95-bd582f14cac6","name":"Test - Plan","interval_count":7,"interval_unit":"day"}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Thu, 23 Jun 2016 20:46:06 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"cc9005f2d9ac2dcb5fb9076128a32d21" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 250b3ffc-64f6-482a-a395-1f46b7cf3736 - x-runtime: - - '0.025146' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"uuid":"pl_06ea83a9-f8c8-4ddd-a980-9ceffd27f107","external_id":null,"name":"Test - Plan","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_55ab11fb-53e6-4468-aa95-bd582f14cac6"}' - http_version: - recorded_at: Thu, 23 Jun 2016 20:46:06 GMT -- request: - method: post - uri: https://api.chartmogul.com/v1/import/customers/cus_510b1395-4fe8-4d35-ae23-0e61f9a51e33/invoices - body: - encoding: UTF-8 - string: '{"invoices":[{"date":"2016-01-01 12:00:00 +0000","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"test_cus_sub_ext_id", "subscription_set_external_id":"test_cus_set_ext_id", "plan_uuid":"pl_06ea83a9-f8c8-4ddd-a980-9ceffd27f107","service_period_start":"2016-01-01 - 12:00:00 +0000","service_period_end":"2016-02-01 12:00:00 +0000","amount_in_cents":1000}],"external_id":"test_tr_inv_ext_id"}],"customer_uuid":"cus_510b1395-4fe8-4d35-ae23-0e61f9a51e33"}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 201 - message: - headers: - server: - - nginx/1.9.10 - date: - - Thu, 23 Jun 2016 20:46:07 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"25c93d56164e8f1515058dc7f3a0d468" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - 72edbe3a-c00c-4d83-80ca-8e091784fa88 - x-runtime: - - '0.095619' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"invoices":[{"uuid":"inv_90054098-c269-46e1-b69a-338a8216499a","external_id":"test_tr_inv_ext_id","date":"2016-01-01T12:00:00.000Z","due_date":null,"currency":"USD","line_items":[{"uuid":"li_d25c8f7f-a10a-445f-9793-b7c68bd699cd","external_id":null,"type":"subscription","subscription_uuid":"sub_9b3ccf25-4613-4af6-84b3-12026cfa4b7c","plan_uuid":"pl_06ea83a9-f8c8-4ddd-a980-9ceffd27f107","prorated":false,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","amount_in_cents":1000,"quantity":1,"discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0}],"transactions":[]}]}' - http_version: - recorded_at: Thu, 23 Jun 2016 20:46:07 GMT -- request: - method: get - uri: https://api.chartmogul.com/v1/import/customers/cus_510b1395-4fe8-4d35-ae23-0e61f9a51e33/subscriptions - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 200 - message: - headers: - server: - - nginx/1.9.10 - date: - - Thu, 23 Jun 2016 20:46:07 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - etag: - - W/"797037ae5a33dcae7de46e23dfdd4ec7" - cache-control: - - max-age=0, private, must-revalidate - x-request-id: - - efa1a67e-37e8-4ac3-bce7-8d11f33d0e8c - x-runtime: - - '0.026716' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '{"customer_uuid":"cus_510b1395-4fe8-4d35-ae23-0e61f9a51e33","subscriptions":[{"uuid":"sub_9b3ccf25-4613-4af6-84b3-12026cfa4b7c","external_id":"test_cus_sub_ext_id", "subscription_set_external_id":"test_cus_set_ext_id","cancellation_dates":[],"plan_uuid":"pl_06ea83a9-f8c8-4ddd-a980-9ceffd27f107","data_source_uuid":"ds_55ab11fb-53e6-4468-aa95-bd582f14cac6"}],"current_page":1,"total_pages":1}' - http_version: - recorded_at: Thu, 23 Jun 2016 20:46:07 GMT -- request: - method: patch - uri: https://api.chartmogul.com/v1/import/subscriptions/sub_9b3ccf25-4613-4af6-84b3-12026cfa4b7c - body: - encoding: UTF-8 - string: '{"cancelled_at":"2016-01-15 12:00:00 +0000"}' - headers: - User-Agent: - - Faraday v0.9.2 - Content-Type: - - application/json - Authorization: - - Basic hidden - response: - status: - code: 202 - message: - headers: - server: - - nginx/1.9.10 - date: - - Thu, 23 Jun 2016 20:46:07 GMT - content-type: - - application/json; charset=utf-8 - transfer-encoding: - - chunked - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - cache-control: - - no-cache - x-request-id: - - 7bdf7b19-3d18-481a-9f12-e3f613b50f7b - x-runtime: - - '0.060122' - body: - encoding: UTF-8 - string: '{"uuid":"sub_9b3ccf25-4613-4af6-84b3-12026cfa4b7c","external_id":"test_cus_sub_ext_id","cancellation_dates":["2016-01-15T12:00:00.000Z"],"customer_uuid":"cus_510b1395-4fe8-4d35-ae23-0e61f9a51e33","plan_uuid":"pl_06ea83a9-f8c8-4ddd-a980-9ceffd27f107","data_source_uuid":"ds_55ab11fb-53e6-4468-aa95-bd582f14cac6"}' - http_version: - recorded_at: Thu, 23 Jun 2016 20:46:07 GMT -- request: - method: delete - uri: https://api.chartmogul.com/v1/data_sources/ds_55ab11fb-53e6-4468-aa95-bd582f14cac6 - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Faraday v0.9.2 - Authorization: - - Basic hidden - response: - status: - code: 204 - message: - headers: - server: - - nginx/1.9.10 - date: - - Thu, 23 Jun 2016 20:46:07 GMT - connection: - - close - x-frame-options: - - SAMEORIGIN - x-xss-protection: - - 1; mode=block - x-content-type-options: - - nosniff - cache-control: - - no-cache - x-request-id: - - ebf1f856-a389-457f-aead-22769e35aa8e - x-runtime: - - '0.013399' - strict-transport-security: - - max-age=15768000 - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Thu, 23 Jun 2016 20:46:07 GMT -recorded_with: VCR 3.0.3 diff --git a/lib/chartmogul/api/actions/custom.rb b/lib/chartmogul/api/actions/custom.rb index 433a43a..9d0369d 100644 --- a/lib/chartmogul/api/actions/custom.rb +++ b/lib/chartmogul/api/actions/custom.rb @@ -25,7 +25,8 @@ def custom_without_assign!(http_method, http_path, body_data = {}) req.body = JSON.dump(body_data) end end - ChartMogul::Utils::JSONParser.parse(resp.body, immutable_keys: immutable_keys) + parsed_body = resp.body.empty? ? '{}' : resp.body + ChartMogul::Utils::JSONParser.parse(parsed_body, immutable_keys: immutable_keys) end def custom!(http_method, http_path, body_data = {}) diff --git a/lib/chartmogul/concerns/pageable_with_cursor.rb b/lib/chartmogul/concerns/pageable_with_cursor.rb index bfda5b1..4f11f4c 100644 --- a/lib/chartmogul/concerns/pageable_with_cursor.rb +++ b/lib/chartmogul/concerns/pageable_with_cursor.rb @@ -9,6 +9,10 @@ def self.included(base) readonly_attr :cursor end end + + def next(options = {}) + self.class.all(options.merge(cursor: cursor)) + end end end end diff --git a/lib/chartmogul/contact.rb b/lib/chartmogul/contact.rb index d5408a7..25a5b11 100644 --- a/lib/chartmogul/contact.rb +++ b/lib/chartmogul/contact.rb @@ -34,6 +34,7 @@ def self.all(options = {}) def self.merge!(into_uuid:, from_uuid:) custom!(:post, "/v1/contacts/#{into_uuid}/merge/#{from_uuid}") + true end def serialize_for_write @@ -61,9 +62,5 @@ class Contacts < APIResource include Concerns::PageableWithCursor set_entry_class Contact - - def next(options = {}) - Contacts.all(options.merge(cursor: cursor)) - end end end diff --git a/lib/chartmogul/customer.rb b/lib/chartmogul/customer.rb index b9f8b7c..e18ef53 100644 --- a/lib/chartmogul/customer.rb +++ b/lib/chartmogul/customer.rb @@ -34,6 +34,8 @@ class Customer < APIResource writeable_attr :data_source_uuid writeable_attr :lead_created_at, type: :time writeable_attr :free_trial_started_at, type: :time + writeable_attr :owner + writeable_attr :primary_contact include API::Actions::Create include API::Actions::Custom @@ -53,6 +55,15 @@ def self.find_by_external_id(external_id) all(external_id: external_id).first end + def self.merge!(into_uuid:, from_uuid:) + options = { + from: { customer_uuid: from_uuid }, + into: { customer_uuid: into_uuid } + } + custom!(:post, '/v1/customers/merges', options) + true + end + def subscriptions(options = {}) @subscriptions ||= ChartMogul::Subscription.all(uuid, options) end @@ -109,7 +120,7 @@ def update_custom_attributes!(custom_attrs = {}) def remove_custom_attributes!(*custom_attrs) self.custom_attributes = custom_without_assign!(:delete, "/v1/customers/#{uuid}/attributes/custom", - custom: custom_attrs)[:custom] + custom: custom_attrs) end def merge_into!(other_customer) @@ -146,6 +157,7 @@ class Customers < APIResource include API::Actions::Custom include Concerns::Pageable include Concerns::Pageable2 + include Concerns::PageableWithCursor set_entry_class Customer diff --git a/lib/chartmogul/customer_invoices.rb b/lib/chartmogul/customer_invoices.rb index b2f5e48..193a25b 100644 --- a/lib/chartmogul/customer_invoices.rb +++ b/lib/chartmogul/customer_invoices.rb @@ -17,6 +17,7 @@ class CustomerInvoices < APIResource include API::Actions::All include API::Actions::Create include Concerns::Pageable2 + include Concerns::PageableWithCursor def serialize_invoices map(&:serialize_for_write) @@ -26,6 +27,10 @@ def self.all(customer_uuid, options = {}) super(options.merge(customer_uuid: customer_uuid)) end + def next(options = {}) + CustomerInvoices.all(customer_uuid, options.merge(cursor: cursor)) + end + def self.destroy_all!(data_source_uuid, customer_uuid) path = ChartMogul::ResourcePath.new('v1/data_sources/:data_source_uuid/customers/:customer_uuid/invoices') handling_errors do @@ -34,7 +39,6 @@ def self.destroy_all!(data_source_uuid, customer_uuid) true end - def_delegators :invoices, :each, :[], :<<, :size, :length, :empty?, :first private diff --git a/lib/chartmogul/enrichment/customer.rb b/lib/chartmogul/enrichment/customer.rb index 5d8f4cf..e8b3f21 100644 --- a/lib/chartmogul/enrichment/customer.rb +++ b/lib/chartmogul/enrichment/customer.rb @@ -120,6 +120,7 @@ class Customers < APIResource include Concerns::Entries include API::Actions::Custom include Concerns::Pageable + include Concerns::PageableWithCursor set_entry_class DeprecatedCustomer diff --git a/lib/chartmogul/invoice.rb b/lib/chartmogul/invoice.rb index 76e0a86..3b488a8 100644 --- a/lib/chartmogul/invoice.rb +++ b/lib/chartmogul/invoice.rb @@ -83,6 +83,7 @@ class Invoices < APIResource include Concerns::Entries include Concerns::Pageable2 + include Concerns::PageableWithCursor set_entry_class Invoice end diff --git a/lib/chartmogul/metrics/activity.rb b/lib/chartmogul/metrics/activity.rb index 966982b..a076f42 100644 --- a/lib/chartmogul/metrics/activity.rb +++ b/lib/chartmogul/metrics/activity.rb @@ -29,12 +29,9 @@ class Activities < APIResource include Concerns::Entries include Concerns::PageableWithAnchor + include Concerns::PageableWithCursor set_entry_class Activity - - def self.all(options = {}) - super(options) - end end end end diff --git a/lib/chartmogul/metrics/customers/activity.rb b/lib/chartmogul/metrics/customers/activity.rb index f479550..3d4157e 100644 --- a/lib/chartmogul/metrics/customers/activity.rb +++ b/lib/chartmogul/metrics/customers/activity.rb @@ -26,12 +26,17 @@ class Activities < APIResource include Concerns::Entries include Concerns::Pageable + include Concerns::PageableWithCursor set_entry_class Activity def self.all(customer_uuid, options = {}) super(options.merge(customer_uuid: customer_uuid)) end + + def next(customer_uuid, options = {}) + Activities.all(customer_uuid, options.merge(cursor: cursor)) + end end end end diff --git a/lib/chartmogul/metrics/customers/subscription.rb b/lib/chartmogul/metrics/customers/subscription.rb index 8d95c0a..d498beb 100644 --- a/lib/chartmogul/metrics/customers/subscription.rb +++ b/lib/chartmogul/metrics/customers/subscription.rb @@ -29,12 +29,17 @@ class Subscriptions < APIResource include Concerns::Entries include Concerns::Pageable + include Concerns::PageableWithCursor set_entry_class Subscription def self.all(customer_uuid, options = {}) super(options.merge(customer_uuid: customer_uuid)) end + + def next(customer_uuid, options = {}) + Subscriptions.all(customer_uuid, options.merge(cursor: cursor)) + end end end end diff --git a/lib/chartmogul/plan.rb b/lib/chartmogul/plan.rb index 7195bc5..a12e07d 100644 --- a/lib/chartmogul/plan.rb +++ b/lib/chartmogul/plan.rb @@ -33,6 +33,7 @@ class Plans < APIResource include Concerns::Entries include Concerns::Pageable2 + include Concerns::PageableWithCursor set_entry_class Plan end diff --git a/lib/chartmogul/plan_group.rb b/lib/chartmogul/plan_group.rb index fb9e244..cc92655 100644 --- a/lib/chartmogul/plan_group.rb +++ b/lib/chartmogul/plan_group.rb @@ -32,6 +32,7 @@ class PlanGroups < APIResource include Concerns::Entries include Concerns::Pageable2 + include Concerns::PageableWithCursor set_entry_class PlanGroup end diff --git a/lib/chartmogul/plan_groups/plans.rb b/lib/chartmogul/plan_groups/plans.rb index b45af99..ca008cf 100644 --- a/lib/chartmogul/plan_groups/plans.rb +++ b/lib/chartmogul/plan_groups/plans.rb @@ -10,8 +10,19 @@ class Plans < APIResource include Concerns::Entries include Concerns::Pageable2 + include Concerns::PageableWithCursor + include API::Actions::Custom set_entry_class Plan + + def self.all(plan_group_uuid, options = {}) + super(options.merge(plan_group_uuid: plan_group_uuid)) + end + + def next(plan_group_uuid, options = {}) + path = ChartMogul::ResourcePath.new("/v1/plan_groups/#{plan_group_uuid}/plans") + custom!(:get, path.apply_with_get_params(options.merge(cursor: cursor))) + end end end end diff --git a/lib/chartmogul/subscription.rb b/lib/chartmogul/subscription.rb index f774bfb..a56d45a 100644 --- a/lib/chartmogul/subscription.rb +++ b/lib/chartmogul/subscription.rb @@ -55,11 +55,16 @@ class Subscriptions < APIResource include Concerns::Entries include Concerns::Pageable2 + include Concerns::PageableWithCursor set_entry_class Subscription def self.all(customer_uuid, options = {}) super(options.merge(customer_uuid: customer_uuid)) end + + def next(customer_uuid, options = {}) + Subscriptions.all(customer_uuid, options.merge(cursor: cursor)) + end end end diff --git a/lib/chartmogul/subscription_event.rb b/lib/chartmogul/subscription_event.rb index 4e7ce7d..e979d7b 100644 --- a/lib/chartmogul/subscription_event.rb +++ b/lib/chartmogul/subscription_event.rb @@ -72,6 +72,7 @@ class SubscriptionEvents < APIResource include API::Actions::All include Concerns::Entries + include Concerns::PageableWithCursor set_entry_class SubscriptionEvent end diff --git a/lib/chartmogul/version.rb b/lib/chartmogul/version.rb index cdf3e73..e066fdb 100644 --- a/lib/chartmogul/version.rb +++ b/lib/chartmogul/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ChartMogul - VERSION = '3.3.0' + VERSION = '3.3.1' end diff --git a/spec/chartmogul/account_spec.rb b/spec/chartmogul/account_spec.rb index 461379b..b83f085 100644 --- a/spec/chartmogul/account_spec.rb +++ b/spec/chartmogul/account_spec.rb @@ -10,20 +10,13 @@ let(:account) { ChartMogul::Account.retrieve } - it 'returns the name of current account', uses_api: true do - expect(account.name).to eq('Example Test Company') - end - - it 'returns the currency of current account', uses_api: true do - expect(account.currency).to eq('EUR') - end - - it 'returns the time zone of current account', uses_api: true do - expect(account.time_zone).to eq('Europe/Berlin') - end - - it 'returns the week_start_on of current account', uses_api: true do - expect(account.week_start_on).to eq('sunday') + it 'returns the right account attributes' do + expect(account).to have_attributes( + name: 'Example Test Company', + currency: 'EUR', + time_zone: 'Europe/Berlin', + week_start_on: 'sunday' + ) end end end diff --git a/spec/chartmogul/contact_spec.rb b/spec/chartmogul/contact_spec.rb index 1577f86..0008dda 100644 --- a/spec/chartmogul/contact_spec.rb +++ b/spec/chartmogul/contact_spec.rb @@ -5,15 +5,15 @@ describe ChartMogul::Contact do let(:attrs) do { - uuid: 'con_00000000-0000-0000-0000-000000000000', - customer_uuid: 'cus_00000000-0000-0000-0000-000000000000', - data_source_uuid: 'ds_00000000-0000-0000-0000-000000000000', - customer_external_id: 'external_001', + uuid: contact_uuid, + customer_uuid: customer_uuid, + data_source_uuid: data_source_uuid, + customer_external_id: 'cus_004', first_name: 'First name', last_name: 'Last name', position: 9, - title: 'Title', - email: 'test@example.com', + title: 'CEO', + email: 'contact@example.com', phone: '+1234567890', linked_in: 'https://linkedin.com/not_found', twitter: 'https://twitter.com/not_found', @@ -24,6 +24,26 @@ } } end + let(:contact_uuid) { 'con_36399f04-7686-11ee-86f6-8727560009c2' } + let(:customer_uuid) { 'cus_23e01538-2c7e-11ee-b2ce-fb986e96e21b' } + let(:data_source_uuid) { 'ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46' } + let(:updated_attributes) do + { + first_name: 'Foo', + last_name: 'Bar', + email: 'contact2@example.com', + title: 'CTO', + position: 9, + phone: '+9876543210', + linked_in: 'https://linkedin.com/about', + twitter: 'https://twitter.com/about', + custom: { Toggle: false } + } + end + let(:cursor) do + 'MjAyMy0xMC0yOVQxODowODo1MC4yNDQ4NzUwMDBaJmNvbl8z'\ + 'NjM5OWYwNC03Njg2LTExZWUtODZmNi04NzI3NTYwMDA5YzI=' + end describe '#initialize' do subject { described_class.new(attrs) } @@ -32,25 +52,9 @@ expect(subject).to have_attributes({ uuid: nil }) end + # We can't use `.except` here because we still support Ruby 2.6 and 2.7 it 'sets the writeable properties correctly' do - expect(subject).to have_attributes({ - customer_uuid: 'cus_00000000-0000-0000-0000-000000000000', - data_source_uuid: 'ds_00000000-0000-0000-0000-000000000000', - customer_external_id: 'external_001', - first_name: 'First name', - last_name: 'Last name', - position: 9, - title: 'Title', - email: 'test@example.com', - phone: '+1234567890', - linked_in: 'https://linkedin.com/not_found', - twitter: 'https://twitter.com/not_found', - notes: 'Heading\nBody\nFooter', - custom: { - MyStringAttribute: 'Test', - MyIntegerAttribute: 123, - } - }) + expect(subject).to have_attributes(attrs.reject { |k, _| k == :uuid }) end end @@ -62,91 +66,102 @@ end end - describe 'API Interactions', vcr: true do - it 'creates contact correctly', uses_api: true do - ds = ChartMogul::DataSource.create!(name: 'Customer Test Data Source') - customer = ChartMogul::Customer.create!( - name: 'Test Customer', - external_id: 'X1234', - data_source_uuid: ds.uuid, - email: 'test@example.com', - ) - contact = described_class.create!( - customer_uuid: customer.uuid, - data_source_uuid: ds.uuid, - email: 'test@example.com' - ) + describe 'API Actions', uses_api: true, vcr: true do + it 'retrieves the contact correctly' do + contact = described_class.retrieve(contact_uuid) - retrieved_contact = described_class.retrieve(contact.uuid) - expect(retrieved_contact.uuid).to be_a_kind_of(String) - expect(retrieved_contact.customer_uuid).to eq(customer.uuid) - expect(retrieved_contact.data_source_uuid).to eq(ds.uuid) - expect(retrieved_contact.email).to eq('test@example.com') + expect(contact).to have_attributes( + uuid: contact_uuid, + customer_uuid: customer_uuid, + data_source_uuid: data_source_uuid, + email: 'contact@example.com' + ) end - it 'updates contact correctly', uses_api: true do - contact_id = 'con_8305e66c-bf2f-11ed-a4cb-db537410c51b' - contact = described_class.retrieve(contact_id) - - contact.first_name = 'Foo' - contact.last_name = 'Bar' - contact.email = 'test2@example.com' - contact.title = 'CTO' - contact.position = 9 - contact.phone = '+9876543210' - contact.linked_in = 'https://linkedin.com/about' - contact.twitter = 'https://twitter.com/about' - contact.custom = { Toggle: false } - - contact.update! - - updated_contact = described_class.retrieve(contact_id) - expect(updated_contact.first_name).to eq 'Foo' - expect(updated_contact.last_name).to eq 'Bar' - expect(updated_contact.email).to eq 'test2@example.com' - expect(updated_contact.title).to eq 'CTO' - expect(updated_contact.position).to eq 9 - expect(updated_contact.phone).to eq '+9876543210' - expect(updated_contact.linked_in).to eq 'https://linkedin.com/about' - expect(updated_contact.twitter).to eq 'https://twitter.com/about' - expect(updated_contact.custom).to eq ({ Toggle: false }) + it 'creates the contact correctly' do + attributes = { + customer_uuid: customer_uuid, + data_source_uuid: data_source_uuid, + email: 'contact@example.com' + } + contact = described_class.create!(**attributes) + expect(contact).to have_attributes(uuid: contact_uuid, **attributes) end - it 'destroys contact correctly', uses_api: true do - contact_id = 'con_e2894d28-9189-11ed-8100-ffadd676801d' - contact = described_class.retrieve(contact_id) - contact.destroy! + it 'updates the contact correctly with the class method' do + updated_contact = described_class.update!( + contact_uuid, **updated_attributes + ) - expect do - described_class.retrieve(contact_id) - end.to raise_error(ChartMogul::NotFoundError) + expect(updated_contact).to have_attributes( + uuid: contact_uuid, + data_source_uuid: data_source_uuid, + customer_uuid: customer_uuid, + **updated_attributes + ) end - it 'merges contact correctly', uses_api: true do - into_uuid = 'con_f4ef7c64-bf27-11ed-92ad-a7d034bf3085' - from_uuid = 'con_33dd5606-bf2a-11ed-a7d0-17036209bd22' - contact_into = described_class.retrieve(into_uuid) - contact_from = described_class.retrieve(from_uuid) + it 'destroys the contact correctly' do + uuid_to_delete = 'con_ab1e60d4-7690-11ee-84d7-f7e55168a5df' + deleted_contact = described_class.destroy!(uuid: uuid_to_delete) + expect(deleted_contact).to eq(true) + end - expect(contact_into.notes).to eq('Hello') - expect(contact_from.notes).to eq('World') + it 'merges contacts correctly' do + into_uuid = contact_uuid + from_uuid = 'con_6f0b7208-7690-11ee-8857-9f75f1321afd' - contact_result = described_class.merge!(into_uuid: into_uuid, from_uuid: from_uuid) - expect(contact_result.notes).to eq('Hello World') + contact_result = described_class.merge!( + into_uuid: into_uuid, from_uuid: from_uuid + ) + expect(contact_result).to eq(true) end - it 'paginates correctly', uses_api: true do - all_contacts = ChartMogul::Contacts.all - expect(all_contacts.has_more).to be(false) - expect(all_contacts.map(&:first_name)).to match_array(%w[contact1 contact2 contact3 contact4 contact5]) - - contacts = ChartMogul::Contacts.all(per_page: 3) - expect(contacts.has_more).to be(true) - expect(contacts.map(&:first_name)).to match_array(%w[contact1 contact2 contact3]) + context 'with old pagination' do + it 'paginates correctly' do + contacts = ChartMogul::Contacts.all(per_page: 1, page: 3) + expect(contacts.size).to eq(1) + expect(contacts).to have_attributes( + cursor: cursor, + has_more: true + ) + expect(contacts.first).to have_attributes( + uuid: 'con_36399f04-7686-11ee-86f6-8727560009c2' + ) + end + end - contacts = contacts.next(per_page: 3) - expect(contacts.has_more).to be(false) - expect(contacts.map(&:first_name)).to match_array(%w[contact4 contact5]) + context 'with new pagination' do + let(:first_cursor) do + 'MjAyMy0xMC0yOVQxODowODo1MC4yNDQ4NzUwMDBaJmNvbl8z'\ + 'NjM5OWYwNC03Njg2LTExZWUtODZmNi04NzI3NTYwMDA5YzI=' + end + let(:next_cursor) do + 'MjAyMy0xMC0yN1QwODowMDoyMS41MTQwMzcwMDBaJmNvbl9l'\ + 'MDdmYzM1Ni03NDllLTExZWUtYmQ0MC05ZmNiMDdmNGFlZGE=' + end + + it 'paginates correctly' do + contacts = ChartMogul::Contact.all(per_page: 1) + expect(contacts).to have_attributes( + cursor: first_cursor, + has_more: true, + size: 1 + ) + expect(contacts.first).to have_attributes( + uuid: 'con_36399f04-7686-11ee-86f6-8727560009c2' + ) + + next_contacts = contacts.next(per_page: 1) + expect(next_contacts).to have_attributes( + cursor: next_cursor, + has_more: true, + size: 1 + ) + expect(next_contacts.first).to have_attributes( + uuid: 'con_e07fc356-749e-11ee-bd40-9fcb07f4aeda' + ) + end end end end diff --git a/spec/chartmogul/customer_invoices_spec.rb b/spec/chartmogul/customer_invoices_spec.rb index 1ea877b..b218c78 100644 --- a/spec/chartmogul/customer_invoices_spec.rb +++ b/spec/chartmogul/customer_invoices_spec.rb @@ -205,22 +205,11 @@ end end - describe 'API Interactions', vcr: true do - it 'correctly interracts with the API', uses_api: true do - data_source = ChartMogul::DataSource.new( - name: 'Customer Invoices Test Data Source' - ).create! - - customer = ChartMogul::Customer.new( - name: 'Test Customer', external_id: 'test_cus_ext_id', - data_source_uuid: data_source.uuid, email: 'test@customer.com', - city: 'Berlin', country: 'DE' - ).create! - - plan = ChartMogul::Plan.new( - data_source_uuid: data_source.uuid, name: 'Test Plan', - interval_count: 7, interval_unit: 'day', external_id: 'test_cus_pl_ext_id' - ).create! + describe 'API Actions', uses_api: true, vcr: true do + it 'creates the customer invoice correctly' do + data_source = ChartMogul::DataSource.retrieve('ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46') + customer = ChartMogul::Customer.retrieve('cus_23551596-2c7e-11ee-9ea1-2bfe193640c0') + plan = ChartMogul::Plan.retrieve('pl_de9e281e-76cb-11ee-b63f-b727630ce4d4') line_item = ChartMogul::LineItems::Subscription.new( subscription_external_id: 'test_cus_sub_ext_id', @@ -244,21 +233,69 @@ invoice = ChartMogul::Invoice.new( date: Time.utc(2016, 1, 1, 12), currency: 'USD', - external_id: 'test_cus_inv_ext_id', + external_id: 'test_cus_inv_ext_id_1', due_date: Time.utc(2016, 1, 7, 12), - customer_external_id: customer.external_id + customer_external_id: customer.external_id, + data_source_uuid: data_source.uuid ) invoice.line_items << line_item invoice.transactions << transaction - customer.invoices << invoice - customer.invoices.create! - expect(customer.invoices[0].line_items.first.subscription_uuid).to be_truthy + customer_invoices = customer.invoices.create! + expect(customer_invoices.size).to eq(1) + expect(customer_invoices[0].line_items.size).to eq(1) + expect(customer_invoices[0].transactions.size).to eq(1) + end - ChartMogul::CustomerInvoices.destroy_all!(data_source.uuid, customer.uuid) + it 'destroys all customer invoices correctly' do + deleted_invoices = described_class.destroy_all!( + 'ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46', + 'cus_23551596-2c7e-11ee-9ea1-2bfe193640c0' + ) + expect(deleted_invoices).to eq(true) + end - data_source.destroy! + context 'with old pagination' do + it 'paginates correctly' do + invoices = ChartMogul::CustomerInvoices.all( + 'cus_23551596-2c7e-11ee-9ea1-2bfe193640c0', + per_page: 1, page: 1 + ) + expect(invoices.size).to eq(1) + expect(invoices).to have_attributes( + cursor: nil, current_page: 1, total_pages: 1, has_more: nil + ) + expect(invoices.first).to have_attributes( + uuid: 'inv_d54e1b96-15a6-4491-979a-595530b1a55d' + ) + end + end + + context 'with new pagination' do + let(:cursor) do + 'MjAyMy0xMC0zMFQwMjo1ODo0MS4yNzkyNzIwMDBaJmludl8'\ + '4YWI3NDYxNC00ZTYyLTQ5ZjYtYjRiMy1mNzc5MTA5ZTUwZDA=' + end + + it 'paginates correctly' do + invoices = ChartMogul::CustomerInvoices.all( + 'cus_23551596-2c7e-11ee-9ea1-2bfe193640c0', per_page: 1 + ) + expect(invoices.size).to eq(1) + expect(invoices).to have_attributes( + cursor: cursor, current_page: 1, + total_pages: 1, has_more: false + ) + expect(invoices.first).to have_attributes( + uuid: 'inv_8ab74614-4e62-49f6-b4b3-f779109e50d0' + ) + + next_invoices = invoices.next(per_page: 1) + expect(next_invoices).to have_attributes( + cursor: nil, has_more: false, size: 0 + ) + end end end end diff --git a/spec/chartmogul/customer_spec.rb b/spec/chartmogul/customer_spec.rb index 40409a8..45d1b47 100644 --- a/spec/chartmogul/customer_spec.rb +++ b/spec/chartmogul/customer_spec.rb @@ -5,364 +5,383 @@ describe ChartMogul::Customer do let(:attrs) do { - uuid: 'cus_adcd3-12345-123345', - data_source_uuid: 'ds_123456', + uuid: 'cus_23740208-2c7e-11ee-9ea2-ffd2435982bb', + data_source_uuid: 'ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46', name: 'Test Customer', - external_id: 'X1234', + email: 'customer@example.com', + company: 'ChartMogul', + external_id: 'cus_001', city: 'Berlin', state: 'BE', country: 'DE', zip: '10115', + status: 'Active', lead_created_at: Time.utc(2016, 10, 1).to_s, - free_trial_started_at: Time.utc(2016, 10, 2).to_s + free_trial_started_at: Time.utc(2016, 10, 2).to_s, + owner: 'owner@chartmogul.com', + custom: { Toggle: false } } end + let(:customer_uuid) { 'cus_23e01538-2c7e-11ee-b2ce-fb986e96e21b' } + let(:data_source_uuid) { 'ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46' } describe '#initialize' do subject { described_class.new(attrs) } - it 'doesnt set the uuid attribute' do - expect(subject.uuid).to be_nil + it 'sets the right attributes' do + expect(subject).to have_attributes( + uuid: nil, + data_source_uuid: 'ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46', + name: 'Test Customer', + email: 'customer@example.com', + company: 'ChartMogul', + external_id: 'cus_001', + country: 'DE', + state: 'BE', + city: 'Berlin', + zip: '10115', + lead_created_at: Time.utc(2016, 10, 1).to_s, + free_trial_started_at: Time.utc(2016, 10, 2).to_s, + owner: 'owner@chartmogul.com', + status: nil + ) end + end - it 'sets the name attribute' do - expect(subject.name).to eq('Test Customer') - end + describe '.new_from_json' do + subject { described_class.new_from_json(attrs) } - it 'sets the data_source_uuid attribute' do - expect(subject.data_source_uuid).to eq('ds_123456') + it 'sets the right attributes' do + expect(subject).to have_attributes( + uuid: 'cus_23740208-2c7e-11ee-9ea2-ffd2435982bb', + data_source_uuid: 'ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46', + name: 'Test Customer', + email: 'customer@example.com', + company: 'ChartMogul', + external_id: 'cus_001', + country: 'DE', + state: 'BE', + city: 'Berlin', + zip: '10115', + lead_created_at: Time.utc(2016, 10, 1), + free_trial_started_at: Time.utc(2016, 10, 2), + owner: 'owner@chartmogul.com', + status: 'Active' + ) end + end - it 'sets the external_id attribute' do - expect(subject.external_id).to eq('X1234') + describe '.find_by_external_id', uses_api: true, vcr: true do + it 'returns matching user if exists' do + result = ChartMogul::Customer.find_by_external_id('test_cus_ext_id') + expect(result.external_id).to eq('test_cus_ext_id') end - it 'sets the city attribute' do - expect(subject.city).to eq('Berlin') + it 'returns nil if customer does not exist' do + result = ChartMogul::Customer.find_by_external_id('unknown') + expect(result).to be_nil end + end - it 'sets the state attribute' do - expect(subject.state).to eq('BE') - end + describe 'API Actions', uses_api: true, vcr: true do + let(:lead_created_at) { Time.utc(2015, 11, 1) } + let(:free_trial_started_at) { Time.utc(2015, 11, 17, 01, 20) } - it 'sets the country attribute' do - expect(subject.country).to eq('DE') - end - it 'sets the zip attribute' do - expect(subject.zip).to eq('10115') - end + it 'retrieves the customer correctly' do + customer = described_class.retrieve(customer_uuid) - it 'sets the lead_created_at attribute' do - expect(subject.lead_created_at).to eq(Time.utc(2016, 10, 1).to_s) + expect(customer).to have_attributes( + uuid: customer_uuid, + data_source_uuid: data_source_uuid, + email: 'customer@example.com', + external_id: 'cus_004' + ) end - it 'sets the free_trial_started_at attribute' do - expect(subject.free_trial_started_at).to eq(Time.utc(2016, 10, 2).to_s) + it 'creates the customer correctly' do + attributes = { + data_source_uuid: data_source_uuid, + external_id: 'cus_007', + name: 'New Customer', + email: 'new_customer@example.com', + owner: 'bruno+chartmogultest@chartmogul.com', + city: 'Berlin' + } + customer = described_class.create!(**attributes) + expect(customer).to have_attributes( + uuid: 'cus_a4680a9c-76a4-11ee-83ab-d3b9aabc7f00', **attributes + ) end - end - describe '.new_from_json' do - subject { described_class.new_from_json(attrs) } + it 'updates the customer correctly with the instance method' do + customer_uuid = 'cus_a4680a9c-76a4-11ee-83ab-d3b9aabc7f00' + customer = described_class.retrieve(customer_uuid) - it 'sets the uuid attribute' do - expect(subject.uuid).to eq('cus_adcd3-12345-123345') - end + customer.name = 'Currywurst' + customer.email = 'curry@wurst.com' + customer.company = 'Curry 36' + customer.country = 'DE' + customer.state = 'NY' + customer.city = 'Berlin' + customer.lead_created_at = Time.utc(2016, 1, 1, 14, 30) + customer.free_trial_started_at = Time.utc(2016, 2, 2, 22, 40) + customer.attributes = {}.tap do |att| + att[:tags] = [:wurst] + att[:custom] = { Toggle: true } + end - it 'sets the data_source_uuid attribute' do - expect(subject.data_source_uuid).to eq('ds_123456') + updated_customer = customer.update! + expect(updated_customer).to have_attributes( + name: 'Currywurst', + email: 'curry@wurst.com', + attributes: { + custom: { Toggle: true }, clearbit: {}, + tags: ["wurst"], stripe: {} + }, + company: 'Curry 36' + ) end - it 'sets the name attribute' do - expect(subject.name).to eq('Test Customer') - end + it 'updates customer correctly with the class method' do + customer_uuid = 'cus_a4680a9c-76a4-11ee-83ab-d3b9aabc7f00' - it 'sets the external_id attribute' do - expect(subject.external_id).to eq('X1234') - end + updated_customer = described_class.update!(customer_uuid, { + email: 'customer_test@example.com', + company: 'Curry 42', + attributes: { custom: { Toggle: true } }, + name: 'Test Customer' + }) - it 'sets the city attribute' do - expect(subject.city).to eq('Berlin') + expect(updated_customer).to have_attributes( + email: 'customer_test@example.com', + company: 'Curry 42', + name: 'Test Customer', + attributes: { + custom: { Toggle: true }, clearbit: {}, + tags: ["wurst"], stripe: {} + } + ) end - it 'sets the state attribute' do - expect(subject.state).to eq('BE') + it 'destroys the customer correctly' do + uuid_to_delete = 'cus_a4680a9c-76a4-11ee-83ab-d3b9aabc7f00' + deleted_customer = described_class.destroy!(uuid: uuid_to_delete) + expect(deleted_customer).to eq(true) end - it 'sets the country attribute' do - expect(subject.country).to eq('DE') - end + it 'merges customers correctly with the class method' do + from_uuid = 'cus_c10aa086-5298-11ee-82da-ebac6f7a03c3' + into_uuid = 'cus_23740208-2c7e-11ee-9ea2-ffd2435982bb' - it 'sets the zip attribute' do - expect(subject.zip).to eq('10115') + customer_result = described_class.merge!( + into_uuid: into_uuid, from_uuid: from_uuid + ) + expect(customer_result).to eq(true) end - it 'sets the lead_created_at attribute' do - expect(subject.lead_created_at).to eq(Time.utc(2016, 10, 1)) - end + it 'merges customers correctly with the instance method' do + from_uuid = 'cus_2706d304-76b7-11ee-93d6-5b3d820d37cd' + into_uuid = 'cus_23740208-2c7e-11ee-9ea2-ffd2435982bb' - it 'sets the free_trial_started_at attribute' do - expect(subject.free_trial_started_at).to eq(Time.utc(2016, 10, 2)) - end - end + into_customer = described_class.retrieve(into_uuid) + from_customer = described_class.retrieve(from_uuid) - describe '.find_by_external_id', vcr: true do - context 'when external_id is provided' do - it 'returns matching user if exists', uses_api: true do - result = ChartMogul::Customer.find_by_external_id('X1234') - expect(result).not_to be_nil - expect(result.external_id).to eq(attrs[:external_id]) + customer_result = from_customer.merge_into!(into_customer) + expect(customer_result).to eq(true) + end + + context 'with old pagination' do + it 'paginates correctly' do + customers = ChartMogul::Customers.all(per_page: 1, page: 3) + expect(customers.size).to eq(1) + expect(customers).to have_attributes( + cursor: nil, has_more: true, + page: 3, per_page: 1 + ) + expect(customers.first).to have_attributes( + uuid: 'cus_23551596-2c7e-11ee-9ea1-2bfe193640c0' + ) end - it 'returns nil if customer does not exist', uses_api: true do - result = ChartMogul::Customer.find_by_external_id('nope') - expect(result).to be_nil + it 'paginates the /search endpoint correctly' do + customers = described_class.search('gavin@example.com', page: 1, per_page: 1) + expect(customers.first.email).to eq('gavin@example.com') + expect(customers).to have_attributes( + cursor: nil, has_more: false, + page: 1, per_page: 1 + ) end end - end - - describe 'API Interactions', vcr: true do - let(:lead_created_at) { Time.utc(2016, 10, 1, 23, 55) } - let(:free_trial_started_at) { Time.utc(2016, 10, 12, 11, 12) } - - it 'correctly interracts with the API', uses_api: true do - ds = ChartMogul::DataSource.create!(name: 'Customer Test Data Source') - - customer = ChartMogul::Customer.create!( - name: 'Test Customer', - external_id: 'X1234', - data_source_uuid: ds.uuid, - email: 'test@example.com', - city: 'Berlin', - country: 'DE', - lead_created_at: lead_created_at.to_s, - free_trial_started_at: free_trial_started_at.to_s - ) - - customers = ChartMogul::Customer.all - expect(customers.current_page).to eq(1) - expect(customers.total_pages).to eq(1) - expect(customers.page).to eq(1) - expect(customers.per_page).to eq(200) - expect(customers.has_more).to eq(false) - expect(customers.size).to eq(1) - expect(customers[0].uuid).not_to be_nil - expect(customers[0].name).to eq('Test Customer') - expect(customers[0].external_id).to eq('X1234') - expect(customers[0].data_source_uuid).to eq(ds.uuid) - expect(customers[0].email).to eq('test@example.com') - expect(customers[0].city).to eq('Berlin') - expect(customers[0].country).to eq('DE') - expect(customers[0].lead_created_at).to eq(lead_created_at) - expect(customers[0].free_trial_started_at).to eq(free_trial_started_at) - expect(customers[0].billing_system_type).to eq('Import API') - - customer.destroy! - - customers = ChartMogul::Customer.all - - expect(customers.entries).to be_empty - end - it 'correctly handles a 422 response', uses_api: true do - expect { ChartMogul::Customer.create! }.to raise_error(ChartMogul::ResourceInvalidError) - end + context 'with new pagination' do + let(:first_cursor) do + 'MjAxNi0wMS0wMVQxMjowMDowMC4wMDAwMDAwMDBaJjExNDE2NzQ1MA==' + end + let(:next_cursor) do + 'MjAxNi0wMS0yNVQwMDowMDowMC4wMDAwMDAwMDBaJjExNDE2NzQ1MQ==' + end - it 'returns all customers through list all endpoint', uses_api: true do - customers = described_class.all(per_page: 10) - expect(customers).to be_any - end + it 'paginates correctly' do + customers = ChartMogul::Customer.all(per_page: 1) + expect(customers).to have_attributes( + cursor: first_cursor, + has_more: true, + page: 1, per_page: 1 + ) + expect(customers.first).to have_attributes( + uuid: 'cus_23740208-2c7e-11ee-9ea2-ffd2435982bb' + ) + + next_customers = customers.next(per_page: 1) + expect(next_customers).to have_attributes( + cursor: next_cursor, + has_more: true, + size: 1 + ) + expect(next_customers.first).to have_attributes( + uuid: 'cus_23c11cf0-2c7e-11ee-b2cd-fbfd681a34dd' + ) + end - it 'returns right customers through search endpoint', uses_api: true do - customers = described_class.search('adam@smith.com') - expect(customers.first.email).to eq('adam@smith.com') - expect(customers.has_more).to eq(false) - expect(customers.per_page).to eq(200) - expect(customers.page).to eq(1) + it 'paginates the /search endpoint correctly' do + customers = described_class.search('gavin@example.com', per_page: 1) + expect(customers.first.email).to eq('gavin@example.com') + expect(customers).to have_attributes( + cursor: 'MjAxNi0wMS0yNVQwMDowMDowMC4wMDAwMDAwMDBaJjExNDE2NzQ1MQ==', + has_more: false, page: 1, per_page: 1 + ) + end end - it 'can page through search endpoint', uses_api: true do - customers = described_class.search('adam@smith.com', page: 2, per_page: 1) - expect(customers.first.email).to eq('adam@smith.com') - expect(customers.has_more).to eq(false) - expect(customers.per_page).to eq(1) - expect(customers.page).to eq(2) + it 'searches for customers correctly' do + customers = described_class.search('gavin@example.com') + expect(customers.first.email).to eq('gavin@example.com') + expect(customers).to have_attributes( + cursor: 'MjAxNi0wMS0yNVQwMDowMDowMC4wMDAwMDAwMDBaJjExNDE2NzQ1MQ==', + has_more: false, + per_page: 200, + page: 1 + ) end - it 'raises 404 if no customers found', uses_api: true do + it 'raises a HTTP 404 if searching for customers does not find any' do expect { described_class.search('no@email.com') }.to raise_error(ChartMogul::NotFoundError) end - it 'returns customer through retrieve endpoint', uses_api: true do - customer = described_class.retrieve('cus_07393ece-aab1-4255-8bcd-0ef11e24b047') - expect(customer).to be - end - - it 'adds required tags', uses_api: true do - customer = described_class.retrieve('cus_07393ece-aab1-4255-8bcd-0ef11e24b047') - customer.add_tags!('example', 'another-tag') - expect(customer.tags).to match_array(%w[example another-tag]) + it 'adds tags correctly' do + attrs[:attributes] = { + tags: ["auto-churned-delinquent-subscription", "merged-customer"], + custom: {} + } + customer = described_class.new_from_json(attrs) + updated_tags = customer.add_tags!('test-tag') + expect(updated_tags).to eq( + ["auto-churned-delinquent-subscription", "merged-customer", "test-tag"] + ) end - it 'removes tags', uses_api: true do - customer = described_class.retrieve('cus_07393ece-aab1-4255-8bcd-0ef11e24b047') - customer.remove_tags!('example') - expect(customer.tags).to match_array(['another-tag']) + it 'removes tags correctly' do + attrs[:attributes] = { + tags: ["auto-churned-delinquent-subscription", "merged-customer", "test-tag"], + custom: {} + } + customer = described_class.new_from_json(attrs) + updated_tags = customer.remove_tags!('test-tag') + expect(updated_tags).to eq(["auto-churned-delinquent-subscription", "merged-customer"]) end - it 'adds custom attributes', uses_api: true do - customer = described_class.retrieve('cus_07393ece-aab1-4255-8bcd-0ef11e24b047') - customer.add_custom_attributes!( + it 'adds custom attributes correctly' do + attrs[:attributes] = { tags: [], custom: {} } + customer = described_class.new_from_json(attrs) + updated_attributes = customer.add_custom_attributes!( { type: 'String', key: 'StringKey', value: 'String Value' }, { type: 'Integer', key: 'integer_key', value: 1234 }, - { type: 'Timestamp', key: 'timestamp_key', value: Time.utc(2016, 0o1, 31) }, - type: 'Boolean', key: 'boolean_key', value: true + { type: 'Timestamp', key: 'timestamp_key', value: Time.utc(2016, 1, 31) }, + { type: 'Boolean', key: 'boolean_key', value: true } ) - expect(customer.custom_attributes).to eq( + expect(updated_attributes).to eq( StringKey: 'String Value', integer_key: 1234, - timestamp_key: Time.utc(2016, 0o1, 31), + timestamp_key: '2016-01-31T00:00:00.000Z', boolean_key: true ) end - it 'updates custom attributes', uses_api: true do - customer = described_class.retrieve('cus_07393ece-aab1-4255-8bcd-0ef11e24b047') - customer.update_custom_attributes!( + it 'updates custom attributes correctly' do + attrs[:attributes] = { + tags: [], + custom: { + StringKey: 'String Value', + integer_key: 1234, + timestamp_key: '2016-01-31T00:00:00.000Z', + boolean_key: true + } + } + customer = described_class.new_from_json(attrs) + updated_attributes = customer.update_custom_attributes!( StringKey: 'Another String Value', integer_key: 5678, - timestamp_key: Time.utc(2016, 0o2, 1), - boolean_key: false + timestamp_key: Time.utc(2016, 2, 1), + boolean_key: false, + Toggle: false ) - expect(customer.custom_attributes).to eq( + expect(updated_attributes).to eq( StringKey: 'Another String Value', integer_key: 5678, - timestamp_key: Time.utc(2016, 0o2, 1), - boolean_key: false + timestamp_key: '2016-02-01T00:00:00.000Z', + boolean_key: false, + Toggle: false ) end - it 'respects camel case for all customers endpoint', uses_api: true do - customer_with_camel_case = described_class.all(per_page: 10).first - - expect(customer_with_camel_case.custom_attributes.key?(:String_key)).to be true - end - - it 'removes custom attributes', uses_api: true do - customer = described_class.retrieve('cus_07393ece-aab1-4255-8bcd-0ef11e24b047') - customer.remove_custom_attributes!(:string_key, :integer_key, :timestamp_key, :boolean_key) - expect(customer.custom_attributes).to eq({}) - end - - it 'merges customers', uses_api: true do - from_uuid = 'cus_35da5436-a730-11e6-a5a0-d32f2a781b50' - into_uuid = 'cus_fc5451ee-a72f-11e6-9019-3b1a0ecf3c73' - - from_customer = described_class.retrieve(from_uuid) - into_customer = described_class.retrieve(into_uuid) - - expect(from_customer.merge_into!(into_customer)).to eq(true) - - expect do - described_class.retrieve(from_uuid) - end.to raise_error ChartMogul::NotFoundError - - merged_customer = described_class.retrieve(into_uuid) - expect(merged_customer.attributes[:tags]).to eq ['merged-customer'] - end - - it 'updates customer', uses_api: true do - customer_uuid = 'cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e' - customer = described_class.retrieve(customer_uuid) - - customer.name = 'Currywurst' - customer.email = 'curry@wurst.com' - customer.company = 'Curry 36' - customer.country = 'DE' - customer.state = 'NY' - customer.city = 'Berlin' - customer.lead_created_at = Time.utc(2016, 1, 1, 14, 30) - customer.free_trial_started_at = Time.utc(2016, 2, 2, 22, 40) - customer.attributes[:tags] = [:wurst] - customer.attributes[:custom][:meinung] = [:lecker] - - customer.update! - - updated_customer = described_class.retrieve(customer_uuid) - expect(updated_customer.name).to eq 'Currywurst' - expect(updated_customer.email).to eq 'curry@wurst.com' - expect(updated_customer.address).to eq(country: 'Germany', state: 'New York', city: 'Berlin', address_zip: nil) - expect(updated_customer.attributes[:tags]).to eq ['wurst'] - expect(updated_customer.attributes[:custom][:meinung]).to eq ['lecker'] - end - - it 'updates customer using class method', uses_api: true, match_requests_on: [:method, :uri, :body] do - customer_uuid = 'cus_a29bbcb6-43ed-11e9-9bff-a3a747d175b1' - - updated_customer = described_class.update!(customer_uuid, { - email: 'curry@example.com', - company: 'Curry 42', - country: 'IN', - state: 'NY', - city: 'Berlin', - free_trial_started_at: Time.utc(2020, 2, 2, 22, 40), - attributes: { - custom: { - company_size: 'just me' - }, - tags: ['foobar'] + it 'removes custom attributes correctly' do + attrs[:attributes] = { + tags: [], + custom: { + StringKey: 'Another String Value', + integer_key: 5678, + timestamp_key: '2016-02-01T00:00:00.000Z', + boolean_key: false } - }) - - expect(updated_customer.uuid).to eq customer_uuid - expect(updated_customer.name).to eq 'Currywurst' - expect(updated_customer.email).to eq 'curry@example.com' - expect(updated_customer.address).to eq(country: 'India', state: 'New York', city: 'Berlin', address_zip: nil) - expect(updated_customer.attributes[:tags]).to eq ['foobar'] - expect(updated_customer.attributes[:custom][:company_size]).to eq 'just me' - end - - it 'raises 422 for update with invalid data', uses_api: true do - customer_uuid = 'cus_782b0716-a728-11e6-8eab-a7d0e8cd5c1e' - customer = described_class.retrieve(customer_uuid) - - customer.email = 'schnitzel.com' - - error_message = "The Customer could not be created or updated. (HTTP Status: 422)\n"\ - 'Response: {"code":422,"message":"The value provided does not appear to be '\ - 'a valid email address.","param":"email"}' - - expect do - customer.update! - end.to raise_error(ChartMogul::ResourceInvalidError, error_message) - end - - it 'raises 401 if invalid credentials', uses_api: true do - error_message = "No valid API key provided (HTTP Status: 401)\n"\ - 'Response: {"code":401,"message":"No valid API key provided","param":null}' - expect do - described_class.all(per_page: 10) - end.to raise_error(ChartMogul::UnauthorizedError, error_message) + } + customer = described_class.new_from_json(attrs) + updated_attributes = customer.remove_custom_attributes!( + :StringKey, :integer_key, :timestamp_key, :boolean_key + ) + expect(updated_attributes).to eq({}) end it 'lists the contacts belonging to the customer correctly' do - customer_uuid = 'cus_54cde7bc-bf30-11ed-a51a-2325f065834f' - customer = described_class.retrieve(customer_uuid) - contacts = customer.contacts + cursor = 'MjAyMy0xMC0zMFQwMToxNDoxNi4zNzIzODUwMDBaJmNvbl9'\ + 'hNGZiOWI2NC03NmMxLTExZWUtOWZmOC1jYjBiYTIzODQ1MjM=' + contacts = described_class.new_from_json(attrs).contacts expect(contacts.entries.size).to eq(1) - expect(contacts[0].first_name).to eq('Test') - expect(contacts[0].last_name).to eq('Again') + expect(contacts.has_more).to eq(false) + expect(contacts.cursor).not_to be_nil end it 'creates a contact belonging to the customer correctly' do - customer_uuid = 'cus_54cde7bc-bf30-11ed-a51a-2325f065834f' - customer = described_class.retrieve(customer_uuid) + customer = described_class.new_from_json(attrs) new_contact = customer.create_contact( data_source_uuid: customer.data_source_uuid, email: 'new_contact@example.com' ) - expect(new_contact.email).to eq('new_contact@example.com') end + + it 'lists the invoices belonging to the customer correctly' do + invoices = described_class.new_from_json(attrs).invoices + expect(invoices.entries.size).to eq(2) + expect(invoices.has_more).to eq(false) + expect(invoices.cursor).not_to be_nil + end + + it 'lists the subscriptions belonging to the customer correctly' do + subs = described_class.new_from_json(attrs).subscriptions + expect(subs.entries.size).to eq(2) + expect(subs.has_more).to eq(false) + expect(subs.cursor).not_to be_nil + end end end diff --git a/spec/chartmogul/data_source_spec.rb b/spec/chartmogul/data_source_spec.rb index 7eb79db..5df6aea 100644 --- a/spec/chartmogul/data_source_spec.rb +++ b/spec/chartmogul/data_source_spec.rb @@ -27,20 +27,13 @@ subject { described_class.new_from_json(json_attrs) } - it 'sets the name attribute' do - expect(subject.name).to eq('Test Data Source') - end - - it 'sets the UUID' do - expect(subject.uuid).to eq('abcd-1234') - end - - it 'sets created_at' do - expect(subject.created_at).to eq(Time.utc(2016, 0o6, 0o5, 15, 33, 34)) - end - - it 'sets the status' do - expect(subject.status).to eq('never_imported') + it 'sets all properties correctly' do + expect(subject).to have_attributes( + name: 'Test Data Source', + uuid: 'abcd-1234', + created_at: Time.utc(2016, 6, 5, 15, 33, 34), + status: 'never_imported' + ) end end diff --git a/spec/chartmogul/invoice_spec.rb b/spec/chartmogul/invoice_spec.rb index 03f8375..4a6f5f5 100644 --- a/spec/chartmogul/invoice_spec.rb +++ b/spec/chartmogul/invoice_spec.rb @@ -108,15 +108,18 @@ } end + let(:invoice_uuid) { 'inv_8ab74614-4e62-49f6-b4b3-f779109e50d0' } + describe '#initialize' do subject { described_class.new(attrs) } - it 'sets the date attribute' do - expect(subject.date).to eq('2016-01-01 12:00:00') - end - - it 'sets the currency attribute' do - expect(subject.currency).to eq('USD') + it 'sets all properties correctly' do + expect(subject).to have_attributes( + currency: 'USD', + date: '2016-01-01 12:00:00', + due_date: '2016-02-01 12:00:00', + external_id: 'inv_ext_id' + ) end it 'sets the line_items attribute' do @@ -130,29 +133,19 @@ expect(subject.transactions.first).to be_instance_of(ChartMogul::Transactions::Payment) expect(subject.transactions.last).to be_instance_of(ChartMogul::Transactions::Refund) end - - it 'sets the external_id attribute' do - expect(subject.external_id).to eq('inv_ext_id') - end - - it 'sets the due_date attribute' do - expect(subject.due_date).to eq('2016-02-01 12:00:00') - end end describe '.new_from_json' do subject { described_class.new_from_json(json) } - it 'sets the uuid attribute' do - expect(subject.uuid).to eq('inv_1234-5678-9012-34567') - end - - it 'sets the date attribute' do - expect(subject.date).to eq(Time.parse('2016-01-01 12:00:00')) - end - - it 'sets the currency attribute' do - expect(subject.currency).to eq('USD') + it 'sets all properties correctly' do + expect(subject).to have_attributes( + uuid: 'inv_1234-5678-9012-34567', + currency: 'USD', + date: Time.parse('2016-01-01 12:00:00'), + due_date: Time.parse('2016-02-01 12:00:00'), + external_id: 'inv_ext_id' + ) end it 'sets the line_items attribute' do @@ -166,14 +159,6 @@ expect(subject.transactions.first).to be_instance_of(ChartMogul::Transactions::Payment) expect(subject.transactions.last).to be_instance_of(ChartMogul::Transactions::Refund) end - - it 'sets the external_id attribute' do - expect(subject.external_id).to eq('inv_ext_id') - end - - it 'sets the due_date attribute' do - expect(subject.due_date).to eq(Time.parse('2016-02-01 12:00:00')) - end end describe '#serialize_for_write' do @@ -230,35 +215,70 @@ ) end end - describe 'API Interactions', vcr: true do - it 'returns all invoices through list all endpoint', uses_api: true do - invoices = described_class.all(per_page: 10, external_id: 'invoice_eid') - expect(invoices.instance_of?(ChartMogul::Invoices)).to be true - expect(invoices.size).to eq 1 - expect(invoices[0].instance_of?(described_class)).to be true - expect(invoices[0].external_id).to eq 'invoice_eid' - expect(invoices[0].customer_uuid).to eq 'customer_uuid' + + describe 'API Actions', uses_api: true, vcr: true do + it 'retrieves the invoice correctly' do + invoice = described_class.retrieve(invoice_uuid) + + expect(invoice).to have_attributes( + uuid: invoice_uuid, + external_id: 'test_cus_inv_ext_id_1', + currency: 'USD' + ) end - it 'deletes an invoice', uses_api: true do - invoice = described_class.new - invoice.instance_variable_set(:@uuid, 'inv_123') # hack-write private uuid - invoice.destroy! # expect no exception :) + it 'destroys the invoice correctly' do + uuid_to_delete = 'inv_6fab6457-7b27-44c3-99ae-815923a22c7c' + deleted_invoice = described_class.destroy!(uuid: uuid_to_delete) + expect(deleted_invoice).to eq(true) end - it 'deletes an invoice with class method', uses_api: true do - ChartMogul::Invoice.destroy!(uuid: 'inv_12345') + + it 'destroys the invoice correctly with instance method' do + invoice = described_class.retrieve('inv_c183cce8-a9f4-4992-b2d0-f42e16309866') + deleted_invoice = invoice.destroy! + expect(deleted_invoice).to eq(true) end - it 'raises error on deleting non-existing invoice', uses_api: true do - invoice = described_class.new - invoice.instance_variable_set(:@uuid, 'inv_I_dont_exists') # hack-write private uuid - expect { invoice.destroy! }.to raise_error(ChartMogul::ChartMogulError) + context 'with old pagination' do + it 'paginates correctly' do + invoices = described_class.all(per_page: 1, page: 2) + expect(invoices.size).to eq(1) + expect(invoices).to have_attributes( + cursor: nil, current_page: 2, total_pages: 27 + ) + expect(invoices.first).to have_attributes( + uuid: 'inv_8ab74614-4e62-49f6-b4b3-f779109e50d0' + ) + end end - it 'retrieves existing invoice by uuid', uses_api: true do - invoice = described_class.retrieve('inv_1234-5678-9012-34567') - expect(invoice).to be # can't compare instances easily - expect(invoice.uuid).to eq 'inv_1234-5678-9012-34567' + context 'with new pagination' do + let(:first_cursor) do + 'MjAyMy0xMC0zMFQwMzoxNjo1Ni4wMzUwMTcwMDBaJmludl82'\ + 'ODk3ZDcwMC05OTNlLTQxYjUtYmVlNi1mMTU2OWM5MmNmMWU=' + end + let(:next_cursor) do + 'MjAyMy0xMC0zMFQwMjo1ODo0MS4yNzkyNzIwMDBaJmludl84'\ + 'YWI3NDYxNC00ZTYyLTQ5ZjYtYjRiMy1mNzc5MTA5ZTUwZDA=' + end + + it 'paginates correctly' do + invoices = described_class.all(per_page: 1) + expect(invoices).to have_attributes( + cursor: first_cursor, has_more: true, size: 1 + ) + expect(invoices.first).to have_attributes( + uuid: 'inv_6897d700-993e-41b5-bee6-f1569c92cf1e' + ) + + next_invoices = invoices.next(per_page: 1) + expect(next_invoices).to have_attributes( + cursor: next_cursor, has_more: true, size: 1 + ) + expect(next_invoices.first).to have_attributes( + uuid: 'inv_8ab74614-4e62-49f6-b4b3-f779109e50d0' + ) + end end end end diff --git a/spec/chartmogul/metrics/activities_spec.rb b/spec/chartmogul/metrics/activities_spec.rb index 1423b5c..f7ba4b6 100644 --- a/spec/chartmogul/metrics/activities_spec.rb +++ b/spec/chartmogul/metrics/activities_spec.rb @@ -13,6 +13,7 @@ expect(response).to be_kind_of(ChartMogul::Metrics::Activities) expect(response.count).to be > 0 + expect(response.cursor).not_to be_nil activity = response[0] expect(activity).to be_kind_of(ChartMogul::Metrics::Activity) @@ -31,4 +32,14 @@ expect(activity.billing_connector_uuid).not_to be_nil expect(activity.uuid).not_to be_nil end + + it 'should paginate using cursor when called with #next' do + activities = ChartMogul::Metrics::Activity.all(per_page: 1) + expect(activities.size).to eq(1) + expect(activities[0].uuid).to eq('561814e1-d7d3-42f3-8936-4689ec0fbb74') + + next_activities = activities.next(per_page: 1) + expect(next_activities.size).to eq(1) + expect(next_activities[0].uuid).to eq('d868a892-37c7-45e3-ae84-e693181d2344') + end end diff --git a/spec/chartmogul/metrics/customers/activities_spec.rb b/spec/chartmogul/metrics/customers/activities_spec.rb index 40924d5..89f1742 100644 --- a/spec/chartmogul/metrics/customers/activities_spec.rb +++ b/spec/chartmogul/metrics/customers/activities_spec.rb @@ -4,7 +4,7 @@ require_relative '../shared/pageable' describe ChartMogul::Metrics::Customers::Activity, vcr: true, uses_api: true do - let(:do_request) { ChartMogul::Metrics::Customers::Activity.all('cus_91af761e-9d0a-11e5-b514-1feab446feac') } + let(:do_request) { ChartMogul::Metrics::Customers::Activity.all('cus_23551596-2c7e-11ee-9ea1-2bfe193640c0') } it_behaves_like 'Pageable' @@ -13,6 +13,7 @@ expect(response).to be_kind_of(ChartMogul::Metrics::Customers::Activities) expect(response.count).to be > 0 + expect(response.cursor).not_to be_nil activity = response[0] expect(activity).to be_kind_of(ChartMogul::Metrics::Customers::Activity) @@ -27,4 +28,15 @@ expect(activity.currency_sign).not_to be_nil expect(activity.subscription_external_id).not_to be_nil end + + it 'should paginate using cursor when called with #next' do + customer_uuid = 'cus_23551596-2c7e-11ee-9ea1-2bfe193640c0' + activities = ChartMogul::Metrics::Customers::Activity.all(customer_uuid, per_page: 1) + expect(activities.size).to eq(1) + expect(activities[0].id).to eq(2625867088) + + next_activities = activities.next(customer_uuid, per_page: 1) + expect(next_activities.size).to eq(1) + expect(next_activities[0].id).to eq(2625867087) + end end diff --git a/spec/chartmogul/metrics/customers/subscriptions_spec.rb b/spec/chartmogul/metrics/customers/subscriptions_spec.rb index 6b6f3e9..00f7ffd 100644 --- a/spec/chartmogul/metrics/customers/subscriptions_spec.rb +++ b/spec/chartmogul/metrics/customers/subscriptions_spec.rb @@ -4,7 +4,7 @@ require_relative '../shared/pageable' describe ChartMogul::Metrics::Customers::Subscription, vcr: true, uses_api: true do - let(:do_request) { ChartMogul::Metrics::Customers::Subscription.all('cus_91af761e-9d0a-11e5-b514-1feab446feac') } + let(:do_request) { ChartMogul::Metrics::Customers::Subscription.all('cus_23551596-2c7e-11ee-9ea1-2bfe193640c0') } it_behaves_like 'Pageable' @@ -13,6 +13,7 @@ expect(response).to be_kind_of(ChartMogul::Metrics::Customers::Subscriptions) expect(response.count).to be > 0 + expect(response.cursor).not_to be_nil subscription = response[0] expect(subscription).to be_kind_of(ChartMogul::Metrics::Customers::Subscription) @@ -29,4 +30,14 @@ expect(subscription.currency).not_to be_nil expect(subscription.currency_sign).not_to be_nil end + + it 'should paginate using cursor when called with #next' do + customer_uuid = 'cus_23551596-2c7e-11ee-9ea1-2bfe193640c0' + subscriptions = ChartMogul::Metrics::Customers::Subscription.all(customer_uuid, per_page: 1) + expect(subscriptions.size).to eq(1) + expect(subscriptions[0].id).to eq(2293710870) + + next_subscriptions = subscriptions.next(customer_uuid, per_page: 1) + expect(next_subscriptions.size).to eq(0) + end end diff --git a/spec/chartmogul/plan_group_spec.rb b/spec/chartmogul/plan_group_spec.rb index cd7484a..0cbc3be 100644 --- a/spec/chartmogul/plan_group_spec.rb +++ b/spec/chartmogul/plan_group_spec.rb @@ -2,116 +2,114 @@ require 'spec_helper' -describe ChartMogul::PlanGroup, uses_api: true do - describe 'API interactions', vcr: true, record: :all do - let(:data_source) do - ChartMogul::DataSource.create!(name: 'Data Source #1') - end - - let(:plan1) do - ChartMogul::Plan.create!( - interval_count: 1, - interval_unit: 'month', - name: 'A Test Plan', - data_source_uuid: data_source.uuid +describe ChartMogul::PlanGroup, uses_api: true, vcr: true do + describe 'API Actions' do + let(:plan_group_uuid) { 'plg_e6ae207a-ff32-4431-ae46-34f20b61e17a' } + + it 'retrieves the plan_group correctly' do + plan_group = described_class.retrieve(plan_group_uuid) + expect(plan_group).to have_attributes( + uuid: plan_group_uuid, + name: 'My plan group', + plans_count: 2 ) end - let(:plan2) do - ChartMogul::Plan.create!( - interval_count: 1, - interval_unit: 'month', - name: 'A another Test Plan', - data_source_uuid: data_source.uuid + it 'creates a plan_group correctly' do + plan = ChartMogul::Plan.retrieve('pl_e205d990-56e3-013c-13ac-46813c1ddd3d') + plan_group = described_class.create!( + name: 'New Plan Group', + plans: [plan] + ) + expect(plan_group).to have_attributes( + uuid: 'plg_5f1af63a-ec94-4688-9127-5eb816d05a8f', + name: 'New Plan Group', + plans_count: 1 ) end - let(:plan_group) do - ChartMogul::PlanGroup.create!( - name: 'My plan group', - plans: [plan1, plan2] + it 'updates the plan_group correctly with the instance method' do + plan_group = described_class.retrieve(plan_group_uuid) + plan_group.name = 'A new name' + updated_plan_group = plan_group.update! + expect(updated_plan_group).to have_attributes( + uuid: plan_group_uuid, + name: 'A new name' ) end - it 'returns an array of plan groups' do - plan_group - - plan3 = ChartMogul::Plan.create!( - interval_count: 1, - interval_unit: 'month', - name: 'A another Test Plan', - data_source_uuid: data_source.uuid + it 'updates the plan_group correctly with the class method' do + updated_plan_group = described_class.update!( + plan_group_uuid, name: 'Another name' ) - - second_plan_group = ChartMogul::PlanGroup.create!( - name: 'My second plan group', - plans: [plan2, plan3] + expect(updated_plan_group).to have_attributes( + uuid: plan_group_uuid, name: 'Another name' ) - - plan_groups = ChartMogul::PlanGroup.all - - expect(plan_groups.map(&:uuid).sort).to eq([plan_group.uuid, second_plan_group.uuid].sort) - expect(plan_groups.map(&:plans_count)).to eq([2, 2]) - end - - it 'correctly handles a 422 error', uses_api: true do - expect { ChartMogul::PlanGroup.create! }.to raise_error(ChartMogul::ResourceInvalidError) end - it 'retrieves existing plan group by uuid', uses_api: true do - api_pg = ChartMogul::PlanGroup.retrieve(plan_group.uuid) - - expect(api_pg.uuid).to eq(plan_group.uuid) - end - - it 'updates existing plan group name', uses_api: true do - new_name = 'A new plan group_name' - plan_group.name = new_name - - plan_group.update! - - api_pg = ChartMogul::PlanGroup.retrieve(plan_group.uuid) - - expect(api_pg.name).to eq(new_name) - expect(api_pg.plans_count).to eq(2) + it 'updates a plan_group plans' do + plan_1 = ChartMogul::Plan.retrieve('pl_de9e281e-76cb-11ee-b63f-b727630ce4d4') + plan_2 = ChartMogul::Plan.retrieve('pl_e205d990-56e3-013c-13ac-46813c1ddd3d') + plan_group = described_class.retrieve(plan_group_uuid) + plan_group.plans = [plan_1, plan_2] + + updated_plan_group = plan_group.update! + expect(updated_plan_group).to have_attributes( + name: 'Another name', + plans_count: 2, + uuid: plan_group_uuid + ) + expect(updated_plan_group.plans.map(&:uuid)).to match_array([plan_1.uuid, plan_2.uuid]) end - it 'updates existing plan group name via class method', uses_api: true, match_requests_on: [:method, :uri, :body] do - new_name = 'A new group name' - - updated_pg = described_class.update!(plan_group.uuid, { - name: new_name - }) - - expect(updated_pg.name).to eq(new_name) - expect(updated_pg.plans_count).to eq(2) + it 'destroys a plan_group correctly' do + plan_group = described_class.retrieve(plan_group_uuid) + destroyed_plan_group = plan_group.destroy! + expect(destroyed_plan_group).to eq(true) end - it 'updates existing plan group plans', uses_api: true do - plan3 = ChartMogul::Plan.create!( - interval_count: 1, - interval_unit: 'month', - name: 'A another Test Plan', - data_source_uuid: data_source.uuid - ) - new_plans = [plan1, plan2, plan3] - plan_group.plans = new_plans - - plan_group.update! - - api_pg = ChartMogul::PlanGroup.retrieve(plan_group.uuid) - plans = ChartMogul::PlanGroups::Plans.all(plan_group_uuid: plan_group.uuid) - - expect(api_pg.plans_count).to eq(3) - expect(plans.map(&:uuid).sort).to eq(new_plans.map(&:uuid).sort) + context 'with old pagination' do + it 'paginates correctly' do + plan_groups = described_class.all(per_page: 1, page: 3) + expect(plan_groups.size).to eq(1) + expect(plan_groups).to have_attributes( + cursor: nil, current_page: 3, total_pages: 8 + ) + expect(plan_groups.first).to have_attributes( + uuid: 'plg_cb92ce3a-2196-4b1b-92e1-7bb7c01c359e' + ) + end end - it 'deletes a plan group' do - plan_group.destroy! - - expect do - ChartMogul::PlanGroup.retrieve(plan_group.uuid) - end.to raise_error(ChartMogul::NotFoundError) + context 'with new pagination' do + let(:first_cursor) do + 'MjAyMy0xMC0zMFQwNDowMTo0NS4yNDYwNzQwMDBaJjIxMTg5' + end + let(:next_cursor) do + 'MjAyMy0xMC0yN1QxMDo0MzoxMC41MTc3OTcwMDBaJjIxMTgy' + end + + it 'paginates correctly' do + plan_groups = described_class.all(per_page: 1) + expect(plan_groups).to have_attributes( + cursor: first_cursor, + has_more: true, + size: 1 + ) + expect(plan_groups.first).to have_attributes( + uuid: 'plg_5f1af63a-ec94-4688-9127-5eb816d05a8f' + ) + + next_plan_groups = plan_groups.next(per_page: 1) + expect(next_plan_groups).to have_attributes( + cursor: next_cursor, + has_more: true, + size: 1 + ) + expect(next_plan_groups.first).to have_attributes( + uuid: 'plg_596af607-ea77-45a3-8d0b-5f1f6b31bf3b' + ) + end end end end diff --git a/spec/chartmogul/plan_groups/plans_spec.rb b/spec/chartmogul/plan_groups/plans_spec.rb index 930bd59..ed36863 100644 --- a/spec/chartmogul/plan_groups/plans_spec.rb +++ b/spec/chartmogul/plan_groups/plans_spec.rb @@ -3,40 +3,53 @@ require 'spec_helper' describe ChartMogul::PlanGroups::Plans do - describe 'API interactions', vcr: true, record: :all do - let(:data_source) do - ChartMogul::DataSource.create!(name: 'Data Source #1') - end - - let(:plan1) do - ChartMogul::Plan.create!( - interval_count: 1, - interval_unit: 'month', - name: 'A Test Plan', - data_source_uuid: data_source.uuid - ) - end + describe 'API Actions', vcr: true, uses_api: true do + let(:plan_group_uuid) { 'plg_5f1af63a-ec94-4688-9127-5eb816d05a8f' } - let(:plan2) do - ChartMogul::Plan.create!( - interval_count: 1, - interval_unit: 'month', - name: 'A another Test Plan', - data_source_uuid: data_source.uuid - ) + context 'with old pagination' do + it 'paginates correctly' do + plans = described_class.all( + plan_group_uuid, + per_page: 1, page: 1 + ) + expect(plans.size).to eq(1) + expect(plans).to have_attributes( + cursor: nil, has_more: nil, + current_page: 1, total_pages: 2 + ) + expect(plans.plans.first.uuid).to eq('pl_e205d990-56e3-013c-13ac-46813c1ddd3d') + end end - let(:plan_group) do - ChartMogul::PlanGroup.create!( - name: 'My plan group', - plans: [plan1, plan2] - ) - end + context 'with new pagination' do + let(:first_cursor) do + 'MjAyMy0xMC0yN1QxMDo0NTozNS4yMjM5MDUwMDBaJjEwOTk1ODQ=' + end + let(:next_cursor) do + 'MjAyMy0xMC0yN1QwNzozMTo1NC40MzQzNDkwMDBaJjEwOTk1MzI=' + end - it 'given a plan group uuid, returns an array of plans in the plan group', uses_api: true do - plans = ChartMogul::PlanGroups::Plans.all(plan_group_uuid: plan_group.uuid) + it 'paginates correctly' do + plans = described_class.all(plan_group_uuid, per_page: 1) + expect(plans).to have_attributes( + cursor: first_cursor, + has_more: true, + size: 1 + ) + expect(plans.plans.map(&:uuid)).to eq( + ['pl_e205d990-56e3-013c-13ac-46813c1ddd3d'] + ) - expect(plans.map(&:uuid).sort).to eq([plan1.uuid, plan2.uuid].sort) + next_plans = plans.next(plan_group_uuid, per_page: 1) + expect(next_plans).to have_attributes( + cursor: next_cursor, + has_more: false, + size: 1 + ) + expect(next_plans.first).to have_attributes( + uuid: 'pl_e6ffcc84-749a-11ee-be12-f32dce10118e' + ) + end end end end diff --git a/spec/chartmogul/plan_spec.rb b/spec/chartmogul/plan_spec.rb index 280daff..51e7fd9 100644 --- a/spec/chartmogul/plan_spec.rb +++ b/spec/chartmogul/plan_spec.rb @@ -3,96 +3,107 @@ require 'spec_helper' describe ChartMogul::Plan do - describe 'API Interactions', vcr: true do - it 'correctly interacts with the API', uses_api: true do - data_source = ChartMogul::DataSource.create!(name: 'Another Data Source') - - plan = ChartMogul::Plan.create!( - interval_count: 1, - interval_unit: 'month', - name: 'A Test Plan', - data_source_uuid: data_source.uuid + let(:plan_uuid) { 'pl_de9e281e-76cb-11ee-b63f-b727630ce4d4' } + let(:data_source_uuid) { 'ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46' } + + describe 'API Actions', uses_api: true, vcr: true do + it 'retrieves the plan correctly' do + plan = described_class.retrieve(plan_uuid) + expect(plan).to have_attributes( + uuid: plan_uuid, + name: 'Test Plan', + external_id: 'test_cus_pl_ext_id', + data_source_uuid: data_source_uuid ) - - plans = ChartMogul::Plan.all - - expect(plans.size).to eq(1) - expect(plans[0].name).to eq(plan.name) - expect(plans[0].external_id).to eq(plan.external_id) - expect(plans[0].interval_unit).to eq(plan.interval_unit) - expect(plans[0].interval_count).to eq(plan.interval_count) - expect(plans[0].data_source_uuid).to eq(plan.data_source_uuid) - end - - it 'correctly handles a 422 error', uses_api: true do - expect { ChartMogul::Plan.create! }.to raise_error(ChartMogul::ResourceInvalidError) end - it 'retrieves existing plan by uuid', uses_api: true do - data_source = ChartMogul::DataSource.create!(name: 'Another Data Source') - - plan = ChartMogul::Plan.create!( + it 'creates the plan correctly' do + plan = described_class.create!( interval_count: 1, interval_unit: 'month', - name: 'A Test Plan', - data_source_uuid: data_source.uuid + name: 'Another Test Plan', + data_source_uuid: data_source_uuid ) - plan.send(:set_uuid, 'pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072') - - plan = described_class.retrieve('pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072') - expect(plan).to be - end - - it 'updates existing plan', uses_api: true do - data_source = ChartMogul::DataSource.create!(name: 'Another Data Source') - - plan = ChartMogul::Plan.create!( - interval_count: 1, - interval_unit: 'month', - name: 'A Test Plan', - data_source_uuid: data_source.uuid + expect(plan).to have_attributes( + uuid: 'pl_1184b750-5905-013c-13b1-46813c1ddd3d', + name: 'Another Test Plan', + data_source_uuid: data_source_uuid ) - plan.send(:set_uuid, 'pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072') + end + it 'updates the plan correctly with the instance method' do + plan = described_class.retrieve('pl_1184b750-5905-013c-13b1-46813c1ddd3d') + plan.name = 'Another Test Plan 123' plan.interval_count = 2 - plan.update! + updated_plan = plan.update! - plan = described_class.retrieve('pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072') - expect(plan.interval_count).to eq(2) + expect(updated_plan).to have_attributes( + uuid: 'pl_1184b750-5905-013c-13b1-46813c1ddd3d', + name: 'Another Test Plan 123', + interval_count: 2 + ) end - it 'updates existing plan using class method', uses_api: true, match_requests_on: [:method, :uri, :body] do - data_source = ChartMogul::DataSource.create!(name: 'Another Data Source') - - plan = described_class.create!( - interval_count: 1, - interval_unit: 'month', - name: 'pro', - data_source_uuid: data_source.uuid + it 'updates the plan correctly with the class method' do + updated_plan = described_class.update!( + 'pl_1184b750-5905-013c-13b1-46813c1ddd3d', + name: 'Another Test Plan', interval_count: 1 + ) + expect(updated_plan).to have_attributes( + uuid: 'pl_1184b750-5905-013c-13b1-46813c1ddd3d', + name: 'Another Test Plan', + interval_count: 1 ) - - updated_plan = described_class.update!(plan.uuid, { - interval_count: 2, - name: 'really pro' - }) - - expect(updated_plan.interval_count).to eq(2) - expect(updated_plan.name).to eq('really pro') end - it 'deletes existing plan', uses_api: true do - data_source = ChartMogul::DataSource.create!(name: 'Another Data Source') + it 'destroys the plan correctly' do + uuid_to_delete = 'pl_1184b750-5905-013c-13b1-46813c1ddd3d' + deleted_plan = described_class.destroy!(uuid: uuid_to_delete) + expect(deleted_plan).to eq(true) + end - plan = ChartMogul::Plan.create!( - interval_count: 1, - interval_unit: 'month', - name: 'A Test Plan', - data_source_uuid: data_source.uuid - ) - plan.send(:set_uuid, 'pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072') + context 'with old pagination' do + it 'paginates correctly' do + plans = described_class.all(per_page: 1, page: 3) + expect(plans.size).to eq(1) + expect(plans).to have_attributes( + cursor: nil, current_page: 3, total_pages: 14 + ) + expect(plans.first).to have_attributes( + uuid: 'pl_e1c26000-56e3-013c-fc49-2215549c3f98' + ) + end + end - expect(plan.destroy!).to be_truthy - expect { described_class.retrieve('pl_5ee8bf93-b0b4-4722-8a17-6b624a3af072') }.to raise_error(ChartMogul::NotFoundError) + context 'with new pagination' do + let(:first_cursor) do + 'MjAyMy0xMC0zMFQwMjoyNzoyOC4wMzU1OTIwMDBaJjExMDAyMjQ=' + end + let(:next_cursor) do + 'MjAyMy0xMC0yN1QxMDo0NTozNS4yMjM5MDUwMDBaJjEwOTk1ODQ=' + end + + it 'paginates correctly' do + plans = described_class.all(per_page: 1) + expect(plans).to have_attributes( + cursor: first_cursor, + has_more: true, + size: 1 + ) + expect(plans.first).to have_attributes( + uuid: 'pl_de9e281e-76cb-11ee-b63f-b727630ce4d4' + ) + + next_plans = plans.next(per_page: 1) + expect(next_plans).to have_attributes( + cursor: next_cursor, + has_more: true, + size: 1 + ) + expect(next_plans.first).to have_attributes( + uuid: 'pl_e205d990-56e3-013c-13ac-46813c1ddd3d' + ) + end end end end diff --git a/spec/chartmogul/subscription_event_spec.rb b/spec/chartmogul/subscription_event_spec.rb index ca25e39..ad859bf 100644 --- a/spec/chartmogul/subscription_event_spec.rb +++ b/spec/chartmogul/subscription_event_spec.rb @@ -45,7 +45,9 @@ expect(events.size).to eq 1 expect(events[0].id).to eq single_event.id - expect(events.meta[:total_pages]).to eq 1 + expect(events.meta[:total_pages]).to eq(1) + expect(events.cursor).to eq('MjAyMy0xMC0yN1QwODoxNTozNy4yMzE0NjMwMDBaJjM3NDI3Nzc0Ng==') + expect(events.has_more).to eq(false) single_event.destroy! data_source.destroy! @@ -237,5 +239,17 @@ data_source.destroy! end + + it 'should paginate using cursor when called with #next', uses_api: true do + customer_uuid = 'cus_713e32ae-74a1-11ee-b822-fbc804fece75' + + events = described_class.all(customer_uuid: customer_uuid, per_page: 1) + expect(events.size).to eq(1) + expect(events[0].id).to eq(374279754) + + next_events = events.next(customer_uuid: customer_uuid, per_page: 1) + expect(next_events.size).to eq(1) + expect(next_events[0].id).to eq(374279751) + end end end diff --git a/spec/chartmogul/subscription_spec.rb b/spec/chartmogul/subscription_spec.rb index ed88fa3..9aa74fe 100644 --- a/spec/chartmogul/subscription_spec.rb +++ b/spec/chartmogul/subscription_spec.rb @@ -41,13 +41,18 @@ invoices: [invoice] ).create! - expect(customer.subscriptions.current_page).to eq(1) - expect(customer.subscriptions.total_pages).to eq(1) - expect(customer.subscriptions.size).to eq(1) - expect(customer.subscriptions.first.uuid).to eq('sub_9b3ccf25-4613-4af6-84b3-12026cfa4b7c') - expect(customer.subscriptions.first.data_source_uuid).to eq('ds_55ab11fb-53e6-4468-aa95-bd582f14cac6') - expect(customer.subscriptions.first.external_id).to eq('test_cus_sub_ext_id') - expect(customer.subscriptions.first.subscription_set_external_id).to eq('test_cus_set_ext_id') + expect(customer.subscriptions).to have_attributes( + current_page: 1, + total_pages: 1, + cursor: 'MjAyMy0xMC0yN1QwODoxODo0NC4xMTI5NjYwMDBaJnN1Yl80NmMzZjRjMS1iZmU1LTQ2NjUtYWViNy05NWFhNjBmZDJmNDk=', + has_more: false + ) + expect(customer.subscriptions.first).to have_attributes( + uuid: 'sub_46c3f4c1-bfe5-4665-aeb7-95aa60fd2f49', + data_source_uuid: 'ds_70f9d974-74a1-11ee-9f41-abc03e24d1d3', + external_id: 'test_cus_sub_ext_id', + subscription_set_external_id: 'test_cus_set_ext_id' + ) customer.subscriptions.first.cancel(Time.utc(2016, 1, 15, 12)) @@ -58,6 +63,15 @@ data_source.destroy! end + it 'should paginate using cursor when called with #next', uses_api: true do + subscriptions = described_class.all('cus_23551596-2c7e-11ee-9ea1-2bfe193640c0', per_page: 1) + expect(subscriptions.size).to eq(1) + expect(subscriptions[0].uuid).to eq('sub_e16a87f3-a045-45e5-9fe0-62c7b2f28f45') + + next_subscriptions = subscriptions.next('cus_23551596-2c7e-11ee-9ea1-2bfe193640c0', per_page: 1) + expect(next_subscriptions.size).to eq(0) + end + it 'has multiple aliases', uses_api: true do subscriptions = described_class.all('cus_510b1395-4fe8-4d35-ae23-0e61f9a51e33', page: 1, per_page: 2) expect(subscriptions.current_page).to eq(1) diff --git a/fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_in_a_threaded_environment.yml b/spec/fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_in_a_threaded_environment.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_in_a_threaded_environment.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_in_a_threaded_environment.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_when_credentials_are_updated.yml b/spec/fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_when_credentials_are_updated.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_when_credentials_are_updated.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_APIResource/connection/works_when_credentials_are_updated.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Account/returns_details_of_current_account.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Account/returns_details_of_current_account.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Account/returns_details_of_current_account.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Account/returns_details_of_current_account.yml diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/creates_the_contact_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/creates_the_contact_correctly.yml new file mode 100644 index 0000000..3f959e6 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/creates_the_contact_correctly.yml @@ -0,0 +1,36 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.chartmogul.com/v1/contacts + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_23e01538-2c7e-11ee-b2ce-fb986e96e21b","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","email":"contact@example.com"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 201 + message: Created + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 18:08:50 GMT + content-length: + - '365' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"uuid":"con_36399f04-7686-11ee-86f6-8727560009c2","customer_uuid":"cus_23e01538-2c7e-11ee-b2ce-fb986e96e21b","customer_external_id":"cus_004","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","position":1,"first_name":null,"last_name":null,"title":null,"email":"contact@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}' + http_version: + recorded_at: Sun, 29 Oct 2023 18:08:50 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/destroys_the_contact_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/destroys_the_contact_correctly.yml new file mode 100644 index 0000000..8fa2fb7 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/destroys_the_contact_correctly.yml @@ -0,0 +1,34 @@ +--- +http_interactions: +- request: + method: delete + uri: https://api.chartmogul.com/v1/contacts/con_ab1e60d4-7690-11ee-84d7-f7e55168a5df + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 19:25:28 GMT + content-length: + - '2' + connection: + - keep-alive + body: + encoding: UTF-8 + string: "{}" + http_version: + recorded_at: Sun, 29 Oct 2023 19:25:28 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/merges_contacts_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/merges_contacts_correctly.yml new file mode 100644 index 0000000..1f52157 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/merges_contacts_correctly.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.chartmogul.com/v1/contacts/con_36399f04-7686-11ee-86f6-8727560009c2/merge/con_6f0b7208-7690-11ee-8857-9f75f1321afd + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 19:23:08 GMT + content-length: + - '446' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"uuid":"con_36399f04-7686-11ee-86f6-8727560009c2","customer_uuid":null,"customer_external_id":"cus_004","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","position":9,"first_name":"Foo","last_name":"Bar","title":"CTO","email":"contact2@example.com","phone":"+9876543210","linked_in":"https://linkedin.com/about","twitter":"https://twitter.com/about","notes":"Heading\\nBody\\nFooter + This contact was merged","custom":{"Toggle":false}}' + http_version: + recorded_at: Sun, 29 Oct 2023 19:23:08 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/retrieves_the_contact_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/retrieves_the_contact_correctly.yml new file mode 100644 index 0000000..6ee95e0 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/retrieves_the_contact_correctly.yml @@ -0,0 +1,36 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/contacts/con_36399f04-7686-11ee-86f6-8727560009c2 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 18:09:23 GMT + content-length: + - '365' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"uuid":"con_36399f04-7686-11ee-86f6-8727560009c2","customer_uuid":"cus_23e01538-2c7e-11ee-b2ce-fb986e96e21b","customer_external_id":"cus_004","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","position":1,"first_name":null,"last_name":null,"title":null,"email":"contact@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}' + http_version: + recorded_at: Sun, 29 Oct 2023 18:09:23 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/updates_the_contact_correctly_with_the_class_method.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/updates_the_contact_correctly_with_the_class_method.yml new file mode 100644 index 0000000..b1da988 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/updates_the_contact_correctly_with_the_class_method.yml @@ -0,0 +1,36 @@ +--- +http_interactions: +- request: + method: patch + uri: https://api.chartmogul.com/v1/contacts/con_36399f04-7686-11ee-86f6-8727560009c2 + body: + encoding: UTF-8 + string: '{"position":9,"first_name":"Foo","last_name":"Bar","title":"CTO","email":"contact2@example.com","phone":"+9876543210","linked_in":"https://linkedin.com/about","twitter":"https://twitter.com/about","custom":[{"key":"Toggle","value":false}]}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 19:09:59 GMT + content-length: + - '460' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"uuid":"con_36399f04-7686-11ee-86f6-8727560009c2","customer_uuid":"cus_23e01538-2c7e-11ee-b2ce-fb986e96e21b","customer_external_id":"cus_004","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","position":9,"first_name":"Foo","last_name":"Bar","title":"CTO","email":"contact2@example.com","phone":"+9876543210","linked_in":"https://linkedin.com/about","twitter":"https://twitter.com/about","notes":"Heading\\nBody\\nFooter","custom":{"Toggle":false}}' + http_version: + recorded_at: Sun, 29 Oct 2023 19:09:59 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/with_new_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/with_new_pagination/paginates_correctly.yml new file mode 100644 index 0000000..42278be --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/with_new_pagination/paginates_correctly.yml @@ -0,0 +1,70 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/contacts?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 19:55:27 GMT + content-length: + - '622' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"entries":[{"uuid":"con_36399f04-7686-11ee-86f6-8727560009c2","customer_uuid":"cus_23e01538-2c7e-11ee-b2ce-fb986e96e21b","customer_external_id":"cus_004","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","position":9,"first_name":"Foo","last_name":"Bar","title":"CTO","email":"contact2@example.com","phone":"+9876543210","linked_in":"https://linkedin.com/about","twitter":"https://twitter.com/about","notes":"Heading\\nBody\\nFooter + This contact was merged","custom":{"Toggle":false}}],"cursor":"MjAyMy0xMC0yOVQxODowODo1MC4yNDQ4NzUwMDBaJmNvbl8zNjM5OWYwNC03Njg2LTExZWUtODZmNi04NzI3NTYwMDA5YzI=","has_more":true}' + http_version: + recorded_at: Sun, 29 Oct 2023 19:55:26 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/contacts?cursor=MjAyMy0xMC0yOVQxODowODo1MC4yNDQ4NzUwMDBaJmNvbl8zNjM5OWYwNC03Njg2LTExZWUtODZmNi04NzI3NTYwMDA5YzI%3D&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 19:55:27 GMT + content-length: + - '498' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"entries":[{"uuid":"con_e07fc356-749e-11ee-bd40-9fcb07f4aeda","customer_uuid":"cus_e037a9f4-749e-11ee-bf18-07ce97fbd41c","customer_external_id":"X1234","data_source_uuid":"ds_dff53f06-749e-11ee-bf16-8fc807c27dc6","position":1,"first_name":null,"last_name":null,"title":null,"email":"test@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}],"cursor":"MjAyMy0xMC0yN1QwODowMDoyMS41MTQwMzcwMDBaJmNvbl9lMDdmYzM1Ni03NDllLTExZWUtYmQ0MC05ZmNiMDdmNGFlZGE=","has_more":true}' + http_version: + recorded_at: Sun, 29 Oct 2023 19:55:27 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/with_old_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/with_old_pagination/paginates_correctly.yml new file mode 100644 index 0000000..5bb00a8 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Contact/API_Actions/with_old_pagination/paginates_correctly.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/contacts?page=3&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 19:27:53 GMT + content-length: + - '622' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"entries":[{"uuid":"con_36399f04-7686-11ee-86f6-8727560009c2","customer_uuid":"cus_23e01538-2c7e-11ee-b2ce-fb986e96e21b","customer_external_id":"cus_004","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","position":9,"first_name":"Foo","last_name":"Bar","title":"CTO","email":"contact2@example.com","phone":"+9876543210","linked_in":"https://linkedin.com/about","twitter":"https://twitter.com/about","notes":"Heading\\nBody\\nFooter + This contact was merged","custom":{"Toggle":false}}],"cursor":"MjAyMy0xMC0yOVQxODowODo1MC4yNDQ4NzUwMDBaJmNvbl8zNjM5OWYwNC03Njg2LTExZWUtODZmNi04NzI3NTYwMDA5YzI=","has_more":true}' + http_version: + recorded_at: Sun, 29 Oct 2023 19:27:53 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/adds_custom_attributes_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/adds_custom_attributes_correctly.yml new file mode 100644 index 0000000..a99dcc2 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/adds_custom_attributes_correctly.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.chartmogul.com/v1/customers/cus_23740208-2c7e-11ee-9ea2-ffd2435982bb/attributes/custom + body: + encoding: UTF-8 + string: '{"custom":[{"type":"String","key":"StringKey","value":"String Value"},{"type":"Integer","key":"integer_key","value":1234},{"type":"Timestamp","key":"timestamp_key","value":"2016-01-31 + 00:00:00 UTC"},{"type":"Boolean","key":"boolean_key","value":true}]}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:52:56 GMT + content-length: + - '120' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"custom":{"StringKey":"String Value","integer_key":1234,"timestamp_key":"2016-01-31T00:00:00.000Z","boolean_key":true}}' + http_version: + recorded_at: Mon, 30 Oct 2023 00:52:56 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/adds_tags_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/adds_tags_correctly.yml new file mode 100644 index 0000000..b80ffa2 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/adds_tags_correctly.yml @@ -0,0 +1,36 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.chartmogul.com/v1/customers/cus_23740208-2c7e-11ee-9ea2-ffd2435982bb/attributes/tags + body: + encoding: UTF-8 + string: '{"tags":["test-tag"]}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:32:14 GMT + content-length: + - '78' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"tags":["auto-churned-delinquent-subscription","merged-customer","test-tag"]}' + http_version: + recorded_at: Mon, 30 Oct 2023 00:32:14 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/creates_a_contact_belonging_to_the_customer_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/creates_a_contact_belonging_to_the_customer_correctly.yml new file mode 100644 index 0000000..5e7bb97 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/creates_a_contact_belonging_to_the_customer_correctly.yml @@ -0,0 +1,36 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.chartmogul.com/v1/contacts + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_23740208-2c7e-11ee-9ea2-ffd2435982bb","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","email":"new_contact@example.com"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 201 + message: Created + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Mon, 30 Oct 2023 01:16:59 GMT + content-length: + - '369' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"uuid":"con_066a8eb4-76c2-11ee-8f49-ffeda4a3d8f7","customer_uuid":"cus_23740208-2c7e-11ee-9ea2-ffd2435982bb","customer_external_id":"cus_002","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","position":2,"first_name":null,"last_name":null,"title":null,"email":"new_contact@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{}}' + http_version: + recorded_at: Mon, 30 Oct 2023 01:16:59 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/creates_the_customer_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/creates_the_customer_correctly.yml new file mode 100644 index 0000000..8d6d231 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/creates_the_customer_correctly.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.chartmogul.com/v1/customers + body: + encoding: UTF-8 + string: '{"external_id":"cus_007","name":"New Customer","email":"new_customer@example.com","city":"Berlin","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","owner":"bruno+chartmogultest@chartmogul.com"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 201 + message: Created + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 21:46:40 GMT + content-length: + - '845' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJpZCI6MTMzMTQ5MTQ1LCJ1dWlkIjoiY3VzX2E0NjgwYTljLTc2YTQtMTFlZS04M2FiLWQzYjlhYWJjN2YwMCIsImV4dGVybmFsX2lkIjoiY3VzXzAwNyIsIm5hbWUiOiJOZXcgQ3VzdG9tZXIiLCJlbWFpbCI6Im5ld19jdXN0b21lckBleGFtcGxlLmNvbSIsInN0YXR1cyI6Ik5ldyBMZWFkIiwiY3VzdG9tZXItc2luY2UiOm51bGwsImF0dHJpYnV0ZXMiOnsiY3VzdG9tIjp7fSwiY2xlYXJiaXQiOnt9LCJzdHJpcGUiOnt9LCJ0YWdzIjpbXX0sImRhdGFfc291cmNlX3V1aWQiOiJkc18wM2NmZDJjNC0yYzdlLTExZWUtYWIyMy1jYjBmMDA4Y2ZmNDYiLCJkYXRhX3NvdXJjZV91dWlkcyI6WyJkc18wM2NmZDJjNC0yYzdlLTExZWUtYWIyMy1jYjBmMDA4Y2ZmNDYiXSwiZXh0ZXJuYWxfaWRzIjpbImN1c18wMDciXSwiY29tcGFueSI6IiIsImNvdW50cnkiOm51bGwsInN0YXRlIjpudWxsLCJjaXR5IjoiQmVybGluIiwiemlwIjpudWxsLCJsZWFkX2NyZWF0ZWRfYXQiOm51bGwsImZyZWVfdHJpYWxfc3RhcnRlZF9hdCI6bnVsbCwiYWRkcmVzcyI6eyJjb3VudHJ5IjpudWxsLCJzdGF0ZSI6bnVsbCwiY2l0eSI6IkJlcmxpbiIsImFkZHJlc3NfemlwIjpudWxsfSwibXJyIjowLCJhcnIiOjAsImJpbGxpbmctc3lzdGVtLXVybCI6bnVsbCwiY2hhcnRtb2d1bC11cmwiOiJodHRwczovL2FwcC5jaGFydG1vZ3VsLmNvbS8jL2N1c3RvbWVycy8xMzMxNDkxNDUtTmV3X0N1c3RvbWVyIiwiYmlsbGluZy1zeXN0ZW0tdHlwZSI6Ikdvb2dsZSBTaGVldHMiLCJjdXJyZW5jeSI6IkVVUiIsImN1cnJlbmN5LXNpZ24iOiLigqwiLCJvd25lciI6ImJydW5vK2NoYXJ0bW9ndWx0ZXN0QGNoYXJ0bW9ndWwuY29tIn0= + http_version: + recorded_at: Sun, 29 Oct 2023 21:46:40 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/destroys_the_customer_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/destroys_the_customer_correctly.yml new file mode 100644 index 0000000..56d35a6 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/destroys_the_customer_correctly.yml @@ -0,0 +1,30 @@ +--- +http_interactions: +- request: + method: delete + uri: https://api.chartmogul.com/v1/customers/cus_a4680a9c-76a4-11ee-83ab-d3b9aabc7f00 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Authorization: + - Basic hidden + response: + status: + code: 204 + message: No Content + headers: + access-control-allow-credentials: + - 'true' + date: + - Sun, 29 Oct 2023 23:49:40 GMT + connection: + - keep-alive + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Sun, 29 Oct 2023 23:49:40 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_contacts_belonging_to_the_customer_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_contacts_belonging_to_the_customer_correctly.yml new file mode 100644 index 0000000..47d8144 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_contacts_belonging_to_the_customer_correctly.yml @@ -0,0 +1,36 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/contacts?customer_uuid=cus_23740208-2c7e-11ee-9ea2-ffd2435982bb + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Mon, 30 Oct 2023 01:16:10 GMT + content-length: + - '529' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"entries":[{"uuid":"con_a4fb9b64-76c1-11ee-9ff8-cb0ba2384523","customer_uuid":"cus_23740208-2c7e-11ee-9ea2-ffd2435982bb","customer_external_id":"cus_002","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","position":1,"first_name":"Test","last_name":"Contact","title":null,"email":"contact_123@example.com","phone":null,"linked_in":null,"twitter":null,"notes":null,"custom":{"Toggle":false}}],"cursor":"MjAyMy0xMC0zMFQwMToxNDoxNi4zNzIzODUwMDBaJmNvbl9hNGZiOWI2NC03NmMxLTExZWUtOWZmOC1jYjBiYTIzODQ1MjM=","has_more":false}' + http_version: + recorded_at: Mon, 30 Oct 2023 01:16:10 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_invoices_belonging_to_the_customer_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_invoices_belonging_to_the_customer_correctly.yml new file mode 100644 index 0000000..5ef179d --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_invoices_belonging_to_the_customer_correctly.yml @@ -0,0 +1,60 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/import/customers/cus_23740208-2c7e-11ee-9ea2-ffd2435982bb/invoices + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-encoding: + - gzip + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 01:19:18 GMT + etag: + - W/"ffa542a40b469610b06de8e0dc3b713f" + referrer-policy: + - strict-origin-when-cross-origin + vary: + - Accept-Encoding, Accept-Encoding + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 44bbe838563fba7b7f3f9bbca210ea2e + x-runtime: + - '0.109229' + x-xss-protection: + - 1; mode=block + content-length: + - '749' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_23740208-2c7e-11ee-9ea2-ffd2435982bb","invoices":[{"uuid":"inv_7dd39e18-835a-4f89-9a6b-684043f6c5f2","date":"2016-01-01T12:00:00.000Z","due_date":null,"errors":{},"external_id":"test_tr_inv_ext_id2","currency":"USD","line_items":[{"uuid":"li_2e2bb219-004b-449f-8262-b4f5c4ff983c","external_id":null,"type":"subscription","subscription_uuid":"sub_dd7ef9f2-1f60-4e36-bd8d-af8b20ad8f4f","subscription_external_id":"test_cus_sub_ext_id2","prorated":false,"proration_type":null,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","plan_uuid":"pl_ae02e740-34c6-013c-d52b-563f32a3b7a1","amount_in_cents":1000,"quantity":1,"discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"transaction_fees_in_cents":0,"account_code":"","transaction_fees_currency":null,"discount_description":null,"event_order":null}],"transactions":[]},{"uuid":"inv_3af9f740-b62d-4ce1-8f76-0f0bc051103e","date":"2016-01-01T12:00:00.000Z","due_date":null,"errors":{},"external_id":"test_tr_inv_ext_id1","currency":"USD","line_items":[{"uuid":"li_7e628982-0e79-40fb-814f-3a6625ea7f4a","external_id":null,"type":"subscription","subscription_uuid":"sub_6bb176ae-99a4-481d-8f48-1abe09a7fbfc","subscription_external_id":"test_cus_sub_ext_id1","prorated":false,"proration_type":null,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","plan_uuid":"pl_adcdb9f0-34c6-013c-82df-0230272d2d1f","amount_in_cents":1000,"quantity":1,"discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"transaction_fees_in_cents":0,"account_code":"","transaction_fees_currency":null,"discount_description":null,"event_order":null}],"transactions":[]}],"current_page":1,"total_pages":1,"cursor":"MjAyMy0wOS0xNFQwMDo1MDo1My4zNDkwNjMwMDBaJmludl8zYWY5Zjc0MC1iNjJkLTRjZTEtOGY3Ni0wZjBiYzA1MTEwM2U=","has_more":false}' + http_version: + recorded_at: Mon, 30 Oct 2023 01:19:18 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_subscriptions_belonging_to_the_customer_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_subscriptions_belonging_to_the_customer_correctly.yml new file mode 100644 index 0000000..abdf5db --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/lists_the_subscriptions_belonging_to_the_customer_correctly.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/import/customers/cus_23740208-2c7e-11ee-9ea2-ffd2435982bb/subscriptions + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 01:20:07 GMT + etag: + - W/"4768a84541be8c93daad8004bb61b017" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - f9d6070f5e6269168dc2c59c4bc8897a + x-runtime: + - '0.058804' + x-xss-protection: + - 1; mode=block + content-length: + - '692' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_23740208-2c7e-11ee-9ea2-ffd2435982bb","subscriptions":[{"external_id":"test_cus_sub_ext_id2","uuid":"sub_dd7ef9f2-1f60-4e36-bd8d-af8b20ad8f4f","cancellation_dates":[],"plan_uuid":"pl_ae02e740-34c6-013c-d52b-563f32a3b7a1","data_source_uuid":"ds_c0d412aa-5298-11ee-bb1f-332cea9687ed"},{"external_id":"test_cus_sub_ext_id1","uuid":"sub_6bb176ae-99a4-481d-8f48-1abe09a7fbfc","cancellation_dates":[],"plan_uuid":"pl_adcdb9f0-34c6-013c-82df-0230272d2d1f","data_source_uuid":"ds_c0d412aa-5298-11ee-bb1f-332cea9687ed"}],"current_page":1,"total_pages":1,"cursor":"MjAyMy0wOS0xNFQwMDo1MDo1My4zODY0OTgwMDBaJnN1Yl82YmIxNzZhZS05OWE0LTQ4MWQtOGY0OC0xYWJlMDlhN2ZiZmM=","has_more":false}' + http_version: + recorded_at: Mon, 30 Oct 2023 01:20:07 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/merges_customers_correctly_with_the_class_method.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/merges_customers_correctly_with_the_class_method.yml new file mode 100644 index 0000000..064cd48 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/merges_customers_correctly_with_the_class_method.yml @@ -0,0 +1,34 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.chartmogul.com/v1/customers/merges + body: + encoding: UTF-8 + string: '{"from":{"customer_uuid":"cus_c10aa086-5298-11ee-82da-ebac6f7a03c3"},"into":{"customer_uuid":"cus_23740208-2c7e-11ee-9ea2-ffd2435982bb"}}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 202 + message: Accepted + headers: + content-type: + - application/json + date: + - Sun, 29 Oct 2023 23:57:02 GMT + content-length: + - '2' + connection: + - keep-alive + body: + encoding: UTF-8 + string: "{}" + http_version: + recorded_at: Sun, 29 Oct 2023 23:57:02 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/merges_customers_correctly_with_the_instance_method.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/merges_customers_correctly_with_the_instance_method.yml new file mode 100644 index 0000000..5a293eb --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/merges_customers_correctly_with_the_instance_method.yml @@ -0,0 +1,106 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23740208-2c7e-11ee-9ea2-ffd2435982bb + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-encoding: + - gzip + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:05:45 GMT + vary: + - Accept-Encoding + content-length: + - '595' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJpZCI6MTE0MTY3NDUwLCJ1dWlkIjoiY3VzXzIzNzQwMjA4LTJjN2UtMTFlZS05ZWEyLWZmZDI0MzU5ODJiYiIsImV4dGVybmFsX2lkIjoiY3VzXzAwMiIsIm5hbWUiOiJKb2huIFNtaXRoIiwiZW1haWwiOiJqb2huQGV4YW1wbGUuY29tIiwic3RhdHVzIjoiQWN0aXZlIiwiY3VzdG9tZXItc2luY2UiOiIyMDE2LTAxLTAxVDEyOjAwOjAwKzAwOjAwIiwiYXR0cmlidXRlcyI6eyJjdXN0b20iOnt9LCJjbGVhcmJpdCI6e30sInN0cmlwZSI6e30sInRhZ3MiOlsiYXV0by1jaHVybmVkLWRlbGlucXVlbnQtc3Vic2NyaXB0aW9uIiwibWVyZ2VkLWN1c3RvbWVyIl19LCJkYXRhX3NvdXJjZV91dWlkIjoiZHNfMDNjZmQyYzQtMmM3ZS0xMWVlLWFiMjMtY2IwZjAwOGNmZjQ2IiwiZGF0YV9zb3VyY2VfdXVpZHMiOlsiZHNfMDNjZmQyYzQtMmM3ZS0xMWVlLWFiMjMtY2IwZjAwOGNmZjQ2IiwiZHNfYzBkNDEyYWEtNTI5OC0xMWVlLWJiMWYtMzMyY2VhOTY4N2VkIl0sImV4dGVybmFsX2lkcyI6WyJjdXNfMDAyIiwidGVzdF9jdXNfZXh0X2lkIl0sImNvbXBhbnkiOiJJbml0cm9kZSIsImNvdW50cnkiOiJVUyIsInN0YXRlIjoiQ0EiLCJjaXR5IjoiTW91bnRhaW4gVmlldyIsInppcCI6IjEyMzQ1IiwibGVhZF9jcmVhdGVkX2F0IjoiMjAxNS0xMS0wMVQwMDowMDowMC4wMDBaIiwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjoiMjAxNS0xMS0wN1QwMToyMDowMC4wMDBaIiwiYWRkcmVzcyI6eyJjb3VudHJ5IjoiVW5pdGVkIFN0YXRlcyIsInN0YXRlIjoiQ2FsaWZvcm5pYSIsImNpdHkiOiJNb3VudGFpbiBWaWV3IiwiYWRkcmVzc196aXAiOiIxMjM0NSJ9LCJtcnIiOjgwMDgsImFyciI6OTYwOTYsImJpbGxpbmctc3lzdGVtLXVybCI6bnVsbCwiY2hhcnRtb2d1bC11cmwiOiJodHRwczovL2FwcC5jaGFydG1vZ3VsLmNvbS8jL2N1c3RvbWVycy8xMTQxNjc0NTAtSW5pdHJvZGUiLCJiaWxsaW5nLXN5c3RlbS10eXBlIjoiR29vZ2xlIFNoZWV0cyIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsIm93bmVyIjpudWxsfQ== + http_version: + recorded_at: Mon, 30 Oct 2023 00:05:45 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_2706d304-76b7-11ee-93d6-5b3d820d37cd + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:05:45 GMT + content-length: + - '820' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJpZCI6MTMzMTYwOTk4LCJ1dWlkIjoiY3VzXzI3MDZkMzA0LTc2YjctMTFlZS05M2Q2LTViM2Q4MjBkMzdjZCIsImV4dGVybmFsX2lkIjoiY3VzXzAwOSIsIm5hbWUiOiIiLCJlbWFpbCI6IiIsInN0YXR1cyI6Ik5ldyBMZWFkIiwiY3VzdG9tZXItc2luY2UiOm51bGwsImF0dHJpYnV0ZXMiOnsiY3VzdG9tIjp7IlRvZ2dsZSI6dHJ1ZX0sImNsZWFyYml0Ijp7fSwic3RyaXBlIjp7fSwidGFncyI6W119LCJkYXRhX3NvdXJjZV91dWlkIjoiZHNfMDNjZmQyYzQtMmM3ZS0xMWVlLWFiMjMtY2IwZjAwOGNmZjQ2IiwiZGF0YV9zb3VyY2VfdXVpZHMiOlsiZHNfMDNjZmQyYzQtMmM3ZS0xMWVlLWFiMjMtY2IwZjAwOGNmZjQ2Il0sImV4dGVybmFsX2lkcyI6WyJjdXNfMDA5Il0sImNvbXBhbnkiOiJQaWVkIFBpcGVyIChzdGFnaW5nKSIsImNvdW50cnkiOiJBTCIsInN0YXRlIjpudWxsLCJjaXR5IjoiVGlyYW5hIiwiemlwIjpudWxsLCJsZWFkX2NyZWF0ZWRfYXQiOm51bGwsImZyZWVfdHJpYWxfc3RhcnRlZF9hdCI6bnVsbCwiYWRkcmVzcyI6eyJjb3VudHJ5IjoiQWxiYW5pYSIsInN0YXRlIjpudWxsLCJjaXR5IjoiVGlyYW5hIiwiYWRkcmVzc196aXAiOm51bGx9LCJtcnIiOjAsImFyciI6MCwiYmlsbGluZy1zeXN0ZW0tdXJsIjpudWxsLCJjaGFydG1vZ3VsLXVybCI6Imh0dHBzOi8vYXBwLmNoYXJ0bW9ndWwuY29tLyMvY3VzdG9tZXJzLzEzMzE2MDk5OC1QaWVkX1BpcGVyX3N0YWdpbmciLCJiaWxsaW5nLXN5c3RlbS10eXBlIjoiR29vZ2xlIFNoZWV0cyIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsIm93bmVyIjpudWxsfQ== + http_version: + recorded_at: Mon, 30 Oct 2023 00:05:45 GMT +- request: + method: post + uri: https://api.chartmogul.com/v1/customers/merges + body: + encoding: UTF-8 + string: '{"from":{"customer_uuid":"cus_2706d304-76b7-11ee-93d6-5b3d820d37cd"},"into":{"customer_uuid":"cus_23740208-2c7e-11ee-9ea2-ffd2435982bb"}}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 202 + message: Accepted + headers: + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:05:46 GMT + content-length: + - '2' + connection: + - keep-alive + body: + encoding: UTF-8 + string: "{}" + http_version: + recorded_at: Mon, 30 Oct 2023 00:05:46 GMT +recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_404_if_no_customers_found.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/raises_a_HTTP_404_if_searching_for_customers_does_not_find_any.yml similarity index 68% rename from fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_404_if_no_customers_found.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/raises_a_HTTP_404_if_searching_for_customers_does_not_find_any.yml index e94e11b..830f363 100644 --- a/fixtures/vcr_cassettes/ChartMogul_Customer/API_Interactions/raises_404_if_no_customers_found.yml +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/raises_a_HTTP_404_if_searching_for_customers_does_not_find_any.yml @@ -5,10 +5,10 @@ http_interactions: uri: https://api.chartmogul.com/v1/customers/search?email=no%40email.com body: encoding: UTF-8 - string: '{}' + string: "{}" headers: User-Agent: - - Faraday v0.9.2 + - chartmogul-ruby/3.3.1 Content-Type: - application/json Authorization: @@ -16,23 +16,19 @@ http_interactions: response: status: code: 404 - message: + message: Not Found headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:47:11 GMT content-type: - application/json + date: + - Mon, 30 Oct 2023 00:28:18 GMT content-length: - '94' connection: - - close - status: - - 404 Not Found + - Close body: encoding: UTF-8 string: '{"code":404,"message":"Can''t find any customers with email: \"no@email.com\"","param":"email"}' - http_version: - recorded_at: Wed, 29 Jun 2016 12:47:11 GMT -recorded_with: VCR 3.0.3 + http_version: + recorded_at: Mon, 30 Oct 2023 00:28:18 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/removes_custom_attributes_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/removes_custom_attributes_correctly.yml new file mode 100644 index 0000000..25f9eb4 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/removes_custom_attributes_correctly.yml @@ -0,0 +1,32 @@ +--- +http_interactions: +- request: + method: delete + uri: https://api.chartmogul.com/v1/customers/cus_23740208-2c7e-11ee-9ea2-ffd2435982bb/attributes/custom + body: + encoding: UTF-8 + string: '{"custom":["StringKey","integer_key","timestamp_key","boolean_key","Toggle"]}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 204 + message: No Content + headers: + access-control-allow-credentials: + - 'true' + date: + - Mon, 30 Oct 2023 00:52:22 GMT + connection: + - keep-alive + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Mon, 30 Oct 2023 00:52:23 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/removes_tags_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/removes_tags_correctly.yml new file mode 100644 index 0000000..550028d --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/removes_tags_correctly.yml @@ -0,0 +1,36 @@ +--- +http_interactions: +- request: + method: delete + uri: https://api.chartmogul.com/v1/customers/cus_23740208-2c7e-11ee-9ea2-ffd2435982bb/attributes/tags + body: + encoding: UTF-8 + string: '{"tags":["test-tag"]}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:36:11 GMT + content-length: + - '67' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"tags":["auto-churned-delinquent-subscription","merged-customer"]}' + http_version: + recorded_at: Mon, 30 Oct 2023 00:36:11 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/retrieves_the_customer_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/retrieves_the_customer_correctly.yml new file mode 100644 index 0000000..2f7c250 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/retrieves_the_customer_correctly.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23e01538-2c7e-11ee-b2ce-fb986e96e21b + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 21:45:25 GMT + content-length: + - '913' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJpZCI6MTE0MTY3NDUyLCJ1dWlkIjoiY3VzXzIzZTAxNTM4LTJjN2UtMTFlZS1iMmNlLWZiOTg2ZTk2ZTIxYiIsImV4dGVybmFsX2lkIjoiY3VzXzAwNCIsIm5hbWUiOiJSaWNoYXJkIEhlbmRyaWNrcyIsImVtYWlsIjoiY3VzdG9tZXJAZXhhbXBsZS5jb20iLCJzdGF0dXMiOiJOZXcgTGVhZCIsImN1c3RvbWVyLXNpbmNlIjpudWxsLCJhdHRyaWJ1dGVzIjp7ImN1c3RvbSI6e30sImNsZWFyYml0Ijp7fSwic3RyaXBlIjp7fSwidGFncyI6WyJtYW5hZ2VkIl19LCJkYXRhX3NvdXJjZV91dWlkIjoiZHNfMDNjZmQyYzQtMmM3ZS0xMWVlLWFiMjMtY2IwZjAwOGNmZjQ2IiwiZGF0YV9zb3VyY2VfdXVpZHMiOlsiZHNfMDNjZmQyYzQtMmM3ZS0xMWVlLWFiMjMtY2IwZjAwOGNmZjQ2Il0sImV4dGVybmFsX2lkcyI6WyJjdXNfMDA0Il0sImNvbXBhbnkiOiJQaWVkIFBpcGVyIiwiY291bnRyeSI6IlVTIiwic3RhdGUiOiJDQSIsImNpdHkiOiJTYW4gRnJhbmNpc2NvIiwiemlwIjoiMTIzNDUiLCJsZWFkX2NyZWF0ZWRfYXQiOiIyMDE1LTExLTAxVDAwOjAwOjAwLjAwMFoiLCJmcmVlX3RyaWFsX3N0YXJ0ZWRfYXQiOiIyMDE1LTExLTA3VDAxOjIwOjAwLjAwMFoiLCJhZGRyZXNzIjp7ImNvdW50cnkiOiJVbml0ZWQgU3RhdGVzIiwic3RhdGUiOiJDYWxpZm9ybmlhIiwiY2l0eSI6IlNhbiBGcmFuY2lzY28iLCJhZGRyZXNzX3ppcCI6IjEyMzQ1In0sIm1yciI6MCwiYXJyIjowLCJiaWxsaW5nLXN5c3RlbS11cmwiOm51bGwsImNoYXJ0bW9ndWwtdXJsIjoiaHR0cHM6Ly9hcHAuY2hhcnRtb2d1bC5jb20vIy9jdXN0b21lcnMvMTE0MTY3NDUyLVBpZWRfUGlwZXIiLCJiaWxsaW5nLXN5c3RlbS10eXBlIjoiR29vZ2xlIFNoZWV0cyIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsIm93bmVyIjpudWxsfQ== + http_version: + recorded_at: Sun, 29 Oct 2023 21:45:25 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/searches_for_customers_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/searches_for_customers_correctly.yml new file mode 100644 index 0000000..413bdc0 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/searches_for_customers_correctly.yml @@ -0,0 +1,41 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/search?email=gavin%40example.com + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-encoding: + - gzip + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:22:30 GMT + vary: + - Accept-Encoding + content-length: + - '609' + connection: + - Close + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MTE0MTY3NDUxLCJ1dWlkIjoiY3VzXzIzYzExY2YwLTJjN2UtMTFlZS1iMmNkLWZiZmQ2ODFhMzRkZCIsImV4dGVybmFsX2lkIjoiY3VzXzAwMyIsIm5hbWUiOiJHYXZpbiBCZWxzb24iLCJlbWFpbCI6ImdhdmluQGV4YW1wbGUuY29tIiwic3RhdHVzIjoiQ2FuY2VsbGVkIiwiY3VzdG9tZXItc2luY2UiOiIyMDE2LTAxLTI1VDAwOjAwOjAwKzAwOjAwIiwiYXR0cmlidXRlcyI6eyJjdXN0b20iOnt9LCJjbGVhcmJpdCI6e30sInN0cmlwZSI6e30sInRhZ3MiOlsibWFuYWdlZCIsImF1dG8tY2h1cm5lZC1kZWxpbnF1ZW50LXN1YnNjcmlwdGlvbiJdfSwiZGF0YV9zb3VyY2VfdXVpZCI6ImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiIsImRhdGFfc291cmNlX3V1aWRzIjpbImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiJdLCJleHRlcm5hbF9pZHMiOlsiY3VzXzAwMyJdLCJjb21wYW55IjoiSG9vbGkiLCJjb3VudHJ5IjpudWxsLCJzdGF0ZSI6bnVsbCwiY2l0eSI6IiIsInppcCI6bnVsbCwibGVhZF9jcmVhdGVkX2F0IjoiMjAxNS0xMS0wMVQwMDowMDowMC4wMDBaIiwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjoiMjAxNS0xMS0wN1QwMToyMDowMC4wMDBaIiwiYWRkcmVzcyI6eyJjb3VudHJ5IjpudWxsLCJzdGF0ZSI6bnVsbCwiY2l0eSI6IiIsImFkZHJlc3NfemlwIjpudWxsfSwibXJyIjowLCJhcnIiOjAsImJpbGxpbmctc3lzdGVtLXVybCI6bnVsbCwiY2hhcnRtb2d1bC11cmwiOiJodHRwczovL2FwcC5jaGFydG1vZ3VsLmNvbS8jL2N1c3RvbWVycy8xMTQxNjc0NTEtSG9vbGkiLCJiaWxsaW5nLXN5c3RlbS10eXBlIjoiR29vZ2xlIFNoZWV0cyIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsIm93bmVyIjpudWxsfV0sImN1cnJlbnRfcGFnZSI6MSwidG90YWxfcGFnZXMiOm51bGwsImhhc19tb3JlIjpmYWxzZSwicGVyX3BhZ2UiOjIwMCwicGFnZSI6MSwiY3Vyc29yIjoiTWpBeE5pMHdNUzB5TlZRd01Eb3dNRG93TUM0d01EQXdNREF3TURCYUpqRXhOREUyTnpRMU1RPT0ifQ== + http_version: + recorded_at: Mon, 30 Oct 2023 00:22:30 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_custom_attributes_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_custom_attributes_correctly.yml new file mode 100644 index 0000000..977f16e --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_custom_attributes_correctly.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: put + uri: https://api.chartmogul.com/v1/customers/cus_23740208-2c7e-11ee-9ea2-ffd2435982bb/attributes/custom + body: + encoding: UTF-8 + string: '{"custom":{"StringKey":"Another String Value","integer_key":5678,"timestamp_key":"2016-02-01 + 00:00:00 UTC","boolean_key":false,"Toggle":false}}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:47:16 GMT + content-length: + - '144' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"custom":{"Toggle":false,"StringKey":"Another String Value","integer_key":5678,"timestamp_key":"2016-02-01T00:00:00.000Z","boolean_key":false}}' + http_version: + recorded_at: Mon, 30 Oct 2023 00:47:16 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_customer_correctly_with_the_class_method.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_customer_correctly_with_the_class_method.yml new file mode 100644 index 0000000..8e86e7c --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_customer_correctly_with_the_class_method.yml @@ -0,0 +1,38 @@ +--- +http_interactions: +- request: + method: patch + uri: https://api.chartmogul.com/v1/customers/cus_a4680a9c-76a4-11ee-83ab-d3b9aabc7f00 + body: + encoding: UTF-8 + string: '{"attributes":{"custom":{"Toggle":false}},"name":"Test Customer","email":"customer_test@example.com","company":"Curry + 42"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 23:40:02 GMT + content-length: + - '920' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJpZCI6MTMzMTQ5MTQ1LCJ1dWlkIjoiY3VzX2E0NjgwYTljLTc2YTQtMTFlZS04M2FiLWQzYjlhYWJjN2YwMCIsImV4dGVybmFsX2lkIjoiY3VzXzAwNyIsIm5hbWUiOiJUZXN0IEN1c3RvbWVyIiwiZW1haWwiOiJjdXN0b21lcl90ZXN0QGV4YW1wbGUuY29tIiwic3RhdHVzIjoiTmV3IExlYWQiLCJjdXN0b21lci1zaW5jZSI6bnVsbCwiYXR0cmlidXRlcyI6eyJjdXN0b20iOnsiVG9nZ2xlIjp0cnVlfSwiY2xlYXJiaXQiOnt9LCJzdHJpcGUiOnt9LCJ0YWdzIjpbInd1cnN0Il19LCJkYXRhX3NvdXJjZV91dWlkIjoiZHNfMDNjZmQyYzQtMmM3ZS0xMWVlLWFiMjMtY2IwZjAwOGNmZjQ2IiwiZGF0YV9zb3VyY2VfdXVpZHMiOlsiZHNfMDNjZmQyYzQtMmM3ZS0xMWVlLWFiMjMtY2IwZjAwOGNmZjQ2Il0sImV4dGVybmFsX2lkcyI6WyJjdXNfMDA3Il0sImNvbXBhbnkiOiJDdXJyeSA0MiIsImNvdW50cnkiOiJERSIsInN0YXRlIjpudWxsLCJjaXR5IjoiQmVybGluIiwiemlwIjpudWxsLCJsZWFkX2NyZWF0ZWRfYXQiOiIyMDE2LTAxLTAxVDE0OjMwOjAwLjAwMFoiLCJmcmVlX3RyaWFsX3N0YXJ0ZWRfYXQiOiIyMDE2LTAyLTAyVDIyOjQwOjAwLjAwMFoiLCJhZGRyZXNzIjp7ImNvdW50cnkiOiJHZXJtYW55Iiwic3RhdGUiOm51bGwsImNpdHkiOiJCZXJsaW4iLCJhZGRyZXNzX3ppcCI6bnVsbH0sIm1yciI6MCwiYXJyIjowLCJiaWxsaW5nLXN5c3RlbS11cmwiOm51bGwsImNoYXJ0bW9ndWwtdXJsIjoiaHR0cHM6Ly9hcHAuY2hhcnRtb2d1bC5jb20vIy9jdXN0b21lcnMvMTMzMTQ5MTQ1LUN1cnJ5XzQyIiwiYmlsbGluZy1zeXN0ZW0tdHlwZSI6Ikdvb2dsZSBTaGVldHMiLCJjdXJyZW5jeSI6IkVVUiIsImN1cnJlbmN5LXNpZ24iOiLigqwiLCJvd25lciI6ImJydW5vK2NoYXJ0bW9ndWx0ZXN0QGNoYXJ0bW9ndWwuY29tIn0= + http_version: + recorded_at: Sun, 29 Oct 2023 23:40:02 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_the_customer_correctly_with_the_instance_method.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_the_customer_correctly_with_the_instance_method.yml new file mode 100644 index 0000000..ae7c162 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/updates_the_customer_correctly_with_the_instance_method.yml @@ -0,0 +1,73 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_a4680a9c-76a4-11ee-83ab-d3b9aabc7f00 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 22:52:46 GMT + content-length: + - '859' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJpZCI6MTMzMTQ5MTQ1LCJ1dWlkIjoiY3VzX2E0NjgwYTljLTc2YTQtMTFlZS04M2FiLWQzYjlhYWJjN2YwMCIsImV4dGVybmFsX2lkIjoiY3VzXzAwNyIsIm5hbWUiOiJOZXcgQ3VzdG9tZXIiLCJlbWFpbCI6Im5ld19jdXN0b21lckBleGFtcGxlLmNvbSIsInN0YXR1cyI6Ik5ldyBMZWFkIiwiY3VzdG9tZXItc2luY2UiOm51bGwsImF0dHJpYnV0ZXMiOnsiY3VzdG9tIjp7IlRvZ2dsZSI6ZmFsc2V9LCJjbGVhcmJpdCI6e30sInN0cmlwZSI6e30sInRhZ3MiOltdfSwiZGF0YV9zb3VyY2VfdXVpZCI6ImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiIsImRhdGFfc291cmNlX3V1aWRzIjpbImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiJdLCJleHRlcm5hbF9pZHMiOlsiY3VzXzAwNyJdLCJjb21wYW55IjoiIiwiY291bnRyeSI6bnVsbCwic3RhdGUiOm51bGwsImNpdHkiOiJCZXJsaW4iLCJ6aXAiOm51bGwsImxlYWRfY3JlYXRlZF9hdCI6bnVsbCwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjpudWxsLCJhZGRyZXNzIjp7ImNvdW50cnkiOm51bGwsInN0YXRlIjpudWxsLCJjaXR5IjoiQmVybGluIiwiYWRkcmVzc196aXAiOm51bGx9LCJtcnIiOjAsImFyciI6MCwiYmlsbGluZy1zeXN0ZW0tdXJsIjpudWxsLCJjaGFydG1vZ3VsLXVybCI6Imh0dHBzOi8vYXBwLmNoYXJ0bW9ndWwuY29tLyMvY3VzdG9tZXJzLzEzMzE0OTE0NS1OZXdfQ3VzdG9tZXIiLCJiaWxsaW5nLXN5c3RlbS10eXBlIjoiR29vZ2xlIFNoZWV0cyIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsIm93bmVyIjoiYnJ1bm8rY2hhcnRtb2d1bHRlc3RAY2hhcnRtb2d1bC5jb20ifQ== + http_version: + recorded_at: Sun, 29 Oct 2023 22:52:46 GMT +- request: + method: patch + uri: https://api.chartmogul.com/v1/customers/cus_a4680a9c-76a4-11ee-83ab-d3b9aabc7f00 + body: + encoding: UTF-8 + string: '{"attributes":{"tags":["wurst"],"custom":{"Toggle":true}},"external_id":"cus_007","name":"Currywurst","email":"curry@wurst.com","company":"Curry + 36","country":"DE","state":"NY","city":"Berlin","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","lead_created_at":"2016-01-01 + 14:30:00 UTC","free_trial_started_at":"2016-02-02 22:40:00 UTC","owner":"owner@chartmogul.com"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Sun, 29 Oct 2023 22:52:46 GMT + content-length: + - '907' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJpZCI6MTMzMTQ5MTQ1LCJ1dWlkIjoiY3VzX2E0NjgwYTljLTc2YTQtMTFlZS04M2FiLWQzYjlhYWJjN2YwMCIsImV4dGVybmFsX2lkIjoiY3VzXzAwNyIsIm5hbWUiOiJDdXJyeXd1cnN0IiwiZW1haWwiOiJjdXJyeUB3dXJzdC5jb20iLCJzdGF0dXMiOiJOZXcgTGVhZCIsImN1c3RvbWVyLXNpbmNlIjpudWxsLCJhdHRyaWJ1dGVzIjp7ImN1c3RvbSI6eyJUb2dnbGUiOnRydWV9LCJjbGVhcmJpdCI6e30sInN0cmlwZSI6e30sInRhZ3MiOlsid3Vyc3QiXX0sImRhdGFfc291cmNlX3V1aWQiOiJkc18wM2NmZDJjNC0yYzdlLTExZWUtYWIyMy1jYjBmMDA4Y2ZmNDYiLCJkYXRhX3NvdXJjZV91dWlkcyI6WyJkc18wM2NmZDJjNC0yYzdlLTExZWUtYWIyMy1jYjBmMDA4Y2ZmNDYiXSwiZXh0ZXJuYWxfaWRzIjpbImN1c18wMDciXSwiY29tcGFueSI6IkN1cnJ5IDM2IiwiY291bnRyeSI6IkRFIiwic3RhdGUiOm51bGwsImNpdHkiOiJCZXJsaW4iLCJ6aXAiOm51bGwsImxlYWRfY3JlYXRlZF9hdCI6IjIwMTYtMDEtMDFUMTQ6MzA6MDAuMDAwWiIsImZyZWVfdHJpYWxfc3RhcnRlZF9hdCI6IjIwMTYtMDItMDJUMjI6NDA6MDAuMDAwWiIsImFkZHJlc3MiOnsiY291bnRyeSI6Ikdlcm1hbnkiLCJzdGF0ZSI6bnVsbCwiY2l0eSI6IkJlcmxpbiIsImFkZHJlc3NfemlwIjpudWxsfSwibXJyIjowLCJhcnIiOjAsImJpbGxpbmctc3lzdGVtLXVybCI6bnVsbCwiY2hhcnRtb2d1bC11cmwiOiJodHRwczovL2FwcC5jaGFydG1vZ3VsLmNvbS8jL2N1c3RvbWVycy8xMzMxNDkxNDUtQ3VycnlfMzYiLCJiaWxsaW5nLXN5c3RlbS10eXBlIjoiR29vZ2xlIFNoZWV0cyIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsIm93bmVyIjoiYnJ1bm8rY2hhcnRtb2d1bHRlc3RAY2hhcnRtb2d1bC5jb20ifQ== + http_version: + recorded_at: Sun, 29 Oct 2023 22:52:46 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_new_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_new_pagination/paginates_correctly.yml new file mode 100644 index 0000000..b448b79 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_new_pagination/paginates_correctly.yml @@ -0,0 +1,79 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-encoding: + - gzip + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:18:51 GMT + vary: + - Accept-Encoding + content-length: + - '713' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MTE0MTY3NDUwLCJ1dWlkIjoiY3VzXzIzNzQwMjA4LTJjN2UtMTFlZS05ZWEyLWZmZDI0MzU5ODJiYiIsImV4dGVybmFsX2lkIjoiY3VzXzAwMiIsIm5hbWUiOiJKb2huIFNtaXRoIiwiZW1haWwiOiJqb2huQGV4YW1wbGUuY29tIiwic3RhdHVzIjoiQWN0aXZlIiwiY3VzdG9tZXItc2luY2UiOiIyMDE2LTAxLTAxVDEyOjAwOjAwKzAwOjAwIiwiYXR0cmlidXRlcyI6eyJjdXN0b20iOnsiVG9nZ2xlIjp0cnVlfSwiY2xlYXJiaXQiOnt9LCJzdHJpcGUiOnt9LCJ0YWdzIjpbImF1dG8tY2h1cm5lZC1kZWxpbnF1ZW50LXN1YnNjcmlwdGlvbiIsIm1lcmdlZC1jdXN0b21lciJdfSwiZGF0YV9zb3VyY2VfdXVpZCI6ImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiIsImRhdGFfc291cmNlX3V1aWRzIjpbImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiIsImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiIsImRzX2MwZDQxMmFhLTUyOTgtMTFlZS1iYjFmLTMzMmNlYTk2ODdlZCJdLCJleHRlcm5hbF9pZHMiOlsiY3VzXzAwMiIsImN1c18wMDkiLCJ0ZXN0X2N1c19leHRfaWQiXSwiY29tcGFueSI6IkluaXRyb2RlIiwiY291bnRyeSI6IlVTIiwic3RhdGUiOiJDQSIsImNpdHkiOiJNb3VudGFpbiBWaWV3IiwiemlwIjoiMTIzNDUiLCJsZWFkX2NyZWF0ZWRfYXQiOiIyMDE1LTExLTAxVDAwOjAwOjAwLjAwMFoiLCJmcmVlX3RyaWFsX3N0YXJ0ZWRfYXQiOiIyMDE1LTExLTA3VDAxOjIwOjAwLjAwMFoiLCJhZGRyZXNzIjp7ImNvdW50cnkiOiJVbml0ZWQgU3RhdGVzIiwic3RhdGUiOiJDYWxpZm9ybmlhIiwiY2l0eSI6Ik1vdW50YWluIFZpZXciLCJhZGRyZXNzX3ppcCI6IjEyMzQ1In0sIm1yciI6ODAwOCwiYXJyIjo5NjA5NiwiYmlsbGluZy1zeXN0ZW0tdXJsIjpudWxsLCJjaGFydG1vZ3VsLXVybCI6Imh0dHBzOi8vYXBwLmNoYXJ0bW9ndWwuY29tLyMvY3VzdG9tZXJzLzExNDE2NzQ1MC1Jbml0cm9kZSIsImJpbGxpbmctc3lzdGVtLXR5cGUiOiJHb29nbGUgU2hlZXRzIiwiY3VycmVuY3kiOiJFVVIiLCJjdXJyZW5jeS1zaWduIjoi4oKsIiwib3duZXIiOm51bGx9XSwiY3VycmVudF9wYWdlIjoxLCJ0b3RhbF9wYWdlcyI6MTksImhhc19tb3JlIjp0cnVlLCJwZXJfcGFnZSI6MSwicGFnZSI6MSwiY3Vyc29yIjoiTWpBeE5pMHdNUzB3TVZReE1qb3dNRG93TUM0d01EQXdNREF3TURCYUpqRXhOREUyTnpRMU1BPT0ifQ== + http_version: + recorded_at: Mon, 30 Oct 2023 00:18:51 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/customers?cursor=MjAxNi0wMS0wMVQxMjowMDowMC4wMDAwMDAwMDBaJjExNDE2NzQ1MA%3D%3D&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-encoding: + - gzip + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:18:51 GMT + vary: + - Accept-Encoding + transfer-encoding: + - chunked + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MTE0MTY3NDUxLCJ1dWlkIjoiY3VzXzIzYzExY2YwLTJjN2UtMTFlZS1iMmNkLWZiZmQ2ODFhMzRkZCIsImV4dGVybmFsX2lkIjoiY3VzXzAwMyIsIm5hbWUiOiJHYXZpbiBCZWxzb24iLCJlbWFpbCI6ImdhdmluQGV4YW1wbGUuY29tIiwic3RhdHVzIjoiQ2FuY2VsbGVkIiwiY3VzdG9tZXItc2luY2UiOiIyMDE2LTAxLTI1VDAwOjAwOjAwKzAwOjAwIiwiYXR0cmlidXRlcyI6eyJjdXN0b20iOnt9LCJjbGVhcmJpdCI6e30sInN0cmlwZSI6e30sInRhZ3MiOlsibWFuYWdlZCIsImF1dG8tY2h1cm5lZC1kZWxpbnF1ZW50LXN1YnNjcmlwdGlvbiJdfSwiZGF0YV9zb3VyY2VfdXVpZCI6ImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiIsImRhdGFfc291cmNlX3V1aWRzIjpbImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiJdLCJleHRlcm5hbF9pZHMiOlsiY3VzXzAwMyJdLCJjb21wYW55IjoiSG9vbGkiLCJjb3VudHJ5IjpudWxsLCJzdGF0ZSI6bnVsbCwiY2l0eSI6IiIsInppcCI6bnVsbCwibGVhZF9jcmVhdGVkX2F0IjoiMjAxNS0xMS0wMVQwMDowMDowMC4wMDBaIiwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjoiMjAxNS0xMS0wN1QwMToyMDowMC4wMDBaIiwiYWRkcmVzcyI6eyJjb3VudHJ5IjpudWxsLCJzdGF0ZSI6bnVsbCwiY2l0eSI6IiIsImFkZHJlc3NfemlwIjpudWxsfSwibXJyIjowLCJhcnIiOjAsImJpbGxpbmctc3lzdGVtLXVybCI6bnVsbCwiY2hhcnRtb2d1bC11cmwiOiJodHRwczovL2FwcC5jaGFydG1vZ3VsLmNvbS8jL2N1c3RvbWVycy8xMTQxNjc0NTEtSG9vbGkiLCJiaWxsaW5nLXN5c3RlbS10eXBlIjoiR29vZ2xlIFNoZWV0cyIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsIm93bmVyIjpudWxsfV0sImN1cnNvciI6Ik1qQXhOaTB3TVMweU5WUXdNRG93TURvd01DNHdNREF3TURBd01EQmFKakV4TkRFMk56UTFNUT09IiwiaGFzX21vcmUiOnRydWV9 + http_version: + recorded_at: Mon, 30 Oct 2023 00:18:51 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_new_pagination/paginates_the_/search_endpoint_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_new_pagination/paginates_the_/search_endpoint_correctly.yml new file mode 100644 index 0000000..d42a69f --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_new_pagination/paginates_the_/search_endpoint_correctly.yml @@ -0,0 +1,41 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/search?email=gavin%40example.com&per_page=1 + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-encoding: + - gzip + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:26:54 GMT + vary: + - Accept-Encoding + content-length: + - '607' + connection: + - Close + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MTE0MTY3NDUxLCJ1dWlkIjoiY3VzXzIzYzExY2YwLTJjN2UtMTFlZS1iMmNkLWZiZmQ2ODFhMzRkZCIsImV4dGVybmFsX2lkIjoiY3VzXzAwMyIsIm5hbWUiOiJHYXZpbiBCZWxzb24iLCJlbWFpbCI6ImdhdmluQGV4YW1wbGUuY29tIiwic3RhdHVzIjoiQ2FuY2VsbGVkIiwiY3VzdG9tZXItc2luY2UiOiIyMDE2LTAxLTI1VDAwOjAwOjAwKzAwOjAwIiwiYXR0cmlidXRlcyI6eyJjdXN0b20iOnt9LCJjbGVhcmJpdCI6e30sInN0cmlwZSI6e30sInRhZ3MiOlsibWFuYWdlZCIsImF1dG8tY2h1cm5lZC1kZWxpbnF1ZW50LXN1YnNjcmlwdGlvbiJdfSwiZGF0YV9zb3VyY2VfdXVpZCI6ImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiIsImRhdGFfc291cmNlX3V1aWRzIjpbImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiJdLCJleHRlcm5hbF9pZHMiOlsiY3VzXzAwMyJdLCJjb21wYW55IjoiSG9vbGkiLCJjb3VudHJ5IjpudWxsLCJzdGF0ZSI6bnVsbCwiY2l0eSI6IiIsInppcCI6bnVsbCwibGVhZF9jcmVhdGVkX2F0IjoiMjAxNS0xMS0wMVQwMDowMDowMC4wMDBaIiwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjoiMjAxNS0xMS0wN1QwMToyMDowMC4wMDBaIiwiYWRkcmVzcyI6eyJjb3VudHJ5IjpudWxsLCJzdGF0ZSI6bnVsbCwiY2l0eSI6IiIsImFkZHJlc3NfemlwIjpudWxsfSwibXJyIjowLCJhcnIiOjAsImJpbGxpbmctc3lzdGVtLXVybCI6bnVsbCwiY2hhcnRtb2d1bC11cmwiOiJodHRwczovL2FwcC5jaGFydG1vZ3VsLmNvbS8jL2N1c3RvbWVycy8xMTQxNjc0NTEtSG9vbGkiLCJiaWxsaW5nLXN5c3RlbS10eXBlIjoiR29vZ2xlIFNoZWV0cyIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsIm93bmVyIjpudWxsfV0sImN1cnJlbnRfcGFnZSI6MSwidG90YWxfcGFnZXMiOm51bGwsImhhc19tb3JlIjpmYWxzZSwicGVyX3BhZ2UiOjEsInBhZ2UiOjEsImN1cnNvciI6Ik1qQXhOaTB3TVMweU5WUXdNRG93TURvd01DNHdNREF3TURBd01EQmFKakV4TkRFMk56UTFNUT09In0= + http_version: + recorded_at: Mon, 30 Oct 2023 00:26:54 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_old_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_old_pagination/paginates_correctly.yml new file mode 100644 index 0000000..e9505fc --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_old_pagination/paginates_correctly.yml @@ -0,0 +1,41 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers?page=3&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-encoding: + - gzip + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:13:15 GMT + vary: + - Accept-Encoding + transfer-encoding: + - chunked + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MTE0MTY3NDQ5LCJ1dWlkIjoiY3VzXzIzNTUxNTk2LTJjN2UtMTFlZS05ZWExLTJiZmUxOTM2NDBjMCIsImV4dGVybmFsX2lkIjoiY3VzXzAwMSIsIm5hbWUiOiJQZXRlciBHaWJib25zIiwiZW1haWwiOiJwZXRlckBleGFtcGxlLmNvbSIsInN0YXR1cyI6IkNhbmNlbGxlZCIsImN1c3RvbWVyLXNpbmNlIjoiMjAxNi0wMi0yNFQwMDowMDowMCswMDowMCIsImF0dHJpYnV0ZXMiOnsiY3VzdG9tIjp7fSwiY2xlYXJiaXQiOnt9LCJzdHJpcGUiOnt9LCJ0YWdzIjpbImF1dG8tY2h1cm5lZC1kZWxpbnF1ZW50LXN1YnNjcmlwdGlvbiJdfSwiZGF0YV9zb3VyY2VfdXVpZCI6ImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiIsImRhdGFfc291cmNlX3V1aWRzIjpbImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiJdLCJleHRlcm5hbF9pZHMiOlsiY3VzXzAwMSJdLCJjb21wYW55IjoiSW5pdGVjaCIsImNvdW50cnkiOiJVUyIsInN0YXRlIjoiQ0EiLCJjaXR5IjoiU2FuIEZyYW5jaXNjbyIsInppcCI6IjEyMzQ1IiwibGVhZF9jcmVhdGVkX2F0IjoiMjAxNS0xMS0wMVQwMDowMDowMC4wMDBaIiwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjoiMjAxNS0xMS0wN1QwMToyMDowMC4wMDBaIiwiYWRkcmVzcyI6eyJjb3VudHJ5IjoiVW5pdGVkIFN0YXRlcyIsInN0YXRlIjoiQ2FsaWZvcm5pYSIsImNpdHkiOiJTYW4gRnJhbmNpc2NvIiwiYWRkcmVzc196aXAiOiIxMjM0NSJ9LCJtcnIiOjAsImFyciI6MCwiYmlsbGluZy1zeXN0ZW0tdXJsIjpudWxsLCJjaGFydG1vZ3VsLXVybCI6Imh0dHBzOi8vYXBwLmNoYXJ0bW9ndWwuY29tLyMvY3VzdG9tZXJzLzExNDE2NzQ0OS1Jbml0ZWNoIiwiYmlsbGluZy1zeXN0ZW0tdHlwZSI6Ikdvb2dsZSBTaGVldHMiLCJjdXJyZW5jeSI6IkVVUiIsImN1cnJlbmN5LXNpZ24iOiLigqwiLCJvd25lciI6bnVsbH1dLCJjdXJyZW50X3BhZ2UiOjMsInRvdGFsX3BhZ2VzIjoxOSwiaGFzX21vcmUiOnRydWUsInBlcl9wYWdlIjoxLCJwYWdlIjozfQ== + http_version: + recorded_at: Mon, 30 Oct 2023 00:13:15 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_old_pagination/paginates_the_/search_endpoint_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_old_pagination/paginates_the_/search_endpoint_correctly.yml new file mode 100644 index 0000000..bd882dc --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/API_Actions/with_old_pagination/paginates_the_/search_endpoint_correctly.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/search?email=gavin%40example.com&page=1&per_page=1 + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Mon, 30 Oct 2023 00:26:11 GMT + content-length: + - '996' + connection: + - Close + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MTE0MTY3NDUxLCJ1dWlkIjoiY3VzXzIzYzExY2YwLTJjN2UtMTFlZS1iMmNkLWZiZmQ2ODFhMzRkZCIsImV4dGVybmFsX2lkIjoiY3VzXzAwMyIsIm5hbWUiOiJHYXZpbiBCZWxzb24iLCJlbWFpbCI6ImdhdmluQGV4YW1wbGUuY29tIiwic3RhdHVzIjoiQ2FuY2VsbGVkIiwiY3VzdG9tZXItc2luY2UiOiIyMDE2LTAxLTI1VDAwOjAwOjAwKzAwOjAwIiwiYXR0cmlidXRlcyI6eyJjdXN0b20iOnt9LCJjbGVhcmJpdCI6e30sInN0cmlwZSI6e30sInRhZ3MiOlsibWFuYWdlZCIsImF1dG8tY2h1cm5lZC1kZWxpbnF1ZW50LXN1YnNjcmlwdGlvbiJdfSwiZGF0YV9zb3VyY2VfdXVpZCI6ImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiIsImRhdGFfc291cmNlX3V1aWRzIjpbImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiJdLCJleHRlcm5hbF9pZHMiOlsiY3VzXzAwMyJdLCJjb21wYW55IjoiSG9vbGkiLCJjb3VudHJ5IjpudWxsLCJzdGF0ZSI6bnVsbCwiY2l0eSI6IiIsInppcCI6bnVsbCwibGVhZF9jcmVhdGVkX2F0IjoiMjAxNS0xMS0wMVQwMDowMDowMC4wMDBaIiwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjoiMjAxNS0xMS0wN1QwMToyMDowMC4wMDBaIiwiYWRkcmVzcyI6eyJjb3VudHJ5IjpudWxsLCJzdGF0ZSI6bnVsbCwiY2l0eSI6IiIsImFkZHJlc3NfemlwIjpudWxsfSwibXJyIjowLCJhcnIiOjAsImJpbGxpbmctc3lzdGVtLXVybCI6bnVsbCwiY2hhcnRtb2d1bC11cmwiOiJodHRwczovL2FwcC5jaGFydG1vZ3VsLmNvbS8jL2N1c3RvbWVycy8xMTQxNjc0NTEtSG9vbGkiLCJiaWxsaW5nLXN5c3RlbS10eXBlIjoiR29vZ2xlIFNoZWV0cyIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsIm93bmVyIjpudWxsfV0sImN1cnJlbnRfcGFnZSI6MSwidG90YWxfcGFnZXMiOm51bGwsImhhc19tb3JlIjpmYWxzZSwicGVyX3BhZ2UiOjEsInBhZ2UiOjF9 + http_version: + recorded_at: Mon, 30 Oct 2023 00:26:11 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/returns_matching_user_if_exists.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/returns_matching_user_if_exists.yml new file mode 100644 index 0000000..b5aa65b --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/returns_matching_user_if_exists.yml @@ -0,0 +1,41 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers?external_id=test_cus_ext_id + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-encoding: + - gzip + content-type: + - application/json + date: + - Sun, 29 Oct 2023 21:13:51 GMT + vary: + - Accept-Encoding + transfer-encoding: + - chunked + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MTE5NDE0Njk5LCJ1dWlkIjoiY3VzX2MxMGFhMDg2LTUyOTgtMTFlZS04MmRhLWViYWM2ZjdhMDNjMyIsImV4dGVybmFsX2lkIjoidGVzdF9jdXNfZXh0X2lkIiwibmFtZSI6IlRlc3QgQ3VzdG9tZXIiLCJlbWFpbCI6IiIsInN0YXR1cyI6IkFjdGl2ZSIsImN1c3RvbWVyLXNpbmNlIjoiMjAxNi0wMS0wMVQxMjowMDowMCswMDowMCIsImF0dHJpYnV0ZXMiOnsiY3VzdG9tIjp7fSwiY2xlYXJiaXQiOnt9LCJzdHJpcGUiOnt9LCJ0YWdzIjpbXX0sImRhdGFfc291cmNlX3V1aWQiOiJkc19jMGQ0MTJhYS01Mjk4LTExZWUtYmIxZi0zMzJjZWE5Njg3ZWQiLCJkYXRhX3NvdXJjZV91dWlkcyI6WyJkc19jMGQ0MTJhYS01Mjk4LTExZWUtYmIxZi0zMzJjZWE5Njg3ZWQiXSwiZXh0ZXJuYWxfaWRzIjpbInRlc3RfY3VzX2V4dF9pZCJdLCJjb21wYW55IjoiIiwiY291bnRyeSI6bnVsbCwic3RhdGUiOm51bGwsImNpdHkiOiIiLCJ6aXAiOm51bGwsImxlYWRfY3JlYXRlZF9hdCI6bnVsbCwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjpudWxsLCJhZGRyZXNzIjp7ImNvdW50cnkiOm51bGwsInN0YXRlIjpudWxsLCJjaXR5IjoiIiwiYWRkcmVzc196aXAiOm51bGx9LCJtcnIiOjgwMDgsImFyciI6OTYwOTYsImJpbGxpbmctc3lzdGVtLXVybCI6bnVsbCwiY2hhcnRtb2d1bC11cmwiOiJodHRwczovL2FwcC5jaGFydG1vZ3VsLmNvbS8jL2N1c3RvbWVycy8xMTk0MTQ2OTktVGVzdF9DdXN0b21lciIsImJpbGxpbmctc3lzdGVtLXR5cGUiOiJJbXBvcnQgQVBJIiwiY3VycmVuY3kiOiJFVVIiLCJjdXJyZW5jeS1zaWduIjoi4oKsIiwib3duZXIiOm51bGx9LHsiaWQiOjEzMjc1MjI2OCwidXVpZCI6ImN1c19lNmM5ZTFiNC03NDlhLTExZWUtOGIxMi1iYmI2ZGFkZTRjZmMiLCJleHRlcm5hbF9pZCI6InRlc3RfY3VzX2V4dF9pZCIsIm5hbWUiOiJUZXN0IEN1c3RvbWVyIiwiZW1haWwiOiJ0ZXN0QGN1c3RvbWVyLmNvbSIsInN0YXR1cyI6Ik5ldyBMZWFkIiwiY3VzdG9tZXItc2luY2UiOm51bGwsImF0dHJpYnV0ZXMiOnsiY3VzdG9tIjp7fSwiY2xlYXJiaXQiOnt9LCJzdHJpcGUiOnt9LCJ0YWdzIjpbXX0sImRhdGFfc291cmNlX3V1aWQiOiJkc19lNjg1ZjA5ZS03NDlhLTExZWUtODYyNC02YmFhMGU3NTI5ZjYiLCJkYXRhX3NvdXJjZV91dWlkcyI6WyJkc19lNjg1ZjA5ZS03NDlhLTExZWUtODYyNC02YmFhMGU3NTI5ZjYiXSwiZXh0ZXJuYWxfaWRzIjpbInRlc3RfY3VzX2V4dF9pZCJdLCJjb21wYW55IjoiIiwiY291bnRyeSI6IkRFIiwic3RhdGUiOm51bGwsImNpdHkiOiJCZXJsaW4iLCJ6aXAiOm51bGwsImxlYWRfY3JlYXRlZF9hdCI6bnVsbCwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjpudWxsLCJhZGRyZXNzIjp7ImNvdW50cnkiOiJHZXJtYW55Iiwic3RhdGUiOm51bGwsImNpdHkiOiJCZXJsaW4iLCJhZGRyZXNzX3ppcCI6bnVsbH0sIm1yciI6MCwiYXJyIjowLCJiaWxsaW5nLXN5c3RlbS11cmwiOm51bGwsImNoYXJ0bW9ndWwtdXJsIjoiaHR0cHM6Ly9hcHAuY2hhcnRtb2d1bC5jb20vIy9jdXN0b21lcnMvMTMyNzUyMjY4LVRlc3RfQ3VzdG9tZXIiLCJiaWxsaW5nLXN5c3RlbS10eXBlIjoiSW1wb3J0IEFQSSIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsIm93bmVyIjpudWxsfV0sImN1cnJlbnRfcGFnZSI6MSwidG90YWxfcGFnZXMiOjEsImhhc19tb3JlIjpmYWxzZSwicGVyX3BhZ2UiOjIwMCwicGFnZSI6MSwiY3Vyc29yIjoiSmpFek1qYzFNakkyT0E9PSJ9 + http_version: + recorded_at: Sun, 29 Oct 2023 21:13:51 GMT +recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/raises_error_on_deleting_non-existing_invoice.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/returns_nil_if_customer_does_not_exist.yml similarity index 50% rename from fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/raises_error_on_deleting_non-existing_invoice.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/returns_nil_if_customer_does_not_exist.yml index 24078ba..ad63183 100644 --- a/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Interactions/raises_error_on_deleting_non-existing_invoice.yml +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Customer/_find_by_external_id/returns_nil_if_customer_does_not_exist.yml @@ -1,42 +1,36 @@ --- http_interactions: - request: - method: delete - uri: https://api.chartmogul.com/v1/invoices/inv_123 + method: get + uri: https://api.chartmogul.com/v1/customers?external_id=unknown body: encoding: US-ASCII string: '' headers: User-Agent: - - Faraday v0.9.2 + - chartmogul-ruby/3.3.1 Content-Type: - application/json Authorization: - Basic hidden response: status: - code: 404 - message: Not found + code: 200 + message: OK headers: - server: - - nginx/1.9.10 - date: - - Wed, 29 Jun 2016 12:45:27 GMT + access-control-allow-credentials: + - 'true' content-type: - application/json + date: + - Sun, 29 Oct 2023 21:14:11 GMT content-length: - - '35' + - '102' connection: - - close - vary: - - Accept-Encoding - status: - - 404 Not found - access-control-allow-credentials: - - 'true' + - keep-alive body: encoding: UTF-8 - string: '{"error":"Invoice not found"}' + string: '{"entries":[],"current_page":1,"total_pages":1,"has_more":false,"per_page":200,"page":1,"cursor":null}' http_version: - recorded_at: Wed, 29 Jun 2016 12:45:27 GMT -recorded_with: VCR 3.0.3 + recorded_at: Sun, 29 Oct 2023 21:14:11 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/creates_the_customer_invoice_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/creates_the_customer_invoice_correctly.yml new file mode 100644 index 0000000..ce68a02 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/creates_the_customer_invoice_correctly.yml @@ -0,0 +1,234 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/data_sources/ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Mon, 30 Oct 2023 02:58:40 GMT + content-length: + - '158' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","name":"Google Sheets + app","system":"Google Sheets","created_at":"2023-07-27T13:03:43.614Z","status":"idle"}' + http_version: + recorded_at: Mon, 30 Oct 2023 02:58:40 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Mon, 30 Oct 2023 02:58:40 GMT + content-length: + - '929' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJpZCI6MTE0MTY3NDQ5LCJ1dWlkIjoiY3VzXzIzNTUxNTk2LTJjN2UtMTFlZS05ZWExLTJiZmUxOTM2NDBjMCIsImV4dGVybmFsX2lkIjoiY3VzXzAwMSIsIm5hbWUiOiJQZXRlciBHaWJib25zIiwiZW1haWwiOiJwZXRlckBleGFtcGxlLmNvbSIsInN0YXR1cyI6Ik5ldyBMZWFkIiwiY3VzdG9tZXItc2luY2UiOm51bGwsImF0dHJpYnV0ZXMiOnsiY3VzdG9tIjp7fSwiY2xlYXJiaXQiOnt9LCJzdHJpcGUiOnt9LCJ0YWdzIjpbImF1dG8tY2h1cm5lZC1kZWxpbnF1ZW50LXN1YnNjcmlwdGlvbiJdfSwiZGF0YV9zb3VyY2VfdXVpZCI6ImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiIsImRhdGFfc291cmNlX3V1aWRzIjpbImRzXzAzY2ZkMmM0LTJjN2UtMTFlZS1hYjIzLWNiMGYwMDhjZmY0NiJdLCJleHRlcm5hbF9pZHMiOlsiY3VzXzAwMSJdLCJjb21wYW55IjoiSW5pdGVjaCIsImNvdW50cnkiOiJVUyIsInN0YXRlIjoiQ0EiLCJjaXR5IjoiU2FuIEZyYW5jaXNjbyIsInppcCI6IjEyMzQ1IiwibGVhZF9jcmVhdGVkX2F0IjoiMjAxNS0xMS0wMVQwMDowMDowMC4wMDBaIiwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjoiMjAxNS0xMS0wN1QwMToyMDowMC4wMDBaIiwiYWRkcmVzcyI6eyJjb3VudHJ5IjoiVW5pdGVkIFN0YXRlcyIsInN0YXRlIjoiQ2FsaWZvcm5pYSIsImNpdHkiOiJTYW4gRnJhbmNpc2NvIiwiYWRkcmVzc196aXAiOiIxMjM0NSJ9LCJtcnIiOjAsImFyciI6MCwiYmlsbGluZy1zeXN0ZW0tdXJsIjpudWxsLCJjaGFydG1vZ3VsLXVybCI6Imh0dHBzOi8vYXBwLmNoYXJ0bW9ndWwuY29tLyMvY3VzdG9tZXJzLzExNDE2NzQ0OS1Jbml0ZWNoIiwiYmlsbGluZy1zeXN0ZW0tdHlwZSI6Ikdvb2dsZSBTaGVldHMiLCJjdXJyZW5jeSI6IkVVUiIsImN1cnJlbmN5LXNpZ24iOiLigqwiLCJvd25lciI6bnVsbH0= + http_version: + recorded_at: Mon, 30 Oct 2023 02:58:40 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/plans/pl_de9e281e-76cb-11ee-b63f-b727630ce4d4 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 02:58:40 GMT + etag: + - W/"fe6ec38e44f2cb5de77ecfc2db2ddd07" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 040cf67b39bc78976f70c6c36a42427c + x-runtime: + - '0.023306' + x-xss-protection: + - 1; mode=block + content-length: + - '206' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"test_cus_pl_ext_id","name":"Test Plan","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4"}' + http_version: + recorded_at: Mon, 30 Oct 2023 02:58:40 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/import/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/invoices + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 02:58:40 GMT + etag: + - W/"ce3c7d6b9d1d32360e0cf5806aecf83d" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - dea46daf04cec43f0e4f8f411bc6c7c2 + x-runtime: + - '0.027281' + x-xss-protection: + - 1; mode=block + content-length: + - '138' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0","invoices":[],"current_page":1,"total_pages":0,"cursor":null,"has_more":false}' + http_version: + recorded_at: Mon, 30 Oct 2023 02:58:40 GMT +- request: + method: post + uri: https://api.chartmogul.com/v1/import/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/invoices + body: + encoding: UTF-8 + string: '{"invoices":[{"date":"2016-01-01 12:00:00 UTC","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"test_cus_sub_ext_id","service_period_start":"2016-01-01 + 12:00:00 UTC","service_period_end":"2016-02-01 12:00:00 UTC","amount_in_cents":1000,"cancelled_at":"2016-01-15 + 12:00:00 UTC","prorated":false,"quantity":5,"discount_amount_in_cents":1200,"discount_code":"DISCCODE","tax_amount_in_cents":200,"external_id":"test_cus_li_ext_id","plan_uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4"}],"transactions":[{"type":"payment","date":"2016-01-01 + 12:00:00 UTC","result":"successful","external_id":"test_cus_tr_ext_id"}],"external_id":"test_cus_inv_ext_id_1","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","customer_external_id":"cus_001","due_date":"2016-01-07 + 12:00:00 UTC"}],"customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 201 + message: Created + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 02:58:41 GMT + etag: + - W/"c0105973d321517193399f0828e2f063" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 8eb5fdef25d2457efe5deb11564af155 + x-runtime: + - '0.146990' + x-xss-protection: + - 1; mode=block + content-length: + - '1145' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"invoices":[{"uuid":"inv_8ab74614-4e62-49f6-b4b3-f779109e50d0","date":"2016-01-01T12:00:00.000Z","due_date":"2016-01-07T12:00:00.000Z","errors":{},"external_id":"test_cus_inv_ext_id_1","currency":"USD","line_items":[{"uuid":"li_dacad109-fc67-47f9-8381-462e0fe27201","external_id":"test_cus_li_ext_id","type":"subscription","subscription_uuid":"sub_0259d4d5-a63d-4a8c-b901-4f93f95b74b0","subscription_external_id":"test_cus_sub_ext_id","prorated":false,"proration_type":null,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","plan_uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4","amount_in_cents":1000,"quantity":5,"discount_code":"DISCCODE","discount_amount_in_cents":1200,"tax_amount_in_cents":200,"transaction_fees_in_cents":0,"account_code":"","transaction_fees_currency":null,"discount_description":null,"event_order":null}],"transactions":[{"uuid":"tr_13920c67-3782-4d8c-b835-03deb3dd471c","external_id":"test_cus_tr_ext_id","amount_in_cents":null,"type":"payment","date":"2016-01-01T12:00:00.000Z","result":"successful","transaction_fees_in_cents":null,"transaction_fees_currency":null}]}]}' + http_version: + recorded_at: Mon, 30 Oct 2023 02:58:41 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/destroys_all_customer_invoices_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/destroys_all_customer_invoices_correctly.yml new file mode 100644 index 0000000..b0c442b --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/destroys_all_customer_invoices_correctly.yml @@ -0,0 +1,48 @@ +--- +http_interactions: +- request: + method: delete + uri: https://api.chartmogul.com/v1/data_sources/ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/invoices + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Authorization: + - Basic hidden + response: + status: + code: 204 + message: No Content + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - no-cache + date: + - Mon, 30 Oct 2023 02:54:04 GMT + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - f45f6d020724a1cd21cb11de8bdb4b01 + x-runtime: + - '0.124159' + x-xss-protection: + - 1; mode=block + connection: + - keep-alive + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Mon, 30 Oct 2023 02:54:04 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/with_new_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/with_new_pagination/paginates_correctly.yml new file mode 100644 index 0000000..4c518a5 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/with_new_pagination/paginates_correctly.yml @@ -0,0 +1,113 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/import/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/invoices?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-encoding: + - gzip + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:00:42 GMT + etag: + - W/"5dab45371d26789fa23539e57a649410" + referrer-policy: + - strict-origin-when-cross-origin + vary: + - Accept-Encoding, Accept-Encoding + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - b3d1f40d0b5a7ae298ce0c39a8ab8994 + x-runtime: + - '0.075820' + x-xss-protection: + - 1; mode=block + content-length: + - '696' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0","invoices":[{"uuid":"inv_8ab74614-4e62-49f6-b4b3-f779109e50d0","date":"2016-01-01T12:00:00.000Z","due_date":"2016-01-07T12:00:00.000Z","errors":{},"external_id":"test_cus_inv_ext_id_1","currency":"USD","line_items":[{"uuid":"li_dacad109-fc67-47f9-8381-462e0fe27201","external_id":"test_cus_li_ext_id","type":"subscription","subscription_uuid":"sub_0259d4d5-a63d-4a8c-b901-4f93f95b74b0","subscription_external_id":"test_cus_sub_ext_id","prorated":false,"proration_type":null,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","plan_uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4","amount_in_cents":1000,"quantity":5,"discount_code":"DISCCODE","discount_amount_in_cents":1200,"tax_amount_in_cents":200,"transaction_fees_in_cents":0,"account_code":"","transaction_fees_currency":null,"discount_description":null,"event_order":null}],"transactions":[{"uuid":"tr_13920c67-3782-4d8c-b835-03deb3dd471c","external_id":"test_cus_tr_ext_id","amount_in_cents":null,"type":"payment","date":"2016-01-01T12:00:00.000Z","result":"successful","transaction_fees_in_cents":null,"transaction_fees_currency":null}]}],"current_page":1,"total_pages":1,"cursor":"MjAyMy0xMC0zMFQwMjo1ODo0MS4yNzkyNzIwMDBaJmludl84YWI3NDYxNC00ZTYyLTQ5ZjYtYjRiMy1mNzc5MTA5ZTUwZDA=","has_more":false}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:00:42 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/import/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/invoices?cursor=MjAyMy0xMC0zMFQwMjo1ODo0MS4yNzkyNzIwMDBaJmludl84YWI3NDYxNC00ZTYyLTQ5ZjYtYjRiMy1mNzc5MTA5ZTUwZDA%3D&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:00:42 GMT + etag: + - W/"b1901b783b42c63a6d98916d81c9add8" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 76109e83f59f1a27a5b984535d4850d0 + x-runtime: + - '0.041957' + x-xss-protection: + - 1; mode=block + content-length: + - '105' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0","invoices":[],"cursor":null,"has_more":false}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:00:42 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/with_old_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/with_old_pagination/paginates_correctly.yml new file mode 100644 index 0000000..3ef41de --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_CustomerInvoices/API_Actions/with_old_pagination/paginates_correctly.yml @@ -0,0 +1,60 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/import/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/invoices?page=1&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-encoding: + - gzip + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 02:48:07 GMT + etag: + - W/"f5a5b0f50cc09c9e1fe64adee32cac72" + referrer-policy: + - strict-origin-when-cross-origin + vary: + - Accept-Encoding, Accept-Encoding + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - a9cf5909b7c1e0c157d875d97a366b50 + x-runtime: + - '0.042736' + x-xss-protection: + - 1; mode=block + transfer-encoding: + - chunked + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0","invoices":[{"uuid":"inv_d54e1b96-15a6-4491-979a-595530b1a55d","date":"2016-01-01T12:00:00.000Z","due_date":"2016-01-07T12:00:00.000Z","errors":{},"external_id":"test_cus_inv_ext_id_1","currency":"USD","line_items":[{"uuid":"li_0380e8ef-7476-440c-8abd-faa0fe237f8a","external_id":"test_cus_li_ext_id","type":"subscription","subscription_uuid":"sub_7e16d71e-7c78-4fd5-810c-d13b6486f5cb","subscription_external_id":"test_cus_sub_ext_id","prorated":false,"proration_type":null,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","plan_uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4","amount_in_cents":1000,"quantity":5,"discount_code":"DISCCODE","discount_amount_in_cents":1200,"tax_amount_in_cents":200,"transaction_fees_in_cents":0,"account_code":"","transaction_fees_currency":null,"discount_description":null,"event_order":null}],"transactions":[{"uuid":"tr_d657cb88-d87b-4b91-836e-f69f1e7b0164","external_id":"test_cus_tr_ext_id","amount_in_cents":null,"type":"payment","date":"2016-01-01T12:00:00.000Z","result":"successful","transaction_fees_in_cents":null,"transaction_fees_currency":null}]}],"current_page":1,"total_pages":1}' + http_version: + recorded_at: Mon, 30 Oct 2023 02:48:07 GMT +recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml b/spec/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_interracts_with_the_API.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml b/spec/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_404.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml b/spec/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/correctly_raises_errors_on_422.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/retrieves_existing_data_source_matching_uuid.yml b/spec/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/retrieves_existing_data_source_matching_uuid.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/retrieves_existing_data_source_matching_uuid.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_DataSource/API_Interactions/retrieves_existing_data_source_matching_uuid.yml diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/destroys_the_invoice_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/destroys_the_invoice_correctly.yml new file mode 100644 index 0000000..2e5c879 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/destroys_the_invoice_correctly.yml @@ -0,0 +1,48 @@ +--- +http_interactions: +- request: + method: delete + uri: https://api.chartmogul.com/v1/invoices/inv_6fab6457-7b27-44c3-99ae-815923a22c7c + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Authorization: + - Basic hidden + response: + status: + code: 204 + message: No Content + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - no-cache + date: + - Mon, 30 Oct 2023 03:24:00 GMT + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - e48130466af0f2cda07821194a24d0ec + x-runtime: + - '0.092448' + x-xss-protection: + - 1; mode=block + connection: + - keep-alive + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Mon, 30 Oct 2023 03:24:00 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/destroys_the_invoice_correctly_with_instance_method.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/destroys_the_invoice_correctly_with_instance_method.yml new file mode 100644 index 0000000..928451b --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/destroys_the_invoice_correctly_with_instance_method.yml @@ -0,0 +1,105 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/invoices/inv_c183cce8-a9f4-4992-b2d0-f42e16309866 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-encoding: + - gzip + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:26:02 GMT + etag: + - W/"c162edda5a91257bffe9a1b3b10e4762" + referrer-policy: + - strict-origin-when-cross-origin + vary: + - Accept-Encoding, Accept-Encoding + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - fd33ebf73936202f9887ec959a6c46e8 + x-runtime: + - '0.058600' + x-xss-protection: + - 1; mode=block + content-length: + - '451' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"uuid":"inv_c183cce8-a9f4-4992-b2d0-f42e16309866","date":"2023-07-26T23:00:00.000Z","due_date":"2023-07-26T23:00:00.000Z","errors":{},"external_id":"1","currency":"EUR","customer_uuid":"cus_1245b3b0-2c82-11ee-aef1-93c289e29cdb","line_items":[{"uuid":"li_5d8424c3-4089-4e7f-a7b3-67f38fb35de9","external_id":null,"type":"one_time","description":null,"amount_in_cents":11100,"quantity":1,"discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"transaction_fees_in_cents":0,"account_code":"","transaction_fees_currency":null,"discount_description":null,"event_order":null}],"transactions":[{"uuid":"tr_49973871-fc39-4fd9-8c68-6c0721b9543e","external_id":null,"amount_in_cents":11100,"type":"payment","date":"2023-07-26T23:00:00.000Z","result":"successful","transaction_fees_in_cents":null,"transaction_fees_currency":null},{"uuid":"tr_15dcd1f9-6d0f-4791-bd68-2829007eb74e","external_id":null,"amount_in_cents":11100,"type":"refund","date":"2023-07-26T23:00:00.000Z","result":"successful","transaction_fees_in_cents":null,"transaction_fees_currency":null}]}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:26:01 GMT +- request: + method: delete + uri: https://api.chartmogul.com/v1/invoices/inv_c183cce8-a9f4-4992-b2d0-f42e16309866 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Authorization: + - Basic hidden + response: + status: + code: 204 + message: No Content + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - no-cache + date: + - Mon, 30 Oct 2023 03:26:02 GMT + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 7a44dd2d1c76c94f691ea5edfdd4cafa + x-runtime: + - '0.130862' + x-xss-protection: + - 1; mode=block + connection: + - keep-alive + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Mon, 30 Oct 2023 03:26:02 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/retrieves_the_invoice_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/retrieves_the_invoice_correctly.yml new file mode 100644 index 0000000..63c6d43 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/retrieves_the_invoice_correctly.yml @@ -0,0 +1,60 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/invoices/inv_8ab74614-4e62-49f6-b4b3-f779109e50d0 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-encoding: + - gzip + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:24:01 GMT + etag: + - W/"0cb100b2abc514a884d56ece77c2309c" + referrer-policy: + - strict-origin-when-cross-origin + vary: + - Accept-Encoding, Accept-Encoding + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 5acf81a584d6184e6c6cac7f15a04a31 + x-runtime: + - '0.038434' + x-xss-protection: + - 1; mode=block + transfer-encoding: + - chunked + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"uuid":"inv_8ab74614-4e62-49f6-b4b3-f779109e50d0","date":"2016-01-01T12:00:00.000Z","due_date":"2016-01-07T12:00:00.000Z","errors":{},"external_id":"test_cus_inv_ext_id_1","currency":"USD","customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0","line_items":[{"uuid":"li_dacad109-fc67-47f9-8381-462e0fe27201","external_id":"test_cus_li_ext_id","type":"subscription","subscription_uuid":"sub_0259d4d5-a63d-4a8c-b901-4f93f95b74b0","subscription_external_id":"test_cus_sub_ext_id","prorated":false,"proration_type":null,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","plan_uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4","amount_in_cents":1000,"quantity":5,"discount_code":"DISCCODE","discount_amount_in_cents":1200,"tax_amount_in_cents":200,"transaction_fees_in_cents":0,"account_code":"","transaction_fees_currency":null,"discount_description":null,"event_order":null}],"transactions":[{"uuid":"tr_13920c67-3782-4d8c-b835-03deb3dd471c","external_id":"test_cus_tr_ext_id","amount_in_cents":null,"type":"payment","date":"2016-01-01T12:00:00.000Z","result":"successful","transaction_fees_in_cents":null,"transaction_fees_currency":null}]}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:24:01 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/with_new_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/with_new_pagination/paginates_correctly.yml new file mode 100644 index 0000000..118256b --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/with_new_pagination/paginates_correctly.yml @@ -0,0 +1,117 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/invoices?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-encoding: + - gzip + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:21:07 GMT + etag: + - W/"a7a017343a1d885270af527619cf5399" + referrer-policy: + - strict-origin-when-cross-origin + vary: + - Accept-Encoding, Accept-Encoding + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 69d7846af9eca26b0db6dc88754dbf9b + x-runtime: + - '0.042497' + x-xss-protection: + - 1; mode=block + content-length: + - '611' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"invoices":[{"uuid":"inv_6897d700-993e-41b5-bee6-f1569c92cf1e","external_id":"test_cus_inv_ext_id_2","date":"2023-10-30T00:00:00.000Z","due_date":"2023-10-30T00:00:00.000Z","currency":"EUR","customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0","errors":{},"line_items":[{"subscription_uuid":"sub_0259d4d5-a63d-4a8c-b901-4f93f95b74b0","subscription_external_id":"test_cus_sub_ext_id","prorated":false,"proration_type":null,"service_period_start":"2023-10-30T00:00:00.000Z","service_period_end":"2023-10-31T00:00:00.000Z","uuid":"li_94751507-6531-420f-92f8-57b6ad7a54e3","external_id":null,"type":"subscription","amount_in_cents":1000,"quantity":1,"discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"transaction_fees_in_cents":0,"account_code":"","plan_uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4","transaction_fees_currency":null,"discount_description":null,"event_order":null,"balance_transfer":null}],"transactions":[]}],"total_pages":27,"current_page":1,"cursor":"MjAyMy0xMC0zMFQwMzoxNjo1Ni4wMzUwMTcwMDBaJmludl82ODk3ZDcwMC05OTNlLTQxYjUtYmVlNi1mMTU2OWM5MmNmMWU=","has_more":true}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:21:07 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/invoices?cursor=MjAyMy0xMC0zMFQwMzoxNjo1Ni4wMzUwMTcwMDBaJmludl82ODk3ZDcwMC05OTNlLTQxYjUtYmVlNi1mMTU2OWM5MmNmMWU%3D&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-encoding: + - gzip + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:21:07 GMT + etag: + - W/"b36ca2e4677c9de472dc19b00c3b5682" + referrer-policy: + - strict-origin-when-cross-origin + vary: + - Accept-Encoding, Accept-Encoding + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - f4e5a1143f0b681e63a4d42031df40dc + x-runtime: + - '0.040280' + x-xss-protection: + - 1; mode=block + transfer-encoding: + - chunked + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"invoices":[{"uuid":"inv_8ab74614-4e62-49f6-b4b3-f779109e50d0","external_id":"test_cus_inv_ext_id_1","date":"2016-01-01T12:00:00.000Z","due_date":"2016-01-07T12:00:00.000Z","currency":"USD","customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0","errors":{},"line_items":[{"subscription_uuid":"sub_0259d4d5-a63d-4a8c-b901-4f93f95b74b0","subscription_external_id":"test_cus_sub_ext_id","prorated":false,"proration_type":null,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","uuid":"li_dacad109-fc67-47f9-8381-462e0fe27201","external_id":"test_cus_li_ext_id","type":"subscription","amount_in_cents":1000,"quantity":5,"discount_code":"DISCCODE","discount_amount_in_cents":1200,"tax_amount_in_cents":200,"transaction_fees_in_cents":0,"account_code":"","plan_uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4","transaction_fees_currency":null,"discount_description":null,"event_order":null,"balance_transfer":null}],"transactions":[{"uuid":"tr_13920c67-3782-4d8c-b835-03deb3dd471c","external_id":"test_cus_tr_ext_id","type":"payment","date":"2016-01-01T12:00:00.000Z","result":"successful","amount_in_cents":null,"transaction_fees_in_cents":null,"transaction_fees_currency":null}]}],"cursor":"MjAyMy0xMC0zMFQwMjo1ODo0MS4yNzkyNzIwMDBaJmludl84YWI3NDYxNC00ZTYyLTQ5ZjYtYjRiMy1mNzc5MTA5ZTUwZDA=","has_more":true}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:21:07 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/with_old_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/with_old_pagination/paginates_correctly.yml new file mode 100644 index 0000000..e29f130 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Invoice/API_Actions/with_old_pagination/paginates_correctly.yml @@ -0,0 +1,60 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/invoices?page=2&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-encoding: + - gzip + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:21:58 GMT + etag: + - W/"bb1739184991c55d9487eb6dc30d7367" + referrer-policy: + - strict-origin-when-cross-origin + vary: + - Accept-Encoding, Accept-Encoding + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 20cf1903feb29ebd6408a6c4e099da46 + x-runtime: + - '0.046631' + x-xss-protection: + - 1; mode=block + content-length: + - '591' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"invoices":[{"uuid":"inv_8ab74614-4e62-49f6-b4b3-f779109e50d0","external_id":"test_cus_inv_ext_id_1","date":"2016-01-01T12:00:00.000Z","due_date":"2016-01-07T12:00:00.000Z","currency":"USD","customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0","errors":{},"line_items":[{"subscription_uuid":"sub_0259d4d5-a63d-4a8c-b901-4f93f95b74b0","subscription_external_id":"test_cus_sub_ext_id","prorated":false,"proration_type":null,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","uuid":"li_dacad109-fc67-47f9-8381-462e0fe27201","external_id":"test_cus_li_ext_id","type":"subscription","amount_in_cents":1000,"quantity":5,"discount_code":"DISCCODE","discount_amount_in_cents":1200,"tax_amount_in_cents":200,"transaction_fees_in_cents":0,"account_code":"","plan_uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4","transaction_fees_currency":null,"discount_description":null,"event_order":null,"balance_transfer":null}],"transactions":[{"uuid":"tr_13920c67-3782-4d8c-b835-03deb3dd471c","external_id":"test_cus_tr_ext_id","type":"payment","date":"2016-01-01T12:00:00.000Z","result":"successful","amount_in_cents":null,"transaction_fees_in_cents":null,"transaction_fees_currency":null}]}],"total_pages":27,"current_page":2}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:21:58 GMT +recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/get_activities_export.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/get_activities_export.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/get_activities_export.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/get_activities_export.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/post_activities_export.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/post_activities_export.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/post_activities_export.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_ActivitiesExport/post_activities_export.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_Activity.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity.yml diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_PageableWithAnchor/should_be_pageable.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_PageableWithAnchor/should_be_pageable.yml new file mode 100644 index 0000000..6471087 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/behaves_like_PageableWithAnchor/should_be_pageable.yml @@ -0,0 +1,43 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/activities?per_page=2 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-encoding: + - gzip + content-type: + - application/json + date: + - Fri, 27 Oct 2023 08:58:22 GMT + vary: + - Accept-Encoding + content-length: + - '478' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: '{"entries":[{"description":"purchased the Test Plan1 plan","activity-mrr-movement":4004,"activity-mrr":4004,"activity-arr":48048,"date":"2016-01-01T12:00:00+00:00","type":"new_biz","currency":"EUR","subscription-external-id":"test_cus_sub_ext_id1","plan-external-id":"adcdb9f0-34c6-013c-82df-0230272d2d1f","customer-name":"Test + Customer","customer-uuid":"cus_c10aa086-5298-11ee-82da-ebac6f7a03c3","customer-external-id":"test_cus_ext_id","billing-connector-uuid":"ds_c0d412aa-5298-11ee-bb1f-332cea9687ed","uuid":"561814e1-d7d3-42f3-8936-4689ec0fbb74"},{"description":"purchased + the Test Plan2 plan","activity-mrr-movement":4004,"activity-mrr":8009,"activity-arr":96108,"date":"2016-01-01T12:00:00+00:00","type":"new_biz","currency":"EUR","subscription-external-id":"test_cus_sub_ext_id2","plan-external-id":"ae02e740-34c6-013c-d52b-563f32a3b7a1","customer-name":"Test + Customer","customer-uuid":"cus_c10aa086-5298-11ee-82da-ebac6f7a03c3","customer-external-id":"test_cus_ext_id","billing-connector-uuid":"ds_c0d412aa-5298-11ee-bb1f-332cea9687ed","uuid":"ff76d95f-0536-4b2e-85cf-cc49a42c8757"}],"has_more":true,"per_page":2,"cursor":"d868a892-37c7-45e3-ae84-e693181d2344"}' + http_version: + recorded_at: Fri, 27 Oct 2023 08:58:22 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml new file mode 100644 index 0000000..6471087 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_have_Activity_entries.yml @@ -0,0 +1,43 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/activities?per_page=2 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-encoding: + - gzip + content-type: + - application/json + date: + - Fri, 27 Oct 2023 08:58:22 GMT + vary: + - Accept-Encoding + content-length: + - '478' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: '{"entries":[{"description":"purchased the Test Plan1 plan","activity-mrr-movement":4004,"activity-mrr":4004,"activity-arr":48048,"date":"2016-01-01T12:00:00+00:00","type":"new_biz","currency":"EUR","subscription-external-id":"test_cus_sub_ext_id1","plan-external-id":"adcdb9f0-34c6-013c-82df-0230272d2d1f","customer-name":"Test + Customer","customer-uuid":"cus_c10aa086-5298-11ee-82da-ebac6f7a03c3","customer-external-id":"test_cus_ext_id","billing-connector-uuid":"ds_c0d412aa-5298-11ee-bb1f-332cea9687ed","uuid":"561814e1-d7d3-42f3-8936-4689ec0fbb74"},{"description":"purchased + the Test Plan2 plan","activity-mrr-movement":4004,"activity-mrr":8009,"activity-arr":96108,"date":"2016-01-01T12:00:00+00:00","type":"new_biz","currency":"EUR","subscription-external-id":"test_cus_sub_ext_id2","plan-external-id":"ae02e740-34c6-013c-d52b-563f32a3b7a1","customer-name":"Test + Customer","customer-uuid":"cus_c10aa086-5298-11ee-82da-ebac6f7a03c3","customer-external-id":"test_cus_ext_id","billing-connector-uuid":"ds_c0d412aa-5298-11ee-bb1f-332cea9687ed","uuid":"ff76d95f-0536-4b2e-85cf-cc49a42c8757"}],"has_more":true,"per_page":2,"cursor":"d868a892-37c7-45e3-ae84-e693181d2344"}' + http_version: + recorded_at: Fri, 27 Oct 2023 08:58:22 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_paginate_using_cursor_when_called_with_next.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_paginate_using_cursor_when_called_with_next.yml new file mode 100644 index 0000000..c9b7cb9 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Activity/should_paginate_using_cursor_when_called_with_next.yml @@ -0,0 +1,70 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/activities?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 09:15:10 GMT + content-length: + - '630' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"entries":[{"description":"purchased the Test Plan1 plan","activity-mrr-movement":4004,"activity-mrr":4004,"activity-arr":48048,"date":"2016-01-01T12:00:00+00:00","type":"new_biz","currency":"EUR","subscription-external-id":"test_cus_sub_ext_id1","plan-external-id":"adcdb9f0-34c6-013c-82df-0230272d2d1f","customer-name":"Test + Customer","customer-uuid":"cus_c10aa086-5298-11ee-82da-ebac6f7a03c3","customer-external-id":"test_cus_ext_id","billing-connector-uuid":"ds_c0d412aa-5298-11ee-bb1f-332cea9687ed","uuid":"561814e1-d7d3-42f3-8936-4689ec0fbb74"}],"has_more":true,"per_page":1,"cursor":"ff76d95f-0536-4b2e-85cf-cc49a42c8757"}' + http_version: + recorded_at: Fri, 27 Oct 2023 09:15:10 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/activities?cursor=ff76d95f-0536-4b2e-85cf-cc49a42c8757&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 09:15:11 GMT + content-length: + - '567' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"entries":[{"description":"purchased the Gold annual plan","activity-mrr-movement":768,"activity-mrr":768,"activity-arr":9216,"date":"2016-01-25T00:00:00+00:00","type":"new_biz","currency":"EUR","subscription-external-id":"1","plan-external-id":"plan_Gold_annual_1_year","customer-name":"Hooli","customer-uuid":"cus_23c11cf0-2c7e-11ee-b2cd-fbfd681a34dd","customer-external-id":"cus_003","billing-connector-uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","uuid":"d868a892-37c7-45e3-ae84-e693181d2344"}],"has_more":true,"cursor":"cdc5cf2f-2ee7-4cdf-b19d-e5550f8f30c8"}' + http_version: + recorded_at: Fri, 27 Oct 2023 09:15:11 GMT +recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_summary.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_summary.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_summary.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_summary.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/behaves_like_Pageable/should_be_pageable.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/behaves_like_Pageable/should_be_pageable.yml new file mode 100644 index 0000000..857f3c8 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/behaves_like_Pageable/should_be_pageable.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/activities + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 08:32:48 GMT + content-length: + - '376' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MjYyNTUyMzI3MSwiZGVzY3JpcHRpb24iOiJwdXJjaGFzZWQgdGhlIEdvbGQgYW5udWFsIHBsYW4iLCJhY3Rpdml0eS1tcnItbW92ZW1lbnQiOjc1NiwiYWN0aXZpdHktbXJyIjo3NTYsImFjdGl2aXR5LWFyciI6OTA3MiwiZGF0ZSI6IjIwMTYtMDItMjRUMDA6MDA6MDArMDA6MDAiLCJ0eXBlIjoibmV3X2JpeiIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsInN1YnNjcmlwdGlvbi1leHRlcm5hbC1pZCI6IjEifV0sImhhc19tb3JlIjpmYWxzZSwicGVyX3BhZ2UiOjIwMCwicGFnZSI6MSwiY3Vyc29yIjoiTWpBeU15MHhNQzB5TjFRd056b3pPRG8wTkM0Mk1EUTJNVFV3TURCYUpqSTJNalUxTWpNeU56RT0ifQ== + http_version: + recorded_at: Fri, 27 Oct 2023 08:32:48 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_have_Activity_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_have_Activity_entries.yml new file mode 100644 index 0000000..857f3c8 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_have_Activity_entries.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/activities + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 08:32:48 GMT + content-length: + - '376' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MjYyNTUyMzI3MSwiZGVzY3JpcHRpb24iOiJwdXJjaGFzZWQgdGhlIEdvbGQgYW5udWFsIHBsYW4iLCJhY3Rpdml0eS1tcnItbW92ZW1lbnQiOjc1NiwiYWN0aXZpdHktbXJyIjo3NTYsImFjdGl2aXR5LWFyciI6OTA3MiwiZGF0ZSI6IjIwMTYtMDItMjRUMDA6MDA6MDArMDA6MDAiLCJ0eXBlIjoibmV3X2JpeiIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsInN1YnNjcmlwdGlvbi1leHRlcm5hbC1pZCI6IjEifV0sImhhc19tb3JlIjpmYWxzZSwicGVyX3BhZ2UiOjIwMCwicGFnZSI6MSwiY3Vyc29yIjoiTWpBeU15MHhNQzB5TjFRd056b3pPRG8wTkM0Mk1EUTJNVFV3TURCYUpqSTJNalUxTWpNeU56RT0ifQ== + http_version: + recorded_at: Fri, 27 Oct 2023 08:32:48 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_paginate_using_cursor_when_called_with_next.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_paginate_using_cursor_when_called_with_next.yml new file mode 100644 index 0000000..d648714 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Activity/should_paginate_using_cursor_when_called_with_next.yml @@ -0,0 +1,71 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/activities?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 09:09:31 GMT + content-length: + - '369' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MjYyNTg2NzA4OCwiZGVzY3JpcHRpb24iOiJjYW5jZWxsZWQgdGhlaXIgR29sZCBhbm51YWwgcGxhbiIsImFjdGl2aXR5LW1yci1tb3ZlbWVudCI6LTc4MCwiYWN0aXZpdHktbXJyIjowLCJhY3Rpdml0eS1hcnIiOjAsImRhdGUiOiIyMDE3LTAzLTEwVDAwOjAwOjAwKzAwOjAwIiwidHlwZSI6ImNodXJuIiwiY3VycmVuY3kiOiJFVVIiLCJjdXJyZW5jeS1zaWduIjoi4oKsIiwic3Vic2NyaXB0aW9uLWV4dGVybmFsLWlkIjoiMSJ9XSwiaGFzX21vcmUiOnRydWUsInBlcl9wYWdlIjoxLCJwYWdlIjoxLCJjdXJzb3IiOiJNakF5TXkweE1DMHlOMVF3T1Rvd05EbzFOaTQzTVRjNE16SXdNREJhSmpJMk1qVTROamN3T0RnPSJ9 + http_version: + recorded_at: Fri, 27 Oct 2023 09:09:31 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/activities?cursor=MjAyMy0xMC0yN1QwOTowNDo1Ni43MTc4MzIwMDBaJjI2MjU4NjcwODg%3D&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 09:09:32 GMT + content-length: + - '352' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MjYyNTg2NzA4NywiZGVzY3JpcHRpb24iOiJwdXJjaGFzZWQgdGhlIEdvbGQgYW5udWFsIHBsYW4iLCJhY3Rpdml0eS1tcnItbW92ZW1lbnQiOjc1NiwiYWN0aXZpdHktbXJyIjo3NTYsImFjdGl2aXR5LWFyciI6OTA3MiwiZGF0ZSI6IjIwMTYtMDItMjRUMDA6MDA6MDArMDA6MDAiLCJ0eXBlIjoibmV3X2JpeiIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCIsInN1YnNjcmlwdGlvbi1leHRlcm5hbC1pZCI6IjEifV0sImN1cnNvciI6Ik1qQXlNeTB4TUMweU4xUXdPVG93TkRvMU5pNDNNVGM0TXpJd01EQmFKakkyTWpVNE5qY3dPRGM9IiwiaGFzX21vcmUiOmZhbHNlfQ== + http_version: + recorded_at: Fri, 27 Oct 2023 09:09:32 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/behaves_like_Pageable/should_be_pageable.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/behaves_like_Pageable/should_be_pageable.yml new file mode 100644 index 0000000..905c73e --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/behaves_like_Pageable/should_be_pageable.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/subscriptions + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 08:31:18 GMT + content-length: + - '458' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MjI5MzcxMDg3MCwiZXh0ZXJuYWxfaWQiOiIxIiwic3Vic2NyaXB0aW9uX3NldF9leHRlcm5hbF9pZCI6IjEiLCJxdWFudGl0eSI6MSwidXVpZCI6IjE0N2NiYTFhLTFmZDktNDExYi1iY2I3LTJlZDQ2N2NlYmUyNCIsIm1yciI6NzU2LCJhcnIiOjkwNzIsInN0YXR1cyI6ImFjdGl2ZSIsInBsYW4iOiJHb2xkIGFubnVhbCIsImJpbGxpbmctY3ljbGUiOiJ5ZWFyIiwiYmlsbGluZy1jeWNsZS1jb3VudCI6MSwic3RhcnQtZGF0ZSI6IjIwMTYtMDItMjRUMDA6MDA6MDArMDA6MDAiLCJlbmQtZGF0ZSI6IjIwMTctMDItMjRUMDA6MDA6MDArMDA6MDAiLCJjdXJyZW5jeSI6IkVVUiIsImN1cnJlbmN5LXNpZ24iOiLigqwifV0sImhhc19tb3JlIjpmYWxzZSwicGVyX3BhZ2UiOjIwMCwicGFnZSI6MSwiY3Vyc29yIjoiYzNWaWMyTnlhWEIwYVc5dWMxOXVaWGgwWDNCaFoyVTlNZz09In0= + http_version: + recorded_at: Fri, 27 Oct 2023 08:31:18 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_have_Subscription_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_have_Subscription_entries.yml new file mode 100644 index 0000000..11d8f6e --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_have_Subscription_entries.yml @@ -0,0 +1,37 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/subscriptions + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 08:31:09 GMT + content-length: + - '458' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MjI5MzcxMDg3MCwiZXh0ZXJuYWxfaWQiOiIxIiwic3Vic2NyaXB0aW9uX3NldF9leHRlcm5hbF9pZCI6IjEiLCJxdWFudGl0eSI6MSwidXVpZCI6IjE0N2NiYTFhLTFmZDktNDExYi1iY2I3LTJlZDQ2N2NlYmUyNCIsIm1yciI6NzU2LCJhcnIiOjkwNzIsInN0YXR1cyI6ImFjdGl2ZSIsInBsYW4iOiJHb2xkIGFubnVhbCIsImJpbGxpbmctY3ljbGUiOiJ5ZWFyIiwiYmlsbGluZy1jeWNsZS1jb3VudCI6MSwic3RhcnQtZGF0ZSI6IjIwMTYtMDItMjRUMDA6MDA6MDArMDA6MDAiLCJlbmQtZGF0ZSI6IjIwMTctMDItMjRUMDA6MDA6MDArMDA6MDAiLCJjdXJyZW5jeSI6IkVVUiIsImN1cnJlbmN5LXNpZ24iOiLigqwifV0sImhhc19tb3JlIjpmYWxzZSwicGVyX3BhZ2UiOjIwMCwicGFnZSI6MSwiY3Vyc29yIjoiYzNWaWMyTnlhWEIwYVc5dWMxOXVaWGgwWDNCaFoyVTlNZz09In0= + http_version: + recorded_at: Fri, 27 Oct 2023 08:31:09 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_paginate_using_cursor_when_called_with_next.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_paginate_using_cursor_when_called_with_next.yml new file mode 100644 index 0000000..c372f08 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_Customers_Subscription/should_paginate_using_cursor_when_called_with_next.yml @@ -0,0 +1,70 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/subscriptions?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 09:13:54 GMT + content-length: + - '458' + connection: + - keep-alive + body: + encoding: ASCII-8BIT + string: !binary |- + eyJlbnRyaWVzIjpbeyJpZCI6MjI5MzcxMDg3MCwiZXh0ZXJuYWxfaWQiOiIxIiwic3Vic2NyaXB0aW9uX3NldF9leHRlcm5hbF9pZCI6IjEiLCJxdWFudGl0eSI6MSwidXVpZCI6IjE0N2NiYTFhLTFmZDktNDExYi1iY2I3LTJlZDQ2N2NlYmUyNCIsIm1yciI6NzU2LCJhcnIiOjkwNzIsInN0YXR1cyI6ImluYWN0aXZlIiwicGxhbiI6IkdvbGQgYW5udWFsIiwiYmlsbGluZy1jeWNsZSI6InllYXIiLCJiaWxsaW5nLWN5Y2xlLWNvdW50IjoxLCJzdGFydC1kYXRlIjoiMjAxNi0wMi0yNFQwMDowMDowMCswMDowMCIsImVuZC1kYXRlIjoiMjAxNy0wMy0xMFQwMDowMDowMCswMDowMCIsImN1cnJlbmN5IjoiRVVSIiwiY3VycmVuY3ktc2lnbiI6IuKCrCJ9XSwiaGFzX21vcmUiOmZhbHNlLCJwZXJfcGFnZSI6MSwicGFnZSI6MSwiY3Vyc29yIjoiYzNWaWMyTnlhWEIwYVc5dWMxOXVaWGgwWDNCaFoyVTlNZz09In0= + http_version: + recorded_at: Fri, 27 Oct 2023 09:13:54 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/subscriptions?cursor=c3Vic2NyaXB0aW9uc19uZXh0X3BhZ2U9Mg%3D%3D&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 09:13:54 GMT + content-length: + - '79' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"entries":[],"cursor":"c3Vic2NyaXB0aW9uc19uZXh0X3BhZ2U9Mw==","has_more":false}' + http_version: + recorded_at: Fri, 27 Oct 2023 09:13:54 GMT +recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/behaves_like_Summary/should_have_summary.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/behaves_like_Summary/should_have_summary.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_on_incorrect_credentials.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_on_incorrect_credentials.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_on_incorrect_credentials.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_on_incorrect_credentials.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_500_internal_server_error.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_500_internal_server_error.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_500_internal_server_error.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_500_internal_server_error.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_504_gateway_timeout_error.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_504_gateway_timeout_error.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_504_gateway_timeout_error.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Ping/pings/and_fails_with_504_gateway_timeout_error.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Ping/pings/when_credentials_correct.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Ping/pings/when_credentials_correct.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Ping/pings/when_credentials_correct.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Ping/pings/when_credentials_correct.yml diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/creates_the_plan_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/creates_the_plan_correctly.yml new file mode 100644 index 0000000..d319d7f --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/creates_the_plan_correctly.yml @@ -0,0 +1,57 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.chartmogul.com/v1/plans + body: + encoding: UTF-8 + string: '{"name":"Another Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 201 + message: Created + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:48:10 GMT + etag: + - W/"f3aaf84b099a0421ba8b59887443272c" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - b94db83baa7dc1b3096910dbba06f0dd + x-runtime: + - '0.054636' + x-xss-protection: + - 1; mode=block + content-length: + - '234' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"1184b750-5905-013c-13b1-46813c1ddd3d","name":"Another + Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","uuid":"pl_1184b750-5905-013c-13b1-46813c1ddd3d"}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:48:10 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/destroys_the_plan_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/destroys_the_plan_correctly.yml new file mode 100644 index 0000000..cf1c63a --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/destroys_the_plan_correctly.yml @@ -0,0 +1,48 @@ +--- +http_interactions: +- request: + method: delete + uri: https://api.chartmogul.com/v1/plans/pl_1184b750-5905-013c-13b1-46813c1ddd3d + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Authorization: + - Basic hidden + response: + status: + code: 204 + message: No Content + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - no-cache + date: + - Mon, 30 Oct 2023 03:50:50 GMT + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 5d23c509efbe57c9b2230d246b7643cd + x-runtime: + - '0.057753' + x-xss-protection: + - 1; mode=block + connection: + - keep-alive + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Mon, 30 Oct 2023 03:50:50 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/retrieves_the_plan_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/retrieves_the_plan_correctly.yml new file mode 100644 index 0000000..38ea52e --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/retrieves_the_plan_correctly.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plans/pl_de9e281e-76cb-11ee-b63f-b727630ce4d4 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:47:36 GMT + etag: + - W/"fe6ec38e44f2cb5de77ecfc2db2ddd07" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 1ce480559b4090227e54fcca33aaa2b5 + x-runtime: + - '0.025952' + x-xss-protection: + - 1; mode=block + content-length: + - '206' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"test_cus_pl_ext_id","name":"Test Plan","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4"}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:47:36 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/updates_the_plan_correctly_with_the_class_method.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/updates_the_plan_correctly_with_the_class_method.yml new file mode 100644 index 0000000..dfea2f3 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/updates_the_plan_correctly_with_the_class_method.yml @@ -0,0 +1,53 @@ +--- +http_interactions: +- request: + method: patch + uri: https://api.chartmogul.com/v1/plans/pl_1184b750-5905-013c-13b1-46813c1ddd3d + body: + encoding: UTF-8 + string: '{"name":"Another Test Plan","interval_count":1}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 202 + message: Accepted + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:50:22 GMT + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 9f11c63f8c1c542ec7b49db2ad0f21d6 + x-runtime: + - '0.059153' + x-xss-protection: + - 1; mode=block + content-length: + - '234' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"1184b750-5905-013c-13b1-46813c1ddd3d","name":"Another + Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","uuid":"pl_1184b750-5905-013c-13b1-46813c1ddd3d"}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:50:22 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/updates_the_plan_correctly_with_the_instance_method.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/updates_the_plan_correctly_with_the_instance_method.yml new file mode 100644 index 0000000..908fd5d --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/updates_the_plan_correctly_with_the_instance_method.yml @@ -0,0 +1,107 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plans/pl_1184b750-5905-013c-13b1-46813c1ddd3d + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:49:53 GMT + etag: + - W/"f3aaf84b099a0421ba8b59887443272c" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - bdbd494e58a3eb7c5243252d332fa255 + x-runtime: + - '0.028785' + x-xss-protection: + - 1; mode=block + content-length: + - '234' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"1184b750-5905-013c-13b1-46813c1ddd3d","name":"Another + Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","uuid":"pl_1184b750-5905-013c-13b1-46813c1ddd3d"}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:49:53 GMT +- request: + method: patch + uri: https://api.chartmogul.com/v1/plans/pl_1184b750-5905-013c-13b1-46813c1ddd3d + body: + encoding: UTF-8 + string: '{"name":"Another Test Plan 123","interval_count":2,"interval_unit":"month","external_id":"1184b750-5905-013c-13b1-46813c1ddd3d","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 202 + message: Accepted + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:49:53 GMT + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - f910fe6ed5abcedbe435c39db5575c46 + x-runtime: + - '0.053454' + x-xss-protection: + - 1; mode=block + content-length: + - '238' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"1184b750-5905-013c-13b1-46813c1ddd3d","name":"Another + Test Plan 123","interval_count":2,"interval_unit":"month","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","uuid":"pl_1184b750-5905-013c-13b1-46813c1ddd3d"}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:49:53 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/with_new_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/with_new_pagination/paginates_correctly.yml new file mode 100644 index 0000000..2d26b1a --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/with_new_pagination/paginates_correctly.yml @@ -0,0 +1,110 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plans?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:47:38 GMT + etag: + - W/"b1d120e492a570c10015d262525a56c5" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 6e7c975e9f9670e63cd02455f64b26ad + x-runtime: + - '0.032475' + x-xss-protection: + - 1; mode=block + content-length: + - '332' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"plans":[{"external_id":"test_cus_pl_ext_id","name":"Test Plan","interval_count":7,"uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4","interval_unit":"day","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46"}],"current_page":1,"total_pages":14,"cursor":"MjAyMy0xMC0zMFQwMjoyNzoyOC4wMzU1OTIwMDBaJjExMDAyMjQ=","has_more":true}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:47:38 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/plans?cursor=MjAyMy0xMC0zMFQwMjoyNzoyOC4wMzU1OTIwMDBaJjExMDAyMjQ%3D&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:47:38 GMT + etag: + - W/"7c7ce0218da7be85ab0c25ca6a191ce9" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - e0a8840365c167375f84e670f16aa089 + x-runtime: + - '0.027452' + x-xss-protection: + - 1; mode=block + content-length: + - '328' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"plans":[{"external_id":"e205d990-56e3-013c-13ac-46813c1ddd3d","name":"A + another Test Plan","interval_count":1,"uuid":"pl_e205d990-56e3-013c-13ac-46813c1ddd3d","interval_unit":"month","data_source_uuid":"ds_f4dc3566-74b5-11ee-8820-478291cce06f"}],"cursor":"MjAyMy0xMC0yN1QxMDo0NTozNS4yMjM5MDUwMDBaJjEwOTk1ODQ=","has_more":true}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:47:38 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/with_old_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/with_old_pagination/paginates_correctly.yml new file mode 100644 index 0000000..4baaa92 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Plan/API_Actions/with_old_pagination/paginates_correctly.yml @@ -0,0 +1,57 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plans?page=3&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:47:37 GMT + etag: + - W/"8100c562c64eeaa702be7e13641f8297" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 0d96ae5d6ad9db067e0d8fc66a462421 + x-runtime: + - '0.021110' + x-xss-protection: + - 1; mode=block + content-length: + - '274' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"plans":[{"external_id":"e1c26000-56e3-013c-fc49-2215549c3f98","name":"A + Test Plan","interval_count":1,"uuid":"pl_e1c26000-56e3-013c-fc49-2215549c3f98","interval_unit":"month","data_source_uuid":"ds_f4dc3566-74b5-11ee-8820-478291cce06f"}],"current_page":3,"total_pages":14}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:47:37 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/correctly_handles_a_422_error.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/correctly_handles_a_422_error.yml new file mode 100644 index 0000000..2f2fa84 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/correctly_handles_a_422_error.yml @@ -0,0 +1,54 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.chartmogul.com/v1/plan_groups + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 422 + message: Unprocessable Content + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:00:23 GMT + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - df66edf9df80e8a0d7683af697ccf160 + x-runtime: + - '0.024525' + x-xss-protection: + - 1; mode=block + transfer-encoding: + - chunked + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"name":["Name can''t be blank"],"plan_ids":["Plan ids can''t be blank"],"error_details":[{"param":"name","code":"blank","message":"Name + can''t be blank"},{"param":"plan_ids","code":"blank","message":"Plan ids can''t + be blank"}]}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:00:23 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/creates_a_plan_group_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/creates_a_plan_group_correctly.yml new file mode 100644 index 0000000..2ba328a --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/creates_a_plan_group_correctly.yml @@ -0,0 +1,110 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plans/pl_e205d990-56e3-013c-13ac-46813c1ddd3d + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:01:45 GMT + etag: + - W/"fd6c4f5a102bbb360d8b4797f4328c5d" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 2c9c27e1e5a70c6a38153e327324e4e8 + x-runtime: + - '0.029597' + x-xss-protection: + - 1; mode=block + content-length: + - '236' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"e205d990-56e3-013c-13ac-46813c1ddd3d","name":"A another + Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_f4dc3566-74b5-11ee-8820-478291cce06f","uuid":"pl_e205d990-56e3-013c-13ac-46813c1ddd3d"}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:01:44 GMT +- request: + method: post + uri: https://api.chartmogul.com/v1/plan_groups + body: + encoding: UTF-8 + string: '{"name":"New Plan Group","plans":["pl_e205d990-56e3-013c-13ac-46813c1ddd3d"]}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:01:45 GMT + etag: + - W/"024bf0b0130258d669012be7932cfc24" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - f330d9469a5d4ebfbf6bf920b37e23b2 + x-runtime: + - '0.044249' + x-xss-protection: + - 1; mode=block + content-length: + - '91' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"name":"New Plan Group","uuid":"plg_5f1af63a-ec94-4688-9127-5eb816d05a8f","plans_count":1}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:01:45 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/destroys_a_plan_group_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/destroys_a_plan_group_correctly.yml new file mode 100644 index 0000000..e869f3e --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/destroys_a_plan_group_correctly.yml @@ -0,0 +1,101 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plan_groups/plg_e6ae207a-ff32-4431-ae46-34f20b61e17a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:13:15 GMT + etag: + - W/"f79332b69b7a92568a243cbe551b82ee" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - dde2c326d7750afbfd7149bf1a0705bc + x-runtime: + - '0.028109' + x-xss-protection: + - 1; mode=block + content-length: + - '89' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"name":"Another name","uuid":"plg_e6ae207a-ff32-4431-ae46-34f20b61e17a","plans_count":2}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:13:15 GMT +- request: + method: delete + uri: https://api.chartmogul.com/v1/plan_groups/plg_e6ae207a-ff32-4431-ae46-34f20b61e17a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Authorization: + - Basic hidden + response: + status: + code: 204 + message: No Content + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - no-cache + date: + - Mon, 30 Oct 2023 04:13:15 GMT + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - c126f12b6ac9f545c6f8473b4747abba + x-runtime: + - '0.040121' + x-xss-protection: + - 1; mode=block + connection: + - keep-alive + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Mon, 30 Oct 2023 04:13:15 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/retrieves_the_plan_group_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/retrieves_the_plan_group_correctly.yml new file mode 100644 index 0000000..7dd0641 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/retrieves_the_plan_group_correctly.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plan_groups/plg_e6ae207a-ff32-4431-ae46-34f20b61e17a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 03:55:33 GMT + etag: + - W/"cc31e79d8c8c118a0847d629bf702d1d" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 3687e3e4eff5144677e95142b0abc9a7 + x-runtime: + - '0.025782' + x-xss-protection: + - 1; mode=block + content-length: + - '90' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"name":"My plan group","uuid":"plg_e6ae207a-ff32-4431-ae46-34f20b61e17a","plans_count":2}' + http_version: + recorded_at: Mon, 30 Oct 2023 03:55:33 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_a_plan_group_plans.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_a_plan_group_plans.yml new file mode 100644 index 0000000..f22e241 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_a_plan_group_plans.yml @@ -0,0 +1,216 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plans/pl_de9e281e-76cb-11ee-b63f-b727630ce4d4 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:11:43 GMT + etag: + - W/"fe6ec38e44f2cb5de77ecfc2db2ddd07" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - eb0aa5ddaa8ff5199600f81d5efaa4ec + x-runtime: + - '0.072272' + x-xss-protection: + - 1; mode=block + content-length: + - '206' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"test_cus_pl_ext_id","name":"Test Plan","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","uuid":"pl_de9e281e-76cb-11ee-b63f-b727630ce4d4"}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:11:43 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/plans/pl_e205d990-56e3-013c-13ac-46813c1ddd3d + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:11:44 GMT + etag: + - W/"fd6c4f5a102bbb360d8b4797f4328c5d" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - f4f0ed8834bd683d01366069fd059269 + x-runtime: + - '0.035518' + x-xss-protection: + - 1; mode=block + content-length: + - '236' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"e205d990-56e3-013c-13ac-46813c1ddd3d","name":"A another + Test Plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_f4dc3566-74b5-11ee-8820-478291cce06f","uuid":"pl_e205d990-56e3-013c-13ac-46813c1ddd3d"}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:11:44 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/plan_groups/plg_e6ae207a-ff32-4431-ae46-34f20b61e17a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:11:44 GMT + etag: + - W/"038c6bd0a24b7ef600020132047b1c09" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 3b117d62417dc9e17afc9bd813b292ae + x-runtime: + - '0.025107' + x-xss-protection: + - 1; mode=block + content-length: + - '89' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"name":"Another name","uuid":"plg_e6ae207a-ff32-4431-ae46-34f20b61e17a","plans_count":1}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:11:44 GMT +- request: + method: patch + uri: https://api.chartmogul.com/v1/plan_groups/plg_e6ae207a-ff32-4431-ae46-34f20b61e17a + body: + encoding: UTF-8 + string: '{"name":"Another name","plans":["pl_de9e281e-76cb-11ee-b63f-b727630ce4d4","pl_e205d990-56e3-013c-13ac-46813c1ddd3d"]}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:11:44 GMT + etag: + - W/"f79332b69b7a92568a243cbe551b82ee" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - e8536356e47ba8f07e331196f4209c5e + x-runtime: + - '0.089372' + x-xss-protection: + - 1; mode=block + content-length: + - '89' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"name":"Another name","uuid":"plg_e6ae207a-ff32-4431-ae46-34f20b61e17a","plans_count":2}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:11:44 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_the_plan_group_correctly_with_the_class_method.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_the_plan_group_correctly_with_the_class_method.yml new file mode 100644 index 0000000..11e7877 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_the_plan_group_correctly_with_the_class_method.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: patch + uri: https://api.chartmogul.com/v1/plan_groups/plg_e6ae207a-ff32-4431-ae46-34f20b61e17a + body: + encoding: UTF-8 + string: '{"name":"Another name"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:04:51 GMT + etag: + - W/"f79332b69b7a92568a243cbe551b82ee" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 7c6eb94bc13195ee0c7d478aa05a8b03 + x-runtime: + - '0.036283' + x-xss-protection: + - 1; mode=block + content-length: + - '89' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"name":"Another name","uuid":"plg_e6ae207a-ff32-4431-ae46-34f20b61e17a","plans_count":2}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:04:51 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_the_plan_group_correctly_with_the_instance_method.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_the_plan_group_correctly_with_the_instance_method.yml new file mode 100644 index 0000000..c3d06f6 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/updates_the_plan_group_correctly_with_the_instance_method.yml @@ -0,0 +1,109 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plan_groups/plg_e6ae207a-ff32-4431-ae46-34f20b61e17a + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:04:00 GMT + etag: + - W/"cc31e79d8c8c118a0847d629bf702d1d" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - b66696349b7171a7f07b267ea324d00f + x-runtime: + - '0.022967' + x-xss-protection: + - 1; mode=block + content-length: + - '90' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"name":"My plan group","uuid":"plg_e6ae207a-ff32-4431-ae46-34f20b61e17a","plans_count":2}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:04:00 GMT +- request: + method: patch + uri: https://api.chartmogul.com/v1/plan_groups/plg_e6ae207a-ff32-4431-ae46-34f20b61e17a + body: + encoding: UTF-8 + string: '{"name":"A new name"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:04:00 GMT + etag: + - W/"de7055852ec792a1a76b2b6401dc3cb2" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 5e0839b35d0414cf0304ad76e5a79b5b + x-runtime: + - '0.036317' + x-xss-protection: + - 1; mode=block + content-length: + - '87' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"name":"A new name","uuid":"plg_e6ae207a-ff32-4431-ae46-34f20b61e17a","plans_count":2}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:04:00 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/with_new_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/with_new_pagination/paginates_correctly.yml new file mode 100644 index 0000000..7c31444 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/with_new_pagination/paginates_correctly.yml @@ -0,0 +1,109 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plan_groups?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:15:40 GMT + etag: + - W/"1cbe0a604591e2806e6d3efc2b086973" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 684c2f15e497a812429b3629512a05c4 + x-runtime: + - '0.039200' + x-xss-protection: + - 1; mode=block + content-length: + - '218' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"plan_groups":[{"name":"New Plan Group","uuid":"plg_5f1af63a-ec94-4688-9127-5eb816d05a8f","plans_count":1}],"current_page":1,"total_pages":8,"cursor":"MjAyMy0xMC0zMFQwNDowMTo0NS4yNDYwNzQwMDBaJjIxMTg5","has_more":true}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:15:40 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/plan_groups?cursor=MjAyMy0xMC0zMFQwNDowMTo0NS4yNDYwNzQwMDBaJjIxMTg5&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:15:40 GMT + etag: + - W/"4c9bbcc9142d6aaacdb219a6b25f92bb" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 1025fbc4aabf66bac2f2180e8db7f81b + x-runtime: + - '0.025084' + x-xss-protection: + - 1; mode=block + content-length: + - '184' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"plan_groups":[{"name":"My plan group","uuid":"plg_596af607-ea77-45a3-8d0b-5f1f6b31bf3b","plans_count":0}],"cursor":"MjAyMy0xMC0yN1QxMDo0MzoxMC41MTc3OTcwMDBaJjIxMTgy","has_more":true}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:15:40 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/with_old_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/with_old_pagination/paginates_correctly.yml new file mode 100644 index 0000000..9dd46cd --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroup/API_Actions/with_old_pagination/paginates_correctly.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plan_groups?page=3&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:14:02 GMT + etag: + - W/"9d956b2ca58aa398467e3c62fddb5bed" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 8cd53369cac8d301155400a9a409348c + x-runtime: + - '0.025841' + x-xss-protection: + - 1; mode=block + content-length: + - '148' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"plan_groups":[{"name":"My second plan group","uuid":"plg_cb92ce3a-2196-4b1b-92e1-7bb7c01c359e","plans_count":1}],"current_page":3,"total_pages":8}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:14:02 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_Actions/with_new_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_Actions/with_new_pagination/paginates_correctly.yml new file mode 100644 index 0000000..9045b28 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_Actions/with_new_pagination/paginates_correctly.yml @@ -0,0 +1,109 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plan_groups/plg_5f1af63a-ec94-4688-9127-5eb816d05a8f/plans?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:59:59 GMT + etag: + - W/"9a42cb386231839c75bf5c643192aefa" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 9399db2fb7d34f064cee668605882928 + x-runtime: + - '0.024910' + x-xss-protection: + - 1; mode=block + content-length: + - '361' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"plans":[{"name":"A another Test Plan","uuid":"pl_e205d990-56e3-013c-13ac-46813c1ddd3d","data_source_uuid":"ds_f4dc3566-74b5-11ee-8820-478291cce06f","interval_count":1,"interval_unit":"month","external_id":"e205d990-56e3-013c-13ac-46813c1ddd3d"}],"current_page":1,"total_pages":2,"cursor":"MjAyMy0xMC0yN1QxMDo0NTozNS4yMjM5MDUwMDBaJjEwOTk1ODQ=","has_more":true}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:59:59 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/plan_groups/plg_5f1af63a-ec94-4688-9127-5eb816d05a8f/plans?cursor=MjAyMy0xMC0yN1QxMDo0NTozNS4yMjM5MDUwMDBaJjEwOTk1ODQ%3D&per_page=1 + body: + encoding: UTF-8 + string: "{}" + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:59:59 GMT + etag: + - W/"aa151a1968ab4b05766e958fb95b4f3e" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 72303828047f4f8c1dfb3f66ea85653d + x-runtime: + - '0.032432' + x-xss-protection: + - 1; mode=block + content-length: + - '299' + connection: + - Close + body: + encoding: UTF-8 + string: '{"plans":[{"name":"Test Plan","uuid":"pl_e6ffcc84-749a-11ee-be12-f32dce10118e","data_source_uuid":"ds_e685f09e-749a-11ee-8624-6baa0e7529f6","interval_count":7,"interval_unit":"day","external_id":"test_cus_pl_ext_id"}],"cursor":"MjAyMy0xMC0yN1QwNzozMTo1NC40MzQzNDkwMDBaJjEwOTk1MzI=","has_more":false}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:59:59 GMT +recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_Actions/with_old_pagination/paginates_correctly.yml b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_Actions/with_old_pagination/paginates_correctly.yml new file mode 100644 index 0000000..d5d6e06 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_PlanGroups_Plans/API_Actions/with_old_pagination/paginates_correctly.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/plan_groups/plg_5f1af63a-ec94-4688-9127-5eb816d05a8f/plans?page=1&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Mon, 30 Oct 2023 04:56:59 GMT + etag: + - W/"05dc11c33b9948d5c36efefc64f8bcae" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 91a929bf2b8225f4349d9687f661d2ca + x-runtime: + - '0.034806' + x-xss-protection: + - 1; mode=block + content-length: + - '281' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"plans":[{"name":"A another Test Plan","uuid":"pl_e205d990-56e3-013c-13ac-46813c1ddd3d","data_source_uuid":"ds_f4dc3566-74b5-11ee-8820-478291cce06f","interval_count":1,"interval_unit":"month","external_id":"e205d990-56e3-013c-13ac-46813c1ddd3d"}],"current_page":1,"total_pages":2}' + http_version: + recorded_at: Mon, 30 Oct 2023 04:56:59 GMT +recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/connects_subscriptions.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/connects_subscriptions.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/connects_subscriptions.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/connects_subscriptions.yml diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml new file mode 100644 index 0000000..c46fabf --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/correctly_interracts_with_the_API.yml @@ -0,0 +1,309 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.chartmogul.com/v1/data_sources + body: + encoding: UTF-8 + string: '{"name":"Subscription Test Data Source"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 201 + message: Created + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 08:18:43 GMT + content-length: + - '167' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"uuid":"ds_70f9d974-74a1-11ee-9f41-abc03e24d1d3","name":"Subscription + Test Data Source","system":"Import API","created_at":"2023-10-27T08:18:42.862Z","status":"idle"}' + http_version: + recorded_at: Fri, 27 Oct 2023 08:18:42 GMT +- request: + method: post + uri: https://api.chartmogul.com/v1/customers + body: + encoding: UTF-8 + string: '{"external_id":"test_cus_ext_id","name":"Test Customer","data_source_uuid":"ds_70f9d974-74a1-11ee-9f41-abc03e24d1d3"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 201 + message: Created + headers: + access-control-allow-credentials: + - 'true' + content-type: + - application/json + date: + - Fri, 27 Oct 2023 08:18:43 GMT + content-length: + - '791' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"id":132753287,"uuid":"cus_713e32ae-74a1-11ee-b822-fbc804fece75","external_id":"test_cus_ext_id","name":"Test + Customer","email":"","status":"New Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_70f9d974-74a1-11ee-9f41-abc03e24d1d3","data_source_uuids":["ds_70f9d974-74a1-11ee-9f41-abc03e24d1d3"],"external_ids":["test_cus_ext_id"],"company":"","country":null,"state":null,"city":"","zip":null,"lead_created_at":null,"free_trial_started_at":null,"address":{"country":null,"state":null,"city":"","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#/customers/132753287-Test_Customer","billing-system-type":"Import + API","currency":"EUR","currency-sign":"€","owner":null}' + http_version: + recorded_at: Fri, 27 Oct 2023 08:18:43 GMT +- request: + method: post + uri: https://api.chartmogul.com/v1/plans + body: + encoding: UTF-8 + string: '{"name":"Test Plan","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_70f9d974-74a1-11ee-9f41-abc03e24d1d3"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 201 + message: Created + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Fri, 27 Oct 2023 08:18:43 GMT + etag: + - W/"62b0872bed18ec052a31bd9d2420c37f" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - eecc1fcf92af328e1c16b0265d8ade79 + x-runtime: + - '0.054972' + x-xss-protection: + - 1; mode=block + content-length: + - '224' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"5def4ec0-56cf-013c-5e95-16a2a79ba941","name":"Test + Plan","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_70f9d974-74a1-11ee-9f41-abc03e24d1d3","uuid":"pl_5def4ec0-56cf-013c-5e95-16a2a79ba941"}' + http_version: + recorded_at: Fri, 27 Oct 2023 08:18:43 GMT +- request: + method: post + uri: https://api.chartmogul.com/v1/import/customers/cus_713e32ae-74a1-11ee-b822-fbc804fece75/invoices + body: + encoding: UTF-8 + string: '{"invoices":[{"date":"2016-01-01 12:00:00 UTC","currency":"USD","line_items":[{"type":"subscription","subscription_external_id":"test_cus_sub_ext_id","service_period_start":"2016-01-01 + 12:00:00 UTC","service_period_end":"2016-02-01 12:00:00 UTC","amount_in_cents":1000,"subscription_set_external_id":"test_cus_set_ext_id","plan_uuid":"pl_5def4ec0-56cf-013c-5e95-16a2a79ba941"}],"external_id":"test_tr_inv_ext_id"}],"customer_uuid":"cus_713e32ae-74a1-11ee-b822-fbc804fece75"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 201 + message: Created + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Fri, 27 Oct 2023 08:18:44 GMT + etag: + - W/"ef186a940b0167cb6b4d18e570cfacf8" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - a53a2622cf7d607031e2030456dd2e40 + x-runtime: + - '0.233755' + x-xss-protection: + - 1; mode=block + content-length: + - '897' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"invoices":[{"uuid":"inv_9d5e3249-89bc-4123-8943-36d0b62de824","date":"2016-01-01T12:00:00.000Z","due_date":null,"errors":{},"external_id":"test_tr_inv_ext_id","currency":"USD","line_items":[{"uuid":"li_7e44ac53-95a9-4104-9aef-3aa644bb3ab8","external_id":null,"type":"subscription","subscription_uuid":"sub_46c3f4c1-bfe5-4665-aeb7-95aa60fd2f49","subscription_external_id":"test_cus_sub_ext_id","prorated":false,"proration_type":null,"service_period_start":"2016-01-01T12:00:00.000Z","service_period_end":"2016-02-01T12:00:00.000Z","subscription_set_external_id":"test_cus_set_ext_id","plan_uuid":"pl_5def4ec0-56cf-013c-5e95-16a2a79ba941","amount_in_cents":1000,"quantity":1,"discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"transaction_fees_in_cents":0,"account_code":"","transaction_fees_currency":null,"discount_description":null,"event_order":null}],"transactions":[]}]}' + http_version: + recorded_at: Fri, 27 Oct 2023 08:18:44 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/import/customers/cus_713e32ae-74a1-11ee-b822-fbc804fece75/subscriptions + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Fri, 27 Oct 2023 08:18:44 GMT + etag: + - W/"13eb96103a5ff58c46a2b9cea3bc8bcd" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 470d1806a62f737ad20a69cebfb15a21 + x-runtime: + - '0.048928' + x-xss-protection: + - 1; mode=block + content-length: + - '516' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_713e32ae-74a1-11ee-b822-fbc804fece75","subscriptions":[{"external_id":"test_cus_sub_ext_id","uuid":"sub_46c3f4c1-bfe5-4665-aeb7-95aa60fd2f49","cancellation_dates":[],"subscription_set_external_id":"test_cus_set_ext_id","plan_uuid":"pl_5def4ec0-56cf-013c-5e95-16a2a79ba941","data_source_uuid":"ds_70f9d974-74a1-11ee-9f41-abc03e24d1d3"}],"current_page":1,"total_pages":1,"cursor":"MjAyMy0xMC0yN1QwODoxODo0NC4xMTI5NjYwMDBaJnN1Yl80NmMzZjRjMS1iZmU1LTQ2NjUtYWViNy05NWFhNjBmZDJmNDk=","has_more":false}' + http_version: + recorded_at: Fri, 27 Oct 2023 08:18:44 GMT +- request: + method: patch + uri: https://api.chartmogul.com/v1/import/subscriptions/sub_46c3f4c1-bfe5-4665-aeb7-95aa60fd2f49 + body: + encoding: UTF-8 + string: '{"cancelled_at":"2016-01-15 12:00:00 UTC"}' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 202 + message: Accepted + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Fri, 27 Oct 2023 08:19:35 GMT + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 445a03562827f3a6745c93df10217e69 + x-runtime: + - '0.166778' + x-xss-protection: + - 1; mode=block + transfer-encoding: + - chunked + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"external_id":"test_cus_sub_ext_id","uuid":"sub_46c3f4c1-bfe5-4665-aeb7-95aa60fd2f49","cancellation_dates":["2016-01-15T12:00:00.000Z"],"plan_uuid":"pl_5def4ec0-56cf-013c-5e95-16a2a79ba941","customer_uuid":"cus_713e32ae-74a1-11ee-b822-fbc804fece75","data_source_uuid":"ds_70f9d974-74a1-11ee-9f41-abc03e24d1d3"}' + http_version: + recorded_at: Fri, 27 Oct 2023 08:19:35 GMT +- request: + method: delete + uri: https://api.chartmogul.com/v1/data_sources/ds_70f9d974-74a1-11ee-9f41-abc03e24d1d3 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Authorization: + - Basic hidden + response: + status: + code: 204 + message: No Content + headers: + access-control-allow-credentials: + - 'true' + date: + - Fri, 27 Oct 2023 08:19:36 GMT + connection: + - keep-alive + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Fri, 27 Oct 2023 08:19:36 GMT +recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/has_multiple_aliases.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/has_multiple_aliases.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/has_multiple_aliases.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/has_multiple_aliases.yml diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/should_paginate_using_cursor_when_called_with_next.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/should_paginate_using_cursor_when_called_with_next.yml new file mode 100644 index 0000000..6806171 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/API_Interactions/should_paginate_using_cursor_when_called_with_next.yml @@ -0,0 +1,109 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/import/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/subscriptions?per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Fri, 27 Oct 2023 10:38:04 GMT + etag: + - W/"94e499c34ea905de4f2c452832664b58" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - c0b645aa22ad679de4c9bda782ca5a7a + x-runtime: + - '0.042454' + x-xss-protection: + - 1; mode=block + content-length: + - '445' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0","subscriptions":[{"external_id":"1","uuid":"sub_e16a87f3-a045-45e5-9fe0-62c7b2f28f45","cancellation_dates":[],"plan_uuid":"pl_8a3f435e-5293-11ee-bbe3-17817ce53e3c","data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46"}],"current_page":1,"total_pages":1,"cursor":"MjAyMy0wOS0xNFQwMDoxNDoxMS45NDA3NjMwMDBaJnN1Yl9lMTZhODdmMy1hMDQ1LTQ1ZTUtOWZlMC02MmM3YjJmMjhmNDU=","has_more":false}' + http_version: + recorded_at: Fri, 27 Oct 2023 10:38:04 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/import/customers/cus_23551596-2c7e-11ee-9ea1-2bfe193640c0/subscriptions?cursor=MjAyMy0wOS0xNFQwMDoxNDoxMS45NDA3NjMwMDBaJnN1Yl9lMTZhODdmMy1hMDQ1LTQ1ZTUtOWZlMC02MmM3YjJmMjhmNDU%3D&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Fri, 27 Oct 2023 10:38:04 GMT + etag: + - W/"69734d9af537a491800936df17303434" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 267e79bcfabf89fe3a62a171aa48ac97 + x-runtime: + - '0.037520' + x-xss-protection: + - 1; mode=block + content-length: + - '110' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"customer_uuid":"cus_23551596-2c7e-11ee-9ea1-2bfe193640c0","subscriptions":[],"cursor":null,"has_more":false}' + http_version: + recorded_at: Fri, 27 Oct 2023 10:38:04 GMT +recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_has_time_objects/is_setting_the_cancellation_dates_of_the_subscription.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_has_time_objects/is_setting_the_cancellation_dates_of_the_subscription.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_has_time_objects/is_setting_the_cancellation_dates_of_the_subscription.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_has_time_objects/is_setting_the_cancellation_dates_of_the_subscription.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_invalid_entries/raises_an_exception.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_invalid_entries/raises_an_exception.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_invalid_entries/raises_an_exception.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_invalid_entries/raises_an_exception.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_valid_entries/is_setting_the_cancellation_dates_of_the_subscription.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_valid_entries/is_setting_the_cancellation_dates_of_the_subscription.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_valid_entries/is_setting_the_cancellation_dates_of_the_subscription.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_includes_valid_entries/is_setting_the_cancellation_dates_of_the_subscription.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_is_empty/makes_an_API_call_and_removes_the_cancellation_dates.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_is_empty/makes_an_API_call_and_removes_the_cancellation_dates.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_is_empty/makes_an_API_call_and_removes_the_cancellation_dates.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Subscription/_update_cancellation_dates/when_array_is_empty/makes_an_API_call_and_removes_the_cancellation_dates.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event.yml b/spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event_through_initialization.yml b/spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event_through_initialization.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event_through_initialization.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event_through_initialization.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/deletes_the_subscription_event.yml b/spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/deletes_the_subscription_event.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/deletes_the_subscription_event.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/deletes_the_subscription_event.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/lists_all_subscription_events.yml b/spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/lists_all_subscription_events.yml similarity index 64% rename from fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/lists_all_subscription_events.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/lists_all_subscription_events.yml index 65b5667..a0d9de2 100644 --- a/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/lists_all_subscription_events.yml +++ b/spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/lists_all_subscription_events.yml @@ -8,7 +8,7 @@ http_interactions: string: '{"name":"Subscription Events Test ds_index"}' headers: User-Agent: - - chartmogul-ruby/3.0.0 + - chartmogul-ruby/3.3.1 Content-Type: - application/json Authorization: @@ -23,28 +23,26 @@ http_interactions: content-type: - application/json date: - - Fri, 27 May 2022 21:54:20 GMT - status: - - 201 Created + - Fri, 27 Oct 2023 08:15:36 GMT content-length: - '171' connection: - keep-alive body: encoding: UTF-8 - string: '{"uuid":"ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99","name":"Subscription - Events Test ds_index","system":"Import API","created_at":"2022-05-27T21:54:20.374Z","status":"idle"}' + string: '{"uuid":"ds_01b0c140-74a1-11ee-acc1-b7f01977e96a","name":"Subscription + Events Test ds_index","system":"Import API","created_at":"2023-10-27T08:15:36.158Z","status":"idle"}' http_version: - recorded_at: Fri, 27 May 2022 21:54:20 GMT + recorded_at: Fri, 27 Oct 2023 08:15:36 GMT - request: method: post uri: https://api.chartmogul.com/v1/customers body: encoding: UTF-8 - string: '{"external_id":"test_cus_ext_id","name":"Test Customer","data_source_uuid":"ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99"}' + string: '{"external_id":"test_cus_ext_id","name":"Test Customer","data_source_uuid":"ds_01b0c140-74a1-11ee-acc1-b7f01977e96a"}' headers: User-Agent: - - chartmogul-ruby/3.0.0 + - chartmogul-ruby/3.3.1 Content-Type: - application/json Authorization: @@ -59,29 +57,26 @@ http_interactions: content-type: - application/json date: - - Fri, 27 May 2022 21:54:20 GMT - status: - - 201 Created + - Fri, 27 Oct 2023 08:15:36 GMT content-length: - - '772' + - '791' connection: - keep-alive body: - encoding: UTF-8 - string: '{"id":131944286,"uuid":"cus_9042b26a-de07-11ec-881b-ef2c738ae27a","external_id":"test_cus_ext_id","name":"Test - Customer","email":"","status":"Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99","data_source_uuids":["ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99"],"external_ids":["test_cus_ext_id"],"company":"","country":null,"state":null,"city":"","zip":null,"lead_created_at":null,"free_trial_started_at":null,"address":{"country":null,"state":null,"city":"","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#/customers/131944286-Test_Customer","billing-system-type":"Import - API","currency":"USD","currency-sign":"$"}' + encoding: ASCII-8BIT + string: !binary |- + eyJpZCI6MTMyNzUzMjI0LCJ1dWlkIjoiY3VzXzAxZThmYjMyLTc0YTEtMTFlZS1iYTA2LWUzYmZhNjc1YjYyNCIsImV4dGVybmFsX2lkIjoidGVzdF9jdXNfZXh0X2lkIiwibmFtZSI6IlRlc3QgQ3VzdG9tZXIiLCJlbWFpbCI6IiIsInN0YXR1cyI6Ik5ldyBMZWFkIiwiY3VzdG9tZXItc2luY2UiOm51bGwsImF0dHJpYnV0ZXMiOnsiY3VzdG9tIjp7fSwiY2xlYXJiaXQiOnt9LCJzdHJpcGUiOnt9LCJ0YWdzIjpbXX0sImRhdGFfc291cmNlX3V1aWQiOiJkc18wMWIwYzE0MC03NGExLTExZWUtYWNjMS1iN2YwMTk3N2U5NmEiLCJkYXRhX3NvdXJjZV91dWlkcyI6WyJkc18wMWIwYzE0MC03NGExLTExZWUtYWNjMS1iN2YwMTk3N2U5NmEiXSwiZXh0ZXJuYWxfaWRzIjpbInRlc3RfY3VzX2V4dF9pZCJdLCJjb21wYW55IjoiIiwiY291bnRyeSI6bnVsbCwic3RhdGUiOm51bGwsImNpdHkiOiIiLCJ6aXAiOm51bGwsImxlYWRfY3JlYXRlZF9hdCI6bnVsbCwiZnJlZV90cmlhbF9zdGFydGVkX2F0IjpudWxsLCJhZGRyZXNzIjp7ImNvdW50cnkiOm51bGwsInN0YXRlIjpudWxsLCJjaXR5IjoiIiwiYWRkcmVzc196aXAiOm51bGx9LCJtcnIiOjAsImFyciI6MCwiYmlsbGluZy1zeXN0ZW0tdXJsIjpudWxsLCJjaGFydG1vZ3VsLXVybCI6Imh0dHBzOi8vYXBwLmNoYXJ0bW9ndWwuY29tLyMvY3VzdG9tZXJzLzEzMjc1MzIyNC1UZXN0X0N1c3RvbWVyIiwiYmlsbGluZy1zeXN0ZW0tdHlwZSI6IkltcG9ydCBBUEkiLCJjdXJyZW5jeSI6IkVVUiIsImN1cnJlbmN5LXNpZ24iOiLigqwiLCJvd25lciI6bnVsbH0= http_version: - recorded_at: Fri, 27 May 2022 21:54:20 GMT + recorded_at: Fri, 27 Oct 2023 08:15:36 GMT - request: method: post uri: https://api.chartmogul.com/v1/plans body: encoding: UTF-8 - string: '{"name":"Test Plan1","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99"}' + string: '{"name":"Test Plan1","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_01b0c140-74a1-11ee-acc1-b7f01977e96a"}' headers: User-Agent: - - chartmogul-ruby/3.0.0 + - chartmogul-ruby/3.3.1 Content-Type: - application/json Authorization: @@ -98,13 +93,11 @@ http_interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 27 May 2022 21:54:21 GMT + - Fri, 27 Oct 2023 08:15:36 GMT etag: - - W/"6fde56cac48be2d2879439236e61d4c7" + - W/"244269ebdcb63bef4aa5df8aa100cf5a" referrer-policy: - strict-origin-when-cross-origin - status: - - 201 Created x-content-type-options: - nosniff x-download-options: @@ -114,9 +107,9 @@ http_interactions: x-permitted-cross-domain-policies: - none x-request-id: - - 5555551bcf3ef259ad027d1ad2dfadea + - 05ef1774e846e8caac8de96103fbb6cd x-runtime: - - '0.036157' + - '0.064423' x-xss-protection: - 1; mode=block content-length: @@ -125,19 +118,19 @@ http_interactions: - keep-alive body: encoding: UTF-8 - string: '{"external_id":"7cfed9b0-c035-013a-2b33-2ae6b33040d8","name":"Test - Plan1","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99","uuid":"pl_7cfed9b0-c035-013a-2b33-2ae6b33040d8"}' + string: '{"external_id":"ee9b8490-56ce-013c-85a3-2660b071d17e","name":"Test + Plan1","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_01b0c140-74a1-11ee-acc1-b7f01977e96a","uuid":"pl_ee9b8490-56ce-013c-85a3-2660b071d17e"}' http_version: - recorded_at: Fri, 27 May 2022 21:54:21 GMT + recorded_at: Fri, 27 Oct 2023 08:15:36 GMT - request: method: post uri: https://api.chartmogul.com/v1/subscription_events body: encoding: UTF-8 - string: '{"subscription_event":{"id":null,"data_source_uuid":"ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99","customer_external_id":"test_cus_ext_id","subscription_set_external_id":"","subscription_external_id":"test_cus_sub_ext_id1","plan_external_id":"","event_date":"2022-05-18T09:48:34Z","effective_date":"2021-12-30T00:01:00Z","event_type":"subscription_cancelled","external_id":"test_ev_id_create_1","errors":null,"created_at":null,"updated_at":null,"quantity":"","currency":"","amount_in_cents":"","tax_amount_in_cents":null,"retracted_event_id":null}}' + string: '{"subscription_event":{"id":null,"data_source_uuid":"ds_01b0c140-74a1-11ee-acc1-b7f01977e96a","customer_external_id":"test_cus_ext_id","subscription_set_external_id":"","subscription_external_id":"test_cus_sub_ext_id1","plan_external_id":"","event_date":"2022-05-18T09:48:34Z","effective_date":"2021-12-30T00:01:00Z","event_type":"subscription_cancelled","external_id":"test_ev_id_create_1","errors":null,"created_at":null,"updated_at":null,"quantity":"","currency":"","amount_in_cents":"","tax_amount_in_cents":null,"retracted_event_id":null}}' headers: User-Agent: - - chartmogul-ruby/3.0.0 + - chartmogul-ruby/3.3.1 Content-Type: - application/json Authorization: @@ -154,13 +147,11 @@ http_interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 27 May 2022 21:54:21 GMT + - Fri, 27 Oct 2023 08:15:37 GMT etag: - - W/"09e4c0810a4a8c2fbabd9173d353f99b" + - W/"2669e1c6c436ee0a0971adb00ed28da6" referrer-policy: - strict-origin-when-cross-origin - status: - - 201 Created x-content-type-options: - nosniff x-download-options: @@ -170,29 +161,29 @@ http_interactions: x-permitted-cross-domain-policies: - none x-request-id: - - f047e84bd02b0505c9cacafc71906664 + - 901089af31b2474b22895211eeff60b3 x-runtime: - - '0.038987' + - '0.084097' x-xss-protection: - 1; mode=block - transfer-encoding: - - chunked + content-length: + - '560' connection: - keep-alive body: encoding: UTF-8 - string: '{"id":138979501,"data_source_uuid":"ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99","customer_external_id":"test_cus_ext_id","subscription_set_external_id":"","subscription_external_id":"test_cus_sub_ext_id1","plan_external_id":"","event_date":"2022-05-18T09:48:34Z","effective_date":"2021-12-30T00:01:00Z","event_type":"subscription_cancelled","external_id":"test_ev_id_create_1","errors":{},"created_at":"2022-05-27T21:54:21Z","updated_at":"2022-05-27T21:54:21Z","quantity":"","currency":"","amount_in_cents":"","tax_amount_in_cents":null,"retracted_event_id":null}' + string: '{"id":374277746,"data_source_uuid":"ds_01b0c140-74a1-11ee-acc1-b7f01977e96a","customer_external_id":"test_cus_ext_id","subscription_set_external_id":"","subscription_external_id":"test_cus_sub_ext_id1","plan_external_id":"","event_date":"2022-05-18T09:48:34Z","effective_date":"2021-12-30T00:01:00Z","event_type":"subscription_cancelled","external_id":"test_ev_id_create_1","errors":{},"created_at":"2023-10-27T08:15:37Z","updated_at":"2023-10-27T08:15:37Z","quantity":"","currency":"","amount_in_cents":"","tax_amount_in_cents":null,"retracted_event_id":null}' http_version: - recorded_at: Fri, 27 May 2022 21:54:21 GMT + recorded_at: Fri, 27 Oct 2023 08:15:37 GMT - request: method: get - uri: https://api.chartmogul.com/v1/subscription_events?data_source_uuid=ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99 + uri: https://api.chartmogul.com/v1/subscription_events?data_source_uuid=ds_01b0c140-74a1-11ee-acc1-b7f01977e96a body: encoding: US-ASCII string: '' headers: User-Agent: - - chartmogul-ruby/3.0.0 + - chartmogul-ruby/3.3.1 Content-Type: - application/json Authorization: @@ -209,15 +200,11 @@ http_interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 27 May 2022 21:54:21 GMT + - Fri, 27 Oct 2023 08:15:37 GMT etag: - - W/"19aca00f96d5e5fe4b2f45dbc8e61ec7" + - W/"e621fbf6a42d108aee9913a478081e1e" referrer-policy: - strict-origin-when-cross-origin - status: - - 200 OK - vary: - - Accept-Encoding, Accept-Encoding x-content-type-options: - nosniff x-download-options: @@ -227,29 +214,29 @@ http_interactions: x-permitted-cross-domain-policies: - none x-request-id: - - 7561efee0df9bdf9fb734897e35dc90e + - b7442516f6eadd4268cef79dd84ab13d x-runtime: - - '0.016321' + - '0.064263' x-xss-protection: - 1; mode=block content-length: - - '368' + - '777' connection: - keep-alive body: - encoding: ASCII-8BIT - string: '{"subscription_events":[{"id":138979501,"data_source_uuid":"ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99","customer_external_id":"test_cus_ext_id","subscription_set_external_id":"","subscription_external_id":"test_cus_sub_ext_id1","plan_external_id":"","event_date":"2022-05-18T09:48:34Z","effective_date":"2021-12-30T00:01:00Z","event_type":"subscription_cancelled","external_id":"test_ev_id_create_1","errors":{},"created_at":"2022-05-27T21:54:21Z","updated_at":"2022-05-27T21:54:21Z","quantity":"","currency":"","amount_in_cents":"","tax_amount_in_cents":null,"retracted_event_id":null}],"meta":{"next_key":null,"prev_key":null,"before_key":"2022-05-27T21:54:21.938Z","page":1,"total_pages":1}}' + encoding: UTF-8 + string: '{"subscription_events":[{"id":374277746,"data_source_uuid":"ds_01b0c140-74a1-11ee-acc1-b7f01977e96a","customer_external_id":"test_cus_ext_id","subscription_set_external_id":"","subscription_external_id":"test_cus_sub_ext_id1","plan_external_id":"","event_date":"2022-05-18T09:48:34Z","effective_date":"2021-12-30T00:01:00Z","event_type":"subscription_cancelled","external_id":"test_ev_id_create_1","errors":{},"created_at":"2023-10-27T08:15:37Z","updated_at":"2023-10-27T08:15:37Z","quantity":"","currency":"","amount_in_cents":"","tax_amount_in_cents":null,"retracted_event_id":null}],"meta":{"next_key":null,"prev_key":null,"before_key":"2023-10-27T08:15:37.554Z","page":1,"total_pages":1},"cursor":"MjAyMy0xMC0yN1QwODoxNTozNy4yMzE0NjMwMDBaJjM3NDI3Nzc0Ng==","has_more":false}' http_version: - recorded_at: Fri, 27 May 2022 21:54:21 GMT + recorded_at: Fri, 27 Oct 2023 08:15:37 GMT - request: method: delete - uri: https://api.chartmogul.com/v1/subscription_events?subscription_event%5Bid%5D=138979501 + uri: https://api.chartmogul.com/v1/subscription_events?subscription_event%5Bid%5D=374277746 body: encoding: US-ASCII string: '' headers: User-Agent: - - chartmogul-ruby/3.0.0 + - chartmogul-ruby/3.3.1 Authorization: - Basic hidden response: @@ -262,11 +249,9 @@ http_interactions: cache-control: - no-cache date: - - Fri, 27 May 2022 21:54:22 GMT + - Fri, 27 Oct 2023 08:15:37 GMT referrer-policy: - strict-origin-when-cross-origin - status: - - 204 No Content x-content-type-options: - nosniff x-download-options: @@ -276,9 +261,9 @@ http_interactions: x-permitted-cross-domain-policies: - none x-request-id: - - 523d53210f2717f45159faa43ae6903a + - '08cdd1fc74a1bad6a49046e370db1ba3' x-runtime: - - '0.023047' + - '0.042628' x-xss-protection: - 1; mode=block connection: @@ -287,16 +272,16 @@ http_interactions: encoding: UTF-8 string: '' http_version: - recorded_at: Fri, 27 May 2022 21:54:22 GMT + recorded_at: Fri, 27 Oct 2023 08:15:37 GMT - request: method: delete - uri: https://api.chartmogul.com/v1/data_sources/ds_9002d3f2-de07-11ec-bf8d-ab00fe78ae99 + uri: https://api.chartmogul.com/v1/data_sources/ds_01b0c140-74a1-11ee-acc1-b7f01977e96a body: encoding: US-ASCII string: '' headers: User-Agent: - - chartmogul-ruby/3.0.0 + - chartmogul-ruby/3.3.1 Authorization: - Basic hidden response: @@ -307,14 +292,12 @@ http_interactions: access-control-allow-credentials: - 'true' date: - - Fri, 27 May 2022 21:54:22 GMT - status: - - 204 No Content + - Fri, 27 Oct 2023 08:15:38 GMT connection: - keep-alive body: encoding: UTF-8 string: '' http_version: - recorded_at: Fri, 27 May 2022 21:54:22 GMT + recorded_at: Fri, 27 Oct 2023 08:15:38 GMT recorded_with: VCR 5.1.0 diff --git a/spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/should_paginate_using_cursor_when_called_with_next.yml b/spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/should_paginate_using_cursor_when_called_with_next.yml new file mode 100644 index 0000000..9e41d23 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/should_paginate_using_cursor_when_called_with_next.yml @@ -0,0 +1,109 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.chartmogul.com/v1/subscription_events?customer_uuid=cus_713e32ae-74a1-11ee-b822-fbc804fece75&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Fri, 27 Oct 2023 11:15:58 GMT + etag: + - W/"12bad95caa37327853a1d9c7de804214" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - 2375869b84ba29c6546aee6f6c9baded + x-runtime: + - '0.037509' + x-xss-protection: + - 1; mode=block + content-length: + - '764' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"subscription_events":[{"id":374279754,"data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","customer_external_id":"cus_001","subscription_set_external_id":null,"subscription_external_id":"1234","plan_external_id":"plan_Gold_monthly_1_month","event_date":"2023-09-30T23:00:00Z","effective_date":"2023-09-30T23:00:00Z","event_type":"subscription_start","external_id":null,"errors":{},"created_at":"2023-10-27T10:40:29Z","updated_at":"2023-10-27T10:40:29Z","quantity":1,"currency":"EUR","amount_in_cents":100,"tax_amount_in_cents":0,"retracted_event_id":null}],"meta":{"next_key":374279754,"prev_key":null,"before_key":"2023-10-27T11:15:58.538Z","page":1,"total_pages":15},"cursor":"MjAyMy0xMC0yN1QxMDo0MDoyOS4wNTE2NDMwMDBaJjM3NDI3OTc1NA==","has_more":true}' + http_version: + recorded_at: Fri, 27 Oct 2023 11:15:58 GMT +- request: + method: get + uri: https://api.chartmogul.com/v1/subscription_events?cursor=MjAyMy0xMC0yN1QxMDo0MDoyOS4wNTE2NDMwMDBaJjM3NDI3OTc1NA%3D%3D&customer_uuid=cus_713e32ae-74a1-11ee-b822-fbc804fece75&per_page=1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - chartmogul-ruby/3.3.1 + Content-Type: + - application/json + Authorization: + - Basic hidden + response: + status: + code: 200 + message: OK + headers: + access-control-allow-credentials: + - 'true' + cache-control: + - max-age=0, private, must-revalidate + content-type: + - application/json; charset=utf-8 + date: + - Fri, 27 Oct 2023 11:15:58 GMT + etag: + - W/"9d6f3cf9a0c4c67756e6a6cf0372b6fb" + referrer-policy: + - strict-origin-when-cross-origin + x-content-type-options: + - nosniff + x-download-options: + - noopen + x-frame-options: + - DENY + x-permitted-cross-domain-policies: + - none + x-request-id: + - aa891b74b109670dd888d1324f6e086e + x-runtime: + - '0.023068' + x-xss-protection: + - 1; mode=block + content-length: + - '651' + connection: + - keep-alive + body: + encoding: UTF-8 + string: '{"subscription_events":[{"id":374279751,"data_source_uuid":"ds_03cfd2c4-2c7e-11ee-ab23-cb0f008cff46","customer_external_id":"cus_001","subscription_set_external_id":null,"subscription_external_id":"123","plan_external_id":"plan_Gold_annual_1_year","event_date":"2023-10-26T23:00:00Z","effective_date":"2023-10-26T23:00:00Z","event_type":"subscription_start","external_id":null,"errors":{},"created_at":"2023-10-27T10:39:30Z","updated_at":"2023-10-27T10:39:30Z","quantity":1,"currency":"EUR","amount_in_cents":11100,"tax_amount_in_cents":0,"retracted_event_id":null}],"cursor":"MjAyMy0xMC0yN1QxMDozOTozMC43NTgxMzQwMDBaJjM3NDI3OTc1MQ==","has_more":true}' + http_version: + recorded_at: Fri, 27 Oct 2023 11:15:58 GMT +recorded_with: VCR 5.1.0 diff --git a/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/updates_the_subscription_event.yml b/spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/updates_the_subscription_event.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/updates_the_subscription_event.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/updates_the_subscription_event.yml diff --git a/fixtures/vcr_cassettes/ChartMogul_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml b/spec/fixtures/vcr_cassettes/ChartMogul_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml similarity index 100% rename from fixtures/vcr_cassettes/ChartMogul_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml rename to spec/fixtures/vcr_cassettes/ChartMogul_Transactions_Payment/API_Interactions/correctly_interracts_with_the_API.yml diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index cfcede6..96124a8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -12,7 +12,7 @@ require 'webmock/rspec' VCR.configure do |config| - config.cassette_library_dir = 'fixtures/vcr_cassettes' + config.cassette_library_dir = 'spec/fixtures/vcr_cassettes' config.hook_into :faraday config.configure_rspec_metadata! config.filter_sensitive_data('Basic hidden') do |interaction|