class PayPal::SDK::REST::DataTypes::FuturePayment

Public Class Methods

exch_token(auth_code) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 276
def exch_token(auth_code)
  if auth_code
    PayPal::SDK::OpenIDConnect::DataTypes::Tokeninfo.token_hash(auth_code)
  else
    raise ArgumentError.new("authorization code required") if auth_code.to_s.strip.empty?
  end
end

Public Instance Methods

create(correlation_id=nil) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 260
def create(correlation_id=nil)
  path = "v1/payments/payment"
  if correlation_id != nil
    header = http_header
    header = header.merge({
      "PAYPAL-CLIENT-METADATA-ID" => correlation_id})
  end
  response = api.post(path, self.to_hash, http_header)
  self.merge!(response)
  success?
end