Module: Unit::Reward
- Defined in:
- lib/unit/models/reward/reward.rb,
lib/unit/models/reward/get_request.rb,
lib/unit/models/reward/list_reward_params.rb,
lib/unit/models/reward/create_reward_request.rb
Defined Under Namespace
Classes: CreateRewardRequest, GetRequest, ListRewardParams
Constant Summary collapse
- REWARD_LIMIT =
100
- REWARD_OFFSET =
0
Class Method Summary collapse
-
.create_reward(receiving_account_id:, amount:, description:, tags:, idempotency_key:, funding_account_id: nil, rewarded_transaction: nil) ⇒ Object
Create a reward request.
-
.get_reward(reward_id:, include: nil) ⇒ Object
Get a reward by id.
-
.list_rewards(limit: REWARD_LIMIT, offset: REWARD_OFFSET, transaction_id: nil, rewarded_transaction_id: nil, receiving_account_id: nil, customer_id: nil, card_id: nil, status: nil, since: nil, until_: nil, tags: nil, sort: nil, include: nil) ⇒ Object
List reward params request.
Class Method Details
.create_reward(receiving_account_id:, amount:, description:, tags:, idempotency_key:, funding_account_id: nil, rewarded_transaction: nil) ⇒ Object
Create a reward request
29 30 31 32 |
# File 'lib/unit/models/reward/reward.rb', line 29 def create_reward(receiving_account_id:, amount:, description:, tags:, idempotency_key:, funding_account_id: nil, rewarded_transaction: nil) request = CreateRewardRequest.new(receiving_account_id, amount, description, , idempotency_key, funding_account_id, rewarded_transaction) Resource::RewardResource.create_reward(request) end |
.get_reward(reward_id:, include: nil) ⇒ Object
Get a reward by id
15 16 17 18 |
# File 'lib/unit/models/reward/reward.rb', line 15 def get_reward(reward_id:, include: nil) request = GetRequest.new(reward_id, include) Resource::RewardResource.get_reward(request) end |
.list_rewards(limit: REWARD_LIMIT, offset: REWARD_OFFSET, transaction_id: nil, rewarded_transaction_id: nil, receiving_account_id: nil, customer_id: nil, card_id: nil, status: nil, since: nil, until_: nil, tags: nil, sort: nil, include: nil) ⇒ Object
List reward params request
49 50 51 52 |
# File 'lib/unit/models/reward/reward.rb', line 49 def list_rewards(limit: REWARD_LIMIT, offset: REWARD_OFFSET, transaction_id: nil, rewarded_transaction_id: nil, receiving_account_id: nil, customer_id: nil, card_id: nil, status: nil, since: nil, until_: nil, tags: nil, sort: nil, include: nil) request = ListRewardParams.new(limit, offset, transaction_id, rewarded_transaction_id, receiving_account_id, customer_id, card_id, status, since, until_, , sort, include) Resource::RewardResource.list_rewards(request) end |