bluedart 0.2.2.0.2 → 0.2.3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f11482fd5ffb31b0de48dc9404bdc1d9cf50c4a5de1794cbc16d2ea0f191eed7
4
- data.tar.gz: b9d4ae2bd610418a1e270dc239d723faeb28f373130a4b73fe756e44938c67ab
3
+ metadata.gz: b18f84d411be6cc265967de94909848a45e045f5414476bbd4e36046d1766b23
4
+ data.tar.gz: 037e7ac235aca4b57d9b48acbc3881439f4a03aec907737dac78b8d606dbf8a8
5
5
  SHA512:
6
- metadata.gz: 4883724c6325480c27f8e9fd51869dcaf0eee86e2fa59a2f6bf3e8312934d7bee1d07ee8e75e1203d1704e2f966af2e3f4e2d9a85eaa0554f94fb25c718898b2
7
- data.tar.gz: 700886ec5a369c8e00a803cfab1fff58733e4d32fb8cf2b64eba341cc96f2f67069e2d7faca808cc31cf539bdf2e40234f12fcf6535c2b19fb43261ba6539877
6
+ metadata.gz: 2a04cabd0d3ba3129169e235b8ab5efda1be4a149dabf0384c0fec4c4936df14306b47bfd722050d7dc4a8ad9d85126e0b4ab2ecb71a50195314efa55e65f919
7
+ data.tar.gz: 84d3dceb5a21f37cb00f9126f32921ed064d43bc5638f19a41f3d585f63ecde02525e194880126f86e88f0f62edbc5bde53c4643f83a9fc83226ddf4e190f80a
data/README.md CHANGED
@@ -34,11 +34,11 @@ p.response
34
34
  ```ruby
35
35
  shipment_details = {mode: 'prod'}
36
36
 
37
- shipment_details[:creds] = {license_key: '', login_id: ''}}
37
+ shipment_details[:creds] = {license_key: '', login_id: ''}
38
38
 
39
- shipment_details[:shipper_details] = {customer_code:"", :customer_name:"J Bieber", :address:"ABC ABC", customer_pincode:"499999",customer_telephone:nil, customer_mobile:"", customer_email_id:"someone@me.com", sender:'', vendor_code:"", isToPayCustomer:false, origin_area:'AAA'}
39
+ shipment_details[:shipper_details] = {customer_code:"", customer_name:"J Bieber", address:"ABC ABC", customer_pincode:"499999",customer_telephone:nil, customer_mobile:"", customer_email_id:"someone@me.com", sender:'', vendor_code:"", isToPayCustomer:false, origin_area:'AAA'}
40
40
 
41
- shipment_details[:consignee_details] = {consignee_name:"Ninja", address:"hogsmeade station", consignee_pincode:"999999", consignee_telephone:"000000000", :consignee_mobile:"0000000000", consignee_attention:""}
41
+ shipment_details[:consignee_details] = {consignee_name:"Ninja", address:"hogsmeade station", consignee_pincode:"999999", consignee_telephone:"000000000", consignee_mobile:"0000000000", consignee_attention:""}
42
42
 
43
43
  shipment_details[:services] = {piece_count:1, actual_weight:0.1, pack_type:"", invoice_no:"", special_instruction:"", declared_value:9999, credit_reference_no:"9999", dimensions:"", pickup_date:'2015-12-12', pickup_time:"1313", commodities:['Crack'], product_type:"Dutiables", collectable_amount:5050, product_code:"A", sub_product_code:"C", p_d_f_output_not_required:false}
44
44
 
@@ -3,6 +3,8 @@ require 'bluedart/base'
3
3
  require 'bluedart/pincode_service'
4
4
  require 'bluedart/shipment'
5
5
  require 'bluedart/tracking'
6
+ require 'bluedart/pickup'
7
+ require 'bluedart/cancel_pickup'
6
8
 
7
9
  module Bluedart
8
10
  end
@@ -34,6 +34,7 @@ module Bluedart
34
34
  ns[:profile] = {key:'ns2', value: 'http://schemas.datacontract.org/2004/07/SAPI.Entities.Admin'}
35
35
  ns[:wsa] = {key:'ns3', value: 'http://www.w3.org/2005/08/addressing'}
36
36
  ns[:shipment] = {key:'ns4', value: 'http://schemas.datacontract.org/2004/07/SAPI.Entities.WayBillGeneration'}
37
+ ns[:pickup] = {key:'ns5', value: 'http://schemas.datacontract.org/2004/07/SAPI.Entities.Pickup'}
37
38
  ns
38
39
  end
39
40
 
@@ -0,0 +1,34 @@
1
+ module Bluedart
2
+ class CancelPickup < Base
3
+ def initialize(details)
4
+ @cancel_pickup_request_details = cancel_pickup_request_hash(details[:cancel_pickup_request])
5
+ @profile = profile_hash({api_type: 'S', version: '1.3'}, details[:creds])
6
+ @mode = details[:mode]
7
+ end
8
+
9
+ def request_url
10
+ if @mode == 'prod'
11
+ 'https://netconnect.bluedart.com/Ver1.8/ShippingAPI/Pickup/PickupRegistrationService.svc'
12
+ else
13
+ 'https://netconnect.bluedart.com/Ver1.8/Demo/ShippingAPI/Pickup/PickupRegistrationService.svc'
14
+ end
15
+ end
16
+
17
+ def response
18
+ wsa = 'http://tempuri.org/IPickupRegistration/CancelPickup'
19
+ params = { 'request' => @cancel_pickup_request_details }
20
+ opts = { message: 'CancelPickup', wsa: wsa, params: params, extra: { 'profile' => @profile }, url: request_url }
21
+ make_request(opts)
22
+ end
23
+
24
+ private
25
+
26
+ def cancel_pickup_request_hash(details)
27
+ params = {}
28
+ params["ns5:PickupRegistrationDate"] = details[:pickup_registration_date]
29
+ params["ns5:Remarks"] = details[:remarks]
30
+ params["ns5:TokenNumber"] = details[:token_number]
31
+ params
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,60 @@
1
+ module Bluedart
2
+ class Pickup < Base
3
+ def initialize(details)
4
+ @pickup_registration_request = pickup_registration_request_hash(details[:pickup_request])
5
+ @profile = profile_hash({api_type: 'S', version: '1.3'}, details[:creds])
6
+ @mode = details[:mode]
7
+ end
8
+
9
+ def request_url
10
+ if @mode == 'prod'
11
+ 'https://netconnect.bluedart.com/Ver1.8/ShippingAPI/Pickup/PickupRegistrationService.svc'
12
+ else
13
+ 'https://netconnect.bluedart.com/Ver1.8/Demo/ShippingAPI/Pickup/PickupRegistrationService.svc'
14
+ end
15
+ end
16
+
17
+ def response
18
+ wsa = 'http://tempuri.org/IPickupRegistration/RegisterPickup'
19
+ params = { 'request' => @pickup_registration_request }
20
+ opts = { message: 'RegisterPickup', wsa: wsa, params: params, extra: { 'profile' => @profile }, url: request_url }
21
+ make_request(opts)
22
+ end
23
+
24
+ private
25
+
26
+ def pickup_registration_request_hash(details)
27
+ params = {}
28
+ params["ns5:AreaCode"] = details[:area_code]
29
+ params["ns5:ContactPersonName"] = details[:contact_person_name]
30
+ params["ns5:CustomerAddress1"] = details[:customer_address1]
31
+ params["ns5:CustomerAddress2"] = details[:customer_address2]
32
+ params["ns5:CustomerAddress3"] = details[:customer_address3]
33
+ params["ns5:CustomerCode"] = details[:customer_code]
34
+ params["ns5:CustomerName"] = details[:customer_name]
35
+ params["ns5:CustomerPincode"] = details[:customer_pincode]
36
+ params["ns5:CustomerTelephoneNumber"] = details[:customer_telephone_number]
37
+ params["ns5:MobileTelNo"] = details[:mobile_tel_no]
38
+ params["ns5:NumberofPieces"] = details[:number_of_pieces]
39
+ params["ns5:OfficeCloseTime"] = details[:office_close_time]
40
+ params["ns5:ProductCode"] = details[:product_code]
41
+ params["ns5:ReferenceNo"] = details[:reference_no]
42
+ params["ns5:ShipmentPickupDate"] = details[:shipment_pickup_date]
43
+ params["ns5:ShipmentPickupTime"] = details[:shipment_pickup_time]
44
+ params["ns5:SubProducts"] = details[:sub_products] || []
45
+ params["ns5:VolumeWeight"] = details[:volume_weight]
46
+ params["ns5:WeightofShipment"] = details[:weight_of_shipment]
47
+ params["ns5:isToPayShipper"] = details[:is_to_pay_shipper] || false
48
+ params["ns5:AWBNo"] = details[:awb_no]
49
+ params["ns5:Remarks"] = details[:remarks]
50
+ params["ns5:RouteCode"] = details[:route_code]
51
+ params["ns5:EmailID"] = details[:email_id]
52
+ params["ns5:DoxNDox"] = details[:dox_n_dox]
53
+ params["ns5:IsReversePickup"] = details[:is_reverse_pickup]
54
+ params["ns5:IsForcePickup"] = details[:is_force_pickup]
55
+ params["ns5:PackType"] = details[:pack_type]
56
+ params["ns5:IsDDN"] = details[:is_ddn] || false
57
+ params
58
+ end
59
+ end
60
+ end
@@ -12,7 +12,7 @@ module Bluedart
12
12
  if @mode == 'prod'
13
13
  'https://netconnect.bluedart.com/ShippingAPI/WayBill/WayBillGeneration.svc'
14
14
  else
15
- 'https://netconnect.bluedart.com/Demo/ShippingAPI/WayBill/WayBillGeneration.svc'
15
+ 'http://netconnect.bluedart.com/Demo/ShippingAPI/WayBill/WayBillGeneration.svc'
16
16
  end
17
17
  end
18
18
 
@@ -73,6 +73,7 @@ module Bluedart
73
73
  params['PickupTime'] = details[:pickup_time]
74
74
  params['PieceCount'] = details[:piece_count]
75
75
  params['ProductCode'] = details[:product_code]
76
+ params['RegisterPickup'] = details[:register_pickup]
76
77
  params['ProductType'] = details[:product_type]
77
78
  params['SubProductCode'] = details[:sub_product_code]
78
79
  params['SpecialInstruction'] = details[:special_instruction]
@@ -1,3 +1,3 @@
1
1
  module Bluedart
2
- VERSION = "0.2.2.0.2"
2
+ VERSION = "0.2.3.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bluedart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2.0.2
4
+ version: 0.2.3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CJ
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-10 00:00:00.000000000 Z
11
+ date: 2019-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -100,6 +100,8 @@ files:
100
100
  - bluedart.gemspec
101
101
  - lib/bluedart.rb
102
102
  - lib/bluedart/base.rb
103
+ - lib/bluedart/cancel_pickup.rb
104
+ - lib/bluedart/pickup.rb
103
105
  - lib/bluedart/pincode_service.rb
104
106
  - lib/bluedart/shipment.rb
105
107
  - lib/bluedart/tracking.rb
@@ -123,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
125
  - !ruby/object:Gem::Version
124
126
  version: '0'
125
127
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 2.7.6
128
+ rubygems_version: 3.0.1
128
129
  signing_key:
129
130
  specification_version: 4
130
131
  summary: Bluedart Web Services