Trendsic Platform Service

<back to all web services

CustomerPaymentsRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator, Agent, Administrator
The following routes are available for this service:
GET/v1/CustomerPayments/{OrderID}
POST,PUT,OPTIONS/v1/CustomerPayments
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class CustomerPayment implements IConvertible
{
    int? ID;
    int? CustomerID;
    int? OrderHeaderID;
    String? Amount;
    bool? Approved;
    String? AuthCode;
    String? CardNumber;
    String? Message;
    int? ResponseCode;
    String? TransactionId;
    DateTime? TransactionDate;
    String? FullResponse;
    int? PaymentStatus;
    int? PaymentType;

    CustomerPayment({this.ID,this.CustomerID,this.OrderHeaderID,this.Amount,this.Approved,this.AuthCode,this.CardNumber,this.Message,this.ResponseCode,this.TransactionId,this.TransactionDate,this.FullResponse,this.PaymentStatus,this.PaymentType});
    CustomerPayment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ID = json['ID'];
        CustomerID = json['CustomerID'];
        OrderHeaderID = json['OrderHeaderID'];
        Amount = json['Amount'];
        Approved = json['Approved'];
        AuthCode = json['AuthCode'];
        CardNumber = json['CardNumber'];
        Message = json['Message'];
        ResponseCode = json['ResponseCode'];
        TransactionId = json['TransactionId'];
        TransactionDate = JsonConverters.fromJson(json['TransactionDate'],'DateTime',context!);
        FullResponse = json['FullResponse'];
        PaymentStatus = json['PaymentStatus'];
        PaymentType = json['PaymentType'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ID': ID,
        'CustomerID': CustomerID,
        'OrderHeaderID': OrderHeaderID,
        'Amount': Amount,
        'Approved': Approved,
        'AuthCode': AuthCode,
        'CardNumber': CardNumber,
        'Message': Message,
        'ResponseCode': ResponseCode,
        'TransactionId': TransactionId,
        'TransactionDate': JsonConverters.toJson(TransactionDate,'DateTime',context!),
        'FullResponse': FullResponse,
        'PaymentStatus': PaymentStatus,
        'PaymentType': PaymentType
    };

    getTypeName() => "CustomerPayment";
    TypeContext? context = _ctx;
}

class CustomerPaymentsResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    bool? PaymentIntentSuccess;
    bool? PaymentSuccess;
    bool? SubscriptionSuccess;
    String? Message;
    String? ReceiptUrl;
    String? AgentNumber;
    String? ClientSecret;
    CustomerPayment? CustomerPayment;
    String? PublicOrderID;

    CustomerPaymentsResponse({this.ResponseStatus,this.PaymentIntentSuccess,this.PaymentSuccess,this.SubscriptionSuccess,this.Message,this.ReceiptUrl,this.AgentNumber,this.ClientSecret,this.CustomerPayment,this.PublicOrderID});
    CustomerPaymentsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        PaymentIntentSuccess = json['PaymentIntentSuccess'];
        PaymentSuccess = json['PaymentSuccess'];
        SubscriptionSuccess = json['SubscriptionSuccess'];
        Message = json['Message'];
        ReceiptUrl = json['ReceiptUrl'];
        AgentNumber = json['AgentNumber'];
        ClientSecret = json['ClientSecret'];
        CustomerPayment = JsonConverters.fromJson(json['CustomerPayment'],'CustomerPayment',context!);
        PublicOrderID = json['PublicOrderID'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'PaymentIntentSuccess': PaymentIntentSuccess,
        'PaymentSuccess': PaymentSuccess,
        'SubscriptionSuccess': SubscriptionSuccess,
        'Message': Message,
        'ReceiptUrl': ReceiptUrl,
        'AgentNumber': AgentNumber,
        'ClientSecret': ClientSecret,
        'CustomerPayment': JsonConverters.toJson(CustomerPayment,'CustomerPayment',context!),
        'PublicOrderID': PublicOrderID
    };

    getTypeName() => "CustomerPaymentsResponse";
    TypeContext? context = _ctx;
}

