klarna-xmlrpc 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +13 -0
- data/Gemfile +14 -0
- data/Guardfile +16 -0
- data/MIT-LICENSE +20 -0
- data/README.textile +139 -0
- data/Rakefile +22 -0
- data/TODO +30 -0
- data/examples/Gemfile +8 -0
- data/examples/config/initializer.rb +15 -0
- data/examples/console.rb +71 -0
- data/examples/public/images/klarna.png +0 -0
- data/examples/public/images/ruby.png +0 -0
- data/examples/views/_address.haml +22 -0
- data/examples/views/_articles.haml +21 -0
- data/examples/views/checkout_page_example.haml +2 -0
- data/examples/views/essential/add_transaction/_form.haml +32 -0
- data/examples/views/essential/add_transaction/result.haml +7 -0
- data/examples/views/essential/calculate_monthly_cost/_form.haml +16 -0
- data/examples/views/essential/calculate_monthly_cost/result.haml +7 -0
- data/examples/views/essential/get_addresses/_form.haml +9 -0
- data/examples/views/essential/get_addresses/result.haml +8 -0
- data/examples/views/index.haml +296 -0
- data/examples/views/layout.haml +48 -0
- data/examples/views/payment_terms_example.haml +102 -0
- data/examples/views/product_page_example.haml +2 -0
- data/examples/views/reservation/activate_reservation/_form.haml +54 -0
- data/examples/views/reservation/activate_reservation/result.haml +7 -0
- data/examples/views/reservation/cancel_reservation/_form.haml +8 -0
- data/examples/views/reservation/cancel_reservation/result.haml +7 -0
- data/examples/views/reservation/change_reservation/_form.haml +10 -0
- data/examples/views/reservation/change_reservation/result.haml +7 -0
- data/examples/views/reservation/reserve_amount/_form.haml +58 -0
- data/examples/views/reservation/reserve_amount/result.haml +7 -0
- data/examples/views/reservation/reserve_ocr_numbers/_form.haml +8 -0
- data/examples/views/reservation/reserve_ocr_numbers/result.haml +7 -0
- data/examples/views/reservation/split_reservation/_form.haml +14 -0
- data/examples/views/reservation/split_reservation/result.haml +7 -0
- data/examples/views/special/get_pclasses/_form.haml +8 -0
- data/examples/views/special/get_pclasses/result.haml +7 -0
- data/examples/views/special/invoice_address/_form.haml +8 -0
- data/examples/views/special/invoice_address/result.haml +7 -0
- data/examples/views/special/invoice_amount/_form.haml +8 -0
- data/examples/views/special/invoice_amount/result.haml +7 -0
- data/examples/views/special/is_invoice_paid/_form.haml +8 -0
- data/examples/views/special/is_invoice_paid/result.haml +7 -0
- data/examples/views/special/update_charge_amount/_form.haml +15 -0
- data/examples/views/special/update_charge_amount/result.haml +7 -0
- data/examples/views/special/update_goods_quantity/_form.haml +17 -0
- data/examples/views/special/update_goods_quantity/result.haml +7 -0
- data/examples/views/special/update_order_number/_form.haml +10 -0
- data/examples/views/special/update_order_number/result.haml +7 -0
- data/examples/views/useful/activate_invoice/_form.haml +9 -0
- data/examples/views/useful/activate_invoice/result.haml +7 -0
- data/examples/views/useful/credit_invoice/_form.haml +11 -0
- data/examples/views/useful/credit_invoice/result.haml +7 -0
- data/examples/views/useful/delete_invoice/_form.haml +9 -0
- data/examples/views/useful/delete_invoice/result.haml +7 -0
- data/examples/views/useful/email_invoice/_form.haml +9 -0
- data/examples/views/useful/email_invoice/result.haml +7 -0
- data/examples/views/useful/has_account/_form.haml +9 -0
- data/examples/views/useful/has_account/result.haml +7 -0
- data/examples/views/useful/return_amount/_form.haml +15 -0
- data/examples/views/useful/return_amount/result.haml +7 -0
- data/examples/views/useful/send_invoice/_form.haml +9 -0
- data/examples/views/useful/send_invoice/result.haml +7 -0
- data/examples/web.rb +349 -0
- data/klarna.gemspec +34 -0
- data/lib/klarna.rb +171 -0
- data/lib/klarna/api.rb +187 -0
- data/lib/klarna/api/client.rb +126 -0
- data/lib/klarna/api/constants.rb +647 -0
- data/lib/klarna/api/errors.rb +154 -0
- data/lib/klarna/api/methods.rb +16 -0
- data/lib/klarna/api/methods/cost_calculations.rb +134 -0
- data/lib/klarna/api/methods/invoicing.rb +304 -0
- data/lib/klarna/api/methods/reservation.rb +188 -0
- data/lib/klarna/api/methods/standard.rb +126 -0
- data/lib/klarna/version.rb +5 -0
- data/test/fixtures/api/companies.yml +97 -0
- data/test/fixtures/api/pclasses.yml +37 -0
- data/test/fixtures/api/persons.yml +144 -0
- data/test/fixtures/api/stores.yml +6 -0
- data/test/fixtures/klarna.yml +10 -0
- data/test/klarna/api/client_test.rb +288 -0
- data/test/klarna/api/errors_test.rb +34 -0
- data/test/klarna/api/methods/cost_calculations_test.rb +78 -0
- data/test/klarna/api/methods/invoicing_test.rb +409 -0
- data/test/klarna/api/methods/reservation_test.rb +66 -0
- data/test/klarna/api/methods/standard_test.rb +244 -0
- data/test/klarna/api_test.rb +184 -0
- data/test/klarna_test.rb +204 -0
- data/test/support/assertions_helper.rb +40 -0
- data/test/test_helper.rb +55 -0
- metadata +335 -0
@@ -0,0 +1,54 @@
|
|
1
|
+
%h3 Activate Reservation
|
2
|
+
%p
|
3
|
+
|
4
|
+
%form{:action => '/reservation/activate_reservation', :name => 'active_reservation'}
|
5
|
+
%p
|
6
|
+
= field "Reservation ID:", :reservation_id, :text, :size => 10
|
7
|
+
%p
|
8
|
+
= field "SSN:", :pno, :text, :size => 10
|
9
|
+
|
10
|
+
= partial :articles
|
11
|
+
|
12
|
+
%p
|
13
|
+
= currency_selector "Currency:"
|
14
|
+
%p
|
15
|
+
= field "Reference", :reference, :text, :size => 10
|
16
|
+
%p
|
17
|
+
= field "Reference ID", :reference_id, :text, :size => 10
|
18
|
+
%p
|
19
|
+
= field "Order ID #1:", :order_id_1, :text, :size => 10
|
20
|
+
%p
|
21
|
+
= field "Order ID #2", :order_id_2, :text, :size => 10
|
22
|
+
|
23
|
+
%table
|
24
|
+
%tbody
|
25
|
+
%tr
|
26
|
+
%td
|
27
|
+
%h3 Delivery address:
|
28
|
+
= partial :address, :prefix => 'delivery_'
|
29
|
+
|
30
|
+
%td
|
31
|
+
%h3 Invoice address:
|
32
|
+
= partial :address, :prefix => 'invoice_'
|
33
|
+
|
34
|
+
%p
|
35
|
+
= field "E-mail:", :email, :text, :size => 20
|
36
|
+
*
|
37
|
+
%p
|
38
|
+
= field "Phone:", :phone, :text, :size => 10
|
39
|
+
*
|
40
|
+
%p
|
41
|
+
= field "Mobile:", :mobile, :text, :size => 10
|
42
|
+
*
|
43
|
+
%p
|
44
|
+
= shipment_type_selector "Shipment type:"
|
45
|
+
%p
|
46
|
+
= country_selector "Country:"
|
47
|
+
%p
|
48
|
+
= language_selector "Language:"
|
49
|
+
%p
|
50
|
+
= ssn_encoding_selector "SSN Encoding:"
|
51
|
+
%p
|
52
|
+
= field "Yearly salary:", :yearly_salary, :text, :size => 20, :value => 0
|
53
|
+
%p
|
54
|
+
= submit_button "Activate"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%h3 Change Reservation
|
2
|
+
%p Enter reservation number and new amount.
|
3
|
+
|
4
|
+
%form{:action => '/reservation/change_reservation'}
|
5
|
+
%p
|
6
|
+
= field "Reservation ID:", :reservation_id, :text, :size => 6
|
7
|
+
%p
|
8
|
+
= field "New amount:", :new_amount, :text, :size => 6
|
9
|
+
%p
|
10
|
+
= submit_button "Update"
|
@@ -0,0 +1,58 @@
|
|
1
|
+
%h3 Reserve Amount (Create Reservation)
|
2
|
+
%p
|
3
|
+
|
4
|
+
%form{:action => '/reservation/reserve_amount', :name => 'reserve_amount'}
|
5
|
+
%p
|
6
|
+
= field "SSN:", :pno, :text, :size => 10
|
7
|
+
*
|
8
|
+
%p
|
9
|
+
= field "Amount:", :amount, :text, :size => 10
|
10
|
+
*
|
11
|
+
|
12
|
+
= partial :articles
|
13
|
+
|
14
|
+
%p
|
15
|
+
= currency_selector "Currency:"
|
16
|
+
%p
|
17
|
+
= field "Reference", :reference, :text, :size => 10
|
18
|
+
%p
|
19
|
+
= field "Reference ID", :reference_id, :text, :size => 10
|
20
|
+
%p
|
21
|
+
= field "Order ID #1:", :order_id_1, :text, :size => 10
|
22
|
+
%p
|
23
|
+
= field "Order ID #2", :order_id_2, :text, :size => 10
|
24
|
+
|
25
|
+
%table
|
26
|
+
%tbody
|
27
|
+
%tr
|
28
|
+
%td
|
29
|
+
%h3 Delivery address:
|
30
|
+
= partial :address, :prefix => 'delivery_'
|
31
|
+
|
32
|
+
%td
|
33
|
+
%h3 Invoice address:
|
34
|
+
= partial :address, :prefix => 'invoice_'
|
35
|
+
|
36
|
+
%p
|
37
|
+
= field "E-mail:", :email, :text, :size => 20
|
38
|
+
*
|
39
|
+
%p
|
40
|
+
= field "Phone:", :phone, :text, :size => 10
|
41
|
+
*
|
42
|
+
%p
|
43
|
+
= field "Mobile:", :mobile, :text, :size => 10
|
44
|
+
*
|
45
|
+
%p
|
46
|
+
= field "Annual salary:", :annual_salary, :text, :size => 20, :value => 0
|
47
|
+
|
48
|
+
%p
|
49
|
+
= shipment_type_selector "Shipment type:"
|
50
|
+
%p
|
51
|
+
= country_selector "Country:"
|
52
|
+
%p
|
53
|
+
= language_selector "Language:"
|
54
|
+
%p
|
55
|
+
= ssn_encoding_selector "SSN Encoding:"
|
56
|
+
|
57
|
+
%p
|
58
|
+
= submit_button "Reserve"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%h3 Split Reservation
|
2
|
+
%p Enter reservation number and new amount.
|
3
|
+
|
4
|
+
%form{:action => '/reservation/split_reservation'}
|
5
|
+
%p
|
6
|
+
= field "Reservation ID:", :reservation_id, :text, :size => 6
|
7
|
+
%p
|
8
|
+
= field "Split amount:", :split_amount, :text, :size => 6
|
9
|
+
%p
|
10
|
+
= field "Order ID #1:", :order_id_1, :text, :size => 6
|
11
|
+
%p
|
12
|
+
= field "Order ID #2:", :order_id_2, :text, :size => 6
|
13
|
+
%p
|
14
|
+
= submit_button "Split"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
%h3 Update Charge Amount
|
2
|
+
%p Enter invoice number of a passive invoice on which you would like to update the charge amount.
|
3
|
+
|
4
|
+
%form{:action => '/special/update_charge_amount'}
|
5
|
+
%p
|
6
|
+
= field "Invoice ID:", :invoice_no, :text, :size => 10
|
7
|
+
%p
|
8
|
+
%input{:name => :charge_type, :type => :radio, :value => '0', :checked => true}
|
9
|
+
%label{:for => :charge_type}= "Shipment"
|
10
|
+
%input{:name => :charge_type, :type => :radio, :value => '1'}
|
11
|
+
%label{:for => :charge_type}= "Handling"
|
12
|
+
%p
|
13
|
+
= field "New amount:", :new_amount, :text, :size => 6
|
14
|
+
%p
|
15
|
+
= submit_button "Update"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
%h3 Update Goods Quantity
|
2
|
+
%p Enter invoice number of a passive invoice on which you would like to update the quantity of a goods.
|
3
|
+
|
4
|
+
%form{:action => '/special/update_goods_quantity'}
|
5
|
+
%p
|
6
|
+
= field "Invoice ID:", :invoice_no, :text, :size => 10
|
7
|
+
%table
|
8
|
+
%thead
|
9
|
+
%tr
|
10
|
+
%th Quantity
|
11
|
+
%th Art.no.
|
12
|
+
%tbody
|
13
|
+
%tr
|
14
|
+
%td= field "", :quantity, :text, :value => "3", :size => 2
|
15
|
+
%td= field "", :article_no, :text, :value => "ABC-123", :size => 10
|
16
|
+
%p
|
17
|
+
= submit_button "Update"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%h3 Update Order Number
|
2
|
+
%p Enter invoice number of a passive invoice on which you would like to update the order number.
|
3
|
+
|
4
|
+
%form{:action => '/special/update_order_number'}
|
5
|
+
%p
|
6
|
+
= field "Invoice ID:", :invoice_no, :text, :size => 10
|
7
|
+
%p
|
8
|
+
= field "New order number:", :new_order_id, :text, :size => 10
|
9
|
+
%p
|
10
|
+
= submit_button "Update"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
%h3 Activate Invoice
|
2
|
+
%p Enter invoice number of an passive invoice you would like to activate. Options: Fully, or partly.
|
3
|
+
|
4
|
+
%form{:action => '/invoicing/activate_invoice'}
|
5
|
+
%p
|
6
|
+
= field "Invoice ID:", :invoice_no, :text, :size => 10
|
7
|
+
*
|
8
|
+
%p
|
9
|
+
= submit_button "Activate"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
%h3 Credit Invoice
|
2
|
+
%p Enter invoice number of an active invoice you would like to return. Options: Fully, or partly.
|
3
|
+
|
4
|
+
%form{:action => '/invoicing/activate_invoice'}
|
5
|
+
%p
|
6
|
+
= field "Invoice ID:", :invoice_no, :text, :size => 10
|
7
|
+
*
|
8
|
+
%p
|
9
|
+
= field "Credit ID:", :credit_id, :text, :size => 10
|
10
|
+
%p
|
11
|
+
= submit_button "Credit"
|