Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
POST | /payment/settings | Add payment settings | Add payment settings for the logged in company |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Namespace Global
Namespace BokaMera.API.ServiceModel.Dtos
<ValidateRequest(Validator:="IsAuthenticated")>
Public Partial Class AddPaymentSettings
Implements ICompany
'''<Summary>
'''The company id, if empty will use the company id for the user you are logged in with.
'''</Summary>
<ApiMember(Description:="The company id, if empty will use the company id for the user you are logged in with.")>
Public Overridable Property CompanyId As Nullable(Of Guid)
'''<Summary>
'''The payson payment is enabled
'''</Summary>
<ApiMember(Description:="The payson payment is enabled")>
Public Overridable Property Enabled As Boolean
'''<Summary>
'''If there should be any fee added when customer selected invoice payment method
'''</Summary>
<ApiMember(Description:="If there should be any fee added when customer selected invoice payment method")>
Public Overridable Property InvoiceFee As Integer
'''<Summary>
'''If allow credit card payment
'''</Summary>
<ApiMember(Description:="If allow credit card payment")>
Public Overridable Property AllowCreditCardPayment As Boolean
'''<Summary>
'''If allow invoice payment
'''</Summary>
<ApiMember(Description:="If allow invoice payment")>
Public Overridable Property AllowInvoicePayment As Boolean
'''<Summary>
'''If allow bank payment
'''</Summary>
<ApiMember(Description:="If allow bank payment")>
Public Overridable Property AllowBankPayment As Boolean
'''<Summary>
'''Automatically refund customer on canceled booking
'''</Summary>
<ApiMember(Description:="Automatically refund customer on canceled booking")>
Public Overridable Property RefundOnCancelBooking As Boolean
'''<Summary>
'''The default option when admin creates a new booking
'''</Summary>
<ApiMember(Description:="The default option when admin creates a new booking")>
Public Overridable Property DefaultAdminPaymentOptionsId As Nullable(Of Integer)
'''<Summary>
'''What payment provider to use
'''</Summary>
<ApiMember(Description:="What payment provider to use")>
Public Overridable Property PaymentProviderId As Integer
End Class
Public Partial Class AdminPaymentOptionsResponse
'''<Summary>
'''The payment options id
'''</Summary>
<ApiMember(Description:="The payment options id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The payment options name
'''</Summary>
<ApiMember(Description:="The payment options name")>
Public Overridable Property Name As String
'''<Summary>
'''The payment options description
'''</Summary>
<ApiMember(Description:="The payment options description")>
Public Overridable Property Description As String
End Class
Public Partial Class PaymentProviderOptionsResponse
'''<Summary>
'''The payment provider id
'''</Summary>
<ApiMember(Description:="The payment provider id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The payment provider name
'''</Summary>
<ApiMember(Description:="The payment provider name")>
Public Overridable Property Name As String
'''<Summary>
'''The payment provider description
'''</Summary>
<ApiMember(Description:="The payment provider description")>
Public Overridable Property Description As String
End Class
Public Partial Class PaymentSettingsQueryResponse
Public Sub New()
AdminPaymentOptions = New List(Of AdminPaymentOptionsResponse)
PaymentProviderOptions = New List(Of PaymentProviderOptionsResponse)
End Sub
'''<Summary>
'''The company id
'''</Summary>
<ApiMember(Description:="The company id")>
Public Overridable Property CompanyId As Guid
'''<Summary>
'''The payment is enabled
'''</Summary>
<ApiMember(Description:="The payment is enabled")>
Public Overridable Property Enabled As Boolean
'''<Summary>
'''If there should be any fee added when customer selected invoice payment method
'''</Summary>
<ApiMember(Description:="If there should be any fee added when customer selected invoice payment method")>
Public Overridable Property InvoiceFee As Integer
'''<Summary>
'''If allow credit card payment
'''</Summary>
<ApiMember(Description:="If allow credit card payment")>
Public Overridable Property AllowCreditCardPayment As Boolean
'''<Summary>
'''If allow invoice payment
'''</Summary>
<ApiMember(Description:="If allow invoice payment")>
Public Overridable Property AllowInvoicePayment As Boolean
'''<Summary>
'''If allow bank payment
'''</Summary>
<ApiMember(Description:="If allow bank payment")>
Public Overridable Property AllowBankPayment As Boolean
'''<Summary>
'''Automatically refund customer on canceled booking
'''</Summary>
<ApiMember(Description:="Automatically refund customer on canceled booking")>
Public Overridable Property RefundOnCancelBooking As Boolean
'''<Summary>
'''The default option when admin creates a new booking
'''</Summary>
<ApiMember(Description:="The default option when admin creates a new booking")>
Public Overridable Property DefaultPaymentOptionId As Nullable(Of Integer)
'''<Summary>
'''What payment provider to use
'''</Summary>
<ApiMember(Description:="What payment provider to use")>
Public Overridable Property PaymentProviderId As Integer
'''<Summary>
'''If you want to include the admin payment options to select from
'''</Summary>
<ApiMember(DataType:="boolean", Description:="If you want to include the admin payment options to select from", ParameterType:="query")>
Public Overridable Property AdminPaymentOptions As List(Of AdminPaymentOptionsResponse)
'''<Summary>
'''If you want to include the payment provider options to select from
'''</Summary>
<ApiMember(DataType:="boolean", Description:="If you want to include the payment provider options to select from", ParameterType:="query")>
Public Overridable Property PaymentProviderOptions As List(Of PaymentProviderOptionsResponse)
'''<Summary>
'''SendPaymentRequestDirectly
'''</Summary>
<ApiMember(Description:="SendPaymentRequestDirectly")>
Public Overridable Property SendPaymentRequestDirectly As Boolean
End Class
End Namespace
End Namespace
VB.NET AddPaymentSettings DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: text/jsv
Content-Type: text/jsv
Content-Length: length
{
CompanyId: 00000000-0000-0000-0000-000000000000,
Enabled: False,
InvoiceFee: 0,
AllowCreditCardPayment: False,
AllowInvoicePayment: False,
AllowBankPayment: False,
RefundOnCancelBooking: False,
DefaultAdminPaymentOptionsId: 0,
PaymentProviderId: 0
}
HTTP/1.1 200 OK Content-Type: text/jsv 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 }