fex 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OWY0ZDEyNWY5NjY4ZWE1NmQ1YTIyNDhkYzgxMmU2NTE1ODViMGFkZA==
5
+ data.tar.gz: !binary |-
6
+ OWFkNmZkOTA5NzgwMjIwNzA3NzdkYjU0NWUxZjkwNTBjZWMxNGJhYw==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZDU3OTI1ZDdkNzZjNWY1OTk4NGRkNTQ4NGJiNmNkNmI1MGM4NGVlM2IwOTE5
10
+ MDFkNTg0NDRkYjExZjVhNzNhMjBhZmVlOWNlZmE3MzM4MjQyMDQ1ZmYwMzY5
11
+ MjFmYzkzNjExNmUxOTIyMGZmNDhkZjIzM2JkNTQxMDdjMzFmZWE=
12
+ data.tar.gz: !binary |-
13
+ MjlkZGU1NTBlOTgzNmNiZjE4MGYzNzQ5NWRmMWIyNDAzMWY3ZTY1OGFmODM3
14
+ ZTY2Yjk2NzYyNGNkMmJkZDNlZGNhMWY4ZjNjYmU4ZDQ5NjIzOGY4NmRiZTZi
15
+ OTczYzI2Mjc2YmJjOWY4MTk4MmEyMjUwNTgzZTIyNzM5Yjg5OWI=
data/Rakefile CHANGED
@@ -1 +1,4 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+ RSpec::Core::RakeTask.new(:spec)
4
+ task :default => :spec
@@ -18,6 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
 
20
20
  gem.add_dependency 'savon', '~> 2.0'
21
+ gem.add_development_dependency "rake"
21
22
  gem.add_development_dependency "rspec"
22
23
  gem.add_development_dependency "pry-nav"
23
24
  end
@@ -20,6 +20,10 @@ module Fex
20
20
  @tracking_number ||= css("TrackingNumber").inner_text
21
21
  end
22
22
 
23
+ def email_label_url
24
+ @email_label_url ||= css("EmailLabelUrl").inner_text
25
+ end
26
+
23
27
  private
24
28
 
25
29
  def find_total_net_charge
@@ -1,3 +1,3 @@
1
1
  module Fex
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -0,0 +1,105 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Pending Shipment Service", :test_environment do
4
+
5
+ example "Create Pending Shipment Request" do
6
+
7
+ client = Fex.client(credentials: credentials, mode: mode, client: { logger: logger })
8
+ service = client.service(:ship)
9
+
10
+ response = service.call(:create_pending_shipment,
11
+ requested_shipment: {
12
+ ship_timestamp: Time.now.utc.iso8601(2),
13
+ dropoff_type: "REGULAR_PICKUP",
14
+ service_type: "PRIORITY_OVERNIGHT",
15
+ packaging_type: "YOUR_PACKAGING",
16
+ shipper: {
17
+ contact: {
18
+ contact_id: "SY32030",
19
+ person_name: "Sunil Yadav",
20
+ company_name: "Syntel Inc",
21
+ phone_number: "9545871684",
22
+ phone_extension: "020",
23
+ e_mail_address: "you@localhost"
24
+ },
25
+ address: {
26
+ street_lines: [ "SHIPPER ADDRESS LINE 1", "SHIPPER ADDRESS LINE 2" ],
27
+ city: "COLORADO SPRINGS",
28
+ state_or_province_code: "CO",
29
+ postal_code: "80915",
30
+ urbanization_code: "CO",
31
+ country_code: "US",
32
+ residential: 0
33
+ }
34
+ },
35
+ recipient: {
36
+ contact: {
37
+ person_name: "Receipient",
38
+ company_name: "Receiver Org",
39
+ phone_number: "9982145555",
40
+ phone_extension: "011",
41
+ e_mail_address: "you@localhost"
42
+ },
43
+ address: {
44
+ street_lines: [ "RECIPIENT ADDRESS LINE 1", "RECIPIENT ADDRESS LINE 2" ],
45
+ city: "DENVER",
46
+ state_or_province_code: "CO",
47
+ postal_code: "80204",
48
+ urbanization_code: "CO",
49
+ country_code: "US",
50
+ residential: 0
51
+ }
52
+ },
53
+ shipping_charges_payment: {
54
+ #only SENDER or THIRD_PARTY allowed
55
+ payment_type: "SENDER",
56
+ payor: {
57
+ responsible_party: {
58
+ account_number: credentials[:account_number],
59
+ contact: ""
60
+ }
61
+ }
62
+ },
63
+ special_services_requested: {
64
+ special_service_types: ["RETURN_SHIPMENT", "PENDING_SHIPMENT"],
65
+ return_shipment_detail: {
66
+ return_type: "PENDING",
67
+ return_e_mail_detail: {
68
+ merchant_phone_number: '123 123 123 123'
69
+ }
70
+ },
71
+ pending_shipment_detail: {
72
+ type: "EMAIL",
73
+ expiration_date: Date.today,
74
+ email_label_detail: {
75
+ notification_e_mail_address: "you@localhost"
76
+ }
77
+ }
78
+ },
79
+ label_specification: {
80
+ label_format_type: "COMMON2D",
81
+ image_type: "PNG",
82
+ label_stock_type: "PAPER_4X6"
83
+ },
84
+ rate_request_types: ["ACCOUNT"],
85
+ package_count: 1,
86
+ requested_package_line_items: [
87
+ {
88
+ sequence_number: 1,
89
+ weight: { units: "LB", value: "20.0" },
90
+ item_description:
91
+ "Hotspot",
92
+ customer_references: {
93
+ customer_reference_type: "CUSTOMER_REFERENCE",
94
+ value: "Hotspot"
95
+ },
96
+ }
97
+ ],
98
+ }
99
+ )
100
+ response.severity.should eq "SUCCESS"
101
+ response.total_net_charge.should be > BigDecimal.new("67.65")
102
+ response.email_label_url.should include("https://wwwtest.fedex.com/OnlineLabel/login.do?labelUserCdDesc=SyntelInc&labelPasswordDesc=")
103
+ end
104
+
105
+ end
@@ -82,7 +82,7 @@ describe "Ship Service", :test_environment do
82
82
  )
