frontgo 0.3.0 → 0.4.0
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +8 -0
- data/lib/frontgo/hosted_checkout.rb +27 -0
- data/lib/frontgo/version.rb +1 -1
- data/lib/frontgo.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f85cddcea75c815e53cc87149dde28a8594e7254f781188e3e5fb594bff897b
|
|
4
|
+
data.tar.gz: 0fd8c5c950e5b753eb3ce33d4620f18be49f3cac8c91112c291205602f782106
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a91d5987ff88a268ec6157bb83166cd29c02395eed18974538ebb3e8c2c1f01e8e0869a062f16c651a6b8c68e4378b9dee3aad8d733e327e9ef208ea1072f3be
|
|
7
|
+
data.tar.gz: dfa1da0242705e3640372e7345bd282aadd4c19de443b95d52377b395025370b9f5261d7961b0df772fab1f7152ce82f11998a5a8f55a18962d54e82fe77930b
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.0]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `HostedCheckout#create_hosted_checkout` to create a hosted checkout payment link (`POST connect/hosted/orders/payment-link/create`)
|
|
12
|
+
|
|
8
13
|
## [0.3.0]
|
|
9
14
|
|
|
10
15
|
### Changed
|
data/README.md
CHANGED
|
@@ -27,6 +27,14 @@ client.create_session_for_one_time_payment_link({
|
|
|
27
27
|
callback: { success: "https://example.com/success", failure: "https://example.com/failure" }
|
|
28
28
|
})
|
|
29
29
|
|
|
30
|
+
# Create a hosted checkout payment link
|
|
31
|
+
client.create_hosted_checkout({
|
|
32
|
+
products: [{ name: "Product", rate: 1000, tax: 25, amount: 1250 }],
|
|
33
|
+
orderSummary: { subTotal: 1000, totalTax: 250, grandTotal: 1250 },
|
|
34
|
+
customerDetails: { type: "private", name: "John Doe", email: "john@example.com" },
|
|
35
|
+
callback: { success: "https://example.com/success", failure: "https://example.com/failure" }
|
|
36
|
+
})
|
|
37
|
+
|
|
30
38
|
# Get order status
|
|
31
39
|
client.get_order_status_by_uuid("ODR123456789")
|
|
32
40
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Frontgo
|
|
4
|
+
# @see https://docs.frontpayment.no/books/fpgo-connect/page/hosted-checkout
|
|
5
|
+
module HostedCheckout
|
|
6
|
+
# @example Create a hosted checkout payment link
|
|
7
|
+
# client.create_hosted_checkout({
|
|
8
|
+
# products: [{ name: "Router", quantity: 1, rate: 4500, tax: 12, amount: 4500 }],
|
|
9
|
+
# orderSummary: { subTotal: 4017.86, totalTax: 482.14, grandTotal: 4500.00 },
|
|
10
|
+
# customerDetails: {
|
|
11
|
+
# type: "private",
|
|
12
|
+
# name: "Kari Nordmann",
|
|
13
|
+
# email: "kari@example.com"
|
|
14
|
+
# },
|
|
15
|
+
# callback: {
|
|
16
|
+
# callbackUrl: "https://example.com/callback",
|
|
17
|
+
# success: "https://example.com/success",
|
|
18
|
+
# failure: "https://example.com/failure"
|
|
19
|
+
# }
|
|
20
|
+
# })
|
|
21
|
+
# # => response.body.dig("data", "orderUuid")
|
|
22
|
+
# # => response.body.dig("data", "paymentUrl")
|
|
23
|
+
def create_hosted_checkout(params)
|
|
24
|
+
post "connect/hosted/orders/payment-link/create", params
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
data/lib/frontgo/version.rb
CHANGED
data/lib/frontgo.rb
CHANGED
|
@@ -9,6 +9,7 @@ require_relative "frontgo/customer"
|
|
|
9
9
|
require_relative "frontgo/refund"
|
|
10
10
|
require_relative "frontgo/terminal"
|
|
11
11
|
require_relative "frontgo/credit"
|
|
12
|
+
require_relative "frontgo/hosted_checkout"
|
|
12
13
|
require "faraday"
|
|
13
14
|
|
|
14
15
|
module Frontgo
|
|
@@ -23,6 +24,7 @@ module Frontgo
|
|
|
23
24
|
include Refund
|
|
24
25
|
include Terminal
|
|
25
26
|
include Credit
|
|
27
|
+
include HostedCheckout
|
|
26
28
|
|
|
27
29
|
# Initializes the client.
|
|
28
30
|
#
|
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.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stanislav (Stas) Katkov
|
|
@@ -41,6 +41,7 @@ files:
|
|
|
41
41
|
- lib/frontgo/connection.rb
|
|
42
42
|
- lib/frontgo/credit.rb
|
|
43
43
|
- lib/frontgo/customer.rb
|
|
44
|
+
- lib/frontgo/hosted_checkout.rb
|
|
44
45
|
- lib/frontgo/order.rb
|
|
45
46
|
- lib/frontgo/refund.rb
|
|
46
47
|
- lib/frontgo/reservation.rb
|
|
@@ -70,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
70
71
|
- !ruby/object:Gem::Version
|
|
71
72
|
version: '0'
|
|
72
73
|
requirements: []
|
|
73
|
-
rubygems_version:
|
|
74
|
+
rubygems_version: 4.0.11
|
|
74
75
|
specification_version: 4
|
|
75
76
|
summary: Ruby client for FrontPayment API
|
|
76
77
|
test_files: []
|