Class: Justa::Pix
- Inherits:
-
OrderCommom
- Object
- JustaObject
- Model
- OrderCommom
- Justa::Pix
- Defined in:
- lib/justa/resources/pix.rb
Constant Summary
Constants inherited from JustaObject
Instance Attribute Summary
Attributes inherited from JustaObject
Instance Method Summary collapse
-
#approve(**params) ⇒ Pix
Request approve to Justa api for this pix ( Only in DEVELOPMENT).
-
#primary_key ⇒ Object
def self.url(*params) [“/#{ CGI.escape underscored_class_name }”, *params].join ‘/’ end.
Methods inherited from Model
class_name, #class_name, create, #create, #fetch, find_by_id, underscored_class_name, url, #url
Methods inherited from JustaObject
#==, #[]=, convert, #empty?, #initialize, #respond_to?, #to_hash, #to_request_params, #unsaved_attributes
Constructor Details
This class inherits a constructor from Justa::JustaObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Justa::JustaObject
Instance Method Details
#approve(**params) ⇒ Pix
Request approve to Justa api for this pix ( Only in DEVELOPMENT)
20 21 22 23 24 25 26 27 28 |
# File 'lib/justa/resources/pix.rb', line 20 def approve(**params) raise JustaError, "Can't approve value in Production environment" if Justa.production? raise ParamError.new("Missing value param", :value, :integer, url("approve")) unless params.has_key? :value Justa::Request.post(url("approve"), { append_document: false, params: params.merge({ client_key: @client_key }) }).call underscored_class_name fetch end |
#primary_key ⇒ Object
def self.url(*params)
["/#{ CGI.escape underscored_class_name }", *params].join '/'
end
7 8 9 |
# File 'lib/justa/resources/pix.rb', line 7 def primary_key tx_id end |