BokaMera.API.Host

<back to all web services

AddPaymentSettings

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/payment/settingsAdd payment settingsAdd payment settings for the logged in company
import java.math.*
import java.util.*
import net.servicestack.client.*


@ValidateRequest(Validator="IsAuthenticated")
open class AddPaymentSettings : ICompany
{
    /**
    * 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.")
    var CompanyId:UUID? = null

    /**
    * The payson payment is enabled
    */
    @ApiMember(Description="The payson payment is enabled")
    var Enabled:Boolean? = null

    /**
    * 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")
    var InvoiceFee:Int? = null

    /**
    * If allow credit card payment
    */
    @ApiMember(Description="If allow credit card payment")
    var AllowCreditCardPayment:Boolean? = null

    /**
    * If allow invoice payment
    */
    @ApiMember(Description="If allow invoice payment")
    var AllowInvoicePayment:Boolean? = null

    /**
    * If allow bank payment
    */
    @ApiMember(Description="If allow bank payment")
    var AllowBankPayment:Boolean? = null

    /**
    * Automatically refund customer on canceled booking
    */
    @ApiMember(Description="Automatically refund customer on canceled booking")
    var RefundOnCancelBooking:Boolean? = null

    /**
    * The default option when admin creates a new booking
    */
    @ApiMember(Description="The default option when admin creates a new booking")
    var DefaultAdminPaymentOptionsId:Int? = null

    /**
    * What payment provider to use
    */
    @ApiMember(Description="What payment provider to use")
    var PaymentProviderId:Int? = null
}

open class PaymentSettingsQueryResponse
{
    /**
    * The company id
    */
    @ApiMember(Description="The company id")
    var CompanyId:UUID? = null

    /**
    * The payment is enabled
    */
    @ApiMember(Description="The payment is enabled")
    var Enabled:Boolean? = null

    /**
    * 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")
    var InvoiceFee:Int? = null

    /**
    * If allow credit card payment
    */
    @ApiMember(Description="If allow credit card payment")
    var AllowCreditCardPayment:Boolean? = null

    /**
    * If allow invoice payment
    */
    @ApiMember(Description="If allow invoice payment")
    var AllowInvoicePayment:Boolean? = null

    /**
    * If allow bank payment
    */
    @ApiMember(Description="If allow bank payment")
    var AllowBankPayment:Boolean? = null

    /**
    * Automatically refund customer on canceled booking
    */
    @ApiMember(Description="Automatically refund customer on canceled booking")
    var RefundOnCancelBooking:Boolean? = null

    /**
    * The default option when admin creates a new booking
    */
    @ApiMember(Description="The default option when admin creates a new booking")
    var DefaultPaymentOptionId:Int? = null

    /**
    * What payment provider to use
    */
    @ApiMember(Description="What payment provider to use")
    var PaymentProviderId:Int? = null

    /**
    * 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")
    var AdminPaymentOptions:ArrayList<AdminPaymentOptionsResponse> = ArrayList<AdminPaymentOptionsResponse>()

    /**
    * 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")
    var PaymentProviderOptions:ArrayList<PaymentProviderOptionsResponse> = ArrayList<PaymentProviderOptionsResponse>()

    /**
    * SendPaymentRequestDirectly
    */
    @ApiMember(Description="SendPaymentRequestDirectly")
    var SendPaymentRequestDirectly:Boolean? = null
}

open class AdminPaymentOptionsResponse
{
    /**
    * The payment options id
    */
    @ApiMember(Description="The payment options id")
    var Id:Int? = null

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

    /**
    * The payment options description
    */
    @ApiMember(Description="The payment options description")
    var Description:String? = null
}

open class PaymentProviderOptionsResponse
{
    /**
    * The payment provider id
    */
    @ApiMember(Description="The payment provider id")
    var Id:Int? = null

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

    /**
    * The payment provider description
    */
    @ApiMember(Description="The payment provider description")
    var Description:String? = null
}

Kotlin AddPaymentSettings 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 /payment/settings HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AddPaymentSettings xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <AllowBankPayment>false</AllowBankPayment>
  <AllowCreditCardPayment>false</AllowCreditCardPayment>
  <AllowInvoicePayment>false</AllowInvoicePayment>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <DefaultAdminPaymentOptionsId>0</DefaultAdminPaymentOptionsId>
  <Enabled>false</Enabled>
  <InvoiceFee>0</InvoiceFee>
  <PaymentProviderId>0</PaymentProviderId>
  <RefundOnCancelBooking>false</RefundOnCancelBooking>
</AddPaymentSettings>
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>