Extensions – Easy Digital Downloads Development https://easydigitaldownloads.com/development Official development blog for Easy Digital Downloads Wed, 15 Dec 2021 21:32:52 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.2 https://easydigitaldownloads.com/development/files/2015/11/icon-256x256-150x150.png Extensions – Easy Digital Downloads Development https://easydigitaldownloads.com/development 32 32 Invoices 1.2 https://easydigitaldownloads.com/development/2021/04/12/invoices-1-2/ https://easydigitaldownloads.com/development/2021/04/12/invoices-1-2/#comments Mon, 12 Apr 2021 12:20:20 +0000 https://easydigitaldownloads.com/development/?p=1050

Continue reading →

]]>
Easy Digital Downloads – Invoices 1.2 is a huge release, providing significant extensibility while maintaining backwards compatibility.

The CSS has been simplified and updated. The new invoices will look slightly different, as the overall appearance and font stack has been modernized, but out of the box, the new invoices should be very similar to the old.

Where version 1.2 really shines is that now, store owners can modify the invoice template. The following template files are now available:

  • invoice.php: This is the primary template, and consists only of the basic HTML markup, and some new custom hooks.
  • invoice-contacts.php: This template outputs the storefront and customer information.
  • invoice-table.php: This template outputs the primary “receipt” of the invoice.
  • invoice-additional-info.php: This template includes any custom notes added by the customer, as well as custom notes from the storefront (this is a new setting in 1.2).

As with any EDD templates, these can be overridden by copying them to a directory called edd_templates in the active theme folder.

In addition to the templates, EDD Invoices now includes multiple hooks in the invoice so that a store owner can add additional information wherever it’s needed:

  • edd_invoices_invoice_head: This hook fires in the head of the HTML output for the invoice. One new feature is that the invoice stylesheet is now output using this hook. The same hook can be used to load an additional custom stylesheet.
  • edd_invoices_invoice_header: This hook is used to output the invoice logo (if set), the invoice number, and (new in 1.2) the order status and purchase date.
  • edd_invoices_invoice_contacts: The invoice-contacts.php template is loaded in this hook.
  • edd_invoices_invoice_items_table: The invoice-table.php template is loaded in this hook.
  • edd_invoices_invoice_additional_info: The invoice-additional-info.php template is loaded in this hook.
  • edd_invoices_invoice_footer: EDD Invoices adds action buttons (print, back) using this hook. These are not included in the printed version of the invoice.

Each hook uses either the order object (in EDD 3.0) or the payment object (EDD 2.x).

Some invoice content is output directly in the templates, but some of it requires a bit more logic, so 1.2 also introduces some helper functions:

  • edd_invoices_get_order_items: This function gets the necessary information for each item in the order: the item ID, the price, the product name, and the price ID. The data is returned to the template as an array.
  • edd_invoices_get_order_discounts: This function gets the discounts applied to the order. In EDD 2.9/2.10, the discount code is displayed on the invoice. Because much more specific information is available in 3.0, those invoices will include the amount of each discount, and (for percentage discounts) the discount rate.
  • edd_invoices_get_custom_order_meta: This function gets the customer’s notes and/or VAT for the order. It works for the metadata in both EDD 2.x and 3.0.
  • edd_invoices_get_order_date: This function gets the order date, which is a different property in EDD 3.0, and requires a little more fallback work for renewal payments in 2.x.

Functions which output directly to the invoice are in the includes/template-functions.php file.

EDD Invoices 1.2 is ready for Easy Digital Downloads 3.0

Just as orders are stored in a custom database table in EDD 3.0, order meta will be as well. Invoices saves custom meta–the option VAT for the customer and any notes the customer adds to the invoice. Invoices 1.2 will migrate this custom meta to the new order meta table when you upgrade to EDD 3.0.

Additionally, the new templates and hooks use the order object in EDD 3.0. This is both more detailed and simpler than the comparable payment object, and allows store owners to access much more specific information about each order and order item.

]]>
https://easydigitaldownloads.com/development/2021/04/12/invoices-1-2/feed/ 1
Stripe 2.8 Beta 1 Adds Payment Request Buttons https://easydigitaldownloads.com/development/2020/11/17/stripe-2-8-beta-1-adds-payment-request-buttons/ https://easydigitaldownloads.com/development/2020/11/17/stripe-2-8-beta-1-adds-payment-request-buttons/#comments Tue, 17 Nov 2020 14:37:03 +0000 https://easydigitaldownloads.com/development/?p=939

Continue reading →

]]>
Our Easy Digital Downloads team has been hard at work getting the Stripe 2.8 release wrapped up and we are happy to be able to release to you, the first public beta of Version 2.8 of our Stripe integration. There some great new features alongside quite a few bug fixes, so let’s take a look at this release in detail.

Apple/Google/Microsoft Pay support

The long-awaited Payment Request Button feature has arrived in Easy Digital Download’s Stripe integration. Payment Request Buttons (or PRB, for short) is what Stripe calls it’s dynamic integrations for Apple Pay, Google Pay and the new Microsoft Pay.

Payment Request Buttons are supported on Single Download pages and Download lists using the [​downloads] shortcode as a “Buy Now” payment method. You can also enable the Payment Request Button on EDD’s Checkout page, where it will be the default payment method if the visitor’s browser supports it.

Visitors will be provided with the appropriate payment option, depending on their platform and/or browser. You can find the details about what operating systems and browsers are supported for each digital wallet service by viewing Stripe’s Payment Request Button documentation.

Stripe Checkout modal replacement

Almost a year ago, Stripe deprecated the ‘Stripe Checkout’ modal that some store owners preferred. This was in an effort to introduce the SCA features as well as their new Checkout experience. While there was nothing we could do about it’s deprecation, we chose to provide a similar purchase experience.

We’ve re-created the Stripe Checkout modal using Stripe Elements. While it is not a stylistic match for the Legacy Checkout product, the functionality remains similar so that store owners can once again use the modal to provide a fast and secure purchase experience, without the need of a cart or checkout page.

Split card fields

In version 2.7 of Stripe, we moved to using Stripe Elements to render the credit card fields. These secure fields, which are provided directly from Stripe’s library look like this.

Combined card fields with the Stripe gateway in Easy Digital Downloads

While some people prefer the combined card field appearance which contains the card number, expiration date, and CVV, it does not work with everyone’s design preferences. In version 2.8 of our integration, we’ve added a checkbox, allowing store owners to have split card fields.

Split card fields for the Stripe gateway

Other improvements

  • Option to reject Pre-Paid cards.
  • Automatically set the new card as the default if the customer has removed all cards.
  • Updated Stripe Library to 7.47.0.
  • Bump Stripe API Version to 2020-03-02.
  • Send the EDD customer name when creating the Stripe customer object.
  • Preemptive updates to allow for EDD 3.0 support.

Notable bug fixes

  • Improved PHP 7.3 and 7.4 compatibility.
  • Avoid Javascript errors on checkout when cart total is 0 or the page is loaded over http.
  • When pre-authorization was allowed and SCA challenges were required, the charges could not be approved.
  • Improved localization by fixing incorrect text domains and properly running error messages through translation functions.
  • Expired cards did not display properly when managing payment methods and could not be deleted.

Using the beta

Easy Digital Downloads Stripe 2.8 Beta 1 is available to all valid license key holders either via direct download within your account, or you can receive betas in your WordPress admin by enabling updates to betas at Downloads > Tools > Beta Versions.

]]>
https://easydigitaldownloads.com/development/2020/11/17/stripe-2-8-beta-1-adds-payment-request-buttons/feed/ 4
Software Licensing 3.6.12 Supports Auto-Updates https://easydigitaldownloads.com/development/2020/11/02/software-licensing-auto-updates/ https://easydigitaldownloads.com/development/2020/11/02/software-licensing-auto-updates/#comments Mon, 02 Nov 2020 16:34:24 +0000 https://easydigitaldownloads.com/development/?p=922

Continue reading →

]]>
The latest WordPress release includes a feature which will be especially noteworthy for plugin and theme authors distributing updates using our Software Licensing extension.

WordPress 5.5 includes support for auto-updating themes and plugins. Version 3.6.12 of Software Licensing includes updates to the plugin and theme update classes, as well as how they are implemented in our sample code, which users who want to support auto-updates will want to implement.

The new versions of the update classes are:

  • EDD_Theme_Updater — 1.1.0
  • EDD_SL_Plugin_Updater — 1.8.0

