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>
29 lines
717 B
Go
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)
|
|
}
|
|
}
|