Skip to content

Commit

Permalink
feas: add invoice require successful payment
Browse files Browse the repository at this point in the history
  • Loading branch information
brunomiguelpinto committed Aug 2, 2024
1 parent d356dcb commit 973d55b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 65 deletions.
102 changes: 51 additions & 51 deletions wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@ const (
)

type RecurringTransactionRuleInput struct {
LagoID uuid.UUID `json:"lago_id,omitempty"`
Interval string `json:"interval,omitempty"`
Method string `json:"method,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
TargetOngoingBalance string `json:"target_ongoing_balance,omitempty"`
ThresholdCredits string `json:"threshold_credits,omitempty"`
Trigger string `json:"trigger,omitempty"`
PaidCredits string `json:"paid_credits,omitempty"`
GrantedCredits string `json:"granted_credits,omitempty"`
InvoiceRequireSuccessfulPayment bool `json:"invoice_require_successful_payment,omitempty"`
LagoID uuid.UUID `json:"lago_id,omitempty"`
Interval string `json:"interval,omitempty"`
Method string `json:"method,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
TargetOngoingBalance string `json:"target_ongoing_balance,omitempty"`
ThresholdCredits string `json:"threshold_credits,omitempty"`
Trigger string `json:"trigger,omitempty"`
PaidCredits string `json:"paid_credits,omitempty"`
GrantedCredits string `json:"granted_credits,omitempty"`
InvoiceRequiresSuccessfulPayment bool `json:"invoice_requires_successful_payment,omitempty"`
}

type RecurringTransactionRuleResponse struct {
LagoID uuid.UUID `json:"lago_id,omitempty"`
Interval string `json:"interval,omitempty"`
Method string `json:"method,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
TargetOngoingBalance string `json:"target_ongoing_balance,omitempty"`
ThresholdCredits string `json:"threshold_credits,omitempty"`
Trigger string `json:"trigger,omitempty"`
PaidCredits string `json:"paid_credits,omitempty"`
GrantedCredits string `json:"granted_credits,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
InvoiceRequireSuccessfulPayment bool `json:"invoice_require_successful_payment,omitempty"`
LagoID uuid.UUID `json:"lago_id,omitempty"`
Interval string `json:"interval,omitempty"`
Method string `json:"method,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
TargetOngoingBalance string `json:"target_ongoing_balance,omitempty"`
ThresholdCredits string `json:"threshold_credits,omitempty"`
Trigger string `json:"trigger,omitempty"`
PaidCredits string `json:"paid_credits,omitempty"`
GrantedCredits string `json:"granted_credits,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
InvoiceRequiresSuccessfulPayment bool `json:"invoice_requires_successful_payment,omitempty"`
}

