RoR - PayPal ActiveMerchant - making a refund

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

How can I make a return to a transaction?

+4
source share
2 answers

Money transfers will be associated with additional PayPal payments. I suggest using the ActiveMerchant return method.

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

+2
source

Cody Fauser does a great job of getting the PayPal transaction working with ActiveMerchant with RoR.

As soon as you start working in test mode, you just need to return the money. With activemerchant, they are 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") 
0
source

All Articles