Class: CyberSourceMergedSpec::AmountDetails51
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::AmountDetails51
- Defined in:
- lib/cyber_source_merged_spec/models/amount_details51.rb
Overview
AmountDetails51 Model.
Instance Attribute Summary collapse
-
#billing_amount ⇒ String
Billing amount for the billing period.
-
#currency ⇒ String
Currency used for the order.
-
#setup_fee ⇒ String
Subscription setup fee.
-
#surcharge ⇒ Surcharge3
Subscription setup fee.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.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(currency: SKIP, billing_amount: SKIP, setup_fee: SKIP, surcharge: SKIP, additional_properties: nil) ⇒ AmountDetails51
constructor
A new instance of AmountDetails51.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ 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(currency: SKIP, billing_amount: SKIP, setup_fee: SKIP, surcharge: SKIP, additional_properties: nil) ⇒ AmountDetails51
Returns a new instance of AmountDetails51.
88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 88 def initialize(currency: SKIP, billing_amount: SKIP, setup_fee: SKIP, surcharge: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @currency = currency unless currency == SKIP @billing_amount = billing_amount unless billing_amount == SKIP @setup_fee = setup_fee unless setup_fee == SKIP @surcharge = surcharge unless surcharge == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#billing_amount ⇒ String
Billing amount for the billing period.
53 54 55 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 53 def billing_amount @billing_amount end |
#currency ⇒ String
Currency used for the order. Use the three-character [ISO Standard Currency Codes.](http://apps.cybersource.com/library/documentation/sbc/quickref/cur rencies.pdf)
Used by
Authorization
Required field.
Authorization Reversal
For an authorization reversal (reversalInformation) or a capture
(processingOptions.capture is set to true), you must use the same
currency that you used in your payment authorization request.
PIN Debit
Currency for the amount you requested for the PIN debit purchase. This value is returned for partial authorizations. The issuing bank can approve a partial amount if the balance on the debit card is less than the requested transaction amount. For the possible values, see the [ISO Standard Currency Codes](https://developer.cybersource.com/library/documentation/sbc/quickre f/currencies.pdf). Returned by PIN debit purchase. For PIN debit reversal requests, you must use the same currency that was used for the PIN debit purchase or PIN debit credit that you are reversing. For the possible values, see the [ISO Standard Currency Codes](https://developer.cybersource.com/library/documentation/sbc/quickre f/currencies.pdf). Required field for PIN Debit purchase and PIN Debit credit requests. Optional field for PIN Debit reversal requests.
GPX
This field is optional for reversing an authorization or credit.
DCC for First Data
Your local currency.
Tax Calculation
Required for international tax and value added tax only. Optional for U.S. and Canadian taxes. Your local currency.
49 50 51 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 49 def currency @currency end |
#setup_fee ⇒ String
Subscription setup fee
57 58 59 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 57 def setup_fee @setup_fee end |
#surcharge ⇒ Surcharge3
Subscription setup fee
61 62 63 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 61 def surcharge @surcharge end |
Class Method Details
.from_element(root) ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 125 def self.from_element(root) currency = XmlUtilities.from_element(root, 'currency', String) billing_amount = XmlUtilities.from_element(root, 'billingAmount', String) setup_fee = XmlUtilities.from_element(root, 'setupFee', String) surcharge = XmlUtilities.from_element(root, 'Surcharge3', Surcharge3) new(currency: currency, billing_amount: billing_amount, setup_fee: setup_fee, surcharge: surcharge, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 101 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. currency = hash.key?('currency') ? hash['currency'] : SKIP billing_amount = hash.key?('billingAmount') ? hash['billingAmount'] : SKIP setup_fee = hash.key?('setupFee') ? hash['setupFee'] : SKIP surcharge = Surcharge3.from_hash(hash['surcharge']) if hash['surcharge'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. AmountDetails51.new(currency: currency, billing_amount: billing_amount, setup_fee: setup_fee, surcharge: surcharge, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
64 65 66 67 68 69 70 71 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 64 def self.names @_hash = {} if @_hash.nil? @_hash['currency'] = 'currency' @_hash['billing_amount'] = 'billingAmount' @_hash['setup_fee'] = 'setupFee' @_hash['surcharge'] = 'surcharge' @_hash end |
.nullables ⇒ Object
An array for nullable fields
84 85 86 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 84 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
74 75 76 77 78 79 80 81 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 74 def self.optionals %w[ currency billing_amount setup_fee surcharge ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
160 161 162 163 164 165 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 160 def inspect class_name = self.class.name.split('::').last "<#{class_name} currency: #{@currency.inspect}, billing_amount: #{@billing_amount.inspect},"\ " setup_fee: #{@setup_fee.inspect}, surcharge: #{@surcharge.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
152 153 154 155 156 157 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 152 def to_s class_name = self.class.name.split('::').last "<#{class_name} currency: #{@currency}, billing_amount: #{@billing_amount}, setup_fee:"\ " #{@setup_fee}, surcharge: #{@surcharge}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/cyber_source_merged_spec/models/amount_details51.rb', line 138 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'currency', currency) XmlUtilities.add_as_subelement(doc, root, 'billingAmount', billing_amount) XmlUtilities.add_as_subelement(doc, root, 'setupFee', setup_fee) XmlUtilities.add_as_subelement(doc, root, 'Surcharge3', surcharge) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |