ClubReady Api

<back to all web services

MakePayment

The following routes are available for this service:
POST/sales/member/{MemberId}/payment/makepaymentMake 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: 'www.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()),
});

Dart MakePayment DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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: www.clubready.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"ApiKey":"String","StoreId":0,"ChainId":0,"MemberId":0,"Amount":0,"Invoice":[0],"RestrictedId":0,"RestrictedResourceType":"Chain","UserId":0}