{"id":18160726,"url":"https://github.com/blankeos/xendit-solid-example","last_synced_at":"2025-04-07T03:54:41.089Z","repository":{"id":249326811,"uuid":"831050893","full_name":"Blankeos/xendit-solid-example","owner":"Blankeos","description":"Xendit integration in Solid + Hono.","archived":false,"fork":false,"pushed_at":"2024-07-31T15:57:06.000Z","size":98,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T08:41:21.281Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blankeos.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":"2024-07-19T14:44:45.000Z","updated_at":"2024-07-31T15:57:10.000Z","dependencies_parsed_at":"2024-07-20T03:26:12.987Z","dependency_job_id":"c3ba8ff6-f1ee-4783-8feb-891e07cd6350","html_url":"https://github.com/Blankeos/xendit-solid-example","commit_stats":null,"previous_names":["blankeos/xendit-solid-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fxendit-solid-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fxendit-solid-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fxendit-solid-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Fxendit-solid-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blankeos","download_url":"https://codeload.github.com/Blankeos/xendit-solid-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247589831,"owners_count":20963022,"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","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-02T08:09:10.860Z","updated_at":"2025-04-07T03:54:41.068Z","avatar_url":"https://github.com/Blankeos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xendit-solid-example\n\n\u003e [!WARNING]\n\u003e Very WIP\n\n\u003e This was bootstrapped with [Solid Hop](https://github.com/blankeos/solid-hop).\n\n- Xendit\n- SolidJS\n- Hono + Vike\n\nA Xendit integration that works in the 🇵🇭 Philippines :D. If you're just learning, I recommend cloning this and taking a few hours to study it (even if I don't use similar tech as you).\n\nConcept: A Watercolor Brush Company\n\nFeatures covered\n\n- [x] Products\n  - [x] Simple one-time payment with tiers (Basic, Professional Set for Watercolor Brushes)\n  - [x] Recurring Subscription (Membership)\n  - [ ] One-time payment with extra units (Watercolor event tickets)\n- [ ] Discounts\n- [ ] Webhook (What happens after successful transaction)\n- [ ] Non-xendit related: Simple Auth + Database signifiying that the user has paid\n\n## Quickstart\n\n\u003e Assumes you have zero knowledge of Xendit.\n\n1. Sign up for a [**Xendit account**](https://dashboard.xendit.co/register). As **Sole Proprietorship** minimum to be able to accept credit/debit card payments.\n\n2. Generate a Secret API Key for development in Test mode. Go to **Settings \u003e Developers \u003e API Keys**.\n\n   - Make sure to set \"Write\" permissions for your API key for Money-in products.\n\n3. Fill environment variables\n\n   ```sh\n   $ cp .env.example .env\n   ```\n\n   - `XENDIT_SECRET_API_KEY` - From **Settings \u003e Developers \u003e API Keys**\n\n4. Install deps and run dev server\n   ```sh\n   bun install\n   bun dev\n   ```\n\n## Some notes\n\n- Xendit feels headless compared to Paddle. Most of it is just a REST API, no extra SDK.\n- What Xendit provides that I think I need:\n  - A **create invoice API** - returns a checkout url. You can also set a success and failure **redirect** url. (they are not webhooks)\n  - A **Checkout URL**\n    - You redirect the user here after creating an invoice.\n    - Xendit owns this checkout page, I guess so most of the UI is done.\n    - Xendit will redirect the user to **success** or **failure** pages. The ones you set in the **create invoice API**.\n    - When the user finishes the payment, they will be redirected to the success url. Else, they will be redirected to the failure url.\n- **Webhooks** - You have to set on the dashboard. Xendit will send a POST request to your webhooks after some events.\n\n- My rough outline of how the payment flow works/is built:\n\n  - 1.  User selects a product/or chooses some products. (c.o. **dev**)\n  - 2.  Backend creates an invoice. (c.o. **dev** + xendit API)\n  - 3.  Backend redirects the user to Xendit's Checkout URL. (c.o. xendit)\n  - 4.  User inputs payment, then finishes payment. (c.o. xendit)\n  - 5.  Xendit redirects user to success url. (c.o. xendit)\n  - 6.  If user failed payment, they will be redirected to failure url. (c.o. **dev**)\n  - 7.  Handle the callback via webhook POST (c.o. **dev**)\n\n- I think that most payment integrations is literally just three steps:\n  - Invoice - List of products to pay for before a checkout session.\n  - Checkout Session - Handle transaction.\n  - Webhook - A way for the dev to react to the transaction and serve the user appropriately.\n\n## Resources\n\n- https://docs.xendit.co/create-a-checkout-page-via-api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankeos%2Fxendit-solid-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblankeos%2Fxendit-solid-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankeos%2Fxendit-solid-example/lists"}