Skip to content

lunagotpwned/omise-webhook-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ตัวอย่างการรับ charge events จาก Omise Webhook

Dependencies :

  • Elysia.js
  • Omise.js

วิธีการทดสอบ

git clone https://github.com/luna-zx/omise-webhook-example.git
cd omise-webhook-example
bun install

แก้ OMISE_PUBLIC_KEY และ OMISE_SECRET_KEY ในไฟล์ .env ด้วยน้า

OMISE_PUBLIC_KEY = 
OMISE_SECRET_KEY = 

HTTP Server จะรันอยู่บน http://localhost:3000 แต่ Omise ยังไม่สามารถส่ง webhook มาได้เพราะว่ารันอยู่ในเครื่อง ในตัวอย่างนี้จะใช้ ngrok ทำ Port forwarding

npm run dev
ngrok http http://localhost:3000

เอา ngrok url ไปใส่ใน Omise (Omise Dashboard -> Settings -> Webhooks -> เพิ่ม https://xxxxxx.ngrok-free.app/webhook)

เวลาสร้าง charge (QR Code) ถ้าเป็น test mode อาจจะเข้าไปดูใน Omise Dashboard -> Charges แล้วเปลี่ยน status เป็นชำระเงินแล้วก็ได้

About

ตัวอย่างการรับ charge events จาก omise webhook ด้วย Elysia.js & Omise.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors