pensio_api 0.3.1 → 0.3.2

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: f9543dfa7d71a3752517ac385c643f887f78bdb4
4
- data.tar.gz: 0fe99ac756ee3145f76f29eae0a993d5e36af8d0
3
+ metadata.gz: a349b03c409fbe6ae2137f01fb3d64e945eed4ee
4
+ data.tar.gz: 1f77f414fa01c965b580938dbd56e7552adc9511
5
5
  SHA512:
6
- metadata.gz: 630b0086874a418ca44e8f9a0eb34174a89bbabd840e0fa8571ffea67a6179d45b83551b36239c3ac066a8fd0e05e335c9e7c389473b33e2c2a9aeadeb50bfd0
7
- data.tar.gz: 3c0f93a5fca86731e5b784c32d9dfebae6a43b94274d06ac839ad9f61b1373cca937d491615bb6e9f126b6775dc297e9b832de46b86c8eb3a160a917e25948c1
6
+ metadata.gz: 1d2b3e27414a9ae8d456221c625581f923f44736fbf407518fdb2f902c62328189a98b2605e002e7f64a8e32ed432af26f9c38010f42981481d1243c60b9dfbd
7
+ data.tar.gz: b61b944700b153168397112fb5801449c97f677670821acc79d5953abba0347cf26bcd8aa8503b34958727460f1a0a790a7d3a10afec96be4c32262188538c5d
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # PensioAPI
2
- This gem covers most of the Merchant and eCommerce API functionality provided by Pensio (http://www.pensio.com).
2
+ This gem covers most of the Merchant and eCommerce API functionality provided by AltaPay, formerly Pensio (https://altapay.com).
3
3
 
4
4
  ## Getting Started
5
5
 
@@ -16,7 +16,7 @@ module PensioAPI
16
16
  @credentials = PensioAPI::Credentials.for(@credentials.to_sym) unless @credentials.nil? || @credentials.is_a?(PensioAPI::Credentials)
17
17
  @credentials ||= PensioAPI::Credentials.default_credentials if PensioAPI::Credentials.credentials_mode == :default || PensioAPI::Credentials.allow_defaults
18
18
  raise Errors::NoCredentials unless @credentials && @credentials.supplied?
19
-
19
+
20
20
  self.class.base_uri @credentials.base_uri unless self.class.base_uri
21
21
 
22
22
  @response = self.class.post(path, request_options(options))
@@ -25,11 +25,14 @@ module PensioAPI
25
25
  private
26
26
 
27
27
  def request_options(options)
28
+ timeout = options.delete(:timeout)
28
29
  {
29
30
  basic_auth: auth,
30
31
  headers: (options.delete(:headers) || {}).merge(HEADERS),
31
32
  body: options
32
- }
33
+ }.tap do |request_options|
34
+ request_options[:timeout] = timeout if timeout
35
+ end
33
36
  end
34
37
 
35
38
  def auth
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'pensio_api'
3
- s.version = '0.3.1'
3
+ s.version = '0.3.2'
4
4
  s.license = 'BSD-3-Clause'
5
5
  s.summary = "Provides integration for the Pensio Merchant API"
6
6
  s.authors = ['Michael Sell', 'Rory Sinclair']
@@ -7,8 +7,16 @@ describe PensioAPI::Ecommerce do
7
7
  end
8
8
 
9
9
  describe '.create_payment_request' do
10
- let(:response) { PensioAPI::Ecommerce.create_payment_request(reservation_arguments) }
10
+ let(:response) { PensioAPI::Ecommerce.create_payment_request(reservation_arguments.merge({timeout: 10})) }
11
11
  it 'returns an instance of PensioAPI::Responses::GatewayURL' do
12
+ expect(PensioAPI::Request).to receive(:post).with("/merchant/API/createPaymentRequest",
13
+ { :basic_auth=>{:username=>"test_user", :password=>"password"},
14
+ :headers=>{"Content-Type"=>"application/x-www-form-urlencoded; charset=utf-8"},
15
+ :body=>{:terminal=>"Pensio Test Terminal",
16
+ :shop_orderid=>"Test Payment",
17
+ :amount=>123.45,
18
+ :currency=>"eur"},
19
+ :timeout=>10 }).and_call_original
12
20
  expect(response).to be_an_instance_of(PensioAPI::Responses::GatewayURL)
13
21
  end
14
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pensio_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Sell
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-09 00:00:00.000000000 Z
12
+ date: 2017-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec