### Multi-Tenant Setup with Proxy Configuration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Configuration example for a multi-tenant setup using a proxy server for network traffic. ```properties # Tenant A configuration with proxy org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_KEY_TENANT_A} org.killbill.billing.plugin.stripe.publicKey=${env:STRIPE_PUBLIC_TENANT_A} org.killbill.billing.plugin.stripe.proxyHost=proxy.example.com org.killbill.billing.plugin.stripe.proxyPort=8080 org.killbill.billing.plugin.stripe.connectionTimeout=60000 ``` -------------------------------- ### Install Java Plugin Locally Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/README.md Installs the Stripe Java plugin locally using the kpm tool. Ensure the JAR file is in the target directory. ```bash kpm install_java_plugin stripe --from-source-file target/stripe-plugin-*-SNAPSHOT.jar --destination /var/tmp/bundles ``` -------------------------------- ### Full Production Setup Configuration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Details a comprehensive configuration for a production environment. ```Properties stripe.api.key=sk_live_... stripe.publishable.key=pk_live_... stripe.webhook.secret=whsec_... stripe.currency=USD ``` -------------------------------- ### Minimal Test Setup Configuration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Provides a minimal configuration for testing purposes. ```Properties stripe.api.key=sk_test_... stripe.publishable.key=pk_test_... ``` -------------------------------- ### Marketplace/Multi-seller Integration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Example of integrating marketplace or multi-seller payment flows. ```Java // Logic for managing payments across multiple sellers in a marketplace ``` -------------------------------- ### Basic Purchase Flow Example Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/overview.md Outlines the steps for a basic payment purchase using the plugin. ```text 1. Add Payment Method API: addPaymentMethod(accountId, paymentMethodId, pm_XXX) Result: Payment method stored locally and linked to Stripe customer 2. Process Purchase API: purchasePayment(accountId, paymentId, amount, currency) Stripe: Create PaymentIntent with capture_method=automatic Result: Funds charged and captured immediately Status: PROCESSED (success) or ERROR (declined) 3. Retrieve Payment API: getPaymentInfo(accountId, paymentId) Result: Transaction details with charge ID and authorization code ``` -------------------------------- ### Subscription Billing Integration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Example of integrating subscription billing functionality. ```Java // Logic for creating and managing subscriptions using the plugin ``` -------------------------------- ### Development Setup Configuration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Basic Stripe plugin configuration for a development environment. ```properties # Basic test configuration org.killbill.billing.plugin.stripe.apiKey=sk_test_51234567890ABCDEFGHIJK org.killbill.billing.plugin.stripe.publicKey=pk_test_51234567890ABCDEFGHIJK org.killbill.billing.plugin.stripe.chargeDescription=Dev Charge org.killbill.billing.plugin.stripe.chargeStatementDescriptor=DevBiz ``` -------------------------------- ### Authorization and Capture Flow Example Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/overview.md Details the process for authorizing a payment and capturing it later. ```text 1. Add Payment Method Same as above 2. Authorize Payment API: authorizePayment(accountId, paymentId, amount, currency) Stripe: Create PaymentIntent with capture_method=manual Result: Payment authorized, funds held Status: PROCESSED (authorized, not captured) 3. Later: Capture Payment API: capturePayment(accountId, paymentId, captureAmount) Stripe: Call PaymentIntent.capture() Result: Funds deducted from card Status: PROCESSED 4. Alternative: Void Payment API: voidPayment(accountId, paymentId) Stripe: Call PaymentIntent.cancel() Result: Authorization cancelled, funds released Status: CANCELED ``` -------------------------------- ### One-time Purchases Integration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Example of integrating one-time purchase functionality. ```Java // Logic for handling one-time purchases using the plugin ``` -------------------------------- ### Exception Handling Example Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Demonstrates how to handle exceptions that may occur during API interactions. ```Java import com.stripe.exception.StripeException; try { // ... Stripe API call ... } catch (StripeException e) { System.err.println("Stripe API Error: " + e.getMessage()); // Handle specific Stripe exceptions } ``` -------------------------------- ### Stripe Healthcheck Example Usage Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/helper-classes.md Demonstrates how to perform health checks for the Stripe plugin using curl. Includes examples for a basic check and a tenant-specific check. ```bash # Basic health check (no tenant) curl http://localhost:8080/plugins/killbill-stripe/healthcheck # Tenant-specific health check (via Kill Bill API) curl http://localhost:8080/1.0/kb/healthchecks \ -u admin:password \ -H 'X-Killbill-ApiKey: bob' ``` -------------------------------- ### SaaS Billing Integration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Example of integrating Software as a Service (SaaS) billing models. ```Java // Logic for implementing SaaS subscription and usage-based billing ``` -------------------------------- ### Configure API Key and Environment Variable Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/errors.md This example shows how to configure the Stripe API key using a properties file and set the corresponding environment variable. ```properties org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_API_KEY} # Set environment variable export STRIPE_API_KEY=sk_test_XXX ``` -------------------------------- ### Payment Lifecycle Example Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/README.md Illustrates a common payment flow: authorizing funds, capturing the authorized amount, and then refunding the captured amount. ```text 1. authorizePayment() — Hold $100 2. capturePayment() — Capture $100 3. refundPayment() — Refund $100 ``` -------------------------------- ### Production Setup with Environment Variables Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Secure production configuration for the Stripe plugin using environment variables for sensitive keys. ```properties # Secure production configuration using environment variables org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_SECRET_KEY_PROD} org.killbill.billing.plugin.stripe.publicKey=${env:STRIPE_PUBLIC_KEY_PROD} org.killbill.billing.plugin.stripe.chargeDescription=YourBusiness org.killbill.billing.plugin.stripe.chargeStatementDescriptor=YourBiz org.killbill.billing.plugin.stripe.cancelOn3DSAuthorizationFailure=false # Network timeouts org.killbill.billing.plugin.stripe.connectionTimeout=30000 org.killbill.billing.plugin.stripe.readTimeout=60000 # Payment expiration org.killbill.billing.plugin.stripe.pendingPaymentExpirationPeriod=P3d org.killbill.billing.plugin.stripe.pending3DsPaymentExpirationPeriod=PT3h org.killbill.billing.plugin.stripe.pendingHppPaymentWithoutCompletionExpirationPeriod=PT1h ``` -------------------------------- ### cURL Example for HTTP Operations Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Shows how to interact with Stripe API endpoints using cURL. ```bash curl -X POST https://api.stripe.com/v1/charges \ -u "sk_test_...": \ -d amount=2000 \ -d currency=usd \ -d description="Test charge" ``` -------------------------------- ### Java Code for API Calls Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Provides Java code examples for making calls to the Stripe API. ```Java import com.stripe.Stripe; import com.stripe.model.Charge; import com.stripe.net.RequestOptions; public class StripeApiExample { public static void main(String[] args) { Stripe.apiKey = "sk_test_..."; RequestOptions options = RequestOptions.builder().setApiKey("sk_test_...").build(); Map chargeParams = new HashMap<>(); chargeParams.put("amount", 2000); chargeParams.put("currency", "usd"); chargeParams.put("description", "Test charge"); try { Charge charge = Charge.create(chargeParams, options); System.out.println("Charge ID: " + charge.getId()); } catch (Exception e) { e.printStackTrace(); } } } ``` -------------------------------- ### Multi-Tenant Stripe Configuration with Environment Variables Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/configuration.md Configure the Stripe plugin for multiple tenants using distinct environment variables for API keys and charge descriptions. Includes tenant-specific properties and environment variable setup. ```properties **Tenant A Configuration:** ```properties org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_KEY_TENANT_A} org.killbill.billing.plugin.stripe.publicKey=${env:STRIPE_PUBLIC_TENANT_A} org.killbill.billing.plugin.stripe.chargeDescription=Tenant A Charges ``` **Tenant B Configuration:** ```properties org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_KEY_TENANT_B} org.killbill.billing.plugin.stripe.publicKey=${env:STRIPE_PUBLIC_TENANT_B} org.killbill.billing.plugin.stripe.chargeDescription=Tenant B Charges ``` ``` ```bash **Environment Setup:** ```bash export STRIPE_KEY_TENANT_A=sk_test_AAAA export STRIPE_PUBLIC_TENANT_A=pk_test_AAAA export STRIPE_KEY_TENANT_B=sk_test_BBBB export STRIPE_PUBLIC_TENANT_B=pk_test_BBBB ``` ``` -------------------------------- ### Get Tenant Configuration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/helper-classes.md Retrieves the Stripe configuration for a specific tenant using a handler. ```java StripeConfigProperties config = handler.getConfigurable(tenantId); String apiKey = config.getApiKey(); ``` -------------------------------- ### Custom Stripe Configuration Properties Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/overview.md Example of extending the base Stripe configuration properties to include custom settings. This allows for additional plugin-specific configurations to be managed. ```java public class CustomStripeConfigProperties extends StripeConfigProperties { private final String customSetting; public CustomStripeConfigProperties(Properties properties) { super(properties, region); this.customSetting = properties.getProperty("org.killbill.billing.plugin.stripe.customSetting"); } public String getCustomSetting() { return customSetting; } } ``` -------------------------------- ### Tenant-Specific Stripe API Key Configuration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/overview.md Example of configuring independent Stripe API keys for different Kill Bill tenants. ```properties # Tenant A org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_KEY_TENANT_A} # Tenant B org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_KEY_TENANT_B} ``` -------------------------------- ### Set Stripe API Credentials and Timeouts Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/README.md Example of setting Stripe API keys and connection timeouts using environment variables. These variables are referenced in the plugin's configuration. ```bash export STRIPE_API_KEY=sk_test_XXX export STRIPE_PUBLIC_KEY=pk_test_YYY export STRIPE_CONNECTION_TIMEOUT=30000 export STRIPE_READ_TIMEOUT=60000 ``` -------------------------------- ### Configure Stripe API Keys using Environment Variables Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/configuration.md Use environment variables for secure management of Stripe API keys. Set the environment variables before starting Kill Bill. ```properties org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_SECRET_KEY} org.killbill.billing.plugin.stripe.publicKey=${env:STRIPE_PUBLIC_KEY} ``` ```bash export STRIPE_SECRET_KEY=sk_test_XXX export STRIPE_PUBLIC_KEY=pk_test_YYY ``` -------------------------------- ### Configure Stripe Connection Timeouts and Proxy Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/errors.md Provides examples for setting connection and read timeouts for the Stripe API, and configuring proxy settings if necessary. These settings help manage network-related issues. ```properties # Verify timeouts are appropriate org.killbill.billing.plugin.stripe.connectionTimeout=30000 org.killbill.billing.plugin.stripe.readTimeout=60000 # If behind proxy, verify proxy settings org.killbill.billing.plugin.stripe.proxyHost=proxy.example.com org.killbill.billing.plugin.stripe.proxyPort=8080 ``` -------------------------------- ### Get Payment Methods (Sync with Stripe) Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-payment-plugin-api.md Retrieves payment methods for an account and synchronizes with Stripe to ensure the local list matches the gateway state. Use this when you need the most up-to-date payment method information. ```java // Sync with Stripe and get fresh list List freshMethods = stripePaymentPluginApi.getPaymentMethods( kbAccountId, true, ImmutableList.of(), callContext ); ``` -------------------------------- ### Get Payment Methods (Local) Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-payment-plugin-api.md Retrieves locally stored payment methods for an account. Use this for a quick check of available payment methods without syncing with the gateway. ```java // Get locally stored payment methods List methods = stripePaymentPluginApi.getPaymentMethods( kbAccountId, false, ImmutableList.of(), callContext ); ``` -------------------------------- ### Stripe DAO - Get Payment Method(s) Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Database operation to retrieve payment method information from local storage. Supports fetching a single method or multiple methods. ```java public StripePaymentMethodPlugin getPaymentMethod(final UUID kbPaymentMethodId) ``` ```java public List getPaymentMethods(final UUID kbAccountId) ``` -------------------------------- ### Get Read Timeout Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the read timeout in milliseconds. Example: "60000". ```java public String getReadTimeout() ``` -------------------------------- ### Multi-tenant Configuration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Shows how to configure the plugin for multi-tenant environments. ```Properties stripe.tenant.id=tenant1 stripe.api.key=sk_test_... stripe.publishable.key=pk_test_... ``` -------------------------------- ### Get Connection Timeout Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the connection timeout in milliseconds. Example: "30000". ```java public String getConnectionTimeout() ``` -------------------------------- ### Property Usage Patterns Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Illustrates common patterns for using configuration properties. ```Properties # Example property usage stripe.api.key=sk_test_... stripe.webhook.enabled=true ``` -------------------------------- ### Environment Variable Usage Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Demonstrates using environment variables for configuration properties. ```Properties stripe.api.key=${STRIPE_API_KEY} stripe.publishable.key=${STRIPE_PUBLISHABLE_KEY} ``` -------------------------------- ### Get HTTP Proxy Hostname Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the configured HTTP proxy hostname. ```java public String getProxyHost() ``` -------------------------------- ### Authorization and Capture Flow (Manual) Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Illustrates a manual flow for authorizing a payment and then capturing it separately. ```Java Payment payment = paymentApi.authorize(accountId, paymentMethodId, currency, amount, idempotencyKey); // ... capture logic ... ``` -------------------------------- ### Get Charge Description Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the charge description, limited to a maximum of 22 characters. ```java public String getChargeDescription() ``` -------------------------------- ### Configure Stripe API Key Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/errors.md Shows how to set the Stripe API key using properties or environment variables. Ensure the API key format is correct (e.g., sk_test_*). ```properties # Set correct API key org.killbill.billing.plugin.stripe.apiKey=sk_test_51234567890ABC # Or use environment variable org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_SECRET_KEY} ``` -------------------------------- ### Get Custom API Base URL Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the custom API base URL if it has been configured. ```java public String getApiBase() ``` -------------------------------- ### Purchase Flow (Authorize + Capture) Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Demonstrates the common purchase flow involving authorization followed by capture. ```Java Payment payment = paymentApi.purchase(accountId, paymentMethodId, currency, amount, idempotencyKey); // ... authorize and capture logic ... ``` -------------------------------- ### Get Pending 3DS Payment Expiration Period Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the expiration period specifically for 3DS payments. ```java public Period getPending3DsPaymentExpirationPeriod() ``` -------------------------------- ### Create Checkout Session with Custom URLs and Payment Methods Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-checkout-servlet.md Creates a Stripe Checkout session with specified success and cancel URLs, and enables multiple payment method types like card and SEPA Direct Debit. Requires Kill Bill account ID and authentication headers. ```bash curl -X POST \ 'http://localhost:8080/plugins/killbill-stripe/checkout?kbAccountId=550e8400-e29b-41d4-a716-446655440000&successUrl=https%3A%2F%2Fmy-site.com%2Fsuccess&cancelUrl=https%3A%2F%2Fmy-site.com%2Fcancel&paymentMethodTypes=card&paymentMethodTypes=sepa_debit' \ -u admin:password \ -H 'X-Killbill-ApiKey: bob' \ -H 'X-Killbill-ApiSecret: lazar' \ -H 'X-Killbill-CreatedBy: admin' ``` -------------------------------- ### Get HTTP Proxy Port Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the configured HTTP proxy port. Returns -1 if disabled. ```java public int getProxyPort() ``` -------------------------------- ### Process Immediate Payment (Purchase) Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/README.md Performs an immediate charge by authorizing and capturing funds in a single transaction. Requires a valid account ID, payment method ID, amount, and currency. ```bash # Immediate charge (authorize + capture) POST /1.0/kb/accounts/550e8400-e29b-41d4-a716-446655440000/payments -d '{ "accountId": "550e8400-e29b-41d4-a716-446655440000", "paymentMethodId": "550e8400-e29b-41d4-a716-446655440001", "transactionType": "PURCHASE", "amount": 99.99, "currency": "USD" }' ``` -------------------------------- ### Get Stripe Public API Key Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the Stripe public API key configured for the plugin. ```java public String getPublicKey() ``` -------------------------------- ### Tenant-Specific Environment Variable References Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/README.md Demonstrates how to configure different Stripe API keys for different tenants by referencing distinct environment variables. This is useful in multi-tenant environments. ```java # Tenant A config org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_KEY_TENANT_A} # Tenant B config org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_KEY_TENANT_B} ``` -------------------------------- ### Get Stripe Secret API Key Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the Stripe secret API key configured for the plugin. ```java public String getApiKey() ``` -------------------------------- ### Get Charge Statement Descriptor Suffix Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the charge statement descriptor suffix, limited to a maximum of 22 characters. ```java public String getChargeStatementDescriptor() ``` -------------------------------- ### Minimal Stripe Plugin Configuration for Testing Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/configuration.md Basic configuration required for testing the Stripe plugin, including API keys. ```properties org.killbill.billing.plugin.stripe.apiKey=sk_test_51234567890ABC org.killbill.billing.plugin.stripe.publicKey=pk_test_51234567890ABC ``` -------------------------------- ### Get Pending Payment Expiration Period Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the expiration period for pending payments, with an optional override for specific payment methods. ```java public Period getPendingPaymentExpirationPeriod(@Nullable final String paymentMethod) ``` ```java Period expirationPeriod = configProperties.getPendingPaymentExpirationPeriod("sepa_debit"); // Returns P5d if configured, otherwise P3d (default) ``` -------------------------------- ### Get Pending HPP Payment Without Completion Expiration Period Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Retrieves the expiration period for incomplete HPP (Hosted Payment Page) payments. ```java public Period getPendingHppPaymentWithoutCompletionExpirationPeriod() ``` -------------------------------- ### 3D Secure Handling Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Explains the process for handling 3D Secure authentication during payment. ```Java Payment payment = paymentApi.processPaymentWith3DS(accountId, paymentMethodId, currency, amount, idempotencyKey, redirectUrl); // ... 3DS handling logic ... ``` -------------------------------- ### Full Stripe Plugin Configuration for Production Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/configuration.md Comprehensive configuration for production use, including API keys, charge descriptions, expiration policies, 3D Secure settings, and network timeouts. ```properties # API Configuration org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_SECRET_KEY} org.killbill.billing.plugin.stripe.publicKey=${env:STRIPE_PUBLIC_KEY} # Charge Descriptions org.killbill.billing.plugin.stripe.chargeDescription=ACME Subscription org.killbill.billing.plugin.stripe.chargeStatementDescriptor=ACME Inc # Payment Expiration Policies org.killbill.billing.plugin.stripe.pendingPaymentExpirationPeriod=P3d org.killbill.billing.plugin.stripe.pending3DsPaymentExpirationPeriod=PT3h org.killbill.billing.plugin.stripe.pendingHppPaymentWithoutCompletionExpirationPeriod=PT1h # 3D Secure org.killbill.billing.plugin.stripe.cancelOn3DSAuthorizationFailure=false # Network Timeouts org.killbill.billing.plugin.stripe.connectionTimeout=30000 org.killbill.billing.plugin.stripe.readTimeout=60000 ``` -------------------------------- ### Stripe Plugin Configuration - Multi-Tenant (Tenant A) Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/README.md Per-tenant configuration for Tenant A, specifying its unique Stripe API key and charge description. ```properties org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_KEY_A} org.killbill.billing.plugin.stripe.chargeDescription=Tenant A Charges ``` -------------------------------- ### Stripe DAO - Get Successful Authorization Response Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Retrieves the database record for a successful authorization response. This is used to link Kill Bill transactions to Stripe authorizations. ```java public StripeResponse getSuccessfulAuthorizationResponse(final UUID kbPaymentId, final UUID kbPaymentTransactionId) ``` -------------------------------- ### Create Basic Checkout Session Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-checkout-servlet.md Initiates a Stripe Checkout session with default settings. Requires Kill Bill account ID and authentication headers. ```bash curl -X POST \ 'http://localhost:8080/plugins/killbill-stripe/checkout?kbAccountId=550e8400-e29b-41d4-a716-446655440000' \ -u admin:password \ -H 'X-Killbill-ApiKey: bob' \ -H 'X-Killbill-ApiSecret: lazar' \ -H 'X-Killbill-CreatedBy: admin' \ -H 'Content-Type: application/json' ``` -------------------------------- ### Stripe Plugin Configuration - Multi-Tenant (Tenant B) Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/README.md Per-tenant configuration for Tenant B, specifying its unique Stripe API key and charge description. ```properties org.killbill.billing.plugin.stripe.apiKey=${env:STRIPE_KEY_B} org.killbill.billing.plugin.stripe.chargeDescription=Tenant B Charges ``` -------------------------------- ### Export Stripe Secret Key Environment Variable Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/configuration.md Ensure the STRIPE_SECRET_KEY environment variable is exported before starting Kill Bill. This is required for secure handling of API keys. ```bash export STRIPE_SECRET_KEY=sk_test_XXX # Then start Kill Bill bin/killbill.sh ``` -------------------------------- ### Stripe Payment Plugin API Constructor Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-payment-plugin-api.md Initializes the Stripe payment plugin API with necessary dependencies. ```java public StripePaymentPluginApi( final StripeConfigPropertiesConfigurationHandler stripeConfigPropertiesConfigurationHandler, final OSGIKillbillAPI killbillAPI, final OSGIConfigPropertiesService configProperties, final Clock clock, final StripeDao dao ) ``` -------------------------------- ### Stripe DAO - Get HPP Request Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Retrieves a Hosted Payment Page (HPP) request record from the database using its associated IDs. Useful for correlating requests and responses. ```java public StripeHppRequest getHppRequest(final UUID kbPaymentId, final UUID kbPaymentTransactionId) ``` -------------------------------- ### Load DDL Schema and Download Jars Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/src/main/resources/README.txt This script loads the DDL schema into MySQL and downloads necessary JAR dependencies using Maven. It configures Java options for Jooq code generation. ```shell #!/bin/sh # In order to generate the Jooq classes either copy and paste the code below or run this through "sh" like: # sh ./src/main/resources/README.txt # Load the DDL schema in MySQL DDL_DIR="`dirname \"$0\"`" mysql -u root -proot killbill < "${DDL_DIR}"/ddl.sql # Download the required jars JOOQ_VERSION=3.15.12 MYSQ_VERSION=8.0.30 REACTIVE_STREAM_VERSION=1.0.4 R2DBC_SPI_VERSION=1.0.0.RELEASE JAXB_VERSION=2.3.1 DEPENDENCIES= \ org.jooq:jooq:$JOOQ_VERSION \ org.jooq:jooq-meta:$JOOQ_VERSION \ org.jooq:jooq-codegen:$JOOQ_VERSION \ org.reactivestreams:reactive-streams:$REACTIVE_STREAM_VERSION \ mysql:mysql-connector-java:$MYSQL_VERSION \ io.r2dbc:r2dbc-spi:$R2DBC_SPI_VERSION \ javax.xml.bind:jaxb-api:$JAXB_VERSION for dep in $DEPENDENCIES; do mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \ -Dartifact=$dep -DremoteRepositories=https://repo.maven.apache.org/maven2 done M2_REPOS=~/.m2/repository JARS=$(find "$M2_REPOS" \ -name "jooq-$JOOQ_VERSION.jar" -o \ -name "jooq-meta-$JOOQ_VERSION.jar" -o \ -name "jooq-codegen-$JOOQ_VERSION.jar" -o \ -name "mysql-connector-java-$MYSQL_VERSION.jar" -o \ -name "reactive-streams-$REACTIVE_STREAM_VERSION.jar" -o \ -name "r2dbc-spi-$R2DBC_SPI_VERSION.jar" -o \ -name "jaxb-api-$JAXB_VERSION.jar" \ | tr '\n' ':') export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee' # Run jOOQ's generation tool java -cp $JARS org.jooq.codegen.GenerationTool ./src/main/resources/gen.xml ``` -------------------------------- ### getPaymentMethods Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-payment-plugin-api.md Retrieves all payment methods for an account. Optionally synchronizes with Stripe to ensure the local payment method list matches the gateway state. Requires Kill Bill account ID, a boolean to refresh from gateway, plugin properties, and call context. ```APIDOC ## getPaymentMethods ### Description Retrieves all payment methods for an account. Optionally synchronizes with Stripe to ensure local payment method list matches gateway state. ### Method Not specified (likely a plugin method call) ### Endpoint Not applicable (plugin method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **kbAccountId** (UUID) - Yes - Kill Bill account identifier - **refreshFromGateway** (boolean) - Yes - Whether to sync with Stripe - **properties** (Iterable) - Yes - Plugin properties - **context** (CallContext) - Yes - Call context ### Returns - `List` — List of payment method info ### Throws: - `PaymentPluginApiException` — If payment methods cannot be retrieved ### Example: ```java // Get locally stored payment methods List methods = stripePaymentPluginApi.getPaymentMethods( kbAccountId, false, ImmutableList.of(), callContext ); // Sync with Stripe and get fresh list List freshMethods = stripePaymentPluginApi.getPaymentMethods( kbAccountId, true, ImmutableList.of(), callContext ); ``` ``` -------------------------------- ### StripePaymentTransactionInfoPlugin Get Stripe Response Record Method Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/types.md Accessor method to retrieve the underlying StripeResponsesRecord associated with the transaction information. This allows access to the full raw response from Stripe. ```java public StripeResponsesRecord getStripeResponseRecord() // Returns the underlying Stripe response record ``` -------------------------------- ### Configure Stripe Public Key Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/configuration.md Set the Stripe public API key, recommended for client-side initialization. This can also be configured using environment variables. ```properties org.killbill.billing.plugin.stripe.publicKey=pk_test_51234567890ABC org.killbill.billing.plugin.stripe.publicKey=${env:STRIPE_PUBLIC_KEY} ``` -------------------------------- ### Stripe Healthcheck Get Health Status Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/helper-classes.md Retrieves the health status of the Stripe plugin. It can perform a basic check if no tenant is provided or a more thorough check by pinging the Stripe API if a tenant is specified. ```java @Override public HealthStatus getHealthStatus( @Nullable final Tenant tenant, @Nullable final Map properties ) ``` -------------------------------- ### Convert Configuration to Stripe RequestOptions Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Converts the current plugin configuration into Stripe RequestOptions for API calls. ```java public RequestOptions toRequestOptions() ``` ```java RequestOptions requestOptions = configProperties.toRequestOptions(); PaymentIntent intent = PaymentIntent.retrieve(intentId, requestOptions); ``` -------------------------------- ### Configure Stripe API Key in Java Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/README.md Sets the Stripe API key for the plugin within a Java configuration context. This is typically done via Kill Bill's tenant configuration. ```java org.killbill.billing.plugin.stripe.apiKey=sk_test_XXX ``` -------------------------------- ### Error Handling Patterns Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Illustrates common patterns for handling payment-related errors. ```Java try { // ... payment operation ... } catch (PaymentPluginApiException e) { // ... error handling logic ... } ``` -------------------------------- ### Get HPP Request Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-dao.md Retrieves a Stripe Checkout session request record using the session ID and tenant ID. Returns the record or null if not found. Useful for fetching details of a past HPP interaction. ```java public StripeHppRequestsRecord getHppRequest( final String sessionId, final String kbTenantId ) throws SQLException ``` ```java StripeHppRequestsRecord hppRecord = dao.getHppRequest("cs_test_ABC123", tenantId.toString()); if (hppRecord != null) { Map additionalData = fromAdditionalData(hppRecord.getAdditionalData()); String setupIntentId = (String) additionalData.get("setup_intent_id"); } ``` -------------------------------- ### PaymentPluginApiException Constructors Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/errors.md Illustrates the different ways to instantiate a PaymentPluginApiException, including with just an error message, an error message and a cause, or a specific error type and message. ```java public PaymentPluginApiException(final String errorMessage) public PaymentPluginApiException(final String errorMessage, final Throwable cause) public PaymentPluginApiException(final String errorType, final String errorMessage) ``` -------------------------------- ### Custom Stripe Plugin Properties for Additional Data Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/overview.md Example of extending Stripe plugin properties to extract and include custom metadata from Stripe objects like PaymentIntent and Charge. This is useful for enriching Kill Bill's additional data with Stripe-specific information. ```java public class CustomStripePluginProperties extends StripePluginProperties { public static Map toAdditionalDataMap(PaymentIntent intent, Charge charge) { Map data = StripePluginProperties.toAdditionalDataMap(intent, charge); data.put("custom_field", intent.getMetadata().get("custom_value")); return data; } } ``` -------------------------------- ### Catch API Key Configuration Errors Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/errors.md Demonstrates how to catch a PaymentPluginApiException and check if the error message indicates an API key issue. ```java try { stripePaymentPluginApi.authorizePayment(...); } catch (PaymentPluginApiException e) { if (e.getMessage().contains("API key")) { // Handle missing API key } } ``` -------------------------------- ### purchasePayment Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-payment-plugin-api.md Performs an immediate charge (authorize and capture in one step). Creates a PaymentIntent with `capture_method=automatic`. ```APIDOC ## purchasePayment ### Description Performs an immediate charge (authorize and capture in one step). Creates a PaymentIntent with `capture_method=automatic`. ### Method POST ### Endpoint /purchasePayment ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **kbAccountId** (UUID) - Yes - Kill Bill account identifier - **kbPaymentId** (UUID) - Yes - Kill Bill payment identifier - **kbTransactionId** (UUID) - Yes - Kill Bill transaction identifier - **kbPaymentMethodId** (UUID) - Yes - Kill Bill payment method identifier - **amount** (BigDecimal) - Yes - Payment amount - **currency** (Currency) - Yes - Payment currency - **properties** (Iterable) - Yes - Plugin properties - **context** (CallContext) - Yes - Call context ### Request Example ```json { "kbAccountId": "uuid", "kbPaymentId": "uuid", "kbTransactionId": "uuid", "kbPaymentMethodId": "uuid", "amount": 100.00, "currency": "USD", "properties": [], "context": {} } ``` ### Response #### Success Response (200) - **transactionInfo** (PaymentTransactionInfoPlugin) - Transaction information #### Response Example ```json { "transactionInfo": {} } ``` ### Error Handling - `PaymentPluginApiException` — If purchase fails ``` -------------------------------- ### Configuration Properties Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Reference for all configuration properties available for the Stripe plugin, including types and defaults. ```APIDOC ## Stripe Configuration Properties Reference for all configurable properties of the Stripe plugin. ### Description This section documents all properties available in `StripeConfigProperties.java`, including their types, default values, and environment variable support. ### Properties Detailed documentation for each property, including its type, whether it is required or optional, and its description, can be found in `configuration.md`. ### Defaults Default values for properties are identified in the source code and documented in `configuration.md`. ### Environment Variables Information on environment variable support for configuration properties is provided in `configuration.md`. ``` -------------------------------- ### Helper Classes and Utilities Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Documentation for utility classes and helper functions used within the Stripe plugin. ```APIDOC ## Helper Classes and Utilities Documentation for utility classes and helper functions within the Stripe plugin. ### Description This section provides details on the various helper classes and utility functions that support the plugin's operations. ### Classes and Methods Documentation for each helper class and its methods is available in `helper-classes.md`. ### Usage Information on how to use these utility classes and functions is included in `helper-classes.md`. ``` -------------------------------- ### Payment Method Addition Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Shows how to add a new payment method for a customer. ```Java PaymentMethod paymentMethod = paymentApi.addPaymentMethod(accountId, paymentMethodData, idempotencyKey); // ... payment method addition logic ... ``` -------------------------------- ### Handle Payment Plugin API Exceptions Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/README.md Demonstrates how to catch and handle PaymentPluginApiException in Java. It shows how to extract error type, message, and the underlying cause. ```java try { PaymentTransactionInfoPlugin transaction = api.purchasePayment(...); } catch (PaymentPluginApiException e) { // Handle payment error String errorType = e.getErrorType(); // USER, EXTERNAL, INTERNAL String message = e.getMessage(); Throwable cause = e.getCause(); } ``` -------------------------------- ### Checkout Servlet Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Documentation for the Stripe checkout servlet endpoint, which handles the checkout process integration. ```APIDOC ## Stripe Checkout Servlet Documentation for the Stripe checkout servlet, which facilitates the payment checkout process. ### Description This endpoint manages the user's interaction during the checkout flow, integrating with Stripe for payment processing. ### Method Details of specific HTTP methods (GET, POST, PUT, DELETE) and their corresponding endpoints are documented in `stripe-checkout-servlet.md`. ### Endpoint Specific endpoints are detailed in `stripe-checkout-servlet.md`. ### Parameters Parameters for the checkout servlet, including path, query, and request body parameters, are documented in `stripe-checkout-servlet.md`. ### Request Example Examples of request bodies for checkout operations are provided in `stripe-checkout-servlet.md`. ### Response Details on success and error responses, including status codes and response body structures, are available in `stripe-checkout-servlet.md`. ``` -------------------------------- ### getPaymentMethods Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-dao.md Retrieves all payment methods for a given Kill Bill account ID and tenant ID. ```APIDOC ## getPaymentMethods ### Description Retrieves all payment methods for an account. ### Method GET (Assumed based on operation) ### Endpoint /accounts/{kbAccountId}/paymentMethods (Assumed based on operation) ### Parameters #### Path Parameters - **kbAccountId** (UUID) - Yes - Kill Bill account ID - **kbTenantId** (UUID) - Yes - Kill Bill tenant ID ### Response #### Success Response (200) - **List** - All active payment methods for account ``` -------------------------------- ### Enabling Plugin Logging (XML) Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/errors.md Configure Kill Bill's logging to enable DEBUG level for the Stripe plugin and the Stripe Java library. ```xml ``` -------------------------------- ### Add Payment Method using a Stripe Token Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/README.md This command demonstrates how to add a payment method to Kill Bill by providing a Stripe token directly in the request parameters. This is useful if you have already tokenized a card. ```bash curl -v \ -X POST \ -u admin:password \ -H "X-Killbill-ApiKey: bob" \ -H "X-Killbill-ApiSecret: lazar" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "X-Killbill-CreatedBy: demo" \ -H "X-Killbill-Reason: demo" \ -H "X-Killbill-Comment: demo" \ -d "{ \"pluginName\": \"killbill-stripe\"}" \ "http://127.0.0.1:8080/1.0/kb/accounts//paymentMethods?pluginProperty=token=tok_XXX" ``` -------------------------------- ### StripeCheckoutServlet Constructor Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/helper-classes.md Constructor for the StripeCheckoutServlet, which handles HTTP requests for creating Stripe Checkout sessions. It requires instances of OSGIKillbillClock and StripePaymentPluginApi. ```java @Inject public StripeCheckoutServlet( final OSGIKillbillClock clock, final StripePaymentPluginApi stripePaymentPluginApi ) ``` -------------------------------- ### Upload Stripe Plugin Configuration via REST API Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/configuration.md Upload plugin configuration properties to Kill Bill using a POST request. Ensure to include necessary authentication headers and the configuration payload. ```bash curl -X POST \ 'http://localhost:8080/1.0/kb/tenants/uploadPluginConfig/killbill-stripe' \ -u admin:password \ -H 'X-Killbill-ApiKey: bob' \ -H 'X-Killbill-ApiSecret: lazar' \ -H 'X-Killbill-CreatedBy: admin' \ -H 'Content-Type: text/plain' \ -d 'org.killbill.billing.plugin.stripe.apiKey=sk_test_XXX org.killbill.billing.plugin.stripe.publicKey=pk_test_YYY org.killbill.billing.plugin.stripe.chargeDescription=My Charges org.killbill.billing.plugin.stripe.chargeStatementDescriptor=MyBiz' ``` -------------------------------- ### Add Payment Method using a Stripe Source Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/README.md This command shows how to add a payment method to Kill Bill using a Stripe source ID. This is an alternative to using tokens for adding payment methods. ```bash curl -v \ -X POST \ -u admin:password \ -H "X-Killbill-ApiKey: bob" \ -H "X-Killbill-ApiSecret: lazar" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -H "X-Killbill-CreatedBy: demo" \ -H "X-Killbill-Reason: demo" \ -H "X-Killbill-Comment: demo" \ -d "{ \"pluginName\": \"killbill-stripe\"}" \ "http://127.0.0.1:8080/1.0/kb/accounts//paymentMethods?pluginProperty=source=src_XXX" ``` -------------------------------- ### StripePaymentMethodInfoPlugin Constructor Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/types.md Represents minimal payment method information specific to Stripe. It extends the base PluginPaymentMethodInfoPlugin class. ```java public class StripePaymentMethodInfoPlugin extends PluginPaymentMethodInfoPlugin { // Constructor public StripePaymentMethodInfoPlugin( final UUID accountId, final UUID paymentMethodId, final boolean isDefault, final String externalPaymentMethodId ) } ``` -------------------------------- ### StripePaymentMethodPlugin Build Method Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/types.md A static factory method to construct a StripePaymentMethodPlugin instance from a StripePaymentMethodsRecord. This is used to create payment method objects from stored database records. ```java public static StripePaymentMethodPlugin build(final StripePaymentMethodsRecord record) // Builds from database record ``` -------------------------------- ### Upload Stripe Plugin Configuration via cURL Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/README.md Uploads plugin configuration, including the Stripe API key, to Kill Bill using a cURL command. Ensure correct authentication and content type. ```bash curl -v \ -X POST \ -u admin:password \ -H 'X-Killbill-ApiKey: bob' \ -H 'X-Killbill-ApiSecret: lazar' \ -H 'X-Killbill-CreatedBy: admin' \ -H 'Content-Type: text/plain' \ -d 'org.killbill.billing.plugin.stripe.apiKey=sk_test_XXX org.killbill.billing.plugin.stripe.chargeDescription=YYY org.killbill.billing.plugin.stripe.chargeStatementDescriptor=ZZZ' \ http://127.0.0.1:8080/1.0/kb/tenants/uploadPluginConfig/killbill-stripe ``` -------------------------------- ### toRequestOptions() Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-config-properties.md Converts the current configuration properties into Stripe RequestOptions, suitable for use in Stripe API calls. ```APIDOC ## toRequestOptions() ### Description Converts configuration to Stripe RequestOptions for API calls. ### Returns `RequestOptions` — Stripe API request options configured with API key, timeouts, and proxy settings ### Example ```java RequestOptions requestOptions = configProperties.toRequestOptions(); PaymentIntent intent = PaymentIntent.retrieve(intentId, requestOptions); ``` ``` -------------------------------- ### Stripe Checkout Flow Steps Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/overview.md Illustrates the sequence of API calls and user interactions for the Stripe Checkout flow. ```text 1. Create Session POST /plugins/killbill-stripe/checkout?kbAccountId=XXX ↓ 2. Get Session Details Response: { sessionId: "cs_test_XXX", clientSecret: "..." } ↓ 3. Redirect to Stripe stripe.redirectToCheckout({ sessionId: "cs_test_XXX" }) ↓ 4. User Enters Payment Details (Customer input in Stripe-hosted form) ↓ 5. Redirect Back Return to successUrl with sessionId parameter ↓ 6. Add Payment Method POST /1.0/kb/accounts/XXX/paymentMethods With pluginProperty: sessionId=cs_test_XXX ↓ 7. Payment Method Stored Ready for charging ``` -------------------------------- ### StripePaymentTransactionInfoPlugin Build Method Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/types.md A static factory method to construct a StripePaymentTransactionInfoPlugin instance from a StripeResponsesRecord. This is used to populate transaction details from database records. ```java public static StripePaymentTransactionInfoPlugin build(final StripeResponsesRecord record) // Builds transaction info from database record ``` -------------------------------- ### Purchase Payment Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/api-reference/stripe-payment-plugin-api.md Performs an immediate charge (authorize and capture in one step). Creates a PaymentIntent with capture_method=automatic. ```java @Override public PaymentTransactionInfoPlugin purchasePayment( final UUID kbAccountId, final UUID kbPaymentId, final UUID kbTransactionId, final UUID kbPaymentMethodId, final BigDecimal amount, final Currency currency, final Iterable properties, final CallContext context ) throws PaymentPluginApiException ``` -------------------------------- ### Add Payment Method via Stripe Checkout Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/README.md Initiates a Stripe Checkout session and then adds the payment method to Kill Bill using the returned session ID. Recommended for most use cases. ```bash POST /plugins/killbill-stripe/checkout?kbAccountId=550e8400-e29b-41d4-a716-446655440000 # Get sessionId, redirect user to Stripe, then: POST /1.0/kb/accounts/550e8400-e29b-41d4-a716-446655440000/paymentMethods ?pluginProperty=sessionId=cs_test_XXX # Payment method now stored ``` -------------------------------- ### Proxy Configuration Source: https://github.com/killbill/killbill-stripe-plugin/blob/master/_autodocs/COMPLETION_SUMMARY.txt Configures the plugin to use a proxy for external API calls. ```Properties stripe.http.proxy.host=proxy.example.com stripe.http.proxy.port=8080 stripe.http.proxy.username=user stripe.http.proxy.password=password ```