Class: Bluedart::Pickup
Instance Method Summary collapse
-
#initialize(details) ⇒ Pickup
constructor
A new instance of Pickup.
- #request_url ⇒ Object
- #response ⇒ Object
Constructor Details
#initialize(details) ⇒ Pickup
Returns a new instance of Pickup.
3 4 5 6 7 |
# File 'lib/bluedart/pickup.rb', line 3 def initialize(details) @pickup_registration_request = pickup_registration_request_hash(details[:pickup_request]) @profile = profile_hash({api_type: 'S', version: '1.3'}, details[:creds]) @mode = details[:mode] end |
Instance Method Details
#request_url ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/bluedart/pickup.rb', line 9 def request_url if @mode == 'prod' 'https://netconnect.bluedart.com/Ver1.8/ShippingAPI/Pickup/PickupRegistrationService.svc' else 'https://netconnect.bluedart.com/Ver1.8/Demo/ShippingAPI/Pickup/PickupRegistrationService.svc' end end |
#response ⇒ Object
17 18 19 20 21 22 |
# File 'lib/bluedart/pickup.rb', line 17 def response wsa = 'http://tempuri.org/IPickupRegistration/RegisterPickup' params = { 'request' => @pickup_registration_request } opts = { message: 'RegisterPickup', wsa: wsa, params: params, extra: { 'profile' => @profile }, url: request_url } make_request(opts) end |