Documentation ¶
Overview ¶
Package paypack implements the payment.Client for the (https://payments.paypack.rw/paypack)
Index ¶
- type Client
- func (c *Client) Cashin(ctx context.Context, tx *paypack.TransactionRequest) (*paypack.TransactionResponse, error)
- func (c *Client) Cashout(ctx context.Context, tx *paypack.TransactionRequest) (*paypack.TransactionResponse, error)
- func (c *Client) Checkout(ctx context.Context, agent, secret string) (*paypack.Checkout, error)
- func (c *Client) FindTx(ctx context.Context, ref string) (*paypack.Transaction, error)
- func (c *Client) ListEvents(ctx context.Context, options ...paypack.Option) (*paypack.EventList, error)
- func (c *Client) ListTx(ctx context.Context, options ...paypack.Option) (*paypack.Transactions, error)
- func (c *Client) Login(ctx context.Context, clientId, clietnSecret string) (*paypack.Token, error)
- func (c *Client) Profile(ctx context.Context) (*paypack.Merchant, error)
- func (c *Client) Refresh(ctx context.Context, token *paypack.Token) (*paypack.Token, error)
- type Err
- type EventResponse
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(uri string, tr http.RoundTripper) (*Client, error)
New creates a new payment.Client instance backed by the paypack.DriverPaypack
func NewDefault ¶
func NewDefault() *Client
NewDefault returns a new paypack-payments connection for client using the` default "https://payments.paypack.rw/api" address.
func (*Client) Cashin ¶
func (c *Client) Cashin(ctx context.Context, tx *paypack.TransactionRequest) (*paypack.TransactionResponse, error)
Cashin responsible to push refund from your phone to dashboard
func (*Client) Cashout ¶
func (c *Client) Cashout(ctx context.Context, tx *paypack.TransactionRequest) (*paypack.TransactionResponse, error)
Cashout responsible to pull refund from dashboard to your phone
func (*Client) FindTx ¶
FindTx responsible to query transaction information that is corresponding to given ref or return error
func (*Client) ListEvents ¶
func (c *Client) ListEvents(ctx context.Context, options ...paypack.Option) (*paypack.EventList, error)
ListEvents implements the paypack list events with the given query slice parameters
func (*Client) ListTx ¶
func (c *Client) ListTx(ctx context.Context, options ...paypack.Option) (*paypack.Transactions, error)
List handles List http api request for https://payments.paypack.rw/api/transactions/list with paramas eg:["kind=cashin",phone="078xxxx"]
type EventResponse ¶
type EventResponse struct { ID string `json:"event_id"` Kind string `json:"event_kind"` Data json.RawMessage `json:"data"` CreatedAt string `json:"created_at"` }
type Transaction ¶
type Transaction struct { Ref string `json:"ref"` Status string `json:"status"` Amount float64 `json:"amount"` Fee float64 `json:"fee"` Kind string `json:"kind"` Provider string `json:"provider"` Client string `json:"client"` Merchant string `json:"merchant"` Timestamp time.Time `json:"timestamp"` }
Transaction represent transaction data details information from payments-paypack