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
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).
Specs
use_grant(Ecto.Schema.t(), Ecto.Schema.t()) :: Ecto.Schema.t()
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