Stellar PHP SDK API Documentation

SEP31Refunds

Refund information for a cross-border payment transaction via SEP-31.

This class aggregates all refund payments made back to the Sending Anchor, including the total refunded amount, associated fees, and individual payment details. It is used when a transaction is partially or fully refunded.

Amount Relationships:

  • amountRefunded = sum of all payments[].amount
  • amountFee = sum of all payments[].fee
  • For full refund: amountRefunded should equal transaction.amountIn
  • Net refund to sender: amountRefunded - amountFee
Tags
see
https://github.com/stellar/stellar-protocol/blob/v3.1.0/ecosystem/sep-0031.md#refunds-object-schema
see
SEP31TransactionResponse
see
SEP31RefundPayment

Table of Contents

Properties

$amountFee  : string
$amountRefunded  : string
$payments  : array<string|int, mixed>

Methods

__construct()  : mixed
fromJson()  : SEP31Refunds
Constructs a new instance of SEP31Refunds by using the given data.

Properties

Methods

__construct()

public __construct(string $amountRefunded, string $amountFee, array<string|int, SEP31RefundPayment$payments) : mixed
Parameters
$amountRefunded : string

The total amount refunded to the Sending Anchor, in units of amount_in_asset. If a full refund was issued, this should match amount_in.

$amountFee : string

The total amount charged in fees for processing all refund payments. Should equal sum of all fee values in the payments list.

$payments : array<string|int, SEP31RefundPayment>

List of individual refund payments made back to the Sending Anchor.

fromJson()

Constructs a new instance of SEP31Refunds by using the given data.

public static fromJson(array<string|int, mixed> $json) : SEP31Refunds
Parameters
$json : array<string|int, mixed>

the data to construct the object from.

Return values
SEP31Refunds

the object containing the parsed data.


        
On this page

Search results