內容簡介
Minimal Stripe Wrapper (MSW) 是一款輕量且安全的 WordPress 外掛,旨在簡化 Stripe 付款流程,提供最小的設置與最大的靈活性。與複雜的付款外掛不同,MSW 利用 Stripe Checkout 確保最高安全性,同時保持網站的付款工作流程簡單高效。
【主要功能】
• 支援 Stripe-hosted Checkout 的單次付款
• 不會在本地儲存卡片或付款資訊
• 可使用 Stripe 測試模式進行沙盒測試
• 自動加收手續費以覆蓋 Stripe 交易費用
• 適用於已登入或未登入的使用者
• 提供可變金額的捐款表單短碼
外掛標籤
開發者團隊
原文外掛簡介
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 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)
Includes a shortcode Donate Form with variable amount.
Downloadable transactions history in the WP dashboard for tracking and cross-referencing transactions.
Security
Uses Stripe-hosted forms. No card data touches your server.
Rate-limiting for extra protection.
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 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 and the Stripe Privacy Policy
How it Works
You can initiate a Stripe payment with any of these methods:
The Gutenberg block element ‘Minimal Stripe Button’
By using any clickable element of your choice (eg. a
Method 1: A Gutenberg block element
Add to your page using the WordPress block editor.
Method 2: Use an existing clickable element
Add a css class to any clickable target element.
eg. Use the page builder of your choice (eg. A Divi Button).
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' ] = [email protected]; // 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 3: Using a shortcode-generated button
This method requires no php code. You can however, optionally add a php hook (as above) to modify the Stripe parameters and to perform extra actions on the Stripe webhook callback.
Example shortcode:
[mswr_stripe_button amount="1234" currency="usd" email="[email protected]" product="Sample Product" quantity="2" success_url="/payment_success" cancelled_url="/payment_cancelled"]
Method 4: WP hook
A developer method.
Use PHP from your code 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' ];
add_action( 'mswr_initiate_stripe_payment', $args );
…
Hooks available in Minimal Stripe Wrapper
1. mswr_initiate_stripe_payment
2. mswr_pre_stripe_checkout
3. mswr_{\$type}
4. mswr_shortcode_html
Method 5: Donate Form
Shortcode generated Donate Form where the user can select the amount to pay.
See the Plugin Documentation for a full description
