Files
zeekay 1943f1c093 Hanzo Commerce
Multi-tenant commerce and billing: orders, subscriptions, invoices, plans,
usage metering and a credit ledger. One Go binary. MIT OR Apache-2.0.

Claude-Session: https://claude.ai/code/session_01SAtaDFm8VDiWrhYHNNtxMw
2026-09-23 21:52:16 -07:00

45 lines
1.0 KiB
Go

package payment
import (
"github.com/hanzoai/commerce/datastore"
"github.com/hanzoai/commerce/models/types/accounts"
"github.com/hanzoai/commerce/models/types/currency"
"github.com/hanzoai/commerce/util/fake"
. "github.com/hanzoai/commerce/types"
)
func Fake(db *datastore.Datastore) *Payment {
pay := New(db)
pay.Amount = currency.Cents(0).Fake()
pay.Account.Type = accounts.NullType
pay.Buyer = Buyer{
Email: fake.EmailAddress(),
FirstName: fake.FirstName(),
LastName: fake.LastName(),
BillingAddress: Address{
Line1: fake.Street(),
City: fake.City(),
State: fake.State(),
PostalCode: fake.Zip(),
Country: "US",
},
ShippingAddress: Address{
Line1: fake.Street(),
City: fake.City(),
State: fake.State(),
PostalCode: fake.Zip(),
Country: "US",
},
}
pay.Status = Unpaid
pay.Currency = currency.USD
pay.Account.Number = "4242424242424242"
pay.Account.CVC = "424"
pay.Account.Month = 12
pay.Account.Year = 2024
return pay
}