=== Minimal Stripe Wrapper === Contributors: jerrystewart99 Tags: stripe, membership, credit card, payment, donation Tested up to: 6.7 Stable tag: 1.1.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Minimal Stripe Wrapper (MSW) – Simple, Secure, and Lightweight Stripe Integration for WordPress == Description == Minimal Stripe Wrapper (MSW) is a lightweight and secure WordPress plugin designed to streamline Stripe payments with minimal setup and maximum flexibility. Unlike complex, feature-heavy payment plugins, MSW provides a low-footprint solution that leverages Stripe Checkout, ensuring the highest level of security while keeping your site’s payment workflow simple and efficient. Please visit the full [Plugin Documentation](https://plugins.webworkz.nz) page. = Features = * Single payments via Stripe-hosted Checkout * No card or payment information are stored locally. * Can use Stripe Test mode for sandbox testing. * Can automatically add a surcharge to cover the Stripe transaction fee. * Will work with either logged in users (eg. a membership site) or not logged in users (eg. a donation) * Transactions history in the Dashboard for tracking and cross-referencing transactions with Stripe = Security = * Uses Stripe-hosted forms. No card data touches your server. * Stripe secret keys are stored encrypted. * Uses the Wordpress REST API with corresponding validation checks in addition to Stripe validation. == External services == This plugin connects to a the Stripe API in order to initiate a Stripe Checkout session and to receive a Webhook response. You may specify what information is supplied to Stripe. The minimum information you must supply is the payment amount. You may optionally include a Users email, product name and quantity. Where an email is not supplied, Stripe will require the user to enter an email. See also the [Stripe Consumer Terms of Service](https://stripe.com/legal/consumer) and the [Stripe Privacy Policy](https://stripe.com/privacy) == How it Works == You can initiate a Stripe payment with any of these 3 methods: 1. By using any clickable element of your choice (eg. a or ) 2. By using a shortcode-generated button provided by this plugin. 3. By using an action hook. = Method 1: Use a custom button = Suitable for Gutenberg or the page builder of your choice (eg. A Divi Button). Simply add the following css class to your element so that it can initiate a Stripe transaction. `class="mswr-stripe-payment"` Then add a filter hook to enter/modify your specific payment details. For example: `add_filter( 'mswr_pre_stripe_checkout', function( \$args ) {` `` ` // add payment details` ` \$args[ 'amount' ] = \$amount; // use the smallest unit of your currency. ie. \$123.45 => '12345'` ` \$args[ 'currency' ] = 'nzd'; // iso 4217 currency code` ` \$args[ 'email' ] = abc@test.com; // eg. wp_get_current_user()->user_email;` ` \$args[ 'product' ] = 'Your Product/Service name';` // will appear on the Stripe Checkput page ` \$args[ 'user_meta' ] = 'Membership Renewal';` // user-defined tag that can help identify a transaction in the Stripe webhook callback `` ` return \$args;` `});` = Method 2: Using a shortcode button = This method requires no php code. You can however, optionally add php hooks to modify the Stripe parameters and to perform actions on Stripe webhook callback. Example shortcode: `[mswr_stripe_button amount="1234" currency="usd" email="abc@test.com" product="Sample Product" quantity="2" success_url="/payment_success" cancelled_url="/payment_cancelled"]` = Method 3: Action hook = Use PHP from your back end to fire a Wordpress 'action' which initiates a Stripe Checkout session with the specified Stripe arguments Action hook: `mswr_initiate_stripe_payment` Example: `\$args = [ 'amount' => '12345' ];` `do_action( 'mswr_initiate_stripe_payment', \$args );` ... == Hooks available in Minimum Stripe Wrapper == `1. mswr_initiate_stripe_payment` `2. mswr_pre_stripe_checkout` `3. mswr_{\$type}` `4. mswr_shortcode_html` .. `1. mswr_initiate_stripe_payment` Description Action hook (Method 3) Initiate a Stripe Checkout. You provide the Stripe arguments here and/or in the `'mswr_pre_stripe_checkout'` filter. Example: `do_action( 'mswr_initiate_stripe_payment', [ 'amount' => '12345' ] ); // add other arguments as required` ---- `2. mswr_pre_stripe_checkout` Description Filter hook fired after 'initiate' and before invoking the Stripe API. Provided for you to add parameters that are sent to Stripe Checkout Example: `add_filter( 'mswr_pre_stripe_checkout', 'function_to_add_your_stripe_arguments' );` ---- `3. mswr_{\$type}` Description Action hook Stripe webhook callback `\$type` will be the name of the webhook event you set up in your Stripe dashboard Example: If you set up Stripe to send webhook notifications for `payment_intent.succeeded`, you would handle that with: `add_action( "mswr_payment_intent_succeeded", 'your_webhook_handler' );` ---- `4. mswr_shortcode_html` Description Filter hook Provides the ability to customise the html provided by the shortcode. == Installation == Minimal Stripe Wrapper just as you would any other WP Plugin: 1. [Download Minimal Stripe Wrapper](https://wordpress.org/plugins/minimal-stripe-wrapper "Minimal Stripe Wrapper") from WordPress.org. 2. Unzip the .zip file. 3. Upload the Plugin folder (minimal-stripe-wrapper/) to the wp-content/plugins folder. 4. Go to [Plugins Admin Panel](https://codex.wordpress.org/Administration_Panels#Plugins "Plugins Admin Panel") and find the newly uploaded Plugin, "Minimal Stripe Wrapper" in the list. 5. Click Activate Plugin to activate it. == Frequently Asked Questions == = How do I use this plugin? = * Install and activate * Setup the pluing settings page * Choose your scenario and implement it as described * See also the [Plugin Documentation](https://plugins.webworkz.nz) = How to uninstall the plugin? = Simply deactivate and delete the plugin. It will clean up nicely and leave no trace. * WARNING Deleting the plugin will also delete your Stripe keys and all data associated with this plugin. == Screenshots == 1. Minimal Stripe Wrapper : Options page 2. Example of a Button to invoke Minimal Stripe Wrapper 3. Example of the Stripe Checkout page 4. Transaction Log Admin Page == Changelog == = 1.1.2 = bugfix: mswr_initiate_stripe_payment is now a filter not an action in order to return the checkout URL = 1.1.1 = small fix to readme.txt = 1.1.0 = add transactions log and system log pages to dashboard = 1.0 = Inital Release == Upgrade Notice == .