开发者

How to use ActiveMerchant for Paypal website payments standard?

I'm trying to set up a rails app to use Paypal website payments standard. I'd rather have users click a button and submit their info on the Paypal site rather than on my site, but I'd like to use ActiveMerchant for it's test mode and handling of credentials.

All the info I can find on the net describes how to use ActiveMerchant to let users fill in details in a form in your site and use the Paypal API to charge their card. Ryan bates has screen casts where he walks through using the website payments standard method but he doesn't take advantage of ActiveMerchant in his method.

I think I have ActiveMerchant set up in my app correctly:

# config/environments/development.rb
config.after_initialize do
  ActiveMerchant::Billing::Base.mode = :test
  ::GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(
    login: 'dgesf_1313616880_biz_api1.gmail.com',
    password: '1313616919',
    signatur开发者_如何学JAVAe: 'AKXgGVsxct8DAOfYpyE73guXzPo1ACa185mHcgzMcYOCJsNYSJ0NflAF'
  )
end

But how do I generate a form which will use the information above to POST my details (item price, name etc) to the correct Paypal URL so that they can construct the page which will display item details to the user and allow him to enter his payment information?

Can I use ActiveMerchant to fake Paypal IPN notifications and test my apps handling of them?


ActiveMerchant is a bundle of payment gateway APIs from Shopfy and the PayPal library in there doesn't seem to be updated, line item fields are not with the APIs as per HERE, good though for payment processing only.

If you'd need a comprehensive integration of the PayPal experience, refer to the DEMO Site and obtain the Express Checkout API codes, that will better fit your need of itemization & customization on PayPal checkout pages.

IPN simulator to test your script with mock call-back messages, that's right from @SgtPooki in the comments

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