POST | /sales/member/{MemberId}/payment/makepayment | Make a Payment for a Member |
---|
import 'package:servicestack/servicestack.dart';
class ApiDtoBase implements IConvertible
{
String? ApiKey;
int? StoreId;
int? ChainId;
ApiDtoBase({this.ApiKey,this.StoreId,this.ChainId});
ApiDtoBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
ChainId = json['ChainId'];
return this;
}
Map<String, dynamic> toJson() => {
'ApiKey': ApiKey,
'StoreId': StoreId,
'ChainId': ChainId
};
getTypeName() => "ApiDtoBase";
TypeContext? context = _ctx;
}
class MakePaymentRequest extends ApiDtoBase implements IConvertible
{
int? UserId;
double? Amount;
List<int>? Invoice;
MakePaymentRequest({this.UserId,this.Amount,this.Invoice});
MakePaymentRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
UserId = json['UserId'];
Amount = JsonConverters.toDouble(json['Amount']);
Invoice = JsonConverters.fromJson(json['Invoice'],'List<int>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'UserId': UserId,
'Amount': Amount,
'Invoice': JsonConverters.toJson(Invoice,'List<int>',context!)
});
getTypeName() => "MakePaymentRequest";
TypeContext? context = _ctx;
}
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
class MakePayment extends MakePaymentRequest implements IRestrictedApiRequest, IConvertible
{
/**
* Api Key - grants access to resources
*/
// @ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")
String? ApiKey;
/**
* ID # of store member belongs to
*/
// @ApiMember(DataType="integer", Description="ID # of store member belongs to", IsRequired=true, Name="StoreId", ParameterType="query")
int? StoreId;
/**
* ID # of chain member belongs to
*/
// @ApiMember(DataType="integer", Description="ID # of chain member belongs to", Name="ChainId", ParameterType="query")
int? ChainId;
/**
* Member ID of user to make payment for
*/
// @ApiMember(DataType="integer", Description="Member ID of user to make payment for", IsRequired=true, Name="MemberId", ParameterType="path")
int? MemberId;
/**
* Amount of the payment, including sales tax
*/
// @ApiMember(DataType="decimal", Description="Amount of the payment, including sales tax", IsRequired=true, Name="Amount", ParameterType="query")
double? Amount;
/**
* Invoice ID to be paid
*/
// @ApiMember(DataType="integer", Description="Invoice ID to be paid", IsRequired=true, Name="Invoice", ParameterType="query")
List<int>? Invoice;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
MakePayment({this.ApiKey,this.StoreId,this.ChainId,this.MemberId,this.Amount,this.Invoice,this.RestrictedId,this.RestrictedResourceType});
MakePayment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
ChainId = json['ChainId'];
MemberId = json['MemberId'];
Amount = JsonConverters.toDouble(json['Amount']);
Invoice = JsonConverters.fromJson(json['Invoice'],'List<int>',context!);
RestrictedId = json['RestrictedId'];
RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ApiKey': ApiKey,
'StoreId': StoreId,
'ChainId': ChainId,
'MemberId': MemberId,
'Amount': Amount,
'Invoice': JsonConverters.toJson(Invoice,'List<int>',context!),
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
});
getTypeName() => "MakePayment";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
'MakePaymentRequest': TypeInfo(TypeOf.Class, create:() => MakePaymentRequest()),
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'MakePayment': TypeInfo(TypeOf.Class, create:() => MakePayment()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /sales/member/{MemberId}/payment/makepayment HTTP/1.1
Host: clubready.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<MakePayment xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Sales.Model">
<ApiKey xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</ApiKey>
<ChainId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ChainId>
<StoreId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</StoreId>
<Amount xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</Amount>
<Invoice xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">
<d2p1:int>0</d2p1:int>
</Invoice>
<UserId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</UserId>
<MemberId>0</MemberId>
</MakePayment>