shopify_api 5.2.3 → 5.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -0
- data/lib/shopify_api/resources/order.rb +9 -2
- data/lib/shopify_api/version.rb +1 -1
- data/test/order_test.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63ec95eea11639a4bb5808aca547e3bf8cb26fb1d3cb1c7576949d99670932fe
|
4
|
+
data.tar.gz: f0d6932da38d82ae6685006ff7683f4a6767f343ca344fbced06fdbfdb9cb51a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a5f47b30dc2761fcd4fe64592f0bd8c75e97e894be120b995cd2046e7e6f912e417a48d32f6c76630ead5b9e7ebf8b8e8f8fba293dbe71d74c7c884d028b103
|
7
|
+
data.tar.gz: 32c775a711e06c294ac92012bc8b15f481598f369615130629ef51343ba81fd6529f33b99fdf8c0180e7ccd14e9f0394aab0b4309a40a2e06c35140a348c2567
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== Version 5.2.4
|
2
|
+
|
3
|
+
* Added `currency` parameter to `ShopifyAPI::Order#capture`. This parameter is required for apps that belong to the
|
4
|
+
multi-currency beta program.
|
5
|
+
|
1
6
|
== Version 5.2.3
|
2
7
|
|
3
8
|
* Update delivery confirmation resource to delivery confirmation details resource.
|
@@ -19,8 +19,15 @@ module ShopifyAPI
|
|
19
19
|
Transaction.find(:all, :params => { :order_id => id })
|
20
20
|
end
|
21
21
|
|
22
|
-
def capture(amount = "")
|
23
|
-
|
22
|
+
def capture(amount = "", currency: nil)
|
23
|
+
capture_transaction = {
|
24
|
+
amount: amount,
|
25
|
+
kind: "capture",
|
26
|
+
order_id: id,
|
27
|
+
}
|
28
|
+
capture_transaction[:currency] = currency if currency
|
29
|
+
|
30
|
+
Transaction.create(capture_transaction)
|
24
31
|
end
|
25
32
|
|
26
33
|
class ClientDetails < Base
|
data/lib/shopify_api/version.rb
CHANGED
data/test/order_test.rb
CHANGED
@@ -56,4 +56,20 @@ class OrderTest < Test::Unit::TestCase
|
|
56
56
|
order.cancel(email: false, restock: true)
|
57
57
|
assert_request_body({'email' => false, 'restock' => true}.to_json)
|
58
58
|
end
|
59
|
+
|
60
|
+
test "capture an order with currency param" do
|
61
|
+
fake 'orders/450789469', body: load_fixture('order')
|
62
|
+
order = ShopifyAPI::Order.find(450789469)
|
63
|
+
|
64
|
+
fake 'orders/450789469/transactions', method: :post, status: 201, body: load_fixture('transaction')
|
65
|
+
order.capture(100.00, currency: 'CAD')
|
66
|
+
|
67
|
+
assert_request_body({
|
68
|
+
transaction: {
|
69
|
+
amount: 100.00,
|
70
|
+
kind: 'capture',
|
71
|
+
currency: 'CAD',
|
72
|
+
},
|
73
|
+
}.to_json)
|
74
|
+
end
|
59
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.
|
4
|
+
version: 5.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|