アクティブなマーチャントでpaypal apadaptive payment gemでipn通知を使用するには? コントローラーを直接使用したいので、金属の使用は避けたいです。レール 3 ルビー 1.9.2 ありがとう
2 に答える
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
その前に、サンドボックスアカウントに移動します。
- テストアカウントを選択します。
- 次に、任意のビジネスアカウントをクリックし、[サンドボックスアカウントを入力]をクリックします
- ビジネスアカウントのメールアドレスを入力し、パスワードを入力します
- ->プロファイル設定->ipn通知->リターンURLの設定を選択します
于 2012-08-23T05:26:33.730 に答える
0
便宜上、すべてをカプセル化したこの gem を確認してください: https://github.com/jpablobr/active_paypal_adaptive_payment
于 2012-02-20T13:59:54.743 に答える