dhl-bcs 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +20 -1
- data/dhl-bcs.gemspec +4 -4
- data/lib/dhl/bcs/v2/client.rb +1 -1
- data/lib/dhl/bcs/v2/shipment.rb +6 -6
- data/lib/dhl/bcs/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 266d8258d3a8678be51463d1148afd001473943e
|
|
4
|
+
data.tar.gz: a9feb88be17f8acf306b66363fc869aae592f919
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5863fa920acf37223595ef5c16b5f779e2b2505f91abc9c6895d1abc895a020c85d18ac8023ab76a853ed11402bd3d65c1b0d82320bc9cdcfbabde5e7fe8f6f
|
|
7
|
+
data.tar.gz: 314a2e6fe4ecebbb1a47f933ac82af1d8b102bb82852906f9de2ea06be728e3e67a38d5f02253896fbbc18de489e299542d3dadc6eb577a160772848d04248f1
|
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -38,7 +38,7 @@ config = {
|
|
|
38
38
|
user: 'your BCS user name', #mandatory
|
|
39
39
|
signature: 'Your BCS user password', #mandatory
|
|
40
40
|
ekp: 'Your DHL EKP (first part of your DHL Account number)', #mandatory
|
|
41
|
-
participation_number: 'Your DHL
|
|
41
|
+
participation_number: 'Your DHL participation_number (last two characters of your DHL Account number)' #mandatory
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -51,6 +51,25 @@ options = {
|
|
|
51
51
|
}
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
### Where do I get all these numbers?
|
|
55
|
+
If you are confused about all the number and credential stuff here is a short explanation.
|
|
56
|
+
|
|
57
|
+
DHL uses a customer integration gateway (cig) for its services.
|
|
58
|
+
You have to register your app first at the developer portal of dhl, define an app_id and get a token for that.
|
|
59
|
+
`api_user` is your app_id and `api_pwd` is the token you get.
|
|
60
|
+
This is basically needed to communicate with the DHL services.
|
|
61
|
+
|
|
62
|
+
To identify as a BCS user you have to give your credentials of the BCS website as `user` and `signature`.
|
|
63
|
+
|
|
64
|
+
The billing works with a number (Abrechnungsnummer) with 14 chars that consists of three parts.
|
|
65
|
+
The first 10 digits are your EKP (Einheitliche Kunden- und Produktnummer) that you get from your DHL contract.
|
|
66
|
+
|
|
67
|
+
The next 2 digits are product dependent (Verfahren), so you don't have to specify it, because they are known if you specify a product at the shipment.
|
|
68
|
+
|
|
69
|
+
The last 2 chars, the participation_number (Teilnahme-Nummer) can be digits or uppercase characters.
|
|
70
|
+
This is contract dependent and used to specify billing conditions.
|
|
71
|
+
|
|
72
|
+
|
|
54
73
|
### Create shipments
|
|
55
74
|
|
|
56
75
|
To create a shipment at DHL you need a sender_address, a receiver_address, and informations about the parcel.
|
data/dhl-bcs.gemspec
CHANGED
|
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
|
|
22
22
|
spec.add_dependency "savon", "~> 2.11"
|
|
23
23
|
|
|
24
|
-
spec.add_development_dependency "bundler", "~> 1.
|
|
25
|
-
spec.add_development_dependency "rake", "~>
|
|
26
|
-
spec.add_development_dependency "minitest", "~> 5.
|
|
27
|
-
spec.add_development_dependency "webmock", "~>
|
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
|
25
|
+
spec.add_development_dependency "rake", "~> 12.0"
|
|
26
|
+
spec.add_development_dependency "minitest", "~> 5.10"
|
|
27
|
+
spec.add_development_dependency "webmock", "~> 3.0"
|
|
28
28
|
spec.add_development_dependency "pry-byebug", "~> 3.4"
|
|
29
29
|
end
|
data/lib/dhl/bcs/v2/client.rb
CHANGED
|
@@ -19,7 +19,7 @@ module Dhl::Bcs::V2
|
|
|
19
19
|
@participation_number = config[:participation_number]
|
|
20
20
|
|
|
21
21
|
@logIO = StringIO.new
|
|
22
|
-
@logger = Logger.new($stdout)
|
|
22
|
+
@logger = log && Logger.new($stdout)
|
|
23
23
|
|
|
24
24
|
@client = Savon.client({
|
|
25
25
|
endpoint: (test ? 'https://cig.dhl.de/services/sandbox/soap' : 'https://cig.dhl.de/services/production/soap'),
|
data/lib/dhl/bcs/v2/shipment.rb
CHANGED
|
@@ -43,18 +43,18 @@ module Dhl::Bcs::V2
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def product=(product)
|
|
46
|
-
raise Error, "No valid product code #{product}. Please use one of these: #{PRODUCTS.join(', ')}" unless PRODUCTS.include?(product)
|
|
46
|
+
raise Dhl::Bcs::Error, "No valid product code #{product}. Please use one of these: #{PRODUCTS.join(', ')}" unless PRODUCTS.include?(product)
|
|
47
47
|
@product = product
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def to_soap_hash(ekp, participation_number)
|
|
51
|
-
raise Error, 'Packing weight in kilo must be set!' unless weight
|
|
52
|
-
raise Error, 'Sender address must be set!' unless shipper
|
|
53
|
-
raise Error, 'Receiver address must be set!' unless receiver
|
|
54
|
-
raise Error, 'Product must be set!' unless product
|
|
51
|
+
raise Dhl::Bcs::Error, 'Packing weight in kilo must be set!' unless weight
|
|
52
|
+
raise Dhl::Bcs::Error, 'Sender address must be set!' unless shipper
|
|
53
|
+
raise Dhl::Bcs::Error, 'Receiver address must be set!' unless receiver
|
|
54
|
+
raise Dhl::Bcs::Error, 'Product must be set!' unless product
|
|
55
55
|
|
|
56
56
|
account_number = "#{ekp}#{PRODUCT_PROCEDURE_NUMBERS[product]}#{participation_number}"
|
|
57
|
-
raise Error, 'Need a 14 character long account number. Check EKP and participation_number' if account_number.size != 14
|
|
57
|
+
raise Dhl::Bcs::Error, 'Need a 14 character long account number. Check EKP and participation_number' if account_number.size != 14
|
|
58
58
|
{
|
|
59
59
|
'ShipmentDetails' => {}.tap { |h|
|
|
60
60
|
h['product'] = product
|
data/lib/dhl/bcs/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dhl-bcs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christoph Wagner
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-07-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: savon
|
|
@@ -30,56 +30,56 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '1.
|
|
33
|
+
version: '1.15'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '1.
|
|
40
|
+
version: '1.15'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rake
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
47
|
+
version: '12.0'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
54
|
+
version: '12.0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: minitest
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
59
|
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '5.
|
|
61
|
+
version: '5.10'
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '5.
|
|
68
|
+
version: '5.10'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: webmock
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
73
|
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
75
|
+
version: '3.0'
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
80
|
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '
|
|
82
|
+
version: '3.0'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: pry-byebug
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
151
151
|
version: '0'
|
|
152
152
|
requirements: []
|
|
153
153
|
rubyforge_project:
|
|
154
|
-
rubygems_version: 2.
|
|
154
|
+
rubygems_version: 2.6.11
|
|
155
155
|
signing_key:
|
|
156
156
|
specification_version: 4
|
|
157
157
|
summary: Client for DHL Business-Customer-Shipping SOAP API 2.0
|