WP Manifestindependent plugin directory
manifest / ecommerce / thawani-pay-woocommerce

Thawani Pay v2 WP Registry grade B. Medium-severity findings · 2 findingsWP RegistryMedium-severity findings · 2 findingsOpen the reportB

Accepts payments with the Thawani Pay v2 Gateway for WooCommerce

★ 16stars
203release downloads
≈20active sites
v1.3.2latest · 5 years ago

Install

Download thawani-pay-v1.3.2.zip From the v1.3.2 release on GitHub, Aug 11, 2021

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/malnafei/thawani-pay-woocommerce/releases/download/v1.3.2/thawani-pay-v1.3.2.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Thawani Pay v2 for WooCommerce

Accepts payments with the Thawani Pay v2 Gateway for WooCommerce

This is the unofficial Thawani Pay v2 payment gateway plugin for WooCommerce. Allows you to accept credit cards, debit cards payments with the WooCommerce plugin. It uses a seamless integration, allowing the customer to pay on your website quickly. Thawani Checkout API Documentation: Thawani API Documentation

Note: Thawani Pay is currently available for businesses with account in Thawani company.

For detailed information and signup please visit: Thawani Pay

Requirements

  • Requires at least: woocommerce >= 4.0.0, WordPress >= 4.0.0
  • Tested up to: 5.6.2
  • Requires PHP >= 5.6
  • WC requires at least: 4.0.0
  • WC tested up to: 5.0.0

Features

  • Compatible with Thawani Pay version 2
  • Easy configuration in WooCommerce - only API secret key and Publishable key need to be copied from Thawani Merchant Portal
  • Easy customization - payment method title, description, environment: UAT/Production, cancel url, success url, client reference id Prefix and more can be changed easily
  • Compatible with UAT and production API.
  • Developer logs feature: receive new emails when something happens with the payment API
  • WC tested up to 5.0.0

To-Do

  • [x] Support UAT api
  • [x] Support PRODUCTION api
  • [x] Create new payment
  • [x] Success and Cancel callbacks
  • [ ] Payment card tokenization - Saved cards
  • [ ] Refund - intgrate Thawani refund API with woocomerce refund feature
  • [ ] Transaction details - View payment transaction details on order edit.
  • [ ] Woocommerce tax
  • [ ] Webhook

Screenshots

Screen Shot 2021-03-10 at 11 18 05 AM

Installation

  1. Upload thawani-pay-woocommerce folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Go to WooCommerce - Settings - Payments - Thawani Pay - setup
  4. Thawani payment gateway will be available in "Checkout" page.

Test with UAT

You can test if the payment works correctly by enableing the UAT mode Screen Shot 2021-03-10 at 11 36 51 AM

UAT Secret Key: rRQ26GcsZzoEhbrP2HZvLYDbn9C9et

UAT Publishable Key: HGvTMLDssJghr9tlN9gr4DVYt0qyBy

You can use the test cards provided by Thawani Team:

Success Card

Decline Card

Changelog

1.2.0

  • Arabic products supported now.

1.1.0

  • fix product name must be a string with a maximum length of 40 issue.
  • Add billing phone to request metadata.

1.0.0

  • first public version

License

gpl-3.0 License

Contributing

All feedback/bug reports/pull requests are welcome.

Releases

7 releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.3.2 latest
Aug 11, 2021 5 years ago
thawani-pay-v1.3.2.zip
92
Jul 27, 2021 5 years ago
thawani-pay-v1.3.1.zip
10
v
Jul 27, 2021 5 years ago
tag only
—
Jul 27, 2021 5 years ago
thawani-pay-v1.3.0.zip
29
May 3, 2021 5 years ago
thawani-pay-v1.2.0.zip
23
Mar 25, 2021 5 years ago
Thawani.Pay.v2.-.v1.1.zip
22
Mar 10, 2021 5 years ago
thawani-pay-woocommerce.zip
27

Active-site estimate ≈20 comes from the median of recent superseded releases. Method.

B grade

Security

Thawani Pay v2 1.3.2 · audited by WP Registry

Medium-severity findings.

2 medium
Audited release
1.3.2
Findings
2
Worst severity
medium
Content hash
2178db9b839c9fdb865a0172…

Findings

  • medium Unauthenticated init return updates orders without an order key or status guard

    missing_auth

    woocommerce_process_thawani_payment is hooked to init with no capability, nonce, or WooCommerce order_key check. Any front-end request that includes GET mode, oid, and status (status is required to be present then ignored) loads session_id from that order's post meta, authenticates to Thawani with the merchant secret, and mutates the order: payment_status=paid calls $order->payment_complete() and WC()->cart->empty_cart(); payment_status=unpaid calls add_order_note('The Thawani transaction has been declined.'). Order IDs are sequential. The handler does not verify the order is still pending/on-hold, that the payment method is thawani, or that client_reference_id/amount in the Thawani payload match the WooCommerce order. It cannot mark an unpaid Thawani session as paid (the API is consulted), but an unauthenticated caller or CSRF GET can still append decline notes on other customers' unpaid Thawani orders, replay payment_complete on a cancelled-but-paid order (WooCommerce core includes cancelled in woocommerce_valid_order_statuses_for_payment_complete), and wipe the current visitor's cart. process_payment mints the return URL as get_permalink(success_url)?mode=&oid=&status= with no secret.

    thawani-pay-woocommerce.php:387-467

    Recommendation

    Handle returns on a dedicated wc-api/webhook endpoint, not generic init. Require the WooCommerce order_key (or a signed token minted at process_payment) and refuse unless the order is pending/on-hold and payment_method is thawani. Compare Thawani client_reference_id and amount to the order. Do not add_order_note or empty_cart on unauthenticated GET. Prefer a server-to-server Thawani webhook over a guessable browser return.

  • medium Unauthenticated payment callback emails the merchant and hangs on Thawani with no timeout

    dos

    The same init handler, when secret_key is empty, curl fails, or Thawani returns a non-2000 body, calls wc_mail() to admin_email or the developer_log setting with subject '[ERROR] Thawani Pay - Order #' plus attacker-controlled oid and a body that concatenates the raw API response. There is no capability, nonce, rate limit, or check that oid is a real thawani order before sending. CURLOPT_TIMEOUT is 0 and CURLOPT_FOLLOWLOCATION is true, so each unauthenticated hit also performs a merchant-authenticated GET to checkout.thawani.om/api/v1/checkout/session/{session_id} that can block a PHP worker indefinitely if the remote side stalls. Observable: curl 'https://site/?mode=1&oid=1&status=x' in a loop fills the merchant inbox and burns Thawani API quota/PHP workers. $order is not validated before the curl/mail path.

    thawani-pay-woocommerce.php:410-475

    Recommendation

    Do not send mail from an unauthenticated GET. Log to WooCommerce logs instead, rate-limit, and require a valid thawani order plus order_key before calling Thawani. Set a finite CURLOPT_TIMEOUT (and CURLOPT_SSL_VERIFYPEER true), disable FOLLOWLOCATION, and skip the API call when session_id or wc_get_order() is empty.

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.