{"id":66,"date":"2016-05-14T09:25:50","date_gmt":"2016-05-14T14:25:50","guid":{"rendered":"https:\/\/easydigitaldownloads.com\/development\/?p=66"},"modified":"2021-12-15T15:31:19","modified_gmt":"2021-12-15T21:31:19","slug":"please-use-edd_payment","status":"publish","type":"post","link":"https:\/\/easydigitaldownloads.com\/development\/2016\/05\/14\/please-use-edd_payment\/","title":{"rendered":"Please use EDD_Payment"},"content":{"rendered":"<p>In Easy Digital Downloads version 2.5, we introduced a new class called <a href=\"https:\/\/docs.easydigitaldownloads.com\/article\/1113-eddpayment\" target=\"_blank\" rel=\"noopener\">EDD_Payment<\/a>. This class provides easy-to-use methods for interacting with payment data in Easy Digital Downloads. It covers\u00a0retrieving payment\u00a0records, creating new payments, updating payments, and deleting payments. It is a complete abstraction for the underlying data structure of the payment records.<\/p>\n<p>There are two primary purposes of EDD_Payment:<\/p>\n<ol>\n<li>Provide an easy way to interact with payment data<\/li>\n<li>Abstract interaction away from the data layer<\/li>\n<\/ol>\n<p>The second point is extremely important, primarily because it provides Easy Digital Downloads with the flexibility <em>to change the data layer<\/em>.<\/p>\n<p>Why is this so important? It&#8217;s actually quite simple:\u00a0the main database structures in Easy Digital Downloads were written four years ago and are really\u00a0beginning to show their age. When I first built Easy Digital Downloads, I had no idea it would scale up to what it is today and, for that and many other reasons, not as much careful thought was put into the creation of the database layer. There were design decisions made four years ago that have inhibited our growth and flexibility since.<\/p>\n<p>In the next 6-12 months, we plan to make some truly significant improvements to many of the underlying data structures in Easy Digital Downloads, and in order to do that we need everyone to move away from directly accessing the database and adopt the abstraction layers we have provided.<\/p>\n<p>The\u00a0EDD_Payment object provides everything needed for interacting with payment data. If you\u00a0have written an extension or done any kind of custom development that involves interaction with payment data in Easy Digital Downloads, please ensure you are using the EDD_Payment class.<\/p>\n<p>Within the next 6-12 months we will be migrating all of the payment data, which is currently stored in the wp_posts and wp_postmeta tables, to a custom table structure that\u00a0will significantly improve the performance of Easy Digital Downloads and allow us to build much greater reporting capabilities in the future. On top of the migrating the data, we will also be building a series of backwards compatibility layers to help the process be smoother.<\/p>\n<p>In order for us to do this with as few pain points as possible, it is paramount that all Easy Digital Downloads users be using the abstractions layers that we have provided. The abstraction layers allow us to change the database layer of Easy Digital Downloads without affecting the functionality in any way, and allows us to make this change without disrupting the functionality of custom applications that have been built on top of Easy Digital Downloads.<\/p>\n<p>As we gradually make the migration to\u00a0storing data in custom tables, the abstraction APIs provided will become more and more important for extension developers and those developers building custom solutions on top of Easy Digital Downloads. In the interest of preventing future problems, please ensure you are using them.<\/p>\n<p>If you have any questions or are unsure of any aspect of how to use EDD_Payment, please use the comment area below. It is in our interest, as well as the interest of everyone else, to ensure the transition over the next 6-12 months goes smoothly.<\/p>\n<p>You can learn more about our plan for the new database structure and the current status of the project on <a href=\"https:\/\/github.com\/easydigitaldownloads\/easy-digital-downloads\/issues\/4576\" target=\"_blank\" rel=\"noopener\">GitHub<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Easy Digital Downloads version 2.5, we introduced a new class called EDD_Payment. This class provides easy-to-use methods for interacting with payment data in Easy Digital Downloads. It covers retrieving payment records, creating new payments, updating payments, and deleting payments. It is a complete abstraction for the underlying data structure of the payment records.<\/p>\n","protected":false},"author":650,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[10],"class_list":["post-66","post","type-post","status-publish","format-standard","hentry","category-core","tag-edd_payment"],"_links":{"self":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/users\/650"}],"replies":[{"embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/comments?post=66"}],"version-history":[{"count":1,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts\/66\/revisions"}],"predecessor-version":[{"id":1121,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/posts\/66\/revisions\/1121"}],"wp:attachment":[{"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/media?parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/categories?post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/easydigitaldownloads.com\/development\/wp-json\/wp\/v2\/tags?post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}