{"id":20756212,"url":"https://github.com/wallester/integration-examples","last_synced_at":"2025-07-24T16:20:45.758Z","repository":{"id":38111644,"uuid":"109136474","full_name":"wallester/integration-examples","owner":"wallester","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-03T07:53:03.000Z","size":204,"stargazers_count":7,"open_issues_count":2,"forks_count":9,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-20T01:07:47.720Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wallester.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-01T13:43:19.000Z","updated_at":"2025-05-22T20:51:45.000Z","dependencies_parsed_at":"2025-03-11T15:56:53.044Z","dependency_job_id":null,"html_url":"https://github.com/wallester/integration-examples","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wallester/integration-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallester%2Fintegration-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallester%2Fintegration-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallester%2Fintegration-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallester%2Fintegration-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wallester","download_url":"https://codeload.github.com/wallester/integration-examples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallester%2Fintegration-examples/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266870514,"owners_count":23998250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T09:29:38.742Z","updated_at":"2025-07-24T16:20:45.708Z","avatar_url":"https://github.com/wallester.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to integrate with Wallester API\n\nTo be able to run given code samples with our payment system you’ll need to have specific settings typically available to our customers. If you are planning to consider us to be your service provider and would like to try Wallester API, please contact us (https://wallester.com/contact-sales).\n\n## Understand how JWT is generally used\n\nPlease take a look at https://jwt.io/introduction/ \n\nFor debugging JWT requests you can use https://jwt.io/#debugger\n\nTo choose a library for JWT please see https://jwt.io\n\nNotice that the JWT tokens are case sensitive.\n\n\n## Create keys for signing and verifying JWT requests\n\n\topenssl genrsa -out example_private 2048\n\topenssl rsa -in example_private -pubout \u003e example_public\n\n\n## Exchange keys with Wallester\n\nSend your public key (example_public) to Wallester and you will receive\n- Wallester public key\n- Wallester certificate containing the public key\n- Wallester audience ID string\n- your issuer ID string\n- maximum token expiration time\n\nUse the received information in the following steps.\n\n\n## Using JWT to communicate with Wallester API\n\nFor each HTTP request, using the JWT library of your choice,\ncreate a JWT token, and set the following fields:\n\n- iss: your issuer ID string\n- aud: Wallester audience ID string\n- exp: set it into the future, for example current UTC time + maximum expiration time allowed by Wallester\n- sub: set it to \"api-request\"\n- rbh: request body hash (see below how to calculate it)\n\nSign the JWT token with your private key using RS256 algorithm.\n\nSet the JWT token in the request \"Authorization\" header as\n\n\t\"Authorization\": \"Bearer \u003cJWT token\u003e\"\n\nEach response will contain a JWT token in the \"Authorization\" header as\n\n\t\"Authorization\": \"Bearer \u003cJWT token\u003e\"\n\nFor each response, verify the JWT token with the JWT library of your choice.\n\nPlease note, that you should also check that the \"rbh\" claim in the response\ntoken is a valid hash of the response body (see below how to calculate it).\n\n\n## How to calculate request/response body hash\n\n\trbh = base64encode(sha256hash(body))\n\nIt is important to mention that SHA256 hash of request body should be a binary representation and not the hex output.\n\nBelow is an example of a request body for the following message, used for GET /v1/test/ping request.\n\n    {\"message\":\"ping\"}\n \nCorrect request body hash for the following message will be\n\n    CupX09Xw/WUiC8YWsyJl9RUgAtbY9NmVc05BwQGXkzc=\n\nShould you use non binary hash representation, you will likely to get something like this. \n\n    MGFlYTU3ZDNkNWYwZmQ2NTIyMGJjNjE2YjMyMjY1ZjUxNTIwMDJkNmQ4ZjRkOTk1NzM0ZTQxYzEwMTk3OTMzNw==\n\n## Example Java source code\n\nPlease take a look at App.java\n\nIn this Java example we use the https://github.com/jwtk/jjwt library.\n\nThe example code uses Gradle build tool https://gradle.org/install/\n\n### Build the example code\n\n\tmake\n\n### Run the example code\n\n\tmake run\n\n### To use openssl generated keys in Java, convert the keys to PKCS8 format:\n\n\topenssl pkcs8 -topk8 -inform PEM -outform DER -in example_private -nocrypt \u003e example_private.pkcs8\n\topenssl rsa -in example_private -pubout -outform DER -out example_public.pkcs8\n\n\n## Example .NET source code\n\nPlease take a look at Program.cs\n\nThe example code was developed and tested with Visual Studio Community\n(https://www.visualstudio.com/vs/community/), on OSX and Windows.\n\nYou can either build and run the example from Visual Studio, or from\ncommand line (for example, on a Mac).\n\n### Set up the build dependencies from command line\n\n\tmake deps\n\n### Build the example code from command line\n\n\tmake\n\n### Run the example code from command line\n\n\tmake run\n\n### To use openssl generated key in .NET\n\n\topenssl req -new -x509 -nodes -sha256 -days 1100 -key example_private \u003e example_private.cer\n\topenssl pkcs12 -export -in example_private.cer -inkey example_private -out example_private.pkcs12\n\nYou will need to enter a password. For the .NET sample code included in this repository,\nuse the password \"123456\".\n\n## Example Node.js source code\n\nPlease take a look at example.js\n\n### Install dependencies\n\n\tmake install\n\n### Run code\n\n\tmake run\n\n## Example request and response\n\n### Request\n\n```\nPOST /v1/test/ping HTTP/1.1\nContent-Type: application/json\nAuthorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJFMkMwQUI1NS1EQzM5LTQxM0ItOTRDRi00QzZGQjJDRUU2RjAiLCJzdWIiOiJhcGktcmVxdWVzdCIsImlzcyI6IjdhNGYyMTIzLTM3ZmYtNDRiMy05MDI4LTM3NDdmNGU5M2IxYyIsInJiaCI6IkN1cFgwOVh3L1dVaUM4WVdzeUpsOVJVZ0F0Ylk5Tm1WYzA1QndRR1hremM9IiwiZXhwIjoxNTA4NTA3MjUxLCJpYXQiOjE1MDg1MDcxOTF9.Zn4y5Y09BZT4KrScGYw3K2zKLjEYgfxK20ZdvRYGFgaGj9V5ZZbnY1_nJ_u5xBh4ncoyaO6eaA0YqOjZ-hPsatw4IXVPLrILg8KU3XnyEY0rYrngNmoAq7idmJQMMmIGfbpR9EEULuEiLyjcENZxF3RyVmL_Ajy8qfoTFtewAbEOLLR1wnbuNFm534DbVnlvXI9_49sEx15Q9fUzn_AjEdjfYFCBBjM8krysswckxzRtZNJP70miCYProRv6EOTQCOPIBk-qDnkzaNPEZ1PIkCyIn-yakrG-26H55m0MdjOhr9DKvUGWk_Ew7OCsMdT2ZO1NdujWE7XBt3g5GF1Kkw\nUser-Agent: Java/1.8.0_121\nHost: localhost:8000\nAccept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2\nConnection: keep-alive\nContent-Length: 18\n\n{\"message\":\"ping\"}\n```\n\n### Response\n\n```\nHTTP/1.1 200 OK\nAuthorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiI3YTRmMjEyMy0zN2ZmLTQ0YjMtOTAyOC0zNzQ3ZjRlOTNiMWMiLCJleHAiOjE1MDg1MDcxOTYsImp0aSI6ImQ5MmRjYjBjLTY1Y2UtNGIwMS1iOGU3LWJkY2NlYjI5MDZmMiIsImlhdCI6MTUwODUwNzE5MSwiaXNzIjoiRTJDMEFCNTUtREMzOS00MTNCLTk0Q0YtNEM2RkIyQ0VFNkYwIiwibmJmIjoxNTA4NTA3MTkxLCJzdWIiOiJhcGktcmVxdWVzdCIsInJiaCI6IlUxNFBma1ZpTnl3aVluTjdWZEpRdUtEOFRUN1VJMy9Bc2pwenNHS3RaRnc9In0.vZyRq_1miiETTNDzIT5JJhd_Xs28wKUKlERYnOLkgWsHcLHkUdgSebRYOsbAIlhrhnOBgIzRmA6W1jBf0Dep48jOC8o7pqoRleEV_lCkrM9Xdxf-qj6LaGt8Ly_V4QUADXmQNtEoBEyReV5oiMyikUCOg2rog4c4nayquf_r8GPB68BVfB0xtaKgaBLoadX7jX4O2L0mLHdk0OA8dFmDDwScCkXdVE7MlySWGwWbjm480l15QP1bc_Kg4RiN1iqb7MI17jO5KyORZ1PR4l_0hlUem2heeXuBiwqXFNZGF1hBSLgYyS4rnZP03TjD8Jcz4EZ85nWbybVTVeoC5BSs2Q\nContent-Type: application/json\nX-Api-Request-Id: ec5f6d6e-bfaf-4a73-affb-407d88b0798a\nDate: Fri, 20 Oct 2017 13:46:31 GMT\nContent-Length: 18\n\n{\"message\":\"pong\"}\n```\n\n## Example PHP source code\n\nPlease take a look at App.php\n\nIn this PHP example we use the https://github.com/firebase/php-jwt library.\n\nThe example code uses Composer package manager https://getcomposer.org/\n\n### Install dependencies\n\n\tmake install\n\n### Run the example code\n\n\tmake run\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallester%2Fintegration-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwallester%2Fintegration-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallester%2Fintegration-examples/lists"}