Skip to content

tmcquinn-stripe/stripe-java-webhook-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use this sample code to handle webhook events in your integration.

Setup a webhook endpoint

Collect & Confirm (Debit Detection) and forms on reader are beta features and require a webhook endpoint to be created via the API.

Use the following cURL command to create a valid webhook endpoint
curl -X POST "https://api.stripe.com/v1/webhook_endpoints" \
  -u 'REPLACE_WITH_YOUR_SECRET_KEY':  \
  -H "Stripe-Version: 2022-11-15;terminal_collect_confirm_beta=v1;terminal_collect_inputs_beta=v1" \
  -d "url"="REPLACE_WITH_URL" \
  -d "enabled_events[0]"="terminal.reader.action_failed" \
  -d "enabled_events[1]"="terminal.reader.action_succeeded" \
  -d "enabled_events[2]"="terminal.reader.action_updated" \
  -d "api_version"="2022-11-15;terminal_collect_confirm_beta=v1;terminal_collect_inputs_beta=v1"

Run Webhook Endpoint

Clone this repository and use the run.sh script to compile and run the server on http://localhost:4242.
Alternatively, Build and run the server with:
mvn compile
mvn exec:java -Dexec.mainClass=com.example.Server

About

Sample Java webhook endpoint

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published