{"id":44472231,"url":"https://github.com/datatrans/openapi-java-sdk-generator","last_synced_at":"2026-02-12T21:33:38.174Z","repository":{"id":84353051,"uuid":"355207952","full_name":"datatrans/openapi-java-sdk-generator","owner":"datatrans","description":"An example how to generate the Datatrans Java SDK from the openapi specification","archived":false,"fork":false,"pushed_at":"2024-07-31T06:50:15.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-07-31T08:11:07.429Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datatrans.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":"2021-04-06T13:56:19.000Z","updated_at":"2024-07-31T06:50:19.000Z","dependencies_parsed_at":"2023-03-04T10:00:18.194Z","dependency_job_id":null,"html_url":"https://github.com/datatrans/openapi-java-sdk-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datatrans/openapi-java-sdk-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datatrans%2Fopenapi-java-sdk-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datatrans%2Fopenapi-java-sdk-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datatrans%2Fopenapi-java-sdk-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datatrans%2Fopenapi-java-sdk-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datatrans","download_url":"https://codeload.github.com/datatrans/openapi-java-sdk-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datatrans%2Fopenapi-java-sdk-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29381789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T20:34:40.886Z","status":"ssl_error","status_checked_at":"2026-02-12T20:23:00.490Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-02-12T21:33:37.486Z","updated_at":"2026-02-12T21:33:38.169Z","avatar_url":"https://github.com/datatrans.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"An example how to generate \u0026 use the Datatrans Java SDK from the [openapi](https://api-reference.datatrans.ch/) specification.\n\n### Generating the Java SDK\n\n```sh\n# Generate the source files\n$ mvn clean compile\n```\n\n### Deploy to your own artifacts sever\n\nCurrently, the Datatrans Java SDK is not yet available on Maven Central (or something similar). \nThat's why you manually need to deploy it to your own artifacts hosting solution.\n\n```\n# You might have to adjust your ~/.m2/settings.xml or add a \u003cdistributionManagement\u003e section to the pom.xml\n$ mvn deploy\n```\n\n## Using the Java SDK\n\nOnce deployed, add the following dependency:\n\n### Maven users\n\nAdd this dependency to your project's POM:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ech.datatrans\u003c/groupId\u003e\n  \u003cartifactId\u003edatatrans-java-sdk\u003c/artifactId\u003e\n  \u003cversion\u003e2.0.15\u003c/version\u003e\n  \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle users\n\nAdd this dependency to your project's build file:\n\n```groovy\ncompile \"ch.datatrans:datatrans-java-sdk:2.0.15\"\n```\n\n### Invoking the SDK\n\n```java\nApiClient defaultClient = Configuration.getDefaultApiClient();\ndefaultClient.setBasePath(\"https://api.sandbox.datatrans.com\");\n\n// Configure HTTP basic authorization: Basic\nHttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication(\"Basic\");\nBasic.setUsername(\"1100017675\"); // your Datatrans merchantId\nBasic.setPassword(\"password\"); // your Datatrans server to server password\n\nV1TransactionsApi transactionsApiInstance = new V1TransactionsApi(defaultClient);\n\nRedirectRequest redirectRequest = new RedirectRequest();\nredirectRequest.successUrl(\"https://pay.sandbox.datatrans.com/upp/merchant/successPage.jsp\")\n        .cancelUrl(\"https://pay.sandbox.datatrans.com/upp/merchant/cancelPage.jsp\")\n        .errorUrl(\"https://pay.sandbox.datatrans.com/upp/merchant/errorPage.jsp\");\n\nInitRequest initRequest = new InitRequest();\ninitRequest.currency(\"CHF\")\n        .paymentMethods(List.of(InitRequest.PaymentMethodsEnum.VIS))\n        .redirect(redirectRequest)\n        .amount(100L)\n        .refno(String.valueOf(System.currentTimeMillis()));\n\ntry {\n    InitResponse result = transactionsApiInstance.init(initRequest);\n    System.out.println(result);\n} catch (ApiException e) {\n    System.err.println(\"Exception when calling V1TransactionsApi#init\");\n    System.err.println(\"Status code: \" + e.getCode());\n    System.err.println(\"Reason: \" + e.getResponseBody());\n    System.err.println(\"Response headers: \" + e.getResponseHeaders());\n    e.printStackTrace();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatatrans%2Fopenapi-java-sdk-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatatrans%2Fopenapi-java-sdk-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatatrans%2Fopenapi-java-sdk-generator/lists"}