Class: IngramMicro::ReturnAuthorization
- Inherits:
-
Transmission
- Object
- Transmission
- IngramMicro::ReturnAuthorization
- Defined in:
- lib/ingram_micro/transmissions/return_authorization.rb
Constant Summary
Constants inherited from Transmission
Instance Attribute Summary collapse
-
#credit_card_information ⇒ Object
Returns the value of attribute credit_card_information.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#order_header ⇒ Object
Returns the value of attribute order_header.
-
#purchase_order_information ⇒ Object
Returns the value of attribute purchase_order_information.
-
#shipment_information ⇒ Object
Returns the value of attribute shipment_information.
Attributes inherited from Transmission
Instance Method Summary collapse
- #add_message_header(builder) ⇒ Object
- #add_return_authorization_submission(builder) ⇒ Object
-
#initialize(options = {}) ⇒ ReturnAuthorization
constructor
A new instance of ReturnAuthorization.
- #order_builder ⇒ Object
Methods inherited from Transmission
#add_transaction_info, #schema_valid?, #send_request, #submit_request
Constructor Details
#initialize(options = {}) ⇒ ReturnAuthorization
Returns a new instance of ReturnAuthorization.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 5 def initialize(={}) super @transaction_name = 'return-authorization' @customer = [:customer] @shipment_information = [:shipment_information] @credit_card_information = [:credit_card_information] @order_header = [:order_header] @detail = [:detail] @purchase_order_information = [:purchase_order_information] end |
Instance Attribute Details
#credit_card_information ⇒ Object
Returns the value of attribute credit_card_information.
2 3 4 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 2 def credit_card_information @credit_card_information end |
#customer ⇒ Object
Returns the value of attribute customer.
2 3 4 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 2 def customer @customer end |
#detail ⇒ Object
Returns the value of attribute detail.
2 3 4 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 2 def detail @detail end |
#order_header ⇒ Object
Returns the value of attribute order_header.
2 3 4 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 2 def order_header @order_header end |
#purchase_order_information ⇒ Object
Returns the value of attribute purchase_order_information.
2 3 4 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 2 def purchase_order_information @purchase_order_information end |
#shipment_information ⇒ Object
Returns the value of attribute shipment_information.
2 3 4 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 2 def shipment_information @shipment_information end |
Instance Method Details
#add_message_header(builder) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 25 def (builder) = IngramMicro::MessageHeaderPW.new({ partner_name: IngramMicro.configuration.partner_name, transaction_name: transaction_name}) builder.send('message-header') do .build(builder) end .valid? end |
#add_return_authorization_submission(builder) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 35 def (builder) = { customer: customer, shipment_information: shipment_information, credit_card_information: credit_card_information, order_header: order_header, detail: detail, purchase_order_information: purchase_order_information } ras = IngramMicro::ReturnAuthorizationSubmission.new() builder.send('return-authorization-submission') do ras.build(builder) end ras.valid? end |
#order_builder ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 16 def order_builder @builder ||= Nokogiri::XML::Builder.new do |builder| builder.send('message') do (builder) (builder) end end end |