Changelog:

  • The theme updater class now populates the no_update property of the WordPress theme update transient
  • The plugin updater class adds plugin and id to the plugin version information which is added to the WordPress plugin update transient (the no_update property population was initially added in Software Licensing 3.6.10)

The way theme and plugin authors initialize the updater classes will also need to be updated to work with the WordPress scheduled task. Plugin authors will note that the edd_sl_sample_plugin_updater function now uses the init hook, instead of admin_init. Both this function and the comparable updater method in the theme-updater-admin.php file now include a check for whether a cron job (scheduled task) is running, as well as the user privilege level.

Once you have updated your theme or plugin code to include these changes and it’s on your users’ sites, they will be able to enable auto-updates.

Documentation:

Valid license holders can get these new sample files from within the Downloads section of your account.

]]>
https://easydigitaldownloads.com/development/2020/11/02/software-licensing-auto-updates/feed/ 2
Software Licensing v3.6.10 and Reviews v2.1.11 https://easydigitaldownloads.com/development/2020/04/13/software-licensing-v3-6-10-and-reviews-v2-1-11/ https://easydigitaldownloads.com/development/2020/04/13/software-licensing-v3-6-10-and-reviews-v2-1-11/#comments Mon, 13 Apr 2020 14:00:00 +0000 https://easydigitaldownloads.com/development/?p=897 This last week we released maintenance updates for two of our most popular extensions that each include a significant number of improvements.

Software Licensing version 3.6.10

Our focus for this update was to address a large number of lingering issues. We made twenty separate improvements to Software Licensing in version 3.6.10.

The complete list of items addressed:

  • Fix: When Apache forced trailing slashes, update packages could fail to be downloaded.
  • Fix: When upgrading a bundle, the child licenses may not have gotten their price IDs updated.
  • Fix: It was not possible to renew multiple licenses for the same product, at the same time.
  • Fix: When using bundle licenses with children, the license list table had some performance issues.
  • Fix: Child licenses could have a different activation limit than their parent.
  • Fix: License counts on the list table for license statuses could be incorrect when child licenses were used.
  • Fix: Some of the Readme information was not being parsed correctly after the latest parser update.
  • Fix: Searching for a child licenses could give incorrect results, or no results.
  • Fix: Updates could intermittently cause the ‘Too Many Redirects’ error.
  • Fix: Searching for partial license keys and email addresses could cause PHP notices and/or warnings.
  • Fix: When jQuery was being loaded in the footer, some JavaScript errors could occur when managing licenses on the front end.
  • Fix: Searching for a non-existent license key, returned all license keys in the list table.
  • Fix: Improved the reliability of the checks to make sure an update can be downloaded.
  • Fix: When using custom keys, it was possible to use a key length that exceeded the database column’s allowed length.
  • Sample Theme:
    • Fix: The sample theme was missing the theme_slug parameter from the API calls.
    • New: The sample theme now supports the item_id parameter.
  • Sample Plugin:
    • Fix: The “View Details” link on the plugin list was not always present.
    • Fix: Sample plugin did not define the EDD_SAMPLE_ITEM_NAME string.
  • New: Changelogs now support the “Read More” tag, to allow reducing changelog information stored in the get_version API calls.
  • Dev: The license list table columns are now filterable and sortable.

Reviews version 2.1.11

Like with Software Licensing, our focus for this update of the Reviews extension was fixing minor issues that have lingered for some time.

We fixed six bugs in version 2.1.11. Those bugs were:

  • Fix: Ensure custom code snippets cannot cause undefined index errors in the [downloads] shortcode
  • Fix: Enable review request emails to be sent when now is the selected time period
  • Fix: Compare version and only show admin notification for upgrade with outdated versions.
  • Fix: Verify that orders are complete or published before request review emails sent
  • Fix: Remove unused variable $post_id in class review widget
  • Fix: Use timestamp $now to ensure review request emails are being sent at correct time relative to store timezone.
]]>
https://easydigitaldownloads.com/development/2020/04/13/software-licensing-v3-6-10-and-reviews-v2-1-11/feed/ 3
Recurring Payments updated to fix invalid expiration dates in Stripe integration https://easydigitaldownloads.com/development/2020/02/05/recurring-payments-updated-to-fix-invalid-expiration-dates-in-stripe-integration/ https://easydigitaldownloads.com/development/2020/02/05/recurring-payments-updated-to-fix-invalid-expiration-dates-in-stripe-integration/#comments Wed, 05 Feb 2020 19:50:39 +0000 https://easydigitaldownloads.com/development/?p=873 Our Recurring Payments plugin was updated to version 2.9.8 on February 3rd, 2020, to fix a problem with invalid expiration dates with subscriptions created through Stripe.

