Documentation
¶
Index ¶
- Constants
- type BalanceResponse
- type Client
- type CreatePaymentMethodRequest
- type CreatePaymentMethodRequestMobileMoneyDetails
- type CreatePaymentMethodRequestNeroMerchantDetails
- type CreatePaymentMethodResponse
- type CreatePaymentMethodResponseMobileMoneyDetails
- type CreatePaymentMethodResponseNeeroMerchantDetails
- type CreatePaymentMethodResponseNeeroPersonDetails
- type CreatePaymentMethodResponseOperatorDetails
- type CreatePaymentMethodResponsePaypalDetails
- type MobileMoneyProvider
- type Option
- type PaymentMethodAttribute
- type PaymentMethodType
- type ResolvePaymentMethodDetailsResponse
- type Response
- type TransactionIntentCreateRequest
- type TransactionIntentPaymentType
- type TransactionIntentTransaction
Constants ¶
const ( // PaymentMethodTypeMobileMoney represents the mobile money payment method type. PaymentMethodTypeMobileMoney = PaymentMethodType("MOBILE_MONEY") // PaymentMethodTypeNeroMerchant represents the neero merchant payment method type. PaymentMethodTypeNeroMerchant = PaymentMethodType("NEERO_MERCHANT") )
const ( // MobileMoneyProviderMTNMoney represents the MTN mobile money provider. MobileMoneyProviderMTNMoney = MobileMoneyProvider("MTN_MONEY") // MobileMoneyProviderOrangeMoney represents the orange money provider. MobileMoneyProviderOrangeMoney = MobileMoneyProvider("ORANGE_MONEY") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalanceResponse ¶
BalanceResponse represents the account balance information.
type Client ¶
type Client struct {
PaymentMethod *paymentMethodService
Balance *balanceService
TransactionIntent *transactionIntentService
// contains filtered or unexported fields
}
Client is the neero API client. Do not instantiate this client with Client{}. Use the New method instead.
type CreatePaymentMethodRequest ¶
type CreatePaymentMethodRequest interface {
// Type returns the payment method type.
Type() PaymentMethodType
// Attribute returns the payment method attribute.
Attribute() PaymentMethodAttribute
}
CreatePaymentMethodRequest represents a request to create a payment method.
type CreatePaymentMethodRequestMobileMoneyDetails ¶
type CreatePaymentMethodRequestMobileMoneyDetails struct {
PhoneNumber string `json:"phoneNumber"`
CountryIso string `json:"countryIso"`
MobileMoneyProvider MobileMoneyProvider `json:"mobileMoneyProvider"`
}
CreatePaymentMethodRequestMobileMoneyDetails represents the details for creating a mobile money payment method.
func (*CreatePaymentMethodRequestMobileMoneyDetails) Attribute ¶
func (c *CreatePaymentMethodRequestMobileMoneyDetails) Attribute() PaymentMethodAttribute
Attribute returns the payment method attribute.
func (*CreatePaymentMethodRequestMobileMoneyDetails) Type ¶
func (c *CreatePaymentMethodRequestMobileMoneyDetails) Type() PaymentMethodType
Type returns the payment method type.
type CreatePaymentMethodRequestNeroMerchantDetails ¶
type CreatePaymentMethodRequestNeroMerchantDetails struct {
MerchantKey string `json:"merchantKey"`
StoreID string `json:"storeId"`
BalanceID string `json:"balanceId"`
OperatorID string `json:"operatorId"`
}
CreatePaymentMethodRequestNeroMerchantDetails represents the details for creating a neero merchant payment method.
func (*CreatePaymentMethodRequestNeroMerchantDetails) Attribute ¶
func (c *CreatePaymentMethodRequestNeroMerchantDetails) Attribute() PaymentMethodAttribute
Attribute returns the payment method attribute.
func (*CreatePaymentMethodRequestNeroMerchantDetails) Type ¶
func (c *CreatePaymentMethodRequestNeroMerchantDetails) Type() PaymentMethodType
Type returns the payment method type.
type CreatePaymentMethodResponse ¶
type CreatePaymentMethodResponse struct {
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
ID string `json:"id"`
Metadata any `json:"metadata"`
OperatorDetails *CreatePaymentMethodResponseOperatorDetails `json:"operatorDetails"`
Active bool `json:"active"`
Type string `json:"type"`
WalletTypeProductName string `json:"walletTypeProductName"`
MobileMoneyDetails *CreatePaymentMethodResponseMobileMoneyDetails `json:"mobileMoneyDetails"`
NeeroPersonDetails *CreatePaymentMethodResponseNeeroPersonDetails `json:"neeroPersonDetails"`
NeeroMerchantDetails *CreatePaymentMethodResponseNeeroMerchantDetails `json:"neeroMerchantDetails"`
PaypalDetails *CreatePaymentMethodResponsePaypalDetails `json:"paypalDetails"`
ShortInfo string `json:"shortInfo"`
WalletID any `json:"walletId"`
}
CreatePaymentMethodResponse represents the response from creating a payment method.
type CreatePaymentMethodResponseMobileMoneyDetails ¶
type CreatePaymentMethodResponseMobileMoneyDetails struct {
CountryCode string `json:"countryCode"`
}
CreatePaymentMethodResponseMobileMoneyDetails represents the mobile money details in the payment method response.
type CreatePaymentMethodResponseNeeroMerchantDetails ¶
type CreatePaymentMethodResponseNeeroMerchantDetails struct {
MerchantKey string `json:"merchantKey"`
StoreID string `json:"storeId"`
BalanceID string `json:"balanceId"`
OperatorID any `json:"operatorId"`
Country string `json:"country"`
}
CreatePaymentMethodResponseNeeroMerchantDetails represents the neero merchant details in the payment method response.
type CreatePaymentMethodResponseNeeroPersonDetails ¶
type CreatePaymentMethodResponseNeeroPersonDetails struct {
PersonID any `json:"personId"`
AccountID string `json:"accountId"`
Country string `json:"country"`
PaymentRequestID any `json:"paymentRequestId"`
}
CreatePaymentMethodResponseNeeroPersonDetails represents the neero person details in the payment method response.
type CreatePaymentMethodResponseOperatorDetails ¶
type CreatePaymentMethodResponseOperatorDetails struct {
OperatorID any `json:"operatorId"`
MerchantKey string `json:"merchantKey"`
}
CreatePaymentMethodResponseOperatorDetails represents the operator details in the payment method response.
type CreatePaymentMethodResponsePaypalDetails ¶
type CreatePaymentMethodResponsePaypalDetails struct {
Email string `json:"email"`
CountryCode string `json:"countryCode"`
}
CreatePaymentMethodResponsePaypalDetails represents the PayPal details in the payment method response.
type MobileMoneyProvider ¶
type MobileMoneyProvider string
MobileMoneyProvider represents the mobile money provider.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is options for constructing a client
func WithBaseURL ¶
WithBaseURL set's the base url for the flutterwave API
func WithHTTPClient ¶
WithHTTPClient sets the underlying HTTP client used for API requests. By default, http.DefaultClient is used.
func WithSecretKey ¶
WithSecretKey sets the secret key to be used for API requests.
type PaymentMethodAttribute ¶
type PaymentMethodAttribute string
PaymentMethodAttribute represents the attribute of the payment method.
type PaymentMethodType ¶
type PaymentMethodType string
PaymentMethodType represents the type of payment method.
type ResolvePaymentMethodDetailsResponse ¶
type ResolvePaymentMethodDetailsResponse struct {
Name string `json:"name"`
}
ResolvePaymentMethodDetailsResponse represents the response from resolving payment method details.
type TransactionIntentCreateRequest ¶
type TransactionIntentCreateRequest struct {
Amount int `json:"amount"`
CurrencyCode string `json:"currencyCode"`
PaymentType TransactionIntentPaymentType `json:"paymentType"`
SourcePaymentMethodID *string `json:"sourcePaymentMethodId,omitempty"`
DestinationPaymentMethodID *string `json:"destinationPaymentMethodId,omitempty"`
Confirm bool `json:"confirm"`
MetaData map[string]any `json:"metadata"`
}
TransactionIntentCreateRequest represents a request to create a transaction intent.
type TransactionIntentPaymentType ¶
type TransactionIntentPaymentType string
TransactionIntentPaymentType represents the type of payment for a transaction intent.
const ( // TransactionIntentPaymentTypeMerchantCollection represents a merchant collection payment type. TransactionIntentPaymentTypeMerchantCollection TransactionIntentPaymentType = "MERCHANT_COLLECTION" // TransactionIntentPaymentTypeOrangeMoneyTransfer represents an orange money transfer payment type. TransactionIntentPaymentTypeOrangeMoneyTransfer TransactionIntentPaymentType = "ORANGE_MONEY_TRANSFER" // TransactionIntentPaymentTypeMTNMobileMoneyTransfer represents an MTN mobile money transfer payment type. TransactionIntentPaymentTypeMTNMobileMoneyTransfer TransactionIntentPaymentType = "MTN_MONEY_TRANSFER" )
type TransactionIntentTransaction ¶
type TransactionIntentTransaction struct {
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
ID string `json:"id"`
Metadata map[string]any `json:"metadata"`
OperatorDetails struct {
OperatorID any `json:"operatorId"`
MerchantKey string `json:"merchantKey"`
} `json:"operatorDetails"`
StatusUpdates []struct {
Status string `json:"status"`
UpdatedAt string `json:"updatedAt"`
} `json:"statusUpdates"`
SourcePaymentMethodID string `json:"sourcePaymentMethodId"`
SourcePaymentMethodDetails struct {
ID string `json:"id"`
Type string `json:"type"`
WalletTypeProductName string `json:"walletTypeProductName"`
ShortInfo string `json:"shortInfo"`
WalletID any `json:"walletId"`
MerchantDetails struct {
MerchantKey string `json:"merchantKey"`
StoreID string `json:"storeId"`
BalanceID string `json:"balanceId"`
OperatorID any `json:"operatorId"`
Country string `json:"country"`
} `json:"merchantDetails"`
} `json:"sourcePaymentMethodDetails"`
DestinationPaymentMethodID string `json:"destinationPaymentMethodId"`
DestinationPaymentMethodDetails struct {
ID string `json:"id"`
Type string `json:"type"`
WalletTypeProductName string `json:"walletTypeProductName"`
ShortInfo string `json:"shortInfo"`
WalletID any `json:"walletId"`
MerchantDetails struct {
MerchantKey string `json:"merchantKey"`
StoreID string `json:"storeId"`
BalanceID string `json:"balanceId"`
OperatorID any `json:"operatorId"`
Country string `json:"country"`
} `json:"merchantDetails"`
} `json:"destinationPaymentMethodDetails"`
Type string `json:"type"`
Amount any `json:"amount"`
Currency string `json:"currency"`
PaymentType string `json:"paymentType"`
ExpirationDateTime string `json:"expirationDateTime"`
PaymentToken string `json:"paymentToken"`
SuccessURL string `json:"successUrl"`
FailureURL string `json:"failureUrl"`
CancelURL string `json:"cancelUrl"`
Customer struct {
Name string `json:"name"`
Email string `json:"email"`
Phone string `json:"phone"`
} `json:"customer"`
ConfirmationSessionID string `json:"confirmationSessionId"`
NextAction struct {
Type string `json:"type"`
CreatedDateTime string `json:"createdDateTime"`
NeeroPersonWithdrawal struct {
WithdrawalRequestID string `json:"withdrawalRequestId"`
} `json:"neeroPersonWithdrawal"`
URLRedirect struct {
URLToRedirect string `json:"urlToRedirect"`
} `json:"urlRedirect"`
} `json:"nextAction"`
CollectCustomerDetails bool `json:"collectCustomerDetails"`
Status string `json:"status"`
CreateFlowTransactionRequests []struct {
Amount int `json:"amount"`
CurrencyCode string `json:"currencyCode"`
PaymentType string `json:"paymentType"`
SourcePaymentMethodID string `json:"sourcePaymentMethodId"`
DestinationPaymentMethodID string `json:"destinationPaymentMethodId"`
TransactionType string `json:"transactionType"`
} `json:"createFlowTransactionRequests"`
Fees struct {
SourceFee struct {
Owner struct {
PersonID any `json:"personId"`
WalletID any `json:"walletId"`
MerchantKey string `json:"merchantKey"`
StoreID string `json:"storeId"`
BalanceID string `json:"balanceId"`
ServiceNumber string `json:"serviceNumber"`
CountryCode string `json:"countryCode"`
Type string `json:"type"`
GatewayCode string `json:"gatewayCode"`
AdditionalData map[string]any `json:"additionalData"`
MaxPositiveBalance any `json:"maxPositiveBalance"`
Balance any `json:"balance"`
Plan string `json:"plan"`
PlanOrder any `json:"planOrder"`
} `json:"owner"`
Amount any `json:"amount"`
Margin any `json:"margin"`
OnAmountVoucherAmount any `json:"onAmountVoucherAmount"`
FreeLimitAmount any `json:"freeLimitAmount"`
OnFeeAmountVoucherAmount any `json:"onFeeAmountVoucherAmount"`
VoucherAmount any `json:"voucherAmount"`
ProductFeeAmount any `json:"productFeeAmount"`
WalletFeeAmount any `json:"walletFeeAmount"`
GovernmentFeeAmount any `json:"governmentFeeAmount"`
DenominationAdjustmentAmount any `json:"denominationAjustementAmount"`
FeeVATAmount any `json:"feeVATAmount"`
Vat any `json:"vat"`
Rate any `json:"rate"`
MarginRate any `json:"marginRate"`
Voucher struct {
Code string `json:"code"`
Value any `json:"value"`
Type string `json:"type"`
} `json:"voucher"`
GovernmentFee struct {
FeeCategory string `json:"feeCategory"`
Fee any `json:"fee"`
FeeType string `json:"feeType"`
} `json:"governmentFee"`
ProductFee struct {
FeeCategory string `json:"feeCategory"`
Fee any `json:"fee"`
FeeType string `json:"feeType"`
} `json:"productFee"`
WalletTypefee struct {
FeeCategory string `json:"feeCategory"`
Fee any `json:"fee"`
FeeType string `json:"feeType"`
} `json:"walletTypefee"`
OtherPlansFees []string `json:"otherPlansFees"`
Target string `json:"target"`
Currency string `json:"currency"`
MargedAmount any `json:"margedAmount"`
TotalFeeAmount any `json:"totalFeeAmount"`
TotalAmount any `json:"totalAmount"`
BillableAmount any `json:"billableAmount"`
Conversion struct {
MargedAmount any `json:"margedAmount"`
TotalFeeAmount any `json:"totalFeeAmount"`
TotalAmount any `json:"totalAmount"`
BillableAmount any `json:"billableAmount"`
ProductFeeAmount any `json:"productFeeAmount"`
WalletFeeAmount any `json:"walletFeeAmount"`
GovernmentFeeAmount any `json:"governmentFeeAmount"`
Rate any `json:"rate"`
Currency string `json:"currency"`
} `json:"conversion"`
} `json:"sourceFee"`
DestinationFee struct {
Owner struct {
PersonID any `json:"personId"`
WalletID any `json:"walletId"`
MerchantKey string `json:"merchantKey"`
StoreID string `json:"storeId"`
BalanceID string `json:"balanceId"`
ServiceNumber string `json:"serviceNumber"`
CountryCode string `json:"countryCode"`
Type string `json:"type"`
GatewayCode string `json:"gatewayCode"`
AdditionalData map[string]any `json:"additionalData"`
MaxPositiveBalance any `json:"maxPositiveBalance"`
Balance any `json:"balance"`
Plan string `json:"plan"`
PlanOrder any `json:"planOrder"`
} `json:"owner"`
Amount any `json:"amount"`
Margin any `json:"margin"`
OnAmountVoucherAmount any `json:"onAmountVoucherAmount"`
FreeLimitAmount any `json:"freeLimitAmount"`
OnFeeAmountVoucherAmount any `json:"onFeeAmountVoucherAmount"`
VoucherAmount any `json:"voucherAmount"`
ProductFeeAmount any `json:"productFeeAmount"`
WalletFeeAmount any `json:"walletFeeAmount"`
GovernmentFeeAmount any `json:"governmentFeeAmount"`
DenominationAjustementAmount any `json:"denominationAjustementAmount"`
FeeVATAmount any `json:"feeVATAmount"`
Vat any `json:"vat"`
Rate any `json:"rate"`
MarginRate any `json:"marginRate"`
Voucher struct {
Code string `json:"code"`
Value any `json:"value"`
Type string `json:"type"`
} `json:"voucher"`
GovernmentFee struct {
FeeCategory string `json:"feeCategory"`
Fee any `json:"fee"`
FeeType string `json:"feeType"`
} `json:"governmentFee"`
ProductFee struct {
FeeCategory string `json:"feeCategory"`
Fee any `json:"fee"`
FeeType string `json:"feeType"`
} `json:"productFee"`
WalletTypefee struct {
FeeCategory string `json:"feeCategory"`
Fee any `json:"fee"`
FeeType string `json:"feeType"`
} `json:"walletTypefee"`
OtherPlansFees []string `json:"otherPlansFees"`
Target string `json:"target"`
Currency string `json:"currency"`
MargedAmount any `json:"margedAmount"`
TotalFeeAmount any `json:"totalFeeAmount"`
TotalAmount any `json:"totalAmount"`
BillableAmount any `json:"billableAmount"`
Conversion struct {
MargedAmount any `json:"margedAmount"`
TotalFeeAmount any `json:"totalFeeAmount"`
TotalAmount any `json:"totalAmount"`
BillableAmount any `json:"billableAmount"`
ProductFeeAmount any `json:"productFeeAmount"`
WalletFeeAmount any `json:"walletFeeAmount"`
GovernmentFeeAmount any `json:"governmentFeeAmount"`
Rate any `json:"rate"`
Currency string `json:"currency"`
} `json:"conversion"`
} `json:"destinationFee"`
} `json:"fees"`
}
TransactionIntentTransaction represents the transaction intent details.
