paypal_merchant 0.1.1 → 0.1.3

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
  SHA1:
3
- metadata.gz: 7de8b132e2698f49aa368b98929c44433a6bfa14
4
- data.tar.gz: 3f1b5b0e05f606ef8185861bb364596f25e057fd
3
+ metadata.gz: 525209b3d94e1edef8873938cbb52f26ae0baf0a
4
+ data.tar.gz: c52236399ead147f6a7b912e1f907889128eeed1
5
5
  SHA512:
6
- metadata.gz: 085cf0ccd603a5eb91556c06a2f9644424bdc0478c5948e414f13ea3facf9eab80a1ac0c1ab4684a53d772345ebe03ada5de7b439114a1d0c3d567b32dc84534
7
- data.tar.gz: 7207dbcf47f03c94e15d6d481c96ecb110b98d3ff2259e0bee59ab9ba97a90a94ef10334c357ef21c27a3df0edb37a572a2dd8384e2ad98857f52f9cf0a6782c
6
+ metadata.gz: 8172ed6b61dd35e8b3432729de3b3e43d551a40ce033df1d6b5e6b05518b020d337a01d5a1af45eb8ae468496c25e12066e75b721ef816dde802265ba96e6623
7
+ data.tar.gz: 184087d78702861c852d06a8241982c9853166845c4272652ee1c3fce84de0b7d4ab0bfa1bc46bb1368013ee4327be4c3c4323186c400f4ccf0150627ca99617
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Zach Ohlgren
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -3,27 +3,37 @@
3
3
  A wrapper for PayPal's merchant-sdk-ruby library
4
4
 
5
5
 
6
- ## Configuration
6
+ ### Installation
7
7
 
8
- PayPal.configure {
9
- mode: "sandbox", # "live" or "sandbox"
10
- username: <PAYPAL-USERNAME>,
11
- password: <PAYPAL-PASSWORD>,
12
- signature: <PAYPAL-SIGNATURE>
13
- }
8
+ gem install paypal_merchant
14
9
 
15
10
 
16
- ## Examples
11
+ ### Configuration
12
+
13
+ PayPal.mode = "live" # default is "sandbox"
14
+ PayPal.username = PAYPAL_USERNAME
15
+ PayPal.password = PAYPAL_PASSWORD
16
+ PayPal.signature = PAYPAL_SIGNATURE
17
17
 
18
+ Or alternatively:
18
19
 
19
- # Checking your account balance
20
+ PayPal.configure do |config|
21
+ config.mode = "live"
22
+ config.username = PAYPAL_USERNAME
23
+ config.password = PAYPAL_PASSWORD
24
+ config.signature = PAYPAL_SIGNATURE
25
+ end
26
+
27
+
28
+ ### Examples
29
+
30
+ ##### Checking your account balance
20
31
  PayPal::Account.balance # => 4831023
21
32
 
22
- # Charging a credit card for $10
33
+ ##### Charging a credit card for $10
23
34
  charge = PayPal::Charge.create(amount: 1000, card: {number: 4222222222222, exp_month: 12, exp_year: 2018})
24
35
  charge.success? # => true
25
36
 
26
- # Transfer $20 to another PayPal account
37
+ ##### Transfer $20 to another PayPal account
27
38
  transfer = PayPal::Transfer.create(amount: 2000, email: "paypal-email@example.com")
28
- transfer.success? # => true
29
-
39
+ transfer.success? # => true
@@ -1,10 +1,10 @@
1
1
  module PayPal
2
2
  module Merchant
3
-
4
- def self.new
5
- PayPal.configure_sdk
6
- PayPal::SDK::Merchant.new
3
+ class << self
4
+ def new
5
+ PayPal.configure_sdk
6
+ PayPal::SDK::Merchant.new
7
+ end
7
8
  end
8
-
9
9
  end
10
10
  end
@@ -15,23 +15,20 @@ module PayPal
15
15
  @logger = PayPal::SDK::Core::Logging.logger
16
16
 
17
17
  class << self
18
+
18
19
  attr_accessor :mode, :logger, :client_id, :client_secret, :username, :password, :signature
19
- end
20
20
 
21
- def self.configure(options = {})
22
- @mode = options[:mode] || "sandbox"
23
- @client_id = options[:client_id]
24
- @client_secret = options[:client_secret]
25
- @username = options[:username]
26
- @password = options[:password]
27
- @signature = options[:signature]
28
- @logger = options[:logger]
29
- configure_sdk
21
+ def configure
22
+ yield self
23
+ configure_sdk
24
+ self
25
+ end
26
+
30
27
  end
31
28
 
32
29
  private
33
30
 
34
- def self.configure_sdk
31
+ def PayPal.configure_sdk
35
32
  PayPal::SDK::Core::Config.logger = @logger
36
33
  PayPal::SDK.configure(
37
34
  mode: @mode,
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'paypal_merchant'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.3'
4
4
  s.summary = "Wrapper for PayPal's merchant-sdk-ruby library"
5
5
  s.description = "Wrapper for PayPal's merchant-sdk-ruby library"
6
6
  s.homepage = "https://github.com/zohlgren/paypal_merchant"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypal_merchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Ohlgren
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-20 00:00:00.000000000 Z
11
+ date: 2013-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paypal-sdk-merchant
@@ -46,6 +46,7 @@ extra_rdoc_files: []
46
46
  files:
47
47
  - .gitignore
48
48
  - Gemfile
49
+ - LICENSE.txt
49
50
  - README.md
50
51
  - lib/paypal/account.rb
51
52
  - lib/paypal/charge.rb