Class: FdxV660Api::RecurringPaymentEntityErrorException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- FdxV660Api::RecurringPaymentEntityErrorException
- Defined in:
- lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb
Overview
A recurring payment. Financial institution is free to adjust the payment date to accommodate weekends and holidays
Instance Attribute Summary collapse
-
#amount ⇒ Float
Amount for the payment.
-
#cancelled_timestamp ⇒ DateTime
When the recurring payment was cancelled.
-
#description ⇒ String
The purpose of the payment as provided by consumer or payment-requesting app.
-
#due_date ⇒ Date
Date that the funds are scheduled to be delivered.
-
#duration ⇒ RecurringPaymentDurationEntity2
Defines how long the payment repeats for.
-
#failed_timestamp ⇒ DateTime
When the recurring payment failed.
-
#frequency ⇒ EventFrequency3
Defines how often the payment repeats.
-
#from_account_id ⇒ String
ID of the account used to source funds for payment.
-
#merchant_account_id ⇒ String
User's account identifier with the merchant.
-
#processed_timestamp ⇒ DateTime
When the last payment executed.
-
#recurring_payment_id ⇒ String
Uniquely identifies a recurring payment.
-
#scheduled_timestamp ⇒ DateTime
When the recurring payment was scheduled.
-
#status ⇒ RecurringPaymentStatus2
Defines the status of the recurring payment.
-
#to_payee_id ⇒ String
ID of the payee to receive funds for the payment.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ RecurringPaymentEntityErrorException
constructor
The constructor.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ RecurringPaymentEntityErrorException
The constructor.
75 76 77 78 79 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 75 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#amount ⇒ Float
Amount for the payment. Must be positive
37 38 39 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 37 def amount @amount end |
#cancelled_timestamp ⇒ DateTime
When the recurring payment was cancelled
58 59 60 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 58 def @cancelled_timestamp end |
#description ⇒ String
The purpose of the payment as provided by consumer or payment-requesting app
33 34 35 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 33 def description @description end |
#due_date ⇒ Date
Date that the funds are scheduled to be delivered
45 46 47 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 45 def due_date @due_date end |
#duration ⇒ RecurringPaymentDurationEntity2
Defines how long the payment repeats for
20 21 22 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 20 def duration @duration end |
#failed_timestamp ⇒ DateTime
When the recurring payment failed
66 67 68 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 66 def @failed_timestamp end |
#frequency ⇒ EventFrequency3
Defines how often the payment repeats
16 17 18 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 16 def frequency @frequency end |
#from_account_id ⇒ String
ID of the account used to source funds for payment
24 25 26 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 24 def from_account_id @from_account_id end |
#merchant_account_id ⇒ String
User's account identifier with the merchant
41 42 43 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 41 def merchant_account_id @merchant_account_id end |
#processed_timestamp ⇒ DateTime
When the last payment executed
62 63 64 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 62 def @processed_timestamp end |
#recurring_payment_id ⇒ String
Uniquely identifies a recurring payment. Used within the API to reference a recurring payment
50 51 52 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 50 def recurring_payment_id @recurring_payment_id end |
#scheduled_timestamp ⇒ DateTime
When the recurring payment was scheduled
54 55 56 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 54 def @scheduled_timestamp end |
#status ⇒ RecurringPaymentStatus2
Defines the status of the recurring payment
70 71 72 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 70 def status @status end |
#to_payee_id ⇒ String
ID of the payee to receive funds for the payment
28 29 30 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 28 def to_payee_id @to_payee_id end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 135 def inspect class_name = self.class.name.split('::').last "<#{class_name} frequency: #{@frequency.inspect}, duration: #{@duration.inspect},"\ " from_account_id: #{@from_account_id.inspect}, to_payee_id: #{@to_payee_id.inspect},"\ " description: #{@description.inspect}, amount: #{@amount.inspect}, merchant_account_id:"\ " #{@merchant_account_id.inspect}, due_date: #{@due_date.inspect}, recurring_payment_id:"\ " #{@recurring_payment_id.inspect}, scheduled_timestamp: #{@scheduled_timestamp.inspect},"\ " cancelled_timestamp: #{@cancelled_timestamp.inspect}, processed_timestamp:"\ " #{@processed_timestamp.inspect}, failed_timestamp: #{@failed_timestamp.inspect}, status:"\ " #{@status.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
123 124 125 126 127 128 129 130 131 132 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 123 def to_s class_name = self.class.name.split('::').last "<#{class_name} frequency: #{@frequency}, duration: #{@duration}, from_account_id:"\ " #{@from_account_id}, to_payee_id: #{@to_payee_id}, description: #{@description}, amount:"\ " #{@amount}, merchant_account_id: #{@merchant_account_id}, due_date: #{@due_date},"\ " recurring_payment_id: #{@recurring_payment_id}, scheduled_timestamp:"\ " #{@scheduled_timestamp}, cancelled_timestamp: #{@cancelled_timestamp},"\ " processed_timestamp: #{@processed_timestamp}, failed_timestamp: #{@failed_timestamp},"\ " status: #{@status}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/fdx_v660_api/exceptions/recurring_payment_entity_error_exception.rb', line 84 def unbox(hash) return nil unless hash @frequency = hash.key?('frequency') ? hash['frequency'] : nil @duration = RecurringPaymentDurationEntity2.from_hash(hash['duration']) if hash['duration'] @from_account_id = hash.key?('fromAccountId') ? hash['fromAccountId'] : nil @to_payee_id = hash.key?('toPayeeId') ? hash['toPayeeId'] : nil @description = hash.key?('description') ? hash['description'] : SKIP @amount = hash.key?('amount') ? hash['amount'] : nil @merchant_account_id = hash.key?('merchantAccountId') ? hash['merchantAccountId'] : SKIP @due_date = hash.key?('dueDate') ? hash['dueDate'] : nil @recurring_payment_id = hash.key?('recurringPaymentId') ? hash['recurringPaymentId'] : SKIP @scheduled_timestamp = if hash.key?('scheduledTimestamp') (DateTimeHelper.from_rfc3339(hash['scheduledTimestamp']) if hash['scheduledTimestamp']) else SKIP end @cancelled_timestamp = if hash.key?('cancelledTimestamp') (DateTimeHelper.from_rfc3339(hash['cancelledTimestamp']) if hash['cancelledTimestamp']) else SKIP end @processed_timestamp = if hash.key?('processedTimestamp') (DateTimeHelper.from_rfc3339(hash['processedTimestamp']) if hash['processedTimestamp']) else SKIP end @failed_timestamp = if hash.key?('failedTimestamp') (DateTimeHelper.from_rfc3339(hash['failedTimestamp']) if hash['failedTimestamp']) else SKIP end @status = hash.key?('status') ? hash['status'] : nil end |