Skip to content

Commit 760e1ea

Browse files
committed
Syntax highlight [ci skip]
1 parent 6d71f91 commit 760e1ea

File tree

1 file changed

+47
-33
lines changed

1 file changed

+47
-33
lines changed

README.md

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,78 @@ The PayPal REST SDK provides Ruby APIs to create, process and manage payment.
66

77
Add this line to your application's Gemfile:
88

9-
gem 'paypal-sdk-rest'
10-
11-
# gem 'paypal-sdk-core', :git => "https://github.com/paypal/sdk-core-ruby.git"
12-
# gem 'paypal-sdk-rest', :git => "https://github.com/paypal/rest-api-sdk-ruby.git"
9+
```ruby
10+
gem 'paypal-sdk-rest'
11+
```
1312

1413
And then execute:
1514

16-
$ bundle
15+
```sh
16+
$ bundle
17+
```
1718

1819
Or install it yourself as:
1920

20-
$ gem install paypal-sdk-rest
21+
```sh
22+
$ gem install paypal-sdk-rest
23+
```
2124

2225
## Configuration
2326

2427
For Rails application:
2528

26-
rails g paypal:sdk:install
29+
```sh
30+
rails g paypal:sdk:install
31+
```
2732

2833
For other ruby application, create a configuration file(`config/paypal.yml`):
2934

30-
development: &default
31-
client_id: EBWKjlELKMYqRNQ6sYvFo64FtaRLRR5BdHEESmha49TM
32-
client_secret: EO422dn3gQLgDbuwqTjzrFgFtaRLRR5BdHEESmha49TM
33-
mode: sandbox
34-
# # with Proxy
35-
# http_proxy: http://proxy-ipaddress:3129/
36-
# # with CA File
37-
# ssl_options:
38-
# ca_file: config/cacert.pem
39-
# # Override Endpoint
40-
# rest_endpoint: https://api.sandbox.paypal.com
41-
test:
42-
<<: *default
43-
production:
44-
<<: *default
45-
mode: live
35+
```yaml
36+
development: &default
37+
mode: sandbox
38+
client_id: EBWKjlELKMYqRNQ6sYvFo64FtaRLRR5BdHEESmha49TM
39+
client_secret: EO422dn3gQLgDbuwqTjzrFgFtaRLRR5BdHEESmha49TM
40+
# # with Proxy
41+
# http_proxy: http://proxy-ipaddress:3129/
42+
# # with CA File
43+
# ssl_options:
44+
# ca_file: config/cacert.pem
45+
# # Override Endpoint
46+
# rest_endpoint: https://api.sandbox.paypal.com
47+
test:
48+
<<: *default
49+
production:
50+
mode: live
51+
client_id: CLIENT_ID
52+
client_secret: CLIENT_SECRET
53+
```
4654
4755
4856
Load Configurations from specified file:
4957
50-
PayPal::SDK::Core::Config.load('spec/config/paypal.yml', ENV['RACK_ENV'] || 'development')
58+
```ruby
59+
PayPal::SDK::Core::Config.load('spec/config/paypal.yml', ENV['RACK_ENV'] || 'development')
60+
```
5161

5262
Without configuration file:
5363

54-
PayPal::SDK::REST.set_config(
55-
:client_id => "EBWKjlELKMYqRNQ6sYvFo64FtaRLRR5BdHEESmha49TM",
56-
:client_secret => "EO422dn3gQLgDbuwqTjzrFgFtaRLRR5BdHEESmha49TM",
57-
:mode => "sandbox", # "sandbox" or "live"
58-
:ssl_options => { } )
64+
```ruby
65+
PayPal::SDK::REST.set_config(
66+
:client_id => "EBWKjlELKMYqRNQ6sYvFo64FtaRLRR5BdHEESmha49TM",
67+
:client_secret => "EO422dn3gQLgDbuwqTjzrFgFtaRLRR5BdHEESmha49TM",
68+
:mode => "sandbox", # "sandbox" or "live"
69+
:ssl_options => { } )
70+
```
5971

6072
Override configuration:
6173

62-
# Class level
63-
Payment.set_config( :client_id => "123" )
74+
```ruby
75+
# Class level
76+
Payment.set_config( :client_id => "123" )
6477

65-
# Object level
66-
payment.set_config( :client_id => "123" )
78+
# Object level
79+
payment.set_config( :client_id => "123" )
80+
```
6781

6882

6983
## Create Payment

0 commit comments

Comments
 (0)