PaymentOperationBuilder
in package
Builder for creating Payment operations.
This builder implements the builder pattern to construct PaymentOperation instances with a fluent interface. Payment operations send a specified amount of an asset from the source account to a destination account.
Tags
Table of Contents
Methods
- __construct() : mixed
- Creates a new Payment operation builder.
- build() : PaymentOperation
- Builds the Payment operation.
- forMuxedDestinationAccount() : PaymentOperationBuilder
- Creates a new Payment operation builder for a muxed destination account.
- setMuxedSourceAccount() : $this
- Sets the muxed source account for this operation.
- setSourceAccount() : $this
- Sets the source account for this operation.
Methods
__construct()
Creates a new Payment operation builder.
public
__construct(string $destinationAccountId, Asset $asset, string $amount) : mixed
Parameters
- $destinationAccountId : string
-
The destination account ID
- $asset : Asset
-
The asset to be sent
- $amount : string
-
The amount of asset to send
build()
Builds the Payment operation.
public
build() : PaymentOperation
Return values
PaymentOperation —The constructed operation
forMuxedDestinationAccount()
Creates a new Payment operation builder for a muxed destination account.
public
static forMuxedDestinationAccount(MuxedAccount $destination, Asset $asset, string $amount) : PaymentOperationBuilder
Parameters
- $destination : MuxedAccount
-
The muxed destination account
- $asset : Asset
-
The asset to send
- $amount : string
-
The amount to send
Return values
PaymentOperationBuilder —The new builder instance
setMuxedSourceAccount()
Sets the muxed source account for this operation.
public
setMuxedSourceAccount(MuxedAccount $sourceAccount) : $this
Parameters
- $sourceAccount : MuxedAccount
-
The muxed account to use as source
Return values
$this —Returns the builder instance for method chaining
setSourceAccount()
Sets the source account for this operation.
public
setSourceAccount(string $accountId) : $this
Parameters
- $accountId : string
-
The Stellar account ID (G...)
Return values
$this —Returns the builder instance for method chaining