subscriptions

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PathCat added in v0.0.4

func PathCat(base string, token string, action string) string

Types

type AdHocSubscriptionChargeReq

type AdHocSubscriptionChargeReq struct {
	Amount          types.Numeric      `payfast:"amount,body,numeric,required"`                // The amount which the buyer must pay, in CENTS (ZAR).
	ItemName        types.AlphaNumeric `payfast:"item_name,body,alphanumeric,required"`        // The name of the item being charged for.
	ItemDescription types.AlphaNumeric `payfast:"item_description,body,alphanumeric,optional"` // The name of the item being charged for.
	ITN             types.Bool         `payfast:"itn,body,bool,optional"`                      // Specify whether an ITN must be sent for the ad hoc charge (1 by default).
	MPaymentID      types.AlphaNumeric `payfast:"m_payment_id,body,alphanumeric,optional"`     // Unique payment ID on the merchant’s system.
	CreditCardCVV   types.Numeric      `payfast:"cc_cvv,body,numeric,optional"`                // The credit card cvv number.
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func Create

func Create(get types.RemoteCall, put types.RemoteCall, patch types.RemoteCall, post types.RemoteCall) *Client

func (*Client) AdHocCharge

func (c *Client) AdHocCharge(token string, payload AdHocSubscriptionChargeReq) (bool, error)

func (*Client) Cancel

func (c *Client) Cancel(token string) (bool, error)

func (*Client) Fetch

func (c *Client) Fetch(token string) (*types.Subscription, error)

func (*Client) Pause

func (c *Client) Pause(token string, payload PauseSubscriptionReq) (bool, error)

func (*Client) Unpause

func (c *Client) Unpause(token string) (bool, error)

func (*Client) Update

func (c *Client) Update(token string, payload UpdateSubscriptionReq) (*types.Subscription, error)

type PauseSubscriptionReq

type PauseSubscriptionReq struct {
	Cycles types.Numeric `payfast:"cycles,body,numeric,optional"`
}

type UpdateSubscriptionReq

type UpdateSubscriptionReq struct {
	Cycles    types.Numeric `payfast:"cycles,body,numeric,optional"`      // The number of cycles for the subscription.
	Frequency types.Numeric `payfast:"frequency,body,numeric,optional"`   // The frequency for the subscription
	RunDate   types.Time    `payfast:"run_date,body,yyyy-mm-dd,optional"` // The next run date for the subscription. YYYY-MM-DD
	Amount    types.Numeric `payfast:"amount,body,numeric,optional"`      // The amount which the buyer must pay, in CENTS (ZAR).
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL