frontgo 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b5159138bcd6b1ffa3490df458dffab02fc32fbec40e2d1ca4d649e22750594
4
- data.tar.gz: 8d4ae77bfd54e8fb53d98396f8232bc098570eb92644bde13bc969fc86b98fb3
3
+ metadata.gz: a5fa60dc69f61aa7e71f9d9904a4fbb824fc5396e23fbd986ae39bb1881c28c4
4
+ data.tar.gz: 18bf5222c2d510c94cc451c5be6f3fd2fdebd45f60c35fccdfba09839783c137
5
5
  SHA512:
6
- metadata.gz: 1e7aff04db3ce6ebafbe883178d8b90b19a72f8a005ad41ac18a2fc7271f7fae4ef42516bf46d43d74b6c08cb4e2673b800cf8c4c04edbe3fa93b17772f887fa
7
- data.tar.gz: 5bb2c17a89beb0e435624276229124dd3975375d296112095045f099fb69f0049368375bb06df5030fd6b65b08e0c961ed600f43f5a8dec1f926576928c309dc
6
+ metadata.gz: db6002ce4ce76d7a888b9d1a0f3142d39f94e81f0abdc6b4411b5d7a93b97416fc0882b5746130f48b50f37dd495191cea1c78626eee987d1f7a0d4520c3e2b2
7
+ data.tar.gz: c0808fb249435127999f828b5fa7f7a578aca0c63d1ab67a743c4c1b8e9f0cc1b71414f94ac6d348e0d2ddeecef865dd8ded519a333e91d71ac438459d717d6a
@@ -31,4 +31,4 @@ module Frontgo
31
31
  get "api/v1/connect/credit/check/list"
32
32
  end
33
33
  end
34
- end
34
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Frontgo
4
4
  # @see https://docs.frontpayment.no/books/fpgo-connect/chapter/customer-management
5
- module Customers
5
+ module Customer
6
6
  # @example Get customer details
7
7
  # client.get_customer_details_by_uuid("CSRT1511414842")
8
8
  def get_customer_details_by_uuid(uuid)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Frontgo
4
4
  # @see https://docs.frontpayment.no/books/fpgo-connect/chapter/order-management
5
- module Orders
5
+ module Order
6
6
  # @example Create a one-time payment link session
7
7
  # client.create_session_for_one_time_payment_link({
8
8
  # products: [{ name: "Router", rate: 4500, tax: 12, amount: 4500 }],
@@ -54,9 +54,9 @@ module Frontgo
54
54
  # @example Send E-Faktura invoice
55
55
  # client.send_e_faktura({
56
56
  # products: { "0": { name: "Hair Wash", rate: 51, tax: 0, amount: 51 } },
57
- # customerDetails: {
58
- # type: "private",
59
- # name: "Kari Nordmann",
57
+ # customerDetails: {
58
+ # type: "private",
59
+ # name: "Kari Nordmann",
60
60
  # email: "kari@example.com",
61
61
  # personalNumber: "12345678901"
62
62
  # },
@@ -69,9 +69,9 @@ module Frontgo
69
69
  # @example Send EHF invoice for corporate customers
70
70
  # client.send_ehf_invoice({
71
71
  # products: { "0": { name: "Hair Wash", rate: 51, tax: 0, amount: 51 } },
72
- # customerDetails: {
73
- # type: "corporate",
74
- # name: "Kari Nordmann",
72
+ # customerDetails: {
73
+ # type: "corporate",
74
+ # name: "Kari Nordmann",
75
75
  # email: "kari@example.com",
76
76
  # organizationId: "123456789"
77
77
  # },
@@ -82,8 +82,8 @@ module Frontgo
82
82
  end
83
83
 
84
84
  # @example Cancel an order
85
- # client.cancel_order("ODR123456789", {
86
- # cancellationNote: "Customer requested cancellation"
85
+ # client.cancel_order("ODR123456789", {
86
+ # cancellationNote: "Customer requested cancellation"
87
87
  # })
88
88
  def cancel_order(order_uuid, params)
89
89
  post "api/v1/connect/orders/cancel/#{order_uuid}", params
