Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
POST | /payment/settings | Add payment settings | Add 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
{
[ValidateRequest("IsAuthenticated")]
public partial class AddPaymentSettings
: 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 payson payment is enabled
///</summary>
[ApiMember(Description="The payson 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? DefaultAdminPaymentOptionsId { get; set; }
///<summary>
///What payment provider to use
///</summary>
[ApiMember(Description="What payment provider to use")]
public virtual int PaymentProviderId { get; set; }
}
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; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<AddPaymentSettings 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>
<DefaultAdminPaymentOptionsId>0</DefaultAdminPaymentOptionsId>
<Enabled>false</Enabled>
<InvoiceFee>0</InvoiceFee>
<PaymentProviderId>0</PaymentProviderId>
<RefundOnCancelBooking>false</RefundOnCancelBooking>
</AddPaymentSettings>
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>