From cf6cd855e8d416ab922e47d16161ac77c2e61fc6 Mon Sep 17 00:00:00 2001 From: vkill Date: Sat, 29 Dec 2018 10:01:12 +0800 Subject: [PATCH] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8535c2e..6ea0eb5 100644 --- a/README.md +++ b/README.md @@ -226,16 +226,16 @@ A simple example of processing notify for Grape v1.2.2 . gem 'multi_xml' # config/routes.rb -mount Wechat::Api => '/notify' +mount WechatPay::Api => '/' -# app/api/wechat/api.rb -module Wechat +# app/api/wechat_pay/api.rb +module WechatPay class Api < Grape::API content_type :xml, 'text/xml' format :xml formatter :xml, lambda { |object, env| object.to_xml(root: 'xml', dasherize: false) } - post "" do + post "notify" do result = params["xml"] if WxPay::Sign.verify?(result) # find your order and process the post-paid logic. -- libgit2 0.21.0