transferto

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TypeAirtimeTransfered string = "airtime_transferred"

TypeAirtimeTransfered is the type of our airtime transferred event

Variables

View Source
var TypeTransferAirtime = "transfer_airtime"

TypeTransferAirtime is the type constant for our airtime action

Functions

func HasAirtimeStatus

func HasAirtimeStatus(env utils.Environment, arg1 types.XValue, arg2 types.XValue) types.XValue

HasAirtimeStatus returns whether the last airtime transfer has the given status. If there are no airtime transfer events, it returns false.

@(has_airtime_status(run, "success")) -> false

@test has_airtime_status(run, status)

Types

type AirtimeTransferredEvent

type AirtimeTransferredEvent struct {
	events.BaseEvent

	Currency string          `json:"currency"`
	Amount   decimal.Decimal `json:"amount"`
	Status   string          `json:"status"`
}

AirtimeTransferredEvent events are created when airtime has been transferred to the contact

{
  "type": "airtime_transferred",
  "created_on": "2006-01-02T15:04:05Z",
  "currency": "RWF",
  "amount": 100,
  "status": "success"
}

@event airtime_transferred

func NewAirtimeTransferredEvent

func NewAirtimeTransferredEvent(currency string, amount decimal.Decimal) *AirtimeTransferredEvent

NewAirtimeTransferredEvent creates a new airtime transferred event

func NewFailedAirtimeTransferredEvent

func NewFailedAirtimeTransferredEvent() *AirtimeTransferredEvent

NewFailedAirtimeTransferredEvent creates a new failed airtime transferred event

func (*AirtimeTransferredEvent) AllowedOrigin

func (e *AirtimeTransferredEvent) AllowedOrigin() flows.EventOrigin

AllowedOrigin determines where this event type can originate

func (*AirtimeTransferredEvent) Apply

Apply applies this event to the given run

func (*AirtimeTransferredEvent) Type

func (e *AirtimeTransferredEvent) Type() string

Type returns the type of this event

func (*AirtimeTransferredEvent) Validate

func (e *AirtimeTransferredEvent) Validate(assets flows.SessionAssets) error

Validate validates our event is valid and has all the assets it needs

type TransferAirtimeAction

type TransferAirtimeAction struct {
	actions.BaseAction

	Amounts map[string]decimal.Decimal `json:"amounts"`
}

TransferAirtimeAction attempts to make a TransferTo airtime transfer to the contact

func (*TransferAirtimeAction) AllowedFlowTypes added in v0.14.0

func (a *TransferAirtimeAction) AllowedFlowTypes() []flows.FlowType

AllowedFlowTypes returns the flow types which this action is allowed to occur in

func (*TransferAirtimeAction) Execute

func (a *TransferAirtimeAction) Execute(run flows.FlowRun, step flows.Step, log flows.EventLog) error

Execute runs this action

func (*TransferAirtimeAction) Type

func (a *TransferAirtimeAction) Type() string

Type returns the type of this router

func (*TransferAirtimeAction) Validate

func (a *TransferAirtimeAction) Validate(assets flows.SessionAssets) error

Validate validates our action is valid and has all the assets it needs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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