flowcommerce-activemerchant 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: efc579210f9d0aba95940b3aa0f1a87755f83032
4
- data.tar.gz: 2bac54e1f784f71c1eca8b073b0af62808c64f06
3
+ metadata.gz: fba843acb8d6cdf6db79694fd1992dbfcddc8b34
4
+ data.tar.gz: 704db572be6c5984193e58fc74ec87fad2b7595e
5
5
  SHA512:
6
- metadata.gz: 68b9a019e021f37039c153bd818a17c40eb54a598df3c41588b840c39730d416e84c0f6a0eee5289e3ed4e4b844b0960226447e67d86a2111e7f2f55dff237fe
7
- data.tar.gz: 76d9bee4d2796559f7d5408d301595f6db954a729b6f5ce61e8584b4f4d7132f198d468def8a37d959713152968c80f2eeba37f783ffcf1a59d41e4632bd852e
6
+ metadata.gz: 36feb67b7e0d5c68f62daf73bde884ef60a773534e52c0c79a4cd6e23af570d24a5033ba3407b251751e86cf29a4a042d7d47b511567f350fde5cea2dac310e9
7
+ data.tar.gz: fb87dde4bf3f9533d746916a683d9dbacf8d88d710d51597f9b3619cf17ee2913d750f1920257bd3fe3ae1960df5c6669b5e77de8d25bfc45cc4a782538e7b68
@@ -1,18 +1,18 @@
1
1
  # @Flow.io (2017)
2
2
  # Active Merchant adapter for Flow api
3
3
 
4
- require 'flow-reference'
4
+ require 'flowcommerce-reference'
5
5
 
6
6
  module ActiveMerchant
7
7
  module Billing
8
8
  class FlowGateway < Gateway
9
- VERSION = '0.1.1' unless defined?(::ActiveMerchant::Billing::FlowGateway::VERSION)
9
+ VERSION = '0.1.2' unless defined?(::ActiveMerchant::Billing::FlowGateway::VERSION)
10
10
 
11
11
  self.display_name = 'Flow.io Pay'
12
12
  self.homepage_url = 'https://www.flow.io/'
13
13
  self.default_currency = 'USD'
14
- self.supported_countries = Flow::Reference::Countries::ISO_3166_2
15
- self.supported_cardtypes = Flow::Reference::PaymentMethods::SUPPORTED_CREDIT_CARDS
14
+ self.supported_countries = FlowCommerce::Reference::Countries::ISO_3166_2
15
+ self.supported_cardtypes = FlowCommerce::Reference::PaymentMethods::SUPPORTED_CREDIT_CARDS
16
16
 
17
17
  def initialize options = {}
18
18
  @flow_api_key = options[:api_key] || ENV['FLOW_API_KEY']
@@ -45,12 +45,13 @@ module ActiveMerchant
45
45
 
46
46
  begin
47
47
  authorization_form = if options[:order_id]
48
- # order_number allready present at flow
49
- data[:order_number] = options[:order_id]
50
- ::Io::Flow::V0::Models::MerchantOfRecordAuthorizationForm.new data
51
- else
52
- ::Io::Flow::V0::Models::DirectAuthorizationForm.new data
53
- end
48
+ # order_number allready present at flow
49
+ data[:order_number] = options[:order_id]
50
+ ::Io::Flow::V0::Models::MerchantOfRecordAuthorizationForm.new data
51
+ else
52
+ ::Io::Flow::V0::Models::DirectAuthorizationForm.new data
53
+ end
54
+
54
55
  response = flow_instance.authorizations.post @flow_organization, authorization_form
55
56
  rescue => exception
56
57
  return Response.new false, exception.message, { exception: exception }
@@ -58,8 +59,9 @@ module ActiveMerchant
58
59
 
59
60
  options = { response: response }
60
61
 
61
- if response.result.status.value == 'authorized'
62
- store = { key: response.key,
62
+ if ['review', 'authorized'].include?(response.result.status.value)
63
+ store = {
64
+ key: response.key,
63
65
  amount: response.amount,
64
66
  currency: response.currency,
65
67
  authorization_id: response.id
@@ -169,7 +171,7 @@ module ActiveMerchant
169
171
 
170
172
  def assert_currency currency, amount
171
173
  raise ArgumentError, 'currency not provided' unless currency
172
- currency_model = Flow::Reference::Currencies.find! currency
174
+ currency_model = FlowCommerce::Reference::Currencies.find! currency
173
175
  currency_model.to_cents(amount).to_f
174
176
  end
175
177
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowcommerce-activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dino Reic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-15 00:00:00.000000000 Z
11
+ date: 2018-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.2.58
41
41
  - !ruby/object:Gem::Dependency
42
- name: flow-reference
42
+ name: flowcommerce-reference
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.3.2
47
+ version: 0.4.6
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.3.2
54
+ version: 0.4.6
55
55
  description: Flow.io is PCI compliant gateway which supports authorizations, captures,
56
56
  refunds and tokenization of credit cards globally.
57
57
  email: tech@flow.io
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  version: '0'
82
82
  requirements: []
83
83
  rubyforge_project:
84
- rubygems_version: 2.5.2
84
+ rubygems_version: 2.5.2.3
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Adapter for Flow.io global payment gateway