Class: PaypalServerSdk::SubscriptionTransactionDetails
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::SubscriptionTransactionDetails
- Defined in:
- lib/paypal_server_sdk/models/subscription_transaction_details.rb
Overview
The transaction details.
Instance Attribute Summary collapse
-
#amount_with_breakdown ⇒ SubscriptionAmountWithBreakdown
The breakdown details for the amount.
-
#id ⇒ String
The PayPal-generated transaction ID.
-
#payer_email ⇒ String
The internationalized email address.
-
#payer_name ⇒ SubscriptionPayerName
The name of the party.
-
#status ⇒ CaptureStatus
The status of the captured payment.
-
#time ⇒ String
The date and time, in [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(id:, amount_with_breakdown:, time:, status: SKIP, payer_name: SKIP, payer_email: SKIP) ⇒ SubscriptionTransactionDetails
constructor
A new instance of SubscriptionTransactionDetails.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(id:, amount_with_breakdown:, time:, status: SKIP, payer_name: SKIP, payer_email: SKIP) ⇒ SubscriptionTransactionDetails
Returns a new instance of SubscriptionTransactionDetails.
69 70 71 72 73 74 75 76 77 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 69 def initialize(id:, amount_with_breakdown:, time:, status: SKIP, payer_name: SKIP, payer_email: SKIP) @status = status unless status == SKIP @id = id @amount_with_breakdown = amount_with_breakdown @payer_name = payer_name unless payer_name == SKIP @payer_email = payer_email unless payer_email == SKIP @time = time end |
Instance Attribute Details
#amount_with_breakdown ⇒ SubscriptionAmountWithBreakdown
The breakdown details for the amount. Includes the gross, tax, fee, and shipping amounts.
23 24 25 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 23 def amount_with_breakdown @amount_with_breakdown end |
#id ⇒ String
The PayPal-generated transaction ID.
18 19 20 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 18 def id @id end |
#payer_email ⇒ String
The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.
34 35 36 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 34 def payer_email @payer_email end |
#payer_name ⇒ SubscriptionPayerName
The name of the party.
27 28 29 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 27 def payer_name @payer_name end |
#status ⇒ CaptureStatus
The status of the captured payment.
14 15 16 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 14 def status @status end |
#time ⇒ String
The date and time, in [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.
41 42 43 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 41 def time @time end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 80 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil if hash['amount_with_breakdown'] amount_with_breakdown = SubscriptionAmountWithBreakdown.from_hash(hash['amount_with_breakdown']) end time = hash.key?('time') ? hash['time'] : nil status = hash.key?('status') ? hash['status'] : SKIP payer_name = SubscriptionPayerName.from_hash(hash['payer_name']) if hash['payer_name'] payer_email = hash.key?('payer_email') ? hash['payer_email'] : SKIP # Create object from extracted values. SubscriptionTransactionDetails.new(id: id, amount_with_breakdown: amount_with_breakdown, time: time, status: status, payer_name: payer_name, payer_email: payer_email) end |
.names ⇒ Object
A mapping from model property names to API property names.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 44 def self.names @_hash = {} if @_hash.nil? @_hash['status'] = 'status' @_hash['id'] = 'id' @_hash['amount_with_breakdown'] = 'amount_with_breakdown' @_hash['payer_name'] = 'payer_name' @_hash['payer_email'] = 'payer_email' @_hash['time'] = 'time' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 65 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 59 60 61 62 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 56 def self.optionals %w[ status payer_name payer_email ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
111 112 113 114 115 116 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 111 def inspect class_name = self.class.name.split('::').last "<#{class_name} status: #{@status.inspect}, id: #{@id.inspect}, amount_with_breakdown:"\ " #{@amount_with_breakdown.inspect}, payer_name: #{@payer_name.inspect}, payer_email:"\ " #{@payer_email.inspect}, time: #{@time.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
103 104 105 106 107 108 |
# File 'lib/paypal_server_sdk/models/subscription_transaction_details.rb', line 103 def to_s class_name = self.class.name.split('::').last "<#{class_name} status: #{@status}, id: #{@id}, amount_with_breakdown:"\ " #{@amount_with_breakdown}, payer_name: #{@payer_name}, payer_email: #{@payer_email}, time:"\ " #{@time}>" end |