Skip to content

Conversation

@abhix2112
Copy link
Contributor

Overview

Added a fully functional Stripe Payment Widget built with Stripe.js v3 for the ServiceNow Service Portal.

This widget allows users to securely make payments, donations, or subscriptions directly from within the portal, featuring modern UI, address validation, and 3D Secure support.


Key Features

  • Integrated Stripe Elements for card and address fields
  • Supports payment and subscription flows
  • Secure client-server design with PCI compliance
  • Clean and responsive layout using custom CSS
  • Easily reusable for NGOs, donations, or billing portals

Files Included

  • Stripe_Payment_html
  • Stripe_Payment_css
  • Stripe_Payment_client_code
  • Stripe_Payment_server_code
  • Readme.md

Developer Notes

  • Requires system property stripe_element_key
  • Add Script Include StripePaymentProcessor for backend Stripe API calls
  • Tested in Vancouver and above Releases

Contributor

Abhishek Aggarwal
ServiceNow Developer | Hacktoberfest 2025 Participant

@ravichandra1998g
Copy link
Contributor

Hello @wiz0floyd
This is similar to the one you reviewed #2377
Can you please review

Copy link
Contributor

@wiz0floyd wiz0floyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I don't think this is a good fit for the code snippets repository as it's far too long and complex to call a snippet. I would recommend uploading this to the Developer Share instead.

There are specific comments inline as well.

}

body {
background: #fafbfc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practice for css is to use variables so that it can get values from the portal and theme.

box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);
}

@media (max-width: 1024px) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are bootstrap classes that can be used for responsive elements instead of baking it into the widget CSS.

Comment on lines +81 to +91
### 🧑‍💻 Author

**Abhishek Aggarwal**
ServiceNow Developer | Hacktoberfest 2025 Contributor
🌐 [GitHub Profile](https://github.com/abhishek-aggarwal)

---

### 🏷️ Tags

`ServiceNow` `ServicePortal` `Stripe` `Hacktoberfest` `Widget` `Payment Integration` `Donation`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this is not needed

<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Subscribe to Premium Plan</title>
<script src="https://cdn.tailwindcss.com"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this script?

</div>
<sp-widget ng-if="c.data.record" widget="c.data.childWidget"></sp-widget>

<script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Script blocks should not be used and this should live in the client controller or in an angular provider.

All DOM manipulation should be in the Link Function.

@@ -0,0 +1,251 @@
(function () {
data.stripeKey = gs.getProperty("Stripe_element_key");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a connection and credential record as indicated in the last review

@ravichandra1998g
Copy link
Contributor

Thank you for reviewing @wiz0floyd

@abhix2112 As suggested, Please upload the working solution to Developer share as it's not the best fit for code snippet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants