Class: PaypalServerSdk::ReauthorizeRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/reauthorize_request.rb

Overview

Reauthorizes an authorized PayPal account payment, by ID. To ensure that funds are still available, reauthorize a payment after its initial three-day honor period expires. You can reauthorize a payment only once from days four to 29. If 30 days have transpired since the date of the original authorization, you must create an authorized payment instead of reauthorizing the original authorized payment. A reauthorized payment itself has a new honor period of three days. You can reauthorize an authorized payment once. The allowed amount depends on context and geography, for example in US it is up to 115% of the original authorized amount, not to exceed an increase of $75 USD. Supports only the ‘amount` request parameter. Note: This request is currently not supported for Partner use cases.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(amount: SKIP) ⇒ ReauthorizeRequest

Returns a new instance of ReauthorizeRequest.



46
47
48
# File 'lib/paypal_server_sdk/models/reauthorize_request.rb', line 46

def initialize(amount: SKIP)
  @amount = amount unless amount == SKIP
end

Instance Attribute Details

#amountMoney

The currency and amount for a financial transaction, such as a balance or payment due.

Returns:



25
26
27
# File 'lib/paypal_server_sdk/models/reauthorize_request.rb', line 25

def amount
  @amount
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



51
52
53
54
55
56
57
58
59
# File 'lib/paypal_server_sdk/models/reauthorize_request.rb', line 51

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  amount = Money.from_hash(hash['amount']) if hash['amount']

  # Create object from extracted values.
  ReauthorizeRequest.new(amount: amount)
end

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
# File 'lib/paypal_server_sdk/models/reauthorize_request.rb', line 28

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['amount'] = 'amount'
  @_hash
end

.nullablesObject

An array for nullable fields



42
43
44
# File 'lib/paypal_server_sdk/models/reauthorize_request.rb', line 42

def self.nullables
  []
end

.optionalsObject

An array for optional fields



35
36
37
38
39
# File 'lib/paypal_server_sdk/models/reauthorize_request.rb', line 35

def self.optionals
  %w[
    amount
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



68
69
70
71
# File 'lib/paypal_server_sdk/models/reauthorize_request.rb', line 68

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} amount: #{@amount.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



62
63
64
65
# File 'lib/paypal_server_sdk/models/reauthorize_request.rb', line 62

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} amount: #{@amount}>"
end