Comments (1)
Hey @Syirrus, it sounds like what you are looking for here is metadata, which is arbitrary information you can attach to an object in Stripe's API.
In terms of implementing that as part of this demo, you'd want to add your hidden input tag in index.html:
<input type="hidden" id="user_id" value="user_123">
and then access it when the form is submitted:
var userId = document.getElementById("user_id").value
You might then pass it to the payOrder
function, in order to send the value to the backend, around here :
https://github.com/stripe/stripe-payments-demo/blob/c242611d0abd2ca99ec0557d3cf5855657ade2cc/public/javascripts/payments.js#L391
order.userId = userId;
const response = await store.payOrder(order, source);
You can then attach it to the charge object created on the backend server:
https://github.com/stripe/stripe-payments-demo/blob/c242611d0abd2ca99ec0557d3cf5855657ade2cc/server/node/routes.js#L63-L75
charge = await stripe.charges.create(
{
source: source.id,
amount: order.amount,
metadata : {userId : order.userId}
....
}
)
This issue tracker is for bugs or issues directly related to this project, and not for general support. Please feel free to reach out to https://support.stripe.com/email and we would be glad to help further!
from stripe-payments-demo.
Related Issues (20)
- Stripe React Native: handle subscriptions HOT 2
- complete demo code for alipay HOT 3
- Move European payment methods from sources to payment methods
- WeChat doesn't seem to work HOT 2
- Not working with IE11 HOT 1
- Issue with Australian dollar (aud) currency HOT 2
- It seems that SKUs have been deprecated - can this support Prices instead? HOT 5
- Shipping Rates from config file do not take effect in total price in checkout
- ApplePay button via PaymentRequestButtonElement fails with "Page already has an active payment session." HOT 9
- PaymentIntents and subscriptions
- No API documentation for paymentIntents.confirm with Source Id HOT 1
- payment_intents error in alipay or wechat pay case HOT 2
- Card Payments and 3D Secure wont work if only express_payment is enabled
- Charge.Succeeded und Charge.refunded Webhook does not work when stripe_payment_express is the only activated Method
- requires_payment_method in wechat payment
- PaymentIntent - Same card is saved multiple times HOT 1
- canMakePayment is not return `promise` as its throwing `undefined` when used with `.then` HOT 1
- Payment Request Button dosen`t show HOT 2
- Stripe.card.validateCreditCardNumber doesn't return error for invalid cards
- Error due to array given in Slim\App::__construct() instead of Psr\Http\Message\ResponseFactoryInterface
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stripe-payments-demo.