Documentation ¶
Index ¶
Constants ¶
const TypeAirtimeTransfered string = "airtime_transferred"
TypeAirtimeTransfered is the type of our airtime transferred event
Variables ¶
var TypeTransferAirtime = "transfer_airtime"
TypeTransferAirtime is the type constant for our airtime action
Functions ¶
func HasAirtimeStatus ¶
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 ¶
func (e *AirtimeTransferredEvent) Apply(run flows.FlowRun) error
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) 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