SEP24InteractiveResponse
extends Response
in package
Response for initiating a SEP-24 interactive deposit or withdrawal flow
This class represents the response received when initiating an interactive deposit or withdrawal transaction. It contains the URL where the user should be directed to complete the transaction through the anchor's web interface.
After submitting a deposit or withdrawal request, the anchor returns this response with a unique transaction ID and an interactive URL. The wallet displays this URL to the user (typically in a popup or webview) where they provide additional information and complete the transaction flow with the anchor.
The transaction ID can be used to query the transaction status via the /transaction or /transactions endpoints while the user completes the interactive flow.
Tags
Table of Contents
Properties
- $id : string
- $type : string
- $url : string
- $httpClient : Client|null
- $rateLimitLimit : int|null
- $rateLimitRemaining : int|null
- $rateLimitReset : int|null
Methods
- fromJson() : SEP24InteractiveResponse
- Constructs a new instance of SEP24InteractiveResponse by using the given data.
- getHttpClient() : Client|null
- Gets the HTTP client used for pagination requests
- getId() : string
- getRateLimitLimit() : int|null
- Returns X-RateLimit-Limit header from the response.
- getRateLimitRemaining() : int|null
- Returns X-RateLimit-Remaining header from the response.
- getRateLimitReset() : int|null
- Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.
- getType() : string
- getUrl() : string
- setHeaders() : void
- Extracts and sets rate limiting information from HTTP response headers
- setHttpClient() : void
- Sets the HTTP client for making follow-up requests
- setId() : void
- setType() : void
- setUrl() : void
- loadFromJson() : void
- Loads the needed data from a json array.
Properties
$id
public
string
$id
The anchor's internal ID for this deposit / withdrawal request. The wallet should use this ID to query the /transaction endpoint to check status of the request.
$type
public
string
$type
Always set to 'interactive_customer_info_needed'.
$url
public
string
$url
URL hosted by the anchor. The wallet should show this URL to the user as a popup.
$httpClient
protected
Client|null
$httpClient
= null
$rateLimitLimit
protected
int|null
$rateLimitLimit
= null
$rateLimitRemaining
protected
int|null
$rateLimitRemaining
= null
$rateLimitReset
protected
int|null
$rateLimitReset
= null
Methods
fromJson()
Constructs a new instance of SEP24InteractiveResponse by using the given data.
public
static fromJson(array<string|int, mixed> $json) : SEP24InteractiveResponse
Parameters
- $json : array<string|int, mixed>
-
the data to construct the object from.
Return values
SEP24InteractiveResponse —the object containing the parsed data.
getHttpClient()
Gets the HTTP client used for pagination requests
public
getHttpClient() : Client|null
Return values
Client|null —The HTTP client instance, or null if not set
getId()
public
getId() : string
Return values
string —The anchor's internal ID for this deposit / withdrawal request. The wallet should use this ID to query the /transaction endpoint to check status of the request.
getRateLimitLimit()
Returns X-RateLimit-Limit header from the response.
public
getRateLimitLimit() : int|null
This number represents the he maximum number of requests that the current client can make in one hour.
Tags
Return values
int|nullgetRateLimitRemaining()
Returns X-RateLimit-Remaining header from the response.
public
getRateLimitRemaining() : int|null
The number of remaining requests for the current window.
Tags
Return values
int|nullgetRateLimitReset()
Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.
public
getRateLimitReset() : int|null
Tags
Return values
int|nullgetType()
public
getType() : string
Return values
string —Always set to 'interactive_customer_info_needed'.
getUrl()
public
getUrl() : string
Return values
string —URL hosted by the anchor. The wallet should show this URL to the user as a popup.
setHeaders()
Extracts and sets rate limiting information from HTTP response headers
public
setHeaders(array<string|int, mixed> $headers) : void
This method processes the X-Ratelimit-* headers from the HTTP response and stores them for client access.
Parameters
- $headers : array<string|int, mixed>
-
Associative array of HTTP headers from the response
setHttpClient()
Sets the HTTP client for making follow-up requests
public
setHttpClient([Client|null $httpClient = null ]) : void
Paginated responses contain links to next/previous pages. This HTTP client is used when following those links to fetch additional pages.
Parameters
- $httpClient : Client|null = null
-
The Guzzle HTTP client to use for pagination
setId()
public
setId(string $id) : void
Parameters
- $id : string
-
The anchor's internal ID for this deposit / withdrawal request. The wallet should use this ID to query the /transaction endpoint to check status of the request.
setType()
public
setType(string $type) : void
Parameters
- $type : string
-
Always set to 'interactive_customer_info_needed'.
setUrl()
public
setUrl(string $url) : void
Parameters
- $url : string
-
URL hosted by the anchor. The wallet should show this URL to the user as a popup.
loadFromJson()
Loads the needed data from a json array.
protected
loadFromJson(array<string|int, mixed> $json) : void
Parameters
- $json : array<string|int, mixed>
-
the data array to read from.