Note that there are some explanatory texts on larger screens.

plurals
  1. POpreapproved payments with paypal in rails 3.2
    primarykey
    data
    text
    <p>I send this info to paypal for using <strong>preapproved payment feature</strong>:</p> <pre><code>response = gateway.preapprove_payment( :return_url =&gt; user_orders_url(current_user), :cancel_url =&gt; user_orders_url(current_user), :requestEnvelope =&gt; {"errorLanguage" =&gt; "en_US"}, :start_date =&gt; Time.now, :end_date =&gt; Time.now + (60*60*24) * 30, :currency_code =&gt;"USD", :senderEmail =&gt;"email address of sender", :max_amount =&gt; "20.00", :maxNumberOfPayments =&gt; "1", :notify_url =&gt; ipn_notification_user_orders_url(current_user), ) redirect_to (gateway.redirect_url_for(response["preapprovalKey"])) p response </code></pre> <p>I get a message in paypal page:</p> <pre><code>This transaction is invalid. Please return to the recipient's website and try again. </code></pre> <p>I am using the method <code>build_preapproval_payment</code> from this gem <a href="https://github.com/jpablobr/active_paypal_adaptive_payment/blob/master/lib/active_merchant/billing/gateways/paypal_adaptive_payment.rb" rel="nofollow">https://github.com/jpablobr/active_paypal_adaptive_payment/blob/master/lib/active_merchant/billing/gateways/paypal_adaptive_payment.rb</a></p> <p>This is the output in my log console:</p> <pre><code>#&lt;ActiveMerchant::Billing::AdaptivePaymentResponse:0xb7c6838 @json="{\"responseEnvelope\":{\"timestamp\":\"2012-07-23T09:32:42.631-07:00\",\"ack\":\"Success\",\"correlationId\":\"0c4df4aefe651\",\"build\":\"DEV\"},\"preapprovalKey\":\"PA-8D4362235H161382C\"}", @response=#&lt;Hashie::Rash preapproval_key="PA-8D4362235H161382C" response_envelope=#&lt;Hashie::Rash ack="Success" build="DEV" correlation_id="0c4df4aefe651" timestamp="2012-07-23T09:32:42.631-07:00"&gt;&gt;, @xml_request="&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;PreapprovalRequest&gt;\n &lt;requestEnvelope&gt;\n &lt;detailLevel&gt;ReturnAll&lt;/detailLevel&gt;\n &lt;errorLanguage&gt;en_US&lt;/errorLanguage&gt;\n &lt;senderEmail&gt;sender_email&lt;/senderEmail&gt;\n &lt;/requestEnvelope&gt;\n &lt;endingDate&gt;2012-08-22T18:32:40&lt;/endingDate&gt;\n &lt;startingDate&gt;2012-07-23T18:32:40&lt;/startingDate&gt;\n &lt;maxTotalAmountOfAllPayments&gt;20.00&lt;/maxTotalAmountOfAllPayments&gt;\n &lt;maxNumberOfPayments&gt;1&lt;/maxNumberOfPayments&gt;\n &lt;currencyCode&gt;USD&lt;/currencyCode&gt;\n &lt;cancelUrl&gt;http://localhost:3000/en/u/maserranocaceres/orders&lt;/cancelUrl&gt;\n &lt;returnUrl&gt;http://localhost:3000/en/u/maserranocaceres/orders&lt;/returnUrl&gt;\n &lt;ipnNotificationUrl&gt;http://localhost:3000/en/u/maserranocaceres/orders/ipn_notification&lt;/ipnNotificationUrl&gt;\n&lt;/PreapprovalRequest&gt;\n", @request={"PreapprovalRequest"=&gt;{"requestEnvelope"=&gt;{"detailLevel"=&gt;"ReturnAll", "errorLanguage"=&gt;"en_US", "senderEmail"=&gt;"microf_1342709287_biz@gmail.com"}, "endingDate"=&gt;"2012-08-22T18:32:40", "startingDate"=&gt;"2012-07-23T18:32:40", "maxTotalAmountOfAllPayments"=&gt;"20.00", "maxNumberOfPayments"=&gt;"1", "currencyCode"=&gt;"USD", "cancelUrl"=&gt;"http://localhost:3000/en/u/maserranocaceres/orders", "returnUrl"=&gt;"http://localhost:3000/en/u/maserranocaceres/orders", "ipnNotificationUrl"=&gt;"http://localhost:3000/en/u/maserranocaceres/orders/ipn_notification"}}, @action="Preapproval"&gt; </code></pre> <p><strong>Where have I the error?</strong></p> <p>Thank you!</p>
    singulars
    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