diff --git a/wallet.go b/wallet.go index fba7c8a..516fb06 100644 --- a/wallet.go +++ b/wallet.go @@ -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 { @@ -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 { @@ -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 { diff --git a/wallet_transaction.go b/wallet_transaction.go index b8b0d01..c890cab 100644 --- a/wallet_transaction.go +++ b/wallet_transaction.go @@ -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 { @@ -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 {