Giter Club home page Giter Club logo

voucherify-ruby-sdk's Introduction

Voucherify Ruby SDK

Official Voucherify SDK for Ruby

Gem Version Gem Downloads License GitHub issues

Voucherify empowers marketers and developers with flexible building blocks to come up with, implement, and track targeted promotional campaigns.

Learn more about Voucherify by visiting our site.

This SDK is automatically generated by the OpenAPI Generator based on our Documentation with v2018-08-01 version.

The legacy version of Ruby SDK could be found here

๐Ÿ“ Documentation

You will find detailed description and example responses at our official documentation. Most method headers point to more detailed descriptions of arguments you can use.

๐Ÿ“š Want to learn more? Visit our official site or our Success Portal.

๐Ÿ‘ฝ Having troubles? Check our Help center.

๐Ÿงช Looking for promotion ideas? Check our Cookbook to get an inspiration.

๐Ÿ› Encounter a bug? Please file a report in the Issues.

โš™๏ธ Installation

Gem Repository

The SDK is hosted in RubeGems and could be easy obtained by adding this line to Your application's Gemfile:

gem 'voucherify'

And then execute:

bundle install

Or install it yourself as:

gem install voucherify

๐Ÿš€ Running code

When You have Voucherify gem installed You could use pre-created example.rb with example code for testing purpose.

# Load the gem
require 'VoucherifySdk'

# Setup authorization
VoucherifySdk.configure do |config|
    # Configure API key authorization: X-App-Id
    config.api_key['X-App-Id'] = 'YOUR API KEY'

    # Configure API key authorization: X-App-Token
    config.api_key['X-App-Token'] = 'YOUR API KEY'

    # (Optional) Configure Voucherify cluster, default is https://api.voucherify.io
    # config.host = 'https://us1.api.voucherify.io'
end

# Creating API Instance
api_instance = VoucherifySdk::CampaignsApi.new

# Calling list_campaigns
begin
    result = api_instance.list_campaigns()
    puts result
rescue VoucherifySdk::ApiError => e
    puts "Exception when calling VouchersApi->list_campaigns: #{e}"
end

Code could be run from the directory where the file is placed (root for this repository), by using:

ruby example.rb

Or, if You're using bundler:

bundle exec ruby example.rb

๐Ÿ›ก๏ธ This code does simple campaign list, so it won't affect Your Voucherify data.

๐Ÿ”’ Remember to fill Your Voucherify keys for the valid authorization.

๐Ÿ’… More examples and good practices You could find in the EXAMPLES.md document.

๐Ÿณ Running local tests with docker

  1. Copy .env.example to .env and fill in the values.
  2. Run docker build -t ruby . to build the image.
  3. Run docker run --rm ruby to run the tests and delete container immediately after.

๐Ÿ› ๏ธ Contributing

Read more about how to Contribute to Voucherify Ruby SDK by visiting main repo GENERATING-SDKS.md

Remember that this SDK is auto generated (except of the tests) so changes made here will be overwritten by generator.

๐Ÿ“… Changelog

  • 2024-05-08 - 5.0.1 - Added support for Create validation rule assignment

  • 2024-03-11 - 5.0.0 - The new version of the SKD includes coverage for all the most commonly used Voucherify endpoints and supports typed models.

Previous versions of the API are no longer supported, and we highly recommend upgrading to version 5.0.0, which is now designated as Long-Term Support (LTS).

Changelog for previous versions could be found in the CHANGELOG.md file

๐Ÿ” Documentation for Authorization

# Setup authorization
VoucherifySdk.configure do |config|
    # Application Keys
    config.api_key['X-App-Id'] = 'YOUR API ID'
    config.api_key['X-App-Token'] = 'YOUR API TOKEN'

    # Client-side Keys
    config.api_key['X-Client-Application-Id'] = 'YOUR CLIENT API ID'
    config.api_key['X-Client-Token'] = 'YOUR CLIENT API TOKEN'

    # Cluster (Optional)
    # default is https://api.voucherify.io
    config.host = 'https://us1.api.voucherify.io'
end

๐ŸŒ Documentation for API Endpoints

All URIs are relative to https://api.voucherify.io

Class Method HTTP request Description
VoucherifySdk::CampaignsApi add_voucher_with_specific_code_to_campaign POST /v1/campaigns/{campaignId}/vouchers/{code} Add Voucher with Specific Code to Campaign
VoucherifySdk::CampaignsApi add_vouchers_to_campaign POST /v1/campaigns/{campaignId}/vouchers Add Vouchers to Campaign
VoucherifySdk::CampaignsApi create_campaign POST /v1/campaigns Create Campaign
VoucherifySdk::CampaignsApi delete_campaign DELETE /v1/campaigns/{campaignId} Delete Campaign
VoucherifySdk::CampaignsApi disable_campaign POST /v1/campaigns/{campaignId}/disable Disable Campaign
VoucherifySdk::CampaignsApi enable_campaign POST /v1/campaigns/{campaignId}/enable Enable Campaign
VoucherifySdk::CampaignsApi get_campaign GET /v1/campaigns/{campaignId} Get Campaign
VoucherifySdk::CampaignsApi import_vouchers_to_campaign POST /v1/campaigns/{campaignId}/import Import Vouchers to Campaign
VoucherifySdk::CampaignsApi import_vouchers_to_campaign_using_csv POST /v1/campaigns/{campaignId}/importCSV Import Vouchers to Campaign by CSV
VoucherifySdk::CampaignsApi list_campaigns GET /v1/campaigns List Campaigns
VoucherifySdk::CampaignsApi update_campaign PUT /v1/campaigns/{campaignId} Update Campaign
VoucherifySdk::CategoriesApi create_category POST /v1/categories Create Category
VoucherifySdk::CategoriesApi delete_category DELETE /v1/categories/{categoryId} Delete Category
VoucherifySdk::CategoriesApi get_category GET /v1/categories/{categoryId} Get Category
VoucherifySdk::CategoriesApi list_categories GET /v1/categories List Categories
VoucherifySdk::CategoriesApi update_category PUT /v1/categories/{categoryId} Update Category
VoucherifySdk::ClientSideApi check_eligibility_client_side POST /client/v1/qualifications Check Eligibility (client-side)
VoucherifySdk::ClientSideApi redeem_stacked_discounts_client_side POST /client/v1/redemptions Redeem Stackable Discounts (client-side)
VoucherifySdk::ClientSideApi track_custom_event_client_side POST /client/v1/events Track Custom Event (client-side)
VoucherifySdk::ClientSideApi update_customers_consents_client_side PUT /client/v1/customers/{customerId}/consents Update Customer's consents (client-side)
VoucherifySdk::ClientSideApi validate_stacked_discounts_client_side POST /client/v1/validations Validate Stackable Discounts (client-side)
VoucherifySdk::CustomersApi create_customer POST /v1/customers Create Customer
VoucherifySdk::CustomersApi customer_permanently_deletion POST /v1/customers/{customerId}/permanent-deletion Delete Customer Permanently
VoucherifySdk::CustomersApi delete_customer DELETE /v1/customers/{customerId} Delete Customer
VoucherifySdk::CustomersApi get_customer GET /v1/customers/{customerId} Get Customer
VoucherifySdk::CustomersApi import_customers_using_csv POST /v1/customers/importCSV Import and Update Customers using CSV
VoucherifySdk::CustomersApi list_customer_activities GET /v1/customers/{customerId}/activities List Customer Activities
VoucherifySdk::CustomersApi list_customer_segments GET /v1/customers/{customerId}/segments List Customer's Segments
VoucherifySdk::CustomersApi list_customers GET /v1/customers List Customers
VoucherifySdk::CustomersApi update_customer PUT /v1/customers/{customerId} Update Customer
VoucherifySdk::CustomersApi update_customers_consents PUT /v1/customers/{customerId}/consents Update Customer's consents
VoucherifySdk::CustomersApi update_customers_in_bulk POST /v1/customers/bulk/async Update Customers in bulk
VoucherifySdk::CustomersApi update_customers_metadata_in_bulk POST /v1/customers/metadata/async Update Customers' Metadata in bulk
VoucherifySdk::EventsApi track_custom_event POST /v1/events Track Custom Event
VoucherifySdk::ExportsApi create_export POST /v1/exports Create Export
VoucherifySdk::ExportsApi delete_export DELETE /v1/exports/{exportId} Delete Export
VoucherifySdk::ExportsApi download_export GET /v1/exports/{export_Id} Download Export
VoucherifySdk::ExportsApi get_export GET /v1/exports/{exportId} Get Export
VoucherifySdk::ExportsApi list_exports GET /v1/exports List Exports
VoucherifySdk::LoyaltiesApi create_in_bulk_loyalty_tiers POST /v1/loyalties/{campaignId}/tiers Create loyalty tiers
VoucherifySdk::LoyaltiesApi delete_earning_rule DELETE /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} Delete Earning Rule
VoucherifySdk::LoyaltiesApi delete_loyalty_program DELETE /v1/loyalties/{campaignId} Delete Loyalty Campaign
VoucherifySdk::LoyaltiesApi delete_reward_assignment1 DELETE /v1/loyalties/{campaignId}/rewards/{assignmentId} Delete Reward Assignment
VoucherifySdk::LoyaltiesApi disable_earning_rule POST /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable Disable Earning Rule
VoucherifySdk::LoyaltiesApi enable_earning_rule POST /v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable Enable Earning Rule
VoucherifySdk::LoyaltiesApi export_loyalty_card_transactions POST /v1/loyalties/members/{memberId}/transactions/export Export Loyalty Card Transactions
VoucherifySdk::LoyaltiesApi export_loyalty_card_transactions1 POST /v1/loyalties/{campaignId}/members/{memberId}/transactions/export Export Loyalty Card Transactions
VoucherifySdk::LoyaltiesApi get_earning_rule GET /v1/loyalties/{campaignId}/earning-rules/{earningRuleId} Get Earning Rule
VoucherifySdk::LoyaltiesApi get_loyalty_tier GET /v1/loyalties/{campaignId}/tiers/{loyaltyTierId} Get Loyalty Tier
VoucherifySdk::LoyaltiesApi get_reward_assignment1 GET /v1/loyalties/{campaignId}/reward-assignments/{assignmentId} Get Reward Assignment
VoucherifySdk::LoyaltiesApi get_reward_assignment2 GET /v1/loyalties/{campaignId}/rewards/{assignmentId} Get Reward Assignment
VoucherifySdk::LoyaltiesApi get_reward_details GET /v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward Get Reward Details
VoucherifySdk::LoyaltiesApi list_loyalty_card_transactions GET /v1/loyalties/members/{memberId}/transactions List Loyalty Card Transactions
VoucherifySdk::LoyaltiesApi list_loyalty_card_transactions1 GET /v1/loyalties/{campaignId}/members/{memberId}/transactions List Loyalty Card Transactions
VoucherifySdk::LoyaltiesApi list_loyalty_tier_earning_rules GET /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/earning-rules List Loyalty Tier Earning Rules
VoucherifySdk::LoyaltiesApi list_loyalty_tier_rewards GET /v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/rewards List Loyalty Tier Rewards
VoucherifySdk::LoyaltiesApi list_loyalty_tiers GET /v1/loyalties/{campaignId}/tiers List Loyalty Tiers
VoucherifySdk::LoyaltiesApi list_member_loyalty_tier GET /v1/loyalties/members/{memberId}/tiers List Member's Loyalty Tiers
VoucherifySdk::LoyaltiesApi list_member_rewards GET /v1/loyalties/members/{memberId}/rewards List Member Rewards
VoucherifySdk::LoyaltiesApi list_points_expiration GET /v1/loyalties/{campaignId}/members/{memberId}/points-expiration Get Points Expiration
VoucherifySdk::LoyaltiesApi redeem_reward POST /v1/loyalties/members/{memberId}/redemption Redeem Reward
VoucherifySdk::LoyaltiesApi redeem_reward1 POST /v1/loyalties/{campaignId}/members/{memberId}/redemption Redeem Reward
VoucherifySdk::LoyaltiesApi transfer_points POST /v1/loyalties/{campaignId}/members/{memberId}/transfers Transfer Loyalty Points
VoucherifySdk::LoyaltiesApi update_loyalty_card_balance POST /v1/loyalties/members/{memberId}/balance Add or Remove Loyalty Card Balance
VoucherifySdk::LoyaltiesApi update_loyalty_card_balance1 POST /v1/loyalties/{campaignId}/members/{memberId}/balance Add or Remove Loyalty Card Balance
VoucherifySdk::OrdersApi create_order POST /v1/orders Create Order
VoucherifySdk::OrdersApi create_order_export POST /v1/orders/export Create Orders Export
VoucherifySdk::OrdersApi get_order GET /v1/orders/{orderId} Get Order
VoucherifySdk::OrdersApi import_orders POST /v1/orders/import Import Orders
VoucherifySdk::OrdersApi list_orders GET /v1/orders List Orders
VoucherifySdk::OrdersApi update_order PUT /v1/orders/{orderId} Update Order
VoucherifySdk::ProductCollectionsApi create_product_collection POST /v1/product-collections Create Product Collection
VoucherifySdk::ProductCollectionsApi delete_product_collection DELETE /v1/product-collections/{productCollectionId} Delete Product Collection
VoucherifySdk::ProductCollectionsApi get_product_collection GET /v1/product-collections/{productCollectionId} Get Product Collection
VoucherifySdk::ProductCollectionsApi list_product_collections GET /v1/product-collections List Product Collections
VoucherifySdk::ProductCollectionsApi list_products_in_collection GET /v1/product-collections/{productCollectionId}/products List Products in Collection
VoucherifySdk::ProductsApi create_product POST /v1/products Create Product
VoucherifySdk::ProductsApi create_sku POST /v1/products/{productId}/skus Create SKU
VoucherifySdk::ProductsApi delete_product DELETE /v1/products/{productId} Delete Product
VoucherifySdk::ProductsApi delete_sku DELETE /v1/products/{productId}/skus/{skuId} Delete SKU
VoucherifySdk::ProductsApi get_product GET /v1/products/{productId} Get Product
VoucherifySdk::ProductsApi get_sku GET /v1/skus/{skuId} Get SKU
VoucherifySdk::ProductsApi import_products_using_csv POST /v1/products/importCSV Import Products using CSV
VoucherifySdk::ProductsApi import_skus_using_csv POST /v1/skus/importCSV Import SKUs using CSV
VoucherifySdk::ProductsApi list_products GET /v1/products List Products
VoucherifySdk::ProductsApi list_skus_in_product GET /v1/products/{productId}/skus List SKUs in Product
VoucherifySdk::ProductsApi update_product PUT /v1/products/{productId} Update Product
VoucherifySdk::ProductsApi update_products_in_bulk POST /v1/products/bulk/async Update Products in bulk
VoucherifySdk::ProductsApi update_products_metadata_in_bulk POST /v1/products/metadata/async Update Products' Metadata in bulk
VoucherifySdk::ProductsApi update_sku PUT /v1/products/{productId}/skus/{skuId} Update SKU
VoucherifySdk::PromotionsApi create_promotion_stack POST /v1/promotions/{campaignId}/stacks Create Promotion Stack
VoucherifySdk::PromotionsApi delete_promotion_stack DELETE /v1/promotions/{campaignId}/stacks/{stackId} Delete Promotion Stack
VoucherifySdk::PromotionsApi delete_promotion_tier DELETE /v1/promotions/tiers/{promotionTierId} Delete Promotion Tier
VoucherifySdk::PromotionsApi disable_promotion_tier POST /v1/promotions/tiers/{promotionTierId}/disable Disable Promotion Tier
VoucherifySdk::PromotionsApi enable_promotion_tier POST /v1/promotions/tiers/{promotionTierId}/enable Enable Promotion Tier
VoucherifySdk::PromotionsApi get_promotion_stack GET /v1/promotions/{campaignId}/stacks/{stackId} Get Promotion Stack
VoucherifySdk::PromotionsApi get_promotion_tier GET /v1/promotions/tiers/{promotionTierId} Get Promotion Tier
VoucherifySdk::PromotionsApi list_all_promotion_stacks GET /v1/promotions/stacks List Promotion Stacks
VoucherifySdk::PromotionsApi list_promotion_stacks_in_campaign GET /v1/promotions/{campaignId}/stacks List Promotion Stacks in Campaign
VoucherifySdk::PromotionsApi list_promotion_tiers_from_campaign GET /v1/promotions/{campaignId}/tiers List Promotion Tiers from Campaign
VoucherifySdk::PromotionsApi update_promotion_stack PUT /v1/promotions/{campaignId}/stacks/{stackId} Update Promotion Stack
VoucherifySdk::PublicationsApi create_publication POST /v1/publications Create Publication
VoucherifySdk::PublicationsApi create_publication1 GET /v1/publications/create Create Publication
VoucherifySdk::PublicationsApi list_publications GET /v1/publications List Publications
VoucherifySdk::QualificationsApi check_eligibility POST /v1/qualifications Check Eligibility
VoucherifySdk::RedemptionsApi get_redemption GET /v1/redemptions/{redemptionId} Get Redemption
VoucherifySdk::RedemptionsApi get_voucher_redemptions GET /v1/vouchers/{code}/redemption Get Voucher's Redemptions
VoucherifySdk::RedemptionsApi list_redemptions GET /v1/redemptions List Redemptions
VoucherifySdk::RedemptionsApi redeem_stacked_discounts POST /v1/redemptions Redeem Stackable Discounts
VoucherifySdk::RedemptionsApi rollback_redemption POST /v1/redemptions/{redemptionId}/rollback Rollback Redemption
VoucherifySdk::RedemptionsApi rollback_stacked_redemptions POST /v1/redemptions/{parentRedemptionId}/rollbacks Rollback Stackable Redemptions
VoucherifySdk::RewardsApi create_reward_assignment POST /v1/rewards/{rewardId}/assignments Create Reward Assignment
VoucherifySdk::RewardsApi delete_reward DELETE /v1/rewards/{rewardId} Delete Reward
VoucherifySdk::RewardsApi delete_reward_assignment DELETE /v1/rewards/{rewardId}/assignments/{assignmentId} Delete Reward Assignment
VoucherifySdk::RewardsApi get_reward_assignment GET /v1/rewards/{rewardId}/assignments/{assignmentId} Get Reward Assignment
VoucherifySdk::RewardsApi list_reward_assignments GET /v1/rewards/{rewardId}/assignments List Reward Assignments
VoucherifySdk::RewardsApi update_reward_assignment PUT /v1/rewards/{rewardId}/assignments/{assignmentId} Update Reward Assignment
VoucherifySdk::SegmentsApi delete_segment DELETE /v1/segments/{segmentId} Delete Segment
VoucherifySdk::ValidationRulesApi create_validation_rule_assignment POST /v1/validation-rules/{validationRuleId}/assignments Create Validation Rules Assignments
VoucherifySdk::ValidationRulesApi create_validation_rules POST /v1/validation-rules Create Validation Rules
VoucherifySdk::ValidationRulesApi delete_validation_rule_assignment DELETE /v1/validation-rules/{validationRuleId}/assignments/{assignmentId} Delete Validation Rule Assignment
VoucherifySdk::ValidationRulesApi delete_validation_rules DELETE /v1/validation-rules/{validationRuleId} Delete Validation Rule
VoucherifySdk::ValidationRulesApi get_validation_rule GET /v1/validation-rules/{validationRuleId} Get Validation Rule
VoucherifySdk::ValidationRulesApi list_validation_rule_assignments GET /v1/validation-rules/{validationRuleId}/assignments List Validation Rule Assignments
VoucherifySdk::ValidationRulesApi list_validation_rules GET /v1/validation-rules List Validation Rules
VoucherifySdk::ValidationRulesApi list_validation_rules_assignments GET /v1/validation-rules-assignments List Validation Rules' Assignment(s)
VoucherifySdk::ValidationRulesApi update_validation_rule PUT /v1/validation-rules/{validationRuleId} Update Validation Rule
VoucherifySdk::ValidationsApi validate_stacked_discounts POST /v1/validations Validate Stackable Discounts
VoucherifySdk::VouchersApi delete_voucher DELETE /v1/vouchers/{code} Delete Voucher
VoucherifySdk::VouchersApi disable_voucher POST /v1/vouchers/{code}/disable Disable Voucher
VoucherifySdk::VouchersApi enable_voucher POST /v1/vouchers/{code}/enable Enable Voucher
VoucherifySdk::VouchersApi export_voucher_transactions POST /v1/vouchers/{code}/transactions/export Export Voucher Transactions
VoucherifySdk::VouchersApi get_voucher GET /v1/vouchers/{code} Get Voucher
VoucherifySdk::VouchersApi import_vouchers_using_csv POST /v1/vouchers/importCSV Import Vouchers using CSV
VoucherifySdk::VouchersApi list_voucher_transactions GET /v1/vouchers/{code}/transactions List Voucher Transactions
VoucherifySdk::VouchersApi release_validation_session DELETE /v1/vouchers/{code}/sessions/{sessionKey} Release Validation Session
VoucherifySdk::VouchersApi update_voucher_balance POST /v1/vouchers/{code}/balance Add or Remove Voucher Balance

๐Ÿ“š Documentation for Models

voucherify-ruby-sdk's People

Contributors

awilczek avatar imvanzen avatar jkaliszuk avatar kgillison avatar lkulig avatar lukaszwiktor avatar marcin-slezak avatar pawelrychlik avatar rderoldan1 avatar sedzia avatar tpindel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

voucherify-ruby-sdk's Issues

Feature: Retry with exponential backoff

At the moment we're wrapping around the outside of the Voucherify SDK to rescue + inspect the errors it raises to implement our own retry mechanism to deal with the odd timeout and very occasionally an odd network error or two.

Are there any plans to build a retry mechanism into the Ruby SDK ร  la Stripe's Ruby client?

See here for Stripe's implementation: https://github.com/stripe/stripe-ruby/blob/master/lib/stripe/stripe_client.rb#L451

If we were to put aside the time to move our retry mechanism into this gem would @voucherifyio be open to merging this in rather than us maintaining our own fork?

Extended OrderItem model and List All Promotion Tiers methods

Utils Method for signature verification

Maybe we shall consider adding utils method for handling signature verification.

require 'openssl'

  def verify_webhook
    calculated_hmac = OpenSSL::HMAC.hexdigest('sha256', SECRET, request.body.read)
    ActiveSupport::SecurityUtils.secure_compare(calculated_hmac, request.headers["X-Voucherify-Signature"])
  end