On February 2nd, an issue was discovered that caused subscription records to get assigned an expiration/renewal date of 00-00-0000 00:00:00.

The problem occurred anytime a renewal payment was processed for a subscription on sites running version 2.9.7 and 2.9.7.1 of Recurring Payments.

Subscriptions that had the problem occur will be corrected automatically when one of two actions is taken:

  1. A renewal payment is processed
  2. The EDD_Subscription object is instantiated in any context

The impacted versions of Recurring Payments were available for only a few days before the problem was discovered and fixed so there should be a very minimal number of impacted subscription records.

If you wish to determine if any of your subscription records were impacted, the following SQL query will locate them:

global $wpdb;

$subs = $wpdb->get_results( "SELECT * FROM $wpdb->edd_subscriptions where expiration = '00-00-0000 00:00:00' AND status = 'active';" );

Loading the details screen in WP Admin > Downloads > Subscriptions of any impacted subscription will correct the expiration date.

]]>
https://easydigitaldownloads.com/development/2020/02/05/recurring-payments-updated-to-fix-invalid-expiration-dates-in-stripe-integration/feed/ 1
All Access and Stripe extension updates released https://easydigitaldownloads.com/development/2020/01/28/all-access-and-stripe-extension-updates-released/ https://easydigitaldownloads.com/development/2020/01/28/all-access-and-stripe-extension-updates-released/#comments Tue, 28 Jan 2020 19:28:30 +0000 https://easydigitaldownloads.com/development/?p=862 Our All Access extension and our Stripe Payment Gateway were both updated in the last week with a series of bug fixes and improvements.

All Access version 1.1.2

This version included nine separate improvements.

A new report option has been added that allows site admins to view the most popular products based on the file download activity of customers.

The [edd_aa_customer_passes] shortcode has been improved so that it shows customers a history of their file downloads.

The [edd_aa_all_access] shortcode now accepts multiple product IDs, allowing you to restrict content to multiple All Access Passes.

The Process All Access Passes tool has been re-named to Backfill All Access Passes to better describe what it does.

The display of purchase buttons to customers that have lifetime all access passes has been improved so that they are not improperly shown a Renew option.

Behind the scenes we have also made a few improvements:

  • Access passes are now properly migrated when a payment record is moved from one customer to another
  • The user capabilities used for upgrade routines now match those used in EDD core
  • Instances of EDD_Payment have been replaced with edd_get_payment() for improved compatibility with the upcoming Easy Digital Downloads 3.0 version

Along with the improvements above, we have also fixed four distinct bugs:

  • License keys purchased for a product that has All Access enabled on it after the license key is purchased do not return the proper API responses
  • Downloads per day not properly reset for customers that do not log in for more than a year
  • Access Passes associated with a variable price do not sync properly with license expirations
  • An error occurred when a payment record did not have a customer attached to it

Stripe Payment Gateway version 2.7.5

The processing logic that handles partial refunds detected via Stripe webhooks was previously held inside the Recurring Payments plugin. That logic has now been moved into the Stripe Payment Gateway for improved maintainability.

The Card Name field has been been updated to include placeholder text for improved user experience.

We have also fixed five distinct bugs:

  • CSS was not properly loaded within the WordPress admin
  • Purchases failed if a cart item title exceeded 1,000 characters
  • “Buy Now” was still taking precedence even though the Stripe Checkout option is no longer available
  • There were improperly localized strings in template-functions.php
  • Creating a pre-approval with a new payment method failed

]]>
https://easydigitaldownloads.com/development/2020/01/28/all-access-and-stripe-extension-updates-released/feed/ 4
Support for multiple subscriptions in single checkout disabled by PayPal https://easydigitaldownloads.com/development/2019/10/25/support-for-multiple-subscriptions-in-single-checkout-disabled-by-paypal/ https://easydigitaldownloads.com/development/2019/10/25/support-for-multiple-subscriptions-in-single-checkout-disabled-by-paypal/#comments Fri, 25 Oct 2019 18:15:48 +0000 https://easydigitaldownloads.com/development/?p=834

