Plugin Directory

Changeset 2918720


Ignore:
Timestamp:
05/29/2023 08:14:38 PM (3 years ago)
Author:
payformeuser
Message:

Deploy v2.0.5

Location:
payforme
Files:
2 added
2 deleted
4 edited
5 copied

Legend:

Unmodified
Added
Removed
  • payforme/tags/2.0.5/README.txt

    r2917635 r2918720  
    11=== PayForMe for Woocommerce ===
    22Contributors: payformeuser
    3 Tags: payforme, pay for me, payment, checkout, woocommerce, ecommerce, e-commerce, commerce, payment gateway, other pays, someone else pays, third party payments
     3Tags: payforme, pay for me, payment, checkout, stripe, woocommerce, ecommerce, e-commerce, commerce, payment gateway, other pays, someone else pays, third party payments
    44Requires at least: 5.0
    5 Tested up to: 6.2
    6 Stable tag: 2.0.4
     5Tested up to: 6.2.2
     6Stable tag: 2.0.5
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7676== Changelog ==
    7777
     78= 2.0.5 =
     79* Add - Support for custom store fees.
     80* Fix - Minor UI improvements.
     81
    7882= 2.0.4 =
    7983* Add - Rebranded logo
  • payforme/tags/2.0.5/build/asset-manifest.json

    r2917635 r2918720  
    22  "files": {
    33    "main.css": "/static/css/main.dda31fb0.css",
    4     "main.js": "/static/js/main.c9510b7e.js",
     4    "main.js": "/static/js/main.8e87d2a3.js",
    55    "static/js/787.bc7d429a.chunk.js": "/static/js/787.bc7d429a.chunk.js",
    66    "index.html": "/index.html",
    77    "main.dda31fb0.css.map": "/static/css/main.dda31fb0.css.map",
    8     "main.c9510b7e.js.map": "/static/js/main.c9510b7e.js.map",
     8    "main.8e87d2a3.js.map": "/static/js/main.8e87d2a3.js.map",
    99    "787.bc7d429a.chunk.js.map": "/static/js/787.bc7d429a.chunk.js.map"
    1010  },
    1111  "entrypoints": [
    1212    "static/css/main.dda31fb0.css",
    13     "static/js/main.c9510b7e.js"
     13    "static/js/main.8e87d2a3.js"
    1414  ]
    1515}
  • payforme/tags/2.0.5/changelog.txt

    r2917635 r2918720  
    11*** PayForMe for Woocommerce Changelog ***
     2
     32023-05-29 - version 2.0.5
     4* Add - Support for custom store fees.
     5* Fix - Minor UI improvements.
    26
    372023-05-26 - version 2.0.4
  • payforme/tags/2.0.5/payforme-woocommerce.php

    r2917635 r2918720  
    77 * Plugin URI:  https://wordpress.org/plugins/payforme/
    88 * Description: PayForMe enables people to pay for the purchases of their friends and families via a secure payment link. Accept Credit/Debit cards, ApplePay and GooglePay using PayForMe.
    9  * Version:     2.0.4
     9 * Version:     2.0.5
    1010 * Author:      PayForMe
    1111 * Author URI:  https://payforme.io/
    1212 * License:     GPL-2.0
    1313 * Requires at least:    5.0
    14  * Tested up to:         6.2
     14 * Tested up to:         6.2.2
    1515 * WC requires at least: 4.7
    1616 * WC tested up to:      7.6.1
     
    196196        $cart_data->totals = $cart->get_totals();
    197197        $cart_data->line_items = payforme_get_cart_items($currency);
     198        $cart_data->line_fees = payforme_get_cart_fees($currency);
    198199        $cart_data->coupons = payforme_get_cart_coupons($cart);
    199200        $cart_data->shipping_rates = payforme_get_chosen_shipping_rates();
     
    308309
    309310    /**
    310      * Gets the cart the cart items
     311     * @param WC_Tax_Rate[] woo tax rates
     312     * @returns taxrates format expected by payforme server
     313     */
     314    function wc_taxrates_to_payforme_taxrates($tax_rates) {
     315        $pfm_tax_rates = [];
     316        foreach ($tax_rates as $key => $rate) {
     317            $_rate_item = [
     318                'id' => $key,
     319                'label' => $rate['label'],
     320                'percent' => $rate['rate'],
     321            ];
     322            array_push($pfm_tax_rates, $_rate_item);
     323        }
     324
     325        return $pfm_tax_rates;
     326    }
     327
     328    /**
     329     * Gets the cart items
    311330     * @return array of cart items
    312331     */
     
    320339            $product_id = $item['product_id'];
    321340            $product = wc_get_product($variation_id  ? $variation_id : $product_id);
    322             $taxes = $wc_tax->get_rates($product->get_tax_class());
     341            $tax_rates = $wc_tax->get_rates($product->get_tax_class());
    323342
    324343            $image_id = $product->get_image_id();
     
    326345            $image_url = reset($image_url_srcs);
    327346            $image_urls = ($image_url) ? [$image_url] : [];
    328 
    329             $_tax_rates = [];
    330             foreach ($taxes as $key => $rate) {
    331                 $_rate_item = [
    332                     'id' => $key,
    333                     'label' => $rate['label'],
    334                     'percent' => $rate['rate'],
    335                 ];
    336                 array_push($_tax_rates, $_rate_item);
    337             }
    338347
    339348            $item = [
     
    345354                'line_tax' => $item['line_tax'],
    346355                'quantity' => $item['quantity'],
    347                 'tax_rates' => $_tax_rates,
     356                'tax_rates' => wc_taxrates_to_payforme_taxrates($tax_rates),
    348357                'currency' => $currency,
    349358                'images' => $image_urls,
     
    353362
    354363        return $arr;
     364    }
     365
     366    function payforme_get_cart_fees($currency) {
     367        $fees = WC()->cart->get_fees();
     368        $fees = array_values($fees);
     369
     370        $line_fees = [];
     371        foreach ($fees as $fee) {
     372            $tax_rates = $fee->taxable ? WC_Tax::get_rates($fee->tax_class, WC()->customer) : [];
     373            $item = [
     374                'id' => $fee->id,
     375                'name' => $fee->name,
     376                'amount' => $fee->amount,
     377                'total' => $fee->total,
     378                'tax' => $fee->tax,
     379                'taxable' => $fee->taxable,
     380                'tax_class' => $fee->tax_class,
     381                'tax_status' => $fee->taxable ? 'taxable' : 'none',
     382                'currency' => $currency,
     383                'tax_rates' => wc_taxrates_to_payforme_taxrates($tax_rates),
     384            ];
     385            array_push($line_fees, $item);
     386        }
     387
     388        return $line_fees;
    355389    }
    356390
  • payforme/trunk/README.txt

    r2917635 r2918720  
    11=== PayForMe for Woocommerce ===
    22Contributors: payformeuser
    3 Tags: payforme, pay for me, payment, checkout, woocommerce, ecommerce, e-commerce, commerce, payment gateway, other pays, someone else pays, third party payments
     3Tags: payforme, pay for me, payment, checkout, stripe, woocommerce, ecommerce, e-commerce, commerce, payment gateway, other pays, someone else pays, third party payments
    44Requires at least: 5.0
    5 Tested up to: 6.2
    6 Stable tag: 2.0.4
     5Tested up to: 6.2.2
     6Stable tag: 2.0.5
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7676== Changelog ==
    7777
     78= 2.0.5 =
     79* Add - Support for custom store fees.
     80* Fix - Minor UI improvements.
     81
    7882= 2.0.4 =
    7983* Add - Rebranded logo
  • payforme/trunk/build/asset-manifest.json

    r2917635 r2918720  
    22  "files": {
    33    "main.css": "/static/css/main.dda31fb0.css",
    4     "main.js": "/static/js/main.c9510b7e.js",
     4    "main.js": "/static/js/main.8e87d2a3.js",
    55    "static/js/787.bc7d429a.chunk.js": "/static/js/787.bc7d429a.chunk.js",
    66    "index.html": "/index.html",
    77    "main.dda31fb0.css.map": "/static/css/main.dda31fb0.css.map",
    8     "main.c9510b7e.js.map": "/static/js/main.c9510b7e.js.map",
     8    "main.8e87d2a3.js.map": "/static/js/main.8e87d2a3.js.map",
    99    "787.bc7d429a.chunk.js.map": "/static/js/787.bc7d429a.chunk.js.map"
    1010  },
    1111  "entrypoints": [
    1212    "static/css/main.dda31fb0.css",
    13     "static/js/main.c9510b7e.js"
     13    "static/js/main.8e87d2a3.js"
    1414  ]
    1515}
  • payforme/trunk/changelog.txt

    r2917635 r2918720  
    11*** PayForMe for Woocommerce Changelog ***
     2
     32023-05-29 - version 2.0.5
     4* Add - Support for custom store fees.
     5* Fix - Minor UI improvements.
    26
    372023-05-26 - version 2.0.4
  • payforme/trunk/payforme-woocommerce.php

    r2917635 r2918720  
    77 * Plugin URI:  https://wordpress.org/plugins/payforme/
    88 * Description: PayForMe enables people to pay for the purchases of their friends and families via a secure payment link. Accept Credit/Debit cards, ApplePay and GooglePay using PayForMe.
    9  * Version:     2.0.4
     9 * Version:     2.0.5
    1010 * Author:      PayForMe
    1111 * Author URI:  https://payforme.io/
    1212 * License:     GPL-2.0
    1313 * Requires at least:    5.0
    14  * Tested up to:         6.2
     14 * Tested up to:         6.2.2
    1515 * WC requires at least: 4.7
    1616 * WC tested up to:      7.6.1
     
    196196        $cart_data->totals = $cart->get_totals();
    197197        $cart_data->line_items = payforme_get_cart_items($currency);
     198        $cart_data->line_fees = payforme_get_cart_fees($currency);
    198199        $cart_data->coupons = payforme_get_cart_coupons($cart);
    199200        $cart_data->shipping_rates = payforme_get_chosen_shipping_rates();
     
    308309
    309310    /**
    310      * Gets the cart the cart items
     311     * @param WC_Tax_Rate[] woo tax rates
     312     * @returns taxrates format expected by payforme server
     313     */
     314    function wc_taxrates_to_payforme_taxrates($tax_rates) {
     315        $pfm_tax_rates = [];
     316        foreach ($tax_rates as $key => $rate) {
     317            $_rate_item = [
     318                'id' => $key,
     319                'label' => $rate['label'],
     320                'percent' => $rate['rate'],
     321            ];
     322            array_push($pfm_tax_rates, $_rate_item);
     323        }
     324
     325        return $pfm_tax_rates;
     326    }
     327
     328    /**
     329     * Gets the cart items
    311330     * @return array of cart items
    312331     */
     
    320339            $product_id = $item['product_id'];
    321340            $product = wc_get_product($variation_id  ? $variation_id : $product_id);
    322             $taxes = $wc_tax->get_rates($product->get_tax_class());
     341            $tax_rates = $wc_tax->get_rates($product->get_tax_class());
    323342
    324343            $image_id = $product->get_image_id();
     
    326345            $image_url = reset($image_url_srcs);
    327346            $image_urls = ($image_url) ? [$image_url] : [];
    328 
    329             $_tax_rates = [];
    330             foreach ($taxes as $key => $rate) {
    331                 $_rate_item = [
    332                     'id' => $key,
    333                     'label' => $rate['label'],
    334                     'percent' => $rate['rate'],
    335                 ];
    336                 array_push($_tax_rates, $_rate_item);
    337             }
    338347
    339348            $item = [
     
    345354                'line_tax' => $item['line_tax'],
    346355                'quantity' => $item['quantity'],
    347                 'tax_rates' => $_tax_rates,
     356                'tax_rates' => wc_taxrates_to_payforme_taxrates($tax_rates),
    348357                'currency' => $currency,
    349358                'images' => $image_urls,
     
    353362
    354363        return $arr;
     364    }
     365
     366    function payforme_get_cart_fees($currency) {
     367        $fees = WC()->cart->get_fees();
     368        $fees = array_values($fees);
     369
     370        $line_fees = [];
     371        foreach ($fees as $fee) {
     372            $tax_rates = $fee->taxable ? WC_Tax::get_rates($fee->tax_class, WC()->customer) : [];
     373            $item = [
     374                'id' => $fee->id,
     375                'name' => $fee->name,
     376                'amount' => $fee->amount,
     377                'total' => $fee->total,
     378                'tax' => $fee->tax,
     379                'taxable' => $fee->taxable,
     380                'tax_class' => $fee->tax_class,
     381                'tax_status' => $fee->taxable ? 'taxable' : 'none',
     382                'currency' => $currency,
     383                'tax_rates' => wc_taxrates_to_payforme_taxrates($tax_rates),
     384            ];
     385            array_push($line_fees, $item);
     386        }
     387
     388        return $line_fees;
    355389    }
    356390
Note: See TracChangeset for help on using the changeset viewer.