Voucherify::Utils.calculate_price does not consider the :amount_limit key

Percent-off vouchers with a cap amount set do not take that cap into consideration when calculating a discount.

From the util code here: https://github.com/voucherifyio/voucherify-ruby-sdk/blob/master/lib/voucherify/utils.rb#L37-L41 It's clear that the discount is a simple function of the percent off times the base price.

Happy to open a PR for this but I'm not sure of all the ways that a cap can come into play. Let me know if you need any more info or a reproduction case to move forward. Thanks!

Consents API support

Consents namespace:

  • List Consents: GET /consents - Docs
  • List Consents (Client): GET /consents - Docs

Customers namespace:

  • Update Customer's Consents: PUT /customers/{id}/consents - Docs
  • Update Customer's Consents (Client): PUT /customers/{id}/consents - Docs

Support blank API response in exception handling

I've received a few errors originating from this line https://github.com/voucherifyio/voucherify-ruby-sdk/blob/master/lib/voucherify/client.rb#L145

unexpected token at ''
/usr/local/bundle/gems/json-2.6.3/lib/json/common.rb:216:in `parse',
/usr/local/bundle/gems/json-2.6.3/lib/json/common.rb:216:in `parse',
/usr/local/bundle/gems/voucherify-4.1.0/lib/voucherify/client.rb:145:in `initialize',
/usr/local/bundle/gems/voucherify-4.1.0/lib/voucherify/client.rb:93:in `new',
...

