pensio_api 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/pensio_api/mixins/request_defaults.rb +5 -2
- data/pensio_api.gemspec +1 -1
- data/spec/lib/pensio_api/ecommerce_spec.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a349b03c409fbe6ae2137f01fb3d64e945eed4ee
|
4
|
+
data.tar.gz: 1f77f414fa01c965b580938dbd56e7552adc9511
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 (
|
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
|
data/pensio_api.gemspec
CHANGED
@@ -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.
|
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:
|
12
|
+
date: 2017-03-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|