GithubHelp home page GithubHelp logo

k1sul1 / woocommerce-installment-gateway Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 20 KB

Generic installment gateway, "designed" to be pluggable

License: GNU General Public License v2.0

PHP 100.00%

woocommerce-installment-gateway's Introduction

Installment payment gateway for WooCommerce

If you're not code savvy, you might want to steer clear of this plugin, unless the defaults work for you.

This plugin is useful for stores that want to utilize a part time payment provider that doen't have an official gateway.

Out of the box, every single order will complete ~instantly, but there's a lot of hooks buried in the 400ish lines of code that this plugin has.

If you want or need to check each order manually before marking it as processing, uncheck "Use direct payment?" on the plugin settings page (/wp-admin/admin.php?page=wc-settings&tab=checkout&section=installments) and add this code to your location of choice.

add_action("plugins_loaded", function() {
  /* Disable default payment callback action */
  remove_action("woocommerce_api_callback", "k1sul1_wcigw_callback_handler");
  remove_action("k1sul1-wcigw-callback", "k1sul1_wcigw_demo_callback");
}, 11);

Payment options are configured on the same options page. Don't be intimidated by the syntax.

60 : ((%total% + 70) * 1.079 / 60) + 7 : Pay in 60 months, %installment% / month.

First, there's the the part amount, how many parts will the order be paid in?

Second, there's the formula, it's up to you how you want it. The formula here takes the total order amount, and adds 70 to it, as a one time fee. The interest rate is 7.9%, so the sum is multiplied with 1.079, and then divided with 60. Each installment will cost an additional 7($), so it's added to the final sum that is displayed to the customer.

Third, there's the text that's displayed to the customer inside the payment option. %installment% contains the result of your formula.

Using this formula, if you were to buy a cat with 600$ + 5$ of shipping fees, you would pay 19.14$ / month.

Other fields on the settings page control the text displayd on the payment form.

Contributing

Yes please!

Licence

GPL-2.0

woocommerce-installment-gateway's People

Contributors

k1sul1 avatar

Stargazers

 avatar The Perfect Will avatar Luke Cavanagh avatar

Watchers

James Cloos avatar

Forkers

theperfectwill

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.