It appears that the error response is empty and the client cannot handle empty error responses. I've not be able to discover what is causing the empty error response. I can't find the request in the Voucherify API audit logs, so I suspect the request doesn't reach Voucherify. But it will help if the client can gracefully handle errors with empty responses.

Cancelling an Order via Ruby

I'm currently unable to cancel an order using the Ruby client. Cancelling orders using Curl works as expected, but making the request with the same request body using Ruby client doesn't work. Here are a couple of log ids

  • log_0d446e83efc39dca2f (using Curl)
  • log_0d44702edb9151d061 (using the Ruby client)

Since the requests are the same, I suspect the API is responding differently based on the user-agent or channel headers?

Ruby 2.7 deprecation warnings: Replace URL.encode

The Voucherify gem gives this warning under Ruby 2.7

lib/voucherify/service/vouchers.rb:19: warning: URI.escape is obsolete

According to the docs URI.encode is an alias for URI.escape, and

This method is obsolete and should not be used. Instead, use CGI.escape, URI.encode_www_form or URI.encode_www_form_component depending on your specific use case.

Create Validation Rule Assignment endpoint doesn't seem to exist in the new openapi gem

Hi there,
First of all I'd like to thank you for the work done at Voucherify, we've used for a few years and it's been a frictionless experience so far ๐Ÿ™‚

