2011-10-17 95 views
0

如何使用ipn通知與貝寶apadaptive付款寶石與活躍的商人? 我想避免使用金屬,直接控制器要使用。 軌道3 紅寶石1.9.2 感謝paypal自適應付款軌3

回答

1

使用這樣

response = gateway.setup_purchase(
    :return_url => url_for(:action => 'index',:port=>"3001", :only_path => false), 
    :cancel_url => url_for(:action => 'create',:port=>"3001", :only_path => false), 
    **:ipn_notification_url => payments_notify_action_url**, 
    :receiver_list => recipients 
) 

在此指定IPN通知URL然後:

def notify_action 
    notify = ActiveMerchant::Billing::Integrations::PaypalAdaptivePayment::Notification.new(request.raw_post) 
    p "Notification object is #{notify}" 
    if notify.acknowledge 
    p "Transaction ID is #{notify.transaction_id}" 
    p "Notification object is #{notify}" 
    p "Notification status is #{notify.status}" 
end 

在那之前g o加入沙箱帳戶。

  1. 選擇測試帳戶。
  2. 然後點擊任何一個企業賬戶 - >點擊「進入沙盒帳戶」
  3. 進入企業帳戶的電子郵件,並輸入密碼
  4. 選擇 - >配置文件設置 - > IPN通知 - >設置返回URL
相關問題