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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e75163182c1fb7b35dd1812beb6a3a13da3d41ecb4f26c0af4677204442db127
4
- data.tar.gz: 8ed57602229d2399ab17c5609941f6fe111cb5146282f76b518c42851edb0b95
3
+ metadata.gz: 63ec95eea11639a4bb5808aca547e3bf8cb26fb1d3cb1c7576949d99670932fe
4
+ data.tar.gz: f0d6932da38d82ae6685006ff7683f4a6767f343ca344fbced06fdbfdb9cb51a
5
5
  SHA512:
6
- metadata.gz: acf3ef0aed4a68b6d339d8594d41f47c89b14322b557b5e4d7d0b90a1214f7f06f4fce3d7cc78e5d03ace2b01b747cef4572a427e933d504734e15e6f61ed7b4
7
- data.tar.gz: 20ac9414d8d480332c07cd184b190cb67ca3ca1a27918c0091d356ee7c8f4d27946673335d3d7462f15c355e5fce0405059644975f42de735b447fc86f22bcee
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
- Transaction.create(:amount => amount, :kind => "capture", :order_id => id)
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
@@ -1,3 +1,3 @@
1
1
  module ShopifyAPI
2
- VERSION = "5.2.3"
2
+ VERSION = "5.2.4"
3
3
  end
@@ -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.3
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-02 00:00:00.000000000 Z
11
+ date: 2019-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource