Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/sumup/resources/readers/checkouts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ def create_with_response(merchant_code:, reader_id:, body: UNSET, options: nil)
#
#
# **Note**: If the target device is a Solo, it must be in version 3.3.28.0 or higher.
# @return [untyped]
def terminate(merchant_code:, reader_id:, body: UNSET, options: nil)
# @return [nil]
def terminate(merchant_code:, reader_id:, options: nil)
@client.request(method: "POST", path: "/v0.1/merchants/#{path_segment(merchant_code)}/readers/#{path_segment(reader_id)}/terminate",
query: {}, body: body, options: options,
response_type: {202 => :any}, with_response: false)
query: {}, options: options,
response_type: {202 => :nil}, with_response: false)
end

def terminate_with_response(merchant_code:, reader_id:, body: UNSET, options: nil)
def terminate_with_response(merchant_code:, reader_id:, options: nil)
@client.request(method: "POST", path: "/v0.1/merchants/#{path_segment(merchant_code)}/readers/#{path_segment(reader_id)}/terminate",
query: {}, body: body, options: options,
response_type: {202 => :any}, with_response: true)
query: {}, options: options,
response_type: {202 => :nil}, with_response: true)
end

# Get a Checkout for a Reader.
Expand Down
28 changes: 26 additions & 2 deletions lib/sumup/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class BasePerson < Model
field :user_id, :string, wire: "user_id", required: false
##
# :attr_reader: birthdate
# The date of birth of the individual, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.
# The date of birth of the individual as an ISO 8601 calendar date. Reduced precision is accepted: YYYY-MM-DD, YYYY-MM, or YYYY.
field :birthdate, :string, wire: "birthdate", required: false
##
# :attr_reader: given_name
Expand Down Expand Up @@ -122,6 +122,9 @@ class BasePerson < Model
# An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code representing the country where the Person resides.
field :country_of_residence, [:union, [:string, :nil]], wire: "country_of_residence", required: false
##
# :attr_reader: attributes
field :attributes, [:map, :string], wire: "attributes", required: false
##
# :attr_reader: version
# The version of the resource. The version reflects a specific change submitted to the API via one of the `PATCH` endpoints.
field :version, :string, wire: "version", required: false
Expand Down Expand Up @@ -1658,11 +1661,25 @@ class Merchant < Model

# An address somewhere in the world. The address fields used depend on the country conventions. For example, in Great Britain, `city` is `post_town`. In the United States, the top-level administrative unit used in addresses is `state`, whereas in Chile it's `region`.
# Whether an address is valid or not depends on whether the locally required fields are present. Fields not supported in a country will be ignored.
# The street can be given either as free-form `street_address` lines or as structured `street_name`, `building_number` and `additional_address_lines`. If both are given, they must agree. At most two street lines are supported in total. Addresses written with structured street fields are returned with both the structured fields and the composed `street_address`. Addresses written with only `street_address` are returned without structured fields.
# Locations don't support the structured street fields yet and reject them.
class MerchantsAddress < Model
##
# :attr_reader: street_address
field :street_address, [:array, :string], wire: "street_address", required: false
##
# :attr_reader: street_name
# The name of the street, without the building number. Required when `building_number` or `additional_address_lines` is set. Together with the building number and separator, the composed street line must fit the 100 character database column.
field :street_name, :string, wire: "street_name", required: false
##
# :attr_reader: building_number
# The building number of the address. It is not necessarily numeric, for example `12a` or `12-14`. Use `S/N` for addresses without a number. Requires `street_name`.
field :building_number, :string, wire: "building_number", required: false
##
# :attr_reader: additional_address_lines
# Further street lines after the street name and building number, for example an apartment. At most one line is supported.
field :additional_address_lines, [:array, :string], wire: "additional_address_lines", required: false
##
# :attr_reader: post_code
# The postal code (aka. zip code) of the address.
field :post_code, :string, wire: "post_code", required: false
Expand All @@ -1675,6 +1692,10 @@ class MerchantsAddress < Model
# The city of the address.
field :city, :string, wire: "city", required: false
##
# :attr_reader: locality
# A locality represents a suburb or locality as used in postal addresses in Australia.
field :locality, :string, wire: "locality", required: false
##
# :attr_reader: province
# The province where the address is located. This may not be relevant in some countries.
field :province, :string, wire: "province", required: false
Expand Down Expand Up @@ -1884,7 +1905,7 @@ class Person < Model
field :user_id, :string, wire: "user_id", required: false
##
# :attr_reader: birthdate
# The date of birth of the individual, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.
# The date of birth of the individual as an ISO 8601 calendar date. Reduced precision is accepted: YYYY-MM-DD, YYYY-MM, or YYYY.
field :birthdate, :string, wire: "birthdate", required: false
##
# :attr_reader: given_name
Expand Down Expand Up @@ -1924,6 +1945,9 @@ class Person < Model
# An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code representing the country where the Person resides.
field :country_of_residence, [:union, [:string, :nil]], wire: "country_of_residence", required: false
##
# :attr_reader: attributes
field :attributes, [:map, :string], wire: "attributes", required: false
##
# :attr_reader: version
# The version of the resource. The version reflects a specific change submitted to the API via one of the `PATCH` endpoints.
field :version, :string, wire: "version", required: false
Expand Down
14 changes: 0 additions & 14 deletions lib/sumup/types/readers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ class CreateRequest < ::SumUp::Model
# Otherwise, the checkout will be rejected.
field :installments, [:union, [:integer, :nil]], wire: "installments", required: false
##
# :attr_reader: payment_type
# The payment method type for the transaction. Defaults to `card`.
#
# Use `pix` to initiate a Pix QR-code payment flow on the device.
# Pix is only supported for Brazilian merchants; other merchants will receive a 422 error.
field :payment_type, :string, wire: "payment_type", required: false
##
# :attr_reader: return_url
# Webhook URL to which the payment result will be sent.
# It must be a HTTPS url.
Expand Down Expand Up @@ -132,12 +125,6 @@ module CardType
CREDIT = "credit"
DEBIT = "debit"
end

# Known values; the API may return additional values.
module PaymentType
CARD = "card"
PIX = "pix"
end
end

class CreateResponse < ::SumUp::Model
Expand Down Expand Up @@ -242,7 +229,6 @@ class TotalAmount < ::SumUp::Model
# Known values; the API may return additional values.
module PaymentType
CARD = "card"
PIX = "pix"
end

# Known values; the API may return additional values.
Expand Down
Loading
Loading