Ruby on Rails Thursday, January 31, 2013

Hi all

I am working with the paypal recurring gem and rails 3.

I am subscribing different plans for a demo site. with "Basic" and "Premium" plans.

I am doing a refund process for test.

def refund_payment
    ppr ={
      :profile_id => self.paypal_recurring_profile_token,
      :transaction_id => "#7RX73297E7023873T",
      :reference      => "1234",
      :refund_type    => :full,
      :currency       => "USD"
    response = ppr.refund
    raise response.errors.inspect if response.errors.present?

For profie id it gets the profile id from the table for each transaction. But incase of transaction id there are no transaction id in response while getting a payment to paypal.
I just hardcoded the transaction id from the last transaction from the website. But it showing error.

[{:code=>"10004", :messages=>["Transaction refused because of an invalid argument. See additional error messages for details.", "The transaction id is not valid"]}]
Thanks in advance

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment