paymentrails 0.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Batch.rb +2 -2
- data/lib/Client.rb +1 -1
- data/lib/Configuration.rb +5 -4
- data/lib/Payment.rb +2 -2
- data/lib/RecipientAccount.rb +2 -2
- data/lib/paymentrails.rb +33 -2
- data/paymentrails.gemspec +4 -4
- data/spec/integration/BatchTest.rb +2 -7
- data/spec/integration/RecipientTest.rb +2 -2
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f10dfe6a1de6364a6f4cd84fcd70379e5e82fb8a9d3deee9fe8568f98f775386
|
4
|
+
data.tar.gz: 05bb3e71ac29f285430f7713fb126347b1f60159eb62272ff1504dc80251155c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86e87a2dff1c9a22b00532315b6f9ab97206afb7703ae2f81d5433a5e1769e22fe03af3182575acdc34a1c2ef9128cf287ccb36a4d622d1a614bfd8513c02d10
|
7
|
+
data.tar.gz: e78456012f1203d16b952307b5a32ce4e6c516c015bce003f18d922afc8c4937a2073b28ad4765de8351ee5467b9b3fd1c0fdb54d4265a1d5c6b7161334fe353
|
data/lib/Batch.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
class Batch
|
2
|
-
attr_accessor :id, :amount, :completedAt, :createdAt, :currency, :description, :sentAt, :status, :totalPayments, :updatedAt, :quoteExpiredAt, :payments
|
3
|
-
attr_writer :id, :amount, :completedAt, :createdAt, :currency, :description, :sentAt, :status, :totalPayments, :updatedAt, :quoteExpiredAt, :payments
|
2
|
+
attr_accessor :id, :amount, :completedAt, :createdAt, :currency, :description, :sentAt, :status, :totalPayments, :updatedAt, :quoteExpiredAt, :payments, :tags, :coverFees
|
3
|
+
attr_writer :id, :amount, :completedAt, :createdAt, :currency, :description, :sentAt, :status, :totalPayments, :updatedAt, :quoteExpiredAt, :payments, :tags, :coverFees
|
4
4
|
end
|
data/lib/Client.rb
CHANGED
data/lib/Configuration.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
class Configuration
|
2
|
-
|
2
|
+
|
3
|
+
def initialize(publicKey, privateKey, environment = 'production')
|
3
4
|
@publicKey = publicKey
|
4
5
|
@privateKey = privateKey
|
5
|
-
@apiBase =
|
6
|
+
@apiBase = set_environment(environment)
|
6
7
|
end
|
7
8
|
|
8
|
-
def
|
9
|
+
def set_environment(apiBase)
|
9
10
|
case apiBase
|
10
11
|
when 'production'
|
11
12
|
'https://api.paymentrails.com'
|
12
13
|
when 'development'
|
13
|
-
'
|
14
|
+
'https://api.railz.io'
|
14
15
|
when 'integration'
|
15
16
|
'http://api.local.dev:3000'
|
16
17
|
else
|
data/lib/Payment.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
class Payment
|
2
|
-
|
3
|
-
|
2
|
+
attr_writer :id, :status, :isSupplyPayment, :returnedAmount, :sourceAmount, :sourceCurrency, :targetAmount, :targetCurrency, :exchangeRate, :fees, :recipientFees, :fxRate, :memo, :externalId, :processedAt, :createdAt, :updatedAt, :merchantFees, :compliance, :payoutMethod, :recipient, :withholdingAmount, :withholdingCurrency, :equivalentWithholdingAmount, :equivalentWithholdingCurrency, :methodDisplay, :batch, :coverFees, :category, :amount, :currency, :taxReportable, :taxBasisAmount, :taxBasisCurrency, :tags, :account, :initiatedAt, :settledAt, :returnedAt, :failureMessage, :merchantId
|
3
|
+
attr_reader :id, :status, :isSupplyPayment, :returnedAmount, :sourceAmount, :sourceCurrency, :targetAmount, :targetCurrency, :exchangeRate, :fees, :recipientFees, :fxRate, :memo, :externalId, :processedAt, :createdAt, :updatedAt, :merchantFees, :compliance, :payoutMethod, :recipient, :withholdingAmount, :withholdingCurrency, :equivalentWithholdingAmount, :equivalentWithholdingCurrency, :methodDisplay, :batch, :coverFees, :category, :amount, :currency, :taxReportable, :taxBasisAmount, :taxBasisCurrency, :tags, :account, :initiatedAt, :settledAt, :returnedAt, :failureMessage, :merchantId
|
4
4
|
end
|
data/lib/RecipientAccount.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
class RecipientAccount
|
2
|
-
attr_accessor :id, :primary, :currency, :recipientAccountId, :routeType, :recipientFees, :emailAddress, :country, :type, :iban, :accountNum, :accountHolderName, :swiftBic, :branchId, :bankId, :bankName, :bankAddress, :bankCity, :bankRegionCode, :bankPostalCode, :status, :disabledAt
|
3
|
-
attr_writer :id, :primary, :currency, :recipientAccountId, :routeType, :recipientFees, :emailAddress, :country, :type, :iban, :accountNum, :accountHolderName, :swiftBic, :branchId, :bankId, :bankName, :bankAddress, :bankCity, :bankRegionCode, :bankPostalCode, :status, :disabledAt
|
2
|
+
attr_accessor :id, :primary, :currency, :recipientAccountId, :recipientId, :recipientReferenceId, :routeType, :recipientFees, :emailAddress, :country, :type, :iban, :accountNum, :accountHolderName, :swiftBic, :branchId, :bankId, :bankName, :bankAddress, :bankCity, :bankRegionCode, :bankPostalCode, :status, :disabledAt
|
3
|
+
attr_writer :id, :primary, :currency, :recipientAccountId, :recipientId, :recipientReferenceId, :routeType, :recipientFees, :emailAddress, :country, :type, :iban, :accountNum, :accountHolderName, :swiftBic, :branchId, :bankId, :bankName, :bankAddress, :bankCity, :bankRegionCode, :bankPostalCode, :status, :disabledAt
|
4
4
|
end
|
data/lib/paymentrails.rb
CHANGED
@@ -1,2 +1,33 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
class PaymentRails
|
2
|
+
attr_reader :recipient
|
3
|
+
attr_writer :recipient
|
4
|
+
|
5
|
+
attr_reader :recipient_account
|
6
|
+
attr_writer :recipient_account
|
7
|
+
|
8
|
+
attr_reader :batch
|
9
|
+
attr_writer :batch
|
10
|
+
|
11
|
+
attr_reader :payment
|
12
|
+
attr_writer :payment
|
13
|
+
|
14
|
+
attr_reader :balance
|
15
|
+
attr_writer :balance
|
16
|
+
|
17
|
+
def initialize(key, secret, environment = 'production')
|
18
|
+
load 'Configuration.rb'
|
19
|
+
load 'Gateway.rb'
|
20
|
+
|
21
|
+
client = Gateway.new(Configuration.new(key, secret, environment))
|
22
|
+
@recipient = client.recipient
|
23
|
+
@recipient_account = client.recipient_account
|
24
|
+
@batch = client.batch
|
25
|
+
@payment = client.payment
|
26
|
+
@balance = client.balance
|
27
|
+
|
28
|
+
# to avoid overriding potential global Configuration & Gateway
|
29
|
+
Object.send(:remove_const, :Gateway)
|
30
|
+
Object.send(:remove_const, :Configuration)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
data/paymentrails.gemspec
CHANGED
@@ -4,12 +4,12 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.name = "paymentrails"
|
5
5
|
s.summary = "PaymentRails Ruby SDK"
|
6
6
|
s.description = "Ruby SDK for interacting with the PaymentRails API"
|
7
|
-
s.version = '0.1'
|
7
|
+
s.version = '0.1.2'
|
8
8
|
s.homepage = 'https://www.paymentrails.com/'
|
9
|
-
s.email = 'jesse.silber@paymentrails.com'
|
9
|
+
s.email = ['jesse.silber@paymentrails.com', 'joshua@paymentrails.com']
|
10
10
|
s.license = "MIT"
|
11
11
|
s.author = "PaymentRails"
|
12
12
|
s.has_rdoc = false
|
13
13
|
s.files = Dir.glob ["README.rdoc", "LICENSE", "lib/**/*.{rb,crt}", "spec/**/*", "*.gemspec"]
|
14
|
-
s.add_dependency "rest-client", "
|
15
|
-
end
|
14
|
+
s.add_dependency "rest-client", ">= 2.0.0"
|
15
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
Dir['../../lib
|
1
|
+
Dir[File.join(__dir__, '../../lib', '*.rb')].each { |file| require file }
|
2
2
|
require 'test/unit'
|
3
3
|
require 'securerandom'
|
4
4
|
|
5
5
|
class BatchTest < Test::Unit::TestCase
|
6
6
|
def setup
|
7
|
-
@client = Gateway.new(Configuration.new('YOUR-API-KEY', 'YOUR-API-SECRET'
|
7
|
+
@client = Gateway.new(Configuration.new('YOUR-API-KEY', 'YOUR-API-SECRET'))
|
8
8
|
end
|
9
9
|
|
10
10
|
def create_recipient
|
@@ -25,11 +25,6 @@ class BatchTest < Test::Unit::TestCase
|
|
25
25
|
recipient
|
26
26
|
end
|
27
27
|
|
28
|
-
def test_all
|
29
|
-
batch = @client.batch.all
|
30
|
-
assert_true(batch.count > 0)
|
31
|
-
end
|
32
|
-
|
33
28
|
def test_create
|
34
29
|
batch = @client.batch.create(sourceCurrency: 'USD', description: 'Integration Test Create')
|
35
30
|
assert_not_nil(batch)
|
@@ -1,10 +1,10 @@
|
|
1
|
-
Dir['../../lib
|
1
|
+
Dir[File.join(__dir__, '../../lib', '*.rb')].each { |file| require file }
|
2
2
|
require 'test/unit'
|
3
3
|
require 'securerandom'
|
4
4
|
|
5
5
|
class RecipientTest < Test::Unit::TestCase
|
6
6
|
def setup
|
7
|
-
@client = Gateway.new(Configuration.new('YOUR-API-KEY', 'YOUR-API-SECRET'
|
7
|
+
@client = Gateway.new(Configuration.new('YOUR-API-KEY', 'YOUR-API-SECRET'))
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_create
|
metadata
CHANGED
@@ -1,31 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paymentrails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PaymentRails
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0.
|
19
|
+
version: 2.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.0.
|
26
|
+
version: 2.0.0
|
27
27
|
description: Ruby SDK for interacting with the PaymentRails API
|
28
|
-
email:
|
28
|
+
email:
|
29
|
+
- jesse.silber@paymentrails.com
|
30
|
+
- joshua@paymentrails.com
|
29
31
|
executables: []
|
30
32
|
extensions: []
|
31
33
|
extra_rdoc_files: []
|