GithubHelp home page GithubHelp logo

woocommerce-gateway-dummy's Introduction

WooCommerce Dummy Payments Gateway

A dummy payment gateway for your WooCommerce development needs, with built-in support for subscriptions and the block-based checkout.

Building instructions

To build this project, run:

nvm use
npm install
npm run packages-update
npm run build

woocommerce-gateway-dummy's People

Contributors

brianhenryie avatar jimjasson avatar manospsyx avatar ndeet avatar nickgreen avatar panossynetos avatar peterwilsoncc avatar rogyw avatar senadir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

woocommerce-gateway-dummy's Issues

Blocks Support not working

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.

Dev Dependencies need updating to build successfully

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"
}

Notice in PHP error log

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

Get cart totals on JS

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

Failed renewal orders ought to update the order status to `failed`.

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.

Example with receipt_page

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.

Checkout block support?

When the gateway is enabled I see it as an option in the checkout shortcode, but not in the checkout block.

Not working with latest woocommerce 8.8.2.

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.

Incompatible archive

Just tried to upload 1.0.8 to a live test site and got the incompatible archive error.

Third Party Payment Gateway

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

Screenshot from 2023-09-15 11-39-14

blocks-js.txt
php.txt

Default payment processing to "success" in new sites

Description

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.

Steps to replicate

  1. Install Dummy Payments in a freshly created site.
  2. Try to pay for an order with Dummy Payments.

getSettings doesn't work

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?

Update node/npm engines

@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.

How to access payment_data on process_payment function

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?

Clean up building process

Description

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.

Dummy Gateway is hidden in the block checkout until gateway settings are manually saved

Description

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.

Unable to build Wordpress 6.5.2 and Woocommerce 8.8.2

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?

Add `pre-orders` support to gateway.

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.

payment field() not getting called

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

payment_fields() in the block

What is the best way to implement the previous function "payment_fields()" to capture the card data in our own form?

Add support for PHP 8.3+

Description

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

Feature request: Only show if admin option

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."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.