{"id":43320370,"url":"https://github.com/xendit/xenissuing-web","last_synced_at":"2026-02-01T22:33:11.883Z","repository":{"id":60267549,"uuid":"540336191","full_name":"xendit/xenissuing-web","owner":"xendit","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-11T02:48:55.000Z","size":278,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-11T03:27:17.169Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xendit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2022-09-23T07:54:51.000Z","updated_at":"2025-04-11T02:30:41.000Z","dependencies_parsed_at":"2025-04-11T03:22:07.488Z","dependency_job_id":"eb38ff0a-64d5-44f8-b127-aa7744a68e91","html_url":"https://github.com/xendit/xenissuing-web","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/xendit/xenissuing-web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fxenissuing-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fxenissuing-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fxenissuing-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fxenissuing-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xendit","download_url":"https://codeload.github.com/xendit/xenissuing-web/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fxenissuing-web/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28993253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T22:01:47.507Z","status":"ssl_error","status_checked_at":"2026-02-01T21:58:37.335Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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-01T22:33:11.825Z","updated_at":"2026-02-01T22:33:11.875Z","avatar_url":"https://github.com/xendit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![NodeJs Support](https://img.shields.io/badge/nodejs-%3E=8.17.0-green)\n![NPM Support](https://img.shields.io/badge/npm-%3E=6.14.15-green)\n\n# Xenissuing\n\nThis SDK comprises the following module:\n\n- **Xenissuing**: Handles encryption between XenIssuing and your web application.\n\n## SecureSession\n\nSecureSession is a module to help you set up encryption between XenIssuing and your application.\n\n### Requirements\n\nTo use XenIssuing, you need a **public key** provided by Xendit.\n\nIt includes several methods:\n\n- `getKey`: Generates and encrypts a random session key using the provided public key. This session key is used for asymmetric encryption with XenIssuing.\n- `encrypt`: Used to encrypt sensitive data before sending it.\n- `decryptCardData`: Used to decrypt sensitive card data received from XenIssuing.\n\n---\n\n### 1. Create Secure Session\n\n```node\nimport XenIssuing from \"@xendit/xenissuing-web\"\n\nconst pubkey = \"-----BEGIN PUBLIC KEY-----${key}-----END PUBLIC KEY-----`\"\n\nconst secureSession = XenIssuing.createSecureSession(pubkey) // add sessionKey as parameter to test\nconst sessionId = secureSession.getKey() // to be used for API calls(eg. get card pan,cvv,etc)\n\nconst { secret, iv } = apiResponse.data\nconst decryptedData = secureSession.decryptCardData(iv, secret)\n```\n\n### 2. Get Card PAN\n\n```node\nimport axios from \"axios\"\n\nconst secureSession = XenIssuing.createSecureSession(pubkey)\nconst authHeader = \"auth\"\nconst sessionId = secureSession.getKey()\n\nconst config = {\n  method: \"get\",\n  url: `https://base-url/pan?session_id=${sessionId}`,\n  headers: {\n    Authorization: authHeader,\n  },\n}\n\nconst response = await axios.request(config)\n\nconst { iv, secret } = response.data\nconst pan = secureSession.decryptCardData(iv, secret)\n\nconsole.log(\"Decrypted PAN:\", pan)\n```\n\n### 3. Get Card CVV\n\n```node\nimport axios from \"axios\"\n\nconst secureSession = XenIssuing.createSecureSession(pubkey)\nconst authHeader = \"auth\"\nconst sessionId = secureSession.getKey()\n\nconst config = {\n  method: \"get\",\n  url: `https://base-url/cvv2?session_id=${sessionId}`,\n  headers: {\n    Authorization: authHeader,\n  },\n}\n\nconst response = await axios.request(config)\n\nconst { iv, secret } = response.data\nconst cvv = secureSession.decryptCardData(iv, secret)\n\nconsole.log(\"Decrypted CVV:\", cvv)\n```\n\n### 4. Set Card PIN\n\n```node\nimport axios from 'axios';\n\nconst secureSession = XenIssuing.createSecureSession(pubkey);\nconst authHeader = 'auth';\nconst sessionId = secureSession.getKey();\n\n\nconst pinToSet = '159753';\nconst iv = secureSession.generateIV()\nconst encPIN = secureSession.encrypt(pin, iv)\n\nconst ivBase64 = forge.util.encode64(iv) // you need to turn this into Base64 before use it the api call\n\nconsole.log({ iv: ivBase64, pin: encPIN })\n\n\nconst config = {\n  method: 'put',\n  url: `https://base-url/pin?session_id=${sessionId}`,\n  data: {\n    pin: encPIN,\n    iv: ivBase64\n  }\n  headers: {\n    Authorization: authHeader,\n  },\n};\n\nconst response = await axios.request(config);\n\nconsole.log('PIN set successfully:', response.data);\n```\n\n### 5. Get Card PIN\n\n```node\nimport axios from \"axios\"\n\nconst secureSession = XenIssuing.createSecureSession(pubkey)\nconst authHeader = \"auth\"\nconst sessionId = secureSession.getKey()\n\nconst config = {\n  method: \"get\",\n  url: `https://base-url/pin?session_id=${sessionId}`,\n  headers: {\n    Authorization: authHeader,\n  },\n}\n\nconst response = await axios.request(config)\n\nconst { iv, secret } = response.data\nconst pin = secureSession.decryptCardData(iv, secret)\n\nconsole.log(\"Decrypted PIN:\", pin)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxendit%2Fxenissuing-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxendit%2Fxenissuing-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxendit%2Fxenissuing-web/lists"}