Logo

dev-resources.site

for different kinds of informations.

Providing receipts for in-person transactions with Terminal

Published at
9/25/2024
Categories
stripe
terminal
Author
azaanephrons
Categories
2 categories in total
stripe
open
terminal
open
Author
12 person written this
azaanephrons
open
Providing receipts for in-person transactions with Terminal

Recently, my colleague Charles Watkins wrote a 4-part intro series to Stripe Terminal, our in-person payment solution. Charles' articles will teach you how to set up and register a Terminal device and build an app to accept or cancel payments. Additionally, I’ve been looking into other features including how to collect tips with Terminal. In this post, I’ll explain how to provide digital receipts for in-person purchases.
Digital receipts are very convenient for both customers and merchants. They eliminate the need for paper, help keep track of your spendings and are very helpful if you need to submit expenses.

Triggering an automatic email receipt

If you’ve used Terminal before or if you read the blog series linked above, you’ll know that to process payments, you need to start by creating a PaymentIntent. By default, this does not send receipts once the payment is processed. To use this feature, you only need to add the receipt_email field in the payment intent object, with the email value your customer would enter in your UI.

{const intent = await stripe.paymentIntents.create({
    currency: "usd",
    amount: 1000,
    payment_method_types: ["card_present"],
    capture_method: "manual",
    receipt_email: "[email protected]"
});
Enter fullscreen mode Exit fullscreen mode

Once the payment intent is created, it needs to be processed using the processPaymentIntent method, passing the Terminal reader ID and the payment intent ID.

await stripe.terminal.readers.processPaymentIntent(
     reader.id, //the reader ID can be found by calling await stripe.terminal.readers.list()
     { payment_intent: intent.id }
);
Enter fullscreen mode Exit fullscreen mode

Finally, capturing the payment using the capture methods will automatically send an email to the address provided.

await stripe.paymentIntents.capture(intent.id);
Enter fullscreen mode Exit fullscreen mode

Creating custom receipts

Image description

The design and content can be updated via the Stripe dashboard. You can select which language to use for receipts (English, French, Portuguese, etc.) in your email receipt settings and update the logo and colors in the branding settings.

Image description
Screenshot of the Stripe dashboard showing the branding page where colors and logos can be edited.

Additionally, you can add details about your cancellation policy by using the description field when creating your payment intent.
Some things to note: a receipt will only be sent after a successful payment. A canceled or failed transaction will not generate a receipt.
Now you should be able to automatically send receipts to your customers after each successful in-person transaction!

Let us know if you’re implementing this, and stay up to date with Stripe developer updates on the following platforms:

📣 Follow @StripeDev and our team on Twitter
📺 Subscribe to our Youtube channel
💬 Join the official Discord server
📧 Sign up for the Dev Digest

About the author

Charlie's profile picture. She has long brown hair and wears glasses. She is standing in front of a white wall with purple lights.

Image description
Charlie Gerard is a Developer Advocate at Stripe, a creative technologist and Google Developer Expert. She loves researching and experimenting with technologies. When she’s not coding, she enjoys spending time outdoors, trying new beers and reading.

stripe Article's
30 articles in total
Favicon
Boost Your Shopify Sales in Australia, the US, and Beyond: Accept Various Payment Methods and Currencies with Stripe
Favicon
Boost Your Shopify Sales in Poland, Europe, and Beyond: Accept Various Payment Methods and Currencies with Stripe
Favicon
Is Stripe your only choice for payment gateway in Sharetribe?
Favicon
Stripe Invoice.Upcoming changes: model switching from monthly to yearly
Favicon
Replay failed stripe events via webhook
Favicon
Building a Payment System for Your Flutter App: A Journey with Stripe Connect and Firebase
Favicon
Understanding Laravel Cashier's Core Traits: A Deep Dive
Favicon
Creating Stripe Test Data in Python
Favicon
Simplifying Payments with Pay gem: A Guide to Using Stripe in Rails
Favicon
Comparison of the middleware implementation between Supabase Auth documentation and the nextjs-stripe-supabase.
Favicon
Building a Custom Shipping Calculator with Stripe and Netlify Functions for Multi-Currency (€/$), Quantity, and Location Support
Favicon
🌟Open-source SaaS Starter: React + Firebase + Stripe + i18n
Favicon
Creating a marketplace with Stripe Connect: The onboarding process
Favicon
Stripe Subscription Integration in Node.js [2024 Ultimate Guide]
Favicon
Clerk Update – November 12, 2024
Favicon
Integrating Stripe Payment Intent in NestJS with Webhook Handling
Favicon
How Mocking Against a Public API Endpoints within Blackbird Gets your API in Production Faster
Favicon
How to add Stripe to Astro
Favicon
Designing Idempotent APIs
Favicon
Building E-Commerce Platforms with Next.js and Stripe: A Step-by-Step Guide
Favicon
How to retrieve the Transactions from Stripe
Favicon
Integration with Stripe for Payment Processing on AWS
Favicon
Providing receipts for in-person transactions with Terminal
Favicon
Providing receipts for in-person transactions with Terminal
Favicon
Top 10 Payment Processors for Next.js Applications [2024]
Favicon
Fixing the Stripe API Key Error When Migrating Next.js from Vercel to Azure Static Web Apps
Favicon
Announcing the Release of my Stripe to SevDesk Integration
Favicon
Receive payments easily using Stripe and PHP
Favicon
Integrating Payment Gateways in Next.js 14
Favicon
Experimenting with pricing: Finding the right strategy for growth!

Featured ones: