Class: AbacatePay::Enums::Billings::Methods
- Inherits:
-
Object
- Object
- AbacatePay::Enums::Billings::Methods
- Defined in:
- lib/abacate_pay/enums/billings/methods.rb
Overview
Enumeration defining billing methods.
This enumeration is used to represent different payment methods available for billing.
Constant Summary collapse
- PIX =
PIX payment method.
"PIX"- CARD =
Returns Credit card payment.
"CARD"- BOLETO =
Boleto bancário. Supports a due date and late-payment interest/fine - see Resources::Checkouts#due_date, #interest and #fine.
"BOLETO"
Class Method Summary collapse
-
.valid?(value) ⇒ Boolean
Validates if a given value is a valid method.
-
.validate!(value) ⇒ String
Validates and returns the value if valid.
-
.values ⇒ Array<String>
Gets all valid method values.
Class Method Details
.valid?(value) ⇒ Boolean
Validates if a given value is a valid method
31 32 33 |
# File 'lib/abacate_pay/enums/billings/methods.rb', line 31 def self.valid?(value) values.include?(value) end |
.validate!(value) ⇒ String
Validates and returns the value if valid
39 40 41 42 43 |
# File 'lib/abacate_pay/enums/billings/methods.rb', line 39 def self.validate!(value) raise ArgumentError, "Invalid payment method: #{value}" unless valid?(value) value end |