收到 Paypal 的通知后,我无法生成 PDF 文件(使用 PRAWN)。我的代码中是否缺少某些内容?这是我的代码:
订购型号:
def paypal_encryption()
values = {
:cert_id => "YR5RRR2MUKRA2",
:cmd => '_xclick',
:upload => 1,
:return => success_payments_url, ,
:cancel_return => profile_url,
:business => "seller_1306231025_biz@spt.com",
:item_name => "FMN Book",
:amount => self.price,
:quantity => self.quantity,
:rm => 2,
:cbt => "Return to Forgetmenotbook",
:currency_code => self.currency,
:notify_url => "http://home.spt.com/payments/pdfbook_for_print",
}
控制器代码:
def pdfbook_for_print
respond_to do |format|
format.pdf {}
end
end
还有对虾文件:pdfbook_for_print.pdf.prawn
require "open-uri"
require "rubygems"
require "sanitize"
Prawn::Document.generate("#{Rails.root.to_s}/public/print-pdf-print.pdf", :page_size
=> [590,590], :left_margin => 50,:right_margin => 50, :page_layout => :portrait,
:skip_page_creation => true, :skip_encoding => true) do |pdf|
pdf.start_new_page
pdf.fill_color "981a00"
pdf.move_down(50)
pdf.text "Testing pdf for printing", :size => 13
end
我怀疑notify_url中应该有类似:format => pdf参数的东西,不确定。任何帮助都感激不尽。