Continue reading →

]]>
On November 1, 2019, PayPal will be entirely disabling support for purchasing multiple subscriptions in a single checkout.

Earlier this year, in January 2019, PayPal disabled support for multiple subscriptions on newer accounts. Merchant accounts that had been selling subscriptions prior to January 1, 2017 were grandfathered and permitted to continue selling multiple subscriptions in a single checkout.

Just under three weeks ago, PayPal sent the following email to affected merchants:

Email notice sent by PayPal on October 7, 2019

Unfortunately PayPal has now decided to cease supporting multiple subscriptions entirely. So now, regardless of when the account was created, PayPal merchants are no longer able to sell multiple subscriptions in a single checkout.

This change takes effect on November 1, 2019.

We have released an update to our Recurring Payments plugin. This update is to ensure your customers do not encounter an error during checkout. Please update to version 2.9.3 of Recurring Payments.

Customers that attempt to purchase multiple subscriptions through PayPal Website Payments Pro or PayPal Express will be shown the following message on checkout:

Only one subscription may be purchased through this payment method per checkout.

A lot of stores frequently sell multiple subscriptions in a single purchase and we fully recognize that this is not an ideal experience for customers. Unfortunately this is entirely outside the realm of our control and we’ve had no choice but to comply with PayPal’s sudden change.

To help the checkout experience when purchasing multiple subscriptions, we recommend disabling PayPal and, instead, using a payment gateway that continues to support multiple subscriptions. Our recommendation is Stripe.

If you’d like to continue offering PayPal alongside another gateway but also proactively prevent customers from having a poor checkout experience, we recommend installing this code snippet, which will automatically remove PayPal as a payment method when there are multiple items in a checkout.

]]>
https://easydigitaldownloads.com/development/2019/10/25/support-for-multiple-subscriptions-in-single-checkout-disabled-by-paypal/feed/ 1
All Access Beta for 1.1 released https://easydigitaldownloads.com/development/2019/01/17/all-access-beta-for-1-1-released/ https://easydigitaldownloads.com/development/2019/01/17/all-access-beta-for-1-1-released/#comments Thu, 17 Jan 2019 20:00:39 +0000 https://easydigitaldownloads.com/development/?p=774

Continue reading →

]]>
The next major release for the All Access extension is version 1.1, and it has just been released into beta. Most of the changes in this version are small bug fixes and edge case handling, but it also contains a few farther-reaching fixes which help prevent future problems down the road. There’s also some new features which have been added to help you handle special customer cases while keeping everything in sync and running smoothly. Let’s dive into the main changes.

New Customer Regeneration Tool

In the past, if a customer’s All Access Pass accidentally expired for any reason, there was no way to un-expire their pass. The reason for this is intentional: Commissions are paid upon pass expiration. If a pass becomes un-expired, some of your Vendors could end up not being compensated for their products. But not everyone using All Access also uses the EDD Commissions extension, and often-enough, passes were expired accidentally, for various reasons.

There is now a way to fix those situations: a new tool in the Customer profile. To find the new tool, find the customer profile in Easy Digital Downloads and go to “Tools”. There, you’ll see a section called “All Access Tools” and a button that says “Regenerate All Access Passes”. This will go through a customer’s entire purchase history and regenerate every piece of All Access data that exists for this customer, fixing any out-of-sync problems that might have arisen, or applying changes you might have made to your All Access Products.

It’s important to be aware of this if you are using EDD Commissions, as un-expiring an already-expired All Access Pass means that commissions for that pass were already generated. While All Access protects you from accidentally double-generating commissions for an All Access Pass (even in this scenario), any products downloaded by the customer after the initial expiration won’t be accounted for. Thus, those Vendors will not be part of the commission split upon subsequent expiration.

Dates are now saved in UTC

Probably the biggest change in this version is that all dates, like the All Access start time, are now saved in UTC. Prior to this update, it saved the times using the timezone of the WordPress installation.

The problem here was that if you moved your store’s location, and so changed the timezone of your WordPress installation to match your new location, all of the times saved were now wrong. This could cause un-intended problems with things like expiration, and downloads-per-day resets.

Now, the times are saved in UTC, but get shown in the WordPress installation’s timezone. This is done by converting the UTC time to the WordPress timezone on-the-fly, just prior to outputting it to the screen.

