Forum: Ruby on Rails Invalid transaction id in paypal recurring

Posted by debadatta (Guest)
on 2013-02-01 08:55
(Received via mailing list)
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 = PayPal::Recurring.new({
      :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?
    response
  end

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
Debadatta
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.