|
| 1 | +# 💳 Stripe Payment Widget for ServiceNow Service Portal |
| 2 | + |
| 3 | +### Overview |
| 4 | + |
| 5 | +The **Stripe Payment Widget** enables secure and modern payment experiences directly inside the **ServiceNow Service Portal** using **Stripe.js v3**. |
| 6 | +It supports one-time payments and subscription flows, with integrated address fields, real-time validation, and full Stripe Element styling. |
| 7 | + |
| 8 | +Built entirely using **client**, **server**, and **HTML/CSS** components — this widget can be plugged into any portal page to accept payments or donations seamlessly. |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +### ✨ Features |
| 13 | + |
| 14 | +- 🔐 Powered by **Stripe.js v3** (secure, PCI-compliant) |
| 15 | +- 🧾 Supports **PaymentIntent** and **Subscription** flows |
| 16 | +- 🌍 Includes **Address Element** and live validation |
| 17 | +- 💬 Displays dynamic messages and status indicators |
| 18 | +- 💅 Modern, responsive design using Tailwind-like CSS |
| 19 | +- ⚙️ Fully compatible with ServiceNow **Service Portal widgets** |
| 20 | +- 🔒 No card details ever stored in ServiceNow |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +### 🧩 Folder Structure |
| 25 | + |
| 26 | +| File Name | Description | |
| 27 | +| ---------------------------- | -------------------------------------------------------------------------------------------- | |
| 28 | +| `Readme.md` | Project documentation | |
| 29 | +| `Stripe_Payment_html` | Widget HTML template | |
| 30 | +| `Stripe_Payment_css` | Widget styling (responsive modern design) | |
| 31 | +| `Stripe_Payment_client_code` | AngularJS client controller with Stripe.js logic | |
| 32 | +| `Stripe_Payment_server_code` | Server script handling secure backend processing via `StripePaymentProcessor` Script Include | |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +### 🧰 Technical Dependencies |
| 37 | + |
| 38 | +- **ServiceNow Instance** with Service Portal enabled |
| 39 | +- **Stripe API Key** stored in a system property: |
| 40 | + - Property Name → `stripe_element_key` |
| 41 | + - Example Value → `pk_test_51Nxxxxx` |
| 42 | +- **Script Include**: `StripePaymentProcessor` |
| 43 | + Handles backend communication with Stripe API securely. |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +### ⚙️ Installation Steps |
| 48 | + |
| 49 | +1. Create a **new Service Portal Widget** in your instance. |
| 50 | +2. Copy each file’s content into its respective section: |
| 51 | + - HTML → Widget HTML |
| 52 | + - CSS → Widget CSS |
| 53 | + - Client Script → Widget Client Controller |
| 54 | + - Server Script → Widget Server Script |
| 55 | +3. Add a system property: |
| 56 | + - Name: `stripe_element_key` |
| 57 | + - Value: Your Stripe Publishable Key |
| 58 | +4. Add the widget to a portal page (like `/checkout` or `/donate`). |
| 59 | +5. (Optional) Create Script Include: `StripePaymentProcessor` to handle backend API calls. |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +### 💳 Example Use Cases |
| 64 | + |
| 65 | +- 🎗️ Donation collection for NGOs / non-profits |
| 66 | +- 🧾 Subscription renewal systems |
| 67 | +- 🛒 Checkout page for internal app store |
| 68 | +- 💼 Invoice or expense reimbursement payment portals |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +### 🧠 Future Enhancements |
| 73 | + |
| 74 | +- Support **Apple Pay** and **Google Pay** |
| 75 | +- Add **multi-currency** and **tax calculation** |
| 76 | +- Enable **webhook-based status sync** |
| 77 | +- Dashboard to track transactions and refunds |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +### 🧑💻 Author |
| 82 | + |
| 83 | +**Abhishek Aggarwal** |
| 84 | +ServiceNow Developer | Hacktoberfest 2025 Contributor |
| 85 | +🌐 [GitHub Profile](https://github.com/abhishek-aggarwal) |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +### 🏷️ Tags |
| 90 | + |
| 91 | +`ServiceNow` `ServicePortal` `Stripe` `Hacktoberfest` `Widget` `Payment Integration` `Donation` |
0 commit comments