Class: PaypalServerSdk::CaptureRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::CaptureRequest
- Defined in:
- lib/paypal_server_sdk/models/capture_request.rb
Overview
CaptureRequest Model.
Instance Attribute Summary collapse
-
#amount ⇒ Money
The currency and amount for a financial transaction, such as a balance or payment due.
-
#final_capture ⇒ TrueClass | FalseClass
Indicates whether you can make additional captures against the authorized payment.
-
#invoice_id ⇒ String
The API caller-provided external invoice number for this order.
-
#note_to_payer ⇒ String
An informational note about this settlement.
-
#payment_instruction ⇒ CapturePaymentInstruction
Any additional payment instructions to be consider during payment processing.
-
#soft_descriptor ⇒ String
The payment descriptor on the payer’s account statement.
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(invoice_id: SKIP, note_to_payer: SKIP, amount: SKIP, final_capture: false, payment_instruction: SKIP, soft_descriptor: SKIP) ⇒ CaptureRequest
constructor
A new instance of CaptureRequest.
-
#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(invoice_id: SKIP, note_to_payer: SKIP, amount: SKIP, final_capture: false, payment_instruction: SKIP, soft_descriptor: SKIP) ⇒ CaptureRequest
Returns a new instance of CaptureRequest.
74 75 76 77 78 79 80 81 82 83 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 74 def initialize(invoice_id: SKIP, note_to_payer: SKIP, amount: SKIP, final_capture: false, payment_instruction: SKIP, soft_descriptor: SKIP) @invoice_id = invoice_id unless invoice_id == SKIP @note_to_payer = note_to_payer unless note_to_payer == SKIP @amount = amount unless amount == SKIP @final_capture = final_capture unless final_capture == SKIP @payment_instruction = payment_instruction unless payment_instruction == SKIP @soft_descriptor = soft_descriptor unless soft_descriptor == SKIP end |
Instance Attribute Details
#amount ⇒ Money
The currency and amount for a financial transaction, such as a balance or payment due.
26 27 28 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 26 def amount @amount end |
#final_capture ⇒ TrueClass | FalseClass
Indicates whether you can make additional captures against the authorized payment. Set to true if you do not intend to capture additional payments against the authorization. Set to false if you intend to capture additional payments against the authorization.
33 34 35 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 33 def final_capture @final_capture end |
#invoice_id ⇒ String
The API caller-provided external invoice number for this order. Appears in both the payer’s transaction history and the emails that the payer receives.
16 17 18 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 16 def invoice_id @invoice_id end |
#note_to_payer ⇒ String
An informational note about this settlement. Appears in both the payer’s transaction history and the emails that the payer receives.
21 22 23 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 21 def note_to_payer @note_to_payer end |
#payment_instruction ⇒ CapturePaymentInstruction
Any additional payment instructions to be consider during payment processing. This processing instruction is applicable for Capturing an order or Authorizing an Order.
39 40 41 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 39 def payment_instruction @payment_instruction end |
#soft_descriptor ⇒ String
The payment descriptor on the payer’s account statement.
43 44 45 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 43 def soft_descriptor @soft_descriptor end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 86 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. invoice_id = hash.key?('invoice_id') ? hash['invoice_id'] : SKIP note_to_payer = hash.key?('note_to_payer') ? hash['note_to_payer'] : SKIP amount = Money.from_hash(hash['amount']) if hash['amount'] final_capture = hash['final_capture'] ||= false payment_instruction = CapturePaymentInstruction.from_hash(hash['payment_instruction']) if hash['payment_instruction'] soft_descriptor = hash.key?('soft_descriptor') ? hash['soft_descriptor'] : SKIP # Create object from extracted values. CaptureRequest.new(invoice_id: invoice_id, note_to_payer: note_to_payer, amount: amount, final_capture: final_capture, payment_instruction: payment_instruction, soft_descriptor: soft_descriptor) end |
.names ⇒ Object
A mapping from model property names to API property names.
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 46 def self.names @_hash = {} if @_hash.nil? @_hash['invoice_id'] = 'invoice_id' @_hash['note_to_payer'] = 'note_to_payer' @_hash['amount'] = 'amount' @_hash['final_capture'] = 'final_capture' @_hash['payment_instruction'] = 'payment_instruction' @_hash['soft_descriptor'] = 'soft_descriptor' @_hash end |
.nullables ⇒ Object
An array for nullable fields
70 71 72 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 70 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 58 def self.optionals %w[ invoice_id note_to_payer amount final_capture payment_instruction soft_descriptor ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
117 118 119 120 121 122 123 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 117 def inspect class_name = self.class.name.split('::').last "<#{class_name} invoice_id: #{@invoice_id.inspect}, note_to_payer:"\ " #{@note_to_payer.inspect}, amount: #{@amount.inspect}, final_capture:"\ " #{@final_capture.inspect}, payment_instruction: #{@payment_instruction.inspect},"\ " soft_descriptor: #{@soft_descriptor.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
109 110 111 112 113 114 |
# File 'lib/paypal_server_sdk/models/capture_request.rb', line 109 def to_s class_name = self.class.name.split('::').last "<#{class_name} invoice_id: #{@invoice_id}, note_to_payer: #{@note_to_payer}, amount:"\ " #{@amount}, final_capture: #{@final_capture}, payment_instruction:"\ " #{@payment_instruction}, soft_descriptor: #{@soft_descriptor}>" end |