spree_mollie_gateway 3.0.0.pre.beta → 3.0.0

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: cf83a48a0236601f55589927af67ebc9b340aa7ff623996e6a7a568d1299b695
4
- data.tar.gz: 97b9e8c49d143227aacb90e71cf7223f0b4843a5c3a635b37f363e7827f87134
3
+ metadata.gz: a6b5e166026cbe5e73895dd1806d2f2a9de535116ce51b7f2b233c7d91c7b84b
4
+ data.tar.gz: f6462d90a2ed5aff5b237e98292e79f7281f5a29e3d95af028c02063a353743c
5
5
  SHA512:
6
- metadata.gz: 3b8580923c7885ef0c7dc9487cad268167d52414812b7085f9983623e7fadbdc38efb227a810234c1c74ca3b8be7d3ae93375cefcfa66b93ca16e0a035ca22e2
7
- data.tar.gz: 30b271c5e2b822f2ba9ca8f9cff3ef9fe0bae328956e49f372b4268d3ecf7cd0f979c74cb11779d2c08ad90be89c6b1673c7d05fcdc358e8ca998431961262f8
6
+ metadata.gz: a8e0f55fbfa671c855d140d63a5ba240cc1f23006611a0c7834b9be0ef44093c8b6216f199e6a2dd98a337a313c7301ae7632b7a3ab4ed24f390c8fa4a9dd217
7
+ data.tar.gz: 85d95df79e975054152b6b31a20b781738d9cf04b02201d37d95098c3e5c77caa4c1e6d15b5768e9051324dc074a5c3b0e108e3780aa5476917f88d6028fe767
data/README.md CHANGED
@@ -37,7 +37,7 @@ Please go to the [signup page](https://www.mollie.com/signup) to create a new Mo
37
37
  * Allow returning customers to <a href="https://www.mollie.com/en/features/checkout" title="One-click payments">use their previous payment details</a> and pay instantly.
38
38
 
39
39
  ## Requirements
40
- - Spree 3.1.0 or newer.
40
+ - Spree 3.3.x or newer.
41
41
 
42
42
  ## Installation
43
43
 
@@ -90,6 +90,8 @@ Want to help us make our API client even better? We take [pull requests](https:/
90
90
  Contact: [www.mollie.com](https://www.mollie.com) — info@mollie.com — +31 20-612 88 55
91
91
 
92
92
  + [More information about iDEAL via Mollie](https://www.mollie.com/en/payments/ideal/)
93
+ + [More information about Klarna Pay Later via Mollie](https://www.mollie.com/en/payments/klarna-pay-later)
94
+ + [More information about Klarna Slice It via Mollie](https://www.mollie.com/en/payments/klarna-slice-it)
93
95
  + [More information about Credit card via Mollie](https://www.mollie.com/en/payments/credit-card/)
94
96
  + [More information about Bancontact via Mollie](https://www.mollie.com/en/payments/bancontact/)
95
97
  + [More information about SOFORT Banking via Mollie](https://www.mollie.com/en/payments/sofort/)
@@ -83,8 +83,16 @@ module Spree
83
83
  @order.line_items.each do |line|
84
84
  order_lines << serialize_line_item(line)
85
85
  end
86
+
86
87
  order_lines << serialize_discounts if @order.has_order_adjustments?
88
+
87
89
  order_lines << serialize_shipping_costs
90
+
91
+ if @order.shipping_discount.positive?
92
+ order_lines << serialize_shipping_discounts
93
+ end
94
+
95
+ order_lines
88
96
  end
89
97
 
90
98
  def serialize_address(address)
@@ -142,6 +150,27 @@ module Spree
142
150
  }
143
151
  end
144
152
 
153
+ def serialize_shipping_discounts
154
+ {
155
+ type: 'discount',
156
+ name: 'Shipping discount',
157
+ quantity: 1,
158
+ unitPrice: {
159
+ currency: @order.currency,
160
+ value: format_money(-@order.display_shipping_discount.money)
161
+ },
162
+ totalAmount: {
163
+ currency: @order.currency,
164
+ value: format_money(-@order.display_shipping_discount.money)
165
+ },
166
+ vatAmount: {
167
+ currency: @order.currency,
168
+ value: '0.00'
169
+ },
170
+ vatRate: '0'
171
+ }
172
+ end
173
+
145
174
  def serialize_line_item(line)
146
175
  {
147
176
  type: 'physical',
@@ -1,5 +1,5 @@
1
1
  Spree::Order.class_eval do
2
- money_methods :order_adjustment_total
2
+ money_methods :order_adjustment_total, :shipping_discount
3
3
 
4
4
  # Make sure the order confirmation is delivered when the order has been paid for.
5
5
  def finalize!
@@ -1,3 +1,3 @@
1
1
  module SpreeMollieGateway
2
- VERSION = '3.0.0-beta'.freeze
2
+ VERSION = '3.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_mollie_gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre.beta
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vernon de Goede
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-16 00:00:00.000000000 Z
11
+ date: 2018-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_backend
@@ -373,9 +373,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
373
373
  version: '0'
374
374
  required_rubygems_version: !ruby/object:Gem::Requirement
375
375
  requirements:
376
- - - ">"
376
+ - - ">="
377
377
  - !ruby/object:Gem::Version
378
- version: 1.3.1
378
+ version: '0'
379
379
  requirements: []
380
380
  rubyforge_project:
381
381
  rubygems_version: 2.7.8