83
83
  response.severity.should eq "SUCCESS"
84
84
  response.image.bytesize.should be_within(1024).of(10746)
85
- response.total_net_charge.should eq BigDecimal.new("67.65")
85
+ response.total_net_charge.should be > BigDecimal.new("67")
86
86
  end
87
87
 
88
88
  end
@@ -3,7 +3,11 @@ module Credentials
3
3
  FILE = File.expand_path("../credentials.yml", __FILE__)
4
4
 
5
5
  def self.all
6
- YAML.load_file(FILE) if File.exist?(FILE)
6
+ if File.exist?(FILE)
7
+ YAML.load_file(FILE)
8
+ else
9
+ {}
10
+ end
7
11
  end
8
12
 
9
13
  module Keys
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
5
- prerelease:
4
+ version: 0.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - iain
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-09 00:00:00.000000000 Z
11
+ date: 2014-01-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: savon
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,15 +20,27 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
29
26
  version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
30
41
  - !ruby/object:Gem::Dependency
31
42
  name: rspec
32
43
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
44
  requirements:
35
45
  - - ! '>='
36
46
  - !ruby/object:Gem::Version
@@ -38,7 +48,6 @@ dependencies:
38
48
  type: :development
39
49
  prerelease: false
40
50
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
51
  requirements:
43
52
  - - ! '>='
44
53
  - !ruby/object:Gem::Version
@@ -46,7 +55,6 @@ dependencies:
46
55
  - !ruby/object:Gem::Dependency
47
56
  name: pry-nav
48
57
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
58
  requirements:
51
59
  - - ! '>='
52
60
  - !ruby/object:Gem::Version
@@ -54,7 +62,6 @@ dependencies:
54
62
  type: :development
55
63
  prerelease: false
56
64
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
65
  requirements:
59
66
  - - ! '>='
60
67
  - !ruby/object:Gem::Version
@@ -83,6 +90,7 @@ files:
83
90
  - lib/fex/version.rb
84
91
  - lib/fex/wsdl.rb
85
92
  - spec/integration/address_validation_spec.rb
93
+ - spec/integration/pending_shipment_spec.rb
86
94
  - spec/integration/rate_spec.rb
87
95
  - spec/integration/ship_spec.rb
88
96
  - spec/integration/track_spec.rb
@@ -104,30 +112,30 @@ files:
104
112
  - wsdl/upload_document.wsdl
105
113
  homepage: https://github.com/yourkarma/fex
106
114
  licenses: []
115
+ metadata: {}
107
116
  post_install_message:
108
117
  rdoc_options: []
109
118
  require_paths:
110
119
  - lib
111
120
  required_ruby_version: !ruby/object:Gem::Requirement
112
- none: false
113
121
  requirements:
114
122
  - - ! '>='
115
123
  - !ruby/object:Gem::Version
116
124
  version: '0'
117
125
  required_rubygems_version: !ruby/object:Gem::Requirement
118
- none: false
119
126
  requirements:
120
127
  - - ! '>='
121
128
  - !ruby/object:Gem::Version
122
129
  version: '0'
123
130
  requirements: []
124
131
  rubyforge_project:
125
- rubygems_version: 1.8.23
132
+ rubygems_version: 2.1.9
126
133
  signing_key:
127
- specification_version: 3
134
+ specification_version: 4
128
135
  summary: Small wrapper around Savon for using FedEx Web Services
129
136
  test_files:
130
137
  - spec/integration/address_validation_spec.rb
138
+ - spec/integration/pending_shipment_spec.rb
131
139
  - spec/integration/rate_spec.rb
132
140
  - spec/integration/ship_spec.rb
133
141
  - spec/integration/track_spec.rb
@@ -136,3 +144,4 @@ test_files:
136
144
  - spec/support/logger_helper.rb
137
145
  - spec/unit/service_spec.rb
138
146
  - spec/unit/wsdl_spec.rb
147
+ has_rdoc: