digitaluapi

<back to all web services

OnceOffPaymentRequests

Requires Authentication
Required role:Client
The following routes are available for this service:
POST/onceoffpaymentOnce of Payments
<?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 OnceOffPaymentResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $PublicAccessGuid='',
        /** @var string|null */
        public ?string $InvoiceNumber=null,
        /** @var int */
        public int $StatusCodesId=0,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PublicAccessGuid'])) $this->PublicAccessGuid = $o['PublicAccessGuid'];
        if (isset($o['InvoiceNumber'])) $this->InvoiceNumber = $o['InvoiceNumber'];
        if (isset($o['StatusCodesId'])) $this->StatusCodesId = $o['StatusCodesId'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PublicAccessGuid)) $o['PublicAccessGuid'] = $this->PublicAccessGuid;
        if (isset($this->InvoiceNumber)) $o['InvoiceNumber'] = $this->InvoiceNumber;
        if (isset($this->StatusCodesId)) $o['StatusCodesId'] = $this->StatusCodesId;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class OnceOffPaymentRequests implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=1)
        // @Validate(Validator="NotNull")
        /** @var string */
        public string $Segment='',

        // @DataMember(Order=2)
        // @Validate(Validator="NotNull")
        /** @var string */
        public string $FirstName='',

        // @DataMember(Order=3)
        // @Validate(Validator="NotNull")
        /** @var string */
        public string $LastName='',

        // @DataMember(Order=4)
        /** @var string|null */
        public ?string $Address=null,

        // @DataMember(Order=5)
        /** @var string|null */
        public ?string $City=null,

        // @DataMember(Order=6)
        /** @var string|null */
        public ?string $Region=null,

        // @DataMember(Order=7)
        /** @var string|null */
        public ?string $Suburb=null,

        // @DataMember(Order=8)
        /** @var string|null */
        public ?string $PostalCode=null,

        // @DataMember(Order=9)
        /** @var string|null */
        public ?string $MobileNumber=null,

        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $Email=null,

        // @DataMember(Order=11)
        /** @var string|null */
        public ?string $IdNumber=null,

        // @DataMember(Order=12)
        /** @var string|null */
        public ?string $PassportNumber=null,

        // @DataMember(Order=13)
        // @Validate(Validator="NotNull")
        /** @var string */
        public string $InvoiceNumber='',

        // @DataMember(Order=14)
        /** @var DateTime */
        public DateTime $DebtDate=new DateTime(),

        // @DataMember(Order=15)
        // @Validate(Validator="NotNull")
        /** @var float */
        public float $AmountOutstanding=0.0,

        // @DataMember(Order=16)
        // @Validate(Validator="NotNull")
        /** @var int */
        public int $CurrenciesId=0,

        // @DataMember(Order=17)
        // @Validate(Validator="NotNull")
        /** @var int */
        public int $ChannelsId=0,

        // @DataMember(Order=18)
        /** @var array<string,string>|null */
        public ?array $DebtMeta=null,

        // @DataMember(Order=19)
        /** @var array<string,string>|null */
        public ?array $CustomersMeta=null,

        // @DataMember(Order=20)
        /** @var string|null */
        public ?string $UrlToDocument=null,

        // @DataMember(Order=21)
        /** @var string|null */
        public ?string $CustomerUniqueIdentifier=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Segment'])) $this->Segment = $o['Segment'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['LastName'])) $this->LastName = $o['LastName'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['Region'])) $this->Region = $o['Region'];
        if (isset($o['Suburb'])) $this->Suburb = $o['Suburb'];
        if (isset($o['PostalCode'])) $this->PostalCode = $o['PostalCode'];
        if (isset($o['MobileNumber'])) $this->MobileNumber = $o['MobileNumber'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['IdNumber'])) $this->IdNumber = $o['IdNumber'];
        if (isset($o['PassportNumber'])) $this->PassportNumber = $o['PassportNumber'];
        if (isset($o['InvoiceNumber'])) $this->InvoiceNumber = $o['InvoiceNumber'];
        if (isset($o['DebtDate'])) $this->DebtDate = JsonConverters::from('DateTime', $o['DebtDate']);
        if (isset($o['AmountOutstanding'])) $this->AmountOutstanding = $o['AmountOutstanding'];
        if (isset($o['CurrenciesId'])) $this->CurrenciesId = $o['CurrenciesId'];
        if (isset($o['ChannelsId'])) $this->ChannelsId = $o['ChannelsId'];
        if (isset($o['DebtMeta'])) $this->DebtMeta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['DebtMeta']);
        if (isset($o['CustomersMeta'])) $this->CustomersMeta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['CustomersMeta']);
        if (isset($o['UrlToDocument'])) $this->UrlToDocument = $o['UrlToDocument'];
        if (isset($o['CustomerUniqueIdentifier'])) $this->CustomerUniqueIdentifier = $o['CustomerUniqueIdentifier'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Segment)) $o['Segment'] = $this->Segment;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->LastName)) $o['LastName'] = $this->LastName;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->Region)) $o['Region'] = $this->Region;
        if (isset($this->Suburb)) $o['Suburb'] = $this->Suburb;
        if (isset($this->PostalCode)) $o['PostalCode'] = $this->PostalCode;
        if (isset($this->MobileNumber)) $o['MobileNumber'] = $this->MobileNumber;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->IdNumber)) $o['IdNumber'] = $this->IdNumber;
        if (isset($this->PassportNumber)) $o['PassportNumber'] = $this->PassportNumber;
        if (isset($this->InvoiceNumber)) $o['InvoiceNumber'] = $this->InvoiceNumber;
        if (isset($this->DebtDate)) $o['DebtDate'] = JsonConverters::to('DateTime', $this->DebtDate);
        if (isset($this->AmountOutstanding)) $o['AmountOutstanding'] = $this->AmountOutstanding;
        if (isset($this->CurrenciesId)) $o['CurrenciesId'] = $this->CurrenciesId;
        if (isset($this->ChannelsId)) $o['ChannelsId'] = $this->ChannelsId;
        if (isset($this->DebtMeta)) $o['DebtMeta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->DebtMeta);
        if (isset($this->CustomersMeta)) $o['CustomersMeta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->CustomersMeta);
        if (isset($this->UrlToDocument)) $o['UrlToDocument'] = $this->UrlToDocument;
        if (isset($this->CustomerUniqueIdentifier)) $o['CustomerUniqueIdentifier'] = $this->CustomerUniqueIdentifier;
        return empty($o) ? new class(){} : $o;
    }
}

PHP OnceOffPaymentRequests DTOs

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

HTTP + CSV

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

POST /onceoffpayment HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Segment":"String","FirstName":"String","LastName":"String","Address":"String","City":"String","Region":"String","Suburb":"String","PostalCode":"String","MobileNumber":"String","Email":"String","IdNumber":"String","PassportNumber":"String","InvoiceNumber":"String","DebtDate":"0001-01-01T00:00:00.0000000","AmountOutstanding":0,"CurrenciesId":0,"ChannelsId":0,"DebtMeta":{"String":"String"},"CustomersMeta":{"String":"String"},"UrlToDocument":"String","CustomerUniqueIdentifier":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"PublicAccessGuid":"00000000000000000000000000000000","InvoiceNumber":"String","StatusCodesId":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}