After updating, you will see an upgrade routine which will modify the saved dates of every All Access pass in your store. You will want to run that upgrade routine, and make sure you don’t change your WordPress’s timezone prior to running that upgrade. After running it, you can change your WordPress installation’s timezone as often as you wish.

Easy Digital Downloads 3.0 Ready

This update also makes All Access ready for version 3.0 of Easy Digital Downloads, by changing all references of EDD_Payment to instead use the helper function called edd_get_payment. This takes advantage of the performance improvements which will be added to version 3 of Easy Digital Downloads.

Better Search Engine Schema

All Access has an option to modify the purchase form, and show a “Buy All Access” button alongside the normal purchase button. An un-intended side-effect of that was that the schema, which is data search engines use to understand your products, showed that the product price was the All Access price, and not the actual price of the product in question. That has been fixed.

Recurring Payments Integration Improvements

The “Limit File Downloads” setting in Recurring Payments prevents customers from being able to download recurring-enabled products unless they have an active, valid subscription. However, if you’re selling lifetime (and thus non-recurring) All Access Passes which include recurring-enabled products, the All Access Pass didn’t work because of that setting. That has now been fixed.

Content Restriction Integration Improvements

The Content Restriction extension allows you to hide content from users unless they purchase a product. All Access modifies this to cut-off their access if their All Access Pass is expired. But what had not been considered previously was if the page was restricted to a product within a pass, and not just to a pass itself. That has now been fixed.

Additionally restricting content to “all prices” now works. which previously was also not working. To further complete the integration, the [edd_restrict] shortcode from Content Restriction also now takes into consideration content restricted to products within an All Access Pass, and not just to All Access products themselves.

Software Licensing Integration Improvements

Another one of the biggest changes in this version of All Access is the behaviour relating to licenses and recurring subscriptions. If you set an All Access Product to “Sync with Recurring”, the pass would expire when the recurring subscription expired. This worked great, except in specific cases where Software Licensing was also involved; specifically discounts/sales.

This is because Software Licensing has the concept of renewals, which also includes the ability to renew a product early, even if you also have an active subscription. While this isn’t typically normal customer behavior, during a sale, like one you might run on Black Friday, it suddenly becomes a customer’s intention. And it’s something Software Licensing and Recurring Payments work together to allow.

An early renewal in Software Licensing cancels the current recurring subscription and creates a brand new one to replace it. Suddenly the license and the subscription are now (correctly) out of sync, with the recurring subscription expiring at a different time than the license. This is how it is ensured that your customers don’t lose any time they’ve paid for.

The problem as far as All Access is concerned, is that it is set to “Sync with Recurring”, when really it should be set to “Sync with License”. To rectify that, All Access now uses the license’s expiration instead of the subscription’s expiration. If a license does not exist, it will then fall-back to use the recurring subscription’s expiration. This keeps All Access in sync with both Software Licensing and Recurring Payments while accounting for early renewals.

Fixed Restrict Content Pro Migrator

If you want to switch from Restrict Content Pro to use Easy Digital Downloads with Recurring Payments and All Access instead, All Access has a migration tool to help keep your current customers working. However that tool was not always working correctly. An issue that sometimes caused it to break on step 1 has now been resolved.

Other bug fixes and improvements

  • There were some cache clears that were not required and they have now been removed.
  • The edd_purchase_link_top hook was not always present on the purchase form with AA, it now is.
  • The price ID attribute was not accounted for in the [edd_all_access] shortcode. It now is.
  • Added some better error handling if someone passes an invalid license to the Software Licensing API
  • Fixed an edge case in the cart where errors were being cleared when they shouldn’t have been

How to test the beta:

As with all of our beta releases, you can get access to the beta in your WordPress dashboard by going to “Downloads” > “Tools” > “Beta Versions”.

]]>
https://easydigitaldownloads.com/development/2019/01/17/all-access-beta-for-1-1-released/feed/ 5
Content Restriction 2.3 Beta 1 released with improved extension integrations https://easydigitaldownloads.com/development/2018/11/12/content-restriction-2-3-beta-1-released-with-improved-extension-integrations/ https://easydigitaldownloads.com/development/2018/11/12/content-restriction-2-3-beta-1-released-with-improved-extension-integrations/#respond Mon, 12 Nov 2018 19:25:06 +0000 https://easydigitaldownloads.com/development/?p=692 The 2.3 update of Content Restriction is mainly focused around improving integration with other Easy Digital Downloads Extensions, and also contains a couple of useful improvements.

