paypal_merchant 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c8c08a3a6da70bf676050217f423daa8b77f192
4
- data.tar.gz: 0804cef478ae29a8dd9feb7de344b0c9a804e98b
3
+ metadata.gz: 7de8b132e2698f49aa368b98929c44433a6bfa14
4
+ data.tar.gz: 3f1b5b0e05f606ef8185861bb364596f25e057fd
5
5
  SHA512:
6
- metadata.gz: 59ebde17a53294cb03fabcac23d3323b23b6da731c3d3901681bf7069e83de5e271e0aac9502b2ef96628aab39356a38718cf7982a80a3338516add8297b56a9
7
- data.tar.gz: 713711c463e1b748229577b77966c8cc2bbc4693a6e3dd97d6201216d6729f3da5d94ca9a034bc5cdfcdceed19c4b967ad76aa734e35867265d257df2a555672
6
+ metadata.gz: 085cf0ccd603a5eb91556c06a2f9644424bdc0478c5948e414f13ea3facf9eab80a1ac0c1ab4684a53d772345ebe03ada5de7b439114a1d0c3d567b32dc84534
7
+ data.tar.gz: 7207dbcf47f03c94e15d6d481c96ecb110b98d3ff2259e0bee59ab9ba97a90a94ef10334c357ef21c27a3df0edb37a572a2dd8384e2ad98857f52f9cf0a6782c
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ /paypal_merchant-*.gem
2
+ /Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # paypal_merchant
2
+
3
+ A wrapper for PayPal's merchant-sdk-ruby library
4
+
5
+
6
+ ## Configuration
7
+
8
+ PayPal.configure {
9
+ mode: "sandbox", # "live" or "sandbox"
10
+ username: <PAYPAL-USERNAME>,
11
+ password: <PAYPAL-PASSWORD>,
12
+ signature: <PAYPAL-SIGNATURE>
13
+ }
14
+
15
+
16
+ ## Examples
17
+
18
+
19
+ # Checking your account balance
20
+ PayPal::Account.balance # => 4831023
21
+
22
+ # Charging a credit card for $10
23
+ charge = PayPal::Charge.create(amount: 1000, card: {number: 4222222222222, exp_month: 12, exp_year: 2018})
24
+ charge.success? # => true
25
+
26
+ # Transfer $20 to another PayPal account
27
+ transfer = PayPal::Transfer.create(amount: 2000, email: "paypal-email@example.com")
28
+ transfer.success? # => true
29
+
data/lib/paypal/charge.rb CHANGED
@@ -2,7 +2,7 @@ module PayPal
2
2
  class Charge
3
3
  include PayPal::Merchant::DoDirectPayment
4
4
 
5
- attr_accessor :response
5
+ attr_accessor :response, :amount, :card
6
6
 
7
7
 
8
8
  class << self
@@ -13,9 +13,9 @@ module PayPal
13
13
 
14
14
 
15
15
  def initialize(params = {})
16
- amount, card = params[:amount], params[:card]
17
- if amount && card
18
- @response = charge(amount, card, params)
16
+ @amount, @card = params[:amount], params[:card]
17
+ if @amount && @card
18
+ @response = charge(@amount, @card, params)
19
19
  else
20
20
  raise "You must provide an amount and credit card"
21
21
  end
@@ -2,7 +2,7 @@ module PayPal
2
2
  class Transfer
3
3
  include PayPal::Merchant::MassPay
4
4
 
5
- attr_accessor :response
5
+ attr_accessor :response, :amount, :email
6
6
 
7
7
  class << self
8
8
  def create(params = {})
@@ -12,9 +12,9 @@ module PayPal
12
12
 
13
13
 
14
14
  def initialize(params = {})
15
- amount, email = params[:amount], params[:email]
16
- if amount && email
17
- @response = self.transfer(amount, email, params)
15
+ @amount, @email = params[:amount], params[:email]
16
+ if @amount && @email
17
+ @response = self.transfer(@amount, @email, params)
18
18
  else
19
19
  raise "You must provide an amount and a recipient email address."
20
20
  end
@@ -1,8 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'paypal_merchant'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
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
+ s.homepage = "https://github.com/zohlgren/paypal_merchant"
6
7
  s.authors = ["Zach Ohlgren"]
7
8
  s.email = 'zach@ohlgren.me'
8
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypal_merchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Ohlgren
@@ -44,6 +44,9 @@ executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
+ - .gitignore
48
+ - Gemfile
49
+ - README.md
47
50
  - lib/paypal/account.rb
48
51
  - lib/paypal/charge.rb
49
52
  - lib/paypal/merchant.rb
@@ -53,7 +56,7 @@ files:
53
56
  - lib/paypal/transfer.rb
54
57
  - lib/paypal_merchant.rb
55
58
  - paypal_merchant.gemspec
56
- homepage:
59
+ homepage: https://github.com/zohlgren/paypal_merchant
57
60
  licenses: []
58
61
  metadata: {}
59
62
  post_install_message: