4

I can successfully make a direct payment to PaPpal using ActiveMerchant in RoR.

How can I make refund to a transaction?

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
Saim
  • 2,471
  • 5
  • 30
  • 43

2 Answers2

2

Money transfer will involve additional PayPal fees. I suggest to use the ActiveMerchant refund method.

https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb

Chris
  • 2,744
  • 3
  • 24
  • 39
0

Cody Fauser gives a great run down on the process to get a paypal transaction working on ActiveMerchant with RoR.

Once you get that running in test mode, it's simple to do refunds. With activemerchant, they're called 'transfers'.

In the controller just do something like below:

success = EXPRESS_GATEWAY.transfer(amount * 100, paypal_email_to_refund_to, :currency => currency.name, :subject => "Withdrawal from My Site", :note => "A personal message if you want")
scott
  • 441
  • 5
  • 11
  • @scott- for sandbox account , at paypal , why it give Mass paymant reciept , payment status denied, however at rails console we get success message ? – Hardik Hardiya Feb 05 '15 at 09:39