Modify a Stellar Info File
Let’s start by modifying ourstellar.toml file created earlier. Wallets need to know that SEP-31 functionality is supported by your business, and they also need to know all currencies you support.
Enable Cross Border Payments
Now you’re ready to enable cross-border payments the SEP-31 API. Specify the following in yourdev.assets.yaml file.
sep31 and send objects closely map to the information that will be exposed to the wallet application using the GET /info SEP-31 endpoint. The Anchor Platform also uses this information to validate requests made to your service. sep31.fields.transaction should be left empty and will be removed in a future release, but you can adjust the send.min_amount and send.max_amount values according to your service’s limits.
The sep31.quotes_supported and sep31.quotes_required determine whether or not sending organizations can and are required to request an FX rate using the SEP-38 POST /quote endpoint. Almost all senders prefer this approach so that they can communicate the rate to their customers prior to proceeding.
Add the following variable to your environment file.
Enable the Customer KYC API
Businesses need to collect and validate KYC information on the customers they’re facilitating transactions for. Clients determine what KYC information needs to be collected and send that information via a SEP-12 KYC API hosted by the Anchor Platform, but the Anchor Platform never stores personally-identifiable information (PII). Instead, it forwards requests from clients to the business server, and returns the business’ responses back to the client, acting as a proxy server. See the Anchor Platform KYC API specification for details on the endpoints that must be implemented on your business’ server. To make this API available to clients, lets add the service URL to our Stellar Info File.Currently, customer types must be mutually exclusive, meaning a customer cannot be more than one type.This limitation is in place because the Anchor Platform cannot validate whether a customer is approved for a specific type of transaction, such as one sending a large amount. It can only validate that a customer is approved for one of the customer types defined. This limitation will be removed in a future release.
docker compose up, run the following command:
Enable the RFQ API
Businesses need to provide their send-side counterparts with a Rate API to check the exchange rates they’re offering between the on-chain asset being used for settlement and the fiat asset being used to pay the recipient. If the rate is competitive, senders also need to be able to request a commitment to the rate currently being offered from business for a short period of time. The Anchor Platform provides the SEP-38 RFQ API to senders for this purpose. To make this API available to clients, lets add the service URL to our Stellar Info File.docker compose up:
Configure Callback API Authentication
Just as your business will need to make requests to the Anchor Platform, the Anchor Platform will need to make requests to your business. Let’s add authentication to these requests as well.CALLBACK_API_BASE_URL uses server instead of localhost as the host because the Anchor Platform will be making requests to your business server from within the local network created by docker compose. When configuring your service in a staging or production environment, make sure to update your service urls.
We’ll define the server that implements the endpoints defined in the Callback API in the following section.