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 Foundation
import ServiceStack

// @ValidateRequest(Validator="IsAuthenticated")
public class UpdatePaymentSettings : ICompany, Codable
{
    /**
    * 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.")
    public var companyId:String?

    /**
    * The payment is enabled
    */
    // @ApiMember(Description="The payment is enabled")
    public var enabled:Bool?

    /**
    * Automatically refund customer on canceled booking
    */
    // @ApiMember(Description="Automatically refund customer on canceled booking")
    public var refundOnCancelBooking:Bool?

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

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

    required public init(){}
}

public class PaymentSettingsQueryResponse : Codable
{
    /**
    * The company id
    */
    // @ApiMember(Description="The company id")
    public var companyId:String

    /**
    * The payment is enabled
    */
    // @ApiMember(Description="The payment is enabled")
    public var enabled:Bool

    /**
    * Automatically refund customer on canceled booking
    */
    // @ApiMember(Description="Automatically refund customer on canceled booking")
    public var refundOnCancelBooking:Bool

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

    /**
    * What payment provider to use
    */
    // @ApiMember(Description="What payment provider to use")
    public var paymentProviderId:Int

    /**
    * 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")
    public var adminPaymentOptions:[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")
    public var paymentProviderOptions:[PaymentProviderOptionsResponse] = []

    required public init(){}
}

public class AdminPaymentOptionsResponse : Codable
{
    /**
    * The payment options id
    */
    // @ApiMember(Description="The payment options id")
    public var id:Int

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

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

    required public init(){}
}

public class PaymentProviderOptionsResponse : Codable
{
    /**
    * The payment provider id
    */
    // @ApiMember(Description="The payment provider id")
    public var id:Int

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

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

    required public init(){}
}


Swift UpdatePaymentSettings DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	Enabled: False,
	RefundOnCancelBooking: False,
	DefaultPaymentOptionId: 0,
	PaymentProviderId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Enabled: False,
	RefundOnCancelBooking: False,
	DefaultPaymentOptionId: 0,
	PaymentProviderId: 0,
	AdminPaymentOptions: 
	[
		{
			Id: 0,
			Name: String,
			Description: String
		}
	],
	PaymentProviderOptions: 
	[
		{
			Id: 0,
			Name: String,
			Description: String
		}
	]
}