Module: Cetustek::Soap
- Included in:
- CancelAllowance, CancelInvoice, CreateAllowance, CreateInvoice, QueryAllowance, QueryInvoice, QueryInvoiceByOrderId, QueryInvoiceNumberByOrderId
- Defined in:
- lib/cetustek/soap.rb
Overview
Shared SOAP plumbing: every operation hits the same WSDL and authenticates with 網站代碼+APIPassword (source) and the 租賃者統編 (rentid).
Instance Method Summary collapse
- #rentid ⇒ Object
- #soap_call(operation, message) ⇒ Object
- #soap_client ⇒ Object
- #soap_return(response, operation) ⇒ Object
- #source ⇒ Object
Instance Method Details
#rentid ⇒ Object
17 18 19 |
# File 'lib/cetustek/soap.rb', line 17 def rentid Cetustek.config.username end |
#soap_call(operation, message) ⇒ Object
21 22 23 |
# File 'lib/cetustek/soap.rb', line 21 def soap_call(operation, ) soap_client.call(operation, message: .merge(source: source, rentid: rentid)) end |
#soap_client ⇒ Object
9 10 11 |
# File 'lib/cetustek/soap.rb', line 9 def soap_client Savon.client(wsdl: Cetustek.config.url, open_timeout: 300, read_timeout: 300) end |
#soap_return(response, operation) ⇒ Object
25 26 27 |
# File 'lib/cetustek/soap.rb', line 25 def soap_return(response, operation) response.body[:"#{operation}_response"][:return] end |