@@ -92,9 +92,9 @@ module Frontgo
92
92
  # @example Send payment link to customer
93
93
  # client.send_payment_link({
94
94
  # products: { "0": { name: "Hair Wash", rate: 51, tax: 0, amount: 51 } },
95
- # customerDetails: {
96
- # type: "private",
97
- # name: "Kari Nordmann",
95
+ # customerDetails: {
96
+ # type: "private",
97
+ # name: "Kari Nordmann",
98
98
  # email: "kari@example.com"
99
99
  # },
100
100
  # sendOrderBy: { sms: true, email: false, invoice: false },
@@ -107,9 +107,9 @@ module Frontgo
107
107
  # @example Send regular invoice
108
108
  # client.send_invoice({
109
109
  # products: { "0": { name: "Hair Wash", rate: 51, tax: 0, amount: 51 } },
110
- # customerDetails: {
111
- # type: "private",
112
- # name: "Kari Nordmann",
110
+ # customerDetails: {
111
+ # type: "private",
112
+ # name: "Kari Nordmann",
113
113
  # email: "kari@example.com"
114
114
  # },
115
115
  # sendOrderBy: { sms: false, email: false, invoice: true },
@@ -29,4 +29,4 @@ module Frontgo
29
29
  post "api/v1/orders/refund/request/approval/#{order_uuid}", params
30
30
  end
31
31
  end
32
- end
32
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Frontgo
4
4
  # @see https://docs.frontpayment.no/books/fpgo-connect/chapter/reservation-management
5
- module Reservations
5
+ module Reservation
6
6
  # @example Submit a new reservation
7
7
  # client.submit_reservation({
8
8
  # customerDetails: {
@@ -80,4 +80,4 @@ module Frontgo
80
80
  post "api/v1/connect/terminal/orders/cancel/#{order_uuid}", params
81
81
  end
82
82
  end
83
- end
83
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Frontgo
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/frontgo.rb CHANGED
@@ -2,32 +2,31 @@
2
2
 
3
3
  require_relative "frontgo/version"
4
4
  require_relative "frontgo/connection"
5
- require_relative "frontgo/orders"
6
- require_relative "frontgo/reservations"
5
+ require_relative "frontgo/order"
6
+ require_relative "frontgo/reservation"
7
7
  require_relative "frontgo/subscription"
8
- require_relative "frontgo/customers"
8
+ require_relative "frontgo/customer"
9
9
  require_relative "frontgo/refund"
10
10
  require_relative "frontgo/terminal"
11
11
  require_relative "frontgo/credit"
12
- require 'faraday'
13
-
12
+ require "faraday"
14
13
 
15
14
  module Frontgo
16
15
  class Error < StandardError; end
17
16
 
18
17
  class Client
19
18
  include Connection
20
- include Orders
21
- include Reservations
19
+ include Order
20
+ include Reservation
22
21
  include Subscription
23
- include Customers
22
+ include Customer
24
23
  include Refund
25
24
  include Terminal
26
25
  include Credit
27
26
 
28
27
  def initialize(base_url, key:)
29
28
  @connection = Faraday.new(base_url) do |conn|
30
- conn.headers['Authorization'] = "Bearer #{key}"
29
+ conn.headers["Authorization"] = "Bearer #{key}"
31
30
  conn.request :json
32
31
  conn.response :json
33
32
  conn.response :raise_error
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frontgo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav (Stas) Katkov
@@ -40,10 +40,10 @@ files:
40
40
  - lib/frontgo.rb
41
41
  - lib/frontgo/connection.rb
42
42
  - lib/frontgo/credit.rb
43
- - lib/frontgo/customers.rb
44
- - lib/frontgo/orders.rb
43
+ - lib/frontgo/customer.rb
44
+ - lib/frontgo/order.rb
45
45
  - lib/frontgo/refund.rb
46
- - lib/frontgo/reservations.rb
46
+ - lib/frontgo/reservation.rb
47
47
  - lib/frontgo/subscription.rb
48
48
  - lib/frontgo/terminal.rb
49
49
  - lib/frontgo/version.rb