expressly 2.0.32.rc1 → 2.0.34.rc1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 765092a460c3705f8841d13a0a39acfaa5d69304
4
- data.tar.gz: 274eed1b540c881777a709ad7c26267d40630dee
3
+ metadata.gz: b50498abdf3764473491a48322e57379c2b5051a
4
+ data.tar.gz: 13b7a6af1a7a920477bdcbb0cec772f8b287746f
5
5
  SHA512:
6
- metadata.gz: 8c56a2753464a13dcd47c858b99fa2cbac90554a366a8da766af141a26bc2703b75f8c8a3e1f8bc2a27d22c31c84275721b0a96941da2cb138a669bb81bb2dc2
7
- data.tar.gz: 493cbaa6101ddfda59fb10469affca648d59ca74afe0dea7645208fed21a5cf18ab3c63c32369f2ad0e8ab2486e2c21c2269b294d2d2d121c0c05976fa68719a
6
+ metadata.gz: 05258c1b5f1dddbed4e841377dc7fb8dc32501957f4d03df8c342c51f8685f454bfd8e8ebd60224bda4686f47b7c22a6c9aa2aa4a991c53d84d20eed3335fe00
7
+ data.tar.gz: ea6d6cb1833c097766399e5c54714f9dc2b087de448c0c6076e289765539b23e42b99c476f214914a79abf2b36fa30a86003b3e8aa4a7a33f14356329766e96f
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ rvm:
2
+ - 1.9.3
3
+ - 2.1.6
4
+ - 2.2.2
data/Gemfile CHANGED
@@ -1,10 +1,12 @@
1
1
  gem "bundler"
2
+ gem 'rake'
2
3
 
3
4
  group :development do
4
5
  require 'rbconfig'
5
- gem 'fakeweb'
6
+ #gem 'fakeweb'
7
+ gem 'awesome_print', '~> 1.2.0'
6
8
  gem 'guard-rspec'
7
9
  gem 'guard'
8
10
  gem "rdoc", "~> 3.12"
9
- gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
11
+ #gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
10
12
  end
data/Gemfile.lock CHANGED
@@ -1,6 +1,7 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
+ awesome_print (1.2.0)
4
5
  celluloid (0.15.2)
5
6
  timers (~> 1.1.0)
6
7
  coderay (1.1.0)
@@ -17,7 +18,6 @@ GEM
17
18
  guard-rspec (4.0.4)
18
19
  guard (>= 2.1.1)
19
20
  rspec (~> 2.14)
20
- httpclient (2.7.0.1)
21
21
  json (1.8.1)
22
22
  listen (2.2.0)
23
23
  celluloid (>= 0.15.2)
@@ -29,6 +29,7 @@ GEM
29
29
  coderay (~> 1.0)
30
30
  method_source (~> 0.8)
31
31
  slop (~> 3.4)
32
+ rake (10.4.2)
32
33
  rb-fsevent (0.9.3)
33
34
  rb-inotify (0.9.2)
34
35
  ffi (>= 0.5.0)
@@ -45,21 +46,18 @@ GEM
45
46
  slop (3.4.7)
46
47
  thor (0.18.1)
47
48
  timers (1.1.0)
48
- tzinfo (0.3.37)
49
- wdm (0.1.1)
50
49
 
51
50
  PLATFORMS
52
51
  ruby
53
52
  x64-mingw32
54
53
 
55
54
  DEPENDENCIES
55
+ awesome_print (~> 1.2.0)
56
56
  bundler
57
57
  guard
58
58
  guard-rspec
59
- httpclient
59
+ rake
60
60
  rdoc (~> 3.12)
61
- tzinfo (= 0.3.37)
62
- wdm (>= 0.1.0)
63
61
 
64
62
  BUNDLED WITH
65
63
  1.10.6
