-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusage_example.rb
39 lines (32 loc) · 1.36 KB
/
usage_example.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# encoding: utf-8
# Run with: bundle exec ruby ./usage_example.rb
require 'collector'
address = Collector::Address.new(
address1: 'GATUADRESSAKT211',
city: 'UMEÅ',
country_code: 'SE',
postal_code: '90737',
first_name: 'FÖRNAMNAKT211',
last_name: 'EFTERNAMNAKT211')
invoice_row = Collector::InvoiceRow.new(
article_id: 12,
description: 'A wonderful thing',
quantity: '2',
unit_price: 12.0,
vat: 2.0)
invoice_request = Collector::InvoiceRequest.new(activation_option: 0,
country_code: 'SE',
currency: 'SEK',
delivery_address: address,
invoice_address: address,
invoice_delivery_method: 1,
invoice_rows: [invoice_row],
invoice_type: 0,
order_date: DateTime.now,
reg_no: '1602079954',
store_id: '355')
user_name = 'blingo_test'
password = 'blingo_test'
collector = Collector.new(user_name, password)
response = collector.add_invoice(invoice_request)
puts "RESPONSE: #{response.inspect}"