Is there a PayPal IPN code sample for Ruby on Rails?

前端 未结 7 452
渐次进展
渐次进展 2021-02-01 05:27

There are official code samples for several languages but couldn\'t find one for Rails.

7条回答
  •  孤城傲影
    2021-02-01 06:03

    PayPal's Ruby Merchant SDK provides an ipn_valid? boolean method to make this super easy on you.

    def notify
      @api = PayPal::SDK::Merchant.new
      if @api.ipn_valid?(request.raw_post)  # return true or false
        # params contains the data
      end
    end
    

    https://github.com/paypal/merchant-sdk-ruby/blob/master/samples/IPN-README.md

提交回复
热议问题