spree_komoju 0.0.7 → 0.0.8

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: 4caf7c8b13c00f6893b7bc2af9a292cf25a867a8
4
- data.tar.gz: e72a32999a83abfcd6db71cecd74a74e4a993be0
3
+ metadata.gz: bb8062887d2830cda89312433b059e9a6ce409fe
4
+ data.tar.gz: 092d3002a410b03e59218451348cfee70a7d7f98
5
5
  SHA512:
6
- metadata.gz: 3ba55860027e52f8813c8eb1853ba8c603b09cbf03fb8a88e389e2d7d78a2edec94624e97874224d9d1086e5b54ebd2d4eeb190d070829c3dc8e68abdb3996e7
7
- data.tar.gz: ed4021bfd231af61e80e834c073285c61c4b3fb66c909e3c1c72635f6812294a82e79177be855409476676c71cdb5c4b0690fa9a61ebd47caba4c325d04913c7
6
+ metadata.gz: ade99fbb0577c77055f6bbc5b786b2f9de03e1b2eb285203b32273a71eb8495a7c2be397884d95b2d89addbb4d5e8b8192a8c25f35525d454c0c158665e8b826
7
+ data.tar.gz: 82af313e501f40ed1a589717bccab38ffce42b75cad1480a599fc9f93acb5237a02c0c6c7fdfe3ccc6f7f3b79e5cad19d2edd99c6c753aa0bccfa8fb5faf2a7e
data/Gemfile CHANGED
@@ -4,7 +4,5 @@ gem 'spree', github: 'spree/spree', branch: '3-0-stable'
4
4
  gem 'activemerchant', github: "komoju/active_merchant", branch: "add-komoju-gateway"
5
5
  # Provides basic authentication functionality for testing parts of your engine
6
6
  gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'
7
- gem 'guard'
8
- gem 'guard-rspec'
9
7
 
10
8
  gemspec
@@ -9,6 +9,14 @@ module Spree
9
9
  provider.refund(money, response_code, {})
10
10
  end
11
11
 
12
+ def cancel(response_code)
13
+ provider.void(response_code)
14
+ end
15
+
16
+ def void(response_code, source, gateway_options)
17
+ provider.void(response_code)
18
+ end
19
+
12
20
  def purchase(money, source, options)
13
21
  options = change_options_to_dollar(options) if options[:currency] == "JPY"
14
22
  if profile_id = source.gateway_payment_profile_id || source.gateway_customer_profile_id
@@ -42,7 +42,12 @@ module ActiveMerchant #:nodoc:
42
42
  commit("/payments", post)
43
43
  end
44
44
 
45
- def refund(money, identification, options = {})
45
+ def refund(amount, identification, options = {})
46
+ params = { :amount => amount }
47
+ commit("/payments/#{identification}/refund", params)
48
+ end
49
+
50
+ def void(identification, options = {})
46
51
  commit("/payments/#{identification}/refund", {})
47
52
  end
48
53
 
@@ -67,6 +67,25 @@ describe Spree::Gateway::KomojuCreditCard, type: :model do
67
67
  end
68
68
  end
69
69
 
70
+ describe "#void" do
71
+ let(:response_code) { "external_payment_id" }
72
+ let(:source) { double("credit card") }
73
+
74
+ it "voids payment" do
75
+ expect(komoju_gateway).to receive(:void).with(response_code)
76
+ subject.void(response_code, source, {})
77
+ end
78
+ end
79
+
80
+ describe "#cancel" do
81
+ let(:response_code) { "external_payment_id" }
82
+
83
+ it "voids payment" do
84
+ expect(komoju_gateway).to receive(:void).with(response_code)
85
+ subject.void(response_code, double("source"), {})
86
+ end
87
+ end
88
+
70
89
  describe "#create_profile" do
71
90
  let(:payment) { double("payment", source: source) }
72
91
  let(:details) { double("payment details") }
data/spree_komoju.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_komoju'
5
- s.version = '0.0.7'
5
+ s.version = '0.0.8'
6
6
  s.summary = 'Spree Komoju Payment Gateway'
7
7
  s.description = 'Spree Payment gateway for Komoju payment gateway'
8
8
  s.authors = ['Masahiro Saito', 'Chris Salzberg', 'Richard Ramsden']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_komoju
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Saito
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-12-21 00:00:00.000000000 Z
13
+ date: 2015-12-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: spree_core