Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/charmbracelet/lipgloss v1.1.0
github.com/mergestat/timediff v0.0.4
github.com/shopspring/decimal v1.4.0
github.com/sumup/sumup-go v0.11.1
github.com/sumup/sumup-go v0.13.0
github.com/urfave/cli/v3 v3.6.2
golang.org/x/term v0.39.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/sumup/sumup-go v0.11.1 h1:jGthnT8V/QIllOoF4pE9kwS000AntdtEa4UTaejeX/I=
github.com/sumup/sumup-go v0.11.1/go.mod h1:UgT9aaxvUBrAiRpunqyb1zi5v/+1z+6Lr6p6bgL8EYI=
github.com/sumup/sumup-go v0.13.0 h1:35Xpv8cNLS5O02voKgwgks8Gz2QU53Ek8emlOyVuvkU=
github.com/sumup/sumup-go v0.13.0/go.mod h1:UgT9aaxvUBrAiRpunqyb1zi5v/+1z+6Lr6p6bgL8EYI=
github.com/urfave/cli/v3 v3.6.2 h1:lQuqiPrZ1cIz8hz+HcrG0TNZFxU70dPZ3Yl+pSrH9A8=
github.com/urfave/cli/v3 v3.6.2/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
Expand Down
6 changes: 3 additions & 3 deletions internal/commands/checkouts/checkouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func listCheckouts(ctx context.Context, cmd *cli.Command) error {
if err != nil {
return err
}
params := checkouts.ListCheckoutsParams{}
params := checkouts.ListParams{}
if ref := cmd.String("checkout-reference"); ref != "" {
params.CheckoutReference = &ref
}
Expand Down Expand Up @@ -153,7 +153,7 @@ func createCheckout(ctx context.Context, cmd *cli.Command) error {
return err
}

body := checkouts.CreateCheckoutBody{
body := checkouts.Create{
CheckoutReference: cmd.String("reference"),
Amount: float32(cmd.Float64("amount")),
Currency: parsedCurrency,
Expand All @@ -173,7 +173,7 @@ func createCheckout(ctx context.Context, cmd *cli.Command) error {
body.CustomerID = &value
}
if value := cmd.String("purpose"); value != "" {
purpose := checkouts.CreateCheckoutBodyPurpose(value)
purpose := checkouts.CreatePurpose(value)
body.Purpose = &purpose
}

Expand Down
4 changes: 2 additions & 2 deletions internal/commands/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func debounce() tea.Cmd {
func (m model) searchMemberships(query string, parentID string, parentType memberships.ResourceType) tea.Cmd {
return func() tea.Msg {
status := shared.MembershipStatusAccepted
params := memberships.ListMembershipsParams{
params := memberships.ListParams{
Status: &status,
}

Expand Down Expand Up @@ -378,7 +378,7 @@ func setContext(ctx context.Context, cmd *cli.Command) error {
message.Notify("Fetching your memberships...")

status := shared.MembershipStatusAccepted
params := memberships.ListMembershipsParams{
params := memberships.ListParams{
Status: &status,
}

Expand Down
6 changes: 3 additions & 3 deletions internal/commands/members/members.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func listMembers(ctx context.Context, cmd *cli.Command) error {
return err
}

params := members.ListMerchantMembersParams{}
params := members.ListParams{}
if cmd.IsSet("offset") {
value := cmd.Int("offset")
params.Offset = &value
Expand Down Expand Up @@ -217,7 +217,7 @@ func createMember(ctx context.Context, cmd *cli.Command) error {
isManaged := true
password := secret.New(cmd.String("password"))

body := members.CreateMerchantMemberBody{
body := members.Create{
Email: cmd.String("email"),
IsManagedUser: &isManaged,
Password: &password,
Expand Down Expand Up @@ -254,7 +254,7 @@ func inviteMember(ctx context.Context, cmd *cli.Command) error {
return err
}

body := members.CreateMerchantMemberBody{
body := members.Create{
Email: cmd.String("email"),
Roles: []string{"role_employee"},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/memberships/memberships.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func listMemberships(ctx context.Context, cmd *cli.Command) error {
if err != nil {
return err
}
params := memberships.ListMembershipsParams{}
params := memberships.ListParams{}
if cmd.IsSet("offset") {
value := cmd.Int("offset")
params.Offset = &value
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/payouts/payouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func listPayouts(ctx context.Context, cmd *cli.Command) error {
if err != nil {
return err
}
params := payouts.ListPayoutsV1Params{
params := payouts.ListParams{
StartDate: startDate,
EndDate: endDate,
}
Expand Down
14 changes: 7 additions & 7 deletions internal/commands/readers/readers.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func addReader(ctx context.Context, cmd *cli.Command) error {
if err != nil {
return err
}
body := readers.CreateReaderBody{
body := readers.Create{
PairingCode: readers.ReaderPairingCode(cmd.String("pairing-code")),
Name: readers.ReaderName(cmd.String("name")),
}
Expand Down Expand Up @@ -269,8 +269,8 @@ func readerCheckout(ctx context.Context, cmd *cli.Command) error {
return fmt.Errorf("amount is too large to convert into minor units")
}

body := readers.CreateReaderCheckoutBody{
TotalAmount: readers.CreateReaderCheckoutBodyTotalAmount{
body := readers.CreateCheckout{
TotalAmount: readers.CreateCheckoutTotalAmount{
Currency: currency.Code(parsedCurrency),
MinorUnit: cmd.Int("minor-unit"),
Value: int(value),
Expand All @@ -284,7 +284,7 @@ func readerCheckout(ctx context.Context, cmd *cli.Command) error {
body.ReturnURL = &returnURL
}
if cardType := cmd.String("card-type"); cardType != "" {
ct := readers.CreateReaderCheckoutBodyCardType(cardType)
ct := readers.CreateCheckoutCardType(cardType)
body.CardType = &ct
}
if cmd.IsSet("installments") {
Expand Down Expand Up @@ -341,7 +341,7 @@ func readerStatus(ctx context.Context, cmd *cli.Command) error {
return err
}

response, err := appCtx.Client.Readers.GetStatus(ctx, cmd.String("merchant-code"), readerID, readers.GetReaderStatusParams{})
response, err := appCtx.Client.Readers.GetStatus(ctx, cmd.String("merchant-code"), readerID, readers.GetStatusParams{})
if err != nil {
return fmt.Errorf("get reader status: %w", err)
}
Expand Down Expand Up @@ -380,7 +380,7 @@ func readerStatusBatteryLevel(v *float32) string {
return fmt.Sprintf("%.0f%%", *v)
}

func buildAffiliatePayload(cmd *cli.Command) (*readers.CreateReaderCheckoutBodyAffiliate, error) {
func buildAffiliatePayload(cmd *cli.Command) (*readers.CreateCheckoutAffiliate, error) {
appID := cmd.String("affiliate-app-id")
key := cmd.String("affiliate-key")
foreignID := cmd.String("affiliate-foreign-transaction-id")
Expand All @@ -390,7 +390,7 @@ func buildAffiliatePayload(cmd *cli.Command) (*readers.CreateReaderCheckoutBodyA
if appID == "" || key == "" || foreignID == "" {
return nil, fmt.Errorf("affiliate requires --affiliate-app-id, --affiliate-key, and --affiliate-foreign-transaction-id")
}
return &readers.CreateReaderCheckoutBodyAffiliate{
return &readers.CreateCheckoutAffiliate{
AppID: appID,
Key: key,
ForeignTransactionID: foreignID,
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/receipts/receipts.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func getReceipt(ctx context.Context, cmd *cli.Command) error {
if err != nil {
return err
}
params := receipts.GetReceiptParams{
params := receipts.GetParams{
Mid: merchantCode,
}
if cmd.IsSet("transaction-event-id") {
Expand Down
4 changes: 2 additions & 2 deletions internal/commands/transactions/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func listTransactions(ctx context.Context, cmd *cli.Command) error {
return err
}

params := transactions.ListTransactionsV21Params{}
params := transactions.ListParams{}
if cmd.IsSet("limit") {
value := cmd.Int("limit")
params.Limit = &value
Expand Down Expand Up @@ -218,7 +218,7 @@ func getTransaction(ctx context.Context, cmd *cli.Command) error {
if err != nil {
return err
}
params := transactions.GetTransactionV21Params{
params := transactions.GetParams{
ID: &transactionID,
}

Expand Down