data/README.rdoc CHANGED
@@ -1,5 +1,27 @@
1
+ {<img src="https://buyexpressly.com/assets/img/expressly-logo-sm-gray.png" alt="Expressly" />}[https://buyexpressly.com]
2
+ {<img src="https://badge.fury.io/rb/expressly.svg" alt="Gem Version" />}[https://badge.fury.io/rb/expressly]
3
+ {<img src="https://api.travis-ci.org/expressly/expressly-plugin-sdk-ruby-core.png" alt="Build Status" />}[https://api.travis-ci.org/expressly/expressly-plugin-sdk-ruby-core]
1
4
  = Expressly Plug-in Ruby SDK
2
5
 
6
+ The Expressly Ruby SDK provides as much of the heavy-lifting of the Expressly Network API to help developers wishing to
7
+ integrate their rails e-commerce platform with the {Expressly network}[https://buyexpressly.com].
8
+
9
+ == Getting Started
10
+
11
+ gemfile::
12
+ gem 'expressly', '~> 2.0'
13
+
14
+ install::
15
+ gem install expressly --pre
16
+
17
+ You can find a Rails reference implementation {here}[https://github.com/expressly/expressly-plugin-rails-reference-implementation]
18
+ to help you get started.
19
+
20
+ == More Info
21
+
22
+ Further resources can be found on the {Expressly developer portal}[http://developer.buyexpressly.com].
23
+
24
+ == License
3
25
 
4
26
  Copyright (c) 2015 Expressly. See LICENSE.txt for further details.
5
27
 
data/Rakefile CHANGED
@@ -1,2 +1,7 @@
1
1
  require 'bundler'
2
- Bundler::GemHelper.install_tasks
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ desc "Run all specs"
5
+ task :default do
6
+ exec 'rspec spec'
7
+ end
data/lib/expressly.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'logger'
2
+
1
3
  module Expressly
2
4
  @@logger = Logger.new(STDERR)
3
5
  @@logger.level= Logger::Severity::INFO
@@ -12,16 +14,37 @@ module Expressly
12
14
  def self.default_configuration?()
13
15
  !@@default_configuration.nil?
14
16
  end
15
-
16
- def self.default_configuration=(default_configuration)
17
+
18
+ ##
19
+ # Set the default configuration. This is how the ApiController so you must call this with your configuration .
20
+ #
21
+ # === Args
22
+ #
23
+ # * +default_configuration+ - an Expressly::Configuration instance
24
+ #
25
+ def self.default_configuration=(default_configuration)
17
26
  @@default_configuration = default_configuration
18
27
  end
19
-
28
+
29
+ ##
30
+ # The configuration object for boot strapping the Expressly plugin engine.
31
+ #
20
32
  class Configuration
21
33
  attr_reader :api_key,
22
34
  :merchant_plugin_provider, :merchant_plugin_endpoint, :merchant_metadata,
23
35
  :expressly_provider, :expressly_endpoint
24
-
36
+
37
+ ##
38
+ # Constructor arguments
39
+ #
40
+ # === Args
41
+ #
42
+ # * +api_key+ - your Expressly API key
43
+ # * +merchant_plugin_provider+ - your Expressly::MerchantPluginProvider implementation
44
+ # * +merchant_plugin_endpoint+ - the http endpoint of your store, i.e. the bit that comes before /expressly/api/...
45
+ # * +merchant_metadata+ - a hash of metadata that may be sent to the server on a customer export
46
+ # * +expressly_endpoint+ - the Expressly server endpoint. Defaults to the Expressly production service.
47
+ #
25
48
  def initialize(api_key, merchant_plugin_provider, merchant_plugin_endpoint, merchant_metadata = {}, expressly_endpoint = 'https://prod.expresslyapp.com/api')
26
49
  @api_key = api_key
27
50
  @merchant_plugin_provider = merchant_plugin_provider
@@ -33,8 +56,6 @@ module Expressly
33
56
  end
34
57
  end
35
58
 
36
- require 'logger'
37
-
38
59
  require 'expressly/version'
39
60
  require 'expressly/util'
40
61
  require 'expressly/domain'
@@ -1,7 +1,9 @@
1
1
  module Expressly
2
2
  ##
3
3
  # This "interface" should be "implemented" by you and provided to the Expressly::Configuration constructor.
4
- # It is the bridge between the expressly domain and your platform.
4
+ # It is the bridge between the expressly domain and your platform. The Expressly::ApiController is responsible
5
+ # for marshalling and routing requests to your platform and directing calls to your specific provider implementation.
6
+ #
5
7
  #
6
8
  class MerchantPluginProvider
7
9
  include AbstractInterface
@@ -11,46 +13,156 @@ module Expressly
11
13
  # and been directed to your shop. You are required to make a call to retrieve the expressly popup html
12
14
  # and embed it on the landing page of your choice.
13
15
  #
16
+ # The typical flow would be:
17
+ #
18
+ # 1. customer clicks a promotion link to https://yourshop.com/expressly/api/:campaign_customer_uuid
19
+ # 2. ApiController call popup_handler with itself as the first parameter and the uuid as the second parameter
20
+ # 3. The handler should through a mechanism of their choice should display an appropriate page on their site and embed the Expressly popup HTML
21
+ #
22
+ # The mechanics of how to acheive step 3 is up to the implementer. The Expressly popup HTML is retrieved with the following call:
23
+ # Expressly::default_configuration.expressly_provider.fetch_migration_confirmation_html(campaign_customer_uuid)
24
+ #
25
+ # === Args
26
+ #
27
+ # * +controller+ - an ApplicationController instance
28
+ # * +campaign_customer_uuid+ - the Expressly uuid identifying the customer to be migrated
29
+ #
30
+ # === Return
31
+ #
32
+ # N/A
33
+ #
14
34
  def popup_handler(controller, campaign_customer_uuid)
15
35
  MerchantPluginProvider.api_not_implemented(self)
16
36
  end
17
37
 
38
+ ##
39
+ # The customer register is the first step of the migration process after they have confirmed that they want to proceed.
40
+ # You should register the customer on you system when you receive this call. You should treat this as a new customer,
41
+ # i.e. send them a welcome email etc.
42
+ #
43
+ # === Args
44
+ #
45
+ # * +primary_email+ - the new customer's identifying e-mail address (note that the emails within the customer object may only contain alternate addresses)
46
+ # * +customer+ - an Expressly::Customer instance with the data of the customer to import
47
+ #
48
+ # === Return
49
+ #
50
+ # The reference you would like to use to further identify the customer within the remaining migration calls. This
51
+ # can be anything that works for you from the email address, the database identifier, to your internal customer object.
52
+ #
18
53
  def customer_register(primary_email, customer)
19
54
  MerchantPluginProvider.api_not_implemented(self)
20
55
  end
21
56
 
57
+ ##
58
+ # You should execute a password reset on behalf of the user and send them an email so that they can reset their
59
+ # password.
60
+ #
61
+ # === Args
62
+ #
63
+ # * +customer_reference+ - the reference you returned in the customer_register call
64
+ #
65
+ # === Return
66
+ #
67
+ # N/A
68
+ #
22
69
  def customer_send_password_reset_email(customer_reference)
23
70
  MerchantPluginProvider.api_not_implemented(self)
24
71
  end
25
72
 
73
+ ##
74
+ # You should update the customer's cart to include the coupon and/or product if either or both are present.
75
+ #
76
+ # === Args
77
+ #
78
+ # * +customer_reference+ - the reference you returned in the customer_register call
79
+ # * +cart+ - an instance of Expressly::Cart with the details of how to update the cart with
80
+ #
81
+ # === Return
82
+ #
83
+ # N/A
84
+ #
26
85
  def customer_update_cart(customer_reference, cart)
27
86
  MerchantPluginProvider.api_not_implemented(self)
28
87
  end
29
88
 
89
+ ##
90
+ # You should log the user in on their current session.
91
+ #
92
+ # === Args
93
+ #
94
+ # * +customer_reference+ - the reference you returned in the customer_register call
95
+ #
96
+ # === Return
97
+ #
98
+ # N/A
99
+ #
30
100
  def customer_login(customer_reference)
31
101
  MerchantPluginProvider.api_not_implemented(self)
32
102
  end
33
103
 
104
+ ##
105
+ # Once the customer is migrated they will need to be re-directed to the most appropriate location on your site.
106
+ # This could be the home page or the checkout.
107
+ #
108
+ # === Args
109
+ #
110
+ # * +success+ - if true then the customer was successfully migrated, if false then it failed and customer_reference will be nil
111
+ # * +customer_reference+ - the reference you returned in the customer_register call unless the migration failed, in which case it will be nil
112
+ #
113
+ # === Return
114
+ #
115
+ # N/A
116
+ #
34
117
  def customer_migrated_redirect_url(success, customer_reference)
35
118
  MerchantPluginProvider.api_not_implemented(self)
36
119
  end
37
120
 
38
121
  ##
39
- # Some documentation on the check_customer_statuses method
40
- # return Expressly::Customer
122
+ # The provider should respond to this call by populating an Expressly::Customer instance with the details of
123
+ # the customer that matches the email address passed to it.
124
+ #
125
+ # === Args
126
+ #
127
+ # * +email+ - the email address of the customer to be exported
128
+ #
129
+ # === Return
130
+ #
131
+ # An instance of Expressly::Customer to be exported. It should attempt to fill in as many fields as possible.
132
+ #
41
133
  def get_customer(email)
42
134
  MerchantPluginProvider.api_not_implemented(self)
43
135
  end
44
136
 
45
137
  ##
46
- # Some documentation on the check_customer_statuses method
138
+ # Check the statuses of the email addresses supplied. Given the list the implementer should check for the
139
+ # existence of the email addresses in their system and for those that exist should return an
140
+ # Expressly::CustomerStatuses instance.
141
+ #
142
+ # === Args
143
+ #
144
+ # * +email_list+ - a list of the emails to check.
145
+ #
146
+ # === Return
147
+ #
148
+ # An instance of Expressly::CustomerStatuses.
149
+ #
47
150
  def check_customer_statuses(email_list)
48
151
  MerchantPluginProvider.api_not_implemented(self)
49
152
  end
50
153
 
51
154
  ##
52
- # Some documentation on the get_order_details method
53
- # Returns ...
155
+ # Retrieve the invoices and orders in a given time frame for the supplied email addresses. Each entry consists
156
+ # of the email address, a from date (inclusive) and a to date (exclusive)
157
+ #
158
+ # === Args
159
+ #
160
+ # * +customer_invoice_request_list+ - a list of Expressly::CustomerInvoiceRequest objects.
161
+ #
162
+ # === Return
163
+ #
164
+ # A list of Expressly::CustomerInvoice objects for all the customers referenced in the request.
165
+ #
54
166
  def get_customer_invoices(customer_invoice_request_list)
55
167
  MerchantPluginProvider.api_not_implemented(self)
56
168
  end
@@ -2,7 +2,7 @@ module Expressly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- PATCH = 32
5
+ PATCH = 34
6
6
  BUILD = 'rc1'
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.32.rc1
4
+ version: 2.0.34.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc G. Smith
@@ -78,6 +78,7 @@ files:
78
78
  - ".document"
79
79
  - ".gitignore"
80
80
  - ".rspec"
81
+ - ".travis.yml"
81
82
  - Gemfile
82
83
  - Gemfile.lock
83
84
  - Guardfile