omise 0.7.0 → 0.7.1

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: 8f67db51e46de8d75813070941bfce1ab7585841
4
- data.tar.gz: 8529481a2cdc0b51f4e8d597a02a995e1e699d83
3
+ metadata.gz: bc3ed7874767ee929bd07b3579faec6fdbaf3a22
4
+ data.tar.gz: ac029be84b38f795b6f163f1fa9a6dba1dd757c5
5
5
  SHA512:
6
- metadata.gz: 75f2c4e8aa0cef550ded71431dd5544f883e44d64de21f4c4689121f2b8c2bcb7a626a972d7075895dc0aa274343ffbaf5d1fd73c09813ccec143fc0bc109150
7
- data.tar.gz: ed74619566dc4e0d3dc08e7db4371ed640212574aee48212c93f3dc87ec1fd5d8d2cc056a83c8e322d14c6feaa42d1aa76f53d7d6776e6bc331250839a5d7506
6
+ metadata.gz: 4378039e687cc23acb12b3afe3c7d8dfe016c14bf3848c717c8d85d1b9bac1e02867d57a7eefbeb4aac162f003a45f903136fbef6a2664b24eb1a827365d1c2e
7
+ data.tar.gz: 155b4409ba41338eed7dadd9988c1eb666ee3450c9e481071d028d659726a25472be0a550d301f4b47a0e0b63a205b4be4d25fa7f8f86be64a4ec2ec827f1ddc
@@ -2,6 +2,10 @@
2
2
 
3
3
  An [unreleased] version is not available on rubygems and is subject to changes and must not be considered final. Elements of unreleased list may be edited or removed at any time.
4
4
 
5
+ ## [0.7.1] 2017-12-13
6
+
7
+ - [Added] Ability to add a suffix to the user agent
8
+
5
9
  ## [0.7.0] 2017-06-04
6
10
 
7
11
  - [Added] Support for start_date in Scheduler
data/README.md CHANGED
@@ -39,7 +39,7 @@ Omise.public_api_key = "pkey_test_xxxxxxxxxxxxxxxxxxx"
39
39
 
40
40
  With this set you'll be able to retrieve tokens or create new ones.
41
41
 
42
- However we recommend using [Omise.js](https://github.com/omise/omise.js) to
42
+ However we recommend using [Omise.js](https://www.omise.co/omise-js-api) to
43
43
  [collect cards](https://www.omise.co/collecting-card-information). When creating a token server side you'll need card data
44
44
  transiting to and from your server and this requires that your organization be
45
45
  PCI compliant.
@@ -74,7 +74,7 @@ Omise.logger = Rails.logger
74
74
 
75
75
  ## Quick Start
76
76
 
77
- After you have implemented [Omise.js](https://gitub.com/omise/omise.js) on your
77
+ After you have implemented [Omise.js](https://www.omise.co/omise-js-api) on your
78
78
  frontend you can charge the card by passing the token into the `card` attribute.
79
79
 
80
80
  ```ruby
@@ -95,7 +95,7 @@ end
95
95
  ```
96
96
 
97
97
  You can check the complete documentation at
98
- [docs.omise.co](https://docs.omise.co/).
98
+ [omise.co/docs](https://omise.co/docs).
99
99
 
100
100
  ## Development
101
101
 
@@ -5,7 +5,7 @@ module Omise
5
5
  LIB_PATH = File.expand_path("../../", __FILE__)
6
6
 
7
7
  class << self
8
- attr_accessor :api_url, :vault_url, :api_version, :resource
8
+ attr_accessor :api_url, :vault_url, :api_version, :resource, :user_agent_suffix
9
9
 
10
10
  attr_writer :secret_api_key, :public_api_key
11
11
 
@@ -89,6 +89,10 @@ module Omise
89
89
  headers = headers.merge(omise_version: Omise.api_version)
90
90
  end
91
91
 
92
+ if Omise.user_agent_suffix
93
+ headers[:user_agent] += ' ' + Omise.user_agent_suffix
94
+ end
95
+
92
96
  headers
93
97
  end
94
98
  end
@@ -1,3 +1,3 @@
1
1
  module Omise
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -22,6 +22,20 @@ class TestResource < Omise::Test
22
22
  assert_equal "2014-07-27", resource.headers[:omise_version]
23
23
  end
24
24
 
25
+ def test_that_the_user_agent_header_has_no_suffix_if_suffix_not_set
26
+ Omise.user_agent_suffix = nil
27
+ resource = Omise::Resource.new(Omise.api_url, "/", "skey_xxx")
28
+
29
+ assert_equal "OmiseRuby/#{Omise::VERSION} Ruby/#{RUBY_VERSION}", resource.headers[:user_agent]
30
+ end
31
+
32
+ def test_that_the_user_agent_header_has_suffix_if_suffix_set
33
+ suffix = "Suffix/1.0"
34
+ Omise.user_agent_suffix = suffix
35
+ resource = Omise::Resource.new(Omise.api_url, "/", "skey_xxx")
36
+ assert resource.headers[:user_agent].end_with? suffix
37
+ end
38
+
25
39
  def test_that_the_path_is_set
26
40
  resource = Omise::Resource.new(Omise.api_url, "/charges", "skey_xxx")
27
41
  uri = URI.parse("https://api.omise.co/charges")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Clart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-04 00:00:00.000000000 Z
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client