Class: Bluedart::CancelPickup
- Defined in:
- lib/bluedart/cancel_pickup.rb
Instance Method Summary collapse
-
#initialize(details) ⇒ CancelPickup
constructor
A new instance of CancelPickup.
- #request_url ⇒ Object
- #response ⇒ Object
Constructor Details
#initialize(details) ⇒ CancelPickup
Returns a new instance of CancelPickup.
3 4 5 6 7 |
# File 'lib/bluedart/cancel_pickup.rb', line 3 def initialize(details) @cancel_pickup_request_details = cancel_pickup_request_hash(details[:cancel_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/cancel_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/cancel_pickup.rb', line 17 def response wsa = 'http://tempuri.org/IPickupRegistration/CancelPickup' params = { 'request' => @cancel_pickup_request_details } opts = { message: 'CancelPickup', wsa: wsa, params: params, extra: { 'profile' => @profile }, url: request_url } make_request(opts) end |