#brandon10x15
1 messages · Page 1 of 1 (latest)
Hello! I'm not sure what you mean by the "title of the purchase"
Can you be more specific?
So basically trying to pull "Coin" which is the product name, from the charge
Not sure how to identify what the charges are for
Looking for a way to trace it back to the payment link or product
Ah, you're using Payment Links?
Is there a better way?
Payment Links are fine, but the Charge and Payment Intent won't have any information on the actual line items in the payment link
You have two options:
- When you get the
charge.succeededevent look for thepayment_intentassociated with the Charge and use it to List the Checkout Sessions tied to that charge/payment (https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-payment_intent). The Checkout Session will have all the line items on it - Update your PaymentLink through the API and include metadata on
payment_intent_data.metadata, which wil be copied over to Charge (https://stripe.com/docs/api/payment_links/payment_links/update#update_payment_link-payment_intent_data-metadata)
const pLinkObj = {
line_items: [
{
price: productInfo.priceID,
quantity: 1,
},
],
payment_intent_data: { metadata: productInfo.name }
};
const pLink = await SpyZManager.stripe.client.paymentLinks.create(pLinkObj);```
I assume this would work
Basically making it so players can buy Coin and my discord bot will detect the charge.succeeded, send a redemtion code to the reciept_email which can be entered in
Almost - the way you're setting metadata isn't right
const pLinkObj = {
line_items: [
{
price: productInfo.priceID,
quantity: 1,
},
],
payment_intent_data: { metadata: { 'productName': productInfo.name} }
};
const pLink = await SpyZManager.stripe.client.paymentLinks.create(pLinkObj);
Since I notice it doesnt always send a reciept number to the customer when they purchase
so i couldnt use that as the code unless I just send it myself
I'm not quite following what you're talking about with the receipt number
so for the subcriptions, I noticed you get a full reciept to your email after purchase with a title similar to "Your receipt from SpyZ© Feed #2330-4825"
that reciept number is accessible in the charge.suceeded and could be used as a unique code but i dont think it was sending reciepts for regular products
It sent me a reciept for SpyZ 1 Month subscript but not for SpyZ 500 Coin, in other words
Can you share a successful payment intent ID (pi_xxx) without a receipt, so that I can have a check?
Im in test mode, can i force one?
I was using money before and saved the responses lol
In test mode, Stripe doesn't send email. Email is only sent in live mode
It's expected that you don't receive receipt email in test mode
Oh I was live when it charged me
That was done in live mode for me to get the objects into a json
I just didnt know if there was another setting to make sure it sends a reciept
Can you share the live mode payment intent (pi_xxx)? You should be able to find the payment in the Dashboard: https://dashboard.stripe.com/payments
Ahh id have to make another, it wont show becuase its over 30 days old, i just jumped back into this lol
I see! Before testing another one live mode, please ensure that you turn on sending email receipt in: https://dashboard.stripe.com/settings/emails
you know, maybe I gotta dig deeper or make them manually on the website first then use them, ill have to have mt bot set all these too I assume
Status
Active
Date created
Oct 22, 8:26 PM
Allow promotion codes
No
Collect addresses
None required
Collect phone numbers
No
Allow business customers to provide tax IDs
No
Save payment details for future use
No
Collect tax automatically
No
Collect terms of service agreement
No
Confirmation page
Default
Call to action button
Pay
Post-payment invoice
No```
Post-payment-invoice = yes would likely fix
Invoice and receipt are two different things. Are you looking for invoice or receipt for one-time payment?
I was looking for any identifier to the line_item