Shopifex v0.4.0 Shopifex.PaymentGuard behaviour View Source

Context behaviour responsible for fetching and using payment grants.

Link to this section Summary

Callbacks

Returns a payment record which grants access to the payment guard. Filters where remaining_usages is greater than 0 or has a nil value (unlimited usage).

Updates the grant to reflect the usage of it in some way. Defaults to decrementing the remaining_usages property if it's not nil. If it is nil, the grant has unlimited usages

Link to this section Callbacks

Link to this callback

grant_for_guard(arg1, arg2)

View Source (optional)

Specs

grant_for_guard(Ecto.Schema.t(), Ecto.Schema.t()) :: Ecto.Schema.t()

Returns a payment record which grants access to the payment guard. Filters where remaining_usages is greater than 0 or has a nil value (unlimited usage).

Link to this callback

use_grant(arg1, arg2)

View Source (optional)

Specs

Updates the grant to reflect the usage of it in some way. Defaults to decrementing the remaining_usages property if it's not nil. If it is nil, the grant has unlimited usages