ConsumerApi

<back to all web services

VippsLoginCallbackRequest

Consumer
The following routes are available for this service:
GET/vipps/login/callback
<?php namespace ConsumerApi;

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 VippsAddressType : string
{
    case Home = 'Home';
    case Work = 'Work';
    case Other = 'Other';
}

class VippsAddress implements JsonSerializable
{
    public function __construct(
        /** @var VippsAddressType|null */
        public ?VippsAddressType $addressType=null,
        /** @var string */
        public string $country='',
        /** @var string */
        public string $formatted='',
        /** @var string */
        public string $postalCode='',
        /** @var string */
        public string $region='',
        /** @var string */
        public string $streetAddress=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['addressType'])) $this->addressType = JsonConverters::from('VippsAddressType', $o['addressType']);
        if (isset($o['country'])) $this->country = $o['country'];
        if (isset($o['formatted'])) $this->formatted = $o['formatted'];
        if (isset($o['postalCode'])) $this->postalCode = $o['postalCode'];
        if (isset($o['region'])) $this->region = $o['region'];
        if (isset($o['streetAddress'])) $this->streetAddress = $o['streetAddress'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->addressType)) $o['addressType'] = JsonConverters::to('VippsAddressType', $this->addressType);
        if (isset($this->country)) $o['country'] = $this->country;
        if (isset($this->formatted)) $o['formatted'] = $this->formatted;
        if (isset($this->postalCode)) $o['postalCode'] = $this->postalCode;
        if (isset($this->region)) $o['region'] = $this->region;
        if (isset($this->streetAddress)) $o['streetAddress'] = $this->streetAddress;
        return empty($o) ? new class(){} : $o;
    }
}

class VippsUserInfo implements JsonSerializable
{
    public function __construct(
        /** @var VippsAddress|null */
        public ?VippsAddress $address=null,
        /** @var DateTime */
        public DateTime $birthdate=new DateTime(),
        /** @var string|null */
        public ?string $email=null,
        /** @var bool|null */
        public ?bool $emailVerified=null,
        /** @var string */
        public string $familyName='',
        /** @var string */
        public string $givenName='',
        /** @var string */
        public string $name='',
        /** @var string */
        public string $phoneNumber='',
        /** @var string */
        public string $sessionIdentifier='',
        /** @var string */
        public string $subjectIdentifier=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['address'])) $this->address = JsonConverters::from('VippsAddress', $o['address']);
        if (isset($o['birthdate'])) $this->birthdate = JsonConverters::from('DateTime', $o['birthdate']);
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['emailVerified'])) $this->emailVerified = $o['emailVerified'];
        if (isset($o['familyName'])) $this->familyName = $o['familyName'];
        if (isset($o['givenName'])) $this->givenName = $o['givenName'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['phoneNumber'])) $this->phoneNumber = $o['phoneNumber'];
        if (isset($o['sessionIdentifier'])) $this->sessionIdentifier = $o['sessionIdentifier'];
        if (isset($o['subjectIdentifier'])) $this->subjectIdentifier = $o['subjectIdentifier'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->address)) $o['address'] = JsonConverters::to('VippsAddress', $this->address);
        if (isset($this->birthdate)) $o['birthdate'] = JsonConverters::to('DateTime', $this->birthdate);
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->emailVerified)) $o['emailVerified'] = $this->emailVerified;
        if (isset($this->familyName)) $o['familyName'] = $this->familyName;
        if (isset($this->givenName)) $o['givenName'] = $this->givenName;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->phoneNumber)) $o['phoneNumber'] = $this->phoneNumber;
        if (isset($this->sessionIdentifier)) $o['sessionIdentifier'] = $this->sessionIdentifier;
        if (isset($this->subjectIdentifier)) $o['subjectIdentifier'] = $this->subjectIdentifier;
        return empty($o) ? new class(){} : $o;
    }
}

PHP VippsLoginCallbackRequest DTOs

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

HTTP + XML

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

GET /vipps/login/callback HTTP/1.1 
Host: unstable-consumer-api.brovs.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<VippsLoginCallbackResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ConsumerApi.Dto">
  <NextRelativeUrl>String</NextRelativeUrl>
  <VippsUserInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/Entities.Common">
    <d2p1:Address>
      <d2p1:AddressType>Home</d2p1:AddressType>
      <d2p1:Country>String</d2p1:Country>
      <d2p1:Formatted>String</d2p1:Formatted>
      <d2p1:PostalCode>String</d2p1:PostalCode>
      <d2p1:Region>String</d2p1:Region>
      <d2p1:StreetAddress>String</d2p1:StreetAddress>
    </d2p1:Address>
    <d2p1:Birthdate xmlns:d3p1="http://schemas.datacontract.org/2004/07/System">
      <d3p1:DateTime>0001-01-01T00:00:00Z</d3p1:DateTime>
      <d3p1:OffsetMinutes>0</d3p1:OffsetMinutes>
    </d2p1:Birthdate>
    <d2p1:Email>String</d2p1:Email>
    <d2p1:EmailVerified>false</d2p1:EmailVerified>
    <d2p1:FamilyName>String</d2p1:FamilyName>
    <d2p1:GivenName>String</d2p1:GivenName>
    <d2p1:Name>String</d2p1:Name>
    <d2p1:PhoneNumber>String</d2p1:PhoneNumber>
    <d2p1:SessionIdentifier>String</d2p1:SessionIdentifier>
    <d2p1:SubjectIdentifier>String</d2p1:SubjectIdentifier>
  </VippsUserInfo>
</VippsLoginCallbackResponse>