Class: IngramMicro::ReturnAuthorization
- Inherits:
-
Transmission
- Object
- Transmission
- IngramMicro::ReturnAuthorization
- Defined in:
- lib/ingram_micro/transmissions/return_authorization.rb
Constant Summary collapse
- TRANSMISSION_FILENAME =
'return-authorization'
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.
- #xml_builder ⇒ Object
Methods inherited from Transmission
#add_transaction_info, #order_builder, #schema_valid?, #send_request, #submit_request
Constructor Details
#initialize(options = {}) ⇒ ReturnAuthorization
Returns a new instance of ReturnAuthorization.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 7 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.
4 5 6 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 4 def credit_card_information @credit_card_information end |
#customer ⇒ Object
Returns the value of attribute customer.
4 5 6 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 4 def customer @customer end |
#detail ⇒ Object
Returns the value of attribute detail.
4 5 6 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 4 def detail @detail end |
#order_header ⇒ Object
Returns the value of attribute order_header.
4 5 6 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 4 def order_header @order_header end |
#purchase_order_information ⇒ Object
Returns the value of attribute purchase_order_information.
4 5 6 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 4 def purchase_order_information @purchase_order_information end |
#shipment_information ⇒ Object
Returns the value of attribute shipment_information.
4 5 6 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 4 def shipment_information @shipment_information end |
Instance Method Details
#add_message_header(builder) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 27 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
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 37 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 |
#xml_builder ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/ingram_micro/transmissions/return_authorization.rb', line 18 def xml_builder @builder ||= Nokogiri::XML::Builder.new do |builder| builder.send('message') do (builder) (builder) end end end |