BokaMera.API.Host

<back to all web services

PaymentSettingsQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, bookingsupplier-administrator-read, superadmin
The following routes are available for this service:
GET/payment/settingsGet payson payment settingsGet payson payment settings for the logged in company
import 'package:servicestack/servicestack.dart';

class AdminPaymentOptionsResponse implements IConvertible
{
    /**
    * The payment options id
    */
    // @ApiMember(Description="The payment options id")
    int? Id;

    /**
    * The payment options name
    */
    // @ApiMember(Description="The payment options name")
    String? Name;

    /**
    * The payment options description
    */
    // @ApiMember(Description="The payment options description")
    String? Description;

    AdminPaymentOptionsResponse({this.Id,this.Name,this.Description});
    AdminPaymentOptionsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description
    };

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

class PaymentProviderOptionsResponse implements IConvertible
{
    /**
    * The payment provider id
    */
    // @ApiMember(Description="The payment provider id")
    int? Id;

    /**
    * The payment provider name
    */
    // @ApiMember(Description="The payment provider name")
    String? Name;

    /**
    * The payment provider description
    */
    // @ApiMember(Description="The payment provider description")
    String? Description;

    PaymentProviderOptionsResponse({this.Id,this.Name,this.Description});
    PaymentProviderOptionsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description
    };

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

class PaymentSettingsQueryResponse implements IConvertible
{
    /**
    * The company id
    */
    // @ApiMember(Description="The company id")
    String? CompanyId;

    /**
    * The payment is enabled
    */
    // @ApiMember(Description="The payment is enabled")
    bool? Enabled;

    /**
    * If there should be any fee added when customer selected invoice payment method
    */
    // @ApiMember(Description="If there should be any fee added when customer selected invoice payment method")
    int? InvoiceFee;

    /**
    * If allow credit card payment
    */
    // @ApiMember(Description="If allow credit card payment")
    bool? AllowCreditCardPayment;

    /**
    * If allow invoice payment
    */
    // @ApiMember(Description="If allow invoice payment")
    bool? AllowInvoicePayment;

    /**
    * If allow bank payment
    */
    // @ApiMember(Description="If allow bank payment")
    bool? AllowBankPayment;

    /**
    * Automatically refund customer on canceled booking
    */
    // @ApiMember(Description="Automatically refund customer on canceled booking")
    bool? RefundOnCancelBooking;

    /**
    * The default option when admin creates a new booking
    */
    // @ApiMember(Description="The default option when admin creates a new booking")
    int? DefaultPaymentOptionId;

    /**
    * What payment provider to use
    */
    // @ApiMember(Description="What payment provider to use")
    int? PaymentProviderId;

    /**
    * If you want to include the admin payment options to select from
    */
    // @ApiMember(DataType="boolean", Description="If you want to include the admin payment options to select from", ParameterType="query")
    List<AdminPaymentOptionsResponse>? AdminPaymentOptions;

    /**
    * If you want to include the payment provider options to select from
    */
    // @ApiMember(DataType="boolean", Description="If you want to include the payment provider options to select from", ParameterType="query")
    List<PaymentProviderOptionsResponse>? PaymentProviderOptions;

    /**
    * SendPaymentRequestDirectly
    */
    // @ApiMember(Description="SendPaymentRequestDirectly")
    bool? SendPaymentRequestDirectly;

