A dummy payment gateway for your WooCommerce development needs, with built-in support for subscriptions and the block-based checkout.
To build this project, run:
nvm use
npm install
npm run packages-update
npm run build
A Dummy Payments gateway for your WooCommerce website.
I have tried the plugin but it seems block support is not working.
Steps:
-I installed the plugin
-I installed woo blocks plugin.
then I add checkout block with Gutenberg but it says extension is not compatible with woo checkout based block.
Following steps shown in https://developer.woocommerce.com/2022/07/07/exposing-payment-options-in-the-checkout-block/
Using woocommerce-gateway-dummy v1.0.5 and running npm install
results in multiple WARN: deprecated
messages and reports 20 known vulnerabilities.
npm audit fix
does not resolve all issues.
npm audit fix --force
and then npm run build
results in an error.
In wp-admin while editing the checkout page the Dummy Gateway is reported as incompatible with block-based checkout
Updating package.json file devDependencies to latest versions as below and then running npm install
and npm run build
fixes error with two warnings remaining. Dummy Gateway displays as expected in checkout page WooCommerce Checkout block.
"devDependencies": {
"@woocommerce/dependency-extraction-webpack-plugin": "^2.2.0",
"@wordpress/scripts": "^26.10.0",
"cross-env": "7.0.3"
}
I'm seeing the following in the PHP error log:
[16-Nov-2022 12:12:55 UTC] Payment gateway with handle 'wc-dummy-payments-blocks' has been deactivated in Cart and Checkout blocks because its dependency 'wc-blocks-registry' is not registered. Read the docs about registering assets for payment methods: https://github.com/woocommerce/woocommerce-blocks/blob/060f63c04f0f34f645200b5d4da9212125c49177/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md#registering-assets
Hello
import { useCart } from '@woocommerce/blocks-checkout';
Can you give an example or least document how to get the cart (eg cart totals, as the above one fails
The process_subscription_payment()
method throws an exception when a payment fails, instead it should call $order->update_status( 'failed' );
to allow subscriptions to action the failure correctly.
Subscriptions hooks in to the woocommerce_order_status_changed
action to record whether a payment is successful or fails. This hook is used to trigger various flows, including the retrying of payments.
PR incoming.
Hello.
Is there anyhow an example to show how receipt_page() is working on a blocks payment gateway? Some payment gateways require a form to be submited upon checkout and not using process_payment direct.
I noticed that the plugin is not showing up in the WooCommerce checkout blocks.
This is with and without the WooCommerce Blocks plugin enabled.
WooCommerce version 7.0
WP version 6.0.2
When the gateway is enabled I see it as an option in the checkout shortcode, but not in the checkout block.
Hi, I cloned the plugin and activated it, but the dummy payment option is still not visible as a checkout option in the block view. It is really hard to debug why our payment plugin is not working, that's why I tried this dummy gateway. Also, it looks like from the fronted console logs, that block.js does not exist. I tried to change the script path to index.js.
Also, the payment option is visible in the page editor for some reason. I don't know why its not on the checkout page.
Just tried to upload 1.0.8 to a live test site and got the incompatible archive error.
Hi, I am sorry for bothering again.
I have third party plugin ( a payment gateway).
Well I added the Block support for checkout, it is compatible but I have a payment form which being generated fine with short code based checkout but in checkout block it just takes the plugin title and checkbox for future save but not showing my form
I am going to attach JS, Can you please have a look into it, that would be great as it is very important and urgent for me.
Thanks
When Dummy Payments is installed in a new site, ensure that payments are successfully processed unless otherwise defined in the plugin settings.
Right now, payments fail until merchants click to save the plugin settings.
I've been trying to implement block-based checkout on a payment gateway which I mantain and I couldn't help noticing that even on this gateway, the getSetting function always returns false and the Payment Gateway ends up showing only because it has a fallback label defined.
As shown on #34 , the user defines the gateway name but the default keeps being used.
Also, window.wc.wcSettings.getSetting('dummy_data') always returns false on the frontend.
Is this an expected behaviour? Or am I missing something?
@wordpress/scripts
requires node 18+. npm run packages-update
produces the following
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@wordpress/[email protected]',
npm WARN EBADENGINE required: { node: '>=18', npm: '>=6.14.4' },
npm WARN EBADENGINE current: { node: 'v16.19.1', npm: '8.19.3' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@wordpress/[email protected]',
npm WARN EBADENGINE required: { node: '>=18' },
npm WARN EBADENGINE current: { node: 'v16.19.1', npm: '8.19.3' }
npm WARN EBADENGINE }
.nvmrc
is Node 16.
I've used this module and implement some modifications like following this url https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/internal-developers/block-client-apis/checkout/checkout-api.md#usepaymentmethodinterface
{ "shipping_address": {}, "billing_address": {}, "customer_note": "", "create_account": false, "payment_method": "bacs", "payment_data": [ { "key": "myGatewayCustomData", "value": "12345" } ], "extensions": {} }
So, how can I access the payment_data, like myGatewayCustomData on process_payment function in that $order variable?
The Gruntfile.js
and package.json
are filled with commands that are not required for Dummy Payments, but instead where copied over from some other plugins. This is a good chance to clean them up.
When installing Dummy Gateway to a site, then it should be enabled by default. Dummy Gateway indeed shows up for the legacy checkout, but it doesn't show up on the block-based checkout. To make it show up there, it is necessary to first go to WooCommerce > Settings > Payments and click on the Save Changes button for this gateway.
The reason why this happens is that the gateway checks the woocommerce_dummy_settings
option in the database to decide if it is active or not for the block-based checkout. This option is not created automatically when the plugin is activated, but instead it is created only after the gateway settings are manually saved.
We need to find a way to create this option when the plugin is first activated.
I get this error when I do wp-scripts build
[webpack-cli] Failed to load '/Applications/MAMP/htdocs/wordpress/wp-content/plugins/woocommerce-gateway-dummy/webpack.config.js' config
[webpack-cli] Error: Cannot find module '../assets/packages'
Any idea how to fix this?
The Pre-orders extension requires gateways to include support for the pre-orders
feature in order for a gateway to be available for pay upon release orders using gateways that support tokenization.
As the dummy gateway doesn't include support for the feature, it's not possible to use it while testing tokenized pre-orders.
Adding it is a pretty simple fix by adding the feature within the WC_Gateway_Dummy
constructor.
how to create a custom stripe form Through this I am using a custom stripe gateway and I have implemented paymentfields() to render my own stripe form
payment field() is not getting called in block checkout
What is the best way to implement the previous function "payment_fields()" to capture the card data in our own form?
Logs:
Deprecated: Creation of dynamic property WC_Gateway_Dummy::$instructions is deprecated in /var/www/html/wp-content/plugins/woocommerce-gateway-dummy/includes/class-wc-gateway-dummy.php on line 52
Deprecated: Creation of dynamic property WC_Gateway_Dummy::$hide_for_non_admin_users is deprecated in /var/www/html/wp-content/plugins/woocommerce-gateway-dummy/includes/class-wc-gateway-dummy.php on line 53
Add admin option to allow users simulate failed payments using the Dummy Gateway.
At the moment, Dummy Payments is not compatible with the new checkout blocks and it doesn't show up in the checkout when these blocks are used. We can integrate Dummy Payments with the new checkout blocks by following this guide: https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/extensibility/payment-method-integration.md
It would be really nice to be able to test the dummy gateway on a production site without it affecting normal customers. One way to do that would be to add an option to "only show gateway at checkout if logged in and an admin."
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.