-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-By: Patryk Smolarz <[email protected]>
- Loading branch information
1 parent
a77b09f
commit 70defbc
Showing
2,461 changed files
with
168,123 additions
and
103,064 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require_relative 'utils.rb' | ||
require 'VoucherifySdk' | ||
|
||
def update_loyalty_card_balance(loyalties_api_instance, memberId) | ||
begin | ||
updated_loyalty_member_card = loyalties_api_instance.update_loyalty_card_balance(memberId, { | ||
loyalties_members_balance_update_request_body: VoucherifySdk::LoyaltiesMembersBalanceUpdateRequestBody.new({ | ||
points: 2000 | ||
}) | ||
}) | ||
|
||
return updated_loyalty_member_card | ||
|
||
rescue VoucherifySdk::ApiError => e | ||
retun nil | ||
end | ||
end | ||
|
||
def list_loyalty_card_transactions(loyalties_api_instance, memberId) | ||
begin | ||
transactions = loyalties_api_instance.list_loyalty_card_transactions(memberId, | ||
{ | ||
limit: 10, | ||
page: 1 | ||
}) | ||
|
||
return transactions | ||
|
||
rescue VoucherifySdk::ApiError => e | ||
return nil | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
require_relative 'utils.rb' | ||
require 'VoucherifySdk' | ||
|
||
def create_order(order_api_instance) | ||
begin | ||
created_order = order_api_instance.create_order({ | ||
orders_create_request_body: VoucherifySdk::OrdersCreateRequestBody.new({ | ||
amount: 10000, | ||
status: 'CREATED', | ||
items: [ | ||
{ | ||
product_id: 'test_order_item1', | ||
quantity: 1 | ||
}, | ||
{ | ||
product_id: 'test_order_item2', | ||
quantity: 1 | ||
} | ||
] | ||
}) | ||
}) | ||
|
||
return created_order | ||
|
||
rescue VoucherifySDk::ApiError => e | ||
return nil | ||
end | ||
end | ||
|
||
def get_order(order_api_instance, orderId) | ||
begin | ||
order = order_api_instance.get_order(orderId) | ||
|
||
return order | ||
|
||
rescue VoucherifySdk::ApiError => e | ||
return nil | ||
end | ||
end | ||
|
||
def update_order(order_api_instance, orderId) | ||
updated_order = order_api_instance.update_order(orderId, { | ||
orders_update_request_body: VoucherifySdk::OrdersUpdateRequestBody.new({ | ||
amount: 30000, | ||
status: 'PAID' | ||
}) | ||
}) | ||
|
||
return updated_order | ||
|
||
rescue VoucherifySdk::ApiError => e | ||
return nil | ||
end | ||
|
||
def list_orders(order_api_instance) | ||
begin | ||
orders = order_api_instance.list_orders({ | ||
limit: 10, | ||
page: 1 | ||
}) | ||
|
||
return orders | ||
|
||
rescue VoucherifySdk::ApiError => e | ||
return nil | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.