Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /payment/settings/ | Update payment settings | Update 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 .csv suffix or ?format=csv
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: api.bokamera.se
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","Enabled":false,"InvoiceFee":0,"AllowCreditCardPayment":false,"AllowInvoicePayment":false,"AllowBankPayment":false,"RefundOnCancelBooking":false,"DefaultPaymentOptionId":0,"PaymentProviderId":0}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Enabled":false,"InvoiceFee":0,"AllowCreditCardPayment":false,"AllowInvoicePayment":false,"AllowBankPayment":false,"RefundOnCancelBooking":false,"DefaultPaymentOptionId":0,"PaymentProviderId":0,"AdminPaymentOptions":[{"Id":0,"Name":"String","Description":"String"}],"PaymentProviderOptions":[{"Id":0,"Name":"String","Description":"String"}],"SendPaymentRequestDirectly":false}