voucherifyio / voucherify-dotnet-sdk Goto Github PK
View Code? Open in Web Editor NEW.Net SDK for Voucherify - coupons, vouchers, promo codes http://www.voucherify.io
Home Page: http://www.voucherify.io
License: MIT License
.Net SDK for Voucherify - coupons, vouchers, promo codes http://www.voucherify.io
Home Page: http://www.voucherify.io
License: MIT License
You've just added new properties to VoucherifyClientException (5ff3171) but they're not being mapped.
Issue lies here:
https://github.com/voucherifyio/voucherify-dotNET-sdk/blob/master/src/Voucherify/Core/Communication/ApiClient.Async.cs#L210
you're creating new exception here, but constructor does not contain new properties
There should be a possibility to create and update Price at product level as it states in docs: https://docs.voucherify.io/reference#the-product-object
Price is already there for SKU object.
Consents namespace:
Customers namespace:
CampaignType -> CampaignExtensionType and there is missing property campaign_type for CampaignType
The JSON API returns boolean is_referral_code
field which is necessary for us to distinguish between discount codes and referral codes.
If such change is not planned in the nearest future,could you please provide a workaround or some other way of obtaining this value.
When I try to get the SKU with api.Products.GetSku("c53dabb5-7945-4e1c-beac-005993311dd5", "10025112"), I get a 404 back when i expect because I ran a delete of this sku earlier (api.Products.DeleteSku("c53dabb5-7945-4e1c-beac-005993311dd5", "10025112")).
But now when try to create the sku again with new data, I'm getting a 'Duplicate resource key' exception. The exceptions details are Sku with source id: 10025112 already exists. Remove resource permanently in order to add next with the same source id.
How do I remove the Sku permanently through the dotNET SDK?
https://github.com/voucherifyio/voucherify-dotNET-sdk#list-vouchers
We want to be able to filter by updated date which is available on the docs. https://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-vouchershttps://docs.voucherify.io/reference?utm_source=github&utm_medium=sdk&utm_campaign=acq#list-vouchers
Hi All,
I'm creating the issue to outline some of our problems we are having in ASP.NET WebAPI and using the .NET library you have provided. We have the following code:
public VoucherModel GetVoucherAsync(string voucherCode)
{
Voucher voucher = _api.Vouchers.Get(voucherCode).Result;
return Mapper.Map<VoucherModel>(voucher);
}
We use .Result
here because our code doesn't support asynchronous operations just yet. And this blog outlines and explaines it what is causing the deadlock. To quote:
So, according to it, ASP.NET has a specialized sync context, that only one thread can have. And if you donβt use .ConfigureAwait(false), it tries to restore old context, which belongs to the main thread that is blocked by .Result, hence deadlock...
This issue will not show up in the example because none of those examples are in ASP.NET
I will create an PR to solve this issue. π
ValidationError model class should return all properties like Key and Code.
src/Voucherify/DataModel/ValidationError.cs
Make sure that Track Custom Event
method is supported: https://docs.voucherify.io/v2018-08-01/reference#create-custom-event
customer
and event
are requiredmetadata
is optionalreferral
is optionalCustom error message is not mapped to VoucherifyClientException.
E.g. response:
{
"code":400,
"key":"customer_rules_violated",
"message":"customer does not match validation rules",
"details":"Referral Code cannot be redeemed because of violated validation rules: val_4Rz40vs2mHXZ",
"request_id":"v-0c625e154445522451",
"resource_id":"rf_0c625e15590ee0d561",
"resource_type":"redemption",
"error":{
"message":"Sorry, this code cannot be used by users who have already taken at least one trip."
}
}
https://support.voucherify.io/article/264-how-can-i-create-custom-errors
From your documentation: The content of the custom error message is going to be returned in the error
object under message
property.
https://github.com/voucherifyio/voucherify-dotNET-sdk/blob/master/src/Voucherify/Core/Exceptions/VoucherifyClientException.cs
Hello,
can anyone look into this?
Add missing validation_rule_assignments
. properties at Voucher and Campaign level:
[JsonProperty(PropertyName = "validation_rule_assignments")]
public BusinessValidationRuleAssignmentList Assignments { get; private set; }
Make sure that developer using the SDK is able to pass error
property for Validation Rules when creating or updating Validation Rule.
Make sure that error
property is correctly mapped when developer is using this SDK to get Validation Rule.
Update README
file to include information about custom error messages.
More information can be found in documentation under following links:
https://docs.voucherify.io/reference#section-custom-error-messages-with-validation-rules
https://docs.voucherify.io/reference#the-validation-rule-object
https://docs.voucherify.io/reference#create-validation-rules
There is no barcode property for voucher assets
Error converting value {null} to type 'System.Int64'. Path 'customers[0].summary.orders.total_amount', line 1, position 565.
Should be fixed by #55.
Add support for new type of discount UNIT with effect ADD_MANY_ITEMS
I was not able to find in the endpoints provided a way to delete voucher sessions.
https://docs.voucherify.io/reference#release-validation-session
There is no way to add applicable_to { excluded :[] , included : [] } to a validation rule creation request .
Add support for new methods related to Loyalty Programs.
Validation namespace:
Rewards namespace:
/rewards
- Docs/rewards
- Docs/rewards/:rewardId
- Docs/rewards/:rewardId
- Docs/rewards/:rewardId
- Docs/rewards/:rewardId/assignments
- Docs/rewards/:rewardId/assignments
- Docs/rewards/:rewardId/assignments/:assignmentId
- Docs/rewards/:rewardId/assignments/:assignmentId
- DocsLoyalties namespace:
/loyalties
- Docs/loyalties
- Docs/loyalties/:campaignId
- Docs/loyalties/:campaignId
- Docs/loyalties/:campaignId
- Docs/loyalties/:campaignId/rewards
- Docs/loyalties/:campaignId/rewards
- Docs/loyalties/:campaignId/rewards/:assignmentId
- Docs/loyalties/:campaignId/rewards/:assignmentId
- Docs/loyalties/{campaignId}/earning-rules
- Docs/loyalties/:campaignId/earning-rules
- Docs/loyalties/:campaignId/earning-rules/:earningRuleId
- Docs/loyalties/:campaignId/earning-rules/:earningRuleId
- Docs/loyalties/:campaignId/members
- Docs/loyalties/:campaignId/members
- Docs/loyalties/:campaignId/members/:memberId
- Docs/loyalties/:campaignId/members/:memberId/balance
- Docs/loyalties/:campaignId/members/:memberId/redemption
- DocsValidateVoucher will return a ValidationVoucher model, which happens to have a ValidationSession, but no properties are assigned to the model. Is that intended as it is the same as the Voucherify.DataModel.Contexts.ValidationSession.
Validation.DataModel.ValidationSession
https://github.com/voucherifyio/voucherify-dotNET-sdk/blob/master/src/Voucherify/DataModel/ValidationSession.cs
Voucherify.DataModel.Contexts.ValidationSession
https://github.com/voucherifyio/voucherify-dotNET-sdk/blob/master/src/Voucherify/DataModel/Contexts/ValidationSession.cs
When performing a (partial) redemption. the amount of the redemption is not available in the redemption result. When performing the redemption on a partially depleted gifcard, you will not know for sure the exact redemption amount then.
This is a view of the toplevel fields in the redemption result (serialized to json)
Simple code snippet:
using Queries = Voucherify.DataModel.Queries;
using Contexts = Voucherify.DataModel.Contexts;
// ...
var _api = new Voucherify.Api(applicationId, secretKey).WithSSL();
await _api.Redemptions.Rollback("", new Queries.RedemptionRollback(), new Contexts.RedemptionRollback());
This throws VoucherifyError[code=404, key=', message='API endpoint does not exist.', details='']
The reason for that is because the empty string is inserted into the URL as-is, resulting in such URL: https://api.voucherify.io/v1/redemptions//rollback
which effectively means https://api.voucherify.io/v1/redemptions/rollback
to Voucherify API hence the error.
I suggest checking for non-empty strings in all methods which insert them into URLs.
Add proper model to support applicableTo
functionality,
When calling the API directly Get Voucher's Redemptions contains the customer source_id. However when using Redemptions.GetForVoucher in the SDK only the customer_id is returned and no source_id.
There should be a possibility to set related_object
along with source_id
once order is specified during validation/redemption. Details in documentation: https://docs.voucherify.io/v2017-04-20/reference#validate-voucher
Products.ListSkus()
should return a ProductSkuList
instead.
Looks like the change in this commit introduced this error:
48f40e3#diff-b6fd2b6c45473889b9039d6cd2d5aa3aL68-R72
Drop API version support for other versions than 2018-08-01 and latest
Add some tools that will build the project automatically and release new version in nuget.
Referral
property is missing on EventCreate class (https://docs.voucherify.io/reference/create-custom-event)
To unit test mappings of the voucherify objects to our internal DTO objects, I'd like to be able new up an object and set it's properties. Instead, I have to use a mocking framework to test.
Make sure that the following methods are provided:
Make sure that the following methods can work with extended Order Item model:
Order; https://docs.voucherify.io/v2018-08-01/reference#the-order-object
Order Items; https://docs.voucherify.io/v2018-08-01/reference#the-order-item-object\
Create Order; https://docs.voucherify.io/v2018-08-01/reference#create-order
Update Order; https://docs.voucherify.io/v2018-08-01/reference#update-order
Validate Voucher; https://docs.voucherify.io/v2018-08-01/reference#validate-voucher
Validate Voucher (client side); https://docs.voucherify.io/v2018-08-01/reference#vouchers-validate
Validate Promotions; https://docs.voucherify.io/v2018-08-01/reference#validate-promotions-1
Redeem Voucher; https://docs.voucherify.io/v2018-08-01/reference#redeem-voucher
Redeem Voucher (client side); https://docs.voucherify.io/v2018-08-01/reference#redeem-voucher-client-side
Redeem Promotion; https://docs.voucherify.io/v2018-08-01/reference#redeem-promotion
Close the issue if no operation is needed or provide a solution with next release.
According to an email conversation I had with support:
The 'active' field in the response from the list redemptions endpoint will always return a null value due to performance decisions.
Thus, the Voucher.Active property has to be nullable. With the current implementation, it always throws an exception.
When validating a voucher with a fixed discount amount for order items the API returns:
discount: {
type: "FIXED",
effect: "APPLY_TO_ITEMS"
}
But the ValidationVoucher object returns a DiscountType.Amount for the Discount object. This is because the enum is missing a value for FIXED. Also the discount effects are missing, see API documentation for possible values: https://docs.voucherify.io/docs/discount-effects
Next to this issue the ValidationVoucher returns the VoucherSubject class in which the price for the product is missing.
The API returns the fixed price value but the VoucherSubject is missing a property for Price.
applicable_to: {
data: [{
object: "product",
id: "prod_id,
source_id: "1",
strict: false,
price: 1000 }]
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.