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 .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<CustomerPaymentsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Customer>
    <AgentId>0</AgentId>
    <BusinessName>String</BusinessName>
    <CustomerCode>String</CustomerCode>
    <Email>String</Email>
    <FirstName>String</FirstName>
    <ID>0</ID>
    <LastName>String</LastName>
    <UID>00000000-0000-0000-0000-000000000000</UID>
  </Customer>
  <OrderID>00000000-0000-0000-0000-000000000000</OrderID>
  <PaymentInfo>
    <AgentId>0</AgentId>
    <CCV>String</CCV>
    <CardNumber>String</CardNumber>
    <ExpDate>String</ExpDate>
    <PaymentType>String</PaymentType>
    <StripeToken>String</StripeToken>
  </PaymentInfo>
</CustomerPaymentsRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomerPaymentsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <AgentNumber>String</AgentNumber>
  <ClientSecret>String</ClientSecret>
  <CustomerPayment>
    <Amount>String</Amount>
    <Approved>false</Approved>
    <AuthCode>String</AuthCode>
    <CardNumber>String</CardNumber>
    <CustomerID>0</CustomerID>
    <FullResponse>String</FullResponse>
    <ID>0</ID>
    <Message>String</Message>
    <OrderHeaderID>0</OrderHeaderID>
    <PaymentStatus>0</PaymentStatus>
    <PaymentType>0</PaymentType>
    <ResponseCode>0</ResponseCode>
    <TransactionDate>0001-01-01T00:00:00</TransactionDate>
    <TransactionId>String</TransactionId>
  </CustomerPayment>
  <Message>String</Message>
  <PaymentIntentSuccess>false</PaymentIntentSuccess>
  <PaymentSuccess>false</PaymentSuccess>
  <PublicOrderID>String</PublicOrderID>
  <ReceiptUrl>String</ReceiptUrl>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <SubscriptionSuccess>false</SubscriptionSuccess>
</CustomerPaymentsResponse>