POST | /PurchaseSubscription |
---|
import 'package:servicestack/servicestack.dart';
class Subscriptions implements IConvertible
{
String? section;
bool? success;
bool? activated;
int? purchasedOrderId;
Subscriptions({this.section,this.success,this.activated,this.purchasedOrderId});
Subscriptions.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
section = json['section'];
success = json['success'];
activated = json['activated'];
purchasedOrderId = json['purchasedOrderId'];
return this;
}
Map<String, dynamic> toJson() => {
'section': section,
'success': success,
'activated': activated,
'purchasedOrderId': purchasedOrderId
};
getTypeName() => "Subscriptions";
TypeContext? context = _ctx;
}
class PurchaseSubscription implements ICardInfo, IAddress, IConvertible
{
String? code;
String? coupon;
String? renewalRef;
String? upgradeRef;
int? quantity;
String? userAuthId;
int? skuId;
bool? isSmallCompany;
bool? isNonProfit;
bool? agreeTerms;
String? firstName;
String? lastName;
String? email;
String? password;
String? company;
String? phoneNumber;
String? addressLine1;
String? addressLine2;
String? addressCity;
String? addressZip;
String? addressState;
String? addressCountry;
String? licenseName;
String? licenseEmail;
String? licenseAddress;
String? cardNumber;
String? cvc;
int? expMonth;
int? expYear;
String? notes;
PurchaseSubscription({this.code,this.coupon,this.renewalRef,this.upgradeRef,this.quantity,this.userAuthId,this.skuId,this.isSmallCompany,this.isNonProfit,this.agreeTerms,this.firstName,this.lastName,this.email,this.password,this.company,this.phoneNumber,this.addressLine1,this.addressLine2,this.addressCity,this.addressZip,this.addressState,this.addressCountry,this.licenseName,this.licenseEmail,this.licenseAddress,this.cardNumber,this.cvc,this.expMonth,this.expYear,this.notes});
PurchaseSubscription.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
coupon = json['coupon'];
renewalRef = json['renewalRef'];
upgradeRef = json['upgradeRef'];
quantity = json['quantity'];
userAuthId = json['userAuthId'];
skuId = json['skuId'];
isSmallCompany = json['isSmallCompany'];
isNonProfit = json['isNonProfit'];
agreeTerms = json['agreeTerms'];
firstName = json['firstName'];
lastName = json['lastName'];
email = json['email'];
password = json['password'];
company = json['company'];
phoneNumber = json['phoneNumber'];
addressLine1 = json['addressLine1'];
addressLine2 = json['addressLine2'];
addressCity = json['addressCity'];
addressZip = json['addressZip'];
addressState = json['addressState'];
addressCountry = json['addressCountry'];
licenseName = json['licenseName'];
licenseEmail = json['licenseEmail'];
licenseAddress = json['licenseAddress'];
cardNumber = json['cardNumber'];
cvc = json['cvc'];
expMonth = json['expMonth'];
expYear = json['expYear'];
notes = json['notes'];
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'coupon': coupon,
'renewalRef': renewalRef,
'upgradeRef': upgradeRef,
'quantity': quantity,
'userAuthId': userAuthId,
'skuId': skuId,
'isSmallCompany': isSmallCompany,
'isNonProfit': isNonProfit,
'agreeTerms': agreeTerms,
'firstName': firstName,
'lastName': lastName,
'email': email,
'password': password,
'company': company,
'phoneNumber': phoneNumber,
'addressLine1': addressLine1,
'addressLine2': addressLine2,
'addressCity': addressCity,
'addressZip': addressZip,
'addressState': addressState,
'addressCountry': addressCountry,
'licenseName': licenseName,
'licenseEmail': licenseEmail,
'licenseAddress': licenseAddress,
'cardNumber': cardNumber,
'cvc': cvc,
'expMonth': expMonth,
'expYear': expYear,
'notes': notes
};
getTypeName() => "PurchaseSubscription";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'account.servicestack.net', types: <String, TypeInfo> {
'Subscriptions': TypeInfo(TypeOf.Class, create:() => Subscriptions()),
'PurchaseSubscription': TypeInfo(TypeOf.Class, create:() => PurchaseSubscription()),
});
Dart PurchaseSubscription DTOs
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 /PurchaseSubscription HTTP/1.1
Host: account.servicestack.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PurchaseSubscription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MyApp.ServiceModel">
<AddressCity>String</AddressCity>
<AddressCountry>String</AddressCountry>
<AddressLine1>String</AddressLine1>
<AddressLine2>String</AddressLine2>
<AddressState>String</AddressState>
<AddressZip>String</AddressZip>
<AgreeTerms>false</AgreeTerms>
<CardNumber>String</CardNumber>
<Code>String</Code>
<Company>String</Company>
<Coupon>String</Coupon>
<Cvc>String</Cvc>
<Email>String</Email>
<ExpMonth>0</ExpMonth>
<ExpYear>0</ExpYear>
<FirstName>String</FirstName>
<IsNonProfit>false</IsNonProfit>
<IsSmallCompany>false</IsSmallCompany>
<LastName>String</LastName>
<LicenseAddress>String</LicenseAddress>
<LicenseEmail>String</LicenseEmail>
<LicenseName>String</LicenseName>
<Notes>String</Notes>
<Password>String</Password>
<PhoneNumber>String</PhoneNumber>
<Quantity>0</Quantity>
<RenewalRef>String</RenewalRef>
<SkuId>0</SkuId>
<UpgradeRef>String</UpgradeRef>
<UserAuthId>String</UserAuthId>
</PurchaseSubscription>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <Subscriptions xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MyApp.ServiceModel"> <Activated>false</Activated> <PurchasedOrderId>0</PurchasedOrderId> <Section>String</Section> <Success>false</Success> </Subscriptions>