Skip to content
nov matake edited this page May 23, 2011 · 2 revisions

Refund

Once an user paid, you got a “Transaction ID”.
It is required when you refund a transaction.

In recurring payment, you will get multiple transaction IDs for each payment via IPN.

Full Refund

request = Paypal::Express::Request.new(
  :username   => SET_YOUR_OWN,
  :password   => SET_YOUR_OWN,
  :signature  => SET_YOUR_OWN
)
request.refund! transaction_id

Partial Refund

request.refund!(
  transaction_id,
  :type          => :Partial
  :amount        => SET_YOUR_OWN,
  :currency_code => SET_YOUR_OWN, # Optional
  :invoice_id    => SET_YOUR_OWN, # Optional
  :note          => SET_YOUR_OWN  # Optional
)
Clone this wiki locally