wechat starter
1.0.0
เทมเพลตสำหรับการพัฒนา wechat ใน Rails
ประมวลผลข้อความด้วย Eric-Guo/wechat
ไลบรารี UI ที่ใช้ weui กับ weui-rails
ชำระเงินด้วย jasl/wx_pay
OAuth2 กับ skinworm/omniauth-wechat-oauth2
บัญชีบริการที่สนับสนุนโดย Le Wagon Shanghai
ความต้องการ
PostgreSQL
กำหนดค่า "服务器地址" เป็น http://your-domain.com/wechat
กำหนดค่า "测试授权目录" เป็น http://your-domain.com/
ติดตั้ง
สร้างโปรเจ็กต์ใหม่ของคุณและเพิ่ม repo นี้เป็นเทมเพลต
mkdir your_app
cd your_app
git init
git remote add template https://github.com/Eric-Guo/wechat-starter.git
git fetch template
git checkout -b master template/master
bundle install
rake db:create
rake db:migrate
สร้าง config/application.yml
และกำหนดค่าข้อมูลต่อไปนี้:
wechat_app_id : " AppID "
wechat_secret : " AppSecret "
wechat_token : " Token "
wechat_encoding_aes_key : " EncodingAESKey "
wechat_trusted_domain_fullname : " http://your_dev.proxy.qqbrowser.cc "
# following is optional if you don't need wechat pay
wechat_pay_mch_id : " merchant id "
wechat_pay_api_key : " 32 bits api key configured in pay.weixin.qq.com "
wechat_pay_notify_url : " url to accept pay result notification "
เริ่มเซิร์ฟเวอร์
puma -C config/puma.rb
ขึ้นอยู่กับ Rails.env
ที่จะเลือกเมนูจากโฟลเดอร์ปรับแต่ง
ตัวอย่างเช่น หาก Rails.env == production
จะเลือก config/menu_production.yaml
# create menu
rake wechat:menu_create
# show menu
rake wechat:menu