POST | /payment/billmate/v1/ipncallback | IPN callback for Qvickly checkout 1.0 | IPN callback for Qvickly checkout 1.0 |
---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class IpnCallBackResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Message=null,
/** @var bool|null */
public ?bool $Success=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Message'])) $this->Message = $o['Message'];
if (isset($o['Success'])) $this->Success = $o['Success'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Message)) $o['Message'] = $this->Message;
if (isset($this->Success)) $o['Success'] = $this->Success;
return empty($o) ? new class(){} : $o;
}
}
class ServerDataResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $HTTP_HOST=null,
/** @var string|null */
public ?string $HTTP_CONNECTION=null,
/** @var string|null */
public ?string $HTTP_CACHE_CONTROL=null,
/** @var string|null */
public ?string $HTTP_ACCEPT=null,
/** @var string|null */
public ?string $HTTP_USER_AGENT=null,
/** @var string|null */
public ?string $HTTP_ACCEPT_ENCODING=null,
/** @var string|null */
public ?string $HTTP_ACCEPT_LANGUAGE=null,
/** @var string|null */
public ?string $PATH=null,
/** @var string|null */
public ?string $SERVER_SOFTWARE=null,
/** @var string|null */
public ?string $SERVER_NAME=null,
/** @var string|null */
public ?string $SERVER_ADDR=null,
/** @var string|null */
public ?string $SERVER_PORT=null,
/** @var string|null */
public ?string $REMOTE_ADDR=null,
/** @var string|null */
public ?string $REMOTE_PORT=null,
/** @var string|null */
public ?string $GATEWAY_INTERFACE=null,
/** @var string|null */
public ?string $SERVER_PROTOCOL=null,
/** @var string|null */
public ?string $REQUEST_METHOD=null,
/** @var string|null */
public ?string $QUERY_STRING=null,
/** @var string|null */
public ?string $REQUEST_TIME=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['HTTP_HOST'])) $this->HTTP_HOST = $o['HTTP_HOST'];
if (isset($o['HTTP_CONNECTION'])) $this->HTTP_CONNECTION = $o['HTTP_CONNECTION'];
if (isset($o['HTTP_CACHE_CONTROL'])) $this->HTTP_CACHE_CONTROL = $o['HTTP_CACHE_CONTROL'];
if (isset($o['HTTP_ACCEPT'])) $this->HTTP_ACCEPT = $o['HTTP_ACCEPT'];
if (isset($o['HTTP_USER_AGENT'])) $this->HTTP_USER_AGENT = $o['HTTP_USER_AGENT'];
if (isset($o['HTTP_ACCEPT_ENCODING'])) $this->HTTP_ACCEPT_ENCODING = $o['HTTP_ACCEPT_ENCODING'];
if (isset($o['HTTP_ACCEPT_LANGUAGE'])) $this->HTTP_ACCEPT_LANGUAGE = $o['HTTP_ACCEPT_LANGUAGE'];
if (isset($o['PATH'])) $this->PATH = $o['PATH'];
if (isset($o['SERVER_SOFTWARE'])) $this->SERVER_SOFTWARE = $o['SERVER_SOFTWARE'];
if (isset($o['SERVER_NAME'])) $this->SERVER_NAME = $o['SERVER_NAME'];
if (isset($o['SERVER_ADDR'])) $this->SERVER_ADDR = $o['SERVER_ADDR'];
if (isset($o['SERVER_PORT'])) $this->SERVER_PORT = $o['SERVER_PORT'];
if (isset($o['REMOTE_ADDR'])) $this->REMOTE_ADDR = $o['REMOTE_ADDR'];
if (isset($o['REMOTE_PORT'])) $this->REMOTE_PORT = $o['REMOTE_PORT'];
if (isset($o['GATEWAY_INTERFACE'])) $this->GATEWAY_INTERFACE = $o['GATEWAY_INTERFACE'];
if (isset($o['SERVER_PROTOCOL'])) $this->SERVER_PROTOCOL = $o['SERVER_PROTOCOL'];
if (isset($o['REQUEST_METHOD'])) $this->REQUEST_METHOD = $o['REQUEST_METHOD'];
if (isset($o['QUERY_STRING'])) $this->QUERY_STRING = $o['QUERY_STRING'];
if (isset($o['REQUEST_TIME'])) $this->REQUEST_TIME = $o['REQUEST_TIME'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->HTTP_HOST)) $o['HTTP_HOST'] = $this->HTTP_HOST;
if (isset($this->HTTP_CONNECTION)) $o['HTTP_CONNECTION'] = $this->HTTP_CONNECTION;
if (isset($this->HTTP_CACHE_CONTROL)) $o['HTTP_CACHE_CONTROL'] = $this->HTTP_CACHE_CONTROL;
if (isset($this->HTTP_ACCEPT)) $o['HTTP_ACCEPT'] = $this->HTTP_ACCEPT;
if (isset($this->HTTP_USER_AGENT)) $o['HTTP_USER_AGENT'] = $this->HTTP_USER_AGENT;
if (isset($this->HTTP_ACCEPT_ENCODING)) $o['HTTP_ACCEPT_ENCODING'] = $this->HTTP_ACCEPT_ENCODING;
if (isset($this->HTTP_ACCEPT_LANGUAGE)) $o['HTTP_ACCEPT_LANGUAGE'] = $this->HTTP_ACCEPT_LANGUAGE;
if (isset($this->PATH)) $o['PATH'] = $this->PATH;
if (isset($this->SERVER_SOFTWARE)) $o['SERVER_SOFTWARE'] = $this->SERVER_SOFTWARE;
if (isset($this->SERVER_NAME)) $o['SERVER_NAME'] = $this->SERVER_NAME;
if (isset($this->SERVER_ADDR)) $o['SERVER_ADDR'] = $this->SERVER_ADDR;
if (isset($this->SERVER_PORT)) $o['SERVER_PORT'] = $this->SERVER_PORT;
if (isset($this->REMOTE_ADDR)) $o['REMOTE_ADDR'] = $this->REMOTE_ADDR;
if (isset($this->REMOTE_PORT)) $o['REMOTE_PORT'] = $this->REMOTE_PORT;
if (isset($this->GATEWAY_INTERFACE)) $o['GATEWAY_INTERFACE'] = $this->GATEWAY_INTERFACE;
if (isset($this->SERVER_PROTOCOL)) $o['SERVER_PROTOCOL'] = $this->SERVER_PROTOCOL;
if (isset($this->REQUEST_METHOD)) $o['REQUEST_METHOD'] = $this->REQUEST_METHOD;
if (isset($this->QUERY_STRING)) $o['QUERY_STRING'] = $this->QUERY_STRING;
if (isset($this->REQUEST_TIME)) $o['REQUEST_TIME'] = $this->REQUEST_TIME;
return empty($o) ? new class(){} : $o;
}
}
class CredentialsResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $hash=null,
/** @var string|null */
public ?string $id=null,
/** @var string|null */
public ?string $version=null,
/** @var string|null */
public ?string $client=null,
/** @var ServerDataResponse|null */
public ?ServerDataResponse $serverdata=null,
/** @var string|null */
public ?string $time=null,
/** @var string|null */
public ?string $test=null,
/** @var string|null */
public ?string $language=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['hash'])) $this->hash = $o['hash'];
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['version'])) $this->version = $o['version'];
if (isset($o['client'])) $this->client = $o['client'];
if (isset($o['serverdata'])) $this->serverdata = JsonConverters::from('ServerDataResponse', $o['serverdata']);
if (isset($o['time'])) $this->time = $o['time'];
if (isset($o['test'])) $this->test = $o['test'];
if (isset($o['language'])) $this->language = $o['language'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->hash)) $o['hash'] = $this->hash;
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->version)) $o['version'] = $this->version;
if (isset($this->client)) $o['client'] = $this->client;
if (isset($this->serverdata)) $o['serverdata'] = JsonConverters::to('ServerDataResponse', $this->serverdata);
if (isset($this->time)) $o['time'] = $this->time;
if (isset($this->test)) $o['test'] = $this->test;
if (isset($this->language)) $o['language'] = $this->language;
return empty($o) ? new class(){} : $o;
}
}
class QvicklyIpnCallbackResponseData implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $number=null,
/** @var string|null */
public ?string $status=null,
/** @var string|null */
public ?string $orderid=null,
/** @var string|null */
public ?string $url=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['number'])) $this->number = $o['number'];
if (isset($o['status'])) $this->status = $o['status'];
if (isset($o['orderid'])) $this->orderid = $o['orderid'];
if (isset($o['url'])) $this->url = $o['url'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->number)) $o['number'] = $this->number;
if (isset($this->status)) $o['status'] = $this->status;
if (isset($this->orderid)) $o['orderid'] = $this->orderid;
if (isset($this->url)) $o['url'] = $this->url;
return empty($o) ? new class(){} : $o;
}
}
class QvicklyCheckoutIpnCallBack implements ICompany, JsonSerializable
{
public function __construct(
/** @description 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.")
/** @var string|null */
public ?string $CompanyId=null,
/** @description Internal reference id (Could be booking, could be Article..) */
// @ApiMember(Description="Internal reference id (Could be booking, could be Article..)")
/** @var string|null */
public ?string $BookingId=null,
/** @description The payment credentials. */
// @ApiMember(Description="The payment credentials.")
/** @var CredentialsResponse|null */
public ?CredentialsResponse $credentials=null,
/** @description The payment ipn callback data. */
// @ApiMember(Description="The payment ipn callback data.")
/** @var QvicklyIpnCallbackResponseData|null */
public ?QvicklyIpnCallbackResponseData $data=null,
/** @description Article type (Could be Service, rebate code types, etc.. */
// @ApiMember(Description="Article type (Could be Service, rebate code types, etc..", IsRequired=true)
/** @var int */
public int $ArticleTypeId=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
if (isset($o['BookingId'])) $this->BookingId = $o['BookingId'];
if (isset($o['credentials'])) $this->credentials = JsonConverters::from('CredentialsResponse', $o['credentials']);
if (isset($o['data'])) $this->data = JsonConverters::from('QvicklyIpnCallbackResponseData', $o['data']);
if (isset($o['ArticleTypeId'])) $this->ArticleTypeId = $o['ArticleTypeId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
if (isset($this->BookingId)) $o['BookingId'] = $this->BookingId;
if (isset($this->credentials)) $o['credentials'] = JsonConverters::to('CredentialsResponse', $this->credentials);
if (isset($this->data)) $o['data'] = JsonConverters::to('QvicklyIpnCallbackResponseData', $this->data);
if (isset($this->ArticleTypeId)) $o['ArticleTypeId'] = $this->ArticleTypeId;
return empty($o) ? new class(){} : $o;
}
}
PHP QvicklyCheckoutIpnCallBack DTOs
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.
POST /payment/billmate/v1/ipncallback HTTP/1.1
Host: api.bokamera.se
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","BookingId":"String","credentials":{"hash":"String","id":"String","version":"String","client":"String","serverdata":{"HTTP_HOST":"String","HTTP_CONNECTION":"String","HTTP_CACHE_CONTROL":"String","HTTP_ACCEPT":"String","HTTP_USER_AGENT":"String","HTTP_ACCEPT_ENCODING":"String","HTTP_ACCEPT_LANGUAGE":"String","PATH":"String","SERVER_SOFTWARE":"String","SERVER_NAME":"String","SERVER_ADDR":"String","SERVER_PORT":"String","REMOTE_ADDR":"String","REMOTE_PORT":"String","GATEWAY_INTERFACE":"String","SERVER_PROTOCOL":"String","REQUEST_METHOD":"String","QUERY_STRING":"String","REQUEST_TIME":"String"},"time":"String","test":"String","language":"String"},"data":{"number":"String","status":"String","orderid":"String","url":"String"},"ArticleTypeId":0}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"Message":"String","Success":false}