chartmogul/chartmogul-go

View on GitHub
integration_tests/fixtures/empty_data_source.yaml

Summary

Maintainability
Test Coverage
---
version: 1
interactions:
- request:
    body: '{"name":"Test Purge DS Data"}'
    form: {}
    headers:
      Authorization:
      - Basic secret
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/data_sources
    method: POST
  response:
    body: '{"uuid":"ds_00aa9ab0-ecd1-11ea-8422-7b2ad002e373","name":"Test Purge DS
      Data","system":"Import API","created_at":"2020-09-02T04:01:39.119Z","status":"idle"}'
    headers:
      Access-Control-Allow-Credentials:
      - "true"
      Content-Type:
      - application/json
      Date:
      - Wed, 02 Sep 2020 04:01:39 GMT
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 201 Created
    status: 201 Created
    code: 201
    duration: ""
- request:
    body: '{"data_source_uuid":"ds_00aa9ab0-ecd1-11ea-8422-7b2ad002e373","external_id":"ext_plan","interval_count":1,"interval_unit":"month","name":"test
      plan"}'
    form: {}
    headers:
      Authorization:
      - Basic secret
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/plans
    method: POST
  response:
    body: '{"external_id":"ext_plan","name":"test plan","interval_count":1,"interval_unit":"month","data_source_uuid":"ds_00aa9ab0-ecd1-11ea-8422-7b2ad002e373","uuid":"pl_00aa9ab1-ecd1-11ea-8422-9b941bd0ee66"}'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Type:
      - application/json; charset=utf-8
      Date:
      - Wed, 02 Sep 2020 04:01:39 GMT
      Etag:
      - W/"33ef8510635c3aa008d5de91aabf23fa"
      Referrer-Policy:
      - strict-origin-when-cross-origin
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 201 Created
      Strict-Transport-Security:
      - max-age=15768000
      X-Content-Type-Options:
      - nosniff
      X-Download-Options:
      - noopen
      X-Frame-Options:
      - SAMEORIGIN
      X-Permitted-Cross-Domain-Policies:
      - none
      X-Request-Id:
      - acb2fbbc-a9b1-4463-900c-9660e5bf0a1a
      X-Runtime:
      - "0.094127"
      X-Xss-Protection:
      - 1; mode=block
    status: 201 Created
    code: 201
    duration: ""
- request:
    body: '{"data_source_uuid":"ds_00aa9ab0-ecd1-11ea-8422-7b2ad002e373","email":"petr@chartmogul.com","external_id":"ext_customer","name":"Test
      Delete Invoice"}'
    form: {}
    headers:
      Authorization:
      - Basic secret
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/customers
    method: POST
  response:
    body: '{"id":80049153,"uuid":"cus_00aa9ab2-ecd1-11ea-8422-a7aee6949ca5","external_id":"ext_customer","name":"Test
      Delete Invoice","email":"petr@chartmogul.com","status":"Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_00aa9ab0-ecd1-11ea-8422-7b2ad002e373","data_source_uuids":["ds_00aa9ab0-ecd1-11ea-8422-7b2ad002e373"],"external_ids":["ext_customer"],"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/80049153-Test_Delete_Invoice","billing-system-type":"Import
      API","currency":"USD","currency-sign":"$"}'
    headers:
      Access-Control-Allow-Credentials:
      - "true"
      Content-Type:
      - application/json
      Date:
      - Wed, 02 Sep 2020 04:01:40 GMT
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 201 Created
    status: 201 Created
    code: 201
    duration: ""
- request:
    body: '{"invoices":[{"currency":"EUR","date":"2020-09-02T10:01:40+06:00","external_id":"INV_to_be_deleted","line_items":[{"amount_in_cents":4500,"description":"fake_item","quantity":2,"type":"one_time"},{"amount_in_cents":10000,"external_id":"ext_line_item","plan_uuid":"pl_00aa9ab1-ecd1-11ea-8422-9b941bd0ee66","quantity":10,"service_period_end":"2017-05-31T00:00:00.000Z","service_period_start":"2017-05-01T00:00:00.000Z","subscription_external_id":"ext_subscription","type":"subscription"}],"transactions":[{"date":"2020-09-02T13:01:40+06:00","result":"successful","type":"payment"}]}]}'
    form: {}
    headers:
      Authorization:
      - Basic secret
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/import/customers/cus_00aa9ab2-ecd1-11ea-8422-a7aee6949ca5/invoices
    method: POST
  response:
    body: '{"invoices":[{"uuid":"inv_e4f52843-1dad-4ad8-8d63-c475398a84ac","date":"2020-09-02T04:01:40.000Z","due_date":null,"external_id":"INV_to_be_deleted","currency":"EUR","line_items":[{"uuid":"li_c5646351-abd1-43f4-9a88-b24e1a20fdf2","external_id":null,"type":"one_time","description":"fake_item","amount_in_cents":4500,"quantity":2,"discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"transaction_fees_in_cents":0,"account_code":""},{"uuid":"li_816bcbbc-978a-41eb-a1c3-b388681cd22e","external_id":"ext_line_item","type":"subscription","subscription_uuid":"sub_9ead74e9-c656-431b-80ec-1c2708c0566b","subscription_external_id":"ext_subscription","prorated":false,"service_period_start":"2017-05-01T00:00:00.000Z","service_period_end":"2017-05-31T00:00:00.000Z","plan_uuid":"pl_00aa9ab1-ecd1-11ea-8422-9b941bd0ee66","amount_in_cents":10000,"quantity":10,"discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"transaction_fees_in_cents":0,"account_code":""}],"transactions":[{"uuid":"tr_f4ef4b0b-bd98-4662-9a2a-8b87a576938b","external_id":null,"type":"payment","date":"2020-09-02T07:01:40.000Z","result":"successful"}]}]}'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Type:
      - application/json; charset=utf-8
      Date:
      - Wed, 02 Sep 2020 04:01:42 GMT
      Etag:
      - W/"6a2c13cd17023c53bc4f5d38c0f44549"
      Referrer-Policy:
      - strict-origin-when-cross-origin
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 201 Created
      Strict-Transport-Security:
      - max-age=15768000
      X-Content-Type-Options:
      - nosniff
      X-Download-Options:
      - noopen
      X-Frame-Options:
      - SAMEORIGIN
      X-Permitted-Cross-Domain-Policies:
      - none
      X-Request-Id:
      - c939e429-b4c3-4a4b-9256-018cfa0b2605
      X-Runtime:
      - "0.784663"
      X-Xss-Protection:
      - 1; mode=block
    status: 201 Created
    code: 201
    duration: ""
- request:
    body: ""
    form: {}
    headers:
      Authorization:
      - Basic secret
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/data_sources/ds_00aa9ab0-ecd1-11ea-8422-7b2ad002e373/all
    method: DELETE
  response:
    body: ""
    headers:
      Access-Control-Allow-Credentials:
      - "true"
      Date:
      - Wed, 02 Sep 2020 04:01:42 GMT
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 204 No Content
    status: 204 No Content
    code: 204
    duration: ""
- request:
    body: ""
    form: {}
    headers:
      Authorization:
      - Basic secret
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/import/customers/cus_00aa9ab2-ecd1-11ea-8422-a7aee6949ca5/invoices
    method: GET
  response:
    body: '{"customer_uuid":"cus_00aa9ab2-ecd1-11ea-8422-a7aee6949ca5","invoices":[],"current_page":1,"total_pages":0}'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Type:
      - application/json; charset=utf-8
      Date:
      - Wed, 02 Sep 2020 04:03:44 GMT
      Etag:
      - W/"e623c1541c26f1500d0cb2268fba1b01"
      Referrer-Policy:
      - strict-origin-when-cross-origin
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 200 OK
      Strict-Transport-Security:
      - max-age=15768000
      Vary:
      - Accept-Encoding
      - Accept-Encoding
      X-Content-Type-Options:
      - nosniff
      X-Download-Options:
      - noopen
      X-Frame-Options:
      - SAMEORIGIN
      X-Permitted-Cross-Domain-Policies:
      - none
      X-Request-Id:
      - 73e2f191-71b8-4d4c-927e-1c44bc8a0094
      X-Runtime:
      - "0.051682"
      X-Xss-Protection:
      - 1; mode=block
    status: 200 OK
    code: 200
    duration: ""
- request:
    body: ""
    form: {}
    headers:
      Authorization:
      - Basic secret
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/customers?data_source_uuid=ds_00aa9ab0-ecd1-11ea-8422-7b2ad002e373
    method: GET
  response:
    body: '{"entries":[],"current_page":1,"total_pages":1,"has_more":false,"per_page":200,"page":1}'
    headers:
      Access-Control-Allow-Credentials:
      - "true"
      Content-Type:
      - application/json
      Date:
      - Wed, 02 Sep 2020 04:03:45 GMT
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 200 OK
      Vary:
      - Accept-Encoding
      - Accept-Encoding
    status: 200 OK
    code: 200
    duration: ""
- request:
    body: ""
    form: {}
    headers:
      Authorization:
      - Basic secret
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/data_sources/ds_00aa9ab0-ecd1-11ea-8422-7b2ad002e373
    method: DELETE
  response:
    body: ""
    headers:
      Access-Control-Allow-Credentials:
      - "true"
      Date:
      - Wed, 02 Sep 2020 04:03:45 GMT
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 204 No Content
    status: 204 No Content
    code: 204
    duration: ""