From 60666a7eb0f7b7b4c80cf9c341b65c68b76ac39a Mon Sep 17 00:00:00 2001 From: Devilal Date: Fri, 27 Nov 2015 20:22:35 +0530 Subject: [PATCH 1/2] Pre-filling address information --- lib/paypal/express/request.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/paypal/express/request.rb b/lib/paypal/express/request.rb index 7661474..c5cf554 100644 --- a/lib/paypal/express/request.rb +++ b/lib/paypal/express/request.rb @@ -24,7 +24,14 @@ def setup(payment_requests, return_url, cancel_url, options = {}) :locale => :LOCALECODE, :logo => :LOGOIMG, :cart_border_color => :CARTBORDERCOLOR, - :payflow_color => :PAYFLOWCOLOR + :payflow_color => :PAYFLOWCOLOR, + :name => :PAYMENTREQUEST_0_SHIPTONAME, + :street => :PAYMENTREQUEST_0_SHIPTOSTREET, + :city => :PAYMENTREQUEST_0_SHIPTOCITY, + :state => :PAYMENTREQUEST_0_SHIPTOSTATE, + :zip => :PAYMENTREQUEST_0_SHIPTOZIP, + :country => :PAYMENTREQUEST_0_SHIPTOCOUNTRY + }.each do |option_key, param_key| params[param_key] = options[option_key] if options[option_key] end From 391e46acc8daf2d0c8becf2aebcedbaa377ec7e8 Mon Sep 17 00:00:00 2001 From: Devilal Date: Sat, 25 Jun 2016 12:56:38 +0530 Subject: [PATCH 2/2] prefill phone number --- lib/paypal/express/request.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/paypal/express/request.rb b/lib/paypal/express/request.rb index c5cf554..080813f 100644 --- a/lib/paypal/express/request.rb +++ b/lib/paypal/express/request.rb @@ -13,7 +13,6 @@ def setup(payment_requests, return_url, cancel_url, options = {}) params[:REQCONFIRMSHIPPING] = 0 params[:NOSHIPPING] = 1 end - params[:ALLOWNOTE] = 0 if options[:allow_note] == false { @@ -30,7 +29,8 @@ def setup(payment_requests, return_url, cancel_url, options = {}) :city => :PAYMENTREQUEST_0_SHIPTOCITY, :state => :PAYMENTREQUEST_0_SHIPTOSTATE, :zip => :PAYMENTREQUEST_0_SHIPTOZIP, - :country => :PAYMENTREQUEST_0_SHIPTOCOUNTRY + :country => :PAYMENTREQUEST_0_SHIPTOCOUNTRY, + :phone => :PAYMENTREQUEST_0_SHIPTOPHONENUM }.each do |option_key, param_key| params[param_key] = options[option_key] if options[option_key]