Skip to content

Commit eef1ee4

Browse files
author
Aman Aalam
authored
Merge pull request #56 from PaymentRails/dev
[DEVREL-11] Ruby SDK Gap Updates
2 parents d93bfa7 + b68d6fa commit eef1ee4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+950
-743
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ rdoc
33
*.gem
44
tags
55
.rvmrc
6-
Gemfile.lock
76
.idea
87
.bundle
98
vendor

.rubocop.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ inherit_from: .rubocop_todo.yml
33
# This basically enshrines existing intentional styles
44

55
AllCops:
6-
TargetRubyVersion: 2.4
6+
TargetRubyVersion: 2.7
77

88
Layout/EmptyLineAfterGuardClause:
99
Enabled: false
@@ -19,3 +19,6 @@ Style/CaseEquality:
1919

2020
Style/Documentation:
2121
Enabled: false
22+
23+
Naming/MethodName:
24+
Enabled: false

.rubocop_todo.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
# SupportedStyles: around, only_before
1313
Layout/EmptyLinesAroundAccessModifier:
1414
Exclude:
15-
- 'lib/paymentrails/Client.rb'
15+
- 'lib/trolley/Client.rb'
1616

1717
# Offense count: 2
1818
# Cop supports --auto-correct.
1919
# Configuration parameters: EnforcedStyle.
2020
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
2121
Layout/EmptyLinesAroundClassBody:
2222
Exclude:
23-
- 'lib/paymentrails/Configuration.rb'
24-
- 'lib/paymentrails/gateways/BalanceGateway.rb'
23+
- 'lib/trolley/Configuration.rb'
24+
- 'lib/trolley/gateways/BalanceGateway.rb'
2525

2626
# Offense count: 1
2727
# Cop supports --auto-correct.
2828
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
2929
Layout/ExtraSpacing:
3030
Exclude:
31-
- 'lib/paymentrails/gateways/BalanceGateway.rb'
31+
- 'lib/trolley/gateways/BalanceGateway.rb'
3232

3333
# Offense count: 2
3434
# Cop supports --auto-correct.
@@ -38,21 +38,21 @@ Layout/ExtraSpacing:
3838
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
3939
Layout/HashAlignment:
4040
Exclude:
41-
- 'lib/paymentrails/Client.rb'
41+
- 'lib/trolley/Client.rb'
4242

4343
# Offense count: 10
4444
# Cop supports --auto-correct.
4545
# Configuration parameters: Width, IgnoredPatterns.
4646
Layout/IndentationWidth:
4747
Exclude:
48-
- 'lib/paymentrails/Client.rb'
49-
- 'lib/paymentrails/Exceptions.rb'
48+
- 'lib/trolley/Client.rb'
49+
- 'lib/trolley/Exceptions.rb'
5050

5151
# Offense count: 1
5252
# Cop supports --auto-correct.
5353
Layout/SpaceBeforeComma:
5454
Exclude:
55-
- 'lib/paymentrails/Client.rb'
55+
- 'lib/trolley/Client.rb'
5656

5757
# Offense count: 2
5858
# Cop supports --auto-correct.
@@ -61,23 +61,23 @@ Layout/SpaceBeforeComma:
6161
# SupportedStylesForEmptyBraces: space, no_space
6262
Layout/SpaceInsideHashLiteralBraces:
6363
Exclude:
64-
- 'lib/paymentrails/Client.rb'
64+
- 'lib/trolley/Client.rb'
6565

6666
# Offense count: 1
6767
# Cop supports --auto-correct.
6868
# Configuration parameters: EnforcedStyle.
6969
# SupportedStyles: space, no_space
7070
Layout/SpaceInsideParens:
7171
Exclude:
72-
- 'lib/paymentrails/gateways/BalanceGateway.rb'
72+
- 'lib/trolley/gateways/BalanceGateway.rb'
7373

7474
# Offense count: 3
7575
# Cop supports --auto-correct.
7676
# Configuration parameters: IndentationWidth.
77-
Layout/Tab:
77+
Layout/IndentationStyle:
7878
Exclude:
79-
- 'lib/paymentrails/Batch.rb'
80-
- 'lib/paymentrails/RecipientAccount.rb'
79+
- 'lib/trolley/Batch.rb'
80+
- 'lib/trolley/RecipientAccount.rb'
8181

8282
# Offense count: 1
8383
# Cop supports --auto-correct.
@@ -90,7 +90,7 @@ Layout/TrailingWhitespace:
9090
# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
9191
Lint/UselessAccessModifier:
9292
Exclude:
93-
- 'lib/paymentrails/Client.rb'
93+
- 'lib/trolley/Client.rb'
9494

9595
# Offense count: 11
9696
Metrics/AbcSize:
@@ -119,23 +119,23 @@ Naming/BlockParameterName:
119119
# SupportedStyles: snake_case, camelCase
120120
Naming/MethodName:
121121
Exclude:
122-
- 'lib/paymentrails/Configuration.rb'
122+
- 'lib/trolley/Configuration.rb'
123123

124124
# Offense count: 8
125125
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
126126
# AllowedNames: io, id, to, by, on, in, at, ip, db, os
127127
Naming/MethodParameterName:
128128
Exclude:
129-
- 'lib/paymentrails/Client.rb'
130-
- 'lib/paymentrails/Configuration.rb'
129+
- 'lib/trolley/Client.rb'
130+
- 'lib/trolley/Configuration.rb'
131131

132132
# Offense count: 1
133133
# Cop supports --auto-correct.
134134
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
135135
# SupportedStyles: assign_to_condition, assign_inside_condition
136136
Style/ConditionalAssignment:
137137
Exclude:
138-
- 'lib/paymentrails/gateways/OfflinePaymentGateway.rb'
138+
- 'lib/trolley/gateways/OfflinePaymentGateway.rb'
139139