Recurring Payments integration improvement

The biggest integration improvement is with the Recurring Payments extension, and the fix requires both version 2.3 of Content Restriction, and version 2.8 of Recurring Payments. Previous to version 2.3 of Content Restriction and 2.8 of Recurring Payments, Recurring Payments was doing too good of a job cutting off access to restricted content if the user did not have an active subscription.

For example, if you wanted to restrict content to people with an active yearly subscription, but also wanted to sell a “lifetime” option that never recurs, your lifetime users would actually never get access to the restricted content. This was because it was required that they have an active subscription, which they didn’t have or need. This issue has now been resolved, and you can now restrict content to both recurring products, and to non-recurring products.

New hook added for custom options

There has also been some code refactoring and new hooks introduced. If you are using the edd_cr_metabox hook to add custom options to the Content Restriction metabox, you should now use the edd_cr_restricted_table_before hook instead. The edd_cr_metabox should have never been used to output options, because it exists as part of the required-products table. The hook remains for backwards compatibility purposes, but to give users the best experience, any custom options for Content Restriction should now use the edd_cr_restricted_table_before hook.

Software Licensing integration improvement

Speaking of that new hook, previous to version 2.3 of Content Restriction, integration code for the Software Licensing extension output a custom option to “Require valid licenses” but was using the edd_cr_metabox hook. It has now been updated to use the proper hook, “edd_cr_restricted_table_before”. If you’re looking to see how that works, or copy it for your own purposes, you can see the change, and how it works, in the “includes/integrations/edd-software-licensing.php” file.

Compatibility issues with PHP 7.2 resolved

There was a single issue which output a warning if using PHP 7.2 which was “Warning: count(): Parameter must be an array or an object that implements Countable in user-functions.php on line 30”. This could happen if a non-array was passed into the edd_cr_user_can_access function. Checking for the variable type has now been added, and this issue is resolved.

Fixed output of unlocked pages upon purchase confirmation

In a scenario where a variably-priced product unlocked 2 different pages with 2 different prices, even if the customer only purchased access to one of the prices/pages, both pages were listed as being available (even though only the correct one actually worked). This has now been resolved.

Improved integration with bbPress

If you restrict your bbPress forums to buyers using Content Restriction, previously it would show a message that said “This forum is restricted to buyers”. But it didn’t tell the user which product they should purchase in order to gain access to the forum. That has now been been added, and the message shown to the user matches the message shown in all other content restriction areas.

Added shortcode for users without access

If you’d like to show content to people who haven’t purchased yet, a new shortcode has now been added for that. It is called edd_cr_no_access. On the docs page for Content Restriction there is documentation about how it works.

Improved UI of Content Restriction metabox on pages

To help make it more clear when you have Content Restriction enabled for a page or post, the options for Content Restriction now only show if you actually have Content Restriction options in place. Unrestricted pages have the Content Restriction metabox options hidden behind a checkbox now.

]]>
https://easydigitaldownloads.com/development/2018/11/12/content-restriction-2-3-beta-1-released-with-improved-extension-integrations/feed/ 0
Recurring Payments 2.8 Beta 1 released with improved tax reporting/management for subscriptions https://easydigitaldownloads.com/development/2018/11/12/recurring-payments-2-8-beta-1-released-with-improved-tax-reporting-management-for-subscriptions/ https://easydigitaldownloads.com/development/2018/11/12/recurring-payments-2-8-beta-1-released-with-improved-tax-reporting-management-for-subscriptions/#comments Mon, 12 Nov 2018 17:10:01 +0000 https://easydigitaldownloads.com/development/?p=690 The Recurring Payments extension is getting a major update in version 2.8 with some significant fixes. Most notably, taxes on subscriptions are now being logged in the subscriptions table in 4 new columns:

  • initial_tax_rate – storing the tax rate from the initial purchase in the subscription
  • initial_tax – storing the tax amount from the initial purchase in the subscription
  • recurring_tax_rate – storing the recurring tax rate, which will be used for all recurs in this subscription
  • recurring_tax – storing the recurring tax amount, which will be used for all recurs in this subscription

These 4 columns are important because the initial amount and tax rate may not match the recurring amount. For example, if you have a free trial for your products enabled, the initial tax amount will be $0. But for subsequent recurs, that amount can be different.

