RezinaLMS-BackEnd/internal/domain/chapa_direct_test.go
Yared Yemane dd82a1b27f feat: add Chapa Direct Charge for in-app USSD subscription payments
Adds /payments/chapa/direct initiate and authorize endpoints alongside existing hosted checkout. Includes 3DES OTP authorization, verify routing for CHAPA_DIRECT payments, tests, and client app integration guide.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 04:04:29 -07:00

29 lines
717 B
Go

package domain
import "testing"
func TestParseChapaDirectChargeType(t *testing.T) {
got, err := ParseChapaDirectChargeType("telebirr")
if err != nil || got != ChapaDirectChargeTelebirr {
t.Fatalf("got %q err=%v", got, err)
}
}
func TestIsChapaPaymentMethod(t *testing.T) {
if !IsChapaPaymentMethod("CHAPA") {
t.Fatal("expected CHAPA")
}
if !IsChapaPaymentMethod("CHAPA_DIRECT:telebirr") {
t.Fatal("expected CHAPA_DIRECT prefix")
}
if IsChapaPaymentMethod("ARIFPAY") {
t.Fatal("did not expect ARIFPAY")
}
}
func TestChapaDirectChargePaymentMethod(t *testing.T) {
if got := ChapaDirectChargePaymentMethod(ChapaDirectChargeTelebirr); got != "CHAPA_DIRECT:telebirr" {
t.Fatalf("got %q", got)
}
}