SDK Scheme Adapter and WSO2 API Gateway
Last updated
Last updated
This documentaion is for testing scheme adapter against a public hosted WSO2 API gateway with SSL encryption and bearer token authentication.
Accesss to WSO2 API production api with a generated token.
sdk-scheme-adapter
mojaloop-simulator
Login to your WSO2 store and go to applications in the menu. Create a new application and access keys if you don't have those already.
Then go to APIs menu, you should find the following applications. Subscribe to these two APIs by selecting your application and tier from the each API main page.
Central Ledger Admin API - We will use this endpoint for creating a new fsp and configure endpoints for that fsp. (Please contact your infra team for the proper https endpoints, they need to provision them on the hub)
FSPIOP API - This is the main API for account lookup, quotes & transfers
You can try some api requests in "API Console" tab by selecting the generated access token.
Please make a note of the API URLs for both APIs and access token.
The following are the things your infrastructure team should take care off. Please contact your infra team for further details.
For getting back the responses, we need a machine with static public IP. And a domain name should be pointed to that IP.
Generate client and server SSL certificates using MCM portal and keychain tool. This step is to establish secure communication using mutual SSL.
Provision the endpoints pointing to your https address in WSO2 / HA Proxy.
Establish JWS authentication
AWS Deployment
Launch an EC2 instance in AWS console
Create an EC2 instance in AWS console and select t2.micro instance type.
Select Ubuntu 18.04 as your operating system.
After your instance is ready, you can connect to it using ssh and the downloaded key file from AWS EC2 dashboard.
Install docker and docker-compose in that EC2 instance
Open 4000 TCP port in security groups and assign elastic IP
Add the inbound rule in security group of this EC2 instance that will expose the TCP 4000 port to public
Use Elastic IP service to assign a static IP for this instance
Setup domain name for this instance
You can use route53 in aws or any other DNS service to point a DNS name to this IP address
This step is required because the Let's Encrypt certificate authority will not issue certificates for a bare IP address.
Please download the Mojaloop Simulator repo
Replace the certificates and keys in src/secrets folder with the generated certificates in the previous step.
Edit the file src/docker-compose.yml and change the required parameters. Please refer the following file.
Edit the file src/sim-backend.env file and change the container name of the scheme adapter in that. Please refer the following lines.
Edit the file src/scheme-adapter.env and change the following settings
Then try running the following command to run the services
We can now access the mojaloop simulator's test api on 3003.
We should create a new fsp named "extpayerfp" or with any other name.
The FSP onboarding section in "OSS-New-Deployment-FSP-Setup" postman collection can be used for this. You can get the postman repo from https://github.com/mojaloop/postman.
Duplicate the "Mojaloop-Local" environment and change the following valuesin that
payerfsp - extpayerfsp
HOST_ML_API_ADAPTER, HOST_ML_API, HOST_SWITCH_TRANSFERS, HOST_ACCOUNT_LOOKUP_SERVICE, HOST_QUOTING_SERVICE - Your WSO2 FSPIOP API endpoint
HOST_CENTRAL_LEDGER - Your WSO2 Central Services Admin API endpoint
HOST_CENTRAL_SETTLEMENT - Your WSO2 Central Settlement API endpoint (optional for our testing)
HOST_SIMULATOR & HOST_SIMULATOR_K8S_CLUSTER - https://<your_domain_name>:4000
Change the URLs in payerfsp onboarding in "FSP Onboarding" section of "OSS-New-Deployment-FSP-Setup" from "payerfsp" to "extpayerfsp"
Change the authentication as "Bearer Token" and provide the access token we created in WSO2 store for the entire "Payer FSP Onboarding" folder.
Change the endpoint URLs to the https endpoints provided by your infra team.
Then run the "Payer FSP Onboarding" folder in that collection with the newly created environment.
You should get 100% pass then we can confirm that the fsp is created and endpoints are set for the fsp.
Generally the simulator running in the switch contains payeefsp and you should register a new participant (phone number) of your choice.
You can refer the postman request "p2p_happy_path SEND QUOTE / Register Participant {{pathfinderMSISDN}} against MSISDN Simulator for PayeeFSP" in "Golden_Path" collection to achieve this.
The postman request will send a POST request to <HOST_ACCOUNT_LOOKUP_SERVICE>/participants/MSISDN/<new_phone_number> with the following body and required http headers.
If you want to send the money in one step, the configuration options "AUTO_ACCEPT_QUOTES" & "AUTO_ACCEPT_PARTY" in "scheme_adapter.env" should be enabled.
The following command is used to send the money in two steps (i.e Requesting the quote first, accept after review the charges and party details)