It is also important to note that in version 2.8, taxes, discounts/coupons, and fees are no longer sent separately to the payment gateway. All calculations that modify the final price for recurring products are now done solely in EDD Recurring Payments and Easy Digital Downloads core.

Previous to version 2.8, taxes/discounts/fees were sent to the gateway as separate amounts and the gateway would redo its own calculations on the total. The problem with this was that it could result in different amounts, even by a single cent. A lot of this has to do with the fact that Stripe and PayPal handle rounding extremely long numbers differently. The end result was that the numbers could be slightly off at the gateway vs what they were in the EDD payment record. Now, by doing the math only in EDD and sending just the total to the payment gateway, there will only be a single set of numbers, and no possibility of duplicate math.

It is advisable that you use the EDD’s payment history for accounting and reporting purposes going forward, as opposed to using the taxation/discount/fee numbers provided by the payment gateway. Those additional amounts/breakdowns are no longer sent to the gateway, so they will no longer exist there.

During the alpha stage of the 2.8 release, our team tested over 196 unique checkout scenarios related to this change. All of these scenarios are created by combinations of possible settings in Easy Digital Downloads, especially when used alongside Software Licensing, and also when discount codes come into play. Between free trials, discounts codes, renewal discounts (from Software Licensing), taxes being entered both inclusive and exclusive of tax, and the combinations of all of the above, we believe we have accounted for and tested almost all possible situations that may arise.

If you are running Recurring Payments alongside Software Licensing, it is a good idea to run this beta version on your staging server and running a few test purchases to ensure you get the results you expect. This applies especially if you have custom code anywhere on your site that affects Recurring Payments in any way. Once you have confirmed that your test purchases go through as you expect them to, then it is advisable to update to the 2.8 release when it becomes available on your live site.

We will be leaving version 2.8 in beta for at least 2 weeks before full release to allow time for beta testing.

Additional fixes included in the 2.8 release:

Fixed Content Restriction Integrations

If you use the Content Restriction extension alongside Recurring Payments, you might be using the “Require active subscription” option to revoke a subscriber’s access to restricted content if their subscription expires. There was an edge case for people who required either a recurring product OR a non recurring product. Recurring Payments was doing too good of a job at requiring active subscriptions, even on products that weren’t recurring-enabled. That is now fixed in version 2.8, and you can restrict a product to both a recurring product or a non recurring product at the same time. An example of this would be if you sold yearly or lifetime packages. The yearly package is recurring enabled (yearly), but the lifetime package is not recurring. Therefore, lifetime purchasers would not have a subscription, and therefore they would not have access. This was the most common use-case for this. That is now resolved in version 2.8 so that the lifetime, non-subscription products also give access, while still requiring active subscriptions for products that are recurring-enabled.

Fixed re-activating subscriptions from the customer account

Another issue that has been resolved in 2.8 is re-activating subscriptions from the customer’s account dashboard, which is provided by the [edd_subscriptions] shortcode. The customer could not re-activate their subscription at Stripe. This was due to an API change made on Stripe’s end, which we have now adjusted and accounted for.

Prevented free trials from being incorrectly applied

If a customer on your site had 2 products in their cart, one of which had a free trial, and the other did not, a free trial was getting applied to both. That bug has also been resolved in version 2.8. Products with free trials and products without free trials can no longer be purchased at the same time. If attempted by a customer, they will receive an error stating “Error: Free trials and non-trials may not be purchased at the same time. Please purchase each separately.”

Resolved multi-currency issue

If you have a custom integration with EDD that charges customers in a different currency than your default currency for your shop, there were previously issues with

the Paypal Pro/Express gateways in that it expected the currency to match the store’s default currency instead of using the unique payment record’s currency. That has now been resolved.

Search results on the Subscriptions page

When searching through your subscriptions in the admin dashboard, the number of found posts always reflected the total number of subscriptions, as opposed to showing the number found in your search query. That has now been resolved.

PayPal eChecks with subscriptions

If a person chose to buy a subscription and paid with an eCheck, previously those payments were not labelled with the “eCheck” label. Those now have code in place to be handled and labelled correctly.

]]>
https://easydigitaldownloads.com/development/2018/11/12/recurring-payments-2-8-beta-1-released-with-improved-tax-reporting-management-for-subscriptions/feed/ 5