    PaymentSettingsQueryResponse({this.CompanyId,this.Enabled,this.InvoiceFee,this.AllowCreditCardPayment,this.AllowInvoicePayment,this.AllowBankPayment,this.RefundOnCancelBooking,this.DefaultPaymentOptionId,this.PaymentProviderId,this.AdminPaymentOptions,this.PaymentProviderOptions,this.SendPaymentRequestDirectly});
    PaymentSettingsQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        Enabled = json['Enabled'];
        InvoiceFee = json['InvoiceFee'];
        AllowCreditCardPayment = json['AllowCreditCardPayment'];
        AllowInvoicePayment = json['AllowInvoicePayment'];
        AllowBankPayment = json['AllowBankPayment'];
        RefundOnCancelBooking = json['RefundOnCancelBooking'];
        DefaultPaymentOptionId = json['DefaultPaymentOptionId'];
        PaymentProviderId = json['PaymentProviderId'];
        AdminPaymentOptions = JsonConverters.fromJson(json['AdminPaymentOptions'],'List<AdminPaymentOptionsResponse>',context!);
        PaymentProviderOptions = JsonConverters.fromJson(json['PaymentProviderOptions'],'List<PaymentProviderOptionsResponse>',context!);
        SendPaymentRequestDirectly = json['SendPaymentRequestDirectly'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'Enabled': Enabled,
        'InvoiceFee': InvoiceFee,
        'AllowCreditCardPayment': AllowCreditCardPayment,
        'AllowInvoicePayment': AllowInvoicePayment,
        'AllowBankPayment': AllowBankPayment,
        'RefundOnCancelBooking': RefundOnCancelBooking,
        'DefaultPaymentOptionId': DefaultPaymentOptionId,
        'PaymentProviderId': PaymentProviderId,
        'AdminPaymentOptions': JsonConverters.toJson(AdminPaymentOptions,'List<AdminPaymentOptionsResponse>',context!),
        'PaymentProviderOptions': JsonConverters.toJson(PaymentProviderOptions,'List<PaymentProviderOptionsResponse>',context!),
        'SendPaymentRequestDirectly': SendPaymentRequestDirectly
    };

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

// @ValidateRequest(Validator="IsAuthenticated")
class PaymentSettingsQuery implements ICompany, IConvertible
{
    /**
    * The company id, if empty will use the company id for the user you are logged in with.
    */
    // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    String? CompanyId;

    /**
    * If you want to include the admin payment options to select from
    */
    // @ApiMember(DataType="boolean", Description="If you want to include the admin payment options to select from")
    bool? IncludeAdminPaymentOptions;

    /**
    * If you want to include the payment provider options to select from
    */
    // @ApiMember(DataType="boolean", Description="If you want to include the payment provider options to select from")
    bool? IncludePaymentProviderOptions;

    PaymentSettingsQuery({this.CompanyId,this.IncludeAdminPaymentOptions,this.IncludePaymentProviderOptions});
    PaymentSettingsQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        IncludeAdminPaymentOptions = json['IncludeAdminPaymentOptions'];
        IncludePaymentProviderOptions = json['IncludePaymentProviderOptions'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'IncludeAdminPaymentOptions': IncludeAdminPaymentOptions,
        'IncludePaymentProviderOptions': IncludePaymentProviderOptions
    };

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

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'AdminPaymentOptionsResponse': TypeInfo(TypeOf.Class, create:() => AdminPaymentOptionsResponse()),
    'PaymentProviderOptionsResponse': TypeInfo(TypeOf.Class, create:() => PaymentProviderOptionsResponse()),
    'PaymentSettingsQueryResponse': TypeInfo(TypeOf.Class, create:() => PaymentSettingsQueryResponse()),
    'List<AdminPaymentOptionsResponse>': TypeInfo(TypeOf.Class, create:() => <AdminPaymentOptionsResponse>[]),
    'List<PaymentProviderOptionsResponse>': TypeInfo(TypeOf.Class, create:() => <PaymentProviderOptionsResponse>[]),
    'PaymentSettingsQuery': TypeInfo(TypeOf.Class, create:() => PaymentSettingsQuery()),
});

Dart PaymentSettingsQuery 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.

GET /payment/settings HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PaymentSettingsQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <AdminPaymentOptions>
    <AdminPaymentOptionsResponse>
      <Description>String</Description>
      <Id>0</Id>
      <Name>String</Name>
    </AdminPaymentOptionsResponse>
  </AdminPaymentOptions>
  <AllowBankPayment>false</AllowBankPayment>
  <AllowCreditCardPayment>false</AllowCreditCardPayment>
  <AllowInvoicePayment>false</AllowInvoicePayment>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <DefaultPaymentOptionId>0</DefaultPaymentOptionId>
  <Enabled>false</Enabled>
  <InvoiceFee>0</InvoiceFee>
  <PaymentProviderId>0</PaymentProviderId>
  <PaymentProviderOptions>
    <PaymentProviderOptionsResponse>
      <Description>String</Description>
      <Id>0</Id>
      <Name>String</Name>
    </PaymentProviderOptionsResponse>
  </PaymentProviderOptions>
  <RefundOnCancelBooking>false</RefundOnCancelBooking>
  <SendPaymentRequestDirectly>false</SendPaymentRequestDirectly>
</PaymentSettingsQueryResponse>