Note that there are some explanatory texts on larger screens.

plurals
  1. POPaypal customer checkout with rails adaptive payment
    primarykey
    data
    text
    <p>Has any successfully set the header image in the <code>displayOptions.headerImageUrl</code> with adaptive payments in Ruby? I'm banging my head against the wall trying to figure this out.</p> <p>From my understanding, I have one action <code>set_pay_chained</code> that gets the paykey and calls the pay function, but need to create an entirely different function to just tell PayPal the image url. Is this correct? Does anyone have an example of how to do this in Ruby/Rails?</p> <p>Currently my code basically looks like this. </p> <pre><code>def set_pay_chained @host=request.host.to_s @port=request.port.to_s @cancelURL= params[:returnurl_paypal] #@returnURL="http://#{@host}:#{@port}/websamples/ap/setpaychained/pay_details" @returnURL= params[:returnurl_paypal] @@ep["SERVICE"]="/AdaptivePayments/Pay" @caller = PayPalSDKCallers::Caller.new(false) req={ "requestEnvelope.errorLanguage" =&gt; "en_US", "clientDetails.ipAddress"=&gt;@@clientDetails["ipAddress"], "clientDetails.deviceId" =&gt;@@clientDetails["deviceId"], "clientDetails.applicationId" =&gt; @@clientDetails["applicationId"], "feesPayer"=&gt; "PRIMARYRECEIVER", "receiverList.receiver[0].email"=&gt;params[:receiveremail_0], "receiverList.receiver[1].email"=&gt; params[:receiveremail_1], "receiverList.receiver[0].amount"=&gt;params[:amount_0], "receiverList.receiver[1].amount"=&gt;params[:amount_1], "receiverList.receiver[0].primary[0]"=&gt; "true", "receiverList.receiver[1].primary[1]"=&gt; "false", "currencyCode"=&gt; "USD", "actionType"=&gt;"PAY", "returnUrl" =&gt; @returnURL, "cancelUrl"=&gt;"#{@cancelURL}&amp;paykey=#{@paykey}", } @transaction = @caller.call(req) if (@transaction.success?) session[:setpaychained_response]=@transaction.response @response = session[:setpaychained_response] @paykey = @response["payKey"][0] @paymentExecStatus=@response["paymentExecStatus"] if (@paymentExecStatus.to_s=="COMPLETED") redirect_to :controller =&gt; 'setpaychained',:action =&gt; 'pay_details' else redirect_to "https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&amp;paykey=#{@paykey}" end else session[:paypal_error]=@transaction.response redirect_to :controller =&gt; 'calls', :action =&gt; 'error' end rescue Errno::ENOENT =&gt; exception flash[:error] = exception redirect_to :controller =&gt; 'calls', :action =&gt; 'exception' end </code></pre> <p>== Update == On Paypal's developer forms, I've been given a variety of advice. I've moved the discussion here to see if I could get a more "rails" way of handling this. So far, SweatCoder has provided what I think is the closest solution I'm looking for. Unfortunately, the code is in PHP (which I have only a very, very, basic understanding) so I'm now trying to translate this code (https://www.x.com/message/211714#211714) into ruby. My understanding is that I need to make two separate calls. I can't tell if I'm supposed to make these calls simultaneously and if not, which call should come first.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload