paymentrails 0.2.11 → 0.2.13

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
  SHA256:
3
- metadata.gz: 59d9150dfe0a7a84e065382411e1292d84f1cb38849030cb5c0092b14140b446
4
- data.tar.gz: 194760ae4ab55031b06e7a128dfb07b43daf23a2e05c197b110250c3e19b31b8
3
+ metadata.gz: fd7551b6de204f7991607d447b9241e4290311219fa06a37a8b5b8a9e6f096e9
4
+ data.tar.gz: 90424f25c26b34259822b231fd2dd305a5e36abc34238c0cc9b35d8e050cee5e
5
5
  SHA512:
6
- metadata.gz: 10d565665437161d12562b22d9d6dc1a8b20318e10451b6d28f5cb4ce537a60471a60a0df764799127285aaf2517d2c6cfdb1232d6d84506debe804cb120216c
7
- data.tar.gz: a826f2f439e18f091a6a1459065d8151ebaeb928986b5f708ae09f3b2c2f3948988685a318cf681a99c9543e153ef77f6200a3236354845dd40ed099c96bc088
6
+ metadata.gz: ec224331246bb9918c8e4606d57498076482172fdf6f2b8ce40324e32c6e30c57eb5ac4a9a2827afb514c3622f61f41c8c40a353feea2c8ecbf838998fb306e6
7
+ data.tar.gz: c7deb1a7472af9712d25f112719b51ce0b2562746a0103e45e147d0505e2a8eda5ace15ff8245591e5f9601618cc5b0eefff6fd4da4035ee825f318a0d159720
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017 Payment Rails, Inc.
1
+ Copyright (c) 2017 Trolley, Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person
4
4
  obtaining a copy of this software and associated documentation
@@ -4,6 +4,7 @@ require 'net/http'
4
4
  require 'openssl'
5
5
  require 'uri'
6
6
  require 'json'
7
+ require "rubygems"
7
8
 
8
9
  module PaymentRails
9
10
  class Client
@@ -39,11 +40,14 @@ module PaymentRails
39
40
  )
40
41
  http.use_ssl = @config.useSsl?
41
42
 
43
+ spec = Gem::Specification.load("paymentrails.gemspec")
44
+
42
45
  time = Time.now.to_i
43
46
  headers = {'X-PR-Timestamp': time.to_s,
44
47
  'Authorization': generate_authorization(time, endPoint, method, body),
45
- 'Content-Type': 'application/json'}
46
-
48
+ 'Content-Type': 'application/json',
49
+ 'Trolley-Source': "ruby-sdk_#{spec.version}"}
50
+
47
51
  if method === "GET"
48
52
  request = Net::HTTP::Get.new(uri.request_uri, headers)
49
53
  elsif method === "POST"
@@ -19,13 +19,13 @@ module PaymentRails
19
19
  def apiBase
20
20
  case environment
21
21
  when 'production'
22
- 'https://api.paymentrails.com'
22
+ 'https://api.trolley.com'
23
23
  when 'development'
24
24
  'https://api.railz.io'
25
25
  when 'integration'
26
26
  'http://api.local.dev:3000'
27
27
  else
28
- 'https://api.paymentrails.com'
28
+ 'https://api.trolley.com'
29
29
  end
30
30
  end
31
31
 
@@ -2,6 +2,7 @@ module PaymentRails
2
2
  class Recipient
3
3
  attr_accessor(
4
4
  :id,
5
+ :routeMinimum,
5
6
  :routeType,
6
7
  :estimatedFees,
7
8
  :referenceId,
@@ -15,6 +16,7 @@ module PaymentRails
15
16
  :language,
16
17
  :complianceStatus,
17
18
  :dob,
19
+ :contactEmails,
18
20
  :passport,
19
21
  :updatedAt,
20
22
  :createdAt,
@@ -5,7 +5,8 @@ module PaymentRails
5
5
  begin
6
6
  klass_instance.send("#{k}=", v)
7
7
  rescue NoMethodError
8
- warn "[PaymentRails] Unknown attribute #{k} for class #{klass_instance.class.name}"
8
+ # TODO: The API is showing non-public attributes, once we remove them from the API response we can re-add this warning.
9
+ # warn "[PaymentRails] Unknown attribute #{k} for class #{klass_instance.class.name}"
9
10
  end
10
11
  end
11
12
 
data/paymentrails.gemspec CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.name = "paymentrails"
5
5
  s.summary = "Trolley Ruby SDK"
6
6
  s.description = "Ruby SDK for interacting with the Trolley API"
7
- s.version = '0.2.11'
7
+ s.version = '0.2.13'
8
8
  s.homepage = 'https://trolley.com/'
9
9
  s.email = ['developer-tools@trolley.com']
10
10
  s.license = "MIT"
@@ -67,6 +67,7 @@ class RecipientTest < Test::Unit::TestCase
67
67
  assert_equal(recipient.firstName, 'Tom')
68
68
  assert_equal(recipient.lastName, 'Jones')
69
69
  assert_not_nil(recipient.id)
70
+ assert_true(recipient.routeMinimum.to_i >= 0)
70
71
 
71
72
  account = @client.recipient_account.create(recipient.id, type: 'bank-transfer', currency: 'EUR', country: 'DE', iban: 'DE89 3704 0044 0532 0130 00')
72
73
  assert_not_nil(account)
@@ -22,9 +22,9 @@ class ConfigurationTest < Test::Unit::TestCase
22
22
 
23
23
  def test_api_base
24
24
  assert_equal 'http://api.local.dev:3000', PaymentRails::Configuration.new('key', 'secret', 'integration').apiBase
25
- assert_equal 'https://api.paymentrails.com', PaymentRails::Configuration.new('key', 'secret', 'production').apiBase
25
+ assert_equal 'https://api.trolley.com', PaymentRails::Configuration.new('key', 'secret', 'production').apiBase
26
26
  assert_equal 'https://api.railz.io', PaymentRails::Configuration.new('key', 'secret', 'development').apiBase
27
- assert_equal 'https://api.paymentrails.com', PaymentRails::Configuration.new('key', 'secret', 'non_standard_environment').apiBase
27
+ assert_equal 'https://api.trolley.com', PaymentRails::Configuration.new('key', 'secret', 'non_standard_environment').apiBase
28
28
  end
29
29
 
30
30
  def test_use_ssl?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paymentrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - PaymentRails
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-17 00:00:00.000000000 Z
11
+ date: 2023-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.1.2
127
+ rubygems_version: 3.2.3
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Trolley Ruby SDK