Class: AmazonFlexPay::Pipelines::Base
- Defined in:
- lib/amazon_flex_pay/pipelines/base.rb
Overview
:nodoc:
Instance Method Summary collapse
- #to_hash ⇒ Object
-
#to_param ⇒ Object
Converts the Pipeline object into parameters and signs them.
-
#to_url ⇒ Object
Returns a full redirectable URL for this pipeline.
Methods inherited from Model
attribute, attribute_names, collection_attribute, complex_attribute, enumerated_attribute, #initialize
Constructor Details
This class inherits a constructor from AmazonFlexPay::Model
Instance Method Details
#to_hash ⇒ Object
25 26 27 28 29 30 |
# File 'lib/amazon_flex_pay/pipelines/base.rb', line 25 def to_hash super().merge( 'pipelineName' => pipeline_name, 'version' => AmazonFlexPay::PIPELINE_VERSION ) end |
#to_param ⇒ Object
Converts the Pipeline object into parameters and signs them.
15 16 17 18 19 20 21 22 23 |
# File 'lib/amazon_flex_pay/pipelines/base.rb', line 15 def to_param params = to_hash.merge( 'callerKey' => AmazonFlexPay.access_key, 'signatureVersion' => 2, 'signatureMethod' => 'HmacSHA256' ) params['signature'] = AmazonFlexPay.sign(AmazonFlexPay.pipeline_endpoint, params) AmazonFlexPay::Util.query_string(params) end |
#to_url ⇒ Object
Returns a full redirectable URL for this pipeline.
10 11 12 |
# File 'lib/amazon_flex_pay/pipelines/base.rb', line 10 def to_url AmazonFlexPay.pipeline_endpoint + '?' + self.to_param end |