Send Hbar
Prerequisites:
Getting startedStep 1: Get Xact Fees
/* Set your Amount in Hbar */
$hbarAmount = 10;
/* Get the service fees */
$fees = $client->getXactFeesPayment($hbarAmount);Step 2: Initialize a Payment
1.1 From an account to an account
/* Hbar to transfer */
$hbarAmount = 10;
/* AccountId that send the Hbar */
$fromAccountId = '';
/* AccountId that received the Hbar */
$toAccountId = '';
/* Add a memo */
$memo = '';
/* Custom uniq ID */
$uniqId = '';
/* Define a Webhook */
$webhook = '';
/* Request for payment */
$client->pay([
$hbarAmount,
$fromAccountId,
$toAccountId,
$memo,
$uniqId
],$webhook);1.2 From an account to an account and to a middleman
Last updated