I'm creating this issue because I have been working on migrating our voucherify gem from the legacy version to the new one.
I have succeeded in replacing every API call we had in our app except for one : creating a validation rule assignment (https://docs.voucherify.io/reference/create-validation-rule-assignment)

I've contacted support and Johanna advised me to create an issue here. I'll be happy to look into a code implementation if needed !

Thank you guys in advance

Loyalties Program support

Add support for new methods related to Loyalty Programs.

Validation namespace:

  • Validate Validation Rules: POST /validation-rules/:rule-id/validation - Docs

Rewards namespace:

  • List: GET /rewards - Docs
  • Create: POST /rewards - Docs
  • Get: GET /rewards/:rewardId - Docs
  • Update: PUT /rewards/:rewardId - Docs
  • Delete: DELETE /rewards/:rewardId - Docs
  • List Assignments: GET /rewards/:rewardId/assignments - Docs
  • Create Assignment: POST /rewards/:rewardId/assignments - Docs
  • Update Assignment: PUT /rewards/:rewardId/assignments/:assignmentId - Docs
  • Delete Assignment: DELETE /rewards/:rewardId/assignments/:assignmentId - Docs

Loyalties namespace:

  • List: GET /loyalties - Docs
  • Create: POST /loyalties - Docs
  • Get: GET /loyalties/:campaignId - Docs
  • Update: PUT /loyalties/:campaignId - Docs
  • Delete: DELETE /loyalties/:campaignId - Docs
  • List Reward Assignments: GET /loyalties/:campaignId/rewards - Docs
  • Create Reward Assignment: POST /loyalties/:campaignId/rewards - Docs
  • Update Reward Assignment: PUT /loyalties/:campaignId/rewards/:assignmentId - Docs
  • Delete Reward Assignment: DELETE /loyalties/:campaignId/rewards/:assignmentId - Docs
  • List Earning Rules: GET /loyalties/{campaignId}/earning-rules - Docs
  • Create Earning Rules: POST /loyalties/:campaignId/earning-rules - Docs
  • Update Earning Rules: PUT /loyalties/:campaignId/earning-rules/:earningRuleId - Docs
  • Delete Earning Rules: DELETE /loyalties/:campaignId/earning-rules/:earningRuleId - Docs
  • List Members: GET /loyalties/:campaignId/members - Docs
  • Add Member: POST /loyalties/:campaignId/members - Docs
  • Get Member: GET /loyalties/:campaignId/members/:memberId - Docs
  • Add Points: POST /loyalties/:campaignId/members/:memberId/balance - Docs
  • Redeem Reward: POST /loyalties/:campaignId/members/:memberId/redemption - Docs

User customizable timeout for RestClient requests

We would like to reduce the max timeout from the default 60 seconds but the RestClient configuration doesn't seem to be accessible without monkey patching the client.

Would it be possible to poke through the timeout as a top-level config?

Thanks!

Add support for "Qualification" actions

The Voucherify documentation describes an endpoint to "Examine Qualification" that is not present in the Ruby SDK.

The Ruby SDK should expose this behavior through a create_qualifications_request method that takes a customer_id and optional context params, returning a list of campaigns said Customer is eligible for.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.