valken-shipping 0.1.0 → 0.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04745f3ed0c5ecabf3975b0f071f244dbff18a6374f81feae40d39f4f546656c
|
4
|
+
data.tar.gz: 7a3073049e68c67f11b3764e1fc68c01479313f75c1d37f803b574629a2e9eb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa58934d2b87f6f334fe5461d2c0c02c91e01984344bdaa0964af467052cad20774de90f2c61ec1afd49a21ba8748a67d121f7871e07aea74161823678ce0b47
|
7
|
+
data.tar.gz: d5bd1cfe4fe351ce5e92cb9c8ae6863c01d1d9ce8df254e89f6dfaf370b66139122803b80f2f605138c16d55a8d3aeaa3b742bfde167562aa1841aa81b110c0a
|
@@ -34,11 +34,11 @@ module Workarea
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def get_ups_data
|
37
|
-
ups_options = get_options(
|
37
|
+
ups_options = get_options(Workarea.config.gateways.ups_carrier, Workarea.config.ups_options)
|
38
38
|
end
|
39
39
|
|
40
40
|
def get_fedex_data
|
41
|
-
fedex_response = get_options(
|
41
|
+
fedex_response = get_options(Workarea.config.gateways.fedex_carrier, Workarea.config.fedex_options)
|
42
42
|
end
|
43
43
|
|
44
44
|
def get_none_data
|
data/lib/valken/shipping.rb
CHANGED
@@ -1,7 +1,42 @@
|
|
1
|
+
require 'workarea'
|
2
|
+
require 'workarea/storefront'
|
3
|
+
require 'workarea/admin'
|
1
4
|
require "valken/shipping/engine"
|
2
5
|
|
3
6
|
module Valken
|
4
7
|
module Shipping
|
5
|
-
|
8
|
+
|
9
|
+
def self.ups_credentials
|
10
|
+
return {} unless Rails.application.secrets.ups_carrier.present?
|
11
|
+
Rails.application.secrets.ups_carrier.symbolize_keys
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.fedex_credentials
|
15
|
+
return {} unless Rails.application.secrets.fedex_carrier.present?
|
16
|
+
Rails.application.secrets.fedex_carrier.symbolize_keys
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.ups_gateway=(gateway)
|
20
|
+
Workarea.config.gateways.ups_carrier = gateway
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.fedex_gateway=(gateway)
|
24
|
+
Workarea.config.gateways.fedex_carrier = gateway
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.auto_initialize_gateway
|
28
|
+
if ups_credentials.present? && fedex_credentials.present?
|
29
|
+
if Rails.env.test?
|
30
|
+
self.ups_gateway = ActiveShipping::Workarea.new
|
31
|
+
self.fedex_gateway = ActiveShipping::Workarea.new
|
32
|
+
else
|
33
|
+
self.ups_gateway = ActiveShipping::UPS.new credentials
|
34
|
+
self.fedex_gateway = ActiveShipping::FedEx.new credentials
|
35
|
+
end
|
36
|
+
else
|
37
|
+
self.ups_gateway = ActiveShipping::Workarea.new
|
38
|
+
self.fedex_gateway = ActiveShipping::Workarea.new
|
39
|
+
end
|
40
|
+
end
|
6
41
|
end
|
7
|
-
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valken-shipping
|
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
|
- sushmitha02
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|