class Customer implements IConvertible
{
    int? ID;
    String? CustomerCode;
    String? BusinessName;
    String? FirstName;
    String? LastName;
    String? Email;
    String? UID;
    int? AgentId;

    Customer({this.ID,this.CustomerCode,this.BusinessName,this.FirstName,this.LastName,this.Email,this.UID,this.AgentId});
    Customer.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ID = json['ID'];
        CustomerCode = json['CustomerCode'];
        BusinessName = json['BusinessName'];
        FirstName = json['FirstName'];
        LastName = json['LastName'];
        Email = json['Email'];
        UID = json['UID'];
        AgentId = json['AgentId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ID': ID,
        'CustomerCode': CustomerCode,
        'BusinessName': BusinessName,
        'FirstName': FirstName,
        'LastName': LastName,
        'Email': Email,
        'UID': UID,
        'AgentId': AgentId
    };

    getTypeName() => "Customer";
    TypeContext? context = _ctx;
}

class PaymentInfo implements IConvertible
{
    String? PaymentType;
    String? CardNumber;
    String? ExpDate;
    String? CCV;
    String? StripeToken;
    int? AgentId;

    PaymentInfo({this.PaymentType,this.CardNumber,this.ExpDate,this.CCV,this.StripeToken,this.AgentId});
    PaymentInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        PaymentType = json['PaymentType'];
        CardNumber = json['CardNumber'];
        ExpDate = json['ExpDate'];
        CCV = json['CCV'];
        StripeToken = json['StripeToken'];
        AgentId = json['AgentId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'PaymentType': PaymentType,
        'CardNumber': CardNumber,
        'ExpDate': ExpDate,
        'CCV': CCV,
        'StripeToken': StripeToken,
        'AgentId': AgentId
    };

    getTypeName() => "PaymentInfo";
    TypeContext? context = _ctx;
}

class CustomerPaymentsRequest implements IConvertible
{
    Customer? Customer;
    String? OrderID;
    PaymentInfo? PaymentInfo;

    CustomerPaymentsRequest({this.Customer,this.OrderID,this.PaymentInfo});
    CustomerPaymentsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Customer = JsonConverters.fromJson(json['Customer'],'Customer',context!);
        OrderID = json['OrderID'];
        PaymentInfo = JsonConverters.fromJson(json['PaymentInfo'],'PaymentInfo',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Customer': JsonConverters.toJson(Customer,'Customer',context!),
        'OrderID': OrderID,
        'PaymentInfo': JsonConverters.toJson(PaymentInfo,'PaymentInfo',context!)
    };

    getTypeName() => "CustomerPaymentsRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'CustomerPayment': TypeInfo(TypeOf.Class, create:() => CustomerPayment()),
    'CustomerPaymentsResponse': TypeInfo(TypeOf.Class, create:() => CustomerPaymentsResponse()),
    'Customer': TypeInfo(TypeOf.Class, create:() => Customer()),
    'PaymentInfo': TypeInfo(TypeOf.Class, create:() => PaymentInfo()),
    'CustomerPaymentsRequest': TypeInfo(TypeOf.Class, create:() => CustomerPaymentsRequest()),
});

Dart CustomerPaymentsRequest DTOs

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

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/CustomerPayments HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Customer":{"ID":0,"CustomerCode":"String","BusinessName":"String","FirstName":"String","LastName":"String","Email":"String","UID":"00000000000000000000000000000000","AgentId":0},"OrderID":"00000000000000000000000000000000","PaymentInfo":{"PaymentType":"String","CardNumber":"String","ExpDate":"String","CCV":"String","StripeToken":"String","AgentId":0}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"PaymentIntentSuccess":false,"PaymentSuccess":false,"SubscriptionSuccess":false,"Message":"String","ReceiptUrl":"String","AgentNumber":"String","ClientSecret":"String","CustomerPayment":{"ID":0,"CustomerID":0,"OrderHeaderID":0,"Amount":"String","Approved":false,"AuthCode":"String","CardNumber":"String","Message":"String","ResponseCode":0,"TransactionId":"String","TransactionDate":"0001-01-01T00:00:00.0000000","FullResponse":"String","PaymentStatus":0,"PaymentType":0},"PublicOrderID":"String"}