Documentation
¶
Index ¶
- type APIAnnotation
- type Address
- type Amount
- type Config
- type ConfigProvider
- type Correspondent
- type CreateBulkDepositResponse
- type CreateBulkPayoutResponse
- type CreateDepositRequest
- type CreateDepositResponse
- type CreatePayoutRequest
- type CreatePayoutResponse
- type Deposit
- type DepositRequest
- type DepositStatusResponse
- type FailureReason
- type InitiateRefundResponse
- type MomoMapping
- type OperationType
- type Payer
- type Payout
- type PayoutRequest
- type PayoutStatusResponse
- type PhoneNumber
- type Recipient
- type Refund
- type RefundRequest
- type RefundStatusResponse
- type ResendCallbackRequest
- type Service
- func (s *Service) CreateBulkPayout(timeProvider TimeProviderFunc, data []PayoutRequest) (CreateBulkPayoutResponse, error)
- func (s *Service) CreatePayout(timeProvider TimeProviderFunc, payoutReq PayoutRequest) (CreatePayoutResponse, error)
- func (s *Service) FailEnqueued(payoutId string) (PayoutStatusResponse, error)
- func (s *Service) GetDeposit(depositId string) (Deposit, error)
- func (s *Service) GetPayout(payoutId string) (Payout, error)
- func (s *Service) GetRefund(refundId string) (Refund, error)
- func (s *Service) InitiateBulkDeposit(timeProvider TimeProviderFunc, data []DepositRequest) (CreateBulkDepositResponse, error)
- func (s *Service) InitiateDeposit(timeProvider TimeProviderFunc, depositReq DepositRequest) (CreateDepositResponse, error)
- func (s *Service) RequestRefund(refundId, depositId string, amount Amount) (InitiateRefundResponse, error)
- func (s *Service) ResendDepositCallback(depositId string) (DepositStatusResponse, error)
- func (s *Service) ResendPayoutCallback(payoutId string) (PayoutStatusResponse, error)
- func (s *Service) ResendRefundCallback(refundId string) (RefundStatusResponse, error)
- type TimeProviderFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIAnnotation ¶
type APIAnnotation struct {
URL string `json:"url"`
RequestPayload string `json:"requestPayload"`
ResponsePayload string `json:"responsePayload"`
ResponseCode int `json:"responseCode"`
}
APIAnnotation is a representation of provider api request and response
type Config ¶
Config represents the pawapay config
func GetConfigFromEnvVars ¶
func GetConfigFromEnvVars() Config
GetConfigFromEnvVars returns config configurations from environment variables
func (*Config) AllowLogging ¶
func (c *Config) AllowLogging()
functionality to allow the package log request and responses
func (*Config) AllowRequestLogging ¶
func (c *Config) AllowRequestLogging()
functionality to allow you log request payload. This is only necessary for debugging as all response objects return the api annotation giving all the required details of the request
func (*Config) AllowResponseLogging ¶
func (c *Config) AllowResponseLogging()
functionality to allow you log response payload. This is only necessary for debugging as all response objects return the api annotation giving all the required details of the request
type Correspondent ¶
type Correspondent struct {
Correspondent string `json:"correspondent"`
OperationTypes []OperationType `json:"operationTypes"`
}
type CreateBulkDepositResponse ¶
type CreateBulkDepositResponse struct {
Result []CreateDepositResponse
Annotation APIAnnotation
}
type CreateBulkPayoutResponse ¶
type CreateBulkPayoutResponse struct {
Result []CreatePayoutResponse
Annotation APIAnnotation
}
type CreateDepositRequest ¶
type CreateDepositRequest struct {
DepositId string `json:"depositId"`
Amount string `json:"amount"`
Currency string `json:"currency"`
Country string `json:"country"`
Correspondent string `json:"correspondent"`
Payer Payer `json:"payer"`
CustomerTimestamp string `json:"customerTimestamp"`
StatementDescription string `json:"statementDescription"`
PreAuthorizationCode string `json:"preAuthorisationCode"`
}
type CreateDepositResponse ¶
type CreateDepositResponse struct {
DepositId string `json:"depositId"`
Status string `json:"status"`
Created string `json:"created"`
Annotation APIAnnotation
}
type CreatePayoutRequest ¶
type CreatePayoutRequest struct {
PayoutId string `json:"payoutId"`
Amount string `json:"amount"`
Currency string `json:"currency"`
Country string `json:"country"`
Correspondent string `json:"correspondent"`
Recipient Recipient `json:"recipient"`
CustomerTimestamp string `json:"customerTimestamp"`
StatementDescription string `json:"statementDescription"`
}
type CreatePayoutResponse ¶
type CreatePayoutResponse struct {
PayoutID string `json:"payoutId"`
Status string `json:"status"`
Created string `json:"created"`
Annotation APIAnnotation
}
type Deposit ¶
type Deposit struct {
DepositId string `json:"depositId"`
Status string `json:"status"`
RequestedAmount string `json:"requestedAmount"`
DepositedAmount string `json:"depositedAmount"`
Currency string `json:"currency"`
Country string `json:"country"`
Payer Payer `json:"payer"`
Correspondent string `json:"correspondent"`
StatementDescription string `json:"statementDescription"`
CustomerTimestamp string `json:"customerTimestamp"`
Created string `json:"created"`
RespondedByPayer string `json:"respondedByPayer"`
CorrespondentIds map[string]interface{} `json:"correspondentIds"`
SuspiciousActivity map[string]interface{} `json:"suspiciousActivityReport"`
FailureReason FailureReason `json:"failureReason"`
Annotation APIAnnotation
}
type DepositRequest ¶
type DepositStatusResponse ¶
type DepositStatusResponse struct {
DepositId string `json:"depositId"`
Status string `json:"status"`
Annotation APIAnnotation
}
type FailureReason ¶
type InitiateRefundResponse ¶
type InitiateRefundResponse struct {
RefundId string `json:"depositId"`
Status string `json:"status"`
Created string `json:"created"`
Annotation APIAnnotation
}
type MomoMapping ¶
type MomoMapping struct {
Country string `json:"country"`
Extension string `json:"extension"`
Correspondents []Correspondent `json:"correspondents"`
}
func GetAllCorrespondents ¶
func GetAllCorrespondents() ([]MomoMapping, error)
type OperationType ¶
type Payout ¶
type Payout struct {
Amount string `json:"amount"`
Correspondent string `json:"correspondent"`
CorrespondentIds map[string]interface{} `json:"correspondentIds"`
Country string `json:"country"`
Created string `json:"created"`
Currency string `json:"currency"`
CustomerTimestamp string `json:"customerTimestamp"`
PayoutID string `json:"payoutId"`
Recipient Recipient `json:"recipient"`
StatementDescription string `json:"statementDescription"`
Status string `json:"status"`
FailureReason FailureReason `json:"failureReason"`
Annotation APIAnnotation
}
func (Payout) IsNotFound ¶
IsNotFound checks a payout response to see if the transaction is not found
func (Payout) IsSuccessful ¶
IsSuccessful reports if a payout is successful
type PayoutRequest ¶
type PayoutRequest struct {
PayoutId string
Amount Amount
Description string
PhoneNumber PhoneNumber
Correspondent string
}
type PayoutStatusResponse ¶
type PayoutStatusResponse struct {
PayoutId string `json:"payoutId"`
Status string `json:"status"`
Annotation APIAnnotation
}
type PhoneNumber ¶
PhoneNumber holds country code and number, eg countryCode:234, number: 7017238745
type Refund ¶
type Refund struct {
RefundId string `json:"refundId"`
Status string `json:"status"`
Amount string `json:"amount"`
Currency string `json:"currency"`
Country string `json:"country"`
Recipient Recipient `json:"recipient"`
Correspondent string `json:"correspondent"`
StatementDescription string `json:"statementDescription"`
CustomerTimestamp string `json:"customerTimestamp"`
Created string `json:"created"`
ReceivedByRecipient string `json:"receivedByRecipient"`
CorrespondentIds map[string]interface{} `json:"correspondentIds"`
FailureReason FailureReason `json:"failureReason"`
Annotation APIAnnotation
}
type RefundRequest ¶
type RefundStatusResponse ¶
type RefundStatusResponse struct {
RefundId string `json:"refundId"`
Status string `json:"status"`
Annotation APIAnnotation
}
type ResendCallbackRequest ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a representation of a pawapay service
func (*Service) CreateBulkPayout ¶
func (s *Service) CreateBulkPayout(timeProvider TimeProviderFunc, data []PayoutRequest) (CreateBulkPayoutResponse, error)
CreateBulkPayout provides the functionality of creating a bulk payout See docs https://docs.pawapay.co.uk/#operation/createPayout for more details
func (*Service) CreatePayout ¶
func (s *Service) CreatePayout(timeProvider TimeProviderFunc, payoutReq PayoutRequest) (CreatePayoutResponse, error)
CreatePayout provides the functionality of creating a payout See docs https://docs.pawapay.co.uk/#operation/createPayout for more details
func (*Service) FailEnqueued ¶
func (s *Service) FailEnqueued(payoutId string) (PayoutStatusResponse, error)
FailEnqueued provides the functionality of failing an already created payout See docs https://docs.pawapay.co.uk/#operation/payoutsFailEnqueued for more details
func (*Service) GetDeposit ¶
GetDeposit provides the functionality of retrieving a deposit See docs https://docs.pawapay.co.uk/#operation/getDeposit for more details
func (*Service) GetPayout ¶
GetPayout provides the functionality of retrieving a payout See docs https://docs.pawapay.co.uk/#operation/getPayout for more details
func (*Service) GetRefund ¶
GetRefund provides the functionality of retrieving an initiated refund See docs https://docs.pawapay.co.uk/#operation/getRefund for more details
func (*Service) InitiateBulkDeposit ¶
func (s *Service) InitiateBulkDeposit(timeProvider TimeProviderFunc, data []DepositRequest) (CreateBulkDepositResponse, error)
CreateBulkDeposit provides the functionality of creating a bulk deposit See docs https://docs.pawapay.co.uk/#operation/createDeposits for more details
func (*Service) InitiateDeposit ¶
func (s *Service) InitiateDeposit(timeProvider TimeProviderFunc, depositReq DepositRequest) (CreateDepositResponse, error)
InitiateDeposit provides the functionality of initiating a deposit for the sender to confirm See docs https://docs.pawapay.co.uk/#operation/createDesposit for more details
func (*Service) RequestRefund ¶
func (s *Service) RequestRefund(refundId, depositId string, amount Amount) (InitiateRefundResponse, error)
RequestRefund provides the functionality of requesting a refund for an initiated deposit See docs https://docs.pawapay.co.uk/#operation/depositWebhook for more details
func (*Service) ResendDepositCallback ¶
func (s *Service) ResendDepositCallback(depositId string) (DepositStatusResponse, error)
ResendDepositCallback provides the functionality of resending a callback (webhook) for a deposit See docs https://docs.pawapay.co.uk/#operation/depositsResendCallback for more details
func (*Service) ResendPayoutCallback ¶
func (s *Service) ResendPayoutCallback(payoutId string) (PayoutStatusResponse, error)
ResendPayoutCallback provides the functionality of resending a callback (webhook) See docs https://docs.pawapay.co.uk/#operation/payoutsResendCallback for more details
func (*Service) ResendRefundCallback ¶
func (s *Service) ResendRefundCallback(refundId string) (RefundStatusResponse, error)
ResendRefundCallback provides the functionality of resending a callback (webhook) See docs https://docs.pawapay.co.uk/#operation/refundsResendCallback for more details
type TimeProviderFunc ¶
TimeProviderFunc represents a provider of time
