Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
pkg
tmp
examples
.rvmrc
5 changes: 4 additions & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ Then, you can request a new payment authorization:
:ipn_url => "http://example.com/paypal/ipn",
:description => "Awesome - Monthly Subscription",
:amount => "9.00",
:currency => "USD"
:currency => "USD",
:bg_color=>"EFC687", # you can customize bg color (optional)
:brand_name=>"My Store title!", # you can customize store title (optional)
:logo=>"http://#{your_host}/images/logo.png") # you can customize logo (optional, this overrides brand name)
})

response = ppr.checkout
Expand Down
3 changes: 3 additions & 0 deletions lib/paypal/recurring/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class Base
attr_accessor :return_url
attr_accessor :start_at
attr_accessor :token
attr_accessor :locale
attr_accessor :logo
attr_accessor :bg_color

def initialize(options = {})
options.each {|name, value| send("#{name}=", value)}
Expand Down
5 changes: 4 additions & 1 deletion lib/paypal/recurring/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class Request
:initial_amount_action => "FAILEDINITAMTACTION",
:ipn_url => ["PAYMENTREQUEST_0_NOTIFYURL", "NOTIFYURL"],
:locale => "LOCALECODE",
:logo => "HDRIMG",
:bg_color => "HDRBACKCOLOR",
:border_color => "HDRBORDERCOLOR",
:method => "METHOD",
:no_shipping => "NOSHIPPING",
:outstanding => "AUTOBILLOUTAMT",
Expand All @@ -60,7 +63,7 @@ class Request
:start_at => "PROFILESTARTDATE",
:token => "TOKEN",
:username => "USER",
:version => "VERSION",
:version => "VERSION"
}

CA_FILE = File.dirname(__FILE__) + "/cacert.pem"
Expand Down
13 changes: 13 additions & 0 deletions spec/paypal/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,18 @@
it "normalizes locale" do
subject.normalize_params(:locale => :us).should == {:LOCALECODE => "US"}
end

it "normalizes bg color" do
subject.normalize_params(:bg_color => "#FFFFFF").should == {:HDRBACKCOLOR => "#FFFFFF"}
end

it "normalizes border color" do
subject.normalize_params(:border_color => "#FFFFFF").should == {:HDRBORDERCOLOR => "#FFFFFF"}
end

it "normalizes logo" do
subject.normalize_params(:logo => "http://www.me.com/logo.jpg").should == { :HDRIMG => "http://www.me.com/logo.jpg" }
end

end
end
2 changes: 2 additions & 0 deletions spec/paypal/response/request_payment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
:currency => "USD",
:payer_id => "WTTS5KC2T46YU",
:token => "EC-7A593227AC789800N",
:logo=>"http://judicialbeep.com/assets/logo-negro-f5e1c7990957c240bcde6115dbe6b2c1.png",
:bg_color=>"CCCCCC"
})
ppr.request_payment
}
Expand Down