chartmogul/chartmogul-go

View on GitHub
integration_tests/fixtures/retrieve_invoice.yaml

Summary

Maintainability
Test Coverage
---
version: 1
rwmutex: {}
interactions:
- request:
    body: '{"name":"Test Retrieve Invoice 1"}'
    form: {}
    headers:
      Authorization:
      - Basic hidden=
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/data_sources
    method: POST
  response:
    body: '{"uuid":"ds_c5268c50-4153-11e7-88b1-af4e084d28d3","name":"Test Retrieve
      Invoice 1","system":"Import API","created_at":"2017-05-25T14:09:30.277Z","status":"idle"}'
    headers:
      Access-Control-Allow-Credentials:
      - "true"
      Content-Length:
      - "161"
      Content-Type:
      - application/json
      Date:
      - Thu, 25 May 2017 14:09:30 GMT
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 201 Created
    status: 201 Created
    code: 201
- request:
    body: '{"data_source_uuid":"ds_c5268c50-4153-11e7-88b1-af4e084d28d3","external_id":"ext_plan","interval_count":1,"interval_unit":"month","name":"test
      plan"}'
    form: {}
    headers:
      Authorization:
      - Basic hidden=
      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_c5268c50-4153-11e7-88b1-af4e084d28d3","uuid":"pl_c561aa4c-4153-11e7-88b1-d720192caa6d"}'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Type:
      - application/json; charset=utf-8
      Date:
      - Thu, 25 May 2017 14:09:30 GMT
      Etag:
      - W/"900de4d09ac845e1c88aed8176dc9dc3"
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 201 Created
      Strict-Transport-Security:
      - max-age=15768000
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Request-Id:
      - 7c27b541-ea5f-4dad-a813-d4f5bc4c9c5b
      X-Runtime:
      - "0.259229"
      X-Xss-Protection:
      - 1; mode=block
    status: 201 Created
    code: 201
- request:
    body: '{"data_source_uuid":"ds_c5268c50-4153-11e7-88b1-af4e084d28d3","email":"petr@chartmogul.com","external_id":"ext_customer","name":"Test
      Delete Invoice"}'
    form: {}
    headers:
      Authorization:
      - Basic hidden=
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/customers
    method: POST
  response:
    body: '{"id":75393,"uuid":"cus_c6076e28-4153-11e7-88b1-fbbe5e3a5ff2","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_c5268c50-4153-11e7-88b1-af4e084d28d3","data_source_uuids":["ds_c5268c50-4153-11e7-88b1-af4e084d28d3"],"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/75393-Test_Delete_Invoice","billing-system-type":"Import
      API","currency":"USD","currency-sign":"$"}'
    headers:
      Access-Control-Allow-Credentials:
      - "true"
      Content-Length:
      - "789"
      Content-Type:
      - application/json
      Date:
      - Thu, 25 May 2017 14:09:32 GMT
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 201 Created
    status: 201 Created
    code: 201
- request:
    body: '{"invoices":[{"currency":"EUR","date":"2017-05-25T16:09:33+02:00","external_id":"INV_to_be_retrieved","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_c561aa4c-4153-11e7-88b1-d720192caa6d","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","subscription_set_external_id":"ext_subscription_set","type":"subscription"}],"transactions":[{"date":"2017-05-25T19:09:33+02:00","result":"successful","type":"payment"}]}]}'
    form: {}
    headers:
      Authorization:
      - Basic hidden=
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/import/customers/cus_c6076e28-4153-11e7-88b1-fbbe5e3a5ff2/invoices
    method: POST
  response:
    body: '{"invoices":[{"uuid":"inv_ada9eb97-f04a-4bc6-90dd-70dba65f4855","external_id":"INV_to_be_retrieved","date":"2017-05-25T14:09:33.000Z","due_date":null,"currency":"EUR","line_items":[{"uuid":"li_fb009b9f-f2a7-4940-acb2-63fd4f0230e4","external_id":"ext_line_item","type":"subscription","subscription_uuid":"sub_e60e9cef-f614-4642-af0a-96e0d0271f3b","subscription_external_id":"ext_subscription","subscription_set_external_id":"ext_subscription_set","plan_uuid":"pl_c561aa4c-4153-11e7-88b1-d720192caa6d","prorated":false,"service_period_start":"2017-05-01T00:00:00.000Z","service_period_end":"2017-05-31T00:00:00.000Z","amount_in_cents":10000,"quantity":10,"discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"account_code":""},{"uuid":"li_e37df05b-5749-464a-8a94-1d68e754eede","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,"account_code":""}],"transactions":[{"uuid":"tr_dfbb823e-9c5b-49c3-a861-e4dfecd65116","external_id":null,"type":"payment","date":"2017-05-25T17:09:33.000Z","result":"successful"}]}]}'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Type:
      - application/json; charset=utf-8
      Date:
      - Thu, 25 May 2017 14:09:33 GMT
      Etag:
      - W/"fe8e27c2a7f8152a5017b552ddc43a3a"
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Strict-Transport-Security:
      - max-age=15768000
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Request-Id:
      - c4475dfb-4e76-48f5-9319-7668e87a24d7
      X-Runtime:
      - "0.959648"
      X-Xss-Protection:
      - 1; mode=block
    status: 201 Created
    code: 201
- request:
    body: ""
    form: {}
    headers:
      Authorization:
      - Basic hidden=
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/invoices/inv_ada9eb97-f04a-4bc6-90dd-70dba65f4855
    method: GET
  response:
    body: '{"uuid":"inv_ada9eb97-f04a-4bc6-90dd-70dba65f4855","external_id":"INV_to_be_retrieved","date":"2017-05-25T14:09:33.000Z","due_date":null,"currency":"EUR","line_items":[{"uuid":"li_fb009b9f-f2a7-4940-acb2-63fd4f0230e4","external_id":"ext_line_item","type":"subscription","subscription_uuid":"sub_e60e9cef-f614-4642-af0a-96e0d0271f3b","subscription_external_id":"ext_subscription","subscription_set_external_id":"ext_subscription_set","plan_uuid":"pl_c561aa4c-4153-11e7-88b1-d720192caa6d","prorated":false,"service_period_start":"2017-05-01T00:00:00.000Z","service_period_end":"2017-05-31T00:00:00.000Z","amount_in_cents":10000,"quantity":10,"discount_code":"","discount_amount_in_cents":0,"tax_amount_in_cents":0,"account_code":""},{"uuid":"li_e37df05b-5749-464a-8a94-1d68e754eede","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,"account_code":""}],"transactions":[{"uuid":"tr_dfbb823e-9c5b-49c3-a861-e4dfecd65116","external_id":null,"type":"payment","date":"2017-05-25T17:09:33.000Z","result":"successful"}]}'
    headers:
      Cache-Control:
      - max-age=0, private, must-revalidate
      Content-Type:
      - application/json; charset=utf-8
      Date:
      - Thu, 25 May 2017 14:09:33 GMT
      Etag:
      - W/"0bf38bb6702ace493a367210453c5414"
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Strict-Transport-Security:
      - max-age=15768000
      Vary:
      - Accept-Encoding
      - Accept-Encoding
      X-Content-Type-Options:
      - nosniff
      X-Frame-Options:
      - SAMEORIGIN
      X-Request-Id:
      - b41cadef-c71a-42ba-904f-ec5383139775
      X-Runtime:
      - "0.453883"
      X-Xss-Protection:
      - 1; mode=block
    status: 200 OK
    code: 200
- request:
    body: ""
    form: {}
    headers:
      Authorization:
      - Basic hidden=
      Content-Type:
      - application/json
    url: https://api.chartmogul.com/v1/data_sources/ds_c5268c50-4153-11e7-88b1-af4e084d28d3
    method: DELETE
  response:
    body: ""
    headers:
      Access-Control-Allow-Credentials:
      - "true"
      Date:
      - Thu, 25 May 2017 14:09:33 GMT
      Retry-Count:
      - "0"
      Server:
      - nginx/1.10.1
      Status:
      - 204 No Content
    status: 204 No Content
    code: 204