我可以使用 RoR 中的 ActiveMerchant 成功地直接向 PaPpal 付款。
如何为交易退款?
汇款将涉及额外的 PayPal 费用。我建议使用 ActiveMerchant 退款方式。
Cody Fauser 对使用 RoR 在 ActiveMerchant 上进行 paypal 交易的过程进行了很好的总结。
一旦你在测试模式下运行,退款很简单。对于 activemerchant,它们被称为“转移”。
在控制器中,只需执行以下操作:
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")