Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Waldstein committed Mar 20, 2024
2 parents b4923b9 + 8df43f3 commit 3e48195
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
== Changelog ==
= 3.6.1: March 21st, 2024 =
* Fix: Resolved an issue with PayPal donations and currency switcher on donation forms using the visual form builder

= 3.6.0: March 13th, 2024 =
* New: Introduced a new beta feature called "Event Tickets" that is open for feedback! If enabled, you can create events and sell tickets on your donation forms.
* New: Added a new form builder layout called "Two Panel" that offers a side-by-side appearance and a multi-step donation experience.
Expand Down
4 changes: 2 additions & 2 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: GiveWP
* Author URI: https://givewp.com/
* Version: 3.6.0
* Version: 3.6.1
* Requires at least: 6.0
* Requires PHP: 7.2
* Text Domain: give
Expand Down Expand Up @@ -404,7 +404,7 @@ private function setup_constants()
{
// Plugin version.
if (!defined('GIVE_VERSION')) {
define('GIVE_VERSION', '3.6.0');
define('GIVE_VERSION', '3.6.1');
}

// Plugin Root File.
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: donation, donate, recurring donations, fundraising, crowdfunding
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.2
Stable tag: 3.6.0
Stable tag: 3.6.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -262,6 +262,9 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri
10. Use almost any payment gateway integration with GiveWP through our add-ons or by creating your own add-on.

== Changelog ==
= 3.6.1: March 21st, 2024 =
* Fix: Resolved an issue with PayPal donations and currency switcher on donation forms using the visual form builder

= 3.6.0: March 13th, 2024 =
* New: Introduced a new beta feature called "Event Tickets" that is open for feedback! If enabled, you can create events and sell tickets on your donation forms.
* New: Added a new form builder layout called "Two Panel" that offers a side-by-side appearance and a multi-step donation experience.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type ModalFormProps = {
};

/**
* @unreleased
* @since 3.6.1
* @since 3.4.0
* @since 3.2.0 include types. update BEM classnames.
* @since 3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type FormModalProps = {
};

/**
* @unreleased
* @since 3.6.1
*/
export default function FormModal({openFormButton, children, onChange, isOpen}: FormModalProps) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ import {PayPalSubscriber} from './types';
let updateOrderAmount = false;
let orderCreated = false;

let currency;

const buttonsStyle = {
color: 'gold' as 'gold' | 'blue' | 'silver' | 'white' | 'black',
label: 'paypal' as 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment' | 'subscribe' | 'donate',
Expand Down Expand Up @@ -100,6 +102,7 @@ import {PayPalSubscriber} from './types';
/**
* Get amount with fee (if any).
*
* @since 3.6.1 Append 'give-cs-form-currency' to formData
* @since 3.2.0
* @return {number} Amount with fee.
*/
Expand Down Expand Up @@ -139,6 +142,11 @@ import {PayPalSubscriber} from './types';
formData.append('billing_country', country);
}

/**
* Ensure the proper currency will be used when using the Currency Switcher add-on.
*/
formData.append('give-cs-form-currency', currency);

return formData;
};

Expand Down Expand Up @@ -266,6 +274,8 @@ import {PayPalSubscriber} from './types';
postalCode = useWatch({name: 'zip'});
country = useWatch({name: 'country'});

currency = useWatch({name: 'currency'});

useEffect(() => {
if (orderCreated) {
updateOrderAmount = true;
Expand All @@ -277,7 +287,6 @@ import {PayPalSubscriber} from './types';

const SmartButtonsContainer = () => {
const {useWatch, useFormState} = window.givewp.form.hooks;
const currency = useWatch({name: 'currency'});
const donationType = useWatch({name: 'donationType'});
const {isSubmitting, isSubmitSuccessful} = useFormState();
const {useFormContext} = window.givewp.form.hooks;
Expand Down Expand Up @@ -451,7 +460,6 @@ import {PayPalSubscriber} from './types';

function PaymentMethodsWrapper() {
const {useWatch} = window.givewp.form.hooks;
const currency = useWatch({name: 'currency'});
const donationType = useWatch({name: 'donationType'});
const [{options}, dispatch] = usePayPalScriptReducer();

Expand Down

0 comments on commit 3e48195

Please sign in to comment.