Midtrans-Middleware/tests
Tengku Achmad 1db068bfb2 fix: update webhook signature retrieval and enhance error logging; correct file path in payment link test 2025-12-08 11:58:44 +07:00
..
README.md feat: update global styles and Tailwind configuration with Inter font; remove obsolete test files and add server documentation 2025-12-04 22:57:38 +07:00
coreApiSimpleExample.js feat: update global styles and Tailwind configuration with Inter font; remove obsolete test files and add server documentation 2025-12-04 22:57:38 +07:00
test-create-payment-link.cjs fix: update webhook signature retrieval and enhance error logging; correct file path in payment link test 2025-12-08 11:58:44 +07:00
test-frontend-payload.cjs feat: update global styles and Tailwind configuration with Inter font; remove obsolete test files and add server documentation 2025-12-04 22:57:38 +07:00
test-snap-token.cjs feat: update global styles and Tailwind configuration with Inter font; remove obsolete test files and add server documentation 2025-12-04 22:57:38 +07:00

README.md

Tests

Folder ini berisi file-file testing untuk Simaya Midtrans Payment Integration.

File Testing

1. test-create-payment-link.cjs

Test untuk membuat payment link menggunakan endpoint /createtransaksi.

Cara menjalankan:

node tests/test-create-payment-link.cjs

Requirement:

  • Server harus running di http://localhost:8000
  • File temp/tmp-createtransaksi.json harus ada dengan payload yang valid

2. test-frontend-payload.cjs

Test untuk mensimulasikan payload dari frontend (CheckoutPage.tsx AutoSnapPayment).

Cara menjalankan:

node tests/test-frontend-payload.cjs

Requirement:

  • Server harus running di http://localhost:8000

3. test-snap-token.cjs

Test untuk mendapatkan Snap token dari Midtrans.

Cara menjalankan:

node tests/test-snap-token.cjs

Requirement:

  • Server harus running di http://localhost:8000

4. coreApiSimpleExample.js

Contoh sederhana penggunaan Midtrans Core API.

Cara menjalankan:

node tests/coreApiSimpleExample.js

Catatan

  • Semua test file menggunakan axios untuk HTTP requests
  • Pastikan server backend sudah running sebelum menjalankan test
  • File temporary/payload test ada di folder temp/