Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /payment/settings/ | Update payment settings | Update payment settings for the logged in company |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
namespace BokaMera.API.ServiceModel.Dtos
{
public partial class AdminPaymentOptionsResponse
{
///<summary>
///The payment options id
///</summary>
[ApiMember(Description="The payment options id")]
public virtual int Id { get; set; }
///<summary>
///The payment options name
///</summary>
[ApiMember(Description="The payment options name")]
public virtual string Name { get; set; }
///<summary>
///The payment options description
///</summary>
[ApiMember(Description="The payment options description")]
public virtual string Description { get; set; }
}
public partial class PaymentProviderOptionsResponse
{
///<summary>
///The payment provider id
///</summary>
[ApiMember(Description="The payment provider id")]
public virtual int Id { get; set; }
///<summary>
///The payment provider name
///</summary>
[ApiMember(Description="The payment provider name")]
public virtual string Name { get; set; }
///<summary>
///The payment provider description
///</summary>
[ApiMember(Description="The payment provider description")]
public virtual string Description { get; set; }
}
public partial class PaymentSettingsQueryResponse
{
public PaymentSettingsQueryResponse()
{
AdminPaymentOptions = new List<AdminPaymentOptionsResponse>{};
PaymentProviderOptions = new List<PaymentProviderOptionsResponse>{};
}
///<summary>
///The company id
///</summary>
[ApiMember(Description="The company id")]
public virtual Guid CompanyId { get; set; }
///<summary>
///The payment is enabled
///</summary>
[ApiMember(Description="The payment is enabled")]
public virtual bool Enabled { get; set; }
///<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 virtual int InvoiceFee { get; set; }
///<summary>
///If allow credit card payment
///</summary>
[ApiMember(Description="If allow credit card payment")]
public virtual bool AllowCreditCardPayment { get; set; }
///<summary>
///If allow invoice payment
///</summary>
[ApiMember(Description="If allow invoice payment")]
public virtual bool AllowInvoicePayment { get; set; }
///<summary>
///If allow bank payment
///</summary>
[ApiMember(Description="If allow bank payment")]
public virtual bool AllowBankPayment { get; set; }
///<summary>
///Automatically refund customer on canceled booking
///</summary>
[ApiMember(Description="Automatically refund customer on canceled booking")]
public virtual bool RefundOnCancelBooking { get; set; }
///<summary>
///The default option when admin creates a new booking
///</summary>
[ApiMember(Description="The default option when admin creates a new booking")]
public virtual int? DefaultPaymentOptionId { get; set; }
///<summary>
///What payment provider to use
///</summary>
[ApiMember(Description="What payment provider to use")]
public virtual int PaymentProviderId { get; set; }
///<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 virtual List<AdminPaymentOptionsResponse> AdminPaymentOptions { get; set; }
///<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 virtual List<PaymentProviderOptionsResponse> PaymentProviderOptions { get; set; }
///<summary>
///SendPaymentRequestDirectly
///</summary>
[ApiMember(Description="SendPaymentRequestDirectly")]
public virtual bool SendPaymentRequestDirectly { get; set; }
}
[ValidateRequest("IsAuthenticated")]
public partial class UpdatePaymentSettings
: 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 virtual Guid? CompanyId { get; set; }
///<summary>
///The payment is enabled
///</summary>
[ApiMember(Description="The payment is enabled")]
public virtual bool? Enabled { get; set; }
///<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 virtual int? InvoiceFee { get; set; }
///<summary>
///If allow credit card payment
///</summary>
[ApiMember(Description="If allow credit card payment")]
public virtual bool? AllowCreditCardPayment { get; set; }
///<summary>
///If allow invoice payment
///</summary>
[ApiMember(Description="If allow invoice payment")]
public virtual bool? AllowInvoicePayment { get; set; }
///<summary>
///If allow bank payment
///</summary>
[ApiMember(Description="If allow bank payment")]
public virtual bool? AllowBankPayment { get; set; }
///<summary>
///Automatically refund customer on canceled booking
///</summary>
[ApiMember(Description="Automatically refund customer on canceled booking")]
public virtual bool? RefundOnCancelBooking { get; set; }
///<summary>
///The default option when admin creates a new booking
///</summary>
[ApiMember(Description="The default option when admin creates a new booking")]
public virtual int? DefaultPaymentOptionId { get; set; }
///<summary>
///What payment provider to use
///</summary>
[ApiMember(Description="What payment provider to use")]
public virtual int? PaymentProviderId { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
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/jsonl
Content-Type: text/jsonl
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/jsonl 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}