This is an example of creating a request using the ether payment network The request will be stored in memory and cleared as soon as the script is finished running.
Before creating a request, the Request Client must be initialized.
First we import the 2 packages we will need to create the request:
To create a request we need to declare the identities of the parties involved. Identities are the unique identifier of a request user. They are generally different from payment addresses but can be the same. They identify an entity like a person or business.
The Ethereum private key signature provider allows a user to pass in their private Ethereum key to sign a request. The signer is either the payee or the payer. The signature is proof of who created the request and of its integrity (that no data changed after it was signed). This process is similar to the signature of an Ethereum transaction.
In the next section of code we declare the request information.
To create a request using ether payment network, we need to provide the payment network parameters to the request creation parameters. For the ether payment network, it's simply the payment address (and eventually the refund address).
The function getData() of a request provides its balance