package paymentkit

import "testing"

func TestJSONObjectAndPathValues(t *testing.T) {
	object := JSONObject([]byte(`{"data":{"status":"SUCCESS","amount":100}}`))
	if object == nil {
		t.Fatal("JSONObject returned nil")
	}
	if got := StringAtPath(object, "data.amount"); got != "100" {
		t.Fatalf("StringAtPath = %q", got)
	}
	if got := StringAtPath(object, "data.missing"); got != "" {
		t.Fatalf("missing path = %q", got)
	}
}