140140
# Offense count: 1
141141
# Cop supports --auto-correct.
@@ -154,14 +154,14 @@ Style/FrozenStringLiteralComment:
154154
# Cop supports --auto-correct.
155155
Style/IfUnlessModifier:
156156
Exclude:
157-
- 'lib/paymentrails/Client.rb'
157+
- 'lib/trolley/Client.rb'
158158

159159
# Offense count: 1
160160
# Cop supports --auto-correct.
161161
# Configuration parameters: AllowMultipleReturnValues.
162162
Style/RedundantReturn:
163163
Exclude:
164-
- 'lib/paymentrails.rb'
164+
- 'lib/trolley.rb'
165165

166166
# Offense count: 1
167167
# Cop supports --auto-correct.
@@ -177,7 +177,7 @@ Style/SpecialGlobalVars:
177177
Style/StringLiterals:
178178
Exclude:
179179
- 'Gemfile'
180-
- 'lib/paymentrails/Client.rb'
180+
- 'lib/trolley/Client.rb'
181181
- 'paymentrails.gemspec'
182182

183183
# Offense count: 49

Gemfile.lock

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
PATH
2+
remote: .
3+
specs:
4+
trolley (1.0.0)
5+
6+
GEM
7+
remote: https://rubygems.org/
8+
specs:
9+
ast (2.4.2)
10+
dotenv (2.8.1)
11+
json (2.6.3)
12+
parallel (1.22.1)
13+
parser (3.2.2.0)
14+
ast (~> 2.4.1)
15+
power_assert (2.0.3)
16+
rainbow (3.1.1)
17+
rake (13.0.6)
18+
regexp_parser (2.7.0)
19+
rexml (3.2.5)
20+
rubocop (1.49.0)
21+
json (~> 2.3)
22+
parallel (~> 1.10)
23+
parser (>= 3.2.0.0)
24+
rainbow (>= 2.2.2, < 4.0)
25+
regexp_parser (>= 1.8, < 3.0)
26+
rexml (>= 3.2.5, < 4.0)
27+
rubocop-ast (>= 1.28.0, < 2.0)
28+
ruby-progressbar (~> 1.7)
29+
unicode-display_width (>= 2.4.0, < 3.0)
30+
rubocop-ast (1.28.0)
31+
parser (>= 3.2.1.0)
32+
ruby-progressbar (1.13.0)
33+
test-unit (3.5.7)
34+
power_assert
35+
unicode-display_width (2.4.2)
36+
37+
PLATFORMS
38+
x86_64-linux
39+
40+
DEPENDENCIES
41+
dotenv (~> 2)
42+
rake (~> 13)
43+
rubocop (~> 1)
44+
test-unit (~> 3)
45+
trolley!
46+
47+
BUNDLED WITH
48+
2.3.22

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
# Trolley Ruby SDK (Previously Payment Rails[^1])
1+
# Trolley Ruby SDK
22

33
[![Latest Stable Version](https://poser.pugx.org/paymentrails/ruby-sdk/v/stable.png)](https://packagist.org/packages/paymentrails/ruby-sdk)
44

55
The Trolley Ruby SDK provides integration access to the Trolley API.
66

7-
[^1]: [Payment Rails is now Trolley](https://www.trolley.com/payment-rails-is-now-trolley-series-a). We're in the process of updating our SDKs to support the new domain. In this transition phase, you might still see "PaymentRails" at some places.
8-
97
## Requirements
108

119
Ruby version >= 2.4 is required.
@@ -16,7 +14,7 @@ Bundler is required.
1614
### Install the Gem
1715

1816
```bash
19-
gem install paymentrails
17+
gem install trolley
2018
```
2119

2220
## Installation & Usage (Git)
@@ -32,8 +30,8 @@ git clone https://github.com/PaymentRails/ruby-sdk.git
3230
```bash
3331
cd ruby-sdk
3432
bundler install
35-
gem build paymentrails.gemspec
36-
gem install paymentrails-[version].gem
33+
gem build trolley.gemspec
34+
gem install trolley-[version].gem
3735
```
3836

3937
### Running Tests
@@ -49,20 +47,24 @@ bundle exec ruby spec/integration/RecipientTest.rb
4947

5048
## Getting Started
5149

52-
```Ruby
53-
54-
require 'paymentrails'
50+
```ruby
51+
require 'trolley'
5552

56-
client = PaymentRails.client('YOUR-API-KEY', 'YOUR-SECRET-KEY')
53+
client = Trolley.client('ACCESS-KEY', 'SECRET-KEY')
5754

5855
recipient = client.recipient.find('R-1234567abcdefg')
5956
print recipient.id
6057
```
6158

62-
#### Need a proxy?
59+
#### Configuring a proxy
6360

6461
```Ruby
65-
client = PaymentRails.client('YOUR-API-KEY', 'YOUR-SECRET-KEY', 'production', proxy_uri: 'peter_the_proxy.com')
62+
client = Trolley.client('ACCESS-KEY', 'SECRET-KEY', proxy_uri: 'peter_the_proxy.com')
63+
```
64+
65+
### Configuring a custom base API URL
66+
```ruby
67+
client = Trolley.client('key', 'secret', api_base: 'https://api.railz.io')
6668
```
6769

6870
## Documentation for API Endpoints

lib/paymentrails.rb

Lines changed: 0 additions & 30 deletions
This file was deleted.

lib/paymentrails/Configuration.rb

Lines changed: 0 additions & 48 deletions
This file was deleted.

lib/paymentrails/Exceptions.rb

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)