Class: Io::Flow::V0::Models::ActionUseSdkPaypal

Inherits:
Action
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Use the Paypal Checkout Javascript SDK to render the Paypal Button and the Paypal experience. The result of this operation will be Paypal identifiers that will be used to update the payment request with a ‘payment_method_data` of type `authorize_paypal_payer`. developer.paypal.com/docs/archive/checkout/integrate

Instance Attribute Summary collapse

Attributes inherited from Action

#type

Instance Method Summary collapse

Methods inherited from Action

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ActionUseSdkPaypal

Returns a new instance of ActionUseSdkPaypal.



29380
29381
29382
29383
29384
29385
29386
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29380

def initialize(incoming={})
  super(:type => Action::Types::ACTION_USE_SDK_PAYPAL)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:payment_id], 'ActionUseSdkPaypal')
  @expires_at = (x = opts.delete(:expires_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @payment_id = HttpClient::Preconditions.assert_class('payment_id', opts.delete(:payment_id), String)
end

Instance Attribute Details

#expires_atObject (readonly)

Returns the value of attribute expires_at.



29378
29379
29380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29378

def expires_at
  @expires_at
end

#payment_idObject (readonly)

Returns the value of attribute payment_id.



29378
29379
29380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29378

def payment_id
  @payment_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29392
29393
29394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29392

def copy(incoming={})
  ActionUseSdkPaypal.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



29396
29397
29398
29399
29400
29401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29396

def subtype_to_hash
  {
    :expires_at => expires_at,
    :payment_id => payment_id
  }
end

#to_jsonObject



29388
29389
29390
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29388

def to_json
  JSON.dump(to_hash)
end