digitaluapi

<back to all web services

DuEnableNotifyRequest

The following routes are available for this service:
POST/duenable/webhook/notify
<?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};


enum PaymentTypeEnum : int
{
    case OneTime = 1;
    case Recurring = 2;
}

class DuEnableNotifyRequest implements JsonSerializable
{
    public function __construct(
        /** @var PaymentTypeEnum|null */
        public ?PaymentTypeEnum $PaymentType=null,
        /** @var string|null */
        public ?string $TransactionId=null,
        /** @var string|null */
        public ?string $Uuid=null,
        /** @var string|null */
        public ?string $PaymentId=null,
        /** @var int */
        public int $Result=0,
        /** @var string|null */
        public ?string $Message=null,
        /** @var float */
        public float $TotalAmount=0.0,
        /** @var float */
        public float $AdjustmentAmount=0.0,
        /** @var float */
        public float $TransactionAmount=0.0,
        /** @var float */
        public float $FeeAmount=0.0,
        /** @var string|null */
        public ?string $RecurringId=null,
        /** @var string|null */
        public ?string $Signature=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PaymentType'])) $this->PaymentType = JsonConverters::from('PaymentTypeEnum', $o['PaymentType']);
        if (isset($o['TransactionId'])) $this->TransactionId = $o['TransactionId'];
        if (isset($o['Uuid'])) $this->Uuid = $o['Uuid'];
        if (isset($o['PaymentId'])) $this->PaymentId = $o['PaymentId'];
        if (isset($o['Result'])) $this->Result = $o['Result'];
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['TotalAmount'])) $this->TotalAmount = $o['TotalAmount'];
        if (isset($o['AdjustmentAmount'])) $this->AdjustmentAmount = $o['AdjustmentAmount'];
        if (isset($o['TransactionAmount'])) $this->TransactionAmount = $o['TransactionAmount'];
        if (isset($o['FeeAmount'])) $this->FeeAmount = $o['FeeAmount'];
        if (isset($o['RecurringId'])) $this->RecurringId = $o['RecurringId'];
        if (isset($o['Signature'])) $this->Signature = $o['Signature'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PaymentType)) $o['PaymentType'] = JsonConverters::to('PaymentTypeEnum', $this->PaymentType);
        if (isset($this->TransactionId)) $o['TransactionId'] = $this->TransactionId;
        if (isset($this->Uuid)) $o['Uuid'] = $this->Uuid;
        if (isset($this->PaymentId)) $o['PaymentId'] = $this->PaymentId;
        if (isset($this->Result)) $o['Result'] = $this->Result;
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->TotalAmount)) $o['TotalAmount'] = $this->TotalAmount;
        if (isset($this->AdjustmentAmount)) $o['AdjustmentAmount'] = $this->AdjustmentAmount;
        if (isset($this->TransactionAmount)) $o['TransactionAmount'] = $this->TransactionAmount;
        if (isset($this->FeeAmount)) $o['FeeAmount'] = $this->FeeAmount;
        if (isset($this->RecurringId)) $o['RecurringId'] = $this->RecurringId;
        if (isset($this->Signature)) $o['Signature'] = $this->Signature;
        return empty($o) ? new class(){} : $o;
    }
}

PHP DuEnableNotifyRequest DTOs

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

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /duenable/webhook/notify HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"PaymentType":"OneTime","TransactionId":"String","Uuid":"String","PaymentId":"String","Result":0,"Message":"String","TotalAmount":0,"AdjustmentAmount":0,"TransactionAmount":0,"FeeAmount":0,"RecurringId":"String","Signature":"String"}