Documentation
¶
Index ¶
- Constants
- Variables
- type CheckPaymentResponse
- type DemoWorkflow
- func (m *DemoWorkflow) Approve() (*models.NextState, error)
- func (m *DemoWorkflow) Description() string
- func (m *DemoWorkflow) GetAllStates() []models.WorkflowState
- func (m *DemoWorkflow) GetRetryConfig() models.RetryConfig
- func (m *DemoWorkflow) GetStateVariables() map[string]string
- func (m *DemoWorkflow) GetWorkflowData() *domain.Workflow
- func (m *DemoWorkflow) Init() (*models.NextState, error)
- func (m *DemoWorkflow) InitialState() string
- func (m *DemoWorkflow) Review() (*models.NextState, error)
- func (m *DemoWorkflow) Setup(wf *domain.Workflow)
- func (m *DemoWorkflow) StateTransitions() map[string][]string
- type EnrollmentStruct
- type ExpressCheckoutRequest
- type ExpressCheckoutResponse
- type GetIpWorkflow
- func (m *GetIpWorkflow) Description() string
- func (m *GetIpWorkflow) GetAllStates() []models.WorkflowState
- func (m *GetIpWorkflow) GetRetryConfig() models.RetryConfig
- func (m *GetIpWorkflow) GetStateVariables() map[string]string
- func (m *GetIpWorkflow) GetWorkflowData() *domain.Workflow
- func (m *GetIpWorkflow) Init() (*models.NextState, error)
- func (m *GetIpWorkflow) InitialState() string
- func (m *GetIpWorkflow) Setup(wf *domain.Workflow)
- func (m *GetIpWorkflow) StateGetIpData() (*models.NextState, error)
- func (m *GetIpWorkflow) StateTransitions() map[string][]string
- type MerchantTraceRequest
- type PaynowClient
- func (c *PaynowClient) CreateExpressCheckout(ctx context.Context, req ExpressCheckoutRequest) (*ExpressCheckoutResponse, error)
- func (c *PaynowClient) GetMerchantTrace(ctx context.Context, req MerchantTraceRequest) (*CheckPaymentResponse, error)
- func (c *PaynowClient) PollStatus(ctx context.Context, pollUrl string) (*CheckPaymentResponse, error)
- type Provider
Constants ¶
View Source
const VAR_AGE = "age"
View Source
const VAR_IP = "ip"
View Source
const VAR_NAME = "name"
Variables ¶
View Source
var StateApprove string = "Approve"
View Source
var StateApproveError string = "ApproveError"
View Source
var StateFinish string = "Finish"
Define a named string type
View Source
var StateGetIpData string = "StateGetIpData"
Define a named string type
View Source
var StateInit string = "Init"
View Source
var StateReview string = "Review"
Functions ¶
This section is empty.
Types ¶
type CheckPaymentResponse ¶
type DemoWorkflow ¶
type DemoWorkflow struct {
core.BaseWorkflow
}
func (*DemoWorkflow) Description ¶
func (m *DemoWorkflow) Description() string
func (*DemoWorkflow) GetAllStates ¶
func (m *DemoWorkflow) GetAllStates() []models.WorkflowState
func (*DemoWorkflow) GetRetryConfig ¶
func (m *DemoWorkflow) GetRetryConfig() models.RetryConfig
func (*DemoWorkflow) GetStateVariables ¶
func (m *DemoWorkflow) GetStateVariables() map[string]string
func (*DemoWorkflow) GetWorkflowData ¶
func (m *DemoWorkflow) GetWorkflowData() *domain.Workflow
func (*DemoWorkflow) Init ¶
func (m *DemoWorkflow) Init() (*models.NextState, error)
Each method returns the next state
func (*DemoWorkflow) InitialState ¶
func (m *DemoWorkflow) InitialState() string
func (*DemoWorkflow) Setup ¶
func (m *DemoWorkflow) Setup(wf *domain.Workflow)
func (*DemoWorkflow) StateTransitions ¶
func (m *DemoWorkflow) StateTransitions() map[string][]string
type EnrollmentStruct ¶
type ExpressCheckoutRequest ¶
type ExpressCheckoutRequest struct {
Id string `json:"id"`
Reference string `json:"reference"`
AuthEmail string `json:"email,omitempty"`
Amount float64 `json:"amount"`
Method Provider `json:"method"`
Phone string `json:"phone"`
ReturnURL string `json:"returnurl,omitempty"`
ResultURL string `json:"resulturl,omitempty"`
AdditionalInfo string `json:"additionalinfo,omitempty"`
MerchantTrace string `json:"merchanttrace,omitempty"`
Status string `json:"status,omitempty"`
Hash string `json:"hash,omitempty"`
}
ExpressCheckoutRequest is the payload for creating an Express Checkout transaction.
type ExpressCheckoutResponse ¶
type ExpressCheckoutResponse struct {
Status string `json:"status"`
Instructions string `json:"instructions,omitempty"`
PayNowReference string `json:"paynowreference,omitempty"`
PollURL string `json:"pollurl,omitempty"`
Hash string `json:"hash,omitempty"`
OtpReference string `json:"otpreference,omitempty"`
RemoteOtpUrl string `json:"remoteotpurl,omitempty"`
}
ExpressCheckoutResponse represents the most relevant parts of the Paynow response.
type GetIpWorkflow ¶
type GetIpWorkflow struct {
core.BaseWorkflow
}
func (*GetIpWorkflow) Description ¶
func (m *GetIpWorkflow) Description() string
func (*GetIpWorkflow) GetAllStates ¶
func (m *GetIpWorkflow) GetAllStates() []models.WorkflowState
func (*GetIpWorkflow) GetRetryConfig ¶
func (m *GetIpWorkflow) GetRetryConfig() models.RetryConfig
func (*GetIpWorkflow) GetStateVariables ¶
func (m *GetIpWorkflow) GetStateVariables() map[string]string
func (*GetIpWorkflow) GetWorkflowData ¶
func (m *GetIpWorkflow) GetWorkflowData() *domain.Workflow
func (*GetIpWorkflow) Init ¶
func (m *GetIpWorkflow) Init() (*models.NextState, error)
Each method returns the next state
func (*GetIpWorkflow) InitialState ¶
func (m *GetIpWorkflow) InitialState() string
func (*GetIpWorkflow) Setup ¶
func (m *GetIpWorkflow) Setup(wf *domain.Workflow)
func (*GetIpWorkflow) StateGetIpData ¶
func (m *GetIpWorkflow) StateGetIpData() (*models.NextState, error)
func (*GetIpWorkflow) StateTransitions ¶
func (m *GetIpWorkflow) StateTransitions() map[string][]string
type MerchantTraceRequest ¶
type PaynowClient ¶
type PaynowClient struct {
IntegrationID string
IntegrationKey string
HTTPClient *http.Client // optional
// contains filtered or unexported fields
}
PaynowClient holds credentials and HTTP client configuration.
func NewClient ¶
func NewClient(integrationID, integrationKey string) *PaynowClient
NewClient creates a Paynow client with sane defaults.
func (*PaynowClient) CreateExpressCheckout ¶
func (c *PaynowClient) CreateExpressCheckout(ctx context.Context, req ExpressCheckoutRequest) (*ExpressCheckoutResponse, error)
CreateExpressCheckout creates an Express Checkout transaction for the given mobile wallet provider. It returns a response containing poll URL/redirect URL and status. The function is generic to support EcoCash, OneMoney, InnBucks, and O'mari (Omari).
func (*PaynowClient) GetMerchantTrace ¶
func (c *PaynowClient) GetMerchantTrace(ctx context.Context, req MerchantTraceRequest) (*CheckPaymentResponse, error)
func (*PaynowClient) PollStatus ¶
func (c *PaynowClient) PollStatus(ctx context.Context, pollUrl string) (*CheckPaymentResponse, error)
Click to show internal directories.
Click to hide internal directories.