Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Add billing_cycles attribute. #36

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
source :rubygems
source 'https://rubygems.org'
gemspec
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH
paypal-recurring (1.1.0)

GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
activesupport (3.2.3)
i18n (~> 0.6)
Expand Down
2 changes: 2 additions & 0 deletions lib/paypal/recurring/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module PayPal
module Recurring
class Base
attr_accessor :amount
attr_accessor :billing_cycles
attr_accessor :cancel_url
attr_accessor :currency
attr_accessor :description
Expand Down Expand Up @@ -189,6 +190,7 @@ def create_recurring_profile
:frequency,
:period,
:email,
:billing_cycles,
:trial_length,
:trial_period,
:trial_frequency,
Expand Down
2 changes: 2 additions & 0 deletions lib/paypal/recurring/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Request
ATTRIBUTES = {
:action => "ACTION",
:amount => ["PAYMENTREQUEST_0_AMT", "AMT"],
:billing_cycles => "TOTALBILLINGCYCLES",
:billing_type => "L_BILLINGTYPE0",
:cancel_url => "CANCELURL",
:currency => ["PAYMENTREQUEST_0_CURRENCYCODE", "CURRENCYCODE"],
Expand Down Expand Up @@ -145,6 +146,7 @@ def client
@client ||= begin
Net::HTTP.new(uri.host, uri.port).tap do |http|
http.use_ssl = true
http.ssl_version = :TLSv1_2
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.ca_file = CA_FILE
end
Expand Down
4 changes: 4 additions & 0 deletions spec/paypal/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
subject.client.use_ssl?.should be_true
end

it "uses TLSv1_2" do
subject.client.ssl_version.should == :TLSv1_2
end

it "verifies certificate" do
subject.client.verify_mode.should == OpenSSL::SSL::VERIFY_PEER
end
Expand Down