GET | /sales/wallet/wallettokencreate | Creates a Wallet Token for a user |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ClubReady.Web.Api.Sales.Wallet;
using ClubReady.Sales.Wallet;
using ClubReady.Core.Api.Models;
using ClubReadyGateway.Vault;
using ClubReady.Web.Api;
namespace ClubReady.Core.Api.Models
{
public partial class ApiDtoBase
{
public virtual string ApiKey { get; set; }
public virtual int? StoreId { get; set; }
public virtual int? ChainId { get; set; }
}
public partial class ApiResponseBase
{
public virtual bool Success { get; set; }
public virtual string Message { get; set; }
}
}
namespace ClubReady.Sales.Wallet
{
public enum WalletPage
{
Uninitialized,
Manage,
Add,
AddCard,
AddBank,
AddMini,
AddCardMini,
AddBankMini,
}
public partial class WalletTokenCreateRequestDto
: ApiDtoBase
{
public virtual int OwnerId { get; set; }
public virtual OwnerType OwnerType { get; set; }
public virtual int CreatorId { get; set; }
public virtual WalletPage Page { get; set; }
public virtual string Theme { get; set; }
public virtual bool? AllowDeleteProfile { get; set; }
public virtual bool? AllowDisableProfile { get; set; }
}
public partial class WalletTokenCreateResponseDto
: ApiResponseBase
{
public virtual string WalletToken { get; set; }
public virtual string WalletOrigin { get; set; }
public virtual string WalletUrl { get; set; }
}
}
namespace ClubReady.Web.Api
{
public enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
}
namespace ClubReady.Web.Api.Sales.Wallet
{
public partial class WalletTokenCreateEndpoint
: WalletTokenCreateRequestDto, IRestrictedApiRequest
{
///<summary>
///Api Key - grants access to resources
///</summary>
[ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")]
public virtual string ApiKey { get; set; }
///<summary>
///ID # of the owner to create the URL for
///</summary>
[ApiMember(DataType="integer", Description="ID # of the owner to create the URL for", IsRequired=true, Name="OwnerId", ParameterType="query")]
public virtual int OwnerId { get; set; }
///<summary>
///Type of owner to create the URL for
///</summary>
[ApiMember(Description="Type of owner to create the URL for", IsRequired=true, Name="OwnerType", ParameterType="query")]
public virtual OwnerType OwnerType { get; set; }
///<summary>
///Person creating the profile. Can be same as OwnerId.
///</summary>
[ApiMember(Description="Person creating the profile. Can be same as OwnerId.", IsRequired=true, Name="CreatorId", ParameterType="query")]
public virtual int CreatorId { get; set; }
///<summary>
///Page to display when calling the Payment Profile iFrame
///</summary>
[ApiMember(Description="Page to display when calling the Payment Profile iFrame", IsRequired=true, Name="Page", ParameterType="query")]
public virtual WalletPage Page { get; set; }
///<summary>
///CSS Theme
///</summary>
[ApiMember(Description="CSS Theme", ParameterType="query")]
public virtual string Theme { get; set; }
public virtual int? RestrictedId { get; set; }
public virtual RestrictedResourceType RestrictedResourceType { get; set; }
///<summary>
///Allows for a payment profile to be deleted
///</summary>
[ApiMember(Description="Allows for a payment profile to be deleted", Name="AllowDeleteProfile", ParameterType="query")]
public virtual bool? AllowDeleteProfile { get; set; }
///<summary>
///Allows for a payment profile to be disabled
///</summary>
[ApiMember(Description="Allows for a payment profile to be disabled", Name="AllowDisableProfile", ParameterType="query")]
public virtual bool? AllowDisableProfile { get; set; }
}
public partial class WalletTokenCreateResponse
: WalletTokenCreateResponseDto
{
public virtual bool Success { get; set; }
public virtual string Message { get; set; }
public virtual string WalletToken { get; set; }
public virtual string WalletOrigin { get; set; }
public virtual string WalletUrl { get; set; }
}
}
namespace ClubReadyGateway.Vault
{
[DataContract]
public enum OwnerType
{
Unknown = 0,
User = 1,
ConvUser = 2,
TempCart = 3,
TempAgmt = 4,
Store = 5,
Chain = 6,
Division = 7,
District = 8,
AdminType = 9,
TempStUser = 10,
VaultApi = 11,
Company = 12,
BackOfficeStore = 13,
OrgUser = 14,
CartItem = 15,
Testing = 99,
System = 100,
Error = -1,
}
}
C# WalletTokenCreateEndpoint DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /sales/wallet/wallettokencreate HTTP/1.1 Host: clubready.com Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Success: False, Message: String, WalletToken: String, WalletOrigin: String, WalletUrl: String }