Skip to content

Commit b47e19d

Browse files
Merge pull request #282 from spark-solutions/feature/cleanup
3.2.0 release
2 parents 0cb134b + bca4302 commit b47e19d

4 files changed

Lines changed: 44 additions & 25 deletions

File tree

.rspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
--colour
1+
--color
2+
-r spec_helper
3+
-f documentation

README.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
# Spree Gateway
22

3-
[![Build Status](https://api.travis-ci.org/spree/spree_gateway.png?branch=master)](https://travis-ci.org/spree/spree_gateway)
4-
[![Code Climate](https://codeclimate.com/github/spree/spree_gateway.png)](https://codeclimate.com/github/spree/spree_gateway)
3+
[![Build Status](https://api.travis-ci.org/spree/spree_gateway.svg?branch=master)](https://travis-ci.org/spree/spree_gateway)
4+
[![Code Climate](https://codeclimate.com/github/spree/spree_gateway.svg)](https://codeclimate.com/github/spree/spree_gateway)
55

66
Community supported Spree Payment Method Gateways. It works as a wrapper for
77
active_merchant gateway. Note that for some gateways you might still need to
88
add another gem to your Gemfile to make it work. For example active_merchant
99
require `braintree` but it doesn't include that gem on its gemspec. So you
1010
need to manually add it to your rails app Gemfile.
1111

12-
These can be used with Spree >= 1.0.x (but see note below for necessary changes)
13-
14-
http://guides.spreecommerce.com/developer/payments.html
15-
1612
## Installation
1713

18-
In your Gemfile:
14+
1. Add this extension to your Gemfile with this line:
15+
16+
#### Spree >= 3.1
1917

20-
**Spree edge**
18+
```ruby
19+
gem 'spree_gateway', github: 'spree/spree_gateway'
20+
```
2121

22-
```ruby
23-
gem 'spree'
24-
gem 'spree_gateway', github: 'spree/spree_gateway', branch: 'master'
25-
```
22+
#### Spree 3.0 and Spree 2.x
2623

27-
**Spree 1.3**
24+
```ruby
25+
gem 'spree_gateway', github: 'spree/spree_gateway', branch: 'X-X-stable'
26+
```
2827

29-
```ruby
30-
gem 'spree', '~> 1.3'
31-
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '1-3-stable'
32-
```
28+
The `branch` option is important: it must match the version of Spree you're using.
29+
For example, use `3-0-stable` if you're using Spree `3-0-stable` or any `3.0.x` version.
3330

34-
Then run from the command line:
31+
2. Install the gem using Bundler:
32+
```ruby
33+
bundle install
34+
```
3535

36-
$ bundle install
37-
$ rails g spree_gateway:install
36+
3. Copy & run migrations
37+
```ruby
38+
bundle exec rails g spree_gateway:install
39+
```
3840

3941
Finally, make sure to **restart your app**. Navigate to *Configuration > Payment Methods > New Payment Method* in the admin panel and you should see that a bunch of additional gateways have been added to the list.
4042

spec/models/gateway/braintree_gateway_spec.rb

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,23 @@
6969

7070
describe 'payment profile failure' do
7171
before do
72-
order = create(:order_with_totals, bill_address: address, ship_address: address)
73-
order.update_with_updater!
72+
country = Spree::Country.default
73+
state = country.states.first
74+
address = create(:address,
75+
firstname: 'John',
76+
lastname: 'Doe',
77+
address1: '1234 My Street',
78+
address2: 'Apt 1',
79+
city: 'Washington DC',
80+
zipcode: '20123',
81+
phone: '(555)555-5555',
82+
state: state,
83+
country: country
84+
)
85+
@address = address
86+
87+
@order = create(:order_with_totals, bill_address: address, ship_address: address)
88+
@order.update_with_updater!
7489

7590
@credit_card = create(:credit_card,
7691
verification_value: '123',
@@ -82,7 +97,7 @@
8297
end
8398

8499
it 'should fail creation' do
85-
expect{ create(:payment, source: @credit_card, order: order, payment_method: @gateway, amount: 10.00) }.to raise_error
100+
expect{ create(:payment, source: @credit_card, order: @order, payment_method: @gateway, amount: 10.00) }.to raise_error Spree::Core::GatewayError
86101
end
87102

88103
end

spree_gateway.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Gem::Specification.new do |s|
33
s.platform = Gem::Platform::RUBY
44
s.name = 'spree_gateway'
5-
s.version = '3.2.0.beta'
5+
s.version = '3.2.0'
66
s.summary = 'Additional Payment Gateways for Spree Commerce'
77
s.description = s.summary
88

0 commit comments

Comments
 (0)