Creating your first payment
Date | Responsible | Changes |
---|---|---|
August 29, 2024 | @Željko Rumenjak | Initial version |
Introduction
In this tutorial you are going to install a Minka command line tool (CLI) and see how we can interact with a real time system from a more technical perspective. We are going to use this tool to create our first payment intent.
In order to follow this tutorial you have to have nodeJS v20 or newer installed on your machine. This tutorial uses a Minka Ledger, so our first task is to connect to it using the Minka CLI tool.
If you haven’t set up your Studio, please follow the Joining an RTP system tutorial first and return here after doing that.
Installing the CLI
Install the Minka CLI by running the following command in your terminal:
After installing the CLI tool, you will be able to interact with local or remote ledger instances by using the minka
command. Check out all the commands available by typing minka --help
.
Connecting to ledger
After we have installed a CLI, we can connect to a ledger by typing:
Ledger URL, required as an input, has the format https://<ledger>.<server>
. You can get your ledger URL from Studio URL by removing the /studio/...
part. For example, if the URL is https://ach.example.com/studio
, the ledger URL you need to use is https://ach.example.com
.
We can test that everything is working correctly by logging in as a test bank. Our RTP ledger comes with a test bank preconfigured, the name of this bank is Tesla Bank (teslabank
). To login as this bank, use the following command:
The password for teslabank is tesla
.
Creating an intent
With everything setup and connected, we can create our first payment intent. For this we will use Tesla Bank to send make a payment to a user from our own bank.
Don’t forget to replace mintbank from the tutorial examples with your own bank.
We can create an intent like this:
We need to sign this intent using teslabank
signer which is a remote signer available on the ledger since the source user is a user of that bank.
For user information and account numbers we can use any values which have a correct format. Tesla Bank is a demo bank which doesn’t validate this data and we haven’t connected any custom integration for our bank, so all payment intents are accepted by default.
If we open our Studio dashboard now, we should see our intent under transfers:
Debugging ledger requests
CLI has a --verbose
argument which can be used with all commands. This argument prints detailed information about a request which was sent to ledger.
All CLI commands are communicating with ledger using standard REST APIs, using verbose parameter will allow us to examine those requests in more detail. This is useful for debugging and also to learn more about how ledger APIs work.
For example, let’s print detailed information about the intent we just made:
In the output we can see all the information about the request and the response. We can see the full URL, HTTP method, headers and the entire body of the request.
This works for all CLI commands, so you can use it to learn more about ledger APIs.
What’s next?
In the next tutorial we will explore how to connect a core banking system to a real time payments network. We will learn more about the two phase commit protocol which is used to synchronize operations between participants of an RTP system efficiently and reliably.