Class: Laundry::PaymentsGateway::ClientDriver
- Inherits:
-
MerchantAuthenticatableDriver
- Object
- MerchantAuthenticatableDriver
- Laundry::PaymentsGateway::ClientDriver
- Defined in:
- lib/laundry/payments_gateway/drivers/client_driver.rb
Instance Attribute Summary
Attributes inherited from MerchantAuthenticatableDriver
Class Method Summary collapse
-
.wsdl ⇒ Object
Setup WSDL.
Instance Method Summary collapse
-
#create!(options = {}) ⇒ Object
Creates a client and returns the newly created client id.
- #find(id) ⇒ Object
Methods inherited from MerchantAuthenticatableDriver
#default_body, #initialize, prettifiable_fields, #setup_client!, uglify_hash
Methods included from SOAPModel
Constructor Details
This class inherits a constructor from Laundry::PaymentsGateway::MerchantAuthenticatableDriver
Class Method Details
.wsdl ⇒ Object
Setup WSDL
7 8 9 10 11 12 13 |
# File 'lib/laundry/payments_gateway/drivers/client_driver.rb', line 7 def self.wsdl if Laundry.sandboxed? "https://sandbox.paymentsgateway.net/WS/Client.wsdl" else "https://ws.paymentsgateway.net/Service/v1/Client.wsdl" end end |
Instance Method Details
#create!(options = {}) ⇒ Object
Creates a client and returns the newly created client id.
25 26 27 28 29 30 |
# File 'lib/laundry/payments_gateway/drivers/client_driver.rb', line 25 def create!( = {}) r = create_client({'client' => ClientDriver.default_hash.merge().merge({'MerchantID' => self.merchant.id, 'ClientID' => 0, 'Status' => 'Active'})} ) do http.headers["SOAPAction"] = 'https://ws.paymentsgateway.net/v1/IClientService/createClient' end r[:create_client_response][:create_client_result] end |
#find(id) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/laundry/payments_gateway/drivers/client_driver.rb', line 17 def find(id) r = get_client({'ClientID' => id}) do http.headers["SOAPAction"] = 'https://ws.paymentsgateway.net/v1/IClientService/getClient' end Client.from_response(r, self.merchant) end |