type WalletRequest struct {
Expand All @@ -52,15 +52,15 @@ type WalletParams struct {
}

type WalletInput struct {
RateAmount string `json:"rate_amount,omitempty"`
Currency Currency `json:"currency,omitempty"`
Name string `json:"name,omitempty"`
PaidCredits string `json:"paid_credits,omitempty"`
GrantedCredits string `json:"granted_credits,omitempty"`
ExpirationAt *time.Time `json:"expiration_at,omitempty"`
ExternalCustomerID string `json:"external_customer_id,omitempty"`
InvoiceRequireSuccessfulPayment bool `json:"invoice_require_successful_payment,omitempty"`
RecurringTransactionRules []RecurringTransactionRuleInput `json:"recurring_transaction_rules,omitempty"`
RateAmount string `json:"rate_amount,omitempty"`
Currency Currency `json:"currency,omitempty"`
Name string `json:"name,omitempty"`
PaidCredits string `json:"paid_credits,omitempty"`
GrantedCredits string `json:"granted_credits,omitempty"`
ExpirationAt *time.Time `json:"expiration_at,omitempty"`
ExternalCustomerID string `json:"external_customer_id,omitempty"`
InvoiceRequiresSuccessfulPayment bool `json:"invoice_requires_successful_payment,omitempty"`
RecurringTransactionRules []RecurringTransactionRuleInput `json:"recurring_transaction_rules,omitempty"`
}

type WalletListInput struct {
Expand All @@ -76,27 +76,27 @@ type WalletResult struct {
}

type Wallet struct {
LagoID uuid.UUID `json:"lago_id,omitempty"`
LagoCustomerID uuid.UUID `json:"lago_customer_id,omitempty"`
ExternalCustomerID string `json:"external_customer_id,omitempty"`
Status Status `json:"status,omitempty"`
Currency Currency `json:"currency,omitempty"`
Name string `json:"name,omitempty"`
RateAmount string `json:"rate_amount,omitempty"`
CreditsBalance string `json:"credits_balance,omitempty"`
BalanceCents int `json:"balance_cents,omitempty"`
ConsumedCredits string `json:"consumed_credits,omitempty"`
InvoiceRequireSuccessfulPayment bool `json:"invoice_require_successful_payment,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
ExpirationAt time.Time `json:"expiration_at,omitempty"`
LastBalanceSyncAt time.Time `json:"last_balance_sync_at,omitempty"`
LastConsumedCreditAt time.Time `json:"last_consumed_credit_at,omitempty"`
TerminatedAt time.Time `json:"terminated_at,omitempty"`
RecurringTransactionRules []RecurringTransactionRuleResponse `json:"recurring_transaction_rules,omitempty"`
OngoingBalanceCents int `json:"ongoing_balance_cents,omitempty"`
OngoingUsageBalanceCents int `json:"ongoing_usage_balance_cents,omitempty"`
CreditsOngoingBalance string `json:"credits_ongoing_balance,omitempty"`
CreditsOngoingUsageBalance string `json:"credits_ongoing_usage_balance,omitempty"`
LagoID uuid.UUID `json:"lago_id,omitempty"`
LagoCustomerID uuid.UUID `json:"lago_customer_id,omitempty"`
ExternalCustomerID string `json:"external_customer_id,omitempty"`
Status Status `json:"status,omitempty"`
Currency Currency `json:"currency,omitempty"`
Name string `json:"name,omitempty"`
RateAmount string `json:"rate_amount,omitempty"`
CreditsBalance string `json:"credits_balance,omitempty"`
BalanceCents int `json:"balance_cents,omitempty"`
ConsumedCredits string `json:"consumed_credits,omitempty"`
InvoiceRequiresSuccessfulPayment bool `json:"invoice_requires_successful_payment,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
ExpirationAt time.Time `json:"expiration_at,omitempty"`
LastBalanceSyncAt time.Time `json:"last_balance_sync_at,omitempty"`
LastConsumedCreditAt time.Time `json:"last_consumed_credit_at,omitempty"`
TerminatedAt time.Time `json:"terminated_at,omitempty"`
RecurringTransactionRules []RecurringTransactionRuleResponse `json:"recurring_transaction_rules,omitempty"`
OngoingBalanceCents int `json:"ongoing_balance_cents,omitempty"`
OngoingUsageBalanceCents int `json:"ongoing_usage_balance_cents,omitempty"`
CreditsOngoingBalance string `json:"credits_ongoing_balance,omitempty"`
CreditsOngoingUsageBalance string `json:"credits_ongoing_usage_balance,omitempty"`
}

func (c *Client) Wallet() *WalletRequest {
Expand Down
28 changes: 14 additions & 14 deletions wallet_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ type WalletTransactionParams struct {
}

type WalletTransactionInput struct {
WalletID string `json:"wallet_id,omitempty"`
PaidCredits string `json:"paid_credits,omitempty"`
GrantedCredits string `json:"granted_credits,omitempty"`
VoidedCredits string `json:"voided_credits,omitempty"`
InvoiceRequireSuccessfulPayment bool `json:"invoice_require_successful_payment,omitempty"`
WalletID string `json:"wallet_id,omitempty"`
PaidCredits string `json:"paid_credits,omitempty"`
GrantedCredits string `json:"granted_credits,omitempty"`
VoidedCredits string `json:"voided_credits,omitempty"`
InvoiceRequiresSuccessfulPayment bool `json:"invoice_requires_successful_payment,omitempty"`
}

type WalletTransactionResult struct {
Expand All @@ -63,15 +63,15 @@ type WalletTransactionResult struct {
}

type WalletTransaction struct {
LagoID uuid.UUID `json:"lago_id,omitempty"`
LagoWalletID uuid.UUID `json:"lago_wallet_id,omitempty"`
Status WalletTransactionStatus `json:"status,omitempty"`
TransactionType TransactionType `json:"transaction_type,omitempty"`
Amount string `json:"amount,omitempty"`
CreditAmount string `json:"credit_amount,omitempty"`
InvoiceRequireSuccessfulPayment bool `json:"invoice_require_successful_payment,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
SettledAt time.Time `json:"settled_at,omitempty"`
LagoID uuid.UUID `json:"lago_id,omitempty"`
LagoWalletID uuid.UUID `json:"lago_wallet_id,omitempty"`
Status WalletTransactionStatus `json:"status,omitempty"`
TransactionType TransactionType `json:"transaction_type,omitempty"`
Amount string `json:"amount,omitempty"`
CreditAmount string `json:"credit_amount,omitempty"`
InvoiceRequiresSuccessfulPayment bool `json:"invoice_requires_successful_payment,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
SettledAt time.Time `json:"settled_at,omitempty"`
}

func (c *Client) WalletTransaction() *WalletTransactionRequest {
Expand Down

0 comments on commit 973d55b

Please sign in to comment.