BokaMera.API.Host

<back to all web services

UpdatePaymentSettings

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/payment/settings/Update payment settingsUpdate payment settings for the logged in company
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AdminPaymentOptionsResponse:
    # @ApiMember(Description="The payment options id")
    id: int = 0
    """
    The payment options id
    """


    # @ApiMember(Description="The payment options name")
    name: Optional[str] = None
    """
    The payment options name
    """


    # @ApiMember(Description="The payment options description")
    description: Optional[str] = None
    """
    The payment options description
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PaymentProviderOptionsResponse:
    # @ApiMember(Description="The payment provider id")
    id: int = 0
    """
    The payment provider id
    """


    # @ApiMember(Description="The payment provider name")
    name: Optional[str] = None
    """
    The payment provider name
    """


    # @ApiMember(Description="The payment provider description")
    description: Optional[str] = None
    """
    The payment provider description
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PaymentSettingsQueryResponse:
    # @ApiMember(Description="The company id")
    company_id: Optional[str] = None
    """
    The company id
    """


    # @ApiMember(Description="The payment is enabled")
    enabled: bool = False
    """
    The payment is enabled
    """


    # @ApiMember(Description="If there should be any fee added when customer selected invoice payment method")
    invoice_fee: int = 0
    """
    If there should be any fee added when customer selected invoice payment method
    """


    # @ApiMember(Description="If allow credit card payment")
    allow_credit_card_payment: bool = False
    """
    If allow credit card payment
    """


    # @ApiMember(Description="If allow invoice payment")
    allow_invoice_payment: bool = False
    """
    If allow invoice payment
    """


    # @ApiMember(Description="If allow bank payment")
    allow_bank_payment: bool = False
    """
    If allow bank payment
    """


    # @ApiMember(Description="Automatically refund customer on canceled booking")
    refund_on_cancel_booking: bool = False
    """
    Automatically refund customer on canceled booking
    """


    # @ApiMember(Description="The default option when admin creates a new booking")
    default_payment_option_id: Optional[int] = None
    """
    The default option when admin creates a new booking
    """


    # @ApiMember(Description="What payment provider to use")
    payment_provider_id: int = 0
    """
    What payment provider to use
    """


    # @ApiMember(DataType="boolean", Description="If you want to include the admin payment options to select from", ParameterType="query")
    admin_payment_options: Optional[List[AdminPaymentOptionsResponse]] = None
    """
    If you want to include the admin payment options to select from
    """


    # @ApiMember(DataType="boolean", Description="If you want to include the payment provider options to select from", ParameterType="query")
    payment_provider_options: Optional[List[PaymentProviderOptionsResponse]] = None
    """
    If you want to include the payment provider options to select from
    """


    # @ApiMember(Description="SendPaymentRequestDirectly")
    send_payment_request_directly: bool = False
    """
    SendPaymentRequestDirectly
    """


# @ValidateRequest(Validator="IsAuthenticated")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdatePaymentSettings(ICompany):
    # @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    company_id: Optional[str] = None
    """
    The company id, if empty will use the company id for the user you are logged in with.
    """


    # @ApiMember(Description="The payment is enabled")
    enabled: Optional[bool] = None
    """
    The payment is enabled
    """


    # @ApiMember(Description="If there should be any fee added when customer selected invoice payment method")
    invoice_fee: Optional[int] = None
    """
    If there should be any fee added when customer selected invoice payment method
    """


    # @ApiMember(Description="If allow credit card payment")
    allow_credit_card_payment: Optional[bool] = None
    """
    If allow credit card payment
    """


    # @ApiMember(Description="If allow invoice payment")
    allow_invoice_payment: Optional[bool] = None
    """
    If allow invoice payment
    """


    # @ApiMember(Description="If allow bank payment")
    allow_bank_payment: Optional[bool] = None
    """
    If allow bank payment
    """


    # @ApiMember(Description="Automatically refund customer on canceled booking")
    refund_on_cancel_booking: Optional[bool] = None
    """
    Automatically refund customer on canceled booking
    """


    # @ApiMember(Description="The default option when admin creates a new booking")
    default_payment_option_id: Optional[int] = None
    """
    The default option when admin creates a new booking
    """


    # @ApiMember(Description="What payment provider to use")
    payment_provider_id: Optional[int] = None
    """
    What payment provider to use
    """

Python UpdatePaymentSettings 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.

PUT /payment/settings/ HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<UpdatePaymentSettings 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>
  <DefaultPaymentOptionId>0</DefaultPaymentOptionId>
  <Enabled>false</Enabled>
  <InvoiceFee>0</InvoiceFee>
  <PaymentProviderId>0</PaymentProviderId>
  <RefundOnCancelBooking>false</RefundOnCancelBooking>
</UpdatePaymentSettings>
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>