mirror of
https://github.com/hanzoai/commerce.git
synced 2026-10-30 15:08:42 +00:00
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
45 lines
1.0 KiB
Go
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
|
|
}
|