diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/chosen-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/chosen-rtl.min.css deleted file mode 100644 index 506a4636..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/chosen-rtl.min.css +++ /dev/null @@ -1,11 +0,0 @@ -/*! -Chosen, a Select Box Enhancer for jQuery and Prototype -by Patrick Filler for Harvest, http://getharvest.com - -Version 1.8.5 -Full source at https://github.com/harvesthq/chosen -Copyright (c) 2011-2018 Harvest http://getharvest.com - -MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md -This file is generated by `grunt build`, do not edit it by hand. -*/.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;-webkit-box-shadow:0 4px 5px rgba(0,0,0,.15);box-shadow:0 4px 5px rgba(0,0,0,.15);display:none}.chosen-container.chosen-with-drop .chosen-drop{display:block}.chosen-container a{cursor:pointer}.chosen-container .chosen-single .group-name,.chosen-container .search-choice .group-name{margin-left:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .chosen-single .group-name:after,.chosen-container .search-choice .group-name:after{content:":";padding-right:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 8px 0 0;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,right top,right bottom,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),to(#f4f4f4));background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;-webkit-box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-single input[type=text]{cursor:pointer;opacity:0;position:absolute;width:0}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-left:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-left:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;left:26px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;left:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 5px 4px 20px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:url(chosen-sprite.png) no-repeat 0 -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;opacity:0;pointer-events:none}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 0 4px 4px;padding:0 4px 0 0;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,right top,right bottom,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-right:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,right top,right bottom,color-stop(1%,#eee),color-stop(15%,#fff));background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:right;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:0 0!important;-webkit-box-shadow:none;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0;width:25px}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 0 3px 5px;padding:3px 5px 3px 20px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,right top,right bottom,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),to(#eee));background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;-webkit-box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;left:3px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-left:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,right top,right bottom,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),to(#eee));background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-gradient(linear,right top,right bottom,color-stop(20%,#eee),color-stop(80%,#fff));background-image:linear-gradient(#eee 20%,#fff 80%);-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-right:none;background:0 0}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span,.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container-single .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b{background-image:url(chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/chosen.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/chosen.min.css deleted file mode 100644 index fb044bf2..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/chosen.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/*! -Chosen, a Select Box Enhancer for jQuery and Prototype -Version 2.1.0 -Full source at https://github.com/jjj/chosen -Copyright (c) 2011-2020 JJJ -MIT License, https://github.com/jjj/chosen/blob/master/LICENSE.md -This file is generated by `grunt build`, do not edit it by hand. -*/.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;z-index:1011;width:100%;border:1px solid #aaa;border-top:0;border-radius:0 0 4px 4px;background:#fff;clip:rect(0,0,0,0);-webkit-clip-path:inset(100% 100%);clip-path:inset(100% 100%);margin-top:-1px;background-clip:padding-box}.chosen-container.chosen-with-drop .chosen-drop{clip:auto;-webkit-clip-path:none;clip-path:none}.chosen-container.chosen-dropup .chosen-choices,.chosen-container.chosen-dropup .chosen-single{z-index:1010}.chosen-container.chosen-dropup .chosen-drop{top:auto;bottom:100%;border:solid #aaa;border-width:1px 1px 0 1px;border-radius:4px 4px 0 0}.chosen-container a{cursor:pointer}.chosen-container .chosen-single .group-name,.chosen-container .search-choice .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .chosen-single .group-name:after,.chosen-container .search-choice .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container .search-choice-close{position:absolute;right:3px;top:0;bottom:0;margin:auto;border:none;cursor:pointer;display:block;width:15px;height:15px;background:url('data:image/svg+xml;charset=US-ASCII,') no-repeat right 0 top 50%;background-size:15px 15px}.chosen-container .search-choice-close:active,.chosen-container .search-choice-close:hover{background:url('data:image/svg+xml;charset=US-ASCII,') no-repeat right 0 top 50%;background-size:15px 15px}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:2.5px 0 2.5px 7px;border:1px solid #aaa;border-radius:4px;background-color:#fff;background-clip:padding-box;color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span,.chosen-container-single .chosen-single-with-deselect.chosen-default span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:42px}.chosen-container-single .chosen-single .search-choice-close{right:26px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url('data:image/svg+xml;charset=US-ASCII,') no-repeat right 5px top 52%;background-size:15px 15px}.chosen-container-single .chosen-search{position:relative;z-index:1011;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:0;padding:5px 20px 5px 5px;width:100%;height:auto;outline:0;border:1px solid #ccc;background:url('data:image/svg+xml;charset=US-ASCII,') no-repeat right 5px top 50%;background-size:15px 15px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:4px}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;clip:rect(0,0,0,0);-webkit-clip-path:inset(100% 100%);clip-path:inset(100% 100%)}.chosen-container-single.chosen-container-single-nosearch.chosen-dropup .chosen-results{padding-top:4px}.chosen-container-single.chosen-container-single-nosearch.chosen-dropup .chosen-single{z-index:1010}.chosen-container-single .chosen-drop .result-selected{background-color:#eee}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none;border-radius:4px}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 3px;width:100%;height:auto;border-radius:4px;border:1px solid #aaa;background-color:#fff;cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:0 3px;padding:6.5px 0;outline:0;border:none;background:0 0;-webkit-box-shadow:none;box-shadow:none;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0;width:25px}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:4px 20px 4px 5px;border:1px solid #aaa;border-radius:3px;max-width:100%;background-color:#eee;color:#333;line-height:12px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{font-size:95%;word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-multi.chosen-dropup .chosen-results{padding-top:4px}.chosen-container-multi.chosen-dropup .chosen-single{z-index:1010}.chosen-container-active .chosen-single{outline:#00f}.chosen-container-active.chosen-with-drop .chosen-choices,.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;border-bottom-right-radius:0;border-bottom-left-radius:0}.chosen-container-active.chosen-with-drop .chosen-single div b{background:url('data:image/svg+xml;charset=US-ASCII,') no-repeat right 5px top 52%;background-size:15px 15px}.chosen-container-active.chosen-with-drop.chosen-dropup .chosen-choices,.chosen-container-active.chosen-with-drop.chosen-dropup .chosen-single{border-radius:0 0 4px 4px}.chosen-container-active .chosen-choices{border:1px solid #5897fb}.chosen-disabled{opacity:.5;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{padding:2px 7px 2px 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:42px}.chosen-rtl .chosen-single div{right:auto;left:0}.chosen-rtl .chosen-single .search-choice-close{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 0 3px 5px;padding:3px 5px 3px 20px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:3px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl .chosen-search input[type=text]{padding:5px 5px 5px 20px;background:url('data:image/svg+xml;charset=US-ASCII,') no-repeat left 5px top 55%;background-size:15px 15px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background:url('data:image/svg+xml;charset=US-ASCII,') no-repeat left 5px top 52%;background-size:15px 15px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background:url('data:image/svg+xml;charset=US-ASCII,') no-repeat left 5px top 52%;background-size:15px 15px} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-chosen-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-chosen-rtl.min.css deleted file mode 100644 index 502b3bff..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-chosen-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -.chosen-container{font-size:14px}.chosen-container-active.chosen-with-drop .chosen-single,.chosen-container-multi .search-field,.chosen-container-single .chosen-single{background:#fff url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat left 5px top 55%;background-size:16px 16px;border:1px solid #7e8993;box-shadow:0 0 0 transparent;color:#32373c}.chosen-container-multi .chosen-choices,.chosen-container-single .chosen-single{border-radius:4px;border-color:#7e8993}.chosen-container-active.chosen-with-drop .chosen-single,.chosen-container-multi.chosen-with-drop .chosen-choices{box-shadow:0 1px 1px rgba(0,0,0,.04)}.chosen-container-multi.chosen-container-active.chosen-dropup .chosen-choices,.chosen-container-single.chosen-container-active.chosen-with-drop.chosen-dropup .chosen-single{border-radius:0 0 4px 4px;border-width:0 1px;z-index:1011}.chosen-container .chosen-drop{position:absolute;top:100%;z-index:1010;width:100%;border-radius:0 0 4px 4px;border-width:0 1px;border-color:transparent;background:#fff;outline:2px solid transparent}.chosen-container-single .chosen-single div b{background-image:none}.chosen-container-single .chosen-search:after{display:block;position:absolute;left:6px;top:50%;font-family:dashicons;font-size:17px;content:"";transform:translateY(-50%)}.chosen-container-single.chosen-container-active.chosen-with-drop .chosen-single{border-radius:4px 4px 0 0}.chosen-container-single .chosen-single div{width:26px}.chosen-container-single .chosen-default{color:#32373c}.chosen-container-active .chosen-single{border-color:transparent;outline:2px solid transparent}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 5px 4px 20px;width:100%!important;height:auto;outline:0;border:1px solid #7e8993;border-radius:4px;line-height:normal;box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.chosen-container-single.chosen-container-active.chosen-with-drop .chosen-single,.chosen-container-single .chosen-single{min-height:30px}@media screen and (max-width:782px){.chosen-container-single.chosen-container-active.chosen-with-drop .chosen-single,.chosen-container-single .chosen-single{font-size:16px;line-height:1.625;min-height:40px;padding:5px 8px}}.chosen-container-multi .search-field{border:none}.chosen-container-multi.chosen-with-drop .chosen-choices{border-bottom-color:transparent}.chosen-container-multi .chosen-choices li.search-field{min-width:100px!important;width:100%}.chosen-container-multi .chosen-choices li.search-field input[type=text]{color:#32373c;font-family:unset;height:unset;margin:0;padding:3px 10px;width:100%!important}.chosen-container-multi .spinner{position:absolute;top:4px;left:-4px}.chosen-container-multi .chosen-choices li.search-choice{margin:3px 0 3px 5px;padding:5px 5px 5px 22px;border:1px solid #7e8993;max-width:100%;border-radius:4px;background:#f4f4f4;box-shadow:none;color:#32373c;cursor:default}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;left:3px;display:block;width:15px;height:15px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before{height:15px;width:15px;position:absolute;top:0;left:0;color:#32373c;font-family:dashicons;content:"";font-size:15px;line-height:1}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover:before{color:#537994}.chosen-container .chosen-results{color:#537994;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 0 4px 4px;padding:0 4px 0 0;max-height:240px}.chosen-container .chosen-results li.highlighted{background-image:none;border-radius:4px;color:#fff}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}:root body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}:root body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}:root body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}:root body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}:root body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}:root body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}:root body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}:root body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}:root body.admin-color-evergreen{--wp-admin-theme-color:#36533f;--wp-admin-theme-color-darker-10:#2c4433;--wp-admin-theme-color-darker-20:#223428}:root body.admin-color-mint{--wp-admin-theme-color:#4f6d59;--wp-admin-theme-color-darker-10:#445e4d;--wp-admin-theme-color-darker-20:#3a4f41}.chosen-container.chosen-container-active .chosen-choices,.chosen-container.chosen-container-active .chosen-single,.chosen-with-drop.chosen-dropup .chosen-drop{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.chosen-container-active.chosen-dropup .chosen-choices,.chosen-container .chosen-drop,.chosen-with-drop.chosen-dropup .chosen-single{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 1px 0 1px #007cba;box-shadow:0 1px 0 1px var(--wp-admin-theme-color)}.chosen-container .chosen-results li.highlighted{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.edd-select-chosen{width:100%;max-width:300px}.edd-select-chosen.edd-customer-select{width:100%!important}.edd-select-chosen.edd-time{width:55px;max-width:55px}@media screen and (max-width:782px){.edd-select-chosen.edd-time{width:70px;max-width:70px}} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-chosen.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-chosen.min.css deleted file mode 100644 index ecfa687b..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-chosen.min.css +++ /dev/null @@ -1 +0,0 @@ -.chosen-container{font-size:14px}.chosen-container-active.chosen-with-drop .chosen-single,.chosen-container-multi .search-field,.chosen-container-single .chosen-single{background:#fff url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat right 5px top 55%;background-size:16px 16px;border:1px solid #7e8993;box-shadow:0 0 0 transparent;color:#32373c}.chosen-container-multi .chosen-choices,.chosen-container-single .chosen-single{border-radius:4px;border-color:#7e8993}.chosen-container-active.chosen-with-drop .chosen-single,.chosen-container-multi.chosen-with-drop .chosen-choices{box-shadow:0 1px 1px rgba(0,0,0,.04)}.chosen-container-multi.chosen-container-active.chosen-dropup .chosen-choices,.chosen-container-single.chosen-container-active.chosen-with-drop.chosen-dropup .chosen-single{border-radius:0 0 4px 4px;border-width:0 1px;z-index:1011}.chosen-container .chosen-drop{position:absolute;top:100%;z-index:1010;width:100%;border-radius:0 0 4px 4px;border-width:0 1px;border-color:transparent;background:#fff;outline:2px solid transparent}.chosen-container-single .chosen-single div b{background-image:none}.chosen-container-single .chosen-search:after{display:block;position:absolute;right:6px;top:50%;font-family:dashicons;font-size:17px;content:"";transform:translateY(-50%)}.chosen-container-single.chosen-container-active.chosen-with-drop .chosen-single{border-radius:4px 4px 0 0}.chosen-container-single .chosen-single div{width:26px}.chosen-container-single .chosen-default{color:#32373c}.chosen-container-active .chosen-single{border-color:transparent;outline:2px solid transparent}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%!important;height:auto;outline:0;border:1px solid #7e8993;border-radius:4px;line-height:normal;box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.chosen-container-single.chosen-container-active.chosen-with-drop .chosen-single,.chosen-container-single .chosen-single{min-height:30px}@media screen and (max-width:782px){.chosen-container-single.chosen-container-active.chosen-with-drop .chosen-single,.chosen-container-single .chosen-single{font-size:16px;line-height:1.625;min-height:40px;padding:5px 8px}}.chosen-container-multi .search-field{border:none}.chosen-container-multi.chosen-with-drop .chosen-choices{border-bottom-color:transparent}.chosen-container-multi .chosen-choices li.search-field{min-width:100px!important;width:100%}.chosen-container-multi .chosen-choices li.search-field input[type=text]{color:#32373c;font-family:unset;height:unset;margin:0;padding:3px 10px;width:100%!important}.chosen-container-multi .spinner{position:absolute;top:4px;right:-4px}.chosen-container-multi .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:5px 22px 5px 5px;border:1px solid #7e8993;max-width:100%;border-radius:4px;background:#f4f4f4;box-shadow:none;color:#32373c;cursor:default}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:15px;height:15px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:before{height:15px;width:15px;position:absolute;top:0;right:0;color:#32373c;font-family:dashicons;content:"";font-size:15px;line-height:1}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover:before{color:#537994}.chosen-container .chosen-results{color:#537994;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px}.chosen-container .chosen-results li.highlighted{background-image:none;border-radius:4px;color:#fff}:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}:root body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}:root body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}:root body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}:root body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}:root body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}:root body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}:root body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}:root body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}:root body.admin-color-evergreen{--wp-admin-theme-color:#36533f;--wp-admin-theme-color-darker-10:#2c4433;--wp-admin-theme-color-darker-20:#223428}:root body.admin-color-mint{--wp-admin-theme-color:#4f6d59;--wp-admin-theme-color-darker-10:#445e4d;--wp-admin-theme-color-darker-20:#3a4f41}.chosen-container.chosen-container-active .chosen-choices,.chosen-container.chosen-container-active .chosen-single,.chosen-with-drop.chosen-dropup .chosen-drop{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px #007cba;box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.chosen-container-active.chosen-dropup .chosen-choices,.chosen-container .chosen-drop,.chosen-with-drop.chosen-dropup .chosen-single{border-color:#007cba;border-color:var(--wp-admin-theme-color);box-shadow:0 1px 0 1px #007cba;box-shadow:0 1px 0 1px var(--wp-admin-theme-color)}.chosen-container .chosen-results li.highlighted{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.edd-select-chosen{width:100%;max-width:300px}.edd-select-chosen.edd-customer-select{width:100%!important}.edd-select-chosen.edd-time{width:55px;max-width:55px}@media screen and (max-width:782px){.edd-select-chosen.edd-time{width:70px;max-width:70px}} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-datepicker-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-datepicker-rtl.min.css deleted file mode 100644 index 7151c1aa..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-datepicker-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-datepicker{padding:0;margin:0;border-radius:0;background-color:#fff;border:1px solid #dfdfdf;border-top:none;box-shadow:0 3px 6px rgba(0,0,0,.075);min-width:17em;width:auto;z-index:1000!important}.edd-datepicker *{padding:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;border-radius:0}.edd-datepicker table{font-size:13px;margin:0;border:none;border-collapse:collapse}.edd-datepicker .ui-datepicker-header,.edd-datepicker .ui-widget-header{background-image:none;border:none;color:#fff;font-weight:400;padding:.2em 0}.edd-datepicker .ui-datepicker-header .ui-state-hover{background:transparent;border-color:transparent;cursor:pointer}.edd-datepicker .ui-datepicker-title{margin:0;padding:10px 0;color:#fff;font-size:14px;line-height:14px;text-align:center}.edd-datepicker .ui-datepicker-next,.edd-datepicker .ui-datepicker-prev{position:relative;top:0;height:34px;width:34px}.edd-datepicker .ui-state-hover.ui-datepicker-next,.edd-datepicker .ui-state-hover.ui-datepicker-prev{border:none}.edd-datepicker .ui-datepicker-prev,.edd-datepicker .ui-datepicker-prev-hover{right:0}.edd-datepicker .ui-datepicker-next,.edd-datepicker .ui-datepicker-next-hover{left:0}.edd-datepicker .ui-datepicker-next span,.edd-datepicker .ui-datepicker-prev span{display:none}.edd-datepicker .ui-datepicker-prev{float:right}.edd-datepicker .ui-datepicker-next{float:left}.edd-datepicker .ui-datepicker-next:before,.edd-datepicker .ui-datepicker-prev:before{font:normal 20px/34px dashicons;padding-right:7px;color:#fff;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:34px;height:34px}.edd-datepicker .ui-datepicker-prev:before{content:""}.edd-datepicker .ui-datepicker-next:before{content:""}.edd-datepicker .ui-datepicker-next-hover:before,.edd-datepicker .ui-datepicker-prev-hover:before{opacity:.7}.edd-datepicker select.ui-datepicker-month,.edd-datepicker select.ui-datepicker-year{width:33%}.edd-datepicker thead{color:#fff;font-weight:600}.edd-datepicker th{padding:10px}.edd-datepicker td{padding:0;border:1px solid #f4f4f4}.edd-datepicker td.ui-datepicker-other-month{border:transparent}.edd-datepicker tr:first-of-type td{border-top:1px solid #f0f0f0}.edd-datepicker td.ui-datepicker-week-end{background-color:#f4f4f4;border:1px solid #f0f0f0}.edd-datepicker td.ui-datepicker-today{background-color:#f0f0c0}.edd-datepicker td.ui-datepicker-current-day{background:#bd8}.edd-datepicker td .ui-state-default{background:transparent;border:none;text-align:center;text-decoration:none;width:auto;display:block;padding:5px 10px;font-weight:400;color:#444}.edd-datepicker td.ui-state-disabled .ui-state-default{opacity:.5}.edd-datepicker .ui-datepicker-header,.edd-datepicker .ui-widget-header{background:#00a0d2}.edd-datepicker thead{background:#32373c}.edd-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.admin-color-fresh .edd-datepicker .ui-datepicker-header,.admin-color-fresh .edd-datepicker .ui-widget-header{background:#00a0d2}.admin-color-fresh .edd-datepicker thead{background:#32373c}.admin-color-fresh .edd-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.admin-color-blue .edd-datepicker .ui-datepicker-header,.admin-color-blue .edd-datepicker .ui-widget-header{background:#52accc}.admin-color-blue .edd-datepicker thead{background:#4796b3}.admin-color-blue .edd-datepicker td .ui-state-hover{background:#096484;color:#fff}.admin-color-coffee .edd-datepicker .ui-datepicker-header,.admin-color-coffee .edd-datepicker .ui-widget-header{background:#59524c}.admin-color-coffee .edd-datepicker thead{background:#46403c}.admin-color-coffee .edd-datepicker td .ui-state-hover{background:#c7a589;color:#fff}.admin-color-ectoplasm .edd-datepicker .ui-datepicker-header,.admin-color-ectoplasm .edd-datepicker .ui-widget-header{background:#523f6d}.admin-color-ectoplasm .edd-datepicker thead{background:#413256}.admin-color-ectoplasm .edd-datepicker td .ui-state-hover{background:#a3b745;color:#fff}.admin-color-midnight .edd-datepicker .ui-datepicker-header,.admin-color-midnight .edd-datepicker .ui-widget-header{background:#363b3f}.admin-color-midnight .edd-datepicker thead{background:#26292c}.admin-color-midnight .edd-datepicker td .ui-state-hover{background:#e14d43;color:#fff}.admin-color-ocean .edd-datepicker .ui-datepicker-header,.admin-color-ocean .edd-datepicker .ui-widget-header{background:#738e96}.admin-color-ocean .edd-datepicker thead{background:#627c83}.admin-color-ocean .edd-datepicker td .ui-state-hover{background:#9ebaa0;color:#fff}.admin-color-sunrise .edd-datepicker .ui-datepicker-header,.admin-color-sunrise .edd-datepicker .ui-datepicker-header .ui-state-hover,.admin-color-sunrise .edd-datepicker .ui-widget-header{background:#cf4944}.admin-color-sunrise .edd-datepicker th{border-color:#be3631;background:#be3631}.admin-color-sunrise .edd-datepicker td .ui-state-hover{background:#dd823b;color:#fff}.admin-color-light .edd-datepicker .ui-datepicker-header,.admin-color-light .edd-datepicker .ui-widget-header{background:#e5e5e5}.admin-color-light .edd-datepicker thead{background:#888}.admin-color-light .edd-datepicker .ui-datepicker-next:before,.admin-color-light .edd-datepicker .ui-datepicker-prev:before,.admin-color-light .edd-datepicker .ui-datepicker-title,.admin-color-light .edd-datepicker td .ui-state-default{color:#555}.admin-color-light .edd-datepicker td .ui-state-hover{background:#e5e5e5}.admin-color-bbp-evergreen .edd-datepicker .ui-datepicker-header,.admin-color-bbp-evergreen .edd-datepicker .ui-widget-header{background:#56b274}.admin-color-bbp-evergreen .edd-datepicker thead{background:#36533f}.admin-color-bbp-evergreen .edd-datepicker td .ui-state-hover{background:#446950;color:#fff}.admin-color-bbp-mint .edd-datepicker .ui-datepicker-header,.admin-color-bbp-mint .edd-datepicker .ui-widget-header{background:#4ca26a}.admin-color-bbp-mint .edd-datepicker thead{background:#4f6d59}.admin-color-bbp-mint .edd-datepicker td .ui-state-hover{background:#5fb37c;color:#fff} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-datepicker.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-datepicker.min.css deleted file mode 100644 index 0b357d49..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-datepicker.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-datepicker{padding:0;margin:0;border-radius:0;background-color:#fff;border:1px solid #dfdfdf;border-top:none;box-shadow:0 3px 6px rgba(0,0,0,.075);min-width:17em;width:auto;z-index:1000!important}.edd-datepicker *{padding:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;border-radius:0}.edd-datepicker table{font-size:13px;margin:0;border:none;border-collapse:collapse}.edd-datepicker .ui-datepicker-header,.edd-datepicker .ui-widget-header{background-image:none;border:none;color:#fff;font-weight:400;padding:.2em 0}.edd-datepicker .ui-datepicker-header .ui-state-hover{background:transparent;border-color:transparent;cursor:pointer}.edd-datepicker .ui-datepicker-title{margin:0;padding:10px 0;color:#fff;font-size:14px;line-height:14px;text-align:center}.edd-datepicker .ui-datepicker-next,.edd-datepicker .ui-datepicker-prev{position:relative;top:0;height:34px;width:34px}.edd-datepicker .ui-state-hover.ui-datepicker-next,.edd-datepicker .ui-state-hover.ui-datepicker-prev{border:none}.edd-datepicker .ui-datepicker-prev,.edd-datepicker .ui-datepicker-prev-hover{left:0}.edd-datepicker .ui-datepicker-next,.edd-datepicker .ui-datepicker-next-hover{right:0}.edd-datepicker .ui-datepicker-next span,.edd-datepicker .ui-datepicker-prev span{display:none}.edd-datepicker .ui-datepicker-prev{float:left}.edd-datepicker .ui-datepicker-next{float:right}.edd-datepicker .ui-datepicker-next:before,.edd-datepicker .ui-datepicker-prev:before{font:normal 20px/34px dashicons;padding-left:7px;color:#fff;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:34px;height:34px}.edd-datepicker .ui-datepicker-prev:before{content:""}.edd-datepicker .ui-datepicker-next:before{content:""}.edd-datepicker .ui-datepicker-next-hover:before,.edd-datepicker .ui-datepicker-prev-hover:before{opacity:.7}.edd-datepicker select.ui-datepicker-month,.edd-datepicker select.ui-datepicker-year{width:33%}.edd-datepicker thead{color:#fff;font-weight:600}.edd-datepicker th{padding:10px}.edd-datepicker td{padding:0;border:1px solid #f4f4f4}.edd-datepicker td.ui-datepicker-other-month{border:transparent}.edd-datepicker tr:first-of-type td{border-top:1px solid #f0f0f0}.edd-datepicker td.ui-datepicker-week-end{background-color:#f4f4f4;border:1px solid #f0f0f0}.edd-datepicker td.ui-datepicker-today{background-color:#f0f0c0}.edd-datepicker td.ui-datepicker-current-day{background:#bd8}.edd-datepicker td .ui-state-default{background:transparent;border:none;text-align:center;text-decoration:none;width:auto;display:block;padding:5px 10px;font-weight:400;color:#444}.edd-datepicker td.ui-state-disabled .ui-state-default{opacity:.5}.edd-datepicker .ui-datepicker-header,.edd-datepicker .ui-widget-header{background:#00a0d2}.edd-datepicker thead{background:#32373c}.edd-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.admin-color-fresh .edd-datepicker .ui-datepicker-header,.admin-color-fresh .edd-datepicker .ui-widget-header{background:#00a0d2}.admin-color-fresh .edd-datepicker thead{background:#32373c}.admin-color-fresh .edd-datepicker td .ui-state-hover{background:#0073aa;color:#fff}.admin-color-blue .edd-datepicker .ui-datepicker-header,.admin-color-blue .edd-datepicker .ui-widget-header{background:#52accc}.admin-color-blue .edd-datepicker thead{background:#4796b3}.admin-color-blue .edd-datepicker td .ui-state-hover{background:#096484;color:#fff}.admin-color-coffee .edd-datepicker .ui-datepicker-header,.admin-color-coffee .edd-datepicker .ui-widget-header{background:#59524c}.admin-color-coffee .edd-datepicker thead{background:#46403c}.admin-color-coffee .edd-datepicker td .ui-state-hover{background:#c7a589;color:#fff}.admin-color-ectoplasm .edd-datepicker .ui-datepicker-header,.admin-color-ectoplasm .edd-datepicker .ui-widget-header{background:#523f6d}.admin-color-ectoplasm .edd-datepicker thead{background:#413256}.admin-color-ectoplasm .edd-datepicker td .ui-state-hover{background:#a3b745;color:#fff}.admin-color-midnight .edd-datepicker .ui-datepicker-header,.admin-color-midnight .edd-datepicker .ui-widget-header{background:#363b3f}.admin-color-midnight .edd-datepicker thead{background:#26292c}.admin-color-midnight .edd-datepicker td .ui-state-hover{background:#e14d43;color:#fff}.admin-color-ocean .edd-datepicker .ui-datepicker-header,.admin-color-ocean .edd-datepicker .ui-widget-header{background:#738e96}.admin-color-ocean .edd-datepicker thead{background:#627c83}.admin-color-ocean .edd-datepicker td .ui-state-hover{background:#9ebaa0;color:#fff}.admin-color-sunrise .edd-datepicker .ui-datepicker-header,.admin-color-sunrise .edd-datepicker .ui-datepicker-header .ui-state-hover,.admin-color-sunrise .edd-datepicker .ui-widget-header{background:#cf4944}.admin-color-sunrise .edd-datepicker th{border-color:#be3631;background:#be3631}.admin-color-sunrise .edd-datepicker td .ui-state-hover{background:#dd823b;color:#fff}.admin-color-light .edd-datepicker .ui-datepicker-header,.admin-color-light .edd-datepicker .ui-widget-header{background:#e5e5e5}.admin-color-light .edd-datepicker thead{background:#888}.admin-color-light .edd-datepicker .ui-datepicker-next:before,.admin-color-light .edd-datepicker .ui-datepicker-prev:before,.admin-color-light .edd-datepicker .ui-datepicker-title,.admin-color-light .edd-datepicker td .ui-state-default{color:#555}.admin-color-light .edd-datepicker td .ui-state-hover{background:#e5e5e5}.admin-color-bbp-evergreen .edd-datepicker .ui-datepicker-header,.admin-color-bbp-evergreen .edd-datepicker .ui-widget-header{background:#56b274}.admin-color-bbp-evergreen .edd-datepicker thead{background:#36533f}.admin-color-bbp-evergreen .edd-datepicker td .ui-state-hover{background:#446950;color:#fff}.admin-color-bbp-mint .edd-datepicker .ui-datepicker-header,.admin-color-bbp-mint .edd-datepicker .ui-widget-header{background:#4ca26a}.admin-color-bbp-mint .edd-datepicker thead{background:#4f6d59}.admin-color-bbp-mint .edd-datepicker td .ui-state-hover{background:#5fb37c;color:#fff} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-email-tags-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-email-tags-rtl.min.css deleted file mode 100644 index 30fcdedc..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-email-tags-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-email-tags-filter{margin:-15px -15px 15px;padding:15px;border-bottom:1px solid #ddd;background:#f3f3f3}.edd-email-tags-filter-search{padding:10px;width:100%;font-size:20px}.edd-email-tags-list{margin:0}.edd-email-tags-list-item{margin-bottom:15px}.edd-email-tags-list-item::last-child{margin-bottom:0}.edd-email-tags-list-button{cursor:pointer;color:#666;text-align:right;padding:.8rem;width:100%;background:none;border:1px solid #ddd;border-radius:3px}.edd-email-tags-list-button:hover{background:#fafafa}.edd-email-tags-list-button strong{color:#444;font-size:14px;margin-bottom:8px}.edd-email-tags-list-button code{margin-right:10px}.edd-email-tags-list-button span{display:block;margin-top:10px} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-email-tags.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-email-tags.min.css deleted file mode 100644 index 018479f4..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-email-tags.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-email-tags-filter{margin:-15px -15px 15px;padding:15px;border-bottom:1px solid #ddd;background:#f3f3f3}.edd-email-tags-filter-search{padding:10px;width:100%;font-size:20px}.edd-email-tags-list{margin:0}.edd-email-tags-list-item{margin-bottom:15px}.edd-email-tags-list-item::last-child{margin-bottom:0}.edd-email-tags-list-button{cursor:pointer;color:#666;text-align:left;padding:.8rem;width:100%;background:none;border:1px solid #ddd;border-radius:3px}.edd-email-tags-list-button:hover{background:#fafafa}.edd-email-tags-list-button strong{color:#444;font-size:14px;margin-bottom:8px}.edd-email-tags-list-button code{margin-left:10px}.edd-email-tags-list-button span{display:block;margin-top:10px} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-extension-manager-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-extension-manager-rtl.min.css deleted file mode 100644 index 1e5a349a..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-extension-manager-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-extension-manager__bar{justify-content:space-between;flex-wrap:wrap}.edd-extension-manager__bar,.edd-extension-manager__bar-heading{display:flex;align-items:center;gap:1em}.edd-extension-manager__bar input[type=search]{background-color:#fff;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBjbGFzcz0idy02IGgtNiI+PHBhdGggc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMjEgMjFsLTUuMTk3LTUuMTk3bTAgMEE3LjUgNy41IDAgMTA1LjE5NiA1LjE5NmE3LjUgNy41IDAgMDAxMC42MDcgMTAuNjA3eiIvPjwvc3ZnPg==);background-size:1em;background-repeat:no-repeat;background-position:3%}.edd-extension-manager__bar input[type=search]:active,.edd-extension-manager__bar input[type=search]:focus,.edd-extension-manager__bar input[type=search]:hover{background-image:none}.edd-extension-manager__body{display:-ms-grid;display:grid;gap:1.5em;-ms-grid-rows:auto 1fr;grid-template-rows:auto 1fr;flex-grow:1}.edd-extension-manager__body img{max-width:100%}.edd-extension-manager__body .notice{max-width:320px}.edd-extension-manager__title{line-height:1.4;margin:0 0 1em 1em}.edd-extension-manager__title a{color:#32373c}.button.edd-extension-manager__action-upgrade{background-color:#008a20;color:#fff}.button.edd-extension-manager__action-upgrade:active,.button.edd-extension-manager__action-upgrade:hover{background-color:#005714;color:#fff}.edd-extension-manager__card--installer .button{display:flex;justify-content:center;align-items:center;gap:5px;margin:0}.edd-extension-manager__card--installer .button:before{margin:0}.edd-extension-manager__card--installer .button.edd-button__install{color:#32373c;border-color:#7e8993}.edd-extension-manager__card--installer .button.edd-button__install:before{content:" ";display:block;width:1em;height:1em;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05LjExMiAxdjUuMDc2aDEuODUydi43NEw4IDkuNzgyIDUuMDM2IDYuODE3di0uNzQxaDEuODUzVjFoMi4yMjN6bS01LjkyOCA5LjE1MnYxLjg1Mmg5LjYzM3YtMS44NTJoMi45NjR2NC44MTZILjIxOXYtNC44MTdoMi45NjV6IiBmaWxsPSIjOTk5Ii8+PC9zdmc+);background-size:1em}.edd-extension-manager__card--installer .button.edd-button__install.edd-updating:before{background:none;animation:edd-spinning 1.5s linear infinite;animation-play-state:inherit;border:2px solid #f9f9f9;border-bottom-color:#7e8993;border-radius:100%;content:"";width:12px;height:12px;transform:translate3d(50%,-50%,0);will-change:transform}.edd-extension-manager__control{display:flex;align-items:center;gap:.5em;min-height:30px}.edd-extension-manager__control .edd-button__toggle{position:relative;margin:0;padding:0;width:36px;height:20px;min-height:unset;background-color:#c3c4c7;transition:background .2s ease;border-radius:30px;box-shadow:none;border:none}.edd-extension-manager__control .edd-button__toggle:after{position:absolute;content:"";height:14px;width:14px;right:3px;bottom:3px;background-color:#fff;transition:transform .1s ease;border-radius:50%}.edd-plugin__active .edd-extension-manager__control .edd-button__toggle:after{transform:translateX(-16px)}.edd-extension-manager__control .edd-button__toggle:active,.edd-extension-manager__control .edd-button__toggle:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px #7e8993}.edd-extension-manager__control .edd-button__toggle:hover{background-color:#7e8993}.edd-extension-manager__control .edd-button__toggle:disabled{background-color:#7e8993!important}.edd-extension-manager__control .edd-button__toggle:disabled:before{position:absolute;top:3px;animation:edd-spinning 1.5s linear infinite;animation-play-state:inherit;border:2px solid #7e8993;border-bottom-color:#f9f9f9;border-radius:100%;content:"";width:10px;height:10px;transform:translate3d(50%,-50%,0);will-change:transform}.edd-extension-manager__control .edd-button__toggle:disabled:after{display:none}.edd-plugin__active .edd-extension-manager__control .edd-button__toggle{background-color:var(--wp-admin-theme-color)}.edd-plugin__active .edd-extension-manager__control .edd-button__toggle :active,.edd-plugin__active .edd-extension-manager__control .edd-button__toggle :focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color)}@media screen and (max-width:782px){.edd-extension-manager__control{min-height:40px}}a.button.edd-extension-manager__button-settings{display:none;position:absolute;top:1em;left:1em;min-height:unset;height:1.5em;width:1.5em;padding:1em;border:none;background-color:#f9f9f9}a.button.edd-extension-manager__button-settings,a.button.edd-extension-manager__button-settings:active,a.button.edd-extension-manager__button-settings:hover{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS4yOSA2LjI5M2wtMS41MTUuODc1YTUuODczIDUuODczIDAgMDEwIDEuNjY0bDEuNTE1Ljg3NS0yLjE2NiAzLjc1My0xLjUxNi0uODc1YTUuODI3IDUuODI3IDAgMDEtMS40NDEuODMzdjEuNzQ5SDUuODM0di0xLjc1YTUuODI1IDUuODI1IDAgMDEtMS40NDEtLjgzMmwtMS41MTYuODc1TC43MSA5LjcwN2wxLjUxNi0uODc1YTUuODc4IDUuODc4IDAgMDEwLTEuNjY0TC43MSA2LjI5MyAyLjg3NyAyLjU0bDEuNTE2Ljg3NmE1LjgyNyA1LjgyNyAwIDAxMS40NC0uODMzVi44MzNoNC4zMzR2MS43NWE1LjgzIDUuODMgMCAwMTEuNDQuODMzbDEuNTE3LS44NzYgMi4xNjYgMy43NTN6TTggMTAuMzMzYTIuMzMzIDIuMzMzIDAgMTAwLTQuNjY2IDIuMzMzIDIuMzMzIDAgMDAwIDQuNjY2eiIgZmlsbD0iIzZCNzI4MCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTUuMjkgNi4yOTNsLTEuNTE1Ljg3NWE1Ljg3MyA1Ljg3MyAwIDAxMCAxLjY2NGwxLjUxNS44NzUtMi4xNjYgMy43NTMtMS41MTYtLjg3NWE1LjgyNyA1LjgyNyAwIDAxLTEuNDQxLjgzM3YxLjc0OUg1LjgzNHYtMS43NWE1LjgyNSA1LjgyNSAwIDAxLTEuNDQxLS44MzJsLTEuNTE2Ljg3NUwuNzEgOS43MDdsMS41MTYtLjg3NWE1Ljg3OCA1Ljg3OCAwIDAxMC0xLjY2NEwuNzEgNi4yOTMgMi44NzcgMi41NGwxLjUxNi44NzZhNS44MjcgNS44MjcgMCAwMTEuNDQtLjgzM1YuODMzaDQuMzM0djEuNzVhNS44MyA1LjgzIDAgMDExLjQ0LjgzM2wxLjUxNy0uODc2IDIuMTY2IDMuNzUzek04IDEwLjMzM2EyLjMzMyAyLjMzMyAwIDEwMC00LjY2NiAyLjMzMyAyLjMzMyAwIDAwMCA0LjY2NnoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iLjUiLz48L3N2Zz4=);background-size:1.25em;background-repeat:no-repeat;background-position:50%}.edd-plugin__active a.button.edd-extension-manager__button-settings{display:block}.edd-extension-manager__card{background-color:#fff;padding:2em;margin:0;display:flex;flex-direction:column;justify-content:space-between}.edd-extension-manager__card.edd-hidden{display:none}.inside .edd-extension-manager__card{padding:0}.edd-extension-manager__features ul{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}.edd-extension-manager__features .dashicons-yes{color:#008a20;margin-left:.25em}.edd-extension-manager__wrap{max-width:1440px}.edd-extension-manager__card-group{transition:all .5s}@supports(grid-area:auto){.edd-extension-manager__card-group{display:grid;grid-template-columns:auto;gap:1em;margin-top:24px}}.edd-extension-manager__group{display:-ms-grid;display:grid}.edd-extension-manager__unlock{margin-top:4em}.edd-extension-manager__icon{border:1px solid #e0e0e0;border-radius:4px;width:78px;height:78px}.edd-extension-manager__icon img{border-radius:12px;display:block;margin:0;padding:9px;width:60px}.edd-extension-manager__image img{display:block;margin:0 auto;max-width:500px;width:100%}.edd-extension-manager__card--installer{border:1px solid #dcdcde;border-radius:3px;padding:0}.edd-extension-manager__card--installer>div{padding:2em}.edd-extension-manager__card--installer>div:not(:last-child){border-bottom:1px solid #e0e0e0}.edd-extension-manager__card--installer .notice{margin:0 -1em!important}.edd-extension-manager__card--installer .notice:not(:last-child){margin-bottom:1em}.edd-extension-manager__card--installer .edd-extension-manager__body{-ms-grid-columns:80px 1fr;grid-template-columns:80px 1fr;-ms-grid-rows:unset;grid-template-rows:unset;position:relative}.edd-extension-manager__card--installer .edd-extension-manager__body p:last-child{margin-bottom:0}.edd-extension-manager__card--installer .edd-extension-manager__actions{background:#f9f9f9;display:flex;justify-content:space-between;align-items:center;padding:1em 2em}.edd-extension-manager__card--installer .edd-extension-manager__actions>:only-child{margin-right:auto}.edd-extension-manager__card--installer .edd-extension-manager__status{font-weight:600}.edd-extension-manager__key-notice{background:#fff;border:1px solid #d63638;border-radius:4px;padding:1em}.edd-extension-manager__key-notice p:first-child{margin-top:0}.edd-extension-manager__step{-ms-grid-row:1;grid-area:1/-1;margin:0}.edd-extension-manager__step:not(:first-of-type){display:none}.edd-extension-manager__step .button{display:table;margin:0 auto;text-align:center;white-space:normal}td .edd-extension-manager__step .button{display:inline-block}.edd-extension-manager__card--horizontal{margin:24px 0;max-width:700px}.edd-extension-manager__card--detailed{background-color:transparent;max-width:700px}.edd-extension-manager__card--detailed-2col{background-color:transparent;max-width:900px}.edd-extension-manager__card--detailed-2col .edd-extension-manager__title,.edd-extension-manager__card--detailed .edd-extension-manager__title{border-bottom:1px solid #ccc;padding-bottom:1em}@media screen and (min-width:600px){.edd-extension-manager__card-group{grid-template-columns:repeat(auto-fill,minmax(340px,1fr))}.edd-extension-manager__card--horizontal .edd-extension-manager__body{-ms-grid-columns:minmax(0,300px) 1fr;grid-template-columns:minmax(0,300px) 1fr;-ms-grid-rows:1fr auto;grid-template-rows:1fr auto;grid-auto-flow:column}.edd-extension-manager__card--horizontal .edd-extension-manager__image{-ms-grid-row:1;-ms-grid-row-span:3;grid-row:1/4}.edd-extension-manager__card--horizontal .edd-extension-manager__description,.edd-extension-manager__features{-ms-grid-row-align:center;align-self:center}}@media screen and (min-width:783px){.edd-extension-manager__card--detailed-2col .edd-extension-manager__body{-ms-grid-columns:minmax(0,375px) 1fr;grid-template-columns:minmax(0,375px) 1fr;grid-auto-flow:column}} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-extension-manager.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-extension-manager.min.css deleted file mode 100644 index 461982d9..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-extension-manager.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-extension-manager__bar{justify-content:space-between;flex-wrap:wrap}.edd-extension-manager__bar,.edd-extension-manager__bar-heading{display:flex;align-items:center;gap:1em}.edd-extension-manager__bar input[type=search]{background-color:#fff;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBjbGFzcz0idy02IGgtNiI+PHBhdGggc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBkPSJNMjEgMjFsLTUuMTk3LTUuMTk3bTAgMEE3LjUgNy41IDAgMTA1LjE5NiA1LjE5NmE3LjUgNy41IDAgMDAxMC42MDcgMTAuNjA3eiIvPjwvc3ZnPg==);background-size:1em;background-repeat:no-repeat;background-position:97%}.edd-extension-manager__bar input[type=search]:active,.edd-extension-manager__bar input[type=search]:focus,.edd-extension-manager__bar input[type=search]:hover{background-image:none}.edd-extension-manager__body{display:-ms-grid;display:grid;gap:1.5em;-ms-grid-rows:auto 1fr;grid-template-rows:auto 1fr;flex-grow:1}.edd-extension-manager__body img{max-width:100%}.edd-extension-manager__body .notice{max-width:320px}.edd-extension-manager__title{line-height:1.4;margin:0 1em 1em 0}.edd-extension-manager__title a{color:#32373c}.button.edd-extension-manager__action-upgrade{background-color:#008a20;color:#fff}.button.edd-extension-manager__action-upgrade:active,.button.edd-extension-manager__action-upgrade:hover{background-color:#005714;color:#fff}.edd-extension-manager__card--installer .button{display:flex;justify-content:center;align-items:center;gap:5px;margin:0}.edd-extension-manager__card--installer .button:before{margin:0}.edd-extension-manager__card--installer .button.edd-button__install{color:#32373c;border-color:#7e8993}.edd-extension-manager__card--installer .button.edd-button__install:before{content:" ";display:block;width:1em;height:1em;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05LjExMiAxdjUuMDc2aDEuODUydi43NEw4IDkuNzgyIDUuMDM2IDYuODE3di0uNzQxaDEuODUzVjFoMi4yMjN6bS01LjkyOCA5LjE1MnYxLjg1Mmg5LjYzM3YtMS44NTJoMi45NjR2NC44MTZILjIxOXYtNC44MTdoMi45NjV6IiBmaWxsPSIjOTk5Ii8+PC9zdmc+);background-size:1em}.edd-extension-manager__card--installer .button.edd-button__install.edd-updating:before{background:none;animation:edd-spinning 1.5s linear infinite;animation-play-state:inherit;border:2px solid #f9f9f9;border-bottom-color:#7e8993;border-radius:100%;content:"";width:12px;height:12px;transform:translate3d(-50%,-50%,0);will-change:transform}.edd-extension-manager__control{display:flex;align-items:center;gap:.5em;min-height:30px}.edd-extension-manager__control .edd-button__toggle{position:relative;margin:0;padding:0;width:36px;height:20px;min-height:unset;background-color:#c3c4c7;transition:background .2s ease;border-radius:30px;box-shadow:none;border:none}.edd-extension-manager__control .edd-button__toggle:after{position:absolute;content:"";height:14px;width:14px;left:3px;bottom:3px;background-color:#fff;transition:transform .1s ease;border-radius:50%}.edd-plugin__active .edd-extension-manager__control .edd-button__toggle:after{transform:translateX(16px)}.edd-extension-manager__control .edd-button__toggle:active,.edd-extension-manager__control .edd-button__toggle:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px #7e8993}.edd-extension-manager__control .edd-button__toggle:hover{background-color:#7e8993}.edd-extension-manager__control .edd-button__toggle:disabled{background-color:#7e8993!important}.edd-extension-manager__control .edd-button__toggle:disabled:before{position:absolute;top:3px;animation:edd-spinning 1.5s linear infinite;animation-play-state:inherit;border:2px solid #7e8993;border-bottom-color:#f9f9f9;border-radius:100%;content:"";width:10px;height:10px;transform:translate3d(-50%,-50%,0);will-change:transform}.edd-extension-manager__control .edd-button__toggle:disabled:after{display:none}.edd-plugin__active .edd-extension-manager__control .edd-button__toggle{background-color:var(--wp-admin-theme-color)}.edd-plugin__active .edd-extension-manager__control .edd-button__toggle :active,.edd-plugin__active .edd-extension-manager__control .edd-button__toggle :focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color)}@media screen and (max-width:782px){.edd-extension-manager__control{min-height:40px}}a.button.edd-extension-manager__button-settings{display:none;position:absolute;top:1em;right:1em;min-height:unset;height:1.5em;width:1.5em;padding:1em;border:none;background-color:#f9f9f9}a.button.edd-extension-manager__button-settings,a.button.edd-extension-manager__button-settings:active,a.button.edd-extension-manager__button-settings:hover{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS4yOSA2LjI5M2wtMS41MTUuODc1YTUuODczIDUuODczIDAgMDEwIDEuNjY0bDEuNTE1Ljg3NS0yLjE2NiAzLjc1My0xLjUxNi0uODc1YTUuODI3IDUuODI3IDAgMDEtMS40NDEuODMzdjEuNzQ5SDUuODM0di0xLjc1YTUuODI1IDUuODI1IDAgMDEtMS40NDEtLjgzMmwtMS41MTYuODc1TC43MSA5LjcwN2wxLjUxNi0uODc1YTUuODc4IDUuODc4IDAgMDEwLTEuNjY0TC43MSA2LjI5MyAyLjg3NyAyLjU0bDEuNTE2Ljg3NmE1LjgyNyA1LjgyNyAwIDAxMS40NC0uODMzVi44MzNoNC4zMzR2MS43NWE1LjgzIDUuODMgMCAwMTEuNDQuODMzbDEuNTE3LS44NzYgMi4xNjYgMy43NTN6TTggMTAuMzMzYTIuMzMzIDIuMzMzIDAgMTAwLTQuNjY2IDIuMzMzIDIuMzMzIDAgMDAwIDQuNjY2eiIgZmlsbD0iIzZCNzI4MCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTUuMjkgNi4yOTNsLTEuNTE1Ljg3NWE1Ljg3MyA1Ljg3MyAwIDAxMCAxLjY2NGwxLjUxNS44NzUtMi4xNjYgMy43NTMtMS41MTYtLjg3NWE1LjgyNyA1LjgyNyAwIDAxLTEuNDQxLjgzM3YxLjc0OUg1LjgzNHYtMS43NWE1LjgyNSA1LjgyNSAwIDAxLTEuNDQxLS44MzJsLTEuNTE2Ljg3NUwuNzEgOS43MDdsMS41MTYtLjg3NWE1Ljg3OCA1Ljg3OCAwIDAxMC0xLjY2NEwuNzEgNi4yOTMgMi44NzcgMi41NGwxLjUxNi44NzZhNS44MjcgNS44MjcgMCAwMTEuNDQtLjgzM1YuODMzaDQuMzM0djEuNzVhNS44MyA1LjgzIDAgMDExLjQ0LjgzM2wxLjUxNy0uODc2IDIuMTY2IDMuNzUzek04IDEwLjMzM2EyLjMzMyAyLjMzMyAwIDEwMC00LjY2NiAyLjMzMyAyLjMzMyAwIDAwMCA0LjY2NnoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iLjUiLz48L3N2Zz4=);background-size:1.25em;background-repeat:no-repeat;background-position:50%}.edd-plugin__active a.button.edd-extension-manager__button-settings{display:block}.edd-extension-manager__card{background-color:#fff;padding:2em;margin:0;display:flex;flex-direction:column;justify-content:space-between}.edd-extension-manager__card.edd-hidden{display:none}.inside .edd-extension-manager__card{padding:0}.edd-extension-manager__features ul{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}.edd-extension-manager__features .dashicons-yes{color:#008a20;margin-right:.25em}.edd-extension-manager__wrap{max-width:1440px}.edd-extension-manager__card-group{transition:all .5s}@supports(grid-area:auto){.edd-extension-manager__card-group{display:grid;grid-template-columns:auto;gap:1em;margin-top:24px}}.edd-extension-manager__group{display:-ms-grid;display:grid}.edd-extension-manager__unlock{margin-top:4em}.edd-extension-manager__icon{border:1px solid #e0e0e0;border-radius:4px;width:78px;height:78px}.edd-extension-manager__icon img{border-radius:12px;display:block;margin:0;padding:9px;width:60px}.edd-extension-manager__image img{display:block;margin:0 auto;max-width:500px;width:100%}.edd-extension-manager__card--installer{border:1px solid #dcdcde;border-radius:3px;padding:0}.edd-extension-manager__card--installer>div{padding:2em}.edd-extension-manager__card--installer>div:not(:last-child){border-bottom:1px solid #e0e0e0}.edd-extension-manager__card--installer .notice{margin:0 -1em!important}.edd-extension-manager__card--installer .notice:not(:last-child){margin-bottom:1em}.edd-extension-manager__card--installer .edd-extension-manager__body{-ms-grid-columns:80px 1fr;grid-template-columns:80px 1fr;-ms-grid-rows:unset;grid-template-rows:unset;position:relative}.edd-extension-manager__card--installer .edd-extension-manager__body p:last-child{margin-bottom:0}.edd-extension-manager__card--installer .edd-extension-manager__actions{background:#f9f9f9;display:flex;justify-content:space-between;align-items:center;padding:1em 2em}.edd-extension-manager__card--installer .edd-extension-manager__actions>:only-child{margin-left:auto}.edd-extension-manager__card--installer .edd-extension-manager__status{font-weight:600}.edd-extension-manager__key-notice{background:#fff;border:1px solid #d63638;border-radius:4px;padding:1em}.edd-extension-manager__key-notice p:first-child{margin-top:0}.edd-extension-manager__step{-ms-grid-row:1;grid-area:1/-1;margin:0}.edd-extension-manager__step:not(:first-of-type){display:none}.edd-extension-manager__step .button{display:table;margin:0 auto;text-align:center;white-space:normal}td .edd-extension-manager__step .button{display:inline-block}.edd-extension-manager__card--horizontal{margin:24px 0;max-width:700px}.edd-extension-manager__card--detailed{background-color:transparent;max-width:700px}.edd-extension-manager__card--detailed-2col{background-color:transparent;max-width:900px}.edd-extension-manager__card--detailed-2col .edd-extension-manager__title,.edd-extension-manager__card--detailed .edd-extension-manager__title{border-bottom:1px solid #ccc;padding-bottom:1em}@media screen and (min-width:600px){.edd-extension-manager__card-group{grid-template-columns:repeat(auto-fill,minmax(340px,1fr))}.edd-extension-manager__card--horizontal .edd-extension-manager__body{-ms-grid-columns:minmax(0,300px) 1fr;grid-template-columns:minmax(0,300px) 1fr;-ms-grid-rows:1fr auto;grid-template-rows:1fr auto;grid-auto-flow:column}.edd-extension-manager__card--horizontal .edd-extension-manager__image{-ms-grid-row:1;-ms-grid-row-span:3;grid-row:1/4}.edd-extension-manager__card--horizontal .edd-extension-manager__description,.edd-extension-manager__features{-ms-grid-row-align:center;align-self:center}}@media screen and (min-width:783px){.edd-extension-manager__card--detailed-2col .edd-extension-manager__body{-ms-grid-columns:minmax(0,375px) 1fr;grid-template-columns:minmax(0,375px) 1fr;grid-auto-flow:column}} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-menu-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-menu-rtl.min.css deleted file mode 100644 index e919591e..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-menu-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -#menu-posts-download .wp-submenu{display:flex;flex-wrap:wrap}#menu-posts-download .wp-submenu li{width:100%}#menu-posts-download a[href^="edit.php?post_type=download"]:focus,#menu-posts-download a[href^="edit.php?post_type=download"]:hover{box-shadow:inset -4px 0 0 0 currentColor;transition:box-shadow .1s linear}#menu-posts-download li>a[href^="post-new.php?post_type=download"]{display:none}#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(2) a:after{border-bottom:1px solid hsla(0,0%,100%,.2);display:block;float:right;margin:13px -15px 8px;content:"";width:calc(100% + 26px)}@media screen and (max-width:782px){#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(2) a:after{margin:20px -20px 8px;width:calc(100% + 30px)}}#adminmenu #menu-posts-download ul.wp-submenu-wrap li{clear:both}#adminmenu #menu-posts-download a.wp-has-current-submenu:after{display:none}ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before{left:0;content:" ";height:0;width:0;position:absolute;pointer-events:none;border:8px solid transparent;border-left-color:#f6f7f7;margin-top:2px}a.edd-onboarding__menu-item{background:#dd823b!important;color:#fff!important;font-weight:600}a.edd-onboarding__menu-item:hover{color:#000!important}a.edd-sidebar__upgrade-pro,a.edd-sidebar__upgrade-pro:hover{background-color:#1da867!important;color:#fff!important;font-weight:600} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-menu.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-menu.min.css deleted file mode 100644 index 127c61d4..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-menu.min.css +++ /dev/null @@ -1 +0,0 @@ -#menu-posts-download .wp-submenu{display:flex;flex-wrap:wrap}#menu-posts-download .wp-submenu li{width:100%}#menu-posts-download a[href^="edit.php?post_type=download"]:focus,#menu-posts-download a[href^="edit.php?post_type=download"]:hover{box-shadow:inset 4px 0 0 0 currentColor;transition:box-shadow .1s linear}#menu-posts-download li>a[href^="post-new.php?post_type=download"]{display:none}#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(2) a:after{border-bottom:1px solid hsla(0,0%,100%,.2);display:block;float:left;margin:13px -15px 8px;content:"";width:calc(100% + 26px)}@media screen and (max-width:782px){#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-discount"]:after,#menu-posts-download li:not(:last-child) a[href^="edit.php?post_type=download&page=edd-reports"]:after,#menu-posts-download li:not(:last-child) a[href^="post-new.php?post_type=download"]:after,#menu-posts-download li:nth-last-child(2) a:after{margin:20px -20px 8px;width:calc(100% + 30px)}}#adminmenu #menu-posts-download ul.wp-submenu-wrap li{clear:both}#adminmenu #menu-posts-download a.wp-has-current-submenu:after{display:none}ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before{right:0;content:" ";height:0;width:0;position:absolute;pointer-events:none;border:8px solid transparent;border-right-color:#f6f7f7;margin-top:2px}a.edd-onboarding__menu-item{background:#dd823b!important;color:#fff!important;font-weight:600}a.edd-onboarding__menu-item:hover{color:#000!important}a.edd-sidebar__upgrade-pro,a.edd-sidebar__upgrade-pro:hover{background-color:#1da867!important;color:#fff!important;font-weight:600} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-onboarding-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-onboarding-rtl.min.css deleted file mode 100644 index 5232aacb..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-onboarding-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}:root body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}:root body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}:root body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}:root body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}:root body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}:root body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}:root body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}:root body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}:root body.admin-color-evergreen{--wp-admin-theme-color:#36533f;--wp-admin-theme-color-darker-10:#2c4433;--wp-admin-theme-color-darker-20:#223428}:root body.admin-color-mint{--wp-admin-theme-color:#4f6d59;--wp-admin-theme-color-darker-10:#445e4d;--wp-admin-theme-color-darker-20:#3a4f41}.edd-onboarding{margin-top:80px}.edd-onboarding__logo img{display:block;width:300px;margin:0 auto 25px}.edd-onboarding__wrapper{max-width:1000px;margin:0 auto;position:relative}@media only screen and (max-width:1280px){.edd-onboarding__wrapper{max-width:850px}}.edd-onboarding__loading{z-index:99;position:fixed;right:0;top:0;width:100%;height:100%;padding-right:80px;padding-top:8px;display:flex;gap:20px;flex-wrap:wrap;align-items:center;justify-content:center;text-align:center}.edd-onboarding__loading:before{position:absolute;animation:edd-spinning 1.5s linear infinite;animation-play-state:inherit;border:2px solid #7e8993;border-bottom-color:#f9f9f9;border-radius:100%;content:"";width:35px;height:35px;transform:translate3d(50%,-50%,0);will-change:transform}.edd-onboarding__loading .edd-onboarding__loading-status{display:block;text-align:center;color:#000;flex-basis:100%;margin-top:80px}@media only screen and (max-width:600px){.edd-onboarding__loading{padding-right:0}}.edd-onboarding__loading-in-progress .edd-onboarding__single-step,.edd-onboarding__loading-in-progress .edd-onboarding__welcome-screen{position:relative}.edd-onboarding__loading-in-progress .edd-onboarding__single-step:before,.edd-onboarding__loading-in-progress .edd-onboarding__welcome-screen:before{content:"";position:absolute;right:0;top:0;width:100%;height:100%;background:hsla(0,0%,100%,.85);z-index:95}.edd-onboarding__steps{margin-top:25px}.edd-onboarding__steps ul{display:flex;gap:15px;position:relative}.edd-onboarding__steps ul:before{position:absolute;top:16px;right:50%;transform:translateX(50%);width:80%;height:2px;background:#dedfe0;content:"";z-index:-1}.edd-onboarding__steps ul li{flex:1;text-align:center}.edd-onboarding__steps ul li a{display:block;padding:5px 10px;color:#8a8e92;text-align:center;font-size:12px;text-decoration:none}.edd-onboarding__steps ul li a span{color:#fff;width:25px;height:25px;line-height:25px;font-size:12px;font-weight:400;border-radius:50%;background:#c2c4c6;display:inline-block;text-align:center;margin-bottom:10px;position:relative;box-shadow:none}.edd-onboarding__steps ul li a span:before{left:-8px}.edd-onboarding__steps ul li a span:after,.edd-onboarding__steps ul li a span:before{position:absolute;top:50%;transform:translateY(-50%);width:8px;height:10px;background:#f0f0f1;content:"";z-index:-1}.edd-onboarding__steps ul li a span:after{right:-8px}.edd-onboarding__steps ul li.active-step a,.edd-onboarding__steps ul li.active-step a small{color:#007cba;color:var(--wp-admin-theme-color);font-weight:500}.edd-onboarding__steps ul li.active-step a span{background:#007cba;background:var(--wp-admin-theme-color);box-shadow:0 0 4px 1px rgba(#007cba,.3);box-shadow:0 0 4px 1px rgba(var(--wp-admin-theme-color),.3)}.edd-onboarding__steps ul li.completed-step a span{width:25px;height:25px;line-height:25px;font-size:14px;background:#00ba37;box-shadow:none}.edd-onboarding__steps__name{color:#646970;display:block;font-size:11px}@media only screen and (max-width:600px){.edd-onboarding__steps ul li.completed-step a span,.edd-onboarding__steps ul li a span{width:20px;height:20px;line-height:20px}.edd-onboarding__steps__name{font-size:10px}}.edd-onboarding__current-step{position:relative}.edd-onboarding__single-step{background:#fff;border:1px solid #dedfe0;border-radius:3px;position:relative}.edd-onboarding__single-step-inner{padding:70px 140px 40px}.edd-onboarding__single-step-inner.equal{padding:70px 140px}@media only screen and (max-width:960px){.edd-onboarding__single-step-inner{padding:35px 70px 20px}.edd-onboarding__single-step-inner.equal{padding:35px 70px}}@media only screen and (max-width:600px){.edd-onboarding__single-step-inner{padding:17px 35px 10px}.edd-onboarding__single-step-inner.equal{padding:17px 35px}}.edd-onboarding__steps-indicator{opacity:.6;display:block}h1.edd-onboarding__single-step-title{font-size:24px;color:#141b38;font-weight:600}.edd-onboarding__single-step-subtitle{font-size:16px;line-height:22px;color:#141b38;font-weight:400;max-width:90%}.edd-onboarding__welcome-screen{width:100%;height:100%;background:#fff;display:flex;align-items:center}.edd-onboarding__welcome-screen h1{line-height:2rem}.edd-onboarding__welcome-screen-inner{padding:100px 80px;text-align:center}.edd-onboarding__testimonials-wrapper{display:-ms-grid;display:grid;gap:1em}.edd-onboarding__testimonial{display:flex;font-size:1rem;text-align:right;justify-content:space-between;gap:2em;align-items:center}.edd-onboarding__testimonial:not(:last-of-type){border-bottom:1px solid #dedfe0;padding-bottom:2em}.edd-onboarding__testimonial-content{flex-grow:1}.edd-onboarding__testimonial-content>span.big{font-weight:600;font-size:15px;font-style:italic}.edd-onboarding__testimonial-avatar{width:75px;height:75px;border-radius:50%;display:block}.edd-onboarding__testimonial-info{display:flex;flex-direction:column;gap:.25em}.edd-onboarding__testimonial-info>.testimonial-name{font-weight:600}.edd-onboarding__testimonial-info>.testimonial-company{font-size:10px;font-style:italic}.edd-onboarding__testimonial-info>.testimonial-stars>span{color:#ffbb38;font-size:12px;height:12px;width:12px}.edd-onboarding__welcome-screen-get-started{color:#fff!important;background:#00ba37!important;border-color:#00ba37!important;margin:1em auto!important}.edd-onboarding__welcome-screen-get-started:hover{color:#fff!important;background:#008a20!important}.edd-onboarding__plugins-list{border-top:1px solid hsla(0,0%,92.9%,.5)}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin{padding:28px 20px;border-bottom:1px solid hsla(0,0%,92.9%,.5);border-right:1px solid hsla(0,0%,92.9%,.5);border-left:1px solid hsla(0,0%,92.9%,.5);transition:all .25s ease-out}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin h3{margin-top:0;transition:all .25s ease-out}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin p{margin-bottom:0;transition:all .25s ease-out}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin .edd-onboarding__plugins-control{width:100px;display:flex;justify-content:flex-end}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin .edd-onboarding__plugins-control .checkbox-control{padding:0;margin:0;position:relative}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin .edd-onboarding__plugins-control .checkbox-control__indicator{position:relative;top:0}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin .edd-onboarding__plugins-external-link{text-decoration:none}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin .edd-onboarding__plugins-details label{display:flex;align-items:center;justify-content:space-between;gap:1em}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin.disabled,.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin.disabled:hover{background:rgba(114,178,129,.04)}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin:hover{background:rgba(#007cba,.02);background:rgba(var(--wp-admin-theme-color),.02)}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin:hover .edd-onboarding__plugins-details h3,.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin:hover .edd-onboarding__plugins-details p{color:#007cba;color:var(--wp-admin-theme-color)}.edd-onboarding__single-step-footer{border-top:1px solid #ededed;padding:35px 50px;display:flex;justify-content:space-between;align-items:center}.edd-onboarding__single-step-footer .edd-onboarding__button-back{color:#787c82;text-decoration:none;transition:all .2s ease-in-out;background:none;border:none;cursor:pointer}.edd-onboarding__single-step-footer .edd-onboarding__button-back:hover{color:#007cba;color:var(--wp-admin-theme-color)}.edd-onboarding__single-step-footer .edd-onboarding__button-skip-step{opacity:.6}@media only screen and (max-width:600px){.edd-onboarding__single-step-footer{padding:17px 25px;flex-wrap:wrap;gap:5px}}.edd-onboarding__close-and-exit{text-align:center;margin-top:20px}.edd-onboarding__close-and-exit button.button-link{color:#8a8e92!important;text-decoration:none!important}@media only screen and (max-width:782px){.edd-form-group__control{display:flex;align-items:center;gap:10px}}.edd-onboarding input:not([type=checkbox]):not([type=radio]){border:1px solid #dedfe0!important;border-radius:2px!important;padding:2px 8px!important;width:100%}.edd-onboarding .quicktags-toolbar input.ed_button{width:auto}.edd-onboarding .edd-check-wrapper{display:flex;align-items:center}.wp-core-ui .edd-onboarding select{font-size:14px;line-height:2;border-color:#dedfe0;box-shadow:none;border-radius:2px;padding:0 8px 0 24px;min-height:30px;max-width:25rem;-webkit-appearance:none;background-size:16px 16px;cursor:pointer;vertical-align:middle}.edd-onboarding .form-table th{vertical-align:middle}.edd-onboarding .form-table,.edd-onboarding .form-table td,.edd-onboarding .form-table td p{color:#8a8e92;font-size:13px;line-height:18px}.edd-onboarding .form-table th,.edd-onboarding .form-wrap label{color:#141b38;font-weight:400;text-shadow:none;vertical-align:baseline}.edd-onboarding td[colspan="2"]{padding:0}.edd-onboarding__stripe-features-listing{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));list-style-type:none;margin-right:0;padding-right:0;margin-top:20px}.edd-onboarding__stripe-features-listing li{list-style-type:none;position:relative;padding-right:28px;color:#3c434a;font-size:12px;margin-bottom:10px;margin-left:10px}.edd-onboarding__stripe-features-listing li:before{position:absolute;top:0;right:0;content:"✓";background:#e9e4fe;color:#635bff;width:20px;height:20px;line-height:20px;text-align:center;border-radius:50%;display:inline-block}.edd-onboarding__stripe-content-holder{max-width:75%;margin:25px auto;background:rgba(241,238,250,.3);padding:50px 40px;border-radius:4px;border:1px solid rgba(241,238,250,.5)}.edd-onboarding__stripe-content-holder .edd-onboarding__stripe-content-logo{text-align:center;margin-bottom:25px;border-bottom:1px solid #ededed;padding-bottom:25px}.edd-onboarding__stripe-content-holder .edd-onboarding__stripe-content-logo img{max-width:180px}.edd-onboarding__stripe-content-holder .edd-onboarding__stripe-content-logo span{text-align:center;font-size:13px;line-height:20px;display:block;max-width:300px;margin:0 auto}@media only screen and (max-width:960px){.edd-onboarding__stripe-content-holder{padding:25px 20px;max-width:100%}}.edd-onboarding__button-stripe{display:block;text-align:center;margin-top:20px}#edds-stripe-disconnect-reconnect{margin-top:10px}.edd-onboarding__stripe-features-title{display:block;text-align:center;font-size:16px;margin-bottom:10px;color:#625bff;font-weight:500}.edd-onboarding__stripe-additional-text{text-align:center;font-size:11px;line-height:14px;display:block;max-width:400px;margin:30px auto 0;opacity:.6}.checkbox-control{position:relative;padding-right:30px;margin-bottom:15px;cursor:pointer;font-size:18px}.checkbox-control input{position:absolute;z-index:-1;opacity:0}.checkbox-control__indicator{position:absolute;top:2px;right:0;height:25px;width:25px;background:#f0f0f1;border-radius:3px}.checkbox-control:hover input~.checkbox-control__indicator,.checkbox-control input:focus~.checkbox-control__indicator{background:#eaeaec}.checkbox-control:hover input:not([disabled]):checked~.checkbox-control__indicator,.checkbox-control input:checked:focus~.checkbox-control__indicator,.checkbox-control input:checked~.checkbox-control__indicator{background:#007cba;background:var(--wp-admin-theme-color)}.checkbox-control input:disabled~.checkbox-control__indicator{background:#00ba37;pointer-events:none}.checkbox-control__indicator:after{content:"";position:absolute;display:none}.checkbox-control input:checked~.checkbox-control__indicator:after{display:block}.checkbox-control--checkbox .checkbox-control__indicator:after{right:9px;top:4px;width:5px;height:12px;border:solid #fff;border-width:0 0 2.5px 2.5px;transform:rotate(-40deg)}.checkbox-control--checkbox input:disabled~.checkbox-control__indicator:after{border-color:#fff}.checkbox-control.small-checkbox{padding-right:24px;margin-bottom:10px;font-size:13px}.small-checkbox .checkbox-control__indicator{top:0;right:0;height:17px;width:17px;background:#eaeaec}.checkbox-control.small-checkbox:hover input~.checkbox-control__indicator,.checkbox-control.small-checkbox input:focus~.checkbox-control__indicator{background:#dedfe0}.checkbox-control.small-checkbox:hover input:not([disabled]):checked~.checkbox-control__indicator,.checkbox-control.small-checkbox input:checked:focus~.checkbox-control__indicator,.checkbox-control.small-checkbox input:checked~.checkbox-control__indicator{background:#007cba;background:var(--wp-admin-theme-color)}.checkbox-control.small-checkbox input:disabled~.checkbox-control__indicator{background:#72b281}.checkbox-control--checkbox.small-checkbox .checkbox-control__indicator:after{right:6px;top:2.5px;width:3px;height:8px;border:solid #f6f7f7;border-width:0 0 2px 2px;transform:rotate(-40deg)}.edd-onboarding__get-suggestions-section{margin-top:30px;text-align:center;padding:50px 50px 40px;background:rgba(12,93,149,.04);border-radius:2px;border:1px solid rgba(12,93,149,.06)}.edd-onboarding__get-suggestions-section h3{margin-top:0;line-height:25px}.edd-onboarding__get-suggestions-section .edd-onboarding__get-suggestions-section_label{display:block;margin-bottom:1em}.edd-onboarding__selected-plugins{text-align:center;margin-top:25px}.edd-onboarding__install-success-wrapper{z-index:99;position:fixed;right:0;top:0;width:100%;height:100%;padding-right:80px;padding-top:8px;display:flex;align-items:center;justify-content:center;font-size:21px}.edd-onboarding__install-success-wrapper .edd-onboarding__install-success{display:flex;flex-wrap:wrap;gap:25px;text-align:center}.edd-onboarding__install-success-wrapper .edd-onboarding__install-success span{display:block;flex-basis:100%}.edd-onboarding__install-success-wrapper .edd-onboarding__install-success .emoji{font-size:65px}@media only screen and (max-width:960px){.edd-onboarding__install-success-wrapper{padding-right:0}}.edd-onboarding__product-files-row td,.edd-onboarding__product-pricing-row td{padding:0}.edd-onboarding__product-image-wrapper{display:flex;justify-content:space-between;gap:4px}.edd-onboarding__pricing-option-pill{display:flex}.edd-onboarding__pricing-option-pill button{display:inline-block;flex:1;border:1px solid #ccc;padding:10px 15px;cursor:pointer}.edd-onboarding__pricing-option-pill button:hover:not(.active){background:#dbdcdd}.edd-onboarding__pricing-option-pill .left-option{border-top-right-radius:2px;border-bottom-right-radius:2px}.edd-onboarding__pricing-option-pill .right-option{border-right:none;border-top-left-radius:2px;border-bottom-left-radius:2px}.edd-onboarding__pricing-option-pill .active{background:#007cba;background:var(--wp-admin-theme-color);border-color:#007cba;border-color:var(--wp-admin-theme-color);border-left-color:#ccc;color:#fff}.no-table-row-padding td{padding:0}.edd-onboarding__product-variable-price{display:none}.edd-onboarding__multi-option-toggle,.edd-onboarding__upload-files-toggle{display:flex;align-items:center}.edd-onboarding__multi-option-toggle span,.edd-onboarding__upload-files-toggle span{margin-right:10px}.edd-onboarding__upload-files-toggle span{color:#1d2327;font-size:1.3em;font-weight:600;display:block;margin-top:1em;margin-bottom:1em}.edd-onboarding__pricing-options-label{display:block;color:#141b38;font-weight:400;text-shadow:none;vertical-align:baseline;font-size:14px;margin-top:20px;margin-bottom:20px}.edd-add-repeatable-row{border-top:none;padding-top:8px;margin-bottom:5px}.edd-onboarding__actions{display:flex;gap:1em;justify-content:center;margin-top:2em}.edd-onboarding__actions button.edd-promo-notice-dismiss{margin:0} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-onboarding.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-onboarding.min.css deleted file mode 100644 index 41bff714..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-onboarding.min.css +++ /dev/null @@ -1 +0,0 @@ -:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87}:root body.admin-color-light{--wp-admin-theme-color:#0085ba;--wp-admin-theme-color-darker-10:#0073a1;--wp-admin-theme-color-darker-20:#006187}:root body.admin-color-modern{--wp-admin-theme-color:#3858e9;--wp-admin-theme-color-darker-10:#2145e6;--wp-admin-theme-color-darker-20:#183ad6}:root body.admin-color-blue{--wp-admin-theme-color:#096484;--wp-admin-theme-color-darker-10:#07526c;--wp-admin-theme-color-darker-20:#064054}:root body.admin-color-coffee{--wp-admin-theme-color:#46403c;--wp-admin-theme-color-darker-10:#383330;--wp-admin-theme-color-darker-20:#2b2724}:root body.admin-color-ectoplasm{--wp-admin-theme-color:#523f6d;--wp-admin-theme-color-darker-10:#46365d;--wp-admin-theme-color-darker-20:#3a2c4d}:root body.admin-color-midnight{--wp-admin-theme-color:#e14d43;--wp-admin-theme-color-darker-10:#dd382d;--wp-admin-theme-color-darker-20:#d02c21}:root body.admin-color-ocean{--wp-admin-theme-color:#627c83;--wp-admin-theme-color-darker-10:#576e74;--wp-admin-theme-color-darker-20:#4c6066}:root body.admin-color-sunrise{--wp-admin-theme-color:#dd823b;--wp-admin-theme-color-darker-10:#d97426;--wp-admin-theme-color-darker-20:#c36922}:root body.admin-color-evergreen{--wp-admin-theme-color:#36533f;--wp-admin-theme-color-darker-10:#2c4433;--wp-admin-theme-color-darker-20:#223428}:root body.admin-color-mint{--wp-admin-theme-color:#4f6d59;--wp-admin-theme-color-darker-10:#445e4d;--wp-admin-theme-color-darker-20:#3a4f41}.edd-onboarding{margin-top:80px}.edd-onboarding__logo img{display:block;width:300px;margin:0 auto 25px}.edd-onboarding__wrapper{max-width:1000px;margin:0 auto;position:relative}@media only screen and (max-width:1280px){.edd-onboarding__wrapper{max-width:850px}}.edd-onboarding__loading{z-index:99;position:fixed;left:0;top:0;width:100%;height:100%;padding-left:80px;padding-top:8px;display:flex;gap:20px;flex-wrap:wrap;align-items:center;justify-content:center;text-align:center}.edd-onboarding__loading:before{position:absolute;animation:edd-spinning 1.5s linear infinite;animation-play-state:inherit;border:2px solid #7e8993;border-bottom-color:#f9f9f9;border-radius:100%;content:"";width:35px;height:35px;transform:translate3d(-50%,-50%,0);will-change:transform}.edd-onboarding__loading .edd-onboarding__loading-status{display:block;text-align:center;color:#000;flex-basis:100%;margin-top:80px}@media only screen and (max-width:600px){.edd-onboarding__loading{padding-left:0}}.edd-onboarding__loading-in-progress .edd-onboarding__single-step,.edd-onboarding__loading-in-progress .edd-onboarding__welcome-screen{position:relative}.edd-onboarding__loading-in-progress .edd-onboarding__single-step:before,.edd-onboarding__loading-in-progress .edd-onboarding__welcome-screen:before{content:"";position:absolute;left:0;top:0;width:100%;height:100%;background:hsla(0,0%,100%,.85);z-index:95}.edd-onboarding__steps{margin-top:25px}.edd-onboarding__steps ul{display:flex;gap:15px;position:relative}.edd-onboarding__steps ul:before{position:absolute;top:16px;left:50%;transform:translateX(-50%);width:80%;height:2px;background:#dedfe0;content:"";z-index:-1}.edd-onboarding__steps ul li{flex:1;text-align:center}.edd-onboarding__steps ul li a{display:block;padding:5px 10px;color:#8a8e92;text-align:center;font-size:12px;text-decoration:none}.edd-onboarding__steps ul li a span{color:#fff;width:25px;height:25px;line-height:25px;font-size:12px;font-weight:400;border-radius:50%;background:#c2c4c6;display:inline-block;text-align:center;margin-bottom:10px;position:relative;box-shadow:none}.edd-onboarding__steps ul li a span:before{right:-8px}.edd-onboarding__steps ul li a span:after,.edd-onboarding__steps ul li a span:before{position:absolute;top:50%;transform:translateY(-50%);width:8px;height:10px;background:#f0f0f1;content:"";z-index:-1}.edd-onboarding__steps ul li a span:after{left:-8px}.edd-onboarding__steps ul li.active-step a,.edd-onboarding__steps ul li.active-step a small{color:#007cba;color:var(--wp-admin-theme-color);font-weight:500}.edd-onboarding__steps ul li.active-step a span{background:#007cba;background:var(--wp-admin-theme-color);box-shadow:0 0 4px 1px rgba(#007cba,.3);box-shadow:0 0 4px 1px rgba(var(--wp-admin-theme-color),.3)}.edd-onboarding__steps ul li.completed-step a span{width:25px;height:25px;line-height:25px;font-size:14px;background:#00ba37;box-shadow:none}.edd-onboarding__steps__name{color:#646970;display:block;font-size:11px}@media only screen and (max-width:600px){.edd-onboarding__steps ul li.completed-step a span,.edd-onboarding__steps ul li a span{width:20px;height:20px;line-height:20px}.edd-onboarding__steps__name{font-size:10px}}.edd-onboarding__current-step{position:relative}.edd-onboarding__single-step{background:#fff;border:1px solid #dedfe0;border-radius:3px;position:relative}.edd-onboarding__single-step-inner{padding:70px 140px 40px}.edd-onboarding__single-step-inner.equal{padding:70px 140px}@media only screen and (max-width:960px){.edd-onboarding__single-step-inner{padding:35px 70px 20px}.edd-onboarding__single-step-inner.equal{padding:35px 70px}}@media only screen and (max-width:600px){.edd-onboarding__single-step-inner{padding:17px 35px 10px}.edd-onboarding__single-step-inner.equal{padding:17px 35px}}.edd-onboarding__steps-indicator{opacity:.6;display:block}h1.edd-onboarding__single-step-title{font-size:24px;color:#141b38;font-weight:600}.edd-onboarding__single-step-subtitle{font-size:16px;line-height:22px;color:#141b38;font-weight:400;max-width:90%}.edd-onboarding__welcome-screen{width:100%;height:100%;background:#fff;display:flex;align-items:center}.edd-onboarding__welcome-screen h1{line-height:2rem}.edd-onboarding__welcome-screen-inner{padding:100px 80px;text-align:center}.edd-onboarding__testimonials-wrapper{display:-ms-grid;display:grid;gap:1em}.edd-onboarding__testimonial{display:flex;font-size:1rem;text-align:left;justify-content:space-between;gap:2em;align-items:center}.edd-onboarding__testimonial:not(:last-of-type){border-bottom:1px solid #dedfe0;padding-bottom:2em}.edd-onboarding__testimonial-content{flex-grow:1}.edd-onboarding__testimonial-content>span.big{font-weight:600;font-size:15px;font-style:italic}.edd-onboarding__testimonial-avatar{width:75px;height:75px;border-radius:50%;display:block}.edd-onboarding__testimonial-info{display:flex;flex-direction:column;gap:.25em}.edd-onboarding__testimonial-info>.testimonial-name{font-weight:600}.edd-onboarding__testimonial-info>.testimonial-company{font-size:10px;font-style:italic}.edd-onboarding__testimonial-info>.testimonial-stars>span{color:#ffbb38;font-size:12px;height:12px;width:12px}.edd-onboarding__welcome-screen-get-started{color:#fff!important;background:#00ba37!important;border-color:#00ba37!important;margin:1em auto!important}.edd-onboarding__welcome-screen-get-started:hover{color:#fff!important;background:#008a20!important}.edd-onboarding__plugins-list{border-top:1px solid hsla(0,0%,92.9%,.5)}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin{padding:28px 20px;border-bottom:1px solid hsla(0,0%,92.9%,.5);border-left:1px solid hsla(0,0%,92.9%,.5);border-right:1px solid hsla(0,0%,92.9%,.5);transition:all .25s ease-out}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin h3{margin-top:0;transition:all .25s ease-out}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin p{margin-bottom:0;transition:all .25s ease-out}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin .edd-onboarding__plugins-control{width:100px;display:flex;justify-content:flex-end}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin .edd-onboarding__plugins-control .checkbox-control{padding:0;margin:0;position:relative}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin .edd-onboarding__plugins-control .checkbox-control__indicator{position:relative;top:0}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin .edd-onboarding__plugins-external-link{text-decoration:none}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin .edd-onboarding__plugins-details label{display:flex;align-items:center;justify-content:space-between;gap:1em}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin.disabled,.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin.disabled:hover{background:rgba(114,178,129,.04)}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin:hover{background:rgba(#007cba,.02);background:rgba(var(--wp-admin-theme-color),.02)}.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin:hover .edd-onboarding__plugins-details h3,.edd-onboarding__plugins-list .edd-onboarding__plugins-plugin:hover .edd-onboarding__plugins-details p{color:#007cba;color:var(--wp-admin-theme-color)}.edd-onboarding__single-step-footer{border-top:1px solid #ededed;padding:35px 50px;display:flex;justify-content:space-between;align-items:center}.edd-onboarding__single-step-footer .edd-onboarding__button-back{color:#787c82;text-decoration:none;transition:all .2s ease-in-out;background:none;border:none;cursor:pointer}.edd-onboarding__single-step-footer .edd-onboarding__button-back:hover{color:#007cba;color:var(--wp-admin-theme-color)}.edd-onboarding__single-step-footer .edd-onboarding__button-skip-step{opacity:.6}@media only screen and (max-width:600px){.edd-onboarding__single-step-footer{padding:17px 25px;flex-wrap:wrap;gap:5px}}.edd-onboarding__close-and-exit{text-align:center;margin-top:20px}.edd-onboarding__close-and-exit button.button-link{color:#8a8e92!important;text-decoration:none!important}@media only screen and (max-width:782px){.edd-form-group__control{display:flex;align-items:center;gap:10px}}.edd-onboarding input:not([type=checkbox]):not([type=radio]){border:1px solid #dedfe0!important;border-radius:2px!important;padding:2px 8px!important;width:100%}.edd-onboarding .quicktags-toolbar input.ed_button{width:auto}.edd-onboarding .edd-check-wrapper{display:flex;align-items:center}.wp-core-ui .edd-onboarding select{font-size:14px;line-height:2;border-color:#dedfe0;box-shadow:none;border-radius:2px;padding:0 24px 0 8px;min-height:30px;max-width:25rem;-webkit-appearance:none;background-size:16px 16px;cursor:pointer;vertical-align:middle}.edd-onboarding .form-table th{vertical-align:middle}.edd-onboarding .form-table,.edd-onboarding .form-table td,.edd-onboarding .form-table td p{color:#8a8e92;font-size:13px;line-height:18px}.edd-onboarding .form-table th,.edd-onboarding .form-wrap label{color:#141b38;font-weight:400;text-shadow:none;vertical-align:baseline}.edd-onboarding td[colspan="2"]{padding:0}.edd-onboarding__stripe-features-listing{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));list-style-type:none;margin-left:0;padding-left:0;margin-top:20px}.edd-onboarding__stripe-features-listing li{list-style-type:none;position:relative;padding-left:28px;color:#3c434a;font-size:12px;margin-bottom:10px;margin-right:10px}.edd-onboarding__stripe-features-listing li:before{position:absolute;top:0;left:0;content:"✓";background:#e9e4fe;color:#635bff;width:20px;height:20px;line-height:20px;text-align:center;border-radius:50%;display:inline-block}.edd-onboarding__stripe-content-holder{max-width:75%;margin:25px auto;background:rgba(241,238,250,.3);padding:50px 40px;border-radius:4px;border:1px solid rgba(241,238,250,.5)}.edd-onboarding__stripe-content-holder .edd-onboarding__stripe-content-logo{text-align:center;margin-bottom:25px;border-bottom:1px solid #ededed;padding-bottom:25px}.edd-onboarding__stripe-content-holder .edd-onboarding__stripe-content-logo img{max-width:180px}.edd-onboarding__stripe-content-holder .edd-onboarding__stripe-content-logo span{text-align:center;font-size:13px;line-height:20px;display:block;max-width:300px;margin:0 auto}@media only screen and (max-width:960px){.edd-onboarding__stripe-content-holder{padding:25px 20px;max-width:100%}}.edd-onboarding__button-stripe{display:block;text-align:center;margin-top:20px}#edds-stripe-disconnect-reconnect{margin-top:10px}.edd-onboarding__stripe-features-title{display:block;text-align:center;font-size:16px;margin-bottom:10px;color:#625bff;font-weight:500}.edd-onboarding__stripe-additional-text{text-align:center;font-size:11px;line-height:14px;display:block;max-width:400px;margin:30px auto 0;opacity:.6}.checkbox-control{position:relative;padding-left:30px;margin-bottom:15px;cursor:pointer;font-size:18px}.checkbox-control input{position:absolute;z-index:-1;opacity:0}.checkbox-control__indicator{position:absolute;top:2px;left:0;height:25px;width:25px;background:#f0f0f1;border-radius:3px}.checkbox-control:hover input~.checkbox-control__indicator,.checkbox-control input:focus~.checkbox-control__indicator{background:#eaeaec}.checkbox-control:hover input:not([disabled]):checked~.checkbox-control__indicator,.checkbox-control input:checked:focus~.checkbox-control__indicator,.checkbox-control input:checked~.checkbox-control__indicator{background:#007cba;background:var(--wp-admin-theme-color)}.checkbox-control input:disabled~.checkbox-control__indicator{background:#00ba37;pointer-events:none}.checkbox-control__indicator:after{content:"";position:absolute;display:none}.checkbox-control input:checked~.checkbox-control__indicator:after{display:block}.checkbox-control--checkbox .checkbox-control__indicator:after{left:9px;top:4px;width:5px;height:12px;border:solid #fff;border-width:0 2.5px 2.5px 0;transform:rotate(40deg)}.checkbox-control--checkbox input:disabled~.checkbox-control__indicator:after{border-color:#fff}.checkbox-control.small-checkbox{padding-left:24px;margin-bottom:10px;font-size:13px}.small-checkbox .checkbox-control__indicator{top:0;left:0;height:17px;width:17px;background:#eaeaec}.checkbox-control.small-checkbox:hover input~.checkbox-control__indicator,.checkbox-control.small-checkbox input:focus~.checkbox-control__indicator{background:#dedfe0}.checkbox-control.small-checkbox:hover input:not([disabled]):checked~.checkbox-control__indicator,.checkbox-control.small-checkbox input:checked:focus~.checkbox-control__indicator,.checkbox-control.small-checkbox input:checked~.checkbox-control__indicator{background:#007cba;background:var(--wp-admin-theme-color)}.checkbox-control.small-checkbox input:disabled~.checkbox-control__indicator{background:#72b281}.checkbox-control--checkbox.small-checkbox .checkbox-control__indicator:after{left:6px;top:2.5px;width:3px;height:8px;border:solid #f6f7f7;border-width:0 2px 2px 0;transform:rotate(40deg)}.edd-onboarding__get-suggestions-section{margin-top:30px;text-align:center;padding:50px 50px 40px;background:rgba(12,93,149,.04);border-radius:2px;border:1px solid rgba(12,93,149,.06)}.edd-onboarding__get-suggestions-section h3{margin-top:0;line-height:25px}.edd-onboarding__get-suggestions-section .edd-onboarding__get-suggestions-section_label{display:block;margin-bottom:1em}.edd-onboarding__selected-plugins{text-align:center;margin-top:25px}.edd-onboarding__install-success-wrapper{z-index:99;position:fixed;left:0;top:0;width:100%;height:100%;padding-left:80px;padding-top:8px;display:flex;align-items:center;justify-content:center;font-size:21px}.edd-onboarding__install-success-wrapper .edd-onboarding__install-success{display:flex;flex-wrap:wrap;gap:25px;text-align:center}.edd-onboarding__install-success-wrapper .edd-onboarding__install-success span{display:block;flex-basis:100%}.edd-onboarding__install-success-wrapper .edd-onboarding__install-success .emoji{font-size:65px}@media only screen and (max-width:960px){.edd-onboarding__install-success-wrapper{padding-left:0}}.edd-onboarding__product-files-row td,.edd-onboarding__product-pricing-row td{padding:0}.edd-onboarding__product-image-wrapper{display:flex;justify-content:space-between;gap:4px}.edd-onboarding__pricing-option-pill{display:flex}.edd-onboarding__pricing-option-pill button{display:inline-block;flex:1;border:1px solid #ccc;padding:10px 15px;cursor:pointer}.edd-onboarding__pricing-option-pill button:hover:not(.active){background:#dbdcdd}.edd-onboarding__pricing-option-pill .left-option{border-top-left-radius:2px;border-bottom-left-radius:2px}.edd-onboarding__pricing-option-pill .right-option{border-left:none;border-top-right-radius:2px;border-bottom-right-radius:2px}.edd-onboarding__pricing-option-pill .active{background:#007cba;background:var(--wp-admin-theme-color);border-color:#007cba;border-color:var(--wp-admin-theme-color);border-right-color:#ccc;color:#fff}.no-table-row-padding td{padding:0}.edd-onboarding__product-variable-price{display:none}.edd-onboarding__multi-option-toggle,.edd-onboarding__upload-files-toggle{display:flex;align-items:center}.edd-onboarding__multi-option-toggle span,.edd-onboarding__upload-files-toggle span{margin-left:10px}.edd-onboarding__upload-files-toggle span{color:#1d2327;font-size:1.3em;font-weight:600;display:block;margin-top:1em;margin-bottom:1em}.edd-onboarding__pricing-options-label{display:block;color:#141b38;font-weight:400;text-shadow:none;vertical-align:baseline;font-size:14px;margin-top:20px;margin-bottom:20px}.edd-add-repeatable-row{border-top:none;padding-top:8px;margin-bottom:5px}.edd-onboarding__actions{display:flex;gap:1em;justify-content:center;margin-top:2em}.edd-onboarding__actions button.edd-promo-notice-dismiss{margin:0} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-pass-handler-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-pass-handler-rtl.min.css deleted file mode 100644 index 5a4a10cd..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-pass-handler-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-pass-handler__description{display:-ms-grid;display:grid;gap:1em;margin-bottom:1em}.edd-pass-handler__control{display:flex;gap:4px;flex-wrap:wrap}.edd-pass-handler__control>input{max-width:250px!important}.edd-pass-handler__control+.notice{max-width:400px;margin-top:1em}.edd-pass-handler__control .button{margin:0}.edd-pass-handler__loading{display:flex;align-items:center;gap:.5em}.edd-pass-handler__loading:before{background:none;display:block;animation:edd-spinning 1.5s linear infinite;animation-play-state:inherit;border:2px solid #7e8993;border-bottom-color:#f9f9f9;border-radius:100%;content:"";width:12px;height:12px;transform:translate3d(50%,-50%,0);will-change:transform}.edd-pass-handler__verifying-wrap{display:flex;position:fixed;right:36px;left:0;top:0;bottom:0;background:rgba(0,0,0,.5);justify-content:center;align-items:center;z-index:1}.edd-pass-handler__verifying-wrap p{background:#fff;border:1px solid #7e8993;border-radius:4px;padding:2em}@media only screen and (min-width:960px){.wp-admin:not(.folded) .edd-pass-handler__verifying-wrap{right:160px}}@media only screen and (max-width:782px){.edd-pass-handler__verifying-wrap{right:0}}.edd-pass-handler__verifying ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before{border-left-color:#787878}.edd-pass-handler__actions{display:flex;gap:4px} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-pass-handler.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-pass-handler.min.css deleted file mode 100644 index 858bef3d..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-pass-handler.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-pass-handler__description{display:-ms-grid;display:grid;gap:1em;margin-bottom:1em}.edd-pass-handler__control{display:flex;gap:4px;flex-wrap:wrap}.edd-pass-handler__control>input{max-width:250px!important}.edd-pass-handler__control+.notice{max-width:400px;margin-top:1em}.edd-pass-handler__control .button{margin:0}.edd-pass-handler__loading{display:flex;align-items:center;gap:.5em}.edd-pass-handler__loading:before{background:none;display:block;animation:edd-spinning 1.5s linear infinite;animation-play-state:inherit;border:2px solid #7e8993;border-bottom-color:#f9f9f9;border-radius:100%;content:"";width:12px;height:12px;transform:translate3d(-50%,-50%,0);will-change:transform}.edd-pass-handler__verifying-wrap{display:flex;position:fixed;left:36px;right:0;top:0;bottom:0;background:rgba(0,0,0,.5);justify-content:center;align-items:center;z-index:1}.edd-pass-handler__verifying-wrap p{background:#fff;border:1px solid #7e8993;border-radius:4px;padding:2em}@media only screen and (min-width:960px){.wp-admin:not(.folded) .edd-pass-handler__verifying-wrap{left:160px}}@media only screen and (max-width:782px){.edd-pass-handler__verifying-wrap{left:0}}.edd-pass-handler__verifying ul#adminmenu #menu-posts-download ul.wp-submenu li.current a:before{border-right-color:#787878}.edd-pass-handler__actions{display:flex;gap:4px} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-rtl.min.css deleted file mode 100644 index c92e70a6..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-custom-price-option-sections-wrap{display:none;border:1px solid #c3c4c7;border-top:0 solid #c3c4c7;box-sizing:border-box;width:100%}.edd-custom-price-option-section{display:block;padding:10px 8px;border-bottom:1px solid hsla(0,0%,87.1%,.3)}.edd-custom-price-option-section-title{display:block;font-weight:600;padding:0 0 10px}.edd-custom-price-option-section-content{display:flex;gap:12px;margin-bottom:6px}.edd-custom-price-option-section:last-child{border-bottom:none}.toggle-custom-price-option-section{color:#787c82}.toggle-custom-price-option-section:hover{color:#537994}#edd_product_settings .edd-product-options__title,#edd_product_settings .inside strong{border-top:1px solid #c3c4c7;border-bottom:1px solid #c3c4c7;background-color:#f9f9f9;display:flex;font-weight:600;margin:0 -12px 16px;padding:8px 12px;justify-content:space-between;align-items:center}#edd_product_settings .edd-product-options-wrapper:first-of-type .edd-product-options__title,#edd_product_settings .inside div:first-child strong{margin-top:-8px}#edd_product_settings .edd-product-options__title .edd-help-tip,#edd_product_settings .inside strong .edd-help-tip{font-size:20px}#edd_product_settings .label--block{display:block;margin:0 0 4px}.edd_repeatable_row.ui-sortable-placeholder{line-height:0;padding:0;margin:0;box-sizing:border-box;border:1px dashed #c3c4c7;visibility:visible!important}.edd-add-repeatable-row{border-top:1px solid #c3c4c7;padding:12px;margin:15px -12px -12px;display:flex;justify-content:flex-end;align-items:center}.edd_repeatable_row input[type=text].large-text{width:100%}.edd_repeatable_upload_wrapper:not(:first-child),.edd_variable_prices_wrapper:not(:first-child){margin-top:12px}.edd_repeatable_row.ui-sortable-helper .edd-repeatable-row-actions .edd-remove-row{display:none}.edd-repeatable-row-actions{color:#787c82}.edd-repeatable-row-actions a{text-decoration:none;width:auto;cursor:pointer}.edd-bundle-products-header,.edd-repeatable-row-header{clear:both;background:#f6f7f7;border:1px solid #c3c4c7;display:flex;justify-content:space-between}.edd-repeatable-row-header{cursor:move}.edd_repeatable_row:hover .edd-repeatable-row-header,.edd_repeatable_row:hover .edd-repeatable-row-standard-fields{border-color:#c3c4c7}.edd-bundled-product-row:after,.edd-bundled-product-row:before,.edd-repeatable-row-header:after,.edd-repeatable-row-header:before{content:"";display:table}.edd-bundled-product-row:after,.edd-repeatable-row-header:after{clear:both}.edd-bundle-products-header,.edd-repeatable-row-title{font-weight:600}.edd-bundle-products-header,.edd-repeatable-row-actions,.edd-repeatable-row-title{padding:8px;box-sizing:border-box}.edd-repeatable-row-actions{flex-grow:1;text-align:left}.edd-bundled-product-row .edd-remove-row,.edd-repeatable-row-actions .edd-remove-row{width:auto;cursor:pointer}.edd-bundled-product-row,.edd-repeatable-row-standard-fields{padding:8px;border:1px solid #c3c4c7;border-top:0 solid #c3c4c7;display:flex;justify-content:space-between;align-items:center;gap:18px}.edd-bundled-product-row .edd-form-group,.edd-repeatable-row-standard-fields .edd-form-group{margin-bottom:0;display:inline-flex;flex-direction:column;flex-grow:1;justify-content:space-between}.edd-repeatable-row-setting-label .edd-help-tip{display:inline-block;margin-right:4px}.edd-bundled-product-item-reorder{min-width:30px}.edd-bundled-product-item-reorder .edd-product-file-reorder{font-size:20px;cursor:move;color:#dcdcde;font-family:dashicons;content:"";transition:color .2s}.edd-bundled-product-item-reorder .edd-product-file-reorder:hover{color:#a7aaad}.edd-bundled-product-actions{-ms-grid-row-align:center;align-self:center}#edd_products .edd-select,.edd_repeatable_product_wrapper .edd-select,.edd_repeatable_upload_wrapper .pricing select{min-width:100%;max-width:200px}.edd_repeatable_product_wrapper td{overflow:visible}@media screen and (max-width:480px){.edd-bundle-products-header,.edd-bundled-product-row,.edd-repeatable-row-header,.edd-repeatable-row-standard-fields{flex-wrap:wrap}.edd-bundled-product-row .edd-form-group,.edd-repeatable-row-standard-fields .edd-form-group{margin-right:0!important;margin-bottom:24px}}.edd_remove_repeatable{border:none;cursor:pointer;display:inline-block;padding:0;overflow:hidden;margin:8px 0 0;text-indent:-9999px;width:10px;height:10px}.edd_remove_repeatable:active,.edd_remove_repeatable:focus,.edd_remove_repeatable:hover{background-position:-10px 0!important}.edd_repeatable_upload_wrapper .edd_repeatable_upload_field_container{position:relative;width:100%}.edd_repeatable_upload_wrapper .edd_repeatable_upload_field_container+span:first-child{width:100%}.edd_repeatable_upload_field{padding-left:32px}.edd_upload_file button{background:#f6f7f7;border:none;border-right:1px solid #c3c4c7;padding:0 4px;position:absolute;height:calc(100% - 4px);overflow:hidden;top:2px;left:2px;display:inline-flex;justify-content:center;align-items:center}#edd-duplicate-action~#publishing-action{position:relative;top:-10px}.edd-form-group{margin-bottom:16px}.edd-form-group:last-of-type{margin-bottom:0}.edd-form-group>label,.edd-form-group__label{display:block;font-weight:600;margin-bottom:8px;padding:0}.edd-form-group__control{margin-bottom:12px;max-width:100%}.edd-form-group__control.is-check,.edd-form-group__control.is-radio{margin-top:4px}.edd-form-group__control:last-of-type{margin-bottom:0}.edd-form-group__control--is-inline{display:inline-flex;align-items:flex-end}.edd-form-group__input{max-width:100%}.edd-form-group__input[type=checkbox],.edd-form-group__input[type=radio]{margin-top:0}.edd-form-group__input[type=checkbox]+label,.edd-form-group__input[type=radio]+label{display:unset}select.edd-form-group__input{max-width:100%}.edd-form-group__help{color:#646970;font-size:13px;font-style:italic;line-height:normal;margin:8px 0 0}.edd-form-row{display:flex;flex-wrap:wrap;gap:12px}.edd-form-row__column{display:inline-flex;flex-direction:column;justify-content:flex-end}.edd-form-row__column.edd-form-group{margin-bottom:0}.edd-form-row label,.edd-form-row label.edd-form-group__label{margin-bottom:8px}#edd-migration-progress .dashicons-minus{color:#949494}#edd-migration-progress .dashicons-yes{color:green}#edd-migration-progress .dashicons-update:before{animation:rotation 2s linear infinite;display:block}#edd-v3-migration-remove-legacy-data-submit-wrap{display:flex;align-items:center;gap:6px}#edd-v3-migration-remove-legacy-data-submit-wrap .button{margin:0}#edd-filters{padding:10px;margin:0;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}#edd-filters .filter-items{flex-wrap:wrap;gap:6px;float:none;flex-grow:1}#edd-filters .filter-items,#edd-filters .filter-items .graph-option-section{display:flex;align-items:center}#edd-filters .filter-items .edd-date-range-picker[data-range=other] .edd-graphs-date-options{border-top-left-radius:4px;border-bottom-left-radius:4px}#edd-filters .filter-items .edd-date-range-picker[data-range=other] .edd-date-range-dates,#edd-filters .filter-items .edd-date-range-picker[data-range=other] .edd-date-range-relative-dates{display:none}#edd-filters .filter-items .edd-date-range-options{display:inline-block;margin:10px 0}#edd-filters .filter-items .edd-graphs-date-options{border-top-left-radius:0;border-bottom-left-radius:0}#edd-filters .filter-items .edd-date-range-dates{display:flex;align-items:center;border:1px solid #8c8f94;border-right:none;color:#2c3338;padding:4px 10px;margin-right:-5px;border-top-left-radius:4px;border-bottom-left-radius:4px;cursor:pointer;gap:4px}#edd-filters .filter-items .edd-date-range-dates.hidden{display:none}#edd-filters .filter-items .edd-date-range-selected-date{display:inline-block}#edd-filters .filter-items .edd-date-range-relative-dates{display:flex;align-items:center;margin-right:10px}#edd-filters .filter-items .edd-date-range-relative-dates.hidden{display:none}#edd-filters .filter-items .edd-date-range-selected-relative-date{position:relative;display:flex;align-items:center;border:1px solid #8c8f94;padding:4px 6px 4px 2px;color:#2c3338;margin-right:10px;margin-left:10px;border-radius:4px;cursor:pointer}#edd-filters .filter-items .edd-date-range-selected-relative-date .arrow-down{width:16px;height:auto;margin-right:6px;margin-top:2px;vertical-align:middle}#edd-filters .filter-items .edd-date-range-selected-relative-date.opened .edd-date-range-relative-dropdown{display:block}#edd-filters .filter-items .edd-date-range-relative-dropdown{position:absolute;z-index:99;width:420px;right:50%;top:100%;margin-top:10px;transform:translateX(50%);background-color:#fff;border:1px solid #8c8f94;border-radius:4px;box-shadow:0 2px 5px 0 rgba(0,0,0,.25);display:none}#edd-filters .filter-items .edd-date-range-relative-dropdown:after{height:10px;width:10px;position:absolute;content:"";background:#fff;border-color:#8c8f94;border-style:solid;border-width:0 0 1px 1px;transform:rotate(135deg);top:-6px;right:calc(50% - 4px)}#edd-filters .filter-items .edd-date-range-relative-dropdown .spinner{display:none}#edd-filters .filter-items .edd-date-range-relative-dropdown.loading{padding:10px;text-align:center}#edd-filters .filter-items .edd-date-range-relative-dropdown.loading .spinner{display:inline-block;visibility:visible;margin:0;float:unset}#edd-filters .filter-items .edd-date-range-relative-dropdown.loading :not(.spinner){display:none}#edd-filters .filter-items .edd-date-range-relative-dropdown ul li{display:flex;align-items:center;padding:2px 10px;opacity:.85;gap:20px}#edd-filters .filter-items .edd-date-range-relative-dropdown ul li.active,#edd-filters .filter-items .edd-date-range-relative-dropdown ul li:hover{cursor:pointer;color:var(--wp-admin-theme-color);opacity:1}#edd-filters .filter-items .edd-date-range-relative-dropdown ul li .date-range-name{width:110px}@media screen and (max-width:950px){#edd-filters .filter-items .graph-option-section{margin-top:8px;width:100%}#edd-filters .filter-items .edd-date-range-picker{flex-wrap:wrap}#edd-filters .filter-items .edd-graphs-date-options{width:100%;max-width:100%;min-height:40px;font-size:14px;border-top-left-radius:4px;border-bottom-left-radius:4px}#edd-filters .filter-items .edd-date-range-dates{width:100%;margin-top:10px;border:1px solid #8c8f94;margin-right:unset;border-radius:4px;font-size:14px;padding:8px 8px 8px 6px}#edd-filters .filter-items .edd-date-range-relative-dates{width:100%;flex-wrap:wrap;margin-right:0;margin-top:6px}#edd-filters .filter-items .edd-date-range-selected-relative-date{width:100%;margin-top:8px;margin-right:0;margin-left:0;font-size:14px;padding:8px 8px 8px 6px;flex-wrap:wrap}#edd-filters .filter-items .edd-date-range-selected-relative-date .arrow-down{margin-right:auto}#edd-filters .filter-items .edd-date-range-relative-dropdown{position:relative;width:100%;right:0;top:0;transform:unset;box-shadow:unset;border:unset;margin:0}#edd-filters .filter-items .edd-date-range-relative-dropdown:after{display:none}#edd-filters .filter-items .edd-date-range-relative-dropdown ul{margin-bottom:0}#edd-filters .filter-items .edd-date-range-relative-dropdown ul li{padding-right:0;padding-left:0;justify-content:space-between;flex-wrap:wrap;gap:unset}#edd-filters .filter-items .edd-date-range-relative-dropdown ul li .date-range-dates,#edd-filters .filter-items .edd-date-range-relative-dropdown ul li .date-range-name{width:100%}}#edd-filters>p{color:#757575}#edd-filters input[type=number],#edd-filters input[type=text].edd_datepicker{max-width:105px}#edd-filters .button-secondary,#edd-filters input[type=number]{margin-bottom:0}#edd-filters .search-form{margin:0}@media screen and (max-width:480px){#edd-filters span{margin:2px 0}}#edd-advanced-filters{position:relative}#edd-advanced-filters .inside{z-index:99;position:absolute;top:29px;left:0;border:1px solid #e0e0e0;padding:0;background:#fff;box-shadow:0 3px 5px rgba(0,0,0,.2);min-width:285px;opacity:0;visibility:hidden}#edd-advanced-filters fieldset{display:block;padding:10px 15px 15px;margin:10px 0}#edd-advanced-filters fieldset:not(:last-of-type){border-bottom:1px solid #e0e0e0}#edd-advanced-filters fieldset:last-of-type{padding-bottom:5px}#edd-advanced-filters fieldset.edd-add-on-filters div,#edd-advanced-filters fieldset.edd-add-on-filters label,#edd-advanced-filters fieldset.edd-add-on-filters p,#edd-advanced-filters fieldset.edd-add-on-filters span{display:block;margin-bottom:2px}#edd-advanced-filters div.edd-select-chosen:not(:last-child){margin-bottom:10px}#edd-advanced-filters.open .edd-advanced-filters-button{background:#e0e0e0;border-color:#949494;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);transform:translateY(1px)}#edd-advanced-filters.open .inside{visibility:visible;opacity:1;transition:opacity .2s ease-in}.download_page_edd-reports #edd-filters{margin-bottom:-1px;box-shadow:none}@media screen and (max-width:782px){.download_page_edd-reports #edd-filters{gap:0}}.edd-old-log-filters{margin-top:-30px;margin-right:2px}@media screen and (min-width:600px){#edd-reports-charts-wrap{display:-ms-grid;display:grid;-ms-grid-columns:(minmax(200px,50%))[2];grid-template-columns:repeat(2,minmax(200px,50%));grid-gap:20px}.edd-reports-chart{margin-bottom:0}.edd-reports-chart-bar,.edd-reports-chart-line{-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/span 2}}.edd-reports-chart{height:500px;max-height:700px}.chart-timezone{font-size:.75rem;color:#ccc}.edd-mobile-link{line-height:32px}.edd-mobile-link a{text-decoration:none}.edd-mobile-link a:after,.edd-mobile-link a:before{display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/30px dashicons;vertical-align:top;margin:1px 0 0;padding:0}.edd-mobile-link a:before{content:"";color:#757575;margin-left:-3px}.edd-mobile-link a:after{content:""}#edd-reports-tiles-wrap #dashboard-widgets .sortable-placeholder{padding:0;margin:0 0 20px;line-height:0;box-sizing:border-box;height:110px}#edd-reports-tiles-wrap #dashboard-widgets #primary-sortables{margin-right:0}#edd-reports-tiles-wrap #dashboard-widgets #tertiary-sortables{margin-left:0}#edd-reports-tiles-wrap{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));grid-gap:20px}.edd-reports-tile{text-align:center;padding:20px 10px 35px;display:flex;flex-direction:column;justify-content:center;border:1px solid #e5e5e5;background:#fafafa;position:relative;box-sizing:border-box;gap:.5em}.edd-reports-tile>span:not(.tile-compare){width:100%}.edd-reports-tile .tile-label{text-align:center;text-transform:uppercase;font-size:12px;font-weight:400;color:#101517}.edd-reports-tile .tile-value{color:#333;font-size:2em;line-height:1;transition:all .2s ease-in-out;display:flex;justify-content:center;flex-direction:column;gap:.25em}.edd-reports-tile:hover{border:1px solid #aaa}.edd-reports-tile:hover .tile-value:not(.tile-no-data){transform:scale(1.05)}.edd-reports-tile .tile-amount{color:#2794da}.edd-reports-tile .tile-number{color:#96f}.edd-reports-tile .tile-amount,.edd-reports-tile .tile-number{color:#fff}.edd-reports-tile .tile-value.tile-no-data{color:#ddd}.edd-reports-tile .tile-value.tile-url{font-size:1.5em}.edd-reports-tile .tile-relative{font-size:12px;font-weight:400;color:#888}.edd-reports-tile span.dashicons{display:inline-block;font-size:30px;line-height:20px;height:20px;width:20px;position:relative;top:4px;right:-5px;margin-right:-5px;color:#999}.edd-reports-tile .tile-relative span.dashicons{top:-5px;right:-3px;margin-right:0}.edd-reports-tile .tile-relative span.dashicons-arrow-down,.edd-reports-tile .tile-relative span.dashicons-arrow-up.reverse{color:#d63638}.edd-reports-tile .tile-relative span.dashicons-arrow-down.reverse,.edd-reports-tile .tile-relative span.dashicons-arrow-up{color:#008a20}.edd-reports-tile .tile-compare{position:absolute;left:0;bottom:0;color:#aaa;font-size:11px;line-height:1em;background-color:#fff;border-color:#e5e5e5 #e5e5e5 #fff #fff;border-style:solid;border-width:1px;border-top-right-radius:8px;padding:4px 9px 0 0;margin:0 0 -1px -1px}.edd-reports-tile:hover .tile-compare{border-right:1px solid #bbb;border-top:1px solid #bbb;color:#777}#edd-submit-refund-status{text-align:center;font-size:1.2em}#edd-submit-refund-status .edd-submit-refund-message:before{font-family:dashicons;font-size:1.5em;vertical-align:middle;color:#fff;border-radius:16px;margin:5px}#edd-submit-refund-status .edd-submit-refund-message.success:before{content:"";background-color:#008a20;padding-left:1px}#edd-submit-refund-status .edd-submit-refund-message.fail{display:block;margin-bottom:16px}#edd-submit-refund-status .edd-submit-refund-message.fail:before{content:"";background-color:#d63638}.refund-items td,.refund-items th.check-column{vertical-align:baseline}.refund-items .column-amount,.refund-items .column-discount,.refund-items .column-quantity,.refund-items .column-subtotal,.refund-items .column-tax,.refund-items .column-total{width:80px}.refund-items .edd-form-group__control{display:flex;align-items:center}.refund-items .edd-form-group__control input,.refund-items .edd-form-group__control select{background-color:transparent;border:0;border-bottom:1px solid;border-radius:0;box-shadow:none;text-align:left;width:100%}.refund-items .edd-form-group__control input:disabled,.refund-items .edd-form-group__control select:disabled{border-bottom:none}.refund-items .edd-form-group__control input:focus,.refund-items .edd-form-group__control select:focus{border-bottom:1px solid var(--wp-admin-theme-color-darker-10);box-shadow:0 1px 0 var(--wp-admin-theme-color-darker-10)}.refund-items .edd-form-group__control select[data-original="1"]{background:transparent}.refund-items .edd-form-group__control .is-before+span>input,.refund-items .edd-form-group__control select{text-align:right}.refund-items .edd-refund-submit-line-total{background-color:#fff!important}.refund-items .edd-refund-submit-line-total td{text-align:left}.refund-items .edd-refund-submit-line-total-amount{display:inline-block;margin-right:20px;text-align:right;width:80px}.refund-items #edd-refund-submit-subtotal td{border-top:2px solid #c3c4c7}@media screen and (max-width:782px){.refund-items td.column-total{margin-bottom:16px}.refund-items .edd-refund-submit-line-total-amount{padding-left:16px;width:unset}}.edd-submit-refund-actions{margin:16px 0 0}.did-refund .edd-submit-refund-actions,.did-refund .refund-items{display:none}.edd-admin-notice-top-of-page{font-size:15px;line-height:1.4;color:#fff;margin-right:-20px;padding:12px 20px 12px 32px;background:#2d6ca2}.edd-admin-notice-top-of-page.edd-pro-inactive{background:#d63638}@media screen and (min-width:783px){.edd-admin-notice-top-of-page{padding:10px 22px 10px 46px}}@media screen and (min-width:961px){.edd-admin-notice-top-of-page{text-align:center}}.edd-admin-notice-top-of-page a{color:#fff}.edd-admin-notice-top-of-page a:hover{text-decoration:none}.edd-admin-notice-top-of-page .button-link{position:absolute;top:48px;left:-1px;font-size:20px;color:#fff;font-weight:700;text-decoration:none;margin-right:5px;padding:6px 10px}.edd-admin-notice-top-of-page .button-link:active,.edd-admin-notice-top-of-page .button-link:focus,.edd-admin-notice-top-of-page .button-link:hover{color:#fff;text-decoration:none}@media screen and (min-width:601px){.edd-admin-notice-top-of-page .button-link{top:1px}}@media screen and (min-width:783px){.edd-admin-notice-top-of-page .button-link{left:9px}}#edd-admin-notice-five-star-review{display:-ms-grid;display:grid}#edd_dashboard_sales .edd-promo-notice{border-bottom:1px solid #c3c4c7}.edd-review-actions{display:flex;gap:6px;margin:0 0 16px}.edd-promo-notice .edd-peeking{align-self:flex-end;justify-self:flex-end;margin-left:16px;margin-bottom:-1px}@media screen and (max-width:782px){#edd-admin-notice-five-star-review.notice .edd-peeking{margin-bottom:-6px}}@media screen and (min-width:480px){.edd-promo-notice.notice-info .edd-peeking{justify-self:flex-start;margin-left:0;margin-right:250px}}.edd-promo-notice .edd-peeking,.edd-review-step{-ms-grid-row:1;grid-area:1/-1}.edd-promo-notice__overlay{display:none;position:fixed;background:rgba(16,21,23,.75);top:0;left:0;bottom:0;right:160px;z-index:11;justify-content:center;align-items:center}.folded .edd-promo-notice__overlay{right:36px}@media screen and (max-width:782px){.edd-promo-notice__overlay{right:0}}.edd-admin-notice-overlay{display:none;background-color:#fff;padding:2.5em;text-align:center;max-width:650px;position:relative;flex-direction:column}.edd-promo-notice__overlay .edd-admin-notice-overlay{display:flex}.edd-admin-notice-overlay h2{line-height:1.6em;margin:0 auto;max-width:540px}.edd-admin-notice-overlay .edd-promo-notice__features{text-align:right;display:-ms-grid;display:grid;-ms-grid-columns:(auto)[3];grid-template-columns:repeat(3,auto);margin:2em auto;gap:0 1.5em}.edd-admin-notice-overlay .edd-promo-notice__features li{display:flex;gap:.5em;align-items:center}@media screen and (max-width:600px){.edd-admin-notice-overlay .edd-promo-notice__features{-ms-grid-columns:unset;grid-template-columns:unset}}.edd-admin-notice-overlay .button-primary{padding:4px 36px;margin:0 auto .5em;max-width:360px}.edd-admin-notice-overlay__link{color:#101517}.edd-admin-notice-overlay .edd-promo-notice-dismiss.button-link{position:absolute;color:#537994;text-decoration:none;font-size:2em;top:0;left:.5em}.edd-admin-notice-overlay .edd-promo-notice-dismiss.button-link:active,.edd-admin-notice-overlay .edd-promo-notice-dismiss.button-link:hover{color:#101517}@media screen and (max-width:782px){.edd-admin-notice-overlay{margin:1em}}.edd-paypal-account-status ul{margin-right:25px}.edd-paypal-account-status>li{margin-bottom:1em}.edd-paypal-account-status ul:not(.edd-paypal-webhook-events) li{margin:.25em 0}.edd-paypal-account-status .dashicons-yes{color:#008a20}.edd-paypal-account-status .dashicons-no{color:#d63638}.edd-overlay{position:fixed;z-index:1052;top:0;left:0;bottom:0;right:160px;background-color:#141b38;opacity:.5;transition:.5s}.edd-slide-in{transform:translateX(-100%)!important;-webkit-transform:translateX(-100%)!important}#edd-notifications-panel{background-color:#fff;height:100%;width:100%;max-width:570px;position:fixed;z-index:1053;top:0;left:0;bottom:0;overflow-x:hidden;transition:.5s;transform:translateX(0);-webkit-transform:translateX(0)}body.admin-bar #edd-notifications-panel{top:32px}@media screen and (max-width:600px){body.admin-bar #edd-notifications-panel{top:46px}}#edd-notifications-header{display:flex;align-items:center;padding:0 30px;color:#fff;background-color:#0c5d95}#edd-notifications-header h3{color:#fff;flex:1}#edd-notifications-header .edd-close{background:none;border:none;color:#fff;cursor:pointer}#edd-notifications-body{padding:30px}.edd-notification{display:flex;gap:20px;margin-bottom:20px}.edd-notification--icon{color:#00aa63}.edd-notification--icon.edd-notification--icon-info{color:#005ae0}.edd-notification--icon.edd-notification--icon-warning{color:#f18200}.edd-notification--icon.edd-notification--icon-error{color:#df2a4a}.edd-notification--body{flex:1}.edd-notification--header{align-items:center;display:flex;justify-content:space-between;gap:5px;margin-bottom:7px}.edd-notification--title{color:#141b38;flex:1;font-size:16px;font-weight:600;margin:0}.edd-notification--date{color:#71747e;font-size:12px}.edd-notification--actions{flex-wrap:wrap;display:flex;align-items:center;gap:5px;margin-top:10px}.edd-notification--dismiss{background:none!important;border:none!important;box-shadow:none!important;color:#71747e!important;cursor:pointer;padding:0 10px;text-decoration:underline}.edd-notification--dismiss:hover{text-decoration:none}.edd-dialog{display:none}.edd-item-header-small{padding-bottom:20px;border-bottom:1px solid #e5e5e5;display:flex;justify-content:flex-start;align-items:center;gap:6px}.edd-item-header-small span{font-weight:600;font-size:15px}.edd-admin-order-status-badge,.edd-status-badge{padding:2px 7px;border-radius:4px;background:#ececec;display:inline-flex;align-items:center;gap:2px}.edd-admin-order-status-badge__icon,.edd-status-badge__icon{opacity:.8}.edd-admin-order-status-badge--error,.edd-admin-order-status-badge--expired,.edd-admin-order-status-badge--failed,.edd-admin-order-status-badge--failing,.edd-admin-order-status-badge--red,.edd-admin-order-status-badge--rejected,.edd-admin-order-status-badge--revoked,.edd-status-badge--error,.edd-status-badge--expired,.edd-status-badge--failed,.edd-status-badge--failing,.edd-status-badge--red,.edd-status-badge--rejected,.edd-status-badge--revoked{color:#ac3d3d;background:#ffd6d6}.edd-admin-order-status-badge--active,.edd-admin-order-status-badge--approved,.edd-admin-order-status-badge--complete,.edd-admin-order-status-badge--completed,.edd-admin-order-status-badge--edd_subscription,.edd-admin-order-status-badge--green,.edd-admin-order-status-badge--partially_refunded,.edd-admin-order-status-badge--success,.edd-status-badge--active,.edd-status-badge--approved,.edd-status-badge--complete,.edd-status-badge--completed,.edd-status-badge--edd_subscription,.edd-status-badge--green,.edd-status-badge--partially_refunded,.edd-status-badge--success{color:#017d5c;background:#e5f5f0}.edd-admin-order-status-badge--pending,.edd-admin-order-status-badge--warning,.edd-admin-order-status-badge--yellow,.edd-status-badge--pending,.edd-status-badge--warning,.edd-status-badge--yellow{color:#996800;background:#f5f2e5}.edd-admin-order-status-badge--blue,.edd-admin-order-status-badge--info,.edd-admin-order-status-badge--processing,.edd-admin-order-status-badge--trialling,.edd-status-badge--blue,.edd-status-badge--info,.edd-status-badge--processing,.edd-status-badge--trialling{color:#016087;background:#e5f1f5}.edd-pro-upgrade,.edd-pro-upgrade:hover{color:#1da867;font-weight:600;text-decoration:none}.wrap-licenses .edd-licenses__description{margin:2em 1em}.wrap-licenses .form-table,.wrap-licenses caption,.wrap-licenses tfoot,.wrap-licenses th,.wrap-licenses thead,.wrap-licenses tr{display:block}@media screen and (min-width:600px){.wrap-licenses .form-table,.wrap-licenses caption,.wrap-licenses tfoot,.wrap-licenses th,.wrap-licenses thead,.wrap-licenses tr{display:unset}}.wrap-licenses tbody{display:-ms-grid;display:grid;gap:1em}.wrap-licenses .form-table tr{margin:0;background:#fff;border:1px solid #dcdcde;border-radius:3px;padding:0;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between}@media screen and (min-width:600px){.wrap-licenses .form-table tr{display:-ms-grid;display:grid;-ms-grid-columns:200px 1fr;grid-template-columns:200px 1fr}}.wrap-licenses .form-table th{background:#f9f9f9;margin-bottom:2.5em;padding:1em;border-bottom:1px solid #dcdcde;width:unset}@media screen and (min-width:600px){.wrap-licenses .form-table th{border-bottom:none;margin-bottom:0;display:flex;align-items:center}}.wrap-licenses .form-table td{margin:0;padding:0;display:flex;flex-direction:column;gap:2.5em;flex-grow:1}@media screen and (min-width:600px){.wrap-licenses .form-table td{flex-direction:row;gap:unset}}.wrap-licenses .form-table td input.regular-text{margin:0;width:100%;max-width:250px}.wrap-licenses .form-table td button{margin:0}.wrap-licenses .form-table .edd-license__control{flex-grow:1;padding:0 1em;display:flex;gap:4px;align-items:center;justify-content:center}@media screen and (min-width:600px){.wrap-licenses .form-table .edd-license__control{justify-content:flex-end}}.wrap-licenses .form-table .edd-licensing__actions{display:flex;gap:4px}.wrap-licenses .edd-license-data[class*=edd-license-]{background:#f9f9f9;padding:1em;border-top:1px solid #dcdcde;margin:0;width:100%;box-sizing:border-box;display:flex;align-items:flex-end}.wrap-licenses .edd-license-data[class*=edd-license-] a{color:#444}.wrap-licenses .edd-license-data[class*=edd-license-] a:hover{text-decoration:none}@media screen and (min-width:600px){.wrap-licenses .edd-license-data[class*=edd-license-]{border-top:none;width:unset;flex-basis:100%;align-items:center}.wrap-licenses .edd-license-data[class*=edd-license-]:not(:only-child){flex:0 1 300px}}.wrap-licenses .edd-license-data.license-expires-soon-notice{background-color:#00a0d2;color:#fff;border-color:#00a0d2}.wrap-licenses .edd-license-data.edd-license-expired{background-color:#e24e4e;color:#fff;border-color:#e24e4e}.wrap-licenses .edd-license-data.edd-license-error,.wrap-licenses .edd-license-data.edd-license-invalid,.wrap-licenses .edd-license-data.edd-license-item_name_mismatch,.wrap-licenses .edd-license-data.edd-license-missing,.wrap-licenses .edd-license-data.edd-license-site_inactive{background-color:#ffebcd;border-color:#ffebcd}.wrap-licenses .edd-license-data p{font-size:13px;margin-top:0}.wrap-licenses .edd-license-data.edd-license-expired a,.wrap-licenses .edd-license-data.license-expires-soon-notice a{color:#fff}.wrap-licenses .edd-license-data.edd-license-expired a:hover,.wrap-licenses .edd-license-data.license-expires-soon-notice a:hover{text-decoration:none}.edd-settings-content{max-width:1440px}.edd-settings-color,.edd-settings-colors{display:flex;flex-wrap:wrap;gap:1em}.edd-settings-color{flex-direction:column}.edd-upload-button-wrapper{width:100%;display:flex;gap:5px}.edd-upload-button-wrapper button.edd_settings_upload_button{margin-bottom:0}#edd-payment-gateways a.button.edd-settings__button-settings{position:absolute;left:2em;min-height:unset;height:1.5em;width:1.5em;border:none;background-color:#f9f9f9}#edd-payment-gateways a.button.edd-settings__button-settings,#edd-payment-gateways a.button.edd-settings__button-settings:active,#edd-payment-gateways a.button.edd-settings__button-settings:hover{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS4yOSA2LjI5M2wtMS41MTUuODc1YTUuODczIDUuODczIDAgMDEwIDEuNjY0bDEuNTE1Ljg3NS0yLjE2NiAzLjc1My0xLjUxNi0uODc1YTUuODI3IDUuODI3IDAgMDEtMS40NDEuODMzdjEuNzQ5SDUuODM0di0xLjc1YTUuODI1IDUuODI1IDAgMDEtMS40NDEtLjgzMmwtMS41MTYuODc1TC43MSA5LjcwN2wxLjUxNi0uODc1YTUuODc4IDUuODc4IDAgMDEwLTEuNjY0TC43MSA2LjI5MyAyLjg3NyAyLjU0bDEuNTE2Ljg3NmE1LjgyNyA1LjgyNyAwIDAxMS40NC0uODMzVi44MzNoNC4zMzR2MS43NWE1LjgzIDUuODMgMCAwMTEuNDQuODMzbDEuNTE3LS44NzYgMi4xNjYgMy43NTN6TTggMTAuMzMzYTIuMzMzIDIuMzMzIDAgMTAwLTQuNjY2IDIuMzMzIDIuMzMzIDAgMDAwIDQuNjY2eiIgZmlsbD0iIzZCNzI4MCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTUuMjkgNi4yOTNsLTEuNTE1Ljg3NWE1Ljg3MyA1Ljg3MyAwIDAxMCAxLjY2NGwxLjUxNS44NzUtMi4xNjYgMy43NTMtMS41MTYtLjg3NWE1LjgyNyA1LjgyNyAwIDAxLTEuNDQxLjgzM3YxLjc0OUg1LjgzNHYtMS43NWE1LjgyNSA1LjgyNSAwIDAxLTEuNDQxLS44MzJsLTEuNTE2Ljg3NUwuNzEgOS43MDdsMS41MTYtLjg3NWE1Ljg3OCA1Ljg3OCAwIDAxMC0xLjY2NEwuNzEgNi4yOTMgMi44NzcgMi41NGwxLjUxNi44NzZhNS44MjcgNS44MjcgMCAwMTEuNDQtLjgzM1YuODMzaDQuMzM0djEuNzVhNS44MyA1LjgzIDAgMDExLjQ0LjgzM2wxLjUxNy0uODc2IDIuMTY2IDMuNzUzek04IDEwLjMzM2EyLjMzMyAyLjMzMyAwIDEwMC00LjY2NiAyLjMzMyAyLjMzMyAwIDAwMCA0LjY2NnoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iLjUiLz48L3N2Zz4=);background-size:1em;background-repeat:no-repeat;background-position:50%}.edd-plugin__active #edd-payment-gateways a.button.edd-settings__button-settings{display:block}.edd-settings__list--disc{list-style:disc;list-style-position:inside}.edd-hidden{display:none}.edd-clearfix:after{content:"";display:table;clear:both}.edd-notice .notice-dismiss,.edd-wrap a{text-decoration:none}.wp-core-ui .edd-delete,a.edd-delete{color:#a00}.wp-core-ui .edd-delete:hover,a.edd-delete:hover{color:red}body.post-type-download #contextual-help-link-wrap,body.post-type-download #screen-options-link-wrap{top:5px!important}body.post-type-download #screen-meta{margin:0 -20px -1px 0}#edd-header{border-top:5px solid #0c5d95;border-bottom:1px solid #c3c4c7;padding:20px 0;margin-right:-20px;background:#fff}#edd-header-wrapper{display:flex;justify-content:space-between;padding:0 20px;align-items:center}#edd-header img{display:block;max-width:300px;margin:0}.edd-header-page-title-wrap{font-size:1.75em;margin-top:-5px;margin-left:auto;padding-right:7px}.edd-header-separator{margin-top:-2px;opacity:.25}.edd-header-page-title{font-weight:400;font-size:1em;line-height:1.3em;display:inline}.edd-header-page-title-wrap .button{margin-right:5px}.no-js #edd-header-actions{display:none}#edd-header .edd-round{position:relative;background-color:#f3f4f5;border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;margin-right:10px;cursor:pointer;transition:background-color .2s ease}button.edd-round{border:none}#edd-header button.edd-round:hover{background-color:#e5e5e5}button.edd-round:active,button.edd-round:focus{outline:2px solid #0c5d95}#edd-header .edd-number{position:absolute;background-color:#df2a4a;width:16px;height:16px;font-weight:600;font-size:10px;color:#fff;top:-8px;right:50%;transform:translateX(50%);margin:0;animation:bounce 2s 5}#edd-header .edd-number.edd-hidden{display:none!important}#edd-header .edd-round svg{width:20px;height:20px}@media screen and (max-width:840px){#edd-header img,.edd-header-separator{display:none}}.edd_datepicker{height:29px}.edd-from-to-wrapper input{width:105px;margin:0;position:relative;z-index:1}.edd-from-to-wrapper input[name*=start],.edd-from-to-wrapper input[name=filter_from]{border-top-left-radius:0;border-bottom-left-radius:0}.edd-from-to-wrapper input[name*=end],.edd-from-to-wrapper input[name=filter_to]{margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0}.edd-from-to-wrapper input:focus{z-index:2;position:relative}.edd-settings-sub-nav{margin:0 0 10px;width:100%;border-bottom:1px solid #ccc;box-shadow:0 1px 1px rgba(0,0,0,.04)}.edd-settings-sub-nav a{padding:13px;display:block}.edd-settings-sub-nav a.current{border-bottom:4px solid #000;padding-bottom:9px}.admin-color-fresh .edd-settings-sub-nav a.current{border-bottom-color:#00a0d2}.admin-color-blue .edd-settings-sub-nav a.current{border-bottom-color:#096484}.admin-color-coffee .edd-settings-sub-nav a.current{border-bottom-color:#c7a589}.admin-color-ectoplasm .edd-settings-sub-nav a.current{border-bottom-color:#a3b745}.admin-color-midnight .edd-settings-sub-nav a.current{border-bottom-color:#e14d43}.admin-color-ocean .edd-settings-sub-nav a.current{border-bottom-color:#627c83}.admin-color-sunrise .edd-settings-sub-nav a.current{border-bottom-color:#be3631}.admin-color-light .edd-settings-sub-nav a.current{border-bottom-color:#888}.admin-color-evergreen .edd-settings-sub-nav a.current{border-bottom-color:#36533f}.admin-color-mint .edd-settings-sub-nav a.current{border-bottom-color:#4f6d59}.download_page_edd-settings .edd-check-wrapper{clear:both}.download_page_edd-settings .form-table tr>th>h3,.download_page_edd-settings .form-table tr>th>strong{font-size:1.2em;font-weight:600;margin:0 auto}.edd-sortable-list{margin:0;width:300px;position:relative}.edd-sortable-list li{margin:0;padding:0;position:relative;height:28px;cursor:move}.edd-sortable-list li label *{vertical-align:middle}.edd-sortable-list li label:after{display:block;width:17px;height:17px;position:absolute;left:6px;top:0;color:#aaa;font-family:dashicons;font-size:17px;content:"";cursor:move}.form-table .edd-sortable-list li label{display:block;height:28px;padding:0;margin:0}.edd-sortable-list .payment-icon{width:32px;height:24px;position:relative;top:-2px;margin-left:5px}.edd-help-tip{cursor:help;margin-top:-2px;font-size:24px;color:grey}.edd-ui-tooltip{position:absolute;background:#333!important;border-width:1px!important;border-radius:3px!important;box-shadow:-1px 1px 2px 1px hsla(0,0%,83.9%,.5)!important;color:#dedede!important;max-width:300px!important;padding:7px!important;text-rendering:optimizeLegibility;text-shadow:none!important;z-index:9999!important}.download_page_edd-settings .edd-settings-payment-icon-wrapper{margin-top:5px}.download_page_edd-settings .edd-settings-payment-icon-wrapper input{margin-top:1px}.download_page_edd-settings .form-table .edd-settings-payment-icon-wrapper input[type=checkbox]+label{margin:0;display:inline-block}.download_page_edd-settings .edd-settings-payment-icon-wrapper .payment-icon-image{margin-left:5px;width:32px;display:inline-block;vertical-align:middle}.download_page_edd-settings .edd-settings-payment-icon-wrapper .payment-option-name{vertical-align:middle}.download_page_edd-settings .taxrates td,.download_page_edd-settings .taxrates th{padding:8px 10px}.download_page_edd-settings .taxrates td{line-height:1.5em;vertical-align:top;margin:0}.download_page_edd-settings .taxrates .regular-text{width:100%}#TB_window{overflow:hidden}#TB_title{padding:5px}#TB_ajaxContent{width:calc(100% - 30px)!important;padding:15px;margin:0;height:calc(100% - 118px)!important}#TB_ajaxWindowTitle{font-size:18px;font-weight:600;line-height:30px}#TB_closeWindowButton{left:6px;top:6px}#choose-download-wrapper{width:100%}#choose-download-wrapper .wrap{overflow-y:scroll;margin:0;padding:0;height:calc(100% - 50px)}#choose-download-wrapper .submit-wrapper{position:absolute;width:100%;bottom:0;padding:0;margin:0 -15px 0 0;text-align:left}#choose-download-wrapper .submit-wrapper div{background-color:#fafafa;padding:15px;border-top:1px solid #ddd}.wp-media-buttons .button.edd-thickbox{padding-right:0}.wp-media-buttons .button.edd-email-tags-inserter .dashicons{margin-top:-2px}.download_page_edd-payment-history .edit-post-editor-regions__header{flex-shrink:0;height:auto;border-bottom:1px solid #e2e4e7;z-index:30;position:sticky;top:32px;margin-right:-20px}@media screen and (max-width:782px){.download_page_edd-payment-history .edit-post-editor-regions__header{position:static;top:46px}}.download_page_edd-payment-history .edit-post-header{height:56px;background:#fff;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;max-width:100%;box-sizing:border-box;padding:4px 20px}@media screen and (max-width:782px){.download_page_edd-payment-history .edit-post-header{padding-right:10px;padding-left:10px}}@media(min-width:280px){.download_page_edd-payment-history .edit-post-header{flex-wrap:nowrap}}.download_page_edd-payment-history .edit-post-header .edit-post-header__toolbar{order:0}.download_page_edd-payment-history .edit-post-header .edit-post-header__settings{order:1}.download_page_edd-payment-history .edit-post-header #publishing-action,.download_page_edd-payment-history .edit-post-header .edit-post-header__settings,.download_page_edd-payment-history .edit-post-header .edit-post-header__toolbar{display:flex;align-items:center}.download_page_edd-payment-history .edit-post-header #publishing-action .spinner{margin:0 0 0 5px}.download_page_edd-payment-history .edit-post-header .button-primary{margin:2px;height:34px;line-height:32px;font-size:13px}#edd-order-items .hndle{display:flex;align-items:center;justify-content:space-between}#edd-order-items .hndle .edd-toggle{font-weight:400}.edd-add-order-item td{vertical-align:middle}.edd-add-order-item input{width:80%}.edd-add-order-item input[readonly]{color:#555;background:none;border:1px solid transparent;box-shadow:none}.order-customer-info .customer-details-wrap{margin:15px 0;align-items:center}.order-customer-info .customer-details-wrap .spinner{margin:0}.order-customer-info .customer-details{display:flex;flex-direction:column}.order-customer-info .customer-details .customer-since{color:#666;display:block;margin:4px 0 6px}.order-customer-info .customer-details>span{margin-bottom:5px}.edd-order-add-download-select .spinner{display:none}table.edd-order-overview-summary{border-width:0;table-layout:fixed}table.edd-order-overview-summary--refund{border-width:0}@media screen and (min-width:782px){.edd-order-overview .column-right{text-align:left}}.edd-ml-auto{margin-right:auto!important}@media screen and (min-width:782px){.edd-ml-lg-auto{margin-right:auto!important}}.edd-ml-auto+.edd-ml-auto{margin-right:10px!important}.edd-order-overview-summary__items-name{align-self:flex-start}.edd-order-overview-summary__items>:nth-child(odd){background-color:#f9f9f9}@media screen and (min-width:782px){.edd-order-overview-summary__items tr:last-child td,.edd-order-overview-summary__items tr:last-child th{border-bottom:1px solid #e5e5e5}}@media screen and (max-width:782px){.edd-order-overview-summary .row-actions>*,.edd-order-overview-summary__items-name .row-actions{display:block!important}.edd-order-overview-summary .row-actions>:not(:first-child):before{display:none}}.edd-order-overview-summary th:not(.column-primary){width:100px}.edd-order-overview-summary .row-actions>:not(:first-child):before{color:#999;content:" | "}.edd-order-overview-summary .row-actions .text{color:#555}.edd-order-overview-summary .removable{display:flex;align-items:center;position:relative}.edd-order-overview-summary .removable .delete{display:inline-block;margin-left:10px;margin-right:-8px;padding:10px;border-left:1px solid #e5e5e5;color:#a00}.edd-order-overview-summary .removable .delete:hover{color:#dc3232}.edd-order-overview-summary__adjustments .column-primary{font-weight:600}.edd-order-overview-summary__adjustments td small{font-weight:400}.edd-order-overview-summary__subtotal .column-primary,.edd-order-overview-summary__tax tr:first-of-type .column-primary,.edd-order-overview-summary__total .column-primary{font-weight:600}.edd-order-overview-summary__adjustments td,.edd-order-overview-summary__subtotal td,.edd-order-overview-summary__tax td,.edd-order-overview-summary__total td{vertical-align:middle}.edd-order-overview-summary__tax td small,.edd-order-overview-summary__total td small{font-weight:400}.edd-order-overview-summary__total .total{color:#017d5c;display:inline-block}.edd-order-overview-summary__total .total.is-negative{color:#a00}@media screen and (min-width:783px){.edd-order-overview-summary__adjustments .removable .delete{margin-right:-50px}.edd-order-overview-summary__total .total{font-size:150%;padding-top:5px;padding-bottom:5px}}.edd-order-overview-summary__total tr:last-child td:not(:first-of-type),.edd-order-overview-summary__total tr:last-child th{border-top:1px solid #e5e5e5}.edd-order-overview-summary__total .notice{margin:-1px}.edd-order-overview-summary__total .notice p{font-weight:400;margin:.5em 0}.edd-order-overview-summary__refunds .column-primary{font-weight:600}.edd-order-overview-summary__refunds td small{font-weight:400}.edd-order-overview-summary__refunds tr:first-child td{border-top:1px solid #e5e5e5}#edd-order-overview-actions.inside{border-top:1px solid #ccd0d4;margin-top:0;display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between}#edd-order-overview-actions.inside:empty{padding:0;border-top:0}#edd-order-overview-actions.inside>div{display:flex;align-items:center}#edd-order-overview-actions .edd-order-overview-actions__notice{flex-basis:100%;margin-top:15px}.edd-order-overview-actions .button{width:100%;margin-bottom:12px}.edd-order-overview-actions .button:last-of-type{margin-bottom:0}@media screen and (min-width:782px){.edd-order-overview-actions .button{width:auto;margin-right:12px;margin-bottom:0}.edd-order-overview-actions .button:first-of-type{margin-right:auto}}.edd-order-overview-actions__locked{font-style:italic;opacity:.8}@media screen and (max-width:782px){.edd-order-overview-actions__locked{margin-bottom:12px}}.edd-order-overview-actions__refund .dashicons{margin-left:8px}.edd-dialog .ui-button-icon-only{font-size:0}.download_page_edd-payment-history .ui-dialog,.download_page_edd-payment-history .ui-dialog-content{overflow:visible}.edd-order-overview-modal form>p{margin-top:0}.edd-order-overview-modal fieldset legend,.edd-order-overview-modal form label{display:block;margin-bottom:4px}.edd-order-overview-modal fieldset{margin-bottom:calc(1em - 3px)}.edd-order-overview-modal fieldset>p{margin:2px 0 3px}.edd-order-overview-modal form .submit{margin:0 -16px -16px;padding:16px;background:#fcfcfc;border-top:1px solid #dfdfdf;display:flex;align-items:center}.edd-order-overview-modal form .submit .spinner{margin:0}.edd-order-overview-add-item [for=auto-calculate]{display:flex;align-items:center}.edd-order-overview-add-item [for=auto-calculate] input[type=checkbox]{margin-top:0}.edd-order-overview-add-item [for=auto-calculate] .label{line-height:1.15;margin-right:8px}.edd-order-overview-add-item [for=auto-calculate] .label small{margin-top:4px;display:block;opacity:.75}.edd-order-overview-add-adjustment .notice,.edd-order-overview-add-item .notice{margin:0 0 1rem}.edd-order-overview-add-adjustment #description,.edd-order-overview-add-discount select{width:100%}.edd-order-overview-error{font-style:italic;color:#a00;display:block;margin:4px 0}.edd-order-copy-download-link textarea{width:100%}.edd-order-resend-email-chooser legend{font-weight:700;margin-bottom:4px}.edd-order-resend-email-chooser p{margin:4px 0}.edd-notes .edd-note{padding:10px;background-color:#ffe;border:1px solid #cc0;width:100%;position:relative;margin-bottom:10px;box-sizing:border-box;overflow:hidden}.edd-notes .edd-note.deleting{opacity:.5}.edd-notes .edd-note__header{display:flex;align-items:center}.edd-add-note .spinner{float:none;display:inline-block;margin:0}.edd-notes .edd-note time{font-size:11px;color:#aaa}.edd-notes .edd-note .edd-note-author{margin-left:5px}.edd-notes .edd-note .edd-delete-note{color:#a00;font-weight:700;text-decoration:none;margin-right:auto}.edd-notes .edd-note .edd-delete-note:hover{color:#888}.edd-notes .edd-note p:last-child{margin-bottom:0}.edd-notes .edd-no-notes{margin:4px 0 10px}textarea[name=edd-note]{width:100%;min-height:70px;margin-top:0}.edd-notes-wrapper{width:80%}.edd-note-pagination{float:left;margin:-35px 5px 15px}.edd-note-pagination a,.edd-note-pagination span.page-numbers{padding:5px 8px;margin:2px;text-decoration:none}.edd-note-pagination a{border:1px solid #e5e5e5;background:#fcfcfc}.edd-note-pagination a:last-child,.edd-note-pagination span.page-numbers:last-child{margin-left:0}#edd-products{height:100px;min-width:200px}#edd-add-discount input[type=text],#edd-edit-discount input[type=text]{width:300px}#edd-add-discount .edd-discount-datetime input,#edd-edit-discount .edd-discount-datetime input{vertical-align:middle}#edd-add-discount input[type=text].edd_datepicker,#edd-edit-discount input[type=text].edd_datepicker{display:inline-block;width:183px}#edd-edit-discount textarea{height:100px}.edd-amount-type-wrapper{position:relative;display:flex}.edd-amount-type-wrapper select{border-top-right-radius:0;border-bottom-right-radius:0;width:auto!important}.edd-amount-type-wrapper #edd-amount{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-2px;padding:0 8px;width:unset;max-width:125px}.edd-amount-type-wrapper input:focus{z-index:2}.post-type-download .tablenav.top .edd-select{margin-left:6px}.wp-list-table.addresses .column-primary strong,.wp-list-table.customers .column-primary strong,.wp-list-table.discounts .column-primary strong,.wp-list-table.emails .column-primary strong,.wp-list-table.orderadjustments .column-primary strong,.wp-list-table.orderitems .column-primary strong,.wp-list-table.orders .column-primary strong{font-size:14px}.wp-list-table.customers .column-primary .avatar,.wp-list-table.emails .column-customer .avatar{float:right;margin-left:10px;margin-top:1px;border-radius:5px}.wp-list-table.orders div.order-list-email{font-size:.85em;color:#888}.wp-list-table.orders th.column-amount{width:100px}.wp-list-table .row-actions span.activate a{color:green}.wp-list-table .row-actions span.refund a{color:#836fff}.wp-list-table .row-actions span.cancel a{color:#cc8c00}.wp-list-table .row-actions span.cancel a:hover,.wp-list-table .row-actions span.refund a:hover{opacity:.8}.wp-list-table .type-download .row-actions{color:#999}.no-js.edit-tags-php.post-type-download .wp-heading-inline{position:absolute;top:0}.no-js.edit-tags-php.post-type-download .nav-tab-wrapper{margin-top:50px}.download_page_edd-customers .wrap .nav-tab-wrapper .page-title-action,.download_page_edd-discounts .wrap .nav-tab-wrapper .page-title-action,.download_page_edd-payment-history .wrap .nav-tab-wrapper .page-title-action,.edit-tags-php.post-type-download .wrap .nav-tab-wrapper .page-title-action{top:3px;margin-right:10px;line-height:24px}#edd-payments-filter ul.subsubsub{margin-bottom:8px}tr.status-refunded td{background:#cecece;border-top-color:#ccc}marquee{padding:0;margin:0}@media handheld,only screen and (max-width:640px){.wp-list-table.downloads th{width:auto!important}}#edd-download-link-textarea{width:100%}.edd_files_name_label{width:225px;float:right}.edd_files_url_label{width:220px;float:right}#postbox-container-1 .edd_files_name_label,#postbox-container-1 .edd_files_url_label{width:80px}#edd_product_files .inside,#edd_product_prices .inside{margin-bottom:0}textarea#edd-payment-note{width:100%;height:4em;margin:0}#edd-order-items .row .edd-purchased-files-list-wrapper .download{line-height:1.4}#edd-order-items .edd-purchased-files-list-wrapper .edd-purchased-option{color:#666}input[class*=edd-price-field]{max-width:125px}#edd-order-download-quantity[type=number].small-text,#edd-order-download-tax[type=text].small-text,[class*=item_] [class*=edd-payment-details-download-][type=number].small-text{height:25px}#edd-order-download-quantity[type=number].small-text,.item_price .edd-payment-details-download-quantity[type=number].small-text{width:55px}#edd-order-download-tax[type=text].small-text,.item_tax .edd-payment-details-download-item-tax[type=number].small-text{width:80%;max-width:125px}#edd_product_notes_field{display:block;margin:12px 0 0;height:4em;width:100%}.edd-metabox-title-action{margin:0;float:left;padding:4px 8px;position:relative;top:-1px;text-decoration:none;border:1px solid #ccc;border-radius:2px;background:#f7f7f7;text-shadow:none;font-weight:600;font-size:10px;line-height:normal;color:#0073aa;cursor:pointer;outline:0}.edd-metabox-title-action:hover{border-color:#008ec2;background:#00a0d2;color:#fff}.edd-edit-purchase-element .tablenav{padding:2px 10px 8px}.edd-edit-purchase-element .edd-order-children-wrapper{margin:0 -1px}.edd-edit-purchase-element .edd-order-children-wrapper.child-count-0 table{border-top:none;border-bottom:none}.edd-edit-purchase-element .edd-order-children-wrapper.child-count-0 .tablenav{display:none}.edd-edit-purchase-element[class*=columns-] ul li{padding-left:1%}#edd-edit-order-form .column:nth-child(odd),#edd-edit-order-form .columns-4 .column:nth-child(odd),#edd-edit-order-form .columns-5 .column:nth-child(3n+1){margin-left:0}#edd-edit-order-form input.large-text{width:90%}.edd-edit-purchase-element ul li.item_price{width:15%}.edd-edit-purchase-element ul li.item_price.item_quantity{width:25%}.edd-edit-purchase-element ul li.item_tax{width:15%}.edd-edit-purchase-element ul li.price{width:20%}.edd-admin-box-inside{border-bottom:1px solid #f1f1f1;clear:both;padding:12px;margin:0;word-wrap:break-word}.edd-admin-box-inside--row{display:flex;flex-wrap:wrap;word-break:break-all;justify-content:space-between;align-items:center}.edd-admin-box-inside>p{margin:8px 3px}.edd-admin-box-inside .strong{font-weight:600}.edd-admin-box div:not(.edd-admin-box-inside--row) .label{display:block;margin-bottom:4px;margin-left:0}.edd-admin-box .label--has-tip{display:flex;align-items:center}.edd-admin-box .label--has-tip .edd-help-tip{margin-top:0;font-size:20px}.edd-admin-box div:not(.edd-admin-box-inside--row) .label--has-checkbox{margin-bottom:0}.edd-payment-fees .fee-label{color:#666;font-weight:400}.edd-admin-box .right{float:left}#edd-order-refunds-list{padding-right:25px}#poststuff .edd-order-data .inside{margin:0;padding:0}.edd-order-data .edd-select-chosen{width:130px!important}.edd-order-data input.edd_datepicker{width:180px}.edd-order-data input[type=number].edd-payment-time-hour,.edd-order-data input[type=number].edd-payment-time-min{width:50px}.edd-order-data .edd-tax-rate{color:#9c9c9c;font-style:italic;padding:5px}#edd_general_logs p{margin:0;padding:0}.edd-admin-box-inside span.label{margin-left:10px}#edd-order-resend-receipt .inside{margin-top:11px}.edd-order-resend-receipt-header{font-size:14px;line-height:1.4}.edd-admin-box-inside:last-child{border-bottom:0}#edd-edit-order-form .data-payment-key{word-break:break-all}.edd-order-update-box #major-publishing-actions .button-secondary{margin-left:10px}.edd-order-update-box .button-primary{margin-left:0}.edd-edit-purchase-element .edd-select-chosen{width:196px}.edd-edit-purchase-element ul{clear:both;display:block}#edd-customer-details .actions{float:left}.order-data-address h3{margin:0 0 10px}.order-data-address #edd-order-address-country-wrap,.order-data-address #edd-order-address-state-wrap{display:inline-block;width:50%;max-width:300px}.edd-order-data input.small-text{margin:0}.edd-order-data input.med-text{margin:0;width:100px}.edd-edit-purchase-element ul li{display:block;line-height:1.4;position:relative;margin:0;vertical-align:middle;font-size:13px}.edd-edit-purchase-element .row{padding:12px}.edd-edit-purchase-element .row:not(:last-child){border-bottom:1px solid #eee}.edd-edit-purchase-element .row:nth-child(odd):not(.header){background-color:#f9f9f9}.edd-edit-purchase-element .row.header{padding:6px 12px;font-weight:600;vertical-align:top}.edd-edit-purchase-element ul{margin:0 0 15px}.edd-edit-purchase-element ul:last-of-type{margin-bottom:0}#edd-order-data .data span{color:#666;font-weight:600}.edd-edit-purchase-element .inside{padding:12px}.edd-edit-purchase-element .edd-purchased-download-title{font-size:14px;font-weight:500}.edd-edit-purchase-element .edd-purchased-download-title .deleted{color:#777}.edd-edit-purchase-element .edd-purchased-download-actions{color:#777;line-height:1.4}.edd-edit-purchase-element .edd-purchased-download-actions .edd-purchased-download-actions-label{font-weight:500}.edd-edit-purchase-element .edd-purchased-download-actions a{color:#777;font-size:12px}.edd-edit-purchase-element .edd-purchased-download-actions a:hover{color:#444}.edd-edit-purchase-element .edd-purchased-download-actions .edd-order-remove-download{color:#a00}.edd-edit-purchase-element .edd-purchased-download-actions .edd-order-remove-download:hover{color:red}.edd-add-adjustment-to-purchase,.edd-add-download-to-purchase{padding:15px;border-top:1px solid #e5e5e5;background-color:#f5f5f5}.edd-add-adjustment-to-purchase .chosen-container,.edd-add-download-to-purchase .chosen-container{width:90%!important;max-width:220px!important}.edd-add-adjustment-to-purchase .spinner,.edd-add-download-to-purchase .spinner{margin:0;float:none}.edd-add-download-to-purchase .edd-add-order-quantity{width:40px;height:29px;vertical-align:middle}.edd-add-adjustment-to-purchase .edd-add-adjustment-button,.edd-add-adjustment-to-purchase input[type=text],.edd-add-download-to-purchase .edd-add-order-item-button{height:29px}@media screen and (max-width:1284px){.edd-edit-purchase-element .edd-purchased-download-title{font-size:16px}.edd-edit-purchase-element ul li.item_price{width:22%}.edd-edit-purchase-element ul li.item_price.item_quantity{width:35%}.edd-edit-purchase-element ul li.item_tax{width:25%}.edd-edit-purchase-element ul li.price{width:20%}.edd-edit-purchase-element .edd-purchased-download-actions{padding-top:10px}}@media screen and (max-width:1024px){.edd-edit-purchase-element ul li.item_price.item_quantity{width:40%}.edd-edit-purchase-element ul li.price{width:24%}.edd-edit-purchase-element .edd-purchased-download-actions{padding-top:15px}.edd-edit-purchase-element .edd-purchased-download-actions,.edd-edit-purchase-element .edd-purchased-download-actions a{font-size:14px}}@media screen and (max-width:782px){.edd-edit-purchase-element ul li.item_price,.edd-edit-purchase-element ul li.item_price.item_quantity{padding-bottom:10px}.edd-edit-purchase-element ul li.item_price.item_quantity{width:35%}.edd-edit-purchase-element ul li.item_tax,.edd-edit-purchase-element ul li.price{width:20%;padding-bottom:10px}.edd-payment-details-download-amount,.edd-price-currency{font-size:16px}.order-data-column input[type=email]{padding:6px 10px}.edd-refund-submit-line-total td:last-of-type{flex:0 0 120px}#edd-item-tables-wrapper .addresses tbody tr{display:-ms-grid;display:grid}#edd-item-tables-wrapper .addresses tbody td:not(.no-items){padding-right:35%}}@media screen and (max-width:600px){.edd-edit-purchase-element ul li.item_price,.edd-edit-purchase-element ul li.item_price.item_quantity,.edd-edit-purchase-element ul li.item_tax{width:100%;padding-bottom:20px}.edd-edit-purchase-element .edd-add-download-to-purchase ul li.item_tax,.edd-edit-purchase-element ul li.price{width:100%;padding-bottom:0}.edd-edit-purchase-element .edd-add-download-to-purchase-actions{padding-top:15px}}#edd_product_stats .label{display:inline-block}#edd_product_stats .product-earnings-stats:before,#edd_product_stats .product-sales-stats:before{color:#82878c;font:normal 20px/1 dashicons;display:inline-block;padding:0 0 0 2px;position:relative;top:0;right:-1px;speak:none;text-decoration:none!important;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#edd_product_stats .product-sales-stats:before{content:""}#edd_product_stats .product-earnings-stats:before{content:""}body.dashboard_page_edd-upgrades.js .postbox .hndle{cursor:default}.edd_dashboard_widget table thead td{border-bottom:1px solid #ececec;color:#777}.edd_dashboard_widget .table_left{float:right;width:45%}.edd_dashboard_widget .table_right{float:left;width:45%}.edd_dashboard_widget .inside{font-size:12px}.edd_dashboard_widget td{padding:3px 0}.edd_dashboard_widget .b,.edd_dashboard_widget .t{line-height:1.5;vertical-align:middle}.edd_dashboard_widget .b{padding-left:6px;width:auto}.edd_dashboard_widget .t{font-size:12px;padding-left:12px;color:#777;width:100%}.edd_dashboard_widget .label_heading{border-top:1px solid #ececec;color:#8f8f8f;font-family:Helvetica,Arial,sans-serif;font-size:12px;font-weight:400;display:block;padding-top:10px;margin:0 12px 8px 0}.edd_dashboard_widget .edd_dashboard_widget_subheading{border-top:1px solid #ececec;color:#8f8f8f;font-size:14px;padding-top:10px;margin:1em 0 0}.edd_dashboard_widget .edd_dashboard_widget_subheading+.table{margin:8px 0 0}.edd_dashboard_widget .edd_price_label{background:#00769c;border-radius:3px;color:#fff;font-size:10px;padding:2px 4px;margin-left:2px}.edd_dashboard_widget table{width:100%;margin-right:0;margin-bottom:1em}td.edd_order_label{width:80%}td.edd_order_price{text-align:left}@media handheld,only screen and (max-width:1000px){.edd_dashboard_widget .edd-recent-email{display:none}}body.download_page_edd-reports{overflow-y:scroll}.edd-chip{font-size:10px;font-weight:700;text-transform:uppercase;line-height:1;padding:3px;border-radius:3px;color:#fff;background-color:#444}.edd-reports-wrapper .postbox h2,.edd-reports-wrapper .postbox h3{font-size:1.3em}#edd-dashboard-widgets-wrap .metabox-holder{padding-top:0}.edd-reports-wrapper .postbox .edd-select{max-width:200px;vertical-align:baseline;margin-left:4px;margin-bottom:16px}.download_page_edd-reports #edd-item-wrapper{margin:0}#edd-dashboard-widgets-wrap .postbox h2,#edd-dashboard-widgets-wrap .postbox h3{cursor:default}.edd-date-range-options .edd_datepicker{width:105px}.edd-report-wrap{clear:both}.edd-report-wrap h3{clear:both;margin:0 0 20px}.edd-reports-chart,.edd-reports-table{margin-bottom:20px}.edd-admin--has-grid{display:grid;display:-ms-grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));grid-gap:20px}.edd-admin--has-grid .postbox{margin-bottom:0}.edd-admin--has-grid .edd-from-to-wrapper{display:flex;margin-bottom:16px;width:100%}.edd-admin--has-grid .edd-from-to-wrapper input{width:100%}.edd-admin--has-grid .edd-from-to-wrapper span{flex-grow:1}.edd-admin--has-grid form{display:flex;flex-direction:column;flex-wrap:wrap;position:relative}fieldset.edd-to-and-from-container{display:flex;gap:8px}fieldset.edd-to-and-from-container select{flex:0 0 calc(50% - 6px)}span.edd-to-and-from--separator{line-height:normal;-ms-grid-row-align:center;align-self:center;margin-bottom:16px}.edd-admin--has-grid .postbox .edd-select{max-width:100%;margin-left:0}.edd-admin--has-grid .button.updated-message:before,.edd-admin--has-grid .button.updating-message:before{vertical-align:text-bottom;margin:0 0 0 5px}.edd-import-export-form .edd-progress{background:#ddd;border-radius:15px;height:15px;flex-basis:100%}.edd-import-export-form .edd-progress div{background:#ccc;border-radius:15px;height:100%;width:0}.edd-import-export-form .notice-wrap{background-color:#f4f4f4;border-color:#eae9e9;border-style:solid;border-width:1px 0;padding:12px;overflow:auto;margin:20px -12px -23px;position:relative;width:100%;display:flex;justify-content:space-between;align-items:center}.notice-wrap div.notice{margin:0}.admin-color-fresh .edd-import-export-form .edd-progress div{background:#0073aa}.admin-color-light .edd-import-export-form .edd-progress div{background:#888}.admin-color-blue .edd-import-export-form .edd-progress div{background:#096484}.admin-color-coffee .edd-import-export-form .edd-progress div{background:#c7a589}.admin-color-ectoplasm .edd-import-export-form .edd-progress div{background:#a3b745}.admin-color-midnight .edd-import-export-form .edd-progress div{background:#e14d43}.admin-color-sunrise .edd-import-export-form .edd-progress div{background:#dd823b}.graph-option-section{float:right}.edd-report-filters-title span{display:block;padding:20px}#edd-graphs-filter form{padding:20px}#edd-graphs-filter label{vertical-align:inherit}#edd-graphs-filter .graph-option-section{display:inline-block;line-height:2em;margin:0 0 0 5px;padding:0}.download_page_edd-reports .section-content #post-body-content{float:none}.download_page_edd-reports .section-content select[name=range]{display:none}.edd-mix-totals{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:10px}.edd-mix-chart{display:inline-block;width:49%;vertical-align:top}.edd-graph-notes{color:#9c9c9c}.edd-graph-notes span{display:block}.edd-pie-graph .legend{display:none}.edd-pie-legend{overflow:auto;margin-top:10px}.edd-legend-item-wrapper{color:#333;display:inline-block;font-size:8pt;padding:2px 5px 0;width:48%;height:20px}.edd-legend-color{border:1px solid #cfcfcf;display:inline-block;margin-left:5px;width:20px;height:15px}.edd-pie-legend-item{display:inline-block;vertical-align:top;width:80%}#edd-reports-tiles-wrap .metabox-holder{padding:0}#edd-reports-tiles-wrap #dashboard-widgets{overflow:auto}#edd-reports-tiles-wrap #dashboard-widgets .postbox-container{width:33.3%}.download_page_edd-reports .section-content .tablenav.top{display:none}#edd_tax_rates{margin:1em 0 0}[id*=edd-recapture-].button{font-size:16px;height:auto;padding:8px 14px;margin:6px 0 0}[id*=edd-recapture-].button .dashicons{line-height:29px;margin-left:8px}[id*=edd-recapture-].button .edd-loading,[id*=edd-recapture-].button .edd-loading:after{border-radius:50%;display:inline-block;width:14px;height:14px}[id*=edd-recapture-].button .edd-loading{position:relative;top:3px;margin-right:4px;box-shadow:0 0 2px rgba(0,0,0,.2);animation:edd-spinning 1.1s linear infinite;border:2px solid hsla(0,0%,100%,.5);border-right-color:#fff;font-size:14px;filter:alpha(opacity=0);transform:translateZ(0)}#edd-recapture-disconnect.button .edd-loading.dark{border-color:rgba(0,0,0,.2) #666 rgba(0,0,0,.2) rgba(0,0,0,.2);box-shadow:none}.recapture-notice{position:relative}@keyframes edd-spinning{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}#edd-chartjs-tooltip{position:absolute;background-color:#fff;border-radius:7px;transition:all .1s ease;pointer-events:none;transform:translate(50%);font-size:12px;box-shadow:0 0 0 1px rgba(89,94,100,.1),0 15px 35px 0 rgba(89,94,100,.1),0 5px 15px 0 rgba(0,0,0,.12);min-width:120px;opacity:0}.edd-chartjs-tooltip-key{display:inline-block;width:10px;height:10px;margin-left:5px}#edd-send-test-summary-save-changes-notice .notice p{font-size:13px}#edd-send-test-summary-notice,#edd-send-test-summary-save-changes-notice{display:flex;margin-top:5px}.edd-graph .y1Axis{color:#edc240!important}.edd-graph .y2Axis{color:#afd8f8!important}.wp-list-table.apikeys input.code{width:100%;font-size:10px;cursor:text;background:#fff;border:1px solid #ddd;box-shadow:none;color:#555}.edd-toggle{position:relative;display:inline-block;overflow:visible}.edd-toggle input[type=checkbox]{display:inline-block;vertical-align:middle;position:relative;margin:0;padding:0;width:42px;min-width:42px;height:24px;background-color:#ccc;transition:background .2s ease;border-radius:34px;box-shadow:none;border:none}.edd-toggle .label{display:inline-block;vertical-align:middle;white-space:nowrap}.edd-toggle input[type=checkbox]:before{position:absolute;content:"";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;transition:transform .1s ease;border-radius:50%}@media only screen and (max-width:782px){.edd-toggle input[type=checkbox]:checked:before{margin:-.1875rem -.25rem 0 0}}.edd-toggle input[type=checkbox]:checked{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.edd-toggle input[type=checkbox]:active,.edd-toggle input[type=checkbox]:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px #7e8993}.edd-toggle input[type=checkbox]:checked:active,.edd-toggle input[type=checkbox]:checked:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #007cba;box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color)}.edd-toggle input[type=checkbox]:checked:before{transform:translateX(-22px)}.edd-toggle .label+input,.edd-toggle input+.label{margin-right:5px}.download_page_edd-tools .tablenav .actions{overflow:visible}.edd_user_search_wrap{position:relative;overflow:visible}.edd_user_search_wrap .spinner{position:absolute;margin:0;padding:0;left:4px;top:-2px}.edd_user_search_wrap.loading .spinner{visibility:visible}.edd_user_search_results{position:absolute;right:0;top:20px}.edd_user_search_results a.edd-ajax-user-cancel{position:absolute;left:6px;top:2px}.edd_user_search_results ul{background:#fafafa;border:1px solid #dfdfdf;overflow-y:scroll;padding:0;margin:0;height:150px;width:185px;box-shadow:0 3px 5px rgba(0,0,0,.1)}.edd_user_search_results li{margin:0}.edd_user_search_results li a{display:block;text-decoration:none;padding:6px 10px}.edd_user_search_results li a:hover{background:#f5f5f5}.edd_user_search_results li.no-users{text-align:center;vertical-align:middle;display:block;line-height:150px;color:#bbb;text-transform:uppercase;font-size:11px}@media screen and (max-width:1100px){.edd-mix-chart{display:block;width:100%}}@media screen and (max-width:782px){.license-expiration-date-notice,.license-lifetime-notice,.license-null{padding-right:0}}@media screen and (max-width:600px){#edd-edit-order-form input.large-text{width:100%}}#edd-item-wrapper{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative;margin-top:15px;display:flex}#edd-item-wrapper.full-width{max-width:100%}#edd-item-wrapper:after{content:"";display:block;clear:both;visibility:hidden;font-size:0;height:0}.edd-sections-wrap{clear:both;width:100%}.edd-sections-wrap .section-wrap{background-color:#fff;display:inline-block;z-index:2}.js .edd-sections-wrap .edd-vertical-sections:not(.meta-box) .section-wrap>div{min-height:500px;height:100%}.edd-sections-wrap .section-wrap .customer-section:not(:last-child){border-bottom:1px solid #eee}.edd-sections-wrap .section-wrap .customer-section table{margin-bottom:20px}.edd-sections-wrap .section-wrap{border-right:1px solid #e5e5e5}.edd-sections-wrap .section-wrap .section-content>*{padding:20px}.edd-sections-wrap .section-wrap .section-content h2{margin:0;padding-bottom:0}.edd-sections-wrap .section-wrap .avatar-wrap{float:right;padding-left:10px;text-align:center}.edd-sections-wrap .section-wrap img.avatar{border-radius:5px}.edd-sections-wrap .section-wrap .customer-id{position:absolute;left:0;top:0;padding:10px;background-color:#fafafa;border-bottom-right-radius:20%;border:1px solid #eee;border-top:none;border-left:none;font-family:monospace;font-size:18px;font-weight:600}.edd-item-info.customer-info input[type=password],.edd-item-info.customer-info input[type=text],.edd-item-info.customer-info select{width:200px;height:auto;box-shadow:none;transition:none;border:1px solid #ddd;margin:-5px -2px 4px 0;font-size:13px;padding:2px 4px}.edd-sections-wrap .section-wrap .customer-main-wrapper{float:right}.edd-sections-wrap .section-wrap .customer-main-wrapper input[name="customerinfo[name]"]{font-size:24px}.edd-sections-wrap .section-wrap .customer-address-wrapper{float:left;margin-top:-3px;margin-left:50px;width:202px}.edd-sections-wrap .section-wrap .info-wrapper{min-height:125px;overflow:visible}.edd-sections-wrap .section-wrap .customer-address span[data-key=address2],.edd-sections-wrap .section-wrap .customer-address span[data-key=address],.edd-sections-wrap .section-wrap .customer-address span[data-key=country]{display:block}.edd-sections-wrap .section-wrap a.delete{color:red;margin-left:5px;text-decoration:none}.customer-info{min-height:185px}.customer-info .customer-name{font-size:24px;font-weight:600}.customer-info .customer-name.editable{margin-bottom:6px}.customer-edit-link a{font-weight:400;text-decoration:none}.disconnect-user a{color:#aaa;font-size:20px}#customer-edit-actions{padding:3px;line-height:28px;text-align:center}#customer-edit-actions .button-secondary{margin-left:5px}#customer-edit-actions .cancel{padding:5px}.edd-sections-wrap .section-wrap .row-title{width:30%}.edd-sections-wrap .section-wrap .editable{display:block;padding:3px}.edd-sections-wrap .section-wrap div.edit-item{margin-right:-4px;margin-top:-20px}.edd-sections-wrap .section-wrap .customer-address.edit-item{margin-top:3px}.edd-sections-wrap .section-wrap span.edit-item{display:none}.edd-sections-wrap .section-wrap .edit-item input{font-size:13px}.edd-sections-wrap .section-wrap .customer-name.edit-item input{margin-top:-5px}.edd-sections-wrap .section-wrap .edd_user_search_results{right:-2px;top:18px}.edd-sections-wrap .section-wrap .edd_user_search_results ul{width:198px}#edd-item-stats-wrapper{margin:0 auto;text-align:center}#edd-item-stats-wrapper ul{display:flex;margin:0}#edd-item-stats-wrapper li{font-size:14px;margin-bottom:0;width:50%}#edd-item-stats-wrapper a{text-decoration:none}#edd-item-stats-wrapper .dashicons{color:#888;margin-top:-2px}#edd-item-tables-wrapper table{width:100%}#edd-item-tables-wrapper .no-items{text-align:right}#edd-item-tables-wrapper .emails .add-customer-email-row{background-color:#f4f4f4;border-top:1px solid #e5e5e5}#edd-item-tables-wrapper .add-customer-email-wrapper{display:flex;flex-wrap:wrap;align-items:center;margin:12px 0}#edd-item-tables-wrapper .edd-form-group{margin-bottom:0}#edd-item-tables-wrapper .edd-make-email-primary{flex-grow:1;margin-right:12px}#edd-item-tables-wrapper .emails .spinner{float:none;margin:0 10px;-ms-grid-row-align:center;align-self:center}#edd-item-tables-wrapper .notice-error{background-color:#fff5f5}#edd-item-notes-wrapper{min-height:50px}.customer-note-input{margin-bottom:5px;width:100%}.customer-note-wrapper{border-bottom:1px solid #f9f9f9;min-height:38px;padding:7px 7px 7px 0}.customer-note-wrapper span{display:block}.note-content-wrap{padding-top:7px}.edd-sections-wrap .section-wrap .notice-container{padding-right:20px;padding-left:20px;margin-right:-20px;margin-left:-20px}@media screen and (max-width:810px)and (min-width:656px){.customer-info .customer-name{font-size:16px}.edd-sections-wrap .section-wrap .widefat td,.widefat th{max-width:100%!important;display:table-cell}}@media screen and (max-width:781px){#edd-item-tab-wrapper,.edd-sections-wrap .section-wrap{margin:0;width:100%}#edd-item-tab-wrapper-list .dashicons{font-size:18px}.edd-item-has-tabs .edd-sections-wrap .section-wrap{border-top:1px solid #e5e5e5;border-right:0;margin-top:-1px}}@media screen and (max-width:656px){.edd-item-info.customer-info{position:relative}.edd-sections-wrap .section-wrap .customer-address-wrapper{float:none;position:absolute;top:84px;right:165px;max-width:200px}.edd-sections-wrap .section-wrap .customer-main-wrapper{float:none;position:absolute;right:165px}.customer-info .customer-name{font-size:16px}.edd-sections-wrap .section-wrap #edd-item-stats-wrapper{padding-right:0;padding-left:0}.edd-sections-wrap .section-wrap .customer-section{margin-bottom:0}.edd-sections-wrap .section-wrap .widefat td.column-primary,.edd-sections-wrap .section-wrap .widefat td.no-items,.edd-sections-wrap .section-wrap .widefat th.column-primary{width:100px!important;display:table-cell;overflow:hidden;text-align:right}.edd-sections-wrap .section-wrap .customer-id{display:none}#edd-item-tables-wrapper .emails td.column-primary{padding-left:10px;width:100%!important}#edd-item-tables-wrapper .edd-form-group{margin:0 0 16px}}@media screen and (max-width:480px){#edd-item-tab-wrapper-list li{width:50%}#edd-item-tab-wrapper-list li:nth-child(3n+3){border-width:0 0 1px 1px}#edd-item-tab-wrapper-list li:nth-child(2n){border-width:0 0 1px}.download_page_edd-reports .button{text-align:center}#edd-payment-date-filters span{display:block}#edd-payment-date-filters span>input{float:left}#edd-add-discount select[multiple] option,#edd-edit-discount select[multiple] option{height:20px}.download_page_edd-reports .inside .button,.download_page_edd-reports .inside input[type=submit],.download_page_edd-reports .inside input[type=text],.download_page_edd-reports .inside select,.download_page_edd-settings .inside input[type=button],.download_page_edd-tools .inside input[type=submit],.download_page_edd-tools .inside input[type=text],.download_page_edd-tools .inside select{width:100%}#edd-add-discount select[multiple],#edd-edit-discount select[multiple],.download_page_edd-tools select[multiple]{height:200px!important}.download_page_edd-settings input[type=checkbox]{margin:2px 0}.post-type-download input[type=checkbox]{margin-right:2px}}.inside .edd-tools-textarea{background:#32373c;color:rgba(240,245,250,.7);font-size:12px;font-family:Menlo,Monaco,monospace;display:block;overflow:auto;white-space:pre;width:100%;height:450px;padding:10px;outline:none}#system-info-textarea::selection{background:#555;color:#fff}#edd-system-info .edd-inline-button{margin-right:5px}.recount-stats-controls form{display:inline}.edd-recount-stats-descriptions span{display:none;line-height:24px}.edd-vertical-sections{overflow:visible;display:block;display:flex}#edd-item-tab-wrapper,.edd-vertical-sections .section-nav{position:relative;width:20%;line-height:1em;margin:0 0 0 -1px;padding:0;background-color:#f5f5f5;border-left:1px solid #e5e5e5;box-sizing:border-box;max-width:200px}#edd-item-tab-wrapper-list{margin:0}#edd-item-tab-wrapper li,.edd-vertical-sections .section-nav li{display:block;position:relative;margin:0;padding:0;background-color:#fcfcfc}.edd-vertical-sections .section-title:last-of-type{margin-bottom:24px}#edd-item-tab-wrapper li>.edd-item-tab-label-wrap,#edd-item-tab-wrapper li a,.edd-vertical-sections .section-nav li a{display:flex;margin:0;padding:9px;text-decoration:none;border-bottom:1px solid #e5e5e5;box-shadow:none;position:relative;align-items:center}#edd-item-tab-wrapper li a:focus,#edd-item-tab-wrapper li a:hover,.edd-vertical-sections .section-nav li a:focus,.edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0;outline:0;transition:all .25s}.edd-vertical-sections .section-nav .section-title--is-active a:after{content:"";width:1px;height:100%;background:#fff;position:absolute;left:0;top:0;bottom:0;z-index:3}#edd-item-tab-wrapper li>.edd-item-tab-label-wrap{background-color:#fff}.edd-vertical-sections .section-nav li a>.dashicons,.edd-vertical-sections .section-nav li a>span{display:inline-block}.edd-vertical-sections .section-nav li a>span{max-width:76%}.edd-vertical-sections .section-nav li a .dashicons{line-height:20px;margin-left:3px;color:#888}.edd-vertical-sections .section-nav .section-title--is-active a{font-weight:700;color:#555;background-color:#fff;border-left:none;margin-left:-1px}.edd-vertical-sections.use-js .section-content,.no-js .edd-vertical-sections.use-js.edd-item-header-small,.no-js .edd-vertical-sections.use-js .section-nav{display:none}.no-js .edd-vertical-sections.use-js .section-content{display:block}.admin-color-fresh .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-fresh .edd-vertical-sections .section-nav li a:focus,.admin-color-fresh .edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0 #0073aa}.admin-color-blue .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-blue .edd-vertical-sections .section-nav li a:focus,.admin-color-blue .edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0 #096484}.admin-color-coffee .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-coffee .edd-vertical-sections .section-nav li a:focus,.admin-color-coffee .edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0 #c7a589}.admin-color-ectoplasm .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-ectoplasm .edd-vertical-sections .section-nav li a:focus,.admin-color-ectoplasm .edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0 #a3b745}.admin-color-midnight .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-midnight .edd-vertical-sections .section-nav li a:focus,.admin-color-midnight .edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0 #e14d43}.admin-color-ocean .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-ocean .edd-vertical-sections .section-nav li a:focus,.admin-color-ocean .edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0 #627c83}.admin-color-sunrise .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-sunrise .edd-vertical-sections .section-nav li a:focus,.admin-color-sunrise .edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0 #be3631}.admin-color-light .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-light .edd-vertical-sections .section-nav li a:focus,.admin-color-light .edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0 #888}.admin-color-evergreen .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-evergreen .edd-vertical-sections .section-nav li a:focus,.admin-color-evergreen .edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0 #36533f}.admin-color-mint .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-mint .edd-vertical-sections .section-nav li a:focus,.admin-color-mint .edd-vertical-sections .section-nav li a:hover{box-shadow:inset -5px 0 #4f6d59}.edd-vertical-sections .section-nav .section-title--is-active .dashicons{color:#555}@media only screen and (max-width:782px){#edd-item-tab-wrapper,.edd-vertical-sections .section-nav{width:48px}.edd-vertical-sections .section-nav li a{justify-content:center}.edd-vertical-sections .section-nav li a .dashicons{width:24px;height:24px;font-size:24px;line-height:24px;margin:0}.section-nav li .dashicons:before{width:24px;height:24px}#edd-item-tab-wrapper .edd-item-tab-label,.section-nav li .label{overflow:hidden;position:absolute;top:-1000em;right:-1000em;width:1px;height:1px}}#edd-item-card-wrapper,.edd-vertical-sections .section-wrap{width:80%}#edd-item-card-wrapper .item-section{background:#fff;overflow:hidden;box-sizing:border-box}:not(#edd-item-tab-wrapper)+#edd-item-card-wrapper .item-section{margin:25px 0;padding:20px;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04)}#edd-item-tab-wrapper+#edd-item-card-wrapper{padding:20px;border-right:1px solid #e5e5e5;box-sizing:border-box}@media only screen and (min-width:1200px){#edd-graphs-filter,#edd-item-card-wrapper,.edd-vertical-sections:not(.meta-box) .section-wrap{width:calc(100% - 200px)}}@media only screen and (max-width:782px){#edd-graphs-filter,#edd-item-card-wrapper,.edd-vertical-sections .section-wrap{width:calc(100% - 48px)}}#edd-debug-log .edd-inline-button{margin-right:5px}.edd-settings-sidebar{padding-top:27px}.edd-settings-sidebar-content{background-color:#fff;text-align:center;border:1px solid #ddd;box-sizing:border-box;max-width:300px}.edd-settings-sidebar-content p{font-size:14px;line-height:1.5;margin-top:0}.edd-sidebar-header-section{background-color:#35495c;line-height:1;padding:26px 20px 24px;border-bottom:3px dashed #fafafa}.edd-sidebar-description-section{background-color:#fafafa;padding:16px 20px;border-bottom:1px solid #ddd}.edd-sidebar-description-section .edd-sidebar-description{margin:0}.edd-sidebar-coupon-section{font-size:14px;padding:16px 20px}.edd-sidebar-coupon-section label{display:block;line-height:1.4;margin-bottom:6px}.edd-sidebar-coupon-section label strong{color:#253b51;font-weight:700}.edd-sidebar-coupon-section input{background:#f4f7fa;font-size:22px;font-weight:600;text-align:center;padding:10px;border:2px dashed #2794da;border-radius:4px;margin-bottom:16px;box-shadow:none;width:100%}.edd-sidebar-coupon-section input:focus{border:2px dashed #2794da;box-shadow:none}.edd-settings-sidebar-content .edd-coupon-note{color:#6c7883;font-size:13px;font-style:italic;margin:0}.edd-settings-sidebar-content .edd-coupon-note a{color:#253b51}.edd-settings-sidebar-content .edd-coupon-note a:hover{text-decoration:none}.edd-sidebar-footer-section{background-color:#fafafa;padding:16px 20px;border-top:1px solid #ddd}.edd-sidebar-footer-section .edd-cta-button{display:block;background-color:#2794da;color:#fff;text-decoration:none;font-size:20px;font-weight:700;text-transform:uppercase;padding:17px 10px;border:none;border-radius:4px;width:100%;box-sizing:border-box;box-shadow:none;transition:background-color .2s}.edd-sidebar-footer-section .edd-cta-button:hover{background-color:#2386c5}@media (min-width:1080px){.edd-has-sidebar .edd-settings-content{float:right;width:67%}.edd-has-sidebar .edd-settings-sidebar{float:left;width:31%}}@media (min-width:1240px){.edd-has-sidebar .edd-settings-content{width:74%}.edd-has-sidebar .edd-settings-sidebar{width:23%}}.taxes-tab .edd-has-sidebar .edd-settings-content,.taxes-tab .edd-has-sidebar .edd-settings-sidebar{float:none;width:100%}.bfcm-promo-img-container{background-color:#35495c;width:100%;height:160px}.bfcm-code{color:#2794da;font-weight:700}.sale-ends{position:absolute;bottom:9px;left:14px;display:inline-block;color:#6c7883;font-size:12px;text-align:left;font-style:italic;width:150px} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-tax-rates-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-tax-rates-rtl.min.css deleted file mode 100644 index 8dd18105..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-tax-rates-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -#edd-admin-tax-rates{margin:1em 0 0}#edd-admin-tax-rates table{border-collapse:collapse}#edd-admin-tax-rates .tablenav.top{display:flex;justify-content:space-between}#edd-admin-tax-rates .edd-admin-tax-rates__tablenav--left{display:inline-flex}#edd-admin-tax-rates th:not(.check-column){padding:15px 10px;width:unset}#edd-admin-tax-rates .chosen-container{width:100%!important}#edd-admin-tax-rates tbody tr:not(:last-of-type){border-bottom:1px solid #e0e0e0}#edd-admin-tax-rates tfoot.add-new th{font-weight:400;padding:12px 8px 10px}#edd-admin-tax-rates .edd-tax-rate-row--inactive,#edd-admin-tax-rates .edd-tax-rate-row--is-empty+.edd-tax-rate-row--is-empty{display:none}#edd-admin-tax-rates .has-inactive .edd-tax-rate-row--inactive{display:table-row}#edd-admin-tax-rates .edd-tax-rate-row--is-empty td{background-color:#f9f9f9}#edd-admin-tax-rates .edd-tax-rate-row--inactive td{color:#999;background-color:#f9f9f9}#edd-admin-tax-rates .edd-tax-rate-table-add{background-color:#f9f9f9}@media screen and (max-width:782px){#edd-admin-tax-rates tfoot:not(.add-new) th:not(.edd-tax-rates-table-rate),#edd-admin-tax-rates thead th:not(.edd-tax-rates-table-rate){display:none}#edd-admin-tax-rates .edd-tax-rate-row,#edd-admin-tax-rates tfoot:not(.add-new) tr,#edd-admin-tax-rates thead tr{display:-ms-grid;display:grid;-ms-grid-columns:2.5em 1fr;grid-template-columns:2.5em 1fr;-ms-grid-rows:1fr;grid-template-rows:1fr;grid-gap:0 16px}#edd-admin-tax-rates th.edd-tax-rates-table-rate{padding-right:12px}#edd-admin-tax-rates .edd-tax-rates-table-checkbox{-ms-grid-row:1;-ms-grid-row-span:4;grid-row:1/5}#edd-admin-tax-rates tbody td{padding-right:35%!important}#edd-admin-tax-rates td:before{content:attr(data-colname);display:block;width:32%;position:absolute}#edd-admin-tax-rates .tablenav.top{flex-wrap:wrap}#edd-admin-tax-rates .edd-admin-tax-rates__tablenav--left{margin-bottom:16px}#edd-admin-tax-rates .edd-admin-tax-rates__tablenav--left select{margin-left:6px}}.edd-tax-rate-table-add th input[type=number],.edd-tax-rate-table-add th input[type=text],.edd-tax-rate-table-add th select{width:100%;margin:0;padding:4px}.edd-tax-rate-table-add #tax_rate_region_global{margin-left:4px;margin-bottom:8px}@media screen and (max-width:782px){.edd-tax-rate-table-add,.edd-tax-rate-table-add th{display:block}.edd-tax-rate-table-add .screen-reader-text{display:block;width:unset;clip:unset;height:unset;-webkit-clip-path:unset;clip-path:unset;margin:0 0 12px;position:relative}} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-tax-rates.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-tax-rates.min.css deleted file mode 100644 index fc6d4697..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin-tax-rates.min.css +++ /dev/null @@ -1 +0,0 @@ -#edd-admin-tax-rates{margin:1em 0 0}#edd-admin-tax-rates table{border-collapse:collapse}#edd-admin-tax-rates .tablenav.top{display:flex;justify-content:space-between}#edd-admin-tax-rates .edd-admin-tax-rates__tablenav--left{display:inline-flex}#edd-admin-tax-rates th:not(.check-column){padding:15px 10px;width:unset}#edd-admin-tax-rates .chosen-container{width:100%!important}#edd-admin-tax-rates tbody tr:not(:last-of-type){border-bottom:1px solid #e0e0e0}#edd-admin-tax-rates tfoot.add-new th{font-weight:400;padding:12px 8px 10px}#edd-admin-tax-rates .edd-tax-rate-row--inactive,#edd-admin-tax-rates .edd-tax-rate-row--is-empty+.edd-tax-rate-row--is-empty{display:none}#edd-admin-tax-rates .has-inactive .edd-tax-rate-row--inactive{display:table-row}#edd-admin-tax-rates .edd-tax-rate-row--is-empty td{background-color:#f9f9f9}#edd-admin-tax-rates .edd-tax-rate-row--inactive td{color:#999;background-color:#f9f9f9}#edd-admin-tax-rates .edd-tax-rate-table-add{background-color:#f9f9f9}@media screen and (max-width:782px){#edd-admin-tax-rates tfoot:not(.add-new) th:not(.edd-tax-rates-table-rate),#edd-admin-tax-rates thead th:not(.edd-tax-rates-table-rate){display:none}#edd-admin-tax-rates .edd-tax-rate-row,#edd-admin-tax-rates tfoot:not(.add-new) tr,#edd-admin-tax-rates thead tr{display:-ms-grid;display:grid;-ms-grid-columns:2.5em 1fr;grid-template-columns:2.5em 1fr;-ms-grid-rows:1fr;grid-template-rows:1fr;grid-gap:0 16px}#edd-admin-tax-rates th.edd-tax-rates-table-rate{padding-left:12px}#edd-admin-tax-rates .edd-tax-rates-table-checkbox{-ms-grid-row:1;-ms-grid-row-span:4;grid-row:1/5}#edd-admin-tax-rates tbody td{padding-left:35%!important}#edd-admin-tax-rates td:before{content:attr(data-colname);display:block;width:32%;position:absolute}#edd-admin-tax-rates .tablenav.top{flex-wrap:wrap}#edd-admin-tax-rates .edd-admin-tax-rates__tablenav--left{margin-bottom:16px}#edd-admin-tax-rates .edd-admin-tax-rates__tablenav--left select{margin-right:6px}}.edd-tax-rate-table-add th input[type=number],.edd-tax-rate-table-add th input[type=text],.edd-tax-rate-table-add th select{width:100%;margin:0;padding:4px}.edd-tax-rate-table-add #tax_rate_region_global{margin-right:4px;margin-bottom:8px}@media screen and (max-width:782px){.edd-tax-rate-table-add,.edd-tax-rate-table-add th{display:block}.edd-tax-rate-table-add .screen-reader-text{display:block;width:unset;clip:unset;height:unset;-webkit-clip-path:unset;clip-path:unset;margin:0 0 12px;position:relative}} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin.min.css deleted file mode 100644 index 39389650..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-admin.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-custom-price-option-sections-wrap{display:none;border:1px solid #c3c4c7;border-top:0 solid #c3c4c7;box-sizing:border-box;width:100%}.edd-custom-price-option-section{display:block;padding:10px 8px;border-bottom:1px solid hsla(0,0%,87.1%,.3)}.edd-custom-price-option-section-title{display:block;font-weight:600;padding:0 0 10px}.edd-custom-price-option-section-content{display:flex;gap:12px;margin-bottom:6px}.edd-custom-price-option-section:last-child{border-bottom:none}.toggle-custom-price-option-section{color:#787c82}.toggle-custom-price-option-section:hover{color:#537994}#edd_product_settings .edd-product-options__title,#edd_product_settings .inside strong{border-top:1px solid #c3c4c7;border-bottom:1px solid #c3c4c7;background-color:#f9f9f9;display:flex;font-weight:600;margin:0 -12px 16px;padding:8px 12px;justify-content:space-between;align-items:center}#edd_product_settings .edd-product-options-wrapper:first-of-type .edd-product-options__title,#edd_product_settings .inside div:first-child strong{margin-top:-8px}#edd_product_settings .edd-product-options__title .edd-help-tip,#edd_product_settings .inside strong .edd-help-tip{font-size:20px}#edd_product_settings .label--block{display:block;margin:0 0 4px}.edd_repeatable_row.ui-sortable-placeholder{line-height:0;padding:0;margin:0;box-sizing:border-box;border:1px dashed #c3c4c7;visibility:visible!important}.edd-add-repeatable-row{border-top:1px solid #c3c4c7;padding:12px;margin:15px -12px -12px;display:flex;justify-content:flex-end;align-items:center}.edd_repeatable_row input[type=text].large-text{width:100%}.edd_repeatable_upload_wrapper:not(:first-child),.edd_variable_prices_wrapper:not(:first-child){margin-top:12px}.edd_repeatable_row.ui-sortable-helper .edd-repeatable-row-actions .edd-remove-row{display:none}.edd-repeatable-row-actions{color:#787c82}.edd-repeatable-row-actions a{text-decoration:none;width:auto;cursor:pointer}.edd-bundle-products-header,.edd-repeatable-row-header{clear:both;background:#f6f7f7;border:1px solid #c3c4c7;display:flex;justify-content:space-between}.edd-repeatable-row-header{cursor:move}.edd_repeatable_row:hover .edd-repeatable-row-header,.edd_repeatable_row:hover .edd-repeatable-row-standard-fields{border-color:#c3c4c7}.edd-bundled-product-row:after,.edd-bundled-product-row:before,.edd-repeatable-row-header:after,.edd-repeatable-row-header:before{content:"";display:table}.edd-bundled-product-row:after,.edd-repeatable-row-header:after{clear:both}.edd-bundle-products-header,.edd-repeatable-row-title{font-weight:600}.edd-bundle-products-header,.edd-repeatable-row-actions,.edd-repeatable-row-title{padding:8px;box-sizing:border-box}.edd-repeatable-row-actions{flex-grow:1;text-align:right}.edd-bundled-product-row .edd-remove-row,.edd-repeatable-row-actions .edd-remove-row{width:auto;cursor:pointer}.edd-bundled-product-row,.edd-repeatable-row-standard-fields{padding:8px;border:1px solid #c3c4c7;border-top:0 solid #c3c4c7;display:flex;justify-content:space-between;align-items:center;gap:18px}.edd-bundled-product-row .edd-form-group,.edd-repeatable-row-standard-fields .edd-form-group{margin-bottom:0;display:inline-flex;flex-direction:column;flex-grow:1;justify-content:space-between}.edd-repeatable-row-setting-label .edd-help-tip{display:inline-block;margin-left:4px}.edd-bundled-product-item-reorder{min-width:30px}.edd-bundled-product-item-reorder .edd-product-file-reorder{font-size:20px;cursor:move;color:#dcdcde;font-family:dashicons;content:"";transition:color .2s}.edd-bundled-product-item-reorder .edd-product-file-reorder:hover{color:#a7aaad}.edd-bundled-product-actions{-ms-grid-row-align:center;align-self:center}#edd_products .edd-select,.edd_repeatable_product_wrapper .edd-select,.edd_repeatable_upload_wrapper .pricing select{min-width:100%;max-width:200px}.edd_repeatable_product_wrapper td{overflow:visible}@media screen and (max-width:480px){.edd-bundle-products-header,.edd-bundled-product-row,.edd-repeatable-row-header,.edd-repeatable-row-standard-fields{flex-wrap:wrap}.edd-bundled-product-row .edd-form-group,.edd-repeatable-row-standard-fields .edd-form-group{margin-left:0!important;margin-bottom:24px}}.edd_remove_repeatable{border:none;cursor:pointer;display:inline-block;padding:0;overflow:hidden;margin:8px 0 0;text-indent:-9999px;width:10px;height:10px}.edd_remove_repeatable:active,.edd_remove_repeatable:focus,.edd_remove_repeatable:hover{background-position:-10px 0!important}.edd_repeatable_upload_wrapper .edd_repeatable_upload_field_container{position:relative;width:100%}.edd_repeatable_upload_wrapper .edd_repeatable_upload_field_container+span:first-child{width:100%}.edd_repeatable_upload_field{padding-right:32px}.edd_upload_file button{background:#f6f7f7;border:none;border-left:1px solid #c3c4c7;padding:0 4px;position:absolute;height:calc(100% - 4px);overflow:hidden;top:2px;right:2px;display:inline-flex;justify-content:center;align-items:center}#edd-duplicate-action~#publishing-action{position:relative;top:-10px}.edd-form-group{margin-bottom:16px}.edd-form-group:last-of-type{margin-bottom:0}.edd-form-group>label,.edd-form-group__label{display:block;font-weight:600;margin-bottom:8px;padding:0}.edd-form-group__control{margin-bottom:12px;max-width:100%}.edd-form-group__control.is-check,.edd-form-group__control.is-radio{margin-top:4px}.edd-form-group__control:last-of-type{margin-bottom:0}.edd-form-group__control--is-inline{display:inline-flex;align-items:flex-end}.edd-form-group__input{max-width:100%}.edd-form-group__input[type=checkbox],.edd-form-group__input[type=radio]{margin-top:0}.edd-form-group__input[type=checkbox]+label,.edd-form-group__input[type=radio]+label{display:unset}select.edd-form-group__input{max-width:100%}.edd-form-group__help{color:#646970;font-size:13px;font-style:italic;line-height:normal;margin:8px 0 0}.edd-form-row{display:flex;flex-wrap:wrap;gap:12px}.edd-form-row__column{display:inline-flex;flex-direction:column;justify-content:flex-end}.edd-form-row__column.edd-form-group{margin-bottom:0}.edd-form-row label,.edd-form-row label.edd-form-group__label{margin-bottom:8px}#edd-migration-progress .dashicons-minus{color:#949494}#edd-migration-progress .dashicons-yes{color:green}#edd-migration-progress .dashicons-update:before{animation:rotation 2s linear infinite;display:block}#edd-v3-migration-remove-legacy-data-submit-wrap{display:flex;align-items:center;gap:6px}#edd-v3-migration-remove-legacy-data-submit-wrap .button{margin:0}#edd-filters{padding:10px;margin:0;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}#edd-filters .filter-items{flex-wrap:wrap;gap:6px;float:none;flex-grow:1}#edd-filters .filter-items,#edd-filters .filter-items .graph-option-section{display:flex;align-items:center}#edd-filters .filter-items .edd-date-range-picker[data-range=other] .edd-graphs-date-options{border-top-right-radius:4px;border-bottom-right-radius:4px}#edd-filters .filter-items .edd-date-range-picker[data-range=other] .edd-date-range-dates,#edd-filters .filter-items .edd-date-range-picker[data-range=other] .edd-date-range-relative-dates{display:none}#edd-filters .filter-items .edd-date-range-options{display:inline-block;margin:10px 0}#edd-filters .filter-items .edd-graphs-date-options{border-top-right-radius:0;border-bottom-right-radius:0}#edd-filters .filter-items .edd-date-range-dates{display:flex;align-items:center;border:1px solid #8c8f94;border-left:none;color:#2c3338;padding:4px 10px;margin-left:-5px;border-top-right-radius:4px;border-bottom-right-radius:4px;cursor:pointer;gap:4px}#edd-filters .filter-items .edd-date-range-dates.hidden{display:none}#edd-filters .filter-items .edd-date-range-selected-date{display:inline-block}#edd-filters .filter-items .edd-date-range-relative-dates{display:flex;align-items:center;margin-left:10px}#edd-filters .filter-items .edd-date-range-relative-dates.hidden{display:none}#edd-filters .filter-items .edd-date-range-selected-relative-date{position:relative;display:flex;align-items:center;border:1px solid #8c8f94;padding:4px 2px 4px 6px;color:#2c3338;margin-left:10px;margin-right:10px;border-radius:4px;cursor:pointer}#edd-filters .filter-items .edd-date-range-selected-relative-date .arrow-down{width:16px;height:auto;margin-left:6px;margin-top:2px;vertical-align:middle}#edd-filters .filter-items .edd-date-range-selected-relative-date.opened .edd-date-range-relative-dropdown{display:block}#edd-filters .filter-items .edd-date-range-relative-dropdown{position:absolute;z-index:99;width:420px;left:50%;top:100%;margin-top:10px;transform:translateX(-50%);background-color:#fff;border:1px solid #8c8f94;border-radius:4px;box-shadow:0 2px 5px 0 rgba(0,0,0,.25);display:none}#edd-filters .filter-items .edd-date-range-relative-dropdown:after{height:10px;width:10px;position:absolute;content:"";background:#fff;border-color:#8c8f94;border-style:solid;border-width:0 1px 1px 0;transform:rotate(-135deg);top:-6px;left:calc(50% - 4px)}#edd-filters .filter-items .edd-date-range-relative-dropdown .spinner{display:none}#edd-filters .filter-items .edd-date-range-relative-dropdown.loading{padding:10px;text-align:center}#edd-filters .filter-items .edd-date-range-relative-dropdown.loading .spinner{display:inline-block;visibility:visible;margin:0;float:unset}#edd-filters .filter-items .edd-date-range-relative-dropdown.loading :not(.spinner){display:none}#edd-filters .filter-items .edd-date-range-relative-dropdown ul li{display:flex;align-items:center;padding:2px 10px;opacity:.85;gap:20px}#edd-filters .filter-items .edd-date-range-relative-dropdown ul li.active,#edd-filters .filter-items .edd-date-range-relative-dropdown ul li:hover{cursor:pointer;color:var(--wp-admin-theme-color);opacity:1}#edd-filters .filter-items .edd-date-range-relative-dropdown ul li .date-range-name{width:110px}@media screen and (max-width:950px){#edd-filters .filter-items .graph-option-section{margin-top:8px;width:100%}#edd-filters .filter-items .edd-date-range-picker{flex-wrap:wrap}#edd-filters .filter-items .edd-graphs-date-options{width:100%;max-width:100%;min-height:40px;font-size:14px;border-top-right-radius:4px;border-bottom-right-radius:4px}#edd-filters .filter-items .edd-date-range-dates{width:100%;margin-top:10px;border:1px solid #8c8f94;margin-left:unset;border-radius:4px;font-size:14px;padding:8px 6px 8px 8px}#edd-filters .filter-items .edd-date-range-relative-dates{width:100%;flex-wrap:wrap;margin-left:0;margin-top:6px}#edd-filters .filter-items .edd-date-range-selected-relative-date{width:100%;margin-top:8px;margin-left:0;margin-right:0;font-size:14px;padding:8px 6px 8px 8px;flex-wrap:wrap}#edd-filters .filter-items .edd-date-range-selected-relative-date .arrow-down{margin-left:auto}#edd-filters .filter-items .edd-date-range-relative-dropdown{position:relative;width:100%;left:0;top:0;transform:unset;box-shadow:unset;border:unset;margin:0}#edd-filters .filter-items .edd-date-range-relative-dropdown:after{display:none}#edd-filters .filter-items .edd-date-range-relative-dropdown ul{margin-bottom:0}#edd-filters .filter-items .edd-date-range-relative-dropdown ul li{padding-left:0;padding-right:0;justify-content:space-between;flex-wrap:wrap;gap:unset}#edd-filters .filter-items .edd-date-range-relative-dropdown ul li .date-range-dates,#edd-filters .filter-items .edd-date-range-relative-dropdown ul li .date-range-name{width:100%}}#edd-filters>p{color:#757575}#edd-filters input[type=number],#edd-filters input[type=text].edd_datepicker{max-width:105px}#edd-filters .button-secondary,#edd-filters input[type=number]{margin-bottom:0}#edd-filters .search-form{margin:0}@media screen and (max-width:480px){#edd-filters span{margin:2px 0}}#edd-advanced-filters{position:relative}#edd-advanced-filters .inside{z-index:99;position:absolute;top:29px;right:0;border:1px solid #e0e0e0;padding:0;background:#fff;box-shadow:0 3px 5px rgba(0,0,0,.2);min-width:285px;opacity:0;visibility:hidden}#edd-advanced-filters fieldset{display:block;padding:10px 15px 15px;margin:10px 0}#edd-advanced-filters fieldset:not(:last-of-type){border-bottom:1px solid #e0e0e0}#edd-advanced-filters fieldset:last-of-type{padding-bottom:5px}#edd-advanced-filters fieldset.edd-add-on-filters div,#edd-advanced-filters fieldset.edd-add-on-filters label,#edd-advanced-filters fieldset.edd-add-on-filters p,#edd-advanced-filters fieldset.edd-add-on-filters span{display:block;margin-bottom:2px}#edd-advanced-filters div.edd-select-chosen:not(:last-child){margin-bottom:10px}#edd-advanced-filters.open .edd-advanced-filters-button{background:#e0e0e0;border-color:#949494;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);transform:translateY(1px)}#edd-advanced-filters.open .inside{visibility:visible;opacity:1;transition:opacity .2s ease-in}.download_page_edd-reports #edd-filters{margin-bottom:-1px;box-shadow:none}@media screen and (max-width:782px){.download_page_edd-reports #edd-filters{gap:0}}.edd-old-log-filters{margin-top:-30px;margin-left:2px}@media screen and (min-width:600px){#edd-reports-charts-wrap{display:-ms-grid;display:grid;-ms-grid-columns:(minmax(200px,50%))[2];grid-template-columns:repeat(2,minmax(200px,50%));grid-gap:20px}.edd-reports-chart{margin-bottom:0}.edd-reports-chart-bar,.edd-reports-chart-line{-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/span 2}}.edd-reports-chart{height:500px;max-height:700px}.chart-timezone{font-size:.75rem;color:#ccc}.edd-mobile-link{line-height:32px}.edd-mobile-link a{text-decoration:none}.edd-mobile-link a:after,.edd-mobile-link a:before{display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/30px dashicons;vertical-align:top;margin:1px 0 0;padding:0}.edd-mobile-link a:before{content:"";color:#757575;margin-right:-3px}.edd-mobile-link a:after{content:""}#edd-reports-tiles-wrap #dashboard-widgets .sortable-placeholder{padding:0;margin:0 0 20px;line-height:0;box-sizing:border-box;height:110px}#edd-reports-tiles-wrap #dashboard-widgets #primary-sortables{margin-left:0}#edd-reports-tiles-wrap #dashboard-widgets #tertiary-sortables{margin-right:0}#edd-reports-tiles-wrap{display:-ms-grid;display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));grid-gap:20px}.edd-reports-tile{text-align:center;padding:20px 10px 35px;display:flex;flex-direction:column;justify-content:center;border:1px solid #e5e5e5;background:#fafafa;position:relative;box-sizing:border-box;gap:.5em}.edd-reports-tile>span:not(.tile-compare){width:100%}.edd-reports-tile .tile-label{text-align:center;text-transform:uppercase;font-size:12px;font-weight:400;color:#101517}.edd-reports-tile .tile-value{color:#333;font-size:2em;line-height:1;transition:all .2s ease-in-out;display:flex;justify-content:center;flex-direction:column;gap:.25em}.edd-reports-tile:hover{border:1px solid #aaa}.edd-reports-tile:hover .tile-value:not(.tile-no-data){transform:scale(1.05)}.edd-reports-tile .tile-amount{color:#2794da}.edd-reports-tile .tile-number{color:#96f}.edd-reports-tile .tile-amount,.edd-reports-tile .tile-number{color:#fff}.edd-reports-tile .tile-value.tile-no-data{color:#ddd}.edd-reports-tile .tile-value.tile-url{font-size:1.5em}.edd-reports-tile .tile-relative{font-size:12px;font-weight:400;color:#888}.edd-reports-tile span.dashicons{display:inline-block;font-size:30px;line-height:20px;height:20px;width:20px;position:relative;top:4px;left:-5px;margin-left:-5px;color:#999}.edd-reports-tile .tile-relative span.dashicons{top:-5px;left:-3px;margin-left:0}.edd-reports-tile .tile-relative span.dashicons-arrow-down,.edd-reports-tile .tile-relative span.dashicons-arrow-up.reverse{color:#d63638}.edd-reports-tile .tile-relative span.dashicons-arrow-down.reverse,.edd-reports-tile .tile-relative span.dashicons-arrow-up{color:#008a20}.edd-reports-tile .tile-compare{position:absolute;right:0;bottom:0;color:#aaa;font-size:11px;line-height:1em;background-color:#fff;border-color:#e5e5e5 #fff #fff #e5e5e5;border-style:solid;border-width:1px;border-top-left-radius:8px;padding:4px 0 0 9px;margin:0 -1px -1px 0}.edd-reports-tile:hover .tile-compare{border-left:1px solid #bbb;border-top:1px solid #bbb;color:#777}#edd-submit-refund-status{text-align:center;font-size:1.2em}#edd-submit-refund-status .edd-submit-refund-message:before{font-family:dashicons;font-size:1.5em;vertical-align:middle;color:#fff;border-radius:16px;margin:5px}#edd-submit-refund-status .edd-submit-refund-message.success:before{content:"";background-color:#008a20;padding-right:1px}#edd-submit-refund-status .edd-submit-refund-message.fail{display:block;margin-bottom:16px}#edd-submit-refund-status .edd-submit-refund-message.fail:before{content:"";background-color:#d63638}.refund-items td,.refund-items th.check-column{vertical-align:baseline}.refund-items .column-amount,.refund-items .column-discount,.refund-items .column-quantity,.refund-items .column-subtotal,.refund-items .column-tax,.refund-items .column-total{width:80px}.refund-items .edd-form-group__control{display:flex;align-items:center}.refund-items .edd-form-group__control input,.refund-items .edd-form-group__control select{background-color:transparent;border:0;border-bottom:1px solid;border-radius:0;box-shadow:none;text-align:right;width:100%}.refund-items .edd-form-group__control input:disabled,.refund-items .edd-form-group__control select:disabled{border-bottom:none}.refund-items .edd-form-group__control input:focus,.refund-items .edd-form-group__control select:focus{border-bottom:1px solid var(--wp-admin-theme-color-darker-10);box-shadow:0 1px 0 var(--wp-admin-theme-color-darker-10)}.refund-items .edd-form-group__control select[data-original="1"]{background:transparent}.refund-items .edd-form-group__control .is-before+span>input,.refund-items .edd-form-group__control select{text-align:left}.refund-items .edd-refund-submit-line-total{background-color:#fff!important}.refund-items .edd-refund-submit-line-total td{text-align:right}.refund-items .edd-refund-submit-line-total-amount{display:inline-block;margin-left:20px;text-align:left;width:80px}.refund-items #edd-refund-submit-subtotal td{border-top:2px solid #c3c4c7}@media screen and (max-width:782px){.refund-items td.column-total{margin-bottom:16px}.refund-items .edd-refund-submit-line-total-amount{padding-right:16px;width:unset}}.edd-submit-refund-actions{margin:16px 0 0}.did-refund .edd-submit-refund-actions,.did-refund .refund-items{display:none}.edd-admin-notice-top-of-page{font-size:15px;line-height:1.4;color:#fff;margin-left:-20px;padding:12px 32px 12px 20px;background:#2d6ca2}.edd-admin-notice-top-of-page.edd-pro-inactive{background:#d63638}@media screen and (min-width:783px){.edd-admin-notice-top-of-page{padding:10px 46px 10px 22px}}@media screen and (min-width:961px){.edd-admin-notice-top-of-page{text-align:center}}.edd-admin-notice-top-of-page a{color:#fff}.edd-admin-notice-top-of-page a:hover{text-decoration:none}.edd-admin-notice-top-of-page .button-link{position:absolute;top:48px;right:-1px;font-size:20px;color:#fff;font-weight:700;text-decoration:none;margin-left:5px;padding:6px 10px}.edd-admin-notice-top-of-page .button-link:active,.edd-admin-notice-top-of-page .button-link:focus,.edd-admin-notice-top-of-page .button-link:hover{color:#fff;text-decoration:none}@media screen and (min-width:601px){.edd-admin-notice-top-of-page .button-link{top:1px}}@media screen and (min-width:783px){.edd-admin-notice-top-of-page .button-link{right:9px}}#edd-admin-notice-five-star-review{display:-ms-grid;display:grid}#edd_dashboard_sales .edd-promo-notice{border-bottom:1px solid #c3c4c7}.edd-review-actions{display:flex;gap:6px;margin:0 0 16px}.edd-promo-notice .edd-peeking{align-self:flex-end;justify-self:flex-end;margin-right:16px;margin-bottom:-1px}@media screen and (max-width:782px){#edd-admin-notice-five-star-review.notice .edd-peeking{margin-bottom:-6px}}@media screen and (min-width:480px){.edd-promo-notice.notice-info .edd-peeking{justify-self:flex-start;margin-right:0;margin-left:250px}}.edd-promo-notice .edd-peeking,.edd-review-step{-ms-grid-row:1;grid-area:1/-1}.edd-promo-notice__overlay{display:none;position:fixed;background:rgba(16,21,23,.75);top:0;right:0;bottom:0;left:160px;z-index:11;justify-content:center;align-items:center}.folded .edd-promo-notice__overlay{left:36px}@media screen and (max-width:782px){.edd-promo-notice__overlay{left:0}}.edd-admin-notice-overlay{display:none;background-color:#fff;padding:2.5em;text-align:center;max-width:650px;position:relative;flex-direction:column}.edd-promo-notice__overlay .edd-admin-notice-overlay{display:flex}.edd-admin-notice-overlay h2{line-height:1.6em;margin:0 auto;max-width:540px}.edd-admin-notice-overlay .edd-promo-notice__features{text-align:left;display:-ms-grid;display:grid;-ms-grid-columns:(auto)[3];grid-template-columns:repeat(3,auto);margin:2em auto;gap:0 1.5em}.edd-admin-notice-overlay .edd-promo-notice__features li{display:flex;gap:.5em;align-items:center}@media screen and (max-width:600px){.edd-admin-notice-overlay .edd-promo-notice__features{-ms-grid-columns:unset;grid-template-columns:unset}}.edd-admin-notice-overlay .button-primary{padding:4px 36px;margin:0 auto .5em;max-width:360px}.edd-admin-notice-overlay__link{color:#101517}.edd-admin-notice-overlay .edd-promo-notice-dismiss.button-link{position:absolute;color:#537994;text-decoration:none;font-size:2em;top:0;right:.5em}.edd-admin-notice-overlay .edd-promo-notice-dismiss.button-link:active,.edd-admin-notice-overlay .edd-promo-notice-dismiss.button-link:hover{color:#101517}@media screen and (max-width:782px){.edd-admin-notice-overlay{margin:1em}}.edd-paypal-account-status ul{margin-left:25px}.edd-paypal-account-status>li{margin-bottom:1em}.edd-paypal-account-status ul:not(.edd-paypal-webhook-events) li{margin:.25em 0}.edd-paypal-account-status .dashicons-yes{color:#008a20}.edd-paypal-account-status .dashicons-no{color:#d63638}.edd-overlay{position:fixed;z-index:1052;top:0;right:0;bottom:0;left:160px;background-color:#141b38;opacity:.5;transition:.5s}.edd-slide-in{transform:translateX(100%)!important;-webkit-transform:translateX(100%)!important}#edd-notifications-panel{background-color:#fff;height:100%;width:100%;max-width:570px;position:fixed;z-index:1053;top:0;right:0;bottom:0;overflow-x:hidden;transition:.5s;transform:translateX(0);-webkit-transform:translateX(0)}body.admin-bar #edd-notifications-panel{top:32px}@media screen and (max-width:600px){body.admin-bar #edd-notifications-panel{top:46px}}#edd-notifications-header{display:flex;align-items:center;padding:0 30px;color:#fff;background-color:#0c5d95}#edd-notifications-header h3{color:#fff;flex:1}#edd-notifications-header .edd-close{background:none;border:none;color:#fff;cursor:pointer}#edd-notifications-body{padding:30px}.edd-notification{display:flex;gap:20px;margin-bottom:20px}.edd-notification--icon{color:#00aa63}.edd-notification--icon.edd-notification--icon-info{color:#005ae0}.edd-notification--icon.edd-notification--icon-warning{color:#f18200}.edd-notification--icon.edd-notification--icon-error{color:#df2a4a}.edd-notification--body{flex:1}.edd-notification--header{align-items:center;display:flex;justify-content:space-between;gap:5px;margin-bottom:7px}.edd-notification--title{color:#141b38;flex:1;font-size:16px;font-weight:600;margin:0}.edd-notification--date{color:#71747e;font-size:12px}.edd-notification--actions{flex-wrap:wrap;display:flex;align-items:center;gap:5px;margin-top:10px}.edd-notification--dismiss{background:none!important;border:none!important;box-shadow:none!important;color:#71747e!important;cursor:pointer;padding:0 10px;text-decoration:underline}.edd-notification--dismiss:hover{text-decoration:none}.edd-dialog{display:none}.edd-item-header-small{padding-bottom:20px;border-bottom:1px solid #e5e5e5;display:flex;justify-content:flex-start;align-items:center;gap:6px}.edd-item-header-small span{font-weight:600;font-size:15px}.edd-admin-order-status-badge,.edd-status-badge{padding:2px 7px;border-radius:4px;background:#ececec;display:inline-flex;align-items:center;gap:2px}.edd-admin-order-status-badge__icon,.edd-status-badge__icon{opacity:.8}.edd-admin-order-status-badge--error,.edd-admin-order-status-badge--expired,.edd-admin-order-status-badge--failed,.edd-admin-order-status-badge--failing,.edd-admin-order-status-badge--red,.edd-admin-order-status-badge--rejected,.edd-admin-order-status-badge--revoked,.edd-status-badge--error,.edd-status-badge--expired,.edd-status-badge--failed,.edd-status-badge--failing,.edd-status-badge--red,.edd-status-badge--rejected,.edd-status-badge--revoked{color:#ac3d3d;background:#ffd6d6}.edd-admin-order-status-badge--active,.edd-admin-order-status-badge--approved,.edd-admin-order-status-badge--complete,.edd-admin-order-status-badge--completed,.edd-admin-order-status-badge--edd_subscription,.edd-admin-order-status-badge--green,.edd-admin-order-status-badge--partially_refunded,.edd-admin-order-status-badge--success,.edd-status-badge--active,.edd-status-badge--approved,.edd-status-badge--complete,.edd-status-badge--completed,.edd-status-badge--edd_subscription,.edd-status-badge--green,.edd-status-badge--partially_refunded,.edd-status-badge--success{color:#017d5c;background:#e5f5f0}.edd-admin-order-status-badge--pending,.edd-admin-order-status-badge--warning,.edd-admin-order-status-badge--yellow,.edd-status-badge--pending,.edd-status-badge--warning,.edd-status-badge--yellow{color:#996800;background:#f5f2e5}.edd-admin-order-status-badge--blue,.edd-admin-order-status-badge--info,.edd-admin-order-status-badge--processing,.edd-admin-order-status-badge--trialling,.edd-status-badge--blue,.edd-status-badge--info,.edd-status-badge--processing,.edd-status-badge--trialling{color:#016087;background:#e5f1f5}.edd-pro-upgrade,.edd-pro-upgrade:hover{color:#1da867;font-weight:600;text-decoration:none}.wrap-licenses .edd-licenses__description{margin:2em 1em}.wrap-licenses .form-table,.wrap-licenses caption,.wrap-licenses tfoot,.wrap-licenses th,.wrap-licenses thead,.wrap-licenses tr{display:block}@media screen and (min-width:600px){.wrap-licenses .form-table,.wrap-licenses caption,.wrap-licenses tfoot,.wrap-licenses th,.wrap-licenses thead,.wrap-licenses tr{display:unset}}.wrap-licenses tbody{display:-ms-grid;display:grid;gap:1em}.wrap-licenses .form-table tr{margin:0;background:#fff;border:1px solid #dcdcde;border-radius:3px;padding:0;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between}@media screen and (min-width:600px){.wrap-licenses .form-table tr{display:-ms-grid;display:grid;-ms-grid-columns:200px 1fr;grid-template-columns:200px 1fr}}.wrap-licenses .form-table th{background:#f9f9f9;margin-bottom:2.5em;padding:1em;border-bottom:1px solid #dcdcde;width:unset}@media screen and (min-width:600px){.wrap-licenses .form-table th{border-bottom:none;margin-bottom:0;display:flex;align-items:center}}.wrap-licenses .form-table td{margin:0;padding:0;display:flex;flex-direction:column;gap:2.5em;flex-grow:1}@media screen and (min-width:600px){.wrap-licenses .form-table td{flex-direction:row;gap:unset}}.wrap-licenses .form-table td input.regular-text{margin:0;width:100%;max-width:250px}.wrap-licenses .form-table td button{margin:0}.wrap-licenses .form-table .edd-license__control{flex-grow:1;padding:0 1em;display:flex;gap:4px;align-items:center;justify-content:center}@media screen and (min-width:600px){.wrap-licenses .form-table .edd-license__control{justify-content:flex-end}}.wrap-licenses .form-table .edd-licensing__actions{display:flex;gap:4px}.wrap-licenses .edd-license-data[class*=edd-license-]{background:#f9f9f9;padding:1em;border-top:1px solid #dcdcde;margin:0;width:100%;box-sizing:border-box;display:flex;align-items:flex-end}.wrap-licenses .edd-license-data[class*=edd-license-] a{color:#444}.wrap-licenses .edd-license-data[class*=edd-license-] a:hover{text-decoration:none}@media screen and (min-width:600px){.wrap-licenses .edd-license-data[class*=edd-license-]{border-top:none;width:unset;flex-basis:100%;align-items:center}.wrap-licenses .edd-license-data[class*=edd-license-]:not(:only-child){flex:0 1 300px}}.wrap-licenses .edd-license-data.license-expires-soon-notice{background-color:#00a0d2;color:#fff;border-color:#00a0d2}.wrap-licenses .edd-license-data.edd-license-expired{background-color:#e24e4e;color:#fff;border-color:#e24e4e}.wrap-licenses .edd-license-data.edd-license-error,.wrap-licenses .edd-license-data.edd-license-invalid,.wrap-licenses .edd-license-data.edd-license-item_name_mismatch,.wrap-licenses .edd-license-data.edd-license-missing,.wrap-licenses .edd-license-data.edd-license-site_inactive{background-color:#ffebcd;border-color:#ffebcd}.wrap-licenses .edd-license-data p{font-size:13px;margin-top:0}.wrap-licenses .edd-license-data.edd-license-expired a,.wrap-licenses .edd-license-data.license-expires-soon-notice a{color:#fff}.wrap-licenses .edd-license-data.edd-license-expired a:hover,.wrap-licenses .edd-license-data.license-expires-soon-notice a:hover{text-decoration:none}.edd-settings-content{max-width:1440px}.edd-settings-color,.edd-settings-colors{display:flex;flex-wrap:wrap;gap:1em}.edd-settings-color{flex-direction:column}.edd-upload-button-wrapper{width:100%;display:flex;gap:5px}.edd-upload-button-wrapper button.edd_settings_upload_button{margin-bottom:0}#edd-payment-gateways a.button.edd-settings__button-settings{position:absolute;right:2em;min-height:unset;height:1.5em;width:1.5em;border:none;background-color:#f9f9f9}#edd-payment-gateways a.button.edd-settings__button-settings,#edd-payment-gateways a.button.edd-settings__button-settings:active,#edd-payment-gateways a.button.edd-settings__button-settings:hover{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS4yOSA2LjI5M2wtMS41MTUuODc1YTUuODczIDUuODczIDAgMDEwIDEuNjY0bDEuNTE1Ljg3NS0yLjE2NiAzLjc1My0xLjUxNi0uODc1YTUuODI3IDUuODI3IDAgMDEtMS40NDEuODMzdjEuNzQ5SDUuODM0di0xLjc1YTUuODI1IDUuODI1IDAgMDEtMS40NDEtLjgzMmwtMS41MTYuODc1TC43MSA5LjcwN2wxLjUxNi0uODc1YTUuODc4IDUuODc4IDAgMDEwLTEuNjY0TC43MSA2LjI5MyAyLjg3NyAyLjU0bDEuNTE2Ljg3NmE1LjgyNyA1LjgyNyAwIDAxMS40NC0uODMzVi44MzNoNC4zMzR2MS43NWE1LjgzIDUuODMgMCAwMTEuNDQuODMzbDEuNTE3LS44NzYgMi4xNjYgMy43NTN6TTggMTAuMzMzYTIuMzMzIDIuMzMzIDAgMTAwLTQuNjY2IDIuMzMzIDIuMzMzIDAgMDAwIDQuNjY2eiIgZmlsbD0iIzZCNzI4MCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTUuMjkgNi4yOTNsLTEuNTE1Ljg3NWE1Ljg3MyA1Ljg3MyAwIDAxMCAxLjY2NGwxLjUxNS44NzUtMi4xNjYgMy43NTMtMS41MTYtLjg3NWE1LjgyNyA1LjgyNyAwIDAxLTEuNDQxLjgzM3YxLjc0OUg1LjgzNHYtMS43NWE1LjgyNSA1LjgyNSAwIDAxLTEuNDQxLS44MzJsLTEuNTE2Ljg3NUwuNzEgOS43MDdsMS41MTYtLjg3NWE1Ljg3OCA1Ljg3OCAwIDAxMC0xLjY2NEwuNzEgNi4yOTMgMi44NzcgMi41NGwxLjUxNi44NzZhNS44MjcgNS44MjcgMCAwMTEuNDQtLjgzM1YuODMzaDQuMzM0djEuNzVhNS44MyA1LjgzIDAgMDExLjQ0LjgzM2wxLjUxNy0uODc2IDIuMTY2IDMuNzUzek04IDEwLjMzM2EyLjMzMyAyLjMzMyAwIDEwMC00LjY2NiAyLjMzMyAyLjMzMyAwIDAwMCA0LjY2NnoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iLjUiLz48L3N2Zz4=);background-size:1em;background-repeat:no-repeat;background-position:50%}.edd-plugin__active #edd-payment-gateways a.button.edd-settings__button-settings{display:block}.edd-settings__list--disc{list-style:disc;list-style-position:inside}.edd-hidden{display:none}.edd-clearfix:after{content:"";display:table;clear:both}.edd-notice .notice-dismiss,.edd-wrap a{text-decoration:none}.wp-core-ui .edd-delete,a.edd-delete{color:#a00}.wp-core-ui .edd-delete:hover,a.edd-delete:hover{color:red}body.post-type-download #contextual-help-link-wrap,body.post-type-download #screen-options-link-wrap{top:5px!important}body.post-type-download #screen-meta{margin:0 0 -1px -20px}#edd-header{border-top:5px solid #0c5d95;border-bottom:1px solid #c3c4c7;padding:20px 0;margin-left:-20px;background:#fff}#edd-header-wrapper{display:flex;justify-content:space-between;padding:0 20px;align-items:center}#edd-header img{display:block;max-width:300px;margin:0}.edd-header-page-title-wrap{font-size:1.75em;margin-top:-5px;margin-right:auto;padding-left:7px}.edd-header-separator{margin-top:-2px;opacity:.25}.edd-header-page-title{font-weight:400;font-size:1em;line-height:1.3em;display:inline}.edd-header-page-title-wrap .button{margin-left:5px}.no-js #edd-header-actions{display:none}#edd-header .edd-round{position:relative;background-color:#f3f4f5;border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;margin-left:10px;cursor:pointer;transition:background-color .2s ease}button.edd-round{border:none}#edd-header button.edd-round:hover{background-color:#e5e5e5}button.edd-round:active,button.edd-round:focus{outline:2px solid #0c5d95}#edd-header .edd-number{position:absolute;background-color:#df2a4a;width:16px;height:16px;font-weight:600;font-size:10px;color:#fff;top:-8px;left:50%;transform:translateX(-50%);margin:0;animation:bounce 2s 5}#edd-header .edd-number.edd-hidden{display:none!important}#edd-header .edd-round svg{width:20px;height:20px}@media screen and (max-width:840px){#edd-header img,.edd-header-separator{display:none}}.edd_datepicker{height:29px}.edd-from-to-wrapper input{width:105px;margin:0;position:relative;z-index:1}.edd-from-to-wrapper input[name*=start],.edd-from-to-wrapper input[name=filter_from]{border-top-right-radius:0;border-bottom-right-radius:0}.edd-from-to-wrapper input[name*=end],.edd-from-to-wrapper input[name=filter_to]{margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}.edd-from-to-wrapper input:focus{z-index:2;position:relative}.edd-settings-sub-nav{margin:0 0 10px;width:100%;border-bottom:1px solid #ccc;box-shadow:0 1px 1px rgba(0,0,0,.04)}.edd-settings-sub-nav a{padding:13px;display:block}.edd-settings-sub-nav a.current{border-bottom:4px solid #000;padding-bottom:9px}.admin-color-fresh .edd-settings-sub-nav a.current{border-bottom-color:#00a0d2}.admin-color-blue .edd-settings-sub-nav a.current{border-bottom-color:#096484}.admin-color-coffee .edd-settings-sub-nav a.current{border-bottom-color:#c7a589}.admin-color-ectoplasm .edd-settings-sub-nav a.current{border-bottom-color:#a3b745}.admin-color-midnight .edd-settings-sub-nav a.current{border-bottom-color:#e14d43}.admin-color-ocean .edd-settings-sub-nav a.current{border-bottom-color:#627c83}.admin-color-sunrise .edd-settings-sub-nav a.current{border-bottom-color:#be3631}.admin-color-light .edd-settings-sub-nav a.current{border-bottom-color:#888}.admin-color-evergreen .edd-settings-sub-nav a.current{border-bottom-color:#36533f}.admin-color-mint .edd-settings-sub-nav a.current{border-bottom-color:#4f6d59}.download_page_edd-settings .edd-check-wrapper{clear:both}.download_page_edd-settings .form-table tr>th>h3,.download_page_edd-settings .form-table tr>th>strong{font-size:1.2em;font-weight:600;margin:0 auto}.edd-sortable-list{margin:0;width:300px;position:relative}.edd-sortable-list li{margin:0;padding:0;position:relative;height:28px;cursor:move}.edd-sortable-list li label *{vertical-align:middle}.edd-sortable-list li label:after{display:block;width:17px;height:17px;position:absolute;right:6px;top:0;color:#aaa;font-family:dashicons;font-size:17px;content:"";cursor:move}.form-table .edd-sortable-list li label{display:block;height:28px;padding:0;margin:0}.edd-sortable-list .payment-icon{width:32px;height:24px;position:relative;top:-2px;margin-right:5px}.edd-help-tip{cursor:help;margin-top:-2px;font-size:24px;color:grey}.edd-ui-tooltip{position:absolute;background:#333!important;border-width:1px!important;border-radius:3px!important;box-shadow:1px 1px 2px 1px hsla(0,0%,83.9%,.5)!important;color:#dedede!important;max-width:300px!important;padding:7px!important;text-rendering:optimizeLegibility;text-shadow:none!important;z-index:9999!important}.download_page_edd-settings .edd-settings-payment-icon-wrapper{margin-top:5px}.download_page_edd-settings .edd-settings-payment-icon-wrapper input{margin-top:1px}.download_page_edd-settings .form-table .edd-settings-payment-icon-wrapper input[type=checkbox]+label{margin:0;display:inline-block}.download_page_edd-settings .edd-settings-payment-icon-wrapper .payment-icon-image{margin-right:5px;width:32px;display:inline-block;vertical-align:middle}.download_page_edd-settings .edd-settings-payment-icon-wrapper .payment-option-name{vertical-align:middle}.download_page_edd-settings .taxrates td,.download_page_edd-settings .taxrates th{padding:8px 10px}.download_page_edd-settings .taxrates td{line-height:1.5em;vertical-align:top;margin:0}.download_page_edd-settings .taxrates .regular-text{width:100%}#TB_window{overflow:hidden}#TB_title{padding:5px}#TB_ajaxContent{width:calc(100% - 30px)!important;padding:15px;margin:0;height:calc(100% - 118px)!important}#TB_ajaxWindowTitle{font-size:18px;font-weight:600;line-height:30px}#TB_closeWindowButton{right:6px;top:6px}#choose-download-wrapper{width:100%}#choose-download-wrapper .wrap{overflow-y:scroll;margin:0;padding:0;height:calc(100% - 50px)}#choose-download-wrapper .submit-wrapper{position:absolute;width:100%;bottom:0;padding:0;margin:0 0 0 -15px;text-align:right}#choose-download-wrapper .submit-wrapper div{background-color:#fafafa;padding:15px;border-top:1px solid #ddd}.wp-media-buttons .button.edd-thickbox{padding-left:0}.wp-media-buttons .button.edd-email-tags-inserter .dashicons{margin-top:-2px}.download_page_edd-payment-history .edit-post-editor-regions__header{flex-shrink:0;height:auto;border-bottom:1px solid #e2e4e7;z-index:30;position:sticky;top:32px;margin-left:-20px}@media screen and (max-width:782px){.download_page_edd-payment-history .edit-post-editor-regions__header{position:static;top:46px}}.download_page_edd-payment-history .edit-post-header{height:56px;background:#fff;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;max-width:100%;box-sizing:border-box;padding:4px 20px}@media screen and (max-width:782px){.download_page_edd-payment-history .edit-post-header{padding-left:10px;padding-right:10px}}@media(min-width:280px){.download_page_edd-payment-history .edit-post-header{flex-wrap:nowrap}}.download_page_edd-payment-history .edit-post-header .edit-post-header__toolbar{order:0}.download_page_edd-payment-history .edit-post-header .edit-post-header__settings{order:1}.download_page_edd-payment-history .edit-post-header #publishing-action,.download_page_edd-payment-history .edit-post-header .edit-post-header__settings,.download_page_edd-payment-history .edit-post-header .edit-post-header__toolbar{display:flex;align-items:center}.download_page_edd-payment-history .edit-post-header #publishing-action .spinner{margin:0 5px 0 0}.download_page_edd-payment-history .edit-post-header .button-primary{margin:2px;height:34px;line-height:32px;font-size:13px}#edd-order-items .hndle{display:flex;align-items:center;justify-content:space-between}#edd-order-items .hndle .edd-toggle{font-weight:400}.edd-add-order-item td{vertical-align:middle}.edd-add-order-item input{width:80%}.edd-add-order-item input[readonly]{color:#555;background:none;border:1px solid transparent;box-shadow:none}.order-customer-info .customer-details-wrap{margin:15px 0;align-items:center}.order-customer-info .customer-details-wrap .spinner{margin:0}.order-customer-info .customer-details{display:flex;flex-direction:column}.order-customer-info .customer-details .customer-since{color:#666;display:block;margin:4px 0 6px}.order-customer-info .customer-details>span{margin-bottom:5px}.edd-order-add-download-select .spinner{display:none}table.edd-order-overview-summary{border-width:0;table-layout:fixed}table.edd-order-overview-summary--refund{border-width:0}@media screen and (min-width:782px){.edd-order-overview .column-right{text-align:right}}.edd-ml-auto{margin-left:auto!important}@media screen and (min-width:782px){.edd-ml-lg-auto{margin-left:auto!important}}.edd-ml-auto+.edd-ml-auto{margin-left:10px!important}.edd-order-overview-summary__items-name{align-self:flex-start}.edd-order-overview-summary__items>:nth-child(odd){background-color:#f9f9f9}@media screen and (min-width:782px){.edd-order-overview-summary__items tr:last-child td,.edd-order-overview-summary__items tr:last-child th{border-bottom:1px solid #e5e5e5}}@media screen and (max-width:782px){.edd-order-overview-summary .row-actions>*,.edd-order-overview-summary__items-name .row-actions{display:block!important}.edd-order-overview-summary .row-actions>:not(:first-child):before{display:none}}.edd-order-overview-summary th:not(.column-primary){width:100px}.edd-order-overview-summary .row-actions>:not(:first-child):before{color:#999;content:" | "}.edd-order-overview-summary .row-actions .text{color:#555}.edd-order-overview-summary .removable{display:flex;align-items:center;position:relative}.edd-order-overview-summary .removable .delete{display:inline-block;margin-right:10px;margin-left:-8px;padding:10px;border-right:1px solid #e5e5e5;color:#a00}.edd-order-overview-summary .removable .delete:hover{color:#dc3232}.edd-order-overview-summary__adjustments .column-primary{font-weight:600}.edd-order-overview-summary__adjustments td small{font-weight:400}.edd-order-overview-summary__subtotal .column-primary,.edd-order-overview-summary__tax tr:first-of-type .column-primary,.edd-order-overview-summary__total .column-primary{font-weight:600}.edd-order-overview-summary__adjustments td,.edd-order-overview-summary__subtotal td,.edd-order-overview-summary__tax td,.edd-order-overview-summary__total td{vertical-align:middle}.edd-order-overview-summary__tax td small,.edd-order-overview-summary__total td small{font-weight:400}.edd-order-overview-summary__total .total{color:#017d5c;display:inline-block}.edd-order-overview-summary__total .total.is-negative{color:#a00}@media screen and (min-width:783px){.edd-order-overview-summary__adjustments .removable .delete{margin-left:-50px}.edd-order-overview-summary__total .total{font-size:150%;padding-top:5px;padding-bottom:5px}}.edd-order-overview-summary__total tr:last-child td:not(:first-of-type),.edd-order-overview-summary__total tr:last-child th{border-top:1px solid #e5e5e5}.edd-order-overview-summary__total .notice{margin:-1px}.edd-order-overview-summary__total .notice p{font-weight:400;margin:.5em 0}.edd-order-overview-summary__refunds .column-primary{font-weight:600}.edd-order-overview-summary__refunds td small{font-weight:400}.edd-order-overview-summary__refunds tr:first-child td{border-top:1px solid #e5e5e5}#edd-order-overview-actions.inside{border-top:1px solid #ccd0d4;margin-top:0;display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between}#edd-order-overview-actions.inside:empty{padding:0;border-top:0}#edd-order-overview-actions.inside>div{display:flex;align-items:center}#edd-order-overview-actions .edd-order-overview-actions__notice{flex-basis:100%;margin-top:15px}.edd-order-overview-actions .button{width:100%;margin-bottom:12px}.edd-order-overview-actions .button:last-of-type{margin-bottom:0}@media screen and (min-width:782px){.edd-order-overview-actions .button{width:auto;margin-left:12px;margin-bottom:0}.edd-order-overview-actions .button:first-of-type{margin-left:auto}}.edd-order-overview-actions__locked{font-style:italic;opacity:.8}@media screen and (max-width:782px){.edd-order-overview-actions__locked{margin-bottom:12px}}.edd-order-overview-actions__refund .dashicons{margin-right:8px}.edd-dialog .ui-button-icon-only{font-size:0}.download_page_edd-payment-history .ui-dialog,.download_page_edd-payment-history .ui-dialog-content{overflow:visible}.edd-order-overview-modal form>p{margin-top:0}.edd-order-overview-modal fieldset legend,.edd-order-overview-modal form label{display:block;margin-bottom:4px}.edd-order-overview-modal fieldset{margin-bottom:calc(1em - 3px)}.edd-order-overview-modal fieldset>p{margin:2px 0 3px}.edd-order-overview-modal form .submit{margin:0 -16px -16px;padding:16px;background:#fcfcfc;border-top:1px solid #dfdfdf;display:flex;align-items:center}.edd-order-overview-modal form .submit .spinner{margin:0}.edd-order-overview-add-item [for=auto-calculate]{display:flex;align-items:center}.edd-order-overview-add-item [for=auto-calculate] input[type=checkbox]{margin-top:0}.edd-order-overview-add-item [for=auto-calculate] .label{line-height:1.15;margin-left:8px}.edd-order-overview-add-item [for=auto-calculate] .label small{margin-top:4px;display:block;opacity:.75}.edd-order-overview-add-adjustment .notice,.edd-order-overview-add-item .notice{margin:0 0 1rem}.edd-order-overview-add-adjustment #description,.edd-order-overview-add-discount select{width:100%}.edd-order-overview-error{font-style:italic;color:#a00;display:block;margin:4px 0}.edd-order-copy-download-link textarea{width:100%}.edd-order-resend-email-chooser legend{font-weight:700;margin-bottom:4px}.edd-order-resend-email-chooser p{margin:4px 0}.edd-notes .edd-note{padding:10px;background-color:#ffe;border:1px solid #cc0;width:100%;position:relative;margin-bottom:10px;box-sizing:border-box;overflow:hidden}.edd-notes .edd-note.deleting{opacity:.5}.edd-notes .edd-note__header{display:flex;align-items:center}.edd-add-note .spinner{float:none;display:inline-block;margin:0}.edd-notes .edd-note time{font-size:11px;color:#aaa}.edd-notes .edd-note .edd-note-author{margin-right:5px}.edd-notes .edd-note .edd-delete-note{color:#a00;font-weight:700;text-decoration:none;margin-left:auto}.edd-notes .edd-note .edd-delete-note:hover{color:#888}.edd-notes .edd-note p:last-child{margin-bottom:0}.edd-notes .edd-no-notes{margin:4px 0 10px}textarea[name=edd-note]{width:100%;min-height:70px;margin-top:0}.edd-notes-wrapper{width:80%}.edd-note-pagination{float:right;margin:-35px 5px 15px}.edd-note-pagination a,.edd-note-pagination span.page-numbers{padding:5px 8px;margin:2px;text-decoration:none}.edd-note-pagination a{border:1px solid #e5e5e5;background:#fcfcfc}.edd-note-pagination a:last-child,.edd-note-pagination span.page-numbers:last-child{margin-right:0}#edd-products{height:100px;min-width:200px}#edd-add-discount input[type=text],#edd-edit-discount input[type=text]{width:300px}#edd-add-discount .edd-discount-datetime input,#edd-edit-discount .edd-discount-datetime input{vertical-align:middle}#edd-add-discount input[type=text].edd_datepicker,#edd-edit-discount input[type=text].edd_datepicker{display:inline-block;width:183px}#edd-edit-discount textarea{height:100px}.edd-amount-type-wrapper{position:relative;display:flex}.edd-amount-type-wrapper select{border-top-left-radius:0;border-bottom-left-radius:0;width:auto!important}.edd-amount-type-wrapper #edd-amount{border-top-right-radius:0;border-bottom-right-radius:0;margin-right:-2px;padding:0 8px;width:unset;max-width:125px}.edd-amount-type-wrapper input:focus{z-index:2}.post-type-download .tablenav.top .edd-select{margin-right:6px}.wp-list-table.addresses .column-primary strong,.wp-list-table.customers .column-primary strong,.wp-list-table.discounts .column-primary strong,.wp-list-table.emails .column-primary strong,.wp-list-table.orderadjustments .column-primary strong,.wp-list-table.orderitems .column-primary strong,.wp-list-table.orders .column-primary strong{font-size:14px}.wp-list-table.customers .column-primary .avatar,.wp-list-table.emails .column-customer .avatar{float:left;margin-right:10px;margin-top:1px;border-radius:5px}.wp-list-table.orders div.order-list-email{font-size:.85em;color:#888}.wp-list-table.orders th.column-amount{width:100px}.wp-list-table .row-actions span.activate a{color:green}.wp-list-table .row-actions span.refund a{color:#836fff}.wp-list-table .row-actions span.cancel a{color:#cc8c00}.wp-list-table .row-actions span.cancel a:hover,.wp-list-table .row-actions span.refund a:hover{opacity:.8}.wp-list-table .type-download .row-actions{color:#999}.no-js.edit-tags-php.post-type-download .wp-heading-inline{position:absolute;top:0}.no-js.edit-tags-php.post-type-download .nav-tab-wrapper{margin-top:50px}.download_page_edd-customers .wrap .nav-tab-wrapper .page-title-action,.download_page_edd-discounts .wrap .nav-tab-wrapper .page-title-action,.download_page_edd-payment-history .wrap .nav-tab-wrapper .page-title-action,.edit-tags-php.post-type-download .wrap .nav-tab-wrapper .page-title-action{top:3px;margin-left:10px;line-height:24px}#edd-payments-filter ul.subsubsub{margin-bottom:8px}tr.status-refunded td{background:#cecece;border-top-color:#ccc}marquee{padding:0;margin:0}@media handheld,only screen and (max-width:640px){.wp-list-table.downloads th{width:auto!important}}#edd-download-link-textarea{width:100%}.edd_files_name_label{width:225px;float:left}.edd_files_url_label{width:220px;float:left}#postbox-container-1 .edd_files_name_label,#postbox-container-1 .edd_files_url_label{width:80px}#edd_product_files .inside,#edd_product_prices .inside{margin-bottom:0}textarea#edd-payment-note{width:100%;height:4em;margin:0}#edd-order-items .row .edd-purchased-files-list-wrapper .download{line-height:1.4}#edd-order-items .edd-purchased-files-list-wrapper .edd-purchased-option{color:#666}input[class*=edd-price-field]{max-width:125px}#edd-order-download-quantity[type=number].small-text,#edd-order-download-tax[type=text].small-text,[class*=item_] [class*=edd-payment-details-download-][type=number].small-text{height:25px}#edd-order-download-quantity[type=number].small-text,.item_price .edd-payment-details-download-quantity[type=number].small-text{width:55px}#edd-order-download-tax[type=text].small-text,.item_tax .edd-payment-details-download-item-tax[type=number].small-text{width:80%;max-width:125px}#edd_product_notes_field{display:block;margin:12px 0 0;height:4em;width:100%}.edd-metabox-title-action{margin:0;float:right;padding:4px 8px;position:relative;top:-1px;text-decoration:none;border:1px solid #ccc;border-radius:2px;background:#f7f7f7;text-shadow:none;font-weight:600;font-size:10px;line-height:normal;color:#0073aa;cursor:pointer;outline:0}.edd-metabox-title-action:hover{border-color:#008ec2;background:#00a0d2;color:#fff}.edd-edit-purchase-element .tablenav{padding:2px 10px 8px}.edd-edit-purchase-element .edd-order-children-wrapper{margin:0 -1px}.edd-edit-purchase-element .edd-order-children-wrapper.child-count-0 table{border-top:none;border-bottom:none}.edd-edit-purchase-element .edd-order-children-wrapper.child-count-0 .tablenav{display:none}.edd-edit-purchase-element[class*=columns-] ul li{padding-right:1%}#edd-edit-order-form .column:nth-child(odd),#edd-edit-order-form .columns-4 .column:nth-child(odd),#edd-edit-order-form .columns-5 .column:nth-child(3n+1){margin-right:0}#edd-edit-order-form input.large-text{width:90%}.edd-edit-purchase-element ul li.item_price{width:15%}.edd-edit-purchase-element ul li.item_price.item_quantity{width:25%}.edd-edit-purchase-element ul li.item_tax{width:15%}.edd-edit-purchase-element ul li.price{width:20%}.edd-admin-box-inside{border-bottom:1px solid #f1f1f1;clear:both;padding:12px;margin:0;word-wrap:break-word}.edd-admin-box-inside--row{display:flex;flex-wrap:wrap;word-break:break-all;justify-content:space-between;align-items:center}.edd-admin-box-inside>p{margin:8px 3px}.edd-admin-box-inside .strong{font-weight:600}.edd-admin-box div:not(.edd-admin-box-inside--row) .label{display:block;margin-bottom:4px;margin-right:0}.edd-admin-box .label--has-tip{display:flex;align-items:center}.edd-admin-box .label--has-tip .edd-help-tip{margin-top:0;font-size:20px}.edd-admin-box div:not(.edd-admin-box-inside--row) .label--has-checkbox{margin-bottom:0}.edd-payment-fees .fee-label{color:#666;font-weight:400}.edd-admin-box .right{float:right}#edd-order-refunds-list{padding-left:25px}#poststuff .edd-order-data .inside{margin:0;padding:0}.edd-order-data .edd-select-chosen{width:130px!important}.edd-order-data input.edd_datepicker{width:180px}.edd-order-data input[type=number].edd-payment-time-hour,.edd-order-data input[type=number].edd-payment-time-min{width:50px}.edd-order-data .edd-tax-rate{color:#9c9c9c;font-style:italic;padding:5px}#edd_general_logs p{margin:0;padding:0}.edd-admin-box-inside span.label{margin-right:10px}#edd-order-resend-receipt .inside{margin-top:11px}.edd-order-resend-receipt-header{font-size:14px;line-height:1.4}.edd-admin-box-inside:last-child{border-bottom:0}#edd-edit-order-form .data-payment-key{word-break:break-all}.edd-order-update-box #major-publishing-actions .button-secondary{margin-right:10px}.edd-order-update-box .button-primary{margin-right:0}.edd-edit-purchase-element .edd-select-chosen{width:196px}.edd-edit-purchase-element ul{clear:both;display:block}#edd-customer-details .actions{float:right}.order-data-address h3{margin:0 0 10px}.order-data-address #edd-order-address-country-wrap,.order-data-address #edd-order-address-state-wrap{display:inline-block;width:50%;max-width:300px}.edd-order-data input.small-text{margin:0}.edd-order-data input.med-text{margin:0;width:100px}.edd-edit-purchase-element ul li{display:block;line-height:1.4;position:relative;margin:0;vertical-align:middle;font-size:13px}.edd-edit-purchase-element .row{padding:12px}.edd-edit-purchase-element .row:not(:last-child){border-bottom:1px solid #eee}.edd-edit-purchase-element .row:nth-child(odd):not(.header){background-color:#f9f9f9}.edd-edit-purchase-element .row.header{padding:6px 12px;font-weight:600;vertical-align:top}.edd-edit-purchase-element ul{margin:0 0 15px}.edd-edit-purchase-element ul:last-of-type{margin-bottom:0}#edd-order-data .data span{color:#666;font-weight:600}.edd-edit-purchase-element .inside{padding:12px}.edd-edit-purchase-element .edd-purchased-download-title{font-size:14px;font-weight:500}.edd-edit-purchase-element .edd-purchased-download-title .deleted{color:#777}.edd-edit-purchase-element .edd-purchased-download-actions{color:#777;line-height:1.4}.edd-edit-purchase-element .edd-purchased-download-actions .edd-purchased-download-actions-label{font-weight:500}.edd-edit-purchase-element .edd-purchased-download-actions a{color:#777;font-size:12px}.edd-edit-purchase-element .edd-purchased-download-actions a:hover{color:#444}.edd-edit-purchase-element .edd-purchased-download-actions .edd-order-remove-download{color:#a00}.edd-edit-purchase-element .edd-purchased-download-actions .edd-order-remove-download:hover{color:red}.edd-add-adjustment-to-purchase,.edd-add-download-to-purchase{padding:15px;border-top:1px solid #e5e5e5;background-color:#f5f5f5}.edd-add-adjustment-to-purchase .chosen-container,.edd-add-download-to-purchase .chosen-container{width:90%!important;max-width:220px!important}.edd-add-adjustment-to-purchase .spinner,.edd-add-download-to-purchase .spinner{margin:0;float:none}.edd-add-download-to-purchase .edd-add-order-quantity{width:40px;height:29px;vertical-align:middle}.edd-add-adjustment-to-purchase .edd-add-adjustment-button,.edd-add-adjustment-to-purchase input[type=text],.edd-add-download-to-purchase .edd-add-order-item-button{height:29px}@media screen and (max-width:1284px){.edd-edit-purchase-element .edd-purchased-download-title{font-size:16px}.edd-edit-purchase-element ul li.item_price{width:22%}.edd-edit-purchase-element ul li.item_price.item_quantity{width:35%}.edd-edit-purchase-element ul li.item_tax{width:25%}.edd-edit-purchase-element ul li.price{width:20%}.edd-edit-purchase-element .edd-purchased-download-actions{padding-top:10px}}@media screen and (max-width:1024px){.edd-edit-purchase-element ul li.item_price.item_quantity{width:40%}.edd-edit-purchase-element ul li.price{width:24%}.edd-edit-purchase-element .edd-purchased-download-actions{padding-top:15px}.edd-edit-purchase-element .edd-purchased-download-actions,.edd-edit-purchase-element .edd-purchased-download-actions a{font-size:14px}}@media screen and (max-width:782px){.edd-edit-purchase-element ul li.item_price,.edd-edit-purchase-element ul li.item_price.item_quantity{padding-bottom:10px}.edd-edit-purchase-element ul li.item_price.item_quantity{width:35%}.edd-edit-purchase-element ul li.item_tax,.edd-edit-purchase-element ul li.price{width:20%;padding-bottom:10px}.edd-payment-details-download-amount,.edd-price-currency{font-size:16px}.order-data-column input[type=email]{padding:6px 10px}.edd-refund-submit-line-total td:last-of-type{flex:0 0 120px}#edd-item-tables-wrapper .addresses tbody tr{display:-ms-grid;display:grid}#edd-item-tables-wrapper .addresses tbody td:not(.no-items){padding-left:35%}}@media screen and (max-width:600px){.edd-edit-purchase-element ul li.item_price,.edd-edit-purchase-element ul li.item_price.item_quantity,.edd-edit-purchase-element ul li.item_tax{width:100%;padding-bottom:20px}.edd-edit-purchase-element .edd-add-download-to-purchase ul li.item_tax,.edd-edit-purchase-element ul li.price{width:100%;padding-bottom:0}.edd-edit-purchase-element .edd-add-download-to-purchase-actions{padding-top:15px}}#edd_product_stats .label{display:inline-block}#edd_product_stats .product-earnings-stats:before,#edd_product_stats .product-sales-stats:before{color:#82878c;font:normal 20px/1 dashicons;display:inline-block;padding:0 2px 0 0;position:relative;top:0;left:-1px;speak:none;text-decoration:none!important;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#edd_product_stats .product-sales-stats:before{content:""}#edd_product_stats .product-earnings-stats:before{content:""}body.dashboard_page_edd-upgrades.js .postbox .hndle{cursor:default}.edd_dashboard_widget table thead td{border-bottom:1px solid #ececec;color:#777}.edd_dashboard_widget .table_left{float:left;width:45%}.edd_dashboard_widget .table_right{float:right;width:45%}.edd_dashboard_widget .inside{font-size:12px}.edd_dashboard_widget td{padding:3px 0}.edd_dashboard_widget .b,.edd_dashboard_widget .t{line-height:1.5;vertical-align:middle}.edd_dashboard_widget .b{padding-right:6px;width:auto}.edd_dashboard_widget .t{font-size:12px;padding-right:12px;color:#777;width:100%}.edd_dashboard_widget .label_heading{border-top:1px solid #ececec;color:#8f8f8f;font-family:Helvetica,Arial,sans-serif;font-size:12px;font-weight:400;display:block;padding-top:10px;margin:0 0 8px 12px}.edd_dashboard_widget .edd_dashboard_widget_subheading{border-top:1px solid #ececec;color:#8f8f8f;font-size:14px;padding-top:10px;margin:1em 0 0}.edd_dashboard_widget .edd_dashboard_widget_subheading+.table{margin:8px 0 0}.edd_dashboard_widget .edd_price_label{background:#00769c;border-radius:3px;color:#fff;font-size:10px;padding:2px 4px;margin-right:2px}.edd_dashboard_widget table{width:100%;margin-left:0;margin-bottom:1em}td.edd_order_label{width:80%}td.edd_order_price{text-align:right}@media handheld,only screen and (max-width:1000px){.edd_dashboard_widget .edd-recent-email{display:none}}body.download_page_edd-reports{overflow-y:scroll}.edd-chip{font-size:10px;font-weight:700;text-transform:uppercase;line-height:1;padding:3px;border-radius:3px;color:#fff;background-color:#444}.edd-reports-wrapper .postbox h2,.edd-reports-wrapper .postbox h3{font-size:1.3em}#edd-dashboard-widgets-wrap .metabox-holder{padding-top:0}.edd-reports-wrapper .postbox .edd-select{max-width:200px;vertical-align:baseline;margin-right:4px;margin-bottom:16px}.download_page_edd-reports #edd-item-wrapper{margin:0}#edd-dashboard-widgets-wrap .postbox h2,#edd-dashboard-widgets-wrap .postbox h3{cursor:default}.edd-date-range-options .edd_datepicker{width:105px}.edd-report-wrap{clear:both}.edd-report-wrap h3{clear:both;margin:0 0 20px}.edd-reports-chart,.edd-reports-table{margin-bottom:20px}.edd-admin--has-grid{display:grid;display:-ms-grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));grid-gap:20px}.edd-admin--has-grid .postbox{margin-bottom:0}.edd-admin--has-grid .edd-from-to-wrapper{display:flex;margin-bottom:16px;width:100%}.edd-admin--has-grid .edd-from-to-wrapper input{width:100%}.edd-admin--has-grid .edd-from-to-wrapper span{flex-grow:1}.edd-admin--has-grid form{display:flex;flex-direction:column;flex-wrap:wrap;position:relative}fieldset.edd-to-and-from-container{display:flex;gap:8px}fieldset.edd-to-and-from-container select{flex:0 0 calc(50% - 6px)}span.edd-to-and-from--separator{line-height:normal;-ms-grid-row-align:center;align-self:center;margin-bottom:16px}.edd-admin--has-grid .postbox .edd-select{max-width:100%;margin-right:0}.edd-admin--has-grid .button.updated-message:before,.edd-admin--has-grid .button.updating-message:before{vertical-align:text-bottom;margin:0 5px 0 0}.edd-import-export-form .edd-progress{background:#ddd;border-radius:15px;height:15px;flex-basis:100%}.edd-import-export-form .edd-progress div{background:#ccc;border-radius:15px;height:100%;width:0}.edd-import-export-form .notice-wrap{background-color:#f4f4f4;border-color:#eae9e9;border-style:solid;border-width:1px 0;padding:12px;overflow:auto;margin:20px -12px -23px;position:relative;width:100%;display:flex;justify-content:space-between;align-items:center}.notice-wrap div.notice{margin:0}.admin-color-fresh .edd-import-export-form .edd-progress div{background:#0073aa}.admin-color-light .edd-import-export-form .edd-progress div{background:#888}.admin-color-blue .edd-import-export-form .edd-progress div{background:#096484}.admin-color-coffee .edd-import-export-form .edd-progress div{background:#c7a589}.admin-color-ectoplasm .edd-import-export-form .edd-progress div{background:#a3b745}.admin-color-midnight .edd-import-export-form .edd-progress div{background:#e14d43}.admin-color-sunrise .edd-import-export-form .edd-progress div{background:#dd823b}.graph-option-section{float:left}.edd-report-filters-title span{display:block;padding:20px}#edd-graphs-filter form{padding:20px}#edd-graphs-filter label{vertical-align:inherit}#edd-graphs-filter .graph-option-section{display:inline-block;line-height:2em;margin:0 5px 0 0;padding:0}.download_page_edd-reports .section-content #post-body-content{float:none}.download_page_edd-reports .section-content select[name=range]{display:none}.edd-mix-totals{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);padding:10px}.edd-mix-chart{display:inline-block;width:49%;vertical-align:top}.edd-graph-notes{color:#9c9c9c}.edd-graph-notes span{display:block}.edd-pie-graph .legend{display:none}.edd-pie-legend{overflow:auto;margin-top:10px}.edd-legend-item-wrapper{color:#333;display:inline-block;font-size:8pt;padding:2px 5px 0;width:48%;height:20px}.edd-legend-color{border:1px solid #cfcfcf;display:inline-block;margin-right:5px;width:20px;height:15px}.edd-pie-legend-item{display:inline-block;vertical-align:top;width:80%}#edd-reports-tiles-wrap .metabox-holder{padding:0}#edd-reports-tiles-wrap #dashboard-widgets{overflow:auto}#edd-reports-tiles-wrap #dashboard-widgets .postbox-container{width:33.3%}.download_page_edd-reports .section-content .tablenav.top{display:none}#edd_tax_rates{margin:1em 0 0}[id*=edd-recapture-].button{font-size:16px;height:auto;padding:8px 14px;margin:6px 0 0}[id*=edd-recapture-].button .dashicons{line-height:29px;margin-right:8px}[id*=edd-recapture-].button .edd-loading,[id*=edd-recapture-].button .edd-loading:after{border-radius:50%;display:inline-block;width:14px;height:14px}[id*=edd-recapture-].button .edd-loading{position:relative;top:3px;margin-left:4px;box-shadow:0 0 2px rgba(0,0,0,.2);animation:edd-spinning 1.1s linear infinite;border:2px solid hsla(0,0%,100%,.5);border-left-color:#fff;font-size:14px;filter:alpha(opacity=0);transform:translateZ(0)}#edd-recapture-disconnect.button .edd-loading.dark{border-color:rgba(0,0,0,.2) rgba(0,0,0,.2) rgba(0,0,0,.2) #666;box-shadow:none}.recapture-notice{position:relative}@keyframes edd-spinning{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}#edd-chartjs-tooltip{position:absolute;background-color:#fff;border-radius:7px;transition:all .1s ease;pointer-events:none;transform:translate(-50%);font-size:12px;box-shadow:0 0 0 1px rgba(89,94,100,.1),0 15px 35px 0 rgba(89,94,100,.1),0 5px 15px 0 rgba(0,0,0,.12);min-width:120px;opacity:0}.edd-chartjs-tooltip-key{display:inline-block;width:10px;height:10px;margin-right:5px}#edd-send-test-summary-save-changes-notice .notice p{font-size:13px}#edd-send-test-summary-notice,#edd-send-test-summary-save-changes-notice{display:flex;margin-top:5px}.edd-graph .y1Axis{color:#edc240!important}.edd-graph .y2Axis{color:#afd8f8!important}.wp-list-table.apikeys input.code{width:100%;font-size:10px;cursor:text;background:#fff;border:1px solid #ddd;box-shadow:none;color:#555}.edd-toggle{position:relative;display:inline-block;overflow:visible}.edd-toggle input[type=checkbox]{display:inline-block;vertical-align:middle;position:relative;margin:0;padding:0;width:42px;min-width:42px;height:24px;background-color:#ccc;transition:background .2s ease;border-radius:34px;box-shadow:none;border:none}.edd-toggle .label{display:inline-block;vertical-align:middle;white-space:nowrap}.edd-toggle input[type=checkbox]:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;transition:transform .1s ease;border-radius:50%}@media only screen and (max-width:782px){.edd-toggle input[type=checkbox]:checked:before{margin:-.1875rem 0 0 -.25rem}}.edd-toggle input[type=checkbox]:checked{background-color:#007cba;background-color:var(--wp-admin-theme-color)}.edd-toggle input[type=checkbox]:active,.edd-toggle input[type=checkbox]:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px #7e8993}.edd-toggle input[type=checkbox]:checked:active,.edd-toggle input[type=checkbox]:checked:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px #007cba;box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color)}.edd-toggle input[type=checkbox]:checked:before{transform:translateX(22px)}.edd-toggle .label+input,.edd-toggle input+.label{margin-left:5px}.download_page_edd-tools .tablenav .actions{overflow:visible}.edd_user_search_wrap{position:relative;overflow:visible}.edd_user_search_wrap .spinner{position:absolute;margin:0;padding:0;right:4px;top:-2px}.edd_user_search_wrap.loading .spinner{visibility:visible}.edd_user_search_results{position:absolute;left:0;top:20px}.edd_user_search_results a.edd-ajax-user-cancel{position:absolute;right:6px;top:2px}.edd_user_search_results ul{background:#fafafa;border:1px solid #dfdfdf;overflow-y:scroll;padding:0;margin:0;height:150px;width:185px;box-shadow:0 3px 5px rgba(0,0,0,.1)}.edd_user_search_results li{margin:0}.edd_user_search_results li a{display:block;text-decoration:none;padding:6px 10px}.edd_user_search_results li a:hover{background:#f5f5f5}.edd_user_search_results li.no-users{text-align:center;vertical-align:middle;display:block;line-height:150px;color:#bbb;text-transform:uppercase;font-size:11px}@media screen and (max-width:1100px){.edd-mix-chart{display:block;width:100%}}@media screen and (max-width:782px){.license-expiration-date-notice,.license-lifetime-notice,.license-null{padding-left:0}}@media screen and (max-width:600px){#edd-edit-order-form input.large-text{width:100%}}#edd-item-wrapper{background:#fff;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);position:relative;margin-top:15px;display:flex}#edd-item-wrapper.full-width{max-width:100%}#edd-item-wrapper:after{content:"";display:block;clear:both;visibility:hidden;font-size:0;height:0}.edd-sections-wrap{clear:both;width:100%}.edd-sections-wrap .section-wrap{background-color:#fff;display:inline-block;z-index:2}.js .edd-sections-wrap .edd-vertical-sections:not(.meta-box) .section-wrap>div{min-height:500px;height:100%}.edd-sections-wrap .section-wrap .customer-section:not(:last-child){border-bottom:1px solid #eee}.edd-sections-wrap .section-wrap .customer-section table{margin-bottom:20px}.edd-sections-wrap .section-wrap{border-left:1px solid #e5e5e5}.edd-sections-wrap .section-wrap .section-content>*{padding:20px}.edd-sections-wrap .section-wrap .section-content h2{margin:0;padding-bottom:0}.edd-sections-wrap .section-wrap .avatar-wrap{float:left;padding-right:10px;text-align:center}.edd-sections-wrap .section-wrap img.avatar{border-radius:5px}.edd-sections-wrap .section-wrap .customer-id{position:absolute;right:0;top:0;padding:10px;background-color:#fafafa;border-bottom-left-radius:20%;border:1px solid #eee;border-top:none;border-right:none;font-family:monospace;font-size:18px;font-weight:600}.edd-item-info.customer-info input[type=password],.edd-item-info.customer-info input[type=text],.edd-item-info.customer-info select{width:200px;height:auto;box-shadow:none;transition:none;border:1px solid #ddd;margin:-5px 0 4px -2px;font-size:13px;padding:2px 4px}.edd-sections-wrap .section-wrap .customer-main-wrapper{float:left}.edd-sections-wrap .section-wrap .customer-main-wrapper input[name="customerinfo[name]"]{font-size:24px}.edd-sections-wrap .section-wrap .customer-address-wrapper{float:right;margin-top:-3px;margin-right:50px;width:202px}.edd-sections-wrap .section-wrap .info-wrapper{min-height:125px;overflow:visible}.edd-sections-wrap .section-wrap .customer-address span[data-key=address2],.edd-sections-wrap .section-wrap .customer-address span[data-key=address],.edd-sections-wrap .section-wrap .customer-address span[data-key=country]{display:block}.edd-sections-wrap .section-wrap a.delete{color:red;margin-right:5px;text-decoration:none}.customer-info{min-height:185px}.customer-info .customer-name{font-size:24px;font-weight:600}.customer-info .customer-name.editable{margin-bottom:6px}.customer-edit-link a{font-weight:400;text-decoration:none}.disconnect-user a{color:#aaa;font-size:20px}#customer-edit-actions{padding:3px;line-height:28px;text-align:center}#customer-edit-actions .button-secondary{margin-right:5px}#customer-edit-actions .cancel{padding:5px}.edd-sections-wrap .section-wrap .row-title{width:30%}.edd-sections-wrap .section-wrap .editable{display:block;padding:3px}.edd-sections-wrap .section-wrap div.edit-item{margin-left:-4px;margin-top:-20px}.edd-sections-wrap .section-wrap .customer-address.edit-item{margin-top:3px}.edd-sections-wrap .section-wrap span.edit-item{display:none}.edd-sections-wrap .section-wrap .edit-item input{font-size:13px}.edd-sections-wrap .section-wrap .customer-name.edit-item input{margin-top:-5px}.edd-sections-wrap .section-wrap .edd_user_search_results{left:-2px;top:18px}.edd-sections-wrap .section-wrap .edd_user_search_results ul{width:198px}#edd-item-stats-wrapper{margin:0 auto;text-align:center}#edd-item-stats-wrapper ul{display:flex;margin:0}#edd-item-stats-wrapper li{font-size:14px;margin-bottom:0;width:50%}#edd-item-stats-wrapper a{text-decoration:none}#edd-item-stats-wrapper .dashicons{color:#888;margin-top:-2px}#edd-item-tables-wrapper table{width:100%}#edd-item-tables-wrapper .no-items{text-align:left}#edd-item-tables-wrapper .emails .add-customer-email-row{background-color:#f4f4f4;border-top:1px solid #e5e5e5}#edd-item-tables-wrapper .add-customer-email-wrapper{display:flex;flex-wrap:wrap;align-items:center;margin:12px 0}#edd-item-tables-wrapper .edd-form-group{margin-bottom:0}#edd-item-tables-wrapper .edd-make-email-primary{flex-grow:1;margin-left:12px}#edd-item-tables-wrapper .emails .spinner{float:none;margin:0 10px;-ms-grid-row-align:center;align-self:center}#edd-item-tables-wrapper .notice-error{background-color:#fff5f5}#edd-item-notes-wrapper{min-height:50px}.customer-note-input{margin-bottom:5px;width:100%}.customer-note-wrapper{border-bottom:1px solid #f9f9f9;min-height:38px;padding:7px 0 7px 7px}.customer-note-wrapper span{display:block}.note-content-wrap{padding-top:7px}.edd-sections-wrap .section-wrap .notice-container{padding-left:20px;padding-right:20px;margin-left:-20px;margin-right:-20px}@media screen and (max-width:810px)and (min-width:656px){.customer-info .customer-name{font-size:16px}.edd-sections-wrap .section-wrap .widefat td,.widefat th{max-width:100%!important;display:table-cell}}@media screen and (max-width:781px){#edd-item-tab-wrapper,.edd-sections-wrap .section-wrap{margin:0;width:100%}#edd-item-tab-wrapper-list .dashicons{font-size:18px}.edd-item-has-tabs .edd-sections-wrap .section-wrap{border-top:1px solid #e5e5e5;border-left:0;margin-top:-1px}}@media screen and (max-width:656px){.edd-item-info.customer-info{position:relative}.edd-sections-wrap .section-wrap .customer-address-wrapper{float:none;position:absolute;top:84px;left:165px;max-width:200px}.edd-sections-wrap .section-wrap .customer-main-wrapper{float:none;position:absolute;left:165px}.customer-info .customer-name{font-size:16px}.edd-sections-wrap .section-wrap #edd-item-stats-wrapper{padding-left:0;padding-right:0}.edd-sections-wrap .section-wrap .customer-section{margin-bottom:0}.edd-sections-wrap .section-wrap .widefat td.column-primary,.edd-sections-wrap .section-wrap .widefat td.no-items,.edd-sections-wrap .section-wrap .widefat th.column-primary{width:100px!important;display:table-cell;overflow:hidden;text-align:left}.edd-sections-wrap .section-wrap .customer-id{display:none}#edd-item-tables-wrapper .emails td.column-primary{padding-right:10px;width:100%!important}#edd-item-tables-wrapper .edd-form-group{margin:0 0 16px}}@media screen and (max-width:480px){#edd-item-tab-wrapper-list li{width:50%}#edd-item-tab-wrapper-list li:nth-child(3n+3){border-width:0 1px 1px 0}#edd-item-tab-wrapper-list li:nth-child(2n){border-width:0 0 1px}.download_page_edd-reports .button{text-align:center}#edd-payment-date-filters span{display:block}#edd-payment-date-filters span>input{float:right}#edd-add-discount select[multiple] option,#edd-edit-discount select[multiple] option{height:20px}.download_page_edd-reports .inside .button,.download_page_edd-reports .inside input[type=submit],.download_page_edd-reports .inside input[type=text],.download_page_edd-reports .inside select,.download_page_edd-settings .inside input[type=button],.download_page_edd-tools .inside input[type=submit],.download_page_edd-tools .inside input[type=text],.download_page_edd-tools .inside select{width:100%}#edd-add-discount select[multiple],#edd-edit-discount select[multiple],.download_page_edd-tools select[multiple]{height:200px!important}.download_page_edd-settings input[type=checkbox]{margin:2px 0}.post-type-download input[type=checkbox]{margin-left:2px}}.inside .edd-tools-textarea{background:#32373c;color:rgba(240,245,250,.7);font-size:12px;font-family:Menlo,Monaco,monospace;display:block;overflow:auto;white-space:pre;width:100%;height:450px;padding:10px;outline:none}#system-info-textarea::selection{background:#555;color:#fff}#edd-system-info .edd-inline-button{margin-left:5px}.recount-stats-controls form{display:inline}.edd-recount-stats-descriptions span{display:none;line-height:24px}.edd-vertical-sections{overflow:visible;display:block;display:flex}#edd-item-tab-wrapper,.edd-vertical-sections .section-nav{position:relative;width:20%;line-height:1em;margin:0 -1px 0 0;padding:0;background-color:#f5f5f5;border-right:1px solid #e5e5e5;box-sizing:border-box;max-width:200px}#edd-item-tab-wrapper-list{margin:0}#edd-item-tab-wrapper li,.edd-vertical-sections .section-nav li{display:block;position:relative;margin:0;padding:0;background-color:#fcfcfc}.edd-vertical-sections .section-title:last-of-type{margin-bottom:24px}#edd-item-tab-wrapper li>.edd-item-tab-label-wrap,#edd-item-tab-wrapper li a,.edd-vertical-sections .section-nav li a{display:flex;margin:0;padding:9px;text-decoration:none;border-bottom:1px solid #e5e5e5;box-shadow:none;position:relative;align-items:center}#edd-item-tab-wrapper li a:focus,#edd-item-tab-wrapper li a:hover,.edd-vertical-sections .section-nav li a:focus,.edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0;outline:0;transition:all .25s}.edd-vertical-sections .section-nav .section-title--is-active a:after{content:"";width:1px;height:100%;background:#fff;position:absolute;right:0;top:0;bottom:0;z-index:3}#edd-item-tab-wrapper li>.edd-item-tab-label-wrap{background-color:#fff}.edd-vertical-sections .section-nav li a>.dashicons,.edd-vertical-sections .section-nav li a>span{display:inline-block}.edd-vertical-sections .section-nav li a>span{max-width:76%}.edd-vertical-sections .section-nav li a .dashicons{line-height:20px;margin-right:3px;color:#888}.edd-vertical-sections .section-nav .section-title--is-active a{font-weight:700;color:#555;background-color:#fff;border-right:none;margin-right:-1px}.edd-vertical-sections.use-js .section-content,.no-js .edd-vertical-sections.use-js.edd-item-header-small,.no-js .edd-vertical-sections.use-js .section-nav{display:none}.no-js .edd-vertical-sections.use-js .section-content{display:block}.admin-color-fresh .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-fresh .edd-vertical-sections .section-nav li a:focus,.admin-color-fresh .edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0 #0073aa}.admin-color-blue .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-blue .edd-vertical-sections .section-nav li a:focus,.admin-color-blue .edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0 #096484}.admin-color-coffee .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-coffee .edd-vertical-sections .section-nav li a:focus,.admin-color-coffee .edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0 #c7a589}.admin-color-ectoplasm .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-ectoplasm .edd-vertical-sections .section-nav li a:focus,.admin-color-ectoplasm .edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0 #a3b745}.admin-color-midnight .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-midnight .edd-vertical-sections .section-nav li a:focus,.admin-color-midnight .edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0 #e14d43}.admin-color-ocean .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-ocean .edd-vertical-sections .section-nav li a:focus,.admin-color-ocean .edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0 #627c83}.admin-color-sunrise .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-sunrise .edd-vertical-sections .section-nav li a:focus,.admin-color-sunrise .edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0 #be3631}.admin-color-light .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-light .edd-vertical-sections .section-nav li a:focus,.admin-color-light .edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0 #888}.admin-color-evergreen .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-evergreen .edd-vertical-sections .section-nav li a:focus,.admin-color-evergreen .edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0 #36533f}.admin-color-mint .edd-vertical-sections .section-nav .section-title--is-active a,.admin-color-mint .edd-vertical-sections .section-nav li a:focus,.admin-color-mint .edd-vertical-sections .section-nav li a:hover{box-shadow:inset 5px 0 #4f6d59}.edd-vertical-sections .section-nav .section-title--is-active .dashicons{color:#555}@media only screen and (max-width:782px){#edd-item-tab-wrapper,.edd-vertical-sections .section-nav{width:48px}.edd-vertical-sections .section-nav li a{justify-content:center}.edd-vertical-sections .section-nav li a .dashicons{width:24px;height:24px;font-size:24px;line-height:24px;margin:0}.section-nav li .dashicons:before{width:24px;height:24px}#edd-item-tab-wrapper .edd-item-tab-label,.section-nav li .label{overflow:hidden;position:absolute;top:-1000em;left:-1000em;width:1px;height:1px}}#edd-item-card-wrapper,.edd-vertical-sections .section-wrap{width:80%}#edd-item-card-wrapper .item-section{background:#fff;overflow:hidden;box-sizing:border-box}:not(#edd-item-tab-wrapper)+#edd-item-card-wrapper .item-section{margin:25px 0;padding:20px;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04)}#edd-item-tab-wrapper+#edd-item-card-wrapper{padding:20px;border-left:1px solid #e5e5e5;box-sizing:border-box}@media only screen and (min-width:1200px){#edd-graphs-filter,#edd-item-card-wrapper,.edd-vertical-sections:not(.meta-box) .section-wrap{width:calc(100% - 200px)}}@media only screen and (max-width:782px){#edd-graphs-filter,#edd-item-card-wrapper,.edd-vertical-sections .section-wrap{width:calc(100% - 48px)}}#edd-debug-log .edd-inline-button{margin-left:5px}.edd-settings-sidebar{padding-top:27px}.edd-settings-sidebar-content{background-color:#fff;text-align:center;border:1px solid #ddd;box-sizing:border-box;max-width:300px}.edd-settings-sidebar-content p{font-size:14px;line-height:1.5;margin-top:0}.edd-sidebar-header-section{background-color:#35495c;line-height:1;padding:26px 20px 24px;border-bottom:3px dashed #fafafa}.edd-sidebar-description-section{background-color:#fafafa;padding:16px 20px;border-bottom:1px solid #ddd}.edd-sidebar-description-section .edd-sidebar-description{margin:0}.edd-sidebar-coupon-section{font-size:14px;padding:16px 20px}.edd-sidebar-coupon-section label{display:block;line-height:1.4;margin-bottom:6px}.edd-sidebar-coupon-section label strong{color:#253b51;font-weight:700}.edd-sidebar-coupon-section input{background:#f4f7fa;font-size:22px;font-weight:600;text-align:center;padding:10px;border:2px dashed #2794da;border-radius:4px;margin-bottom:16px;box-shadow:none;width:100%}.edd-sidebar-coupon-section input:focus{border:2px dashed #2794da;box-shadow:none}.edd-settings-sidebar-content .edd-coupon-note{color:#6c7883;font-size:13px;font-style:italic;margin:0}.edd-settings-sidebar-content .edd-coupon-note a{color:#253b51}.edd-settings-sidebar-content .edd-coupon-note a:hover{text-decoration:none}.edd-sidebar-footer-section{background-color:#fafafa;padding:16px 20px;border-top:1px solid #ddd}.edd-sidebar-footer-section .edd-cta-button{display:block;background-color:#2794da;color:#fff;text-decoration:none;font-size:20px;font-weight:700;text-transform:uppercase;padding:17px 10px;border:none;border-radius:4px;width:100%;box-sizing:border-box;box-shadow:none;transition:background-color .2s}.edd-sidebar-footer-section .edd-cta-button:hover{background-color:#2386c5}@media (min-width:1080px){.edd-has-sidebar .edd-settings-content{float:left;width:67%}.edd-has-sidebar .edd-settings-sidebar{float:right;width:31%}}@media (min-width:1240px){.edd-has-sidebar .edd-settings-content{width:74%}.edd-has-sidebar .edd-settings-sidebar{width:23%}}.taxes-tab .edd-has-sidebar .edd-settings-content,.taxes-tab .edd-has-sidebar .edd-settings-sidebar{float:none;width:100%}.bfcm-promo-img-container{background-color:#35495c;width:100%;height:160px}.bfcm-code{color:#2794da;font-weight:700}.sale-ends{position:absolute;bottom:9px;right:14px;display:inline-block;color:#6c7883;font-size:12px;text-align:right;font-style:italic;width:150px} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd-rtl.min.css deleted file mode 100644 index ffe05d39..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-icon{display:inline-block;fill:currentColor;position:relative;vertical-align:middle}.edd-icon-spin{display:inline-block;animation:edd-icon-spin 2s linear infinite}@keyframes edd-icon-spin{0%{transform:rotate(0deg)}to{transform:rotate(-359deg)}}.edd_clearfix:after{display:block;visibility:hidden;float:none;clear:both;text-indent:-9999px;content:"."}#edd_checkout_cart{text-align:right;width:100%;border:none;margin:0 0 21px;table-layout:auto}#edd_checkout_cart td,#edd_checkout_cart th{text-align:right;border:1px solid #eee;color:#666;padding:.5em 1.387em}#edd_checkout_cart .edd_cart_header_row th{background:#fafafa;padding:1.387em}#edd_checkout_cart .edd_cart_discount_row th,#edd_checkout_cart .edd_cart_tax_row th{background:none}#edd_checkout_cart th{font-weight:700}#edd_checkout_cart td{line-height:25px;vertical-align:middle;background:#fff}#edd_checkout_cart td.edd_cart_actions,#edd_checkout_cart td:last-child,#edd_checkout_cart th.edd_cart_actions,#edd_checkout_cart th.edd_cart_total,#edd_checkout_cart th:last-child{text-align:left}#edd_checkout_cart td img{float:right;margin:0 0 0 8px;background:none;padding:0;border:none}#edd_checkout_cart input.edd-item-quantity{width:3em;padding:2px}#edd_checkout_cart .edd_discount{display:inline-block;margin-right:5px}.edd_discount_remove{display:inline-block;width:14px;height:14px;background:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%221.5%22%20stroke%3D%22currentColor%22%3E%0A%20%20%3Cpath%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22M9.75%209.75l4.5%204.5m0-4.5l-4.5%204.5M21%2012a9%209%200%2011-18%200%209%209%200%200118%200z%22%20%2F%3E%0A%3C%2Fsvg%3E%0A) 100% 0 no-repeat;position:relative;opacity:.6}.edd_discount_remove:hover{opacity:1}#edd_checkout_cart br{display:none}#edd_checkout_cart a.edd-cart-saving-button{font-weight:400;text-decoration:none}#edd_checkout_form_wrap legend{display:block;font-size:120%;line-height:1;font-weight:700;width:100%;margin:0 0 1rem;padding:0}#edd_checkout_form_wrap label{font-weight:700;display:block;position:relative;line-height:100%;font-size:95%;margin:0 0 5px}#edd_checkout_form_wrap span.edd-description{color:#666;font-size:80%;display:block;margin:0 0 5px}#edd_checkout_form_wrap input.edd-input,#edd_checkout_form_wrap textarea.edd-input{display:inline-block;width:70%}#edd_checkout_form_wrap select.edd-select{display:block;width:60%}#edd_checkout_form_wrap select.edd-select.edd-select-small{display:inline;width:auto}#edd_checkout_form_wrap input.edd-input.error,#edd_checkout_form_wrap textarea.edd-input.error{border-color:#c4554e}#edd_checkout_form_wrap>p{margin:0 0 21px}#edd_checkout_form_wrap span.edd-required-indicator{color:#b94a48;display:inline}#edd_checkout_form_wrap input[type=email],#edd_checkout_form_wrap input[type=password],#edd_checkout_form_wrap input[type=tel],#edd_checkout_form_wrap input[type=text],#edd_checkout_form_wrap textarea{padding:4px 6px}#edd_checkout_form_wrap input[type=radio]{border:none;margin-left:5px}#edd_checkout_form_wrap input[type=checkbox]{display:inline-block;margin:0 0 0 5px}#edd_checkout_form_wrap input[type=checkbox]+label,#edd_checkout_form_wrap input[type=checkbox]+label:after{display:inline}#edd_checkout_form_wrap .edd-payment-icons{display:flex;margin:0 0 8px}#edd_checkout_form_wrap .edd-payment-icons img.payment-icon{max-height:32px}#edd_checkout_form_wrap .edd-payment-icons .payment-icon{margin:0 0 0 10px}#edd_checkout_form_wrap #edd-payment-mode-wrap label{display:inline-block;margin:0 0 0 20px}#edd_checkout_form_wrap #edd-payment-mode-wrap .edd-payment-mode-label{font-weight:700;display:inline-block;position:relative;margin-bottom:5px}#edd_checkout_form_wrap fieldset{border:1px solid #eee;padding:1.387em;margin:0 0 21px}#edd_checkout_form_wrap #edd_discount_code,#edd_checkout_form_wrap #edd_purchase_submit,#edd_checkout_form_wrap #edd_register_account_fields{padding:0;border:none}#edd_checkout_form_wrap fieldset fieldset{margin:0;border:none;padding:0}#edd_checkout_form_wrap #edd-login-account-wrap,#edd_checkout_form_wrap #edd-new-account-wrap,#edd_checkout_form_wrap #edd_final_total_wrap,#edd_checkout_form_wrap #edd_show_discount,#edd_checkout_form_wrap .edd-cart-adjustment{background:#fafafa;color:#666;padding:.5em 1.387em}#edd_checkout_form_wrap #edd-discount-code-wrap,#edd_checkout_form_wrap #edd_final_total_wrap,#edd_checkout_form_wrap #edd_show_discount{border:1px solid #eee}#edd_checkout_form_wrap .edd-cart-adjustment{padding:1.387em}#edd_checkout_form_wrap .edd-cart-adjustment input.edd-input,#edd_checkout_form_wrap .edd-cart-adjustment input.edd-submit{display:inline-block}#edd_checkout_form_wrap .edd-cart-adjustment input.edd-submit{padding:3px 12px;margin-bottom:2px}#edd_checkout_form_wrap #edd-discount-error-wrap{width:100%;display:inline-block;margin:1em 0 0}#edd_checkout_form_wrap #edd-login-account-wrap,#edd_checkout_form_wrap #edd-new-account-wrap{margin:-1.387em -1.387em 21px;border-right:none;border-left:none;border-top:none}#edd_checkout_form_wrap #edd_payment_mode_select,#edd_checkout_form_wrap fieldset#edd_register_fields #edd_checkout_user_info{margin-bottom:21px}#edd_checkout_form_wrap fieldset#edd_register_account_fields legend{padding-top:11px}#edd_checkout_form_wrap fieldset#edd_register_account_fields p.edd_login_password,#edd_checkout_form_wrap fieldset#edd_register_account_fields p.edd_register_password{margin:0}#edd_checkout_form_wrap fieldset#edd_cc_fields legend{border:none;padding:0}#edd_checkout_form_wrap fieldset p:last-child{margin-bottom:0}#edd_checkout_form_wrap fieldset#edd_cc_fields #edd-card-number-wrap{margin-top:5px}#edd_checkout_form_wrap #edd_purchase_final_total{margin:21px 0}#edd_checkout_form_wrap #edd_purchase_final_total p{margin:0}#edd_secure_site_wrapper{padding:4px 0 4px 4px;font-weight:700}#edd_secure_site_wrapper span{vertical-align:middle}#edd_checkout_form_wrap input.edd-input.card-number.valid{background-image:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%221.5%22%20stroke%3D%22green%22%3E%0A%20%20%3Cpath%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22M4.5%2012.75l6%206%209-13.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A);background-repeat:no-repeat;background-position:2% 50%}#edd_checkout_form_wrap span.exp-divider{display:inline}#edd_checkout_form_wrap span.card-type{position:absolute;top:0;left:0}#edd_checkout_form_wrap span.card-type.off{display:none}#edd_checkout_form_wrap .edd-cart-ajax{box-shadow:none}.edd-amazon-profile-wrapper{font-size:12px}.edd-amazon-profile-name{font-weight:600}.edd-amazon-logout{font-size:10px;line-height:12px}.edd-amazon-logout a{cursor:pointer}#edd-amazon-address-box,#edd-amazon-wallet-box{height:228px;width:350px}#edd-amazon-address-box{margin-bottom:15px}.edd_cart_tax .edd-loading-ajax.edd-loading{margin:0 auto 0 0;display:inline-block}@media only screen and (min-width:768px){#edd-amazon-address-box,#edd-amazon-wallet-box{width:100%;height:228px}}.edd_purchase_submit_wrapper{position:relative}.edd_purchase_submit_wrapper a.edd-add-to-cart{text-decoration:none;display:none;position:relative;overflow:hidden}.edd_purchase_submit_wrapper .edd-cart-ajax{display:none;position:relative;right:-35px}.edd-submit.button.edd-ajax-loading{padding-left:30px}.edd-add-to-cart .edd-add-to-cart-label{opacity:1;filter:alpha(opacity=100)}.edd-loading,.edd-loading:after{border-radius:50%;display:block;width:1.5em;height:1.5em}.edd-loading{animation:edd-spinning 1.1s linear infinite;border:.2em solid hsla(0,0%,100%,.2);border-right-color:#fff;font-size:.75em;position:absolute;right:calc(50% - .75em);top:calc(50% - .75em);opacity:0;filter:alpha(opacity=0);transform:translateZ(0)}.edd-discount-loader.edd-loading,.edd-loading-ajax.edd-loading,a.edd-add-to-cart.white .edd-loading{border-color:rgba(0,0,0,.2) #000 rgba(0,0,0,.2) rgba(0,0,0,.2)}.edd-loading-ajax.edd-loading{display:inline-block;position:relative;top:0;right:.25em;vertical-align:middle}#edd_checkout_form_wrap .edd-cart-adjustment .edd-apply-discount.edd-submit{display:inline-block}.edd-discount-loader.edd-loading{display:inline-block;position:relative;right:auto;vertical-align:middle;width:1.25em;height:1.25em}.edd-loading-ajax.edd-loading{opacity:1}@keyframes edd-spinning{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}.edd-loading,a.edd-add-to-cart .edd-add-to-cart-label{transition:opacity .1s!important}.edd-add-to-cart[data-edd-loading] .edd-add-to-cart-label{opacity:0;filter:alpha(opacity=0)}.edd-add-to-cart[data-edd-loading] .edd-loading,.edd-discount-loader.edd-loading{opacity:1;filter:alpha(opacity=100)}.edd-cart-added-alert{color:#567622;display:block;position:absolute}.edd_form input.edd-input.required,.edd_form select.edd-select.required{color:#000}body.edd_receipt_page{background-color:#fff;color:#141412;margin:0;font-family:Helvetica,sans-serif;font-size:12px}body.edd_receipt_page:before{position:relative}body.edd_receipt_page #edd_receipt_wrapper{width:660px;margin:0 auto;padding:50px 0}body.edd_receipt_page table{display:table;width:100%;border-bottom:1px solid #ededed;border-collapse:collapse;border-spacing:0;font-size:14px;line-height:2;margin:0 0 20px}body.edd_receipt_page td,body.edd_receipt_page th{display:table-cell;text-align:right;border-top:1px solid #ededed;padding:6px 10px;font-weight:400}body.edd_receipt_page th{font-weight:700;text-transform:uppercase}body.edd_receipt_page h3{font-size:22px;margin:40px 0 5px;clear:both;display:block;font-weight:700}body.edd_receipt_page li{list-style:none}table#edd_purchase_receipt,table#edd_purchase_receipt_products{width:100%}table#edd_purchase_receipt_products td,table#edd_purchase_receipt_products th,table#edd_purchase_receipt td,table#edd_purchase_receipt th{text-align:right}table#edd_purchase_receipt .edd_receipt_payment_status.cancelled,table#edd_purchase_receipt .edd_receipt_payment_status.failed,table#edd_purchase_receipt .edd_receipt_payment_status.pending,table#edd_purchase_receipt .edd_receipt_payment_status.revoked{color:#f73f2e}table#edd_purchase_receipt_products li{list-style:none;margin:0 10px 8px 0}table#edd_purchase_receipt_products ul.edd_purchase_receipt_files,table#edd_purchase_receipt ul{margin:0;padding:0}table#edd_purchase_receipt li.edd_download_file{list-style:none;margin:0 0 8px}table#edd_purchase_receipt_products .edd_purchase_receipt_product_notes{font-style:italic}table#edd_purchase_receipt_products .edd_purchase_receipt_product_name{font-weight:700}table#edd_purchase_receipt_products .edd_bundled_product_name{font-style:italic;font-weight:700}#edd_user_history{text-align:right;width:100%;border-top:1px solid #f0f0f0;border-bottom:none}#edd_user_history td,#edd_user_history th{text-align:right;padding:3px 5px;border-bottom:1px solid #f0f0f0;border-top:none}#edd_user_history th{font-weight:700;background:#f5f5f5}#edd_user_history td{line-height:25px;vertical-align:middle}#edd_user_history .edd_purchase_status.cancelled,#edd_user_history .edd_purchase_status.failed,#edd_user_history .edd_purchase_status.pending,#edd_user_history .edd_purchase_status.revoked{color:#f73f2e}#edd_login_form legend,#edd_register_form legend{font-size:120%;margin-bottom:1em}#edd_login_form fieldset,#edd_register_form fieldset{border:none}#edd_login_form .edd-input,#edd_register_form .edd-input{box-sizing:border-box}#edd_login_form label,#edd_register_form label{cursor:pointer}#edd_profile_editor_form p{margin-bottom:8px}#edd_profile_editor_form label{display:inline-block}#edd_profile_editor_form .edd-profile-emails{list-style-type:none;display:inline-table;margin-right:0;margin-bottom:0}#edd_profile_editor_form .edd-profile-email{width:auto}#edd_profile_editor_form .edd-profile-email .actions{display:none}#edd_profile_editor_form .edd-profile-email:hover>span{display:inline-block}.edd_added_to_cart_alert{padding:5px;font-size:14px;border:1px solid #046a9e;background:#9ecce2;color:#333;margin:8px 0}.edd_added_to_cart_alert a.edd_alert_checkout_link{color:#000!important}input.edd_submit_plain{background:none!important;border:none!important;padding:0!important;display:inline;cursor:pointer}.single-download .edd_download_purchase_form{margin-bottom:1.387em}.edd_download_purchase_form .edd_download_quantity_wrapper{margin:0 0 .5em}.edd_download_purchase_form .edd_download_quantity_wrapper .edd-item-quantity{width:75px}.edd_download_purchase_form .edd_price_options{margin:0 0 15px}.edd_download_purchase_form .edd_price_options ul{margin:0;padding:0;list-style:none}.edd_download_purchase_form .edd_price_options li{display:block;padding:0;margin:0}.edd_download_purchase_form .edd_price_options span{display:inline;padding:0;margin:0}.edd_download_purchase_form .edd_price_options .edd_download_quantity_wrapper{padding-right:18px}.edd_download_purchase_form .edd_price_options .edd_download_quantity_wrapper *{font-size:80%}.edd_download_purchase_form .edd_price_options input.edd-item-quantity{display:inline;width:50px;max-width:90%}#edd-purchase-button,.edd-submit,[type=submit].edd-submit{display:inline-block;padding:6px 12px;margin:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;border:1px solid #ccc;border-radius:4px;box-shadow:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.edd-submit.button:focus,[type=submit].edd-submit:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.edd-submit.button:active{background-image:none;outline:0;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.edd-submit.plain{padding:0;border:none;border-radius:0}.edd-submit.button,.edd-submit.button.gray,.edd-submit.button:visited{color:#333;background:#f0f0f0;border-color:#ccc}.edd-submit.button.gray:active,.edd-submit.button.gray:focus,.edd-submit.button.gray:hover,.edd-submit.button:active,.edd-submit.button:focus,.edd-submit.button:hover{color:#333;background:#ebebeb;border-color:#adadad}.edd-submit.button.gray:active{background-image:none}.edd-submit.button.white{color:#333;background:#fff;border-color:#ccc}.edd-submit.button.white:active,.edd-submit.button.white:focus,.edd-submit.button.white:hover{color:#333;background:#ebebeb;border-color:#adadad}.edd-submit.button.white:active{background-image:none}.edd-submit.button.blue{color:#fff;background:#428bca;border-color:#357ebd}.edd-submit.button.blue.active,.edd-submit.button.blue:focus,.edd-submit.button.blue:hover{color:#fff;background:#3276b1;border-color:#285e8e}.edd-submit.button.blue.active{background-image:none}.edd-submit.button.red{color:#fff;background:#d9534f;border-color:#d43f3a}.edd-submit.button.red:active,.edd-submit.button.red:focus,.edd-submit.button.red:hover{color:#fff;background:#d2322d;border-color:#ac2925}.edd-submit.button.red:active{background-image:none}.edd-submit.button.green{color:#fff;background:#5cb85c;border-color:#4cae4c}.edd-submit.button.green:active,.edd-submit.button.green:focus,.edd-submit.button.green:hover{color:#fff;background:#47a447;border-color:#398439}.edd-submit.button.green:active{background-image:none}.edd-submit.button.yellow{color:#fff;background:#f0ad4e;border-color:#eea236}.edd-submit.button.yellow:active,.edd-submit.button.yellow:focus,.edd-submit.button.yellow:hover{color:#fff;background:#ed9c28;border-color:#d58512}.edd-submit.button.yellow:active{background-image:none}.edd-submit.button.orange{color:#fff;background:#ed9c28;border-color:#e3921e}.edd-submit.button.orange:active,.edd-submit.button.orange:focus,.edd-submit.button.orange:hover{color:#fff;background:#e59016;border-color:#d58512}.edd-submit.button.orange:active{background-image:none}.edd-submit.button.dark-gray{color:#fff;background:#363636;border-color:#222}.edd-submit.button.dark-gray:active,.edd-submit.button.dark-gray:focus,.edd-submit.button.dark-gray:hover{color:#fff;background:#333;border-color:#adadad}.edd-submit.button.dark-gray:active{background-image:none}.edd_downloads_list{display:-ms-grid;display:grid;grid-column-gap:20px;grid-row-gap:40px}.edd_downloads_list:after{content:"";display:table;clear:both}.edd_download{float:right}.edd_download_columns_1 .edd_download{width:100%}.edd_download_columns_2 .edd_download{width:50%}.edd_download_columns_0 .edd_download,.edd_download_columns_3 .edd_download{width:33%}.edd_download_columns_4 .edd_download{width:25%}.edd_download_columns_5 .edd_download{width:20%}.edd_download_columns_6 .edd_download{width:16.6%}.edd_download_inner{padding:0 8px 8px;margin:0 0 10px}.edd_download_columns_2 .edd_download:nth-child(odd),.edd_download_columns_3 .edd_download:nth-child(3n+1),.edd_download_columns_4 .edd_download:nth-child(4n+1),.edd_download_columns_5 .edd_download:nth-child(5n+1),.edd_download_columns_6 .edd_download:nth-child(6n+1){clear:right}.edd_download_image{max-width:100%}.edd_download .edd_price{margin-bottom:10px}@media(min-width:768px){.edd_downloads_list:not(.edd_download_columns_1){-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}}@media(min-width:1200px){.edd_downloads_list.edd_download_columns_2{-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}.edd_downloads_list.edd_download_columns_3{-ms-grid-columns:(1fr)[3];grid-template-columns:repeat(3,1fr)}.edd_downloads_list.edd_download_columns_4{-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.edd_downloads_list.edd_download_columns_5{-ms-grid-columns:(1fr)[5];grid-template-columns:repeat(5,1fr)}.edd_downloads_list.edd_download_columns_6{-ms-grid-columns:(1fr)[6];grid-template-columns:repeat(6,1fr)}}@supports(display:grid){.edd_downloads_list .edd_download{width:auto}.edd_download_inner{padding:0;margin:0}}.edd-hide-on-empty.cart-empty{display:none}.edd-cart-ajax{margin:0 4px 0 8px;position:relative;top:2px;background:none;border:none;padding:0}.edd-cart-number-of-items{font-style:italic;color:grey}.edd-cart-meta.edd_subtotal{font-weight:700;font-style:italic}.edd-cart-meta.edd_cart_tax{font-size:1em;font-style:italic}.edd-cart-meta.edd_cart_tax:before{font-style:normal}.edd-cart-meta.edd_total{font-weight:700}.edd-cart-meta{padding:2px 5px}.edd-cart-meta.edd_subtotal,.edd-cart-meta.edd_total{background-color:#f9f9f9}.edd_errors:not(.edd-alert){border-radius:2px;border:1px solid #e6db55;margin:0 0 21px;background:#ffffe0;color:#333}.edd_error{padding:10px}p.edd_error{margin:0!important}.edd_success:not(.edd-alert){border-radius:2px;border:1px solid #b3ce89;margin:20px 0;background:#d5eab3;color:#567622;padding:6px 8px;box-shadow:inset 0 1px 0 hsla(0,0%,100%,.7)}.edd-alert{border-radius:2px;margin-bottom:20px;padding:10px;border:1px solid transparent;vertical-align:middle}.edd-alert p{padding:0}.edd-alert p:not(:last-child){margin-bottom:5px}.edd-alert p:last-child{margin-bottom:0}.edd-alert-error{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.edd-alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.edd-alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.edd-alert-warn{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/edd.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/edd.min.css deleted file mode 100644 index 63712594..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/edd.min.css +++ /dev/null @@ -1 +0,0 @@ -.edd-icon{display:inline-block;fill:currentColor;position:relative;vertical-align:middle}.edd-icon-spin{display:inline-block;animation:edd-icon-spin 2s linear infinite}@keyframes edd-icon-spin{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.edd_clearfix:after{display:block;visibility:hidden;float:none;clear:both;text-indent:-9999px;content:"."}#edd_checkout_cart{text-align:left;width:100%;border:none;margin:0 0 21px;table-layout:auto}#edd_checkout_cart td,#edd_checkout_cart th{text-align:left;border:1px solid #eee;color:#666;padding:.5em 1.387em}#edd_checkout_cart .edd_cart_header_row th{background:#fafafa;padding:1.387em}#edd_checkout_cart .edd_cart_discount_row th,#edd_checkout_cart .edd_cart_tax_row th{background:none}#edd_checkout_cart th{font-weight:700}#edd_checkout_cart td{line-height:25px;vertical-align:middle;background:#fff}#edd_checkout_cart td.edd_cart_actions,#edd_checkout_cart td:last-child,#edd_checkout_cart th.edd_cart_actions,#edd_checkout_cart th.edd_cart_total,#edd_checkout_cart th:last-child{text-align:right}#edd_checkout_cart td img{float:left;margin:0 8px 0 0;background:none;padding:0;border:none}#edd_checkout_cart input.edd-item-quantity{width:3em;padding:2px}#edd_checkout_cart .edd_discount{display:inline-block;margin-left:5px}.edd_discount_remove{display:inline-block;width:14px;height:14px;background:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%221.5%22%20stroke%3D%22currentColor%22%3E%0A%20%20%3Cpath%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22M9.75%209.75l4.5%204.5m0-4.5l-4.5%204.5M21%2012a9%209%200%2011-18%200%209%209%200%200118%200z%22%20%2F%3E%0A%3C%2Fsvg%3E%0A) 0 0 no-repeat;position:relative;opacity:.6}.edd_discount_remove:hover{opacity:1}#edd_checkout_cart br{display:none}#edd_checkout_cart a.edd-cart-saving-button{font-weight:400;text-decoration:none}#edd_checkout_form_wrap legend{display:block;font-size:120%;line-height:1;font-weight:700;width:100%;margin:0 0 1rem;padding:0}#edd_checkout_form_wrap label{font-weight:700;display:block;position:relative;line-height:100%;font-size:95%;margin:0 0 5px}#edd_checkout_form_wrap span.edd-description{color:#666;font-size:80%;display:block;margin:0 0 5px}#edd_checkout_form_wrap input.edd-input,#edd_checkout_form_wrap textarea.edd-input{display:inline-block;width:70%}#edd_checkout_form_wrap select.edd-select{display:block;width:60%}#edd_checkout_form_wrap select.edd-select.edd-select-small{display:inline;width:auto}#edd_checkout_form_wrap input.edd-input.error,#edd_checkout_form_wrap textarea.edd-input.error{border-color:#c4554e}#edd_checkout_form_wrap>p{margin:0 0 21px}#edd_checkout_form_wrap span.edd-required-indicator{color:#b94a48;display:inline}#edd_checkout_form_wrap input[type=email],#edd_checkout_form_wrap input[type=password],#edd_checkout_form_wrap input[type=tel],#edd_checkout_form_wrap input[type=text],#edd_checkout_form_wrap textarea{padding:4px 6px}#edd_checkout_form_wrap input[type=radio]{border:none;margin-right:5px}#edd_checkout_form_wrap input[type=checkbox]{display:inline-block;margin:0 5px 0 0}#edd_checkout_form_wrap input[type=checkbox]+label,#edd_checkout_form_wrap input[type=checkbox]+label:after{display:inline}#edd_checkout_form_wrap .edd-payment-icons{display:flex;margin:0 0 8px}#edd_checkout_form_wrap .edd-payment-icons img.payment-icon{max-height:32px}#edd_checkout_form_wrap .edd-payment-icons .payment-icon{margin:0 10px 0 0}#edd_checkout_form_wrap #edd-payment-mode-wrap label{display:inline-block;margin:0 20px 0 0}#edd_checkout_form_wrap #edd-payment-mode-wrap .edd-payment-mode-label{font-weight:700;display:inline-block;position:relative;margin-bottom:5px}#edd_checkout_form_wrap fieldset{border:1px solid #eee;padding:1.387em;margin:0 0 21px}#edd_checkout_form_wrap #edd_discount_code,#edd_checkout_form_wrap #edd_purchase_submit,#edd_checkout_form_wrap #edd_register_account_fields{padding:0;border:none}#edd_checkout_form_wrap fieldset fieldset{margin:0;border:none;padding:0}#edd_checkout_form_wrap #edd-login-account-wrap,#edd_checkout_form_wrap #edd-new-account-wrap,#edd_checkout_form_wrap #edd_final_total_wrap,#edd_checkout_form_wrap #edd_show_discount,#edd_checkout_form_wrap .edd-cart-adjustment{background:#fafafa;color:#666;padding:.5em 1.387em}#edd_checkout_form_wrap #edd-discount-code-wrap,#edd_checkout_form_wrap #edd_final_total_wrap,#edd_checkout_form_wrap #edd_show_discount{border:1px solid #eee}#edd_checkout_form_wrap .edd-cart-adjustment{padding:1.387em}#edd_checkout_form_wrap .edd-cart-adjustment input.edd-input,#edd_checkout_form_wrap .edd-cart-adjustment input.edd-submit{display:inline-block}#edd_checkout_form_wrap .edd-cart-adjustment input.edd-submit{padding:3px 12px;margin-bottom:2px}#edd_checkout_form_wrap #edd-discount-error-wrap{width:100%;display:inline-block;margin:1em 0 0}#edd_checkout_form_wrap #edd-login-account-wrap,#edd_checkout_form_wrap #edd-new-account-wrap{margin:-1.387em -1.387em 21px;border-left:none;border-right:none;border-top:none}#edd_checkout_form_wrap #edd_payment_mode_select,#edd_checkout_form_wrap fieldset#edd_register_fields #edd_checkout_user_info{margin-bottom:21px}#edd_checkout_form_wrap fieldset#edd_register_account_fields legend{padding-top:11px}#edd_checkout_form_wrap fieldset#edd_register_account_fields p.edd_login_password,#edd_checkout_form_wrap fieldset#edd_register_account_fields p.edd_register_password{margin:0}#edd_checkout_form_wrap fieldset#edd_cc_fields legend{border:none;padding:0}#edd_checkout_form_wrap fieldset p:last-child{margin-bottom:0}#edd_checkout_form_wrap fieldset#edd_cc_fields #edd-card-number-wrap{margin-top:5px}#edd_checkout_form_wrap #edd_purchase_final_total{margin:21px 0}#edd_checkout_form_wrap #edd_purchase_final_total p{margin:0}#edd_secure_site_wrapper{padding:4px 4px 4px 0;font-weight:700}#edd_secure_site_wrapper span{vertical-align:middle}#edd_checkout_form_wrap input.edd-input.card-number.valid{background-image:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%221.5%22%20stroke%3D%22green%22%3E%0A%20%20%3Cpath%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22M4.5%2012.75l6%206%209-13.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A);background-repeat:no-repeat;background-position:98% 50%}#edd_checkout_form_wrap span.exp-divider{display:inline}#edd_checkout_form_wrap span.card-type{position:absolute;top:0;right:0}#edd_checkout_form_wrap span.card-type.off{display:none}#edd_checkout_form_wrap .edd-cart-ajax{box-shadow:none}.edd-amazon-profile-wrapper{font-size:12px}.edd-amazon-profile-name{font-weight:600}.edd-amazon-logout{font-size:10px;line-height:12px}.edd-amazon-logout a{cursor:pointer}#edd-amazon-address-box,#edd-amazon-wallet-box{height:228px;width:350px}#edd-amazon-address-box{margin-bottom:15px}.edd_cart_tax .edd-loading-ajax.edd-loading{margin:0 0 0 auto;display:inline-block}@media only screen and (min-width:768px){#edd-amazon-address-box,#edd-amazon-wallet-box{width:100%;height:228px}}.edd_purchase_submit_wrapper{position:relative}.edd_purchase_submit_wrapper a.edd-add-to-cart{text-decoration:none;display:none;position:relative;overflow:hidden}.edd_purchase_submit_wrapper .edd-cart-ajax{display:none;position:relative;left:-35px}.edd-submit.button.edd-ajax-loading{padding-right:30px}.edd-add-to-cart .edd-add-to-cart-label{opacity:1;filter:alpha(opacity=100)}.edd-loading,.edd-loading:after{border-radius:50%;display:block;width:1.5em;height:1.5em}.edd-loading{animation:edd-spinning 1.1s linear infinite;border:.2em solid hsla(0,0%,100%,.2);border-left-color:#fff;font-size:.75em;position:absolute;left:calc(50% - .75em);top:calc(50% - .75em);opacity:0;filter:alpha(opacity=0);transform:translateZ(0)}.edd-discount-loader.edd-loading,.edd-loading-ajax.edd-loading,a.edd-add-to-cart.white .edd-loading{border-color:rgba(0,0,0,.2) rgba(0,0,0,.2) rgba(0,0,0,.2) #000}.edd-loading-ajax.edd-loading{display:inline-block;position:relative;top:0;left:.25em;vertical-align:middle}#edd_checkout_form_wrap .edd-cart-adjustment .edd-apply-discount.edd-submit{display:inline-block}.edd-discount-loader.edd-loading{display:inline-block;position:relative;left:auto;vertical-align:middle;width:1.25em;height:1.25em}.edd-loading-ajax.edd-loading{opacity:1}@keyframes edd-spinning{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.edd-loading,a.edd-add-to-cart .edd-add-to-cart-label{transition:opacity .1s!important}.edd-add-to-cart[data-edd-loading] .edd-add-to-cart-label{opacity:0;filter:alpha(opacity=0)}.edd-add-to-cart[data-edd-loading] .edd-loading,.edd-discount-loader.edd-loading{opacity:1;filter:alpha(opacity=100)}.edd-cart-added-alert{color:#567622;display:block;position:absolute}.edd_form input.edd-input.required,.edd_form select.edd-select.required{color:#000}body.edd_receipt_page{background-color:#fff;color:#141412;margin:0;font-family:Helvetica,sans-serif;font-size:12px}body.edd_receipt_page:before{position:relative}body.edd_receipt_page #edd_receipt_wrapper{width:660px;margin:0 auto;padding:50px 0}body.edd_receipt_page table{display:table;width:100%;border-bottom:1px solid #ededed;border-collapse:collapse;border-spacing:0;font-size:14px;line-height:2;margin:0 0 20px}body.edd_receipt_page td,body.edd_receipt_page th{display:table-cell;text-align:left;border-top:1px solid #ededed;padding:6px 10px;font-weight:400}body.edd_receipt_page th{font-weight:700;text-transform:uppercase}body.edd_receipt_page h3{font-size:22px;margin:40px 0 5px;clear:both;display:block;font-weight:700}body.edd_receipt_page li{list-style:none}table#edd_purchase_receipt,table#edd_purchase_receipt_products{width:100%}table#edd_purchase_receipt_products td,table#edd_purchase_receipt_products th,table#edd_purchase_receipt td,table#edd_purchase_receipt th{text-align:left}table#edd_purchase_receipt .edd_receipt_payment_status.cancelled,table#edd_purchase_receipt .edd_receipt_payment_status.failed,table#edd_purchase_receipt .edd_receipt_payment_status.pending,table#edd_purchase_receipt .edd_receipt_payment_status.revoked{color:#f73f2e}table#edd_purchase_receipt_products li{list-style:none;margin:0 0 8px 10px}table#edd_purchase_receipt_products ul.edd_purchase_receipt_files,table#edd_purchase_receipt ul{margin:0;padding:0}table#edd_purchase_receipt li.edd_download_file{list-style:none;margin:0 0 8px}table#edd_purchase_receipt_products .edd_purchase_receipt_product_notes{font-style:italic}table#edd_purchase_receipt_products .edd_purchase_receipt_product_name{font-weight:700}table#edd_purchase_receipt_products .edd_bundled_product_name{font-style:italic;font-weight:700}#edd_user_history{text-align:left;width:100%;border-top:1px solid #f0f0f0;border-bottom:none}#edd_user_history td,#edd_user_history th{text-align:left;padding:3px 5px;border-bottom:1px solid #f0f0f0;border-top:none}#edd_user_history th{font-weight:700;background:#f5f5f5}#edd_user_history td{line-height:25px;vertical-align:middle}#edd_user_history .edd_purchase_status.cancelled,#edd_user_history .edd_purchase_status.failed,#edd_user_history .edd_purchase_status.pending,#edd_user_history .edd_purchase_status.revoked{color:#f73f2e}#edd_login_form legend,#edd_register_form legend{font-size:120%;margin-bottom:1em}#edd_login_form fieldset,#edd_register_form fieldset{border:none}#edd_login_form .edd-input,#edd_register_form .edd-input{box-sizing:border-box}#edd_login_form label,#edd_register_form label{cursor:pointer}#edd_profile_editor_form p{margin-bottom:8px}#edd_profile_editor_form label{display:inline-block}#edd_profile_editor_form .edd-profile-emails{list-style-type:none;display:inline-table;margin-left:0;margin-bottom:0}#edd_profile_editor_form .edd-profile-email{width:auto}#edd_profile_editor_form .edd-profile-email .actions{display:none}#edd_profile_editor_form .edd-profile-email:hover>span{display:inline-block}.edd_added_to_cart_alert{padding:5px;font-size:14px;border:1px solid #046a9e;background:#9ecce2;color:#333;margin:8px 0}.edd_added_to_cart_alert a.edd_alert_checkout_link{color:#000!important}input.edd_submit_plain{background:none!important;border:none!important;padding:0!important;display:inline;cursor:pointer}.single-download .edd_download_purchase_form{margin-bottom:1.387em}.edd_download_purchase_form .edd_download_quantity_wrapper{margin:0 0 .5em}.edd_download_purchase_form .edd_download_quantity_wrapper .edd-item-quantity{width:75px}.edd_download_purchase_form .edd_price_options{margin:0 0 15px}.edd_download_purchase_form .edd_price_options ul{margin:0;padding:0;list-style:none}.edd_download_purchase_form .edd_price_options li{display:block;padding:0;margin:0}.edd_download_purchase_form .edd_price_options span{display:inline;padding:0;margin:0}.edd_download_purchase_form .edd_price_options .edd_download_quantity_wrapper{padding-left:18px}.edd_download_purchase_form .edd_price_options .edd_download_quantity_wrapper *{font-size:80%}.edd_download_purchase_form .edd_price_options input.edd-item-quantity{display:inline;width:50px;max-width:90%}#edd-purchase-button,.edd-submit,[type=submit].edd-submit{display:inline-block;padding:6px 12px;margin:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;border:1px solid #ccc;border-radius:4px;box-shadow:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.edd-submit.button:focus,[type=submit].edd-submit:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.edd-submit.button:active{background-image:none;outline:0;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.edd-submit.plain{padding:0;border:none;border-radius:0}.edd-submit.button,.edd-submit.button.gray,.edd-submit.button:visited{color:#333;background:#f0f0f0;border-color:#ccc}.edd-submit.button.gray:active,.edd-submit.button.gray:focus,.edd-submit.button.gray:hover,.edd-submit.button:active,.edd-submit.button:focus,.edd-submit.button:hover{color:#333;background:#ebebeb;border-color:#adadad}.edd-submit.button.gray:active{background-image:none}.edd-submit.button.white{color:#333;background:#fff;border-color:#ccc}.edd-submit.button.white:active,.edd-submit.button.white:focus,.edd-submit.button.white:hover{color:#333;background:#ebebeb;border-color:#adadad}.edd-submit.button.white:active{background-image:none}.edd-submit.button.blue{color:#fff;background:#428bca;border-color:#357ebd}.edd-submit.button.blue.active,.edd-submit.button.blue:focus,.edd-submit.button.blue:hover{color:#fff;background:#3276b1;border-color:#285e8e}.edd-submit.button.blue.active{background-image:none}.edd-submit.button.red{color:#fff;background:#d9534f;border-color:#d43f3a}.edd-submit.button.red:active,.edd-submit.button.red:focus,.edd-submit.button.red:hover{color:#fff;background:#d2322d;border-color:#ac2925}.edd-submit.button.red:active{background-image:none}.edd-submit.button.green{color:#fff;background:#5cb85c;border-color:#4cae4c}.edd-submit.button.green:active,.edd-submit.button.green:focus,.edd-submit.button.green:hover{color:#fff;background:#47a447;border-color:#398439}.edd-submit.button.green:active{background-image:none}.edd-submit.button.yellow{color:#fff;background:#f0ad4e;border-color:#eea236}.edd-submit.button.yellow:active,.edd-submit.button.yellow:focus,.edd-submit.button.yellow:hover{color:#fff;background:#ed9c28;border-color:#d58512}.edd-submit.button.yellow:active{background-image:none}.edd-submit.button.orange{color:#fff;background:#ed9c28;border-color:#e3921e}.edd-submit.button.orange:active,.edd-submit.button.orange:focus,.edd-submit.button.orange:hover{color:#fff;background:#e59016;border-color:#d58512}.edd-submit.button.orange:active{background-image:none}.edd-submit.button.dark-gray{color:#fff;background:#363636;border-color:#222}.edd-submit.button.dark-gray:active,.edd-submit.button.dark-gray:focus,.edd-submit.button.dark-gray:hover{color:#fff;background:#333;border-color:#adadad}.edd-submit.button.dark-gray:active{background-image:none}.edd_downloads_list{display:-ms-grid;display:grid;grid-column-gap:20px;grid-row-gap:40px}.edd_downloads_list:after{content:"";display:table;clear:both}.edd_download{float:left}.edd_download_columns_1 .edd_download{width:100%}.edd_download_columns_2 .edd_download{width:50%}.edd_download_columns_0 .edd_download,.edd_download_columns_3 .edd_download{width:33%}.edd_download_columns_4 .edd_download{width:25%}.edd_download_columns_5 .edd_download{width:20%}.edd_download_columns_6 .edd_download{width:16.6%}.edd_download_inner{padding:0 8px 8px;margin:0 0 10px}.edd_download_columns_2 .edd_download:nth-child(odd),.edd_download_columns_3 .edd_download:nth-child(3n+1),.edd_download_columns_4 .edd_download:nth-child(4n+1),.edd_download_columns_5 .edd_download:nth-child(5n+1),.edd_download_columns_6 .edd_download:nth-child(6n+1){clear:left}.edd_download_image{max-width:100%}.edd_download .edd_price{margin-bottom:10px}@media(min-width:768px){.edd_downloads_list:not(.edd_download_columns_1){-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}}@media(min-width:1200px){.edd_downloads_list.edd_download_columns_2{-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr)}.edd_downloads_list.edd_download_columns_3{-ms-grid-columns:(1fr)[3];grid-template-columns:repeat(3,1fr)}.edd_downloads_list.edd_download_columns_4{-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr)}.edd_downloads_list.edd_download_columns_5{-ms-grid-columns:(1fr)[5];grid-template-columns:repeat(5,1fr)}.edd_downloads_list.edd_download_columns_6{-ms-grid-columns:(1fr)[6];grid-template-columns:repeat(6,1fr)}}@supports(display:grid){.edd_downloads_list .edd_download{width:auto}.edd_download_inner{padding:0;margin:0}}.edd-hide-on-empty.cart-empty{display:none}.edd-cart-ajax{margin:0 8px 0 4px;position:relative;top:2px;background:none;border:none;padding:0}.edd-cart-number-of-items{font-style:italic;color:grey}.edd-cart-meta.edd_subtotal{font-weight:700;font-style:italic}.edd-cart-meta.edd_cart_tax{font-size:1em;font-style:italic}.edd-cart-meta.edd_cart_tax:before{font-style:normal}.edd-cart-meta.edd_total{font-weight:700}.edd-cart-meta{padding:2px 5px}.edd-cart-meta.edd_subtotal,.edd-cart-meta.edd_total{background-color:#f9f9f9}.edd_errors:not(.edd-alert){border-radius:2px;border:1px solid #e6db55;margin:0 0 21px;background:#ffffe0;color:#333}.edd_error{padding:10px}p.edd_error{margin:0!important}.edd_success:not(.edd-alert){border-radius:2px;border:1px solid #b3ce89;margin:20px 0;background:#d5eab3;color:#567622;padding:6px 8px;box-shadow:inset 0 1px 0 hsla(0,0%,100%,.7)}.edd-alert{border-radius:2px;margin-bottom:20px;padding:10px;border:1px solid transparent;vertical-align:middle}.edd-alert p{padding:0}.edd-alert p:not(:last-child){margin-bottom:5px}.edd-alert p:last-child{margin-bottom:0}.edd-alert-error{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.edd-alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.edd-alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.edd-alert-warn{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/jquery-ui-fresh-rtl.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/jquery-ui-fresh-rtl.min.css deleted file mode 100644 index 87836669..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/jquery-ui-fresh-rtl.min.css +++ /dev/null @@ -1 +0,0 @@ -.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui-helper-clearfix{display:inline-block}/*\*/* html .ui-helper-clearfix{height:1%}.ui-helper-clearfix{display:block}/**/.ui-helper-zfix{width:100%;height:100%;top:0;right:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;right:0;width:100%;height:100%}.ui-widget{font-family:sans-serif;font-size:12px}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:sans-serif;font-size:1em}.ui-widget-content{border:1px solid #dfdfdf;background:#fff;color:#333}.ui-widget-header{border:1px solid #dfdfdf;color:#333;font-weight:bold;background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:-webkit-gradient(linear,right top,right bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec)}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #dfdfdf;background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:-webkit-gradient(linear,right top,right bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec);font-weight:normal;color:#333}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#333;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #ccc;background-color:#ececec;background-image:-ms-linear-gradient(top,#ececec,#f9f9f9);background-image:-moz-linear-gradient(top,#ececec,#f9f9f9);background-image:-o-linear-gradient(top,#ececec,#f9f9f9);background-image:-webkit-gradient(linear,right top,right bottom,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#ececec,#f9f9f9);background-image:linear-gradient(top,#ececec,#f9f9f9);font-weight:normal;color:#000}.ui-state-hover a,.ui-state-hover a:hover{color:#000;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #dfdfdf;background:#fff;font-weight:normal;color:#333}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#333;text-decoration:none}.ui-widget :active{outline:0}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #e6db55;background:#ffffe0;color:#333}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#333}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #c00;background:#ffebe8;color:#c00}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#c00}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#c00}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-icon{width:16px;height:16px;background-image:url(../images/ui-icons_333333_256x240.png)}.ui-widget-content .ui-icon{background-image:url(../images/ui-icons_333333_256x240.png)}.ui-widget-header .ui-icon{background-image:url(../images/ui-icons_999999_256x240.png)}.ui-state-default .ui-icon{background-image:url(../images/ui-icons_333333_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(../images/ui-icons_333333_256x240.png)}.ui-state-active .ui-icon{background-image:url(../images/ui-icons_333333_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(../images/ui-icons_21759b_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(../images/ui-icons_cc0000_256x240.png)}.ui-icon-carat-1-n{background-position:100% 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:100% -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:100% -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:100% -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:100% -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:100% -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:100% -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:100% -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:100% -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:100% -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-off{background-position:-96px -144px}.ui-icon-radio-on{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:100% -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:100% -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:100% -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:100% -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:100% -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.ui-widget-overlay{background:#000;opacity:.6;filter:Alpha(Opacity=60)}.ui-widget-shadow{box-shadow:0 0 16px rgba(0,0,0,0.3)}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;right:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;right:0}.ui-resizable-e{cursor:e-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-se{cursor:sw-resize;width:12px;height:12px;left:1px;bottom:1px}.ui-resizable-sw{cursor:se-resize;width:9px;height:9px;right:-5px;bottom:-5px}.ui-resizable-nw{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-resizable-ne{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion{width:100%}.ui-accordion .ui-accordion-header{cursor:pointer;position:relative;margin-top:1px;zoom:1}.ui-accordion .ui-accordion-li-fix{display:inline}.ui-accordion .ui-accordion-header-active{border-bottom:0!important}.ui-accordion .ui-accordion-header a{display:block;font-size:1em;padding:.5em .7em .5em .5em}.ui-accordion-icons .ui-accordion-header a{padding-right:2.2em}.ui-accordion .ui-accordion-header .ui-icon{position:absolute;right:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;margin-top:-2px;position:relative;top:1px;margin-bottom:2px;overflow:auto;display:none;zoom:1}.ui-accordion .ui-accordion-content-active{display:block}.ui-autocomplete{position:absolute;cursor:default}* html .ui-autocomplete{width:1px}.ui-menu{list-style:none;padding:2px;margin:0;display:block;float:right}.ui-menu .ui-menu{margin-top:-3px}.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;float:right;clear:right;width:100%}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:.2em .4em;line-height:1.5;zoom:1}.ui-menu .ui-menu-item a.ui-state-hover,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-button{display:inline-block;position:relative;padding:0;margin-left:.1em;text-decoration:none!important;cursor:pointer;text-align:center;zoom:1;overflow:visible}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:1.4}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icons .ui-button-text{padding-right:2.1em;padding-left:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{right:50%;margin-right:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{right:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{left:.5em}.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{left:.5em}.ui-buttonset{margin-left:7px}.ui-buttonset .ui-button{margin-right:0;margin-left:-.3em}button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-dialog{position:fixed;padding:.2em;width:300px;overflow:hidden}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:right;margin:.1em 0 .1em 16px}.ui-dialog .ui-dialog-titlebar-close{position:absolute;left:.3em;top:50%;width:19px;margin:-10px 0 0 0;padding:1px;height:18px}.ui-dialog .ui-dialog-titlebar-close span{display:block;margin:1px}.ui-dialog .ui-dialog-titlebar-close:hover,.ui-dialog .ui-dialog-titlebar-close:focus{padding:0}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:100%;overflow:auto;zoom:1}.ui-dialog .ui-dialog-buttonpane{text-align:right;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em .4em .5em 1em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:left}.ui-dialog .ui-dialog-buttonpane button{margin:.5em 0 .5em .4em;cursor:pointer}.ui-dialog .ui-resizable-se{width:14px;height:14px;left:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-slider{position:relative;text-align:right}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:100% 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-right:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{right:0}.ui-slider-horizontal .ui-slider-range-max{left:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{right:-.3em;margin-right:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{right:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-tabs{position:relative;padding:.2em;zoom:1}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:right;position:relative;top:1px;margin:0 0 1px .2em;border-bottom:0!important;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:right;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-selected{margin-bottom:0;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-selected a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-state-processing a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:100%}.ui-tabs .ui-tabs-hide{display:none!important}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{right:2px}.ui-datepicker .ui-datepicker-next{left:2px}.ui-datepicker .ui-datepicker-prev-hover{right:1px}.ui-datepicker .ui-datepicker-next-hover{left:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;right:50%;margin-right:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:left;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-right:0;border-left:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:left;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:right}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0}.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:right}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:ltr}.ui-datepicker-rtl .ui-datepicker-prev{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-next{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker-rtl .ui-datepicker-group{float:left}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0;border-right-width:1px}.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0;border-right-width:1px}.ui-datepicker-cover{display:none;display:block;position:absolute;z-index:-1;filter:mask();top:-4px;right:-4px;width:200px;height:200px}.ui-progressbar{height:2em;text-align:right}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-widget-header{background-color:#83b4d8;background-image:linear-gradient(bottom,#72a7cf 0,#90c5ee 100%);background-image:-o-linear-gradient(bottom,#72a7cf 0,#90c5ee 100%);background-image:-moz-linear-gradient(bottom,#72a7cf 0,#90c5ee 100%);background-image:-webkit-linear-gradient(bottom,#72a7cf 0,#90c5ee 100%);background-image:-ms-linear-gradient(bottom,#72a7cf 0,#90c5ee 100%)} diff --git a/wp-content/plugins/easy-digital-downloads/assets/css/jquery-ui-fresh.min.css b/wp-content/plugins/easy-digital-downloads/assets/css/jquery-ui-fresh.min.css deleted file mode 100644 index 632e1003..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/css/jquery-ui-fresh.min.css +++ /dev/null @@ -1 +0,0 @@ -.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui-helper-clearfix{display:inline-block}/*\*/* html .ui-helper-clearfix{height:1%}.ui-helper-clearfix{display:block}/**/.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ui-widget{font-family:sans-serif;font-size:12px}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:sans-serif;font-size:1em}.ui-widget-content{border:1px solid #dfdfdf;background:#fff;color:#333}.ui-widget-header{border:1px solid #dfdfdf;color:#333;font-weight:bold;background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec)}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #dfdfdf;background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec);font-weight:normal;color:#333}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#333;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #ccc;background-color:#ececec;background-image:-ms-linear-gradient(top,#ececec,#f9f9f9);background-image:-moz-linear-gradient(top,#ececec,#f9f9f9);background-image:-o-linear-gradient(top,#ececec,#f9f9f9);background-image:-webkit-gradient(linear,left top,left bottom,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#ececec,#f9f9f9);background-image:linear-gradient(top,#ececec,#f9f9f9);font-weight:normal;color:#000}.ui-state-hover a,.ui-state-hover a:hover{color:#000;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #dfdfdf;background:#fff;font-weight:normal;color:#333}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#333;text-decoration:none}.ui-widget :active{outline:0}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #e6db55;background:#ffffe0;color:#333}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#333}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #c00;background:#ffebe8;color:#c00}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#c00}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#c00}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-icon{width:16px;height:16px;background-image:url(../images/ui-icons_333333_256x240.png)}.ui-widget-content .ui-icon{background-image:url(../images/ui-icons_333333_256x240.png)}.ui-widget-header .ui-icon{background-image:url(../images/ui-icons_999999_256x240.png)}.ui-state-default .ui-icon{background-image:url(../images/ui-icons_333333_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(../images/ui-icons_333333_256x240.png)}.ui-state-active .ui-icon{background-image:url(../images/ui-icons_333333_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(../images/ui-icons_21759b_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(../images/ui-icons_cc0000_256x240.png)}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-off{background-position:-96px -144px}.ui-icon-radio-on{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{-moz-border-radius-bottomright:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.ui-widget-overlay{background:#000;opacity:.6;filter:Alpha(Opacity=60)}.ui-widget-shadow{box-shadow:0 0 16px rgba(0,0,0,0.3)}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion{width:100%}.ui-accordion .ui-accordion-header{cursor:pointer;position:relative;margin-top:1px;zoom:1}.ui-accordion .ui-accordion-li-fix{display:inline}.ui-accordion .ui-accordion-header-active{border-bottom:0!important}.ui-accordion .ui-accordion-header a{display:block;font-size:1em;padding:.5em .5em .5em .7em}.ui-accordion-icons .ui-accordion-header a{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;margin-top:-2px;position:relative;top:1px;margin-bottom:2px;overflow:auto;display:none;zoom:1}.ui-accordion .ui-accordion-content-active{display:block}.ui-autocomplete{position:absolute;cursor:default}* html .ui-autocomplete{width:1px}.ui-menu{list-style:none;padding:2px;margin:0;display:block;float:left}.ui-menu .ui-menu{margin-top:-3px}.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;float:left;clear:left;width:100%}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:.2em .4em;line-height:1.5;zoom:1}.ui-menu .ui-menu-item a.ui-state-hover,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;text-decoration:none!important;cursor:pointer;text-align:center;zoom:1;overflow:visible}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:1.4}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-dialog{position:fixed;padding:.2em;width:300px;overflow:hidden}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 16px .1em 0}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:19px;margin:-10px 0 0 0;padding:1px;height:18px}.ui-dialog .ui-dialog-titlebar-close span{display:block;margin:1px}.ui-dialog .ui-dialog-titlebar-close:hover,.ui-dialog .ui-dialog-titlebar-close:focus{padding:0}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto;zoom:1}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-tabs{position:relative;padding:.2em;zoom:1}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:1px;margin:0 .2em 1px 0;border-bottom:0!important;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-selected{margin-bottom:0;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-selected a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-state-processing a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}.ui-tabs .ui-tabs-hide{display:none!important}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-cover{display:none;display:block;position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}.ui-progressbar{height:2em;text-align:left}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-widget-header{background-color:#83b4d8;background-image:linear-gradient(bottom,#72a7cf 0,#90c5ee 100%);background-image:-o-linear-gradient(bottom,#72a7cf 0,#90c5ee 100%);background-image:-moz-linear-gradient(bottom,#72a7cf 0,#90c5ee 100%);background-image:-webkit-linear-gradient(bottom,#72a7cf 0,#90c5ee 100%);background-image:-ms-linear-gradient(bottom,#72a7cf 0,#90c5ee 100%)} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-cpt-2x.png b/wp-content/plugins/easy-digital-downloads/assets/images/edd-cpt-2x.png deleted file mode 100644 index 89e8f5b0..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/edd-cpt-2x.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-cpt.png b/wp-content/plugins/easy-digital-downloads/assets/images/edd-cpt.png deleted file mode 100644 index a59acb5c..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/edd-cpt.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-cross-hair.png b/wp-content/plugins/easy-digital-downloads/assets/images/edd-cross-hair.png deleted file mode 100644 index 7cb88bb9..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/edd-cross-hair.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-icon-2x.png b/wp-content/plugins/easy-digital-downloads/assets/images/edd-icon-2x.png deleted file mode 100644 index 32572a70..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/edd-icon-2x.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-icon.png b/wp-content/plugins/easy-digital-downloads/assets/images/edd-icon.png deleted file mode 100644 index be8b1e47..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/edd-icon.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo-pdf.png b/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo-pdf.png deleted file mode 100644 index deb1c625..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo-pdf.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo-white-2x.png b/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo-white-2x.png deleted file mode 100644 index c6f0029d..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo-white-2x.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo.png b/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo.png deleted file mode 100644 index de288d04..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo.svg b/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo.svg deleted file mode 100644 index 5b295c42..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/edd-logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-media.png b/wp-content/plugins/easy-digital-downloads/assets/images/edd-media.png deleted file mode 100644 index 34cbac61..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/edd-media.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/edd-peeking.png b/wp-content/plugins/easy-digital-downloads/assets/images/edd-peeking.png deleted file mode 100644 index f6f6be09..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/edd-peeking.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-arrow-down.png b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-arrow-down.png deleted file mode 100644 index 2ef013c4..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-arrow-down.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-arrow-up.png b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-arrow-up.png deleted file mode 100644 index ac1f534c..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-arrow-up.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-automate.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-automate.svg deleted file mode 100644 index 74faa437..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-automate.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-average.png b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-average.png deleted file mode 100644 index 082f7a68..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-average.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-bundle.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-bundle.svg deleted file mode 100644 index bc9612df..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-bundle.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-chevron-down.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-chevron-down.svg deleted file mode 100644 index ba51258c..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-chevron-down.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-edd-heart.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-edd-heart.svg deleted file mode 100644 index 6ac1679d..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-edd-heart.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-email-marketing.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-email-marketing.svg deleted file mode 100644 index 9d36f6a3..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-email-marketing.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-gateways.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-gateways.svg deleted file mode 100644 index 092aae04..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-gateways.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-gross.png b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-gross.png deleted file mode 100644 index 0de9bee8..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-gross.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-install.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-install.svg deleted file mode 100644 index da0cdc5a..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-install.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-lead-magnets.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-lead-magnets.svg deleted file mode 100644 index 2a853d19..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-lead-magnets.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-megaphone.png b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-megaphone.png deleted file mode 100644 index 152004e5..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-megaphone.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-net.png b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-net.png deleted file mode 100644 index f8bd82c7..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-net.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-new-customers.png b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-new-customers.png deleted file mode 100644 index d4ec5e56..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-new-customers.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-settings.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-settings.svg deleted file mode 100644 index 3ffd68b1..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-settings.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-smiley.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-smiley.svg deleted file mode 100644 index 5d4495a2..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-smiley.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-subscriptions.svg b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-subscriptions.svg deleted file mode 100644 index 0716178e..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-subscriptions.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-top-products.png b/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-top-products.png deleted file mode 100644 index 422c6337..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/icons/icon-top-products.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/icons/iphone.png b/wp-content/plugins/easy-digital-downloads/assets/images/icons/iphone.png deleted file mode 100644 index 265b7880..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/icons/iphone.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/loading.gif b/wp-content/plugins/easy-digital-downloads/assets/images/loading.gif deleted file mode 100644 index 5e21ec18..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/loading.gif and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/logo-edd-dark.svg b/wp-content/plugins/easy-digital-downloads/assets/images/logo-edd-dark.svg deleted file mode 100644 index 6d831e77..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/logo-edd-dark.svg +++ /dev/null @@ -1,216 +0,0 @@ - - - - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/media-button.png b/wp-content/plugins/easy-digital-downloads/assets/images/media-button.png deleted file mode 100644 index 55ff6265..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/media-button.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/bob.jpg b/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/bob.jpg deleted file mode 100644 index db9c41d3..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/bob.jpg and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/joe.jpg b/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/joe.jpg deleted file mode 100644 index 1193ae6b..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/joe.jpg and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/nicolas.jpg b/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/nicolas.jpg deleted file mode 100644 index c81f3c71..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/nicolas.jpg and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/stripe-logo.svg b/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/stripe-logo.svg deleted file mode 100644 index 37b894f9..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/onboarding/stripe-logo.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/promo/bfcm-header.svg b/wp-content/plugins/easy-digital-downloads/assets/images/promo/bfcm-header.svg deleted file mode 100644 index c25fb608..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/images/promo/bfcm-header.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/promo/edd-25-percent-off.png b/wp-content/plugins/easy-digital-downloads/assets/images/promo/edd-25-percent-off.png deleted file mode 100644 index 6e131c81..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/promo/edd-25-percent-off.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/17checkout.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/17checkout.png deleted file mode 100644 index 69edd6be..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/17checkout.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/17direct.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/17direct.png deleted file mode 100644 index e7fdfe76..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/17direct.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/17quantities.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/17quantities.png deleted file mode 100644 index 2ffdca52..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/17quantities.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/18-button-colors.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/18-button-colors.png deleted file mode 100644 index 7626a8ce..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/18-button-colors.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/18cart-saving.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/18cart-saving.png deleted file mode 100644 index 762820ef..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/18cart-saving.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-discount.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-discount.png deleted file mode 100644 index 04e49ced..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-discount.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-register-login.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-register-login.png deleted file mode 100644 index 0aa9f408..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-register-login.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-sequential.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-sequential.png deleted file mode 100644 index 5541c71d..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-sequential.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-unlimited-downloads.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-unlimited-downloads.png deleted file mode 100644 index 798d707a..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/20-unlimited-downloads.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-logs.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-logs.png deleted file mode 100644 index 00171254..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-logs.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-purchased-downloads.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-purchased-downloads.png deleted file mode 100644 index 13c3c7e2..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-purchased-downloads.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-purchased-downloads2.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-purchased-downloads2.png deleted file mode 100644 index e2d5f023..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-purchased-downloads2.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-quantity.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-quantity.png deleted file mode 100644 index cf9d6a2f..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/22-quantity.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/24-category-earnings.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/24-category-earnings.png deleted file mode 100644 index 7690501f..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/24-category-earnings.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/24-checkout.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/24-checkout.png deleted file mode 100644 index 1d24e226..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/24-checkout.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/24-export.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/24-export.png deleted file mode 100644 index 44639130..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/24-export.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/26-customer.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/26-customer.png deleted file mode 100644 index 821e83b6..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/26-customer.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/26-import.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/26-import.png deleted file mode 100644 index 007bcae6..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/26-import.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/26-refund.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/26-refund.png deleted file mode 100644 index 6a838dda..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/26-refund.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/bundles.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/bundles.png deleted file mode 100644 index 61e0f133..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/bundles.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/customer-ui.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/customer-ui.png deleted file mode 100644 index b3b0c99f..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/customer-ui.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/edit-download.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/edit-download.png deleted file mode 100644 index df8aba4d..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/edit-download.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/email-template-21.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/email-template-21.png deleted file mode 100644 index f3d548db..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/email-template-21.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/grid.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/grid.png deleted file mode 100644 index f9440bc0..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/grid.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/order-details.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/order-details.png deleted file mode 100644 index 89719c23..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/order-details.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/product-earnings.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/product-earnings.png deleted file mode 100644 index ed22aac3..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/product-earnings.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/product-tax.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/product-tax.png deleted file mode 100644 index 46fc7f4d..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/product-tax.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/purchase-link.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/purchase-link.png deleted file mode 100644 index 30e1bbf3..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/purchase-link.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/tax-rates.png b/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/tax-rates.png deleted file mode 100644 index 5761d30f..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/screenshots/tax-rates.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_21759b_256x240.png b/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_21759b_256x240.png deleted file mode 100644 index 83bb123e..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_21759b_256x240.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_333333_256x240.png b/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_333333_256x240.png deleted file mode 100644 index f4bf52bb..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_333333_256x240.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_999999_256x240.png b/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_999999_256x240.png deleted file mode 100644 index 14b5901b..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_999999_256x240.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_cc0000_256x240.png b/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_cc0000_256x240.png deleted file mode 100644 index 1b51f76d..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/ui-icons_cc0000_256x240.png and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/images/xit.gif b/wp-content/plugins/easy-digital-downloads/assets/images/xit.gif deleted file mode 100644 index b11c5d43..00000000 Binary files a/wp-content/plugins/easy-digital-downloads/assets/images/xit.gif and /dev/null differ diff --git a/wp-content/plugins/easy-digital-downloads/assets/js/alpine.min.js b/wp-content/plugins/easy-digital-downloads/assets/js/alpine.min.js deleted file mode 100644 index 03fb0b2a..00000000 --- a/wp-content/plugins/easy-digital-downloads/assets/js/alpine.min.js +++ /dev/null @@ -1,5 +0,0 @@ -(()=>{var Fe=!1,je=!1,J=[];function wt(e){Kr(e)}function Kr(e){J.includes(e)||J.push(e),zr()}function zr(){!je&&!Fe&&(Fe=!0,queueMicrotask(Vr))}function Vr(){Fe=!1,je=!0;for(let e=0;ee.effect(t,{scheduler:r=>{ze?wt(r):r()}}),Ke=e.raw}function Ve(e){C=e}function At(e){let t=()=>{};return[n=>{let i=C(n);e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),V(i))}},()=>{t()}]}var Ot=[],Tt=[],Rt=[];function Ct(e){Rt.push(e)}function Mt(e){Tt.push(e)}function Nt(e){Ot.push(e)}function kt(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Be(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var qe=new MutationObserver(He),Ue=!1;function We(){qe.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ue=!0}function Hr(){Br(),qe.disconnect(),Ue=!1}var Z=[],Ge=!1;function Br(){Z=Z.concat(qe.takeRecords()),Z.length&&!Ge&&(Ge=!0,queueMicrotask(()=>{qr(),Ge=!1}))}function qr(){He(Z),Z.length=0}function m(e){if(!Ue)return e();Hr();let t=e();return We(),t}var Ye=!1,pe=[];function Dt(){Ye=!0}function Pt(){Ye=!1,He(pe),pe=[]}function He(e){if(Ye){pe=pe.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;os.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{Be(s,o)}),n.forEach((o,s)=>{Ot.forEach(a=>a(s,o))});for(let o of t)r.includes(o)||Rt.forEach(s=>s(o));for(let o of r)t.includes(o)||Tt.forEach(s=>s(o));t=null,r=null,n=null,i=null}function B(e,t,r){return e._x_dataStack=[t,...Q(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function Je(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function Q(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?Q(e.host):e.parentNode?Q(e.parentNode):[]}function X(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function It(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(n).forEach(([o,s])=>{let a=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,a,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,a)})};return r(e)}function me(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>Ur(n,i),s=>Ze(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function Ur(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function Ze(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),Ze(e[t[0]],t.slice(1),r)}}var Lt={};function x(e,t){Lt[e]=t}function ee(e,t){return Object.entries(Lt).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){return n(t,{Alpine:S,interceptor:me})},enumerable:!1})}),e}function b(e,t,r={}){let n;return h(e,t)(i=>n=i,r),n}function h(...e){return $t(...e)}var $t=Qe;function Ft(e){$t=e}function Qe(e,t){let r={};ee(r,e);let n=[r,...Q(e)];if(typeof t=="function")return Wr(n,t);let i=Gr(n,t);return Yr.bind(null,e,t,i)}function Wr(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(X([n,...e]),i);he(r,o)}}var Xe={};function Jr(e){if(Xe[e])return Xe[e];let t=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)/.test(e)?`(() => { ${e} })()`:e,n=new t(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return Xe[e]=n,n}function Gr(e,t){let r=Jr(t);return(n=()=>{},{scope:i={},params:o=[]}={})=>{r.result=void 0,r.finished=!1;let s=X([i,...e]),a=r(r,s);r.finished?he(n,r.result,s,o):a.then(c=>{he(n,c,s,o)})}}function he(e,t,r,n){if(typeof t=="function"){let i=t.apply(r,n);i instanceof Promise?i.then(o=>he(e,o,r,n)):e(i)}else e(t)}function Yr(e,t,r,...n){try{return r(...n)}catch(i){throw console.warn(`Alpine Expression Error: ${i.message} - -Expression: "${t}" - -`,e),i}}var et="x-";function A(e=""){return et+e}function jt(e){et=e}var Kt={};function p(e,t){Kt[e]=t}function te(e,t,r){let n={};return Array.from(t).map(zt((o,s)=>n[o]=s)).filter(Vt).map(Qr(n,r)).sort(Xr).map(o=>Zr(e,o))}function Bt(e){return Array.from(e).map(zt()).filter(t=>!Vt(t))}var tt=!1,re=new Map,Ht=Symbol();function qt(e){tt=!0;let t=Symbol();Ht=t,re.set(t,[]);let r=()=>{for(;re.get(t).length;)re.get(t).shift()();re.delete(t)},n=()=>{tt=!1,r()};e(r),n()}function Zr(e,t){let r=()=>{},n=Kt[t.type]||r,i=[],o=d=>i.push(d),[s,a]=At(e);i.push(a);let c={Alpine:S,effect:s,cleanup:o,evaluateLater:h.bind(h,e),evaluate:b.bind(b,e)},l=()=>i.forEach(d=>d());kt(e,t.original,l);let u=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,c),n=n.bind(n,e,t,c),tt?re.get(Ht).push(n):n())};return u.runCleanups=l,u}var ge=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),_e=e=>e;function zt(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Ut.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var Ut=[];function H(e){Ut.push(e)}function Vt({name:e}){return Wt().test(e)}var Wt=()=>new RegExp(`^${et}([^:^.]+)\\b`);function Qr(e,t){return({name:r,value:n})=>{let i=r.match(Wt()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var rt="DEFAULT",ye=["ignore","ref","data","bind","init","for","model","transition","show","if",rt,"element"];function Xr(e,t){let r=ye.indexOf(e.type)===-1?rt:e.type,n=ye.indexOf(t.type)===-1?rt:t.type;return ye.indexOf(r)-ye.indexOf(n)}function $(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var nt=[],it=!1;function q(e){nt.push(e),queueMicrotask(()=>{it||setTimeout(()=>{xe()})})}function xe(){for(it=!1;nt.length;)nt.shift()()}function Gt(){it=!0}function N(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>N(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)N(n,t,!1),n=n.nextElementSibling}function be(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Jt(){document.body||be("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's ` - notices ) ) { - $this->notices = array(); - } - - // Parse args - $r = wp_parse_args( $args, array( - 'id' => '', - 'message' => '', - 'class' => false, - 'is_dismissible' => true, - ) ); - - // Prevent a notice from being added more than once. - if ( ! empty( $r['id'] ) && array_key_exists( $r['id'], $this->notices ) ) { - return; - } - - $default_class = 'updated'; - - // One message as string - if ( is_string( $r['message'] ) ) { - $message = '

' . $this->esc_notice( $r['message'] ) . '

'; - - } elseif ( is_array( $r['message'] ) ) { - $message = '

' . implode( '

', array_map( array( $this, 'esc_notice' ), $r['message'] ) ) . '

'; - - // Messages as objects - } elseif ( is_wp_error( $r['message'] ) ) { - $default_class = 'is-error'; - $errors = $r['message']->get_error_messages(); - - switch ( count( $errors ) ) { - case 0: - return false; - - case 1: - $message = '

' . $this->esc_notice( $errors[0] ) . '

'; - break; - - default: - $escaped = array_map( array( $this, 'esc_notice' ), $errors ); - $message = ''; - break; - } - - // Message is an unknown format, so bail - } else { - return false; - } - - // CSS Classes - $classes = array( $default_class ); - if ( ! empty( $r['class'] ) ) { - $classes = explode( ' ', $r['class'] ); - } - - // Add dismissible class - if ( ! empty( $r['is_dismissible'] ) ) { - array_push( $classes, 'is-dismissible' ); - } - - // Assemble the message - $message = '
' . $message . '
'; - $message = str_replace( "'", "\'", $message ); - - // Add notice to notices array - $this->notices[ $r['id'] ] = $message; - } - - /** - * Add all admin area notices - * - * @since 3.0 - */ - public function add_notices() { - - // User can view shop reports - if ( current_user_can( 'view_shop_reports' ) ) { - $this->add_reports_notices(); - } - - // User can manage the entire shop - if ( current_user_can( 'manage_shop_settings' ) ) { - $this->add_data_notices(); - $this->add_settings_notices(); - $this->add_order_upgrade_notice(); - } - - // Generic notices - if ( ! empty( $_REQUEST['edd-message'] ) ) { - $this->add_user_action_notices( $_REQUEST['edd-message'] ); - } - - $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'edd-message' ), $_SERVER['REQUEST_URI'] ); - } - - /** - * Dismiss admin notices when dismiss links are clicked - * - * @since 2.3 - */ - public function dismiss_notices() { - - // Bail if no notices to dismiss - if ( empty( $_GET['edd_notice'] ) || empty( $_GET['_wpnonce'] ) ) { - return; - } - - // Construct key we are dismissing - $key = sanitize_key( $_GET['edd_notice'] ); - - // Bail if sanitized notice is empty - if ( empty( $key ) ) { - return; - } - - // Bail if nonce does not verify - if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'edd_notice_nonce' ) ) { - return; - } - - // Dismiss notice - update_user_meta( get_current_user_id(), "_edd_{$key}_dismissed", 1 ); - edd_redirect( remove_query_arg( array( 'edd_action', 'edd_notice', '_wpnonce' ) ) ); - } - - /** - * Output all admin area notices - * - * @since 2.6.0 bbPress (r6771) - */ - public function display_notices() { - $screen = get_current_screen(); - if ( 'site-health' === $screen->id ) { - return; - } - - $this->show_debugging_notice(); - - // Bail if no notices - if ( empty( $this->notices ) || ! is_array( $this->notices ) ) { - return; - } - - // Start an output buffer - ob_start(); - - // Loop through notices, and add them to buffer - foreach ( $this->notices as $notice ) { - echo $notice; - } - - // Output the current buffer - $notices = ob_get_clean(); - - // Only echo if not empty - if ( ! empty( $notices ) ) { - echo $notices; - } - } - - /** - * Remove unneed admin notices from EDD admin screens. - * - * @since 3.1.1 - * @return void - */ - public function remove_notices() { - if ( ! edd_is_admin_page() ) { - return; - } - - global $wp_filter; - $all_hooks = $wp_filter['admin_notices']->callbacks; - - foreach ( $all_hooks as $priority => $priority_actions ) { - - $priority_functions = wp_list_pluck( $priority_actions, 'function' ); - - foreach ( $priority_functions as $key => $function ) { - if ( is_array( $function ) ) { - - if ( ! empty( $function[0] ) && is_object( $function[0] ) ) { - $class_name = strtolower( get_class( $function[0] ) ); - - if ( false === strpos( $class_name, 'edd' ) ) { - unset( $all_hooks[ $priority ][ $key ] ); - } - } - } elseif ( is_string( $function ) ) { - - $function = strtolower( $function ); - if ( false === strpos( $function, 'edd' ) ) { - - unset( $all_hooks[ $priority ][ $key ] ); - } - } - } - } - $wp_filter['admin_notices']->callbacks = $all_hooks; - } - - /** Private Methods *******************************************************/ - - /** - * Notices about missing pages - * - * @since 3.0 - * @deprecated 3.1.2 - */ - private function add_page_notices() { - - // Checkout page is missing - $purchase_page = edd_get_option( 'purchase_page', '' ); - if ( empty( $purchase_page ) || ( 'trash' === get_post_status( $purchase_page ) ) ) { - $this->add_notice( array( - 'id' => 'edd-no-purchase-page', - /* translators: %s: URL to the settings page */ - 'message' => sprintf( __( 'No checkout page is configured. Set one in Settings.', 'easy-digital-downloads' ), esc_url( edd_get_admin_url( array( 'page' => 'edd-settings', 'tab' => 'general', 'section' => 'pages' ) ) ) ), - 'class' => 'error', - 'is_dismissible' => false, - ) ); - } - } - - /** - * Notices about reports - * - * @since 3.0 - */ - private function add_reports_notices() { - - } - - /** - * Notices for the entire shop - * - * @since 3.0 - * @deprecated 3.1.2 - */ - private function add_system_notices() { - - // Bail if not an EDD admin page - if ( ! edd_is_admin_page() || edd_is_dev_environment() || edd_is_admin_page( 'index.php' ) ) { - return; - } - - // Bail if user cannot manage options - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - // Bail if uploads directory is protected - if ( edd_is_uploads_url_protected() ) { - return; - } - - // Get the upload directory - $upload_directory = edd_get_upload_dir(); - - // Running NGINX - $show_nginx_notice = apply_filters( 'edd_show_nginx_redirect_notice', true ); - if ( $show_nginx_notice && ! empty( $GLOBALS['is_nginx'] ) && ! get_user_meta( get_current_user_id(), '_edd_nginx_redirect_dismissed', true ) ) { - $dismiss_notice_url = wp_nonce_url( add_query_arg( array( - 'edd_action' => 'dismiss_notices', - 'edd_notice' => 'nginx_redirect' - ) ), 'edd_notice_nonce' ); - - $this->add_notice( array( - 'id' => 'edd-nginx', - 'class' => 'error', - 'is_dismissible' => false, - 'message' => array( - /* translators: %s: Uploads directory */ - sprintf( __( 'The files in %s are not currently protected.', 'easy-digital-downloads' ), '' . $upload_directory . '' ), - __( 'To protect them, you must add this NGINX redirect rule.', 'easy-digital-downloads' ), - /* translators: %s: Dismiss notice URL */ - sprintf( __( 'If you have already done this, or it does not apply to your site, you may permenently %s.', 'easy-digital-downloads' ), '' . __( 'dismiss this notice', 'easy-digital-downloads' ) . '' ) - ) - ) ); - } - - // Running Apache - if ( ! empty( $GLOBALS['is_apache'] ) && ! edd_htaccess_exists() && ! get_user_meta( get_current_user_id(), '_edd_htaccess_missing_dismissed', true ) ) { - $dismiss_notice_url = wp_nonce_url( add_query_arg( array( - 'edd_action' => 'dismiss_notices', - 'edd_notice' => 'htaccess_missing' - ) ), 'edd_notice_nonce' ); - - $this->add_notice( array( - 'id' => 'edd-apache', - 'class' => 'error', - 'is_dismissible' => false, - 'message' => array( - sprintf( __( 'The .htaccess file is missing from: %s', 'easy-digital-downloads' ), '' . $upload_directory . '' ), - sprintf( __( 'First, please resave the Misc settings tab a few times. If this warning continues to appear, create a file called ".htaccess" in the %s directory, and copy the following into it:', 'easy-digital-downloads' ), '' . $upload_directory . '' ), - sprintf( __( 'If you have already done this, or it does not apply to your site, you may permenently %s.', 'easy-digital-downloads' ), '' . __( 'dismiss this notice', 'easy-digital-downloads' ) . '' ), - '
' . edd_get_htaccess_rules() . '
' - ) - ) ); - } - } - - /** - * Notices about data (migrations, etc...) - * - * @since 3.0 - */ - private function add_data_notices() { - - // Recount earnings - if ( class_exists( 'EDD_Recount_Earnings' ) ) { - $this->add_notice( array( - 'id' => 'edd-recount-earnings', - 'class' => 'error', - 'is_dismissible' => false, - 'message' => sprintf( - /* translators: 1. link to the recount tool; 2. link to the plugins screen. */ - __( 'Easy Digital Downloads 2.5 contains a built in recount tool. Please deactivate the Easy Digital Downloads - Recount Earnings plugin', 'easy-digital-downloads' ), - esc_url( edd_get_admin_url( array( 'page' => 'edd-tools', 'tab' => 'general' ) ) ), - esc_url( admin_url( 'plugins.php' ) ) - ) - ) ); - } - } - - /** - * Adds a notice about the deprecated Default Rate for Taxes. - * - * @since 3.0 - * @since 3.0.2 - We've found a way to add default tax rates. Leaving the method in case anyone (for some reason) is calling it. - */ - private function add_tax_rate_notice() { - - // Default tax rate not detected. - if ( false === edd_get_option( 'tax_rate' ) ) { - return; - } - - // On Rates page, settings notice is shown. - if ( ! empty( $_GET['page'] ) && 'edd-settings' === $_GET['page'] && ! empty( $_GET['section'] ) && 'rates' === $_GET['section'] ) { - return; - } - - // URL to fix this - $url = edd_get_admin_url( array( - 'page' => 'edd-settings', - 'tab' => 'taxes', - 'section' => 'rates' - ) ); - - // Link - $link = '' . __( 'Review Tax Rates', 'easy-digital-downloads' ) . ''; - - // Add the notice - $this->add_notice( array( - 'id' => 'edd-default-tax-rate', - 'class' => 'error', - /* translators: Link to review existing tax rates. */ - 'message' => '' . __( 'A default tax rate was detected.', 'easy-digital-downloads' ) . '

' . __( 'This setting is no longer used in this version of Easy Digital Downloads. Please confirm your regional tax rates are properly configured and update tax settings to remove this notice.', 'easy-digital-downloads' ) . '

' . $link, - 'is_dismissible' => false - ) ); - } - - /** - * Notices about settings (updating, etc...) - * - * @since 3.0 - */ - private function add_settings_notices() { - - // Settings area - if ( empty( $_GET['page'] ) || ( 'edd-settings' !== $_GET['page'] ) ) { - return; - } - - // Settings updated - if ( ! empty( $_GET['settings-updated'] ) ) { - $this->add_notice( - array( - 'id' => 'edd-notices', - 'message' => __( 'Settings updated.', 'easy-digital-downloads' ) - ) - ); - } - - if ( 'accounting' === filter_input( INPUT_GET, 'section', FILTER_SANITIZE_STRING ) ) { - if ( ! empty( edd_get_option( 'sequential_start_update_failed', false ) ) ) { - $order_number = new \EDD\Orders\Number(); - $this->add_notice( - array( - 'id' => 'edd-sequential-order-numbers-not-updated', - 'message' => sprintf( - /* translators: %s: Next order number */ - __( 'The sequential starting number could not be updated because it could conflict with existing orders. The next assigned order number is %s.', 'easy-digital-downloads' ), - '' . $order_number->format( (int) get_option( 'edd_next_order_number' ) ) . '' - ), - 'class' => 'error', - ) - ); - edd_delete_option( 'sequential_start_update_failed' ); - } - } - } - - /** - * Adds a notice if an order migration is running. - * This is only shown if the migration is running via UI by a different user or on another screen. - * - * @since 3.1.2 - * @return void - */ - private function add_order_upgrade_notice() { - if ( edd_has_upgrade_completed( 'migrate_orders' ) ) { - return; - } - if ( ! get_option( '_edd_v30_doing_order_migration', false ) ) { - return; - } - if ( get_option( 'edd_v30_cli_migration_running', false ) ) { - return; - } - $this->add_notice( - array( - 'id' => 'edd-v30-order-migration-running', - 'class' => 'updated', - 'message' => __( 'Easy Digital Downloads is migrating orders. Sales and earnings data for your store will be updated when all orders have been migrated.', 'easy-digital-downloads' ), - 'is_dismissible' => false, - ) - ); - } - - /** - * Notices about actions that the user has taken - * - * @since 3.0 - * - * @param string $notice - */ - private function add_user_action_notices( $notice = '' ) { - - // Sanitize notice key - $notice = sanitize_key( $notice ); - - // Bail if notice is empty - if ( empty( $notice ) ) { - return; - } - - // Shop discounts errors - if ( current_user_can( 'manage_shop_discounts' ) ) { - switch ( $notice ) { - case 'discount_added' : - $this->add_notice( array( - 'id' => 'edd-discount-added', - 'message' => __( 'Discount code added.', 'easy-digital-downloads' ) - ) ); - break; - case 'discount_add_failed' : - $this->add_notice( array( - 'id' => 'edd-discount-add-fail', - 'message' => __( 'There was a problem adding that discount code, please try again.', 'easy-digital-downloads' ), - 'class' => 'error' - ) ); - break; - case 'discount_exists' : - $this->add_notice( array( - 'id' => 'edd-discount-exists', - 'message' => __( 'A discount with that code already exists, please use a different code.', 'easy-digital-downloads' ), - 'class' => 'error' - ) ); - break; - case 'discount_updated' : - $this->add_notice( array( - 'id' => 'edd-discount-updated', - 'message' => __( 'Discount code updated.', 'easy-digital-downloads' ) - ) ); - break; - case 'discount_not_changed' : - $this->add_notice( array( - 'id' => 'edd-discount-not-changed', - 'message' => __( 'No changes were made to that discount code.', 'easy-digital-downloads' ) - ) ); - break; - case 'discount_update_failed' : - $this->add_notice( array( - 'id' => 'edd-discount-updated-fail', - 'message' => __( 'There was a problem updating that discount code, please try again.', 'easy-digital-downloads' ), - 'class' => 'error' - ) ); - break; - case 'discount_validation_failed' : - $this->add_notice( array( - 'id' => 'edd-discount-validation-fail', - 'message' => __( 'The discount code could not be added because one or more of the required fields was empty, please try again.', 'easy-digital-downloads' ), - 'class' => 'error' - ) ); - break; - case 'discount_invalid_code': - $this->add_notice( array( - 'id' => 'edd-discount-invalid-code', - 'message' => __( 'The discount code entered is invalid; only alphanumeric characters are allowed, please try again.', 'easy-digital-downloads' ), - 'class' => 'error' - ) ); - break; - case 'discount_invalid_amount' : - $this->add_notice( array( - 'id' => 'edd-discount-invalid-amount', - 'message' => __( 'The discount amount must be a valid percentage or numeric flat amount. Please try again.', 'easy-digital-downloads' ), - 'class' => 'error' - ) ); - break; - case 'discount_deleted': - $this->add_notice( array( - 'id' => 'edd-discount-deleted', - 'message' => __( 'Discount code deleted.', 'easy-digital-downloads' ) - ) ); - break; - case 'discount_delete_failed': - $this->add_notice( array( - 'id' => 'edd-discount-delete-fail', - 'message' => __( 'There was a problem deleting that discount code, please try again.', 'easy-digital-downloads' ), - 'class' => 'error' - ) ); - break; - case 'discount_activated': - $this->add_notice( array( - 'id' => 'edd-discount-activated', - 'message' => __( 'Discount code activated.', 'easy-digital-downloads' ) - ) ); - break; - case 'discount_activation_failed': - $this->add_notice( array( - 'id' => 'edd-discount-activation-fail', - 'message' => __( 'There was a problem activating that discount code, please try again.', 'easy-digital-downloads' ), - 'class' => 'error' - ) ); - break; - case 'discount_deactivated': - $this->add_notice( array( - 'id' => 'edd-discount-deactivated', - 'message' => __( 'Discount code deactivated.', 'easy-digital-downloads' ) - ) ); - break; - case 'discount_deactivation_failed': - $this->add_notice( array( - 'id' => 'edd-discount-deactivation-fail', - 'message' => __( 'There was a problem deactivating that discount code, please try again.', 'easy-digital-downloads' ), - 'class' => 'error' - ) ); - break; - } - } - - // Shop reports errors - if ( current_user_can( 'view_shop_reports' ) ) { - switch( $notice ) { - case 'refreshed-reports' : - $this->add_notice( array( - 'id' => 'edd-refreshed-reports', - 'message' => __( 'The reports have been refreshed.', 'easy-digital-downloads' ) - ) ); - break; - } - } - - // Shop settings errors - if ( current_user_can( 'manage_shop_settings' ) ) { - switch( $notice ) { - case 'settings-imported' : - $this->add_notice( array( - 'id' => 'edd-settings-imported', - 'message' => __( 'The settings have been imported.', 'easy-digital-downloads' ) - ) ); - break; - case 'api-key-generated' : - $this->add_notice( array( - 'id' => 'edd-api-key-generated', - 'message' => __( 'API keys successfully generated.', 'easy-digital-downloads' ) - ) ); - break; - case 'api-key-exists' : - $this->add_notice( array( - 'id' => 'edd-api-key-exists', - 'message' => __( 'The specified user already has API keys.', 'easy-digital-downloads' ), - 'class' => 'error' - ) ); - break; - case 'api-key-regenerated' : - $this->add_notice( array( - 'id' => 'edd-api-key-regenerated', - 'message' => __( 'API keys successfully regenerated.', 'easy-digital-downloads' ) - ) ); - break; - case 'api-key-revoked' : - $this->add_notice( array( - 'id' => 'edd-api-key-revoked', - 'message' => __( 'API keys successfully revoked.', 'easy-digital-downloads' ) - ) ); - break; - case 'test-purchase-email-sent': - $this->add_notice( - array( - 'id' => 'edd-test-purchase-receipt-sent', - 'message' => __( 'The test email was sent successfully.', 'easy-digital-downloads' ) - ) - ); - break; - case 'test-summary-email-sent': - $this->add_notice( - array( - 'id' => 'edd-test-summary-email-sent', - 'message' => __( 'The test email summary was sent successfully.', 'easy-digital-downloads' ) - ) - ); - break; - - case 'missing-pass-key': - $this->add_notice( - array( - 'id' => 'edd-missing-pass-key', - 'message' => __( 'Your extensions could not be refreshed because you have not verified your license key.', 'easy-digital-downloads' ), - 'class' => 'error', - ) - ); - break; - } - } - - // Shop payments errors - if ( current_user_can( 'edit_shop_payments' ) ) { - switch( $notice ) { - case 'note-added' : - $this->add_notice( array( - 'id' => 'edd-note-added', - 'message' => __( 'The note has been added successfully.', 'easy-digital-downloads' ) - ) ); - break; - case 'payment-updated' : - $this->add_notice( array( - 'id' => 'edd-payment-updated', - 'message' => __( 'The order has been updated successfully.', 'easy-digital-downloads' ) - ) ); - break; - case 'order_added' : - $this->add_notice( array( - 'id' => 'edd-order-added', - 'message' => __( 'Order successfully created.', 'easy-digital-downloads' ) - ) ); - break; - case 'order_trashed' : - $this->add_notice( array( - 'id' => 'edd-order-trashed', - 'message' => __( 'The order has been moved to the trash.', 'easy-digital-downloads' ) - ) ); - break; - case 'order_restored' : - $this->add_notice( array( - 'id' => 'edd-order-restored', - 'message' => __( 'The order has been restored.', 'easy-digital-downloads' ) - ) ); - break; - case 'payment_deleted' : - $this->add_notice( array( - 'id' => 'edd-payment-deleted', - 'message' => __( 'The order has been deleted.', 'easy-digital-downloads' ) - ) ); - break; - case 'email_sent' : - $this->add_notice( array( - 'id' => 'edd-payment-sent', - 'message' => __( 'The purchase receipt has been resent.', 'easy-digital-downloads' ) - ) ); - break; - case 'email_send_failed': - $this->add_notice( array( - 'id' => 'edd-payment-sent', - 'message' => __( 'Failed to send purchase receipt.', 'easy-digital-downloads' ) - ) ); - break; - case 'payment-note-deleted' : - $this->add_notice( array( - 'id' => 'edd-note-deleted', - 'message' => __( 'The order note has been deleted.', 'easy-digital-downloads' ) - ) ); - break; - } - } - - // Customer Notices - if ( current_user_can( 'edit_shop_payments' ) ) { - switch( $notice ) { - case 'customer-deleted' : - $this->add_notice( array( - 'id' => 'edd-customer-deleted', - 'message' => __( 'Customer successfully deleted.', 'easy-digital-downloads' ), - ) ); - break; - case 'user-verified' : - $this->add_notice( array( - 'id' => 'edd-user-verified', - 'message' => __( 'User successfully verified.', 'easy-digital-downloads' ), - ) ); - break; - case 'email-added' : - $this->add_notice( array( - 'id' => 'edd-customer-email-added', - 'message' => __( 'Customer email added.', 'easy-digital-downloads' ), - ) ); - break; - case 'email-removed' : - $this->add_notice( array( - 'id' => 'edd-customer-email-removed', - 'message' => __( 'Customer email deleted.', 'easy-digital-downloads' ), - ) ); - break; - case 'email-remove-failed' : - $this->add_notice( array( - 'id' => 'edd-customer-email-remove-failed', - 'message' => __( 'Failed to delete customer email.', 'easy-digital-downloads' ), - 'class' => 'error', - ) ); - break; - case 'primary-email-updated' : - $this->add_notice( array( - 'id' => 'eddedd-customer-primary-email-updated', - 'message' => __( 'Primary email updated for customer.', 'easy-digital-downloads' ) - ) ); - break; - case 'primary-email-failed' : - $this->add_notice( array( - 'id' => 'edd-customer-primary-email-failed', - 'message' => __( 'Failed to set primary email.', 'easy-digital-downloads' ), - 'class' => 'error', - ) ); - break; - case 'address-removed' : - $this->add_notice( array( - 'id' => 'edd-customer-address-removed', - 'message' => __( 'Customer address deleted.', 'easy-digital-downloads' ) - ) ); - break; - case 'address-remove-failed' : - $this->add_notice( array( - 'id' => 'edd-customer-address-remove-failed', - 'message' => __( 'Failed to delete customer address.', 'easy-digital-downloads' ), - 'class' => 'error', - ) ); - break; - } - } - - if ( 'one-click-upgrade' === $notice && edd_is_pro() && current_user_can( 'install_plugins' ) && edd_is_admin_page( 'settings' ) ) { - $this->add_notice( - array( - 'id' => 'edd-upgraded', - 'message' => sprintf( - /* Translators: 1. opening strong tag, do not translate; 2. closing strong tag, do not translate */ - __( 'Congratulations! You are now running %1$sEasy Digital Downloads (Pro)%2$s.', 'easy-digital-downloads' ), - '', - '' - ), - ) - ); - } - } - - /** - * Show a notice if debugging is enabled in the EDD settings. - * Does not show if only the `EDD_DEBUG_MODE` constant is defined. - * - * @since 2.11.5 - * @return void - */ - private function show_debugging_notice() { - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { - return; - } - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - if ( ! edd_get_option( 'debug_mode', false ) ) { - return; - } - - /** - * The notices JS needs to be output wherever the notice is displayed, not just EDD screens. - * If more notices add to the script then this enqueue will need to be moved. - * - * @since 3.0 - */ - wp_enqueue_script( 'edd-admin-notices', EDD_PLUGIN_URL . 'assets/js/edd-admin-notices.js', array( 'jquery' ), EDD_VERSION, true ); - $view_url = add_query_arg( - array( - 'post_type' => 'download', - 'page' => 'edd-tools', - 'tab' => 'debug_log', - ), - admin_url( 'edit.php' ) - ); - ?> -

-

- -

-

- - - -

-
- clear_log_file(); - wp_send_json_success( wpautop( __( 'The debug log has been cleared and logging has been disabled.', 'easy-digital-downloads' ) ) ); - } - - /** - * Escape message string output - * - * @since 2.6.0 bbPress (r6775) - * - * @param string $message - * - * @return string - */ - private function esc_notice( $message = '' ) { - $tags = wp_kses_allowed_html( 'post' ); - $text = wp_kses( $message, $tags ); - - return $text; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/class-list-table.php b/wp-content/plugins/easy-digital-downloads/includes/admin/class-list-table.php deleted file mode 100644 index efb5e4b5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/class-list-table.php +++ /dev/null @@ -1,244 +0,0 @@ - 0 - ); - - /** - * Get a request var, or return the default if not set. - * - * @since 3.0 - * - * @param string $var - * @param mixed $default - * @return mixed Un-sanitized request var - */ - public function get_request_var( $var = '', $default = false ) { - return isset( $_REQUEST[ $var ] ) - ? $_REQUEST[ $var ] - : $default; - } - - /** - * Get a status request var, if set. - * - * @since 3.0 - * - * @param mixed $default - * @return string - */ - protected function get_status( $default = '' ) { - return sanitize_key( $this->get_request_var( 'status', $default ) ); - } - - /** - * Retrieve the current page number. - * - * @since 3.0 - * - * @return int Current page number. - */ - protected function get_paged() { - return absint( $this->get_request_var( 'paged', 1 ) ); - } - - /** - * Retrieve the current page number. - * - * @since 3.0 - * - * @return int Current page number. - */ - protected function get_search() { - return urldecode( trim( $this->get_request_var( 's', '' ) ) ); - } - - /** - * Retrieves the data to be populated into the list table. - * - * @since 3.0 - * - * @return array Array of list table data. - */ - abstract public function get_data(); - - /** - * Retrieve the view types - * - * @since 1.4 - * - * @return array $views All the views available - */ - public function get_views() { - - // Get the current status - $current = $this->get_status(); - - // Args to remove - $remove = array( 'edd-message', 'status', 'paged', '_wpnonce' ); - - // Base URL - $url = remove_query_arg( $remove, $this->get_base_url() ); - - // Is all selected? - $class = in_array( $current, array( '', 'all' ), true ) - ? ' class="current"' - : ''; - - // All - $count = ' (' . esc_attr( $this->counts['total'] ) . ')'; - $label = __( 'All', 'easy-digital-downloads' ) . $count; - $views = array( - 'all' => sprintf( '%s', esc_url( $url ), $class, $label ), - ); - - // Remove total from counts array - $counts = $this->counts; - unset( $counts['total'] ); - - // Loop through statuses. - if ( ! empty( $counts ) ) { - foreach ( $counts as $status => $count ) { - $count_url = add_query_arg( array( - 'status' => sanitize_key( $status ), - 'paged' => false, - ), $url ); - - $class = ( $current === $status ) - ? ' class="current"' - : ''; - - $count = ' (' . absint( $this->counts[ $status ] ) . ')'; - - $label = edd_get_status_label( $status ) . $count; - $views[ $status ] = sprintf( '%s', esc_url( $count_url ), $class, $label ); - } - } - - return $views; - } - - /** - * Parse pagination query arguments into keys & values that the Query class - * can understand and use to retrieve the correct results from the database. - * - * @since 3.0 - * - * @param array $args - * - * @return array - */ - public function parse_pagination_args( $args = array() ) { - - // Get pagination values - $order = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'DESC'; // WPCS: CSRF ok. - $orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'id'; // WPCS: CSRF ok. - $paged = $this->get_paged(); - - // Only perform paged math if numeric and greater than 1 - if ( ! empty( $paged ) && is_numeric( $paged ) && ( $paged > 1 ) ) { - $offset = ceil( $this->per_page * ( $paged - 1 ) ); - - // Otherwise, default to the first page of results - } else { - $offset = 0; - } - - // Parse pagination args into passed args - $r = wp_parse_args( $args, array( - 'number' => $this->per_page, - 'offset' => $offset, - 'order' => $order, - 'orderby' => $orderby - ) ); - - // Return args - return array_filter( $r ); - } - - /** - * Show the search field. - * - * @since 3.0 - * - * @param string $text Label for the search box - * @param string $input_id ID of the search box - */ - public function search_box( $text, $input_id ) { - - // Bail if no customers and no search - if ( ! $this->get_search() && ! $this->has_items() ) { - return; - } - - $orderby = $this->get_request_var( 'orderby' ); - $order = $this->get_request_var( 'order' ); - $input_id = $input_id . '-search-input'; - - if ( ! empty( $orderby ) ) { - echo ''; - } - - if ( ! empty( $order ) ) { - echo ''; - } - - ?> - - - - add_section( array( - 'id' => 'general', - 'label' => esc_html__( 'General', 'easy-digital-downloads' ), - 'callback' => array( $this, 'section_general' ) - ) ); - } elseif ( count( $sections ) ) { - foreach ( $sections as $section ) { - $this->add_section( $section ); - } - } - } - - /** - * Setup the sections for the current item - * - * @since 3.0 - * - * @param object $item - */ - public function set_item( $item = false ) { - $this->item = $item; - } - - /** - * Output the contents - * - * @since 3.0 - */ - public function display() { - $use_js = ! empty( $this->use_js ) - ? ' use-js' - : ''; - $role = $this->use_js ? 'tablist' : 'menu'; - - ob_start(); ?> - -
-
-
    - get_all_section_links(); ?> -
- -
- get_all_section_contents(); ?> -
-
-
- nonce_field(); - - if ( ! empty( $this->item ) ) : ?> - - - - -
- - sections[] = (object) wp_parse_args( $section, array( - 'id' => '', - 'label' => '', - 'icon' => 'admin-settings', - 'callback' => '' - ) ); - } - - /** - * Is a section the current section? - * - * @since 3.0 - * - * @param string $section_id - * - * @return bool - */ - private function is_current_section( $section_id = '' ) { - return ( $section_id === $this->current_section ); - } - - /** - * Output the nonce field for the meta box - * - * @since 3.0 - */ - protected function nonce_field() { - wp_nonce_field( - 'edd_' . $this->id . '_sections_nonce', - 'edd_' . $this->id . 'nonce_sections', - true - ); - } - - /** - * Get all section links - * - * @since 3.0 - * - * @return string - */ - protected function get_all_section_links() { - ob_start(); - - // Loop through sections - foreach ( $this->sections as $section ) : - - $url = $this->use_js - ? '#' . esc_attr( $this->id . $section->id ) - : add_query_arg( 'view', sanitize_key( $section->id ), $this->base_url ); - - // Special selected section - $selected = ! $this->use_js && $this->is_current_section( $section->id ) - ? 'aria-current="true"' - : ''; - $class = $this->is_current_section( $section->id ) ? 'section-title section-title--is-active' : 'section-title'; - $aria_attributes = $this->use_js ? 'role="tab" aria-controls="' . esc_attr( $this->id . $section->id ) . '"' : 'role="menuitem"'; - ?> - -
  • > - - - label; // Allow HTML ?> - -
  • - - use_js ) - ? wp_filter_object_list( $this->sections, array( 'id' => $this->current_section ) ) - : $this->sections; - - // Bail if no sections - if ( empty( $sections ) ) { - return; - } - - // Loop through sections - foreach ( $sections as $section ) : - - // Special selected section - $selected = ! $this->is_current_section( $section->id ) - ? 'style="display: none;"' - : ''; ?> - -
    >callback ) ) { - if ( is_callable( $section->callback ) ) { - call_user_func( $section->callback, $this->item ); - - } elseif ( is_array( $section->callback ) && is_callable( $section->callback[0] ) ) { - isset( $section->callback[1] ) - ? call_user_func_array( $section->callback[0], $section->callback[1] ) - : call_user_func_array( $section->callback[0], array() ); - - } else { - _e( 'Invalid section', 'easy-digital-downloads' ); - } - } else { - die; - do_action( 'edd_' . $section->id . 'section_contents', $this ); - } - - ?>
    - - - - - - - - - - - -
    - - - — -
    - - 'address', - 'plural' => 'addresses', - 'ajax' => false - ) ); - - $this->process_bulk_action(); - $this->get_counts(); - } - - /** - * Gets the name of the primary column. - * - * @since 2.5 - * @access protected - * - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'address'; - } - - /** - * This function renders most of the columns in the list table. - * - * @since 3.0 - * - * @param array $item Contains all the data of the customers - * @param string $column_name The name of the column - * - * @return string Column Name - */ - public function column_default( $item, $column_name ) { - switch ( $column_name ) { - - case 'type' : - $value = edd_get_address_type_label( $item['type'] ); - if ( ! empty( $item['is_primary'] ) ) { - $value .= '  ' . esc_html__( 'Primary', 'easy-digital-downloads' ) . ''; - } - break; - - case 'date_created' : - $value = ''; - break; - - default: - $value = ! empty( $item[ $column_name ] ) - ? esc_html( $item[ $column_name ] ) - : '—'; - break; - } - - // Filter & return - return apply_filters( 'edd_customers_column_' . $column_name, $value, $item['id'] ); - } - - /** - * Return the contents of the "Name" column - * - * @since 3.0 - * - * @param array $item - * @return string - */ - public function column_address( $item ) { - $state = $extra = ''; - $status = $this->get_status(); - $address = ! empty( $item['address'] ) ? $item['address'] : '—'; - $address2 = ! empty( $item['address2'] ) ? $item['address2'] : ''; - $city = ! empty( $item['city'] ) ? $item['city'] : ''; - $code = ! empty( $item['postal_code'] ) ? $item['postal_code'] : ''; - - // Address2 - if ( ! empty( $address2 ) ) { - $extra .= '
    ' . $address2; - } - - // City & Zip - if ( ! empty( $city ) || ! empty( $code ) ) { - $extra .= '
    ' . implode( ' ', array( $city, $code ) ); - } - - // Get the item status - $item_status = ! empty( $item['status'] ) - ? $item['status'] - : 'verified'; - - // Get the customer ID - $customer_id = ! empty( $item['customer_id'] ) - ? absint( $item['customer_id'] ) - : 0; - - // Link to customer - $customer_url = edd_get_admin_url( array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => absint( $customer_id ), - ) ); - - // State - if ( ( ! empty( $status ) && ( $status !== $item_status ) ) || ( $item_status !== 'active' ) ) { - switch ( $status ) { - case 'pending' : - $value = __( 'Pending', 'easy-digital-downloads' ); - break; - case 'verified' : - case '' : - default : - $value = __( 'Active', 'easy-digital-downloads' ); - break; - } - - $state = ' — ' . $value; - } - - // Concatenate and return - return '' . esc_html( $address ) . '' . esc_html( $state ) . '' . $extra . $this->row_actions( $this->get_row_actions( $item ) ); - } - - /** - * Gets the row actions for the customer address. - * - * @since 3.0 - * @param array $item - * @return array - */ - private function get_row_actions( $item ) { - // Link to customer - $customer_url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $item['customer_id'] ), - ) - ); - - // Actions - $actions = array( - 'view' => '' . esc_html__( 'View', 'easy-digital-downloads' ) . '' - ); - - if ( empty( $item['is_primary'] ) ) { - $delete_url = wp_nonce_url( edd_get_admin_url( array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $item['id'] ), - 'edd_action' => 'customer-remove-address' - ) ), 'edd-remove-customer-address' ); - $actions['delete'] = '' . esc_html__( 'Delete', 'easy-digital-downloads' ) . ''; - } - - /** - * Filter the customer address row actions. - * - * @since 3.0 - * @param array $actions The array of row actions. - * @param array $item The specific item (customer address). - */ - return apply_filters( 'edd_customer_address_row_actions', $actions, $item ); - } - - /** - * Return the contents of the "Name" column - * - * @since 3.0 - * - * @param array $item - * @return string - */ - public function column_customer( $item ) { - - // Get the customer ID - $customer_id = ! empty( $item['customer_id'] ) - ? absint( $item['customer_id'] ) - : 0; - - // Bail if no customer ID - if ( empty( $customer_id ) ) { - return '—'; - } - - // Try to get the customer - $customer = edd_get_customer( $customer_id ); - - // Bail if customer no longer exists - if ( empty( $customer ) ) { - return '—'; - } - - // Link to customer - $customer_url = edd_get_admin_url( array( - 'page' => 'edd-customers', - 'page_type' => 'physical', - 's' => 'c:' . absint( $customer_id ) - ) ); - - // Concatenate and return - return '' . esc_html( $customer->name ) . ''; - } - - /** - * Render the checkbox column - * - * @access public - * @since 3.0 - * - * @param array $item Address object. - * - * @return string Displays a checkbox - */ - public function column_cb( $item ) { - $customer = edd_get_customer_by( 'id', $item['customer_id'] ); - $name = sprintf( - /* translators: customer address id */ - __( 'Address ID: %s', 'easy-digital-downloads' ), - $item['id'] - ); - if ( ! empty( $customer->name ) ) { - $name = $customer->name; - } - return sprintf( - '', - /*$1%s*/ 'customer', - /*$2%s*/ esc_attr( $item['id'] ), - /* translators: customer name or address id */ - esc_html( sprintf( __( 'Select %s', 'easy-digital-downloads' ), $name ) ) - ); - } - - /** - * Retrieve the customer counts - * - * @access public - * @since 3.0 - * @return void - */ - public function get_counts() { - $this->counts = edd_get_customer_address_counts(); - } - - /** - * Retrieve the table columns - * - * @since 3.0 - * @return array $columns Array of all the list table columns - */ - public function get_columns() { - return apply_filters( 'edd_report_customer_columns', array( - 'cb' => '', - 'address' => __( 'Address', 'easy-digital-downloads' ), - 'region' => __( 'Region', 'easy-digital-downloads' ), - 'country' => __( 'Country', 'easy-digital-downloads' ), - 'customer' => __( 'Customer', 'easy-digital-downloads' ), - 'type' => __( 'Type', 'easy-digital-downloads' ), - 'date_created' => __( 'Date', 'easy-digital-downloads' ) - ) ); - } - - /** - * Get the sortable columns - * - * @since 2.1 - * @return array Array of all the sortable columns - */ - public function get_sortable_columns() { - return array( - 'date_created' => array( 'date_created', true ), - 'address' => array( 'address', false ), - 'region' => array( 'region', true ), - 'country' => array( 'country', true ), - 'customer' => array( 'customer_id', false ), - 'type' => array( 'type', false ) - ); - } - - /** - * Retrieve the bulk actions - * - * @access public - * @since 3.0 - * @return array Array of the bulk actions - */ - public function get_bulk_actions() { - return array( - 'delete' => __( 'Delete', 'easy-digital-downloads' ) - ); - } - - /** - * Process the bulk actions - * - * @access public - * @since 3.0 - */ - public function process_bulk_action() { - if ( empty( $_REQUEST['_wpnonce'] ) ) { - return; - } - - if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-addresses' ) ) { - return; - } - - $ids = isset( $_GET['customer'] ) - ? $_GET['customer'] - : false; - - if ( ! is_array( $ids ) ) { - $ids = array( $ids ); - } - - foreach ( $ids as $id ) { - switch ( $this->current_action() ) { - case 'delete' : - edd_delete_customer_address( $id ); - break; - } - } - } - - /** - * Get all of the items to display, given the current filters - * - * @since 3.0 - * - * @return array $data All the row data - */ - public function get_data() { - $data = array(); - $search = $this->get_search(); - $args = array( 'status' => $this->get_status() ); - - // Customer ID - if ( strpos( $search, 'c:' ) !== false ) { - $args['customer_id'] = trim( str_replace( 'c:', '', $search ) ); - - // Country - } elseif ( strpos( $search, 'country:' ) !== false ) { - $search = substr( $search, strlen( 'country:' ) ); - $args['search'] = $search; - $args['search_columns'] = array( 'country' ); - - // Zip - } elseif ( strpos( $search, 'zip:' ) !== false ) { - $search = substr( $search, strlen( 'zip:' ) ); - $args['search'] = $search; - $args['search_columns'] = array( 'zip' ); - - // Region - } elseif ( strpos( $search, 'region:' ) !== false ) { - $search = substr( $search, strlen( 'region:' ) ); - $args['search'] = $search; - $args['search_columns'] = array( 'region' ); - - // City - } elseif ( strpos( $search, 'city:' ) !== false ) { - $search = substr( $search, strlen( 'city:' ) ); - $args['search'] = $search; - $args['search_columns'] = array( 'city' ); - - // Any... - } else { - $args['search'] = $search; - $args['search_columns'] = array( 'address', 'address2', 'city', 'region', 'country', 'postal_code' ); - } - - // Parse pagination - $this->args = $this->parse_pagination_args( $args ); - - // Get the data - $addresses = edd_get_customer_addresses( $this->args ); - - if ( ! empty( $addresses ) ) { - foreach ( $addresses as $address ) { - $data[] = array( - 'id' => $address->id, - 'customer_id' => $address->customer_id, - 'status' => $address->status, - 'type' => $address->type, - 'address' => $address->address, - 'address2' => $address->address2, - 'city' => $address->city, - 'region' => $address->region, - 'postal_code' => $address->postal_code, - 'country' => $address->country, - 'date_created' => $address->date_created, - 'date_modified' => $address->date_modified, - 'is_primary' => $address->is_primary, - ); - } - } - - return $data; - } - - /** - * Setup the final data for the table - * - * @since 3.0 - * @return void - */ - public function prepare_items() { - $this->_column_headers = array( - $this->get_columns(), - array(), - $this->get_sortable_columns() - ); - - $this->items = $this->get_data(); - - $status = $this->get_status( 'total' ); - - // Setup pagination - $this->set_pagination_args( array( - 'total_pages' => ceil( $this->counts[ $status ] / $this->per_page ), - 'total_items' => $this->counts[ $status ], - 'per_page' => $this->per_page - ) ); - } - - /** - * Generate the table navigation above or below the table. - * We're overriding this to turn off the referer param in `wp_nonce_field()`. - * - * @param string $which - * @since 3.1.0.4 - */ - protected function display_tablenav( $which ) { - if ( 'top' === $which ) { - wp_nonce_field( 'bulk-' . $this->_args['plural'], '_wpnonce', false ); - } - ?> -
    - - has_items() ) : ?> -
    - bulk_actions( $which ); ?> -
    - extra_tablenav( $which ); - $this->pagination( $which ); - ?> - -
    -
    - 'email', - 'plural' => 'emails', - 'ajax' => false - ) ); - - $this->process_bulk_action(); - $this->get_counts(); - } - - /** - * Gets the name of the primary column. - * - * @since 2.5 - * @access protected - * - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'email'; - } - - /** - * This function renders most of the columns in the list table. - * - * @since 3.0 - * - * @param array $item Contains all the data of the customers - * @param string $column_name The name of the column - * - * @return string Column Name - */ - public function column_default( $item, $column_name ) { - switch ( $column_name ) { - - case 'id' : - $value = $item['id']; - break; - - case 'email' : - $value = '' . esc_html( $item['email'] ) . ''; - break; - - case 'type' : - $value = ( 'primary' === $item['type'] ) - ? esc_html__( 'Primary', 'easy-digital-downloads' ) - : esc_html__( 'Secondary', 'easy-digital-downloads' ); - break; - - case 'date_created' : - $value = ''; - break; - - default: - $value = isset( $item[ $column_name ] ) - ? $item[ $column_name ] - : null; - break; - } - - // Filter & return - return apply_filters( 'edd_customers_column_' . $column_name, $value, $item['id'] ); - } - - /** - * Return the contents of the "Name" column - * - * @since 3.0 - * - * @param array $item - * @return string - */ - public function column_email( $item ) { - $state = ''; - $status = $this->get_status(); - $email = ! empty( $item['email'] ) ? $item['email'] : '—'; - - // Get the item status - $item_status = ! empty( $item['status'] ) - ? $item['status'] - : 'verified'; - - // Get the customer ID - $customer_id = ! empty( $item['customer_id'] ) - ? absint( $item['customer_id'] ) - : 0; - - // Link to customer - $customer_url = edd_get_admin_url( array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => absint( $customer_id ), - ) ); - - // State - if ( ( ! empty( $status ) && ( $status !== $item_status ) ) || ( $item_status !== 'active' ) ) { - switch ( $status ) { - case 'pending' : - $value = __( 'Pending', 'easy-digital-downloads' ); - break; - case 'verified' : - case '' : - default : - $value = __( 'Active', 'easy-digital-downloads' ); - break; - } - - $state = ' — ' . $value; - } - - // Concatenate and return - return '' . esc_html( $email ) . '' . esc_html( $state ) . '' . $this->row_actions( $this->get_row_actions( $item ) ); - } - - /** - * Gets the row actions for the customer email address. - * - * @since 3.0 - * @param array $item - * @return array - */ - private function get_row_actions( $item ) { - // Link to customer - $customer_url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $item['customer_id'] ), - ) - ); - - // Actions - $actions = array( - 'view' => '' . __( 'View', 'easy-digital-downloads' ) . '', - ); - - // Non-primary email actions - if ( ! empty( $item['email'] ) && ( empty( $item['type'] ) || 'primary' !== $item['type'] ) ) { - $delete_url = wp_nonce_url( edd_get_admin_url( array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $item['customer_id'] ), - 'email' => rawurlencode( $item['email'] ), - 'edd_action' => 'customer-remove-email', - ) ), 'edd-remove-customer-email' ); - $actions['delete'] = '' . esc_html__( 'Delete', 'easy-digital-downloads' ) . ''; - } - - /** - * Filter the customer email address row actions. - * - * @since 3.0 - * @param array $actions The array of row actions. - * @param array $item The specific item (customer email address). - */ - return apply_filters( 'edd_customer_email_address_row_actions', $actions, $item ); - } - - /** - * Return the contents of the "Name" column - * - * @since 3.0 - * - * @param array $item - * @return string - */ - public function column_customer( $item ) { - - // Get the customer ID - $customer_id = ! empty( $item['customer_id'] ) - ? absint( $item['customer_id'] ) - : 0; - - // Bail if no customer ID - if ( empty( $customer_id ) ) { - return '—'; - } - - // Try to get the customer - $customer = edd_get_customer( $customer_id ); - - // Bail if customer no longer exists - if ( empty( $customer ) ) { - return '—'; - } - - // Link to customer - $customer_url = edd_get_admin_url( array( - 'page' => 'edd-customers', - 'page_type' => 'emails', - 's' => 'c:' . absint( $customer_id ) - ) ); - - // Concatenate and return - return '' . esc_html( $customer->name ) . ''; - } - - /** - * Render the checkbox column - * - * @access public - * @since 3.0 - * - * @param array $item - * - * @return string Displays a checkbox - */ - public function column_cb( $item ) { - $is_primary = ! empty( $item['type'] ) && 'primary' === $item['type']; - $primary_attributes = $is_primary ? ' disabled' : ''; - $title = $is_primary ? __( 'Primary email addresses cannot be deleted.', 'easy-digital-downloads' ) : ''; - - return sprintf( - '', - /*$1%s*/ esc_attr( 'customer' ), - /*$2%s*/ esc_attr( $item['id'] ), - /* translators: customer email */ - esc_html( sprintf( __( 'Select %s', 'easy-digital-downloads' ), $item['email'] ) ), - /*$4%s*/ esc_attr( $title ), - /*$5%s*/ $primary_attributes - ); - } - - /** - * Retrieve the customer counts - * - * @access public - * @since 3.0 - * @return void - */ - public function get_counts() { - $this->counts = edd_get_customer_email_address_counts(); - } - - /** - * Retrieve the table columns - * - * @since 3.0 - * @return array $columns Array of all the list table columns - */ - public function get_columns() { - return apply_filters( 'edd_report_customer_columns', array( - 'cb' => '', - 'email' => __( 'Email', 'easy-digital-downloads' ), - 'customer' => __( 'Customer', 'easy-digital-downloads' ), - 'type' => __( 'Type', 'easy-digital-downloads' ), - 'date_created' => __( 'Date', 'easy-digital-downloads' ) - ) ); - } - - /** - * Get the sortable columns - * - * @since 2.1 - * @return array Array of all the sortable columns - */ - public function get_sortable_columns() { - return array( - 'date_created' => array( 'date_created', true ), - 'email' => array( 'email', true ), - 'customer' => array( 'customer_id', false ), - 'type' => array( 'type', false ) - ); - } - - /** - * Retrieve the bulk actions - * - * @access public - * @since 3.0 - * @return array Array of the bulk actions - */ - public function get_bulk_actions() { - return array( - 'delete' => __( 'Delete', 'easy-digital-downloads' ) - ); - } - - /** - * Process the bulk actions - * - * @access public - * @since 3.0 - */ - public function process_bulk_action() { - if ( empty( $_REQUEST['_wpnonce'] ) ) { - return; - } - - if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-emails' ) ) { - return; - } - - $ids = isset( $_GET['customer'] ) - ? $_GET['customer'] - : false; - - if ( ! is_array( $ids ) ) { - $ids = array( $ids ); - } - - /* - * Only non-primary email addresses can be deleted, so we're building up a safelist using the provided - * IDs. Each ID will be matched against this prior to deletion. - */ - $non_primary_address_ids = edd_get_customer_email_addresses( array( - 'id__in' => $ids, - 'type__not_in' => array( 'primary' ), - 'fields' => 'id' - ) ); - - foreach ( $ids as $id ) { - switch ( $this->current_action() ) { - case 'delete' : - if ( in_array( $id, $non_primary_address_ids ) ) { - edd_delete_customer_email_address( $id ); - } - break; - } - } - } - - /** - * Get all of the items to display, given the current filters - * - * @since 3.0 - * - * @return array $data All the row data - */ - public function get_data() { - $data = array(); - $search = $this->get_search(); - $args = array( 'status' => $this->get_status() ); - - // Account for search stripping the "+" from emails. - if ( strpos( $search, ' ' ) ) { - $original_query = $search; - $search = str_replace( ' ', '+', $search ); - if ( ! is_email( $search ) ) { - $search = $original_query; - } - } - - // Email. - if ( is_email( $search ) ) { - $args['email'] = $search; - - // Address ID. - } elseif ( is_numeric( $search ) ) { - $args['id'] = $search; - - // Customer ID. - } elseif ( strpos( $search, 'c:' ) !== false ) { - $args['customer_id'] = trim( str_replace( 'c:', '', $search ) ); - - // Any... - } else { - $args['search'] = $search; - $args['search_columns'] = array( 'email' ); - } - - // Parse pagination. - $this->args = $this->parse_pagination_args( $args ); - - // Get the data. - $emails = edd_get_customer_email_addresses( $this->args ); - - if ( ! empty( $emails ) ) { - foreach ( $emails as $customer ) { - $data[] = array( - 'id' => $customer->id, - 'email' => $customer->email, - 'customer_id' => $customer->customer_id, - 'status' => $customer->status, - 'type' => $customer->type, - 'date_created' => $customer->date_created, - ); - } - } - - return $data; - } - - /** - * Setup the final data for the table - * - * @since 3.0 - * @return void - */ - public function prepare_items() { - $this->_column_headers = array( - $this->get_columns(), - array(), - $this->get_sortable_columns() - ); - - $this->items = $this->get_data(); - - $status = $this->get_status( 'total' ); - - // Setup pagination - $this->set_pagination_args( array( - 'total_pages' => ceil( $this->counts[ $status ] / $this->per_page ), - 'total_items' => $this->counts[ $status ], - 'per_page' => $this->per_page - ) ); - } - - /** - * Generate the table navigation above or below the table. - * We're overriding this to turn off the referer param in `wp_nonce_field()`. - * - * @param string $which - * @since 3.1.0.4 - */ - protected function display_tablenav( $which ) { - if ( 'top' === $which ) { - wp_nonce_field( 'bulk-' . $this->_args['plural'], '_wpnonce', false ); - } - ?> -
    - - has_items() ) : ?> -
    - bulk_actions( $which ); ?> -
    - extra_tablenav( $which ); - $this->pagination( $which ); - ?> - -
    -
    - 'customer', - 'plural' => 'customers', - 'ajax' => false - ) ); - - $this->process_bulk_action(); - $this->get_counts(); - } - - /** - * Gets the name of the primary column. - * - * @since 2.5 - * @access protected - * - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'name'; - } - - /** - * This function renders most of the columns in the list table. - * - * @since 1.5 - * - * @param array $item Contains all the data of the customers - * @param string $column_name The name of the column - * - * @return string Column Name - */ - public function column_default( $item, $column_name ) { - - $timezone_abbreviation = edd_get_timezone_abbr(); - - switch ( $column_name ) { - - case 'id' : - $value = esc_html( $item['id'] ); - break; - - case 'email' : - $value = '' . esc_html( $item['email'] ) . ''; - break; - - case 'order_count' : - $url = edd_get_admin_url( array( - 'page' => 'edd-payment-history', - 'customer' => rawurlencode( $item['id'] ), - ) ); - $value = '' . esc_html( number_format_i18n( $item['order_count'] ) ) . ''; - break; - - case 'spent' : - $value = edd_currency_filter( edd_format_amount( $item[ $column_name ] ) ); - break; - - case 'date_created' : - $value = ''; - break; - - default: - $value = isset( $item[ $column_name ] ) - ? esc_html( $item[ $column_name ] ) - : null; - break; - } - - // Filter & return - return apply_filters( 'edd_customers_column_' . esc_attr( $column_name ), $value, $item['id'] ); - } - - /** - * Return the contents of the "Name" column - * - * @since 3.0 - * - * @param array $item - * @return string - */ - public function column_name( $item ) { - $state = ''; - $status = $this->get_status(); - $name = ! empty( $item['name'] ) ? $item['name'] : '—'; - - $item_status = ! empty( $item['status'] ) - ? $item['status'] - : 'active'; - - // State - if ( ( ! empty( $status ) && ( $status !== $item_status ) ) || ( $item_status !== 'active' ) ) { - switch ( $status ) { - case 'pending' : - $value = __( 'Pending', 'easy-digital-downloads' ); - break; - case 'active' : - case '' : - default : - $value = __( 'Active', 'easy-digital-downloads' ); - break; - } - - $state = ' — ' . $value; - } - - // Get the customer's avatar - $avatar = get_avatar( $item['email'], 32 ); - - // View URL - $view_url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $item['id'] ), - ) - ); - - // Concatenate and return - return $avatar . '' . esc_html( $name ) . '' . esc_html( $state ) . '' . $this->row_actions( $this->get_row_actions( $item ) ); - } - - /** - * Gets the row actions for the customer. - * - * @since 3.0 - * @param array $item - * @return array - */ - private function get_row_actions( $item ) { - $view_url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $item['id'] ), - ) - ); - $logs_url = edd_get_admin_url( - array( - 'page' => 'edd-tools', - 'tab' => 'logs', - 'customer' => urlencode( $item['id'] ), - ) - ); - $delete_url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'delete', - 'id' => urlencode( $item['id'] ), - ) - ); - $actions = array( - 'view' => '' . __( 'Edit', 'easy-digital-downloads' ) . '', - 'logs' => '' . __( 'Logs', 'easy-digital-downloads' ) . '', - 'delete' => '' . __( 'Delete', 'easy-digital-downloads' ) . '', - ); - - /** - * Filter the customer row actions. - * - * @since 3.0 - * @param array $actions The array of row actions. - * @param array $item The specific item (customer). - */ - return apply_filters( 'edd_customer_row_actions', $actions, $item ); - } - - /** - * Render the checkbox column - * - * @since 3.0 - * - * @param array $item Customer data. - * - * @return string Displays a checkbox - */ - public function column_cb( $item ) { - $name = empty( $item['name'] ) ? $item['email'] : $item['name']; - - return sprintf( - '', - /*$1%s*/ 'customer', - /*$2%s*/ esc_attr( $item['id'] ), - /* translators: customer name or email */ - esc_html( sprintf( __( 'Select %s', 'easy-digital-downloads' ), $name ) ) - ); - } - - /** - * Retrieve the customer counts - * - * @since 3.0 - * @return void - */ - public function get_counts() { - $this->counts = edd_get_customer_counts(); - } - - /** - * Retrieve the table columns - * - * @since 1.5 - * @return array $columns Array of all the list table columns - */ - public function get_columns() { - return apply_filters( 'edd_report_customer_columns', array( - 'cb' => '', - 'name' => __( 'Name', 'easy-digital-downloads' ), - 'email' => __( 'Email', 'easy-digital-downloads' ), - 'order_count' => __( 'Orders', 'easy-digital-downloads' ), - 'spent' => __( 'Spent', 'easy-digital-downloads' ), - 'date_created' => __( 'Date', 'easy-digital-downloads' ) - ) ); - } - - /** - * Get the sortable columns - * - * @since 2.1 - * @return array Array of all the sortable columns - */ - public function get_sortable_columns() { - return array( - 'date_created' => array( 'date_created', true ), - 'name' => array( 'name', true ), - 'email' => array( 'email', true ), - 'order_count' => array( 'purchase_count', false ), - 'spent' => array( 'purchase_value', false ) - ); - } - - /** - * Retrieve the bulk actions - * - * @since 3.0 - * @return array Array of the bulk actions - */ - public function get_bulk_actions() { - return array( - 'delete' => __( 'Delete', 'easy-digital-downloads' ) - ); - } - - /** - * Process the bulk actions - * - * @since 3.0 - */ - public function process_bulk_action() { - if ( empty( $_REQUEST['_wpnonce'] ) ) { - return; - } - - if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-customers' ) ) { - return; - } - - check_admin_referer( 'bulk-customers' ); - - $ids = isset( $_GET['customer'] ) - ? $_GET['customer'] - : false; - - if ( ! is_array( $ids ) ) { - $ids = array( $ids ); - } - - foreach ( $ids as $id ) { - switch ( $this->current_action() ) { - case 'delete' : - edd_delete_customer( $id ); - break; - } - } - } - - /** - * Builds and retrieves all the reports data. - * - * @since 1.5 - * @deprecated 3.0 Use get_data() - * - * @return array All the data for customer reports. - */ - public function reports_data() { - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Customer_Reports_Table::get_data()' ); - - return $this->get_data(); - } - - /** - * Retrieves all of the items to display, given the current filters. - * - * @since 3.0 - * - * @return array $data All the row data. - */ - public function get_data() { - $data = array(); - $search = $this->get_search(); - $args = array( 'status' => $this->get_status() ); - - // Account for search stripping the "+" from emails. - if ( strpos( $search, ' ' ) ) { - $original_query = $search; - $search = str_replace( ' ', '+', $search ); - if ( ! is_email( $search ) ) { - $search = $original_query; - } - } - - // Email search. - if ( is_email( $search ) ) { - $args['email'] = $search; - - // Customer ID. - } elseif ( is_numeric( $search ) ) { - $args['id'] = $search; - } elseif ( strpos( $search, 'c:' ) !== false ) { - $args['id'] = trim( str_replace( 'c:', '', $search ) ); - - // User ID. - } elseif ( strpos( $search, 'user:' ) !== false ) { - $args['user_id'] = trim( str_replace( 'u:', '', $search ) ); - } elseif ( strpos( $search, 'u:' ) !== false ) { - $args['user_id'] = trim( str_replace( 'u:', '', $search ) ); - - // Other... - } else { - $args['search'] = $search; - $args['search_columns'] = array( 'name', 'email' ); - } - - // Parse pagination - $this->args = $this->parse_pagination_args( $args ); - - if ( is_email( $search ) ) { - $customer_emails = new EDD\Database\Queries\Customer_Email_Address(); - $customer_ids = $customer_emails->query( - array( - 'fields' => 'customer_id', - 'email' => $search, - ) - ); - - $customers = edd_get_customers( - array( - 'id__in' => $customer_ids, - ) - ); - } else { - $customers = edd_get_customers( $this->args ); - } - - // Get the data - if ( ! empty( $customers ) ) { - foreach ( $customers as $customer ) { - $data[] = array( - 'id' => $customer->id, - 'user_id' => $customer->user_id, - 'name' => $customer->name, - 'email' => $customer->email, - 'order_count' => $customer->purchase_count, - 'spent' => $customer->purchase_value, - 'date_created' => $customer->date_created, - ); - } - } - - return $data; - } - - /** - * Setup the final data for the table - * - * @since 1.5 - * @return void - */ - public function prepare_items() { - $this->_column_headers = array( - $this->get_columns(), - array(), - $this->get_sortable_columns() - ); - - $this->items = $this->get_data(); - - $status = $this->get_status( 'total' ); - - // Add condition to be sure we don't divide by zero. - // If $this->per_page is 0, then set total pages to 1. - $total_pages = $this->per_page ? ceil( (int) $this->counts[ $status ] / (int) $this->per_page ) : 1; - - // Setup pagination - $this->set_pagination_args( array( - 'total_pages' => $total_pages, - 'total_items' => $this->counts[ $status ], - 'per_page' => $this->per_page, - ) ); - } - - /** - * Generate the table navigation above or below the table. - * We're overriding this to turn off the referer param in `wp_nonce_field()`. - * - * @param string $which - * @since 3.1.0.4 - */ - protected function display_tablenav( $which ) { - if ( 'top' === $which ) { - wp_nonce_field( 'bulk-' . $this->_args['plural'], '_wpnonce', false ); - } - ?> -
    - - has_items() ) : ?> -
    - bulk_actions( $which ); ?> -
    - extra_tablenav( $which ); - $this->pagination( $which ); - ?> - -
    -
    - '', - 'email' => '', - 'date_created' => '', - 'user_id' => 0 - ) ); - - if ( ! is_email( $customer_info['email'] ) ) { - edd_set_error( 'edd-invalid-email', __( 'Please enter a valid email address.', 'easy-digital-downloads' ) ); - } - - if ( (int) $customer_info['user_id'] !== (int) $customer->user_id ) { - - // Make sure we don't already have this user attached to a customer - if ( ! empty( $customer_info['user_id'] ) && false !== edd_get_customer_by( 'user_id', $customer_info['user_id'] ) ) { - /* translators: %d: user ID */ - edd_set_error( 'edd-invalid-customer-user_id', sprintf( __( 'The User ID %d is already associated with a different customer.', 'easy-digital-downloads' ), $customer_info['user_id'] ) ); - } - - // Make sure it's actually a user - $user = get_user_by( 'id', $customer_info['user_id'] ); - if ( ! empty( $customer_info['user_id'] ) && false === $user ) { - /* translators: %d: user ID */ - edd_set_error( 'edd-invalid-user_id', sprintf( __( 'The User ID %d does not exist. Please assign an existing user.', 'easy-digital-downloads' ), $customer_info['user_id'] ) ); - } - } - - // Record this for later - $previous_user_id = $customer->user_id; - - // Bail if errors exist. - if ( edd_get_errors() ) { - return false; - } - - $user_id = absint( $customer_info['user_id'] ); - - if ( empty( $user_id ) && ! empty( $customer_info['user_login'] ) ) { - - // See if they gave an email, otherwise we'll assume login - $user_by_field = is_email( $customer_info['user_login'] ) - ? 'email' - : 'login'; - - $user = get_user_by( $user_by_field, $customer_info['user_login'] ); - - if ( $user ) { - $user_id = $user->ID; - } else { - /* translators: %s: user login or email address */ - edd_set_error( 'edd-invalid-user-string', sprintf( __( 'Failed to attach user. The login or email address %s was not found.', 'easy-digital-downloads' ), $customer_info['user_login'] ) ); - } - } - - // Setup the customer address, if present. - $address = array(); - - $address['address'] = isset( $customer_info['address'] ) - ? $customer_info['address'] - : ''; - - $address['address2'] = isset( $customer_info['address2'] ) - ? $customer_info['address2'] - : ''; - - $address['city'] = isset( $customer_info['city'] ) - ? $customer_info['city'] - : ''; - - $address['country'] = isset( $customer_info['country'] ) - ? $customer_info['country'] - : ''; - - $address['postal_code'] = isset( $customer_info['postal_code'] ) - ? $customer_info['postal_code'] - : ''; - - $address['region'] = isset( $customer_info['region'] ) - ? $customer_info['region'] - : ''; - - // Sanitize the inputs - $customer_data = array(); - $customer_data['name'] = strip_tags( stripslashes( $customer_info['name'] ) ); - $customer_data['email'] = $customer_info['email']; - $customer_data['user_id'] = $user_id; - $customer_data['date_created'] = gmdate( 'Y-m-d H:i:s', strtotime( $customer_info['date_created'] ) ); - - $customer_data = apply_filters( 'edd_edit_customer_info', $customer_data, $customer_id ); - $address = apply_filters( 'edd_edit_customer_address', $address, $customer_id ); - - $customer_data = array_map( 'sanitize_text_field', $customer_data ); - $address = array_map( 'sanitize_text_field', $address ); - - do_action( 'edd_pre_edit_customer', $customer_id, $customer_data, $address ); - - $output = array(); - $previous_email = $customer->email; - - // Add new address before update to skip exists checks - if ( $previous_email !== $customer_data['email'] ) { - $customer->add_email( $customer_data['email'], true ); - } - - // Update customer - if ( $customer->update( $customer_data ) ) { - $current_address = $customer->get_address(); - $address['customer_id'] = $customer->id; - - if ( $current_address ) { - edd_update_customer_address( $current_address->id, $address ); - } else { - $address['is_primary'] = true; - edd_add_customer_address( $address ); - } - - $output['success'] = true; - $customer_data = array_merge( $customer_data, $address ); - $output['customer_info'] = $customer_data; - } else { - $output['success'] = false; - } - - do_action( 'edd_post_edit_customer', $customer_id, $customer_data ); - - if ( edd_doing_ajax() ) { - wp_send_json( $output ); - } - - return $output; -} -add_action( 'edd_edit-customer', 'edd_edit_customer', 10, 1 ); - -/** - * Add an email address to the customer from within the admin and log a customer note - * - * @since 2.6 - * @param array $args Array of arguments: nonce, customer id, and email address - * @return mixed Echos JSON if doing AJAX. Returns array of success (bool) and message (string) if not AJAX. - */ -function edd_add_customer_email( $args = array() ) { - $customer_edit_role = edd_get_edit_customers_role(); - - if ( ! is_admin() || ! current_user_can( $customer_edit_role ) ) { - wp_die( __( 'You do not have permission to edit this customer.', 'easy-digital-downloads' ) ); - } - - $output = array(); - - if ( empty( $args ) || empty( $args['email'] ) || empty( $args['customer_id'] ) ) { - - $output['success'] = false; - - if ( empty( $args['email'] ) ) { - $output['message'] = __( 'Email address is missing.', 'easy-digital-downloads' ); - } else if ( empty( $args['customer_id'] ) ) { - $output['message'] = __( 'Customer ID is required.', 'easy-digital-downloads' ); - } else { - $output['message'] = __( 'An error has occured. Please try again.', 'easy-digital-downloads' ); - } - - } else if ( ! wp_verify_nonce( $args['_wpnonce'], 'edd-add-customer-email' ) ) { - $output = array( - 'success' => false, - 'message' => __( 'Nonce verification failed.', 'easy-digital-downloads' ), - ); - - } else if ( ! is_email( $args['email'] ) ) { - $output = array( - 'success' => false, - 'message' => __( 'Invalid email address.', 'easy-digital-downloads' ), - ); - - } else { - $email = sanitize_email( $args['email'] ); - $customer_id = (int) $args['customer_id']; - $primary = 'true' === $args['primary'] ? true : false; - $customer = new EDD_Customer( $customer_id ); - $customer_email_id = $customer->add_email( $email, $primary ); - - if ( false === $customer_email_id ) { - - if ( in_array( $email, $customer->emails, true ) ) { - $output = array( - 'success' => false, - 'message' => __( 'Email already associated with this customer.', 'easy-digital-downloads' ), - ); - - } else { - $output = array( - 'success' => false, - 'message' => __( 'Email address is already associated with another customer.', 'easy-digital-downloads' ), - ); - } - - } else { - $redirect = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => absint( $customer_id ), - 'edd-message' => 'email-added', - 'edd-email-id' => absint( $customer_email_id ), - ) - ); - $output = array( - 'success' => true, - 'message' => __( 'Email successfully added to customer.', 'easy-digital-downloads' ), - 'redirect' => $redirect . '#edd_general_emails', - ); - - $user = wp_get_current_user(); - $user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name(); - /* translators: 1. email address; 2. username */ - $customer_note = sprintf( __( 'Email address %1$s added by %2$s', 'easy-digital-downloads' ), $email, $user_login ); - $customer->add_note( $customer_note ); - - if ( $primary ) { - /* translators: 1. email address; 2. username */ - $customer_note = sprintf( __( 'Email address %1$s set as primary by %2$s', 'easy-digital-downloads' ), $email, $user_login ); - $customer->add_note( $customer_note ); - } - } - } - - if ( ! isset( $customer_id ) ) { - $customer_id = isset( $args['customer_id'] ) ? $args['customer_id'] : false; - } - - do_action( 'edd_post_add_customer_email', $customer_id, $args ); - - if ( edd_doing_ajax() ) { - wp_send_json( $output ); - } - - return $output; -} -add_action( 'edd_customer-add-email', 'edd_add_customer_email', 10, 1 ); - -/** - * Remove an email address to the customer from within the admin and log a customer note - * and redirect back to the customer interface for feedback - * - * @since 2.6 - * @return void - */ -function edd_remove_customer_email() { - if ( empty( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { - return false; - } - - if ( empty( $_GET['email'] ) || ! is_email( $_GET['email'] ) ) { - return false; - } - - if ( empty( $_GET['_wpnonce'] ) ) { - return false; - } - - $nonce = $_GET['_wpnonce']; - if ( ! wp_verify_nonce( $nonce, 'edd-remove-customer-email' ) ) { - wp_die( __( 'Nonce verification failed', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $customer = new EDD_Customer( $_GET['id'] ); - if ( $customer->remove_email( $_GET['email'] ) ) { - $url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $customer->id ), - 'edd-message' => 'email-removed', - ) - ); - $user = wp_get_current_user(); - $user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name(); - /* translators: 1. email address; 2. username */ - $customer_note = sprintf( __( 'Email address %1$s removed by %2$s', 'easy-digital-downloads' ), sanitize_email( $_GET['email'] ), $user_login ); - $customer->add_note( $customer_note ); - - } else { - $url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $customer->id ), - 'edd-message' => 'email-remove-failed', - ) - ); - } - - edd_redirect( $url . '#edd_general_emails' ); -} -add_action( 'edd_customer-remove-email', 'edd_remove_customer_email', 10 ); - -/** - * Set an email address as the primary for a customer from within the admin and log a customer note - * and redirect back to the customer interface for feedback - * - * @since 2.6 - * @return void - */ -function edd_set_customer_primary_email() { - if ( empty( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { - return false; - } - - if ( empty( $_GET['email'] ) || ! is_email( $_GET['email'] ) ) { - return false; - } - - if ( empty( $_GET['_wpnonce'] ) ) { - return false; - } - - $nonce = $_GET['_wpnonce']; - if ( ! wp_verify_nonce( $nonce, 'edd-set-customer-primary-email' ) ) { - wp_die( __( 'Nonce verification failed', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $customer = new EDD_Customer( $_GET['id'] ); - if ( $customer->set_primary_email( $_GET['email'] ) ) { - $url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $customer->id ), - 'edd-message' => 'primary-email-updated', - ) - ); - $user = wp_get_current_user(); - $user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name(); - $customer_note = sprintf( __( 'Email address %s set as primary by %s', 'easy-digital-downloads' ), sanitize_email( $_GET['email'] ), $user_login ); - $customer->add_note( $customer_note ); - - } else { - $url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $customer->id ), - 'edd-message' => 'primary-email-failed', - ) - ); - } - - edd_redirect( $url . '#edd_general_emails' ); -} -add_action( 'edd_customer-primary-email', 'edd_set_customer_primary_email', 10 ); - -/** - * Delete a customer - * - * @since 2.3 - * @param array $args The $_POST array being passed - * @return int Whether it was a successful deletion - */ -function edd_customer_delete( $args = array() ) { - $customer_edit_role = edd_get_edit_customers_role(); - - if ( ! is_admin() || ! current_user_can( $customer_edit_role ) ) { - wp_die( __( 'You do not have permission to delete this customer.', 'easy-digital-downloads' ) ); - } - - if ( empty( $args ) ) { - return; - } - - $customer_id = (int)$args['customer_id']; - $confirm = ! empty( $args['edd-customer-delete-confirm'] ); - $remove_data = ! empty( $args['edd-customer-delete-records'] ); - $nonce = $args['_wpnonce']; - - if ( ! wp_verify_nonce( $nonce, 'delete-customer' ) ) { - wp_die( __( 'Cheatin\' eh?!', 'easy-digital-downloads' ) ); - } - - if ( ! $confirm ) { - edd_set_error( 'customer-delete-no-confirm', __( 'Please confirm you want to delete this customer', 'easy-digital-downloads' ) ); - } - - if ( edd_get_errors() ) { - edd_redirect( - edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => absint( $customer_id ), - ) - ) - ); - } - - $customer = new EDD_Customer( $customer_id ); - - do_action( 'edd_pre_delete_customer', $customer_id, $confirm, $remove_data ); - - $success = false; - - if ( $customer->id > 0 ) { - - $payments_array = explode( ',', $customer->payment_ids ); - $success = edd_destroy_customer( $customer->id ); - - if ( $success ) { - - if ( $remove_data ) { - - // Remove all payments, logs, etc - foreach ( $payments_array as $payment_id ) { - edd_destroy_order( $payment_id ); - } - - } else { - - // Just set the payments to customer_id of 0 - foreach ( $payments_array as $payment_id ) { - edd_update_payment_meta( $payment_id, '_edd_payment_customer_id', 0 ); - } - } - - $redirect = edd_get_admin_url( array( 'page' => 'edd-customers', 'edd-message' => 'customer-deleted' ) ); - - } else { - edd_set_error( 'edd-customer-delete-failed', __( 'Error deleting customer', 'easy-digital-downloads' ) ); - $redirect = edd_get_admin_url( array( 'page' => 'edd-customers', 'view' => 'delete', 'id' => absint( $customer_id ) ) ); - } - - } else { - edd_set_error( 'edd-customer-delete-invalid-id', __( 'Invalid Customer ID', 'easy-digital-downloads' ) ); - $redirect = edd_get_admin_url( array( 'page' => 'edd-customers' ) ); - } - - edd_redirect( $redirect ); -} -add_action( 'edd_delete-customer', 'edd_customer_delete', 10, 1 ); - -/** - * Disconnect a user ID from a customer - * - * @since 2.3 - * @param array $args Array of arguments - * @return bool If the disconnect was successful - */ -function edd_disconnect_customer_user_id( $args = array() ) { - $customer_edit_role = edd_get_edit_customers_role(); - - if ( ! is_admin() || ! current_user_can( $customer_edit_role ) ) { - wp_die( __( 'You do not have permission to edit this customer.', 'easy-digital-downloads' ) ); - } - - if ( empty( $args ) ) { - return; - } - - $customer_id = (int)$args['customer_id']; - $nonce = $args['_wpnonce']; - - if ( ! wp_verify_nonce( $nonce, 'edit-customer' ) ) { - wp_die( __( 'Cheatin\' eh?!', 'easy-digital-downloads' ) ); - } - - $customer = new EDD_Customer( $customer_id ); - if ( empty( $customer->id ) ) { - return false; - } - - do_action( 'edd_pre_customer_disconnect_user_id', $customer_id, $customer->user_id ); - - $customer_args = array( 'user_id' => 0 ); - - if ( $customer->update( $customer_args ) ) { - - $output['success'] = true; - - } else { - - $output['success'] = false; - edd_set_error( 'edd-disconnect-user-fail', __( 'Failed to disconnect user from customer', 'easy-digital-downloads' ) ); - } - - do_action( 'edd_post_customer_disconnect_user_id', $customer_id ); - - if ( edd_doing_ajax() ) { - wp_send_json( $output ); - } - - return $output; -} -add_action( 'edd_disconnect-userid', 'edd_disconnect_customer_user_id', 10, 1 ); - -/** - * Process manual verification of customer account by admin - * - * @since 2.4.8 - * @return void - */ -function edd_process_admin_user_verification() { - - if ( empty( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { - return false; - } - - if ( empty( $_GET['_wpnonce'] ) ) { - return false; - } - - $nonce = $_GET['_wpnonce']; - if ( ! wp_verify_nonce( $nonce, 'edd-verify-user' ) ) { - wp_die( __( 'Nonce verification failed', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $customer = new EDD_Customer( $_GET['id'] ); - edd_set_user_to_verified( $customer->user_id ); - - $url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => absint( $customer->id ), - 'edd-message' => 'user-verified', - ) - ); - - edd_redirect( $url ); -} -add_action( 'edd_verify_user_admin', 'edd_process_admin_user_verification' ); - -/** - * Register the reset single customer stats batch processor - * @since 2.5 - */ -function edd_register_batch_single_customer_recount_tool() { - add_action( 'edd_batch_export_class_include', 'edd_include_single_customer_recount_tool_batch_processer', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_batch_single_customer_recount_tool', 10 ); - -/** - * Loads the tools batch processing class for recounting stats for a single customer - * - * @since 2.5 - * @param string $class The class being requested to run for the batch export - * @return void - */ -function edd_include_single_customer_recount_tool_batch_processer( $class ) { - if ( 'EDD_Tools_Recount_Single_Customer_Stats' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/tools/class-edd-tools-recount-single-customer-stats.php'; - } -} - -/** - * Removes a customer address - * - * @since 3.0 - * @return void - */ -function edd_remove_customer_address() { - if ( ! is_admin() || ! current_user_can( edd_get_edit_customers_role() ) ) { - wp_die( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) ); - } - - if ( empty( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) || empty( $_GET['_wpnonce'] ) ) { - return; - } - - if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'edd-remove-customer-address' ) ) { - wp_die( __( 'Nonce verification failed', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $address = edd_fetch_customer_address( absint( $_GET['id'] ) ); - $removed = $address instanceof EDD\Customers\Customer_Address ? edd_delete_customer_address( absint( $_GET['id'] ) ) : false; - - $url = edd_get_admin_url( array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $address->customer_id ), - 'edd-message' => 'address-removed' - ) ); - - if ( $removed ) { - $url = add_query_arg( 'edd-message', 'address-removed', $url ); - } else { - $url = add_query_arg( 'edd-message', 'address-remove-failed', $url ); - } - - edd_redirect( $url . '#edd_general_addresses' ); -} -add_action( 'edd_customer-remove-address', 'edd_remove_customer_address', 10 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/customers/customer-functions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/customers/customer-functions.php deleted file mode 100644 index 883e13c8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/customers/customer-functions.php +++ /dev/null @@ -1,186 +0,0 @@ - 'edd_customers_view', - 'emails' => 'edd_customers_emails_view', - 'addresses' => 'edd_customers_addresses_view', - 'delete' => 'edd_customers_delete_view', - 'notes' => 'edd_customer_notes_view', - 'tools' => 'edd_customer_tools_view', - ) ); -} -add_filter( 'edd_customer_views', 'edd_register_default_customer_views', 1, 1 ); - -/** - * Register a tab for the single customer view - * - * @since 2.3 - * @param array $tabs An array of existing tabs - * @return array The altered list of tabs - */ -function edd_register_default_customer_tabs( $tabs ) { - return array_merge( $tabs, array( - 'overview' => array( 'dashicon' => 'dashicons-admin-users', 'title' => _x( 'Profile', 'Customer Details tab title', 'easy-digital-downloads' ) ), - 'emails' => array( 'dashicon' => 'dashicons-email', 'title' => _x( 'Emails', 'Customer Emails tab title', 'easy-digital-downloads' ) ), - 'addresses' => array( 'dashicon' => 'dashicons-admin-home', 'title' => _x( 'Addresses', 'Customer Addresses tab title', 'easy-digital-downloads' ) ), - 'notes' => array( 'dashicon' => 'dashicons-admin-comments', 'title' => _x( 'Notes', 'Customer Notes tab title', 'easy-digital-downloads' ) ), - 'tools' => array( 'dashicon' => 'dashicons-admin-tools', 'title' => _x( 'Tools', 'Customer Tools tab title', 'easy-digital-downloads' ) ) - ) ); -} -add_filter( 'edd_customer_tabs', 'edd_register_default_customer_tabs', 1, 1 ); - -/** - * Register the Delete icon as late as possible so it's at the bottom - * - * @since 2.3.1 - * @param array $tabs An array of existing tabs - * @return array The altered list of tabs, with 'delete' at the bottom - */ -function edd_register_delete_customer_tab( $tabs ) { - - $tabs['delete'] = array( - 'dashicon' => 'dashicons-trash', - 'title' => _x( 'Delete', 'Delete Customer tab title', 'easy-digital-downloads' ) - ); - - return $tabs; -} -add_filter( 'edd_customer_tabs', 'edd_register_delete_customer_tab', PHP_INT_MAX, 1 ); - -/** - * Remove the admin bar edit profile link when the user is not verified - * - * @since 2.4.4 - * @return void - */ -function edd_maybe_remove_adminbar_profile_link() { - - if ( current_user_can( 'manage_shop_settings' ) ) { - return; - } - - if ( edd_user_pending_verification() ) { - global $wp_admin_bar; - $wp_admin_bar->remove_menu( 'edit-profile', 'user-actions' ); - } -} -add_action( 'wp_before_admin_bar_render', 'edd_maybe_remove_adminbar_profile_link' ); - -/** - * Remove the admin menus and disable profile access for non-verified users - * - * @since 2.4.4 - * @return void - */ -function edd_maybe_remove_menu_profile_links() { - - if ( edd_doing_ajax() ) { - return; - } - - if ( current_user_can( 'manage_shop_settings' ) ) { - return; - } - - if ( edd_user_pending_verification() ) { - - if ( defined( 'IS_PROFILE_PAGE' ) && true === IS_PROFILE_PAGE ) { - $url = esc_url( edd_get_user_verification_request_url() ); - /* translators: link to send an email */ - $message = sprintf( __( 'Your account is pending verification. Please click the link in your email to activate your account. No email? Click here to send a new activation code.', 'easy-digital-downloads' ), esc_url( $url ) ); - $title = __( 'Account Pending Verification', 'easy-digital-downloads' ); - $args = array( - 'response' => 403, - ); - wp_die( $message, $title, $args ); - } - - remove_menu_page( 'profile.php' ); - remove_submenu_page( 'users.php', 'profile.php' ); - } -} -add_action( 'admin_init', 'edd_maybe_remove_menu_profile_links' ); - -/** - * Add Customer column to Users list table. - * - * @since 3.0 - * - * @param array $columns Existing columns. - * - * @return array $columns Columns with `Customer` added. - */ -function edd_add_customer_column_to_users_table( $columns ) { - $columns['edd_customer'] = __( 'Customer', 'easy-digital-downloads' ); - return $columns; -} -add_filter( 'manage_users_columns', 'edd_add_customer_column_to_users_table' ); - -/** - * Display customer details on Users list table. - * - * @since 3.0 - * - * @param string $value Existing value of the custom column. - * @param string $column_name Column name. - * @param int $user_id User ID. - * - * @return string URL to Customer page, existing value otherwise. - */ -function edd_render_customer_column( $value, $column_name, $user_id ) { - if ( 'edd_customer' === $column_name ) { - $customer = new EDD_Customer( $user_id, true ); - - if ( $customer->id > 0 ) { - $name = '#' . $customer->id . ' '; - $name .= ! empty( $customer->name ) ? $customer->name : '' . __( 'Unnamed Customer', 'easy-digital-downloads' ) . ''; - $view_url = edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => absint( $customer->id ), - ) - ); - - return '' . $name . ''; - } - } - - return $value; -} -add_action( 'manage_users_custom_column', 'edd_render_customer_column', 10, 3 ); - -/** - * Renders the customer details header (gravatar/name). - * - * @since 3.0 - * @param \EDD_Customer $customer - * @return void - */ -function edd_render_customer_details_header( \EDD_Customer $customer ) { - ?> -
    - email, 30 ); ?> name ); ?> -
    - - - - - esc_html__( 'Customers', 'easy-digital-downloads' ), - 'emails' => esc_html__( 'Email Addresses', 'easy-digital-downloads' ), - 'physical' => esc_html__( 'Physical Addresses', 'easy-digital-downloads' ) - ) ); - } - - // Return - return $pages; -} - -/** - * Display customer sections - * - * Contains backwards compat code to shim tabs & views to EDD_Sections() - * - * @since 3.0 - * - * @param object $customer - */ -function edd_customers_sections( $customer ) { - - // Instantiate the Sections class and sections array - $sections = new EDD\Admin\Sections(); - $c_sections = array(); - - // Setup sections variables - $sections->item = $customer; - $sections->use_js = true; - $sections->current_section = ! empty( $_GET['view'] ) - ? sanitize_key( $_GET['view'] ) - : 'overview'; - $sections->base_url = edd_get_admin_url( array( - 'page' => 'edd-customers', - 'id' => absint( $customer->id ), - ) ); - - // Get all registered tabs & views - $tabs = edd_customer_tabs(); - $views = edd_customer_views(); - - // Do not display the addresses tab if there are none. - if ( empty( $customer->get_addresses() ) ) { - unset( $tabs['addresses'] ); - } - - // Loop through tabs & setup sections - if ( ! empty( $tabs ) ) { - foreach ( $tabs as $id => $tab ) { - - // Bail if no view - if ( ! isset( $views[ $id ] ) ) { - continue; - } - - // Add to sections array - $c_sections[] = array( - 'id' => $id, - 'label' => $tab['title'], - 'icon' => str_replace( 'dashicons-', '', $tab['dashicon'] ), - 'callback' => $views[ $id ] - ); - } - } - - // Set the customer sections - $sections->set_sections( $c_sections ); - - // Display the sections - $sections->display(); -} - -/** - * Customers Page - * - * Renders the customers page contents. - * - * @since 2.3 - * @return void - */ -function edd_customers_page() { - // Enqueue scripts. - wp_enqueue_script( 'edd-admin-customers' ); - wp_enqueue_script( 'edd-admin-notes' ); - - // Views - $default_views = edd_customer_views(); - $requested_view = isset( $_GET['view'] ) - ? sanitize_key( $_GET['view'] ) - : 'customers'; - - // Tabs - $active_tab = ! empty( $_GET['page_type'] ) - ? sanitize_key( $_GET['page_type'] ) - : 'customers'; - - // Single customer view - if ( array_key_exists( $requested_view, $default_views ) && is_callable( $default_views[ $requested_view ] ) ) { - edd_render_customer_view( $requested_view, $default_views ); - - // List table view - } else { - edd_customers_list( $active_tab ); - } -} - -/** - * Register the views for customer management - * - * @since 2.3 - * @return array Array of views and their callbacks - */ -function edd_customer_views() { - return apply_filters( 'edd_customer_views', array() ); -} - -/** - * Register the tabs for customer management - * - * @since 2.3 - * @return array Array of tabs for the customer - */ -function edd_customer_tabs() { - return apply_filters( 'edd_customer_tabs', array() ); -} - -/** - * List table of customers - * - * @since 2.3 - * @return void - */ -function edd_customers_list( $active_tab = 'customers' ) { - - // Get the possible pages - $pages = edd_get_customer_pages(); - - // Reset page if not a registered page - if ( ! in_array( $active_tab, array_keys( $pages ), true ) ) { - $active_tab = 'customers'; - } - - // Get the label/name from the active tab - $name = $pages[ $active_tab ]; - - // Get the action url from the active tab - $action_url = edd_get_admin_url( array( - 'page_type' => sanitize_key( $active_tab ), - 'page' => 'edd-' . sanitize_key( $active_tab ), - ) ); - - // Setup the list table class - switch ( $active_tab ) { - case 'customers' : - include_once dirname( __FILE__ ) . '/class-customer-table.php'; - $list_table_class = 'EDD_Customer_Reports_Table'; - break; - case 'emails' : - include_once dirname( __FILE__ ) . '/class-customer-email-addresses-table.php'; - $list_table_class = 'EDD_Customer_Email_Addresses_Table'; - break; - case 'physical' : - include_once dirname( __FILE__ ) . '/class-customer-addresses-table.php'; - $list_table_class = 'EDD_Customer_Addresses_Table'; - break; - } - - // Initialize the list table - $customers_table = new $list_table_class; - $customers_table->prepare_items(); ?> - -
    -

    -
    - - -
    - - - -
    - views(); - /* translators: the active screen, eg "Search Customers" or "Search Customer Email Addresses" */ - $customers_table->search_box( sprintf( __( 'Search %s', 'easy-digital-downloads' ), $name ), 'edd-customers' ); - $customers_table->display(); - ?> - - - - -
    - - - -
    - - id ) ) { - edd_set_error( 'edd-invalid_customer', __( 'Invalid Customer ID Provided.', 'easy-digital-downloads' ) ); - $render = false; - } ?> - -
    -

    - - -

    - -
    - - - -
    - - - -
    - -
    - - - -
    - get_meta( 'agree_to_terms_time', false ); - $show_terms = edd_get_option( 'show_agree_to_terms' ); - $privacy_timestamps = $customer->get_meta( 'agree_to_privacy_time', false ); - $show_privacy = edd_get_option( 'show_agree_to_privacy_policy' ); - $last_payment_date = ''; - - if ( ( empty( $agreement_timestamps ) && $show_terms ) || ( empty( $privacy_timestamps ) && $show_privacy ) ) { - $last_payment = edd_get_orders( - array( - 'customer_id' => $customer->id, - 'orderby' => 'date', - 'order' => 'DESC', - 'number' => 1, - ) - ); - if ( ! empty( $last_payment ) ) { - $last_payment = reset( $last_payment ); - $last_payment_date = strtotime( $last_payment->date_created ); - } - } - - if ( is_array( $agreement_timestamps ) ) { - $agreement_timestamp = array_pop( $agreement_timestamps ); - } - - if ( is_array( $privacy_timestamps ) ) { - $privacy_timestamp = array_pop( $privacy_timestamps ); - } - - $user_id = ( $customer->user_id > 0 ) - ? absint( $customer->user_id ) - : ''; - - $address_args = array( - 'address' => '', - 'address2' => '', - 'city' => '', - 'region' => '', - 'postal_code' => '', - 'country' => '', - ); - - $data_atts = array( - 'key' => 'user_login', - 'exclude' => $user_id - ); - - $user_args = array( - 'name' => 'customerinfo[user_login]', - 'class' => 'edd-user-dropdown', - 'data' => $data_atts - ); - - // Maybe get user data - if ( ! empty( $user_id ) ) { - $userdata = get_userdata( $user_id ); - - if ( ! empty( $userdata->user_login ) ) { - $user_login = $userdata->user_login; - $user_args['value'] = $user_login; - } else { - $user_login = false; - } - } - - // Address - $address = $customer->get_address(); - - if ( ! empty( $address ) ) { - $address = $address->to_array(); - $address = wp_parse_args( $address, $address_args ); - - } else { - $address = $address_args; - } - - do_action( 'edd_customer_card_top', $customer ); - - // Country - $selected_country = $address['country']; - $countries = edd_get_country_list(); - - // State - $selected_state = edd_get_shop_state(); - $states = edd_get_shop_states( $selected_country ); - $selected_state = isset( $address['region'] ) - ? $address['region'] - : $selected_state; - - // Orders - // Orders and refunds. - $orders = edd_get_orders( array( - 'customer_id' => $customer->id, - 'number' => 10, - 'type' => 'sale', - ) ); - - $refunds = edd_get_orders( array( - 'customer_id' => $customer->id, - 'number' => 10, - 'type' => 'refund', - ) ); - - // Downloads - $downloads = edd_get_users_purchased_products( $customer->email ); - - ?> - -
    -
    - - - - -
    -
    - email, 150 ); ?>
    - - - - - - - - - - - -
    - -
    - #id ); ?> -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    - - - - - name ); ?> - - - - - - - email ); ?> - - - - - - date_created ) ) - ); - ?> - - - html->ajax_user_search( $user_args ); ?> - - - - - - - ' . esc_html( $user_id ) . ''); - endif; ?> - - - - - - - - - - - - 0 ) : ?> - - - - - - - -
    -
    -
    -
    -
    - - - -
    - -
    - - - -
    -

    -

    - - - - - - - - - -

    - -

    - - - - - - - - - -

    -
    - - - -
    - - - -

    - - - - - - - - - - - status ) { - $state = ' — ' . edd_get_payment_status_label( $order->status ); - } - - // View URL - $view_url = edd_get_admin_url( array( - 'page' => 'edd-payment-history', - 'view' => 'view-order-details', - 'id' => absint( $order->id ), - ) ); - ?> - - - - - - - - - - - -
    get_number() ); ?>gateway ) ); ?>total ), $order->currency ); ?>
    - -

    - - - - - - - - - - - 'edd-payment-history', - 'view' => 'view-refund-details', - 'id' => absint( $refund->id ), - ) ); - ?> - - - - - - - - - - - -
    order_number ); ?>gateway ) ); ?>total ), $refund->currency ); ?>
    - -

    - -

    - - - - - - - - - - - - - - - - - - - - - - - -
    post_title ); ?>
    - -
    - - - -
    - - - - $customer->id, - 'orderby' => 'type', // to put `primary` email first - 'order' => 'ASC' - ) ); - ?> -
    - -

    - - -

    - -
    - - - - - - - - - - $email ) : ?> - - - - - - - - - - - - - - - - -
    - email ); ?> - - type ) : ?> - - -
    - 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $customer->id ), - ) - ); - $actions = array( - 'promote' => array( - 'url' => wp_nonce_url( add_query_arg( array( 'email' => rawurlencode( $email->email ), 'edd_action' => 'customer-primary-email' ), $base_url ), 'edd-set-customer-primary-email' ), - 'label' => __( 'Make Primary', 'easy-digital-downloads' ), - ), - 'delete' => array( - 'url' => wp_nonce_url( add_query_arg( array( 'email' => rawurlencode( $email->email ), 'edd_action' => 'customer-remove-email' ), $base_url ), 'edd-remove-customer-email' ), - 'label' => __( 'Delete', 'easy-digital-downloads' ), - ), - ); - $action_links = array(); - foreach ( $actions as $action => $args ) { - $action_links[] = sprintf( - '%s', - esc_attr( $action ), - esc_url( $args['url'] ), - esc_html( $args['label'] ) - ); - } - echo wp_kses( implode( ' | ', $action_links ), edd_get_allowed_tags() ); - ?> -
    - -
    - -
    -
    - - -
    - -
    - -
    -
    -
    -
    - - -
    -
    - - -
    -
    -
    - get_addresses(); - // This has already been checked when setting the tabs. - if ( empty( $addresses ) ) { - return; - } - ?> -
    - -

    - -
    - - - - - - - - - - - - - - 'edd-customers', - 'view' => 'overview', - 'id' => urlencode( $address->id ), - 'edd_action' => 'customer-remove-address', - ) ), 'edd-remove-customer-address' ); - ?> - - - - - - - - - - - - -
    - address ) - ? esc_html( $address->address ) - : '—'; - - echo ! empty( $address->address2 ) - ? esc_html( $address->address2 ) - : ''; - ?> - - city ) - ? esc_html( $address->city ) - : '—'; - ?> - - region ) - ? esc_html( edd_get_state_name( $address->country, $address->region ) ) - : '—'; - ?> - - postal_code ) - ? esc_html( $address->postal_code ) - : '—'; - ?> - - country ) - ? esc_html( edd_get_country_name( $address->country ) ) - : '—'; - ?> - - - is_primary ) ) : ?> - - -
    - -
    -
    -
    - get_notes( $per_page, $paged ); - $note_count = $customer->get_notes_count(); - $args = array( - 'total' => $note_count, - 'add_fragment' => '#edd_general_notes' - ); ?> - -
    - -

    - - - -
    - - id, 'customer' ); ?> -
    - - -
    - - - -
    - -
    - - -

    - -
    - -

    - html->checkbox( array( 'name' => 'edd-customer-delete-confirm' ) ); ?> - -

    - -

    - html->checkbox( array( 'name' => 'edd-customer-delete-records', 'options' => array( 'disabled' => true ) ) ); ?> - -

    - - -
    - - - - - - - -
    -
    -
    - - - -
    - -

    - -
    -

    -

    -
    - - - - - - - -
    -
    -
    - - user_id ) ) { - return; - } - - $url = wp_nonce_url( - edd_get_admin_url( - array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'edd_action' => 'verify_user_admin', - 'id' => absint( $customer->id ), - ) - ), - 'edd-verify-user' - ); - - echo '

    '; - esc_html_e( 'This customer\'s user account is pending verification.', 'easy-digital-downloads' ); - echo ' '; - echo '' . esc_html__( 'Verify account.', 'easy-digital-downloads' ) . ''; - echo "\n\n"; - - echo '

    '; -} -add_action( 'edd_customer_card_top', 'edd_verify_customer_notice', 10, 1 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/dashboard-widgets.php b/wp-content/plugins/easy-digital-downloads/includes/admin/dashboard-widgets.php deleted file mode 100644 index 744b980d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/dashboard-widgets.php +++ /dev/null @@ -1,315 +0,0 @@ -%1$s %2$s

    ', - esc_html__( 'Easy Digital Downloads is performing a database migration via WP-CLI.', 'easy-digital-downloads' ), - esc_html__( 'This summary will be available when that has completed.', 'easy-digital-downloads' ) - ); - return; - } - global $wpdb; - $orders = $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'edd_payment' LIMIT 1" ); - if ( ! empty( $orders ) ) { - $url = add_query_arg( - array( - 'page' => 'edd-upgrades', - 'edd-upgrade' => 'v30_migration', - ), - admin_url( 'index.php' ) - ); - printf( - '

    %1$s %2$s%4$s

    ', - esc_html__( 'Easy Digital Downloads needs to upgrade the database.', 'easy-digital-downloads' ), - esc_html__( 'This summary will be available when that has completed.', 'easy-digital-downloads' ), - esc_url( $url ), - esc_html__( 'Begin the upgrade.', 'easy-digital-downloads' ) - ); - return; - } - } - wp_enqueue_script( 'edd-admin-dashboard' ); - - /** - * Action hook to add content to the dashboard widget. - * This content will not be replaced by the AJAX function: - * only the "edd-loading" content will. - * - * @since 2.11.4 - */ - do_action( 'edd_dashboard_sales_widget' ); - ?> -

    - $range, - 'output' => 'formatted', - 'revenue_type' => 'net', - ); - if ( 'total' === $range ) { - unset( $args['range'] ); - } - // Remove filters so that deprecation notices are not unnecessarily logged outside of reports. - remove_all_filters( 'edd_report_views' ); - $stats = new EDD\Stats( $args ); - $data[ $range ] = array( - 'earnings' => $stats->get_order_earnings(), - 'count' => $stats->get_order_count(), - ); - } - - return $data; -} - -/** - * Loads the dashboard sales widget via ajax - * - * @since 2.1 - * @return void - */ -function edd_load_dashboard_sales_widget( ) { - - if ( ! current_user_can( apply_filters( 'edd_dashboard_stats_cap', 'view_shop_reports' ) ) ) { - die(); - } - - $stats = new EDD_Payment_Stats(); - $data = edd_get_dashboard_sales_widget_data(); ?> -
    -
    - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - -
    -
    -
    - - - - - - - - - - - - - - - - -
    - -
    - -
    -
    -
    - - - - - - - - - - - - - - - - -
    - -
    -
    -
    - - 5, - 'status' => edd_get_net_order_statuses(), - 'type' => 'sale', - ) - ); - - if ( $orders ) { ?> - - - - 5, 'status' => 'complete' ) ) ); - } - ?> -
    - publish ) { - $text = _n( '%s ' . edd_get_label_singular(), '%s ' . edd_get_label_plural(), $num_posts->publish, 'easy-digital-downloads' ); - - $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); - - if ( current_user_can( 'edit_products' ) ) { - $text = sprintf( '%1$s', $text ); - } else { - $text = sprintf( '%1$s', $text ); - } - - $items[] = $text; - } - - return $items; -} -add_filter( 'dashboard_glance_items', 'edd_dashboard_at_a_glance_widget', 1 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/add-discount.php b/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/add-discount.php deleted file mode 100644 index 0c1673e4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/add-discount.php +++ /dev/null @@ -1,236 +0,0 @@ - -
    -

    - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -

    -
    - - - -

    -
    - - - - - - - -

    -
    - - - html->product_dropdown( array( - 'name' => 'product_reqs[]', - 'id' => 'edd_products', - 'selected' => array(), - 'multiple' => true, - 'chosen' => true, - 'placeholder' => sprintf( esc_html__( 'Select %s', 'easy-digital-downloads' ), esc_html( edd_get_label_plural() ) ), - ) ); // WPCS: XSS ok. ?> - -

    -
    - - - html->product_dropdown( array( - 'name' => 'excluded_products[]', - 'id' => 'excluded_products', - 'selected' => array(), - 'multiple' => true, - 'chosen' => true, - 'placeholder' => sprintf( esc_html__( 'Select %s', 'easy-digital-downloads' ), esc_html( edd_get_label_plural() ) ), - ) ); // WPCS: XSS ok. ?> -

    -
    - - - - - - - : - - - - - -

    -
    - - - - - - - : - - - - - -

    -
    - - - -

    -
    - - - -

    -
    - - - - -
    - - - -

    - - - - - -

    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/class-discount-codes-table.php b/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/class-discount-codes-table.php deleted file mode 100644 index 73751d8c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/class-discount-codes-table.php +++ /dev/null @@ -1,459 +0,0 @@ - 'discount', - 'plural' => 'discounts', - 'ajax' => false, - ) ); - - $this->process_bulk_action(); - $this->get_counts(); - } - - /** - * Get the base URL for the discount list table - * - * @since 3.0 - * - * @return string - */ - public function get_base_url() { - - // Remove some query arguments - $base = remove_query_arg( edd_admin_removable_query_args(), edd_get_admin_base_url() ); - - // Add base query args - return add_query_arg( array( - 'page' => 'edd-discounts', - ), $base ); - } - - /** - * Retrieve the table columns - * - * @since 1.4 - * - * @return array $columns Array of all the list table columns - */ - public function get_columns() { - return apply_filters( 'edd_discounts_table_columns', array( - 'cb' => '', - 'name' => __( 'Name', 'easy-digital-downloads' ), - 'code' => __( 'Code', 'easy-digital-downloads' ), - 'amount' => __( 'Amount', 'easy-digital-downloads' ), - 'use_count' => __( 'Uses', 'easy-digital-downloads' ), - 'start_date' => __( 'Start Date', 'easy-digital-downloads' ), - 'end_date' => __( 'End Date', 'easy-digital-downloads' ) - ) ); - } - - /** - * Retrieve the sortable columns - * - * @since 1.4 - * - * @return array Array of all the sortable columns - */ - public function get_sortable_columns() { - return apply_filters( 'edd_discounts_table_sortable_columns', array( - 'name' => array( 'name', false ), - 'code' => array( 'code', false ), - 'use_count' => array( 'use_count', false ), - 'start_date' => array( 'start_date', false ), - 'end_date' => array( 'end_date', false ) - ) ); - } - - /** - * Gets the name of the primary column. - * - * @since 2.5 - * @access protected - * - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'name'; - } - - /** - * This function renders most of the columns in the list table. - * - * @since 1.4 - * - * @param EDD_Discount $discount Discount object. - * @param string $column_name The name of the column - * - * @return string Column Name - */ - public function column_default( $discount, $column_name ) { - $value = property_exists( $discount, $column_name ) ? $discount->$column_name : ''; - - return apply_filters( 'edd_discounts_table_column', $value, $discount, $column_name ); - } - - /** - * This function renders the amount column. - * - * @since 3.0 - * - * @param EDD_Discount $discount Data for the discount code. - * @return string Formatted amount. - */ - public function column_amount( $discount ) { - return edd_format_discount_rate( $discount->type, $discount->amount ); - } - - /** - * This function renders the start column. - * - * @since 3.0 - * - * @param EDD_Discount $discount Discount object. - * @return string Start date - */ - public function column_start_date( $discount ) { - $start_date = $discount->start_date; - $timezone_abbreviation = edd_get_timezone_abbr(); - - if ( $start_date ) { - $display = edd_date_i18n( $start_date, 'M. d, Y' ) . '
    ' . edd_date_i18n( $start_date, 'H:i' ) . ' ' . $timezone_abbreviation; - } else { - $display = '—'; - } - - return $display; - } - - /** - * Render the Expiration column. - * - * @since 3.0 - * - * @param EDD_Discount $discount Discount object. - * @return string Expiration date. - */ - public function column_end_date( $discount ) { - $expiration = $discount->end_date; - $timezone_abbreviation = edd_get_timezone_abbr(); - - if ( $expiration ) { - $display = edd_date_i18n( $expiration, 'M. d, Y' ) . '
    ' . edd_date_i18n( $expiration, 'H:i' ) . ' ' . $timezone_abbreviation; - } else { - $display = '—'; - } - - return $display; - } - - /** - * Render the Name column. - * - * @since 1.4 - * - * @param EDD_Discount $discount Discount object. - * @return string Data shown in the Name column - */ - public function column_name( $discount ) { - $base = $this->get_base_url(); - $state = ''; - $row_actions = array(); - $status = $this->get_status(); - - // Bail if current user cannot manage discounts - if ( ! current_user_can( 'manage_shop_discounts' ) ) { - return; - } - - // State - if ( ( ! empty( $status ) && ( $status !== $discount->status ) ) || ( 'active' !== $discount->status ) ) { - $state = ' — ' . edd_get_discount_status_label( $discount->id ); - } - - // Edit - $row_actions['edit'] = '' . __( 'Edit', 'easy-digital-downloads' ) . ''; - - // Active, so add "deactivate" action - if ( 'active' === strtolower( $discount->status ) ) { - $row_actions['cancel'] = '' . __( 'Deactivate', 'easy-digital-downloads' ) . ''; - - // Inactive, so add "activate" action - } elseif ( 'inactive' === strtolower( $discount->status ) ) { - $row_actions['activate'] = '' . __( 'Activate', 'easy-digital-downloads' ) . ''; - } - - // Delete - if ( 0 === (int) $discount->use_count ) { - $row_actions['delete'] = '' . __( 'Delete', 'easy-digital-downloads' ) . ''; - } else { - $row_actions['orders'] = '' . __( 'View Orders', 'easy-digital-downloads' ) . ''; - } - - // Filter all discount row actions - $row_actions = apply_filters( 'edd_discount_row_actions', $row_actions, $discount ); - - // Wrap discount title in strong anchor - $discount_title = '' . stripslashes( $discount->name ) . '' . esc_html( $state ) . ''; - - /** - * Filter to allow additional content to be appended to the discount title. - * - * @since 3.0 - * - * @param EDD_Discount $discount Discount object. - * @param string $base The base URL for the discount list table. - * @param string $status The queried discount status. - * @return string Additional data shown in the Name column - */ - $additional_content = apply_filters( 'edd_discount_row_after_title', '', $discount, $base, $status ); - - // Return discount title & row actions - return $discount_title . $additional_content . $this->row_actions( $row_actions ); - } - - /** - * Render the checkbox column. - * - * @since 1.4 - * - * @param EDD_Discount $discount Discount object. - * @return string Checkbox HTML. - */ - public function column_cb( $discount ) { - return sprintf( - '', - /*$1%s*/ 'discount', - /*$2%s*/ absint( $discount->id ), - /* translators: discount name */ - esc_html( sprintf( __( 'Select %s', 'easy-digital-downloads' ), $discount->name ) ) - ); - } - - /** - * Return discount code wrapped in a `` tag. - * - * @since 3.0 - * - * @param EDD_Discount $discount Discount object. - * @return string Discount code HTML. - */ - public function column_code( $discount ) { - return '' . $discount->code . ''; - } - - /** - * Message to be displayed when there are no items. - * - * @since 1.7.2 - */ - public function no_items() { - esc_html_e( 'No discounts found.', 'easy-digital-downloads' ); - } - - /** - * Retrieve the bulk actions - * - * @since 1.4 - * @return array $actions Array of the bulk actions - */ - public function get_bulk_actions() { - return array( - 'activate' => __( 'Activate', 'easy-digital-downloads' ), - 'deactivate' => __( 'Deactivate', 'easy-digital-downloads' ), - 'delete' => __( 'Delete', 'easy-digital-downloads' ) - ); - } - - /** - * Process bulk actions. - * - * @since 1.4 - */ - public function process_bulk_action() { - - // Bail if a nonce was not supplied. - if ( ! isset( $_REQUEST['_wpnonce'] ) ) { - return; - } - - if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-discounts' ) ) { - return; - } - - check_admin_referer( 'bulk-discounts' ); - - $ids = wp_parse_id_list( (array) $this->get_request_var( 'discount', false ) ); - - // Bail if no IDs - if ( empty( $ids ) ) { - return; - } - - foreach ( $ids as $id ) { - switch ( $this->current_action() ) { - case 'delete': - edd_delete_discount( $id ); - break; - - case 'cancel': - edd_update_discount_status( $id, 'cancelled' ); - break; - - case 'activate': - edd_update_discount_status( $id, 'active' ); - break; - - case 'deactivate': - edd_update_discount_status( $id, 'inactive' ); - break; - } - } - } - - /** - * Retrieve the discount code counts. - * - * @since 1.4 - */ - public function get_counts() { - $this->counts = edd_get_discount_counts(); - } - - /** - * Retrieves all the data for all the discount codes. - * - * @since 1.4 - * @deprecated 3.0 Use get_data() - * - * @return array Discount codes. - */ - public function discount_codes_data() { - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Discount_Codes_Table::get_data()' ); - - return $this->get_data(); - } - - /** - * Retrieves all of the table data for the discount codes. - * - * @since 3.0 - * - * @return array Discount codes table data. - */ - public function get_data() { - - // Parse pagination - $this->args = $this->parse_pagination_args( array( - 'status' => $this->get_status(), - 'search' => $this->get_search(), - ) ); - - // Return data - return edd_get_discounts( $this->args ); - } - - /** - * Setup the final data for the table - * - * @since 1.4 - */ - public function prepare_items() { - $columns = $this->get_columns(); - $hidden = array(); - $sortable = $this->get_sortable_columns(); - - $this->_column_headers = array( $columns, $hidden, $sortable ); - $this->items = $this->get_data(); - - $status = $this->get_status( 'total' ); - - // Setup pagination - $this->set_pagination_args( array( - 'total_pages' => ceil( $this->counts[ $status ] / $this->per_page ), - 'total_items' => $this->counts[ $status ], - 'per_page' => $this->per_page, - ) ); - } - - /** - * Generate the table navigation above or below the table. - * We're overriding this to turn off the referer param in `wp_nonce_field()`. - * - * @param string $which - * @since 3.1.0.4 - */ - protected function display_tablenav( $which ) { - if ( 'top' === $which ) { - wp_nonce_field( 'bulk-' . $this->_args['plural'], '_wpnonce', false ); - } - ?> -
    - - has_items() ) : ?> -
    - bulk_actions( $which ); ?> -
    - extra_tablenav( $which ); - $this->pagination( $which ); - ?> - -
    -
    - isFree() ) { - $docs_url = edd_link_helper( - 'https://easydigitaldownloads.com/docs/', - array( - 'utm_medium' => 'discounts-contextual-help', - 'utm_content' => 'documentation', - ) - ); - - $upgrade_url = edd_link_helper( - 'https://easydigitaldownloads.com/lite-upgrade/', - array( - 'utm_medium' => 'discounts-contextual-help', - 'utm_content' => 'lite-upgrade', - ) - ); - $screen->set_help_sidebar( - '

    ' . __( 'For more information:', 'easy-digital-downloads' ) . '

    ' . - '

    ' . sprintf( __( 'Visit the documentation on the Easy Digital Downloads website.', 'easy-digital-downloads' ), $docs_url ) . '

    ' . - '

    ' . sprintf( - __( 'Need more from your Easy Digital Downloads store? Upgrade Now!', 'easy-digital-downloads' ), - $upgrade_url - ) . '

    ' - ); - } - - $screen->add_help_tab( array( - 'id' => 'edd-discount-general', - 'title' => __( 'General', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'Discount codes allow you to offer buyers special discounts by having them enter predefined codes during checkout.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Discount codes that are set to "inactive" cannot be redeemed.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Discount codes can be setup to only be used only one time by each customer. If a customer attempts to use a code a second time, they will be given an error.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Discount codes that have already been used cannot be deleted for data integrity and reporting purposes.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-discount-add', - 'title' => __( 'Adding Discounts', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'You can create any number of discount codes easily from this page.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Discount codes have several options:', 'easy-digital-downloads' ) . '

    ' . - '
      '. - '
    • ' . __( 'Name - this is the name given to the discount. Used primarily for administrative purposes.', 'easy-digital-downloads' ) . '
    • ' . - '
    • ' . __( 'Code - this is the unique code that customers will enter during checkout to redeem the code.', 'easy-digital-downloads' ) . '
    • ' . - '
    • ' . __( 'Type - this is the type of discount this code awards.', 'easy-digital-downloads' ) . '
    • ' . - '
    • ' . __( 'Amount - this is the discount amount provided by this code. For percentage based discounts, enter a number such as 70 for 70%. Do not enter a percent sign.', 'easy-digital-downloads' ) . '
    • ' . - '
    • ' . __( 'Requirements - this allows you to select the product(s) that are required to be purchased in order for a discount to be applied.', 'easy-digital-downloads' ) . '
    • ' . - '
    • ' . __( 'Condition - this lets you set whether all selected products must be in the cart, or just a minimum of one.', 'easy-digital-downloads' ) . '
    • ' . - '
    • ' . __( 'Apply discount only to selected Downloads? - If this box is checked, only the prices of the required products will be discounted. If left unchecked, the discount will apply to all products in the cart.', 'easy-digital-downloads' ) . '
    • ' . - '
    • ' . __( 'Start Date - this is the date that this code becomes available. If a customer attempts to redeem the code prior to this date, they will be given an error. This is optional.', 'easy-digital-downloads' ) . '
    • ' . - '
    • ' . __( 'Expiration Date - this is the end date for the discount. After this date, the code will no longer be able to be used. This is optional.', 'easy-digital-downloads' ) . '
    • ' . - '
    • ' . __( 'Minimum Amount - this is the minimum purchase amount required to use this code. If a customer has less than this amount in their cart, they will be given an error. This is optional.', 'easy-digital-downloads' ) . '
    • ' . - '
    • ' . __( 'Max Uses - this is the maximum number of times this discount can be redeemed. Once this number is reached, no more customers will be allowed to use it.', 'easy-digital-downloads' ) . '
    • ' . - '
    ' - ) ); - - do_action( 'edd_discounts_contextual_help', $screen ); -} -add_action( 'load-download_page_edd-discounts', 'edd_discounts_contextual_help' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/discount-actions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/discount-actions.php deleted file mode 100644 index 6f57b7ee..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/discount-actions.php +++ /dev/null @@ -1,422 +0,0 @@ - 403 ) ); - } - - // Bail if discount does not exist. - if ( edd_get_discount_by( 'code', $data['code'] ) ) { - edd_redirect( add_query_arg( 'edd-message', 'discount_exists', $data['edd-redirect'] ) ); - } - - // Bail if missing important data. - if ( empty( $data['name'] ) || empty( $data['code'] ) || empty( $data['amount_type'] ) || ( empty( $data['amount'] ) && 0 !== absint( $data['amount'] ) ) ) { - edd_redirect( add_query_arg( 'edd-message', 'discount_validation_failed' ) ); - } - - // Verify only accepted characters. - $sanitized = preg_replace( '/[^a-zA-Z0-9-_]+/', '', $data['code'] ); - if ( strtoupper( $data['code'] ) !== strtoupper( $sanitized ) ) { - edd_redirect( add_query_arg( 'edd-message', 'discount_invalid_code' ) ); - } - - $sanitized_amount = (float) edd_sanitize_amount( $data['amount'] ); - if ( empty( $data['amount'] ) || 0.00 === $sanitized_amount ) { - edd_redirect( add_query_arg( 'edd-message', 'discount_invalid_amount' ) ); - } - - // Setup default discount values. - $to_add = array(); - $to_add['status'] = 'active'; - $current_timestamp = current_time( 'timestamp' ); - - $data = array_filter( $data ); - - foreach ( $data as $column => $value ) { - switch ( $column ) { - - // We skip these here as they are handled below. - case 'start_date': - case 'start': - case 'end_date': - case 'expiration': - break; - - case 'product_reqs': - $to_add[ $column ] = $value; - break; - - case 'amount': - $to_add['amount'] = edd_sanitize_amount( $value ); - break; - - default: - $to_add[ $column ] = is_array( $value ) - ? array_map( 'sanitize_text_field', $value ) - : sanitize_text_field( $value ); - break; - } - } - - // Start date. - if ( ! empty( $data['start_date'] ) ) { - $start_date = sanitize_text_field( $data['start_date'] ); - $start_date_hour = isset( $data['start_date_hour'] ) && (int) $data['start_date_hour'] >= 0 && (int) $data['start_date_hour'] <= 23 - ? intval( $data['start_date_hour'] ) - : '00'; - $start_date_minute = isset( $data['start_date_minute'] ) && (int) $data['start_date_minute'] >= 0 && (int) $data['start_date_minute'] <= 59 - ? intval( $data['start_date_minute'] ) - : '00'; - - $start_date_string = EDD()->utils->get_date_string( - $start_date, - $start_date_hour, - $start_date_minute - ); - // The start date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now. - $to_add['start_date'] = edd_get_utc_date_string( $start_date_string ); - } - - // End date. - if ( ! empty( $data['end_date'] ) ) { - $end_date = sanitize_text_field( $data['end_date'] ); - $end_date_hour = isset( $data['end_date_hour'] ) && (int) $data['end_date_hour'] >= 0 && (int) $data['end_date_hour'] <= 23 - ? intval( $data['end_date_hour'] ) - : '23'; - $end_date_minute = isset( $data['end_date_minute'] ) && (int) $data['end_date_minute'] >= 0 && (int) $data['end_date_minute'] <= 59 - ? intval( $data['end_date_minute'] ) - : '59'; - - $end_date_string = EDD()->utils->get_date_string( - $end_date, - $end_date_hour, - $end_date_minute, - ); - // The end date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now. - $to_add['end_date'] = edd_get_utc_date_string( $end_date_string ); - } - - // Meta values. - $to_add['product_reqs'] = isset( $data['product_reqs'] ) ? wp_parse_id_list( $data['product_reqs'] ) : ''; - $to_add['excluded_products'] = isset( $data['excluded_products'] ) ? wp_parse_id_list( $data['excluded_products'] ) : ''; - - $to_add = array_filter( $to_add ); - - // Strip out data that should not be sent to the query methods. - $to_strip = array( - 'discount-id', - 'edd-redirect', - 'edd-action', - 'edd-discount-nonce', - 'start_date_minute', - 'start_date_hour', - 'end_date_minute', - 'end_date_hour', - ); - - // Loop through fields to update, and unset known bad keys. - foreach ( $to_add as $key => $value ) { - if ( in_array( $key, $to_strip, true ) ) { - unset( $to_add[ $key ] ); - } - } - - // Attempt to add. - $created = edd_add_discount( $to_add ); - $arg = ! empty( $created ) - ? 'discount_added' - : 'discount_add_failed'; - - // Redirect. - edd_redirect( add_query_arg( 'edd-message', sanitize_key( $arg ), $data['edd-redirect'] ) ); -} -add_action( 'edd_add_discount', 'edd_admin_add_discount' ); - -/** - * Saves an edited discount - * - * @since 3.0 - * @param array $data Discount code data - * @return void - */ -function edd_admin_edit_discount( $data = array() ) { - - // Bail if no nonce or nonce fails - if ( ! isset( $data['edd-discount-nonce'] ) || ! wp_verify_nonce( $data['edd-discount-nonce'], 'edd_discount_nonce' ) ) { - return; - } - - // Bail if current user cannot manage shop discounts - if ( ! current_user_can( 'manage_shop_discounts' ) ) { - wp_die( __( 'You do not have permission to edit discount codes', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Bail if discount does not exist - if ( empty( $data['discount-id'] ) ) { - wp_die( __( 'No discount ID supplied', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Setup default discount values - $discount_id = absint( $data['discount-id'] ); - $discount = edd_get_discount( $discount_id ); - - // Bail if no discount - if ( empty( $discount ) || ( $discount->id <= 0 ) ) { - wp_die( __( 'Invalid discount', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $sanitized_amount = (float) edd_sanitize_amount( $data['amount'] ); - if ( empty( $data['amount'] ) || 0.00 === $sanitized_amount ) { - edd_redirect( add_query_arg( 'edd-message', 'discount_invalid_amount' ) ); - } - - // Prepare update - $to_update = array(); - $current_time = current_time( 'timestamp' ); - - $data = array_filter( $data ); - - foreach ( $data as $column => $value ) { - switch ( $column ) { - // We skip these here as they are handled below. - case 'start_date': - case 'start': - case 'end_date': - case 'expiration': - break; - - case 'discount-id': - $to_update['id'] = $value; - break; - - case 'amount': - $to_update['amount'] = edd_sanitize_amount( $value ); - break; - - default: - $to_update[ $column ] = sanitize_text_field( $value ); - break; - } - } - - // Start date. - if ( ! empty( $data['start_date'] ) ) { - $start_date = sanitize_text_field( $data['start_date'] ); - $start_date_hour = isset( $data['start_date_hour'] ) && (int) $data['start_date_hour'] >= 0 && (int) $data['start_date_hour'] <= 23 - ? intval( $data['start_date_hour'] ) - : '00'; - $start_date_minute = isset( $data['start_date_minute'] ) && (int) $data['start_date_minute'] >= 0 && (int) $data['start_date_minute'] <= 59 - ? intval( $data['start_date_minute'] ) - : '00'; - - $start_date_string = EDD()->utils->get_date_string( - $start_date, - $start_date_hour, - $start_date_minute, - ); - - // The start date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now. - $to_update['start_date'] = edd_get_utc_date_string( $start_date_string ); - } else { - $to_update['start_date'] = null; - } - - // End date. - if ( ! empty( $data['end_date'] ) ) { - $end_date = sanitize_text_field( $data['end_date'] ); - $end_date_hour = isset( $data['end_date_hour'] ) && (int) $data['end_date_hour'] >= 0 && (int) $data['end_date_hour'] <= 23 - ? intval( $data['end_date_hour'] ) - : '23'; - $end_date_minute = isset( $data['end_date_minute'] ) && (int) $data['end_date_minute'] >= 0 && (int) $data['end_date_minute'] <= 59 - ? intval( $data['end_date_minute'] ) - : '59'; - - $end_date_string = EDD()->utils->get_date_string( - $end_date, - $end_date_hour, - $end_date_minute - ); - - // The end date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now. - $to_update['end_date'] = edd_get_utc_date_string( $end_date_string ); - } else { - $to_update['end_date'] = null; - } - - // Known & accepted core discount meta - $to_update['product_reqs'] = isset( $data['product_reqs'] ) ? wp_parse_id_list( $data['product_reqs'] ) : ''; - $to_update['excluded_products'] = isset( $data['excluded_products'] ) ? wp_parse_id_list( $data['excluded_products'] ) : ''; - - // "Once per customer" checkbox. - $to_update['once_per_customer'] = isset( $data['once_per_customer'] ) - ? 1 - : 0; - - // Strip out known non-columns - $to_strip = array( - - // Legacy - 'discount-id', - - // Redirect - 'edd-redirect', - 'edd-action', - 'edd-discount-nonce', - '_wp_http_referer', - - // Time - 'start_date_minute', - 'start_date_hour', - 'end_date_minute', - 'end_date_hour' - ); - - // Loop through fields to update, and unset known bad keys - foreach ( $to_update as $key => $value ) { - if ( in_array( $key, $to_strip, true ) ) { - unset( $to_update[ $key ] ); - } - } - - // Attempt to update - $updated = edd_update_discount( $discount_id, $to_update ); - $arg = ! empty( $updated ) - ? 'discount_updated' - : 'discount_not_changed'; - - // Redirect - edd_redirect( add_query_arg( 'edd-message', sanitize_key( $arg ), $data['edd-redirect'] ) ); -} -add_action( 'edd_edit_discount', 'edd_admin_edit_discount' ); - -/** - * Listens for when a discount delete button is clicked and deletes the - * discount code - * - * @since 3.0 - * @param array $data Discount code data - * @uses edd_delete_discount() - * @return void - */ -function edd_admin_delete_discount( $data = array() ) { - - // Bail if no nonce or nonce fails - if ( ! isset( $data['_wpnonce'] ) || ! wp_verify_nonce( $data['_wpnonce'], 'edd_discount_nonce' ) ) { - wp_die( __( 'Trying to cheat or something?', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Bail if current user cannot manage shop - if ( ! current_user_can( 'manage_shop_discounts' ) ) { - wp_die( __( 'You do not have permission to delete discount codes', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Bail if discount does not exist - if ( empty( $data['discount'] ) ) { - wp_die( __( 'No discount ID supplied', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Setup default discount values - $discount_id = absint( $data['discount'] ); - $deleted = edd_delete_discount( $discount_id ); - $arg = ! empty( $deleted ) - ? 'discount_deleted' - : 'discount_deleted_failed'; - - // Redirect - edd_redirect( remove_query_arg( 'edd-action', add_query_arg( 'edd-message', sanitize_key( $arg ), $_SERVER['REQUEST_URI'] ) ) ); -} -add_action( 'edd_delete_discount', 'edd_admin_delete_discount' ); - -/** - * Activates Discount Code - * - * Sets a discount status to active - * - * @since 1.0 - * @param array $data Discount code data - * @uses edd_update_discount_status() - * @return void - */ -function edd_activate_discount( $data = array() ) { - - // Bail if no nonce or nonce fails - if ( ! isset( $data['_wpnonce'] ) || ! wp_verify_nonce( $data['_wpnonce'], 'edd_discount_nonce' ) ) { - wp_die( __( 'Trying to cheat or something?', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Bail if current user cannot manage shop - if( ! current_user_can( 'manage_shop_discounts' ) ) { - wp_die( __( 'You do not have permission to edit discount codes', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $discount_id = absint( $data['discount'] ); - $activated = edd_update_discount_status( $discount_id, 'active' ); - $arg = ! empty( $activated ) - ? 'discount_activated' - : 'discount_activation_failed'; - - // Redirect - edd_redirect( remove_query_arg( 'edd-action', add_query_arg( 'edd-message', sanitize_key( $arg ), $_SERVER['REQUEST_URI'] ) ) ); -} -add_action( 'edd_activate_discount', 'edd_activate_discount' ); - -/** - * Deactivate Discount - * - * Sets a discount status to deactivate - * - * @since 1.0 - * @param array $data Discount code data - * @uses edd_update_discount_status() - * @return void - */ -function edd_deactivate_discount( $data = array() ) { - - // Bail if no nonce or nonce fails - if ( ! isset( $data['_wpnonce'] ) || ! wp_verify_nonce( $data['_wpnonce'], 'edd_discount_nonce' ) ) { - wp_die( __( 'Trying to cheat or something?', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Bail if current user cannot manage shop - if ( ! current_user_can( 'manage_shop_discounts' ) ) { - wp_die( __( 'You do not have permission to create discount codes', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $discount_id = absint( $data['discount'] ); - $activated = edd_update_discount_status( $discount_id, 'inactive' ); - $arg = ! empty( $activated ) - ? 'discount_deactivated' - : 'discount_deactivation_failed'; - - // Redirect - edd_redirect( remove_query_arg( 'edd-action', add_query_arg( 'edd-message', sanitize_key( $arg ), $_SERVER['REQUEST_URI'] ) ) ); -} -add_action( 'edd_deactivate_discount', 'edd_deactivate_discount' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/discount-codes.php b/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/discount-codes.php deleted file mode 100644 index e243d3df..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/discounts/discount-codes.php +++ /dev/null @@ -1,69 +0,0 @@ -prepare_items(); - - do_action( 'edd_discounts_page_top' ); ?> - -
    - search_box( __( 'Search Discounts', 'easy-digital-downloads' ), 'edd-discounts' ); ?> - - - - - views(); - $discount_codes_table->display(); - ?> -
    - - 400 ) ); -} - -// Load discount -$discount_id = absint( $_GET['discount'] ); - -/** @var EDD_Discount */ -$discount = edd_get_discount( $discount_id ); - -// Bail if discount does not exist -if ( empty( $discount ) ) { - wp_die( __( 'Something went wrong.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 400 ) ); -} - -// Setup discount vars -$product_requirements = $discount->get_product_reqs(); -$excluded_products = $discount->get_excluded_products(); -$condition = $discount->get_product_condition(); -$single_use = $discount->get_once_per_customer(); -$type = $discount->get_type(); -$notes = edd_get_discount_notes( $discount->id ); - -// Show/Hide -$flat_display = ( 'flat' === $type ) ? '' : ' style="display:none;"'; -$percent_display = ( 'percent' === $type ) ? '' : ' style="display:none;"'; -$no_notes_display = empty( $notes ) ? '' : ' style="display:none;"'; -$condition_display = ! empty( $product_requirements ) ? '' : ' style="display:none;"'; - -// Dates & times -$discount_start_date = edd_get_edd_timezone_equivalent_date_from_utc( EDD()->utils->date( $discount->start_date, 'utc' ) ); -$discount_end_date = edd_get_edd_timezone_equivalent_date_from_utc( EDD()->utils->date( $discount->end_date, 'utc' ) ); -$start_date = $discount_start_date->format( 'Y-m-d' ); -$start_hour = $discount_start_date->format( 'H' ); -$start_minute = $discount_start_date->format( 'i' ); -$end_date = $discount_end_date->format( 'Y-m-d' ); -$end_hour = $discount_end_date->format( 'H' ); -$end_minute = $discount_end_date->format( 'i' ); -$hours = edd_get_hour_values(); -$minutes = edd_get_minute_values(); -?> -
    -

    - -
    - -
    - id, $discount ); ?> - - - - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - - - - - - id, $discount ); ?> - - - - - - -
    - - - -

    -
    - - - -

    -
    - - - - - - - -

    -
    - - - html->product_dropdown( array( - 'name' => 'product_reqs[]', - 'id' => 'edd_products', - 'selected' => $product_requirements, - 'multiple' => true, - 'chosen' => true, - 'placeholder' => sprintf( __( 'Select %s', 'easy-digital-downloads' ), edd_get_label_plural() ) - ) ); ?> -
    > -

    - -

    -

    -
    - -

    -
    -

    -
    - - - html->product_dropdown( array( - 'name' => 'excluded_products[]', - 'id' => 'excluded_products', - 'selected' => $excluded_products, - 'multiple' => true, - 'chosen' => true, - 'placeholder' => sprintf( __( 'Select %s', 'easy-digital-downloads' ), edd_get_label_plural() ) - ) ); ?> -

    -
    - - - - - - - : - - - - - -

    -
    - - - - - - - : - - - - - -

    -
    - - - -

    -
    - - - -

    -
    - - - /> - -
    - - - -

    -
    - - -
    - - id, 'discount' ); ?> -
    -
    - - id, $discount ); ?> - -

    - - - - - - -

    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/downloads/contextual-help.php b/wp-content/plugins/easy-digital-downloads/includes/admin/downloads/contextual-help.php deleted file mode 100644 index ca5f8b60..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/downloads/contextual-help.php +++ /dev/null @@ -1,128 +0,0 @@ -id != 'download' ) { - return; - } - - $pass_manager = new Pass_Manager(); - if ( $pass_manager->isFree() ) { - $docs_url = edd_link_helper( - 'https://easydigitaldownloads.com/docs/', - array( - 'utm_medium' => 'downloads-contextual-help', - 'utm_content' => 'documentation', - ) - ); - - $upgrade_url = edd_link_helper( - 'https://easydigitaldownloads.com/lite-upgrade/', - array( - 'utm_medium' => 'downloads-contextual-help', - 'utm_content' => 'lite-upgrade', - ) - ); - - $screen->set_help_sidebar( - '

    ' . __( 'For more information:', 'easy-digital-downloads' ) . '

    ' . - '

    ' . sprintf( __( 'Visit the documentation on the Easy Digital Downloads website.', 'easy-digital-downloads' ), $docs_url ) . '

    ' . - '

    ' . sprintf( - __( 'Need more from your Easy Digital Downloads store? Upgrade Now!', 'easy-digital-downloads' ), - $upgrade_url - ) . '

    ' - ); - } - - $screen->add_help_tab( array( - 'id' => 'edd-download-configuration', - 'title' => sprintf( __( '%s Settings', 'easy-digital-downloads' ), edd_get_label_singular() ), - 'content' => - '

    ' . __( 'File Download Limit - Define how many times customers are allowed to download their purchased files. Leave at 0 for unlimited. Resending the purchase receipt will permit the customer one additional download if their limit has already been reached.', 'easy-digital-downloads' ) . '

    ' . - - '

    ' . __( 'Accounting Options - If enabled, define an individual SKU or product number for this download.', 'easy-digital-downloads' ) . '

    ' . - - '

    ' . __( 'Button Options - Disable the automatic output of the purchase button. If disabled, no button will be added to the download page unless the [purchase_link] shortcode is used.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-download-prices', - 'title' => sprintf( __( '%s Prices', 'easy-digital-downloads' ), edd_get_label_singular() ), - 'content' => - '

    ' . __( 'Enable variable pricing - By enabling variable pricing, multiple download options and prices can be configured.', 'easy-digital-downloads' ) . '

    ' . - - '

    ' . __( 'Enable multi-option purchases - By enabling multi-option purchases customers can add multiple variable price items to their cart at once.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-download-files', - 'title' => sprintf( __( '%s Files', 'easy-digital-downloads' ), edd_get_label_singular() ), - 'content' => - '

    ' . __( 'Product Type Options - Choose a default product type or a bundle. Bundled products automatically include access to other download's files when purchased.', 'easy-digital-downloads' ) . '

    ' . - - '

    ' . __( 'File Downloads - Define download file names and their respective file URL. Multiple files can be assigned to a single price, or variable prices.', 'easy-digital-downloads' ) . '

    ' - ) ); - - - $screen->add_help_tab( array( - 'id' => 'edd-product-notes', - 'title' => sprintf( __( '%s Instructions', 'easy-digital-downloads' ), edd_get_label_singular() ), - 'content' => '

    ' . sprintf( __( 'Special instructions for this %s. These will be added to the sales receipt, and may be used by some extensions or themes.', 'easy-digital-downloads' ), strtolower( edd_get_label_singular() ) ) . '

    ' - ) ); - - $colors = array( - 'gray', 'pink', 'blue', 'green', 'teal', 'black', 'dark gray', 'orange', 'purple', 'slate' - ); - - $screen->add_help_tab( array( - 'id' => 'edd-purchase-shortcode', - 'title' => __( 'Purchase Shortcode', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'Purchase Shortcode - If the automatic output of the purchase button has been disabled via the Download Configuration box, a shortcode can be used to output the button or link.', 'easy-digital-downloads' ) . '

    ' . - '

    [purchase_link id="#" price="1" text="Add to Cart" color="blue"]

    ' . - '
      -
    • id - ' . __( 'The ID of a specific download to purchase.', 'easy-digital-downloads' ) . '
    • -
    • price - ' . __( 'Whether to show the price on the purchase button. 1 to show the price, 0 to disable it.', 'easy-digital-downloads' ) . '
    • -
    • text - ' . __( 'The text to be displayed on the button or link.', 'easy-digital-downloads' ) . '
    • -
    • style - ' . __( 'button | text - The style of the purchase link.', 'easy-digital-downloads' ) . '
    • -
    • color - ' . implode( ' | ', $colors ) . '
    • -
    • class - ' . __( 'One or more custom CSS classes you want applied to the button.', 'easy-digital-downloads' ) . '
    • -
    ' . - '

    ' . sprintf( - __( 'For more information, see using Shortcodes on the WordPress.org Codex or Easy Digital Downloads Documentation', 'easy-digital-downloads' ), - 'https://codex.wordpress.org/Shortcode', - 'https://easydigitaldownloads.com/docs/purchase_link-shortcode/' - ) . '

    ' - ) ); - - /** - * Fires off in the EDD Downloads Contextual Help Screen - * - * @since 1.2.3 - * @param object $screen The current admin screen - */ - do_action( 'edd_downloads_contextual_help', $screen ); -} -add_action( 'load-post.php', 'edd_downloads_contextual_help' ); -add_action( 'load-post-new.php', 'edd_downloads_contextual_help' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/downloads/dashboard-columns.php b/wp-content/plugins/easy-digital-downloads/includes/admin/downloads/dashboard-columns.php deleted file mode 100644 index 21d8fd87..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/downloads/dashboard-columns.php +++ /dev/null @@ -1,367 +0,0 @@ - '', - 'title' => __( 'Name', 'easy-digital-downloads' ), - 'download_category' => $category_labels['menu_name'], - 'download_tag' => $tag_labels['menu_name'], - 'price' => __( 'Price', 'easy-digital-downloads' ), - 'sales' => __( 'Net Sales', 'easy-digital-downloads' ), - 'earnings' => __( 'Net Revenue', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ) - ) ); -} -add_filter( 'manage_edit-download_columns', 'edd_download_columns' ); - -/** - * Render Download Columns - * - * @since 1.0 - * @param string $column_name Column name - * @param int $post_id Download (Post) ID - * @return void - */ -function edd_render_download_columns( $column_name, $post_id ) { - - // Bail if not a download - if ( get_post_type( $post_id ) !== 'download' ) { - return; - } - - switch ( $column_name ) { - case 'download_category': - $terms = get_the_term_list( $post_id, 'download_category', '', ', ', ''); - echo ! empty( $terms ) - ? $terms - : '—'; - break; - case 'download_tag': - $terms = get_the_term_list( $post_id, 'download_tag', '', ', ', ''); - echo ! empty( $terms ) - ? $terms - : '—'; - break; - case 'price': - if ( edd_has_variable_prices( $post_id ) ) { - echo edd_price_range( $post_id ); - } else { - echo edd_price( $post_id, false ); - echo ''; - } - break; - case 'sales': - if ( current_user_can( 'view_product_stats', $post_id ) ) { - $sales_url = add_query_arg( array( - 'page' => 'edd-payment-history', - 'product-id' => urlencode( $post_id ) - ), edd_get_admin_base_url() ); - - echo ''; - echo edd_get_download_sales_stats( $post_id ); - echo ''; - } else { - echo '-'; - } - break; - case 'earnings': - if ( current_user_can( 'view_product_stats', $post_id ) ) { - $report_url = edd_get_admin_url( array( - 'page' => 'edd-reports', - 'view' => 'downloads', - 'products' => absint( $post_id ), - ) ); - - echo ''; - echo edd_currency_filter( edd_format_amount( edd_get_download_earnings_stats( $post_id ) ) ); - echo ''; - } else { - echo '-'; - } - break; - } -} -add_action( 'manage_posts_custom_column', 'edd_render_download_columns', 10, 2 ); - -/** - * Registers the sortable columns in the list table - * - * @since 1.0 - * @param array $columns Array of the columns - * @return array $columns Array of sortable columns - */ -function edd_sortable_download_columns( $columns ) { - $columns['price'] = 'price'; - $columns['sales'] = 'sales'; - $columns['earnings'] = 'earnings'; - - return $columns; -} -add_filter( 'manage_edit-download_sortable_columns', 'edd_sortable_download_columns' ); - -/** - * Sorts Columns in the Downloads List Table - * - * @since 1.0 - * @param array $vars Array of all the sort variables - * @return array $vars Array of all the sort variables - */ -function edd_sort_downloads( $vars ) { - // Check if we're viewing the "download" post type - if ( isset( $vars['post_type'] ) && 'download' == $vars['post_type'] ) { - // Check if 'orderby' is set to "sales" - if ( isset( $vars['orderby'] ) && 'sales' == $vars['orderby'] ) { - $vars = array_merge( - $vars, - array( - 'meta_key' => '_edd_download_sales', - 'orderby' => 'meta_value_num' - ) - ); - } - - // Check if "orderby" is set to "earnings" - if ( isset( $vars['orderby'] ) && 'earnings' == $vars['orderby'] ) { - $vars = array_merge( - $vars, - array( - 'meta_key' => '_edd_download_earnings', - 'orderby' => 'meta_value_num' - ) - ); - } - - // Check if "orderby" is set to "earnings" - if ( isset( $vars['orderby'] ) && 'price' == $vars['orderby'] ) { - $vars = array_merge( - $vars, - array( - 'meta_key' => 'edd_price', - 'orderby' => 'meta_value_num' - ) - ); - } - } - - return $vars; -} - -/** - * Sets restrictions on author of Downloads List Table - * - * @since 2.2 - * @param array $vars Array of all sort variables - * @return array Array of all sort variables - */ -function edd_filter_downloads( $vars ) { - if ( isset( $vars['post_type'] ) && 'download' == $vars['post_type'] ) { - - // If an author ID was passed, use it - if ( isset( $_REQUEST['author'] ) && ! current_user_can( 'view_shop_reports' ) ) { - - $author_id = $_REQUEST['author']; - if ( (int) $author_id !== get_current_user_id() ) { - // Tried to view the products of another person, sorry - wp_die( __( 'You do not have permission to view this data.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - $vars = array_merge( - $vars, - array( - 'author' => get_current_user_id() - ) - ); - } - } - - return $vars; -} - -/** - * Download Load - * - * Sorts the downloads. - * - * @since 1.0 - * @return void - */ -function edd_download_load() { - add_filter( 'request', 'edd_sort_downloads' ); - add_filter( 'request', 'edd_filter_downloads' ); -} -add_action( 'load-edit.php', 'edd_download_load', 9999 ); - -/** - * Add Download Filters - * - * Adds taxonomy drop down filters for downloads. - * - * @since 1.0 - * @return void - */ -function edd_add_download_filters() { - global $typenow; - - // Checks if the current post type is 'download'. - if ( 'download' !== $typenow ) { - return; - } - - $category_args = array( - 'taxonomy' => 'download_category', - 'number' => 30, - ); - - $categories = get_terms( $category_args ); - if ( ! empty( $categories ) ) { - $category_labels = edd_get_taxonomy_labels( 'download_category' ); - - $options = array(); - $options[''] = sprintf( _x( 'All %s', 'plural: Example: "All Categories"', 'easy-digital-downloads' ), $category_labels['name'] ); - - // Ensure we include the selected value in the pre-populated list. - $selected = ! empty( $_GET['download_category'] ) ? $_GET['download_category'] : ''; - if ( ! empty( $selected ) ) { - $selected_term = get_term_by( 'slug', $selected, 'download_category' ); - - $options[ $selected_term->slug ] = $selected_term->name . ' (' . $selected_term->count . ')'; - } - - foreach ( $categories as $category ) { - $options[ $category->slug ] = $category->name . ' (' . $category->count . ')'; - } - - echo EDD()->html->select( - array( - 'name' => 'download_category', - 'id' => 'download_category', - 'class' => 'postform', - 'chosen' => true, - 'show_option_all' => false, - 'show_option_none' => false, - 'options' => $options, - 'selected' => $selected, - 'data' => array( - 'placeholder' => sprintf( _x( 'Search %s', 'plural: Example: "Search Download Categories"', 'easy-digital-downloads' ), $category_labels['name'] ), - 'search-type' => 'download_category', - 'search-placeholder' => sprintf( _x( 'Search %s', 'plural: Example: "Search Download Categories"', 'easy-digital-downloads' ), $category_labels['name'] ), - ), - ) - ); - } - - if ( isset( $_REQUEST['all_posts'] ) && '1' === $_REQUEST['all_posts'] ) { - echo ''; - } else if ( ! current_user_can( 'view_shop_reports' ) ) { - $author_id = get_current_user_id(); - echo ''; - } -} -add_action( 'restrict_manage_posts', 'edd_add_download_filters', 100 ); - -/** - * Remove Download Month Filter - * - * Removes the drop down filter for downloads by date. - * - * @author Daniel J Griffiths - * @since 2.1 - * @param array $dates The preset array of dates - * @global $typenow The post type we are viewing - * @return array Empty array disables the dropdown - */ -function edd_remove_month_filter( $dates ) { - global $typenow; - - if ( 'download' === $typenow ) { - $dates = array(); - } - - return $dates; -} -add_filter( 'months_dropdown_results', 'edd_remove_month_filter', 99 ); - -/** - * Adds price field to Quick Edit options - * - * @since 1.1.3.4 - * @param string $column_name Name of the column - * @param string $post_type Current Post Type (i.e. download) - * @return void - */ -function edd_price_field_quick_edit( $column_name, $post_type ) { - - // Bail if not price or download - if ( $column_name !== 'price' || $post_type !== 'download' ) { - return; - } ?> - -
    -
    -

    - -
    -
    -
    - - post_type ) && 'revision' == $post->post_type ) { - return; - } - - if ( ! current_user_can( 'edit_product', $post_id ) ) { - return; - } - - edd_download_meta_box_fields_save( $post_id, $post ); -} - -add_action( 'save_post', 'edd_download_meta_box_save', 10, 2 ); - - -/** - * Save post meta when the save_post action is called - * - * @since 3.2 - * @param int $post_id Download (Post) ID. - * @global array $post All the data of the the current post. - * @return void - */ -function edd_download_meta_box_fields_save( $post_id, $post ) { - if ( ! current_user_can( 'edit_product', $post_id ) ) { - return; - } - - // The default fields that get saved - $fields = edd_download_metabox_fields(); - foreach ( $fields as $field ) { - if ( '_edd_default_price_id' == $field && edd_has_variable_prices( $post_id ) ) { - - if ( isset( $_POST[ $field ] ) ) { - $new_default_price_id = ( ! empty( $_POST[ $field ] ) && is_numeric( $_POST[ $field ] ) ) || ( 0 === (int) $_POST[ $field ] ) ? (int) $_POST[ $field ] : 1; - } else { - $new_default_price_id = 1; - } - - update_post_meta( $post_id, $field, $new_default_price_id ); - } elseif ( '_edd_product_type' === $field && '0' === $_POST[ $field ] ) { - // No value stored when product type is "default" ("0") for backwards compatibility. - delete_post_meta( $post_id, '_edd_product_type' ); - } else { - - $new = false; - if ( ! empty( $_POST[ $field ] ) ) { - $new = apply_filters( 'edd_metabox_save_' . $field, $_POST[ $field ] ); - } - if ( ! empty( $new ) ) { - update_post_meta( $post_id, $field, $new ); - } else { - delete_post_meta( $post_id, $field ); - } - } - } - - if ( edd_has_variable_prices( $post_id ) ) { - $lowest = edd_get_lowest_price_option( $post_id ); - update_post_meta( $post_id, 'edd_price', $lowest ); - } - - do_action( 'edd_save_download', $post_id, $post ); -} - - -/** - * Sanitize bundled products on save - * - * Ensures a user doesn't try and include a product's ID in the products bundled with that product - * - * @since 1.6 - * - * @param array $products - * @return array - */ -function edd_sanitize_bundled_products_save( $products = array() ) { - - $products = array_map( function( $value ) { - return preg_replace( '/[^0-9_]/', '', $value ); - }, (array) $products ); - - foreach ( $products as $key => $value ) { - $underscore_pos = strpos( $value, '_' ); - if ( is_numeric( $underscore_pos ) ) { - $product_id = substr( $value, 0, $underscore_pos ); - } else { - $product_id = $value; - } - - if ( in_array( $product_id, array( 0, get_the_ID() ) ) ) { - unset( $products[ $key ] ); - } - } - - $products = array_unique( $products ); - - return ! empty( $products ) ? array_combine( - range( 1, count( $products ) ), - array_values( $products ) - ) : false; -} -add_filter( 'edd_metabox_save__edd_bundled_products', 'edd_sanitize_bundled_products_save' ); - -/** - * Sanitize bundled products conditions on save - * - * @since 3.1 - * - * @param array $bundled_products_conditions - * @return array - */ -function edd_sanitize_bundled_products_conditions_save( $bundled_products_conditions = array() ) { - return ! empty( $bundled_products_conditions ) ? array_combine( - range( 1, count( $bundled_products_conditions ) ), - array_values( $bundled_products_conditions ) - ) : false; -} -add_filter( 'edd_metabox_save__edd_bundled_products_conditions', 'edd_sanitize_bundled_products_conditions_save' ); - -/** - * Don't save blank rows. - * - * When saving, check the price and file table for blank rows. - * If the name of the price or file is empty, that row should not - * be saved. - * - * @since 1.2.2 - * @param array $new Array of all the meta values - * @return array $new New meta value with empty keys removed - */ -function edd_metabox_save_check_blank_rows( $new ) { - foreach ( $new as $key => $value ) { - if ( empty( $value['name'] ) && empty( $value['amount'] ) && empty( $value['file'] ) ) - unset( $new[ $key ] ); - } - - return $new; -} - -/** Download Configuration ****************************************************/ - -/** - * Download Metabox - * - * Extensions (as well as the core plugin) can add items to the main download - * configuration metabox via the `edd_meta_box_fields` action. - * - * @since 1.0 - * @return void - */ -function edd_render_download_meta_box() { - $post_id = get_the_ID(); - - /* - * Output the price fields - * @since 1.9 - */ - do_action( 'edd_meta_box_price_fields', $post_id ); - - /* - * Output the price fields - * - * Left for backwards compatibility - * - */ - do_action( 'edd_meta_box_fields', $post_id ); - - wp_nonce_field( basename( __FILE__ ), 'edd_download_meta_box_nonce' ); -} - -/** - * Download Files Metabox - * - * @since 1.9 - * @return void - */ -function edd_render_files_meta_box() { - /* - * Output the files fields - * @since 1.9 - */ - do_action( 'edd_meta_box_files_fields', get_the_ID() ); -} - -/** - * Download Settings Metabox - * - * @since 1.9 - * @return void - */ -function edd_render_settings_meta_box() { - /* - * Output the files fields - * @since 1.9 - */ - do_action( 'edd_meta_box_settings_fields', get_the_ID() ); -} - -/** - * Price Section - * - * If variable pricing is not enabled, simply output a single input box. - * - * If variable pricing is enabled, outputs a table of all current prices. - * Extensions can add column heads to the table via the `edd_download_file_table_head` - * hook, and actual columns via `edd_download_file_table_row` - * - * @since 1.0 - * - * @see edd_render_price_row() - * - * @param $post_id - */ -function edd_render_price_field( $post_id ) { - $price = edd_get_download_price( $post_id ); - $variable_pricing = edd_has_variable_prices( $post_id ); - $prices = edd_get_variable_prices( $post_id ); - $single_option_mode = edd_single_price_option_mode( $post_id ); - - $price_display = $variable_pricing ? ' style="display:none;"' : ''; - $variable_display = $variable_pricing ? '' : ' style="display:none;"'; - $currency_position = edd_get_option( 'currency_position', 'before' ); - ?> -

    - -

    - -
    -
    - /> - -
    -
    - -
    > - -
    - 'edd_price', - 'id' => 'edd_price', - 'value' => isset( $price ) ? esc_attr( edd_format_amount( $price ) ) : '', - 'class' => 'edd-form-group__input edd-price-field', - ); - if ( 'before' === $currency_position ) { - ?> - - html->text( $price_args ); - } else { - echo EDD()->html->text( $price_args ); - ?> - - -
    -
    - - - -
    > - -
    -
    - html->checkbox( array( 'name' => '_edd_price_options_mode', 'current' => $single_option_mode, 'class' => 'edd-form-group__input', ) ); ?> - -
    -
    -
    -
    - -
    - $value ) : - $name = ( isset( $value['name'] ) && ! empty( $value['name'] ) ) ? $value['name'] : ''; - $index = ( isset( $value['index'] ) && $value['index'] !== '' ) ? $value['index'] : $key; - $amount = isset( $value['amount'] ) ? $value['amount'] : ''; - $args = apply_filters( 'edd_price_row_args', compact( 'name', 'amount' ), $value ); - ?> -
    - -
    - -
    - -
    - - -
    - -
    - -
    -
    -
    -
    - null, - 'amount' => null - ); - - $args = wp_parse_args( $args, $defaults ); - - $default_price_id = edd_get_default_variable_price( $post_id ); - $currency_position = edd_get_option( 'currency_position', 'before' ); - $custom_price_options = isset( $wp_filter['edd_download_price_option_row'] ) ? true : false; - ?> -
    - - ' . esc_html( $key ) . '' ); ?> - - - ' . __( 'Show advanced settings', 'easy-digital-downloads' ) . ''; - } - - $actions['remove'] = '' . sprintf( __( 'Remove', 'easy-digital-downloads' ), esc_html( $key ) ) . '' . sprintf( __( 'Remove price option %s', 'easy-digital-downloads' ), esc_html( $key ) ) . ''; - ?> - - - -
    - -
    - -
    - -
    - html->text( array( - 'name' => 'edd_variable_prices[' . $key . '][name]', - 'id' => 'edd_variable_prices-' . $key . '-name', - 'value' => esc_attr( $args['name'] ), - 'placeholder' => __( 'Option Name', 'easy-digital-downloads' ), - 'class' => 'edd_variable_prices_name large-text' - ) ); ?> -
    -
    - -
    - - 'edd_variable_prices[' . $key . '][amount]', - 'id' => 'edd_variable_prices-' . $key . '-amount', - 'value' => $args['amount'], - 'placeholder' => edd_format_amount( 9.99 ), - 'class' => 'edd-form-group__input edd-price-field', - ); - ?> - -
    - - - html->text( $price_args ); - } else { - echo EDD()->html->text( $price_args ); - ?> - - -
    -
    - -
    -
    - - class="edd_repeatable_default_input" name="_edd_default_price_id" id="edd_default_price_id_" value="" /> - -
    -
    - -
    - - - -
    -
    - -
    -
    - - -
    - -
    - html->select( - array( - 'options' => $types, - 'name' => '_edd_product_type', - 'id' => '_edd_product_type', - 'selected' => $type, - 'show_option_all' => false, - 'show_option_none' => false, - 'class' => 'edd-form-group__input', - ) - ); - ?> - - -
    -
    - get_type(); - $display = $type == 'bundle' ? '' : ' style="display:none;"'; - $products = $download->get_bundled_downloads(); - $variable_pricing = $download->has_variable_prices(); - $variable_display = $variable_pricing ? '' : 'display:none;'; - $variable_class = $variable_pricing ? ' has-variable-pricing' : ''; - $prices = $download->get_prices(); - $bundle_options = EDD()->html->get_products( - array( - 'bundles' => false, - ) - ); - ?> - -
    > -
    -
    - - - -
    - - - -
    - -
    - - - $product ) : ?> -
    -
    -
    - - -
    -
    - -
    - html->product_dropdown( - array( - 'name' => '_edd_bundled_products[' . $index . ']', - 'id' => 'edd_bundled_products_' . esc_attr( $index ), - 'selected' => $product, - 'multiple' => false, - 'chosen' => true, - 'products' => $bundle_options, - 'variations' => true, - 'show_variations_only' => false, - 'class' => 'edd-form-group__input', - ) - ); - ?> -
    -
    -
    - -
    - $price ) { - $options[ $price_key ] = $prices[ $price_key ]['name']; - } - } - - $price_assignments = edd_get_bundle_pricing_variations( $post_id ); - if ( ! empty( $price_assignments[0] ) ) { - $price_assignments = $price_assignments[0]; - } - - $selected = isset( $price_assignments[ $index ] ) ? $price_assignments[ $index ] : null; - - echo EDD()->html->select( array( - 'name' => '_edd_bundled_products_conditions[' . $index . ']', - 'id' => 'edd_bundled_products_conditions_'. esc_attr( $index ), - 'class' => 'edd_repeatable_condition_field', - 'options' => $options, - 'show_option_none' => false, - 'selected' => $selected - ) ); - ?> -
    -
    -
    - -
    - -
    -
    - - - - - -
    - -
    -
    -
    - -
    - - -
    -
    - -
    - html->product_dropdown( array( - 'name' => '_edd_bundled_products[1]', - 'id' => 'edd_bundled_products_1', - 'multiple' => false, - 'chosen' => true, - 'products' => $bundle_options, - 'variations' => true, - 'show_variations_only' => false, - ) ); - ?> -
    -
    -
    - -
    - $price ) { - $options[ $price_key ] = $prices[ $price_key ]['name']; - } - } - - $price_assignments = edd_get_bundle_pricing_variations( $post_id ); - - echo EDD()->html->select( array( - 'name' => '_edd_bundled_products_conditions[1]', - 'id' => 'edd_bundled_products_conditions_1', - 'class' => 'edd-form-group__input edd_repeatable_condition_field', - 'options' => $options, - 'show_option_none' => false, - 'selected' => null, - ) ); - ?> -
    -
    -
    - -
    - -
    -
    - - - -
    - -
    - -
    -
    -
    -
    - - -
    > -
    -
    - -
    - $value ) : - $index = isset( $value['index'] ) ? $value['index'] : $key; - $name = isset( $value['name'] ) ? $value['name'] : ''; - $file = isset( $value['file'] ) ? $value['file'] : ''; - $condition = isset( $value['condition'] ) ? $value['condition'] : false; - $thumbnail_size = isset( $value['thumbnail_size'] ) ? $value['thumbnail_size'] : ''; - $attachment_id = isset( $value['attachment_id'] ) ? absint( $value['attachment_id'] ) : false; - - $args = apply_filters( 'edd_file_row_args', compact( 'name', 'file', 'condition', 'attachment_id', 'thumbnail_size' ), $value ); ?> - -
    - -
    - - - -
    - -
    - - - -
    - -
    - -
    -
    -
    -
    - null, - 'file' => null, - 'condition' => null, - 'attachment_id' => null, - 'thumbnail_size' => null, - ) ); - - $prices = edd_get_variable_prices( $post_id ); - $variable_pricing = edd_has_variable_prices( $post_id ); - $variable_display = $variable_pricing ? '' : ' style="display:none;"'; - $variable_class = $variable_pricing ? ' has-variable-pricing' : ''; ?> - -
    - - ' . esc_html( $key ) . '' ); ?> - - - - - - - -
    - -
    -
    - -
    - - - html->text( array( - 'name' => 'edd_download_files[' . $key . '][name]', - 'id' => 'edd_download_files-' . $key . '-name', - 'value' => $args['name'], - 'placeholder' => __( 'My Neat File', 'easy-digital-downloads' ), - 'class' => 'edd-form-group__input edd_repeatable_name_field large-text', - ) ); ?> -
    -
    - -
    - -
    - html->text( array( - 'name' => 'edd_download_files[' . $key . '][file]', - 'id' => 'edd_download_files-' . $key . '-file', - 'value' => $args['file'], - 'placeholder' => __( 'Enter, upload, choose from Media Library', 'easy-digital-downloads' ), - 'class' => 'edd-form-group__input edd_repeatable_upload_field edd_upload_field large-text', - ) ); ?> - - - - -
    -
    - -
    > - - -
    - $price ) { - $options[ $price_key ] = $prices[ $price_key ]['name']; - } - } - - echo EDD()->html->select( array( - 'name' => 'edd_download_files[' . $key . '][condition]', - 'id' => 'edd_download_files-' . $key . '-condition', - 'class' => 'edd-form-group__input edd_repeatable_condition_field', - 'options' => $options, - 'selected' => $args['condition'], - 'show_option_none' => false, - ) ); - ?> -
    -
    - - - -
    -post_type !== 'download' ) ) { - return $strings; - } - - $downloads_object = get_post_type_object( 'download' ); - $labels = $downloads_object->labels; - - $strings['insertIntoPost'] = sprintf( __( 'Insert into %s', 'easy-digital-downloads' ), strtolower( $labels->singular_name ) ); - - return $strings; -} -add_filter( 'media_view_strings', 'edd_download_media_strings', 10, 1 ); - -/** - * Refund Window - * - * The refund window is the maximum number of days each - * can be downloaded by the buyer - * - * @since 3.0 - * @param int $post_id Download (Post) ID - * @return void - */ -function edd_render_refund_row( $post_id ) { - - // Bail if user cannot manage shop settings - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - $types = edd_get_refundability_types(); - $global_ability = edd_get_option( 'refundability', 'refundable' ); - $refundability = edd_get_download_refundability( $post_id ); - $global_window = edd_get_option( 'refund_window', 30 ); - $edd_refund_window = edd_get_download_refund_window( $post_id ); ?> - -
    -
    - - -
    - -
    - - html->select( array( - 'name' => '_edd_refundability', - 'id' => 'edd_refundability', - 'class' => 'edd-form-group__input', - 'options' => array_merge( - // Manually define a "none" option to set a blank value, vs. -1. - array( - '' => sprintf( - /* translators: Default refund status */ - esc_html_x( 'Default (%1$s)', 'Download refund status', 'easy-digital-downloads' ), - ucwords( $refundability ) - ), - ), - $types - ), - // Use the direct meta value to avoid falling back to default. - 'selected' => get_post_meta( $post_id, '_edd_refundability', true ), - 'show_option_all' => '', - 'show_option_none' => false, - ) ); ?> -
    - -
    - - - -
    -

    - 0 for unlimited', 'easy-digital-downloads' ); ?> -

    -
    - -
    > -
    - - -
    -

    - 0 for unlimited', 'easy-digital-downloads' ); ?> -

    -
    - - -
    -
    -
    - html->checkbox( - array( - 'name' => '_edd_download_tax_exclusive', - 'id' => '_edd_download_tax_exclusive', - 'current' => $exclusive, - 'class' => 'edd-form-group__input', - ) - ); ?> - -
    -
    - - -
    -
    -
    - html->checkbox( - array( - 'name' => '_edd_quantities_disabled', - 'id' => '_edd_quantities_disabled', - 'current' => $disabled, - 'class' => 'edd-form-group__input', - ) - ); - ?> - -
    -
    - - - -
    -
    - - -
    -
    - - -
    -
    -
    - - html->text( - array( - 'name' => 'edd_sku', - 'id' => 'edd_sku', - 'value' => $edd_sku, - 'class' => 'edd-form-group__input small-text', - ) - ); - ?> -
    -
    -Purchase button behavior: Add to Cart buttons follow a traditional eCommerce flow. A Buy Now button bypasses most of the process, taking the customer directly from button click to payment, greatly speeding up the process of buying the product.', 'easy-digital-downloads' ); - $no_buy_now_support_tooltip = __( 'Purchase button behavior: Add to Cart buttons follow a traditional eCommerce flow. Buy Now buttons are only available for stores that have a single supported gateway active and that do not use taxes.', 'easy-digital-downloads' ); - ?> - -
    -
    -
    - html->checkbox( - array( - 'name' => '_edd_hide_purchase_link', - 'id' => '_edd_hide_purchase_link', - 'current' => $hide_button, - 'class' => 'edd-form-group__input', - ) - ); - ?> - -
    - -
    - - '_edd_button_behavior', - 'id' => 'edd_button_behavior', - 'selected' => $behavior, - 'options' => array( - 'add_to_cart' => __( 'Add to Cart', 'easy-digital-downloads' ), - 'direct' => __( 'Buy Now', 'easy-digital-downloads' ), - ), - 'show_option_all' => null, - 'show_option_none' => null, - 'class' => 'edd-form-group__input', - ); - echo EDD()->html->select( $args ); - ?> -
    - -
    - - -
    -
    - - -
    -

    -
    - 'edd-payment-history', - 'product-id' => urlencode( $post_id ) - ), edd_get_admin_base_url() ); - - $earnings_report_url = edd_get_admin_url( array( - 'page' => 'edd-reports', - 'view' => 'downloads', - 'products' => absint( $post_id ), - ) ); - ?> - -

    - - -

    - -

    - - -

    - -
    - -

    - 'edd-tools', - 'view' => 'file_downloads', - 'tab' => 'logs', - 'download' => absint( $post_id ), - ) - ); - ?> -
    -

    - 'error', - 'message' => __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), - ) - ); - } - - add_action( 'wp_mail_failed', array( $this, 'mail_failed' ) ); - - $output = array( - 'status' => 'success', - 'message' => __( 'The test Email Summary was sent successfully!', 'easy-digital-downloads' ), - ); - $email = new EDD_Email_Summary( true ); - $email_status = $email->send_email(); - if ( ! $email_status ) { - $output['status'] = 'error'; - - // Generic error. - $output['message'] = __( 'There was an unknown problem while sending test Email Summary!', 'easy-digital-downloads' ); - - // SMTP error. - if ( $this->mail_smtp_error ) { - $output['message'] = $this->mail_smtp_error; - } - } - - echo wp_json_encode( $output ); - edd_die(); - } - - /** - * Get error message from failed SMTP. - * - * @since 3.1 - * - * @param \WP_Error $error The WP Error thrown in WP core: `wp_mail_failed` hook. - */ - public function mail_failed( $error ) { - if ( ! is_wp_error( $error ) ) { - return; - } - - $this->mail_smtp_error = $error->get_error_message(); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/import/class-batch-import-downloads.php b/wp-content/plugins/easy-digital-downloads/includes/admin/import/class-batch-import-downloads.php deleted file mode 100644 index c6281a41..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/import/class-batch-import-downloads.php +++ /dev/null @@ -1,567 +0,0 @@ -field_mapping = array( - 'post_title' => '', - 'post_name' => '', - 'post_status' => 'draft', - 'post_author' => '', - 'post_date' => '', - 'post_content' => '', - 'post_excerpt' => '', - 'price' => '', - 'files' => '', - 'categories' => '', - 'tags' => '', - 'sku' => '', - 'earnings' => '', - 'sales' => '', - 'featured_image' => '', - 'download_limit' => '', - 'notes' => '' - ); - } - - /** - * Process a step - * - * @since 2.6 - * @return bool - */ - public function process_step() { - - $more = false; - - if ( ! $this->can_import() ) { - wp_die( __( 'You do not have permission to import data.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $i = 1; - $offset = $this->step > 1 ? ( $this->per_step * ( $this->step - 1 ) ) : 0; - - if( $offset > $this->total ) { - $this->done = true; - - // Delete the uploaded CSV file. - unlink( $this->file ); - } - - if( ! $this->done && $this->csv ) { - - $more = true; - - foreach( $this->csv as $key => $row ) { - - // Skip all rows until we pass our offset - if( $key + 1 <= $offset ) { - continue; - } - - // Done with this batch - if( $i > $this->per_step ) { - break; - } - - // Import Download - $args = array( - 'post_type' => 'download', - 'post_title' => '', - 'post_name' => '', - 'post_status' => '', - 'post_author' => '', - 'post_date' => '', - 'post_content' => '', - 'post_excerpt' => '' - ); - - foreach ( $args as $key => $field ) { - if ( ! empty( $this->field_mapping[ $key ] ) && ! empty( $row[ $this->field_mapping[ $key ] ] ) ) { - $args[ $key ] = $row[ $this->field_mapping[ $key ] ]; - } - } - - if ( empty( $args['post_author'] ) ) { - $user = wp_get_current_user(); - $args['post_author'] = $user->ID; - } else { - - // Check all forms of possible user inputs, email, ID, login. - if ( is_email( $args['post_author'] ) ) { - $user = get_user_by( 'email', $args['post_author'] ); - } elseif ( is_numeric( $args['post_author'] ) ) { - $user = get_user_by( 'ID', $args['post_author'] ); - } else { - $user = get_user_by( 'login', $args['post_author'] ); - } - - // If we don't find one, resort to the logged in user. - if ( false === $user ) { - $user = wp_get_current_user(); - } - - $args['post_author'] = $user->ID; - } - - // Format the date properly - if ( ! empty( $args['post_date'] ) ) { - - $timestamp = strtotime( $args['post_date'], current_time( 'timestamp' ) ); - $date = date( 'Y-m-d H:i:s', $timestamp ); - - // If the date provided results in a date string, use it, or just default to today so it imports - if ( ! empty( $date ) ) { - $args['post_date'] = $date; - } else { - $date = ''; - } - - } - - - // Detect any status that could map to `publish` - if ( ! empty( $args['post_status'] ) ) { - - $published_statuses = array( - 'live', - 'published', - ); - - $current_status = strtolower( $args['post_status'] ); - - if ( in_array( $current_status, $published_statuses ) ) { - $args['post_status'] = 'publish'; - } - - } - - $download_id = wp_insert_post( $args ); - - // setup categories - if( ! empty( $this->field_mapping['categories'] ) && ! empty( $row[ $this->field_mapping['categories'] ] ) ) { - - $categories = $this->str_to_array( $row[ $this->field_mapping['categories'] ] ); - - $this->set_taxonomy_terms( $download_id, $categories, 'download_category' ); - - } - - // setup tags - if( ! empty( $this->field_mapping['tags'] ) && ! empty( $row[ $this->field_mapping['tags'] ] ) ) { - - $tags = $this->str_to_array( $row[ $this->field_mapping['tags'] ] ); - - $this->set_taxonomy_terms( $download_id, $tags, 'download_tag' ); - - } - - // setup price(s) - if( ! empty( $this->field_mapping['price'] ) && ! empty( $row[ $this->field_mapping['price'] ] ) ) { - - $price = $row[ $this->field_mapping['price'] ]; - - $this->set_price( $download_id, $price ); - - } - - // setup files - if( ! empty( $this->field_mapping['files'] ) && ! empty( $row[ $this->field_mapping['files'] ] ) ) { - - $files = $this->convert_file_string_to_array( $row[ $this->field_mapping['files'] ] ); - - $this->set_files( $download_id, $files ); - - } - - // Product Image - if( ! empty( $this->field_mapping['featured_image'] ) && ! empty( $row[ $this->field_mapping['featured_image'] ] ) ) { - - $image = sanitize_text_field( $row[ $this->field_mapping['featured_image'] ] ); - - $this->set_image( $download_id, $image, $args['post_author'] ); - - } - - // File download limit - if( ! empty( $this->field_mapping['download_limit'] ) && ! empty( $row[ $this->field_mapping['download_limit'] ] ) ) { - - update_post_meta( $download_id, '_edd_download_limit', absint( $row[ $this->field_mapping['download_limit'] ] ) ); - } - - // Sale count - if( ! empty( $this->field_mapping['sales'] ) && ! empty( $row[ $this->field_mapping['sales'] ] ) ) { - - update_post_meta( $download_id, '_edd_download_sales', absint( $row[ $this->field_mapping['sales'] ] ) ); - } - - // Earnings - if( ! empty( $this->field_mapping['earnings'] ) && ! empty( $row[ $this->field_mapping['earnings'] ] ) ) { - - update_post_meta( $download_id, '_edd_download_earnings', edd_sanitize_amount( $row[ $this->field_mapping['earnings'] ] ) ); - } - - // Notes - if( ! empty( $this->field_mapping['notes'] ) && ! empty( $row[ $this->field_mapping['notes'] ] ) ) { - - update_post_meta( $download_id, 'edd_product_notes', sanitize_text_field( $row[ $this->field_mapping['notes'] ] ) ); - } - - // SKU - if( ! empty( $this->field_mapping[ 'sku' ] ) && ! empty( $row[ $this->field_mapping[ 'sku' ] ] ) ) { - - update_post_meta( $download_id, 'edd_sku', sanitize_text_field( $row[ $this->field_mapping['sku'] ] ) ); - } - - // Custom fields - - - $i++; - } - - } - - return $more; - } - - /** - * Return the calculated completion percentage - * - * @since 2.6 - * @return int - */ - public function get_percentage_complete() { - - $percentage = 0; - if ( $this->total > 0 ) { - $percentage = ( $this->step * $this->per_step / $this->total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set up and store the price for the download - * - * @since 2.6 - * @return void - */ - private function set_price( $download_id = 0, $price = '' ) { - - if( is_numeric( $price ) ) { - - update_post_meta( $download_id, 'edd_price', edd_sanitize_amount( $price ) ); - - } else { - - $prices = $this->str_to_array( $price ); - - if( ! empty( $prices ) ) { - - $variable_prices = array(); - $price_id = 1; - foreach( $prices as $price ) { - - // See if this matches the EDD Download export for variable prices - if( false !== strpos( $price, ':' ) ) { - - $price = array_map( 'trim', explode( ':', $price ) ); - - $variable_prices[ $price_id ] = array( 'name' => $price[ 0 ], 'amount' => $price[ 1 ] ); - $price_id++; - - } - - } - - update_post_meta( $download_id, '_variable_pricing', 1 ); - update_post_meta( $download_id, 'edd_variable_prices', $variable_prices ); - - } - - } - - } - - /** - * Set up and store the file downloads - * - * @since 2.6 - * @return void - */ - private function set_files( $download_id = 0, $files = array() ) { - - if( ! empty( $files ) ) { - - $download_files = array(); - $file_id = 1; - foreach( $files as $file ) { - - $condition = ''; - - if ( false !== strpos( $file, ';' ) ) { - - $split_on = strpos( $file, ';' ); - $file_url = substr( $file, 0, $split_on ); - $condition = substr( $file, $split_on + 1 ); - - } else { - - $file_url = $file; - - } - - $download_file_args = array( - 'index' => $file_id, - 'file' => $file_url, - 'name' => basename( $file_url ), - 'condition' => empty( $condition ) ? 'all' : $condition - ); - - $download_files[ $file_id ] = $download_file_args; - $file_id++; - - } - - update_post_meta( $download_id, 'edd_download_files', $download_files ); - - } - - } - - /** - * Set up and store the Featured Image - * - * @since 2.6 - * @return void - */ - private function set_image( $download_id = 0, $image = '', $post_author = 0 ) { - - $is_url = false !== filter_var( $image, FILTER_VALIDATE_URL ); - $is_local = $is_url && false !== strpos( $image, site_url() ); - $ext = edd_get_file_extension( $image ); - - if( $is_url && $is_local ) { - - // Image given by URL, see if we have an attachment already - $attachment_id = attachment_url_to_postid( $image ); - - } elseif( $is_url ) { - - if( ! function_exists( 'media_sideload_image' ) ) { - - require_once( ABSPATH . 'wp-admin/includes/file.php' ); - - } - - // Image given by external URL - $url = media_sideload_image( $image, $download_id, '', 'src' ); - - if( ! is_wp_error( $url ) ) { - - $attachment_id = attachment_url_to_postid( $url ); - - } - - - } elseif( false === strpos( $image, '/' ) && edd_get_file_extension( $image ) ) { - - // Image given by name only - - $upload_dir = wp_upload_dir(); - - if( file_exists( trailingslashit( $upload_dir['path'] ) . $image ) ) { - - // Look in current upload directory first - $file = trailingslashit( $upload_dir['path'] ) . $image; - - } else { - - // Now look through year/month sub folders of upload directory for files with our image's same extension - $files = glob( $upload_dir['basedir'] . '/*/*/*' . $ext ); - foreach( $files as $file ) { - - if( basename( $file ) == $image ) { - - // Found our file - break; - - } - - // Make sure $file is unset so our empty check below does not return a false positive - unset( $file ); - - } - - } - - if( ! empty( $file ) ) { - - // We found the file, let's see if it already exists in the media library - - $guid = str_replace( $upload_dir['basedir'], $upload_dir['baseurl'], $file ); - $attachment_id = attachment_url_to_postid( $guid ); - - - if( empty( $attachment_id ) ) { - - // Doesn't exist in the media library, let's add it - - $filetype = wp_check_filetype( basename( $file ), null ); - - // Prepare an array of post data for the attachment. - $attachment = array( - 'guid' => $guid, - 'post_mime_type' => $filetype['type'], - 'post_title' => preg_replace( '/\.[^.]+$/', '', $image ), - 'post_content' => '', - 'post_status' => 'inherit', - 'post_author' => $post_author - ); - - // Insert the attachment. - $attachment_id = wp_insert_attachment( $attachment, $file, $download_id ); - - // Make sure that this file is included, as wp_generate_attachment_metadata() depends on it. - require_once( ABSPATH . 'wp-admin/includes/image.php' ); - - // Generate the metadata for the attachment, and update the database record. - $attach_data = wp_generate_attachment_metadata( $attachment_id, $file ); - wp_update_attachment_metadata( $attachment_id, $attach_data ); - - } - - } - - } - - if( ! empty( $attachment_id ) ) { - - return set_post_thumbnail( $download_id, $attachment_id ); - - } - - return false; - - } - - /** - * Set up and taxonomy terms - * - * @since 2.6 - * @return void - */ - private function set_taxonomy_terms( $download_id = 0, $terms = array(), $taxonomy = 'download_category' ) { - - $terms = $this->maybe_create_terms( $terms, $taxonomy ); - - if( ! empty( $terms ) ) { - - wp_set_object_terms( $download_id, $terms, $taxonomy ); - - } - - } - - /** - * Locate term IDs or create terms if none are found - * - * @since 2.6 - * @return array - */ - private function maybe_create_terms( $terms = array(), $taxonomy = 'download_category' ) { - - // Return of term IDs - $term_ids = array(); - - foreach( $terms as $term ) { - - if( is_numeric( $term ) && 0 === (int) $term ) { - - $t = get_term( $term, $taxonomy ); - - } else { - - $t = get_term_by( 'name', $term, $taxonomy ); - - if( ! $t ) { - - $t = get_term_by( 'slug', $term, $taxonomy ); - - } - - } - - if( ! empty( $t ) ) { - - $term_ids[] = $t->term_id; - - } else { - - $term_data = wp_insert_term( $term, $taxonomy, array( 'slug' => sanitize_title( $term ) ) ); - - if( ! is_wp_error( $term_data ) ) { - - $term_ids[] = $term_data['term_id']; - - } - - } - - } - - return array_map( 'absint', $term_ids ); - } - - /** - * Retrieve URL to Downloads list table - * - * @since 2.6 - * @return string - */ - public function get_list_table_url() { - return edd_get_admin_base_url(); - } - - /** - * Retrieve Download label - * - * @since 2.6 - * @return void - */ - public function get_import_type_label() { - return edd_get_label_plural( true ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/import/class-batch-import-payments.php b/wp-content/plugins/easy-digital-downloads/includes/admin/import/class-batch-import-payments.php deleted file mode 100644 index 0ce839bf..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/import/class-batch-import-payments.php +++ /dev/null @@ -1,644 +0,0 @@ -per_step = 5; - - // Set up default field map values - $this->field_mapping = array( - 'total' => '', - 'subtotal' => '', - 'tax' => 'draft', - 'number' => '', - 'mode' => '', - 'gateway' => '', - 'date' => '', - 'status' => '', - 'email' => '', - 'name' => '', - 'first_name' => '', - 'last_name' => '', - 'edd_customer_id' => '', - 'user_id' => '', - 'discounts' => '', - 'key' => '', - 'transaction_id' => '', - 'ip' => '', - 'currency' => '', - 'parent_payment_id' => '', - 'downloads' => '', - 'line1' => '', - 'line2' => '', - 'city' => '', - 'state' => '', - 'zip' => '', - 'country' => '', - ); - } - - /** - * Process a step - * - * @since 2.6 - * @return bool - */ - public function process_step() { - - $more = false; - - if ( ! $this->can_import() ) { - wp_die( __( 'You do not have permission to import data.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Remove certain actions to ensure they don't fire when creating the payments - remove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999 ); - remove_action( 'edd_admin_sale_notice', 'edd_admin_email_notice', 10 ); - - $i = 1; - $offset = $this->step > 1 ? ( $this->per_step * ( $this->step - 1 ) ) : 0; - - if( $offset > $this->total ) { - $this->done = true; - - // Clean up the temporary records in the payment import process - global $wpdb; - $sql = "DELETE FROM {$wpdb->prefix}edd_customermeta WHERE meta_key = '_canonical_import_id'"; - $wpdb->query( $sql ); - - // Delete the uploaded CSV file. - unlink( $this->file ); - } - - if( ! $this->done && $this->csv ) { - - $more = true; - - foreach( $this->csv as $key => $row ) { - - // Skip all rows until we pass our offset - if( $key + 1 <= $offset ) { - continue; - } - - // Done with this batch - if( $i > $this->per_step ) { - break; - } - - // Import payment - $this->create_payment( $row ); - - $i++; - } - - } - - return $more; - } - - /** - * Set up and store a payment record from a CSV row - * - * @since 2.6 - * @return void - */ - public function create_payment( $row = array() ) { - - $payment = new EDD_Payment; - $payment->status = 'pending'; - - if( ! empty( $this->field_mapping['number'] ) && ! empty( $row[ $this->field_mapping['number'] ] ) ) { - - $payment->number = sanitize_text_field( $row[ $this->field_mapping['number'] ] ); - - } - - if( ! empty( $this->field_mapping['mode'] ) && ! empty( $row[ $this->field_mapping['mode'] ] ) ) { - - $mode = strtolower( sanitize_text_field( $row[ $this->field_mapping['mode'] ] ) ); - $mode = 'test' != $mode && 'live' != $mode ? false : $mode; - if( ! $mode ) { - $mode = edd_is_test_mode() ? 'test' : 'live'; - } - - $payment->mode = $mode; - - } - - if( ! empty( $this->field_mapping['date'] ) && ! empty( $row[ $this->field_mapping['date'] ] ) ) { - - $date = sanitize_text_field( $row[ $this->field_mapping['date'] ] ); - - if( ! strtotime( $date ) ) { - - $date = date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ); - - } else { - - $date = date( 'Y-m-d H:i:s', strtotime( $date ) ); - - } - - $payment->date = $date; - - } - - $payment->customer_id = $this->set_customer( $row ); - - if( ! empty( $this->field_mapping['email'] ) && ! empty( $row[ $this->field_mapping['email'] ] ) ) { - - $payment->email = sanitize_text_field( $row[ $this->field_mapping['email'] ] ); - - } - - if ( ! empty( $this->field_mapping['name'] ) && ! empty( $row[ $this->field_mapping['name'] ] ) ) { - - $payment->name = sanitize_text_field( $row[ $this->field_mapping['name'] ] ); - - } else { - - if ( ! empty( $this->field_mapping['first_name'] ) && ! empty( $row[ $this->field_mapping['first_name'] ] ) ) { - - $payment->first_name = sanitize_text_field( $row[ $this->field_mapping['first_name'] ] ); - - } - - if ( ! empty( $this->field_mapping['last_name'] ) && ! empty( $row[ $this->field_mapping['last_name'] ] ) ) { - - $payment->last_name = sanitize_text_field( $row[ $this->field_mapping['last_name'] ] ); - - } - } - - if( ! empty( $this->field_mapping['user_id'] ) && ! empty( $row[ $this->field_mapping['user_id'] ] ) ) { - - $user_id = sanitize_text_field( $row[ $this->field_mapping['user_id'] ] ); - - if( is_numeric( $user_id ) ) { - - $user_id = absint( $row[ $this->field_mapping['user_id'] ] ); - $user = get_userdata( $user_id ); - - } elseif( is_email( $user_id ) ) { - - $user = get_user_by( 'email', $user_id ); - - } else { - - $user = get_user_by( 'login', $user_id ); - - } - - if( $user ) { - - $payment->user_id = $user->ID; - - $customer = new EDD_Customer( $payment->customer_id ); - - if( empty( $customer->user_id ) ) { - $customer->update( array( 'user_id' => $user->ID ) ); - } - - } - - } - - if( ! empty( $this->field_mapping['discounts'] ) && ! empty( $row[ $this->field_mapping['discounts'] ] ) ) { - - $payment->discounts = sanitize_text_field( $row[ $this->field_mapping['discounts'] ] ); - - } - - if( ! empty( $this->field_mapping['transaction_id'] ) && ! empty( $row[ $this->field_mapping['transaction_id'] ] ) ) { - - $payment->transaction_id = sanitize_text_field( $row[ $this->field_mapping['transaction_id'] ] ); - - } - - if( ! empty( $this->field_mapping['ip'] ) && ! empty( $row[ $this->field_mapping['ip'] ] ) ) { - - $payment->ip = sanitize_text_field( $row[ $this->field_mapping['ip'] ] ); - - } - - if( ! empty( $this->field_mapping['gateway'] ) && ! empty( $row[ $this->field_mapping['gateway'] ] ) ) { - - $gateways = edd_get_payment_gateways(); - $gateway = strtolower( sanitize_text_field( $row[ $this->field_mapping['gateway'] ] ) ); - - if( ! array_key_exists( $gateway, $gateways ) ) { - - foreach( $gateways as $key => $enabled_gateway ) { - - if( $enabled_gateway['checkout_label'] == $gateway ) { - - $gateway = $key; - break; - - } - - } - - } - - $payment->gateway = $gateway; - - } - - if( ! empty( $this->field_mapping['currency'] ) && ! empty( $row[ $this->field_mapping['currency'] ] ) ) { - - $payment->currency = strtoupper( sanitize_text_field( $row[ $this->field_mapping['currency'] ] ) ); - - } - - if( ! empty( $this->field_mapping['key'] ) && ! empty( $row[ $this->field_mapping['key'] ] ) ) { - - $payment->key = sanitize_text_field( $row[ $this->field_mapping['key'] ] ); - - } - - if( ! empty( $this->field_mapping['parent_payment_id'] ) && ! empty( $row[ $this->field_mapping['parent_payment_id'] ] ) ) { - - $payment->parent_payment_id = absint( $row[ $this->field_mapping['parent_payment_id'] ] ); - - } - - if( ! empty( $this->field_mapping['downloads'] ) && ! empty( $row[ $this->field_mapping['downloads'] ] ) ) { - - if( __( 'Products (Raw)', 'easy-digital-downloads' ) == $this->field_mapping['downloads'] ) { - - // This is an EDD export so we can extract prices - $downloads = $this->get_downloads_from_edd( $row[ $this->field_mapping['downloads'] ] ); - - } else { - - $downloads = $this->str_to_array( $row[ $this->field_mapping['downloads'] ] ); - - } - - if( is_array( $downloads ) ) { - - $download_count = count( $downloads ); - - foreach( $downloads as $download ) { - - if( is_array( $download ) ) { - $download_name = $download['download']; - $price = $download['price']; - $tax = $download['tax']; - $price_id = $download['price_id']; - } else { - $download_name = $download; - } - - $download_id = $this->maybe_create_download( $download_name ); - - if( ! $download_id ) { - continue; - } - - $item_price = ! isset( $price ) ? edd_get_download_price( $download_id ) : $price; - $item_tax = ! isset( $tax ) ? ( $download_count > 1 ? 0.00 : $payment->tax ) : $tax; - $price_id = ! isset( $price_id ) ? false : $price_id; - - $args = array( - 'item_price' => $item_price, - 'tax' => $item_tax, - 'price_id' => $price_id, - ); - - $payment->add_download( $download_id, $args ); - - } - - } - - } - - if( ! empty( $this->field_mapping['total'] ) && ! empty( $row[ $this->field_mapping['total'] ] ) ) { - - $payment->total = edd_sanitize_amount( $row[ $this->field_mapping['total'] ] ); - - } - - if( ! empty( $this->field_mapping['tax'] ) && ! empty( $row[ $this->field_mapping['tax'] ] ) ) { - - $payment->tax = edd_sanitize_amount( $row[ $this->field_mapping['tax'] ] ); - - } - - if( ! empty( $this->field_mapping['subtotal'] ) && ! empty( $row[ $this->field_mapping['subtotal'] ] ) ) { - - $payment->subtotal = edd_sanitize_amount( $row[ $this->field_mapping['subtotal'] ] ); - - } else { - - $payment->subtotal = $payment->total - $payment->tax; - - } - - $address = array( 'line1' => '', 'line2' => '', 'city' => '', 'state' => '', 'zip' => '', 'country' => '' ); - - foreach( $address as $key => $address_field ) { - - if( ! empty( $this->field_mapping[ $key ] ) && ! empty( $row[ $this->field_mapping[ $key ] ] ) ) { - - $address[ $key ] = sanitize_text_field( $row[ $this->field_mapping[ $key ] ] ); - - } - - } - - $payment->address = $address; - - $payment->save(); - - - // The status has to be set after payment is created to ensure status update properly - if( ! empty( $this->field_mapping['status'] ) && ! empty( $row[ $this->field_mapping['status'] ] ) ) { - - $payment->status = strtolower( sanitize_text_field( $row[ $this->field_mapping['status'] ] ) ); - - } else { - - $payment->status = 'complete'; - - } - - // Save a second time to update stats - $payment->save(); - - } - - private function set_customer( $row ) { - - global $wpdb; - $customer = false; - - $customer = false; - $email = ''; - - if( ! empty( $this->field_mapping['email'] ) && ! empty( $row[ $this->field_mapping['email'] ] ) ) { - - $email = sanitize_text_field( $row[ $this->field_mapping['email'] ] ); - - } - - // Look for a customer from the canonical source, if any - if( ! empty( $this->field_mapping['edd_customer_id'] ) && ! empty( $row[ $this->field_mapping['edd_customer_id'] ] ) ) { - - $canonical_id = absint( $row[ $this->field_mapping['edd_customer_id'] ] ); - $mapped_id = $wpdb->get_var( $wpdb->prepare( "SELECT edd_customer_id FROM $wpdb->edd_customermeta WHERE meta_key = '_canonical_import_id' AND meta_value = %d LIMIT 1", $canonical_id ) ); - - } - - if( ! empty( $mapped_id ) ) { - - $customer = new EDD_Customer( $mapped_id ); - - } - - if( empty( $mapped_id ) || ! $customer->id > 0 ) { - - // Look for a customer based on provided ID, if any - if ( ! empty( $this->field_mapping['edd_customer_id'] ) && ! empty( $row[ $this->field_mapping['edd_customer_id'] ] ) ) { - - $customer_id = absint( $row[ $this->field_mapping['edd_customer_id'] ] ); - - $customer_by_id = new EDD_Customer( $customer_id ); - - } - - // Now look for a customer based on provided email - - if( ! empty( $email ) ) { - - $customer_by_email = new EDD_Customer( $email ); - - } - - // Now compare customer records. If they don't match, customer_id will be stored in meta and we will use the customer that matches the email - - if ( ! empty( $customer_by_email ) && ( empty( $customer_by_id ) || $customer_by_id->id !== $customer_by_email->id ) ) { - - $customer = $customer_by_email; - - } elseif ( ! empty( $customer_by_id ) ) { - - $customer = $customer_by_id; - - if( ! empty( $email ) ) { - $customer->add_email( $email ); - } - - } - - // Make sure we found a customer. Create one if not. - if ( empty( $customer->id ) ) { - - if ( ! $customer instanceof EDD_Customer ) { - $customer = new EDD_Customer(); - } - } - - if ( ! empty( $this->field_mapping['name'] ) && ! empty( $row[ $this->field_mapping['name'] ] ) ) { - - $name = $row[ $this->field_mapping['name'] ]; - - } else { - $first_name = ''; - $last_name = ''; - if ( ! empty( $this->field_mapping['first_name'] ) && ! empty( $row[ $this->field_mapping['first_name'] ] ) ) { - - $first_name = $row[ $this->field_mapping['first_name'] ]; - - } - - if ( ! empty( $this->field_mapping['last_name'] ) && ! empty( $row[ $this->field_mapping['last_name'] ] ) ) { - - $last_name = $row[ $this->field_mapping['last_name'] ]; - - } - $name = $first_name . ' ' . $last_name; - } - - $customer->create( - array( - 'name' => sanitize_text_field( $name ), - 'email' => empty( $email ) ? '' : $email, - ) - ); - - if( ! empty( $canonical_id ) && (int) $canonical_id !== (int) $customer->id ) { - $customer->update_meta( '_canonical_import_id', $canonical_id ); - } - } - - if ( ! empty( $email ) && $email !== $customer->email ) { - $customer->add_email( $email ); - } - - return $customer->id; - - } - - /** - * Look up Download by title and create one if none is found - * - * @since 2.6 - * @return int|false Download ID or false if the download could not be created. - */ - private function maybe_create_download( $title = '' ) { - - if ( ! is_string( $title ) ) { - return false; - } - - $download = new WP_Query( - array( - 'post_type' => 'download', - 'title' => $title, - 'post_status' => 'all', - 'posts_per_page' => 1, - 'no_found_rows' => true, - 'ignore_sticky_posts' => true, - 'update_post_term_cache' => false, - 'update_post_meta_cache' => false, - 'orderby' => 'post_date ID', - 'order' => 'ASC', - ) - ); - - if ( ! empty( $download->post ) ) { - return $download->post->ID; - } - - $args = array( - 'post_type' => 'download', - 'post_title' => $title, - 'post_author' => get_current_user_id(), - ); - - return wp_insert_post( $args ); - } - - /** - * Return the calculated completion percentage - * - * @since 2.6 - * @return int - */ - public function get_downloads_from_edd( $data_str ) { - - // Break string into separate products - - $d_array = array(); - $downloads = (array) explode( '/', $data_str ); - - if( $downloads ) { - - foreach( $downloads as $key => $download ) { - - $d = (array) explode( '|', $download ); - if ( ! array_key_exists( 1, $d ) ) { - continue; - } - preg_match_all( '/\{(\d|(\d+(\.\d+|\d+)))\}/', $d[1], $matches ); - - if( false !== strpos( $d[1], '{' ) ) { - - $price = trim( substr( $d[1], 0, strpos( $d[1], '{' ) ) ); - - } else { - - $price = trim( $d[1] ); - } - - $price = floatval( $price ); - $tax = isset( $matches[1][0] ) ? floatval( trim( $matches[1][0] ) ) : 0; - $price_id = isset( $matches[1][1] ) ? trim( $matches[1][1] ) : false; - - $d_array[] = array( - 'download' => trim( $d[0] ), - 'price' => $price - $tax, - 'tax' => $tax, - 'price_id' => $price_id, - ); - - } - - } - - return $d_array; - - } - - /** - * Return the calculated completion percentage - * - * @since 2.6 - * @return int - */ - public function get_percentage_complete() { - - $percentage = 0; - $total = count( $this->csv ); - - if ( $total > 0 ) { - $percentage = ( $this->step * $this->per_step / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Retrieve the URL to the payments list table - * - * @since 2.6 - * @return string - */ - public function get_list_table_url() { - return admin_url( 'edit.php?post_type=download&page=edd-payment-history' ); - } - - /** - * Retrieve the payments labels - * - * @since 2.6 - * @return string - */ - public function get_import_type_label() { - return __( 'payments', 'easy-digital-downloads' ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/import/class-batch-import.php b/wp-content/plugins/easy-digital-downloads/includes/admin/import/class-batch-import.php deleted file mode 100644 index 2f61acbc..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/import/class-batch-import.php +++ /dev/null @@ -1,355 +0,0 @@ - database fields - * - * @since 2.6 - */ - public $field_mapping = array(); - - /** - * Get things started - * - * @param $_step int The step to process - * @since 2.6 - */ - public function __construct( $_file = '', $_step = 1 ) { - - $this->step = $_step; - $this->done = false; - if ( ! empty( $_file ) ) { - $this->set_up_csv( $_file ); - } - } - - /** - * Sets up the CSV file for importing. - * - * @param [type] $file - * @return void - */ - public function set_up_csv( $file ) { - $this->csv = $this->get_csv_file( $file ); - $this->total = count( $this->csv ); - $this->init(); - } - - /** - * Initialize the updater. Runs after import file is loaded but before any processing is done. - * - * @since 2.6 - * @return void - */ - public function init() {} - - /** - * Can we import? - * - * @since 2.6 - * @return bool Whether we can iport or not - */ - public function can_import() { - return (bool) apply_filters( 'edd_import_capability', current_user_can( $this->capability_type ) ); - } - - /** - * Parses the CSV from the file and returns the data as an array. - * - * @since 2.11.5 - * @param string $file - * - * @return array - */ - public function get_csv_file( $file ) { - $this->file = $file; - $csv = array_map( 'str_getcsv', file( $file ) ); - array_walk( - $csv, - function ( &$a ) use ( $csv ) { - /* - * Make sure the two arrays have the same lengths. - * If not, we trim the larger array to match the smaller one. - */ - $min = min( count( $csv[0] ), count( $a ) ); - $headers = array_slice( $csv[0], 0, $min ); - $values = array_slice( $a, 0, $min ); - $a = array_combine( $headers, $values ); - } - ); - array_shift( $csv ); - - return $csv; - } - - /** - * Get the CSV columns - * - * @since 2.6 - * @return array The columns in the CSV - */ - public function get_columns() { - - $columns = array(); - - if ( isset( $this->csv[0] ) && is_array( $this->csv[0] ) ) { - $columns = array_keys( $this->csv[0] ); - } - - return $columns; - } - - /** - * Get the first row of the CSV - * - * This is used for showing an example of what the import will look like - * - * @since 2.6 - * @return array The first row after the header of the CSV - */ - public function get_first_row() { - - if ( ! is_array( $this->csv ) ) { - return array(); - } - - return array_map( array( $this, 'trim_preview' ), current( $this->csv ) ); - } - - /** - * Process a step - * - * @since 2.6 - * @return bool - */ - public function process_step() { - - $more = false; - - if ( ! $this->can_import() ) { - wp_die( __( 'You do not have permission to import data.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - return $more; - } - - /** - * Return the calculated completion percentage - * - * @since 2.6 - * @return int - */ - public function get_percentage_complete() { - return 100; - } - - /** - * Map CSV columns to import fields - * - * @since 2.6 - * @return void - */ - public function map_fields( $import_fields = array() ) { - - $this->field_mapping = array_map( 'sanitize_text_field', $import_fields ); - - } - - /** - * Retrieve the URL to the list table for the import data type - * - * @since 2.6 - * @return string - */ - public function get_list_table_url() {} - - /** - * Retrieve the label for the import type. Example: Payments - * - * @since 2.6 - * @return string - */ - public function get_import_type_label() {} - - /** - * Convert a string containing delimiters to an array - * - * @since 2.6 - * @param $str Input string to convert to an array - * @return array - */ - public function str_to_array( $str = '' ) { - - $array = array(); - - if( is_array( $str ) ) { - return array_map( 'trim', $str ); - } - - // Look for standard delimiters - if( false !== strpos( $str, '|' ) ) { - - $delimiter = '|'; - - } elseif( false !== strpos( $str, ',' ) ) { - - $delimiter = ','; - - } elseif( false !== strpos( $str, ';' ) ) { - - $delimiter = ';'; - - } elseif( false !== strpos( $str, '/' ) && ! filter_var( str_replace( ' ', '%20', $str ), FILTER_VALIDATE_URL ) && '/' !== substr( $str, 0, 1 ) ) { - - $delimiter = '/'; - - } - - if( ! empty( $delimiter ) ) { - - $array = (array) explode( $delimiter, $str ); - - } else { - - $array[] = $str; - } - - return array_map( 'trim', $array ); - - } - - /** - * Convert a files string containing delimiters to an array. - * - * This is identical to str_to_array() except it ignores all / characters. - * - * @since 2.9.20 - * @param $str Input string to convert to an array - * @return array - */ - public function convert_file_string_to_array( $str = '' ) { - - $array = array(); - - if( is_array( $str ) ) { - return array_map( 'trim', $str ); - } - - // Look for standard delimiters - if( false !== strpos( $str, '|' ) ) { - - $delimiter = '|'; - - } elseif( false !== strpos( $str, ',' ) ) { - - $delimiter = ','; - - } elseif( false !== strpos( $str, ';' ) ) { - - $delimiter = ';'; - - } - - if( ! empty( $delimiter ) ) { - - $array = (array) explode( $delimiter, $str ); - - } else { - - $array[] = $str; - } - - return array_map( 'trim', $array ); - - } - - /** - * Trims a column value for preview - * - * @since 2.6 - * @param $str Input string to trim down - * @return string - */ - public function trim_preview( $str = '' ) { - - if( ! is_numeric( $str ) ) { - - $long = strlen( $str ) >= 30; - $str = substr( $str, 0, 30 ); - $str = $long ? $str . '...' : $str; - - } - - return $str; - - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/import/import-actions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/import/import-actions.php deleted file mode 100644 index f42d990a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/import/import-actions.php +++ /dev/null @@ -1,75 +0,0 @@ - __( 'Nonce verification failed', 'easy-digital-downloads' ) ) ); - } - - if ( empty( $_POST['edd-import-class'] ) ) { - wp_send_json_error( array( 'error' => __( 'Missing import parameters. Import class must be specified.', 'easy-digital-downloads' ), 'request' => $_REQUEST ) ); - } - - if ( ! function_exists( 'wp_handle_upload' ) ) { - require_once ABSPATH . 'wp-admin/includes/file.php'; - } - - require_once EDD_PLUGIN_DIR . 'includes/admin/import/class-batch-import.php'; - - $importer_class = sanitize_text_field( $_POST['edd-import-class'] ); - $is_class_allowed = edd_importer_is_class_allowed( $importer_class ); - if ( false === $is_class_allowed ) { - wp_send_json_error( array( 'error' => __( 'Invalid importer class supplied', 'easy-digital-downloads' ) ) ); - } - - do_action( 'edd_batch_import_class_include', $importer_class ); - - $import = new $importer_class(); - - // The import class checks for the user's capability. - if ( ! $import->can_import() ) { - wp_send_json_error( array( 'error' => __( 'You do not have permission to import data', 'easy-digital-downloads' ) ) ); - } - - if ( empty( $_FILES['edd-import-file'] ) ) { - wp_send_json_error( array( 'error' => __( 'Missing import file. Please provide an import file.', 'easy-digital-downloads' ), 'request' => $_REQUEST ) ); - } - - if ( empty( $_FILES['edd-import-file']['type'] ) || ! in_array( strtolower( $_FILES['edd-import-file']['type'] ), edd_importer_accepted_mime_types(), true ) ) { - wp_send_json_error( array( 'error' => __( 'The file you uploaded does not appear to be a CSV file.', 'easy-digital-downloads' ), 'request' => $_REQUEST ) ); - } - - if ( ! file_exists( $_FILES['edd-import-file']['tmp_name'] ) ) { - wp_send_json_error( array( 'error' => __( 'Something went wrong during the upload process, please try again.', 'easy-digital-downloads' ), 'request' => $_REQUEST ) ); - } - - // Let WordPress import the file. We will remove it after import is complete - $import_file = wp_handle_upload( $_FILES['edd-import-file'], array( 'test_form' => false ) ); - - if ( $import_file && empty( $import_file['error'] ) ) { - - $import->set_up_csv( $import_file['file'] ); - wp_send_json_success( array( - 'form' => $_POST, - 'class' => $importer_class, - 'upload' => $import_file, - 'first_row' => $import->get_first_row(), - 'columns' => $import->get_columns(), - 'nonce' => wp_create_nonce( 'edd_ajax_import', 'edd_ajax_import' ) - ) ); - - } else { - - /** - * Error generated by _wp_handle_upload() - * @see _wp_handle_upload() in wp-admin/includes/file.php - */ - - wp_send_json_error( array( 'error' => $import_file['error'] ) ); - } - - exit; - -} -add_action( 'edd_upload_import_file', 'edd_do_ajax_import_file_upload' ); - -/** - * Process batch imports via ajax - * - * @since 2.6 - * @return void - */ -function edd_do_ajax_import() { - - require_once EDD_PLUGIN_DIR . 'includes/admin/import/class-batch-import.php'; - - if( ! wp_verify_nonce( $_REQUEST['nonce'], 'edd_ajax_import' ) ) { - wp_send_json_error( array( 'error' => __( 'Nonce verification failed', 'easy-digital-downloads' ), 'request' => $_REQUEST ) ); - } - - if ( empty( $_REQUEST['class'] ) ) { - wp_send_json_error( array( 'error' => __( 'Missing import parameters. Import class must be specified.', 'easy-digital-downloads' ), 'request' => $_REQUEST ) ); - } - - if ( ! file_exists( $_REQUEST['upload']['file'] ) ) { - wp_send_json_error( array( 'error' => __( 'Something went wrong during the upload process, please try again.', 'easy-digital-downloads' ), 'request' => $_REQUEST ) ); - } - - $file = sanitize_text_field( $_REQUEST['upload']['file'] ); - - $mime_type_allowed = false; - if ( is_callable( 'mime_content_type' ) ) { - if ( in_array( mime_content_type( $file ), edd_importer_accepted_mime_types(), true ) ) { - $mime_type_allowed = true; - } - } else { - if ( wp_check_filetype( $file, edd_importer_accepted_mime_types() ) ) { - $mime_type_allowed = true; - } - } - - if ( false === $mime_type_allowed ) { - wp_send_json_error( array( 'error' => __( 'The file you uploaded does not appear to be a CSV file.', 'easy-digital-downloads' ), 'request' => $_REQUEST ) ); - } - - $importer_class = sanitize_text_field( $_REQUEST['class'] ); - $is_class_allowed = edd_importer_is_class_allowed( $importer_class ); - - if ( ! $is_class_allowed ) { - wp_send_json_error( array( 'error' => __( 'Invalid importer class supplied', 'easy-digital-downloads' ) ) ); - } - - do_action( 'edd_batch_import_class_include', $importer_class ); - - $step = absint( $_REQUEST['step'] ); - $class = $importer_class; - $import = new $class( '', $step ); - - if ( ! $import->can_import() ) { - wp_send_json_error( array( 'error' => __( 'You do not have permission to import data', 'easy-digital-downloads' ) ) ); - } - $import->set_up_csv( $file ); - - parse_str( $_REQUEST['mapping'], $map ); - - $import->map_fields( $map['edd-import-field'] ); - - $ret = $import->process_step( $step ); - - $percentage = $import->get_percentage_complete(); - - if( $ret ) { - - $step += 1; - wp_send_json_success( array( - 'step' => $step, - 'percentage' => $percentage, - 'columns' => $import->get_columns(), - 'mapping' => $import->field_mapping, - 'total' => $import->total - ) ); - - } elseif ( true === $import->is_empty ) { - - wp_send_json_error( array( - 'error' => __( 'No data found for import parameters', 'easy-digital-downloads' ) - ) ); - - } else { - - wp_send_json_success( array( - 'step' => 'done', - 'message' => sprintf( - __( 'Import complete! View imported %s.', 'easy-digital-downloads' ), - esc_url( $import->get_list_table_url() ), - esc_html( $import->get_import_type_label() ) - ) - ) ); - - } -} -add_action( 'wp_ajax_edd_do_ajax_import', 'edd_do_ajax_import' ); - -/** - * Returns the array of accepted mime types for the importer. - * - * @since 3.0 - * @return array - */ -function edd_importer_accepted_mime_types() { - return array( - 'text/csv', - 'text/comma-separated-values', - 'text/plain', - 'text/anytext', - 'text/*', - 'text/plain', - 'text/anytext', - 'text/*', - 'application/csv', - 'application/excel', - 'application/vnd.ms-excel', - 'application/vnd.msexcel', - ); -} - -/** - * Given an importer class name, is it allowed to process as an importer. - * - * @since 3.0.2 - * - * @param string $class The class name to check. - * - * @return bool If the class is allowed to be used as an importer. - */ -function edd_importer_is_class_allowed( $class = '' ) { - $allowed_importer_classes = edd_get_importer_accepted_classes(); - return in_array( $class, $allowed_importer_classes, true ); -} - -/** - * Returns a list of allowed importer classes. - * - * @since 3.0.2 - * - * @return array An array of class names to allow during imports. - */ -function edd_get_importer_accepted_classes() { - return apply_filters( - 'edd_accepted_importer_classes', - array( - 'EDD_Batch_Downloads_Import', - 'EDD_Batch_Payments_Import', - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/notes/note-actions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/notes/note-actions.php deleted file mode 100644 index 2e1a072a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/notes/note-actions.php +++ /dev/null @@ -1,132 +0,0 @@ - $object_id, - 'object_type' => $object_type, - 'content' => $note, - 'user_id' => get_current_user_id() - ) ); - - $x = new WP_Ajax_Response(); - $x->add( - array( - 'what' => 'edd_note_html', - 'data' => edd_admin_get_note_html( $note_id, $object_id ), - ) - ); - $x->send(); -} -add_action( 'wp_ajax_edd_add_note', 'edd_admin_ajax_add_note' ); - -/** - * Delete a note. - * - * @since 3.0 - * - * @param array $data Data from $_GET. - */ -function edd_admin_delete_note( $data = array() ) { - - // Bail if missing any data - if ( empty( $data['_wpnonce'] ) || empty( $data['note_id'] ) ) { - return; - } - - // Bail if nonce fails - if ( ! wp_verify_nonce( $data['_wpnonce'], 'edd_delete_note_' . $data['note_id'] ) ) { - return; - } - - // Try to delete - edd_delete_note( $data['note_id'] ); - - edd_redirect( edd_get_note_delete_redirect_url() ); -} -add_action( 'edd_delete_note', 'edd_admin_delete_note' ); - -/** - * Delete a discount note via AJAX. - * - * @since 3.0 - */ -function edd_admin_ajax_delete_note() { - - // Check AJAX referrer - check_ajax_referer( 'edd_note', 'nonce' ); - - // Bail if user cannot delete notes - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_die( -1 ); - } - - // Get note ID - $note_id = ! empty( $_POST['note_id'] ) - ? absint( $_POST['note_id'] ) - : 0; - - // Bail if no note - if ( empty( $note_id ) ) { - wp_die( -1 ); - } - - // Delete note - if ( edd_delete_note( $note_id ) ) { - wp_die( 1 ); - } - - wp_die( 0 ); -} -add_action( 'wp_ajax_edd_delete_note', 'edd_admin_ajax_delete_note' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/notes/note-functions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/notes/note-functions.php deleted file mode 100644 index 9b2b2c82..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/notes/note-functions.php +++ /dev/null @@ -1,223 +0,0 @@ - - -
    - - -

    > - -

    -
    - - user_id; - $author = edd_get_bot_name(); - if ( ! empty( $user_id ) ) { - /* translators: user ID */ - $author = sprintf( __( 'User ID #%s', 'easy-digital-downloads' ), $user_id ); - $user_object = get_userdata( $user_id ); - if ( $user_object ) { - $author = ! empty( $user_object->display_name ) ? $user_object->display_name : $user_object->user_login; - } - } - - // URL to delete note - $delete_note_url = wp_nonce_url( add_query_arg( array( - 'edd-action' => 'delete_note', - 'note_id' => absint( $note->id ), - ) ), 'edd_delete_note_' . absint( $note->id ) ); - - // Start a buffer - ob_start(); - ?> - -
    -
    - - - - - -
    - - content ) ); ?> -
    - - - -
    -
    - - -
    - -
    -
    - -
    - - -
    - - -
    - - 0, - 'pag_arg' => 'paged', - 'base' => '%_%', - 'show_all' => true, - 'prev_text' => is_rtl() ? '→' : '←', - 'next_text' => is_rtl() ? '←' : '→', - 'add_fragment' => '' - ) ); - - // Maximum notes per page - $per_page = apply_filters( 'edd_notes_per_page', 20 ); - $r['total'] = ceil( $r['total'] / $per_page ); - $r['format'] = "?{$r['pag_arg']}=%#%"; - - // Don't allow pagination beyond the boundaries - $r['current'] = ! empty( $_GET[ $r['pag_arg'] ] ) && is_numeric( $_GET[ $r['pag_arg'] ] ) - ? absint( $_GET[ $r['pag_arg'] ] ) - : 1; - - // Start a buffer - ob_start(); ?> - -
    - -
    - - 'edd-payment-history', - 'view' => 'view-order-details', - 'id' => absint( $request['id'] ) - ) ) ); - } -} -add_action( 'edd_handle_order_item_change', 'edd_handle_order_item_change' ); - -/** - * Process the changes from the `View Order Details` page. - * - * @since 1.9 - * @since 3.0 Refactored to use new core objects and query methods. - * - * @param array $data Order data. -*/ -function edd_update_payment_details( $data = array() ) { - - // Bail if an empty array is passed. - if ( empty( $data ) ) { - wp_die( esc_html__( 'You do not have permission to edit this payment record', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Bail if the user does not have the correct permissions. - if ( ! current_user_can( 'edit_shop_payments', $data['edd_payment_id'] ) ) { - wp_die( esc_html__( 'You do not have permission to edit this payment record', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - check_admin_referer( 'edd_update_payment_details_nonce' ); - - // Retrieve the order ID and set up the order. - $order_id = absint( $data['edd_payment_id'] ); - $order = edd_get_order( $order_id ); - - $order_update_args = array(); - - $unlimited = isset( $data['edd-unlimited-downloads'] ) ? '1' : null; - $new_status = sanitize_key( $data['edd-payment-status'] ); - $date_string = EDD()->utils->get_date_string( - sanitize_text_field( $data['edd-payment-date'] ), - sanitize_text_field( $data['edd-payment-time-hour'] ), - sanitize_text_field( $data['edd-payment-time-min'] ) - ); - - // The date is entered in the WP timezone. We need to convert it to UTC prior to saving now. - $order_update_args['date_created'] = edd_get_utc_date_string( $date_string ); - - // Customer - $curr_customer_id = sanitize_text_field( $data['current-customer-id'] ); - $new_customer_id = sanitize_text_field( $data['customer-id'] ); - - // Create a new customer. - if ( isset( $data['edd-new-customer'] ) && 1 === (int) $data['edd-new-customer'] ) { - $email = isset( $data['edd-new-customer-email'] ) - ? sanitize_text_field( $data['edd-new-customer-email'] ) - : ''; - - // Sanitize first name - $first_name = isset( $data['edd-new-customer-first-name'] ) - ? sanitize_text_field( $data['edd-new-customer-first-name'] ) - : ''; - - // Sanitize last name - $last_name = isset( $data['edd-new-customer-last-name'] ) - ? sanitize_text_field( $data['edd-new-customer-last-name'] ) - : ''; - - // Combine - $name = $first_name . ' ' . $last_name; - - if ( empty( $email ) || empty( $name ) ) { - wp_die( esc_html__( 'New Customers require a name and email address', 'easy-digital-downloads' ) ); - } - - $customer = new EDD_Customer( $email ); - - if ( empty( $customer->id ) ) { - $customer_data = array( - 'name' => $name, - 'email' => $email, - ); - - $user_id = email_exists( $email ); - - if ( false !== $user_id ) { - $customer_data['user_id'] = $user_id; - } - - if ( ! $customer->create( $customer_data ) ) { - $customer = new EDD_Customer( $curr_customer_id ); - edd_set_error( 'edd-payment-new-customer-fail', __( 'Error creating new customer', 'easy-digital-downloads' ) ); - } - } else { - wp_die( sprintf( __( 'A customer with the email address %s already exists. Please go back and assign this payment to them.', 'easy-digital-downloads' ), $email ) ); - } - - $previous_customer = new EDD_Customer( $curr_customer_id ); - } elseif ( $curr_customer_id !== $new_customer_id ) { - $customer = new EDD_Customer( $new_customer_id ); - - $previous_customer = new EDD_Customer( $curr_customer_id ); - } else { - $customer = new EDD_Customer( $curr_customer_id ); - } - - // Remove the stats and payment from the previous customer and attach it to the new customer - if ( isset( $previous_customer ) ) { - $previous_customer->remove_payment( $order_id, false ); - $customer->attach_payment( $order_id, false ); - - $order_update_args['customer_id'] = $customer->id; - } - - $order_update_args['user_id'] = $customer->user_id; - $order_update_args['email'] = $customer->email; - - // Address. - $address = $data['edd_order_address']; - - $order_address_id = absint( $address['address_id'] ); - $order_address_details = array( - 'name' => $customer->name, - 'address' => $address['address'], - 'address2' => $address['address2'], - 'city' => $address['city'], - 'region' => $address['region'], - 'postal_code' => $address['postal_code'], - 'country' => $address['country'], - ); - - if ( empty( $order_address_id ) ) { - - // Unset the address_id which is 0. - unset( $address['address_id'] ); - - // Add the $order_id to the arguments to create this order address. - $order_address_details['order_id'] = $order_id; - - edd_add_order_address( $order_address_details ); - } else { - edd_update_order_address( $order_address_id, $order_address_details ); - } - - // Unlimited downloads. - if ( 1 === (int) $unlimited ) { - edd_update_order_meta( $order_id, 'unlimited_downloads', $unlimited ); - } else { - edd_delete_order_meta( $order_id, 'unlimited_downloads' ); - } - - // Don't set the status in the update call (for back compat) - unset( $order_update_args['status'] ); - - // Attempt to update the order - $updated = edd_update_order( $order_id, $order_update_args ); - - // Bail if an error occurred - if ( false === $updated ) { - wp_die( __( 'Error updating order.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 400 ) ); - } - - // Check if the status has changed, if so, we need to invoke the pertinent - // status processing method (for back compat) - if ( $new_status !== $order->status ) { - edd_update_order_status( $order_id, $new_status ); - } - - do_action( 'edd_updated_edited_purchase', $order_id ); - - edd_redirect( edd_get_admin_url( array( - 'page' => 'edd-payment-history', - 'view' => 'view-order-details', - 'edd-message' => 'payment-updated', - 'id' => absint( $order_id ), - ) ) ); -} -add_action( 'edd_update_payment_details', 'edd_update_payment_details' ); - -/** - * New in 3.0, permanently destroys an order, and all its data, and related data. - * - * @since 3.0 - * - * @param array $data Arguments passed. - */ -function edd_trigger_destroy_order( $data ) { - - if ( wp_verify_nonce( $data['_wpnonce'], 'edd_payment_nonce' ) ) { - - $payment_id = absint( $data['purchase_id'] ); - - if ( ! current_user_can( 'delete_shop_payments', $payment_id ) ) { - wp_die( esc_html__( 'You do not have permission to edit this order.', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - edd_destroy_order( $payment_id ); - - $redirect_link = add_query_arg( - array( - 'page' => 'edd-payment-history', - 'edd-message' => 'payment_deleted', - 'status' => 'trash', - ), - edd_get_admin_base_url() - ); - edd_redirect( $redirect_link ); - } -} -add_action( 'edd_delete_order', 'edd_trigger_destroy_order' ); - -/** - * Trigger the action of moving an order to the 'trash' status - * - * @since 3.0 - * - * @param $data - * @return void - */ -function edd_trigger_trash_order( $data ) { - if ( wp_verify_nonce( $data['_wpnonce'], 'edd_payment_nonce' ) ) { - - $payment_id = absint( $data['purchase_id'] ); - - if ( ! current_user_can( 'delete_shop_payments', $payment_id ) ) { - wp_die( __( 'You do not have permission to edit this payment record', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - edd_trash_order( $payment_id ); - - $redirect = edd_get_admin_url( array( - 'page' => 'edd-payment-history', - 'edd-message' => 'order_trashed', - 'order_type' => esc_attr( $data['order_type'] ), - ) ); - - edd_redirect( $redirect ); - } -} -add_action( 'edd_trash_order', 'edd_trigger_trash_order' ); - -/** - * Trigger the action of restoring an order from the 'trash' status - * - * @since 3.0 - * - * @param $data - * @return void - */ -function edd_trigger_restore_order( $data ) { - if ( wp_verify_nonce( $data['_wpnonce'], 'edd_payment_nonce' ) ) { - - $payment_id = absint( $data['purchase_id'] ); - - if ( ! current_user_can( 'delete_shop_payments', $payment_id ) ) { - wp_die( __( 'You do not have permission to edit this payment record', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - edd_restore_order( $payment_id ); - - $redirect = edd_get_admin_url( array( - 'page' => 'edd-payment-history', - 'edd-message' => 'order_restored', - 'order_type' => esc_attr( $data['order_type'] ), - ) ); - - edd_redirect( $redirect ); - } -} -add_action( 'edd_restore_order', 'edd_trigger_restore_order' ); - -/** - * Retrieves a new download link for a purchased file - * - * @since 2.0 - * @return string -*/ -function edd_ajax_generate_file_download_link() { - - $customer_view_role = apply_filters( 'edd_view_customers_role', 'view_shop_reports' ); - if ( ! current_user_can( $customer_view_role ) ) { - die( '-1' ); - } - - $payment_id = absint( $_POST['payment_id'] ); - $download_id = absint( $_POST['download_id'] ); - $price_id = isset( $_POST['price_id'] ) && is_numeric( $_POST['price_id'] ) ? absint( $_POST['price_id'] ) : null; - - if ( empty( $payment_id ) ) { - die( '-2' ); - } - - if ( empty( $download_id ) ) { - die( '-3' ); - } - - $limit = edd_get_file_download_limit( $download_id ); - if ( ! empty( $limit ) ) { - // Increase the file download limit when generating new links - edd_set_file_download_limit_override( $download_id, $payment_id ); - } - - $files = edd_get_download_files( $download_id, $price_id ); - if ( ! $files ) { - die( '-4' ); - } - - $order = edd_get_order( $payment_id ); - $file_urls = ''; - foreach ( $files as $file_key => $file ) { - $file_urls .= edd_get_download_file_url( $order, $order->email, $file_key, $download_id, $price_id ); - $file_urls .= "\n\n"; - } - - die( $file_urls ); -} -add_action( 'wp_ajax_edd_get_file_download_link', 'edd_ajax_generate_file_download_link' ); - -/** - * Renders the refund form that is used to process a refund. - * - * @since 3.0 - * - * @return void - */ -function edd_ajax_generate_refund_form() { - - // Verify we have a logged user. - if ( ! is_user_logged_in() ) { - $return = array( - 'success' => false, - 'message' => __( 'You must be logged in to perform this action.', 'easy-digital-downloads' ), - ); - - wp_send_json( $return, 401 ); - } - - // Verify the logged in user has permission to edit shop payments. - if ( ! current_user_can( 'edit_shop_payments' ) ) { - $return = array( - 'success' => false, - 'message' => __( 'Your account does not have permission to perform this action.', 'easy-digital-downloads' ), - ); - - wp_send_json( $return, 401 ); - } - - $order_id = isset( $_POST['order_id'] ) && is_numeric( $_POST['order_id'] ) ? absint( $_POST['order_id'] ) : false; - - if ( empty( $order_id ) ) { - $return = array( - 'success' => false, - 'message' => __( 'Invalid order ID', 'easy-digital-downloads' ), - ); - - wp_send_json( $return, 400 ); - } - - $order = edd_get_order( $order_id ); - if ( empty( $order ) ) { - $return = array( - 'success' => false, - 'message' => __( 'Invalid order', 'easy-digital-downloads' ), - ); - - wp_send_json( $return, 404 ); - } - - if ( 'refunded' === $order->status ) { - $return = array( - 'success' => false, - 'message' => __( 'Order is already refunded', 'easy-digital-downloads' ), - ); - - wp_send_json( $return, 404 ); - } - - if ( 'refund' === $order->type ) { - $return = array( - 'success' => false, - 'message' => __( 'Cannot refund an order that is already refunded.', 'easy-digital-downloads' ), - ); - - wp_send_json( $return, 404 ); - } - - // Output buffer the form before we include it in the JSON response. - ob_start(); - ?> - -
    - prepare_items(); - $refund_items->display(); - ?> -
    - true, - 'html' => $html, - ); - - wp_send_json( $return, 200 ); - -} -add_action( 'wp_ajax_edd_generate_refund_form', 'edd_ajax_generate_refund_form' ); - -/** - * Processes the results from the Submit Refund form - * - * @since 3.0 - * @return void - */ -function edd_ajax_process_refund_form() { - - // Verify we have a logged user. - if ( ! is_user_logged_in() ) { - wp_send_json_error( __( 'You must be logged in to perform this action.', 'easy-digital-downloads' ), 401 ); - } - - // Verify the logged in user has permission to edit shop payments. - if ( ! current_user_can( 'edit_shop_payments' ) ) { - wp_send_json_error( __( 'Your account does not have permission to perform this action.', 'easy-digital-downloads' ), 401 ); - } - - if ( empty( $_POST['data'] ) || empty( $_POST['order_id'] ) ) { - wp_send_json_error( __( 'Missing form data or order ID.', 'easy-digital-downloads' ), 400 ); - } - - // Get our data out of the serialized string. - parse_str( $_POST['data'], $form_data ); - - // Verify the nonce. - $nonce = ! empty( $form_data['edd_process_refund'] ) ? sanitize_text_field( $form_data['edd_process_refund'] ) : false; - if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'edd_process_refund' ) ) { - wp_send_json_error( __( 'Nonce validation failed when submitting refund.', 'easy-digital-downloads' ), 401 ); - } - - // Collect selected order items. - $order_items = array(); - if ( ! empty( $form_data['refund_order_item'] ) && is_array( $form_data['refund_order_item'] ) ) { - foreach( $form_data['refund_order_item'] as $order_item_id => $order_item ) { - // If there's no quantity or subtotal - bail. - if ( empty( $order_item['quantity'] ) || empty( $order_item['subtotal'] ) ) { - continue; - } - - $order_items[] = array( - 'order_item_id' => absint( $order_item_id ), - 'quantity' => intval( $order_item['quantity'] ), - 'subtotal' => edd_sanitize_amount( $order_item['subtotal'] ), - 'tax' => ! empty( $order_item['tax'] ) ? edd_sanitize_amount( $order_item['tax'] ) : 0.00 - ); - } - } - - // Collect selected adjustments. - $adjustments = array(); - if ( ! empty( $form_data['refund_order_adjustment'] ) && is_array( $form_data['refund_order_adjustment'] ) ) { - foreach( $form_data['refund_order_adjustment'] as $adjustment_id => $adjustment ) { - // If there's no quantity or subtotal - bail. - if ( empty( $adjustment['quantity'] ) || empty( $adjustment['subtotal'] ) ) { - continue; - } - - $adjustments[] = array( - 'adjustment_id' => absint( $adjustment_id ), - 'quantity' => intval( $adjustment['quantity'] ), - 'subtotal' => floatval( edd_sanitize_amount( $adjustment['subtotal'] ) ), - 'tax' => ! empty( $adjustment['tax'] ) ? floatval( edd_sanitize_amount( $adjustment['tax'] ) ) : 0.00 - ); - } - } - - $order_id = absint( $_POST['order_id'] ); - $refund_id = edd_refund_order( $order_id, $order_items, $adjustments ); - - if ( is_wp_error( $refund_id ) ) { - wp_send_json_error( $refund_id->get_error_message() ); - } elseif ( ! empty( $refund_id ) ) { - $return = array( - 'refund_id' => $refund_id, - 'message' => sprintf( __( 'Refund successfully processed.', 'easy-digital-downloads' ) ), - 'refund_url' => edd_get_admin_url( - array( - 'page' => 'edd-payment-history', - 'view' => 'view-refund-details', - 'id' => urlencode( $refund_id ), - ) - ) - ); - wp_send_json_success( $return, 200 ); - } else { - wp_send_json_error( __( 'Unable to process refund.', 'easy-digital-downloads' ), 401 ); - } -} -add_action( 'wp_ajax_edd_process_refund_form', 'edd_ajax_process_refund_form' ); - -/** - * Process Orders list table bulk actions. This is necessary because we need to - * redirect to ensure filters do not get applied when bulk actions are being - * processed. This processing cannot happen within the `EDD_Payment_History_Table` - * class as at that point, it is too late to do a redirect. - * - * @since 3.0 - */ -function edd_orders_list_table_process_bulk_actions() { - - // Bail if this method was called directly. - if ( 'load-download_page_edd-payment-history' !== current_action() ) { - _doing_it_wrong( __FUNCTION__, 'This method is not meant to be called directly.', 'EDD 3.0' ); - } - - $action = isset( $_REQUEST['action'] ) // WPCS: CSRF ok. - ? sanitize_text_field( $_REQUEST['action'] ) - : ''; - - // If this is a 'delete' action, the capability changes from edit to delete. - $cap = 'delete' === $action ? 'delete_shop_payments' : 'edit_shop_payments'; - - // Check the current user's capability. - if ( ! current_user_can( $cap ) ) { - return; - } - - // Bail if we aren't processing bulk actions. - if ( '-1' === $action ) { - return; - } - - $ids = isset( $_GET['order'] ) // WPCS: CSRF ok. - ? $_GET['order'] - : false; - - if ( ! is_array( $ids ) ) { - $ids = array( $ids ); - } - - if ( empty( $action ) ) { - return; - } - - check_admin_referer( 'bulk-orders' ); - - $ids = wp_parse_id_list( $ids ); - - foreach ( $ids as $id ) { - switch ( $action ) { - case 'trash': - edd_trash_order( $id ); - break; - case 'restore': - edd_restore_order( $id ); - break; - case 'delete': - edd_destroy_order( $id ); - break; - case 'set-status-complete': - edd_update_payment_status( $id, 'complete' ); - break; - - case 'set-status-pending': - edd_update_payment_status( $id, 'pending' ); - break; - - case 'set-status-processing': - edd_update_payment_status( $id, 'processing' ); - break; - - case 'set-status-revoked': - edd_update_payment_status( $id, 'revoked' ); - break; - - case 'set-status-failed': - edd_update_payment_status( $id, 'failed' ); - break; - - case 'set-status-abandoned': - edd_update_payment_status( $id, 'abandoned' ); - break; - - case 'set-status-preapproval': - edd_update_payment_status( $id, 'preapproval' ); - break; - - case 'set-status-cancelled': - edd_update_payment_status( $id, 'cancelled' ); - break; - - case 'resend-receipt': - edd_email_purchase_receipt( $id, false ); - break; - } - - do_action( 'edd_payments_table_do_bulk_action', $id, $action ); - } - - wp_safe_redirect( wp_get_referer() ); -} -add_action( 'load-download_page_edd-payment-history', 'edd_orders_list_table_process_bulk_actions' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/payments/add-order.php b/wp-content/plugins/easy-digital-downloads/includes/admin/payments/add-order.php deleted file mode 100644 index a1aeff48..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/payments/add-order.php +++ /dev/null @@ -1,158 +0,0 @@ - 0, - 'parent' => 0, - 'order_number' => 0, - 'status' => 'complete', - 'date_created' => date( 'Y-m-d H:i:s' ), - 'date_modified' => date( 'Y-m-d H:i:s' ), - 'date_refundable' => null, - 'user_id' => 0, - 'customer_id' => 0, - 'email' => '', - 'ip' => edd_get_ip(), - 'gateway' => '', - 'mode' => '', - 'currency' => edd_get_currency(), - 'payment_key' => '', - 'subtotal' => 0, - 'discount' => 0, - 'tax' => 0, - 'total' => 0, - ) ); - - ?> - -
    - - - -
    -

    - -
    - - - - - - - - - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - - - - - - -
    - -
    - - - - - - - -use_js ) - ? ' use-js' - : ''; - $role = $this->use_js ? 'tablist' : 'menu'; - ?> - -
    -
    -
      - get_all_section_links(); ?> -
    - -
    - get_all_section_contents(); ?> -
    -
    -
    -
    - - 'order', - 'plural' => 'orders', - 'ajax' => false - ) ); - - // Use registered types - $types = array_keys( edd_get_order_types() ); - if ( ! empty( $_GET['order_type'] ) && in_array( $_GET['order_type'], $types, true ) ) { - $this->type = sanitize_key( $_GET['order_type'] ); - - // Default to 'sale' if type is unrecognized - } else { - $this->type = 'sale'; - } - - $this->set_base_url(); - $this->filter_bar_hooks(); - $this->get_payment_counts(); - } - - /** - * Set the base URL. - * - * This retains the current order-type, or 'sale' by default. - * - * @since 3.0 - */ - private function set_base_url() { - // Carry the type over to the base URL - $this->base_url = edd_get_admin_url( array( - 'page' => 'edd-payment-history', - 'order_type' => sanitize_key( $this->type ), - ) ); - } - - /** - * Hook in filter bar actions - * - * @since 3.0 - */ - private function filter_bar_hooks() { - add_action( 'edd_admin_filter_bar_orders', array( $this, 'filter_bar_items' ) ); - add_action( 'edd_after_admin_filter_bar_orders', array( $this, 'filter_bar_searchbox' ) ); - } - - /** - * Display advanced filters. - * - * @since 1.4 - * @since 3.0 Add a filter for modes. - * Display 'Advanced Filters' - */ - public function advanced_filters() { - // Hide when viewing Refunds. - if ( 'refund' === $this->type ) { - return; - } - - edd_admin_filter_bar( 'orders' ); - } - - /** - * Output filter bar items - * - * @since 3.0 - */ - public function filter_bar_items() { - - // Get values - $start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null; - $end_date = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null; - $gateway = isset( $_GET['gateway'] ) ? sanitize_key( $_GET['gateway'] ) : 'all'; - $mode = isset( $_GET['mode'] ) ? sanitize_key( $_GET['mode'] ) : 'all'; - $order_total_filter_type = isset( $_GET['order-amount-filter-type'] ) ? sanitize_text_field( $_GET['order-amount-filter-type'] ) : false; - $order_total_filter_amount = isset( $_GET['order-amount-filter-value'] ) ? sanitize_text_field( $_GET['order-amount-filter-value'] ) : ''; - $country = isset( $_GET['order-country-filter-value'] ) ? sanitize_text_field( $_GET['order-country-filter-value'] ) : ''; - $region = isset( $_GET['order-region-filter-value'] ) ? sanitize_text_field( $_GET['order-region-filter-value'] ) : ''; - $product_id = ! empty( $_GET['product-id'] ) ? sanitize_text_field( $_GET['product-id'] ) : false; - - $status = $this->get_status(); - $clear_url = $this->base_url; - - // Filters - $all_modes = edd_get_payment_modes(); - $all_gateways = edd_get_payment_gateways(); - - // No modes - if ( empty( $all_modes ) ) { - $modes = array(); - - // Add "All" and pluck labels - } else { - $modes = array_merge( array( - 'all' => __( 'All modes', 'easy-digital-downloads' ) - ), wp_list_pluck( $all_modes, 'admin_label' ) ); - } - - // No gateways - if ( empty( $all_gateways ) ) { - $gateways = array(); - - // Add "All" and pluck labels - } else { - $gateways = array_merge( array( - 'all' => __( 'All gateways', 'easy-digital-downloads' ) - ), wp_list_pluck( $all_gateways, 'admin_label' ) ); - } - - /** - * Allow gateways that aren't registered the standard way to be displayed in the dropdown. - * - * @since 2.8.11 - */ - $gateways = apply_filters( 'edd_payments_table_gateways', $gateways ); - - // Output the items - if ( ! empty( $modes ) ) : ?> - - - html->select( array( - 'options' => $modes, - 'name' => 'mode', - 'id' => 'mode', - 'selected' => $mode, - 'show_option_all' => false, - 'show_option_none' => false - ) ); ?> - - - - - - html->date_field( array( - 'id' => 'start-date', - 'name' => 'start-date', - 'placeholder' => _x( 'From', 'date filter', 'easy-digital-downloads' ), - 'value' => $start_date - ) ); - - echo EDD()->html->date_field( array( - 'id' => 'end-date', - 'name' => 'end-date', - 'placeholder' => _x( 'To', 'date filter', 'easy-digital-downloads' ), - 'value' => $end_date - ) ); - - ?> - - - html->select( array( - 'options' => $gateways, - 'name' => 'gateway', - 'id' => 'gateway', - 'selected' => $gateway, - 'show_option_all' => false, - 'show_option_none' => false - ) ); ?> - - - - - - - -
    -
    - - __( 'equal to', 'easy-digital-downloads' ), - 'gt' => __( 'greater than', 'easy-digital-downloads' ), - 'lt' => __( 'less than', 'easy-digital-downloads' ), - ); - - echo EDD()->html->select( array( - 'id' => 'order-amount-filter-type', - 'name' => 'order-amount-filter-type', - 'options' => $options, - 'selected' => $order_total_filter_type, - 'show_option_all' => false, - 'show_option_none' => false, - ) ); - ?> - - -
    - -
    - - html->product_dropdown( array( - 'id' => 'orders-filter-product-id', - 'name' => 'product-id', - 'chosen' => true, - 'selected' => $product_id, - 'variations' => true - ) ); - ?> -
    - -
    - - html->country_select( - array( - 'name' => 'order-country-filter-value', - ), - esc_html( $country ) - ); - echo EDD()->html->region_select( - array( - 'name' => 'order-region-filter-value', - ), - esc_html( $country ), - esc_html( $region ) - ); - ?> -
    - - - -
    - - - - -
    - - -
    -
    - - - - - - - - - - - - - - search_box( esc_html__( 'Search', 'easy-digital-downloads' ), 'edd-payments' ); - } - - /** - * Show the search field. - * - * @since 1.4 - * - * @param string $text Label for the search box. - * @param string $input_id ID of the search box. - */ - public function search_box( $text, $input_id ) { - - // Bail if no customers and no search. - if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { - return; - } - - $input_id = $input_id . '-search-input'; - - if ( ! empty( $_REQUEST['orderby'] ) ) { - echo ''; - } - - if ( ! empty( $_REQUEST['order'] ) ) { - echo ''; - } - - ?> - -

    - - - -

    - - get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'edd_payment' LIMIT 1" ); - if ( ! empty( $orders ) ) { - esc_html_e( 'Easy Digital Downloads needs to upgrade the database. Orders will be available when that has completed.', 'easy-digital-downloads' ); - return; - } - } - - $status = $this->get_status(); - - if ( ! empty( $status ) ) { - $status_label = edd_get_status_label( $status ); - - switch ( $status ) { - case 'trash': - /* Translators: %s is for the status of 'Trash', telling the user no items were found in the trash. */ - $message = sprintf( __( 'No orders found in %s.', 'easy-digital-downloads' ), $status_label ); - break; - default: - /* Translators: %s is for the currently viewed order status filter */ - $message = sprintf( __( 'No %s orders found.', 'easy-digital-downloads' ), $status_label ); - break; - } - - echo esc_html( $message ); - } else { - esc_html_e( 'No orders found.', 'easy-digital-downloads' ); - } - } - - /** - * Retrieve the table columns. - * - * @since 1.4 - * - * @return array $columns Array of all the list table columns. - */ - public function get_columns() { - $columns = array( - 'cb' => '', // Render a checkbox instead of text - 'number' => __( 'Number', 'easy-digital-downloads' ), - 'customer' => __( 'Customer', 'easy-digital-downloads' ), - 'gateway' => __( 'Gateway', 'easy-digital-downloads' ), - 'amount' => __( 'Total', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ), - 'status' => __( 'Status', 'easy-digital-downloads' ), - ); - - if ( 'refund' === $this->type ) { - unset( $columns['status'] ); - } - - /** - * Filters the columns for Orders and Refunds table. - * - * @since unknown - * - * @param array $columns Table columns. - */ - $columns = apply_filters( 'edd_payments_table_columns', $columns ); - - return $columns; - } - - /** - * Retrieve the sortable columns. - * - * @since 1.4 - * - * @return array Array of all the sortable columns. - */ - public function get_sortable_columns() { - return apply_filters( 'edd_payments_table_sortable_columns', array( - 'number' => array( 'id', true ), - 'status' => array( 'status', false ), - 'customer' => array( 'customer_id', false ), - 'gateway' => array( 'gateway', false ), - 'amount' => array( 'total', false ), - 'date' => array( 'date_created', false ) - ) ); - } - - /** - * Gets the name of the primary column. - * - * @since 2.5 - * @access protected - * - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'number'; - } - - /** - * This function renders most of the columns in the list table. - * - * @since 1.4 - * @since 3.0 Updated to use the new EDD\Orders\Order class. - * - * @param EDD\Orders\Order $order Order object. - * @param string $column_name The name of the column. - * - * @return string Column name. - */ - public function column_default( $order, $column_name ) { - $timezone_abbreviation = edd_get_timezone_abbr(); - switch ( $column_name ) { - case 'amount': - $currency = ! empty( $order->currency ) ? $order->currency : edd_get_currency(); - $value = edd_display_amount( $order->total, $currency ); - break; - case 'date': - $value = ''; - break; - case 'gateway': - $value = edd_get_gateway_admin_label( $order->gateway ); - - if ( empty( $value ) ) { - $value = '—'; - } - - break; - case 'status': - $value = edd_get_order_status_badge( $order->status ); - break; - default: - $value = method_exists( $order, 'get_' . $column_name ) - ? call_user_func( array( $order, 'get_' . $column_name ) ) - : ''; - break; - } - - return apply_filters( 'edd_payments_table_column', $value, $order->id, $column_name ); - } - - /** - * Render the checkbox column. - * - * @since 1.4 - * @since 3.0 Updated to use the new EDD\Orders\Order class. - * - * @param EDD\Orders\Order $order Order object. - * @return string Displays a checkbox. - */ - public function column_cb( $order ) { - $order_number = 'sale' === $order->type ? $order->get_number() : $order->order_number; - return sprintf( - '', - 'order', - absint( $order->id ), - /* translators: the order number */ - esc_html( sprintf( __( 'Select %s', 'easy-digital-downloads' ), $order_number ) ) - ); - } - - /** - * Render the ID column. - * - * @since 2.0 - * @since 3.0 Updated to use the new EDD\Orders\Order class. - * - * @param EDD\Orders\Order $order Order object. - * @return string Displays a checkbox. - */ - public function column_number( $order ) { - $status = $this->get_status(); - - // View URL. - $view_url = edd_get_admin_url( array( - 'page' => 'edd-payment-history', - 'view' => 'sale' === $order->type - ? 'view-order-details' - : 'view-refund-details', - 'id' => absint( $order->id ), - ) ); - - // Default row actions. - $row_actions = array( - 'view' => '' . esc_html__( 'Edit', 'easy-digital-downloads' ) . '', - ); - - // View receipt. - if ( 'sale' === $order->type && edd_can_view_receipt( $order ) ) { - $row_actions['receipt'] = sprintf( - '%s', - edd_get_receipt_page_uri( $order->id ), - __( 'View Receipt', 'easy-digital-downloads' ) - ); - } - - // Resend Receipt. - if ( 'sale' === $this->type && 'complete' === $order->status && ! empty( $order->email ) ) { - $row_actions['email_links'] = '' . __( 'Resend Receipt', 'easy-digital-downloads' ) . ''; - } - - // Keep Delete at the end. - if ( edd_is_order_trashable( $order->id ) ) { - $trash_url = wp_nonce_url( add_query_arg( array( - 'edd-action' => 'trash_order', - 'purchase_id' => absint( $order->id ), - ), $this->base_url ), 'edd_payment_nonce' ); - $row_actions['trash'] = '' . esc_html__( 'Trash', 'easy-digital-downloads' ) . ''; - } elseif ( edd_is_order_restorable( $order->id ) ) { - $restore_url = wp_nonce_url( add_query_arg( array( - 'edd-action' => 'restore_order', - 'purchase_id' => absint( $order->id ), - ), $this->base_url ), 'edd_payment_nonce' ); - $row_actions['restore'] = '' . esc_html__( 'Restore', 'easy-digital-downloads' ) . ''; - - $delete_url = wp_nonce_url( add_query_arg( array( - 'edd-action' => 'delete_order', - 'purchase_id' => absint( $order->id ), - ), $this->base_url ), 'edd_payment_nonce' ); - $row_actions['delete'] = '' . esc_html__( 'Delete Permanently', 'easy-digital-downloads' ) . ''; - - unset( $row_actions['view'] ); - } - - if ( has_filter( 'edd_payment_row_actions' ) ) { - $payment = edd_get_payment( $order->id ); - - /** - * Filters the row actions. - * - * @deprecated 3.0 - * - * @param array $row_actions - * @param EDD_Payment|false $payment - */ - $row_actions = apply_filters_deprecated( 'edd_payment_row_actions', array( $row_actions, $payment ), '3.0', 'edd_order_row_actions' ); - } - - /** - * Filters the row actions. - * - * @param array $row_actions Array of row actions. - * @param EDD\Orders\Order $order Order object. - * - * @since 3.0 - */ - $row_actions = apply_filters( 'edd_order_row_actions', $row_actions, $order ); - - // Row actions - $actions = $this->row_actions( $row_actions ); - - // Primary link - $order_number = 'sale' === $order->type ? $order->get_number() : $order->order_number; - $link = edd_is_order_restorable( $order->id ) ? '' . esc_html( $order_number ) . '' : '' . esc_html( $order_number ) . ''; - - // Concatenate & return the results - return $link . $actions; - } - - /** - * Render the Customer column. - * - * @since 2.4.3 - * @since 3.0 Updated to use the new EDD\Orders\Order class. - * - * @param EDD\Orders\Order $order Order object. - * @return string Data shown in the Customer column. - */ - public function column_customer( $order ) { - $customer_id = $order->customer_id; - $customer = edd_get_customer( $customer_id ); - - // Actions if exists - if ( ! empty( $customer ) ) { - - // Use customer name, if exists - $name = ! empty( $customer->name ) - ? $customer->name - : $order->email; - - // Link to View Customer - $url = edd_get_admin_url( array( - 'page' => 'edd-customers', - 'view' => 'overview', - 'id' => absint( $customer_id ), - ) ); - - $name = '' . esc_html( $name ) . ''; - if ( ! empty( $customer->name ) ) { - $name .= '
    ' . $order->email . '
    '; - } - } else { - $name = $order->email; - } - - /** - * Filters the output of the Email column in the Payments table. - * - * @since 1.4 - * @since 3.0 Run manually inside of the `customer` column for backwards compatibility. - * - * @param string $name Customer name. - * @param int $order_id ID of the Payment/Order. - * @param string $column_name Name of the current column (email). - */ - $name = apply_filters( 'edd_payments_table_column', $name, $order->id, 'email' ); - - return $name; - } - - /** - * Retrieve the bulk actions. - * - * @since 1.4 - * - * @return array $actions Bulk actions. - */ - public function get_bulk_actions() { - if ( 'refund' !== $this->type ) { - $action = array( - 'set-status-complete' => __( 'Mark Completed', 'easy-digital-downloads' ), - 'set-status-pending' => __( 'Mark Pending', 'easy-digital-downloads' ), - 'set-status-processing' => __( 'Mark Processing', 'easy-digital-downloads' ), - 'set-status-revoked' => __( 'Mark Revoked', 'easy-digital-downloads' ), - 'set-status-failed' => __( 'Mark Failed', 'easy-digital-downloads' ), - 'set-status-abandoned' => __( 'Mark Abandoned', 'easy-digital-downloads' ), - 'set-status-preapproval' => __( 'Mark Preapproved', 'easy-digital-downloads' ), - 'set-status-cancelled' => __( 'Mark Cancelled', 'easy-digital-downloads' ), - 'resend-receipt' => __( 'Resend Receipts', 'easy-digital-downloads' ), - ); - } else { - $action = array(); - } - - if ( 'trash' === $this->get_status() ) { - $action = array( - 'restore' => __( 'Restore', 'easy-digital-downloads' ), - ); - - if ( current_user_can( 'delete_shop_payments' ) ) { - $action['delete'] = __( 'Delete permanently', 'easy-digital-downloads' ); - } - } else { - $action['trash'] = __( 'Move to Trash', 'easy-digital-downloads' ); - } - - return apply_filters( 'edd_payments_table_bulk_actions', $action ); - } - - /** - * Process the bulk actions. - * - * @since 1.4 - * @since 3.0 Updated to display _doing_it_wrong(). - * - * @see edd_orders_list_table_process_bulk_actions() - */ - public function process_bulk_action() { - _doing_it_wrong( __FUNCTION__, 'Orders list table bulk actions are now handled by edd_orders_list_table_process_bulk_actions(). Please do not call this method directly.', 'EDD 3.0' ); - } - - /** - * Retrieve the payment counts. - * - * @since 1.4 - */ - public function get_payment_counts() { - - // Get the args (without pagination) - $args = $this->parse_args( false ); - - unset( $args['status'], $args['status__not_in'], $args['status__in'] ); - - // Get order counts by type - $this->counts = edd_get_order_counts( $args ); - } - - /** - * Retrieves all the data for all the orders. - * - * @since 1.4 - * @deprecated 3.0 Use get_data() - * - * @return array $payment_data Array of all the data for the orders. - */ - public function payments_data() { - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Payment_History_Table::get_data()' ); - - return $this->get_data(); - } - - /** - * Retrieves all of the orders data based on current filters. - * - * @since 3.0 - * - * @return array Orders table data. - */ - public function get_data() { - - // Parse args (with pagination) - $this->args = $this->parse_args( true ); - - // Force EDD\Orders\Order objects to be returned - $this->args['output'] = 'orders'; - - if ( empty( $this->args['status'] ) ) { - $this->args['status__not_in'] = array( 'trash' ); - } - - // Get data - $items = edd_get_orders( $this->args ); - - // Get customer IDs and count from payments - $customer_ids = array_unique( wp_list_pluck( $items, 'customer_id' ) ); - $cust_count = count( $customer_ids ); - - // Maybe prime customer objects (if more than number of queries) - if ( $cust_count > 1 ) { - edd_get_customers( array( - 'id__in' => $customer_ids, - 'no_found_rows' => true, - 'number' => $cust_count - ) ); - } - - // Return items - return $items; - } - - /** - * Retrieves the Payments table views. - * - * @since 1.4 - * - * @return array $views Available views. - */ - public function get_views() { - $views = parent::get_views(); - - /** - * Filters the Payment table's views. - * - * @since 1.4 - * - * @param array $views Payment table's views. - */ - $views = apply_filters( 'edd_payments_table_views', $views ); - - return $views; - } - - /** - * Builds an array of arguments for getting orders for the list table, counts, and pagination. - * - * @since 3.0 - * - * @param bool $paginate Whether to add pagination arguments - * - * @return array Array of arguments to use for querying orders. - */ - private function parse_args( $paginate = true ) { - $status = $this->get_status(); - $user = isset( $_GET['user'] ) ? absint( $_GET['user'] ) : null; - $customer = isset( $_GET['customer'] ) ? absint( $_GET['customer'] ) : null; - $search = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null; - $start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null; - $end_date = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date; - $gateway = isset( $_GET['gateway'] ) ? sanitize_text_field( $_GET['gateway'] ) : null; - $mode = isset( $_GET['mode'] ) ? sanitize_text_field( $_GET['mode'] ) : null; - $type = isset( $_GET['order_type'] ) ? sanitize_text_field( $_GET['order_type'] ) : 'sale'; - - /** - * Introduced as part of #6063. Allow a gateway to specified based on the context. - * - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/issues/6063 - * @since 2.8.11 - * - * @param string $gateway - */ - $gateway = apply_filters( 'edd_payments_table_search_gateway', $gateway ); - - if ( $gateway === 'all' ) { - $gateway = null; - } - - if ( $mode === 'all' ) { - $mode = null; - } - - $args = array_filter( array( - 'user_id' => $user, - 'customer_id' => $customer, - 'status' => $status, - 'gateway' => $gateway, - 'mode' => $mode, - 'type' => $type, - ) ); - - // If no specific ordering has been requested, order by `date_created`. - if ( empty( $_GET['orderby'] ) ) { - $args['orderby'] = 'date_created'; - $args['order'] = 'DESC'; - } - - // Update args by search query. - if ( ! empty( $search ) ) { - $args = $this->parse_search( $search, $args ); - } - - // Date query - if ( ! empty( $start_date ) || ! empty( $end_date ) ) { - - // start AND end - $args['date_query'] = array( - 'relation' => 'AND' - ); - - // Start (of day) - if ( ! empty( $start_date ) ) { - $args['date_query'][] = array( - 'column' => 'date_created', - 'after' => edd_get_utc_date_string( $start_date, 'mysql' ), - ); - } - - // End (of day) - if ( ! empty( $end_date ) ) { - $end_date_string = EDD()->utils->get_date_string( $end_date, 23, 59, 59 ); - $args['date_query'][] = array( - 'column' => 'date_created', - 'before' => edd_get_utc_date_string( $end_date_string, 'mysql' ), - ); - } - } - - // Maybe filter by order amount. - if ( isset( $_GET['order-amount-filter-type'] ) && ! empty( $_GET['order-amount-filter-value'] ) ) { - $filter_amount = floatval( sanitize_text_field( $_GET['order-amount-filter-value'] ) ); - - switch ( $_GET['order-amount-filter-type'] ) { - case 'lt': - $filter_type = '<'; - break; - case 'gt': - $filter_type = '>'; - break; - default: - $filter_type = '='; - break; - } - - $args['compare_query'] = array( - array( - 'key' => 'total', - 'value' => $filter_amount, - 'compare' => $filter_type, - ), - ); - } - - // Maybe filter by product. - if ( ! empty( $_GET['product-id'] ) ) { - if ( false !== strpos( $_GET['product-id'], '_' ) ) { - $product_pieces = explode( '_', $_GET['product-id'] ); - $args['product_id'] = absint( $product_pieces[0] ); - $args['product_price_id'] = absint( $product_pieces[1] ); - } else { - $args['product_id'] = absint( $_GET['product-id'] ); - } - } - - // Maybe filter by country. - if ( ! empty( $_GET['order-country-filter-value'] ) ) { - $args['country'] = sanitize_text_field( $_GET['order-country-filter-value'] ); - } - - // Maybe filter by region. - if ( ! empty( $_GET['order-region-filter-value'] ) ) { - $args['region'] = sanitize_text_field( $_GET['order-region-filter-value'] ); - } - - // Maybe filter by discount ID. - if ( ! empty( $_GET['discount_id'] ) ) { - $args['discount_id'] = absint( $_GET['discount_id'] ); - } - - /** - * Filters array of arguments for getting orders for the list table, counts, and pagination. - * - * @since 3.0 - * - * @param array $args Array of arguments to use for querying orders. - * @param bool $paginate $paginate Whether to add pagination arguments - */ - $args = apply_filters( 'edd_payments_table_parse_args', $args, $paginate ); - - // Return args, possibly with pagination - return ( true === $paginate ) - ? $this->parse_pagination_args( $args ) - : $args; - } - - /** - * Parse the search query. - * - * @since 3.0.2 - * @param string $search - * @param array $args - * @return array - */ - private function parse_search( $search, $args ) { - - // Order ID/number. - if ( is_numeric( $search ) ) { - $args['id'] = $search; - $args['order_number'] = $search; - - return $args; - } - - // Transaction ID - if ( is_string( $search ) && ( false !== strpos( $search, 'txn:' ) ) ) { - $args['txn'] = trim( str_replace( 'txn:', '', $search ) ); - - return $args; - } - - // Email - if ( is_email( $search ) ) { - $args['email'] = $search; - - return $args; - } - - // Download ID - if ( is_string( $search ) && ( false !== strpos( $search, '#' ) ) ) { - $args['product_id'] = intval( trim( str_replace( '#', '', $search ) ) ); - - return $args; - } - - // The customer’s name or ID prefixed by customer: - if ( ! is_array( $search ) && ( false !== strpos( $search, 'customer:' ) ) ) { - $search = trim( str_replace( 'customer:', '', $search ) ); - - // Search by customer ID. - if ( is_numeric( $search ) ) { - $args['customer_id'] = absint( $search ); - - return $args; - } - - // Get customer IDs that match the search string. - $customers = edd_get_customers( - array( - 'search' => $search, - 'fields' => 'ids', - ) - ); - if ( ! empty( $customers ) ) { - $args['customer_id__in'] = $customers; - } else { - $args['customer_id__in'] = array( null ); - } - - return $args; - } - - // The user ID prefixed by user: - if ( ! is_array( $search ) && ( false !== strpos( $search, 'user:' ) ) ) { - $search = trim( str_replace( 'user:', '', $search ) ); - if ( is_numeric( $search ) ) { - $args['user_id'] = absint( $search ); - - return $args; - } - } - - // The Discount Code prefixed by discount: - if ( is_string( $search ) && ( false !== strpos( $search, 'discount:' ) ) ) { - $discount = edd_get_discount_by_code( trim( str_replace( 'discount:', '', $search ) ) ); - if ( ! empty( $discount->id ) ) { - $args['discount_id'] = $discount->id; - } else { - // If no discount object is found, we force the results to be empty. - $args['id__in'] = array( null ); - } - - return $args; - } - - // Default search - $args['search'] = $search; - - return $args; - } - - /** - * Setup the final data for the table. - * - * @since 1.4 - */ - public function prepare_items() { - wp_reset_vars( array( 'action', 'order', 'orderby', 'order', 's' ) ); - - $hidden = array(); // No hidden columns - $columns = $this->get_columns(); - $sortable = $this->get_sortable_columns(); - $status = $this->get_status( 'total' ); - $this->items = $this->get_data(); - - $this->_column_headers = array( $columns, $hidden, $sortable ); - if ( empty( $this->counts[ $status ] ) ) { - return; - } - - $this->set_pagination_args( array( - 'total_pages' => ceil( $this->counts[ $status ] / $this->per_page ), - 'total_items' => $this->counts[ $status ], - 'per_page' => $this->per_page, - ) ); - } - - /** - * Generate the table navigation above or below the table. - * We're overriding this to turn off the referer param in `wp_nonce_field()`. - * - * @param string $which - * @since 3.1.0.4 - * @since 3.1.1 Outputs the dialogs for deleting orders. - */ - protected function display_tablenav( $which ) { - if ( 'top' === $which ) : - wp_nonce_field( 'bulk-' . $this->_args['plural'], '_wpnonce', false ); - ?> -
    - -
    -
    - -
    - -
    - - has_items() ) : ?> -
    - bulk_actions( $which ); ?> -
    - extra_tablenav( $which ); - $this->pagination( $which ); - ?> - -
    -
    - 'refund-item', - 'plural' => 'refund-items', - 'ajax' => false, - ) ); - - $this->get_counts(); - } - - /** - * Get the base URL for the order item list table. - * - * @since 3.0 - * - * @return string Base URL. - */ - public function get_base_url() {} - - /** - * Retrieve the view types. - * - * @since 3.0 - * - * @return array $views All the views available. - */ - public function get_views() { - return array(); - } - - /** - * Retrieve the table columns. - * - * @since 3.0 - * - * @return array $columns Array of all the list table columns. - */ - public function get_columns() { - $columns = array( - 'cb' => '', - 'name' => __( 'Product', 'easy-digital-downloads' ), - 'amount' => __( 'Unit Price', 'easy-digital-downloads' ), - 'quantity' => __( 'Quantity', 'easy-digital-downloads' ), - 'subtotal' => __( 'Subtotal', 'easy-digital-downloads' ), - ); - - // Maybe add tax column. - $order = $this->get_order(); - if ( $order && $order->get_tax_rate() ) { - $columns['tax'] = __( 'Tax', 'easy-digital-downloads' ); - } - - // Total at the end. - $columns['total'] = __( 'Total', 'easy-digital-downloads' ); - - // Return columns. - return $columns; - } - - /** - * Retrieve the sortable columns. - * - * @since 3.0 - * - * @return array Array of all the sortable columns. - */ - public function get_sortable_columns() { return array(); } - - /** - * Gets the name of the primary column. - * - * @since 2.5 - * @access protected - * - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'name'; - } - - /** - * Generates a unique ID for an item, to be used as HTML IDs. - * We cannot simply use `$item->id` because it's possible that an order item and order adjustment - * could have the same ID. - * - * @param Order_Item|Order_Adjustment $item - * - * @since 3.0 - * @return string - */ - private function get_item_unique_id( $item ) { - return $item instanceof Order_Item ? 'order-item-' . $item->id : 'order-adjustment-' . $item->id; - } - - /** - * Returns a string that designates the type of object. This is used in HTML `name` attributes. - * - * @param Order_Item|Order_Adjustment $item - * - * @since 3.0 - * @return string - */ - private function get_object_type( $item ) { - return $item instanceof Order_Item ? 'order_item' : 'order_adjustment'; - } - - /** - * Returns the item display name. - * - * @param Order_Item|Order_Adjustment $item - * - * @since 3.0 - * @return string - */ - private function get_item_display_name( $item ) { - $name = ''; - if ( $item instanceof Order_Item ) { - return $item->get_order_item_name(); - } - if ( $item instanceof Order_Adjustment ) { - $name = __( 'Order Fee', 'easy-digital-downloads' ); - if ( 'credit' === $item->type ) { - $name = __( 'Order Credit', 'easy-digital-downloads' ); - } - if ( ! empty( $item->description ) ) { - $name .= ': ' . $item->description; - } - } - - return $name; - } - - /** - * This function renders most of the columns in the list table. - * - * @since 3.0 - * - * @param Order_Item|Order_Adjustment $item Order item or adjustment object. - * @param string $column_name The name of the column. - * - * @return string Column name. - */ - public function column_default( $item, $column_name ) { - $object_type = $this->get_object_type( $item ); - $item_id = $this->get_item_unique_id( $item ); - - switch ( $column_name ) { - case 'amount': - return $this->format_currency( $item, $column_name ); - - case 'total': - return $this->format_currency( $item, $column_name, 0 ); - - case 'quantity': - return $this->get_quantity_column( $item, $column_name, $item_id, $object_type ); - - case 'subtotal': - case 'tax': - return $this->get_adjustable_column( $item, $column_name, $item_id, $object_type ); - - default: - return property_exists( $item, $column_name ) - ? $item->{$column_name} - : ''; - } - } - - /** - * This private function formats a column value for currency. - * - * @since 3.0 - * - * @param Order_Item|Order_Adjustment $item Item object. - * @param string $column_name ID of the column being displayed. - * @param false|float $amount_override Amount override, in case it's not in the order item. - * - * @return string Formatted amount. - */ - private function format_currency( $item, $column_name, $amount_override = false ) { - $symbol = $this->get_currency_symbol( $item->order_id ); - $currency_pos = edd_get_option( 'currency_position', 'before' ); - - $formatted_amount = ''; - - if ( 'before' === $currency_pos ) { - $formatted_amount .= $symbol; - } - - // Order Adjustments do not have an `amount` column. We can use `subtotal` instead. - if ( 'amount' === $column_name && $item instanceof Order_Adjustment ) { - $column_name = 'subtotal'; - } - - $amount = false !== $amount_override ? $amount_override : $item->{$column_name}; - - $formatted_amount .= '' . edd_format_amount( $amount, true, $this->get_order_currency_decimals( $item->order_id ) ) . ''; - - if ( 'after' === $currency_pos ) { - $formatted_amount .= $symbol; - } - - return $formatted_amount; - } - - /** - * This private function returns the form input for refundable items, - * or amounts for items which have already been refunded. - * - * @param Order_Item $item The item object. - * @param string $column_name ID of the column being displayed. - * @param string $item_id Unique ID of the order item for the refund modal. - * @param string $object_type The item type. - * @return string - */ - private function get_adjustable_column( $item, $column_name, $item_id, $object_type ) { - - if ( 'refunded' === $item->status ) { - return $this->format_currency( $item, $column_name, 0 ); - } - - $currency_pos = edd_get_option( 'currency_position', 'before' ); - - // Maximum amounts that can be refunded. - $refundable_amounts = $item->get_refundable_amounts(); - $amount_remaining = array_key_exists( $column_name, $refundable_amounts ) ? $refundable_amounts[ $column_name ] : $item->{$column_name}; - - /* - * Original amount. - * For subtotals, we actually do subtotal minus discounts for simplicity so that the end user - * doesn't have to juggle that. - */ - $original_amount = $item->{$column_name}; - if ( 'subtotal' === $column_name && ! empty( $item->discount ) ) { - $original_amount -= $item->discount; - } - ob_start(); - ?> -
    - -
    - '; - echo esc_html( $this->get_currency_symbol( $item->order_id ) ); - echo ''; - } - ?> - - - - '; - echo esc_html( $this->get_currency_symbol( $item->order_id ) ); - echo ''; - } - ?> -
    - - format_currency( $item, $column_name, $amount_remaining ); - ?> - -
    - get_refundable_amounts(); - $item_quantity = 'order_item' === $object_type ? $refundable_amounts['quantity'] : 1; - ob_start(); - ?> -
    - -
    - - - - $options, - 'name' => 'refund_' . esc_attr( $object_type ) . '[' . esc_attr( $item->id ) . '][quantity]', - 'id' => 'edd-order-item-quantity-' . esc_attr( $item_id ), - 'class' => 'edd-order-item-refund-quantity edd-order-item-refund-input', - 'disabled' => true, - 'show_option_all' => false, - 'show_option_none' => false, - 'chosen' => false, - 'selected' => $item_quantity, - 'data' => array( - 'max' => intval( $item_quantity ), - 'original' => intval( $item->quantity ), - ), - ); - ?> - html->select( $args ); ?> - -
    -
    - currency ); - } else { - $currency_decimals = 2; - } - } - - return $currency_decimals; - } - - /** - * Retrieves the currency symbol for a given order item. - * - * @param int $order_id - * - * @since 3.0 - * @return string|null - */ - private function get_currency_symbol( $order_id ) { - static $symbol = null; - - if ( is_null( $symbol ) ) { - $order = edd_get_order( $order_id ); - - if ( $order ) { - $symbol = edd_currency_symbol( $order->currency ); - } - } - - return $symbol; - } - - /** - * Render the checkbox column - * - * @since 3.0 - * - * @param Order_Item|Order_Adjustment $item Order Item or Order Adjustment object. - * - * @return string - */ - public function column_cb( $item ) { - $object_type = $this->get_object_type( $item ); - $refundable_amounts = $item->get_refundable_amounts(); - $total_remaining = array_key_exists( 'total', $refundable_amounts ) ? floatval( $refundable_amounts['total'] ) : 0.00; - - if ( 'refunded' !== $item->status && 0.00 != $total_remaining ) { - - return sprintf( - '', - /*$1%s*/ - 'refund_' . esc_attr( $object_type ), - /*$2%s*/ - esc_attr( $item->id ), - /* translators: product name */ - esc_html( sprintf( __( 'Select %s', 'easy-digital-downloads' ), $this->get_item_display_name( $item ) ) ) - ); - } - - return ''; - } - - /** - * Render the Name Column - * - * @since 3.0 - * - * @param Order_Item|Order_Adjustment $item Order Item object. - * - * @return string Data shown in the Name column - */ - public function column_name( $item ) { - $checkbox_id = 'refund_' . $this->get_object_type( $item ) . '-' . $item->id; - $display_name = esc_html( $this->get_item_display_name( $item ) ); - $status_label = ! empty( $item->status ) && 'complete' !== $item->status ? ' — ' . edd_get_status_label( $item->status ) : ''; - - if ( 'refunded' === $item->status ) { - return '' . $display_name . '' . esc_html( $status_label ); - } - - return '' . $status_label; - } - - /** - * Message to be displayed when there are no items - * - * @since 3.0 - */ - public function no_items() { - esc_html_e( 'No items found.', 'easy-digital-downloads' ); - } - - /** - * Retrieve the bulk actions - * - * @since 3.0 - * @return array $actions Array of the bulk actions - */ - public function get_bulk_actions() { return array(); } - - /** - * Process the bulk actions - * - * @since 3.0 - */ - public function process_bulk_action() {} - - /** - * Retrieve the order_item code counts - * - * @todo Fees aren't included in this count, but where does this actually get used anyway? - * - * @since 3.0 - */ - public function get_counts() { - - // Maybe retrieve counts. - if ( ! edd_is_add_order_page() ) { - - // Check for an order ID - $order_id = ! empty( $_POST['order_id'] ) - ? absint( $_POST['order_id'] ) // WPCS: CSRF ok. - : 0; - - // Get counts - $this->counts = edd_get_order_item_counts( array( - 'order_id' => $order_id, - ) ); - } - } - - /** - * Retrieve all order data to be shown on the refund table. - * This includes order items and order adjustments. - * - * @since 3.0 - * @return Order[]|Order_Adjustment[] All order items and order adjustments associated with the current order. - */ - public function get_data() { - $order = $this->get_order(); - - if ( empty( $order ) ) { - return array(); - } - - // Get order items. - $order_items = edd_get_order_items( array( - 'order_id' => $order->id, - 'number' => 999, - ) ); - - // Get order fees - $order_fees = $order->get_fees(); - - // Get order credits. - $credits = edd_get_order_adjustments( array( - 'object_id' => $order->id, - 'object_type' => 'order', - 'type' => 'credit', - ) ); - - return array_merge( $order_items, $order_fees, $credits ); - } - - /** - * Setup the final data for the table - * - * @since 3.0 - */ - public function prepare_items() { - $this->_column_headers = array( - $this->get_columns(), - array(), - $this->get_sortable_columns(), - ); - - $this->items = $this->get_data(); - } - - /** - * Generates content for a single row of the table - * - * @since 3.0 - * - * @param Order_Item|Order_Adjustment $item Order item object. - */ - public function single_row( $item ) { - - $is_adjustment = $item instanceof Order_Adjustment; - $item_class = $is_adjustment ? $item->object_id : $item->order_id; - // Status. - $classes = array_map( 'sanitize_html_class', array( - 'order-' . $item_class, - $item->status, - 'refunditem', - ) ); - - // Turn into a string. - $class = implode( ' ', $classes ); - $item_id = $this->get_item_unique_id( $item ); - - $is_credit = $is_adjustment && 'credit' === $item->type; - ?> - ="id ); ?>" class=""> - single_row_columns( $item ); ?> - - _args['singular']; - - wp_nonce_field( 'edd_process_refund', 'edd_process_refund' ); - $this->screen->render_screen_reader_content( 'heading_list' ); - ?> - - - - print_column_headers(); ?> - - - - > - display_rows_or_placeholder(); ?> - - -
    -
    - get_order() ); - - $this->display_tablenav( 'bottom' ); - ?> -
    - -
    - -
    - items as $item ) { - - if ( empty( $order_id ) ) { - $order_id = $item->order_id; - } - - $this->single_row( $item ); - } - - $currency_symbol = $this->get_currency_symbol( $order_id ); - - // Now we need to add the columns for the totals. - ?> - - - - - %s', $currency_symbol ); - $before = 'before' === $currency_position ? $currency_symbol_output : ''; - $after = 'after' === $currency_position ? $currency_symbol_output : ''; - $amount = edd_format_amount( 0.00, true, $this->get_order_currency_decimals( $order_id ) ); - printf( - '%1$s%2$s%3$s', - $before, // phpcs:ignore - esc_attr( $amount ), - $after // phpcs:ignore - ); - ?> - - - - get_order(); - if ( $order && $order->get_tax_rate() ) : - ?> - - - - - %1$s%2$s%3$s', - $before, // phpcs:ignore - esc_attr( $amount ), - $after // phpcs:ignore - ); - ?> - - - - - - - - - %1$s%2$s%3$s', - $before, // phpcs:ignore - esc_attr( $amount ), - $after // phpcs:ignore - ); - ?> - - - id ) { - return; - } - - // Do not show on Add or View Order/Refund. - if ( isset( $_GET['view'] ) ) { - return; - } - - $pass_manager = new Pass_Manager(); - if ( $pass_manager->isFree() ) { - $docs_url = edd_link_helper( - 'https://easydigitaldownloads.com/docs/', - array( - 'utm_medium' => 'orders-contextual-help', - 'utm_content' => 'documentation', - ) - ); - - $upgrade_url = edd_link_helper( - 'https://easydigitaldownloads.com/lite-upgrade/', - array( - 'utm_medium' => 'orders-contextual-help', - 'utm_content' => 'lite-upgrade', - ) - ); - - $screen->set_help_sidebar( - '

    ' . __( 'For more information:', 'easy-digital-downloads' ) . '

    ' . - '

    ' . sprintf( __( 'Visit the documentation on the Easy Digital Downloads website.', 'easy-digital-downloads' ), $docs_url ) . '

    ' . - '

    ' . sprintf( - __( 'Need more from your Easy Digital Downloads store? Upgrade Now!', 'easy-digital-downloads' ), - $upgrade_url - ) . '

    ' - ); - } - - $screen->add_help_tab( array( - 'id' => 'edd-payments-overview', - 'title' => __( 'Overview', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'This screen provides access to all of the orders and refunds in your store.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Orders can be searched by email address, user name, or filtered by status, mode, date range, gateway, and more!', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'To maintain accurate reporting and accounting, we strongly advise against deleting any completed order data.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-orders', - 'title' => __( '— Orders', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'Orders are placed by customers when they buy things from your store.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Every order contains a snapshot of your store at the time the order was placed, and is made up of many different pieces of information.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Things like products, discounts, taxes, fees, and customer email address, are all examples of information that is saved with each order.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Both full and partial refunds are supported.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-refunds', - 'title' => __( '— Refunds', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'Refunds are created when a customer would like money back from a completed order.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Every refund refers back to the original order, and only contains the items and adjustments that were refunded.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Refunds could be entire orders, or single products.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Once an item is refunded, it cannot be undone; it can only be repurchased.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-payments-search', - 'title' => __( 'Search', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'The order history can be searched in several different ways.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'You can enter:', 'easy-digital-downloads' ) . '

    ' . - '', - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-payments-details', - 'title' => __( 'Details', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'Each order can be further inspected by clicking the corresponding View Order Details link. This will provide more information including:', 'easy-digital-downloads' ) . '

    ' . - - '' - ) ); - - do_action( 'edd_payments_contextual_help', $screen ); -} -add_action( 'load-download_page_edd-payment-history', 'edd_payments_contextual_help' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/payments/orders.php b/wp-content/plugins/easy-digital-downloads/includes/admin/payments/orders.php deleted file mode 100644 index 5c839313..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/payments/orders.php +++ /dev/null @@ -1,1181 +0,0 @@ - - -
    -
    - -
    - -
    -
    -
    - - - - -
    -
    -
    - - -
    - - - autofocus - - /> -
    -
    - -
    -
    - -
    - -
    - -use_js = true; - $sections->current_section = 'customer'; - $sections->item = $item; - $sections->base_url = ''; - - // Get all registered tabs & views - $o_sections = edd_get_order_details_sections( $item ); - - // Set the customer sections - $sections->set_sections( $o_sections ); - - // Display the sections - $sections->display(); -} - -/** - * Return the order details sections. - * - * @since 3.0 - * - * @param object $order - * @return array Sections. - */ -function edd_get_order_details_sections( $order ) { - $sections = array( - array( - 'id' => 'customer', - 'label' => __( 'Customer', 'easy-digital-downloads' ), - 'icon' => 'businessman', - 'callback' => 'edd_order_details_customer', - ), - array( - 'id' => 'email', - 'label' => __( 'Email', 'easy-digital-downloads' ), - 'icon' => 'email', - 'callback' => 'edd_order_details_email', - ), - array( - 'id' => 'address', - 'label' => __( 'Address', 'easy-digital-downloads' ), - 'icon' => 'admin-home', - 'callback' => 'edd_order_details_addresses', - ), - array( - 'id' => 'notes', - 'label' => __( 'Notes', 'easy-digital-downloads' ), - 'icon' => 'admin-comments', - 'callback' => 'edd_order_details_notes', - ), - array( - 'id' => 'logs', - 'label' => __( 'Logs', 'easy-digital-downloads' ), - 'icon' => 'admin-tools', - 'callback' => 'edd_order_details_logs', - ), - ); - - // Override sections if adding a new order. - if ( edd_is_add_order_page() ) { - $sections = array( - array( - 'id' => 'customer', - 'label' => __( 'Customer', 'easy-digital-downloads' ), - 'icon' => 'businessman', - 'callback' => 'edd_order_details_customer', - ), - array( - 'id' => 'address', - 'label' => __( 'Address', 'easy-digital-downloads' ), - 'icon' => 'admin-home', - 'callback' => 'edd_order_details_addresses', - ), - ); - } - - /** - * Filter the sections. - * - * @since 3.0 - * - * @param array $sections Sections. - * @param object $order Order object. - */ - return (array) apply_filters( 'edd_get_order_details_sections', $sections, $order ); -} - -/** - * Output the order details customer section - * - * @since 3.0 - * - * @param object $order - */ -function edd_order_details_customer( $order ) { - $customer = edd_get_customer( $order->customer_id ); - $payment = edd_get_payment( $order->id ); - $user_info = $payment - ? $payment->user_info - : array(); - - $change_text = edd_is_add_order_page() - ? esc_html__( 'Assign', 'easy-digital-downloads' ) - : esc_html__( 'Switch Customer', 'easy-digital-downloads' ); - - $customer_id = ! empty( $customer ) - ? $customer->id - : 0; ?> - -
    -
    -
    -
    - -
    - html->customer_dropdown( - array( - 'class' => 'edd-payment-change-customer-input edd-form-group__input', - 'selected' => $customer_id, - 'id' => 'customer-id', - 'name' => 'customer-id', - 'none_selected' => esc_html__( 'Search for a customer', 'easy-digital-downloads' ), - 'placeholder' => esc_html__( 'Search for a customer', 'easy-digital-downloads' ), - ) - ); // WPCS: XSS ok. - ?> -
    -
    - - - -
    - -
    -
    - -
    - -
    - -

    - or -

    -
    - - -
    - - get_meta(), $user_info ); - } - do_action( 'edd_payment_view_details', $order->id ); -} - -/** - * Output the order details email section - * - * @since 3.0 - * - * @param object $order - */ -function edd_order_details_email( $order ) { - $customer = edd_get_customer( $order->customer_id ); - $all_emails = array( 'primary' => $customer->email ); - - if ( $customer->email !== $order->email ) { - $all_emails['order'] = $order->email; - } - - foreach ( $customer->emails as $key => $email ) { - if ( $customer->email === $email ) { - continue; - } - - $all_emails[ $key ] = $email; - } - - $help = sprintf( - /* translators: email type */ - __('Send a new copy of the purchase receipt to the %s email address. If download URLs were included in the original receipt, new ones will be included.', 'easy-digital-downloads' ), - count( $all_emails ) > 1 ? __( 'selected', 'easy-digital-downloads' ) : __( 'customer', 'easy-digital-downloads' ) - ); - - $is_multiselect = count( $all_emails ) > 1; - $label_text = $is_multiselect ? __( 'Send email receipt to', 'easy-digital-downloads' ) : __( 'Email Address', 'easy-digital-downloads' ); -?> - -
    -
    - - -
    - - - - - -
    - -

    - -

    -
    - -

    - -

    - - id ); ?> - -
    - 0, - 'order_id' => 0, - 'first_name' => '', - 'last_name' => '', - 'address' => '', - 'address2' => '', - 'city' => '', - 'region' => '', - 'postal_code' => '', - 'country' => '', - ) - : $order->get_address(); ?> - -
    - id ); ?> - -
    -

    - - - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - html->country_select( - array( - 'name' => 'edd_order_address[country]', - 'id' => 'edd-order-address-country', - 'class' => 'edd-order-address-country edd-form-group__input', - 'show_option_all' => false, - 'data' => array( - 'nonce' => wp_create_nonce( 'edd-country-field-nonce' ), - 'search-type' => 'no_ajax', - 'search-placeholder' => esc_html__( 'Search Countries', 'easy-digital-downloads' ), - ), - ), - $address->country - ); // WPCS: XSS ok. - ?> -
    -
    - -
    - -
    - country ); - if ( ! empty( $states ) ) { - echo EDD()->html->region_select( - array( - 'name' => 'edd_order_address[region]', - 'id' => 'edd_order_address_region', - 'class' => 'edd-order-address-region edd-form-group__input', - 'data' => array( - 'search-type' => 'no_ajax', - 'search-placeholder' => esc_html__( 'Search Regions', 'easy-digital-downloads' ), - ), - ), - $address->country, - $address->region - ); // WPCS: XSS ok. - } else { - ?> - - -
    -
    - - - -
    - -
    - - id ); -} - -/** - * Output the order details notes section - * - * @since 3.0 - * - * @param object $order - */ -function edd_order_details_notes( $order ) { - $notes = edd_get_payment_notes( $order->id ); ?> - -
    - - id, 'order' ); // WPCS: XSS ok. ?> -
    - - - -
    - id ); - $download_log_url = edd_get_admin_url( - array( - 'page' => 'edd-tools', - 'tab' => 'logs', - 'payment' => absint( $order->id ), - ) - ); - $customer_log_url = edd_get_admin_url( - array( - 'page' => 'edd-tools', - 'tab' => 'logs', - 'customer' => absint( $order->customer_id ), - ) - ); - $customer_orders_url = edd_get_admin_url( - array( - 'page' => 'edd-payment-history', - 'customer' => absint( $order->customer_id ), - ) - ); - ?> - -

    -

    -

    - - id ); - ?> -
    - - $order->id, - 'number' => 999, - ) ); - - foreach ( $items as $item ) { - $item_adjustments = array(); - - $adjustments = edd_get_order_adjustments( array( - 'object_id' => $item->id, - 'number' => 999, - 'object_type' => 'order_item', - 'type' => array( - 'discount', - 'credit', - 'fee', - ), - ) ); - - foreach ( $adjustments as $adjustment ) { - // @todo edd_get_order_adjustment_to_json()? - $adjustment_args = array( - 'id' => esc_html( $adjustment->id ), - 'objectId' => esc_html( $adjustment->object_id ), - 'objectType' => esc_html( $adjustment->object_type ), - 'typeId' => esc_html( $adjustment->type_id ), - 'type' => esc_html( $adjustment->type ), - 'description' => esc_html( $adjustment->description ), - 'subtotal' => esc_html( $adjustment->subtotal ), - 'tax' => esc_html( $adjustment->tax ), - 'total' => esc_html( $adjustment->total ), - 'dateCreated' => esc_html( $adjustment->date_created ), - 'dateModified' => esc_html( $adjustment->date_modified ), - 'uuid' => esc_html( $adjustment->uuid ), - ); - - $item_adjustments[] = $adjustment_args; - $_adjustments[] = $adjustment_args; - } - - // @todo edd_get_order_item_to_json()? - $_items[] = array( - 'id' => esc_html( $item->id ), - 'orderId' => esc_html( $item->order_id ), - 'productId' => esc_html( $item->product_id ), - 'productName' => esc_html( $item->get_order_item_name() ), - 'priceId' => esc_html( $item->price_id ), - 'cartIndex' => esc_html( $item->cart_index ), - 'type' => esc_html( $item->type ), - 'status' => esc_html( $item->status ), - 'statusLabel' => esc_html( edd_get_status_label( $item->status ) ), - 'quantity' => esc_html( $item->quantity ), - 'amount' => esc_html( $item->amount ), - 'subtotal' => esc_html( $item->subtotal ), - 'discount' => esc_html( $item->discount ), - 'tax' => esc_html( $item->tax ), - 'total' => esc_html( $item->total ), - 'dateCreated' => esc_html( $item->date_created ), - 'dateModified' => esc_html( $item->date_modified ), - 'uuid' => esc_html( $item->uuid ), - 'deliverable' => $item->is_deliverable(), - 'adjustments' => $item_adjustments, - ); - } - - $adjustments = edd_get_order_adjustments( array( - 'object_id' => $order->id, - 'number' => 999, - 'object_type' => 'order', - 'type' => array( - 'discount', - 'credit', - 'fee', - ), - ) ); - - foreach ( $adjustments as $adjustment ) { - // @todo edd_get_order_adjustment_to_json()? - $_adjustments[] = array( - 'id' => esc_html( $adjustment->id ), - 'objectId' => esc_html( $adjustment->object_id ), - 'objectType' => esc_html( $adjustment->object_type ), - 'typeId' => esc_html( $adjustment->type_id ), - 'type' => esc_html( $adjustment->type ), - 'description' => esc_html( $adjustment->description ), - 'subtotal' => esc_html( $adjustment->subtotal ), - 'tax' => esc_html( $adjustment->tax ), - 'total' => esc_html( $adjustment->total ), - 'dateCreated' => esc_html( $adjustment->date_created ), - 'dateModified' => esc_html( $adjustment->date_modified ), - 'uuid' => esc_html( $adjustment->uuid ), - ); - } - - $refunds = edd_get_order_refunds( $order->id ); - - foreach ( $refunds as $refund ) { - $_refunds[] = array( - 'id' => esc_html( $refund->id ), - 'number' => esc_html( $refund->order_number ), - 'total' => esc_html( $refund->total ), - 'dateCreated' => esc_html( $refund->date_created ), - 'dateCreatedi18n' => esc_html( edd_date_i18n( $refund->date_created ) ), - 'uuid' => esc_html( $refund->uuid ), - ); - } - } - - $has_tax = 'none'; - $tax_rate = $order->id ? $order->get_tax_rate() : false; - - $location = array( - 'rate' => $tax_rate, - 'country' => '', - 'region' => '', - 'inclusive' => edd_prices_include_tax(), - ); - - if ( edd_is_add_order_page() && edd_use_taxes() ) { - $default_rate = edd_get_tax_rate_by_location( - array( - 'country' => '', - 'region' => '', - ) - ); - if ( $default_rate ) { - $location['rate'] = floatval( $default_rate->amount ); - } - $has_tax = $location; - } elseif ( $tax_rate ) { - $has_tax = $location; - $has_tax['rate'] = $tax_rate; - - if ( $order->tax_rate_id ) { - $tax_rate_object = $order->get_tax_rate_object(); - - if ( $tax_rate_object ) { - $has_tax['country'] = $tax_rate_object->name; - $has_tax['region'] = $tax_rate_object->description; - } - } - } - - $has_quantity = true; - if ( edd_is_add_order_page() && ! edd_item_quantities_enabled() ) { - $has_quantity = false; - } - - wp_localize_script( - 'edd-admin-orders', - 'eddAdminOrderOverview', - array( - 'items' => $_items, - 'adjustments' => $_adjustments, - 'refunds' => $_refunds, - 'isAdding' => true === edd_is_add_order_page(), - 'hasQuantity' => $has_quantity, - 'hasTax' => $has_tax, - 'hasDiscounts' => true === edd_has_active_discounts(), - 'order' => array( - 'status' => $order->status, - 'currency' => $order->currency, - 'currencySymbol' => html_entity_decode( edd_currency_symbol( $order->currency ) ), - 'subtotal' => $order->subtotal, - 'discount' => $order->discount, - 'tax' => $order->tax, - 'total' => $order->total, - ), - 'nonces' => array( - 'edd_admin_order_get_item_amounts' => wp_create_nonce( 'edd_admin_order_get_item_amounts' ), - ), - 'i18n' => array( - 'closeText' => esc_html__( 'Close', 'easy-digital-downloads' ), - ), - ) - ); - - $templates = array( - 'actions', - 'subtotal', - 'tax', - 'total', - 'item', - 'adjustment', - 'adjustment-discount', - 'refund', - 'no-items', - 'copy-download-link', - 'form-add-order-item', - 'form-add-order-discount', - 'form-add-order-adjustment', - ); - - foreach ( $templates as $tmpl ) { - echo ''; - } -?> - -
    - - - - - - - - - - - -
    - -
    -
    - -id ); -} - -/** - * Output the order details sections box - * - * @since 3.0 - * - * @param object $order - */ -function edd_order_details_sections( $order ) { -?> - -
    -

    - -

    - -
    - -id ) - ? $order->get_transaction_id() - : ''; - - $unlimited = ! empty( $order->id ) - ? $order->has_unlimited_downloads() - : false; - - $readonly = ! empty( $order->id ) - ? 'readonly' - : ''; - - // Setup gateway list. - if ( empty( $order->id ) ) { - $known_gateways = edd_get_payment_gateways(); - - $gateways = array(); - - foreach ( $known_gateways as $id => $data ) { - $gateways[ $id ] = esc_html( $data['admin_label'] ); - } - } - - // Filter the transaction ID (here specifically for back-compat) - if ( ! empty( $transaction_id ) ) { - $transaction_id = apply_filters( 'edd_payment_details_transaction_id-' . $order->gateway, $transaction_id, $order->id ); - } ?> - -
    -

    - -

    - -
    -
    - id ); ?> - - - -
    - - gateway ); ?> -
    - -
    -
    - -
    - html->select( - array( - 'name' => 'gateway', - 'class' => 'edd-form-group__input', - 'id' => 'edd_gateway_select', - 'options' => $gateways, - 'selected' => 'manual', - 'show_option_none' => false, - 'show_option_all' => false, - ) - ); // WPCS: XSS ok. - ?> -
    -
    -
    - - -
    -
    - -
    - value="payment_key ); ?>" /> -
    -
    -
    - - -
    -
    - -
    - -
    -
    -
    - -
    - - id ); // WPCS: XSS ok. ?> -
    - - - -
    - - -
    - - - -
    -
    - -
    - -
    -
    -
    - - -
    -
    -
    - /> - - - -
    -
    -
    - - id ); ?> -
    -
    -
    - -id )->get_recovery_url(); - - $order_date = edd_get_edd_timezone_equivalent_date_from_utc( EDD()->utils->date( $order->date_created, 'utc', true ) ); - - ?> - -
    -

    - -

    - -
    -
    -
    -
    - -
    - -
    -
    - - 'edd-payment-history', - 'order_type' => 'sale', - 'edd-action' => 'trash_order', - 'purchase_id' => absint( $order->id ), - ) ), - 'edd_payment_nonce' - ); - ?> -
    - - - -
    - -
    - - id ) && ! empty( $recovery_url ) ) : ?> -
    -
    - -
    - -
    -
    -
    - - -
    -
    - -
    - -
    -
    -
    - -
    -
    - - - - -
    - - - : - - - -
    -
    -
    - - id ); ?> - -
    -
    - -
    - - $status, - 'label' => edd_get_payment_status_label( $order_status ), - 'icon' => $icon, - 'class' => "edd-admin-order-status-badge--{$order_status}", - ), - $order_status - ); - $status_badge = new EDD\Utils\StatusBadge( $status_badge_args ); - - /** - * Filters the markup for the order status badge icon. - * - * @since 3.0 - * - * @param string $icon Icon HTML markup. - */ - $icon = apply_filters( 'edd_get_order_status_badge_icon', $status_badge->get_icon(), $order_status ); - - return $status_badge->get( $icon ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/payments/payments-history.php b/wp-content/plugins/easy-digital-downloads/includes/admin/payments/payments-history.php deleted file mode 100644 index 3ae69b9c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/payments/payments-history.php +++ /dev/null @@ -1,237 +0,0 @@ - - - - - $type ) { - - // Skip if hidden - if ( empty( $type['show_ui'] ) ) { - continue; - } - - // Add to return array - $retval[ $type_id ] = ! empty( $type['labels']['plural'] ) - ? $type['labels']['plural'] - : ucwords( $type_id ); - } - - // Filter & return - return (array) apply_filters( 'edd_get_order_pages', $retval ); -} - -/** - * Get the payment view - * - * @since 3.0 - * - * @return string - */ -function edd_get_payment_view() { - return ! empty( $_GET['view'] ) // WPCS: CSRF ok. - ? sanitize_key( $_GET['view'] ) // WPCS: CSRF ok. - : 'list'; -} - -/** - * Render one of the Order pages. - * - * @since 1.0 - * @since 3.0 Nomenclature updated for consistency. - * Add a link to manually add orders. - * Changed to switch statement. - */ -function edd_payment_history_page() { - - // What are we viewing? - switch ( edd_get_payment_view() ) { - - // View Order - case 'view-order-details' : - require_once EDD_PLUGIN_DIR . 'includes/admin/payments/view-order-details.php'; - break; - - // Add Order - case 'add-order' : - require_once EDD_PLUGIN_DIR . 'includes/admin/payments/add-order.php'; - edd_add_order_page_content(); - break; - - // View Refund - case 'view-refund-details' : - require_once EDD_PLUGIN_DIR . 'includes/admin/payments/view-refund.php'; - edd_view_refund_page_content(); - break; - - // List Table - case 'list' : - default : - edd_order_list_table_content(); - break; - } -} - -/** - * Output the list table used to list out all orders. - * - * @since 3.0 - */ -function edd_order_list_table_content() { - require_once EDD_PLUGIN_DIR . 'includes/admin/payments/class-payments-table.php'; - $orders_table = new EDD_Payment_History_Table(); - $orders_table->prepare_items(); - - $active_tab = sanitize_key( $orders_table->get_request_var( 'order_type', 'sale' ) ); - $admin_url = edd_get_admin_url( array( 'page' => 'edd-payment-history' ) ); ?> - -
    -

    - 'add-order' ), $admin_url ); - printf( - '%s', - esc_url( $add_new_url ), - esc_html__( 'Add New', 'easy-digital-downloads' ) - ); - } - ?> -
    - - - - - -
    - - - - views(); - $orders_table->advanced_filters(); - $orders_table->display(); - ?> -
    - - -
    - - base ) { - return $admin_title; - } - - // Get the view - $view = edd_get_payment_view(); - - // Which view? - switch ( $view ) { - - // Edit/View - case 'view-order-details': - case 'edit-payment': - $title = __( 'Edit Order', 'easy-digital-downloads' ) . ' — ' . $admin_title; - break; - - // Add - case 'add-order': - $title = __( 'Add New Order', 'easy-digital-downloads' ) . ' — ' . $admin_title; - break; - - // List - case 'list' : - default: - $title = $admin_title; - break; - } - - return $title; -} -add_filter( 'admin_title', 'edd_view_order_details_title', 10, 2 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/payments/refunds.php b/wp-content/plugins/easy-digital-downloads/includes/admin/payments/refunds.php deleted file mode 100644 index dd5410d1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/payments/refunds.php +++ /dev/null @@ -1,368 +0,0 @@ - absint( $refund->parent ), - 'page' => 'edd-payment-history', - 'view' => 'view-order-details', - ) - ); -?> - -
    -
    - -
    - - - -
    - -
    -   - -
    - -
    -
    - - $refund->id, - 'number' => 999, - ) ); - - foreach ( $items as $item ) { - $item_adjustments = array(); - - $adjustments = edd_get_order_adjustments( array( - 'object_id' => $item->id, - 'number' => 999, - 'object_type' => 'order_item', - 'type' => array( - 'discount', - 'credit', - 'fee', - ), - ) ); - - foreach ( $adjustments as $adjustment ) { - // @todo edd_get_order_adjustment_to_json()? - $adjustment_args = array( - 'id' => esc_html( $adjustment->id ), - 'objectId' => esc_html( $adjustment->object_id ), - 'objectType' => esc_html( $adjustment->object_type ), - 'typeId' => esc_html( $adjustment->type_id ), - 'type' => esc_html( $adjustment->type ), - 'description' => esc_html( $adjustment->description ), - 'subtotal' => esc_html( $adjustment->subtotal ), - 'tax' => esc_html( $adjustment->tax ), - 'total' => esc_html( $adjustment->total ), - 'dateCreated' => esc_html( $adjustment->date_created ), - 'dateModified' => esc_html( $adjustment->date_modified ), - 'uuid' => esc_html( $adjustment->uuid ), - ); - - $item_adjustments[] = $adjustment_args; - $_adjustments[] = $adjustment_args; - } - - // @todo edd_get_order_item_to_json()? - $_items[] = array( - 'id' => esc_html( $item->id ), - 'orderId' => esc_html( $item->order_id ), - 'productId' => esc_html( $item->product_id ), - 'productName' => esc_html( $item->get_order_item_name() ), - 'priceId' => esc_html( $item->price_id ), - 'cartIndex' => esc_html( $item->cart_index ), - 'type' => esc_html( $item->type ), - 'status' => esc_html( $item->status ), - 'quantity' => esc_html( $item->quantity ), - 'amount' => esc_html( $item->amount ), - 'subtotal' => esc_html( $item->subtotal ), - 'discount' => esc_html( $item->discount ), - 'tax' => esc_html( $item->tax ), - 'total' => esc_html( $item->total ), - 'dateCreated' => esc_html( $item->date_created ), - 'dateModified' => esc_html( $item->date_modified ), - 'uuid' => esc_html( $item->uuid ), - ); - } - - $adjustments = edd_get_order_adjustments( array( - 'object_id' => $refund->id, - 'number' => 999, - 'object_type' => 'order', - 'type' => array( - 'discount', - 'credit', - 'fee', - ), - ) ); - - foreach ( $adjustments as $adjustment ) { - // @todo edd_get_order_adjustment_to_json()? - $_adjustments[] = array( - 'id' => esc_html( $adjustment->id ), - 'objectId' => esc_html( $adjustment->object_id ), - 'objectType' => esc_html( $adjustment->object_type ), - 'typeId' => esc_html( $adjustment->type_id ), - 'type' => esc_html( $adjustment->type ), - 'description' => esc_html( $adjustment->description ), - 'subtotal' => esc_html( $adjustment->subtotal ), - 'tax' => esc_html( $adjustment->tax ), - 'total' => esc_html( $adjustment->total ), - 'dateCreated' => esc_html( $adjustment->date_created ), - 'dateModified' => esc_html( $adjustment->date_modified ), - 'uuid' => esc_html( $adjustment->uuid ), - ); - } - - $has_tax = 'none'; - $tax_rate = $refund->id ? $refund->get_tax_rate() : false; - $location = array( - 'rate' => $tax_rate, - 'country' => '', - 'region' => '', - ); - if ( $tax_rate ) { - $has_tax = $location; - $has_tax['rate'] = $tax_rate; - if ( $refund->tax_rate_id ) { - $tax_rate_object = $refund->get_tax_rate_object(); - if ( $tax_rate_object ) { - $has_tax['country'] = $tax_rate_object->name; - $has_tax['region'] = $tax_rate_object->description; - } - } - } - - wp_localize_script( - 'edd-admin-orders', - 'eddAdminOrderOverview', - array( - 'items' => $_items, - 'adjustments' => $_adjustments, - 'refunds' => array(), - 'isAdding' => false, - 'isRefund' => true, - 'hasQuantity' => true, - 'hasTax' => $has_tax, - 'order' => array( - 'currency' => $refund->currency, - 'currencySymbol' => html_entity_decode( edd_currency_symbol( $refund->currency ) ), - 'subtotal' => $refund->subtotal, - 'discount' => $refund->discount, - 'tax' => $refund->tax, - 'total' => $refund->total, - ), - ) - ); - - $templates = array( - 'no-items', - 'subtotal', - 'tax', - 'total', - 'item', - 'adjustment', - 'adjustment-discount', - ); - - foreach ( $templates as $tmpl ) { - echo ''; - } -?> - -
    - - - - - - - - - -
    -
    - - - -
    -

    - -

    - -
    - -
    -
    - -utils->date( $refund->date_created, 'utc', true ) ); - - $trash_url = wp_nonce_url( - edd_get_admin_url( array( - 'edd-action' => 'trash_order', - 'purchase_id' => absint( $refund->id ), - 'order_type' => 'refund', - 'page' => 'edd-payment-history', - ) ), - 'edd_payment_nonce' - ); - - $order_url = edd_get_admin_url( - array( - 'id' => absint( $refund->parent ), - 'page' => 'edd-payment-history', - 'view' => 'view-order-details', - ) - ); - - $order = edd_get_order( $refund->parent ); -?> - -
    -

    - -

    - -
    - - -

    - - - - -
    - -
    -
    - - - - -
    -
    -
    - -parent ), - function( $related_refund ) use ( $refund ) { - return $related_refund->id !== $refund->id; - } - ); - - if ( empty( $refunds ) ) { - return; - } -?> - -
    -

    - -

    - - 'edd-payment-history', - 'view' => 'view-refund-details', - 'id' => absint( $refund->id ), - ) ); - ?> -
    -
    - - number ); ?> - -
    - -
    -
    - -
    - -type ) { - $refund_link = edd_get_admin_url( - array( - 'page' => 'edd-payment-history', - 'view' => 'view-refund-details', - 'id' => urlencode( $order->id ), - ) - ); - wp_die( sprintf( __( 'The specified ID is for a refund, not an order. Please access the refund directly.', 'easy-digital-downloads' ), esc_url( $refund_link ) ), __( 'Error', 'easy-digital-downloads' ) ); -} - -wp_enqueue_script( 'edd-admin-orders' ); -// Enqueued for backwards compatibility. Empty file. -wp_enqueue_script( 'edd-admin-payments' ); -?> - -
    - - - -
    -

    number ) ); ?>

    - -
    - - - - id ); ?> - - id ); ?> - -
    -
    -
    -
    -
    - id ); - - // Overview - edd_order_details_overview( $order ); - - // Details sections - edd_order_details_sections( $order ); - - // Legacy hook from pre version 3 of Easy Digital Downloads. - do_action( 'edd_view_order_details_billing_after', $order->id ); - - // After body - do_action( 'edd_view_order_details_main_after', $order->id ); - - ?> -
    -
    - -
    -
    - id ); - - // Attributes - edd_order_details_attributes( $order ); - - // Extras - edd_order_details_extras( $order ); - - // After sidebar - do_action( 'edd_view_order_details_sidebar_after', $order->id ); - - ?> -
    -
    -
    -
    -
    - - id ); - - wp_nonce_field( 'edd_update_payment_details_nonce' ); ?> - - - - - id ); ?> - -
    - -
    - -
    - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/payments/view-refund.php b/wp-content/plugins/easy-digital-downloads/includes/admin/payments/view-refund.php deleted file mode 100644 index b3220e25..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/payments/view-refund.php +++ /dev/null @@ -1,128 +0,0 @@ -type ) { - wp_die( __( 'The specified ID does not belong to an refund. Please try again.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ) ); - } - - wp_enqueue_script( 'edd-admin-orders' ); - // Enqueued for backwards compatibility. Empty file. - wp_enqueue_script( 'edd-admin-payments' ); -?> - - - -
    - -

    order_number ); ?>

    - - id ); - ?> - -
    -
    -
    - -
    -
    - id ); - - // Refund Items. - edd_refund_details_items( $refund ); - - // Notes. - edd_refund_details_notes( $refund ); - - /** - * Allows further output after the Refund details. - * - * @since 3.0 - * - * @param int $refund_id ID of the current Refund. - */ - do_action( 'edd_view_refund_details_main_after', $refund->id ); - ?> -
    -
    - -
    -
    - id ); - - // Attributes. - edd_refund_details_attributes( $refund ); - - // Related Refunds. - edd_refund_details_related_refunds( $refund ); - - /** - * Allows further output after Refund sidebar content. - * - * @since 3.0 - * - * @param int $refund_id ID of the current Refund. - */ - do_action( 'edd_view_refund_details_sidebar_after', $refund->id ); - ?> -
    -
    - -
    -
    -
    - -
    - - 'all-plugins', - 'utm_content' => 'upgrade-to-pro', - ) - ); - - $edd_links['edd-pro-upgrade'] = sprintf( '' . __( 'Upgrade to Pro', 'easy-digital-downloads' ) . '', $url ); - } - - $settings_url = edd_get_admin_url( - array( - 'page' => 'edd-settings', - ) - ); - - $edd_links['settings'] = '' . esc_html__( 'Settings', 'easy-digital-downloads' ) . ''; - - // Return array of links. - return array_merge( $edd_links, $links ); -} -add_filter( 'plugin_action_links_easy-digital-downloads/easy-digital-downloads.php', 'edd_plugin_action_links', 10, 2 ); - -/** - * Load any CSS we need for the plugins list table. - */ -function edd_plugin_list_styles() { - echo ''; -} -add_action( 'admin_print_styles-plugins.php', 'edd_plugin_list_styles' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/promos/email-summary/blurbs.json b/wp-content/plugins/easy-digital-downloads/includes/admin/promos/email-summary/blurbs.json deleted file mode 100644 index 19c5204d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/promos/email-summary/blurbs.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "blurbs":[ - { - "headline":"Are new features and products getting ignored?", - "content":"Smart marketers know that emails with high click-through rates that promote new products and features will lead to more sales. Connect your Easy Digital Downloads powered store to your favorite email marketing service to boost revenue.", - "button_text":"Read More", - "button_link":"https://easydigitaldownloads.com/downloads/category/extensions/email/?utm_source=plugin&utm_medium=email&utm_campaign=summaries", - "conditions":{ - "current_pass":"free" - } - }, - { - "headline":"Are you missing out on future revenue?", - "content":"On average, up to 60% of customers do not manually renew their license keys. That's lost revenue for your business. Enable subscriptions on your licensed products and keep the revenue flowing!", - "button_text":"Read More", - "button_link":"https://easydigitaldownloads.com/downloads/recurring-payments/?utm_source=plugin&utm_medium=email&utm_campaign=summaries", - "conditions":{ - "active_plugins":[ - "EDD-Software-Licensing/edd-software-licenses.php" - ], - "inactive_plugins":[ - "edd-recurring/edd-recurring.php" - ], - "current_pass":"pass-any" - } - }, - { - "headline":"Are you giving things away for free?", - "content":"Lead magnets are the easiest way to capture potential customers. Use our Free Downloads add-on, and start capturing those leads today.", - "button_text":"Read More", - "button_link":"https://easydigitaldownloads.com/blog/how-to-add-lead-magnets-in-wordpress-to-grow-your-email-list/?utm_source=plugin&utm_medium=email&utm_campaign=summaries", - "conditions":{ - "has_downloads":[ - "free" - ], - "inactive_plugins":[ - "edd-free-downloads/edd-free-downloads.php" - ] - } - }, - { - "headline":"Who are your biggest fans?", - "content":"Did you know that 72% of customers say that a product review is the key to making their purchasing decision? Learn how to add reviews to your store, and let your happy customers be your brand ambassadors!", - "button_text":"Read More", - "button_link":"https://easydigitaldownloads.com/blog/how-to-add-product-reviews-to-your-website/?utm_source=plugin&utm_medium=email&utm_campaign=summaries", - "conditions":{ - "inactive_plugins":[ - "edd-reviews/edd-reviews.php" - ], - "current_pass":"pass-any" - } - } - ] -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/promos/notices/class-five-star-review-dashboard.php b/wp-content/plugins/easy-digital-downloads/includes/admin/promos/notices/class-five-star-review-dashboard.php deleted file mode 100644 index 9a5c33c2..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/promos/notices/class-five-star-review-dashboard.php +++ /dev/null @@ -1,191 +0,0 @@ - -
    - _display(); - ?> -
    - -
    -

    -
    -
    - -
    -
    - - - - - time() ) { - return false; - } - $orders = edd_count_orders( - array( - 'type' => 'sale', - 'status__in' => edd_get_complete_order_statuses(), - ) - ); - - return $orders >= 15; - } - - /** - * Builds the UTM parameters for the URLs. - * - * @since 2.11.4 - * - * @return string - */ - private function url() { - $url = edd_link_helper( - 'https://easydigitaldownloads.com/plugin-feedback/', - array( - 'utm_medium' => 'feedback-' . static::TYPE, - 'utm_content' => 'give-feedback', - ) - ); - - return $url; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/promos/notices/class-five-star-review-settings.php b/wp-content/plugins/easy-digital-downloads/includes/admin/promos/notices/class-five-star-review-settings.php deleted file mode 100644 index ed9427d5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/promos/notices/class-five-star-review-settings.php +++ /dev/null @@ -1,68 +0,0 @@ - -
    - -
    - __( 'Log ID', 'easy-digital-downloads' ), - 'details' => __( 'Request Details', 'easy-digital-downloads' ), - 'version' => __( 'API Version', 'easy-digital-downloads' ), - 'ip' => __( 'Request IP', 'easy-digital-downloads' ), - 'speed' => __( 'Request Speed', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ) - ); - } - - /** - * Gets the name of the primary column. - * - * @since 2.5 - * @access protected - * - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'ID'; - } - - /** - * This function renders most of the columns in the list table. - * - * @since 1.5 - * - * @param array $item Contains all the data of the api request - * @param string $column_name The name of the column - * - * @return string Column Name - */ - public function column_default( $item, $column_name ) { - switch ( $column_name ) { - case 'ip': - return '' . esc_html( $item['ip'] ) . ''; - default: - return $item[ $column_name ]; - } - } - - /** - * Output Error Message column - * - * @since 1.5 - * @param array $item Contains all the data of the log - * @return void - */ - public function column_details( $item ) { - ?> - - - $log->id, - 'version' => $log->version, - 'speed' => $log->time, - 'ip' => $log->ip, - 'date' => $log->date_created, - 'api_key' => $log->api_key, - 'request' => $log->request, - 'error' => $log->error, - 'user_id' => $log->user_id, - ); - } - } - - return $logs_data; - } - - /** - * Get the total number of items - * - * @since 3.0 - * - * @param array $log_query - * - * @return int - */ - public function get_total( $log_query = array() ) { - return edd_count_api_request_logs( $log_query ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-base-logs-list-table.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-base-logs-list-table.php deleted file mode 100644 index 4529d1ea..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-base-logs-list-table.php +++ /dev/null @@ -1,560 +0,0 @@ - 'log', - 'plural' => 'logs', - 'ajax' => false - ) ); - - $this->filter_bar_hooks(); - } - - /** - * Generate the table navigation above or below the table - * - * Removes the referrer nonce from parent class. - * - * @since 3.0.0 - * @param string $which - */ - protected function display_tablenav( $which ) { - ?> -
    - has_items() ) : ?> -
    - bulk_actions( $which ); ?> -
    - extra_tablenav( $which ); - $this->pagination( $which ); ?> - -
    -
    id ) ) { - $ret = $customer->id; - } - } - - return $ret; - } - - /** - * Return the start-date of the filter - * - * @since 3.0 - * - * @return string Start date to filter by - */ - public function get_filtered_start_date() { - return sanitize_text_field( $this->get_request_var( 'start-date', null ) ); - } - - /** - * Return the end-date of the filter - * - * @since 3.0 - * - * @return string End date to filter by - */ - public function get_filtered_end_date() { - return sanitize_text_field( $this->get_request_var( 'end-date', null ) ); - } - - /** - * Return the ID of the download we're filtering logs by - * - * @since 3.0 - * - * @return int Download ID. - */ - public function get_filtered_download() { - return absint( $this->get_request_var( 'download', false ) ); - } - - /** - * Return the ID of the payment we're filtering logs by - * - * @since 3.0 - * - * @return int Payment ID. - */ - public function get_filtered_payment() { - return absint( $this->get_request_var( 'payment', false ) ); - } - - /** - * Gets the meta query for the log query. - * - * This is used to return log entries that match our search query, user query, or download query. - * - * @since 3.0 - * - * @return array $meta_query - */ - public function get_meta_query() { - return array(); - } - - /** - * Outputs the log views. - * - * @since 3.0 - */ - public function bulk_actions( $which = '' ) { - return; - } - - /** - * Renders the Reports page views drop down - * - * @since 3.0 - * @return void - */ - public function log_views() { - $views = edd_log_default_views(); - $current_view = $this->get_filtered_view(); ?> - - - - - - - - - - - 'edd-log-download-filter', - 'name' => 'download', - 'chosen' => true, - ); - - if ( ! empty( $download ) ) { - $args['selected'] = $download; - } - - echo EDD()->html->product_dropdown( $args ); - } - - /** - * Gets the log entries for the current view - * - * @since 3.0 - * - * @return array $logs_data Array of all the logs. - */ - function get_logs( $log_query = array() ) { - return array(); - } - - /** - * Get the total number of items - * - * @since 3.0 - * - * @param array $log_query - * - * @return int - */ - public function get_total( $log_query = array() ) { - return count( array() ); - } - - /** - * Empty method to hide view links on all logs table - * - * @since 3.0 - */ - public function get_views() { - // Intentionally empty - } - - /** - * Retrieves the logs data. - * - * @since 3.0 - * - * @return array Logs data. - */ - public function get_data() { - $log_query = $this->get_query_args(); - - return $this->get_logs( $log_query ); - } - - /** - * Setup the final data for the table. - * - * @since 3.0 - */ - public function prepare_items() { - - $this->_column_headers = array( - $this->get_columns(), - array(), - $this->get_sortable_columns() - ); - - $this->items = $this->get_data(); - $log_query = $this->get_query_args( false ); - $total_items = $this->get_total( $log_query ); - - $this->set_pagination_args( array( - 'total_pages' => ceil( $total_items / $this->per_page ), - 'total_items' => $total_items, - 'per_page' => $this->per_page, - ) ); - } - - /** - * Return array of query arguments - * - * @since 3.0 - * - * @param bool $paginate Whether to add pagination arguments - * - * @return array - */ - protected function get_query_args( $paginate = true ) { - - // Defaults - $retval = array( - 'product_id' => $this->get_filtered_download(), - 'customer_id' => $this->get_filtered_customer(), - 'order_id' => $this->get_filtered_payment(), - 'meta_query' => $this->get_meta_query(), - ); - - // Search - $search = $this->get_search(); - if ( ! empty( $search ) ) { - if ( filter_var( $search, FILTER_VALIDATE_IP ) ) { - $retval['ip'] = $search; - } elseif ( is_email( $search ) ) { - if ( 'api_requests' === $this->log_type ) { - // API requests are linked to user accounts, so we're checking user data here. - $user = get_user_by( 'email', $search ); - if ( ! empty( $user->ID ) ) { - $retval['user_id'] = $user->ID; - } else { - // This is a fallback to help ensure an invalid email will produce zero results. - $retval['search'] = $search; - } - } else { - // All other logs are linked to customers. - $customer = edd_get_customer_by( 'email', $search ); - if ( ! empty( $customer->id ) ) { - $retval['customer_id'] = $customer->id; - } else { - // This is a fallback to help ensure an invalid email will produce zero results. - $retval['search'] = $search; - } - } - } elseif ( 'api_requests' === $this->log_type && 32 === strlen( $search ) ) { - // Look for an API key - $retval['api_key'] = $search; - } elseif ( 'api_requests' === $this->log_type && stristr( $search, 'token:' ) ) { - // Look for an API token - $retval['token'] = str_ireplace( 'token:', '', $search ); - } elseif ( is_numeric( $search ) ) { - if ( 'api_requests' === $this->log_type ) { - // API requests are linked to user accounts, so we're checking user data here. - $user = get_user_by( 'email', $search ); - if ( ! empty( $user->ID ) ) { - $retval['user_id'] = $user->ID; - } else { - $retval['search'] = $search; - } - } else { - // All other logs are linked to customers. - $customer = edd_get_customer( $search ); - if ( ! empty( $customer->id ) ) { - $retval['customer_id'] = $customer->id; - } elseif ( 'file_downloads' === $this->log_type ) { - $retval['product_id'] = $search; - } else { - $retval['search'] = $search; - } - } - } else { - if ( 'file_downloads' === $this->log_type ) { - $this->file_search = true; - } else { - $retval['search'] = $search; - } - } - } - - // Start date - $start_date = $this->get_filtered_start_date(); - $end_date = $this->get_filtered_end_date(); - - // Setup original array - if ( ! empty( $start_date ) || ! empty( $end_date ) ) { - $retval['date_created_query']['column'] = 'date_created'; - - // Start date - if ( ! empty( $start_date ) ) { - $retval['date_created_query'][] = array( - 'column' => 'date_created', - 'after' => \Carbon\Carbon::parse( date( 'Y-m-d H:i:s', strtotime( "{$start_date} midnight" ) ), edd_get_timezone_id() )->setTimezone( 'UTC' )->toDateTimeString(), - ); - } - - // End date - if ( ! empty( $end_date ) ) { - $retval['date_created_query'][] = array( - 'column' => 'date_created', - 'before' => \Carbon\Carbon::parse( date( 'Y-m-d H:i:s', strtotime( "{$end_date} + 1 day" ) ), edd_get_timezone_id() )->setTimezone( 'UTC' )->toDateTimeString(), - ); - } - } - - $retval = array_filter( $retval ); - - // Return query arguments - return ( true === $paginate ) - ? $this->parse_pagination_args( $retval ) - : $retval; - } - - /** - * Output advanced filters for payments - * - * @since 3.0 - */ - public function advanced_filters() { - edd_admin_filter_bar( 'logs' ); - } - - /** - * Output filter bar items - * - * @since 3.0 - */ - public function filter_bar_items() { - - // Get values - $start_date = $this->get_filtered_start_date(); - $end_date = $this->get_filtered_end_date(); - $download = $this->get_filtered_download(); - $customer = $this->get_filtered_customer(); - $view = $this->get_filtered_view(); - $clear_url = edd_get_admin_url( array( - 'page' => 'edd-tools', - 'tab' => 'logs', - 'view' => sanitize_key( $view ), - ) ); ?> - - - log_views(); ?> - - - - html->date_field( array( - 'id' => 'start-date', - 'name' => 'start-date', - 'placeholder' => _x( 'From', 'date filter', 'easy-digital-downloads' ), - 'value' => $start_date - ) ); - - echo EDD()->html->date_field( array( - 'id' => 'end-date', - 'name' => 'end-date', - 'placeholder' => _x( 'To', 'date filter', 'easy-digital-downloads' ), - 'value' => $end_date - ) ); - - ?> - - - downloads_filter( $download ); ?> - - - - - - - - - - - - - - - - - - - search_box( __( 'Search', 'easy-digital-downloads' ), 'edd-logs' ); - } - - /** - * Show the search field - * - * @since 3.0 - * - * @param string $text Label for the search box - * @param string $input_id ID of the search box - * - * @return void - */ - public function search_box( $text, $input_id ) { - - // Bail if no customers and no search - if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { - return; - } - - $input_id = $input_id . '-search-input'; - - if ( ! empty( $_REQUEST['orderby'] ) ) { - echo ''; - } - - if ( ! empty( $_REQUEST['order'] ) ) { - echo ''; - } - - ?> - -

    - - -

    - - 'report-earning', - 'plural' => 'report-earnings', - 'ajax' => false - ) ); - } - - /** - * Gets the name of the primary column. - * - * @since 2.5 - * @access protected - * - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'label'; - } - - /** - * This function renders most of the columns in the list table. - * - * @since 2.4 - * - * @param array $item Contains all the data of the downloads - * @param string $column_name The name of the column - * - * @return string Column Name - */ - public function column_default( $item, $column_name ) { - return $item[ $column_name ]; - } - - /** - * Retrieve the table columns - * - * @since 2.4 - * @return array $columns Array of all the list table columns - */ - public function get_columns() { - return array( - 'label' => __( 'Category', 'easy-digital-downloads' ), - 'total_sales' => __( 'Total Sales', 'easy-digital-downloads' ), - 'total_earnings' => __( 'Total Earnings', 'easy-digital-downloads' ), - 'avg_sales' => __( 'Monthly Sales Avg', 'easy-digital-downloads' ), - 'avg_earnings' => __( 'Monthly Earnings Avg', 'easy-digital-downloads' ) - ); - } - - /** - * Outputs the reporting views - * - * @since 1.5 - * @return void - */ - public function display_tablenav( $which = '' ) { - ?> -
    -
    - -
    -
    - get_data(); - } - - /** - * Builds and retrieves all of the categories reports data. - * - * @since 3.0 - * - * @return array Categories reports table data. - */ - public function get_data() { - - /* - * Date filtering - */ - $dates = edd_get_report_dates(); - - $include_taxes = empty( $_GET['exclude_taxes'] ) ? true : false; - - if ( ! empty( $dates[ 'year' ] ) ) { - $date = new DateTime(); - $date->setDate( $dates[ 'year' ], $dates[ 'm_start' ], $dates[ 'day' ] ); - $start_date = $date->format( 'Y-m-d' ); - - $date->setDate( $dates[ 'year_end' ], $dates[ 'm_end' ], $dates[ 'day_end' ] ); - $end_date = $date->format( 'Y-m-d' ); - $cached_report_key = 'edd_earnings_by_category_data' . $start_date . '_' . $end_date; - } else { - $start_date = false; - $end_date = false; - $cached_report_key = 'edd_earnings_by_category_data'; - } - - $cached_reports = get_transient( $cached_report_key ); - - if ( false !== $cached_reports ) { - $reports_data = $cached_reports; - - } else { - $reports_data = array(); - $categories = get_terms( 'download_category', array( - 'parent' => 0, - 'hierarchical' => 0, - 'hide_empty' => false - ) ); - - foreach ( $categories as $category ) { - - $category_slugs = array( $category->slug ); - $child_terms = get_terms( 'download_category', array( - 'parent' => $category->term_id, - 'hierarchical' => 0 - ) ); - - if ( ! empty( $child_terms ) ) { - foreach ( $child_terms as $child_term ) { - $category_slugs[] = $child_term->slug; - } - } - - $downloads = get_posts( array( - 'post_type' => 'download', - 'posts_per_page' => -1, - 'fields' => 'ids', - 'tax_query' => array( - array( - 'taxonomy' => 'download_category', - 'field' => 'slug', - 'terms' => $category_slugs - ) - ) - ) ); - - $sales = $avg_sales = 0; - $earnings = $avg_earnings = 0.00; - - foreach ( $downloads as $download ) { - $current_sales = EDD()->payment_stats->get_sales( $download, $start_date, $end_date ); - $current_earnings = EDD()->payment_stats->get_earnings( $download, $start_date, $end_date, $include_taxes ); - - $current_average_sales = edd_get_average_monthly_download_sales( $download ); - $current_average_earnings = edd_get_average_monthly_download_earnings( $download ); - - $sales += $current_sales; - $earnings += $current_earnings; - $avg_sales += $current_average_sales; - $avg_earnings += $current_average_earnings; - } - - $avg_earnings = round( $avg_earnings, edd_currency_decimal_filter() ); - if ( ! empty( $avg_earnings ) && $avg_sales < 1 ) { - $avg_sales = __( 'Less than 1', 'easy-digital-downloads' ); - } else { - $avg_sales = round( edd_format_amount( $avg_sales, false ) ); - } - - $reports_data[] = array( - 'ID' => $category->term_id, - 'label' => $category->name, - 'total_sales' => edd_format_amount( $sales, false ), - 'total_sales_raw' => $sales, - 'total_earnings' => edd_currency_filter( edd_format_amount( $earnings ) ), - 'total_earnings_raw' => $earnings, - 'avg_sales' => $avg_sales, - 'avg_earnings' => edd_currency_filter( edd_format_amount( $avg_earnings ) ), - 'is_child' => false, - ); - - if ( ! empty( $child_terms ) ) { - foreach ( $child_terms as $child_term ) { - $child_downloads = get_posts( array( - 'post_type' => 'download', - 'posts_per_page' => -1, - 'fields' => 'ids', - 'tax_query' => array( - array( - 'taxonomy' => 'download_category', - 'field' => 'slug', - 'terms' => $child_term->slug - ) - ) - ) ); - - $child_sales = $child_avg_sales = 0; - $child_earnings = $child_avg_earnings = 0.00; - - foreach ( $child_downloads as $child_download ) { - $current_average_sales = $current_sales = EDD()->payment_stats->get_sales( $child_download, $start_date, $end_date ); - $current_average_earnings = $current_earnings = EDD()->payment_stats->get_earnings( $child_download, $start_date, $end_date ); - - $release_date = get_post_field( 'post_date', $child_download ); - $diff = abs( current_time( 'timestamp' ) - strtotime( $release_date ) ); - $months = floor( $diff / ( 30 * 60 * 60 * 24 ) ); // Number of months since publication - - if ( $months > 0 ) { - $current_average_sales = ( $current_sales / $months ); - $current_average_earnings = ( $current_earnings / $months ); - } - - $child_sales += $current_sales; - $child_earnings += $current_earnings; - $child_avg_sales += $current_average_sales; - $child_avg_earnings += $current_average_earnings; - } - - $child_avg_sales = round( $child_avg_sales / count( $child_downloads ) ); - $child_avg_earnings = round( $child_avg_earnings / count( $child_downloads ), edd_currency_decimal_filter() ); - - $reports_data[] = array( - 'ID' => $child_term->term_id, - 'label' => '— ' . $child_term->name, - 'total_sales' => edd_format_amount( $child_sales, false ), - 'total_sales_raw' => $child_sales, - 'total_earnings' => edd_currency_filter( edd_format_amount( $child_earnings ) ), - 'total_earnings_raw' => $child_earnings, - 'avg_sales' => edd_format_amount( $child_avg_sales, false ), - 'avg_earnings' => edd_currency_filter( edd_format_amount( $child_avg_earnings ) ), - 'is_child' => true - ); - } - } - } - } - - return $reports_data; - } - - /** - * Output the Category Sales Mix Pie Chart - * - * @since 2.4 - * @return string The HTML for the outputted graph - */ - public function output_sales_graph() { - if ( empty( $this->items ) ) { - return; - } - - $data = array(); - $total_sales = 0; - - foreach ( $this->items as $item ) { - $total_sales += $item['total_sales_raw']; - - if ( ! empty( $item[ 'is_child' ] ) || empty( $item[ 'total_sales_raw' ] ) ) { - continue; - } - - $data[ $item[ 'label' ] ] = $item[ 'total_sales_raw' ]; - } - - - if ( empty( $total_sales ) ) { - echo '

    ' . __( 'No sales for dates provided.', 'easy-digital-downloads' ) . '

    '; - } - - // Sort High to Low, prior to filter so people can reorder if they please - arsort( $data ); - $data = apply_filters( 'edd_category_sales_graph_data', $data ); - - $options = apply_filters( 'edd_category_sales_graph_options', array( - 'legend_formatter' => 'eddLegendFormatterSales', - ), $data ); - - $pie_graph = new EDD_Pie_Graph( $data, $options ); - $pie_graph->display(); - } - - /** - * Output the Category Earnings Mix Pie Chart - * - * @since 2.4 - * @return string The HTML for the outputted graph - */ - public function output_earnings_graph() { - if ( empty( $this->items ) ) { - return; - } - - $data = array(); - $total_earnings = 0; - - foreach ( $this->items as $item ) { - $total_earnings += $item['total_earnings_raw']; - - if ( ! empty( $item[ 'is_child' ] ) || empty( $item[ 'total_earnings_raw' ] ) ) { - continue; - } - - $data[ $item[ 'label' ] ] = $item[ 'total_earnings_raw' ]; - - } - - if ( empty( $total_earnings ) ) { - echo '

    ' . __( 'No earnings for dates provided.', 'easy-digital-downloads' ) . '

    '; - } - - // Sort High to Low, prior to filter so people can reorder if they please - arsort( $data ); - $data = apply_filters( 'edd_category_earnings_graph_data', $data ); - - $options = apply_filters( 'edd_category_earnings_graph_options', array( - 'legend_formatter' => 'eddLegendFormatterEarnings', - ), $data ); - - $pie_graph = new EDD_Pie_Graph( $data, $options ); - $pie_graph->display(); - } - - /** - * Setup the final data for the table - * - * @since 2.4 - * @uses EDD_Categories_Reports_Table::get_columns() - * @uses EDD_Categories_Reports_Table::get_sortable_columns() - * @uses EDD_Categories_Reports_Table::reports_data() - * @return void - */ - public function prepare_items() { - $columns = $this->get_columns(); - $hidden = array(); // No hidden columns - $sortable = $this->get_sortable_columns(); - $this->_column_headers = array( $columns, $hidden, $sortable ); - $this->items = $this->get_data(); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-download-reports-table.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-download-reports-table.php deleted file mode 100644 index 9a734c4f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-download-reports-table.php +++ /dev/null @@ -1,298 +0,0 @@ - 'report-download', - 'plural' => 'report-downloads', - 'ajax' => false - ) ); - - add_action( 'edd_report_view_actions', array( $this, 'category_filter' ) ); - - $this->query(); - } - - /** - * Gets the name of the primary column. - * - * @since 2.5 - * @access protected - * - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'title'; - } - - /** - * This function renders most of the columns in the list table. - * - * @since 1.5 - * - * @param array $item Contains all the data of the downloads - * @param string $column_name The name of the column - * - * @return string Column Name - */ - public function column_default( $item, $column_name ) { - switch( $column_name ){ - case 'earnings' : - return edd_currency_filter( edd_format_amount( $item[ $column_name ] ) ); - case 'average_sales' : - return round( $item[ $column_name ] ); - case 'average_earnings' : - return edd_currency_filter( edd_format_amount( $item[ $column_name ] ) ); - case 'details' : - $url = edd_get_admin_url( - array( - 'page' => 'edd-reports', - 'view' => 'downloads', - 'download-id' => absint( $item['ID'] ), - ) - ); - return '' . __( 'View Detailed Report', 'easy-digital-downloads' ) . ''; - default: - return $item[ $column_name ]; - } - } - - /** - * Retrieve the table columns - * - * @since 1.5 - * @return array $columns Array of all the list table columns - */ - public function get_columns() { - return array( - 'title' => edd_get_label_singular(), - 'sales' => __( 'Sales', 'easy-digital-downloads' ), - 'earnings' => __( 'Earnings', 'easy-digital-downloads' ), - 'average_sales' => __( 'Monthly Average Sales', 'easy-digital-downloads' ), - 'average_earnings' => __( 'Monthly Average Earnings', 'easy-digital-downloads' ), - 'details' => __( 'Detailed Report', 'easy-digital-downloads' ) - ); - } - - /** - * Retrieve the sortable columns - * - * @since 1.4 - * @return array Array of all the sortable columns - */ - public function get_sortable_columns() { - return array( - 'title' => array( 'title', true ), - 'sales' => array( 'sales', false ), - 'earnings' => array( 'earnings', false ) - ); - } - - /** - * Retrieve the category being viewed - * - * @since 1.5.2 - * @return int Category ID - */ - public function get_category() { - return absint( $this->get_request_var( 'category', 0 ) ); - } - - /** - * Retrieve the total number of downloads - * - * @since 1.5 - * @return int $total Total number of downloads - */ - public function get_total_downloads() { - $total = 0; - $counts = wp_count_posts( 'download', 'readable' ); - - foreach( $counts as $count ) { - $total += $count; - } - - return $total; - } - - /** - * Outputs the reporting views - * - * These aren't really bulk actions but this outputs the markup in the - * right place. - * - * @since 1.5 - * @return void - */ - public function bulk_actions( $which = '' ) { - edd_report_views(); - } - - /** - * Attaches the category filter to the log views - * - * @since 1.5.2 - * @return void - */ - public function category_filter() { - if ( get_terms( 'download_category' ) ) { - echo EDD()->html->category_dropdown( 'category', $this->get_category() ); - } - } - - /** - * Performs the products query - * - * @since 1.5.2 - * @return void - */ - public function query() { - - $orderby = sanitize_text_field( $this->get_request_var( 'orderby', 'title' ) ); - $order = sanitize_text_field( $this->get_request_var( 'order', 'DESC' ) ); - $category = $this->get_category(); - - $args = array( - 'post_type' => 'download', - 'post_status' => 'publish', - 'order' => $order, - 'fields' => 'ids', - 'posts_per_page' => $this->per_page, - 'paged' => $this->get_paged(), - 'suppress_filters' => true - ); - - if ( ! empty( $category ) ) { - $args['tax_query'] = array( - array( - 'taxonomy' => 'download_category', - 'terms' => $category - ) - ); - } - - switch ( $orderby ) { - case 'title' : - $args['orderby'] = 'title'; - break; - - case 'sales' : - $args['orderby'] = 'meta_value_num'; - $args['meta_key'] = '_edd_download_sales'; - break; - - case 'earnings' : - $args['orderby'] = 'meta_value_num'; - $args['meta_key'] = '_edd_download_earnings'; - break; - } - - $r = apply_filters( 'edd_download_reports_prepare_items_args', $args, $this ); - - $this->products = new WP_Query( $r ); - } - - /** - * Build and retrieves all of the download reports data. - * - * @since 1.5 - * @deprecated 3.0 Use get_data() - * - * @return array All the data for customer reports. - */ - public function reports_data() { - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Download_Reports_Table::get_data()' ); - - return $this->get_data(); - } - - /** - * Retrieves all of the download reports data. - * - * @since 3.0 - * - * @return array Download reports table data. - */ - public function get_data() { - $reports_data = array(); - - $downloads = $this->products->posts; - - if ( $downloads ) { - foreach ( $downloads as $download ) { - $reports_data[] = array( - 'ID' => $download, - 'title' => get_the_title( $download ), - 'sales' => edd_get_download_sales_stats( $download ), - 'earnings' => edd_get_download_earnings_stats( $download ), - 'average_sales' => edd_get_average_monthly_download_sales( $download ), - 'average_earnings' => edd_get_average_monthly_download_earnings( $download ), - ); - } - } - - return $reports_data; - } - - /** - * Setup the final data for the table - * - * @since 1.5 - * @uses EDD_Download_Reports_Table::get_columns() - * @uses EDD_Download_Reports_Table::get_sortable_columns() - * @uses EDD_Download_Reports_Table::get_total_downloads() - * @uses EDD_Download_Reports_Table::get_data() - * @uses EDD_Download_Reports_Table::set_pagination_args() - * @return void - */ - public function prepare_items() { - $this->_column_headers = array( - $this->get_columns(), - array(), - $this->get_sortable_columns() - ); - - $total_items = $this->get_total_downloads(); - $this->items = $this->get_data(); - - $this->set_pagination_args( array( - 'total_pages' => ceil( $total_items / $this->per_page ), - 'total_items' => $total_items, - 'per_page' => $this->per_page, - ) ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-edd-graph.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-edd-graph.php deleted file mode 100644 index 0cd1e131..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-edd-graph.php +++ /dev/null @@ -1,291 +0,0 @@ - array( - array( 1, 5 ), - array( 3, 8 ), - array( 10, 2 ) - ), - - 'Second Label' => array( - array( 1, 7 ), - array( 4, 5 ), - array( 12, 8 ) - ) - ); - - $graph = new EDD_Graph( $data ); - $graph->display(); - - */ - - /** - * Data to graph - * - * @var array - * @since 1.9 - */ - private $data; - - /** - * Unique ID for the graph - * - * @var string - * @since 1.9 - */ - private $id = ''; - - /** - * Graph options - * - * @var array - * @since 1.9 - */ - private $options = array(); - - /** - * Get things started - * - * @since 1.9 - */ - public function __construct( $_data ) { - - $this->data = $_data; - - // Generate unique ID - $this->id = 'a' . md5( rand() ); - - // Setup default options; - $this->options = array( - 'y_mode' => null, - 'x_mode' => null, - 'y_decimals' => 0, - 'x_decimals' => 0, - 'y_position' => 'right', - 'time_format' => '%d/%b', - 'ticksize_unit' => 'day', - 'ticksize_num' => 1, - 'multiple_y_axes' => false, - 'bgcolor' => '#f9f9f9', - 'bordercolor' => '#ccc', - 'color' => '#bbb', - 'borderwidth' => 2, - 'bars' => false, - 'lines' => true, - 'points' => true, - 'additional_options' => '', - ); - - } - - /** - * Set an option - * - * @param $key The option key to set - * @param $value The value to assign to the key - * @since 1.9 - */ - public function set( $key, $value ) { - $this->options[ $key ] = $value; - } - - /** - * Get an option - * - * @param $key The option key to get - * @since 1.9 - */ - public function get( $key ) { - return isset( $this->options[ $key ] ) ? $this->options[ $key ] : false; - } - - /** - * Get graph data - * - * @since 1.9 - */ - public function get_data() { - return apply_filters( 'edd_get_graph_data', $this->data, $this ); - } - - /** - * Load the graphing library script - * - * @since 1.9 - */ - public function load_scripts() { - wp_enqueue_script( 'edd-jquery-flot', EDD_PLUGIN_URL . 'assets/js/vendor/jquery.flot.min.js' ); - wp_enqueue_script( 'edd-jquery-flot-time', EDD_PLUGIN_URL . 'assets/js/vendor/jquery.flot.time.min.js' ); - - /** - * Fires immediately after the legacy Flot JS graphing framework is enqueued. - * - * @since 1.9 - */ - do_action( 'edd_graph_load_scripts' ); - } - - /** - * Build the graph and return it as a string - * - * @var array - * @since 1.9 - * @return string - */ - public function build_graph() { - - $yaxis_count = 1; - - $this->load_scripts(); - ob_start(); -?> - -
    -build_graph(); - do_action( 'edd_after_graph', $this ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-edd-pie-graph.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-edd-pie-graph.php deleted file mode 100644 index 27fc32e7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-edd-pie-graph.php +++ /dev/null @@ -1,199 +0,0 @@ - 'value' ), - array( 'Label 2' => 'value 2' ), - ); - - $graph = new EDD_Pie_Graph( $data ); - $graph->display(); - - */ - - /** - * Data to graph - * - * @var array - * @since 2.4 - */ - private $data; - - /** - * Unique ID for the graph - * - * @var string - * @since 2.4 - */ - private $id = ''; - - /** - * Graph options - * - * @var array - * @since 2.4 - */ - private $options = array(); - - /** - * Get things started - * - * @since 2.4 - */ - public function __construct( $_data, $options = array() ) { - - $this->data = $_data; - - // Set this so filters recieving $this can quickly know if it's a graph they want to modify - $this->type = 'pie'; - - // Generate unique ID, add 'a' since md5 can leave a numerical first character - $this->id = 'a' . md5( rand() ); - - // Setup default options; - $this->options = wp_parse_args( $options, array( - 'radius' => 1, - 'legend' => true, - 'legend_formatter' => false, - 'legend_columns' => 3, - 'legend_position' => 's', - 'show_labels' => false, - 'label_threshold' => 0.01, - 'label_formatter' => 'eddLabelFormatter', - 'label_bg_opacity' => 0.75, - 'label_radius' => 1, - 'height' => '300', - 'hoverable' => true, - 'clickable' => false, - 'threshold' => false, - ) ); - - add_action( 'edd_graph_load_scripts', array( $this, 'load_additional_scripts' ) ); - } - - /** - * Load the graphing library script - * - * @since 2.4 - */ - public function load_additional_scripts() { - wp_enqueue_script( 'edd-jquery-flot-pie', EDD_PLUGIN_URL . 'assets/js/vendor/jquery.flot.pie.min.js' ); - } - - /** - * Build the graph and return it as a string - * - * @var array - * @since 2.4 - * @return string - */ - public function build_graph() { - - if ( count( $this->data ) ) { - $this->load_scripts(); - - ob_start(); - ?> - -
    -
    -
    -
    - id, $this->data, $this->options ); - - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export-customers.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export-customers.php deleted file mode 100644 index 82a98de8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export-customers.php +++ /dev/null @@ -1,165 +0,0 @@ -export_type . '-' . date( 'm-d-Y' ) ) . '.csv"' ); - header( 'Expires: 0' ); - } - - /** - * Set the CSV columns - * - * @since 1.4.4 - * @return array $cols All the columns - */ - public function csv_cols() { - if ( ! empty( $_POST['edd_export_download'] ) ) { - $cols = array( - 'first_name' => __( 'First Name', 'easy-digital-downloads' ), - 'last_name' => __( 'Last Name', 'easy-digital-downloads' ), - 'email' => __( 'Email', 'easy-digital-downloads' ), - 'date' => __( 'Date Purchased', 'easy-digital-downloads' ) - ); - } else { - - $cols = array(); - - if( 'emails' != $_POST['edd_export_option'] ) { - $cols['name'] = __( 'Name', 'easy-digital-downloads' ); - } - - $cols['email'] = __( 'Email', 'easy-digital-downloads' ); - - if( 'full' == $_POST['edd_export_option'] ) { - $cols['purchases'] = __( 'Total Purchases', 'easy-digital-downloads' ); - $cols['amount'] = __( 'Total Purchased', 'easy-digital-downloads' ) . ' (' . html_entity_decode( edd_currency_filter( '' ) ) . ')'; - } - - } - - return $cols; - } - - /** - * Get the Export Data - * - * @since 1.4.4 - * @global object $wpdb Used to query the database using the WordPress - * Database API - * @global object $edd_logs EDD Logs Object - * @return array $data The data for the CSV file - */ - public function get_data() { - - $data = array(); - - if ( ! empty( $_POST['edd_export_download'] ) ) { - - $edd_logs = EDD()->debug_log; - - $args = array( - 'post_parent' => absint( $_POST['edd_export_download'] ), - 'log_type' => 'sale', - 'nopaging' => true - ); - - if( isset( $_POST['edd_price_option'] ) ) { - $args['meta_query'] = array( - array( - 'key' => '_edd_log_price_id', - 'value' => (int) $_POST['edd_price_option'] - ) - ); - } - - $logs = $edd_logs->get_connected_logs( $args ); - - if ( $logs ) { - foreach ( $logs as $log ) { - $payment_id = get_post_meta( $log->ID, '_edd_log_payment_id', true ); - $user_info = edd_get_payment_meta_user_info( $payment_id ); - $data[] = array( - 'first_name' => $user_info['first_name'], - 'last_name' => $user_info['last_name'], - 'email' => $user_info['email'], - 'date' => $log->post_date - ); - } - } - - } else { - - // Export all customers - $customers = edd_get_customers( array( - 'limit' => 9999999, - ) ); - - $i = 0; - - foreach ( $customers as $customer ) { - - if( 'emails' != $_POST['edd_export_option'] ) { - $data[$i]['name'] = $customer->name; - } - - $data[$i]['email'] = $customer->email; - - if( 'full' == $_POST['edd_export_option'] ) { - - $data[$i]['purchases'] = $customer->purchase_count; - $data[$i]['amount'] = edd_format_amount( $customer->purchase_value ); - - } - $i++; - } - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return $data; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export-download-history.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export-download-history.php deleted file mode 100644 index ca2e1e7d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export-download-history.php +++ /dev/null @@ -1,113 +0,0 @@ -export_type . '-' . $month . '-' . $year ) . '.csv"' ); - header( 'Expires: 0' ); - } - - - /** - * Set the CSV columns - * - * @since 1.4.4 - * @return array $cols All the columns - */ - public function csv_cols() { - $cols = array( - 'date' => __( 'Date', 'easy-digital-downloads' ), - 'user' => __( 'Downloaded by', 'easy-digital-downloads' ), - 'ip' => __( 'IP Address', 'easy-digital-downloads' ), - 'download' => __( 'Product', 'easy-digital-downloads' ), - 'file' => __( 'File', 'easy-digital-downloads' ) - ); - return $cols; - } - - /** - * Get the Export Data - * - * @since 1.4.4 - * @global object $edd_logs EDD Logs Object - * @return array $data The data for the CSV file - */ - public function get_data() { - $edd_logs = EDD()->debug_log; - - $data = array(); - - $args = array( - 'nopaging' => true, - 'log_type' => 'file_download', - 'monthnum' => isset( $_POST['month'] ) ? absint( $_POST['month'] ) : date( 'n' ), - 'year' => isset( $_POST['year'] ) ? absint( $_POST['year'] ) : date( 'Y' ) - ); - - $logs = $edd_logs->get_connected_logs( $args ); - - if ( $logs ) { - foreach ( $logs as $log ) { - $user_info = get_post_meta( $log->ID, '_edd_log_user_info', true ); - $files = edd_get_download_files( $log->post_parent ); - $file_id = (int) get_post_meta( $log->ID, '_edd_log_file_id', true ); - $file_name = isset( $files[ $file_id ]['name'] ) ? $files[ $file_id ]['name'] : null; - $user = get_userdata( $user_info['id'] ); - $user = $user ? $user->user_login : $user_info['email']; - - $data[] = array( - 'date' => $log->post_date, - 'user' => $user, - 'ip' => get_post_meta( $log->ID, '_edd_log_ip', true ), - 'download' => get_the_title( $log->post_parent ), - 'file' => $file_name - ); - } - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return $data; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export-payments.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export-payments.php deleted file mode 100644 index f96eef98..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export-payments.php +++ /dev/null @@ -1,201 +0,0 @@ -export_type . '-' . $month . '-' . $year ) . '.csv"' ); - header( 'Expires: 0' ); - } - - /** - * Set the CSV columns - * - * @since 1.4.4 - * @return array $cols All the columns - */ - public function csv_cols() { - $cols = array( - 'id' => __( 'ID', 'easy-digital-downloads' ), // unaltered payment ID (use for querying) - 'seq_id' => __( 'Payment Number', 'easy-digital-downloads' ), // sequential payment ID - 'email' => __( 'Email', 'easy-digital-downloads' ), - 'first' => __( 'First Name', 'easy-digital-downloads' ), - 'last' => __( 'Last Name', 'easy-digital-downloads' ), - 'address1' => __( 'Address', 'easy-digital-downloads' ), - 'address2' => __( 'Address (Line 2)', 'easy-digital-downloads' ), - 'city' => __( 'City', 'easy-digital-downloads' ), - 'state' => __( 'State', 'easy-digital-downloads' ), - 'country' => __( 'Country', 'easy-digital-downloads' ), - 'zip' => __( 'Zip / Postal Code', 'easy-digital-downloads' ), - 'products' => __( 'Products', 'easy-digital-downloads' ), - 'skus' => __( 'SKUs', 'easy-digital-downloads' ), - 'currency' => __( 'Currency', 'easy-digital-downloads' ), - 'amount' => __( 'Amount', 'easy-digital-downloads' ), - 'tax' => __( 'Tax', 'easy-digital-downloads' ), - 'discount' => __( 'Discount Code', 'easy-digital-downloads' ), - 'gateway' => __( 'Payment Method', 'easy-digital-downloads' ), - 'trans_id' => __( 'Transaction ID', 'easy-digital-downloads' ), - 'key' => __( 'Purchase Key', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ), - 'user' => __( 'User', 'easy-digital-downloads' ), - 'status' => __( 'Status', 'easy-digital-downloads' ) - ); - - if( ! edd_use_skus() ){ - unset( $cols['skus'] ); - } - if ( ! edd_get_option( 'enable_sequential' ) ) { - unset( $cols['seq_id'] ); - } - - return $cols; - } - - /** - * Get the Export Data - * - * @since 1.4.4 - * @global object $wpdb Used to query the database using the WordPress - * Database API - * @return array $data The data for the CSV file - */ - public function get_data() { - global $wpdb; - - $data = array(); - - $payments = edd_get_payments( array( - 'offset' => 0, - 'number' => 9999999, - 'mode' => edd_is_test_mode() ? 'test' : 'live', - 'status' => isset( $_POST['edd_export_payment_status'] ) ? $_POST['edd_export_payment_status'] : 'any', - 'month' => isset( $_POST['month'] ) ? absint( $_POST['month'] ) : date( 'n' ), - 'year' => isset( $_POST['year'] ) ? absint( $_POST['year'] ) : date( 'Y' ) - ) ); - - foreach ( $payments as $payment ) { - $payment_meta = edd_get_payment_meta( $payment->ID ); - $user_info = edd_get_payment_meta_user_info( $payment->ID ); - $downloads = edd_get_payment_meta_cart_details( $payment->ID ); - $total = edd_get_payment_amount( $payment->ID ); - $user_id = isset( $user_info['id'] ) && $user_info['id'] != -1 ? $user_info['id'] : $user_info['email']; - $products = ''; - $skus = ''; - - if ( $downloads ) { - foreach ( $downloads as $key => $download ) { - // Download ID - $id = isset( $payment_meta['cart_details'] ) ? $download['id'] : $download; - - // If the download has variable prices, override the default price - $price_override = isset( $payment_meta['cart_details'] ) ? $download['price'] : null; - - $price = edd_get_download_final_price( $id, $user_info, $price_override ); - - // Display the Downoad Name - $products .= get_the_title( $id ) . ' - '; - - if ( edd_use_skus() ) { - $sku = edd_get_download_sku( $id ); - - if ( ! empty( $sku ) ) - $skus .= $sku; - } - - if ( isset( $downloads[ $key ]['item_number'] ) && isset( $downloads[ $key ]['item_number']['options'] ) ) { - $price_options = $downloads[ $key ]['item_number']['options']; - - if ( isset( $price_options['price_id'] ) ) { - $products .= edd_get_price_option_name( $id, $price_options['price_id'], $payment->ID ) . ' - '; - } - } - $products .= html_entity_decode( edd_currency_filter( $price ) ); - - if ( $key != ( count( $downloads ) -1 ) ) { - $products .= ' / '; - - if( edd_use_skus() ) - $skus .= ' / '; - } - } - } - - if ( is_numeric( $user_id ) ) { - $user = get_userdata( $user_id ); - } else { - $user = false; - } - - $currency_code = edd_get_payment_currency_code( $payment->ID ); - - $data[] = array( - 'id' => $payment->ID, - 'seq_id' => edd_get_payment_number( $payment->ID ), - 'email' => $payment_meta['email'], - 'first' => $user_info['first_name'], - 'last' => $user_info['last_name'], - 'address1' => isset( $user_info['address']['line1'] ) ? $user_info['address']['line1'] : '', - 'address2' => isset( $user_info['address']['line2'] ) ? $user_info['address']['line2'] : '', - 'city' => isset( $user_info['address']['city'] ) ? $user_info['address']['city'] : '', - 'state' => isset( $user_info['address']['state'] ) ? $user_info['address']['state'] : '', - 'country' => isset( $user_info['address']['country'] ) ? $user_info['address']['country'] : '', - 'zip' => isset( $user_info['address']['zip'] ) ? $user_info['address']['zip'] : '', - 'products' => $products, - 'skus' => $skus, - 'currency' => $currency_code, - 'amount' => html_entity_decode( edd_format_amount( $total, $currency_code ) ), - 'tax' => html_entity_decode( edd_format_amount( edd_get_payment_tax( $payment->ID, $payment_meta ), $currency_code ) ), - 'discount' => isset( $user_info['discount'] ) && $user_info['discount'] != 'none' ? $user_info['discount'] : __( 'none', 'easy-digital-downloads' ), - 'gateway' => edd_get_gateway_admin_label( edd_get_payment_meta( $payment->ID, '_edd_payment_gateway', true ) ), - 'trans_id' => edd_get_payment_transaction_id( $payment->ID ), - 'key' => $payment_meta['key'], - 'date' => $payment->post_date, - 'user' => $user ? $user->display_name : __( 'guest', 'easy-digital-downloads' ), - 'status' => edd_get_payment_status( $payment, true ) - ); - - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return $data; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export.php deleted file mode 100644 index fadc1991..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-export.php +++ /dev/null @@ -1,202 +0,0 @@ -export_type . '-' . date( 'm-d-Y' ) . '.csv"' ); - header( 'Expires: 0' ); - - /** - * We need to append a BOM to the export so that Microsoft Excel knows - * that the file is in Unicode. - * - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/issues/4859 - */ - echo "\xEF\xBB\xBF"; - } - - /** - * Set the CSV columns. - * - * @since 1.4.4 - * - * @return array $cols CSV columns. - */ - public function csv_cols() { - $cols = array( - 'id' => __( 'ID', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ), - ); - return $cols; - } - - /** - * Retrieve the CSV columns. - * - * @since 1.4.4 - * - * @return array $cols Array of the columns. - */ - public function get_csv_cols() { - $cols = $this->csv_cols(); - return apply_filters( 'edd_export_csv_cols_' . $this->export_type, $cols ); - } - - /** - * Output the CSV columns. - * - * @since 1.4.4 - */ - public function csv_cols_out() { - $cols = $this->get_csv_cols(); - - $i = 1; - - // Output each column. - foreach ( $cols as $col_id => $column ) { - echo '"' . addslashes( $column ) . '"'; - - echo count( $cols ) === $i - ? '' - : ','; - - $i++; - } - echo "\r\n"; - } - - /** - * Get the data being exported. - * - * @since 1.4.4 - * - * @return array $data Data for export. - */ - public function get_data() { - - // Just a sample data array - $data = array( - 0 => array( - 'id' => '', - 'data' => date( 'F j, Y' ), - ), - 1 => array( - 'id' => '', - 'data' => date( 'F j, Y' ), - ), - ); - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return $data; - } - - /** - * Output the CSV rows. - * - * @since 1.4.4 - */ - public function csv_rows_out() { - $data = $this->get_data(); - - $cols = $this->get_csv_cols(); - - // Output each row. - foreach ( $data as $row ) { - $i = 1; - - foreach ( $row as $col_id => $column ) { - - // Make sure the column is valid. - if ( array_key_exists( $col_id, $cols ) ) { - echo '"' . addslashes( $column ) . '"'; - - echo count( $cols ) === $i - ? '' - : ','; - - $i++; - } - } - echo "\r\n"; - } - } - - /** - * Perform the export. - * - * @since 1.4.4 - * - * - * @uses EDD_Export::can_export() - * @uses EDD_Export::headers() - * @uses EDD_Export::csv_cols_out() - * @uses EDD_Export::csv_rows_out() - */ - public function export() { - - // Bail if user if unauthorized. - if ( ! $this->can_export() ) { - wp_die( __( 'You do not have permission to export data.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Set headers - $this->headers(); - - // Output CSV columns (headers) - $this->csv_cols_out(); - - // Output CSV rows - $this->csv_rows_out(); - - edd_die(); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-file-downloads-logs-list-table.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-file-downloads-logs-list-table.php deleted file mode 100644 index b48cafdb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-file-downloads-logs-list-table.php +++ /dev/null @@ -1,258 +0,0 @@ -ID, $item['price_id'] ) - : edd_get_download_name( $download->ID ); - - return '' . esc_html( $column_value ) . ''; - case 'customer' : - return ! empty( $item[ 'customer' ]->id ) - ? '' . esc_html( $item['customer']->name ) . '' - : '—'; - - case 'payment_id' : - $number = edd_get_payment_number( $item['payment_id'] ); - return ! empty( $number ) - ? '' . esc_html( $number ) . '' - : '—'; - case 'ip' : - return '' . esc_html( $item['ip'] ) . ''; - case 'file': - return ! empty( $item['file'] ) - ? esc_html( $item['file'] ) - : '—'; - default: - return $item[ $column_name ]; - } - } - - /** - * Set the table columns. - * - * @since 1.4 - * - * @return array $columns Array of all the list table columns - */ - public function get_columns() { - return array( - 'ID' => __( 'Log ID', 'easy-digital-downloads' ), - 'download' => edd_get_label_singular(), - 'customer' => __( 'Customer', 'easy-digital-downloads' ), - 'payment_id' => __( 'Order Number', 'easy-digital-downloads' ), - 'file' => __( 'File', 'easy-digital-downloads' ), - 'ip' => __( 'IP Address', 'easy-digital-downloads' ), - 'user_agent' => __( 'User Agent', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ) - ); - } - - /** - * Gets the log entries for the current view - * - * @since 1.4 - * - * @param $log_query array Arguments for getting logs. - * - * @return array $logs_data Array of all the logs. - */ - function get_logs( $log_query = array() ) { - $logs_data = array(); - - $logs = edd_get_file_download_logs( $log_query ); - - if ( $logs ) { - foreach ( $logs as $log ) { - /** @var $log File_Download_Log */ - - $customer_id = ! empty( $log->customer_id ) ? (int) $log->customer_id : edd_get_payment_customer_id( $log->order_id ); - - $files = $this->get_log_files( $log, $customer_id ); - - $file_id = $log->file_id; - - /** - * Filters the ID of the file that was actually downloaded from this log. - * - * @param int $file_id - * @param File_Download_Log $log - */ - $file_id = apply_filters( 'edd_log_file_download_file_id', $file_id, $log ); - - $file_name = edd_get_file_download_log_meta( $log->id, 'file_name', true ); - - if ( empty( $file_name ) && is_array( $files ) && isset( $files[ $file_id ] ) ) { - $file_name = ! empty( $files[ $file_id ]['name'] ) - ? $files[ $file_id ]['name'] - : edd_get_file_name( $files[ $file_id ] ); - } - - if ( empty( $this->file_search ) || ( ! empty( $this->file_search ) && strpos( strtolower( $file_name ), strtolower( $this->get_search() ) ) !== false ) ) { - $logs_data[] = array( - 'ID' => $log->id, - 'download' => $log->product_id, - 'customer' => new EDD_Customer( $customer_id ), - 'payment_id' => $log->order_id, - 'price_id' => $log->price_id, - 'file' => $file_name, - 'ip' => $log->ip, - 'user_agent' => $log->user_agent, - 'date' => $log->date_created, - ); - } - } - } - - return $logs_data; - } - - /** - * Retrieves the array of files associated with the log. - * - * This method contains a lot of logic to ensure backwards compatibility with how - * the `edd_log_file_download_download_files` filter was formatted in EDD 2.x. - * - * @since 3.0 - * - * @param File_Download_Log $log - * @param int $customer_id - * - * @return array - */ - protected function get_log_files( File_Download_Log $log, $customer_id ) { - $customer = ! empty( $customer_id ) ? edd_get_customer( $customer_id ) : false; - - /* - * Get the files associated with this download and store them in a property to prevent - * multiple queries for the same download. - * This is needed for backwards compatibility in the `edd_log_file_download_download_files` filter. - */ - if ( ! array_key_exists( $log->product_id, $this->queried_files ) ) { - $files = get_post_meta( $log->product_id, 'edd_download_files', true ); - $this->queried_files[ $log->product_id ] = $files; - } else { - $files = $this->queried_files[ $log->product_id ]; - } - - /* - * User info is needed for backwards compatibility in the `edd_log_file_download_download_files` filter. - */ - $user = ! empty( $customer->user_id ) ? get_userdata( $customer->user_id ) : false; - - $user_info = ! empty( $user ) - ? array( - 'id' => $user->ID, - 'email' => $user->user_email, - 'name' => $user->display_name, - ) - : array(); - - /* - * Build up an array of meta. - */ - $meta = edd_get_file_download_log_meta( $log->id ); - - // These meta keys no longer exist, but we need to create them for use in the filter. - $backwards_compat_meta = array( - '_edd_log_user_info' => $user_info, - '_edd_log_user_id' => ! empty( $customer->user_id ) ? $customer->user_id : false, - '_edd_log_customer_id' => $customer_id, - '_edd_log_file_id' => $log->file_id, - '_edd_log_ip' => $log->ip, - '_edd_log_payment_id' => $log->order_id, - '_edd_log_price_id' => $log->price_id, - ); - - foreach( $backwards_compat_meta as $meta_key => $meta_value ) { - $meta[ $meta_key ] = array( $meta_value ); - } - - /** - * Filters the array of all files linked to the product. - * - * @param array $files Files linked to the product. - * @param File_Download_Log $log Log record from the database. - * @param array $meta What used to be the meta array in EDD 2.9 and lower. - */ - return apply_filters( 'edd_log_file_download_download_files', $files, $log, $meta ); - } - - /** - * Setup the final data for the table. - * - * @since 1.5 - */ - public function get_total( $log_query = array() ) { - return edd_count_file_download_logs( $log_query ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-gateway-error-logs-list-table.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-gateway-error-logs-list-table.php deleted file mode 100644 index a19ee615..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-gateway-error-logs-list-table.php +++ /dev/null @@ -1,158 +0,0 @@ - - - - __( 'Log ID', 'easy-digital-downloads' ), - 'payment_id' => __( 'Order Number', 'easy-digital-downloads' ), - 'error' => __( 'Error', 'easy-digital-downloads' ), - 'message' => __( 'Error Message', 'easy-digital-downloads' ), - 'gateway' => __( 'Gateway', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ) - ); - } - - /** - * Gets the log entries for the current view - * - * @since 1.4 - * @param array $log_query Query arguments - * @global object $edd_logs EDD Logs Object - * @return array $logs_data Array of all the Log entries - */ - public function get_logs( $log_query = array() ) { - $logs_data = array(); - $log_query['type'] = 'gateway_error'; - - $logs = edd_get_logs( $log_query ); - - if ( $logs ) { - foreach ( $logs as $log ) { - /** @var $log EDD\Logs\Log */ - - $logs_data[] = array( - 'ID' => $log->id, - 'payment_id' => $log->object_id, - 'error' => $log->title ? $log->title : __( 'Payment Error', 'easy-digital-downloads' ), - 'gateway' => edd_get_payment_gateway( $log->object_id ), - 'date' => $log->date_created, - 'content' => $log->content, - ); - } - } - - return $logs_data; - } - - /** - * Setup the final data for the table. - * - * @since 1.5 - */ - public function get_total( $log_query = array() ) { - $log_query['type'] = 'gateway_error'; - - return edd_count_logs( $log_query ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-gateways-reports-table.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-gateways-reports-table.php deleted file mode 100644 index bd9b7ed0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-gateways-reports-table.php +++ /dev/null @@ -1,159 +0,0 @@ - 'report-gateway', - 'plural' => 'report-gateways', - 'ajax' => false - ) ); - } - - /** - * Gets the name of the primary column. - * - * @since 2.5 - * @access protected - * - * @return string Name of the primary column. - */ - protected function get_primary_column_name() { - return 'label'; - } - - /** - * This function renders most of the columns in the list table. - * - * @since 1.5 - * - * @param array $item Contains all the data of the downloads - * @param string $column_name The name of the column - * - * @return string Column Name - */ - public function column_default( $item, $column_name ) { - return $item[ $column_name ]; - } - - /** - * Retrieve the table columns - * - * @since 1.5 - * @return array $columns Array of all the list table columns - */ - public function get_columns() { - return array( - 'label' => __( 'Gateway', 'easy-digital-downloads' ), - 'complete_sales' => __( 'Complete Sales', 'easy-digital-downloads' ), - 'pending_sales' => __( 'Pending / Failed Sales', 'easy-digital-downloads' ), - 'total_sales' => __( 'Total Sales', 'easy-digital-downloads' ) - ); - } - - /** - * Outputs the reporting views - * - * @since 1.5 - * @return void - */ - public function bulk_actions( $which = '' ) { - // These aren't really bulk actions but this outputs the markup in - // the right place. - edd_report_views(); - } - - /** - * Builds and retrieves all of the payment gateways reports data. - * - * @since 1.5 - * @deprecated 3.0 Use get_data() - * - * @return array All the data for customer reports. - */ - public function reports_data() { - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Gateway_Reports_Table::get_data()' ); - - return $this->get_data(); - } - - /** - * Retrieves all of the payment gateways reports data. - * - * @since 3.0 - * - * @return array Payment gateways reports table data. - */ - public function get_data() { - - $reports_data = array(); - $gateways = edd_get_payment_gateways(); - - foreach ( $gateways as $gateway_id => $gateway ) { - - $complete_count = edd_count_sales_by_gateway( $gateway_id, edd_get_gross_order_statuses() ); - $pending_count = edd_count_sales_by_gateway( $gateway_id, edd_get_incomplete_order_statuses() ); - - $reports_data[] = array( - 'ID' => $gateway_id, - 'label' => $gateway['admin_label'], - 'complete_sales' => edd_format_amount( $complete_count, false ), - 'pending_sales' => edd_format_amount( $pending_count, false ), - 'total_sales' => edd_format_amount( $complete_count + $pending_count, false ), - ); - } - - return $reports_data; - } - - /** - * Setup the final data for the table - * - * @since 1.5 - * @uses EDD_Gateway_Reports_Table::get_columns() - * @uses EDD_Gateway_Reports_Table::get_sortable_columns() - * @uses EDD_Gateway_Reports_Table::reports_data() - * @return void - */ - public function prepare_items() { - $columns = $this->get_columns(); - $hidden = array(); // No hidden columns - $sortable = $this->get_sortable_columns(); - $this->_column_headers = array( $columns, $hidden, $sortable ); - $this->items = $this->get_data(); - } -} - -/** - * Back-compat for typo - * - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/issues/6549 - */ -class_alias( 'EDD_Gateway_Reports_Table', 'EDD_Gateawy_Reports_Table' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-reports-sections.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-reports-sections.php deleted file mode 100644 index 27b403ba..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/class-reports-sections.php +++ /dev/null @@ -1,51 +0,0 @@ -use_js ) - ? ' use-js' - : ''; - - $role = $this->use_js ? 'tablist' : 'menu'; - ?> -
    - -
    -
      - get_all_section_links(); ?> -
    - -
    - get_all_section_contents(); ?> -
    -
    -
    -
    - get_name( $price_id ); - $return = '' . esc_html( $title ) . ''; - break; - - case 'customer': - $name = ! empty( $item['customer']->name ) - ? $item['customer']->name - : '' . __( 'Unnamed Customer', 'easy-digital-downloads' ) . ''; - - $return = '#' . esc_html( $item['customer']->id ) . ' ' . esc_html( $name ) . ''; - break; - - case 'item_price': - $return = edd_currency_filter( edd_format_amount( $item['item_price'] ), $currency ); - break; - - case 'amount': - $return = edd_currency_filter( edd_format_amount( $item['amount'] / $item['quantity'] ), $currency ); - break; - - case 'ID': - $return = '' . absint( $item['ID'] ) . ''; - break; - - default: - $return = $item[ $column_name ]; - break; - } - - return $return; - } - - /** - * Retrieve the table columns - * - * @since 1.4 - * @return array $columns Array of all the list table columns - */ - public function get_columns() { - return array( - 'ID' => __( 'Order Number', 'easy-digital-downloads' ), - 'customer' => __( 'Customer', 'easy-digital-downloads' ), - 'download' => edd_get_label_singular(), - 'amount' => __( 'Item Amount', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ), - ); - } - - /** - * Return array of query arguments. - * - * @since 3.0 - * - * @param boolean $paginate - * - * @return array - */ - protected function get_query_args( $paginate = true ) { - $retval = parent::get_query_args( $paginate ); - - $user = $this->get_filtered_user(); - - if ( $user ) { - // Show only logs from a specific user - $retval['user_id'] = $user; - } - - $search = $this->get_search(); - if ( $search ) { - if ( is_email( $search ) ) { - $field = 'email'; - } else { - // Look for a user - $field = 'user_id'; - - if ( ! is_numeric( $search ) ) { - // Searching for user by username - $user = get_user_by( 'login', $search ); - - if ( $user ) { - // Found one, set meta value to user's ID - $search = $user->ID; - } else { - // No user found so let's do a real search query - $users = new WP_User_Query( array( - 'search' => $search, - 'search_columns' => array( 'user_url', 'user_nicename' ), - 'number' => 1, - 'fields' => 'ids', - ) ); - - $found_user = $users->get_results(); - - if ( $found_user ) { - $search = $found_user[0]; - } - } - } - } - - if ( ! $this->file_search ) { - $retval[ $field ] = $search; - } - } - - return $retval; - } - - /** - * Gets the log entries for the current view. - * - * @since 1.4 - * @since 3.0 Refactored to fetch from order items table. - * - * @param array $log_query Query vars. - * @return array $data Array of all the sales. - */ - public function get_logs( $log_query = array() ) { - $data = $order_args = array(); - - // Customer ID - if ( ! empty( $log_query['customer_id'] ) ) { - $order_args = array( - 'customer_id' => $log_query['customer_id'], - 'no_found_rows' => true - ); - - // Customer Email - } elseif ( ! empty( $log_query['email'] ) ) { - $order_args = array( - 'email' => $log_query['email'], - 'no_found_rows' => true - ); - } - - // Maybe query for orders first - if ( ! empty( $order_args ) ) { - $orders = edd_get_orders( $order_args ); - $log_query['order_id__in'] = wp_list_pluck( $orders, 'id' ); - } - - // Query order items - $order_items = edd_get_order_items( $log_query ); - - // Bail if no order items - if ( empty( $order_items ) ) { - return $data; - } - - // Maybe prime orders - if ( empty( $orders ) ) { - $order_ids = array_values( array_unique( wp_list_pluck( $order_items, 'order_id' ) ) ); - - if ( count( $order_ids ) > 2 ) { - $orders = edd_get_orders( array( - 'id__in' => $order_ids, - 'no_found_rows' => true - ) ); - } - } - - // Maybe prime customers - if ( ! empty( $orders ) ) { - $customer_ids = array_values( array_unique( wp_list_pluck( $orders, 'customer_id' ) ) ); - - if ( count( $customer_ids ) > 2 ) { - edd_get_customers( array( - 'id__in' => $customer_ids, - 'no_found_rows' => true - ) ); - } - } - - // Loop through order items - foreach ( $order_items as $order_item ) { - $order = edd_get_order( $order_item->order_id ); - - $data[] = array( - 'ID' => $order->get_number(), - 'order_id' => $order->id, - 'customer' => edd_get_customer( $order->customer_id ), - 'download' => $order_item->product_id, - 'price_id' => $order_item->price_id, - 'item_price' => $order_item->amount, - 'amount' => $order_item->total, - 'date' => EDD()->utils->date( $order_item->date_created, null, true )->toDateTimeString(), - 'quantity' => $order_item->quantity, - 'currency' => $order->currency, - ); - } - - return $data; - } - - /** - * Get the total number of items - * - * @since 3.0 - * - * @param array $log_query - * - * @return int - */ - public function get_total( $log_query = array() ) { - return edd_count_order_items( $log_query ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/contextual-help.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/contextual-help.php deleted file mode 100644 index 46686fd0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/contextual-help.php +++ /dev/null @@ -1,92 +0,0 @@ -id != 'download_page_edd-reports' ) { - return; - } - - $pass_manager = new Pass_Manager(); - if ( $pass_manager->isFree() ) { - $docs_url = edd_link_helper( - 'https://easydigitaldownloads.com/docs/', - array( - 'utm_medium' => 'reports-contextual-help', - 'utm_content' => 'documentation', - ) - ); - - $upgrade_url = edd_link_helper( - 'https://easydigitaldownloads.com/lite-upgrade/', - array( - 'utm_medium' => 'reports-contextual-help', - 'utm_content' => 'lite-upgrade', - ) - ); - - $screen->set_help_sidebar( - '

    ' . __( 'For more information:', 'easy-digital-downloads' ) . '

    ' . - '

    ' . sprintf( __( 'Visit the documentation on the Easy Digital Downloads website.', 'easy-digital-downloads' ), $docs_url ) . '

    ' . - '

    ' . sprintf( - __( 'Need more from your Easy Digital Downloads store? Upgrade Now!', 'easy-digital-downloads' ), - $upgrade_url - ) . '

    ' - ); - } - - $screen->add_help_tab( array( - 'id' => 'edd-reports', - 'title' => __( 'Reports', 'easy-digital-downloads' ), - 'content' => '

    ' . __( 'This screen provides you with reports for your earnings, downloads, customers and taxes.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-reports-export', - 'title' => __( 'Export', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'This screen allows you to export your reports into a CSV format.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Sales and Earnings - This report exports all of the sales and earnings that you have made in the current year. It includes your sales and earnings for each product as well a graphs of sales and earnings so you can compare them for each month.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Payment History - This report exports all of the payments you have received on your EDD store in a CSV format. It includes the contact details of the customer, the products they have purchased as well as any discount codes they have used and the final price they have paid.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( "Customers - This report exports all of your customers in a CSV format. It exports the customer's name and email address and the amount of products they have purchased as well as the final price of their total purchases.", 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Download History - This report exports all of the downloads you have received in the current month into a CSV. It exports the date the file was downloaded, the customer it was downloaded by, their IP address, the name of the product and the file they downloaded.', 'easy-digital-downloads' ) . '

    ' - ) ); - - if( ! empty( $_GET['tab'] ) && 'logs' == $_GET['tab'] ) { - $screen->add_help_tab( array( - 'id' => 'edd-reports-log-search', - 'title' => __( 'Search File Downloads', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'The file download log can be searched in several different ways:', 'easy-digital-downloads' ) . '

    ' . - '
      -
    • ' . __( 'You can enter the customer\'s email address', 'easy-digital-downloads' ) . '
    • -
    • ' . __( 'You can enter the customer\'s IP address', 'easy-digital-downloads' ) . '
    • -
    • ' . __( 'You can enter the download file\'s name', 'easy-digital-downloads' ) . '
    • -
    ' - ) ); - } - - do_action( 'edd_reports_contextual_help', $screen ); -} -add_action( 'load-download_page_edd-reports', 'edd_reporting_contextual_help' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-api-requests.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-api-requests.php deleted file mode 100644 index 3b18964d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-api-requests.php +++ /dev/null @@ -1,132 +0,0 @@ - __( 'Log ID', 'easy-digital-downloads' ), - 'request' => __( 'API Request', 'easy-digital-downloads' ), - 'ip' => __( 'IP Address', 'easy-digital-downloads' ), - 'user' => __( 'API User', 'easy-digital-downloads' ), - 'key' => __( 'API Key', 'easy-digital-downloads' ), - 'version' => __( 'API Version', 'easy-digital-downloads' ), - 'speed' => __( 'Request Speed', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ) - ); - - return $cols; - } - - /** - * Get the export data. - * - * @since 2.7 - * @since 3.0 Updated to use new query methods. - * - * @return array $data The data for the CSV file. - */ - public function get_data() { - $data = array(); - - $args = array( - 'number' => 30, - 'offset' => ( $this->step * 30 ) - 30 - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_query'] = $this->get_date_query(); - } - - $logs = edd_get_api_request_logs( $args ); - - foreach ( $logs as $log ) { - /** @var EDD\Logs\Api_Request_Log $log */ - - $data[] = array( - 'ID' => $log->id, - 'request' => $log->request, - 'ip' => $log->ip, - 'user' => $log->user_id, - 'key' => $log->api_key, - 'version' => $log->version, - 'speed' => $log->time, - 'date' => $log->date_created - ); - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return ! empty( $data ) - ? $data - : false; - } - - /** - * Return the calculated completion percentage. - * - * @since 2.7 - * @since 3.0 Updated to use new query methods. - * - * @return int Percentage complete. - */ - public function get_percentage_complete() { - $args = array( - 'fields' => 'ids', - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_query'] = $this->get_date_query(); - } - - $total = edd_count_api_request_logs( $args ); - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( 30 * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - public function set_properties( $request ) { - $this->start = isset( $request['api-requests-export-start'] ) ? sanitize_text_field( $request['api-requests-export-start'] ) : ''; - $this->end = isset( $request['api-requests-export-end'] ) ? sanitize_text_field( $request['api-requests-export-end'] ) : ''; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-customers.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-customers.php deleted file mode 100644 index 39547282..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-customers.php +++ /dev/null @@ -1,230 +0,0 @@ - __( 'ID', 'easy-digital-downloads' ), - 'user_id' => __( 'User ID', 'easy-digital-downloads' ), - 'name' => __( 'Name', 'easy-digital-downloads' ), - 'email' => __( 'Email', 'easy-digital-downloads' ), - 'purchases' => __( 'Number of Purchases', 'easy-digital-downloads' ), - 'amount' => __( 'Customer Value', 'easy-digital-downloads' ), - 'payment_ids' => __( 'Payment IDs', 'easy-digital-downloads' ), - 'date_created' => __( 'Date Created', 'easy-digital-downloads' ), - ); - } - - /** - * Get the export data. - * - * @since 2.4 - * @since 3.0 Updated to use new query methods. - * - * @return array $data The data for the CSV file. - */ - public function get_data() { - global $wpdb; - - $data = array(); - - // Taxonomy. - if ( ! empty( $this->taxonomy ) ) { - $taxonomy = $wpdb->prepare( 't.term_id = %d', $this->taxonomy ); - - $limit = $wpdb->prepare( '%d, %d', 30 * ( $this->step - 1 ), 30 ); - - $sql = "SELECT DISTINCT o.customer_id - FROM {$wpdb->terms} t - INNER JOIN {$wpdb->term_taxonomy} tt ON t.term_id = tt.term_id - INNER JOIN {$wpdb->term_relationships} tr ON tr.term_taxonomy_id = tt.term_taxonomy_id - INNER JOIN {$wpdb->edd_order_items} oi ON tr.object_id = oi.product_id - INNER JOIN {$wpdb->edd_orders} o ON oi.order_id = o.id - WHERE {$taxonomy} - LIMIT {$limit}"; - - $results = $wpdb->get_col( $sql ); // WPCS: unprepared SQL ok. - - if ( $results ) { - foreach ( $results as $customer_id ) { - $customer = new EDD_Customer( $customer_id ); - $name = ! empty( $customer->name ) ? $customer->name : ''; - if ( preg_match( '~^[+\-=@]~m', $name ) ) { - $name = "'{$name}"; - } - - $data[] = array( - 'id' => $customer->id, - 'name' => $name, - 'email' => $customer->email, - 'purchases' => $customer->purchase_count, - 'amount' => edd_format_amount( $customer->purchase_value ), - ); - } - } - - // Download. - } elseif ( ! empty( $this->download ) ) { - // Export customers of a specific product - - $args = array( - 'product_id' => absint( $this->download ), - 'number' => 30, - 'offset' => 30 * ( $this->step - 1 ), - ); - - if ( null !== $this->price_id ) { - $args['price_id'] = (int) $this->price_id; - } - - $order_items = edd_get_order_items( $args ); - - if ( $order_items ) { - foreach ( $order_items as $item ) { - $order = edd_get_order( $item->order_id ); - - $customer = new EDD_Customer( $order->customer_id ); - $name = ! empty( $customer->name ) ? $customer->name : ''; - if ( preg_match( '~^[+\-=@]~m', $name ) ) { - $name = "'{$name}"; - } - - $data[] = array( - 'id' => $customer->id, - 'user_id' => $customer->user_id, - 'name' => $name, - 'email' => $customer->email, - 'purchases' => $customer->purchase_count, - 'amount' => edd_format_amount( $customer->purchase_value ), - 'payment_ids' => $customer->payment_ids, - 'date_created' => $customer->date_created, - ); - } - } - - // All customers. - } else { - $customers = edd_get_customers( array( - 'number' => 30, - 'offset' => 30 * ( $this->step - 1 ), - ) ); - - $i = 0; - - foreach ( $customers as $customer ) { - $name = ! empty( $customer->name ) ? $customer->name : ''; - if ( preg_match( '~^[+\-=@]~m', $name ) ) { - $name = "'{$name}"; - } - $data[ $i ]= array( - 'id' => $customer->id, - 'user_id' => $customer->user_id, - 'name' => $name, - 'email' => $customer->email, - 'purchases' => $customer->purchase_count, - 'amount' => edd_format_amount( $customer->purchase_value ), - 'payment_ids' => $customer->payment_ids, - 'date_created' => $customer->date_created, - ); - - $i++; - } - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return $data; - } - - /** - * Return the calculated completion percentage. - * - * @since 2.4 - * - * @return float Percentage complete. - */ - public function get_percentage_complete() { - $percentage = 0; - - // We can't count the number when getting them for a specific download. - if ( empty( $this->download ) ) { - $total = edd_count_customers(); - - if ( $total > 0 ) { - $percentage = ( ( 30 * $this->step ) / $total ) * 100; - } - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the Customers export - * - * @since 2.4.2 - * - * @param array $request Form data passed into the batch processing. - */ - public function set_properties( $request ) { - $this->taxonomy = isset( $request['taxonomy'] ) - ? absint( $request['taxonomy'] ) - : null; - - $this->download = isset( $request['download'] ) - ? absint( $request['download'] ) - : null; - - $this->price_id = ! empty( $request['edd_price_option'] ) && 0 !== $request['edd_price_option'] - ? absint( $request['edd_price_option'] ) - : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-downloads.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-downloads.php deleted file mode 100644 index 1ea03b64..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-downloads.php +++ /dev/null @@ -1,234 +0,0 @@ - __( 'ID', 'easy-digital-downloads' ), - 'post_name' => __( 'Slug', 'easy-digital-downloads' ), - 'post_title' => __( 'Name', 'easy-digital-downloads' ), - 'post_date' => __( 'Date Created', 'easy-digital-downloads' ), - 'post_author' => __( 'Author', 'easy-digital-downloads' ), - 'post_content' => __( 'Description', 'easy-digital-downloads' ), - 'post_excerpt' => __( 'Excerpt', 'easy-digital-downloads' ), - 'post_status' => __( 'Status', 'easy-digital-downloads' ), - 'categories' => __( 'Categories', 'easy-digital-downloads' ), - 'tags' => __( 'Tags', 'easy-digital-downloads' ), - 'edd_price' => __( 'Price', 'easy-digital-downloads' ), - '_edd_files' => __( 'Files', 'easy-digital-downloads' ), - '_edd_download_limit' => __( 'File Download Limit', 'easy-digital-downloads' ), - '_thumbnail_id' => __( 'Featured Image', 'easy-digital-downloads' ), - 'edd_sku' => __( 'SKU', 'easy-digital-downloads' ), - 'edd_product_notes' => __( 'Notes', 'easy-digital-downloads' ), - '_edd_download_sales' => __( 'Sales', 'easy-digital-downloads' ), - '_edd_download_earnings' => __( 'Earnings', 'easy-digital-downloads' ), - ); - - return $cols; - } - - /** - * Get the export data. - * - * @since 2.5 - * - * @return array $data The data for the CSV file. - */ - public function get_data() { - $data = array(); - - $meta = array( - 'edd_price', - '_edd_files', - '_edd_download_limit', - '_thumbnail_id', - 'edd_sku', - 'edd_product_notes', - '_edd_download_sales', - '_edd_download_earnings', - ); - - $args = array( - 'post_type' => 'download', - 'posts_per_page' => 30, - 'paged' => $this->step, - 'orderby' => 'ID', - 'order' => 'ASC', - ); - - if ( 0 !== $this->download ) { - $args['post__in'] = array( $this->download ); - } - - $downloads = new WP_Query( $args ); - - if ( $downloads->posts ) { - foreach ( $downloads->posts as $download ) { - $row = array(); - - foreach ( $this->csv_cols() as $key => $value ) { - - // Setup default value - $row[ $key ] = ''; - - if ( in_array( $key, $meta ) ) { - switch ( $key ) { - case '_thumbnail_id' : - $image_id = get_post_thumbnail_id( $download->ID ); - $row[ $key ] = wp_get_attachment_url( $image_id ); - break; - - case 'edd_price' : - if ( edd_has_variable_prices( $download->ID ) ) { - $prices = array(); - foreach ( edd_get_variable_prices( $download->ID ) as $price ) { - $prices[] = $price['name'] . ': ' . $price['amount']; - } - - $row[ $key ] = implode( ' | ', $prices ); - } else { - $row[ $key ] = edd_get_download_price( $download->ID ); - } - break; - - case '_edd_files' : - $files = array(); - - foreach ( edd_get_download_files( $download->ID ) as $file ) { - $f = $file['file']; - - if ( edd_has_variable_prices( $download->ID ) ) { - $condition = isset( $file['condition'] ) ? $file['condition'] : 'all'; - $f .= ';' . $condition; - } - - $files[] = $f; - - unset( $file ); - } - - $row[ $key ] = implode( ' | ', $files ); - break; - - default : - $row[ $key ] = get_post_meta( $download->ID, $key, true ); - break; - } - } elseif ( isset( $download->$key ) ) { - switch ( $key ) { - case 'post_author': - $row[ $key ] = get_the_author_meta( 'user_login', $download->post_author ); - break; - - default: - $row[ $key ] = $download->$key; - break; - } - } elseif ( 'tags' == $key ) { - $terms = get_the_terms( $download->ID, 'download_tag' ); - - if ( $terms ) { - $terms = wp_list_pluck( $terms, 'name' ); - $row[ $key ] = implode( ' | ', $terms ); - } - } elseif ( 'categories' == $key ) { - $terms = get_the_terms( $download->ID, 'download_category' ); - - if ( $terms ) { - $terms = wp_list_pluck( $terms, 'name' ); - $row[ $key ] = implode( ' | ', $terms ); - } - } - } - - $data[] = $row; - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return $data; - } - - return false; - } - - /** - * Return the calculated completion percentage. - * - * @since 2.5 - * - * @return int Percentage complete. - */ - public function get_percentage_complete() { - $args = array( - 'post_type' => 'download', - 'posts_per_page' => - 1, - 'post_status' => 'any', - 'fields' => 'ids', - ); - - if ( 0 !== $this->download ) { - $args['post__in'] = array( $this->download ); - } - - $downloads = new WP_Query( $args ); - $total = (int) $downloads->post_count; - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( 30 * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the downloads export. - * - * @since 3.0 - * - * @param array $request Form data passed into the batch processor. - */ - public function set_properties( $request ) { - $this->download = isset( $request['download_id'] ) ? absint( $request['download_id'] ) : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-earnings-report.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-earnings-report.php deleted file mode 100644 index af4e6ff7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-earnings-report.php +++ /dev/null @@ -1,383 +0,0 @@ -export_type . '-' . date( 'm' ) . '-' . date( 'Y' ) ) . '.csv"' ); - header( 'Expires: 0' ); - } - - /** - * Get the column headers for the Earnings Report. - * - * @since 2.8.18 - * - * @return array CSV columns. - */ - public function get_csv_cols() { - - // Always start with the date column. - $pre_status_columns = array( - __( 'Monthly Sales Activity', 'easy-digital-downloads' ), - __( 'Gross Activity', 'easy-digital-downloads' ), - ); - - $status_cols = $this->get_status_cols(); - - // Append the arrays together so it starts with the date, then include the status list. - $cols = array_merge( $pre_status_columns, $status_cols ); - - // Include the 'net' after all other columns. - $cols[] = __( 'Net Activity', 'easy-digital-downloads' ); - - return $cols; - } - - /** - * Specifically retrieve the headers for supported order statuses. - * - * @since 2.8.18 - * - * @return array Order status columns. - */ - public function get_status_cols() { - $status_cols = edd_get_payment_statuses(); - $supported_statuses = $this->get_supported_statuses(); - - foreach ( $status_cols as $id => $label ) { - if ( ! in_array( $id, $supported_statuses ) ) { - unset( $status_cols[ $id ] ); - } - } - - return array_values( $status_cols ); - } - - /** - * Get a list of the statuses supported in this report. - * - * @since 2.8.18 - * - * @return array The status keys supported (not labels). - */ - public function get_supported_statuses() { - $statuses = edd_get_payment_statuses(); - - // Unset a few statuses we don't need in the report: - unset( $statuses['pending'], $statuses['processing'], $statuses['preapproval'] ); - $supported_statuses = array_keys( $statuses ); - - return array_unique( apply_filters( 'edd_export_earnings_supported_statuses', $supported_statuses ) ); - } - - /** - * Output the CSV columns. - * - * We make use of this function to set up the header of the earnings report. - * - * @since 2.7 - * - * @return string $col_data CSV cols. - */ - public function print_csv_cols() { - $cols = $this->get_csv_cols(); - $col_data = ''; - $column_count = count( $cols ); - for ( $i = 0; $i < $column_count; $i++ ) { - $col_data .= $cols[ $i ]; - - // We don't need an extra space after the first column. - if ( $i == 0 ) { - $col_data .= ','; - continue; - } - - if ( $i == ( $column_count - 1 ) ) { - $col_data .= "\r\n"; - } else { - $col_data .= ",,"; - } - } - - $statuses = $this->get_supported_statuses(); - $number_cols = count( $statuses ) + 2; - - $col_data .= ','; - for ( $i = 1; $i <= $number_cols; $i++ ) { - $col_data .= __( 'Order Count', 'easy-digital-downloads' ) . ','; - $col_data .= __( 'Gross Amount', 'easy-digital-downloads' ); - - if ( $number_cols !== $i ) { - $col_data .= ','; - } - } - $col_data .= "\r\n"; - - $this->stash_step_data( $col_data ); - - return $col_data; - } - - /** - * Print the CSV rows for the current step. - * - * @since 2.7 - * - * @return mixed string|false - */ - public function print_csv_rows() { - $row_data = ''; - - $data = $this->get_data(); - - if ( $data ) { - $start_date = date( 'Y-m-d', strtotime( $this->start ) ); - - if ( $this->count() == 0 ) { - $end_date = date( 'Y-m-d', strtotime( $this->end ) ); - } else { - $end_date = date( 'Y-m-d', strtotime( 'first day of +1 month', strtotime( $start_date ) ) ); - } - - if ( $this->step == 1 ) { - $row_data .= $start_date . ','; - } elseif ( $this->step > 1 ) { - $start_date = date( 'Y-m-d', strtotime( 'first day of +' . ( $this->step - 1 ) . ' month', strtotime( $start_date ) ) ); - - if ( date( 'Y-m', strtotime( $start_date ) ) == date( 'Y-m', strtotime( $this->end ) ) ) { - $end_date = date( 'Y-m-d', strtotime( $this->end ) ); - $row_data .= $end_date . ','; - } else { - $row_data .= $start_date . ','; - } - } - - $gross_count = 0; - $gross_amount = 0; - foreach ( edd_get_gross_order_statuses() as $status ) { - $gross_count += absint( $data[ $status ]['count'] ); - $gross_amount += $data[ $status ]['amount']; - } - - $row_data .= $gross_count . ','; - $row_data .= '"' . edd_format_amount( $gross_amount ) . '",'; - - foreach ( $data as $status => $status_data ) { - $row_data .= isset( $data[ $status ]['count'] ) ? $data[ $status ]['count'] . ',' : 0 . ','; - - $column_amount = isset( $data[ $status ]['amount'] ) ? edd_format_amount( $data[ $status ]['amount'] ) : 0; - if ( ! empty( $column_amount ) && 'refunded' == $status ) { - $column_amount = '-' . $column_amount; - } - - $row_data .= isset( $data[ $status ]['amount'] ) ? '"' . $column_amount . '"' . ',' : 0 . ','; - } - - // Allows extensions with other 'completed' statuses to alter net earnings, like recurring. - $completed_statuses = array_unique( apply_filters( 'edd_export_earnings_completed_statuses', edd_get_net_order_statuses() ) ); - - $net_count = 0; - $net_amount = 0; - foreach ( $completed_statuses as $status ) { - if ( ! isset( $data[ $status ] ) ) { - continue; - } - $net_count += absint( $data[ $status ]['count'] ); - $net_amount += floatval( $data[ $status ]['amount'] ); - } - if ( ! empty( $this->partial_refunds ) ) { - $net_amount += floatval( $this->partial_refunds['total'] ); - } - $row_data .= $net_count . ','; - $row_data .= '"' . edd_format_amount( $net_amount ) . '"'; - - $row_data .= "\r\n"; - - $this->stash_step_data( $row_data ); - - return $row_data; - } - - return false; - } - - /** - * Get the Export Data. - * - * @since 2.7 - * - * @return array $data The data for the CSV file - */ - public function get_data() { - global $wpdb; - - $data = array(); - - $start_date = date( 'Y-m-d 00:00:00', strtotime( $this->start ) ); - $end_date = date( 'Y-m-t 23:59:59', strtotime( $this->start ) ); - - if ( $this->step > 1 ) { - $start_timestamp = strtotime( 'first day of +' . ( $this->step - 1 ) . ' month', strtotime( $start_date ) ); - $start_date = date( 'Y-m-d 00:00:00', $start_timestamp ); - $end_date = date( 'Y-m-t 23:59:59', $start_timestamp ); - } - - if ( strtotime( $start_date ) > strtotime( $this->end ) ) { - return false; - } - - $statuses = $this->get_supported_statuses(); - $totals = $wpdb->get_results( $wpdb->prepare( - "SELECT SUM(total) AS total, COUNT(DISTINCT id) AS count, status - FROM {$wpdb->edd_orders} - WHERE type = 'sale' - AND date_created >= %s AND date_created <= %s - GROUP BY YEAR(date_created), MONTH(date_created), status - ORDER by date_created ASC", $start_date, $end_date ), ARRAY_A ); - - $total_data = array(); - foreach ( $totals as $row ) { - $total_data[ $row['status'] ] = array( - 'count' => $row['count'], - 'amount' => floatval( $row['total'] ), - ); - } - - foreach ( $statuses as $status ) { - - if ( ! isset( $total_data[ $status ] ) ) { - $data[ $status ] = array( - 'count' => 0, - 'amount' => 0, - ); - } else { - $data[ $status ] = array( - 'count' => $total_data[ $status ]['count'], - 'amount' => $total_data[ $status ]['amount'], - ); - } - } - - // Get partial refund amounts to factor into net activity amounts. - $partial_refunds = $wpdb->get_results( - $wpdb->prepare( - "SELECT SUM(total) AS total, COUNT(DISTINCT id) AS count - FROM {$wpdb->edd_orders} - WHERE type = 'refund' - AND parent IN ( - SELECT id - FROM {$wpdb->edd_orders} - WHERE status = 'partially_refunded' - AND date_created >= %s - AND date_created <= %s - GROUP BY YEAR(date_created), MONTH(date_created) - ORDER by date_created ASC - );", - $start_date, - $end_date - ), - ARRAY_A - ); - if ( ! empty( $partial_refunds ) ) { - $this->partial_refunds = reset( $partial_refunds ); - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data, $start_date, $end_date ); - - return $data; - } - - /** - * Count the number of months we are dealing with. - * - * @since 2.7 - * @access private - * - * @return void - */ - private function count() { - return abs( ( date( 'Y', strtotime( $this->end ) ) - date( 'Y', strtotime( $this->start ) ) ) * 12 + ( date( 'm', strtotime( $this->end ) ) - date( 'm', strtotime( $this->start ) ) ) ); - } - - /** - * Return the calculated completion percentage - * - * @since 2.7 - * - * @return int Percentage of batch processing complete. - */ - public function get_percentage_complete() { - $percentage = 100; - - $total = $this->count(); - - if ( $total > 0 ) { - $percentage = ( $this->step / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the earnings report. - * - * @since 2.7 - * - * @param array $request The Form Data passed into the batch processing - * @return void - */ - public function set_properties( $request ) { - $this->start = ( isset( $request['start_month'] ) && isset( $request['start_year'] ) ) ? sanitize_text_field( $request['start_year'] ) . '-' . sanitize_text_field( $request['start_month'] ) . '-1' : ''; - $this->end = ( isset( $request['end_month'] ) && isset( $request['end_year'] ) ) ? sanitize_text_field( $request['end_year'] ) . '-' . sanitize_text_field( $request['end_month'] ) . '-' . cal_days_in_month( CAL_GREGORIAN, sanitize_text_field( $request['end_month'] ), sanitize_text_field( $request['end_year'] ) ) : ''; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-file-downloads.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-file-downloads.php deleted file mode 100644 index 77fe7298..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-file-downloads.php +++ /dev/null @@ -1,162 +0,0 @@ - __( 'Date', 'easy-digital-downloads' ), - 'user' => __( 'Downloaded by', 'easy-digital-downloads' ), - 'ip' => __( 'IP Address', 'easy-digital-downloads' ), - 'user_agent' => __( 'User Agent', 'easy-digital-downloads' ), - 'download' => __( 'Product', 'easy-digital-downloads' ), - 'file' => __( 'File', 'easy-digital-downloads' ), - ); - - return $cols; - } - - /** - * Get the export data. - * - * @since 2.4 - * @since 3.0 Refactored to use new query methods. - * - * @return array $data The data for the CSV file. - */ - public function get_data() { - $data = array(); - - $args = array( - 'number' => 30, - 'offset' => ( $this->step * 30 ) - 30, - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_created_query'] = $this->get_date_query(); - } - - if ( 0 !== $this->download_id ) { - $args['product_id'] = $this->download_id; - } - - $logs = edd_get_file_download_logs( $args ); - - foreach ( $logs as $log ) { - /** @var EDD\Logs\File_Download_Log $log */ - - $files = edd_get_download_files( $log->product_id ); - $file_id = $log->file_id; - $file_name = isset( $files[ $file_id ]['name'] ) ? $files[ $file_id ]['name'] : null; - $customer = edd_get_customer( $log->customer_id ); - - if ( $customer ) { - $customer = $customer->email; - if ( ! empty( $customer->name ) ) { - $customer = $customer->name; - if ( preg_match( '~^[+\-=@]~m', $customer ) ) { - $customer = "'{$customer}"; - } - } - } else { - $order = edd_get_order( $log->order_id ); - - if ( $order ) { - $customer = $order->email; - } - } - - $data[] = array( - 'date' => $log->date_created, - 'user' => $customer, - 'ip' => $log->ip, - 'user_agent' => $log->user_agent, - 'download' => get_the_title( $log->product_id ), - 'file' => $file_name, - ); - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return ! empty( $data ) - ? $data - : false; - } - - /** - * Return the calculated completion percentage. - * - * @since 2.4 - * @since 3.0 Updated to use new query methods. - * - * @return int Percentage complete. - */ - public function get_percentage_complete() { - $args = array( - 'fields' => 'ids', - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_created_query'] = $this->get_date_query(); - } - - if ( 0 !== $this->download_id ) { - $args['download_id'] = $this->download_id; - } - - $total = edd_count_file_download_logs( $args ); - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( 30 * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - public function set_properties( $request ) { - $this->start = isset( $request['file-download-export-start'] ) ? sanitize_text_field( $request['file-download-export-start'] ) : ''; - $this->end = isset( $request['file-download-export-end'] ) ? sanitize_text_field( $request['file-download-export-end'] ) : ''; - $this->download_id = isset( $request['download_id'] ) ? absint( $request['download_id'] ) : 0; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-payments.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-payments.php deleted file mode 100644 index 1f2a55a6..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-payments.php +++ /dev/null @@ -1,281 +0,0 @@ - __( 'Order ID', 'easy-digital-downloads' ), // unaltered payment ID (use for querying) - 'seq_id' => __( 'Order Number', 'easy-digital-downloads' ), // sequential payment ID - 'email' => __( 'Email', 'easy-digital-downloads' ), - 'customer_id' => __( 'Customer ID', 'easy-digital-downloads' ), - 'name' => __( 'Customer Name', 'easy-digital-downloads' ), - 'address1' => __( 'Address', 'easy-digital-downloads' ), - 'address2' => __( 'Address (Line 2)', 'easy-digital-downloads' ), - 'city' => __( 'City', 'easy-digital-downloads' ), - 'state' => __( 'State', 'easy-digital-downloads' ), - 'country' => __( 'Country', 'easy-digital-downloads' ), - 'zip' => __( 'Zip / Postal Code', 'easy-digital-downloads' ), - 'products' => __( 'Products (Verbose)', 'easy-digital-downloads' ), - 'products_raw' => __( 'Products (Raw)', 'easy-digital-downloads' ), - 'skus' => __( 'SKUs', 'easy-digital-downloads' ), - 'currency' => __( 'Currency', 'easy-digital-downloads' ), - 'amount' => __( 'Amount', 'easy-digital-downloads' ), - 'tax' => __( 'Tax', 'easy-digital-downloads' ), - 'discount' => __( 'Discount Code', 'easy-digital-downloads' ), - 'gateway' => __( 'Payment Method', 'easy-digital-downloads' ), - 'trans_id' => __( 'Transaction ID', 'easy-digital-downloads' ), - 'key' => __( 'Purchase Key', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ), - 'user' => __( 'User', 'easy-digital-downloads' ), - 'ip' => __( 'IP Address', 'easy-digital-downloads' ), - 'mode' => __( 'Mode (Live|Test)', 'easy-digital-downloads' ), - 'status' => __( 'Status', 'easy-digital-downloads' ), - 'country_name' => __( 'Country Name', 'easy-digital-downloads' ), - 'state_name' => __( 'State Name', 'easy-digital-downloads' ), - ); - - if ( ! edd_use_skus() ){ - unset( $cols['skus'] ); - } - - if ( ! edd_get_option( 'enable_sequential' ) ) { - unset( $cols['seq_id'] ); - } - - return $cols; - } - - /** - * Get the export data. - * - * @since 2.4 - * @since 3.0 Updated to use new query methods. - * - * @return array $data The data for the CSV file. - */ - public function get_data() { - $data = array(); - - $args = array( - 'number' => 30, - 'offset' => ( $this->step * 30 ) - 30, - 'status' => $this->status, - 'order' => 'ASC', - 'orderby' => 'date_created', - 'type' => 'sale', - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_query'] = $this->get_date_query(); - } - - if ( in_array( $args['status'], array( 'any', 'all' ), true ) ) { - unset( $args['status'] ); - $args['status__not_in'] = array( 'trash' ); - } - - $orders = edd_get_orders( $args ); - - foreach ( $orders as $order ) { - /** @var EDD\Orders\Order $order */ - - $items = $order->get_items(); - $address = $order->get_address(); - $total = $order->total; - $user_id = $order->id && $order->id != - 1 ? $order->id : $order->email; - $customer = edd_get_customer( $order->customer_id ); - $products = ''; - $products_raw = ''; - $skus = ''; - - $discounts = $order->get_discounts(); - $discounts = ! empty( $discounts ) - ? implode( ', ', $discounts ) - : __( 'none', 'easy-digital-downloads' ); - - foreach ( $items as $key => $item ) { - /** @var EDD\Orders\Order_Item $item */ - - // Setup item information. - $id = $item->product_id; - $qty = $item->quantity; - $price = $item->amount; - $tax = $item->tax; - $price_id = $item->price_id; - - // Set up verbose product column. - $products .= html_entity_decode( get_the_title( $id ) ); - - if ( $qty > 1 ) { - $products .= html_entity_decode( ' (' . $qty . ')' ); - } - - $products .= ' - '; - - if ( edd_use_skus() ) { - $sku = edd_get_download_sku( $id ); - - if ( ! empty( $sku ) ) { - $skus .= $sku; - } - } - - if ( 0 < $item->price_id ) { - $products .= html_entity_decode( edd_get_price_option_name( $id, $item->price_id, $order->id ) ) . ' - '; - } - - $products .= html_entity_decode( edd_currency_filter( edd_format_amount( $price ), $order->currency ) ); - - if ( $key != ( count( $items ) -1 ) ) { - $products .= ' / '; - - if ( edd_use_skus() ) { - $skus .= ' / '; - } - } - - // Set up raw products column; nothing but product names. - $products_raw .= html_entity_decode( get_the_title( $id ) ) . '|' . $price . '{' . $tax . '}'; - - // If we have a price ID, include it. - if ( false !== $price_id ) { - $products_raw .= '{' . $price_id . '}'; - } - - if ( $key != ( count( $items ) -1 ) ) { - $products_raw .= ' / '; - } - } - - $user = is_numeric( $user_id ) - ? get_userdata( $user_id ) - : false; - - $name = ! empty( $customer->name ) ? $customer->name : ''; - if ( preg_match( '~^[+\-=@]~m', $name ) ) { - $name = "'{$name}"; - } - - $data[] = array( - 'id' => $order->id, - 'seq_id' => $order->get_number(), - 'email' => $order->email, - 'customer_id' => $order->customer_id, - 'name' => $name, - 'address1' => isset( $address->address ) ? $address->address : '', - 'address2' => isset( $address->address2 ) ? $address->address2 : '', - 'city' => isset( $address->city ) ? $address->city : '', - 'state' => isset( $address->region ) ? $address->region : '', - 'country' => isset( $address->country ) ? $address->country : '', - 'zip' => isset( $address->postal_code ) ? $address->postal_code : '', - 'products' => $products, - 'products_raw' => $products_raw, - 'skus' => $skus, - 'currency' => $order->currency, - 'amount' => html_entity_decode( edd_format_amount( $total ) ), // The non-discounted item price - 'tax' => html_entity_decode( edd_format_amount( $order->tax ) ), - 'discount' => $discounts, - 'gateway' => edd_get_gateway_admin_label( $order->gateway ), - 'trans_id' => $order->get_transaction_id(), - 'key' => $order->payment_key, - 'date' => $order->date_created, - 'user' => $user ? $user->display_name : __( 'guest', 'easy-digital-downloads' ), - 'ip' => $order->ip, - 'mode' => $order->mode, - 'status' => $order->status, - 'country_name' => isset( $address->country ) ? edd_get_country_name( $address->country ) : '', - 'state_name' => isset( $address->country ) && isset( $address->region ) ? edd_get_state_name( $address->country, $address->region ) : '', - ); - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return ! empty( $data ) - ? $data - : false; - } - - /** - * Return the calculated completion percentage - * - * @since 2.4 - * @since 3.0 Updated to use new query methods. - * - * @return int - */ - public function get_percentage_complete() { - $args = array( - 'fields' => 'ids', - 'status' => $this->status, - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_query'] = $this->get_date_query(); - } - - if ( in_array( $args['status'], array( 'any', 'all' ), true ) ) { - unset( $args['status'] ); - } - - $total = edd_count_orders( $args ); - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( 30 * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the payments export - * - * @since 2.4.2 - * - * @param array $request The Form Data passed into the batch processing - */ - public function set_properties( $request ) { - $this->start = isset( $request['orders-export-start'] ) ? sanitize_text_field( $request['orders-export-start'] ) : ''; - $this->end = isset( $request['orders-export-end'] ) ? sanitize_text_field( $request['orders-export-end'] ) : ''; - $this->status = isset( $request['status'] ) ? sanitize_text_field( $request['status'] ) : 'complete'; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-sales-and-earnings.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-sales-and-earnings.php deleted file mode 100644 index 4d0ad54d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-sales-and-earnings.php +++ /dev/null @@ -1,238 +0,0 @@ - __( 'Date', 'easy-digital-downloads' ), - 'sales' => __( 'Sales', 'easy-digital-downloads' ), - 'earnings' => __( 'Earnings', 'easy-digital-downloads' ), - ); - - return $cols; - } - - /** - * Get the export data. - * - * @since 3.0 - * - * @return array $data The data for the CSV file. - */ - public function get_data() { - global $wpdb; - - $data = array(); - - $args = array( - 'number' => 30, - 'offset' => ( $this->step * 30 ) - 30, - ); - - $status = "AND {$wpdb->edd_orders}.status IN ( '" . implode( "', '", $wpdb->_escape( edd_get_complete_order_statuses() ) ) . "' )"; - $date_query_sql = ''; - - // Customer ID. - $customer_id = ! empty( $this->customer_id ) - ? $wpdb->prepare( "AND {$wpdb->edd_orders}.customer_id = %d", $this->customer_id ) - : ''; - - // Download ID. - $download_id = ! empty( $this->download_id ) - ? $wpdb->prepare( "AND {$wpdb->edd_order_items}.product_id = %d", $this->download_id ) - : ''; - - // Generate date query SQL if dates have been set. - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - - // Fetch GMT offset. - $offset = EDD()->utils->get_gmt_offset(); - - $date_query_sql = 'AND '; - - if ( ! empty( $this->start ) ) { - $this->start = date( 'Y-m-d 00:00:00', strtotime( $this->start ) ); - - $this->start = 0 < $offset - ? EDD()->utils->date( $this->start )->subSeconds( $offset )->format( 'mysql' ) - : EDD()->utils->date( $this->start )->addSeconds( $offset )->format( 'mysql' ); - - $date_query_sql .= $wpdb->prepare( "{$wpdb->edd_orders}.date_created >= %s", $this->start ); - } - - // Join dates with `AND` if start and end date set. - if ( ! empty( $this->start ) && ! empty( $this->end ) ) { - $this->end = date( 'Y-m-d 23:59:59', strtotime( $this->end ) ); - - $this->end = 0 < $offset - ? EDD()->utils->date( $this->end )->addSeconds( $offset )->format( 'mysql' ) - : EDD()->utils->date( $this->end )->subSeconds( $offset )->format( 'mysql' ); - - $date_query_sql .= ' AND '; - } - - if ( ! empty( $this->end ) ) { - $date_query_sql .= $wpdb->prepare( "{$wpdb->edd_orders}.date_created <= %s", $this->end ); - } - } - - // Look in orders table if a product ID was not passed. - if ( 0 === $this->download_id ) { - $sql = " - SELECT COUNT(id) AS sales, SUM(total) AS earnings, date_created - FROM {$wpdb->edd_orders} - WHERE 1=1 {$status} {$customer_id} {$date_query_sql} - GROUP BY YEAR(date_created), MONTH(date_created), DAY(date_created) - ORDER BY YEAR(date_created), MONTH(date_created), DAY(date_created) ASC - LIMIT {$args['offset']}, {$args['number']} - "; - - // Join orders and order items table. - } else { - $sql = " - SELECT SUM({$wpdb->edd_order_items}.quantity) AS sales, SUM({$wpdb->edd_order_items}.total) AS earnings, {$wpdb->edd_orders}.date_created - FROM {$wpdb->edd_orders} - INNER JOIN {$wpdb->edd_order_items} ON {$wpdb->edd_orders}.id = {$wpdb->edd_order_items}.order_id - WHERE 1=1 {$status} {$download_id} {$date_query_sql} - GROUP BY YEAR({$wpdb->edd_orders}.date_created), MONTH({$wpdb->edd_orders}.date_created), DAY({$wpdb->edd_orders}.date_created) - ORDER BY YEAR({$wpdb->edd_orders}.date_created), MONTH({$wpdb->edd_orders}.date_created), DAY({$wpdb->edd_orders}.date_created) ASC - LIMIT {$args['offset']}, {$args['number']} - "; - } - - $results = $wpdb->get_results( $sql ); - - foreach ( $results as $result ) { - - // Localize the returned time. - $d = EDD()->utils->date( $result->date_created, null, true )->format( 'date' ); - - $sales = isset( $result->sales ) - ? absint( $result->sales ) - : 0; - - $earnings = isset( $result->earnings ) - ? edd_format_amount( $result->earnings ) - : floatval( 0 ); - - $data[] = array( - 'date' => $d, - 'sales' => $sales, - 'earnings' => $earnings, - ); - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return $data; - } - - /** - * Return the calculated completion percentage - * - * @since 2.4 - * @since 3.0 Updated to use new query methods. - * - * @return int - */ - public function get_percentage_complete() { - $args = array( - 'fields' => 'ids', - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_query'] = $this->get_date_query(); - } - - $total = edd_count_orders( $args ); - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( 30 * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the sales and earnings export. - * - * @since 3.0 - * - * @param array $request Form data passed to the batch processor. - */ - public function set_properties( $request ) { - $this->start = isset( $request['order-export-start'] ) - ? sanitize_text_field( $request['order-export-start'] ) - : ''; - - $this->end = isset( $request['order-export-end'] ) - ? sanitize_text_field( $request['order-export-end'] ) - : ''; - - $this->download_id = isset( $request['download_id'] ) - ? absint( $request['download_id'] ) - : 0; - - $this->customer_id = isset( $request['customer_id'] ) - ? absint( $request['customer_id'] ) - : 0; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-sales.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-sales.php deleted file mode 100644 index bf6b435f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-sales.php +++ /dev/null @@ -1,197 +0,0 @@ - __( 'Product ID', 'easy-digital-downloads' ), - 'user_id' => __( 'User', 'easy-digital-downloads' ), - 'customer_id' => __( 'Customer ID', 'easy-digital-downloads' ), - 'email' => __( 'Email', 'easy-digital-downloads' ), - 'name' => __( 'Name', 'easy-digital-downloads' ), - 'download' => edd_get_label_singular(), - 'quantity' => __( 'Quantity', 'easy-digital-downloads' ), - 'amount' => __( 'Item Amount', 'easy-digital-downloads' ), - 'currency' => __( 'Currency', 'easy-digital-downloads' ), - 'order_id' => __( 'Order ID', 'easy-digital-downloads' ), - 'price_id' => __( 'Price ID', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ), - ); - } - - /** - * Get the Export Data - * - * @since 2.7 - * @since 3.0 Updated to use new query methods. - * - * @return array|bool The data for the CSV file, false if no data to return. - */ - public function get_data() { - $data = array(); - - $args = array_merge( - $this->get_order_item_args(), - array( - 'number' => 30, - 'offset' => ( $this->step * 30 ) - 30, - 'order' => 'ASC' - ) - ); - - $items = edd_get_order_items( $args ); - - foreach ( $items as $item ) { - - if ( 'refunded' === $item->status ) { - continue; - } - - /** @var EDD\Orders\Order_Item $item */ - $order = edd_get_order( $item->order_id ); - - // If the item has been partially refunded, we need to calculate the amount - $amount = array_reduce( - $item->get_refunded_items(), - function( $total, $refund_item ) { - return $total + $refund_item->total; - }, - $item->total - ); - - $data[] = array( - 'ID' => $item->product_id, - 'user_id' => $order->user_id, - 'customer_id' => $order->customer_id, - 'email' => $order->email, - 'name' => edd_get_customer_field( $order->customer_id, 'name' ), - 'download' => $item->product_name, - 'quantity' => $item->quantity, - 'amount' => edd_format_amount( $amount ), - 'currency' => $order->currency, - 'order_id' => $order->id, - 'price_id' => $item->price_id, - 'date' => $order->date_created, - ); - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return ! empty( $data ) - ? $data - : false; - } - /** - * Return the calculated completion percentage. - * - * @since 2.7 - * @since 3.0 Updated to use new query methods. - * - * @return int - */ - public function get_percentage_complete() { - $args = $this->get_order_item_args(); - $total = edd_count_order_items( $args ); - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( 30 * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Gets the default order item parameters based on the class properties. - * - * @since 3.1.1.4 - * @return array - */ - private function get_order_item_args() { - $args = array(); - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_query'] = $this->get_date_query(); - } - - if ( ! empty( $this->download_id ) ) { - $args['product_id'] = $this->download_id; - } - - if ( ! empty( $this->orders ) ) { - $args['order_id__in'] = $this->orders; - } - - return $args; - } - - public function set_properties( $request ) { - $this->start = isset( $request['sales-export-start'] ) ? sanitize_text_field( $request['sales-export-start'] ) : ''; - $this->end = isset( $request['sales-export-end'] ) ? sanitize_text_field( $request['sales-export-end'] ) : ''; - $this->download_id = isset( $request['download_id'] ) ? absint( $request['download_id'] ) : 0; - $this->orders = $this->get_orders(); - } - - /** - * Gets the array of complete order IDs for the time period. - * - * @return array - */ - private function get_orders() { - $args = array( - 'fields' => 'ids', - 'type' => 'sale', - 'number' => 999999999, - 'status__in' => edd_get_complete_order_statuses(), - ); - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_query'] = $this->get_date_query(); - } - - return edd_get_orders( $args ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-taxed-customers.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-taxed-customers.php deleted file mode 100644 index 2ea4e1ad..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-taxed-customers.php +++ /dev/null @@ -1,183 +0,0 @@ - __( 'ID', 'easy-digital-downloads' ), - 'name' => __( 'Name', 'easy-digital-downloads' ), - 'email' => __( 'Email', 'easy-digital-downloads' ), - 'purchases' => __( 'Number of Purchases', 'easy-digital-downloads' ), - 'amount' => __( 'Customer Value', 'easy-digital-downloads' ), - ); - - return $cols; - } - - /** - * Get the export data. - * - * @since 3.0 - * - * @return array $data The data for the CSV file. - */ - public function get_data() { - $data = array(); - - $args = array( - 'number' => 30, - 'offset' => ( $this->step * 30 ) - 30, - 'status__in' => edd_get_complete_order_statuses(), - 'order' => 'ASC', - 'orderby' => 'date_created', - 'fields' => 'customer_id', - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_query'] = $this->get_date_query(); - } - - add_filter( 'edd_orders_query_clauses', array( $this, 'query_clauses' ), 10, 2 ); - - $customer_ids = edd_get_orders( $args ); - - remove_filter( 'edd_orders_query_clauses', array( $this, 'query_clauses' ), 10 ); - - $customer_ids = array_unique( $customer_ids ); - - asort( $customer_ids ); - - foreach ( $customer_ids as $customer_id ) { - - // Bail if a customer ID was not set. - if ( 0 === $customer_id ) { - continue; - } - - $customer = edd_get_customer( $customer_id ); - - // Bail if a customer record does not exist. - if ( ! $customer ) { - continue; - } - - $name = ! empty( $customer->name ) ? $customer->name : ''; - if ( preg_match( '~^[+\-=@]~m', $name ) ) { - $name = "'{$name}"; - } - - $data[] = array( - 'id' => $customer->id, - 'name' => $name, - 'email' => $customer->email, - 'purchases' => $customer->purchase_count, - 'amount' => edd_format_amount( $customer->purchase_value ), - ); - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return $data; - } - - /** - * Return the calculated completion percentage. - * - * @since 3.0 - * - * @return int - */ - public function get_percentage_complete() { - $args = array( - 'fields' => 'ids', - 'status__in' => edd_get_complete_order_statuses(), - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_query'] = $this->get_date_query(); - } - - add_filter( 'edd_orders_query_clauses', array( $this, 'query_clauses' ), 10, 2 ); - - $total = edd_count_orders( $args ); - - remove_filter( 'edd_orders_query_clauses', array( $this, 'query_clauses' ), 10 ); - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( 30 * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the taxed orders export. - * - * @since 3.0 - * - * @param array $request The form data passed into the batch processing. - */ - public function set_properties( $request ) { - $this->start = isset( $request['taxed-customers-export-start'] ) ? sanitize_text_field( $request['taxed-customers-export-start'] ) : ''; - $this->end = isset( $request['taxed-customers-export-end'] ) ? sanitize_text_field( $request['taxed-customers-export-end'] ) : ''; - } - - /** - * Filter the database query to only return orders which have tax applied to them. - * - * @since 3.0 - * - * @param array $clauses A compacted array of item query clauses. - * @param \EDD\Database\Query $base Instance passed by reference. - * - * @return array - */ - public function query_clauses( $clauses, $base ) { - $clauses['where'] = ! empty( $clauses['where'] ) - ? $clauses['where'] .= ' AND tax > 0' - : 'tax > 0'; - - return $clauses; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-taxed-orders.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-taxed-orders.php deleted file mode 100644 index 12151951..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export-taxed-orders.php +++ /dev/null @@ -1,307 +0,0 @@ - __( 'Order ID', 'easy-digital-downloads' ), // unaltered payment ID (use for querying) - 'seq_id' => __( 'Order Number', 'easy-digital-downloads' ), // sequential payment ID - 'email' => __( 'Email', 'easy-digital-downloads' ), - 'customer_id' => __( 'Customer ID', 'easy-digital-downloads' ), - 'first' => __( 'First Name', 'easy-digital-downloads' ), - 'last' => __( 'Last Name', 'easy-digital-downloads' ), - 'address1' => __( 'Address', 'easy-digital-downloads' ), - 'address2' => __( 'Address (Line 2)', 'easy-digital-downloads' ), - 'city' => __( 'City', 'easy-digital-downloads' ), - 'state' => __( 'State', 'easy-digital-downloads' ), - 'country' => __( 'Country', 'easy-digital-downloads' ), - 'zip' => __( 'Zip / Postal Code', 'easy-digital-downloads' ), - 'products' => __( 'Products (Verbose)', 'easy-digital-downloads' ), - 'products_raw' => __( 'Products (Raw)', 'easy-digital-downloads' ), - 'skus' => __( 'SKUs', 'easy-digital-downloads' ), - 'amount' => __( 'Amount', 'easy-digital-downloads' ) . ' (' . html_entity_decode( edd_currency_filter( '' ) ) . ')', - 'tax' => __( 'Tax', 'easy-digital-downloads' ) . ' (' . html_entity_decode( edd_currency_filter( '' ) ) . ')', - 'discount' => __( 'Discount Code', 'easy-digital-downloads' ), - 'gateway' => __( 'Gateway', 'easy-digital-downloads' ), - 'trans_id' => __( 'Transaction ID', 'easy-digital-downloads' ), - 'key' => __( 'Purchase Key', 'easy-digital-downloads' ), - 'date' => __( 'Date', 'easy-digital-downloads' ), - 'user' => __( 'User', 'easy-digital-downloads' ), - 'currency' => __( 'Currency', 'easy-digital-downloads' ), - 'ip' => __( 'IP Address', 'easy-digital-downloads' ), - 'mode' => __( 'Mode (Live|Test)', 'easy-digital-downloads' ), - 'status' => __( 'Status', 'easy-digital-downloads' ), - 'country_name' => __( 'Country Name', 'easy-digital-downloads' ), - ); - - if ( ! edd_use_skus() ) { - unset( $cols['skus'] ); - } - - if ( ! edd_get_option( 'enable_sequential' ) ) { - unset( $cols['seq_id'] ); - } - - return $cols; - } - - /** - * Get the export data. - * - * @since 3.0 - * - * @return array $data The data for the CSV file. - */ - public function get_data() { - $data = array(); - - $args = array( - 'number' => 30, - 'offset' => ( $this->step * 30 ) - 30, - 'status' => $this->status, - 'order' => 'ASC', - 'orderby' => 'date_created', - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_created_query'] = $this->get_date_query(); - } - - if ( in_array( $args['status'], array( 'any', 'all' ), true ) ) { - unset( $args['status'] ); - $args['status__not_in'] = array( 'trash' ); - } - - add_filter( 'edd_orders_query_clauses', array( $this, 'query_clauses' ), 10, 2 ); - - $orders = edd_get_orders( $args ); - - remove_filter( 'edd_orders_query_clauses', array( $this, 'query_clauses' ), 10 ); - - foreach ( $orders as $order ) { - /** @var EDD\Orders\Order $order */ - - $items = $order->get_items(); - $address = $order->get_address(); - $total = $order->total; - $user_id = $order->user_id; - $products = ''; - $products_raw = ''; - $skus = ''; - - $discounts = $order->get_discounts(); - $discounts = ! empty( $discounts ) - ? implode( ', ', $discounts ) - : __( 'none', 'easy-digital-downloads' ); - - foreach ( $items as $key => $item ) { - /** @var EDD\Orders\Order_Item $item */ - - // Setup item information. - $id = $item->product_id; - $qty = $item->quantity; - $price = $item->amount; - $tax = $item->tax; - $price_id = $item->price_id; - - // Set up verbose product column. - $products .= html_entity_decode( get_the_title( $id ) ); - - if ( $qty > 1 ) { - $products .= html_entity_decode( ' (' . $qty . ')' ); - } - - $products .= ' - '; - - if ( edd_use_skus() ) { - $sku = edd_get_download_sku( $id ); - - if ( ! empty( $sku ) ) { - $skus .= $sku; - } - } - - if ( 0 < $item->price_id ) { - $products .= html_entity_decode( edd_get_price_option_name( $id, $item->price_id, $order->id ) ) . ' - '; - } - - $products .= html_entity_decode( edd_currency_filter( edd_format_amount( $price ) ) ); - - if ( ( count( $items ) - 1 ) !== $key ) { - $products .= ' / '; - - if ( edd_use_skus() ) { - $skus .= ' / '; - } - } - - // Set up raw products column; nothing but product names. - $products_raw .= html_entity_decode( get_the_title( $id ) ) . '|' . $price . '{' . $tax . '}'; - - // If we have a price ID, include it. - if ( false !== $price_id ) { - $products_raw .= '{' . $price_id . '}'; - } - - if ( ( count( $items ) - 1 ) !== $key ) { - $products_raw .= ' / '; - } - } - - $user = is_numeric( $user_id ) - ? get_userdata( $user_id ) - : false; - - $data[] = array( - 'id' => $order->id, - 'seq_id' => $order->get_number(), - 'email' => $order->email, - 'customer_id' => $order->customer_id, - 'first' => $address->first_name, - 'last' => $address->last_name, - 'address1' => $address->address, - 'address2' => $address->address2, - 'city' => $address->city, - 'state' => $address->region, - 'country' => $address->country, - 'zip' => $address->postal_code, - 'products' => $products, - 'products_raw' => $products_raw, - 'skus' => $skus, - 'amount' => html_entity_decode( edd_format_amount( $total ) ), // The non-discounted item price - 'tax' => html_entity_decode( edd_format_amount( $order->tax ) ), - 'discount' => $discounts, - 'gateway' => edd_get_gateway_admin_label( $order->gateway ), - 'trans_id' => $order->get_transaction_id(), - 'key' => $order->payment_key, - 'date' => $order->date_created, - 'user' => $user ? $user->display_name : __( 'guest', 'easy-digital-downloads' ), - 'currency' => $order->currency, - 'ip' => $order->ip, - 'mode' => $order->mode, - 'status' => $order->status, - 'country_name' => isset( $user_info['address']['country'] ) ? edd_get_country_name( $user_info['address']['country'] ) : '', - ); - } - - $data = apply_filters( 'edd_export_get_data', $data ); - $data = apply_filters( 'edd_export_get_data_' . $this->export_type, $data ); - - return ! empty( $data ) - ? $data - : false; - } - - /** - * Return the calculated completion percentage. - * - * @since 3.0 - * - * @return int - */ - public function get_percentage_complete() { - $args = array( - 'fields' => 'ids', - 'status' => $this->status, - ); - - if ( ! empty( $this->start ) || ! empty( $this->end ) ) { - $args['date_created_query'] = $this->get_date_query(); - } - - if ( in_array( $args['status'], array( 'any', 'all' ), true ) ) { - unset( $args['status'] ); - } - - $total = edd_count_orders( $args ); - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( 30 * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the taxed orders export. - * - * @since 3.0 - * - * @param array $request The form data passed into the batch processing. - */ - public function set_properties( $request ) { - $this->start = isset( $request['taxed-orders-export-start'] ) ? sanitize_text_field( $request['taxed-orders-export-start'] ) : ''; - $this->end = isset( $request['taxed-orders-export-end'] ) ? sanitize_text_field( $request['taxed-orders-export-end'] ) : ''; - $this->status = isset( $request['status'] ) ? sanitize_text_field( $request['status'] ) : 'complete'; - $this->country = isset( $request['country'] ) ? sanitize_text_field( $request['country'] ) : ''; - $this->region = isset( $request['region'] ) ? sanitize_text_field( $request['region'] ) : ''; - } - - /** - * Filter the database query to only return orders which have tax applied to them. - * - * @since 3.0 - * - * @param array $clauses A compacted array of item query clauses. - * @param \EDD\Database\Query $base Instance passed by reference. - * - * @return array - */ - public function query_clauses( $clauses, $base ) { - global $wpdb; - - $clauses['where'] = ! empty( $clauses['where'] ) - ? $clauses['where'] .= ' AND edd_o.tax > 0' - : 'edd_o.tax > 0'; - - if ( ! empty( $this->country ) ) { - $clauses['join'] = " INNER JOIN {$wpdb->edd_order_addresses} edd_oa ON edd_o.id = edd_oa.order_id"; - $clauses['where'] .= $wpdb->prepare( ' AND edd_oa.country = %s', $this->country ); - } - - if ( ! empty( $this->region ) ) { - $clauses['where'] .= $wpdb->prepare( ' AND edd_oa.region = %s', $this->region ); - } - - return $clauses; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export.php deleted file mode 100644 index 9491cfb8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/class-batch-export.php +++ /dev/null @@ -1,349 +0,0 @@ -filetype = '.csv'; - $this->filename = 'edd-' . $this->export_type . $this->filetype; - $this->file = trailingslashit( $upload_dir['basedir'] ) . $this->filename; - - if ( ! is_writeable( $upload_dir['basedir'] ) ) { - $this->is_writable = false; - } - - $this->step = $_step; - $this->done = false; - } - - /** - * Process a step - * - * @since 2.4 - * @return bool - */ - public function process_step() { - - if ( ! $this->can_export() ) { - wp_die( __( 'You do not have permission to export data.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - if( $this->step < 2 ) { - - // Make sure we start with a fresh file on step 1 - if ( file_exists( $this->file ) ) { - unlink( $this->file ); - } - $this->print_csv_cols(); - } - - $rows = $this->print_csv_rows(); - - if( $rows ) { - return true; - } else { - return false; - } - } - - /** - * Output the CSV columns - * - * @since 2.4 - * @uses EDD_Export::get_csv_cols() - * @return string - */ - public function print_csv_cols() { - - $col_data = ''; - $cols = $this->get_csv_cols(); - $i = 1; - foreach( $cols as $col_id => $column ) { - $col_data .= '"' . addslashes( $column ) . '"'; - $col_data .= $i == count( $cols ) ? '' : ','; - $i++; - } - $col_data .= "\r\n"; - - $this->stash_step_data( $col_data ); - - return $col_data; - - } - - /** - * Print the CSV rows for the current step - * - * @since 2.4 - * @return string|false - */ - public function print_csv_rows() { - - $row_data = ''; - $data = $this->get_data(); - $cols = $this->get_csv_cols(); - - if( $data ) { - - // Output each row - foreach ( $data as $row ) { - $i = 1; - foreach ( $row as $col_id => $column ) { - // Make sure the column is valid - if ( array_key_exists( $col_id, $cols ) ) { - $row_data .= '"' . addslashes( preg_replace( "/\"/","'", $column ) ) . '"'; - $row_data .= $i == count( $cols ) ? '' : ','; - $i++; - } - } - $row_data .= "\r\n"; - } - - $this->stash_step_data( $row_data ); - - return $row_data; - } - - return false; - } - - /** - * Return the calculated completion percentage - * - * @since 2.4 - * @return int - */ - public function get_percentage_complete() { - return 100; - } - - /** - * Retrieve the file data is written to - * - * @since 2.4 - * @return string - */ - protected function get_file() { - - $file = ''; - - if ( @file_exists( $this->file ) ) { - - if ( ! is_writeable( $this->file ) ) { - $this->is_writable = false; - } - - $file = @file_get_contents( $this->file ); - - } else { - - @file_put_contents( $this->file, '' ); - @chmod( $this->file, 0664 ); - - } - - return $file; - } - - /** - * Append data to export file - * - * @since 2.4 - * @param $data string The data to add to the file - * @return void - */ - protected function stash_step_data( $data = '' ) { - - $file = $this->get_file(); - $file .= $data; - @file_put_contents( $this->file, $file ); - - // If we have no rows after this step, mark it as an empty export - $file_rows = file( $this->file, FILE_SKIP_EMPTY_LINES); - $default_cols = $this->get_csv_cols(); - $default_cols = empty( $default_cols ) ? 0 : 1; - - $this->is_empty = count( $file_rows ) == $default_cols ? true : false; - - } - - /** - * Perform the export - * - * @since 2.4 - * @return void - */ - public function export() { - - // Set headers - $this->headers(); - - $file = $this->get_file(); - - @unlink( $this->file ); - - echo $file; - - die(); - } - - /* - * Set the properties specific to the export - * - * @since 2.4.2 - * @param array $request The Form Data passed into the batch processing - */ - public function set_properties( $request ) {} - - /** - * Allow for prefetching of data for the remainder of the exporter - * - * @since 2.5 - * @return void - */ - public function pre_fetch() {} - - /** - * Gets the date query. - * - * @since 3.0 - * @return array - */ - protected function get_date_query() { - $date_query = array( - 'after' => '', - 'before' => '', - 'inclusive' => true, - ); - - if ( $this->start ) { - $start_date_string = EDD()->utils->get_date_string( $this->start ); - $date_query['after'] = edd_get_utc_date_string( $start_date_string ); - } - - if ( $this->end ) { - $end_date_string = EDD()->utils->get_date_string( $this->end, 23, 59, 59 ); - $date_query['before'] = edd_get_utc_date_string( $end_date_string ); - } - - return array( $date_query ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/export-actions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/export-actions.php deleted file mode 100644 index 26149fac..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/export-actions.php +++ /dev/null @@ -1,309 +0,0 @@ - 403 ) ); - } - - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php'; - do_action( 'edd_batch_export_class_include', $_REQUEST['class'] ); - - if ( class_exists( $_REQUEST['class'] ) && 'EDD_Batch_Export' === get_parent_class( $_REQUEST['class'] ) ) { - $export = new $_REQUEST['class'](); - $export->export(); - } -} -add_action( 'edd_download_batch_export', 'edd_process_batch_export_download' ); - -/** - * Export all the customers to a CSV file. - * - * Note: The WordPress Database API is being used directly for performance - * reasons (workaround of calling all posts and fetch data respectively) - * - * @since 1.4.4 - * @return void - */ -function edd_export_all_customers() { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/class-export-customers.php'; - - $customer_export = new EDD_Customers_Export(); - - $customer_export->export(); -} -add_action( 'edd_email_export', 'edd_export_all_customers' ); - -/** - * Exports all the downloads to a CSV file using the EDD_Export class. - * - * @since 1.4.4 - * @return void - */ -function edd_export_all_downloads_history() { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/class-export-download-history.php'; - - $file_download_export = new EDD_Download_History_Export(); - - $file_download_export->export(); -} -add_action( 'edd_downloads_history_export', 'edd_export_all_downloads_history' ); - -/** - * Add a hook allowing extensions to register a hook on the batch export process - * - * @since 2.4.2 - * @return void - */ -function edd_register_batch_exporters() { - if ( is_admin() ) { - do_action( 'edd_register_batch_exporter' ); - } -} -add_action( 'plugins_loaded', 'edd_register_batch_exporters', 99 ); - -/** - * Register the payments batch exporter - * @since 2.4.2 - */ -function edd_register_payments_batch_export() { - add_action( 'edd_batch_export_class_include', 'edd_include_payments_batch_processor', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_payments_batch_export', 10 ); - -/** - * Loads the payments batch processor if needed. - * - * @since 2.4.2 - * - * @param string $class The class being requested to run for the batch export - */ -function edd_include_payments_batch_processor( $class ) { - if ( 'EDD_Batch_Payments_Export' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-payments.php'; - } -} - -/** - * Register the customers batch exporter. - * - * @since 2.4.2 - */ -function edd_register_customers_batch_export() { - add_action( 'edd_batch_export_class_include', 'edd_include_customers_batch_processor', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_customers_batch_export', 10 ); - -/** - * Loads the customers batch processor if needed. - * - * @since 2.4.2 - * - * @param string $class The class being requested to run for the batch export. - */ -function edd_include_customers_batch_processor( $class ) { - if ( 'EDD_Batch_Customers_Export' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-customers.php'; - } -} - -/** - * Register the download products batch exporter - * - * @since 2.5 - */ -function edd_register_downloads_batch_export() { - add_action( 'edd_batch_export_class_include', 'edd_include_downloads_batch_processor', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_downloads_batch_export', 10 ); - -/** - * Loads the file downloads batch process if needed - * - * @since 2.5 - * @param string $class The class being requested to run for the batch export - * @return void - */ -function edd_include_downloads_batch_processor( $class ) { - if ( 'EDD_Batch_Downloads_Export' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-downloads.php'; - } -} - -/** - * Register the file downloads batch exporter - * @since 2.4.2 - */ -function edd_register_file_downloads_batch_export() { - add_action( 'edd_batch_export_class_include', 'edd_include_file_downloads_batch_processor', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_file_downloads_batch_export', 10 ); - -/** - * Loads the file downloads batch process if needed - * - * @since 2.4.2 - * @param string $class The class being requested to run for the batch export - * @return void - */ -function edd_include_file_downloads_batch_processor( $class ) { - if ( 'EDD_Batch_File_Downloads_Export' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-file-downloads.php'; - } -} - -/** - * Register the sales batch exporter. - * - * @since 2.7 - */ -function edd_register_sales_export_batch_export() { - add_action( 'edd_batch_export_class_include', 'edd_include_sales_export_batch_processor', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_sales_export_batch_export', 10 ); - -/** - * Loads the sales export batch process if needed - * - * @since 2.7 - * @param string $class The class being requested to run for the batch export - * @return void - */ -function edd_include_sales_export_batch_processor( $class ) { - if ( 'EDD_Batch_Sales_Export' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-sales.php'; - } -} - -/** - * Register the earnings report batch exporter - * - * @since 2.7 - */ -function edd_register_earnings_report_batch_export() { - add_action( 'edd_batch_export_class_include', 'edd_include_earnings_report_batch_processor', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_earnings_report_batch_export', 10 ); - -/** - * Loads the earnings report batch process if needed - * - * @since 2.7 - * @param string $class The class being requested to run for the batch export - * @return void - */ -function edd_include_earnings_report_batch_processor( $class ) { - if ( 'EDD_Batch_Earnings_Report_Export' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-earnings-report.php'; - } -} - -/** - * Register the API requests batch exporter - * - * @since 2.7 - */ -function edd_register_api_requests_batch_export() { - add_action( 'edd_batch_export_class_include', 'edd_include_api_requests_batch_processor', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_api_requests_batch_export', 10 ); - -/** - * Loads the API requests batch process if needed - * - * @since 2.7 - * @param string $class The class being requested to run for the batch export - * @return void - */ -function edd_include_api_requests_batch_processor( $class ) { - if ( 'EDD_Batch_API_Requests_Export' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-api-requests.php'; - } -} - -/** - * Register the taxed orders report batch exporter. - * - * @since 3.0 - */ -function edd_register_taxed_orders_batch_export() { - add_action( 'edd_batch_export_class_include', 'edd_include_taxed_orders_batch_processor', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_taxed_orders_batch_export', 10 ); - -/** - * Loads the taxed orders report batch process if needed. - * - * @since 3.0 - * - * @param string $class The class being requested to run for the batch export - */ -function edd_include_taxed_orders_batch_processor( $class ) { - if ( 'EDD_Batch_Taxed_Orders_Export' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-taxed-orders.php'; - } -} - -/** - * Register the taxed orders report batch exporter. - * - * @since 3.0 - */ -function edd_register_taxed_customers_batch_export() { - add_action( 'edd_batch_export_class_include', 'edd_include_taxed_customers_batch_processor', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_taxed_customers_batch_export', 10 ); - -/** - * Loads the taxed customers report batch process if needed. - * - * @since 3.0 - * - * @param string $class The class being requested to run for the batch export - */ -function edd_include_taxed_customers_batch_processor( $class ) { - if ( 'EDD_Batch_Taxed_Customers_Export' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-taxed-customers.php'; - } -} - -/** - * Register the sales and earnings report batch exporter. - * - * @since 3.0 - */ -function edd_register_sales_and_earnings_batch_export() { - add_action( 'edd_batch_export_class_include', 'edd_include_sales_and_earnings_batch_processor', 10, 1 ); -} -add_action( 'edd_register_batch_exporter', 'edd_register_sales_and_earnings_batch_export', 10 ); - -/** - * Loads the sales and earnings batch process if needed. - * - * @since 3.0 - * - * @param string $class The class being requested to run for the batch export - */ -function edd_include_sales_and_earnings_batch_processor( $class ) { - if ( 'EDD_Batch_Sales_And_Earnings_Export' === $class ) { - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-sales-and-earnings.php'; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/export-functions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/export-functions.php deleted file mode 100644 index 61f9489b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/export/export-functions.php +++ /dev/null @@ -1,112 +0,0 @@ -can_export() ) { - die( '-1' ); - } - - if ( ! $export->is_writable ) { - echo wp_json_encode( array( - 'error' => true, - 'message' => __( 'Export location or file not writable', 'easy-digital-downloads' ), - )); - - exit; - } - - $export->set_properties( $_REQUEST ); - - // Added in 2.5 to allow a bulk processor to pre-fetch some data to speed up the remaining steps and cache data. - $export->pre_fetch(); - - $ret = $export->process_step(); - - $percentage = $export->get_percentage_complete(); - - if ( $ret ) { - $step++; - - echo wp_json_encode( array( - 'step' => absint( $step ), - 'percentage' => esc_attr( $percentage ), - ) ); - - exit; - } elseif ( true === $export->is_empty ) { - echo wp_json_encode( array( - 'error' => true, - 'message' => __( 'No data found for export parameters', 'easy-digital-downloads' ), - ) ); - - exit; - } elseif ( true === $export->done && true === $export->is_void ) { - $message = ! empty( $export->message ) - ? $export->message - : __( 'Batch Processing Complete', 'easy-digital-downloads' ); - - echo wp_json_encode( array( - 'success' => true, - 'message' => $message, - 'data' => $export->result_data, - ) ); - - exit; - } else { - $args = array_merge( $_REQUEST, array( - 'step' => absint( $step ), - 'class' => urlencode( $class ), - 'nonce' => wp_create_nonce( 'edd-batch-export' ), - 'edd_action' => 'download_batch_export', - ) ); - - $download_url = add_query_arg( $args, admin_url() ); - - echo wp_json_encode( array( - 'step' => 'done', - 'url' => esc_url_raw( $download_url ), - ) ); - - exit; - } -} -add_action( 'wp_ajax_edd_do_ajax_export', 'edd_do_ajax_export' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/graphing.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/graphing.php deleted file mode 100644 index 9fe27382..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/graphing.php +++ /dev/null @@ -1,775 +0,0 @@ -month; - - $i = 0; - $j = 0; - - $start = $dates['start']->format( 'Y-m-d' ); - $end = $dates['end']->format( 'Y-m-d' ); - - $sales = EDD()->payment_stats->get_sales_by_range( $dates['range'], true, $start, $end ); - $earnings = EDD()->payment_stats->get_earnings_by_range( $dates['range'], true, $start, $end, $include_taxes ); - - while ( $hour <= 23 ) { - $date = mktime( $hour, 0, 0, $month, $dates['start']->day, $dates['start']->year ) * 1000; - - if ( isset( $earnings[ $i ] ) && $earnings[ $i ]['h'] == $hour ) { - $earnings_data[] = array( $date, $earnings[ $i ]['total'] ); - $earnings_totals += $earnings[ $i ]['total']; - $i++; - } else { - $earnings_data[] = array( $date, 0 ); - } - - if ( isset( $sales[ $j ] ) && $sales[ $j ]['h'] == $hour ) { - $sales_data[] = array( $date, $sales[ $j ]['count'] ); - $sales_totals += $sales[ $j ]['count']; - $j++; - } else { - $sales_data[] = array( $date, 0 ); - } - - $hour++; - } - } elseif ( $dates['range'] == 'this_week' || $dates['range'] == 'last_week' ) { - $report_dates = array(); - $i = 0; - while ( $i <= 6 ) { - if ( ( $dates['start']->day + $i ) <= $dates['end']->day ) { - $report_dates[ $i ] = array( - 'day' => (string) $dates['start']->day + $i, - 'month' => $dates['start']->month, - 'year' => $dates['start']->year, - ); - } else { - $report_dates[ $i ] = array( - 'day' => (string) $i, - 'month' => $dates['end']->month, - 'year' => $dates['end']->year, - ); - } - - $i++; - } - - $start_date = $report_dates[0]; - $end_date = end( $report_dates ); - - $sales = EDD()->payment_stats->get_sales_by_range( $dates['range'], true, $start_date['year'] . '-' . $start_date['month'] . '-' . $start_date['day'], $end_date['year'] . '-' . $end_date['month'] . '-' . $end_date['day'] ); - $earnings = EDD()->payment_stats->get_earnings_by_range( $dates['range'], true, $start_date['year'] . '-' . $start_date['month'] . '-' . $start_date['day'], $end_date['year'] . '-' . $end_date['month'] . '-' . $end_date['day'], $include_taxes ); - - $i = 0; - $j = 0; - foreach ( $report_dates as $report_date ) { - $date = mktime( 0, 0, 0, $report_date['month'], $report_date['day'], $report_date['year'] ) * 1000; - - if ( array_key_exists( $i, $sales ) && $report_date['day'] == $sales[ $i ]['d'] && $report_date['month'] == $sales[ $i ]['m'] && $report_date['year'] == $sales[ $i ]['y'] ) { - $sales_data[] = array( $date, $sales[ $i ]['count'] ); - $sales_totals += $sales[ $i ]['count']; - $i++; - } else { - $sales_data[] = array( $date, 0 ); - } - - if ( array_key_exists( $j, $earnings ) && $report_date['day'] == $earnings[ $j ]['d'] && $report_date['month'] == $earnings[ $j ]['m'] && $report_date['year'] == $earnings[ $j ]['y'] ) { - $earnings_data[] = array( $date, $earnings[ $j ]['total'] ); - $earnings_totals += $earnings[ $j ]['total']; - $j++; - } else { - $earnings_data[] = array( $date, 0 ); - } - } - - } else { - $date_start = $dates['start']->format( 'Y-m-d' ); - $date_end = $dates['end']->format( 'Y-m-d' ); - - $sales = EDD()->payment_stats->get_sales_by_range( $dates['range'], $day_by_day, $date_start, $date_end ); - $earnings = EDD()->payment_stats->get_earnings_by_range( $dates['range'], $day_by_day, $date_start, $date_end, $include_taxes ); - - $temp_data = array( - 'sales' => array(), - 'earnings' => array(), - ); - - foreach ( $sales as $sale ) { - if ( $day_by_day ) { - $temp_data['sales'][ $sale['y'] ][ $sale['m'] ][ $sale['d'] ] = $sale['count']; - } else { - $temp_data['sales'][ $sale['y'] ][ $sale['m'] ] = $sale['count']; - } - $sales_totals += $sale['count']; - } - - foreach ( $earnings as $earning ) { - if ( $day_by_day ) { - $temp_data['earnings'][ $earning['y'] ][ $earning['m'] ][ $earning['d'] ] = $earning['total']; - } else { - $temp_data['earnings'][ $earning['y'] ][ $earning['m'] ] = $earning['total']; - } - $earnings_totals += $earning['total']; - } - - while ( $day_by_day && ( strtotime( $date_start ) <= strtotime( $date_end ) ) ) { - $d = $dates['start']->day; - $m = $dates['start']->month; - $y = $dates['start']->year; - - if ( ! isset( $temp_data['sales'][ $y ][ $m ][ $d ] ) ) { - $temp_data['sales'][ $y ][ $m ][ $d ] = 0; - } - - if ( ! isset( $temp_data['earnings'][ $y ][ $m ][ $d ] ) ) { - $temp_data['earnings'][ $y ][ $m ][ $d ] = 0; - } - - $date_start = $dates['start']->addDays( 1 )->format( 'Y-m-d' ); - } - - while ( ! $day_by_day && ( strtotime( $date_start ) <= strtotime( $date_end ) ) ) { - $m = $dates['start']->month; - $y = $dates['start']->year; - - if ( ! isset( $temp_data['sales'][ $y ][ $m ] ) ) { - $temp_data['sales'][ $y ][ $m ] = 0; - } - - if ( ! isset( $temp_data['earnings'][ $y ][ $m ] ) ) { - $temp_data['earnings'][ $y ][ $m ] = 0; - } - - $date_start = $dates['start']->addMonths( 1 )->format( 'Y-m' ); - } - - $sales_data = array(); - $earnings_data = array(); - - // When using 3 months or smaller as the custom range, show each day individually on the graph - if ( $day_by_day ) { - foreach ( $temp_data['sales'] as $year => $months ) { - foreach ( $months as $month => $days ) { - foreach ( $days as $day => $count ) { - $date = mktime( 0, 0, 0, $month, $day, $year ) * 1000; - $sales_data[] = array( $date, $count ); - } - } - } - - foreach ( $temp_data['earnings'] as $year => $months ) { - foreach ( $months as $month => $days ) { - foreach ( $days as $day => $total ) { - $date = mktime( 0, 0, 0, $month, $day, $year ) * 1000; - $earnings_data[] = array( $date, $total ); - } - } - } - - // Sort dates in ascending order - foreach ( $sales_data as $key => $value ) { - $timestamps[ $key ] = $value[0]; - } - if ( ! empty( $timestamps ) ) { - array_multisort( $timestamps, SORT_ASC, $sales_data ); - } - - foreach ( $earnings_data as $key => $value ) { - $earnings_timestamps[ $key ] = $value[0]; - } - if ( ! empty( $earnings_timestamps ) ) { - array_multisort( $earnings_timestamps, SORT_ASC, $earnings_data ); - } - - // When showing more than 3 months of results, group them by month, by the first (except for the last month, group on the last day of the month selected) - } else { - - foreach ( $temp_data['sales'] as $year => $months ) { - $month_keys = array_keys( $months ); - $last_month = end( $month_keys ); - - if ( $day_by_day ) { - foreach ( $months as $month => $days ) { - $day_keys = array_keys( $days ); - $last_day = end( $day_keys ); - - $month_keys = array_keys( $months ); - - $consolidated_date = $month === end( $month_keys ) ? cal_days_in_month( CAL_GREGORIAN, $month, $year ) : 1; - - $sales = array_sum( $days ); - $date = mktime( 0, 0, 0, $month, $consolidated_date, $year ) * 1000; - $sales_data[] = array( $date, $sales ); - } - } else { - foreach ( $months as $month => $count ) { - $month_keys = array_keys( $months ); - $consolidated_date = $month === end( $month_keys ) ? cal_days_in_month( CAL_GREGORIAN, $month, $year ) : 1; - - $date = mktime( 0, 0, 0, $month, $consolidated_date, $year ) * 1000; - $sales_data[] = array( $date, $count ); - } - } - } - - // Sort dates in ascending order - foreach ( $sales_data as $key => $value ) { - $timestamps[ $key ] = $value[0]; - } - if ( ! empty( $timestamps ) ) { - array_multisort( $timestamps, SORT_ASC, $sales_data ); - } - - foreach ( $temp_data['earnings'] as $year => $months ) { - $month_keys = array_keys( $months ); - $last_month = end( $month_keys ); - - if ( $day_by_day ) { - foreach ( $months as $month => $days ) { - $day_keys = array_keys( $days ); - $last_day = end( $day_keys ); - - $month_keys = array_keys( $months ); - - $consolidated_date = $month === end( $month_keys ) - ? cal_days_in_month( CAL_GREGORIAN, $month, $year ) - : 1; - - $earnings = array_sum( $days ); - $date = mktime( 0, 0, 0, $month, $consolidated_date, $year ) * 1000; - $earnings_data[] = array( $date, $earnings ); - } - } else { - foreach ( $months as $month => $count ) { - $month_keys = array_keys( $months ); - $consolidated_date = $month === end( $month_keys ) - ? cal_days_in_month( CAL_GREGORIAN, $month, $year ) - : 1; - - $date = mktime( 0, 0, 0, $month, $consolidated_date, $year ) * 1000; - $earnings_data[] = array( $date, $count ); - } - } - } - - // Sort dates in ascending order - foreach ( $earnings_data as $key => $value ) { - $earnings_timestamps[ $key ] = $value[0]; - } - if ( ! empty( $earnings_timestamps ) ) { - array_multisort( $earnings_timestamps, SORT_ASC, $earnings_data ); - } - } - } - - $data = array( - __( 'Earnings', 'easy-digital-downloads' ) => $earnings_data, - __( 'Sales', 'easy-digital-downloads' ) => $sales_data - ); - - // start our own output buffer - ob_start(); - - do_action( 'edd_reports_graph_before' ); ?> - -
    -
    -
    -

    - -
    - set( 'x_mode', 'time' ); - $graph->set( 'multiple_y_axes', true ); - $graph->display(); - - if( ! empty( $dates['range'] ) && 'this_month' == $dates['range'] ) { - $estimated = edd_estimated_monthly_stats( $include_taxes ); - } - ?> - -

    - - - - - - -

    -

    - - -

    - - - - - - -

    -

    - - - - -

    - - - -

    -
    -
    -
    -
    - - = 3 || ( $dates['year_end'] > $dates['year'] && ( $dates['m_start'] - $dates['m_end'] ) != 10 ) ) { - $day_by_day = false; - } else { - $day_by_day = true; - } - break; - default: - $day_by_day = true; - break; - } - - $earnings_totals = (float) 0.00; // Total earnings for time period shown - $sales_totals = 0; // Total sales for time period shown - - $include_taxes = empty( $_GET['exclude_taxes'] ) ? true : false; - $earnings_data = array(); - $sales_data = array(); - - if ( $dates['range'] == 'today' || $dates['range'] == 'yesterday' ) { - // Hour by hour - $month = $dates['m_start']; - $hour = 0; - $minute = 0; - $second = 0; - while ( $hour <= 23 ) : - if ( $hour == 23 ) { - $minute = $second = 59; - } - - $date = mktime( $hour, $minute, $second, $month, $dates['day'], $dates['year'] ); - $date_end = mktime( $hour + 1, $minute, $second, $month, $dates['day'], $dates['year'] ); - - $sales = EDD()->payment_stats->get_sales( $download_id, $date, $date_end ); - $sales_totals += $sales; - - $earnings = EDD()->payment_stats->get_earnings( $download_id, $date, $date_end, $include_taxes ); - $earnings_totals += $earnings; - - $sales_data[] = array( $date * 1000, $sales ); - $earnings_data[] = array( $date * 1000, $earnings ); - - $hour++; - endwhile; - } elseif( $dates['range'] == 'this_week' || $dates['range'] == 'last_week' ) { - $num_of_days = cal_days_in_month( CAL_GREGORIAN, $dates['m_start'], $dates['year'] ); - - $report_dates = array(); - $i = 0; - while ( $i <= 6 ) { - if ( ( $dates['day'] + $i ) <= $num_of_days ) { - $report_dates[ $i ] = array( - 'day' => (string) $dates['day'] + $i, - 'month' => $dates['m_start'], - 'year' => $dates['year'], - ); - } else { - $report_dates[ $i ] = array( - 'day' => (string) $i, - 'month' => $dates['m_end'], - 'year' => $dates['year_end'], - ); - } - - $i++; - } - - foreach ( $report_dates as $report_date ) { - $date = mktime( 0, 0, 0, $report_date['month'], $report_date['day'], $report_date['year'] ); - $date_end = mktime( 23, 59, 59, $report_date['month'], $report_date['day'], $report_date['year'] ); - $sales = EDD()->payment_stats->get_sales( $download_id, $date, $date_end ); - $sales_totals += $sales; - - $earnings = EDD()->payment_stats->get_earnings( $download_id, $date, $date_end, $include_taxes ); - $earnings_totals += $earnings; - - $sales_data[] = array( $date * 1000, $sales ); - $earnings_data[] = array( $date * 1000, $earnings ); - } - } else { - $y = $dates['year']; - $temp_data = array(); - - while( $y <= $dates['year_end'] ) { - - $last_year = false; - - if( $dates['year'] == $dates['year_end'] ) { - $month_start = $dates['m_start']; - $month_end = $dates['m_end']; - $last_year = true; - } elseif( $y == $dates['year'] ) { - $month_start = $dates['m_start']; - $month_end = 12; - } elseif ( $y == $dates['year_end'] ) { - $month_start = 1; - $month_end = $dates['m_end']; - } else { - $month_start = 1; - $month_end = 12; - } - - $i = $month_start; - while ( $i <= $month_end ) { - $d = $dates['day']; - - if ( $i == $month_end ) { - $num_of_days = $dates['day_end']; - - if ( $month_start < $month_end ) { - $d = 1; - } - } elseif ( $i > $month_start && $i < $month_end ) { - $num_of_days = cal_days_in_month( CAL_GREGORIAN, $i, $y ); - $d = 1; - } else { - $num_of_days = cal_days_in_month( CAL_GREGORIAN, $i, $y ); - } - - while ( $d <= $num_of_days ) { - $date = mktime( 0, 0, 0, $i, $d, $y ); - $end_date = mktime( 23, 59, 59, $i, $d, $y ); - - $earnings = EDD()->payment_stats->get_earnings( $download_id, $date, $end_date, $include_taxes ); - $earnings_totals += $earnings; - - $sales = EDD()->payment_stats->get_sales( $download_id, $date, $end_date ); - $sales_totals += $sales; - - $temp_data['earnings'][ $y ][ $i ][ $d ] = $earnings; - $temp_data['sales'][ $y ][ $i ][ $d ] = $sales; - - $d++; - } - - $i++; - } - - $y++; - } - - $sales_data = array(); - $earnings_data = array(); - - // When using 2 months or smaller as the custom range, show each day individually on the graph - if ( $day_by_day ) { - foreach ( $temp_data[ 'sales' ] as $year => $months ) { - foreach( $months as $month => $dates ) { - foreach ( $dates as $day => $sales ) { - $date = mktime( 0, 0, 0, $month, $day, $year ) * 1000; - $sales_data[] = array( $date, $sales ); - } - } - } - - foreach ( $temp_data[ 'earnings' ] as $year => $months ) { - foreach( $months as $month => $dates ) { - foreach ( $dates as $day => $earnings ) { - $date = mktime( 0, 0, 0, $month, $day, $year ) * 1000; - $earnings_data[] = array( $date, $earnings ); - } - } - } - - // When showing more than 2 months of results, group them by month, by the first (except for the last month, group on the last day of the month selected) - } else { - foreach ( $temp_data[ 'sales' ] as $year => $months ) { - $month_keys = array_keys( $months ); - $last_month = end( $month_keys ); - - foreach ( $months as $month => $days ) { - $day_keys = array_keys( $days ); - $last_day = end( $day_keys ); - - $consolidated_date = $month === $last_month ? $last_day : 1; - - $sales = array_sum( $days ); - $date = mktime( 0, 0, 0, $month, $consolidated_date, $year ) * 1000; - $sales_data[] = array( $date, $sales ); - } - } - - foreach ( $temp_data[ 'earnings' ] as $year => $months ) { - $month_keys = array_keys( $months ); - $last_month = end( $month_keys ); - - foreach ( $months as $month => $days ) { - $day_keys = array_keys( $days ); - $last_day = end( $day_keys ); - - $consolidated_date = $month === $last_month ? $last_day : 1; - - $earnings = array_sum( $days ); - $date = mktime( 0, 0, 0, $month, $consolidated_date, $year ) * 1000; - $earnings_data[] = array( $date, $earnings ); - } - } - } - } - - $data = array( - __( 'Earnings', 'easy-digital-downloads' ) => $earnings_data, - __( 'Sales', 'easy-digital-downloads' ) => $sales_data - ); - - ?> -
    -
    -

    - -
    - set( 'x_mode', 'time' ); - $graph->set( 'multiple_y_axes', true ); - $graph->display(); - ?> -

    -

    -

    -

    -

    -
    -
    - 'edd-reports', - ) ); - - $filter_args = array(); - - // Parse and validate filters. - foreach ( $filters as $filter => $attributes ) { - - switch ( $filter ) { - - case 'dates': - if ( ! empty( $form_data['range'] ) ) { - $range = sanitize_key( $form_data['range'] ); - $relative_range = sanitize_key( $form_data['relative_range'] ); - } else { - $range = Reports\get_dates_filter_range(); - $relative_range = Reports\get_relative_dates_filter_range(); - } - - if ( 'other' === $range ) { - try { - /* - * This validates the input dates before saving. If they're not valid, an exception - * will be thrown. - */ - EDD()->utils->date( $form_data['filter_from'] ); - EDD()->utils->date( $form_data['filter_to'] ); - } catch ( \Exception $e ) { - wp_die( - esc_html__( 'Invalid date format. Please enter a date in the format: YYYY-mm-dd.', 'easy-digital-downloads' ), - esc_html__( 'Invalid Date Error', 'easy-digital-downloads' ), - array( 'response' => 400, 'back_link' => true ) - ); - } - - $filter_args = array_merge( - array( - 'filter_from' => ! empty( $form_data['filter_from'] ) - ? sanitize_text_field( $form_data['filter_from'] ) - : '', - 'filter_to' => ! empty( $form_data['filter_to'] ) - ? sanitize_text_field( $form_data['filter_to'] ) - : '', - 'range' => 'other', - 'relative_range' => 'previous_period', - ), - $filter_args - ); - - } else { - - $dates = Reports\parse_dates_for_range( $range ); - - $filter_args = array_merge( - array( - 'filter_from' => $dates['start']->format( 'date-mysql' ), - 'filter_to' => $dates['end']->format( 'date-mysql' ), - 'range' => $range, - 'relative_range' => $relative_range, - ), - $filter_args - ); - - } - break; - - case 'taxes': - $filter_args = array_merge( - array( - 'exclude_taxes' => isset( $form_data['exclude_taxes'] ), - ), - $filter_args - ); - - break; - - default: - $filter_arg = isset( $form_data[ $filter ] ) - ? $form_data[ $filter ] - : array(); - - if ( ! empty( $filter_arg ) ) { - $filter_args[ $filter ] = $filter_arg; - } - - break; - } - } - - // Redirect back to report. - $redirect = add_query_arg( $filter_args, $redirect ); - - edd_redirect( $redirect ); -} -add_action( 'edd_filter_reports', 'edd_parse_report_dates' ); - -/** - * EDD Reports Refresh Button - * @since 2.7 - * @description: Outputs a "Refresh Reports" button for graphs - */ -function edd_reports_refresh_button() { - - $url = wp_nonce_url( add_query_arg( array( - 'edd_action' => 'refresh_reports_transients', - 'edd-message' => 'refreshed-reports' - ) ), 'edd-refresh-reports' ); - - echo '' . esc_html__( 'Refresh Reports', 'easy-digital-downloads' ) . ''; -} - -add_action( 'edd_reports_graph_after', 'edd_reports_refresh_button' ); - -/** - * EDD trigger the refresh of reports transients - * - * @since 2.7 - * - * @param array $data Parameters sent from Settings page - * @return void - */ -function edd_run_refresh_reports_transients( $data ) { - if ( ! wp_verify_nonce( $data['_wpnonce'], 'edd-refresh-reports' ) ) { - return; - } - - // Delete transients - delete_transient( 'edd_stats_earnings' ); - delete_transient( 'edd_stats_sales' ); - delete_transient( 'edd_estimated_monthly_stats' ); - delete_transient( 'edd_earnings_total' ); - delete_transient( md5( 'edd_earnings_this_monththis_month' ) ); - delete_transient( md5( 'edd_earnings_todaytoday' ) ); -} -add_action( 'edd_refresh_reports_transients', 'edd_run_refresh_reports_transients' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/logs.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/logs.php deleted file mode 100644 index 761c02a4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/logs.php +++ /dev/null @@ -1,23 +0,0 @@ -prepare( " AND currency = %s ", strtoupper( $currency ) ); - } - - // Revenue calculations should include gross statuses to negate refunds properly. - $statuses = edd_get_gross_order_statuses(); - $statuses = apply_filters( 'edd_payment_stats_post_statuses', $statuses ); - $statuses = "'" . implode( "', '", $statuses ) . "'"; - - $earnings_results = $wpdb->get_results( - $wpdb->prepare( - "SELECT SUM({$column}) AS earnings, {$sql_clauses['select']} - FROM {$wpdb->edd_orders} edd_o - WHERE date_created >= %s AND date_created <= %s - AND status IN( {$statuses} ) - AND type IN ( 'sale', 'refund' ) - {$sql_clauses['where']} - GROUP BY {$sql_clauses['groupby']} - ORDER BY {$sql_clauses['orderby']} ASC", - $dates['start']->copy()->format( 'mysql' ), - $dates['end']->copy()->format( 'mysql' ) - ) - ); - - // Sales counts should count by 'net' statuses, which excludes refunds. - $statuses = edd_get_net_order_statuses(); - $statuses = apply_filters( 'edd_payment_stats_post_statuses', $statuses ); - $statuses = "'" . implode( "', '", $statuses ) . "'"; - - $sales_results = $wpdb->get_results( - $wpdb->prepare( - "SELECT COUNT(*) AS sales, {$sql_clauses['select']} - FROM {$wpdb->edd_orders} edd_o - WHERE date_created >= %s AND date_created <= %s - AND status IN( {$statuses} ) - AND type = 'sale' - {$sql_clauses['where']} - GROUP BY {$sql_clauses['groupby']} - ORDER BY {$sql_clauses['orderby']} ASC", - $dates['start']->copy()->format( 'mysql' ), - $dates['end']->copy()->format( 'mysql' ) - ) - ); - - $sales = array(); - $earnings = array(); - - /** - * Initialise all arrays with timestamps and set values to 0. - * - * We use the Chart based dates for this loop, so the graph shows in the proper date ranges while the actual DB queries are all UTC based. - */ - while ( strtotime( $chart_dates['start']->copy()->format( 'mysql' ) ) <= strtotime( $chart_dates['end']->copy()->format( 'mysql' ) ) ) { - $timestamp = $chart_dates['start']->copy()->format( 'U' ); - $date_on_chart = $chart_dates['start']; - - $sales[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $sales[ $timestamp ][1] = 0; - - $earnings[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $earnings[ $timestamp ][1] = 0.00; - - // Loop through each date there were sales/earnings, which we queried from the database. - foreach ( $earnings_results as $earnings_result ) { - $date_of_db_value = EDD()->utils->date( $earnings_result->date ); - - // Add any sales/earnings that happened during this hour. - if ( 'hour' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d H' ) === $date_on_chart->format( 'Y-m-d H' ) ) { - $earnings[ $timestamp ][1] += $earnings_result->earnings; - } - // Add any sales/earnings that happened during this day. - } elseif ( 'day' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d' ) === $date_on_chart->format( 'Y-m-d' ) ) { - $earnings[ $timestamp ][1] += $earnings_result->earnings; - } - // Add any sales/earnings that happened during this month. - } else { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m' ) === $date_on_chart->format( 'Y-m' ) ) { - $earnings[ $timestamp ][1] += $earnings_result->earnings; - } - } - } - - // Loop through each date there were sales/earnings, which we queried from the database. - foreach ( $sales_results as $sales_result ) { - $date_of_db_value = EDD()->utils->date( $sales_result->date ); - - // Add any sales/earnings that happened during this hour. - if ( 'hour' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d H' ) === $date_on_chart->format( 'Y-m-d H' ) ) { - $sales[ $timestamp ][1] += $sales_result->sales; - } - // Add any sales/earnings that happened during this day. - } elseif ( 'day' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d' ) === $date_on_chart->format( 'Y-m-d' ) ) { - $sales[ $timestamp ][1] += $sales_result->sales; - } - // Add any sales/earnings that happened during this month. - } else { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m' ) === $date_on_chart->format( 'Y-m' ) ) { - $sales[ $timestamp ][1] += $sales_result->sales; - } - } - } - - // Move the chart along to the next hour/day/month to get ready for the next loop. - if ( 'hour' === $period ) { - $chart_dates['start']->addHour( 1 ); - } elseif ( 'day' === $period ) { - $chart_dates['start']->addDays( 1 ); - } else { - $chart_dates['start']->addMonth( 1 ); - } - } - - return array( - 'sales' => array_values( $sales ), - 'earnings' => array_values( $earnings ), - ); - -} - -/** - * The callback function which fetches the data for the edd_overview_refunds_chart reports endpoint. - * - * @since 3.0 - */ -function edd_overview_refunds_chart() { - global $wpdb; - - $dates = Reports\get_dates_filter( 'objects' ); - $chart_dates = Reports\parse_dates_for_range( null, 'now', false ); - $column = Reports\get_taxes_excluded_filter() ? 'total - tax' : 'total'; - $currency = Reports\get_filter_value( 'currencies' ); - $period = Reports\get_graph_period(); - $sql_clauses = Reports\get_sql_clauses( $period ); - - if ( empty( $currency ) || 'convert' === $currency ) { - $column = sprintf( '(%s) / rate', $column ); - } else { - $sql_clauses['where'] = $wpdb->prepare( " AND currency = %s ", strtoupper( $currency ) ); - } - - $results = $wpdb->get_results( - $wpdb->prepare( - "SELECT COUNT(*) AS number, SUM({$column}) AS amount, {$sql_clauses['select']} - FROM {$wpdb->edd_orders} edd_o - WHERE status IN (%s, %s) AND date_created >= %s AND date_created <= %s AND type = 'refund' - {$sql_clauses['where']} - GROUP BY {$sql_clauses['groupby']} - ORDER BY {$sql_clauses['orderby']} ASC", - esc_sql( 'complete' ), - esc_sql( 'partially_refunded' ), - $dates['start']->copy()->format( 'mysql' ), - $dates['end']->copy()->format( 'mysql' ) - ) - ); - - $number = array(); - $amount = array(); - - // Initialise all arrays with timestamps and set values to 0. - while ( strtotime( $chart_dates['start']->copy()->format( 'mysql' ) ) <= strtotime( $chart_dates['end']->copy()->format( 'mysql' ) ) ) { - $timestamp = $chart_dates['start']->copy()->format( 'U' ); - $date_on_chart = $chart_dates['start']; - - $number[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $number[ $timestamp ][1] = 0; - - $amount[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $amount[ $timestamp ][1] = 0.00; - - // Loop through each date there were refunds, which we queried from the database. - foreach ( $results as $result ) { - $date_of_db_value = EDD()->utils->date( $result->date ); - - // Add any refunds that happened during this hour. - if ( 'hour' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d H' ) === $date_on_chart->format( 'Y-m-d H' ) ) { - $number[ $timestamp ][1] += $result->number; - $amount[ $timestamp ][1] += abs( $result->amount ); - } - // Add any refunds that happened during this day. - } elseif ( 'day' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d' ) === $date_on_chart->format( 'Y-m-d' ) ) { - $number[ $timestamp ][1] += $result->number; - $amount[ $timestamp ][1] += abs( $result->amount ); - } - // Add any refunds that happened during this month. - } else { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m' ) === $date_on_chart->format( 'Y-m' ) ) { - $number[ $timestamp ][1] += $result->number; - $amount[ $timestamp ][1] += abs( $result->amount ); - } - } - } - - // Move the chart along to the next hour/day/month to get ready for the next loop. - if ( 'hour' === $period ) { - $chart_dates['start']->addHour( 1 ); - } elseif ( 'day' === $period ) { - $chart_dates['start']->addDays( 1 ); - } else { - $chart_dates['start']->addMonth( 1 ); - } - } - - return array( - 'number' => array_values( $number ), - 'amount' => array_values( $amount ), - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/reports.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/reports.php deleted file mode 100644 index f5df0017..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/reports.php +++ /dev/null @@ -1,2814 +0,0 @@ - 'edd-reports' - ) ); - - // Redirect if user cannot view reports - if ( ! current_user_can( 'view_shop_reports' ) ) { - edd_redirect( $redirect_url ); - } - - // Start the Reports API. - new Reports\Init(); - - add_filter( 'edd_admin_is_single_view', '__return_false' ); - - // Get the section and report - $section = Reports\get_current_report(); - $report = Reports\get_report( $section ); - - // Redirect if report is invalid - if ( empty( $report ) || is_wp_error( $report ) ) { - edd_redirect( $redirect_url ); - } - - // Stash the report in the EDD global for future reference - EDD()->report = $report; -} -add_action( 'load-download_page_edd-reports', 'edd_admin_load_report' ); - -/** - * Contains backwards compat code to shim tabs & views to EDD_Sections() - * - * @since 3.0 - */ -function edd_reports_sections() { - - // Instantiate the Sections class and sections array - $sections = new EDD\Admin\Reports_Sections(); - $c_sections = array(); - - // Setup sections variables - $sections->use_js = false; - $sections->current_section = Reports\get_current_report(); - $sections->item = null; - - // Find persisted filters to append to the base URL. - $persisted_filters = Reports\get_persisted_filters(); - $persisted_filter_args = array(); - - foreach ( $persisted_filters as $filter ) { - if ( isset( $_GET[ $filter ] ) ) { - $persisted_filter_args[ $filter ] = sanitize_text_field( $_GET[ $filter ] ); - } - } - - // Build the section base URL. - $sections->base_url = edd_get_admin_url( - array_merge( - array( - 'page' => 'edd-reports', - ), - $persisted_filter_args - ) - ); - - // Get all registered tabs & views - $tabs = Reports\get_reports(); - - // Loop through tabs & setup sections - if ( ! empty( $tabs ) ) { - foreach ( $tabs as $id => $tab ) { - - // Add to sections array - $c_sections[] = array( - 'id' => $id, - 'label' => $tab['label'], - 'icon' => $tab['icon'], - 'callback' => array( 'edd_output_report_callback', array( $id ) ) - ); - } - } - - // Set the customer sections - $sections->set_sections( $c_sections ); - - // Display the sections - $sections->display(); -} - -/** - * Output a report via a callback - * - * @since 3.0 - * - * @param string $report_id - */ -function edd_output_report_callback( $report_id = '' ) { - - // Maybe use the already loaded report - $report = EDD()->report - ? EDD()->report - : EDD\Reports\get_report( $report_id ); - - /** - * Fires at the top of the content area of a Reports tab. - * - * @since 1.0 - * @since 3.0 Added the `$report` parameter. - * - * @param \EDD\Reports\Data\Report|\WP_Error $report The current report object, - * or WP_Error if invalid. - */ - do_action( 'edd_reports_page_top', $report ); - - if ( ! is_wp_error( $report ) ) { - printf( '

    %s

    ', esc_html( $report->label ) ); - $report->display(); - } else { - Reports\default_display_report( $report ); - } - - /** - * Fires at the bottom of the content area of a Reports tab. - * - * @since 1.0 - * @since 3.0 Added the `$report` parameter. - * - * @param \EDD\Reports\Data\Report|\WP_Error $report The current report object, - * or WP_Error if invalid. - */ - do_action( 'edd_reports_page_bottom', $report ); -} - -/** - * Reports Page - * - * Renders the reports page contents. - * - * @since 1.0 - * @return void - */ -function edd_reports_page() { - // Enqueue scripts. - wp_enqueue_script( 'edd-admin-reports' ); - ?> - -
    -

    - - report ); ?> - -
    - -
    -
    - - add_report( 'overview', array( - 'label' => __( 'Overview', 'easy-digital-downloads' ), - 'icon' => 'dashboard', - 'priority' => 5, - 'endpoints' => array( - 'tiles' => array( - 'overview_sales', - 'overview_earnings', - 'overview_average_order_value', - 'overview_new_customers', - 'overview_refunded_amount', - ), - 'charts' => array( - 'overview_sales_earnings_chart', - ), - ), - 'filters' => array( - 'dates', - 'taxes', - 'currencies', - ) - ) ); - - $reports->register_endpoint( 'overview_sales', array( - 'label' => __( 'Sales', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $currency ) { - $stats = new EDD\Stats( - array( - 'range' => $dates['range'], - 'relative' => true, - 'currency' => $currency, - 'revenue_type' => 'net', - ) - ); - return $stats->get_order_count(); - }, - 'display_args' => array( - 'comparison_label' => $label . ' — ' . __( 'Net', 'easy-digital-downloads' ), - ), - ), - ), - ) ); - - $reports->register_endpoint( 'overview_earnings', array( - 'label' => __( 'Earnings', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $exclude_taxes, $currency ) { - $stats = new EDD\Stats( - array( - 'range' => $dates['range'], - 'function' => 'SUM', - 'exclude_taxes' => $exclude_taxes, - 'currency' => $currency, - 'relative' => true, - 'output' => 'formatted', - 'revenue_type' => 'net', - ) - ); - return $stats->get_order_earnings(); - }, - 'display_args' => array( - 'comparison_label' => $label . ' — ' . __( 'Net', 'easy-digital-downloads' ), - ), - ), - ), - ) ); - - $reports->register_endpoint( 'overview_average_order_value', array( - 'label' => __( 'Average Order Value', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $exclude_taxes, $currency ) { - $stats = new EDD\Stats( - array( - 'function' => 'AVG', - 'output' => 'formatted', - 'relative' => true, - 'range' => $dates['range'], - 'exclude_taxes' => $exclude_taxes, - 'currency' => $currency, - ) - ); - return $stats->get_order_earnings(); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'overview_new_customers', array( - 'label' => __( 'New Customers', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates ) { - $stats = new EDD\Stats(); - return $stats->get_customer_count( array( - 'range' => $dates['range'], - 'relative' => true, - 'purchase_count' => true, - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'overview_refunded_amount', array( - 'label' => __( 'Total Refund Amount', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $exclude_taxes, $currency ) { - $stats = new EDD\Stats(); - return $stats->get_order_refund_amount( array( - 'range' => $dates['range'], - 'function' => 'SUM', - 'exclude_taxes' => $exclude_taxes, - 'currency' => $currency, - 'relative' => true, - 'output' => 'formatted', - ) ); - - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'overview_sales_earnings_chart', array( - 'label' => __( 'Sales and Earnings', 'easy-digital-downloads' ) . ' — ' . $label . ' — ' . __( 'Net', 'easy-digital-downloads' ), - 'views' => array( - 'chart' => array( - 'data_callback' => 'edd_overview_sales_earnings_chart', - 'type' => 'line', - 'options' => array( - 'datasets' => array( - 'earnings' => array( - 'label' => __( 'Earnings', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(24,126,244,0.75)', - 'backgroundColor' => 'rgba(24,126,244,0.1)', - 'fill' => true, - 'borderWidth' => 2, - 'type' => 'currency', - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - 'yAxisID' => 'earnings-y', - ), - 'sales' => array( - 'label' => __( 'Sales', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(252,108,18,0.75)', - 'backgroundColor' => 'rgba(252,108,18,0.05)', - 'fill' => true, - 'borderWidth' => 2, - 'borderCapStyle' => 'round', - 'borderJoinStyle' => 'round', - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - 'yAxisID' => 'sales-y', - ), - ), - 'scales' => array( - 'yAxes' => array( - array( - 'id' => 'earnings-y', - 'type' => 'linear', - 'display' => true, - 'position' => 'left', - 'ticks' => array( - 'formattingType' => 'format', - 'beginAtZero' => true, - 'precision' => 0, - ), - 'gridLines' => array( - 'display' => true, - ), - ), - array( - 'id' => 'sales-y', - 'type' => 'linear', - 'position' => 'right', - 'display' => true, - 'ticks' => array( - 'formattingType' => 'integer', - 'beginAtZero' => true, - 'hideNegativeTicks' => true, - 'precision' => 0, - ), - 'gridLines' => array( - 'display' => true, - 'color' => 'rgba(0,0,0,0.03)', - ), - ), - ), - ), - ), - ), - ), - ) ); - } catch ( \EDD_Exception $exception ) { - edd_debug_log_exception( $exception ); - } -} -add_action( 'edd_reports_init', 'edd_register_overview_report' ); - -/** - * Register downloads report and endpoints. - * - * @since 3.0 - * - * @param \EDD\Reports\Data\Report_Registry $reports Report registry. - */ -function edd_register_downloads_report( $reports ) { - try { - $options = Reports\get_dates_filter_options(); - $dates = Reports\get_filter_value( 'dates' ); - $exclude_taxes = Reports\get_taxes_excluded_filter(); - $currency = ''; - - $hbh = Reports\get_dates_filter_hour_by_hour(); - $label = $options[ $dates['range'] ] . ( $hbh ? ' (' . edd_get_timezone_abbr() . ')' : '' ); - - $download_data = Reports\get_filter_value( 'products' ); - $download_data = ! empty( $download_data ) && 'all' !== Reports\get_filter_value( 'products' ) - ? edd_parse_product_dropdown_value( Reports\get_filter_value( 'products' ) ) - : false; - - $endpoint_label = __( 'Sales / Earnings', 'easy-digital-downloads' ); - - // Mock downloads and prices in case they cannot be found later. - $download = edd_get_download(); - $prices = array(); - $download_label = ''; - if ( $download_data ) { - $download = edd_get_download( $download_data['download_id'] ); - $prices = $download->get_prices(); - if ( isset( $download_data['price_id'] ) && is_numeric( $download_data['price_id'] ) ) { - $args = array( 'price_id' => $download_data['price_id'] ); - $price_name = edd_get_price_name( $download->ID, $args ); - if ( $price_name ) { - $download->post_title .= ': ' . $price_name; - } - } - $download_label = esc_html( ' (' . $download->post_title . ')' ); - } - - $tiles = array_filter( array( - 'most_valuable_download', - 'average_download_sales_earnings', - 'download_sales_earnings', - ), function( $endpoint ) use ( $download_data ) { - switch( $endpoint ) { - case 'download_sales_earnings': - return false !== $download_data; - break; - default: - return false === $download_data; - } - } ); - - $charts = array_filter( array( - 'download_sales_by_variations', - 'download_earnings_by_variations', - 'download_sales_earnings_chart' - ), function( $endpoint ) use ( $download_data, $download ) { - switch( $endpoint ) { - case 'download_sales_by_variations': - case 'download_earnings_by_variations': - return ( - false !== $download_data && - false === $download_data['price_id'] && - true === $download->has_variable_prices() - ); - - break; - - default: - return false !== $download_data; - } - } ); - - $tables = array_filter( array( - 'top_selling_downloads', - 'earnings_by_taxonomy', - ), function( $endpoint ) use ( $download_data ) { - return false === $download_data; - } ); - - $reports->add_report( 'downloads', array( - 'label' => edd_get_label_plural(), - 'priority' => 10, - 'icon' => 'download', - 'endpoints' => array( - 'tiles' => $tiles, - 'charts' => $charts, - 'tables' => $tables, - ), - 'filters' => array( 'dates', 'products', 'taxes' ), - ) ); - - $reports->register_endpoint( 'most_valuable_download', array( - 'label' => sprintf( __( 'Most Valuable %s', 'easy-digital-downloads' ), edd_get_label_singular() ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $currency ) { - $stats = new EDD\Stats(); - $d = $stats->get_most_valuable_order_items( array( - 'range' => $dates['range'], - 'currency' => $currency, - 'function' => 'SUM' - ) ); - - if ( ! empty( $d ) && isset( $d[0] ) ) { - $d = $d[0]; - - if ( $d->object instanceof EDD_Download ) { - $title = $d->object->post_title; - - if ( $d->object->has_variable_prices() ) { - $prices = array_values( wp_filter_object_list( $d->object->get_prices(), array( 'index' => absint( $d->price_id ) ) ) ); - - $title .= ( is_array( $prices ) && isset( $prices[0] ) ) - ? ': ' . $prices[0]['name'] - : ''; - } - - return esc_html( $title ); - } - } - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'average_download_sales_earnings', array( - 'label' => __( 'Average Sales / Earnings', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $exclude_taxes, $currency ) { - $stats = new EDD\Stats( array( - 'function' => 'AVG', - 'range' => $dates['range'], - 'exclude_taxes' => $exclude_taxes, - 'currency' => $currency, - 'output' => 'formatted', - ) ); - - return $stats->get_order_item_count() . ' / ' . $stats->get_order_item_earnings(); - }, - 'display_args' => array( - 'comparison_label' => $label . ' — ' . __( 'Net ', 'easy-digital-downloads' ), - ), - ), - ), - ) ); - - $reports->register_endpoint( 'download_sales_earnings', array( - 'label' => $endpoint_label, - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $download_data, $dates, $currency ) { - $price_id = isset( $download_data['price_id'] ) && is_numeric( $download_data['price_id'] ) ? absint( $download_data['price_id'] ) : null; - $stats = new EDD\Stats( array( - 'product_id' => absint( $download_data['download_id'] ), - 'price_id' => $price_id, - 'currency' => $currency, - 'range' => $dates['range'], - 'output' => 'formatted', - ) ); - - $earnings = $stats->get_order_item_earnings( array( - 'function' => 'SUM' - ) ); - $sales = $stats->get_order_item_count( array( - 'function' => 'COUNT' - ) ); - - return esc_html( $sales . ' / ' . $earnings ); - }, - 'display_args' => array( - 'comparison_label' => $label . $download_label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'earnings_by_taxonomy', array( - 'label' => __( 'Earnings By Taxonomy', 'easy-digital-downloads' ) . ' — ' . $label, - 'views' => array( - 'table' => array( - 'display_args' => array( - 'class_name' => '\\EDD\\Reports\\Data\\Downloads\\Earnings_By_Taxonomy_List_Table', - 'class_file' => EDD_PLUGIN_DIR . 'includes/reports/data/downloads/class-earnings-by-taxonomy-list-table.php', - ), - ), - ), - ) ); - - $reports->register_endpoint( 'top_selling_downloads', array( - 'label' => sprintf( __( 'Top Selling %s', 'easy-digital-downloads' ), edd_get_label_plural() ) . ' — ' . $label, - 'views' => array( - 'table' => array( - 'display_args' => array( - 'class_name' => '\\EDD\\Reports\\Data\\Downloads\\Top_Selling_Downloads_List_Table', - 'class_file' => EDD_PLUGIN_DIR . 'includes/reports/data/downloads/class-top-selling-downloads-list-table.php', - ), - ), - ), - ) ); - - $reports->register_endpoint( 'download_sales_by_variations', array( - 'label' => __( 'Sales by Variation', 'easy-digital-downloads' ) . $download_label, - 'views' => array( - 'chart' => array( - 'data_callback' => function() use ( $download_data, $download, $dates, $prices, $currency ) { - $stats = new EDD\Stats(); - $sales = $stats->get_order_item_count( array( - 'product_id' => absint( $download_data['download_id'] ), - 'range' => $dates['range'], - 'grouped' => true, - 'currency' => $currency - ) ); - - // Set all values to 0. - foreach ( $prices as $key => $price ) { - $prices[ $key ]['sales'] = 0; - } - - // Parse results from the database. - foreach ( $sales as $data ) { - $prices[ $data->price_id ]['sales'] = absint( $data->total ); - } - - $sales = array_values( wp_list_pluck( $prices, 'sales' ) ); - - return array( - 'sales' => $sales, - ); - }, - 'type' => 'pie', - 'options' => array( - 'cutoutPercentage' => 0, - 'datasets' => array( - 'sales' => array( - 'label' => __( 'Sales', 'easy-digital-downloads' ), - 'backgroundColor' => array( - 'rgb(133,175,91)', - 'rgb(9,149,199)', - 'rgb(8,189,231)', - 'rgb(137,163,87)', - 'rgb(27,98,122)', - ), - ), - ), - 'labels' => array_values( wp_list_pluck( $prices, 'name' ) ) - ), - ), - ) - ) ); - - $reports->register_endpoint( 'download_earnings_by_variations', array( - 'label' => __( 'Earnings by Variation', 'easy-digital-downloads' ) . $download_label, - 'views' => array( - 'chart' => array( - 'data_callback' => function() use ( $download_data, $prices, $dates, $currency ) { - $stats = new EDD\Stats(); - $earnings = $stats->get_order_item_earnings( array( - 'product_id' => absint( $download_data['download_id'] ), - 'range' => $dates['range'], - 'grouped' => true, - 'currency' => $currency - ) ); - - // Set all values to 0. - foreach ( $prices as $key => $price ) { - $prices[ $key ]['earnings'] = floatval( 0 ); - } - - // Parse results from the database. - foreach ( $earnings as $data ) { - $prices[ $data->price_id ]['earnings'] = floatval( $data->total ); - } - - $earnings = array_values( wp_list_pluck( $prices, 'earnings' ) ); - - return array( - 'earnings' => $earnings, - ); - }, - 'type' => 'pie', - 'options' => array( - 'cutoutPercentage' => 0, - 'datasets' => array( - 'earnings' => array( - 'label' => __( 'Earnings', 'easy-digital-downloads' ), - 'type' => 'currency', - 'backgroundColor' => array( - 'rgb(133,175,91)', - 'rgb(9,149,199)', - 'rgb(8,189,231)', - 'rgb(137,163,87)', - 'rgb(27,98,122)', - ), - ), - ), - 'labels' => array_values( wp_list_pluck( $prices, 'name' ) ) - ), - ), - ) - ) ); - - $reports->register_endpoint( 'download_sales_earnings_chart', array( - 'label' => __( 'Sales and Earnings', 'easy-digital-downloads' ) . esc_html( $download_label ), - 'views' => array( - 'chart' => array( - 'data_callback' => function () use ( $download_data, $currency ) { - global $wpdb; - - $dates = Reports\get_dates_filter( 'objects' ); - $chart_dates = Reports\parse_dates_for_range( null, 'now', false ); - $period = Reports\get_graph_period(); - $sql_clauses = Reports\get_sql_clauses( $period, 'edd_oi.date_created' ); - - $union_clauses = array( - 'select' => 'date', - 'groupby' => 'date', - 'orderby' => 'date', - ); - - $price_id = isset( $download_data['price_id'] ) && is_numeric( $download_data['price_id'] ) - ? sprintf( 'AND price_id = %d', absint( $download_data['price_id'] ) ) - : ''; - - $earnings_statuses = edd_get_gross_order_statuses(); - $earnings_status_string = implode( ', ', array_fill( 0, count( $earnings_statuses ), '%s' ) ); - - $order_item_earnings = $wpdb->prepare( - "SELECT SUM(edd_oi.total / edd_oi.rate) AS earnings, {$sql_clauses['select']} - FROM {$wpdb->edd_order_items} edd_oi - INNER JOIN {$wpdb->edd_orders} edd_o ON edd_oi.order_id = edd_o.id - WHERE edd_oi.product_id = %d {$price_id} AND edd_oi.date_created >= %s AND edd_oi.date_created <= %s AND edd_o.status IN ({$earnings_status_string}) - GROUP BY {$sql_clauses['groupby']}", - $download_data['download_id'], - $dates['start']->copy()->format( 'mysql' ), - $dates['end']->copy()->format( 'mysql' ), - ...$earnings_statuses - ); - - /** - * The adjustments query needs a different order status check than the order items. This is due to the fact that - * adjustments refunded would end up being double counted, and therefore create an inaccurate revenue report. - */ - $adjustments_statuses = edd_get_net_order_statuses(); - $adjustments_status_string = implode( ', ', array_fill( 0, count( $adjustments_statuses ), '%s' ) ); - - $order_adjustments = $wpdb->prepare( - "SELECT SUM(edd_oa.total / edd_oa.rate) AS earnings, {$sql_clauses['select']} - FROM {$wpdb->edd_order_adjustments} edd_oa - INNER JOIN {$wpdb->edd_order_items} edd_oi ON - edd_oi.id = edd_oa.object_id - AND edd_oi.product_id = %d - {$price_id} - AND edd_oi.date_created >= %s AND edd_oi.date_created <= %s - INNER JOIN {$wpdb->edd_orders} edd_o ON edd_oi.order_id = edd_o.id AND edd_o.type = 'sale' AND edd_o.status IN ({$adjustments_status_string}) - WHERE edd_oa.object_type = 'order_item' - AND edd_oa.type != 'discount' - GROUP BY {$sql_clauses['groupby']}", - $download_data['download_id'], - $dates['start']->copy()->format( 'mysql' ), - $dates['end']->copy()->format( 'mysql' ), - ...$adjustments_statuses - ); - - $earnings_sql = "SELECT SUM(earnings) as earnings, {$union_clauses['select']} FROM ({$order_item_earnings} UNION {$order_adjustments})a GROUP BY {$union_clauses['groupby']} ORDER BY {$union_clauses['orderby']}"; - $earnings_results = $wpdb->get_results( $earnings_sql ); - - $statuses = edd_get_net_order_statuses(); - $status_string = implode( ', ', array_fill( 0, count( $statuses ), '%s' ) ); - - $join = $wpdb->prepare( - "INNER JOIN {$wpdb->edd_orders} edd_o ON (edd_oi.order_id = edd_o.id) AND edd_o.status IN({$status_string}) AND edd_o.type = 'sale' ", - ...$statuses - ); - - $sales_sql = $wpdb->prepare( - "SELECT COUNT(edd_oi.total) AS sales, {$sql_clauses['select']} - FROM {$wpdb->edd_order_items} edd_oi - {$join} - WHERE edd_oi.product_id = %d %1s AND edd_oi.date_created >= %s AND edd_oi.date_created <= %s AND edd_oi.status IN ({$status_string}) - GROUP BY {$sql_clauses['groupby']} - ORDER BY {$sql_clauses['orderby']} ASC", - $download_data['download_id'], - $price_id, - $dates['start']->copy()->format( 'mysql' ), - $dates['end']->copy()->format( 'mysql' ), - ...$statuses - ); - - $sales_results = $wpdb->get_results( $sales_sql ); - - $sales = array(); - $earnings = array(); - - // Initialise all arrays with timestamps and set values to 0. - while ( strtotime( $chart_dates['start']->copy()->format( 'mysql' ) ) <= strtotime( $chart_dates['end']->copy()->format( 'mysql' ) ) ) { - $timestamp = $chart_dates['start']->copy()->format( 'U' ); - $date_on_chart = $chart_dates['start']; - - $sales[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $sales[ $timestamp ][1] = 0; - - $earnings[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $earnings[ $timestamp ][1] = 0.00; - - // Loop through each date there were sales/earnings, which we queried from the database. - foreach ( $earnings_results as $earnings_result ) { - $date_of_db_value = EDD()->utils->date( $earnings_result->date ); - - // Add any sales/earnings that happened during this hour. - if ( 'hour' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d H' ) === $date_on_chart->format( 'Y-m-d H' ) ) { - $earnings[ $timestamp ][1] += $earnings_result->earnings; - } - // Add any sales/earnings that happened during this day. - } elseif ( 'day' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d' ) === $date_on_chart->format( 'Y-m-d' ) ) { - $earnings[ $timestamp ][1] += $earnings_result->earnings; - } - // Add any sales/earnings that happened during this month. - } else { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m' ) === $date_on_chart->format( 'Y-m' ) ) { - $earnings[ $timestamp ][1] += $earnings_result->earnings; - } - } - } - - // Loop through each date there were sales/earnings, which we queried from the database. - foreach ( $sales_results as $sales_result ) { - $date_of_db_value = EDD()->utils->date( $sales_result->date ); - - // Add any sales/earnings that happened during this hour. - if ( 'hour' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d H' ) === $date_on_chart->format( 'Y-m-d H' ) ) { - $sales[ $timestamp ][1] += $sales_result->sales; - } - // Add any sales/earnings that happened during this day. - } elseif ( 'day' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d' ) === $date_on_chart->format( 'Y-m-d' ) ) { - $sales[ $timestamp ][1] += $sales_result->sales; - } - // Add any sales/earnings that happened during this month. - } else { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m' ) === $date_on_chart->format( 'Y-m' ) ) { - $sales[ $timestamp ][1] += $sales_result->sales; - } - } - } - - // Move the chart along to the next hour/day/month to get ready for the next loop. - if ( 'hour' === $period ) { - $chart_dates['start']->addHour( 1 ); - } elseif ( 'day' === $period ) { - $chart_dates['start']->addDays( 1 ); - } else { - $chart_dates['start']->addMonth( 1 ); - } - } - - return array( - 'earnings' => array_values( $earnings ), - 'sales' => array_values( $sales ), - ); - }, - 'type' => 'line', - 'options' => array( - 'datasets' => array( - 'earnings' => array( - 'label' => __( 'Earnings', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(24,126,244,0.75)', - 'backgroundColor' => 'rgba(24,126,244,0.1)', - 'fill' => true, - 'borderWidth' => 2, - 'type' => 'currency', - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - 'yAxisID' => 'earnings-y', - ), - 'sales' => array( - 'label' => __( 'Sales', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(252,108,18,0.75)', - 'backgroundColor' => 'rgba(252,108,18,0.05)', - 'fill' => true, - 'borderWidth' => 2, - 'borderCapStyle' => 'round', - 'borderJoinStyle' => 'round', - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - 'yAxisID' => 'sales-y', - ), - ), - 'scales' => array( - 'yAxes' => array( - array( - 'id' => 'earnings-y', - 'type' => 'linear', - 'display' => true, - 'position' => 'left', - 'ticks' => array( - 'maxTicksLimit' => 5, - 'formattingType' => 'format', - 'suggestedMin' => 0, - 'beginAtZero' => true, - ), - 'gridLines' => array( - 'display' => true, - ), - ), - array( - 'id' => 'sales-y', - 'type' => 'linear', - 'position' => 'right', - 'display' => true, - 'ticks' => array( - 'maxTicksLimit' => 5, - 'formattingType' => 'integer', - 'suggestedMin' => 0, - 'beginAtZero' => true, - 'hideNegativeTicks' => true, - ), - 'gridLines' => array( - 'display' => true, - 'color' => 'rgba(0,0,0,0.03)', - ), - ), - ), - ), - ), - ), - ), - ) ); - } catch ( \EDD_Exception $exception ) { - edd_debug_log_exception( $exception ); - } -} -add_action( 'edd_reports_init', 'edd_register_downloads_report' ); - - -/** - * Register refunds report and endpoints. - * - * @since 3.0 - * - * @param \EDD\Reports\Data\Report_Registry $reports Report registry. - */ -function edd_register_refunds_report( $reports ) { - try { - - // Variables to hold date filter values. - $options = Reports\get_dates_filter_options(); - $dates = Reports\get_filter_value( 'dates' ); - $exclude_taxes = Reports\get_taxes_excluded_filter(); - $currency = Reports\get_filter_value( 'currencies' ); - - $hbh = Reports\get_dates_filter_hour_by_hour(); - $label = $options[ $dates['range'] ] . ( $hbh ? ' (' . edd_get_timezone_abbr() . ')' : '' ); - - $reports->add_report( 'refunds', array( - 'label' => __( 'Refunds', 'easy-digital-downloads' ), - 'icon' => 'image-rotate', - 'priority' => 15, - 'endpoints' => array( - 'tiles' => array( - 'refund_count', - 'fully_refunded_order_count', - 'fully_refunded_order_item_count', - 'refund_amount', - 'average_refund_amount', - 'average_time_to_refund', - 'refund_rate', - ), - 'charts' => array( - 'refunds_chart', - ), - ), - 'filters' => array( - 'dates', - 'taxes', - 'currencies' - ) - ) ); - - $reports->register_endpoint( 'refund_count', array( - 'label' => __( 'Number of Refunds', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $currency ) { - $stats = new EDD\Stats(); - $number = $stats->get_order_refund_count( array( - 'range' => $dates['range'], - 'currency' => $currency - ) ); - return esc_html( $number ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'fully_refunded_order_count', array( - 'label' => __( 'Number of Fully Refunded Orders', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $currency ) { - $stats = new EDD\Stats(); - $number = $stats->get_order_refund_count( array( - 'range' => $dates['range'], - 'status' => array( 'complete' ), - 'currency' => $currency - ) ); - return esc_html( $number ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'fully_refunded_order_item_count', array( - 'label' => __( 'Number of Fully Refunded Items', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $currency ) { - $stats = new EDD\Stats(); - $number = $stats->get_order_item_refund_count( array( - 'range' => $dates['range'], - 'status' => array( 'refunded' ), - 'currency' => $currency - ) ); - return esc_html( $number ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'refund_amount', array( - 'label' => __( 'Total Refund Amount', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $exclude_taxes, $currency ) { - $stats = new EDD\Stats(); - return $stats->get_order_refund_amount( array( - 'range' => $dates['range'], - 'exclude_taxes' => $exclude_taxes, - 'output' => 'formatted', - 'currency' => $currency - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'average_refund_amount', array( - 'label' => __( 'Average Refund Amount', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $exclude_taxes, $currency ) { - $stats = new EDD\Stats(); - return $stats->get_order_refund_amount( array( - 'function' => 'AVG', - 'range' => $dates['range'], - 'exclude_taxes' => $exclude_taxes, - 'output' => 'formatted', - 'currency' => $currency - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'average_time_to_refund', array( - 'label' => __( 'Average Time to Refund', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $currency ) { - $stats = new EDD\Stats(); - return $stats->get_average_refund_time( array( - 'range' => $dates['range'], - 'currency' => $currency - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'refund_rate', array( - 'label' => __( 'Refund Rate', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $currency ) { - $stats = new EDD\Stats(); - return $stats->get_refund_rate( array( - 'range' => $dates['range'], - 'output' => 'formatted', - 'status' => edd_get_gross_order_statuses(), - 'currency' => $currency - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'refunds_chart', array( - 'label' => __( 'Refunds', 'easy-digital-downloads' ) . ' — ' . $label, - 'views' => array( - 'chart' => array( - 'data_callback' => 'edd_overview_refunds_chart', - 'type' => 'line', - 'options' => array( - 'datasets' => array( - 'amount' => array( - 'label' => __( 'Amount', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(24,126,244,0.75)', - 'backgroundColor' => 'rgba(24,126,244,0.1)', - 'fill' => true, - 'borderWidth' => 2, - 'type' => 'currency', - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - 'yAxisID' => 'amount-y', - ), - 'number' => array( - 'label' => __( 'Number', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(252,108,18,0.75)', - 'backgroundColor' => 'rgba(252,108,18,0.05)', - 'fill' => true, - 'borderWidth' => 2, - 'borderCapStyle' => 'round', - 'borderJoinStyle' => 'round', - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - 'yAxisID' => 'number-y', - ), - ), - 'scales' => array( - 'yAxes' => array( - array( - 'id' => 'amount-y', - 'type' => 'linear', - 'display' => true, - 'position' => 'left', - 'ticks' => array( - 'maxTicksLimit' => 5, - 'formattingType' => 'format', - 'suggestedMin' => 0, - 'beginAtZero' => true, - 'precision' => 0, - ), - 'gridLines' => array( - 'display' => true, - ), - ), - array( - 'id' => 'number-y', - 'type' => 'linear', - 'position' => 'right', - 'display' => true, - 'ticks' => array( - 'maxTicksLimit' => 5, - 'formattingType' => 'integer', - 'suggestedMin' => 0, - 'beginAtZero' => true, - 'precision' => 0, - ), - 'gridLines' => array( - 'display' => true, - 'color' => 'rgba(0,0,0,0.03)', - ), - ), - ), - ), - ), - ), - ), - ) ); - } catch ( \EDD_Exception $exception ) { - edd_debug_log_exception( $exception ); - } -} -add_action( 'edd_reports_init', 'edd_register_refunds_report' ); - -/** - * Register payment gateways report and endpoints. - * - * @since 3.0 - * - * @param \EDD\Reports\Data\Report_Registry $reports Report registry. - */ -function edd_register_payment_gateways_report( $reports ) { - try { - - // Variables to hold date filter values. - $options = Reports\get_dates_filter_options(); - $dates = Reports\get_filter_value( 'dates' ); - $exclude_taxes = Reports\get_taxes_excluded_filter(); - $currency = Reports\get_filter_value( 'currencies' ); - $gateway = Reports\get_filter_value( 'gateways' ); - - $hbh = Reports\get_dates_filter_hour_by_hour(); - $label = $options[ $dates['range'] ] . ( $hbh ? ' (' . edd_get_timezone_abbr() . ')' : '' ); - - $tiles = array( - 'sales_per_gateway', - 'earnings_per_gateway', - 'refunds_per_gateway', - 'average_value_per_gateway', - ); - - $tables = array_filter( array( - 'gateway_stats', - ), function( $endpoint ) use ( $gateway ) { - return empty( $gateway ) || 'all' === $gateway; - } ); - - $charts = array_filter( array( - 'gateway_sales_breakdown', - 'gateway_earnings_breakdown', - 'gateway_sales_earnings_chart', - ), function( $endpoint ) use ( $gateway ) { - switch( $endpoint ) { - case 'gateway_sales_earnings_chart': - return ! empty( $gateway ) && 'all' !== $gateway; - break; - default: - return ( empty( $gateway ) || 'all' === $gateway ); - } - } ); - - $reports->add_report( 'gateways', array( - 'label' => __( 'Payment Gateways', 'easy-digital-downloads' ), - 'icon' => 'image-filter', - 'priority' => 20, - 'endpoints' => array( - 'tiles' => $tiles, - 'tables' => $tables, - 'charts' => $charts, - ), - 'filters' => array( 'dates', 'gateways', 'taxes', 'currencies' ), - ) ); - - $reports->register_endpoint( 'sales_per_gateway', array( - 'label' => __( 'Sales', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $currency ) { - $gateway = 'all' !== Reports\get_filter_value( 'gateways' ) - ? Reports\get_filter_value( 'gateways' ) - : ''; - - $stats = new EDD\Stats(); - - return $stats->get_gateway_sales( array( - 'range' => $dates['range'], - 'gateway' => $gateway, - 'currency' => $currency, - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'earnings_per_gateway', array( - 'label' => __( 'Earnings', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $exclude_taxes, $currency ) { - $gateway = 'all' !== Reports\get_filter_value( 'gateways' ) - ? Reports\get_filter_value( 'gateways' ) - : ''; - - $stats = new EDD\Stats(); - - return $stats->get_gateway_earnings( array( - 'range' => $dates['range'], - 'exclude_taxes' => $exclude_taxes, - 'gateway' => $gateway, - 'output' => 'formatted', - 'currency' => $currency - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'refunds_per_gateway', array( - 'label' => __( 'Refunds', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $currency ) { - $gateway = 'all' !== Reports\get_filter_value( 'gateways' ) - ? Reports\get_filter_value( 'gateways' ) - : ''; - - $stats = new EDD\Stats(); - - return $stats->get_gateway_earnings( array( - 'range' => $dates['range'], - 'gateway' => $gateway, - 'output' => 'formatted', - 'type' => 'refund', - 'status' => array( 'complete' ), - 'currency' => $currency - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'average_value_per_gateway', array( - 'label' => __( 'Average Order Value', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $exclude_taxes, $currency ) { - $gateway = 'all' !== Reports\get_filter_value( 'gateways' ) - ? Reports\get_filter_value( 'gateways' ) - : ''; - - $stats = new EDD\Stats(); - - if ( empty( $gateway ) ) { - return $stats->get_order_earnings( array( - 'range' => $dates['range'], - 'exclude_taxes' => $exclude_taxes, - 'function' => 'AVG', - 'output' => 'formatted', - 'currency' => $currency - ) ); - } else { - return $stats->get_gateway_earnings( array( - 'range' => $dates['range'], - 'exclude_taxes' => $exclude_taxes, - 'gateway' => $gateway, - 'function' => 'AVG', - 'output' => 'formatted', - 'currency' => $currency - ) ); - } - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'gateway_stats', array( - 'label' => __( 'Gateway Stats', 'easy-digital-downloads' ) . ' — ' . $options[ $dates['range'] ], - 'views' => array( - 'table' => array( - 'display_args' => array( - 'class_name' => '\\EDD\\Reports\\Data\\Payment_Gateways\\Gateway_Stats', - 'class_file' => EDD_PLUGIN_DIR . 'includes/reports/data/payment-gateways/class-gateway-stats-list-table.php', - ), - ), - ), - ) ); - - $gateway_list = array_map( 'edd_get_gateway_admin_label', array_keys( edd_get_payment_gateways() ) ); - - $reports->register_endpoint( 'gateway_sales_breakdown', array( - 'label' => __( 'Gateway Sales', 'easy-digital-downloads' ) . ' — ' . $options[ $dates['range'] ], - 'views' => array( - 'chart' => array( - 'data_callback' => function() use ( $dates, $currency ) { - $stats = new EDD\Stats(); - $g = $stats->get_gateway_sales( array( - 'range' => $dates['range'], - 'grouped' => true, - 'currency' => $currency - ) ); - - $gateways = array_flip( array_keys( edd_get_payment_gateways() ) ); - - foreach ( $g as $data ) { - $gateways[ $data->gateway ] = $data->total; - } - - $gateways = array_map( function( $v ) { - return null === $v - ? 0 - : $v; - }, $gateways ); - - return array( - 'sales' => array_values( $gateways ), - ); - }, - 'type' => 'pie', - 'options' => array( - 'cutoutPercentage' => 0, - 'datasets' => array( - 'sales' => array( - 'label' => __( 'Sales', 'easy-digital-downloads' ), - 'backgroundColor' => array( - 'rgb(133,175,91)', - 'rgb(9,149,199)', - 'rgb(8,189,231)', - 'rgb(137,163,87)', - 'rgb(27,98,122)', - ), - ), - ), - 'labels' => $gateway_list, - ), - ), - ) - ) ); - - $reports->register_endpoint( 'gateway_earnings_breakdown', array( - 'label' => __( 'Gateway Earnings', 'easy-digital-downloads' ) . ' — ' . $options[ $dates['range'] ], - 'views' => array( - 'chart' => array( - 'data_callback' => function() use ( $dates, $exclude_taxes, $currency ) { - $stats = new EDD\Stats(); - $g = $stats->get_gateway_earnings( array( - 'grouped' => true, - 'range' => $dates['range'], - 'exclude_taxes' => $exclude_taxes, - 'currency' => $currency - ) ); - - $gateways = array_flip( array_keys( edd_get_payment_gateways() ) ); - - foreach ( $g as $data ) { - $gateways[ $data->gateway ] = $data->earnings; - } - - $gateways = array_values( array_map( function( $v ) { - return null === $v - ? 0.00 - : $v; - }, $gateways ) ); - - return array( - 'earnings' => $gateways, - ); - }, - 'type' => 'pie', - 'options' => array( - 'cutoutPercentage' => 0, - 'datasets' => array( - 'earnings' => array( - 'label' => __( 'Earnings', 'easy-digital-downloads' ), - 'backgroundColor' => array( - 'rgb(133,175,91)', - 'rgb(9,149,199)', - 'rgb(8,189,231)', - 'rgb(137,163,87)', - 'rgb(27,98,122)', - ), - 'type' => 'currency', - ), - ), - 'labels' => $gateway_list, - ), - ), - ) - ) ); - - $reports->register_endpoint( 'gateway_sales_earnings_chart', array( - 'label' => __( 'Sales and Earnings', 'easy-digital-downloads' ) . ' — ' . $label, - 'views' => array( - 'chart' => array( - 'data_callback' => function () use ( $dates, $exclude_taxes, $currency ) { - global $wpdb; - - $dates = Reports\get_dates_filter( 'objects' ); - $chart_dates = Reports\parse_dates_for_range( null, 'now', false ); - $period = Reports\get_graph_period(); - $sql_clauses = Reports\get_sql_clauses( $period, 'date_created' ); - - $gateway = Reports\get_filter_value( 'gateways' ); - $column = $exclude_taxes - ? '( total - tax ) / rate' - : 'total / rate'; - - $currency_sql = ''; - if ( ! empty( $currency ) && array_key_exists( strtoupper( $currency ), edd_get_currencies() ) ) { - $currency_sql = $wpdb->prepare( - " AND currency = %s ", - strtoupper( $currency ) - ); - } - - $results = $wpdb->get_results( $wpdb->prepare( - "SELECT COUNT({$column}) AS sales, SUM({$column}) AS earnings, {$sql_clauses['select']} - FROM {$wpdb->edd_orders} o - WHERE gateway = %s AND status IN ('complete', 'revoked') {$currency_sql} AND date_created >= %s AND date_created <= %s - GROUP BY {$sql_clauses['groupby']} - ORDER BY {$sql_clauses['orderby']} ASC", - esc_sql( $gateway ), $dates['start']->copy()->format( 'mysql' ), $dates['end']->copy()->format( 'mysql' ) ) ); - - $sales = array(); - $earnings = array(); - - /** - * Initialise all arrays with timestamps and set values to 0. - * - * We use the Chart based dates for this loop, so the graph shows in the proper date ranges while the actual DB queries are all UTC based. - */ - while ( strtotime( $chart_dates['start']->copy()->format( 'mysql' ) ) <= strtotime( $chart_dates['end']->copy()->format( 'mysql' ) ) ) { - $timestamp = $chart_dates['start']->copy()->format( 'U' ); - $date_on_chart = $chart_dates['start']; - - $sales[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $sales[ $timestamp ][1] = 0; - - $earnings[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $earnings[ $timestamp ][1] = 0.00; - - // Loop through each date there were sales/earnings, which we queried from the database. - foreach ( $results as $result ) { - $date_of_db_value = EDD()->utils->date( $result->date ); - - // Add any sales/earnings that happened during this hour. - if ( 'hour' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d H' ) === $date_on_chart->format( 'Y-m-d H' ) ) { - $sales[ $timestamp ][1] += $result->sales; - $earnings[ $timestamp ][1] += $result->earnings; - } - // Add any sales/earnings that happened during this day. - } elseif ( 'day' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d' ) === $date_on_chart->format( 'Y-m-d' ) ) { - $sales[ $timestamp ][1] += $result->sales; - $earnings[ $timestamp ][1] += $result->earnings; - } - // Add any sales/earnings that happened during this month. - } else { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m' ) === $date_on_chart->format( 'Y-m' ) ) { - $sales[ $timestamp ][1] += $result->sales; - $earnings[ $timestamp ][1] += $result->earnings; - } - } - } - - // Move the chart along to the next hour/day/month to get ready for the next loop. - if ( 'hour' === $period ) { - $chart_dates['start']->addHour( 1 ); - } elseif ( 'day' === $period ) { - $chart_dates['start']->addDays( 1 ); - } else { - $chart_dates['start']->addMonth( 1 ); - } - } - - $sales = array_values( $sales ); - $earnings = array_values( $earnings ); - - return array( - 'earnings' => $earnings, - 'sales' => $sales, - ); - }, - 'type' => 'line', - 'options' => array( - 'datasets' => array( - 'earnings' => array( - 'label' => __( 'Earnings', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(24,126,244,0.75)', - 'backgroundColor' => 'rgba(24,126,244,0.1)', - 'fill' => true, - 'borderWidth' => 2, - 'type' => 'currency', - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - 'yAxisID' => 'earnings-y', - ), - 'sales' => array( - 'label' => __( 'Sales', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(252,108,18,0.75)', - 'backgroundColor' => 'rgba(252,108,18,0.05)', - 'fill' => true, - 'borderWidth' => 2, - 'borderCapStyle' => 'round', - 'borderJoinStyle' => 'round', - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - 'yAxisID' => 'sales-y', - ), - ), - 'scales' => array( - 'yAxes' => array( - array( - 'id' => 'earnings-y', - 'type' => 'linear', - 'display' => true, - 'position' => 'left', - 'ticks' => array( - 'maxTicksLimit' => 5, - 'formattingType' => 'format', - 'suggestedMin' => 0, - 'beginAtZero' => true, - 'precision' => 0, - ), - 'gridLines' => array( - 'display' => true, - ), - ), - array( - 'id' => 'sales-y', - 'type' => 'linear', - 'position' => 'right', - 'display' => true, - 'ticks' => array( - 'maxTicksLimit' => 5, - 'formattingType' => 'integer', - 'suggestedMin' => 0, - 'beginAtZero' => true, - 'hideNegativeTicks' => true, - 'precision' => 0, - ), - 'gridLines' => array( - 'display' => true, - 'color' => 'rgba(0,0,0,0.03)', - ), - ), - ), - ), - ), - ), - ), - ) ); - } catch ( \EDD_Exception $exception ) { - edd_debug_log_exception( $exception ); - } -} -add_action( 'edd_reports_init', 'edd_register_payment_gateways_report' ); - -/** - * Register taxes report and endpoints. - * - * @since 3.0 - * - * @param \EDD\Reports\Data\Report_Registry $reports Report registry. - */ -function edd_register_taxes_report( $reports ) { - try { - - // Variables to hold date filter values. - $options = Reports\get_dates_filter_options(); - $dates = Reports\get_filter_value( 'dates' ); - $currency = Reports\get_filter_value( 'currencies' ); - - $hbh = Reports\get_dates_filter_hour_by_hour(); - $label = $options[ $dates['range'] ] . ( $hbh ? ' (' . edd_get_timezone_abbr() . ')' : '' ); - - $download_data = Reports\get_filter_value( 'products' ); - $download_data = ! empty( $download_data ) && 'all' !== Reports\get_filter_value( 'products' ) - ? edd_parse_product_dropdown_value( Reports\get_filter_value( 'products' ) ) - : false; - - $download_label = ''; - if ( $download_data ) { - $download = edd_get_download( $download_data['download_id'] ); - if ( isset( $download_data['price_id'] ) && is_numeric( $download_data['price_id'] ) ) { - $args = array( 'price_id' => $download_data['price_id'] ); - $price_name = edd_get_price_name( $download->ID, $args ); - if ( $price_name ) { - $download->post_title .= ': ' . $price_name; - } - } - $download_label = esc_html( ' (' . $download->post_title . ')' ); - } - - $country = Reports\get_filter_value( 'countries' ); - $region = Reports\get_filter_value( 'regions' ); - - $tiles = array( - 'total_tax_collected', - 'total_tax_collected_for_location', - ); - - $tables = array_filter( array( - 'tax_collected_by_location', - ), function( $table ) use ( $download_data ) { - return false === $download_data; - } ); - - $reports->add_report( 'taxes', array( - 'label' => __( 'Taxes', 'easy-digital-downloads' ), - 'priority' => 25, - 'icon' => 'editor-paste-text', - 'endpoints' => array( - 'tiles' => $tiles, - 'tables' => $tables, - ), - 'filters' => array( 'dates', 'products', 'countries', 'regions', 'currencies' ), - ) ); - - $reports->register_endpoint( 'total_tax_collected', array( - 'label' => __( 'Total Tax Collected', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $currency ) { - $download = Reports\get_filter_value( 'products' ); - $download = ! empty( $download ) && 'all' !== Reports\get_filter_value( 'products' ) - ? edd_parse_product_dropdown_value( Reports\get_filter_value( 'products' ) ) - : array( 'download_id' => '', 'price_id' => '' ); - - $stats = new EDD\Stats(); - return $stats->get_tax( array( - 'output' => 'formatted', - 'range' => $dates['range'], - 'download_id' => $download['download_id'], - 'price_id' => (string) $download['price_id'], - 'currency' => $currency - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label . $download_label, - ), - ), - ), - ) ); - - if ( ! empty( $country ) && 'all' !== $country ) { - $location = ''; - - if ( ! empty( $region ) && 'all' !== $region ) { - $location = edd_get_state_name( $country, $region ) . ', '; - } - - $location .= edd_get_country_name( $country ); - - $reports->register_endpoint( 'total_tax_collected_for_location', array( - 'label' => __( 'Total Tax Collected for ', 'easy-digital-downloads' ) . $location, - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates, $country, $region, $currency ) { - $download = Reports\get_filter_value( 'products' ); - $download = ! empty( $download ) && 'all' !== Reports\get_filter_value( 'products' ) - ? edd_parse_product_dropdown_value( Reports\get_filter_value( 'products' ) ) - : array( 'download_id' => '', 'price_id' => '' ); - - $stats = new EDD\Stats(); - - return $stats->get_tax_by_location( array( - 'output' => 'formatted', - 'range' => $dates['range'], - 'download_id' => $download['download_id'], - 'price_id' => (string) $download['price_id'], - 'country' => $country, - 'region' => $region, - 'currency' => $currency - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label . $download_label, - ), - ), - ), - ) ); - } - - $reports->register_endpoint( 'tax_collected_by_location', array( - 'label' => __( 'Tax Collected by Location', 'easy-digital-downloads' ), - 'views' => array( - 'table' => array( - 'display_args' => array( - 'class_name' => '\\EDD\\Reports\\Data\\Taxes\\Tax_Collected_By_Location', - 'class_file' => EDD_PLUGIN_DIR . 'includes/reports/data/taxes/class-tax-collected-by-location-list-table.php', - ), - ), - ), - ) ); - } catch ( \EDD_Exception $exception ) { - edd_debug_log_exception( $exception ); - } -} -add_action( 'edd_reports_init', 'edd_register_taxes_report' ); - -/** - * Register file downloads report and endpoints. - * - * @since 3.0 - * - * @param \EDD\Reports\Data\Report_Registry $reports Report registry. - */ -function edd_register_file_downloads_report( $reports ) { - try { - - // Variables to hold date filter values. - $options = Reports\get_dates_filter_options(); - $filter = Reports\get_filter_value( 'dates' ); - - $hbh = Reports\get_dates_filter_hour_by_hour(); - $label = $options[ $filter['range'] ] . ( $hbh ? ' (' . edd_get_timezone_abbr() . ')' : '' ); - - $download_data = Reports\get_filter_value( 'products' ); - $download_data = ! empty( $download_data ) && 'all' !== Reports\get_filter_value( 'products' ) - ? edd_parse_product_dropdown_value( Reports\get_filter_value( 'products' ) ) - : false; - - $download_label = ''; - if ( $download_data ) { - $download = edd_get_download( $download_data['download_id'] ); - if ( isset( $download_data['price_id'] ) && is_numeric( $download_data['price_id'] ) ) { - $args = array( 'price_id' => $download_data['price_id'] ); - $price_name = edd_get_price_name( $download->ID, $args ); - if ( $price_name ) { - $download->post_title .= ': ' . $price_name; - } - } - $download_label = esc_html( ' (' . $download->post_title . ')' ); - } - - $tiles = array_filter( array( - 'number_of_file_downloads', - 'average_file_downloads_per_customer', - 'most_downloaded_product', - 'average_file_downloads_per_order', - ), function( $endpoint ) use ( $download_data ) { - switch( $endpoint ) { - case 'average_file_downloads_per_customer': - case 'most_downloaded_product': - case 'average_file_downloads_per_order': - return false === $download_data; - break; - default: - return true; - } - } ); - - $tables = array_filter( array( - 'top_five_most_downloaded_products', - ), function( $endpoint ) use ( $download_data ) { - return false === $download_data; - } ); - - $charts = array( - 'file_downloads_chart', - ); - - $reports->add_report( 'file_downloads', array( - 'label' => __( 'File Downloads', 'easy-digital-downloads' ), - 'icon' => 'download', - 'priority' => 30, - 'endpoints' => array( - 'tiles' => $tiles, - 'tables' => $tables, - 'charts' => $charts, - ), - 'filters' => array( 'dates', 'products' ), - ) ); - - $reports->register_endpoint( 'number_of_file_downloads', array( - 'label' => __( 'Number of File Downloads', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $filter ) { - $download = Reports\get_filter_value( 'products' ); - $download = ! empty( $download ) && 'all' !== Reports\get_filter_value( 'products' ) - ? edd_parse_product_dropdown_value( Reports\get_filter_value( 'products' ) ) - : array( 'download_id' => '', 'price_id' => '' ); - - $stats = new EDD\Stats(); - return $stats->get_file_download_count( array( - 'range' => $filter['range'], - 'download_id' => $download['download_id'], - 'price_id' => (string) $download['price_id'], - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label . $download_label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'average_file_downloads_per_customer', array( - 'label' => __( 'Average per Customer', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $filter ) { - $stats = new EDD\Stats(); - return $stats->get_average_file_download_count( array( - 'range' => $filter['range'], - 'column' => 'customer_id', - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'average_file_downloads_per_order', array( - 'label' => __( 'Average per Order', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $filter ) { - $stats = new EDD\Stats(); - return $stats->get_average_file_download_count( array( - 'range' => $filter['range'], - 'column' => 'order_id', - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'most_downloaded_product', array( - 'label' => __( 'Most Downloaded Product', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $filter ) { - $stats = new EDD\Stats(); - $d = $stats->get_most_downloaded_products( array( 'range' => $filter['range'] ) ); - if ( $d ) { - return esc_html( $d[0]->object->post_title ); - } - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'top_five_most_downloaded_products', array( - 'label' => __( 'Top Five Most Downloaded Products', 'easy-digital-downloads' ) . ' – ' . $label, - 'views' => array( - 'table' => array( - 'display_args' => array( - 'class_name' => '\\EDD\\Reports\\Data\\File_Downloads\\Top_Five_Most_Downloaded_List_Table', - 'class_file' => EDD_PLUGIN_DIR . 'includes/reports/data/file-downloads/class-top-five-most-downloaded-list-table.php', - ), - ), - ), - ) ); - - $reports->register_endpoint( 'file_downloads_chart', array( - 'label' => __( 'Number of File Downloads', 'easy-digital-downloads' ) . $download_label, - 'views' => array( - 'chart' => array( - 'data_callback' => function () use ( $filter, $download_data ) { - global $wpdb; - - $dates = Reports\get_dates_filter( 'objects' ); - $chart_dates = Reports\parse_dates_for_range( null, 'now', false ); - $period = Reports\get_graph_period(); - $sql_clauses = Reports\get_sql_clauses( $period ); - - $product_id = ''; - $price_id = ''; - - if ( is_array( $download_data ) ) { - $product_id = $wpdb->prepare( 'AND product_id = %d', absint( $download_data['download_id'] ) ); - - $price_id = isset( $download_data['price_id'] ) && is_numeric( $download_data['price_id'] ) - ? $wpdb->prepare( 'AND price_id = %d', absint( $download_data['price_id'] ) ) - : ''; - } - - $results = $wpdb->get_results( $wpdb->prepare( - "SELECT COUNT(id) AS total, {$sql_clauses['select']} - FROM {$wpdb->edd_logs_file_downloads} edd_lfd - WHERE edd_lfd.date_created >= %s AND edd_lfd.date_created <= %s {$product_id} {$price_id} - GROUP BY {$sql_clauses['groupby']} - ORDER BY {$sql_clauses['orderby']} ASC", - $dates['start']->copy()->format( 'mysql' ), $dates['end']->copy()->format( 'mysql' ) ) ); - - $file_downloads = array(); - - // Initialise all arrays with timestamps and set values to 0. - while ( strtotime( $chart_dates['start']->copy()->format( 'mysql' ) ) <= strtotime( $chart_dates['end']->copy()->format( 'mysql' ) ) ) { - $timestamp = $chart_dates['start']->copy()->format( 'U' ); - $date_on_chart = $chart_dates['start']; - - $file_downloads[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $file_downloads[ $timestamp ][1] = 0; - - foreach ( $results as $result ) { - $date_of_db_value = EDD()->utils->date( $result->date ); - - // Add any file downloads that happened during this hour. - if ( 'hour' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d H' ) === $date_on_chart->format( 'Y-m-d H' ) ) { - $file_downloads[ $timestamp ][1] += absint( $result->total ); - } - // Add any file downloads that happened during this day. - } elseif ( 'day' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d' ) === $date_on_chart->format( 'Y-m-d' ) ) { - $file_downloads[ $timestamp ][1] += absint( $result->total ); - } - // Add any file downloads that happened during this month. - } else { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m' ) === $date_on_chart->format( 'Y-m' ) ) { - $file_downloads[ $timestamp ][1] += absint( $result->total ); - } - } - } - - // Move the chart along to the next hour/day/month to get ready for the next loop. - if ( 'hour' === $period ) { - $chart_dates['start']->addHour( 1 ); - } elseif ( 'day' === $period ) { - $chart_dates['start']->addDays( 1 ); - } else { - $chart_dates['start']->addMonth( 1 ); - } - } - - $file_downloads = array_values( $file_downloads ); - - return array( 'file_downloads' => $file_downloads ); - }, - 'type' => 'line', - 'options' => array( - 'datasets' => array( - 'file_downloads' => array( - 'label' => __( 'File Downloads', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(24,126,244,0.75)', - 'backgroundColor' => 'rgba(24,126,244,0.1)', - 'fill' => true, - 'borderWidth' => 2, - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - 'yAxisID' => 'file-downloads-y', - ), - ), - 'scales' => array( - 'yAxes' => array( - array( - 'id' => 'file-downloads-y', - 'type' => 'linear', - 'display' => true, - 'position' => 'left', - 'ticks' => array( - 'maxTicksLimit' => 5, - 'formattingType' => 'integer', - 'suggestedMin' => 0, - 'beginAtZero' => true, - 'precision' => 0, - ), - ), - ), - ), - ), - ), - ), - ) ); - } catch ( \EDD_Exception $exception ) { - edd_debug_log_exception( $exception ); - } -} -add_action( 'edd_reports_init', 'edd_register_file_downloads_report' ); - -/** - * Register discounts report and endpoints. - * - * @since 3.0 - * - * @param \EDD\Reports\Data\Report_Registry $reports Report registry. - */ -function edd_register_discounts_report( $reports ) { - try { - - // Variables to hold date filter values. - $options = Reports\get_dates_filter_options(); - $filter = Reports\get_filter_value( 'dates' ); - $currency = Reports\get_filter_value( 'currencies' ); - - $hbh = Reports\get_dates_filter_hour_by_hour(); - $label = $options[ $filter['range'] ] . ( $hbh ? ' (' . edd_get_timezone_abbr() . ')' : '' ); - - $discount = Reports\get_filter_value( 'discounts' ); - $discount = ! empty( $discount ) && 'all' !== $discount - ? $discount - : 0; - - $d = edd_get_discount( $discount ); - - $discount_label = false !== $d - ? esc_html( ' (' . $d->name . ')' ) - : ''; - - $tiles = array_filter( array( - 'number_of_discounts_used', - 'ratio_of_discounted_orders', - 'customer_savings', - 'average_discount_amount', - 'most_popular_discount', - 'discount_usage_count', - ), function( $tile ) use ( $discount ) { - switch ( $tile ) { - case 'discount_usage_count': - return 0 !== $discount; - break; - default: - return 0 === $discount; - } - } ); - - $tables = array_filter( array( - 'top_five_discounts', - ), function( $table ) use ( $discount ) { - return 0 === $discount; - } ); - - $charts = array( - 'discount_usage_chart', - ); - - $reports->add_report( 'discounts', array( - 'label' => __( 'Discounts', 'easy-digital-downloads' ), - 'icon' => 'tickets-alt', - 'priority' => 35, - 'endpoints' => array( - 'tiles' => $tiles, - 'tables' => $tables, - 'charts' => $charts, - ), - 'filters' => array( 'dates', 'discounts' ), - ) ); - - $reports->register_endpoint( 'number_of_discounts_used', array( - 'label' => __( 'Number of Discounts Used', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $filter ) { - $stats = new EDD\Stats(); - return $stats->get_discount_usage_count( array( - 'range' => $filter['range'], - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'ratio_of_discounted_orders', array( - 'label' => __( 'Discount Ratio', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $filter ) { - $stats = new EDD\Stats(); - return $stats->get_ratio_of_discounted_orders( array( - 'range' => $filter['range'], - ) ); - }, - 'display_args' => array( - 'context' => 'secondary', - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'customer_savings', array( - 'label' => __( 'Customer Savings', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $filter, $d ) { - $stats = new EDD\Stats(); - return $stats->get_discount_savings( array( - 'range' => $filter['range'], - 'output' => 'formatted', - 'discount_code' => isset( $d->code ) - ? $d->code - : '', - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label . $discount_label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'average_discount_amount', array( - 'label' => __( 'Average Discount Amount', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $filter ) { - $stats = new EDD\Stats(); - return $stats->get_average_discount_amount( array( - 'range' => $filter['range'], - 'output' => 'formatted', - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'most_popular_discount', array( - 'label' => __( 'Most Popular Discount', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $filter ) { - $stats = new EDD\Stats(); - - $r = $stats->get_most_popular_discounts( array( - 'range' => $filter['range'], - 'number' => 1, - ) ); - - if ( ! empty( $r ) ) { - $r = $r[0]; - return esc_html( $r->code . ' (' . $r->count . ')' ); - } - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - if ( $d ) { - $reports->register_endpoint( 'discount_usage_count', array( - 'label' => __( 'Discount Usage Count', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $filter, $d ) { - $stats = new EDD\Stats(); - return $stats->get_discount_usage_count( array( - 'range' => $filter['range'], - 'discount_code' => $d->code, - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label . $discount_label, - ), - ), - ), - ) ); - } - - $reports->register_endpoint( 'top_five_discounts', array( - 'label' => __( 'Top Five Discounts', 'easy-digital-downloads' ) . ' – ' . $label, - 'views' => array( - 'table' => array( - 'display_args' => array( - 'class_name' => '\\EDD\\Reports\\Data\\Discounts\\Top_Five_Discounts_List_Table', - 'class_file' => EDD_PLUGIN_DIR . 'includes/reports/data/discounts/class-top-five-discounts-list-table.php', - ), - ), - ), - ) ); - - if ( $d ) { - $reports->register_endpoint( 'discount_usage_chart', array( - 'label' => __( 'Discount Usage', 'easy-digital-downloads' ), - 'views' => array( - 'chart' => array( - 'data_callback' => function () use ( $filter, $d ) { - global $wpdb; - - $dates = Reports\get_dates_filter( 'objects' ); - $chart_dates = Reports\parse_dates_for_range( null, 'now', false ); - $period = Reports\get_graph_period(); - $sql_clauses = Reports\get_sql_clauses( $period, 'edd_oa.date_created' ); - - $discount_code = ! empty( $d->code ) - ? $wpdb->prepare( 'AND type = %s AND description = %s', 'discount', esc_sql( $d->code ) ) - : $wpdb->prepare( 'AND type = %s', 'discount' ); - - $results = $wpdb->get_results( $wpdb->prepare( - "SELECT COUNT(id) AS total, {$sql_clauses['select']} - FROM {$wpdb->edd_order_adjustments} edd_oa - WHERE 1=1 {$discount_code} AND edd_oa.date_created >= %s AND edd_oa.date_created <= %s - GROUP BY {$sql_clauses['groupby']} - ORDER BY {$sql_clauses['orderby']} ASC", - $dates['start']->copy()->format( 'mysql' ), $dates['end']->copy()->format( 'mysql' ) ) ); - - $discount_usage = array(); - - // Initialise all arrays with timestamps and set values to 0. - while ( strtotime( $chart_dates['start']->copy()->format( 'mysql' ) ) <= strtotime( $chart_dates['end']->copy()->format( 'mysql' ) ) ) { - $timestamp = $chart_dates['start']->copy()->format( 'U' ); - $date_on_chart = $chart_dates['start']; - - $discount_usage[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $discount_usage[ $timestamp ][1] = 0; - - // Loop through each date in which there were discount codes used, which we queried from the database. - foreach ( $results as $result ) { - $date_of_db_value = EDD()->utils->date( $result->date ); - - // Add any discount codes that were used during this hour. - if ( 'hour' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d H' ) === $date_on_chart->format( 'Y-m-d H' ) ) { - $discount_usage[ $timestamp ][1] += abs( $result->total ); - } - // Add any discount codes that were used during this day. - } elseif ( 'day' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d' ) === $date_on_chart->format( 'Y-m-d' ) ) { - $discount_usage[ $timestamp ][1] += abs( $result->total ); - } - // Add any discount codes that were used during this month. - } else { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m' ) === $date_on_chart->format( 'Y-m' ) ) { - $discount_usage[ $timestamp ][1] += abs( $result->total ); - } - } - } - - // Move the chart along to the next hour/day/month to get ready for the next loop. - if ( 'hour' === $period ) { - $chart_dates['start']->addHour( 1 ); - } elseif ( 'day' === $period ) { - $chart_dates['start']->addDays( 1 ); - } else { - $chart_dates['start']->addMonth( 1 ); - } - } - - $discount_usage = array_values( $discount_usage ); - - return array( 'discount_usage' => $discount_usage ); - }, - 'type' => 'line', - 'options' => array( - 'datasets' => array( - 'discount_usage' => array( - 'label' => __( 'Discount Usage', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(24,126,244,0.75)', - 'backgroundColor' => 'rgba(24,126,244,0.1)', - 'fill' => true, - 'borderWidth' => 2, - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - ), - ), - 'scales' => array( - 'yAxes' => array( - array( - 'type' => 'linear', - 'display' => true, - 'position' => 'left', - 'ticks' => array( - 'maxTicksLimit' => 2, - 'formattingType' => 'integer', - 'suggestedMin' => 0, - 'beginAtZero' => true, - 'precision' => 0, - ), - ), - ), - ), - ), - ), - ), - ) ); - } - } catch ( \EDD_Exception $exception ) { - edd_debug_log_exception( $exception ); - } -} -add_action( 'edd_reports_init', 'edd_register_discounts_report' ); - -/** - * Register customer report and endpoints. - * - * @since 3.0 - * - * @param \EDD\Reports\Data\Report_Registry $reports Report registry. - */ -function edd_register_customer_report( $reports ) { - try { - - // Variables to hold date filter values. - $options = Reports\get_dates_filter_options(); - $dates = Reports\get_filter_value( 'dates' ); - $exclude_taxes = Reports\get_taxes_excluded_filter(); - - $hbh = Reports\get_dates_filter_hour_by_hour(); - $label = $options[ $dates['range'] ] . ( $hbh ? ' (' . edd_get_timezone_abbr() . ')' : '' ); - - $reports->add_report( 'customers', array( - 'label' => __( 'Customers', 'easy-digital-downloads' ), - 'icon' => 'groups', - 'priority' => 40, - 'endpoints' => array( - 'tiles' => array( - 'new_customer_growth', - 'average_revenue_per_customer', - 'average_number_of_orders_per_customer', - ), - 'tables' => array( - 'top_five_customers', - 'most_valuable_customers', - ), - 'charts' => array( - 'new_customers', - ), - ), - ) ); - - $reports->register_endpoint( 'new_customer_growth', array( - 'label' => __( 'New Customers', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates ) { - $stats = new EDD\Stats(); - return $stats->get_customer_count( array( - 'range' => $dates['range'], - 'relative' => true, - 'purchase_count' => true, - ) ); - }, - 'display_args' => array( - 'comparison_label' => $label, - ), - ), - ), - ) ); - - $reports->register_endpoint( 'average_revenue_per_customer', array( - 'label' => __( 'Average Revenue per Customer', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () { - $stats = new EDD\Stats(); - return $stats->get_customer_lifetime_value( array( - 'function' => 'AVG', - 'output' => 'formatted', - ) ); - }, - ), - ), - ) ); - - $reports->register_endpoint( 'average_number_of_orders_per_customer', array( - 'label' => __( 'Average Orders per Customer', 'easy-digital-downloads' ), - 'views' => array( - 'tile' => array( - 'data_callback' => function () use ( $dates ) { - $stats = new EDD\Stats(); - return $stats->get_customer_order_count( array( - 'range' => $dates['range'], - 'function' => 'AVG', - 'relative' => true, - ) ); - }, - ), - ), - ) ); - - $reports->register_endpoint( 'top_five_customers', array( - 'label' => __( 'Top Five Customers — All Time', 'easy-digital-downloads' ), - 'views' => array( - 'table' => array( - 'display_args' => array( - 'class_name' => '\\EDD\\Reports\\Data\\Customers\\Top_Five_Customers_List_Table', - 'class_file' => EDD_PLUGIN_DIR . 'includes/reports/data/customers/class-top-five-customers-list-table.php', - ), - ), - ), - ) ); - - $reports->register_endpoint( 'most_valuable_customers', array( - 'label' => __( 'Most Valuable Customers', 'easy-digital-downloads' ) . ' — '. $label, - 'views' => array( - 'table' => array( - 'display_args' => array( - 'class_name' => '\\EDD\\Reports\\Data\\Customers\\Most_Valuable_Customers_List_Table', - 'class_file' => EDD_PLUGIN_DIR . 'includes/reports/data/customers/class-most-valuable-customers-list-table.php', - ), - ), - ), - ) ); - - $reports->register_endpoint( 'new_customers', array( - 'label' => __( 'New Customers', 'easy-digital-downloads' ) . ' — ' . $label, - 'views' => array( - 'chart' => array( - 'data_callback' => function () { - global $wpdb; - - $dates = Reports\get_dates_filter( 'objects' ); - $chart_dates = Reports\parse_dates_for_range( null, 'now', false ); - $period = Reports\get_graph_period(); - $sql_clauses = Reports\get_sql_clauses( $period ); - - $results = $wpdb->get_results( $wpdb->prepare( - "SELECT COUNT(c.id) AS total, {$sql_clauses['select']} - FROM {$wpdb->edd_customers} c - WHERE c.date_created >= %s AND c.date_created <= %s - AND c.purchase_count > 0 - GROUP BY {$sql_clauses['groupby']} - ORDER BY {$sql_clauses['orderby']} ASC", - $dates['start']->copy()->format( 'mysql' ), - $dates['end']->copy()->format( 'mysql' ) ) ); - - $customers = array(); - - // Initialise all arrays with timestamps and set values to 0. - while ( strtotime( $chart_dates['start']->copy()->format( 'mysql' ) ) <= strtotime( $chart_dates['end']->copy()->format( 'mysql' ) ) ) { - $timestamp = $chart_dates['start']->copy()->format( 'U' ); - $date_on_chart = $chart_dates['start']; - - $customers[ $timestamp ][0] = $date_on_chart->format( 'Y-m-d H:i:s' ); - $customers[ $timestamp ][1] = 0; - - foreach ( $results as $result ) { - $date_of_db_value = EDD()->utils->date( $result->date ); - - // Add any new customers that were created during this hour. - if ( 'hour' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d H' ) === $date_on_chart->format( 'Y-m-d H' ) ) { - $customers[ $timestamp ][1] += $result->total; - } - // Add any new customers that were created during this day. - } elseif ( 'day' === $period ) { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m-d' ) === $date_on_chart->format( 'Y-m-d' ) ) { - $customers[ $timestamp ][1] += $result->total; - } - // Add any new customers that were created during this month. - } else { - // If the date of this db value matches the date on this line graph/chart, set the y axis value for the chart to the number in the DB result. - if ( $date_of_db_value->format( 'Y-m' ) === $date_on_chart->format( 'Y-m' ) ) { - $customers[ $timestamp ][1] += $result->total; - } - } - } - - // Move the chart along to the next hour/day/month to get ready for the next loop. - if ( 'hour' === $period ) { - $chart_dates['start']->addHour( 1 ); - } elseif ( 'day' === $period ) { - $chart_dates['start']->addDays( 1 ); - } else { - $chart_dates['start']->addMonth( 1 ); - } - } - - return array( - 'customers' => array_values( $customers ), - ); - }, - 'type' => 'line', - 'options' => array( - 'datasets' => array( - 'customers' => array( - 'label' => __( 'New Customers', 'easy-digital-downloads' ), - 'borderColor' => 'rgba(24,126,244,0.75)', - 'backgroundColor' => 'rgba(24,126,244,0.1)', - 'fill' => true, - 'borderWidth' => 2, - 'pointRadius' => 4, - 'pointHoverRadius' => 6, - 'pointBackgroundColor' => 'rgb(255,255,255)', - ), - ), - 'scales' => array( - 'yAxes' => array( - array( - 'type' => 'linear', - 'display' => true, - 'position' => 'left', - 'ticks' => array( - 'maxTicksLimit' => 5, - 'formattingType' => 'integer', - 'suggestedMin' => 0, - 'beginAtZero' => true, - 'precision' => 0, - ), - ), - ), - ), - ), - ), - ), - ) ); - } catch ( \EDD_Exception $exception ) { - edd_debug_log_exception( $exception ); - } -} -add_action( 'edd_reports_init', 'edd_register_customer_report' ); - -/** - * Register export report and endpoints. - * - * @since 3.0 - * - * @param \EDD\Reports\Data\Report_Registry $reports Report registry. - */ -function edd_register_export_report( $reports ) { - try { - $reports->add_report( 'export', array( - 'label' => __( 'Export', 'easy-digital-downloads' ), - 'icon' => 'migrate', - 'priority' => 1000, - 'capability' => 'export_shop_reports', - 'display_callback' => 'display_export_report', - 'filters' => false, - ) ); - } catch ( \EDD_Exception $exception ) { - edd_debug_log_exception( $exception ); - } -} -add_action( 'edd_reports_init', 'edd_register_export_report' ); -/** - * Render the `Export` report. - * - * @since 3.0 - */ -function display_export_report() { - wp_enqueue_script( 'edd-admin-tools-export' ); - ?> -
    -
    -
    -
    - -
    -
    -
    -
    - 0, - 'sales' => 0 - ); - - $stats = new EDD_Payment_Stats; - - $to_date_earnings = $stats->get_earnings( 0, 'this_month', null, $include_taxes ); - $to_date_sales = $stats->get_sales( 0, 'this_month' ); - - $current_day = date( 'd', current_time( 'timestamp' ) ); - $current_month = date( 'n', current_time( 'timestamp' ) ); - $current_year = date( 'Y', current_time( 'timestamp' ) ); - $days_in_month = cal_days_in_month( CAL_GREGORIAN, $current_month, $current_year ); - - $estimated['earnings'] = ( $to_date_earnings / $current_day ) * $days_in_month; - $estimated['sales'] = ( $to_date_sales / $current_day ) * $days_in_month; - - // Cache for one day - set_transient( 'edd_estimated_monthly_stats' . $include_taxes, $estimated, 86400 ); - } - - return maybe_unserialize( $estimated ); -} - -/** - * Adds postbox nonces, which are used to save the position of tile endpoint meta boxes. - * - * @since 3.0 - */ -function edd_add_screen_options_nonces() { - wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); - wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); -} -add_action( 'admin_footer', 'edd_add_screen_options_nonces' ); - -/** - * This function adds a notice to the bottom of the Tax reports screen if a default tax rate is detected, stating - * that we cannot report on the default tax rate. - * - * @since 3.0 - * @param \EDD\Reports\Data\Report|\WP_Error $report The current report object, or WP_Error if invalid. - */ -function edd_tax_report_notice( $report ) { - if ( 'taxes' === $report->object_id && false !== edd_get_option( 'tax_rate' ) ) { - ?> -

    - : - -

    - -

    -
    -

    -
    -
    - - - - - html->date_field( - array( - 'id' => 'edd-api-requests-export-start', - 'class' => 'edd-export-start', - 'name' => 'api-requests-export-start', - 'placeholder' => _x( 'From', 'date filter', 'easy-digital-downloads' ) - ) - ); - ?> - - html->date_field( - array( - 'id' => 'edd-api-requests-export-end', - 'class' => 'edd-export-end', - 'name' => 'api-requests-export-end', - 'placeholder' => _x( 'To', 'date filter', 'easy-digital-downloads' ) - ) - ); - ?> -
    - - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-customers.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-customers.php deleted file mode 100644 index bb3cf5b9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-customers.php +++ /dev/null @@ -1,63 +0,0 @@ -
    -

    -
    -

    -
    - prepare( "tt.taxonomy IN ({$placeholders})", $taxonomies ); - - $sql = "SELECT t.*, tt.*, tr.object_id - FROM {$wpdb->terms} AS t - INNER JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id - INNER JOIN {$wpdb->term_relationships} AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id - WHERE {$taxonomy__in}"; - - $results = $wpdb->get_results( $sql ); - - $taxonomies = array(); - - if ( $results ) { - foreach ( $results as $r ) { - $t = get_taxonomy( $r->taxonomy ); - $taxonomies[ absint( $r->term_id ) ] = $t->labels->singular_name . ': ' . esc_html( $r->name ); - } - } - ?> - - html->select( - array( - 'name' => 'taxonomy', - 'id' => 'edd_export_taxonomy', - 'options' => $taxonomies, - 'selected' => false, - 'show_option_none' => false, - 'show_option_all' => __( 'All Taxonomies', 'easy-digital-downloads' ), - ) - ); - ?> - - html->product_dropdown( - array( - 'name' => 'download', - 'id' => 'edd_customer_export_download', - 'chosen' => true, - /* translators: the plural post type label */ - 'placeholder' => sprintf( __( 'All %s', 'easy-digital-downloads' ), edd_get_label_plural() ), - ) - ); - - wp_nonce_field( 'edd_ajax_export', 'edd_ajax_export' ); - ?> - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-download-history.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-download-history.php deleted file mode 100644 index 03a4cebf..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-download-history.php +++ /dev/null @@ -1,49 +0,0 @@ -
    -

    -
    -

    -
    - - html->product_dropdown( - array( - 'name' => 'download_id', - 'id' => 'edd_file_download_export_download', - 'chosen' => true, - /* translators: the plural post type label */ - 'placeholder' => sprintf( __( 'All %s', 'easy-digital-downloads' ), edd_get_label_plural() ), - ) - ); - ?> -
    - - - - - html->date_field( - array( - 'id' => 'edd-file-download-export-start', - 'class' => 'edd-export-start', - 'name' => 'file-download-export-start', - 'placeholder' => _x( 'From', 'date filter', 'easy-digital-downloads' ) - ) - ); - ?> - - html->date_field( - array( - 'id' => 'edd-file-download-export-end', - 'class' => 'edd-export-end', - 'name' => 'file-download-export-end', - 'placeholder' => _x( 'To', 'date filter', 'easy-digital-downloads' ) - ) - ); - ?> -
    - - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-downloads.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-downloads.php deleted file mode 100644 index 7ede6555..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-downloads.php +++ /dev/null @@ -1,26 +0,0 @@ -
    -

    -
    -

    -
    - - html->product_dropdown( - array( - 'name' => 'download_id', - 'id' => 'edd_download_export_download', - 'chosen' => true, - /* translators: the plural post type label */ - 'placeholder' => sprintf( __( 'All %s', 'easy-digital-downloads' ), edd_get_label_plural() ), - ) - ); - ?> - - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-earnings-report.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-earnings-report.php deleted file mode 100644 index d12e3e1a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-earnings-report.php +++ /dev/null @@ -1,32 +0,0 @@ -
    -

    -
    -

    -
    -
    - - - - - html->month_dropdown( 'start_month', 0, 'edd_export_earnings', true ); ?> - - html->year_dropdown( 'start_year', 0, 5, 0, 'edd_export_earnings' ); ?> -
    - - - -
    - - - - - html->month_dropdown( 'end_month', 0, 'edd_export_earnings', true ); ?> - - html->year_dropdown( 'end_year', 0, 5, 0, 'edd_export_earnings' ); ?> -
    - - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-orders.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-orders.php deleted file mode 100644 index 626ed1fe..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-orders.php +++ /dev/null @@ -1,52 +0,0 @@ -
    -

    -
    -

    -
    -
    - - - - - html->date_field( - array( - 'id' => 'edd-orders-export-start', - 'class' => 'edd-export-start', - 'name' => 'orders-export-start', - 'placeholder' => _x( 'From', 'date filter', 'easy-digital-downloads' ), - ) - ); - ?> - - html->date_field( - array( - 'id' => 'edd-orders-export-end', - 'class' => 'edd-export-end', - 'name' => 'orders-export-end', - 'placeholder' => _x( 'To', 'date filter', 'easy-digital-downloads' ), - ) - ); - ?> -
    - - html->select( - array( - 'id' => 'edd_orders_export_status', - 'name' => 'status', - 'show_option_all' => __( 'All Statuses', 'easy-digital-downloads' ), - 'show_option_none' => false, - 'selected' => false, - 'options' => edd_get_payment_statuses(), - ) - ); - - wp_nonce_field( 'edd_ajax_export', 'edd_ajax_export' ); - ?> - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-sales-earnings.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-sales-earnings.php deleted file mode 100644 index d62be100..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-sales-earnings.php +++ /dev/null @@ -1,64 +0,0 @@ -
    -

    -
    -

    -
    -
    - - - - - html->date_field( - array( - 'id' => 'edd-order-export-start', - 'class' => 'edd-export-start', - 'name' => 'order-export-start', - 'placeholder' => _x( 'From', 'date filter', 'easy-digital-downloads' ), - ) - ); - ?> - - html->date_field( - array( - 'id' => 'edd-order-export-end', - 'class' => 'edd-export-end', - 'name' => 'order-export-end', - 'placeholder' => _x( 'To', 'date filter', 'easy-digital-downloads' ), - ) - ); - - ?> -
    - - html->product_dropdown( - array( - 'name' => 'download_id', - 'id' => 'edd_orders_export_download', - 'chosen' => true, - /* translators: the plural post type label */ - 'placeholder' => sprintf( __( 'All %s', 'easy-digital-downloads' ), edd_get_label_plural() ), - ) - ); - ?> - - html->customer_dropdown( - array( - 'name' => 'customer_id', - 'id' => 'edd_order_export_customer', - 'chosen' => true, - 'none_selected' => '', - 'placeholder' => __( 'All Customers', 'easy-digital-downloads' ), - ) - ); - - wp_nonce_field( 'edd_ajax_export', 'edd_ajax_export' ); ?> - - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-sales.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-sales.php deleted file mode 100644 index c324c241..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-sales.php +++ /dev/null @@ -1,49 +0,0 @@ -
    -

    -
    -

    -
    -
    - - - - - html->date_field( - array( - 'id' => 'edd-sales-export-start', - 'class' => 'edd-sales-export-start', - 'name' => 'sales-export-start', - 'placeholder' => _x( 'From', 'date filter', 'easy-digital-downloads' ), - ) - ); - ?> - - html->date_field( - array( - 'id' => 'edd-sales-export-end', - 'class' => 'edd-export-end', - 'name' => 'sales-export-end', - 'placeholder' => _x( 'To', 'date filter', 'easy-digital-downloads' ), - ) - ); - - ?> -
    - - html->product_dropdown( - array( - 'name' => 'download_id', - 'id' => 'edd_sales_export_download', - 'chosen' => true, - ) - ); - ?> - - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-taxed-customers.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-taxed-customers.php deleted file mode 100644 index 04e86600..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-taxed-customers.php +++ /dev/null @@ -1,37 +0,0 @@ -
    -

    -
    -

    -
    -
    - - - - html->date_field( - array( - 'id' => 'edd-taxed-customers-export-start', - 'class' => 'edd-export-start', - 'name' => 'taxed-customers-export-start', - 'placeholder' => _x( 'From', 'date filter', 'easy-digital-downloads' ) - ) - ); - ?> - - html->date_field( - array( - 'id' => 'edd-taxed-customers-export-end', - 'class' => 'edd-export-end', - 'name' => 'taxed-customers-export-end', - 'placeholder' => _x( 'To', 'date filter', 'easy-digital-downloads' ) - ) - ); - ?> -
    - - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-taxed-orders.php b/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-taxed-orders.php deleted file mode 100644 index 359a5de9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/reporting/views/export-taxed-orders.php +++ /dev/null @@ -1,72 +0,0 @@ -
    -

    -
    -

    -
    -
    - - - - - html->date_field( - array( - 'id' => 'edd-taxed-orders-export-start', - 'class' => 'edd-export-start', - 'name' => 'taxed-orders-export-start', - 'placeholder' => _x( 'From', 'date filter', 'easy-digital-downloads' ) - ) - ); - ?> - - html->date_field( - array( - 'id' => 'edd-taxed-orders-export-end', - 'class' => 'edd-export-end', - 'name' => 'taxed-orders-export-end', - 'placeholder' => _x( 'To', 'date filter', 'easy-digital-downloads' ) - ) - ); - ?> -
    - - html->select( - array( - 'id' => 'edd_taxed_orders_export_status', - 'name' => 'status', - 'show_option_all' => __( 'All Statuses', 'easy-digital-downloads' ), - 'show_option_none' => false, - 'selected' => false, - 'options' => edd_get_payment_statuses(), - ) - ); - ?> - - html->country_select( - array( - 'name' => 'country', - 'id' => 'edd_reports_filter_taxed_countries', - 'selected' => false, - 'show_option_all' => false, - ) - ); - ?> - - html->region_select( - array( - 'id' => 'edd_reports_filter_regions', - 'placeholder' => __( 'All Regions', 'easy-digital-downloads' ), - ) - ); - - wp_nonce_field( 'edd_ajax_export', 'edd_ajax_export' ); - ?> - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/settings/contextual-help.php b/wp-content/plugins/easy-digital-downloads/includes/admin/settings/contextual-help.php deleted file mode 100644 index e62cf8a0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/settings/contextual-help.php +++ /dev/null @@ -1,136 +0,0 @@ -id ) { - return; - } - - $pass_manager = new Pass_Manager(); - if ( $pass_manager->isFree() ) { - $docs_url = edd_link_helper( - 'https://easydigitaldownloads.com/docs/', - array( - 'utm_medium' => 'settings-contextual-help', - 'utm_content' => 'documentation', - ) - ); - - $upgrade_url = edd_link_helper( - 'https://easydigitaldownloads.com/lite-upgrade/', - array( - 'utm_medium' => 'settings-contextual-help', - 'utm_content' => 'lite-upgrade', - ) - ); - - $screen->set_help_sidebar( - '

    ' . __( 'For more information:', 'easy-digital-downloads' ) . '

    ' . - '

    ' . sprintf( __( 'Visit the documentation on the Easy Digital Downloads website.', 'easy-digital-downloads' ), $docs_url ) . '

    ' . - '

    ' . sprintf( - __( 'Need more from your Easy Digital Downloads store? Upgrade Now!.', 'easy-digital-downloads' ), - $upgrade_url - ) . '

    ' - ); - } - - $screen->add_help_tab( array( - 'id' => 'edd-settings-general', - 'title' => __( 'General', 'easy-digital-downloads' ), - 'content' => '

    ' . __( 'This screen provides the most basic settings for configuring your store. You can set the currency, page templates, and general store settings.', 'easy-digital-downloads' ) . '

    ', - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-settings-payment-gateways', - 'title' => __( 'Payments', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'This screen provides ways to enable Test Mode, toggle payment gateways on or off, manage accounting settings, and configure gateway-specific settings. Any extra payment gateway extensions you have installed will appear on this page, and can be configured to suit your needs.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Test Payment - This included gateway is great for testing your store, as it requires no payment, and leads straight to product downloads. However, please remember to turn it off once your site is live!', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'PayPal - A PayPal payment gateway is included as standard with Easy Digital Downloads. To test the PayPal gateway, you need a Sandbox account for PayPal and the site must be placed in Test Mode from the Payments > Gateways tab. Please remember to enter your PayPal account email address in order for payments to get processed.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Stripe - The Stripe payment gateway is also included with Easy Digital Downloads. To test the Stripe gateway, you must "Connect with Stripe" and the site must be placed in Test Mode from the Payments > Gateways tab.', 'easy-digital-downloads' ) . '

    ', - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-settings-emails', - 'title' => __( 'Emails', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( "This screen allows you to customize how emails act throughout your store. You can choose a premade template, set the sender's name, email address, and subject.", 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'A set of email tag markers has also been provided to allow the creation of personalized emails. A tag consists of a keyword surrounded by curly braces: {tag}.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-settings-marketing', - 'title' => __( 'Marketing', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'Marketing settings will help you connect with your customers.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Marketing specific extensions will add their settings here as well.', 'easy-digital-downloads' ) . '

    ', - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-settings-styles', - 'title' => __( 'Styles', 'easy-digital-downloads' ), - 'content' => '

    ' . __( "This screen allows customization of your store's styles. For complete control, you can completely disable all styles generated by the plugin.", 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-settings-taxes', - 'title' => __( 'Taxes', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'This screen allows you to configure the tax rules for your store.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'If you do not wish to charge any tax on purchase, simply leave the Enable Taxes option unchecked.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Default Tax Rate: The default tax rate is the tax rate charged to customers located in your base country / state or province.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Base Country: This determines the country that is loaded by default on the checkout screen for customers that do not have an address stored in their account.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Base State / Province: This determines the region that is loaded by default on the checkout screen for customers that do not have an address stored in their account.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Prices Entered with Tax: if enabled, this means that the price entered on the product edit screens is the total amount the customer will pay after taxes. For example, if enabled and the price of a product is $20, the customer will pay 20$ at checkout. The exact amount charged in tax will be calculated automatically.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Display Tax Rate on Prices: when enabled, the amount the customer is expected to pay in tax will be displayed below purchase buttons.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Display During Checkout: This determines whether prices are shown with taxes or without taxes on checkout. If set to Including Tax, a $10 product with a 10% tax will be shown as $11.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Calculate Tax After Discounts: If enabled, this option will make it so that tax is calculated on the after-discount amount. If a purchase of $20 is made and a 20% discount is applied, tax will be calculated off of $16 instead of $20.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'Additional Tax Rates: This section lets you add tax rates for specific countries and/or states/provinces in those countries.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-settings-privacy', - 'title' => __( 'Policies', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'This screen provides access to customer privacy policies, terms & agreements, and how to display them on the front of your site.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'You may also override what happens to order records when a customer exercises their right to be forgotten from your site.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-settings-extensions', - 'title' => __( 'Extensions', 'easy-digital-downloads' ), - 'content' => '

    ' . __( 'This screen provides access to settings added by most Easy Digital Downloads extensions.', 'easy-digital-downloads' ) . '

    ' - ) ); - - $screen->add_help_tab( array( - 'id' => 'edd-settings-misc', - 'title' => __( 'Miscellaneous', 'easy-digital-downloads' ), - 'content' => - '

    ' . __( 'This screen provides other miscellaneous options such as configuring your store buttons, file download functionality, and terms of service.', 'easy-digital-downloads' ) . '

    ', - ) ); - - do_action( 'edd_settings_contextual_help', $screen ); -} -add_action( 'load-download_page_edd-settings', 'edd_settings_contextual_help' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/settings/display-settings.php b/wp-content/plugins/easy-digital-downloads/includes/admin/settings/display-settings.php deleted file mode 100644 index c88c03ca..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/settings/display-settings.php +++ /dev/null @@ -1,441 +0,0 @@ -notifications->countActiveNotifications(); - $current_page = ! empty( $_GET['page'] ) ? $_GET['page'] : ''; - $is_single_view = (bool) apply_filters( 'edd_admin_is_single_view', ! empty( $_GET['view'] ) ); - - $page_title = __( 'Downloads', 'easy-digital-downloads' ); - switch( $current_page ) { - case 'edd-settings': - $page_title = __( 'Settings', 'easy-digital-downloads' ); - break; - case 'edd-reports': - $page_title = __( 'Reports', 'easy-digital-downloads' ); - break; - case 'edd-payment-history': - $page_title = __( 'Orders', 'easy-digital-downloads' ); - break; - case 'edd-discounts': - $page_title = __( 'Discounts', 'easy-digital-downloads' ); - break; - case 'edd-customers': - $page_title = __( 'Customers', 'easy-digital-downloads' ); - break; - case 'edd-tools': - $page_title = __( 'Tools', 'easy-digital-downloads' ); - break; - case 'edd-addons': - $page_title = __( 'View Extensions', 'easy-digital-downloads' ); - if ( edd_is_pro() ) { - $page_title = __( 'Manage Extensions', 'easy-digital-downloads' ); - } - break; - default: - if ( ! empty( $_GET['page'] ) ) { - $page_title = ucfirst( str_replace( array( 'edd-', 'fes-' ), '', $current_page ) ); - } elseif ( ! empty( $_GET['post_type'] ) ) { - $post_type = get_post_type_object( $_GET['post_type'] ); - $page_title = $post_type->labels->name; - } - break; - } - - $page_title = apply_filters( 'edd_settings_page_title', $page_title, $current_page, $is_single_view ); - if ( ! empty( $page_title ) && empty( $is_single_view ) ) { - ?> - - - - -
    -
    - - - - - - - / - - < class="edd-header-page-title">> - - - -
    - -
    -
    -
    - - - __( 'General', 'easy-digital-downloads' ) - ); - } - - // Default links array - $links = array(); - - // Loop through sections - foreach ( $sections as $section_id => $section_name ) { - - // Tab & Section - $tab_url = add_query_arg( - array( - 'post_type' => 'download', - 'page' => 'edd-settings', - 'tab' => $active_tab, - 'section' => $section_id, - ), - edd_get_admin_base_url() - ); - - // Settings not updated - $tab_url = remove_query_arg( 'settings-updated', $tab_url ); - - // Class for link - $class = ( $section === $section_id ) - ? 'current' - : ''; - - // Add to links array - $links[ $section_id ] = '
  • ' . esc_html( $section_name ) . '
  • '; - } - if ( count( $links ) < 2 ) { - return; - } - ?> - -
    -
      - -
    -
    - - - -
    -
    -
    - -
    -
    -
    - - $stitle ) { - if ( is_string( $sid ) && ! empty( $sections ) && array_key_exists( $sid, $sections ) ) { - continue; - } else { - $has_main_settings = true; - break; - } - } - } - - // Unset 'main' if it's empty and default to the first non-empty if it's the chosen section. - if ( false === $has_main_settings ) { - unset( $sections['main'] ); - - if ( 'main' === $section ) { - foreach ( $sections as $section_key => $section_title ) { - if ( ! empty( $all_settings[ $active_tab ][ $section_key ] ) ) { - $section = $section_key; - $override = true; - break; - } - } - } - } - - // Start a buffer - ob_start(); ?> - -
    -

    - -
    -
    -
    -

    - -

    -
    -
    - -
    -

    - -

    - highest_license_key ) : - ?> -

    - 'edd-settings', - 'tab' => 'general', - ) - ); - printf( - wp_kses_post( - /* translators: 1. opening anchor tag; 2. closing anchor tag */ - __( 'Have a pass? You\'re ready to set up EDD (Pro). %1$sActivate Your Pass%2$s' ) - ), - '', - '' - ); - ?> -

    - -
    - $sections ) { - - // Loop through sections - foreach ( $sections as $section => $settings ) { - - // Check for backwards compatibility - $section_tabs = edd_get_settings_tab_sections( $tab ); - if ( ! is_array( $section_tabs ) || ! array_key_exists( $section, $section_tabs ) ) { - $section = 'main'; - $settings = $sections; - } - - // Current page - $page = "edd_settings_{$tab}_{$section}"; - - // Add the settings section - add_settings_section( - $page, - __return_null(), - '__return_false', - $page - ); - - foreach ( $settings as $option ) { - - // For backwards compatibility - if ( empty( $option['id'] ) ) { - continue; - } - - // Parse args - $args = wp_parse_args( $option, array( - 'section' => $section, - 'id' => null, - 'desc' => '', - 'name' => '', - 'size' => null, - 'options' => '', - 'std' => '', - 'min' => null, - 'max' => null, - 'step' => null, - 'chosen' => null, - 'multiple' => null, - 'placeholder' => null, - 'allow_blank' => true, - 'readonly' => false, - 'faux' => false, - 'tooltip_title' => false, - 'tooltip_desc' => false, - 'field_class' => '', - 'label_for' => false - ) ); - - // Callback fallback - $func = 'edd_' . $args['type'] . '_callback'; - $callback = ! function_exists( $func ) - ? 'edd_missing_callback' - : $func; - - // Link the label to the form field - if ( empty( $args['label_for'] ) ) { - $args['label_for'] = 'edd_settings[' . $args['id'] . ']'; - } - - // Add the settings field - add_settings_field( - 'edd_settings[' . $args['id'] . ']', - $args['name'], - $callback, - $page, - $page, - $args - ); - } - } - } - - // Register our setting in the options table - register_setting( 'edd_settings', 'edd_settings', 'edd_settings_sanitize' ); -} -add_action( 'admin_init', 'edd_register_settings' ); - -/** - * Retrieve the array of plugin settings - * - * @since 1.8 - * @since 3.0 Use a static variable internally to store registered settings - * @return array - */ -function edd_get_registered_settings() { - static $edd_settings = null; - - // Only build settings if not already built. - if ( null === $edd_settings ) { - $settings = new EDD\Admin\Settings\Register(); - $edd_settings = $settings->get(); - } - - return $edd_settings; -} - -/** - * Settings Sanitization - * - * Adds a settings error (for the updated message) - * At some point this will validate input - * - * @since 1.0.8.2 - * - * @param array $input The value inputted in the field - * - * @global array $edd_options Array of all the EDD Options - * - * @return array $input Sanitized value - */ -function edd_settings_sanitize( $input = array() ) { - global $edd_options; - - // Default values - $referrer = ''; - $setting_types = edd_get_registered_settings_types(); - $doing_section = ! empty( $_POST['_wp_http_referer'] ); - $input = ! empty( $input ) - ? $input - : array(); - - if ( true === $doing_section ) { - - // Pull out the tab and section - parse_str( $_POST['_wp_http_referer'], $referrer ); - $tab = ! empty( $referrer['tab'] ) ? sanitize_key( $referrer['tab'] ) : 'general'; - $section = ! empty( $referrer['section'] ) ? sanitize_key( $referrer['section'] ) : 'main'; - - if ( ! empty( $_POST['edd_tab_override'] ) ) { - $tab = sanitize_text_field( $_POST['edd_tab_override'] ); - } - - // Maybe override the tab section - if ( ! empty( $_POST['edd_section_override'] ) ) { - $section = sanitize_text_field( $_POST['edd_section_override'] ); - } - - // Get setting types for this section - $setting_types = edd_get_registered_settings_types( $tab, $section ); - - // Run a general sanitization for the tab for special fields (like taxes) - $input = apply_filters( 'edd_settings_' . $tab . '_sanitize', $input ); - - // Run a general sanitization for the section so custom tabs with sub-sections can save special data - $input = apply_filters( 'edd_settings_' . $tab . '-' . $section . '_sanitize', $input ); - } - - // Remove non setting types and merge settings together - $non_setting_types = edd_get_non_setting_types(); - $setting_types = array_diff( $setting_types, $non_setting_types ); - $output = array_merge( $edd_options, $input ); - - // Loop through settings, and apply any filters - foreach ( $setting_types as $key => $type ) { - - // Skip if type is empty - if ( empty( $type ) ) { - continue; - } - - if ( array_key_exists( $key, $output ) ) { - $output[ $key ] = apply_filters( 'edd_settings_sanitize_' . $type, $output[ $key ], $key ); - $output[ $key ] = apply_filters( 'edd_settings_sanitize', $output[ $key ], $key ); - } - - if ( true === $doing_section ) { - switch ( $type ) { - case 'checkbox': - case 'checkbox_description': - case 'gateways': - case 'multicheck': - case 'payment_icons': - if ( array_key_exists( $key, $input ) && $output[ $key ] === '-1' ) { - unset( $output[ $key ] ); - } - break; - case 'text': - if ( array_key_exists( $key, $input ) && empty( $input[ $key ] ) ) { - unset( $output[ $key ] ); - } - break; - case 'number': - if ( array_key_exists( $key, $output ) && ! array_key_exists( $key, $input ) ) { - unset( $output[ $key ] ); - } - - $setting_details = edd_get_registered_setting_details( $tab, $section, $key ); - $number_type = ! empty( $setting_details['step'] ) && false !== strpos( $setting_details['step'], '.' ) ? 'floatval' : 'intval'; - $minimum = isset( $setting_details['min'] ) ? $number_type( $setting_details['min'] ) : false; - $maximum = isset( $setting_details['max'] ) ? $number_type( $setting_details['max'] ) : false; - $new_value = $number_type( $input[ $key ] ); - - if ( ( false !== $minimum && $minimum > $new_value ) || ( false !== $maximum && $maximum < $new_value ) ) { - unset( $output[ $key ] ); - } - break; - default: - if ( array_key_exists( $key, $input ) && empty( $input[ $key ] ) || ( array_key_exists( $key, $output ) && ! array_key_exists( $key, $input ) ) ) { - unset( $output[ $key ] ); - } - break; - } - } elseif ( empty( $input[ $key ] ) ) { - unset( $output[ $key ] ); - } - } - - // Return output. - return (array) $output; -} - -/** - * Flattens the set of registered settings and their type so we can easily sanitize all the settings - * in a much cleaner set of logic in edd_settings_sanitize - * - * @since 2.6.5 - * @since 2.8 - Added the ability to filter setting types by tab and section - * - * @param $filtered_tab bool|string A tab to filter setting types by. - * @param $filtered_section bool|string A section to filter setting types by. - * - * @return array Key is the setting ID, value is the type of setting it is registered as - */ -function edd_get_registered_settings_types( $filtered_tab = false, $filtered_section = false ) { - $settings = edd_get_registered_settings(); - $setting_types = array(); - - foreach ( $settings as $tab_id => $tab ) { - - if ( false !== $filtered_tab && $filtered_tab !== $tab_id ) { - continue; - } - - foreach ( $tab as $section_id => $section_or_setting ) { - - // See if we have a setting registered at the tab level for backwards compatibility - if ( false !== $filtered_section && is_array( $section_or_setting ) && array_key_exists( 'type', $section_or_setting ) ) { - $setting_types[ $section_or_setting['id'] ] = $section_or_setting['type']; - continue; - } - - if ( false !== $filtered_section && $filtered_section !== $section_id ) { - continue; - } - - foreach ( $section_or_setting as $section_settings ) { - if ( ! empty( $section_settings['type'] ) ) { - $setting_types[ $section_settings['id'] ] = $section_settings['type']; - } - } - } - } - - return $setting_types; -} - -/** - * Allow getting a specific setting's details. - * - * @since 3.0 - * - * @param string $filtered_tab The tab the setting's section is in. - * @param string $filtered_section The section the setting is located in. - * @param string $setting_key The key associated with the setting. - * - * @return array - */ -function edd_get_registered_setting_details( $filtered_tab = '', $filtered_section = '', $setting_key = '' ) { - $settings = edd_get_registered_settings(); - $setting_details = array(); - - if ( isset( $settings[ $filtered_tab ][ $filtered_section][ $setting_key ] ) ) { - $setting_details = $settings[ $filtered_tab ][ $filtered_section][ $setting_key ]; - } - - return $setting_details; -} - -/** - * Return array of settings field types that aren't settings. - * - * @since 3.0 - * - * @return array - */ -function edd_get_non_setting_types() { - return apply_filters( 'edd_non_setting_types', array( - 'header', - 'descriptive_text', - 'hook', - ) ); -} - -/** - * Misc File Download Settings Sanitization - * - * @since 2.5 - * - * @param array $input The value inputted in the field - * - * @return string $input Sanitized value - */ -function edd_settings_sanitize_misc_file_downloads( $input ) { - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return $input; - } - - if ( edd_get_file_download_method() != $input['download_method'] || ! edd_htaccess_exists() ) { - // Force the .htaccess files to be updated if the Download method was changed. - edd_create_protection_files( true, $input['download_method'] ); - } - - return $input; -} - -add_filter( 'edd_settings_misc-file_downloads_sanitize', 'edd_settings_sanitize_misc_file_downloads' ); - -/** - * Misc Accounting Settings Sanitization - * - * @since 2.5 - * - * @param array $input The value inputted in the field - * - * @return array $input Sanitized value - */ -function edd_settings_sanitize_misc_accounting( $input ) { - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return $input; - } - - return $input; -} - -/** - * Taxes Settings Sanitization - * - * Adds a settings error (for the updated message) - * This also saves the tax rates table - * - * @since 1.6 - * - * @param array $input The value inputted in the field - * - * @return array $input Sanitized value. - */ -function edd_settings_sanitize_taxes( $input ) { - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return $input; - } - - if ( ! isset( $_POST['tax_rates'] ) ) { - return $input; - } - - $tax_rates = ! empty( $_POST['tax_rates'] ) - ? $_POST['tax_rates'] - : array(); - - foreach ( $tax_rates as $tax_rate ) { - - $scope = isset( $tax_rate['global'] ) - ? 'country' - : 'region'; - - $region = isset( $tax_rate['state'] ) - ? sanitize_text_field( $tax_rate['state'] ) - : ''; - - $name = '*' === $tax_rate['country'] - ? '' - : sanitize_text_field( $tax_rate['country'] ); - - if ( empty( $name ) ) { - $scope = 'global'; - } - - $adjustment_data = array( - 'name' => $name, - 'type' => 'tax_rate', - 'scope' => $scope, - 'amount_type' => 'percent', - 'amount' => floatval( $tax_rate['rate'] ), - 'description' => $region, - ); - - if ( ( empty( $adjustment_data['name'] ) && 'global' !== $adjustment_data['scope'] ) || $adjustment_data['amount'] < 0 ) { - continue; - } - - $existing_adjustment = edd_get_adjustments( $adjustment_data ); - - if ( ! empty( $existing_adjustment ) ) { - $adjustment = $existing_adjustment[0]; - $adjustment_data['status'] = sanitize_text_field( $tax_rate['status'] ); - - edd_update_adjustment( $adjustment->id, $adjustment_data ); - } else { - $adjustment_data['status'] = 'active'; - - edd_add_tax_rate( $adjustment_data ); - } - } - - return $input; -} -add_filter( 'edd_settings_taxes_sanitize', 'edd_settings_sanitize_taxes' ); - -/** - * Payment Gateways Settings Sanitization - * - * @since 2.7 - * - * @param array $input The value inputted in the field - * - * @return string $input Sanitized value - */ -function edd_settings_sanitize_gateways( $input = array() ) { - - // Bail if user cannot manage shop settings - if ( ! current_user_can( 'manage_shop_settings' ) || empty( $input['default_gateway'] ) ) { - return $input; - } - - // Unset the default gateway if there are no `gateways` enabled - if ( empty( $input['gateways'] ) || '-1' == $input['gateways'] ) { - unset( $input['default_gateway'] ); - - // Current gateway is no longer enabled, so - } elseif ( ! array_key_exists( $input['default_gateway'], $input['gateways'] ) ) { - $enabled_gateways = $input['gateways']; - - reset( $enabled_gateways ); - - $first_gateway = key( $enabled_gateways ); - - if ( $first_gateway ) { - $input['default_gateway'] = $first_gateway; - } - } - - return $input; -} -add_filter( 'edd_settings_gateways_sanitize', 'edd_settings_sanitize_gateways' ); - -/** - * Sanitize text fields - * - * @since 1.8 - * - * @param array $input The field value - * - * @return string $input Sanitized value - */ -function edd_sanitize_text_field( $input = '' ) { - $allowed_tags = edd_get_allowed_tags(); - - return trim( wp_kses( $input, $allowed_tags ) ); -} - -add_filter( 'edd_settings_sanitize_text', 'edd_sanitize_text_field' ); - -/** - * Sanitize HTML Class Names - * - * @since 2.6.11 - * - * @param string|array $class HTML Class Name(s) - * - * @return string $class - */ -function edd_sanitize_html_class( $class = '' ) { - - if ( is_string( $class ) ) { - $class = sanitize_html_class( $class ); - } else if ( is_array( $class ) ) { - $class = array_values( array_map( 'sanitize_html_class', $class ) ); - $class = implode( ' ', array_unique( $class ) ); - } - - return $class; -} - - -/** - * Sanitizes banned emails. - * - * @since 3.0 - */ -function edd_sanitize_banned_emails( $input ) { - - $emails = ''; - if ( ! empty( $input['banned_emails'] ) ) { - // Sanitize the input - $emails = array_map( 'trim', explode( "\n", $input['banned_emails'] ) ); - $emails = array_unique( $emails ); - $emails = array_map( 'sanitize_text_field', $emails ); - - foreach ( $emails as $id => $email ) { - if ( ! is_email( $email ) && $email[0] != '@' && $email[0] != '.' ) { - unset( $emails[ $id ] ); - } - } - } - $input['banned_emails'] = $emails; - - return $input; -} -add_filter( 'edd_settings_gateways-checkout_sanitize', 'edd_sanitize_banned_emails' ); - -/** - * Retrieve settings tabs - * - * @since 1.8 - * @since 2.11.4 Any tabs with no registered settings are filtered out in `edd_options_page`. - * - * @return array $tabs - */ -function edd_get_settings_tabs() { - return apply_filters( 'edd_settings_tabs', array( - 'general' => __( 'General', 'easy-digital-downloads' ), - 'gateways' => __( 'Payments', 'easy-digital-downloads' ), - 'emails' => __( 'Emails', 'easy-digital-downloads' ), - 'marketing' => __( 'Marketing', 'easy-digital-downloads' ), - 'styles' => __( 'Styles', 'easy-digital-downloads' ), - 'taxes' => __( 'Taxes', 'easy-digital-downloads' ), - 'privacy' => __( 'Policies', 'easy-digital-downloads' ), - 'extensions' => __( 'Extensions', 'easy-digital-downloads' ), - 'licenses' => __( 'Licenses', 'easy-digital-downloads' ), - 'misc' => __( 'Misc', 'easy-digital-downloads' ), - ) ); -} - -/** - * Retrieve settings tabs - * - * @since 2.5 - * @return array $section - */ -function edd_get_settings_tab_sections( $tab = false ) { - $tabs = array(); - $sections = edd_get_registered_settings_sections(); - - if ( $tab && ! empty( $sections[ $tab ] ) ) { - $tabs = $sections[ $tab ]; - } else if ( $tab ) { - $tabs = array(); - } - - return $tabs; -} - -/** - * Get the settings sections for each tab - * Uses a static to avoid running the filters on every request to this function - * - * @since 2.5 - * @return array Array of tabs and sections - */ -function edd_get_registered_settings_sections() { - static $sections = null; - - if ( null === $sections ) { - $sections = array( - 'general' => apply_filters( 'edd_settings_sections_general', array( - 'main' => __( 'Store', 'easy-digital-downloads' ), - 'currency' => __( 'Currency', 'easy-digital-downloads' ), - 'pages' => __( 'Pages', 'easy-digital-downloads' ), - 'api' => __( 'API', 'easy-digital-downloads' ), - ) ), - 'gateways' => apply_filters( 'edd_settings_sections_gateways', array( - 'main' => __( 'General', 'easy-digital-downloads' ), - 'checkout' => __( 'Checkout', 'easy-digital-downloads' ), - 'refunds' => __( 'Refunds', 'easy-digital-downloads' ), - 'accounting' => __( 'Accounting', 'easy-digital-downloads' ), - ) ), - 'emails' => apply_filters( 'edd_settings_sections_emails', array( - 'main' => __( 'General', 'easy-digital-downloads' ), - 'purchase_receipts' => __( 'Purchase Receipts', 'easy-digital-downloads' ), - 'sale_notifications' => __( 'Sale Notifications', 'easy-digital-downloads' ), - 'email_summaries' => __( 'Summaries', 'easy-digital-downloads' ), - ) ), - 'marketing' => apply_filters( 'edd_settings_sections_marketing', array( - 'main' => __( 'General', 'easy-digital-downloads' ), - ) ), - 'styles' => apply_filters( 'edd_settings_sections_styles', array( - 'main' => __( 'General', 'easy-digital-downloads' ), - 'buttons' => __( 'Buttons', 'easy-digital-downloads' ) - ) ), - 'taxes' => apply_filters( 'edd_settings_sections_taxes', array( - 'main' => __( 'General', 'easy-digital-downloads' ), - 'rates' => __( 'Rates', 'easy-digital-downloads' ), - ) ), - 'privacy' => apply_filters( 'edd_settings_section_privacy', array( - 'main' => __( 'Privacy Policy', 'easy-digital-downloads' ), - 'site_terms' => __( 'Terms & Agreements', 'easy-digital-downloads' ), - 'export_erase' => __( 'Export & Erase', 'easy-digital-downloads' ) - ) ), - 'extensions' => apply_filters( 'edd_settings_sections_extensions', array( - 'main' => __( 'Main', 'easy-digital-downloads' ) - ) ), - 'licenses' => apply_filters( 'edd_settings_sections_licenses', array() ), - 'misc' => apply_filters( 'edd_settings_sections_misc', array( - 'main' => __( 'General', 'easy-digital-downloads' ), - 'button_text' => __( 'Purchase Buttons', 'easy-digital-downloads' ), - 'file_downloads' => __( 'File Downloads', 'easy-digital-downloads' ), - ) ) - ); - } - - // Filter & return - return apply_filters( 'edd_settings_sections', $sections ); -} - -/** - * Retrieve a list of all published pages - * - * On large sites this can be expensive, so only load if on the settings page or $force is set to true - * - * @since 1.9.5 - * - * @param bool $force Force the pages to be loaded even if not on settings - * - * @return array $pages_options An array of the pages - */ -function edd_get_pages( $force = false ) { - - $pages_options = array( '' => __( 'None', 'easy-digital-downloads' ) ); - - if ( ( ! isset( $_GET['page'] ) || 'edd-settings' !== $_GET['page'] ) && ! $force ) { - return $pages_options; - } - - $pages = get_pages(); - if ( $pages ) { - foreach ( $pages as $page ) { - $pages_options[ $page->ID ] = $page->post_title; - } - } - - return $pages_options; -} - -/** - * Header Callback - * - * Renders the header. - * - * @since 1.0 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_header_callback( $args ) { - echo apply_filters( 'edd_after_setting_output', '', $args ); -} - -/** - * Checkbox Callback - * - * Renders checkboxes. - * - * @since 1.0 - * @since 3.0 Updated to use `EDD_HTML_Elements`. - * - * @param array $args Arguments passed by the setting. - */ -function edd_checkbox_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - if ( isset( $args['faux'] ) && true === $args['faux'] ) { - $name = ''; - } else { - $name = 'edd_settings[' . edd_sanitize_key( $args['id'] ) . ']'; - } - - $class = edd_sanitize_html_class( $args['field_class'] ); - - $args['name'] = $name; - $args['class'] = $class; - $args['current'] = ! empty( $edd_option ) - ? $edd_option - : ''; - $args['label'] = wp_kses_post( $args['desc'] ); - $args['value'] = 1; - - $html = ''; - $html .= '
    '; - $html .= EDD()->html->checkbox( $args ); - $html .= '
    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Checkbox with description Callback - * - * Renders checkboxes with a description. - * - * @since 3.0 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_checkbox_description_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - // Allow a setting or filter to override what the found value is. - if ( isset( $args['current'] ) ) { - $edd_option = $args['current']; - } - - if ( isset( $args['faux'] ) && true === $args['faux'] ) { - $name = ''; - } else { - $name = 'edd_settings[' . edd_sanitize_key( $args['id'] ) . ']'; - } - - $args['name'] = $name; - $args['class'] = edd_sanitize_html_class( $args['field_class'] ); - $args['current'] = ! empty( $edd_option ) ? $edd_option : ''; - $args['label'] = false; - $args['value'] = 1; - - $html = ''; - $html .= '
    '; - $html .= EDD()->html->checkbox( $args ); - $html .= ''; - $html .= '
    '; - if ( ! empty( $args['desc'] ) ) { - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - } - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Multicheck Callback - * - * Renders multiple checkboxes. - * - * @since 1.0 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_multicheck_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - $class = edd_sanitize_html_class( $args['field_class'] ); - - $html = ''; - if ( ! empty( $args['options'] ) ) { - $html .= ''; - - foreach ( $args['options'] as $key => $option ): - if ( isset( $edd_option[ $key ] ) ) { - $enabled = $option; - } else { - $enabled = null; - } - $html .= '
    '; - $html .= ' '; - $html .= ''; - $html .= '
    '; - endforeach; - $html .= '

    ' . $args['desc'] . '

    '; - } - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Payment method icons callback - * - * @since 2.1 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_payment_icons_callback( $args = array() ) { - - // Start an output buffer - ob_start(); - - $edd_option = edd_get_option( $args['id'] ); - $class = edd_sanitize_html_class( $args['field_class'] ); ?> - - - - -
      - - $option ) : - $enabled = isset( $edd_option[ $key ] ) - ? $option - : null; ?> - -
    • - -
    • - - - -
    - -

    - - $option ) : - $checked = false; - - if ( $edd_options && $edd_options == $key ) { - $checked = true; - } elseif ( isset( $args['std'] ) && $args['std'] == $key && ! $edd_options ) { - $checked = true; - } - - $html .= '
    '; - $html .= ' '; - $html .= ''; - $html .= '
    '; - endforeach; - - $html .= '

    ' . apply_filters( 'edd_after_setting_output', wp_kses_post( $args['desc'] ), $args ) . '

    '; - - echo $html; -} - -/** - * Gateways Callback - * - * Renders gateways fields. - * - * @since 1.0 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_gateways_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - $html = ''; - $html .= ''; - - if ( ! empty( $args['options'] ) ) { - $class = edd_sanitize_html_class( $args['field_class'] ); - $html .= '
      '; - - foreach ( $args['options'] as $key => $option ) { - if ( isset( $edd_option[ $key ] ) ) { - $enabled = '1'; - } else { - $enabled = null; - } - - $html .= '
    • '; - $html .= ''; - $html .= '
    • '; - } - - $html .= '
    '; - - $url = edd_link_helper( - 'https://easydigitaldownloads.com/downloads/category/extensions/gateways/', - array( - 'utm_medium' => 'payment-settings', - 'utm_content' => 'gateways', - ) - ); - - /* translators: 1. opening link tag; do not translate; 2. closing link tag; do not translate */ - $html .= '

    ' . esc_html__( 'Choose how you want to allow your customers to pay you.', 'easy-digital-downloads' ) . '
    ' . sprintf( __( 'More %1$sPayment Gateways%2$s are available.', 'easy-digital-downloads' ), '', '' ) . '

    '; - } - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Gateways Callback (drop down) - * - * Renders gateways select menu - * - * @since 1.5 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_gateway_select_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - $class = edd_sanitize_html_class( $args['field_class'] ); - if ( isset( $args['chosen'] ) ) { - $class .= ' edd-select-chosen'; - if ( is_rtl() ) { - $class .= ' chosen-rtl'; - } - } - - $html = ''; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Text Callback - * - * Renders text fields. - * - * @since 1.0 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_text_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - if ( $edd_option ) { - $value = $edd_option; - } elseif ( ! empty( $args['allow_blank'] ) && empty( $edd_option ) ) { - $value = ''; - } else { - $value = isset( $args['std'] ) ? $args['std'] : ''; - } - - if ( isset( $args['faux'] ) && true === $args['faux'] ) { - $args['readonly'] = true; - $value = isset( $args['std'] ) ? $args['std'] : ''; - $name = ''; - } else { - $name = 'name="edd_settings[' . esc_attr( $args['id'] ) . ']"'; - } - - $class = edd_sanitize_html_class( $args['field_class'] ); - - $placeholder = ! empty( $args['placeholder'] ) - ? ' placeholder="' . esc_attr( $args['placeholder'] ) . '"' - : ''; - - $disabled = ! empty( $args['disabled'] ) ? ' disabled="disabled"' : ''; - $readonly = $args['readonly'] === true ? ' readonly="readonly"' : ''; - $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular'; - $html = ''; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Email Callback - * - * Renders email fields. - * - * @since 2.8 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_email_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - if ( $edd_option ) { - $value = $edd_option; - } elseif ( ! empty( $args['allow_blank'] ) && empty( $edd_option ) ) { - $value = ''; - } else { - $value = isset( $args['std'] ) ? $args['std'] : ''; - } - - if ( isset( $args['faux'] ) && true === $args['faux'] ) { - $args['readonly'] = true; - $value = isset( $args['std'] ) ? $args['std'] : ''; - $name = ''; - } else { - $name = 'name="edd_settings[' . esc_attr( $args['id'] ) . ']"'; - } - - $class = edd_sanitize_html_class( $args['field_class'] ); - - $placeholder = isset( $args['placeholder'] ) - ? $args['placeholder'] - : ''; - - $disabled = ! empty( $args['disabled'] ) ? ' disabled="disabled"' : ''; - $readonly = $args['readonly'] === true ? ' readonly="readonly"' : ''; - $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular'; - $html = ''; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Number Callback - * - * Renders number fields. - * - * @since 1.9 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_number_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - if ( is_numeric( $edd_option ) ) { - $value = $edd_option; - } else { - $value = isset( $args['std'] ) ? $args['std'] : ''; - } - - if ( isset( $args['faux'] ) && true === $args['faux'] ) { - $args['readonly'] = true; - $value = isset( $args['std'] ) ? $args['std'] : ''; - $name = ''; - } else { - $name = 'name="edd_settings[' . esc_attr( $args['id'] ) . ']"'; - } - - $class = edd_sanitize_html_class( $args['field_class'] ); - - $max = isset( $args['max'] ) ? $args['max'] : 999999; - $min = isset( $args['min'] ) ? $args['min'] : 0; - $step = isset( $args['step'] ) ? $args['step'] : 1; - - $readonly = ! empty( $args['readonly'] ) ? ' readonly' : ''; - $disabled = ! empty( $args['disabled'] ) ? ' disabled="disabled"' : ''; - - $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular'; - $html = ''; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Textarea Callback - * - * Renders textarea fields. - * - * @since 1.0 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_textarea_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - if ( $edd_option ) { - if ( is_array( $edd_option ) ) { - $value = implode( "\n", maybe_unserialize( $edd_option ) ); - } else { - $value = $edd_option; - } - } else { - $value = isset( $args['std'] ) ? $args['std'] : ''; - } - - $class = edd_sanitize_html_class( $args['field_class'] ); - $placeholder = ! empty( $args['placeholder'] ) - ? ' placeholder="' . esc_attr( $args['placeholder'] ) . '"' - : ''; - - $readonly = $args['readonly'] === true ? ' readonly="readonly"' : ''; - - $html = ''; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Password Callback - * - * Renders password fields. - * - * @since 1.3 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_password_callback( $args ) { - $edd_options = edd_get_option( $args['id'] ); - - if ( $edd_options ) { - $value = $edd_options; - } else { - $value = isset( $args['std'] ) ? $args['std'] : ''; - } - - $class = edd_sanitize_html_class( $args['field_class'] ); - - $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular'; - $html = ''; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Missing Callback - * - * If a function is missing for settings callbacks alert the user. - * - * @since 1.3.1 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_missing_callback( $args ) { - printf( - wp_kses_post( - /* translators: %s: the setting ID */ - __( 'The callback function used for the %s setting is missing.', 'easy-digital-downloads' ) - ), - '' . esc_attr( $args['id'] ) . '' - ); -} - -/** - * Select Callback - * - * Renders select fields. - * - * @since 1.0 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_select_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - if ( $edd_option ) { - $value = $edd_option; - } else { - - // Properly set default fallback if the Select Field allows Multiple values - if ( empty( $args['multiple'] ) ) { - $value = isset( $args['std'] ) ? $args['std'] : ''; - } else { - $value = ! empty( $args['std'] ) ? $args['std'] : array(); - } - - } - - $placeholder = isset( $args['placeholder'] ) - ? $args['placeholder'] - : ''; - - $class = edd_sanitize_html_class( $args['field_class'] ); - - if ( isset( $args['chosen'] ) ) { - $class .= ' edd-select-chosen'; - if ( is_rtl() ) { - $class .= ' chosen-rtl'; - } - } - - // Nonce - $nonce = isset( $args['data']['nonce'] ) - ? ' data-nonce="' . sanitize_text_field( $args['data']['nonce'] ) . '"' - : ''; - - // If the Select Field allows Multiple values, save as an Array - $name_attr = 'edd_settings[' . esc_attr( $args['id'] ) . ']'; - $name_attr = ( $args['multiple'] ) ? $name_attr . '[]' : $name_attr; - - $html = ''; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Color select Callback - * - * Renders color select fields. - * - * @since 1.8 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_color_select_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - if ( $edd_option ) { - $value = $edd_option; - } else { - $value = isset( $args['std'] ) ? $args['std'] : ''; - } - - $class = edd_sanitize_html_class( $args['field_class'] ); - if ( $args['chosen'] ) { - $class .= 'edd-select-chosen'; - if ( is_rtl() ) { - $class .= ' chosen-rtl'; - } - } - - $html = ''; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Rich Editor Callback - * - * Renders rich editor fields. - * - * @since 1.0 - * - * @param array $args Arguments passed by the setting - */ -function edd_rich_editor_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - if ( $edd_option ) { - $value = $edd_option; - } else { - if ( ! empty( $args['allow_blank'] ) && empty( $edd_option ) ) { - $value = ''; - } else { - $value = isset( $args['std'] ) ? $args['std'] : ''; - } - } - - $rows = isset( $args['size'] ) ? $args['size'] : 20; - - $class = edd_sanitize_html_class( $args['field_class'] ); - - ob_start(); - - wp_editor( stripslashes( $value ), 'edd_settings_' . esc_attr( $args['id'] ), array( - 'textarea_name' => 'edd_settings[' . esc_attr( $args['id'] ) . ']', - 'textarea_rows' => absint( $rows ), - 'editor_class' => $class, - ) ); - - if ( ! empty( $args['desc'] ) ) { - echo '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - } - - $html = ob_get_clean(); - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Upload Callback - * - * Renders upload fields. - * - * @since 1.0 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_upload_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - if ( $edd_option ) { - $value = $edd_option; - } else { - $value = isset( $args['std'] ) ? $args['std'] : ''; - } - - $class = edd_sanitize_html_class( $args['field_class'] ); - - $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular'; - $html = '
    '; - $html .= ''; - $html .= ''; - $html .= '
    '; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Color picker Callback - * - * Renders color picker fields. - * - * @since 1.6 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_color_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - - if ( $edd_option ) { - $value = $edd_option; - } else { - $value = isset( $args['std'] ) ? $args['std'] : ''; - } - - $default = isset( $args['std'] ) ? $args['std'] : ''; - - $class = edd_sanitize_html_class( $args['field_class'] ); - - $html = ''; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Shop States Callback - * - * Renders states drop down based on the currently selected country - * - * @since 1.6 - * - * @param array $args Arguments passed by the setting - * - * @return void - */ -function edd_shop_states_callback( $args ) { - $edd_option = edd_get_option( $args['id'] ); - $states = edd_get_shop_states(); - $class = edd_sanitize_html_class( $args['field_class'] ); - $placeholder = isset( $args['placeholder'] ) - ? $args['placeholder'] - : ''; - - if ( $args['chosen'] ) { - $class .= ' edd-select-chosen'; - if ( is_rtl() ) { - $class .= ' chosen-rtl'; - } - } - - if ( empty( $states ) ) { - $class .= ' edd-no-states'; - } - - $html = ''; - $html .= '

    ' . wp_kses_post( $args['desc'] ) . '

    '; - - echo apply_filters( 'edd_after_setting_output', $html, $args ); -} - -/** - * Outputs the "Default Rate" setting. - * - * @since 3.0 - * - * @param array $args Arguments passed to the setting. - */ -function edd_tax_rate_callback( $args ) { - echo ''; - echo wp_kses_post( $args['desc'] ); -} - -/** - * Recapture Callback - * - * Renders Recapture Settings - * - * @since 2.10.2 - * @param array $args Arguments passed by the setting - * @return void - */ -function edd_recapture_callback($args) { - $client_connected = false; - - if ( class_exists( 'RecaptureEDD' ) ) { - $client_connected = RecaptureEDD::is_ready(); - } - - ob_start(); - - echo $args['desc']; - - // Output the appropriate button and label based on connection status - if ( $client_connected ) : - $connection_complete = get_option( 'recapture_api_key' ); - ?> -
    -

    - - ', - '' - ); - ?> -

    - - -

    - -

    - -

    - ', - '' - ); - ?> -

    - -
    - -

    - ', - '' - ); - ?> -

    - -

    - -

    - - - $rates, - 'nonce' => wp_create_nonce( 'edd-country-field-nonce' ), - 'i18n' => array( - /* translators: Tax rate country code */ - 'duplicateRate' => esc_html__( 'Duplicate tax rates are not allowed. Please deactivate the existing %s tax rate before adding or activating another.', 'easy-digital-downloads' ), - 'emptyCountry' => esc_html__( 'Please select a country.', 'easy-digital-downloads' ), - 'negativeTax' => esc_html__( 'Please enter a tax rate greater than 0.', 'easy-digital-downloads' ), - 'emptyTax' => esc_html__( 'Are you sure you want to add a 0% tax rate?', 'easy-digital-downloads' ), - ), - ) ); - - $templates = array( - 'meta', - 'row', - 'row-empty', - 'add', - 'bulk-actions' - ); - - echo '

    ' . $args['desc'] . '

    '; - - echo '
    '; - - foreach ( $templates as $tmpl ) { -?> - - - -' . esc_html( $args['tooltip_title'] ) . '
    : ' . esc_html( $args['tooltip_desc'] ) . '">'; - $has_p_tag = strstr( $html, '

    ' ); - $has_label = strstr( $html, '' ); - - // Insert tooltip at end of paragraph - if ( false !== $has_p_tag ) { - $html = str_replace( '

    ', $tooltip . '

    ', $html ); - - // Insert tooltip at end of label - } elseif ( false !== $has_label ) { - $html = str_replace( '', '' . $tooltip, $html ); - - // Append tooltip to end of HTML - } else { - $html .= $tooltip; - } - } - - return $html; -} -add_filter( 'edd_after_setting_output', 'edd_add_setting_tooltip', 10, 2 ); - -/** - * Filters the edd_get_option call for test_mode. - * - * This allows us to ensure that calls directly to edd_get_option respect the constant - * in addition to the edd_is_test_mode() function call and included filter. - * - * @since 3.1 - * - * @param bool $value If test_mode is enabled in the settings. - * @param string $key The key of the setting, should be test_mode. - * @param bool $default The default setting, which is 'false' for test_mode. - */ -function edd_filter_test_mode_option( $value, $key, $default ) { - if ( edd_is_test_mode_forced() ) { - $value = true; - } - - return $value; -} -add_filter( 'edd_get_option_test_mode', 'edd_filter_test_mode_option', 10, 3 ); - -/** - * Determine if test mode is being forced to true. - * - * Using the EDD_TEST_MODE and the edd_is_test_mode filter, determine if the value of true - * is being forced for test_mode so we can properly alter the setting for it. - * - * @since 3.1 - * - * @return bool If test_mode is being forced or not. - */ -function edd_is_test_mode_forced() { - if ( defined( 'EDD_TEST_MODE' ) && true === EDD_TEST_MODE ) { - return true; - } - - if ( false !== has_filter( 'edd_is_test_mode', '__return_true' ) ) { - return true; - } - - return false; -} - -/** - * Checks for an incorrect setting for the privacy policy. - * Required in updating from EDD 2.9.2 to 2.9.3. - */ -add_filter( 'edd_get_option_show_privacy_policy_on_checkout', function( $value ) { - if ( ! empty( $value ) ) { - return $value; - } - $fix_show_privacy_policy_setting = edd_get_option( 'show_agree_to_privacy_policy_on_checkout', false ); - if ( ! empty( $fix_show_privacy_policy_setting ) ) { - edd_update_option( 'show_privacy_policy_on_checkout', $fix_show_privacy_policy_setting ); - edd_delete_option( 'show_agree_to_privacy_policy_on_checkout' ); - - return $fix_show_privacy_policy_setting; - } - - return $value; -}, 10, 3 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/settings/settings-compatibility.php b/wp-content/plugins/easy-digital-downloads/includes/admin/settings/settings-compatibility.php deleted file mode 100644 index 6d9df044..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/settings/settings-compatibility.php +++ /dev/null @@ -1,164 +0,0 @@ -'; - /* translators: singular download label */ - $text = sprintf( __( 'Insert %s', 'easy-digital-downloads' ), edd_get_label_singular() ); - - // Output the thickbox button - echo '' . $icon . esc_html( $text ) . ''; -} -add_action( 'media_buttons', 'edd_media_button', 11 ); - -/** - * Admin Footer For Thickbox - * - * Prints the footer code needed for the Insert Download - * TinyMCE button. - * - * @since 1.0 - * @global $pagenow - * @global $typenow - * @return void - */ -function edd_admin_footer_for_thickbox() { - - // Bail if not a post new/edit screen - if ( ! edd_is_insertable_admin_page() ) { - return; - } - - // Styles - $styles = array( - 'text link' => esc_html__( 'Link', 'easy-digital-downloads' ), - 'button' => esc_html__( 'Button', 'easy-digital-downloads' ) - ); - - // Colors - $colors = edd_get_button_colors(); - - ?> - - - - - - - -
    -

    -
    - - - -
    - -
    -
    - - __( 'General', 'easy-digital-downloads' ), - 'api_keys' => __( 'API Keys', 'easy-digital-downloads' ), - 'betas' => __( 'Beta Versions', 'easy-digital-downloads' ), - 'logs' => __( 'Logs', 'easy-digital-downloads' ), - 'system_info' => __( 'System Info', 'easy-digital-downloads' ), - 'debug_log' => __( 'Debug Log', 'easy-digital-downloads' ), - 'import_export' => __( 'Import/Export', 'easy-digital-downloads' ) - ); - - // Unset the betas tab if not allowed - if ( count( edd_get_beta_enabled_extensions() ) <= 0 ) { - unset( $tabs['betas'] ); - } - } - - // Filter & return - return apply_filters( 'edd_tools_tabs', $tabs ); -} - -/** - * Display the recount stats. - * - * @since 2.5 - */ -function edd_tools_recount_stats_display() { - - // Bail if the user does not have the required capabilities. - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - do_action( 'edd_tools_recount_stats_before' ); - ?> - -
    -

    -
    -

    -
    - - - - - - - - - -
    - - - - - - - - - - - - Deletes
    all payment records, customers, and related log entries.', 'easy-digital-downloads' ) ); ?> - - - - - -
    - -
    -
    - - -
    -

    -
    -

    -

    -
    -

    - - - -

    -
    -
    -
    - prepare_items(); - $api_keys_table->display(); - $docs_link = edd_link_helper( - 'https://easydigitaldownloads.com/categories/docs/api-reference/', - array( - 'utm_medium' => 'tools', - 'utm_content' => 'api-documentation', - ) - ); - - $ios_link = edd_link_helper( - 'https://easydigitaldownloads.com/downloads/ios-sales-earnings-tracker/', - array( - 'utm_medium' => 'tools', - 'utm_content' => 'ios-app', - ) - ); - ?> -

    - ', - '', - '' - ); - ?> -

    - - -
    -

    -
    -

    -
    - - - $product ) : ?> - - - - - - - -
    - - value="1"/> - -
    - - - -
    -
    -
    - - 'Extension Name' - * - * @since 2.6.11 - * - * @return array $extensions The array of extensions - */ -function edd_get_beta_enabled_extensions() { - return (array) apply_filters( 'edd_beta_enabled_extensions', array() ); -} - -/** - * Check if a given extensions has beta support enabled - * - * @since 2.6.11 - * - * @param string $slug The slug of the extension to check - * - * @return bool True if enabled, false otherwise - */ -function edd_extension_has_beta_support( $slug ) { - $enabled_betas = edd_get_option( 'enabled_betas', array() ); - $return = false; - - if ( array_key_exists( $slug, $enabled_betas ) ) { - $return = true; - } - - return $return; -} - -/** - * Save enabled betas. - * - * @since 2.6.11 - */ -function edd_tools_enabled_betas_save() { - if ( ! wp_verify_nonce( $_POST['edd_save_betas_nonce'], 'edd_save_betas_nonce' ) ) { - return; - } - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - if ( ! empty( $_POST['enabled_betas'] ) ) { - $enabled_betas = array_filter( array_map( 'edd_tools_enabled_betas_sanitize_value', $_POST['enabled_betas'] ) ); - edd_update_option( 'enabled_betas', $enabled_betas ); - } else { - edd_delete_option( 'enabled_betas' ); - } -} - -add_action( 'edd_save_enabled_betas', 'edd_tools_enabled_betas_save' ); - -/** - * Sanitize the supported beta values by making them booleans - * - * @since 2.6.11 - * - * @param mixed $value The value being sent in, determining if beta support is enabled. - * - * @return bool - */ -function edd_tools_enabled_betas_sanitize_value( $value ) { - return filter_var( $value, FILTER_VALIDATE_BOOLEAN ); -} - -/** - * Save banned emails. - * - * @since 2.0 - */ -function edd_tools_banned_emails_save() { - if ( ! wp_verify_nonce( $_POST['edd_banned_emails_nonce'], 'edd_banned_emails_nonce' ) ) { - return; - } - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - if ( ! empty( $_POST['banned_emails'] ) ) { - // Sanitize the input - $emails = array_map( 'trim', explode( "\n", $_POST['banned_emails'] ) ); - $emails = array_unique( $emails ); - $emails = array_map( 'sanitize_text_field', $emails ); - - foreach ( $emails as $id => $email ) { - if ( ! is_email( $email ) && $email[0] != '@' && $email[0] != '.' ) { - unset( $emails[ $id ] ); - } - } - } else { - $emails = ''; - } - - edd_update_option( 'banned_emails', $emails ); -} -add_action( 'edd_save_banned_emails', 'edd_tools_banned_emails_save' ); - -/** - * Execute upgrade notice clear. - * - * @since 2.3.5 - */ -function edd_tools_clear_upgrade_notice() { - if ( ! wp_verify_nonce( $_POST['edd_clear_upgrades_nonce'], 'edd_clear_upgrades_nonce' ) ) { - return; - } - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - delete_option( 'edd_doing_upgrade' ); -} -add_action( 'edd_clear_doing_upgrade', 'edd_tools_clear_upgrade_notice' ); - -/** - * Display the tools import/export tab. - * - * @since 2.0 - */ -function edd_tools_import_export_display() { - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - do_action( 'edd_tools_import_export_before' ); - ?> - -
    -

    -
    -

    -
    - -
    - - -

    - -

    - - - - -
    - - -
    -
    -
    - -
    -

    -
    -

    -
    - -
    - - -

    - -

    - - - - -
    - - -
    -
    -
    - -
    -

    -
    -

    -

    - Reports page.', 'easy-digital-downloads' ) - ), - esc_url( - edd_get_admin_url( - array( - 'page' => 'edd-reports', - 'view' => 'export', - ) - ) - ) - ); - ?> -

    -
    -

    -

    - - -

    -
    -
    -
    - -
    -

    -
    -

    -
    -

    - -

    -

    - - - -

    -
    -
    -
    - $edd_settings, - 'edd_tax_rates' => $edd_tax_rates - ) ); -} -add_action( 'edd_export_settings', 'edd_tools_import_export_process_export' ); - -/** - * Process a settings import from a json file - * - * @since 1.7 - * @return void - */ -function edd_tools_import_export_process_import() { - - if ( empty( $_POST['edd_import_nonce'] ) ) { - return; - } - - if ( ! wp_verify_nonce( $_POST['edd_import_nonce'], 'edd_import_nonce' ) ) { - return; - } - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - if ( edd_get_file_extension( $_FILES['import_file']['name'] ) != 'json' ) { - wp_die( __( 'Please upload a valid .json file', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 400 ) ); - } - - $import_file = $_FILES['import_file']['tmp_name']; - - if ( empty( $import_file ) ) { - wp_die( __( 'Please upload a file to import', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 400 ) ); - } - - // Retrieve the settings from the file and convert the json object to an array - $settings = edd_object_to_array( json_decode( file_get_contents( $import_file ) ) ); - - if ( ! isset( $settings['edd_settings'] ) ) { - - // Process a settings export from a pre 2.8 version of EDD - update_option( 'edd_settings', $settings ); - - } else { - - // Update the settings from a 2.8+ export file - $edd_settings = $settings['edd_settings']; - update_option( 'edd_settings', $edd_settings ); - - $edd_tax_rates = $settings['edd_tax_rates']; - if ( ! empty( $edd_tax_rates ) ) { - foreach( $edd_tax_rates as $rate ) { - $scope = 'country'; - if ( ! empty( $rate['scope'] ) ) { - $scope = $rate['scope']; - } elseif ( empty( $rate['global'] ) && ! empty( $rate['state'] ) ) { - $scope = 'region'; - } elseif ( empty( $rate['country'] && empty( $rate['state'] ) ) ) { - $scope = 'global'; - } - edd_add_tax_rate( - array( - 'name' => esc_attr( $rate['country'] ), - 'status' => ! empty( $rate['status'] ) ? esc_attr( $rate['status'] ) : 'active', - 'description' => esc_attr( $rate['state'] ), - 'amount' => floatval( $rate['rate'] ), - 'scope' => esc_attr( $scope ), - ) - ); - } - } - - } - - edd_redirect( edd_get_admin_url( array( - 'page' => 'edd-tools', - 'edd-message' => 'settings-imported', - 'tab' => 'import_export', - ) ) ); -} -add_action( 'edd_import_settings', 'edd_tools_import_export_process_import' ); - -/** - * Display the debug log tab - * - * @since 2.8.7 - */ -function edd_tools_debug_log_display() { - $edd_logs = EDD()->debug_log; - - // Setup fallback incase no file exists - $path = $edd_logs->get_log_file_path(); - $log = $edd_logs->get_file_contents(); - $path_output = ! empty( $path ) - ? wp_normalize_path( $path ) - : esc_html__( 'No File', 'easy-digital-downloads' ); - $log_output = ! empty( $log ) - ? wp_normalize_path( $log ) - : esc_html__( 'Log is Empty', 'easy-digital-downloads' ); - ?> - -
    -

    -
    -
    -

    - ', - 'edd_debug_log', - '' - ); - ?> -

    - -

    - - "this.form['edd-debug-log-contents'].focus();this.form['edd-debug-log-contents'].select();document.execCommand('copy');return false;" ) ); - - // Only show the "Clear Log" button if there is a log to clear - if ( ! empty( $log ) ) { - submit_button( __( 'Clear Log', 'easy-digital-downloads' ), 'secondary edd-inline-button', 'edd-clear-debug-log', false ); - } - - ?> -

    - -
    - -

    - : - -

    -
    -
    - - debug_log; - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - check_admin_referer( 'edd-debug-log-action' ); - - if ( isset( $_REQUEST['edd-download-debug-log'] ) ) { - nocache_headers(); - - header( 'Content-Type: text/plain' ); - header( 'Content-Disposition: attachment; filename="edd-debug-log.txt"' ); - - echo wp_strip_all_tags( $_REQUEST['edd-debug-log-contents'] ); - exit; - - } elseif ( isset( $_REQUEST['edd-clear-debug-log'] ) ) { - - // Clear the debug log. - $edd_logs->clear_log_file(); - - edd_redirect( edd_get_admin_url( array( - 'page' => 'edd-tools', - 'tab' => 'debug_log' - ) ) ); - } -} -add_action( 'edd_submit_debug_log', 'edd_handle_submit_debug_log' ); - -/** - * Redirects requests to the old sales log to the orders page. - * - * @since 3.0 - */ -function edd_redirect_sales_log() { - if ( edd_is_admin_page( 'tools', 'logs' ) && ! empty( $_GET['view'] ) && 'sales' === $_GET['view'] ) { - $query_args = array( - 'page' => 'edd-payment-history' - ); - - $args_to_remap = array( - 'download' => 'product-id', - 'start-date' => 'start-date', - 'end-date' => 'end-date' - ); - - foreach( $args_to_remap as $old_arg => $new_arg ) { - if ( ! empty( $_GET[ $old_arg ] ) ) { - $query_args[ $new_arg ] = urlencode( $_GET[ $old_arg ] ); - } - } - - wp_safe_redirect( esc_url_raw( add_query_arg( $query_args, edd_get_admin_base_url() ) ) ); - exit; - } -} -add_action( 'admin_init', 'edd_redirect_sales_log' ); - -/** - * Renders the Logs tab in the Tools screen. - * - * @since 3.0 - */ -function edd_tools_tab_logs() { - if ( ! current_user_can( 'view_shop_reports' ) ) { - return; - } - - require_once EDD_PLUGIN_DIR . 'includes/admin/tools/logs.php'; - - $current_view = 'file_downloads'; - $log_views = edd_log_default_views(); - - if ( isset( $_GET['view'] ) && array_key_exists( $_GET['view'], $log_views ) ) { - $current_view = sanitize_text_field( $_GET['view'] ); - } - - /** - * Fires when a given logs view should be rendered. - * - * The dynamic portion of the hook name, `$current_view`, represents the slug - * of the logs view to render. - * - * @since 1.4 - */ - do_action( 'edd_logs_view_' . $current_view ); -} -add_action( 'edd_tools_tab_logs', 'edd_tools_tab_logs' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-all-stats.php b/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-all-stats.php deleted file mode 100644 index d97d4c4e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-all-stats.php +++ /dev/null @@ -1,136 +0,0 @@ - 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Process a step - * - * @since 2.5 - * @return bool - */ - public function process_step() { - if ( ! $this->can_export() ) { - wp_die( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $download_ids = $this->get_download_ids(); - - if ( ! empty( $download_ids ) && is_array( $download_ids ) ) { - foreach ( $this->get_download_ids() as $download_id ) { - edd_recalculate_download_sales_earnings( $download_id ); - } - } - - if ( ! empty( $download_ids ) ) { - $this->done = false; - return true; - } else { - $this->delete_data( 'edd_recount_all_total' ); - $this->delete_data( 'edd_temp_recount_all_stats' ); - $this->delete_data( 'edd_temp_payment_items' ); - $this->delete_data( 'edd_temp_download_ids' ); - $this->delete_data( 'edd_temp_processed_payments' ); - $this->done = true; - $this->message = __( 'Earnings and sales stats successfully recounted.', 'easy-digital-downloads' ); - return false; - } - } - - /** - * Returns the download IDs to process during this step. - * - * @since 3.0 - * - * @return int[] - */ - private function get_download_ids() { - if ( null === $this->download_ids ) { - $this->download_ids = get_posts( array( - 'post_status' => 'any', - 'post_type' => 'download', - 'posts_per_page' => $this->per_step, - 'offset' => ( $this->step - 1 ) * $this->per_step, - 'fields' => 'ids', - ) ); - } - - return $this->download_ids; - } - - /** - * Delete an option - * - * @since 2.5 - * @param string $key The option_name to delete - * @return void - */ - protected function delete_data( $key ) { - global $wpdb; - $wpdb->delete( $wpdb->options, array( 'option_name' => $key ) ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-customer-stats.php b/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-customer-stats.php deleted file mode 100644 index b44e1cb7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-customer-stats.php +++ /dev/null @@ -1,147 +0,0 @@ - $this->per_step, - 'offset' => $this->per_step * ( $this->step - 1 ), - 'orderby' => 'id', - 'order' => 'DESC', - ); - - $customers = edd_get_customers( $args ); - - if ( $customers ) { - foreach ( $customers as $customer ) { - $customer->recalculate_stats(); - } - - return true; - } - - return false; - - } - - /** - * Return the calculated completion percentage - * - * @since 2.5 - * @return int - */ - public function get_percentage_complete() { - - $total = edd_count_customers(); - $percentage = 100; - - if( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the payments export - * - * @since 2.5 - * @param array $request The Form Data passed into the batch processing - */ - public function set_properties( $request ) { } - - /** - * Process a step - * - * @since 2.5 - * @return bool - */ - public function process_step() { - - if ( ! $this->can_export() ) { - wp_die( __( 'You do not have permission to export data.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $had_data = $this->get_data(); - - if( $had_data ) { - $this->done = false; - return true; - } else { - $this->done = true; - $this->message = __( 'Customer stats successfully recounted.', 'easy-digital-downloads' ); - return false; - } - } - - public function headers() { - edd_set_time_limit(); - } - - /** - * Perform the export - * - * @since 2.5 - * @return void - */ - public function export() { - - // Set headers - $this->headers(); - - edd_die(); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-download-stats.php b/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-download-stats.php deleted file mode 100644 index d4bb5137..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-download-stats.php +++ /dev/null @@ -1,164 +0,0 @@ - $this->download_id, - 'post_type' => 'edd_log', - 'posts_per_page' => $this->per_step, - 'post_status' => 'publish', - 'paged' => $this->step, - 'log_type' => 'sale', - 'fields' => 'ids', - ) - ), '3.0' ); - - if ( ! empty( $this->download_id ) && is_numeric( $this->download_id ) ) { - edd_recalculate_download_sales_earnings( $this->download_id ); - - return false; - } - - return false; - } - - /** - * Return the calculated completion percentage - * - * @since 2.5 - * @return int - */ - public function get_percentage_complete() { - return 100; - } - - /** - * Set the properties specific to the payments export - * - * @since 2.5 - * @param array $request The Form Data passed into the batch processing - */ - public function set_properties( $request ) { - $this->download_id = isset( $request['download_id'] ) ? sanitize_text_field( $request['download_id'] ) : false; - } - - /** - * Process a step - * - * @since 2.5 - * @return bool - */ - public function process_step() { - if ( ! $this->can_export() ) { - wp_die( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $more_to_do = $this->get_data(); - - if( $more_to_do ) { - $this->done = false; - return true; - } else { - $this->delete_data( 'edd_recount_total_' . $this->download_id ); - $this->delete_data( 'edd_temp_recount_download_stats' ); - $this->done = true; - $this->message = sprintf( __( 'Earnings and sales stats successfully recounted for %s.', 'easy-digital-downloads' ), get_the_title( $this->download_id ) ); - return false; - } - } - - public function headers() { - edd_set_time_limit(); - } - - /** - * Perform the export - * - * @since 2.5 - * @return void - */ - public function export() { - - // Set headers - $this->headers(); - - edd_die(); - } - - /** - * Delete an option - * - * @since 2.5 - * @param string $key The option_name to delete - * @return void - */ - protected function delete_data( $key ) { - global $wpdb; - $wpdb->delete( $wpdb->options, array( 'option_name' => $key ) ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-single-customer-stats.php b/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-single-customer-stats.php deleted file mode 100644 index a508853b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-single-customer-stats.php +++ /dev/null @@ -1,146 +0,0 @@ -customer_id ); - if ( $customer ) { - $customer->recalculate_stats(); - $this->result_data = array( - 'purchase_count' => (int) $customer->purchase_count, - 'purchase_value' => esc_html( edd_currency_filter( edd_format_amount( $customer->purchase_value ) ) ), - ); - return true; - } - - return false; - - } - - /** - * Return the calculated completion percentage - * - * @since 2.5 - * @return int - */ - public function get_percentage_complete() { - - $total = edd_count_orders( - array( - 'customer_id' => $this->customer_id, - ) - ); - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the payments export - * - * @since 2.5 - * @param array $request The Form Data passed into the batch processing - */ - public function set_properties( $request ) { - $this->customer_id = isset( $request['customer_id'] ) ? sanitize_text_field( $request['customer_id'] ) : false; - } - - /** - * Process a step - * - * @since 2.5 - * @return bool - */ - public function process_step() { - - if ( ! $this->can_export() ) { - wp_die( esc_html__( 'You do not have permission to modify this data.', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $had_data = $this->get_data(); - - if ( ! $had_data ) { - $this->done = false; - return true; - } - $this->done = true; - $this->message = esc_html__( 'Customer stats successfully recounted.', 'easy-digital-downloads' ); - - return false; - } - - public function headers() { - edd_set_time_limit(); - } - - /** - * Perform the export - * - * @since 2.5 - * @return void - */ - public function export() { - - // Set headers - $this->headers(); - - edd_die(); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-store-earnings.php b/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-store-earnings.php deleted file mode 100644 index 0af60fcd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-recount-store-earnings.php +++ /dev/null @@ -1,258 +0,0 @@ -step == 1 ) { - $this->delete_data( 'edd_temp_recount_earnings' ); - } - - $total = get_option( 'edd_temp_recount_earnings', false ); - - if ( false === $total ) { - $total = (float) 0; - $this->store_data( 'edd_temp_recount_earnings', $total ); - } - - $accepted_statuses = apply_filters( 'edd_recount_accepted_statuses', edd_get_gross_order_statuses() ); - - $args = apply_filters( - 'edd_recount_earnings_args', - array( - 'number' => $this->per_step, - 'offset' => $this->per_step * ( $this->step - 1 ), - 'status' => $accepted_statuses, - 'fields' => 'total', - 'no_found_rows' => true, - 'type' => array( 'sale', 'refund' ), - ) - ); - - $orders = edd_get_orders( $args ); - - if ( ! empty( $orders ) ) { - $total += array_sum( $orders ); - - if ( $total < 0 ) { - $total = 0; - } - - $total = round( $total, edd_currency_decimal_filter() ); - - $this->store_data( 'edd_temp_recount_earnings', $total ); - - return true; - - } - - update_option( 'edd_earnings_total', $total, false ); - set_transient( 'edd_earnings_total', $total, 86400 ); - - return false; - - } - - /** - * Return the calculated completion percentage - * - * @since 2.5 - * @return int - */ - public function get_percentage_complete() { - - $total = $this->get_stored_data( 'edd_recount_earnings_total' ); - - if ( false === $total ) { - $accepted_statuses = apply_filters( 'edd_recount_accepted_statuses', edd_get_gross_order_statuses() ); - $args = apply_filters( - 'edd_recount_earnings_total_args', - array( - 'status' => $accepted_statuses, - 'type' => array( 'sale', 'refund' ), - ) - ); - $total = apply_filters( 'edd_recount_store_earnings_total', edd_count_orders( $args ) ); - - $this->store_data( 'edd_recount_earnings_total', $total ); - } - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the payments export - * - * @since 2.5 - * @param array $request The Form Data passed into the batch processing - */ - public function set_properties( $request ) {} - - /** - * Process a step - * - * @since 2.5 - * @return bool - */ - public function process_step() { - - if ( ! $this->can_export() ) { - wp_die( __( 'You do not have permission to export data.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $had_data = $this->get_data(); - - if( $had_data ) { - $this->done = false; - return true; - } else { - delete_transient( 'edd_stats_earnings' ); - delete_transient( 'edd_stats_sales' ); - delete_transient( 'edd_estimated_monthly_stats' . true ); - delete_transient( 'edd_estimated_monthly_stats' . false ); - - $this->delete_data( 'edd_recount_earnings_total' ); - $this->delete_data( 'edd_temp_recount_earnings' ); - $this->done = true; - $this->message = __( 'Store earnings successfully recounted.', 'easy-digital-downloads' ); - return false; - } - } - - public function headers() { - edd_set_time_limit(); - } - - /** - * Perform the export - * - * @since 2.5 - * @return void - */ - public function export() { - - // Set headers - $this->headers(); - - edd_die(); - } - - /** - * Given a key, get the information from the Database Directly - * - * @since 2.5 - * @param string $key The option_name - * @return mixed Returns the data from the database - */ - private function get_stored_data( $key ) { - global $wpdb; - $value = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key ) ); - - if ( empty( $value ) ) { - return false; - } - - $maybe_json = json_decode( $value ); - if ( ! is_null( $maybe_json ) ) { - $value = json_decode( $value, true ); - } - - return $value; - } - - /** - * Give a key, store the value - * - * @since 2.5 - * @param string $key The option_name - * @param mixed $value The value to store - * @return void - */ - private function store_data( $key, $value ) { - global $wpdb; - - $value = is_array( $value ) ? wp_json_encode( $value ) : esc_attr( $value ); - - $data = array( - 'option_name' => $key, - 'option_value' => $value, - 'autoload' => 'no', - ); - - $formats = array( - '%s', '%s', '%s', - ); - - $wpdb->replace( $wpdb->options, $data, $formats ); - } - - /** - * Delete an option - * - * @since 2.5 - * @param string $key The option_name to delete - * @return void - */ - private function delete_data( $key ) { - global $wpdb; - $wpdb->delete( $wpdb->options, array( 'option_name' => $key ) ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-reset-stats.php b/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-reset-stats.php deleted file mode 100644 index 93e94316..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/class-edd-tools-reset-stats.php +++ /dev/null @@ -1,292 +0,0 @@ -get_stored_data( 'edd_reset_tables_to_truncate' ); - - if ( ! is_array( $tables ) ) { - return false; - } - - $offset = ( $this->step - 1 ) * $this->per_step; - $step_items = array_slice( $tables, $offset, $this->per_step ); - - if ( $step_items ) { - $query = "TRUNCATE TABLE {$step_items[0]}"; - edd_debug_log( var_export($query, true), true ); - $wpdb->query( $query ); - - return true; - } - - return false; - } - - /** - * Return the percentage completed. - * - * @since 2.5 - * - * @return float Percentage complete. - */ - public function get_percentage_complete() { - $items = $this->get_stored_data( 'edd_reset_tables_to_truncate' ); - $total = count( $items ); - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the export. - * - * @since 2.5 - * - * @param array $request Form data passed into the batch processor. - */ - public function set_properties( $request ) {} - - /** - * Process a step. - * - * @since 2.5 - * - * @return bool True if more data exists, false otherwise. - */ - public function process_step() { - if ( ! $this->can_export() ) { - wp_die( esc_html__( 'You do not have permission to export data.', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $had_data = $this->get_data(); - - if ( $had_data ) { - $this->done = false; - return true; - } else { - update_option( 'edd_earnings_total', 0, false ); - update_option( 'edd_earnings_total_without_tax', 0, false ); - delete_transient( 'edd_earnings_total' ); - delete_transient( 'edd_earnings_total_without_tax' ); - delete_transient( 'edd_estimated_monthly_stats' . true ); - delete_transient( 'edd_estimated_monthly_stats' . false ); - $this->delete_data( 'edd_reset_tables_to_truncate' ); - - // Reset the sequential order numbers - if ( edd_get_option( 'enable_sequential' ) ) { - delete_option( 'edd_last_payment_number' ); - delete_option( 'edd_next_order_number' ); - } - - $this->done = true; - $this->message = __( 'Your store has been successfully reset.', 'easy-digital-downloads' ); - return false; - } - } - - /** - * Export headers. - * - * @since 2.5 - */ - public function headers() { - edd_set_time_limit(); - } - - /** - * Perform the export. - * - * @since 2.5 - */ - public function export() { - - // Set headers. - $this->headers(); - - edd_die(); - } - - /** - * Fetch data prior to batch processing starting. - * - * @since 2.5 - */ - public function pre_fetch() { - if ( 1 === $this->step ) { - $this->delete_data( 'edd_reset_tables_to_truncate' ); - } - - $tables = get_option( 'edd_reset_tables_to_truncate', false ); - - if ( false === $tables ) { - $tables = array(); - - foreach ( EDD()->components as $component ) { - /** @var $component EDD\Component */ - - // Objects - $object = $component->get_interface( 'table' ); - if ( $object instanceof \EDD\Database\Table && $object->exists() ) { - if ( 'adjustments' === $object->name ) { - continue; - } - $tables[] = $object->table_name; - } - - // Meta - $meta = $component->get_interface( 'meta' ); - if ( $meta instanceof \EDD\Database\Table && $meta->exists() ) { - if ( 'adjustmentmeta' === $meta->name ) { - continue; - } - $tables[] = $meta->table_name; - } - } - - $tables = apply_filters( 'edd_reset_tables_to_truncate', $tables ); - - $this->store_data( 'edd_reset_tables_to_truncate', $tables ); - } - } - - /** - * Given a key, get the information from the database directly. - * - * @since 2.5 - * - * @param string $key Option name. - * @return mixed Returns the data from the database. - */ - private function get_stored_data( $key ) { - global $wpdb; - - $value = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM {$wpdb->options} WHERE option_name = %s", $key ) ); - - if ( empty( $value ) ) { - return array(); - } - - $maybe_json = json_decode( $value ); - if ( ! is_null( $maybe_json ) ) { - $value = json_decode( $value, true ); - } - - return (array) $value; - } - - /** - * Store a value in the wp_options table. - * - * @since 2.5 - * - * @param string $key Option name. - * @param mixed $value Option value. - */ - private function store_data( $key = '', $value = '' ) { - global $wpdb; - - // Bail if no key was passed. - if ( empty( $key ) ) { - return; - } - - // Parse value. - $value = is_array( $value ) - ? wp_json_encode( $value ) - : esc_attr( $value ); - - // Prepare data. - $data = array( - 'option_name' => $key, - 'option_value' => $value, - 'autoload' => 'no', - ); - - $formats = array( '%s', '%s', '%s' ); - - // Update database. - $wpdb->replace( $wpdb->options, $data, $formats ); - } - - /** - * Delete an option. - * - * @since 2.5 - * - * @param string $key Option name. - */ - private function delete_data( $key = '' ) { - global $wpdb; - - // Bail if no key was passed. - if ( empty( $key ) ) { - return; - } - - // Delete from the database. - $wpdb->delete( $wpdb->options, array( 'option_name' => $key ) ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/logs.php b/wp-content/plugins/easy-digital-downloads/includes/admin/tools/logs.php deleted file mode 100644 index e32c2a40..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/tools/logs.php +++ /dev/null @@ -1,241 +0,0 @@ -prepare_items(); ?> - -
    - - -
    - - - - views(); - $logs_table->advanced_filters(); - ?> -
    - display(); - ?> - - - -
    - __( 'File Downloads', 'easy-digital-downloads' ), - 'gateway_errors' => __( 'Payment Errors', 'easy-digital-downloads' ), - 'api_requests' => __( 'API Requests', 'easy-digital-downloads' ) - ) ); -} - -/** - * Renders the Reports page views drop down - * - * @since 1.3 - * @since 3.0 Deprecated, and modified to look like the 3.0 approach - * - * @return void -*/ -function edd_log_views() { - static $once = false; - - // Only once - if ( true === $once ) { - return; - } - - // Only once - $once = true; ?> - - - -
    - -
    -
    - - - - - - - - - - - - - - - data = $data->get(); - } - - /** - * Send the data to the EDD server - * - * @access private - * - * @param bool $override If we should override the tracking setting. - * @param bool $ignore_last_checkin If we should ignore when the last check in was. - * - * @return bool - */ - public function send_checkin( $override = false, $ignore_last_checkin = false ) { - - if ( ! $this->can_send_data( $override, $ignore_last_checkin ) ) { - return false; - } - - $this->setup_data(); - - if ( empty( $this->data ) ) { - return false; - } - - wp_remote_post( - $this->telemetry_server, - array( - 'method' => 'POST', - 'timeout' => 8, - 'redirection' => 5, - 'httpversion' => '1.1', - 'blocking' => false, - 'body' => $this->data, - 'user-agent' => 'EDD/' . EDD_VERSION . '; ' . $this->data['id'], - ) - ); - - update_option( 'edd_tracking_last_send', time(), false ); - - return true; - } - - /** - * Check for a new opt-in on settings save - * - * This runs during the sanitation of General settings, thus the return - * - * @return array - */ - public function check_for_settings_optin( $input ) { - - // Send an intial check in on settings save - if ( isset( $input['allow_tracking'] ) && $input['allow_tracking'] == 1 ) { - $this->send_checkin( true ); - } - - return $input; - } - - /** - * Adds the tracking setting to the miscellaneous settings section. - * - * @since 3.1.1 - * @param array $settings - * @return array - */ - public function register_setting( $settings ) { - $hidden = edd_get_option( 'allow_tracking', false ) ? '' : 'edd-hidden'; - - $settings['main']['allow_tracking'] = array( - 'id' => 'allow_tracking', - 'name' => __( 'Join the EDD Community', 'easy-digital-downloads' ), - 'check' => __( 'Yes, I want to help!', 'easy-digital-downloads' ) . ' ', - 'desc' => $this->get_telemetry_description(), - 'type' => 'checkbox_description', - ); - - return $settings; - } - - /** - * Check for a new opt-in via the admin notice - * - * @return void - */ - public function check_for_optin() { - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - edd_update_option( 'allow_tracking', 1 ); - - $this->send_checkin( true ); - - update_option( 'edd_tracking_notice', 1, false ); - } - - /** - * Check for a new opt-in via the admin notice - * - * @return void - */ - public function check_for_optout() { - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - edd_delete_option( 'allow_tracking' ); - update_option( 'edd_tracking_notice', 1, false ); - edd_redirect( remove_query_arg( 'edd_action' ) ); - } - - /** - * Get the last time a checkin was sent - * - * @access private - * @return false|string - */ - private function get_last_send() { - return get_option( 'edd_tracking_last_send' ); - } - - /** - * Schedule a weekly checkin - * - * We send once a week (while tracking is allowed) to check in, which can be - * used to determine active sites. - * - * @return void - */ - public function schedule_send() { - if ( edd_doing_cron() ) { - add_action( 'edd_weekly_scheduled_events', array( $this, 'send_checkin' ) ); - } - } - - /** - * Display the admin notice to users that have not opted-in or out - * - * @return void - */ - public function admin_notice() { - static $once = null; - - // Only 1 notice. - if ( ! is_null( $once ) ) { - return; - } - - // Already ran once. - $once = true; - - // Bail if already noticed. - if ( get_option( 'edd_tracking_notice' ) ) { - return; - } - - // Bail if already allowed. - if ( edd_get_option( 'allow_tracking', false ) ) { - return; - } - - // Bail if user cannot decide. - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - // No notices for local installs. - if ( edd_is_dev_environment() ) { - update_option( 'edd_tracking_notice', 1, false ); - return; - } - - if ( edd_is_admin_page() && ! edd_is_admin_page( 'index.php' ) && ! edd_is_insertable_admin_page() ) { - - // Add the notice. - EDD()->notices->add_notice( - array( - 'id' => 'edd-allow-tracking', - 'class' => 'updated', - 'message' => $this->get_admin_notice_message(), - 'is_dismissible' => false, - ) - ); - } - } - - /** - * Build the admin notice message. - * - * @since 3.1.1 - * @return array - */ - private function get_admin_notice_message() { - - return array( - '' . __( 'Join the EDD Community', 'easy-digital-downloads' ) . '', - $this->get_telemetry_description(), - sprintf( - '%s %s', - esc_url( add_query_arg( 'edd_action', 'opt_into_tracking' ) ), - __( 'Allow', 'easy-digital-downloads' ), - esc_url( add_query_arg( 'edd_action', 'opt_out_of_tracking' ) ), - __( 'Do not allow', 'easy-digital-downloads' ) - ), - ); - } - - /** - * Gets the telemetry description. - * - * @since 3.1.1 - * @return string - */ - public function get_telemetry_description() { - - return __( 'Help us provide a better experience and faster fixes by sharing some anonymous data about how you use Easy Digital Downloads.', 'easy-digital-downloads' ) . - ' ' . - sprintf( - /* translators: %1$s Link to tracking information, do not translate. %2$s clsoing link tag, do not translate */ - __( '%1$sHere is what we track.%2$s', 'easy-digital-downloads' ), - '', - '' - ); - } - - /** - * Whether we can send the data. - * - * @since 3.1.1 - * @param bool $override If we should override the tracking setting. - * @param bool $ignore_last_checkin If we should ignore when the last check in was. - * @return bool - */ - public function can_send_data( $override, $ignore_last_checkin ) { - - // Never send data from a dev site. - if ( edd_is_dev_environment() || edd_is_test_mode() ) { - return false; - } - - if ( function_exists( 'wp_get_environment_type' ) && 'staging' === wp_get_environment_type() ) { - return false; - } - - if ( ! $this->tracking_allowed() && ! $override ) { - return false; - } - - // Send a maximum of once per week. - $last_send = $this->get_last_send(); - if ( ! $ignore_last_checkin && is_numeric( $last_send ) && $last_send > strtotime( '-1 week' ) ) { - return false; - } - - return true; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/classes/class-file-download-log-migration.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/classes/class-file-download-log-migration.php deleted file mode 100644 index 711cd99d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/classes/class-file-download-log-migration.php +++ /dev/null @@ -1,237 +0,0 @@ -get_log_ids_for_current_step(); - - if ( ! is_array( $step_items ) ) { - return false; - } - - if ( empty( $step_items ) ) { - return false; - } - - foreach ( $step_items as $log_id ) { - $log_id = (int) $log_id; - $sanitized_log_id = absint( $log_id ); - - if ( $sanitized_log_id !== $log_id ) { - edd_debug_log( "Log ID mismatch, skipping log ID {$log_id}" ); - continue; - } - - $has_customer_id = (int) get_post_meta( $log_id, '_edd_log_customer_id', true ); - if ( ! empty( $has_customer_id ) ) { - continue; - } - - $payment_id = (int) get_post_meta( $log_id, '_edd_log_payment_id', true ); - if ( ! empty( $payment_id ) ) { - $customer_id = edd_get_payment_customer_id( $payment_id ); - - if ( $customer_id < 0 ) { - $customer_id = 0; - } - - update_post_meta( $log_id, '_edd_log_customer_id', $customer_id ); - delete_post_meta( $log_id, '_edd_log_user_info' ); - } - } - - return true; - } - - /** - * Return the calculated completion percentage - * - * @since 2.9.2 - * @return int - */ - public function get_percentage_complete() { - $total = (int) get_option( 'edd_fdlm_total_logs', 0 ); - - $percentage = 100; - - if( $total > 0 ) { - $percentage = ( ( $this->step * $this->per_step ) / $total ) * 100; - } - - if( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } - - /** - * Set the properties specific to the payments export - * - * @since 2.9.2 - * @param array $request The Form Data passed into the batch processing - */ - public function set_properties( $request ) {} - - /** - * Process a step - * - * @since 2.9.2 - * @return bool - */ - public function process_step() { - - if ( ! $this->can_export() ) { - wp_die( - __( 'You do not have permission to run this upgrade.', 'easy-digital-downloads' ), - __( 'Error', 'easy-digital-downloads' ), - array( 'response' => 403 ) ); - } - - $had_data = $this->get_data(); - - if( $had_data ) { - $this->done = false; - return true; - } else { - $this->done = true; - delete_option( 'edd_fdlm_total_logs' ); - delete_option( 'edd_fdlm_term_tax_id' ); - $this->message = __( 'File download logs updated successfully.', 'easy-digital-downloads' ); - edd_set_upgrade_complete( 'update_file_download_log_data' ); - return false; - } - } - - public function headers() { - edd_set_time_limit(); - } - - /** - * Perform the export - * - * @access public - * @since 2.9.2 - * @return void - */ - public function export() { - - // Set headers - $this->headers(); - - edd_die(); - } - - /** - * Fetch total number of log IDs needing migration - * - * @since 2.9.5 - * - * @global object $wpdb - */ - public function pre_fetch() { - global $wpdb; - - // Default count (assume no entries) - $log_id_count = 0; - - // Query for a term ID (make sure log items exist) - $term_id = $wpdb->get_var( "SELECT term_id FROM {$wpdb->terms} WHERE name = 'file_download' LIMIT 1" ); - - // Log items exist... - if ( ! empty( $term_id ) ) { - - // Query for possible entries... - $term_tax_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_taxonomy_id FROM {$wpdb->term_taxonomy} WHERE term_id = %d AND taxonomy = 'edd_log_type' LIMIT 1", $term_id ) ); - - // Entries exist... - if ( ! empty( $term_tax_id ) ) { - - // Cache the term taxonomy ID - update_option( 'edd_fdlm_term_tax_id', $term_tax_id ); - - // Count the number of entries! - $log_id_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->term_relationships} WHERE term_taxonomy_id = %d", $term_tax_id ) ); - } - } - - // Temporarily save the number of rows - update_option( 'edd_fdlm_total_logs', (int) $log_id_count ); - } - - /** - * Get the log IDs (50 based on this->per_step) for the current step - * - * @since 2.9.5 - * - * @global object $wpdb - * @return array - */ - private function get_log_ids_for_current_step() { - global $wpdb; - - // Default values - $log_ids = array(); - $offset = ( $this->step * $this->per_step ) - $this->per_step; - - // Count the number of entries! - $term_tax_id = (int) get_option( 'edd_fdlm_term_tax_id', 0 ); - - // Only query if term taxonomy ID was prefetched - if ( ! empty( $term_tax_id ) ) { - $log_ids = $wpdb->get_col( $wpdb->prepare( "SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id = %d LIMIT %d, %d", $term_tax_id, $offset, $this->per_step ) ); - } - - // Always return an array - return ! is_wp_error( $log_ids ) - ? (array) $log_ids - : array(); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/deprecated-upgrade-functions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/deprecated-upgrade-functions.php deleted file mode 100644 index 2b846620..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/deprecated-upgrade-functions.php +++ /dev/null @@ -1,911 +0,0 @@ -=' ) ) { - return; - } - - edd_set_time_limit(); - - $query = new WP_Query( array( - 'post_type' => 'download', - 'posts_per_page' => -1, - 'post_status' => 'publish' - ) ); - $downloads = $query->get_posts(); - - if ( $downloads ) { - $edd_log = new EDD_Logging(); - foreach ( $downloads as $download ) { - // Convert sale logs - $sale_logs = edd_get_download_sales_log( $download->ID, false ); - - if ( $sale_logs ) { - foreach ( $sale_logs['sales'] as $sale ) { - $log_data = array( - 'post_parent' => $download->ID, - 'post_date' => $sale['date'], - 'log_type' => 'sale' - ); - - $log_meta = array( - 'payment_id'=> $sale['payment_id'] - ); - - $log = $edd_log->insert_log( $log_data, $log_meta ); - } - } - - // Convert file download logs - $file_logs = edd_get_file_download_log( $download->ID, false ); - - if ( $file_logs ) { - foreach ( $file_logs['downloads'] as $log ) { - $log_data = array( - 'post_parent' => $download->ID, - 'post_date' => $log['date'], - 'log_type' => 'file_download' - - ); - - $log_meta = array( - 'user_info' => $log['user_info'], - 'file_id' => $log['file_id'], - 'ip' => $log['ip'] - ); - - $log = $edd_log->insert_log( $log_data, $log_meta ); - } - } - } - } - add_option( 'edd_logs_upgraded', '1' ); -} - -/** - * Upgrade routine for v1.3.0 - * - * @since 1.3.0 - * @deprecated 3.1.2 - * @return void - */ -function edd_v134_upgrades() { - $general_options = get_option( 'edd_settings_general' ); - - // Settings already updated - if ( isset( $general_options['failure_page'] ) ) { - return; - } - - // Failed Purchase Page - $failed = wp_insert_post( - array( - 'post_title' => __( 'Transaction Failed', 'easy-digital-downloads' ), - 'post_content' => __( 'Your transaction failed, please try again or contact site support.', 'easy-digital-downloads' ), - 'post_status' => 'publish', - 'post_author' => 1, - 'post_type' => 'page', - 'post_parent' => $general_options['purchase_page'], - 'comment_status' => 'closed' - ) - ); - - $general_options['failure_page'] = $failed; - - update_option( 'edd_settings_general', $general_options ); -} - -/** - * Upgrade routine for v1.4 - * - * @since 1.4 - * @deprecated 3.1.2 - * @global $edd_options Array of all the EDD Options - * @return void - */ -function edd_v14_upgrades() { - - /** Add [edd_receipt] to success page **/ - $success_page = get_post( edd_get_option( 'success_page' ) ); - - // Check for the [edd_receipt] shortcode and add it if not present - if ( strpos( $success_page->post_content, '[edd_receipt' ) === false ) { - $page_content = $success_page->post_content .= "\n[edd_receipt]"; - wp_update_post( array( 'ID' => edd_get_option( 'success_page' ), 'post_content' => $page_content ) ); - } - - /** Convert Discounts to new Custom Post Type **/ - $discounts = get_option( 'edd_discounts' ); - - if ( $discounts ) { - foreach ( $discounts as $discount ) { - - $discount_id = wp_insert_post( array( - 'post_type' => 'edd_discount', - 'post_title' => isset( $discount['name'] ) ? $discount['name'] : '', - 'post_status' => 'active' - ) ); - - $meta = array( - 'code' => isset( $discount['code'] ) ? $discount['code'] : '', - 'uses' => isset( $discount['uses'] ) ? $discount['uses'] : '', - 'max_uses' => isset( $discount['max'] ) ? $discount['max'] : '', - 'amount' => isset( $discount['amount'] ) ? $discount['amount'] : '', - 'start' => isset( $discount['start'] ) ? $discount['start'] : '', - 'expiration' => isset( $discount['expiration'] ) ? $discount['expiration'] : '', - 'type' => isset( $discount['type'] ) ? $discount['type'] : '', - 'min_price' => isset( $discount['min_price'] ) ? $discount['min_price'] : '' - ); - - foreach ( $meta as $meta_key => $value ) { - update_post_meta( $discount_id, '_edd_discount_' . $meta_key, $value ); - } - } - - // Remove old discounts from database - delete_option( 'edd_discounts' ); - } -} - -/** - * Upgrade routine for v1.5 - * - * @since 1.5 - * @deprecated 3.1.2 - * @return void - */ -function edd_v15_upgrades() { - // Update options for missing tax settings - $tax_options = get_option( 'edd_settings_taxes' ); - - // Set include tax on checkout to off - $tax_options['checkout_include_tax'] = 'no'; - - // Check if prices are displayed with taxes - $tax_options['prices_include_tax'] = isset( $tax_options['taxes_on_prices'] ) - ? 'yes' - : 'no'; - - update_option( 'edd_settings_taxes', $tax_options ); - - // Flush the rewrite rules for the new /edd-api/ end point - flush_rewrite_rules( false ); -} - -/** - * Upgrades for EDD v2.0 - * - * @since 2.0 - * @deprecated 3.1.2 - * @return void - */ -function edd_v20_upgrades() { - global $edd_options, $wpdb; - - edd_set_time_limit(); - - // Upgrade for the anti-behavior fix - #2188 - if ( ! empty( $edd_options['disable_ajax_cart'] ) ) { - unset( $edd_options['enable_ajax_cart'] ); - } else { - $edd_options['enable_ajax_cart'] = '1'; - } - - // Upgrade for the anti-behavior fix - #2188 - if ( ! empty( $edd_options['disable_cart_saving'] ) ) { - unset( $edd_options['enable_cart_saving'] ); - } else { - $edd_options['enable_cart_saving'] = '1'; - } - - // Properly set the register / login form options based on whether they were enabled previously - #2076 - if ( ! empty( $edd_options['show_register_form'] ) ) { - $edd_options['show_register_form'] = 'both'; - } else { - $edd_options['show_register_form'] = 'none'; - } - - // Remove all old, improperly expired sessions. See https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/2031 - $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%' AND option_value+0 < 2789308218" ); - - update_option( 'edd_settings', $edd_options ); -} - -/** - * Upgrades for EDD v2.0 and sequential payment numbers - * - * @deprecated 3.1.1.2 EDD no longer implies that past orders will be updated. - * @since 2.0 - * @return void - */ -function edd_v20_upgrade_sequential_payment_numbers() { - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_die( __( 'You do not have permission to do shop upgrades', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - edd_set_time_limit(); - - $step = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1; - $total = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false; - - if ( empty( $total ) || $total <= 1 ) { - $payments = edd_count_payments(); - foreach ( $payments as $status ) { - $total += $status; - } - } - - $orders = edd_get_orders( array( - 'number' => 100, - 'offset' => $step == 1 ? 0 : ( $step - 1 ) * 100, - 'order' => 'asc', - ) ); - - if ( $orders ) { - $prefix = edd_get_option( 'sequential_prefix' ); - $postfix = edd_get_option( 'sequential_postfix' ); - $number = ! empty( $_GET['custom'] ) ? absint( $_GET['custom'] ) : intval( edd_get_option( 'sequential_start', 1 ) ); - - foreach ( $orders as $order ) { - - // Re-add the prefix and postfix - $payment_number = $prefix . $number . $postfix; - - edd_update_order( $order->id, array( - 'order_number' => $payment_number - ) ); - - // Increment the payment number - $number++; - } - - // Payments found so upgrade them - $step++; - $redirect = add_query_arg( array( - 'page' => 'edd-upgrades', - 'edd-upgrade' => 'upgrade_sequential_payment_numbers', - 'step' => urlencode( $step ), - 'custom' => urlencode( $number ), - 'total' => urlencode( $total ), - ), admin_url( 'index.php' ) ); - - edd_redirect( $redirect ); - - // No more payments found, finish up - } else { - delete_option( 'edd_upgrade_sequential' ); - delete_option( 'edd_doing_upgrade' ); - - edd_redirect( admin_url() ); - } -} - -/** - * Upgrades for EDD v2.1 and the new customers database - * - * @since 2.1 - * @deprecated 3.1.2 EDD no longer implies that past orders will be updated. - * @return void - */ -function edd_v21_upgrade_customers_db() { - global $wpdb; - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_die( __( 'You do not have permission to do shop upgrades', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - edd_set_time_limit(); - - $number = 20; - $step = isset( $_GET['step'] ) - ? absint( $_GET['step'] ) - : 1; - $offset = $step == 1 - ? 0 - : ( $step - 1 ) * $number; - - $emails = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT meta_value FROM {$wpdb->postmeta} WHERE meta_key = '_edd_payment_user_email' LIMIT %d,%d;", $offset, $number ) ); - - if ( $emails ) { - - foreach ( $emails as $email ) { - - if ( EDD()->customers->exists( $email ) ) { - continue; // Allow the upgrade routine to be safely re-run in the case of failure - } - - $payments = new EDD_Payments_Query( array( - 'user' => $email, - 'order' => 'ASC', - 'orderby' => 'ID', - 'number' => 9999999, - 'page' => $step - ) ); - - $payments = $payments->get_payments(); - - if ( $payments ) { - - $total_value = 0.00; - $total_count = 0; - - foreach ( $payments as $payment ) { - - if ( 'revoked' == $payment->status || 'complete' == $payment->status ) { - $total_value += $payment->total; - $total_count += 1; - } - } - - $ids = wp_list_pluck( $payments, 'ID' ); - - $user = get_user_by( 'email', $email ); - - $args = array( - 'email' => $email, - 'user_id' => $user ? $user->ID : 0, - 'name' => $user ? $user->display_name : '', - 'purchase_count' => $total_count, - 'purchase_value' => round( $total_value, 2 ), - 'payment_ids' => implode( ',', array_map( 'absint', $ids ) ), - 'date_created' => $payments[0]->date - ); - - $customer_id = EDD()->customers->add( $args ); - - foreach ( $ids as $id ) { - update_post_meta( $id, '_edd_payment_customer_id', $customer_id ); - } - } - } - - // Customers found so upgrade them - $step++; - $redirect = add_query_arg( array( - 'page' => 'edd-upgrades', - 'edd-upgrade' => 'upgrade_customers_db', - 'step' => urlencode( $step ), - ), admin_url( 'index.php' ) ); - - edd_redirect( $redirect ); - - // No more customers found, finish up - } else { - delete_option( 'edd_doing_upgrade' ); - - edd_redirect( admin_url() ); - } -} - -/** - * Fixes the edd_log meta for 2.2.6 - * - * @since 2.2.6 - * @deprecated 3.1.2 EDD no longer implies that past orders will be updated. - * @return void - */ -function edd_v226_upgrade_payments_price_logs_db() { - global $wpdb; - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_die( __( 'You do not have permission to do shop upgrades', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - edd_set_time_limit(); - - $number = 25; - $step = isset( $_GET['step'] ) - ? absint( $_GET['step'] ) - : 1; - $offset = $step == 1 - ? 0 - : ( $step - 1 ) * $number; - - if ( 1 === $step ) { - // Check if we have any variable price products on the first step - $sql = "SELECT ID FROM {$wpdb->posts} p LEFT JOIN {$wpdb->postmeta} m ON p.ID = m.post_id WHERE m.meta_key = '_variable_pricing' AND m.meta_value = 1 LIMIT 1"; - $has_variable = $wpdb->get_col( $sql ); - if ( empty( $has_variable ) ) { - // We had no variable priced products, so go ahead and just complete - delete_option( 'edd_doing_upgrade' ); - edd_redirect( admin_url() ); - } - } - - $payment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'edd_payment' ORDER BY post_date DESC LIMIT %d,%d;", $offset, $number ) ); - if ( ! empty( $payment_ids ) ) { - foreach ( $payment_ids as $payment_id ) { - $payment_downloads = edd_get_payment_meta_downloads( $payment_id ); - $variable_downloads = array(); - - // May not be an array due to some very old payments, move along - if ( ! is_array( $payment_downloads ) ) { - continue; - } - - foreach ( $payment_downloads as $download ) { - // Don't care if the download is a single price id - if ( ! isset( $download['options']['price_id'] ) ) { - continue; - } - $variable_downloads[] = array( 'id' => $download['id'], 'price_id' => $download['options']['price_id'] ); - } - $variable_download_ids = array_unique( wp_list_pluck( $variable_downloads, 'id' ) ); - $unique_download_ids = implode( ',', $variable_download_ids ); - - // If there were no downloads, just fees, move along - if ( empty( $unique_download_ids ) ) { - continue; - } - - // Get all Log Ids where the post parent is in the set of download IDs we found in the cart meta - $logs = $wpdb->get_results( "SELECT m.post_id AS log_id, p.post_parent AS download_id FROM {$wpdb->postmeta} m LEFT JOIN {$wpdb->posts} p ON m.post_id = p.ID WHERE meta_key = '_edd_log_payment_id' AND meta_value = $payment_id AND p.post_parent IN ($unique_download_ids)", ARRAY_A ); - $mapped_logs = array(); - - // Go through each cart item - foreach ( $variable_downloads as $cart_item ) { - // Itterate through the logs we found attached to this payment - foreach ( $logs as $key => $log ) { - // If this Log ID is associated with this download ID give it the price_id - if ( (int) $log['download_id'] === (int) $cart_item['id'] ) { - $mapped_logs[$log['log_id']] = $cart_item['price_id']; - // Remove this Download/Log ID from the list, for multipurchase compatibility - unset( $logs[$key] ); - // These aren't the logs we're looking for. Move Along, Move Along. - break; - } - } - } - - if ( ! empty( $mapped_logs ) ) { - $update = "UPDATE {$wpdb->postmeta} SET meta_value = "; - $case = "CASE post_id "; - foreach ( $mapped_logs as $post_id => $value ) { - $case .= "WHEN {$post_id} THEN {$value} "; - } - $case .= "END "; - $log_ids = implode( ',', array_keys( $mapped_logs ) ); - $where = "WHERE post_id IN ({$log_ids}) AND meta_key = '_edd_log_price_id'"; - $sql = $update . $case . $where; - - // Execute our query to update this payment - $wpdb->query( $sql ); - } - } - - // More Payments found so upgrade them - $step++; - $redirect = add_query_arg( array( - 'page' => 'edd-upgrades', - 'edd-upgrade' => 'upgrade_payments_price_logs_db', - 'step' => urlencode( $step ), - ), admin_url( 'index.php' ) ); - - edd_redirect( $redirect ); - } else { - delete_option( 'edd_doing_upgrade' ); - edd_redirect( admin_url() ); - } -} - -/** - * Upgrades payment taxes for 2.3 - * - * @since 2.3 - * @deprecated 3.1.2 EDD no longer implies that past orders will be updated. - * @return void - */ -function edd_v23_upgrade_payment_taxes() { - global $wpdb; - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_die( __( 'You do not have permission to do shop upgrades', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - edd_set_time_limit(); - - $number = 50; - $step = isset( $_GET['step'] ) - ? absint( $_GET['step'] ) - : 1; - $offset = $step == 1 - ? 0 - : ( $step - 1 ) * $number; - - if ( $step < 2 ) { - // Check if we have any payments before moving on - $sql = "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'edd_payment' LIMIT 1"; - $has_payments = $wpdb->get_col( $sql ); - - if ( empty( $has_payments ) ) { - // We had no payments, just complete - edd_set_upgrade_complete( 'upgrade_payment_taxes' ); - delete_option( 'edd_doing_upgrade' ); - edd_redirect( admin_url() ); - } - } - - $total = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false; - if ( empty( $total ) || $total <= 1 ) { - $total_sql = "SELECT COUNT(ID) as total_payments FROM {$wpdb->posts} WHERE post_type = 'edd_payment'"; - $results = $wpdb->get_row( $total_sql, 0 ); - - $total = $results->total_payments; - } - - $payment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'edd_payment' ORDER BY post_date DESC LIMIT %d,%d;", $offset, $number ) ); - - if ( $payment_ids ) { - - // Add the new _edd_payment_meta item - foreach ( $payment_ids as $payment_id ) { - $payment_tax = edd_get_payment_tax( $payment_id ); - edd_update_payment_meta( $payment_id, '_edd_payment_tax', $payment_tax ); - } - - // Payments found so upgrade them - $step++; - $redirect = add_query_arg( array( - 'page' => 'edd-upgrades', - 'edd-upgrade' => 'upgrade_payment_taxes', - 'step' => urlencode( $step ), - 'number' => urlencode( $number ), - 'total' => urlencode( $total ), - ), admin_url( 'index.php' ) ); - - edd_redirect( $redirect ); - - // No more payments found, finish up - } else { - edd_set_upgrade_complete( 'upgrade_payment_taxes' ); - delete_option( 'edd_doing_upgrade' ); - edd_redirect( admin_url() ); - } -} - -/** - * Run the upgrade for the customers to find all payment attachments - * - * @since 2.3 - * @deprecated 3.1.2 EDD no longer implies that past orders will be updated. - * @return void - */ -function edd_v23_upgrade_customer_purchases() { - global $wpdb; - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_die( __( 'You do not have permission to do shop upgrades', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - edd_set_time_limit(); - - $number = 50; - $step = isset( $_GET['step'] ) - ? absint( $_GET['step'] ) - : 1; - $offset = $step == 1 - ? 0 - : ( $step - 1 ) * $number; - - if ( $step < 2 ) { - // Check if we have any payments before moving on - $sql = "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'edd_payment' LIMIT 1"; - $has_payments = $wpdb->get_col( $sql ); - - if ( empty( $has_payments ) ) { - // We had no payments, just complete - edd_set_upgrade_complete( 'upgrade_customer_payments_association' ); - delete_option( 'edd_doing_upgrade' ); - edd_redirect( admin_url() ); - } - } - - $total = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false; - - if ( empty( $total ) || $total <= 1 ) { - $total = EDD()->customers->count(); - } - - $customers = edd_get_customers( array( 'number' => $number, 'offset' => $offset ) ); - - if ( ! empty( $customers ) ) { - - foreach ( $customers as $customer ) { - - // Get payments by email and user ID - $select = "SELECT ID FROM {$wpdb->posts} p "; - $join = "LEFT JOIN {$wpdb->postmeta} m ON p.ID = m.post_id "; - $where = "WHERE p.post_type = 'edd_payment' "; - - if ( ! empty( $customer->user_id ) && intval( $customer->user_id ) > 0 ) { - $where .= "AND ( ( m.meta_key = '_edd_payment_user_email' AND m.meta_value = '{$customer->email}' ) OR ( m.meta_key = '_edd_payment_customer_id' AND m.meta_value = '{$customer->id}' ) OR ( m.meta_key = '_edd_payment_user_id' AND m.meta_value = '{$customer->user_id}' ) )"; - } else { - $where .= "AND ( ( m.meta_key = '_edd_payment_user_email' AND m.meta_value = '{$customer->email}' ) OR ( m.meta_key = '_edd_payment_customer_id' AND m.meta_value = '{$customer->id}' ) ) "; - } - - $sql = $select . $join . $where; - $found_payments = $wpdb->get_col( $sql ); - - $unique_payment_ids = array_unique( array_filter( $found_payments ) ); - - if ( ! empty( $unique_payment_ids ) ) { - - $unique_ids_string = implode( ',', $unique_payment_ids ); - $customer_data = array( 'payment_ids' => $unique_ids_string ); - - $purchase_value_sql = "SELECT SUM( m.meta_value ) FROM {$wpdb->postmeta} m LEFT JOIN {$wpdb->posts} p ON m.post_id = p.ID WHERE m.post_id IN ( {$unique_ids_string} ) AND p.post_status IN ( 'publish', 'revoked' ) AND m.meta_key = '_edd_payment_total'"; - $purchase_value = $wpdb->get_col( $purchase_value_sql ); - - $purchase_count_sql = "SELECT COUNT( m.post_id ) FROM {$wpdb->postmeta} m LEFT JOIN {$wpdb->posts} p ON m.post_id = p.ID WHERE m.post_id IN ( {$unique_ids_string} ) AND p.post_status IN ( 'publish', 'revoked' ) AND m.meta_key = '_edd_payment_total'"; - $purchase_count = $wpdb->get_col( $purchase_count_sql ); - - if ( ! empty( $purchase_value ) && ! empty( $purchase_count ) ) { - - $purchase_value = $purchase_value[0]; - $purchase_count = $purchase_count[0]; - - $customer_data['purchase_count'] = $purchase_count; - $customer_data['purchase_value'] = $purchase_value; - } - - } else { - $customer_data['purchase_count'] = 0; - $customer_data['purchase_value'] = 0; - $customer_data['payment_ids'] = ''; - } - - if ( ! empty( $customer_data ) ) { - $customer = new EDD_Customer( $customer->id ); - $customer->update( $customer_data ); - } - } - - // More Payments found so upgrade them - $step++; - $redirect = add_query_arg( array( - 'page' => 'edd-upgrades', - 'edd-upgrade' => 'upgrade_customer_payments_association', - 'step' => urlencode( $step ), - 'number' => urlencode( $number ), - 'total' => urlencode( $total ), - ), admin_url( 'index.php' ) ); - - edd_redirect( $redirect ); - - // No more customers found, finish up - } else { - edd_set_upgrade_complete( 'upgrade_customer_payments_association' ); - delete_option( 'edd_doing_upgrade' ); - - edd_redirect( admin_url() ); - } -} - -/** - * Upgrade the User meta API Key storage to swap keys/values for performance - * - * @since 2.4 - * @deprecated 3.1.2 - * @return void - */ -function edd_upgrade_user_api_keys() { - global $wpdb; - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_die( __( 'You do not have permission to do shop upgrades', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - edd_set_time_limit(); - - $number = 10; - $step = isset( $_GET['step'] ) - ? absint( $_GET['step'] ) - : 1; - $offset = $step == 1 - ? 0 - : ( $step - 1 ) * $number; - - if ( $step < 2 ) { - // Check if we have any users with API Keys before moving on - $sql = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = 'edd_user_public_key' LIMIT 1"; - $has_key = $wpdb->get_col( $sql ); - - // We had no key, just complete - if ( empty( $has_key ) ) { - edd_set_upgrade_complete( 'upgrade_user_api_keys' ); - delete_option( 'edd_doing_upgrade' ); - edd_redirect( admin_url() ); - } - } - - $total = isset( $_GET['total'] ) - ? absint( $_GET['total'] ) - : false; - - if ( empty( $total ) || $total <= 1 ) { - $total = $wpdb->get_var( "SELECT count(user_id) FROM $wpdb->usermeta WHERE meta_key = 'edd_user_public_key'" ); - } - - $keys_sql = $wpdb->prepare( "SELECT user_id, meta_key, meta_value FROM $wpdb->usermeta WHERE meta_key = 'edd_user_public_key' OR meta_key = 'edd_user_secret_key' ORDER BY user_id ASC LIMIT %d,%d;", $offset, $number ); - $found_keys = $wpdb->get_results( $keys_sql ); - - if ( ! empty( $found_keys ) ) { - foreach ( $found_keys as $key ) { - $user_id = $key->user_id; - $meta_key = $key->meta_key; - $meta_value = $key->meta_value; - - // Generate a new entry - update_user_meta( $user_id, $meta_value, $meta_key ); - - // Delete the old one - delete_user_meta( $user_id, $meta_key ); - } - - // More Payments found so upgrade them - $step++; - $redirect = add_query_arg( array( - 'page' => 'edd-upgrades', - 'edd-upgrade' => 'upgrade_user_api_keys', - 'step' => urlencode( $step ), - 'number' => urlencode( $number ), - 'total' => urlencode( $total ) ) ); - - edd_redirect( $redirect ); - - // No more customers found, finish up - } else { - edd_set_upgrade_complete( 'upgrade_user_api_keys' ); - delete_option( 'edd_doing_upgrade' ); - edd_redirect( admin_url() ); - } -} - -/** 2.9.2 Upgrades ***********************************************************/ - -/** - * Output the results of the file-download log data update - * - * @since 2.9.2 - * @deprecated 3.1.2 - */ -function edd_upgrade_render_update_file_download_log_data() { - $migration_complete = edd_has_upgrade_completed( 'update_file_download_log_data' ); - - if ( $migration_complete ) : ?> -
    -

    - Migration complete: You have already completed the update to the file download logs.', 'easy-digital-downloads' ); ?> -

    -
    - - - - -
    -

    Important: Do not navigate away from this page until all upgrades complete.', 'easy-digital-downloads' ); ?>

    -
    - - - - - -
    -
    -

    - - -

    -
    -

    - PII and make file download counts more accurate.', 'easy-digital-downloads' ); ?> -

    -
    - - - - - - - - - - - — - - - - - - -
    -
    -
    -
    - - =' ) || - ( $downgraded_from && version_compare( $downgraded_from, '3.0-beta1', '>=' ) ) - ) { - /* - * This site probably just downgraded from EDD 3.0. Let's perform a downgrade. - */ - $did_downgrade = edd_maybe_downgrade_from_v3(); - } - } - - if ( $did_downgrade ) { - update_option( 'edd_version', preg_replace( '/[^0-9.].*/', '', EDD_VERSION ) ); - delete_option( 'edd_version_downgraded_from' ); - } - - return $did_downgrade; -} - -/** - * Performs a database downgrade from EDD 3.0 to 2.11 if one is needed. - * The main operation here is changing the customer meta column from `edd_customer_id` (v3.0 version) - * back to `customer_id` for v2.x. - * - * @since 2.11 - * @return bool Whether the downgrade was performed. - */ -function edd_maybe_downgrade_from_v3() { - global $wpdb; - $customer_meta_table = EDD()->customer_meta->table_name; - - // If there is no column called `edd_customer_id`, then we don't need to downgrade. - $columns = $wpdb->query( "SHOW COLUMNS FROM {$customer_meta_table} LIKE 'edd_customer_id'"); - if ( empty( $columns ) ) { - return false; - } - - $wpdb->query( "ALTER TABLE {$customer_meta_table} CHANGE `edd_customer_id` `customer_id` bigint(20) unsigned NOT NULL default '0'" ); - $wpdb->query( "ALTER TABLE {$customer_meta_table} DROP INDEX edd_customer_id" ); - $wpdb->query( "ALTER TABLE {$customer_meta_table} ADD INDEX customer_id (customer_id)" ); - - // These two calls re-add the table version numbers for us. - EDD()->customer_meta->create_table(); - EDD()->customers->create_table(); - - edd_debug_log( 'Completed downgrade from EDD 3.0.', true ); - - return true; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/upgrade-functions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/upgrade-functions.php deleted file mode 100644 index 7f8f9573..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/upgrade-functions.php +++ /dev/null @@ -1,596 +0,0 @@ -id ) { - return; - } - - // Sequential Orders was the first stepped upgrade, so check if we have a stalled upgrade - $resume_upgrade = edd_maybe_resume_upgrade(); - if ( ! empty( $resume_upgrade ) ) { - EDD()->notices->add_notice( - array( - 'id' => 'edd-resume-upgrade', - 'class' => 'error', - 'message' => sprintf( - /* translators: %s: Resume upgrade link */ - __( 'Easy Digital Downloads needs to complete a database upgrade that was previously started, click here to resume the upgrade.', 'easy-digital-downloads' ), - esc_url( add_query_arg( $resume_upgrade, admin_url( 'index.php' ) ) ) - ), - 'is_dismissible' => false, - ) - ); - } else { - - // Include all 'Stepped' upgrade process notices in this else statement, - // to avoid having a pending, and new upgrade suggested at the same time - - if ( get_option( 'edd_upgrade_sequential' ) ) { - delete_option( 'edd_upgrade_sequential' ); - } - - /** 3.0 Upgrades ******************************************************/ - - // Check if we need to do any upgrades. - if ( ! edd_v30_is_migration_complete() ) { - - // If any EDD 2.x data exists, the migration should be run. - $needs_migration = _edd_needs_v3_migration(); - $version = false; - // If the migration doesn't need to be run, mark the upgrades as complete. - if ( ! $needs_migration ) { - $upgrades = edd_get_v30_upgrades(); - $upgrades = array_keys( $upgrades ); - foreach ( $upgrades as $upgrade ) { - edd_set_upgrade_complete( $upgrade ); - } - } else { - $component = edd_get_component( 'order' ); - $table = $component->get_interface( 'table' ); - if ( ! empty( $table ) ) { - $version = $table->get_version(); - } - } - - // The migration needs to be run, and the database table exists. - if ( $needs_migration && $version ) { - ?> -
    - -

    - -

    - ', - '' - ); - ?> -

    -
    -

    - -

    -

    - ', - '' - ); - ?> -

    -

    - ', - '' - ); - ?> -

    -

    - ', - '', - '
    ', - 'wp edd v30_migration' - ); - ?> -

    -

    - -

    -
    - 'edd-upgrades', - 'edd-upgrade' => 'v30_migration', - ), - admin_url() - ); - ?> -

    - -

    - -
    - db_version(); - - // The database version is the problem. - if ( version_compare( $database_version, '5.6', '<' ) ) { - $message .= ' ' . sprintf( - /* translators: 1. opening anchor tag, do not translate; 2. closing anchor tag, do not translate; 3. MySQL database version, do not translate */ - __( 'Please contact your host and ask them to upgrade your environment to meet our %1$sminimum technical requirements%2$s. Your MySQL version is %3$s and needs to be updated.', 'easy-digital-downloads' ), - '', - '', - $database_version - ); - } else { - $message .= ' ' . sprintf( - /* translators: 1. opening anchor tag, do not translate; 2. closing anchor tag, do not translate */ - __( '%1$sContact our support team%2$s for help with next steps.', 'easy-digital-downloads' ), - '', - '' - ); - } - ?> -
    -

    -
    - $status ) { - if ( edd_has_upgrade_completed( $upgrade_key ) ) { - $upgrade_statuses[ $upgrade_key ] = true; - $number_complete++; - - continue; - } - - // Let's see if we have a step in progress. - $current_step = get_option( 'edd_v3_migration_step_' . $upgrade_key ); - if ( ! empty( $current_step ) ) { - $upgrade_statuses[ $upgrade_key ] = absint( $current_step ); - } - } - - $migration_complete = $number_complete === count( $upgrades ); - - /* - * Determine if legacy data can be removed. - * It can be if all upgrades except legacy data have been completed. - */ - $can_remove_legacy_data = array_key_exists( 'v30_legacy_data_removed', $upgrade_statuses ) && $upgrade_statuses[ 'v30_legacy_data_removed' ] !== true; - if ( $can_remove_legacy_data ) { - foreach( $upgrade_statuses as $upgrade_key => $status ) { - if ( 'v30_legacy_data_removed' === $upgrade_key ) { - continue; - } - - // If there's at least one upgrade still unfinished, we can't remove legacy data. - if ( true !== $status ) { - $can_remove_legacy_data = false; - break; - } - } - } - - if ( $migration_complete ) { - ?> -
    -

    - Database Upgrade Complete: All database upgrades have been completed.', 'easy-digital-downloads' ), array( 'strong' => array() ) ); ?> -

    - -

    -
    - -

    - -

    - -
    -

    Important: Do not navigate away from this page until all upgrades have completed.', 'easy-digital-downloads' ), array( 'strong' => array() ) ); ?>

    -
    - -

    - - - -

    - -

    - wp edd v30_migration' ); - ?> -

    - - -
    -

    - -

    - - -
    -
    - -
    > -
      - $upgrade_details ) : - // We skip the one to remove legacy data. We'll handle that separately later. - if ( 'v30_legacy_data_removed' === $upgrade_key ) { - continue; - } - ?> -
    • data-upgrade=""> - - - - - - - - - - - - - - – - 0% - -
    • - -
    -
    - -
    -

    - -

    -
    - - -
    > - -

    - -

    - Important: This removes all legacy data from where it was previously stored in custom post types and post meta. This is an optional step that is not reversible. Please back up your database and ensure your store is operational before completing this step.', 'easy-digital-downloads' ), array( 'strong' => array() ) ); ?> -

    - -

    - 'edd-tools' ) ) ) . '">', - '' - ); - ?> -

    - -
    -

    - -

    - - - -
    - - - - 0% - - -
    -
    -
    -

    - -

    -
    -
    -
    - -
    -

    - -
    - -
    -
    - - -
    -

    -
    - - 'edd-upgrades', - 'edd-upgrade' => $action, - 'step' => $step, - 'total' => $total, - 'custom' => $custom, - 'steps' => $steps - ) ); - - // Prevent step estimate from going over - if ( $step > $steps ) { - $steps = $step; - } - - if ( ! empty( $action ) ) : - - // Redirect URL - $redirect = add_query_arg( - array( - 'edd_action' => sanitize_key( $action ), - 'step' => absint( $step ), - 'total' => absint( $total ), - 'custom' => absint( $custom ), - '_wpnonce' => wp_create_nonce( 'edd-upgrade' ), - ), - admin_url( 'index.php' ) - ); - ?> - -
    -

    - - -

    - -
    - - - - -
    -

    - - -

    -
    - - - - - -
    - - can_export() ) { - wp_die( - esc_html__( 'You do not have permission to run this upgrade.', 'easy-digital-downloads' ), - esc_html__( 'Error', 'easy-digital-downloads' ), - array( - 'response' => 403, - ) - ); - } - - $had_data = $this->get_data(); - - if ( $had_data ) { - $this->done = false; - // Save the *next* step to do. - update_option( sprintf( 'edd_v3_migration_%s_step', sanitize_key( $this->upgrade ) ), $this->step + 1 ); - return true; - } else { - $this->done = true; - $this->message = $this->completed_message; - edd_set_upgrade_complete( $this->upgrade ); - delete_option( sprintf( 'edd_v3_migration_%s_step', sanitize_key( $this->upgrade ) ) ); - edd_v30_is_migration_complete(); - return false; - } - } - - /** - * Set the headers. - * - * @since 3.0 - */ - public function headers() { - edd_set_time_limit(); - } - - /** - * Perform the migration. - * - * @since 3.0 - * - * @return void - */ - public function export() { - - // Set headers. - $this->headers(); - - edd_die(); - } - - /** - * Return the global database interface. - * - * @since 3.0 - * @access protected - * @static - * - * @return \wpdb|\stdClass - */ - protected static function get_db() { - return isset( $GLOBALS['wpdb'] ) - ? $GLOBALS['wpdb'] - : new \stdClass(); - } - - /** - * Set properties specific to the export. - * - * @since 3.0 - * - * @param array $request Form data passed into the batch processor. - */ - public function set_properties( $request ) { - } - - /** - * Allow for pre-fetching of data for the remainder of the batch processor. - * - * @since 3.0 - */ - public function pre_fetch() { - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-customer-addresses.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-customer-addresses.php deleted file mode 100644 index 2675b772..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-customer-addresses.php +++ /dev/null @@ -1,90 +0,0 @@ -completed_message = __( 'Customer addresses migration completed successfully.', 'easy-digital-downloads' ); - $this->upgrade = 'migrate_customer_addresses'; - } - - /** - * Retrieve the data pertaining to the current step and migrate as necessary. - * - * @since 3.0 - * - * @return bool True if data was migrated, false otherwise. - */ - public function get_data() { - $offset = ( $this->step - 1 ) * $this->per_step; - - $results = $this->get_db()->get_results( $this->get_db()->prepare( - "SELECT * - FROM {$this->get_db()->usermeta} - WHERE meta_key = %s - ORDER BY umeta_id ASC - LIMIT %d, %d", - esc_sql( '_edd_user_address' ), $offset, $this->per_step - ) ); - - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - Data_Migrator::customer_addresses( $result ); - } - - return true; - } - - return false; - } - - /** - * Calculate the percentage completed. - * - * @since 3.0 - * - * @return float Percentage. - */ - public function get_percentage_complete() { - $total = $this->get_db()->get_var( $this->get_db()->prepare( "SELECT COUNT(umeta_id) AS count FROM {$this->get_db()->usermeta} WHERE meta_key = %s", esc_sql( '_edd_user_address' ) ) ); - - if ( empty( $total ) ) { - $total = 0; - } - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-customer-email-addresses.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-customer-email-addresses.php deleted file mode 100644 index a1d18bfb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-customer-email-addresses.php +++ /dev/null @@ -1,100 +0,0 @@ -completed_message = __( 'Customer email addresses migration completed successfully.', 'easy-digital-downloads' ); - $this->upgrade = 'migrate_customer_email_addresses'; - } - - /** - * Retrieve the data pertaining to the current step and migrate as necessary. - * - * @since 3.0 - * - * @return bool True if data was migrated, false otherwise. - */ - public function get_data() { - $offset = ( $this->step - 1 ) * $this->per_step; - - $results = $this->get_db()->get_results( $this->get_db()->prepare( - "SELECT * - FROM {$this->get_db()->edd_customermeta} - WHERE meta_key = %s - LIMIT %d, %d", - esc_sql( 'additional_email' ), $offset, $this->per_step - ) ); - - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - // Check if email has already been migrated. - if ( ! empty( $result->edd_customer_id ) && $result->meta_value ) { - $number_results = edd_count_customer_email_addresses( array( - 'customer_id' => $result->edd_customer_id, - 'email' => $result->meta_value - ) ); - if ( $number_results > 0 ) { - continue; - } - } - - Data_Migrator::customer_email_addresses( $result ); - } - - return true; - } - - return false; - } - - /** - * Calculate the percentage completed. - * - * @since 3.0 - * - * @return float Percentage. - */ - public function get_percentage_complete() { - $total = $this->get_db()->get_var( $this->get_db()->prepare( "SELECT COUNT(meta_id) AS count FROM {$this->get_db()->edd_customermeta} WHERE meta_key = %s", esc_sql( 'additional_email' ) ) ); - - if ( empty( $total ) ) { - $total = 0; - } - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-customer-notes.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-customer-notes.php deleted file mode 100644 index 079c5161..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-customer-notes.php +++ /dev/null @@ -1,90 +0,0 @@ -completed_message = __( 'Customer notes migration completed successfully.', 'easy-digital-downloads' ); - $this->upgrade = 'migrate_customer_notes'; - } - - /** - * Retrieve the data pertaining to the current step and migrate as necessary. - * - * @since 3.0 - * - * @return bool True if data was migrated, false otherwise. - */ - public function get_data() { - $offset = ( $this->step - 1 ) * $this->per_step; - - $results = $this->get_db()->get_results( $this->get_db()->prepare( - "SELECT * - FROM {$this->get_db()->edd_customers} - LIMIT %d, %d", - $offset, $this->per_step - ) ); - - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - Data_Migrator::customer_notes( $result ); - } - - return true; - } - - return false; - } - - /** - * Calculate the percentage completed. - * - * @since 3.0 - * - * @return float Percentage. - */ - public function get_percentage_complete() { - $total = $this->get_db()->get_var( "SELECT COUNT(id) AS count FROM {$this->get_db()->edd_customers}" ); - - if ( empty( $total ) ) { - $total = 0; - } - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-data-migrator.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-data-migrator.php deleted file mode 100644 index d691cdd7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-data-migrator.php +++ /dev/null @@ -1,1533 +0,0 @@ -meta_value ); - - $user_id = absint( $data->user_id ); - - $customer = edd_get_customer_by( 'user_id', $user_id ); - - $address = wp_parse_args( $address, array( - 'line1' => '', - 'line2' => '', - 'city' => '', - 'state' => '', - 'zip' => '', - 'country' => '', - ) ); - - $address_to_check = array_filter( $address ); - - // Do not migrate empty addresses. - if ( empty( $address_to_check ) ) { - return; - } - - if ( $customer ) { - edd_maybe_add_customer_address( - array( - 'customer_id' => $customer->id, - 'is_primary' => true, - 'name' => $customer->name, - 'address' => $address['line1'], - 'address2' => $address['line2'], - 'city' => $address['city'], - 'region' => $address['state'], - 'postal_code' => $address['zip'], - 'country' => $address['country'], - 'date_created' => $customer->date_created, - ) - ); - } - } - - /** - * Customer email addresses. - * - * @since 3.0 - * - * @param object $data Data to migrate. - */ - public static function customer_email_addresses( $data = null ) { - - // Bail if no data passed. - if ( ! isset( $data->edd_customer_id ) || ! isset( $data->meta_value ) ) { - return; - } - - $customer = edd_get_customer( absint( $data->edd_customer_id ) ); - if ( ! $customer ) { - return; - } - - edd_add_customer_email_address( - array( - 'customer_id' => $customer->id, - 'email' => $data->meta_value, - 'date_created' => $customer->date_created, - ) - ); - } - - /** - * Customer notes. - * - * @since 3.0 - * - * @param object $data Data to migrate. - */ - public static function customer_notes( $data = null ) { - - // Bail if no data passed. - if ( ! $data ) { - return; - } - - $customer_id = absint( $data->id ); - - if ( property_exists( $data, 'notes' ) && ! empty( $data->notes ) ) { - $notes = array_reverse( array_filter( explode( "\n\n", $data->notes ) ) ); - - $notes = array_map( function( $val ) { - return explode( ' - ', $val ); - }, $notes ); - - if ( ! empty( $notes ) ) { - foreach ( $notes as $note ) { - try { - $date = isset( $note[0] ) - ? EDD()->utils->date( $note[0], edd_get_timezone_id() )->setTimezone( 'UTC' )->toDateTimeString() - : ''; - } catch ( \Exception $e ) { - // An empty date will be changed to current time in BerlinDB. - $date = ''; - } - - $note_content = isset( $note[1] ) - ? $note[1] - : ''; - - edd_add_note( array( - 'user_id' => 0, - 'object_id' => $customer_id, - 'object_type' => 'customer', - 'content' => $note_content, - 'date_created' => $date, - 'date_modified' => $date, - ) ); - } - } - } - } - - /** - * Discounts. - * - * @since 3.0 - * - * @param object $data Data to migrate. - */ - public static function discounts( $data = null ) { - - // Bail if no data passed. - if ( ! $data ) { - return; - } - - $data = get_post( $data->ID ); - - $args = array(); - $meta = get_post_custom( $data->ID ); - $meta_to_migrate = array(); - $core_meta = array( - 'code', - 'name', - 'status', - 'uses', - 'max_uses', - 'amount', - 'start', - 'expiration', - 'type', - 'min_price', - 'product_reqs', - 'product_condition', - 'excluded_products', - 'is_not_global', - 'is_single_use', - ); - - foreach ( $meta as $key => $value ) { - $value = maybe_unserialize( $value[0] ); - if ( false === strpos( $key, '_edd_discount' ) ) { - - // This is custom meta from another plugin that needs to be migrated to the new meta table. - $meta_to_migrate[ $key ] = $value; - continue; - } - $meta_key = str_replace( '_edd_discount_', '', $key ); - if ( ! in_array( $meta_key, $core_meta, true ) ) { - $meta_to_migrate[ $meta_key ] = $value; - continue; - } - - $args[ $meta_key ] = $value; - } - - // If the discount name was not stored in post_meta, use value from the WP_Post object. - if ( ! isset( $args['name'] ) ) { - $args['name'] = $data->post_title; - } - - $args['id'] = $data->ID; - $args['date_created'] = $data->post_date_gmt; - $args['date_modified'] = $data->post_modified_gmt; - - // Use edd_store_discount() so any legacy data is handled correctly. - $discount_id = edd_store_discount( $args ); - - // Migrate any additional meta. - if ( ! empty( $meta_to_migrate ) ) { - foreach ( $meta_to_migrate as $key => $value ) { - edd_add_adjustment_meta( $discount_id, $key, $value ); - } - } - } - - /** - * Logs. - * - * @since 3.0 - * - * @param object $data Data to migrate. - */ - public static function logs( $data = null ) { - global $wpdb; - - // Bail if no data passed. - if ( ! $data ) { - return; - } - - $meta_to_migrate = array(); - if ( 'file_download' === $data->slug ) { - $meta = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM {$wpdb->postmeta} WHERE post_id = %d", absint( $data->ID ) ) ); - - $post_meta = array(); - - foreach ( $meta as $meta_item ) { - $post_meta[ $meta_item->meta_key ] = maybe_unserialize( $meta_item->meta_value ); - } - - $log_data = array( - 'product_id' => $data->post_parent, - /* - * Custom Deliverables was overriding the file ID to be a string instead of an integer. The preg_replace - * allows us to try to salvage the file ID from that string. - */ - 'file_id' => isset( $post_meta['_edd_log_file_id'] ) ? preg_replace( '/[^0-9]/', '', $post_meta['_edd_log_file_id'] ) : 0, - 'order_id' => isset( $post_meta['_edd_log_payment_id'] ) ? $post_meta['_edd_log_payment_id'] : 0, - 'price_id' => isset( $post_meta['_edd_log_price_id'] ) ? $post_meta['_edd_log_price_id'] : 0, - 'customer_id' => isset( $post_meta['_edd_log_customer_id'] ) ? $post_meta['_edd_log_customer_id'] : 0, - 'ip' => isset( $post_meta['_edd_log_ip'] ) ? $post_meta['_edd_log_ip'] : '', - 'date_created' => $data->post_date_gmt, - 'date_modified' => $data->post_modified_gmt, - ); - - $meta_to_remove = array( - '_edd_log_file_id', - '_edd_log_payment_id', - '_edd_log_price_id', - '_edd_log_customer_id', - '_edd_log_ip', - '_edd_log_user_id', - ); - // If the log doesn't have a customer ID, but does have a user ID, keep the user ID as metadata. - if ( empty( $log_data['customer_id'] ) && ! empty( $post_meta['_edd_log_user_id'] ) && ! in_array( $post_meta['_edd_log_user_id'], array( 0, -1 ) ) ) { - $meta_to_remove = array_diff( $meta_to_remove, array( '_edd_log_user_id' ) ); - } - $meta_to_migrate = $post_meta; - $new_log_id = edd_add_file_download_log( $log_data ); - $add_meta_function = 'edd_add_file_download_log_meta'; - - /** - * Triggers after a file download log has been migrated. - * - * @since 3.0 - * - * @param int $new_log_id ID of the newly created log. - * @param object $data Data from the posts table. (Essentially a `WP_Post`, without being that object.) - * @param array $post_meta All meta associated with this log. - */ - do_action( 'edd_30_migrate_file_download_log', $new_log_id, $data, $post_meta ); - } elseif ( 'api_request' === $data->slug ) { - $meta = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM {$wpdb->postmeta} WHERE post_id = %d", absint( $data->ID ) ) ); - - $post_meta = array(); - - foreach ( $meta as $meta_item ) { - $post_meta[ $meta_item->meta_key ] = maybe_unserialize( $meta_item->meta_value ); - } - - $post_meta = wp_parse_args( - $post_meta, - array( - '_edd_log_request_ip' => '', - '_edd_log_user' => 0, - '_edd_log_key' => 'public', - '_edd_log_token' => 'public', - '_edd_log_version' => '', - '_edd_log_time' => '', - ) - ); - - if ( empty( $post_meta['_edd_log_token'] ) ) { - $post_meta['_edd_log_token'] = 'public' === $post_meta['_edd_log_key'] ? 'public' : ''; - } - - $log_data = array( - 'ip' => $post_meta['_edd_log_request_ip'], - 'user_id' => $post_meta['_edd_log_user'], - 'api_key' => $post_meta['_edd_log_key'], - 'token' => $post_meta['_edd_log_token'], - 'version' => $post_meta['_edd_log_version'], - 'time' => $post_meta['_edd_log_time'], - 'request' => $data->post_excerpt, - 'error' => $data->post_content, - 'date_created' => $data->post_date_gmt, - 'date_modified' => $data->post_modified_gmt, - ); - - $meta_to_remove = array( - '_edd_log_request_ip', - '_edd_log_user', - '_edd_log_key', - '_edd_log_token', - '_edd_log_version', - '_edd_log_time', - ); - $meta_to_migrate = $post_meta; - $new_log_id = edd_add_api_request_log( $log_data ); - $add_meta_function = 'edd_add_api_request_log_meta'; - } else { - $post_meta = get_post_custom( $data->ID ); - foreach ( $post_meta as $key => $value ) { - $meta_to_migrate[ $key ] = maybe_unserialize( $value[0] ); - } - - $log_data = array( - 'object_id' => $data->post_parent, - 'object_type' => 'download', - 'user_id' => ! empty( $meta_to_migrate['_edd_log_user'] ) ? $meta_to_migrate['_edd_log_user'] : $data->post_author, - 'type' => $data->slug, - 'title' => $data->post_title, - 'content' => $data->post_content, - 'date_created' => $data->post_date_gmt, - 'date_modified' => $data->post_modified_gmt, - ); - - $meta_to_remove = array( - '_edit_lock', - '_edd_log_user', - ); - - $new_log_id = edd_add_log( $log_data ); - $add_meta_function = 'edd_add_log_meta'; - } - - if ( ! is_callable( $add_meta_function ) || empty( $meta_to_migrate ) ) { - return; - } - - foreach ( $meta_to_migrate as $key => $value ) { - if ( ! in_array( $key, $meta_to_remove, true ) ) { - // Strip off `_edd_log_` prefix. - $key = str_replace( '_edd_log_', '', $key ); - - $add_meta_function( $new_log_id, $key, $value ); - } - } - } - - /** - * Order notes. - * - * @since 3.0 - * - * @param object $data Data to migrate. - */ - public static function order_notes( $data = null ) { - - // Bail if no data passed. - if ( ! $data ) { - return; - } - - $note_data = array( - 'object_id' => $data->object_id, - 'object_type' => 'order', - 'date_created' => $data->comment_date_gmt, - 'date_modified' => $data->comment_date_gmt, - 'content' => $data->comment_content, - 'user_id' => $data->user_id, - ); - - $id = edd_add_note( $note_data ); - - $meta = get_comment_meta( $data->comment_ID ); - if ( ! empty( $meta ) ) { - foreach ( $meta as $key => $value ) { - edd_add_note_meta( $id, $key, $value ); - } - } - } - - public static function orders( $data = null ) { - - // Bail if no data passed. - if ( ! $data ) { - return false; - } - - /** Create a new order ***************************************/ - global $wpdb; - - // Get's all the post meta for this payment. - $meta = get_post_custom( $data->ID ); - - $payment_meta = maybe_unserialize( $meta['_edd_payment_meta'][0] ); - $user_info = isset( $payment_meta['user_info'] ) ? maybe_unserialize( $payment_meta['user_info'] ) : array(); - - // It is possible that for some reason the entire unserialized array is invalid, so before trying to use it, let's just verify we got an array back. - if ( ! is_array( $payment_meta ) ) { - // Dump this data to a file to ensure we keep it for later use. - edd_debug_log( '==== Failed Migrating Legacy Payment ID: ' . $data->ID . ' ====', true ); - edd_debug_log( 'Reason: Payment Meta Unserialization failed.', true ); - edd_debug_log( '- Post Data', true ); - foreach ( get_object_vars( $data ) as $key => $value ) { - edd_debug_log( '-- ' . $key . ': ' . $value, true ); - } - - edd_debug_log( '- Post Meta', true ); - foreach ( $meta as $key => $value_array ) { - edd_debug_log( '-- Meta Key: ' . $key, true ); - foreach ( $value_array as $value ) { - edd_debug_log( '--- ' . $value, true ); - } - } - - return false; - } - - // Some old EDD data has the user info serialized, but starting with something other than a: so it can't be unserialized - $user_info = self::fix_possible_serialization( $user_info ); - $user_info = maybe_unserialize( $user_info ); - - if ( ! is_array( $user_info ) ) { - $user_info = array(); - } - - /** - * Last chance to filter payment meta before we use it! - * Note: If modifying `cart_details`, then it's recommended that you first run - * `EDD\Admin\Upgrades\v3\Data_Migrator::fix_possible_serialization()` - * before making adjustments. - * - * @since 3.0 - * - * @param array $payment_meta Payment meta. - * @param int $payment_id ID of the payment. - * @param array $meta All post meta. - */ - $payment_meta = apply_filters( 'edd_30_migration_payment_meta', $payment_meta, $data->ID, $meta ); - - $order_number = isset( $meta['_edd_payment_number'][0] ) ? $meta['_edd_payment_number'][0] : ''; - $user_id = isset( $meta['_edd_payment_user_id'][0] ) && ! empty( $meta['_edd_payment_user_id'][0] ) ? $meta['_edd_payment_user_id'][0] : 0; - $ip = isset( $meta['_edd_payment_user_ip'][0] ) ? $meta['_edd_payment_user_ip'][0] : ''; - $mode = isset( $meta['_edd_payment_mode'][0] ) ? $meta['_edd_payment_mode'][0] : 'live'; - $gateway = isset( $meta['_edd_payment_gateway'][0] ) && ! empty( $meta['_edd_payment_gateway'][0] ) ? $meta['_edd_payment_gateway'][0] : 'manual'; - $customer_id = isset( $meta['_edd_payment_customer_id'][0] ) ? $meta['_edd_payment_customer_id'][0] : 0; - $date_completed = isset( $meta['_edd_completed_date'][0] ) ? $meta['_edd_completed_date'][0] : null; - $purchase_key = isset( $meta['_edd_payment_purchase_key'][0]) ? $meta['_edd_payment_purchase_key'][0] : false; - $purchase_email = isset( $meta['_edd_payment_user_email'][0] ) ? $meta['_edd_payment_user_email'][0] : $payment_meta['email']; - - // Get the customer object - if ( ! empty( $customer_id ) ) { - $customer = edd_get_customer( $customer_id ); - } else if ( ! empty( $purchase_email ) ) { - $customer = edd_get_customer_by( 'email', $purchase_email ); - if ( $customer ) { - $customer_id = $customer->id; - } - } - - if ( false === $purchase_key ) { - $purchase_key = isset( $payment_meta['key'] ) ? $payment_meta['key'] : ''; - } - - // Do not use -1 as the user ID. - $user_id = ( -1 === $user_id ) - ? 0 - : $user_id; - - // Account for possible double serialization of the cart_details - $cart_details = isset( $payment_meta['cart_details'] ) ? maybe_unserialize( $payment_meta['cart_details'] ) : array(); - - // Some old EDD data has the cart details serialized, but starting with something other than a: so it can't be unserialized - $cart_details = self::fix_possible_serialization( $cart_details ); - - // Some old cart data does not contain subtotal or discount information. Normalize it. - $cart_details = self::normalize_cart_details( $cart_details ); - - // Account for possible double serialization of the cart_details - $cart_downloads = isset( $payment_meta['downloads'] ) ? maybe_unserialize( $payment_meta['downloads'] ) : array(); - - // Some old EDD data has the downloads serialized, but starting with something other than a: so it can't be unserialized - $cart_downloads = self::fix_possible_serialization( $cart_downloads ); - - // If the order status is 'publish' convert it to the new 'complete' status. - $order_status = 'publish' === $data->post_status ? 'complete' : $data->post_status; - - // If there are no items, and it's abandoned, just return, since this isn't a valid order. - if ( 'abandoned' === $order_status && empty( $cart_downloads ) && empty( $cart_details ) ) { - edd_debug_log( 'Skipping order ' . $data->ID . ' due to abandoned status and no products.', true ); - return false; - } - - $order_subtotal = 0; - $order_tax = 0; - $order_discount = 0; - $order_total = 0; - - // Track the total value of added fees in case the Order was initially migrated - // without _edd_payment_total or _edd_payment_tax and manual calculation was needed. - $order_fees_tax = 0; - $order_fees_total = 0; - $order_items_fees_tax = 0; - - // Retrieve the tax amount from metadata if available. - $meta_tax = isset( $meta['_edd_payment_tax'] ) - ? $meta['_edd_payment_tax'] - : false; - - if ( false !== $meta_tax ) { - $meta_tax = maybe_unserialize( $meta_tax ); - $order_tax = (float) $meta_tax[0]; - } - - $meta_total = false; - // Retrieve the total amount from metadata if available. - if ( isset( $meta['_edd_payment_total'] ) ) { - $meta_total = maybe_unserialize( $meta['_edd_payment_total'] ); - $order_total = (float) $meta_total[0]; - } elseif ( isset( $payment_meta['amount'] ) ) { - $meta_total = maybe_unserialize( $payment_meta['amount'] ); - $order_total = (float) $meta_total; - } - - // In some cases (very few) there is no cart details...so we have to just avoid this part. - if ( ! empty( $cart_details ) && is_array( $cart_details ) ) { - - // Loop through the items in the purchase to build the totals. - foreach ( $cart_details as $cart_item ) { - $order_subtotal += $cart_item['subtotal']; - - // Add the cart line item tax amount if a total is not available on the order. - if ( false === $meta_tax ) { - $order_tax += $cart_item['tax']; - } - - $order_discount += $cart_item['discount']; - - // Add the cart line item price amount (includes tax, order item fee, _but not order item fee tax_) - // if a total is not available on the order. - if ( false === $meta_total ) { - $order_total += $cart_item['price']; - } - } - - } - - // Account for a situation where the post_date_gmt is set to 0000-00-00 00:00:00 - $date_created_gmt = $data->post_date_gmt; - if ( '0000-00-00 00:00:00' === $date_created_gmt ) { - - $date_created_gmt = new \DateTime( $data->post_date ); - $modified_time = new \DateTime( $data->post_modified ); - $modified_time_gmt = new \DateTime( $data->post_modified_gmt ); - - if ( $modified_time != $modified_time_gmt ) { - $diff = $modified_time_gmt->diff( $modified_time ); - - $time_diff = 'PT'; - - // Add hours to the offset string. - if ( ! empty( $diff->h ) ) { - $time_diff .= $diff->h . 'H'; - } - - // Add minutes to the offset string. - if ( ! empty( $diff->i ) ) { - $time_diff .= $diff->i . 'M'; - } - - // Account for -/+ GMT offsets. - try { - if ( 1 === $diff->invert ) { - $date_created_gmt->add( new \DateInterval( $time_diff ) ); - } else { - $date_created_gmt->sub( new \DateInterval( $time_diff ) ); - } - } catch ( \Exception $e ) { - - } - } - - $date_created_gmt = $date_created_gmt->format('Y-m-d H:i:s'); - } - - // Maybe convert the date completed to UTC or backfill the date_completed. - $non_completed_statuses = apply_filters( 'edd_30_noncomplete_statuses', edd_get_incomplete_order_statuses() ); - if ( ! in_array( $order_status, $non_completed_statuses, true ) ) { - - if ( ! empty( $date_completed ) ) { // Update the data_completed to the UTC. - try { - $date_completed = EDD()->utils->date( $date_completed, edd_get_timezone_id() )->setTimezone( 'UTC' )->toDateTimeString(); - } catch ( \Exception $e ) { - $date_completed = $date_created_gmt; - } - } elseif ( is_null( $date_completed ) ) { // Backfill a missing date_completed (for things like recurring payments). - $date_completed = $date_created_gmt; - } - - } - - if ( 'manual_purchases' === $gateway && isset( $meta['_edd_payment_total'][0] ) ) { - $gateway = 'manual'; - $order_total = $meta['_edd_payment_total'][0]; - } - - /* - * Build up the order address data. Actual insertion happens later, but we need this now to figure out the tax rate. - */ - - // First & last name. - $user_info['first_name'] = ! empty( $user_info['first_name'] ) - ? $user_info['first_name'] - : ''; - $user_info['last_name'] = ! empty( $user_info['last_name'] ) - ? $user_info['last_name'] - : ''; - - // Add order address. - $user_info['address'] = ! empty( $user_info['address'] ) - ? $user_info['address'] - : array(); - - $user_info['address'] = wp_parse_args( $user_info['address'], array( - 'line1' => '', - 'line2' => '', - 'city' => '', - 'zip' => '', - 'country' => '', - 'state' => '', - ) ); - - $order_address_data = array( - 'name' => trim( $user_info['first_name'] . ' ' . $user_info['last_name'] ), - 'address' => isset( $user_info['address']['line1'] ) ? $user_info['address']['line1'] : '', - 'address2' => isset( $user_info['address']['line2'] ) ? $user_info['address']['line2'] : '', - 'city' => isset( $user_info['address']['city'] ) ? $user_info['address']['city'] : '', - 'region' => isset( $user_info['address']['state'] ) ? $user_info['address']['state'] : '', - 'country' => isset( $user_info['address']['country'] ) && array_key_exists( strtoupper( $user_info['address']['country'] ), edd_get_country_list() ) - ? $user_info['address']['country'] - : '', - 'postal_code' => isset( $user_info['address']['zip'] ) ? $user_info['address']['zip'] : '', - 'date_created' => $date_created_gmt, - ); - - $tax_rate_id = null; - $tax_rate = isset( $meta['_edd_payment_tax_rate'][0] ) - ? (float) $meta['_edd_payment_tax_rate'][0] - : 0.00; - - /* - * Previously tax rates were stored as a decimal (e.g. `0.2`) but they're now stored as a percentage - * (e.g. `20`). So we need to convert. - */ - if ( $tax_rate < 1 ) { - $tax_rate = $tax_rate * 100; - } - - $set_tax_rate_meta = false; - - if ( ! empty( $tax_rate ) ) { - // Fetch the actual tax rate object for the order region & country. - $tax_rate_object = edd_get_tax_rate_by_location( array( - 'country' => $order_address_data['country'], - 'region' => $order_address_data['region'], - ) ); - - if ( ! empty( $tax_rate_object->id ) && $tax_rate_object->amount == $tax_rate ) { - $tax_rate_id = $tax_rate_object->id; - } - } - - /* - * If we cannot find a matching Adjustment object, we should save this in order meta so it isn't lost. - */ - if ( ! empty( $tax_rate ) && empty( $tax_rate_id ) ) { - $set_tax_rate_meta = true; - } - - // Build the order data before inserting. - $order_data = array( - 'id' => $data->ID, - 'parent' => $data->post_parent, - 'order_number' => $order_number, - 'status' => $order_status, - 'type' => 'sale', - 'date_created' => $date_created_gmt, // GMT is stored in the database as the offset is applied by the new query classes. - 'date_modified' => $data->post_modified_gmt, // GMT is stored in the database as the offset is applied by the new query classes. - 'date_completed' => $date_completed, - 'user_id' => $user_id, - 'customer_id' => $customer_id, - 'email' => $purchase_email, - 'ip' => $ip, - 'gateway' => $gateway, - 'mode' => $mode, - 'currency' => ! empty( $payment_meta['currency'] ) ? $payment_meta['currency'] : edd_get_currency(), - 'payment_key' => $purchase_key, - 'tax_rate_id' => $tax_rate_id, - 'subtotal' => $order_subtotal, - 'tax' => $order_tax, - 'discount' => $order_discount, - 'total' => $order_total, - ); - - /** - * Filters the data used to create the order. - * - * @since 3.0 - * - * @param array $order_data Order creation arguments. - * @param array $payment_meta Payment meta. - * @param array $cart_details Cart details. - * @param array $meta All payment meta. - */ - $order_data = apply_filters( 'edd_30_migration_order_creation_data', $order_data, $payment_meta, $cart_details, $meta ); - - update_option( '_edd_v30_doing_order_migration', true, false ); - - // Remove all order status transition actions. - remove_all_actions( 'edd_transition_order_status' ); - remove_all_actions( 'edd_transition_order_item_status' ); - - $order_id = edd_add_order( $order_data ); - - // Save an un-matched tax rate in order meta. - if ( $set_tax_rate_meta ) { - edd_add_order_meta( $order_id, 'tax_rate', $tax_rate ); - } - - // Do not pass the original order ID into other arrays - unset( $order_data['id'] ); - - // Reset the $refund_id variable so that we don't end up accidentally creating refunds. - $refund_id = 0; - - // If the order status is 'refunded', we need to generate a new order with the type of 'refund'. - if ( 'refunded' === $order_status ) { - - // Since the refund is a near copy of the original order, copy over the arguments. - $refund_data = $order_data; - - $refund_data['parent'] = $order_id; - $refund_data['order_number'] = $order_id . apply_filters( 'edd_order_refund_suffix', '-R-' ) . '1'; - $refund_data['type'] = 'refund'; - $refund_data['status'] = 'complete'; - - // Negate the amounts - $refund_data['subtotal'] = edd_negate_amount( $order_subtotal ); - $refund_data['tax'] = edd_negate_amount( $order_tax ); - $refund_data['discount'] = edd_negate_amount( $order_discount ); - $refund_data['total'] = edd_negate_amount( $order_total ); - - - // These are the best guess at the date it was refunded since we didn't store that prior. - $refund_data['date_created'] = $data->post_modified_gmt; - $refund_data['date_modified'] = $data->post_modified_gmt; - - $refund_id = edd_add_order( $refund_data ); - - } - - // Remove empty data. - $order_address_data = array_filter( $order_address_data ); - if ( ! empty( $order_address_data ) ) { - // Add to edd_order_addresses table. - $order_address_data['order_id'] = $order_id; - edd_add_order_address( $order_address_data ); - } - - // Maybe add the address to the edd_customer_addresses. - $customer_address_data = $order_address_data; - - // We don't need to pass this data to edd_maybe_add_customer_address(). - unset( $customer_address_data['order_id'] ); - unset( $customer_address_data['first_name'] ); - unset( $customer_address_data['last_name'] ); - - // If possible, set the order date as the address creation date. - $customer_address_data['date_created'] = $date_created_gmt; - - // Maybe add address to customer record. - edd_maybe_add_customer_address( $customer_id, $customer_address_data ); - - // Maybe add email address to customer record - if ( ! empty( $customer ) && $customer instanceof \EDD_Customer ) { - $type = ( $customer->email === $purchase_email ) ? 'primary' : 'secondary'; - edd_add_customer_email_address( - array( - 'customer_id' => $customer_id, - 'date_created' => $date_created_gmt, - 'email' => $purchase_email, - 'type' => $type, - ) - ); - } - - /** Migrate meta *********************************************/ - - // Unlimited downloads meta is not an order property, so we set it on the order meta for the new order ID. - if ( isset( $meta['_edd_payment_unlimited_downloads'] ) && ! empty( $meta['_edd_payment_unlimited_downloads'][0] ) ) { - edd_add_order_meta( $order_id, 'unlimited_downloads', $meta['_edd_payment_unlimited_downloads'][0] ); - } - - // Transaction IDs are no longer meta, and have their own table and data set, so we need to add the transactions. - $transaction_id = ! empty( $meta['_edd_payment_transaction_id'][0] ) ? $meta['_edd_payment_transaction_id'][0] : false; - // If we have no transaction ID & the gateway was PayPal, let's check in old payment notes. - if ( empty( $transaction_id ) && false !== strpos( $gateway, 'paypal' ) ) { - $transaction_id = self::find_transaction_id_from_notes( $order_id ); - } - if ( ! empty( $transaction_id ) ) { - edd_add_order_transaction( array( - 'object_id' => $order_id, - 'object_type' => 'order', - 'transaction_id' => $transaction_id, - 'gateway' => $gateway, - 'status' => 'complete', - 'total' => $order_total, - 'date_created' => $date_completed, - 'date_modified' => $date_completed, - ) ); - } - - /** - * By default, this is what is stored in payment meta. These array keys are part of the core payment meta in 2.x - * but are not needed as part of the order meta and will not be migrated. - * Extensions can add their keys to this filter if they use the payment meta array to store data and have - * established a migration process to keep the data intact with the new order tables. - * - * @since 3.0 - * @param array The array of payment meta keys. - */ - $core_meta_keys = apply_filters( 'edd_30_payment_meta_keys_not_migrated', array( - 'fees', - 'key', - 'email', - 'date', - 'downloads', - 'cart_details', - 'currency', - 'discount', - 'subtotal', - 'tax', - 'amount', - 'user_id', - ) ); - - // Remove core keys from `user_info`. - $remaining_user_info = false; - if ( ! empty( $user_info ) ) { - /** - * Array keys which are part of the core `user_info` in payment meta which are not needed as part of the order meta. - * Extensions can add their keys to this filter if they use the `user_info` array to store data and have - * established a migration process to keep the data intact with the new order tables. - * - * @since 3.0 - * @param array The array of user info keys. - */ - $core_user_info = apply_filters( 'edd_30_core_user_info', array( 'id', 'email', 'first_name', 'last_name', 'discount', 'address', 'user_id' ) ); - $remaining_user_info = array_diff_key( $user_info, array_flip( $core_user_info ) ); - } - - // If an extension has added data to `user_info`, migrate it. - if ( $remaining_user_info ) { - $payment_meta['user_info'] = $remaining_user_info; - } else { - $core_meta_keys[] = 'user_info'; - } - - // Remove all the core payment meta from the array, and... - if ( is_array( $payment_meta ) ) { - $remaining_payment_meta = array_diff_key( $payment_meta, array_flip( $core_meta_keys ) ); - - // ..If we have extra payment meta, it needs to be migrated across. - if ( 0 < count( $remaining_payment_meta ) ) { - edd_add_order_meta( $order_id, 'payment_meta', $remaining_payment_meta ); - } - } - - /** Create order items ***************************************/ - - // Now we iterate through all the cart items and make rows in the order items table. - if ( ! empty( $cart_details ) ) { - foreach ( $cart_details as $key => $cart_item ) { - // Reset any conditional IDs to be safe. - $refund_order_item_id = 0; - - // Get product name. - $product_name = isset( $cart_item['name'] ) - ? $cart_item['name'] - : ''; - - // Get price ID. - $price_id = self::get_valid_price_id_for_cart_item( $cart_item ); - - if ( ! empty( $product_name ) ) { - $option_name = edd_get_price_option_name( $cart_item['id'], $price_id ); - if ( ! empty( $option_name ) ) { - $product_name .= ' — ' . $option_name; - } - } - - $order_item_args = array( - 'order_id' => $order_id, - 'product_id' => $cart_item['id'], - 'product_name' => $product_name, - 'price_id' => $price_id, - 'cart_index' => $key, - 'type' => 'download', - 'status' => $order_status, - 'quantity' => $cart_item['quantity'], - 'amount' => (float) $cart_item['item_price'], - 'subtotal' => (float) $cart_item['subtotal'], - 'discount' => (float) $cart_item['discount'], - 'tax' => $cart_item['tax'], - 'total' => (float) $cart_item['price'], - 'date_created' => $date_created_gmt, - 'date_modified' => $data->post_modified_gmt, - ); - - /** - * Filters the arguments used to create the order item. - * - * @since 1.0 - * - * @param array $order_item_args Order item arguments. - * @param array $cart_item Original cart item. - * @param array $payment_meta Payment meta. - * @param array $meta All meta. - */ - $order_item_args = apply_filters( 'edd_30_migration_order_item_creation_data', $order_item_args, $cart_item, $payment_meta, $meta ); - - $order_item_id = edd_add_order_item( $order_item_args ); - - if ( ! empty( $cart_item['item_number']['options'] ) ) { - // Collect any item_number options and store them. - - // Remove our price_id and quantity, as they are columns on the order item now. - unset( $cart_item['item_number']['options']['price_id'] ); - unset( $cart_item['item_number']['options']['quantity'] ); - - foreach ( $cart_item['item_number']['options'] as $option_key => $value ) { - $option_key = '_option_' . sanitize_key( $option_key ); - - edd_add_order_item_meta( $order_item_id, $option_key, $value ); - } - } - - // If the order status is refunded, we also need to add all the refunded order items on the refund order as well. - if ( ! empty( $refund_id ) ) { - - // Since the refund is a near copy of the original order, copy over the arguments. - $refund_item_args = $order_item_args; - - $refund_item_args['parent'] = $order_item_id; - $refund_item_args['order_id'] = $refund_id; - $refund_item_args['status'] = 'complete'; - - // Subtotal is actually set to subtotal - discount. - $refund_item_args['subtotal'] = $refund_item_args['subtotal'] - $refund_item_args['discount']; - - // Negate the amounts - $refund_item_args['quantity'] = edd_negate_int( $cart_item['quantity'] ); - foreach( array( 'amount', 'subtotal', 'tax', 'total' ) as $field_to_negate ) { - $refund_item_args[ $field_to_negate ] = edd_negate_amount( $refund_item_args[ $field_to_negate ] ); - } - - // These are our best estimates since we did not store the refund date previously. - $refund_item_args['date_crated'] = $data->post_modified_gmt; - $refund_item_args['date_modified'] = $data->post_modified_gmt; - - $refund_order_item_id = edd_add_order_item( $refund_item_args ); - - if ( ! empty( $cart_item['item_number']['options'] ) ) { - // Collect any item_number options and store them. - - // Remove our price_id and quantity, as they are columns on the order item now. - unset( $cart_item['item_number']['options']['price_id'] ); - unset( $cart_item['item_number']['options']['quantity'] ); - - foreach ( $cart_item['item_number']['options'] as $option_key => $value ) { - $option_key = '_option_' . sanitize_key( $option_key ); - - edd_add_order_item_meta( $refund_order_item_id, $option_key, $value ); - } - } - - } - - // Store order item fees as adjustments. - if ( isset( $cart_item['fees'] ) && ! empty( $cart_item['fees'] ) ) { - foreach ( $cart_item['fees'] as $fee_id => $fee ) { - // Reset any conditional IDs to be safe. - $refund_adjustment_id = 0; - - $tax = EDD()->fees->get_calculated_tax( $fee, $tax_rate ); - $total = floatval( $fee['amount'] ) + $tax; - - // Track order item fees tax to adjust order if needed. - $order_items_fees_tax += $tax; - - // Add the adjustment. - $adjustment_args = array( - 'object_id' => $order_item_id, - 'object_type' => 'order_item', - 'type_key' => $fee_id, - 'type' => 'fee', - 'description' => $fee['label'], - 'subtotal' => floatval( $fee['amount'] ), - 'tax' => $tax, - 'total' => floatval( $fee['amount'] ) + $tax, - ); - - /** - * Filters the arguments used to create an order item adjustment. - * - * @since 3.0 - * - * @param array $adjustment_args Adjustment arguments for a fee. - * @param array $fee Original fee data. - * @param array $cart_item Cart item this fee is part of. - * @param array $payment_meta Payment meta. - * @param array $meta All meta. - */ - $adjustment_args = apply_filters( 'edd_30_migration_order_item_adjustment_creation_data', $adjustment_args, $fee, $cart_item, $payment_meta, $meta ); - - $adjustment_id = edd_add_order_adjustment( $adjustment_args ); - - // If we refunded the main order, the fees also need to be added to the refund order type we created. - if ( ! empty( $refund_id ) ) { - $refund_adjustment_args = $adjustment_args; - $refund_adjustment_args['parent'] = $adjustment_id; - $refund_adjustment_args['object_id'] = $refund_order_item_id; - $refund_adjustment_args['subtotal'] = edd_negate_amount( floatval( $fee['amount'] ) ); - $refund_adjustment_args['tax'] = edd_negate_amount( $tax ); - $refund_adjustment_args['total'] = edd_negate_amount( floatval( $fee['amount'] ) + $tax ); - - $refund_adjustment_id = edd_add_order_adjustment( $refund_adjustment_args ); - } - } - } - } - - // Compatibility with older versions of EDD. - // Older versions stored a single dimensional array of download IDs. - } elseif ( is_array( $cart_downloads ) && count( $cart_downloads ) === count( $cart_downloads, COUNT_RECURSIVE ) ) { - foreach ( $cart_downloads as $cart_index => $download_id ) { - $download = edd_get_download( $download_id ); - - $order_item_args = array( - 'order_id' => $order_id, - 'product_id' => $download_id, - 'product_name' => $download->post_name, - 'price_id' => null, - 'cart_index' => $cart_index, - 'type' => 'download', - 'quantity' => 1, - 'amount' => (float) $payment_meta['amount'], - 'subtotal' => (float) $payment_meta['amount'], - 'discount' => 0.00, - 'tax' => 0.00, - 'total' => (float) $payment_meta['amount'], - 'date_created' => $date_created_gmt, - 'date_modified' => $data->post_modified_gmt, - ); - - $order_item_id = edd_add_order_item( $order_item_args ); - - // If the order was refunded, we also need to add these items to the refund order. - if ( ! empty( $refund_id ) ) { - - // Since the refund is a near copy of the original order, copy over the arguments. - $refund_item_args = $order_item_args; - - $refund_item_args['parent'] = $order_item_id; - $refund_item_args['order_id'] = $refund_id; - $refund_item_args['quantity'] = edd_negate_int( 1 ); - $refund_item_args['amount'] = edd_negate_amount( (float) $payment_meta['amount'] ); - $refund_item_args['subtotal'] = edd_negate_amount( (float) $payment_meta['amount'] ); - $refund_item_args['total'] = edd_negate_amount( (float) $payment_meta['amount'] ); - - // These are the best guess at the time, since we didn't store this data previously. - $refund_item_args['date_created'] = $data->post_modified_gmt; - $refund_item_args['date_modified'] = $data->post_modified_gmt; - - edd_add_order_item( $order_item_args ); - } - } - } - - /** Create order adjustments *********************************/ - - if ( isset( $payment_meta['fees'] ) && ! empty( $payment_meta['fees'] ) ) { - foreach ( $payment_meta['fees'] as $fee_id => $fee ) { - // Reset any conditional IDs to be safe. - $refund_adjustment_id = 0; - - if ( ! empty( $fee['download_id'] ) ) { - continue; - } - - $tax = EDD()->fees->get_calculated_tax( $fee, $tax_rate ); - $total = floatval( $fee['amount'] ) + $tax; - - $order_fees_tax += $tax; - $order_fees_total += $total; - - // Add the adjustment. - $adjustment_args = array( - 'object_id' => $order_id, - 'object_type' => 'order', - 'type_key' => $fee_id, - 'type' => 'fee', - 'description' => $fee['label'], - 'subtotal' => floatval( $fee['amount'] ), - 'tax' => $tax, - 'total' => $total, - 'date_created' => $date_created_gmt, - 'date_modified' => $data->post_modified_gmt, - ); - - /** - * Filters the order adjustment arguments. - * - * @since 3.0 - * - * @param array $adjustment_args Arguments used to create the order adjustment. - * @param array $fee Fee data. - * @param array $payment_meta Payment meta. - * @param array $meta All meta. - */ - $adjustment_args = apply_filters( 'edd_30_migration_order_adjustment_creation_data', $adjustment_args, $fee, $payment_meta, $meta ); - - $adjustment_id = edd_add_order_adjustment( $adjustment_args ); - - if ( ! empty( $refund_id ) ) { - - // Since the refund is a near copy of the original order, copy over the arguments. - $refund_adjustment_args = $adjustment_args; - - $refund_adjustment_args['parent'] = $adjustment_id; - $refund_adjustment_args['object_id'] = $refund_id; - - // Negate the amounts. - $refund_adjustment_args['subtotal'] = edd_negate_amount( floatval( $fee['amount'] ) ); - $refund_adjustment_args['tax'] = edd_negate_amount( $tax ); - $refund_adjustment_args['total'] = edd_negate_amount( floatval( $fee['amount'] ) + $tax ); - - $refund_adjustment_id = edd_add_order_adjustment( $refund_adjustment_args ); - } - } - } - - // Add fee taxes (order and order item) if the order tax amount was previously manually calculated. - if ( false === $meta_tax ) { - edd_update_order( $order_id, array( - 'tax' => $order_tax + $order_fees_tax + $order_items_fees_tax, - ) ); - } - - // Add fee totals (order and order item) if the order tax amount was previously manually calculated. - // Order item fees were previously included in the total calculation. We must manually include - // order item fee tax amounts, and order fees total (subtotal + tax). - if ( false === $meta_total ) { - edd_update_order( $order_id, array( - 'total' => $order_total + $order_fees_total + $order_items_fees_tax, - ) ); - } - - // Insert discounts. - $discounts = ! empty( $user_info['discount'] ) - ? $user_info['discount'] - : array(); - - if ( ! is_array( $discounts ) ) { - $discounts = explode( ',', $discounts ); - } - - if ( ! empty( $discounts ) && ( 'none' !== $discounts[0] ) ) { - if ( 1 === count( $discounts ) ) { - $discount_code = reset( $discounts ); - - /** @var \EDD_Discount $discount_object */ - $discount_object = edd_get_discount_by( 'code', $discount_code ); - - if ( $discount_object instanceof \EDD_Discount ) { - $discount_args = array( - 'object_id' => $order_id, - 'object_type' => 'order', - 'type_id' => $discount_object->id, - 'type' => 'discount', - 'description' => $discount_object->code, - 'subtotal' => $order_discount, - 'total' => $order_discount, - 'date_created' => $date_created_gmt, - 'date_modified' => $data->post_modified_gmt, - ); - - /** - * Filters the arguments used to create a discount adjustment. - * - * @since 3.0 - * - * @param array $discount_args Order adjustment arguments. - * @param \EDD_Discount $discount_object Discount object. - * @param float $order_subtotal Order subtotal. - * @param array $user_info User info array. - * @param array $payment_meta Payment meta. - * @param array $meta All post meta. - */ - $discount_args = apply_filters( 'edd_30_migration_order_discount_creation_data', $discount_args, $discount_object, $order_subtotal, $user_info, $payment_meta, $meta ); - - $new_discount_id = edd_add_order_adjustment( $discount_args ); - if ( $order_discount <= 0 ) { - edd_add_order_adjustment_meta( - $new_discount_id, - 'migrated_order_discount_unknown', - (int) $order_id, - true - ); - } - } - } else { - foreach ( $discounts as $discount_code ) { - - /** @var \EDD_Discount $discount_object */ - $discount_object = edd_get_discount_by( 'code', $discount_code ); - - if ( false === $discount_object ) { - continue; - } - - $calculated_discount = $order_subtotal - $discount_object->get_discounted_amount( $order_subtotal ); - $discount_args = array( - 'object_id' => $order_id, - 'object_type' => 'order', - 'type_id' => $discount_object->id, - 'type' => 'discount', - 'description' => $discount_object->code, - 'subtotal' => $calculated_discount, - 'total' => $calculated_discount, - 'date_created' => $date_created_gmt, - 'date_modified' => $data->post_modified_gmt, - ); - - /** - * Filters the arguments used to create a discount adjustment. - * - * @since 3.0 - * - * @param array $discount_args Order adjustment arguments. - * @param \EDD_Discount $discount_object Discount object. - * @param float $order_subtotal Order subtotal. - * @param array $user_info User info array. - * @param array $payment_meta Payment meta. - * @param array $meta All post meta. - */ - $discount_args = apply_filters( 'edd_30_migration_order_discount_creation_data', $discount_args, $discount_object, $order_subtotal, $user_info, $payment_meta, $meta ); - - $new_discount_id = edd_add_order_adjustment( $discount_args ); - if ( $calculated_discount <= 0 ) { - edd_add_order_adjustment_meta( - $new_discount_id, - 'migrated_order_discount_unknown', - (int) $order_id, - true - ); - } - } - } - } - - /** Create order meta ****************************************/ - - $core_meta_keys = array( - '_edd_payment_user_email', - '_edd_payment_customer_id', - '_edd_payment_user_id', - '_edd_payment_user_ip', - '_edd_payment_purchase_key', - '_edd_payment_total', - '_edd_payment_mode', - '_edd_payment_gateway', - '_edd_payment_meta', - '_edd_payment_tax', - '_edd_payment_tax_rate', - '_edd_completed_date', - '_edd_payment_unlimited_downloads', - '_edd_payment_number', - '_edd_payment_transaction_id', - ); - - // Determine what main payment meta keys were from core and what were custom... - $remaining_meta = array_diff_key( $meta, array_flip( $core_meta_keys ) ); - - // ...and whatever is not from core, needs to be added as new order meta. - foreach ( $remaining_meta as $meta_key => $meta_value ) { - $meta_value = maybe_unserialize( $meta_value[0] ); - - edd_add_order_meta( $order_id, $meta_key, $meta_value ); - } - - /** - * Now that we're done, let's run a hook here so we can allow extensions to make any necessary changes. - * - * @since 3.0 - * @param int $order_id The order ID. - * @param array $payment_meta The `_edd_payment_meta` value for the original payment. - * @param array $meta All post meta associated with the payment. - */ - do_action( 'edd_30_migrate_order', $order_id, $payment_meta, $meta ); - - delete_option( '_edd_v30_doing_order_migration' ); - - return $order_id; - } - - /** - * Retrieves a valid price ID for a given cart item. - * If the product does not have variable prices, then `null` is always returned. - * If the supplied price ID does not match a price ID that actually exists, then the default - * variable price is returned instead of the supplied one. - * - * @since 3.0 - * - * @param array $cart_item Array of cart item details. - * - * @return int|null - */ - protected static function get_valid_price_id_for_cart_item( $cart_item ) { - // If the product doesn't have variable prices, just return `null`. - if ( ! edd_has_variable_prices( $cart_item['id'] ) ) { - return null; - } - - $variable_prices = edd_get_variable_prices( $cart_item['id'] ); - if ( ! is_array( $variable_prices ) || empty( $variable_prices ) ) { - return null; - } - - // Return the price ID that's set to the cart item right now, if not numeric return NULL. - return isset( $cart_item['item_number']['options']['price_id'] ) && is_numeric( $cart_item['item_number']['options']['price_id'] ) - ? absint( $cart_item['item_number']['options']['price_id'] ) - : null; - } - - /** - * Attempts to locate a PayPal transaction ID from legacy payment notes. - * - * @since 3.0 - * - * @param int $payment_id - * - * @return string|false Transaction ID on success, false if not found. - */ - private static function find_transaction_id_from_notes( $payment_id ) { - global $wpdb; - - $payment_notes = $wpdb->get_col( $wpdb->prepare( - "SELECT comment_content FROM {$wpdb->comments} WHERE comment_post_ID = %d", - $payment_id - ) ); - - if ( empty( $payment_notes ) || ! is_array( $payment_notes ) ) { - return false; - } - - foreach ( $payment_notes as $note ) { - if ( preg_match( '/^PayPal Transaction ID: ([^\s]+)/', $note, $match ) ) { - return $match[1]; - } - } - - return false; - } - - /** - * Tax rates. - * - * @since 3.0 - * - * @param object $data Data to migrate. - */ - public static function tax_rates( $data = null ) { - - // Bail if no data passed. - if ( ! $data ) { - return; - } - - $scope = ! empty( $data['global'] ) - ? 'country' - : 'region'; - - // If the scope is 'country', look for other active rates that are country wide and set them as 'inactive'. - if ( 'country' === $scope ) { - $tax_rates = edd_get_adjustments( - array( - 'type' => 'tax_rate', - 'status' => 'active', - 'scope' => 'country', - 'name' => $data['country'], - ) - ); - - if ( ! empty( $tax_rates ) ) { - foreach ( $tax_rates as $tax_rate ) { - edd_update_adjustment( - $tax_rate->id, - array( 'status' => 'inactive', ) - ); - } - } - } - - $adjustment_data = array( - 'name' => $data['country'], - 'scope' => $scope, - 'amount' => floatval( $data['rate'] ), - ); - - if ( ! empty( $data['state'] ) ) { - $adjustment_data['description'] = sanitize_text_field( $data['state'] ); - } - - edd_add_tax_rate( $adjustment_data ); - } - - /** - * Normalizes and backfills legacy payment cart data. - * - * @since 3.0.0 - * - * @param array|string $cart_details Cart details. No action is performed if a string - * (array cannot be unserialized) is provided. - * @return array|string - */ - private static function normalize_cart_details( $cart_details ) { - if ( ! is_array( $cart_details ) ) { - return $cart_details; - } - - foreach ( $cart_details as &$cart_item ) { - - // Get price. - $cart_item['price'] = isset( $cart_item['price'] ) - ? (float) $cart_item['price'] - : 0.00; - - // Get item price. - $cart_item['item_price'] = isset( $cart_item['item_price'] ) - ? (float) $cart_item['item_price'] - : (float) $cart_item['price']; - - // Get quantity. - $cart_item['quantity'] = isset( $cart_item['quantity'] ) - ? $cart_item['quantity'] - : 1; - - // Get subtotal. - $cart_item['subtotal'] = isset( $cart_item['subtotal'] ) - ? (float) $cart_item['subtotal'] - : (float) $cart_item['quantity'] * $cart_item['item_price']; - - // Get discount. - $cart_item['discount'] = isset( $cart_item['discount'] ) - ? (float) $cart_item['discount'] - : 0.00; - - // Get tax. - $cart_item['tax'] = isset( $cart_item['tax'] ) - ? (float) $cart_item['tax'] - : 0.00; - } - - return $cart_details; - } - - /** - * Given that some data quite possible has bad serialization, we need to possibly fix the bad serialization. - * - * @since 3.0.0 - * - * @param $data - * - * @return mixed - */ - public static function fix_possible_serialization( $data ) { - if ( ! is_array( $data ) && is_string( $data ) ) { - $data = substr_replace( $data, 'a', 0, 1 ); - } - - return $data; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-discounts.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-discounts.php deleted file mode 100644 index 6697c20d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-discounts.php +++ /dev/null @@ -1,95 +0,0 @@ -completed_message = __( 'Discounts migration completed successfully.', 'easy-digital-downloads' ); - $this->upgrade = 'migrate_discounts'; - } - - /** - * Retrieve the data pertaining to the current step and migrate as necessary. - * - * @since 3.0 - * - * @return bool True if data was migrated, false otherwise. - */ - public function get_data() { - $offset = ( $this->step - 1 ) * $this->per_step; - - $results = $this->get_db()->get_results( $this->get_db()->prepare( - "SELECT * - FROM {$this->get_db()->posts} - WHERE post_type = %s - LIMIT %d, %d", - esc_sql( 'edd_discount' ), $offset, $this->per_step - ) ); - - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - - // Check if discount has already been migrated. - if ( edd_get_discount( $result->ID ) ) { - continue; - } - - Data_Migrator::discounts( $result ); - } - - return true; - } - - return false; - } - - /** - * Calculate the percentage completed. - * - * @since 3.0 - * - * @return float Percentage. - */ - public function get_percentage_complete() { - $total = $this->get_db()->get_var( $this->get_db()->prepare( "SELECT COUNT(ID) AS count FROM {$this->get_db()->posts} WHERE post_type = %s", esc_sql( 'edd_discount' ) ) ); - - if ( empty( $total ) ) { - $total = 0; - } - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-logs.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-logs.php deleted file mode 100644 index c3533998..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-logs.php +++ /dev/null @@ -1,93 +0,0 @@ -completed_message = __( 'Logs migration completed successfully.', 'easy-digital-downloads' ); - $this->upgrade = 'migrate_logs'; - } - - /** - * Retrieve the data pertaining to the current step and migrate as necessary. - * - * @since 3.0 - * - * @return bool True if data was migrated, false otherwise. - */ - public function get_data() { - $offset = ( $this->step - 1 ) * $this->per_step; - - $results = $this->get_db()->get_results( $this->get_db()->prepare( - "SELECT p.*, t.slug - FROM {$this->get_db()->posts} AS p - LEFT JOIN {$this->get_db()->term_relationships} AS tr ON (p.ID = tr.object_id) - LEFT JOIN {$this->get_db()->term_taxonomy} AS tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) - LEFT JOIN {$this->get_db()->terms} AS t ON (tt.term_id = t.term_id) - WHERE p.post_type = %s AND t.slug != %s - GROUP BY p.ID - LIMIT %d, %d", - esc_sql( 'edd_log' ), esc_sql( 'sale' ), $offset, $this->per_step - ) ); - - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - Data_Migrator::logs( $result ); - } - - return true; - } - - return false; - } - - /** - * Calculate the percentage completed. - * - * @since 3.0 - * - * @return float Percentage. - */ - public function get_percentage_complete() { - $total = $this->get_db()->get_var( $this->get_db()->prepare( "SELECT COUNT(ID) AS count FROM {$this->get_db()->posts} WHERE post_type = %s", esc_sql( 'edd_log' ) ) ); - - if ( empty( $total ) ) { - $total = 0; - } - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-order-notes.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-order-notes.php deleted file mode 100644 index 636fc86d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-order-notes.php +++ /dev/null @@ -1,91 +0,0 @@ -completed_message = __( 'Order notes migration completed successfully.', 'easy-digital-downloads' ); - $this->upgrade = 'migrate_order_notes'; - } - - /** - * Retrieve the data pertaining to the current step and migrate as necessary. - * - * @since 3.0 - * - * @return bool True if data was migrated, false otherwise. - */ - public function get_data() { - $offset = ( $this->step - 1 ) * $this->per_step; - - $results = $this->get_db()->get_results( $this->get_db()->prepare( - "SELECT * - FROM {$this->get_db()->comments} - WHERE comment_type = %s - ORDER BY comment_id ASC - LIMIT %d, %d", - esc_sql( 'edd_payment_note' ), $offset, $this->per_step - ) ); - - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - $result->object_id = $result->comment_post_ID; - Data_Migrator::order_notes( $result ); - } - - return true; - } - - return false; - } - - /** - * Calculate the percentage completed. - * - * @since 3.0 - * - * @return float Percentage. - */ - public function get_percentage_complete() { - $total = $this->get_db()->get_var( $this->get_db()->prepare( "SELECT COUNT(comment_ID) AS count FROM {$this->get_db()->comments} WHERE comment_type = %s", esc_sql( 'edd_payment_note' ) ) ); - - if ( empty( $total ) ) { - $total = 0; - } - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-orders.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-orders.php deleted file mode 100644 index 3f9cf288..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-orders.php +++ /dev/null @@ -1,141 +0,0 @@ -completed_message = __( 'Orders migration completed successfully.', 'easy-digital-downloads' ); - $this->upgrade = 'migrate_orders'; - } - - /** - * Retrieve the data pertaining to the current step and migrate as necessary. - * - * @since 3.0 - * - * @return bool True if data was migrated, false otherwise. - */ - public function get_data() { - $offset = ( $this->step - 1 ) * $this->per_step; - - $results = $this->get_db()->get_results( $this->get_db()->prepare( - "SELECT * - FROM {$this->get_db()->posts} - WHERE post_type = %s - ORDER BY ID ASC - LIMIT %d, %d", - esc_sql( 'edd_payment' ), $offset, $this->per_step - ) ); - - if ( ! empty( $results ) ) { - $orders = new \EDD\Database\Queries\Order(); - foreach ( $results as $result ) { - - // Check if order has already been migrated. - if ( $orders->get_item( $result->ID ) ) { - continue; - } - - Data_Migrator::orders( $result ); - } - - return true; - } - $this->recalculate_sales_earnings(); - - return false; - } - - /** - * Recalculates the sales and earnings numbers for all downloads once the orders have been migrated. - * - * @since 3.0 - * @return void - */ - private function recalculate_sales_earnings() { - global $wpdb; - - $downloads = $wpdb->get_results( - "SELECT ID - FROM {$wpdb->posts} - WHERE post_type = 'download' - ORDER BY ID ASC" - ); - $total = count( $downloads ); - if ( ! empty( $total ) ) { - foreach ( $downloads as $download ) { - edd_recalculate_download_sales_earnings( $download->ID ); - } - } - } - - /** - * Recalculates all customer values. - * - * @since 3.1.2 - * @return void - */ - private function recalculate_customer_values() { - $customers = edd_get_customers( - array( - 'number' => 9999999, - ) - ); - - if ( ! empty( $customers ) ) { - foreach ( $customers as $customer ) { - $customer->recalculate_stats(); - } - } - } - - /** - * Calculate the percentage completed. - * - * @since 3.0 - * - * @return float Percentage. - */ - public function get_percentage_complete() { - $total = $this->get_db()->get_var( $this->get_db()->prepare( "SELECT COUNT(id) AS count FROM {$this->get_db()->posts} WHERE post_type = %s", esc_sql( 'edd_payment' ) ) ); - - if ( empty( $total ) ) { - $total = 0; - } - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-remove-legacy-data.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-remove-legacy-data.php deleted file mode 100644 index e59d3b27..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-remove-legacy-data.php +++ /dev/null @@ -1,166 +0,0 @@ -completed_message = __( 'Legacy data removed successfully.', 'easy-digital-downloads' ); - $this->upgrade = 'v30_legacy_data_removed'; - } - - /** - * Retrieve the data pertaining to the current step and migrate as necessary. - * - * @since 3.0 - * - * @return bool True if data was migrated, false otherwise. - */ - public function get_data() { - // Perform some database operations on the first step. - if ( 1 === $this->step ) { - // Drop customer `payment_ids` column. It's no longer needed. - $customer_table = edd_get_component_interface( 'customer', 'table' ); - if ( $customer_table instanceof \EDD\Database\Tables\Customers ) { - if ( $customer_table->column_exists( 'payment_ids' ) ) { - $this->get_db()->query( "ALTER TABLE {$this->get_db()->edd_customers} DROP `payment_ids`" ); - } - - if ( $customer_table->column_exists( 'notes' ) ) { - $this->get_db()->query( "ALTER TABLE {$this->get_db()->edd_customers} DROP `notes`" ); - } - } - - // Delete unneeded meta. - $this->get_db()->query( $this->get_db()->prepare( "DELETE FROM {$this->get_db()->edd_customermeta} WHERE meta_key = %s", esc_sql( 'additional_email' ) ) ); - $this->get_db()->query( $this->get_db()->prepare( "DELETE FROM {$this->get_db()->usermeta} WHERE meta_key = %s", esc_sql( '_edd_user_address' ) ) ); - } - - // First delete custom post types. - $results = $this->get_db()->get_col( $this->get_db()->prepare( - "SELECT id - FROM {$this->get_db()->posts} - WHERE post_type IN(%s, %s, %s) - ORDER BY id ASC - LIMIT %d", - esc_sql( 'edd_payment' ), esc_sql( 'edd_discount' ), esc_sql( 'edd_log' ), $this->per_step - ), 0 ); - - $data_was_deleted = false; - - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - wp_delete_post( $result, true ); - } - - $data_was_deleted = true; - } - - // Then delete order notes, stored in comments. - $results = $this->get_db()->get_col( $this->get_db()->prepare( - "SELECT comment_ID - FROM {$this->get_db()->comments} - WHERE comment_type = %s - ORDER BY comment_ID ASC - LIMIT %d", - 'edd_payment_note', $this->per_step - ) ); - if ( ! empty( $results ) ) { - foreach( $results as $result ) { - wp_delete_comment( $result, true ); - } - - $data_was_deleted = true; - } - - return $data_was_deleted; - } - - /** - * Calculate the percentage completed. - * - * Because we're *deleting* records as we go, this percentage will not be accurate because we don't track - * exactly how many we've deleted. So this percentage is really just best guess. - * - * @since 3.0 - * - * @return float Percentage. - */ - public function get_percentage_complete() { - // Get post type total. - $total = $this->get_db()->get_var( $this->get_db()->prepare( - "SELECT COUNT(id) AS count - FROM {$this->get_db()->posts} - WHERE post_type IN(%s, %s, %s)", - esc_sql( 'edd_payment' ), esc_sql( 'edd_discount' ), esc_sql( 'edd_log' ) - ) ); - - if ( empty( $total ) ) { - $total = 0; - } - - // Get order note total. - $order_note_total = $this->get_db()->get_var( $this->get_db()->prepare( - "SELECT COUNT(comment_ID) AS count - FROM {$this->get_db()->comments} - WHERE comment_type = %s", - 'edd_payment_note' - ) ); - - if ( empty( $order_note_total ) ) { - $order_note_total = 0; - } - - // Combine the two. - $total += $order_note_total; - - // Estimate how many we've already done to improve the percentage. - $number_done = $this->per_step * $this->step; - $total += $number_done; - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( $number_done / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-tax-rates.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-tax-rates.php deleted file mode 100644 index 970faee7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/class-tax-rates.php +++ /dev/null @@ -1,96 +0,0 @@ -completed_message = __( 'Tax rates migration completed successfully.', 'easy-digital-downloads' ); - $this->upgrade = 'migrate_tax_rates'; - } - - /** - * Retrieve the data pertaining to the current step and migrate as necessary. - * - * @since 3.0 - * - * @return bool True if data was migrated, false otherwise. - */ - public function get_data() { - $offset = ( $this->step - 1 ) * $this->per_step; - - if ( 1 === $this->step ) { - $default_tax_rate = edd_get_option( 'tax_rate', false ); - if ( ! empty( $default_tax_rate ) ) { - edd_add_tax_rate( - array( - 'scope' => 'global', - 'amount' => floatval( $default_tax_rate ), - ) - ); - } - } - - $results = get_option( 'edd_tax_rates', array() ); - $results = array_slice( $results, $offset, $this->per_step, true ); - - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - Data_Migrator::tax_rates( $result ); - } - - return true; - } - - return false; - } - - /** - * Calculate the percentage completed. - * - * @since 3.0 - * - * @return float Percentage. - */ - public function get_percentage_complete() { - $total = count( get_option( 'edd_tax_rates', array() ) ); - - if ( empty( $total ) ) { - $total = 0; - } - - $percentage = 100; - - if ( $total > 0 ) { - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; - } - - if ( $percentage > 100 ) { - $percentage = 100; - } - - return $percentage; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/upgrade-actions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/upgrade-actions.php deleted file mode 100644 index 4c923980..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upgrades/v3/upgrade-actions.php +++ /dev/null @@ -1,106 +0,0 @@ - $upgrade_details ) { - if ( edd_has_upgrade_completed( $upgrade_key ) ) { - unset( $all_upgrades[ $upgrade_key ] ); - } - } - - $upgrade_keys = array_keys( $all_upgrades ); - - // Use supplied upgrade key if available, otherwise the first item in the list. - $upgrade_key = ! empty( $_POST['upgrade_key'] ) && 'false' !== $_POST['upgrade_key'] ? $_POST['upgrade_key'] : false; - if ( empty( $upgrade_key ) ) { - $upgrade_key = reset( $upgrade_keys ); - } - - if ( ! array_key_exists( $upgrade_key, $all_upgrades ) ) { - wp_send_json_error( sprintf( __( '"%s" is not a valid 3.0 upgrade.', 'easy-digital-downloads' ), $upgrade_key ) ); - } - - $step = ! empty( $_POST['step'] ) ? absint( $_POST['step'] ) : 1; - - // If we have a step already saved, use that instead. - $saved_step = get_option( sprintf( 'edd_v3_migration_%s_step', sanitize_key( $upgrade_key ) ) ); - if ( ! empty( $saved_step ) ) { - $step = absint( $saved_step ); - } - - $class_name = $all_upgrades[ $upgrade_key ]['class']; - - // Load the required classes. - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php'; - do_action( 'edd_batch_export_class_include', $class_name ); - - if ( ! class_exists( $class_name ) ) { - wp_send_json_error( __( 'Error loading migration class.', 'easy-digital-downloads' ) ); - } - - /** @var \EDD_Batch_Export $export */ - $export = new $class_name( $step ); - - if ( ! $export->can_export() ) { - wp_die( -1, 403, array( 'response' => 403 ) ); - } - - $was_processed = $export->process_step(); - $percentage_complete = round( $export->get_percentage_complete(), 2 ); - - // Build some shared args. - $response_args = array( - 'upgrade_processed' => $upgrade_key, - 'nonce' => wp_create_nonce( 'edd_process_v3_upgrade' ) - ); - - if ( $was_processed ) { - // Data was processed, which means we'll want to repeat this upgrade again next time. - wp_send_json_success( wp_parse_args( array( - 'upgrade_completed' => false, - 'next_step' => $step + 1, - 'next_upgrade' => $upgrade_key, - 'percentage' => $percentage_complete, - ), $response_args ) ); - } else { - // No data was processed, which means it's time to move on to the next upgrade. - - // Figure out which upgrade is next. - $remaining_upgrades = array_slice( $upgrade_keys, array_search( $upgrade_key, $upgrade_keys ) + 1 ); - $next_upgrade = ! empty( $remaining_upgrades ) ? reset( $remaining_upgrades ) : false; - - wp_send_json_success( wp_parse_args( array( - 'upgrade_completed' => true, - 'next_step' => 1, - 'next_upgrade' => $next_upgrade, - 'percentage' => 0 - ), $response_args ) ); - } - -} - -add_action( 'wp_ajax_edd_process_v3_upgrade', 'edd_process_v3_upgrade' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/upload-functions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/upload-functions.php deleted file mode 100644 index f40df5af..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/upload-functions.php +++ /dev/null @@ -1,185 +0,0 @@ -\n"; - $rules .= "Order Allow,Deny\n"; - $rules .= "Allow from all\n"; - $rules .= "\n"; - break; - } - - /** - * Filter and return the htaccess rules used to allow or deny access - * - * @since 1.6 - * - * @param string $rules The contents of .htaccess - * @param string $method The method (either direct|redirect) - */ - return apply_filters( 'edd_protected_directory_htaccess_rules', $rules, $method ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/notifications.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/notifications.php deleted file mode 100644 index b804d688..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/notifications.php +++ /dev/null @@ -1,106 +0,0 @@ - -
    -
    - -
    -
    -

    - ' - ), - array( 'span' => array( 'x-text' => true ) ) - ); - ?> -

    - - -
    - -
    - - - - - -
    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-actions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-actions.php deleted file mode 100644 index 1ad4d14e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-actions.php +++ /dev/null @@ -1,71 +0,0 @@ -id ); -$is_override = edd_is_order_refundable_by_override( $order->id ); -$is_window_passed = edd_is_order_refund_window_passed( $order->id ); - -if ( true === edd_is_add_order_page() ) : -?> - - - - - - - -status && edd_get_order_total( $order->id ) > 0 ) : ?> -
    - - -
    - -
    - gateway ) : ?> - - - - - - - - -
    - gateway ) : ?> -
    -

    -
    - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-adjustment-discount.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-adjustment-discount.php deleted file mode 100644 index e339cb3f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-adjustment-discount.php +++ /dev/null @@ -1,48 +0,0 @@ - 'edd-discounts', - 'edd-action' => 'edit_discount', - ) -); -?> - - - - -
    - <# if ( true === data.state.isAdding ) { #> - - <# } #> - - -
    - - - - –{{ data.totalCurrency }} - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-adjustment.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-adjustment.php deleted file mode 100644 index 2b6b930f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-adjustment.php +++ /dev/null @@ -1,64 +0,0 @@ - 'edd-discounts', - 'edd-action' => 'edit_discount', - ) -); -?> - - - - -
    - <# if ( true === data.state.isAdding ) { #> - - <# } #> - -
    - <# if ( '' !== data.description ) { #> - {{ data.description }} - <# } #> - - <# if ( '' !== data.description || false !== data.orderItem ) { #> -
    - - <# } #> - <# if ( false !== data.orderItem ) { #> - : {{ data.orderItem.productName }} - <# } else if ( 'credit' === data.type ) { #> - - <# } else { #> - - <# } #> - <# if ( '' !== data.description || false !== data.orderItem ) { #> - - <# } #> -
    -
    - - - - <# if ( 'fee' !== data.type || data.subtotal < 0 ) { #>–<# } #>{{ data.subtotalCurrency }} - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-copy-download-link.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-copy-download-link.php deleted file mode 100644 index b4fc360e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-copy-download-link.php +++ /dev/null @@ -1,39 +0,0 @@ - - -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-form-add-order-adjustment.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-form-add-order-adjustment.php deleted file mode 100644 index 4b8241db..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-form-add-order-adjustment.php +++ /dev/null @@ -1,174 +0,0 @@ - - -
    -
    -
    - - - - -

    - -

    - -

    - -

    -
    - - <# if ( 'fee' === data.type && data.orderItems.length > 0 ) { #> -

    - - - -

    - <# } #> - -

    - - - - - - - - - - - - -

    - - <# if ( 'none' !== data.state.hasTax && 'fee' === data.type ) { #> -

    - -

    - <# } #> - - <# - if ( - 'fee' === data.type && - 'none' !== data.state.hasTax && - '' === data.state.hasTax.country - ) { - #> -
    -

    -
    - -

    -

    - -

    -
    - <# } #> - -

    - - -

    - -

    - - disabled - <# } #> - /> -

    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-form-add-order-discount.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-form-add-order-discount.php deleted file mode 100644 index 01bcb4a6..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-form-add-order-discount.php +++ /dev/null @@ -1,72 +0,0 @@ - 100, - 'status' => 'active', -) ); -?> - -
    -
    -

    - - - - - <# if ( true === data._isDuplicate ) { #> - - - - <# } #> -

    - -

    - <# if ( true === data.state.isFetching ) { #> - - <# } #> - - - disabled - <# } #> - /> -

    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-form-add-order-item.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-form-add-order-item.php deleted file mode 100644 index ffa4c206..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-form-add-order-item.php +++ /dev/null @@ -1,260 +0,0 @@ - 'ids', - 'orderby' => 'date', - 'order' => 'ASC', - 'post_type' => 'download', - 'posts_per_page' => 25, - 'post_status' => array( - 'publish', - 'draft', - 'private', - 'future', - ), -) ); - -if ( ! empty( $recent_downloads ) ) { - - foreach ( $recent_downloads as $download_id ) { - $prices = edd_get_variable_prices( $download_id ); - - // Non-variable items. - if ( empty( $prices ) ) { - $downloads[] = array( - 'id' => $download_id, - 'name' => edd_get_download_name( $download_id ), - ); - // Variable items. - } else { - foreach ( $prices as $key => $value ) { - $name = edd_get_download_name( $download_id, $key ); - - if ( ! empty( $name ) ) { - $downloads[] = array( - 'id' => $download_id . '_' . $key, - 'name' => esc_html( $name ), - ); - } - } - } - } -} -?> - -
    -
    - <# if ( false !== data.state.error ) { #> -
    -

    {{ data.state.error }}

    -
    - <# } #> - -

    - - - - - <# if ( true === data.state.isDuplicate ) { #> - - - - <# } #> -

    - - <# if ( false !== data.state.hasQuantity ) { #> -

    - - - disabled - <# } #> - /> -

    - <# } #> - -

    - -

    - - <# if ( 'none' !== data.state.hasTax && '' === data.state.hasTax.country && false === data.state.isAdjustingManually ) { #> -
    -

    -
    - -

    -

    - -

    -
    - <# } #> - - <# if ( true === data.state.isAdjustingManually ) { #> - -

    - - - - - - - - - - - - -

    - - <# if ( 'none' !== data.state.hasTax ) { #> -

    - - - - - - - - - - - - -

    - <# } #> - -

    - - - - - - - - - - - - -

    - - <# } #> - -

    - <# if ( true === data.state.isFetching ) { #> - - <# } #> - - - disabled - <# } #> - /> -

    -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-item.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-item.php deleted file mode 100644 index be25a2d4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-item.php +++ /dev/null @@ -1,90 +0,0 @@ - 'edit', - ), - admin_url( 'post.php' ) -); -?> - - -
    - <# if ( true === data.state.isAdding ) { #> - - <# } #> - -
    - - {{{ data.productName }}} - - <# if ( false === data.state.isRefund ) { #> - <# if ( [ 'refunded', 'partially_refunded' ].includes( data.status ) ) { #> - — {{{ data.statusLabel }}} - <# } #> - <# } #> - -
    - <# if ( 'none' !== data.state.hasTax ) { #> - - - {{ data.taxCurrency }} - <# if ( true === data.config.isAdjustingManually ) { #>†<# } #> - - <# } #> - - <# if ( false === data.state.isAdding && true === data.deliverable ) { #> - - - - <# } #> -
    -
    - - -
    - - - - {{ data.amountCurrency }} - <# if ( true === data.config.isAdjustingManually ) { #>†<# } #> - - -<# if ( true === data.state.hasQuantity ) { #> - - {{ data.quantity }} - -<# } #> - - - {{ data.subtotalCurrency }} - <# if ( true === data.config.isAdjustingManually ) { #>†<# } #> - - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-no-items.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-no-items.php deleted file mode 100644 index 637a5dc5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-no-items.php +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-refund.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-refund.php deleted file mode 100644 index 13944d0a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-refund.php +++ /dev/null @@ -1,41 +0,0 @@ - 'edd-payment-history', - 'view' => 'view-refund-details', -) ); -?> - - - - - {{ data.number }}' - ), - array( - 'a' => array( - 'href' => true, - ), - ) - ); - ?> -
    - {{ data.dateCreated }} - - - - {{ data.totalCurrency }} - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-subtotal.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-subtotal.php deleted file mode 100644 index bd4953fa..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-subtotal.php +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - {{ data.subtotalCurrency }} - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-tax.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-tax.php deleted file mode 100644 index 0d87c6ab..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-tax.php +++ /dev/null @@ -1,73 +0,0 @@ - - -<# if ( 'none' !== data.state.hasTax && false !== data.state.hasTax.rate ) { #> - - - - - <# if ( false !== data.state.hasTax.rate && '' !== data.state.hasTax.country ) { #> - {{ data.state.hasTax.country }}<# if ( '' !== data.state.hasTax.region ) { #>: {{ data.state.hasTax.region }}<# } #> – {{ data.state.hasTax.rate }}% -
    - <# } else if ( false !== data.state.hasTax.rate ) { #> - {{ data.state.hasTax.rate }}% -
    - <# } #> - - - - - - {{ data.taxCurrency }} - - - - <# if ( false !== data.state.hasNewTaxRate && true === data.hasTaxableItems ) { #> - - - -
    -

    - -

    -

    - -

    - - -
    - - - <# } #> - -<# } #> - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-total.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-total.php deleted file mode 100644 index c57d0511..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-order-total.php +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - <# if ( data.state.hasManualAdjustment ) { #> -
    - - <# } #> - - - {{ data.totalCurrency }} - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-add.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-add.php deleted file mode 100644 index fd8762c4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-add.php +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - html->country_select( array( - 'id' => 'tax_rate_country', - ) ); - ?> - - - - - - - -
    - - - - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-bulk-actions.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-bulk-actions.php deleted file mode 100644 index b88c3316..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-bulk-actions.php +++ /dev/null @@ -1,33 +0,0 @@ - - -
    - -
    - - - -
    - -
    - -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-meta.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-meta.php deleted file mode 100644 index 53be0ea4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-meta.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-row-empty.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-row-empty.php deleted file mode 100644 index 1a85272e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-row-empty.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-row.php b/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-row.php deleted file mode 100644 index 29787a1c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/admin/views/tmpl-tax-rates-table-row.php +++ /dev/null @@ -1,55 +0,0 @@ - - - - checked<# } #> /> - - - - <# if ( data.country ) { #> - {{ data.country }} - <# } else { #> - * - <# } #> - - - - - <# if ( data.global ) { #> - — - - <# } else if ( data.region ) { #> - {{ data.region }} - - <# } else { #> - — - - <# } #> - - - - {{ data.formattedAmount }} - - - - - <# if ( data.unsaved ) { #> - - <# } else if ( 'active' === data.status ) { #> - - <# } else { #> - - <# } #> - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/ajax-functions.php b/wp-content/plugins/easy-digital-downloads/includes/ajax-functions.php deleted file mode 100644 index 7432400e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/ajax-functions.php +++ /dev/null @@ -1,1456 +0,0 @@ -enabled() ) { - return true; - } - - } else { - if ( $airplane->check_status() == 'on' ) { - return true; - } - } - } - - add_filter( 'block_local_requests', '__return_false' ); - - if ( get_transient( '_edd_ajax_works' ) ) { - return true; - } - - $works = true; - $ajax = wp_safe_remote_post( esc_url_raw( edd_get_ajax_url() ), array( - 'sslverify' => false, - 'timeout' => 30, - 'body' => array( - 'action' => 'edd_test_ajax' - ) - ) ); - - if ( is_wp_error( $ajax ) ) { - $works = false; - - } else { - - if ( empty( $ajax['response'] ) ) { - $works = false; - } - - if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) { - $works = false; - } - - if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) { - $works = false; - } - - if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) { - $works = false; - } - } - - if ( $works ) { - set_transient( '_edd_ajax_works', '1', DAY_IN_SECONDS ); - } - - return $works; -} - -/** - * Get AJAX URL - * - * @since 1.3 - * @return string URL to the AJAX file to call during AJAX requests. -*/ -function edd_get_ajax_url() { - $scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin'; - - $current_url = edd_get_current_page_url(); - $ajax_url = admin_url( 'admin-ajax.php', $scheme ); - - if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) { - $ajax_url = preg_replace( '/^http/', 'https', $ajax_url ); - } - - return apply_filters( 'edd_ajax_url', $ajax_url ); -} - -/** - * Removes item from cart via AJAX. - * - * @since 1.0 - * @return void - */ -function edd_ajax_remove_from_cart() { - if ( ! isset( $_POST['nonce'] ) ) { - edd_debug_log( __( 'Missing nonce when removing an item from the cart. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), true ); - } - - if ( isset( $_POST['cart_item'] ) && isset( $_POST['nonce'] ) ) { - - - $cart_item = absint( $_POST['cart_item'] ); - $nonce = sanitize_text_field( $_POST['nonce'] ); - - $nonce_verified = wp_verify_nonce( $nonce, 'edd-remove-cart-widget-item' ); - - if ( false === $nonce_verified ) { - $return = array( 'removed' => 0 ); - } else { - edd_remove_from_cart( $cart_item ); - - $return = array( - 'removed' => 1, - 'subtotal' => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ), ENT_COMPAT, 'UTF-8' ), - 'total' => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ), ENT_COMPAT, 'UTF-8' ), - 'cart_quantity' => html_entity_decode( edd_get_cart_quantity() ), - ); - - if ( edd_use_taxes() ) { - $cart_tax = (float) edd_get_cart_tax(); - $return['tax'] = html_entity_decode( edd_currency_filter( edd_format_amount( $cart_tax ) ), ENT_COMPAT, 'UTF-8' ); - } - } - - $return = apply_filters( 'edd_ajax_remove_from_cart_response', $return ); - - echo json_encode( $return ); - - } - edd_die(); -} -add_action( 'wp_ajax_edd_remove_from_cart', 'edd_ajax_remove_from_cart' ); -add_action( 'wp_ajax_nopriv_edd_remove_from_cart', 'edd_ajax_remove_from_cart' ); - -/** - * Adds item to the cart via AJAX. - * - * @since 1.0 - * @return void - */ -function edd_ajax_add_to_cart() { - if ( ! isset( $_POST['download_id'] ) ) { - edd_die(); - } - - $download_id = absint( $_POST['download_id'] ); - $request_validated = false; - if ( isset( $_POST['timestamp'] ) && isset( $_POST['token'] ) && EDD\Utils\Tokenizer::is_token_valid( $_POST['token'], $_POST['timestamp'] ) ) { - $request_validated = true; - } elseif ( isset( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], 'edd-add-to-cart-' . $download_id ) ) { - $request_validated = true; - } - - if ( ! $request_validated ) { - edd_debug_log( __( 'Missing nonce when adding an item to the cart. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), true ); - edd_die( '', '', 403 ); - } - - $to_add = array(); - - if ( isset( $_POST['price_ids'] ) && is_array( $_POST['price_ids'] ) ) { - foreach ( $_POST['price_ids'] as $price ) { - $to_add[] = array( 'price_id' => $price ); - } - } - - $items = ''; - - if ( isset( $_POST['post_data'] ) ) { - parse_str( $_POST['post_data'], $post_data ); - } else { - $post_data = array(); - } - - foreach ( $to_add as $options ) { - - if ( $_POST['download_id'] == $options['price_id'] ) { - $options = array(); - } - - if ( isset( $options['price_id'] ) && isset( $post_data['edd_download_quantity_' . $options['price_id'] ] ) ) { - - $options['quantity'] = absint( $post_data['edd_download_quantity_' . $options['price_id'] ] ); - - } else { - - $options['quantity'] = isset( $post_data['edd_download_quantity'] ) ? absint( $post_data['edd_download_quantity'] ) : 1; - - } - - $key = edd_add_to_cart( $_POST['download_id'], $options ); - - $item = array( - 'id' => $_POST['download_id'], - 'options' => $options, - ); - - $item = apply_filters( 'edd_ajax_pre_cart_item_template', $item ); - $items .= html_entity_decode( edd_get_cart_item_template( $key, $item, true ), ENT_COMPAT, 'UTF-8' ); - } - - $return = array( - 'subtotal' => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ), ENT_COMPAT, 'UTF-8' ), - 'total' => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ), ENT_COMPAT, 'UTF-8' ), - 'cart_item' => $items, - 'cart_quantity' => html_entity_decode( edd_get_cart_quantity() ) - ); - - if ( edd_use_taxes() ) { - $cart_tax = (float) edd_get_cart_tax(); - $return['tax'] = html_entity_decode( edd_currency_filter( edd_format_amount( $cart_tax ) ), ENT_COMPAT, 'UTF-8' ); - } - - $return = apply_filters( 'edd_ajax_add_to_cart_response', $return ); - - echo json_encode( $return ); - edd_die(); -} -add_action( 'wp_ajax_edd_add_to_cart', 'edd_ajax_add_to_cart' ); -add_action( 'wp_ajax_nopriv_edd_add_to_cart', 'edd_ajax_add_to_cart' ); - -/** - * Gets the cart's subtotal via AJAX. - * - * @since 1.0 - * @return void - */ -function edd_ajax_get_subtotal() { - echo edd_currency_filter( edd_get_cart_subtotal() ); - edd_die(); -} -add_action( 'wp_ajax_edd_get_subtotal', 'edd_ajax_get_subtotal' ); -add_action( 'wp_ajax_nopriv_edd_get_subtotal', 'edd_ajax_get_subtotal' ); - -/** - * Validates the supplied discount sent via AJAX. - * - * @since 1.0 - * @return void - */ -function edd_ajax_apply_discount() { - if ( isset( $_POST['code'] ) ) { // WPCS: CSRF ok. - $discount_code = sanitize_text_field( $_POST['code'] ); - - $return = array( - 'msg' => '', - 'code' => $discount_code, - ); - - $user = ''; - - if ( is_user_logged_in() ) { - $user = get_current_user_id(); - } else { - parse_str( $_POST['form'], $form ); // WPCS: CSRF ok. - if ( ! empty( $form['edd_email'] ) ) { - $user = urldecode( $form['edd_email'] ); - } - } - - if ( edd_is_discount_valid( $discount_code, $user ) ) { - $discount = edd_get_discount_by( 'code', $discount_code ); - $amount = edd_format_discount_rate( edd_get_discount_type( $discount->id ), edd_get_discount_amount( $discount->id ) ); - $discounts = edd_set_cart_discount( $discount_code ); - $total = edd_get_cart_total( $discounts ); - - $return = array( - 'msg' => 'valid', - 'amount' => $amount, - 'total_plain' => $total, - 'total' => html_entity_decode( edd_currency_filter( edd_format_amount( $total ) ), ENT_COMPAT, 'UTF-8' ), - 'code' => $discount_code, - 'html' => edd_get_cart_discounts_html( $discounts ), - ); - } else { - $errors = edd_get_errors(); - $return['msg'] = $errors['edd-discount-error']; - edd_unset_error( 'edd-discount-error' ); - } - - // Allow for custom discount code handling - $return = apply_filters( 'edd_ajax_discount_response', $return ); - - echo wp_json_encode( $return ); - } - - edd_die(); -} -add_action( 'wp_ajax_edd_apply_discount', 'edd_ajax_apply_discount' ); -add_action( 'wp_ajax_nopriv_edd_apply_discount', 'edd_ajax_apply_discount' ); - -/** - * Validates the supplied discount sent via AJAX. - * - * @since 1.0 - * @return void - */ -function edd_ajax_update_cart_item_quantity() { - if ( ! empty( $_POST['quantity'] ) && ! empty( $_POST['download_id'] ) ) { - - $download_id = absint( $_POST['download_id'] ); - $quantity = absint( $_POST['quantity'] ); - $options = json_decode( stripslashes( $_POST['options'] ), true ); - - EDD()->cart->set_item_quantity( $download_id, $quantity, $options ); - - $subtotal = EDD()->cart->get_subtotal(); - $taxes = EDD()->cart->get_tax(); - $total = EDD()->cart->get_total(); - - $return = array( - 'download_id' => $download_id, - 'quantity' => EDD()->cart->get_item_quantity( $download_id, $options ), - 'subtotal_raw' => $subtotal, - 'taxes_raw' => $taxes, - 'total_raw' => $total, - 'subtotal' => html_entity_decode( edd_currency_filter( edd_format_amount( $subtotal ) ), ENT_COMPAT, 'UTF-8' ), - 'taxes' => html_entity_decode( edd_currency_filter( edd_format_amount( $taxes ) ), ENT_COMPAT, 'UTF-8' ), - 'total' => html_entity_decode( edd_currency_filter( edd_format_amount( $total ) ), ENT_COMPAT, 'UTF-8' ), - 'discounts' => edd_get_cart_discounts_html(), - ); - - // Allow for custom cart item quantity handling - $return = apply_filters( 'edd_ajax_cart_item_quantity_response', $return ); - - echo json_encode($return); - } - edd_die(); -} -add_action( 'wp_ajax_edd_update_quantity', 'edd_ajax_update_cart_item_quantity' ); -add_action( 'wp_ajax_nopriv_edd_update_quantity', 'edd_ajax_update_cart_item_quantity' ); - -/** - * Removes a discount code from the cart via ajax - * - * @since 1.7 - * @return void - */ -function edd_ajax_remove_discount() { - if ( isset( $_POST['code'] ) ) { - - edd_unset_cart_discount( urldecode( $_POST['code'] ) ); - - $total = edd_get_cart_total(); - - $return = array( - 'total_plain' => $total, - 'total' => html_entity_decode( edd_currency_filter( edd_format_amount( $total ) ), ENT_COMPAT, 'UTF-8' ), - 'code' => sanitize_text_field( $_POST['code'] ), - 'discounts' => edd_get_cart_discounts(), - 'html' => edd_get_cart_discounts_html() - ); - - /** - * Allow for custom remove discount code handling. - * - * @since 2.11.4 - */ - $return = apply_filters( 'edd_ajax_remove_discount_response', $return ); - - wp_send_json( $return ); - } - edd_die(); -} -add_action( 'wp_ajax_edd_remove_discount', 'edd_ajax_remove_discount' ); -add_action( 'wp_ajax_nopriv_edd_remove_discount', 'edd_ajax_remove_discount' ); - -/** - * Loads Checkout Login Fields the via AJAX - * - * @since 1.0 - * @return void - */ -function edd_load_checkout_login_fields() { - $action = sanitize_text_field( $_POST['action'] ); - $nonce = sanitize_text_field( $_POST['nonce'] ); - - $nonce_verified = wp_verify_nonce( $nonce, 'edd_' . $action ); - - if ( $nonce_verified ) { - do_action( 'edd_purchase_form_login_fields' ); - } - - edd_die(); -} -add_action('wp_ajax_nopriv_checkout_login', 'edd_load_checkout_login_fields'); - -/** - * Load Checkout Register Fields via AJAX - * - * @since 1.0 - * @return void -*/ -function edd_load_checkout_register_fields() { - $action = sanitize_text_field( $_POST['action'] ); - $nonce = sanitize_text_field( $_POST['nonce'] ); - - $nonce_verified = wp_verify_nonce( $nonce, 'edd_' . $action ); - - if ( $nonce_verified ) { - do_action( 'edd_purchase_form_register_fields' ); - } - - edd_die(); -} -add_action('wp_ajax_nopriv_checkout_register', 'edd_load_checkout_register_fields'); - -/** - * Get Download Title via AJAX - * - * @since 1.0 - * @since 2.8 Restrict to just the download post type - * @return void - */ -function edd_ajax_get_download_title() { - if ( isset( $_POST['download_id'] ) ) { - $post_id = absint( $_POST['download_id'] ); - $post_type = get_post_type( $post_id ); - $title = 'fail'; - - if ( 'download' === $post_type ) { - $post_title = get_the_title( $_POST['download_id'] ); - if ( $post_title ) { - echo $title = $post_title; - } - } - - echo $title; - } - edd_die(); -} -add_action( 'wp_ajax_edd_get_download_title', 'edd_ajax_get_download_title' ); -add_action( 'wp_ajax_nopriv_edd_get_download_title', 'edd_ajax_get_download_title' ); - -/** - * Recalculate cart taxes - * - * @since 1.6 - * @return void - */ -function edd_ajax_recalculate_taxes() { - if ( ! isset( $_POST['nonce'] ) ) { - edd_debug_log( __( 'Missing nonce when recalculating taxes. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), true ); - } - - $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( $_POST['nonce'] ) : ''; - $nonce_verified = wp_verify_nonce( $nonce, 'edd-checkout-address-fields' ); - - if ( false === $nonce_verified ) { - return false; - } - - if ( ! edd_get_cart_contents() ) { - return false; - } - - if ( empty( $_POST['billing_country'] ) ) { - $_POST['billing_country'] = edd_get_shop_country(); - } - - ob_start(); - edd_checkout_cart(); - /** - * Allows the cart content to be filtered. - * @since 3.1 - */ - $cart = apply_filters( 'edd_get_checkout_cart', ob_get_clean() ); - $response = array( - 'html' => $cart, - 'tax_raw' => edd_get_cart_tax(), - 'tax' => html_entity_decode( edd_cart_tax( false ), ENT_COMPAT, 'UTF-8' ), - 'tax_rate_raw' => edd_get_tax_rate(), - 'tax_rate' => html_entity_decode( edd_get_formatted_tax_rate(), ENT_COMPAT, 'UTF-8' ), - 'total' => html_entity_decode( edd_cart_total( false ), ENT_COMPAT, 'UTF-8' ), - 'total_raw' => edd_get_cart_total(), - ); - - echo json_encode( $response ); - - edd_die(); -} -add_action( 'wp_ajax_edd_recalculate_taxes', 'edd_ajax_recalculate_taxes' ); -add_action( 'wp_ajax_nopriv_edd_recalculate_taxes', 'edd_ajax_recalculate_taxes' ); - -/** - * Retrieve a states drop down - * - * @since 1.6 - * @since 2.9.4 Added nonce verification. - * @since 3.0 Updated listbox with placeholder values. - */ -function edd_ajax_get_states_field() { - - // Check a nonce was sent. - if ( empty( $_POST['nonce'] ) ) { - edd_debug_log( __( 'Missing nonce when retrieving state list. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), true ); - } - - $nonce = ! empty( $_POST['nonce'] ) - ? sanitize_text_field( $_POST['nonce'] ) - : ''; - - $nonce_verified = wp_verify_nonce( $nonce, 'edd-country-field-nonce' ); - - // Bail if nonce verification failed. - if ( false === $nonce_verified ) { - edd_die(); - } - - // Get country. - $country = ! empty( $_POST['country'] ) - ? sanitize_text_field( $_POST['country'] ) // Exactly matched - : edd_get_shop_country(); - - // Get states for country. - $states = edd_get_shop_states( $country ); - - // Chosen - $chosen = ! isset( $_POST['chosen'] ) || ( 'true' === $_POST['chosen'] ) - ? true - : false; - - // Maybe setup the new listbox. - if ( ! empty( $states ) ) { - $field_name = isset( $_POST['field_name'] ) - ? sanitize_text_field( $_POST['field_name'] ) - : 'edd-state-select'; - - $field_id = isset( $_POST['field_id'] ) - ? sanitize_text_field( $_POST['field_id'] ) - : $field_name; - - $response = EDD()->html->region_select( - array( - 'name' => $field_name, - 'id' => $field_id, - 'class' => $field_name . ' edd-select', - 'options' => $states, - 'chosen' => $chosen, - 'show_option_all' => false, - ) - ); - } else { - $response = 'nostates'; - } - - echo $response; - - edd_die(); -} -add_action( 'wp_ajax_edd_get_shop_states', 'edd_ajax_get_states_field' ); -add_action( 'wp_ajax_nopriv_edd_get_shop_states', 'edd_ajax_get_states_field' ); - -/** - * Retrieve a downloads drop down - * - * @since 1.6 - * @since 3.0 Use `get_posts()` instead of multiple direct queries (yay caching) - * @since 3.1.0.5 Uses EDD\Downloads\Search. - * - * @return void - */ -function edd_ajax_download_search() { - - $search = new EDD\Downloads\Search(); - $search->ajax_search(); -} -add_action( 'wp_ajax_edd_download_search', 'edd_ajax_download_search' ); -add_action( 'wp_ajax_nopriv_edd_download_search', 'edd_ajax_download_search' ); - -/** - * Search the customers database via AJAX - * - * @since 2.2 - * @return void - */ -function edd_ajax_customer_search() { - global $wpdb; - - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); - $results = array(); - $customer_view_role = apply_filters( 'edd_view_customers_role', 'view_shop_reports' ); - if ( ! current_user_can( $customer_view_role ) ) { - $customers = array(); - } else { - $select = "SELECT id, name, email FROM {$wpdb->prefix}edd_customers "; - if ( is_numeric( $search ) ) { - $where = "WHERE `id` LIKE '%$search%' OR `user_id` LIKE '%$search%' "; - } else { - $where = "WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' "; - } - $limit = "LIMIT 50"; - - $customers = $wpdb->get_results( $select . $where . $limit ); - } - - if ( $customers ) { - - foreach( $customers as $customer ) { - - $results[] = array( - 'id' => $customer->id, - 'name' => $customer->name . '(' . $customer->email . ')' - ); - } - - } else { - - $customers[] = array( - 'id' => 0, - 'name' => __( 'No results found', 'easy-digital-downloads' ) - ); - - } - - echo json_encode( $results ); - - edd_die(); -} -add_action( 'wp_ajax_edd_customer_search', 'edd_ajax_customer_search' ); - -/** - * Search the download categories via AJAX - * - * @since 3.1.0.4 - * @return void - */ -function edd_ajax_download_category_search() { - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); - $results = array(); - - $category_args = array( - 'taxonomy' => array( 'download_category' ), - 'orderby' => 'id', - 'order' => 'ASC', - 'hide_empty' => true, - 'fields' => 'all', - 'name__like' => $search, - ); - - $categories_found = get_terms( $category_args ); - - if ( ! empty( $categories_found ) ) { - foreach ( $categories_found as $category ) { - $results[] = array( - 'id' => $category->slug, - 'name' => $category->name . ' (' . $category->count . ')', - ); - } - } else { - $results[] = array( - 'id' => 0, - 'name' => __( 'No categories found', 'easy-digital-downloads' ), - ); - } - - echo wp_send_json( $results ); -} -add_action( 'wp_ajax_edd_download_category_search', 'edd_ajax_download_category_search' ); - -/** - * Search the users database via AJAX - * - * @since 2.6.9 - * @return void - */ -function edd_ajax_user_search() { - - // Default results - $results = array( - 'id' => 0, - 'name' => __( 'No users found', 'easy-digital-downloads' ) - ); - - // Default user role - $user_view_role = apply_filters( 'edd_view_users_role', 'view_shop_reports' ); - - // User can view users - if ( current_user_can( $user_view_role ) ) { - $search = esc_sql( sanitize_text_field( $_GET['s'] ) ); - $users = array(); - - // Searching - if ( ! empty( $search ) ) { - $users = get_users( array( - 'search' => '*' . $search . '*', - 'number' => 50 - ) ); - } - - // Setup results based on users - if ( ! empty( $users ) ) { - $results = array(); - - foreach( $users as $user ) { - $results[] = array( - 'id' => $user->ID, - 'name' => $user->display_name, - ); - } - } - } - - echo json_encode( $results ); - - edd_die(); -} -add_action( 'wp_ajax_edd_user_search', 'edd_ajax_user_search' ); - -/** - * Check for Download Price Variations via AJAX (this function can only be used - * in WordPress Admin). This function is used for the Edit Payment screen when downloads - * are added to the purchase. When each download is chosen, an AJAX call is fired - * to this function which will check if variable prices exist for that download. - * If they do, it will output a dropdown of all the variable prices available for - * that download. - * - * @author Sunny Ratilal - * @since 1.5 - * @return void - */ -function edd_check_for_download_price_variations() { - if ( ! current_user_can( 'edit_products' ) ) { - die( '-1' ); - } - - $download_id = intval( $_POST['download_id'] ); - $download = get_post( $download_id ); - - if ( 'download' != $download->post_type ) { - die( '-2' ); - } - - if ( edd_has_variable_prices( $download_id ) ) { - $variable_prices = edd_get_variable_prices( $download_id ); - - if ( ! empty( $variable_prices ) ) { - $ajax_response = ''; - - echo $ajax_response; - } - } - - edd_die(); -} -add_action( 'wp_ajax_edd_check_for_download_price_variations', 'edd_check_for_download_price_variations' ); - -/** - * Searches for users via ajax and returns a list of results - * - * @since 2.0 - * @return void - */ -function edd_ajax_search_users() { - - // Bail if user cannot manage shop settings - if ( ! current_user_can( 'manage_shop_settings' ) ) { - die(); - } - - // To search for - $search_query = ! empty( $_POST['user_name'] ) - ? trim( $_POST['user_name'] ) - : ''; - - // To exclude - $exclude = ! empty( $_POST['exclude'] ) - ? trim( $_POST['exclude'] ) - : ''; - - // Default args - $defaults = array( - 'number' => 50, - 'search' => $search_query . '*' - ); - - // Maybe exclude users - if ( ! empty( $exclude ) ) { - $exclude_array = explode( ',', $exclude ); - $defaults['exclude'] = $exclude_array; - } - - // Filter query args - $get_users_args = apply_filters( 'edd_search_users_args', $defaults ); - - // Maybe get users - $users = ! empty( $get_users_args ) && ! empty( $search_query ) - ? get_users( $get_users_args ) - : array(); - - // Filter users - $found_users = apply_filters( 'edd_ajax_found_users', $users, $search_query ); - - // Put together the results string - $user_list = '
      '; - if ( ! empty( $found_users ) ) { - foreach( $found_users as $user ) { - $user_list .= '
    • ' . esc_html( $user->user_login ) . '
    • '; - } - } else { - $user_list .= '
    • ' . __( 'No users found', 'easy-digital-downloads' ) . '
    • '; - } - $user_list .= '
    '; - - echo json_encode( array( 'results' => $user_list ) ); - - edd_die(); -} -add_action( 'wp_ajax_edd_search_users', 'edd_ajax_search_users' ); - -/** - * Search for download, build, and return HTML. - * - * This is used in the Admin for Adding items to an order. - * - * @since 3.0 - */ -function edd_ajax_add_order_item() { - - // Bail if user cannot manage shop settings. - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_send_json_error(); - } - - // Set up parameters. - $nonce = isset( $_POST['nonce'] ) - ? sanitize_text_field( $_POST['nonce'] ) - : ''; - - $download = isset( $_POST['download'] ) - ? edd_parse_product_dropdown_value( sanitize_text_field( $_POST['download'] ) ) - : array(); - - $country = isset( $_POST['country'] ) - ? sanitize_text_field( $_POST['country'] ) - : ''; - - $region = isset( $_POST['region'] ) - ? sanitize_text_field( $_POST['region'] ) - : ''; - - $editable = 1 !== absint( $_POST['editable'] ); - - // Bail if missing any data. - if ( empty( $nonce ) || empty( $download ) ) { - wp_send_json_error(); - } - - // Bail if nonce fails. - if ( ! wp_verify_nonce( $nonce, 'edd_add_order_nonce' ) ) { - wp_send_json_error(); - } - - $response = array(); - - $d = edd_get_download( $download['download_id'] ); - - if ( $d ) { - $name = $d->get_name(); - - if ( ! $d->has_variable_prices() ) { - $amount = floatval( $d->get_price() ); - } else { - $prices = $d->get_prices(); - - if ( isset( $prices[ $download['price_id'] ] ) ) { - $price = $prices[ $download['price_id'] ]; - $amount = floatval( $price['amount'] ); - $name .= ' — ' . esc_html( $price['name'] ); - } - } - - $quantity = edd_item_quantities_enabled() && isset( $_POST['quantity'] ) - ? absint( $_POST['quantity'] ) - : 1; - - $response['name'] = $name; - $response['discount'] = 0.00; - $response['tax'] = edd_calculate_tax( $amount * $quantity, $country, $region ); - $response['quantity'] = $quantity; - $response['amount'] = $amount; - $response['total'] = floatval( ( $amount * $quantity ) + $response['tax'] ); - - static $symbol = null; - - if ( null === $symbol ) { - $symbol = edd_currency_symbol( edd_get_currency() ); - } - - ob_start(); ?> - - - - - - - /> - - - - - /> - - - - - - - /> - - - - - - /> - - - - - - - - - - - name ) ?> - - code ); ?> - type, $discount->amount ); ?> - - - - - - - amount; - $response['type'] = $discount->type; - - break; - - // We just need to generate HTML if credit is being applied. - case 'credit': - $amount = isset( $_POST['adjustment_data']['credit']['amount'] ) - ? floatval( $_POST['adjustment_data']['credit']['amount'] ) - : 0.00; - - $description = isset( $_POST['adjustment_data']['credit']['description'] ) - ? esc_html( $_POST['adjustment_data']['credit']['description'] ) - : ''; - - ob_start(); ?> - - - - - - - - - - - - get_addresses(); - - if ( $addresses ) { - $response['addresses'] = array(); - $options = array(); - - foreach ( $addresses as $address ) { - - // Convert EDD\Customer\Customer_Address object to array. - $a = $address->to_array(); - - // Pass array back as response. - $response['addresses'][ $address->id ] = $a; - - $address_keys = array_flip( array( 'address', 'address2', 'city', 'region', 'country', 'postal_code' ) ); - - $a = array_filter( array_intersect_key( $a, $address_keys ) ); - - if ( isset( $a['region'] ) && isset( $a['country'] ) ) { - $a['region'] = edd_get_state_name( $a['country'], $a['region'] ); - } - - if ( isset( $a['country'] ) ) { - $a['country'] = edd_get_country_name( $a['country'] ); - } - - $a = implode( ', ', $a ); - - $response['formatted'][ $address->id ] = $a; - $options[ $address->id ] = $a; - } - - // Fetch the select - if ( ! empty( $options ) ) { - $html = ''; - - $response['html'] = $html; - } - } - } - - return wp_send_json_success( $response ); -} -add_action( 'wp_ajax_edd_customer_addresses', 'edd_ajax_customer_addresses' ); - -/** - * Returns details about a Customer. - * - * @since 3.0 - */ -function edd_ajax_customer_details() { - // Bail if user cannot manage shop settings. - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return wp_send_json_error(); - } - - // Set up parameters. - $nonce = isset( $_POST['nonce'] ) - ? sanitize_text_field( $_POST['nonce'] ) - : ''; - - $customer_id = isset( $_POST['customer_id'] ) - ? absint( $_POST['customer_id'] ) - : 0; - - // Bail if missing any data. - if ( empty( $nonce ) || empty( $customer_id ) ) { - return wp_send_json_error(); - } - - // Bail if nonce verification failed. - if ( ! wp_verify_nonce( $nonce, 'edd_customer_details_nonce' ) ) { - return wp_send_json_error(); - } - - // Fetch customer. - $customer = edd_get_customer( $customer_id ); - - if ( ! $customer ) { - return wp_send_json_error(); - } - - $response = array( - 'id' => esc_html( $customer->id ), - 'name' => esc_html( $customer->name ), - 'email' => esc_html( $customer->email ), - 'avatar' => get_avatar( $customer->email, 50 ), - 'date_created' => esc_html( $customer->date_created ), - 'date_created_i18n' => esc_html( edd_date_i18n( $customer->date_created ) ), - '_links' => array( - 'self' => esc_url_raw( admin_url( 'edit.php?post_type=download&page=edd-customers&view=overview&id=' . absint( $customer->id ) ) ), - ), - ); - - return wp_send_json_success( $response ); -} -add_action( 'wp_ajax_edd_customer_details', 'edd_ajax_customer_details' ); - -/** - * Recalculates taxes when adding a new order and the country/region field is changed. - * - * @since 3.0 - */ -function edd_ajax_get_tax_rate() { - - // Bail if user cannot manage shop settings. - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return wp_send_json_error(); - } - - // Set up parameters. - $nonce = isset( $_POST['nonce'] ) - ? sanitize_text_field( $_POST['nonce'] ) - : ''; - - $country = isset( $_POST['country'] ) - ? sanitize_text_field( $_POST['country'] ) - : ''; - - $region = isset( $_POST['region'] ) - ? sanitize_text_field( $_POST['region'] ) - : ''; - - // Bail if missing any data. - if ( empty( $nonce ) ) { - return wp_send_json_error(); - } - - // Bail if nonce verification failed. - if ( ! wp_verify_nonce( $nonce, 'edd_get_tax_rate_nonce' ) ) { - return wp_send_json_error(); - } - - $response = array(); - - $rate = edd_get_tax_rate( $country, $region, $fallback = false ); - - $response['tax_rate'] = $rate; - $response['prices_include_tax'] = (bool) edd_prices_include_tax(); - - return wp_send_json_success( $response ); -} -add_action( 'wp_ajax_edd_get_tax_rate', 'edd_ajax_get_tax_rate' ); - -/** - * Retrieves a potential Order Item's amounts. - * - * @since 3.0 - */ -function edd_admin_order_get_item_amounts() { - // Set up parameters. - $nonce = isset( $_POST['nonce'] ) - ? sanitize_text_field( $_POST['nonce'] ) - : ''; - - // Bail if missing any data. - if ( empty( $nonce ) ) { - return wp_send_json_error( array( - 'message' => esc_html__( 'Unable to verify action. Please refresh the page and try again.', 'easy-digital-downloads' ), - ) ); - } - - // Bail if nonce verification failed. - if ( ! wp_verify_nonce( $nonce, 'edd_admin_order_get_item_amounts' ) ) { - return wp_send_json_error( array( - 'message' => esc_html__( 'Unable to verify action. Please refresh the page and try again.', 'easy-digital-downloads' ), - ) ); - } - - $is_adjusting_manually = isset( $_POST['_isAdjustingManually'] ) && false !== $_POST['_isAdjustingManually']; - - $product_id = isset( $_POST['productId'] ) - ? intval( sanitize_text_field( $_POST['productId'] ) ) - : 0; - - $price_id = isset( $_POST['priceId'] ) - ? intval( sanitize_text_field( $_POST['priceId'] ) ) - : 0; - - $quantity = isset( $_POST['quantity'] ) - ? intval( sanitize_text_field( $_POST['quantity'] ) ) - : 0; - - $country = isset( $_POST['country'] ) - ? sanitize_text_field( $_POST['country'] ) - : ''; - - $region = isset( $_POST['region'] ) - ? sanitize_text_field( $_POST['region'] ) - : ''; - - $products = isset( $_POST['products'] ) - ? $_POST['products'] - : array(); - - $discounts = isset( $_POST['discounts'] ) - ? array_unique( array_map( 'intval', $_POST['discounts'] ) ) - : array(); - - $download = edd_get_download( $product_id ); - - // Bail if no Download is found. - if ( ! $download ) { - return wp_send_json_error( array( - 'message' => esc_html__( 'Unable to find download. Please refresh the page and try again.', 'easy-digital-downloads' ), - ) ); - } - - // Use base Amount if sent. - if ( isset( $_POST['amount'] ) && '0' !== $_POST['amount'] ) { - $amount = edd_sanitize_amount( sanitize_text_field( $_POST['amount'] ) ); - - // Determine amount from Download record. - } else { - if ( ! $download->has_variable_prices() ) { - $amount = floatval( $download->get_price() ); - } else { - $prices = $download->get_prices(); - - if ( isset( $prices[ $price_id ] ) ) { - $price = $prices[ $price_id ]; - $amount = floatval( $price['amount'] ); - } - } - } - - // Use base Subtotal if sent. - if ( isset( $_POST['subtotal'] ) && '0' !== $_POST['subtotal'] ) { - $subtotal = edd_sanitize_amount( sanitize_text_field( $_POST['subtotal'] ) ); - } else { - $subtotal = $amount * $quantity; - } - - $discount = 0; - - // Track how much of each Discount is applied to an `OrderItem`. - // There is not currently API support for `OrderItem`-level `OrderAdjustment`s. - $adjustments = array(); - - global $edd_flat_discount_total; - - foreach ( $discounts as $discount_id ) { - $edd_flat_discount_total = 0; - - $d = edd_get_discount( $discount_id ); - - if ( ! $d ) { - continue; - } - - // Retrieve total flat rate amount. - if ( 'flat' === $d->get_type() ) { - foreach ( $products as $product ) { - // This incremements the `$edd_flat_discount_total` global. - edd_get_item_discount_amount( $product, $products, array( $d ) ); - } - } - - // Store total discount and reset global. - $total_discount = $edd_flat_discount_total; - - $item = array( - 'id' => $download->id, - 'quantity' => $quantity, - 'options' => array( - 'price_id' => $price_id, - ), - ); - - $discount_amount = edd_get_item_discount_amount( $item, $products, array( $d ) ); - - if ( - 0 !== $discount_amount && - 'flat' === $d->get_type() && - $item['id'] == end( $products )['id'] - ) { - if ( $total_discount < $d->get_amount() ) { - $adjustment = ( $d->get_amount() - $total_discount ); - $discount_amount += $adjustment; - } else if ( $total_discount > $d->get_amount() ) { - $adjustment = ( $total_discount - $d->get_amount() ); - $discount_amount -= $adjustment; - } - } - - $adjustments[] = array( - 'objectType' => 'order_item', - 'type' => 'discount', - 'typeId' => $d->id, - 'description' => $d->code, - 'subtotal' => $discount_amount, - 'total' => $discount_amount, - ); - - $discount += $discount_amount; - } - - if ( - true === edd_use_taxes() && - false === edd_download_is_tax_exclusive( $product_id ) - ) { - $tax = edd_calculate_tax( floatval( $subtotal - $discount ), $country, $region, false ); - } else { - $tax = 0; - } - - wp_send_json_success( array( - 'amount' => $amount, - 'subtotal' => $subtotal, - 'discount' => $discount, - 'tax' => $tax, - 'total' => $subtotal + $tax, - 'adjustments' => $adjustments, - ) ); -} -add_action( 'wp_ajax_edd-admin-order-get-item-amounts', 'edd_admin_order_get_item_amounts' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/api/class-edd-api-v1.php b/wp-content/plugins/easy-digital-downloads/includes/api/class-edd-api-v1.php deleted file mode 100644 index 073e72b5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/api/class-edd-api-v1.php +++ /dev/null @@ -1,24 +0,0 @@ - 'download', - 'posts_per_page' => $this->per_page(), - 'suppress_filters' => true, - 'paged' => $this->get_paged(), - 'order' => $args['order'], - 'orderby' => $args['orderby'], - ); - - if( ! empty( $args['s'] ) ) { - $query_args['s'] = sanitize_text_field( $args['s'] ); - } - - switch ( $query_args['orderby'] ) { - case 'price': - $query_args['meta_key'] = 'edd_price'; - $query_args['orderby'] = 'meta_value_num'; - break; - - case 'sales': - if ( user_can( $this->user_id, 'view_shop_sensitive_data' ) || current_user_can( 'view_shop_sensitive_data' ) || $this->override ) { - $query_args['meta_key'] = '_edd_download_sales'; - $query_args['orderby'] = 'meta_value_num'; - } - break; - - case 'earnings': - if ( user_can( $this->user_id, 'view_shop_sensitive_data' ) || current_user_can( 'view_shop_sensitive_data' ) || $this->override ) { - $query_args['meta_key'] = '_edd_download_earnings'; - $query_args['orderby'] = 'meta_value_num'; - } - break; - - } - - if( ! empty( $args['category'] ) ) { - if ( is_string( $args[ 'categrory' ] ) ) { - $args['category'] = explode( ',', $args['category'] ); - } - - if ( is_numeric( $args['category'] ) ) { - $query_args['tax_query'] = array( - array( - 'taxonomy' => 'download_category', - 'field' => 'ID', - 'terms' => (int) $args['category'] - ), - ); - } else if ( is_array( $args['category'] ) ) { - - foreach ( $args['category'] as $category ) { - - - $field = is_numeric( $category ) ? 'ID': 'slug'; - - $query_args['tax_query'][] = array( - 'taxonomy' => 'download_category', - 'field' => $field, - 'terms' => $category, - ); - - } - - } else { - $query_args['download_category'] = $args['category']; - } - } - - if( ! empty( $args['tag'] ) ) { - if ( strpos( $args['tag'], ',' ) ) { - $args['tag'] = explode( ',', $args['tag'] ); - } - - if ( is_numeric( $args['tag'] ) ) { - $query_args['tax_query'] = array( - array( - 'taxonomy' => 'download_tag', - 'field' => 'ID', - 'terms' => (int) $args['tag'] - ), - ); - } else if ( is_array( $args['tag'] ) ) { - - foreach ( $args['tag'] as $tag ) { - - - $field = is_numeric( $tag ) ? 'ID': 'slug'; - - $query_args['tax_query'][] = array( - 'taxonomy' => 'download_tag', - 'field' => $field, - 'terms' => $tag, - ); - - } - - } else { - $query_args['download_tag'] = $args['tag']; - } - } - - if ( ! empty( $query_args['tax_query'] ) ) { - - $relation = ! empty( $args['term_relation'] ) ? sanitize_text_field( $args['term_relation'] ) : 'OR'; - $query_args['tax_query']['relation'] = $relation; - - } - - $product_list = get_posts( $query_args ); - - if ( $product_list ) { - $i = 0; - foreach ( $product_list as $product_info ) { - $products['products'][$i] = $this->get_product_data( $product_info ); - $i++; - } - } - - } else { - - if ( get_post_type( $args['product'] ) == 'download' ) { - $product_info = get_post( $args['product'] ); - - $products['products'][0] = $this->get_product_data( $product_info ); - - } else { - $error['error'] = sprintf( __( 'Product %s not found!', 'easy-digital-downloads' ), $args['product'] ); - return $error; - } - } - - return apply_filters( 'edd_api_products', $products ); - } - - /** - * Given a download post object, generate the data for the API output - * - * @since 2.6 - * @param object $product_info The Download Post Object - * @return array Array of post data to return back in the API - */ - public function get_product_data( $product_info ) { - - // Use the parent's get_product_data to reduce code duplication - $product = parent::get_product_data( $product_info ); - - if ( edd_use_skus() ) { - $product['info']['sku'] = edd_get_download_sku( $product['info']['id'] ); - } - - return apply_filters( 'edd_api_products_product_v2', $product ); - - } - - /** - * Process Get Customers API Request. - * - * @since 2.6 - * - * @param array $args Array of arguments for filters customers. - * - * @return array $customers Multidimensional array of the customers. - */ - public function get_customers( $args = array() ) { - - $paged = $this->get_paged(); - $per_page = $this->per_page(); - $offset = $per_page * ( $paged - 1 ); - - $defaults = array( - 'customer' => null, - 'date' => null, - 'startdate' => null, - 'enddate' => null, - 'number' => $per_page, - 'offset' => $offset, - ); - - $args = wp_parse_args( $args, $defaults ); - $customers = array(); - $error = array(); - $stats = new EDD\Stats( - array( - 'output' => 'formatted', - ) - ); - - if ( ! user_can( $this->user_id, 'view_shop_sensitive_data' ) && ! $this->override ) { - return $customers; - } - - $query_by_customer = false; - if ( is_numeric( $args['customer'] ) ) { - $field = 'id'; - } elseif ( is_email( $args['customer'] ) ) { - $field = 'email'; - } - - if ( isset( $field ) ) { - $args[ $field ] = $args['customer']; - - if ( ! empty( $args[ $field ] ) ) { - $query_by_customer = true; - unset( $args['customer'] ); - } - } - - if ( ! empty( $args['date'] ) ) { - if ( 'range' === $args['date'] ) { - if ( ! empty( $args['startdate'] ) ) { - $_GET['filter_from'] = $args['startdate']; - } - - if ( ! empty( $args['enddate'] ) ) { - $_GET['filter_to'] = $args['enddate']; - } - - $_GET['range'] = 'other'; - } elseif ( ! empty( $args['date'] ) ) { - $_GET['range'] = $args['date']; - } - - $dates = EDD\Reports\parse_dates_for_range(); - - $date_query = array( - 'column' => 'date_created', - ); - - if ( ! empty( $dates['start'] ) && ! empty( $dates['end'] ) ) { - $date_query['compare'] = 'BETWEEN'; - $date_query['after'] = $dates['start']->format( 'Y-m-d' ); - $date_query['before'] = $dates['end']->format( 'Y-m-d' ); - } elseif ( ! empty( $dates['start'] ) ) { - $date_query['after'] = $dates['start']->format( 'Y-m-d' ); - } elseif ( ! empty( $dates['end'] ) ) { - $date_query['before'] = $dates['end']->format( 'Y-m-d' ); - } - - $date_query = array_filter( $date_query ); - if ( ! empty( $date_query ) ) { - $args['date_query'] = $date_query; - } - } - - unset( $args['startdate'], $args['enddate'] ); - - // Remove any empty values. - $args = array_filter( $args ); - - $customer_query = edd_get_customers( $args ); - $customer_count = 0; - - if ( $customer_query ) { - - foreach ( $customer_query as $customer_obj ) { - // Setup a new EDD_Customer object so additional details are defined (like additional emails) - $customer_obj = new EDD_Customer( $customer_obj->id ); - - $names = explode( ' ', $customer_obj->name ); - $first_name = ! empty( $names[0] ) ? $names[0] : ''; - $last_name = ''; - if ( ! empty( $names[1] ) ) { - unset( $names[0] ); - $last_name = implode( ' ', $names ); - } - - $customers['customers'][ $customer_count ]['info']['customer_id'] = $customer_obj->id; - $customers['customers'][ $customer_count ]['info']['user_id'] = 0; - $customers['customers'][ $customer_count ]['info']['username'] = ''; - $customers['customers'][ $customer_count ]['info']['display_name'] = ''; - $customers['customers'][ $customer_count ]['info']['first_name'] = $first_name; - $customers['customers'][ $customer_count ]['info']['last_name'] = $last_name; - $customers['customers'][ $customer_count ]['info']['email'] = $customer_obj->email; - $customers['customers'][ $customer_count ]['info']['additional_emails'] = null; - $customers['customers'][ $customer_count ]['info']['date_created'] = $customer_obj->date_created; - - if ( ! empty( $customer_obj->emails ) && count( $customer_obj->emails ) > 1 ) { - $additional_emails = $customer_obj->emails; - - $primary_email_key = array_search( $customer_obj->email, $customer_obj->emails, true ); - if ( false !== $primary_email_key ) { - unset( $additional_emails[ $primary_email_key ] ); - } - - $customers['customers'][ $customer_count ]['info']['additional_emails'] = $additional_emails; - } - - if ( ! empty( $customer_obj->user_id ) && $customer_obj->user_id > 0 ) { - - $user_data = get_userdata( $customer_obj->user_id ); - - // Customer with registered account - - // id is going to get deprecated in the future, user user_id or customer_id instead - $customers['customers'][ $customer_count ]['info']['user_id'] = $customer_obj->user_id; - $customers['customers'][ $customer_count ]['info']['username'] = $user_data->user_login; - $customers['customers'][ $customer_count ]['info']['display_name'] = $user_data->display_name; - - } - - $customers['customers'][ $customer_count ]['stats']['total_purchases'] = $customer_obj->purchase_count; - $customers['customers'][ $customer_count ]['stats']['total_spent'] = edd_format_amount( $customer_obj->purchase_value, true, '', 'typed' ); - $customers['customers'][ $customer_count ]['stats']['total_downloads'] = edd_count_file_downloads_of_customer( $customer_obj->id ); - - $customer_count++; - - } - } elseif ( true === $query_by_customer ) { - - $error['error'] = __( 'Customer not found!', 'easy-digital-downloads' ); - return $error; - - } else { - - $error['error'] = __( 'No customers found!', 'easy-digital-downloads' ); - return $error; - - } - - return apply_filters( 'edd_api_customers', $customers, $this ); - } - - /** - * Retrieves Recent Sales - * - * @since 2.6 - * @return array - */ - public function get_recent_sales() { - global $wp_query; - - $sales = array(); - - if ( ! user_can( $this->user_id, 'view_shop_reports' ) && ! $this->override ) { - return $sales; - } - - if ( isset( $wp_query->query_vars['id'] ) ) { - $query = array(); - $query[] = edd_get_order( $wp_query->query_vars['id'] ); - } elseif ( isset( $wp_query->query_vars['purchasekey'] ) ) { - $query = array(); - $query[] = edd_get_order_by( 'payment_key', $wp_query->query_vars['purchasekey'] ); - } elseif ( isset( $wp_query->query_vars['email'] ) ) { - $query = edd_get_orders( - array( - 'type' => 'sale', - 'email' => $wp_query->query_vars['email'], - 'number' => $this->per_page(), - 'offset' => ( $this->get_paged() - 1 ) * $this->per_page(), - 'status__in' => edd_get_net_order_statuses(), - ) - ); - } else { - $query = edd_get_orders( - array( - 'type' => 'sale', - 'number' => $this->per_page(), - 'offset' => ( $this->get_paged() - 1 ) * $this->per_page(), - 'status__in' => edd_get_net_order_statuses(), - ) - ); - } - - if ( $query ) { - $i = 0; - foreach ( $query as $order ) { - /** @var EDD\Orders\Order $order An Order object. */ - - $localized_time = edd_get_edd_timezone_equivalent_date_from_utc( EDD()->utils->date( $order->date_created ) ); - - $sales['sales'][ $i ]['ID'] = $order->get_number(); - $sales['sales'][ $i ]['mode'] = $order->mode; - $sales['sales'][ $i ]['status'] = $order->status; - $sales['sales'][ $i ]['transaction_id'] = $order->get_transaction_id(); - $sales['sales'][ $i ]['key'] = $order->payment_key; - $sales['sales'][ $i ]['subtotal'] = $order->subtotal; - $sales['sales'][ $i ]['tax'] = $order->tax; - $sales['sales'][ $i ]['total'] = $order->total; - $sales['sales'][ $i ]['gateway'] = $order->gateway; - $sales['sales'][ $i ]['customer_id'] = $order->customer_id; - $sales['sales'][ $i ]['user_id'] = $order->user_id; - $sales['sales'][ $i ]['email'] = $order->email; - $sales['sales'][ $i ]['date'] = $localized_time->copy()->format( 'Y-m-d H:i:s' ); - $sales['sales'][ $i ]['date_utc'] = $order->date_created; - - $fees = array(); - $discounts = array(); - - foreach ( $order->adjustments as $adjustment ) { - switch ( $adjustment->type ) { - case 'fee': - $fees[] = array( - 'amount' => $adjustment->total, - 'label' => $adjustment->description, - 'no_tax' => empty( $adjustment->tax ), - 'type' => $adjustment->type, - 'price_id' => null, - 'download_id' => null, - 'id' => $adjustment->type_key, - ); - break; - - case 'discount': - $discounts[ $adjustment->description ] = $adjustment->total; - break; - } - } - - $c = 0; - $cart_items = array(); - - foreach ( $order->items as $item ) { - $cart_items[ $c ]['object_id'] = $item->id; - $cart_items[ $c ]['id'] = $item->product_id; - $cart_items[ $c ]['quantity'] = $item->quantity; - $cart_items[ $c ]['name'] = $item->product_name; - $cart_items[ $c ]['price'] = $item->total; - - // Keeping this here for backwards compatibility. - $cart_items[ $c ]['price_name'] = null === $item->price_id - ? '' - : edd_get_price_name( $item->product_id, array( 'price_id' => $item->price_id ) ); - - // Check for any item level fees to include in the fees array. - foreach ( $item->adjustments as $adjustment ) { - if ( 'fee' === $adjustment->type ) { - $fees[] = array( - 'amount' => $adjustment->total, - 'label' => $adjustment->description, - 'no_tax' => empty( $adjustment->tax ), - 'type' => $adjustment->type, - 'price_id' => $item->price_id, - 'download_id' => $item->product_id, - 'id' => $adjustment->type_key, - ); - } - } - - $c++; - } - - $sales['sales'][ $i ]['products'] = $cart_items; - $sales['sales'][ $i ]['fees'] = ! empty( $fees ) ? $fees : null; - $sales['sales'][ $i ]['discounts'] = ! empty( $discounts ) ? $discounts : null; - - $i++; - } - } - return apply_filters( 'edd_api_sales', $sales, $this ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/api/class-edd-api.php b/wp-content/plugins/easy-digital-downloads/includes/api/class-edd-api.php deleted file mode 100644 index a4334442..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/api/class-edd-api.php +++ /dev/null @@ -1,2426 +0,0 @@ -versions = array( - 'v1' => 'EDD_API_V1', - 'v2' => 'EDD_API_V2', - ); - - foreach ( $this->get_versions() as $version => $class ) { - require_once EDD_PLUGIN_DIR . 'includes/api/class-edd-api-' . $version . '.php'; - } - - add_action( 'init', array( $this, 'add_endpoint' ) ); - add_action( 'wp', array( $this, 'process_query' ), - 1 ); - add_filter( 'query_vars', array( $this, 'query_vars' ) ); - add_action( 'edd_process_api_key', array( $this, 'process_api_key' ) ); - - // Setup a backwards compatibility check for user API Keys - add_filter( 'get_user_metadata', array( $this, 'api_key_backwards_copmat' ), 10, 4 ); - - // Determine if JSON_PRETTY_PRINT is available - $this->pretty_print = defined( 'JSON_PRETTY_PRINT' ) ? JSON_PRETTY_PRINT : null; - - // Setup EDD_Stats instance - $this->stats = new EDD_Payment_Stats; - } - - /** - * Registers a new rewrite endpoint for accessing the API - * - * @author Daniel J Griffiths - * - * @param array $rewrite_rules WordPress Rewrite Rules - * - * @since 1.5 - */ - public function add_endpoint( $rewrite_rules ) { - add_rewrite_endpoint( 'edd-api', EP_ALL ); - } - - /** - * Registers query vars for API access - * - * @since 1.5 - * @author Daniel J Griffiths - * - * @param array $vars Query vars - * - * @return string[] $vars New query vars - */ - public function query_vars( $vars ) { - - $vars[] = 'token'; - $vars[] = 'key'; - $vars[] = 'query'; - $vars[] = 'type'; - $vars[] = 'product'; - $vars[] = 'category'; - $vars[] = 'tag'; - $vars[] = 'term_relation'; - $vars[] = 'number'; - $vars[] = 'date'; - $vars[] = 'startdate'; - $vars[] = 'enddate'; - $vars[] = 'customer'; - $vars[] = 'discount'; - $vars[] = 'format'; - $vars[] = 'id'; - $vars[] = 'purchasekey'; - $vars[] = 'email'; - $vars[] = 'info'; - $vars[] = 'include_tax'; - - return $vars; - } - - /** - * Retrieve the API versions - * - * @since 2.4 - * @return array - */ - public function get_versions() { - return $this->versions; - } - - /** - * Retrieve the API version that was queried - * - * @since 2.4 - * @return string - */ - public function get_queried_version() { - return $this->queried_version; - } - - /** - * Retrieves the default version of the API to use - * - * @access private - * @since 2.4 - * @return string - */ - public function get_default_version() { - - $version = get_option( 'edd_default_api_version' ); - - if ( defined( 'EDD_API_VERSION' ) ) { - $version = EDD_API_VERSION; - } elseif ( ! $version ) { - $version = 'v1'; - } - - return $version; - } - - /** - * Sets the version of the API that was queried. - * - * Falls back to the default version if no version is specified - * - * @access private - * @since 2.4 - */ - private function set_queried_version() { - - global $wp_query; - - $version = $wp_query->query_vars['edd-api']; - - if ( strpos( $version, '/' ) ) { - - $version = explode( '/', $version ); - $version = strtolower( $version[0] ); - - $wp_query->query_vars['edd-api'] = str_replace( $version . '/', '', $wp_query->query_vars['edd-api'] ); - - if ( array_key_exists( $version, $this->versions ) ) { - - $this->queried_version = $version; - - } else { - - $this->is_valid_request = false; - $this->invalid_version(); - } - - } else { - - $this->queried_version = $this->get_default_version(); - - } - - } - - /** - * Validate the API request - * - * Checks for the user's public key and token against the secret key - * - * @access private - * @global object $wp_query WordPress Query - * @uses EDD_API::get_user() - * @uses EDD_API::invalid_key() - * @uses EDD_API::invalid_auth() - * @since 1.5 - * @return bool - */ - private function validate_request() { - global $wp_query; - - $this->override = false; - - // Make sure we have both user and api key - if ( ! empty( $wp_query->query_vars['edd-api'] ) && ( ! $this->is_public_query() || ! empty( $wp_query->query_vars['token'] ) ) ) { - - if ( empty( $wp_query->query_vars['token'] ) || empty( $wp_query->query_vars['key'] ) ) { - $this->missing_auth(); - - return false; - } - - // Auth was provided, include the upgrade routine so we can use the fallback api checks - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; - - // Retrieve the user by public API key and ensure they exist - if ( ! ( $user = $this->get_user( $wp_query->query_vars['key'] ) ) ) { - - $this->invalid_key(); - - return false; - - } else { - - $token = urldecode( $wp_query->query_vars['token'] ); - $secret = $this->get_user_secret_key( $user ); - $public = urldecode( $wp_query->query_vars['key'] ); - - // Verify that if user has secret key or not. - if ( ! $secret ) { - $this->invalid_auth(); - } - - $valid = $this->check_keys( $secret, $public, $token ); - if ( $valid ) { - $this->is_valid_request = true; - } else { - $this->invalid_auth(); - - return false; - } - - } - } elseif ( ! empty( $wp_query->query_vars['edd-api'] ) && $this->is_public_query() ) { - $this->is_valid_request = true; - $wp_query->set( 'key', 'public' ); - } - - } - - /** - * Return whether this is a public query. - * - * @access private - * @global object $wp_query WordPress Query - * @since 2.6 - * @return boolean - */ - private function is_public_query() { - global $wp_query; - - $public_modes = apply_filters( 'edd_api_public_query_modes', array( - 'products', - ) ); - - return in_array( $wp_query->query_vars['edd-api'], $public_modes ); - } - - /** - * Retrieve the user ID based on the public key provided - * - * @since 1.5.1 - * @global object $wpdb Used to query the database using the WordPress - * Database API - * - * @param string $key Public Key - * - * @return bool if user ID is found, false otherwise - */ - public function get_user( $key = '' ) { - global $wpdb, $wp_query; - - if ( empty( $key ) ) { - $key = urldecode( $wp_query->query_vars['key'] ); - } - - if ( empty( $key ) ) { - return false; - } - - $user = get_transient( md5( 'edd_api_user_' . $key ) ); - - if ( false === $user ) { - $user = $wpdb->get_var( $wpdb->prepare( "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s LIMIT 1", $key ) ); - set_transient( md5( 'edd_api_user_' . $key ), $user, DAY_IN_SECONDS ); - } - - if ( $user != null ) { - $this->user_id = $user; - - return $user; - } - - return false; - } - - public function get_user_public_key( $user_id = 0 ) { - global $wpdb; - - if ( empty( $user_id ) ) { - return ''; - } - - $cache_key = md5( 'edd_api_user_public_key' . $user_id ); - $user_public_key = get_transient( $cache_key ); - - if ( empty( $user_public_key ) ) { - $user_public_key = $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->usermeta WHERE meta_value = 'edd_user_public_key' AND user_id = %d", $user_id ) ); - set_transient( $cache_key, $user_public_key, HOUR_IN_SECONDS ); - } - - return $user_public_key; - } - - public function get_user_secret_key( $user_id = 0 ) { - global $wpdb; - - if ( empty( $user_id ) ) { - return ''; - } - - $cache_key = md5( 'edd_api_user_secret_key' . $user_id ); - $user_secret_key = get_transient( $cache_key ); - - if ( empty( $user_secret_key ) ) { - $user_secret_key = $wpdb->get_var( $wpdb->prepare( "SELECT meta_key FROM $wpdb->usermeta WHERE meta_value = 'edd_user_secret_key' AND user_id = %d", $user_id ) ); - set_transient( $cache_key, $user_secret_key, HOUR_IN_SECONDS ); - } - - return $user_secret_key; - } - - /** - * Displays a missing authentication error if all the parameters aren't - * provided - * - * @access private - * @author Daniel J Griffiths - * @uses EDD_API::output() - * @since 1.5 - */ - private function missing_auth() { - $error = array(); - $error['error'] = __( 'You must specify both a token and API key!', 'easy-digital-downloads' ); - - $this->data = $error; - $this->output( 401 ); - } - - /** - * Displays an authentication failed error if the user failed to provide valid - * credentials - * - * @access private - * @since 1.5 - * @uses EDD_API::output() - * @return void - */ - private function invalid_auth() { - $error = array(); - $error['error'] = __( 'Your request could not be authenticated!', 'easy-digital-downloads' ); - - $this->data = $error; - $this->output( 403 ); - } - - /** - * Displays an invalid API key error if the API key provided couldn't be - * validated - * - * @access private - * @author Daniel J Griffiths - * @since 1.5 - * @uses EDD_API::output() - * @return void - */ - private function invalid_key() { - $error = array(); - $error['error'] = __( 'Invalid API key!', 'easy-digital-downloads' ); - - $this->data = $error; - $this->output( 403 ); - } - - /** - * Displays an invalid version error if the version number passed isn't valid - * - * @access private - * @since 2.4 - * @uses EDD_API::output() - * @return void - */ - private function invalid_version() { - $error = array(); - $error['error'] = __( 'Invalid API version!', 'easy-digital-downloads' ); - - $this->data = $error; - $this->output( 404 ); - } - - /** - * Listens for the API and then processes the API requests - * - * @global $wp_query - * @since 1.5 - * @return void - */ - public function process_query() { - - global $wp_query; - - // Start logging how long the request takes for logging - $before = microtime( true ); - - // Check for edd-api var. Get out if not present - if ( empty( $wp_query->query_vars['edd-api'] ) ) { - return; - } - - // Determine which version was queried - $this->set_queried_version(); - - // Determine the kind of query - $this->set_query_mode(); - - // Check for a valid user and set errors if necessary - $this->validate_request(); - - // Only proceed if no errors have been noted - if ( ! $this->is_valid_request ) { - return; - } - - if ( ! defined( 'EDD_DOING_API' ) ) { - define( 'EDD_DOING_API', true ); - } - - $data = array(); - $version = $this->get_queried_version(); - $this->routes = new $this->versions[ $version ]; - $this->routes->validate_request(); - - switch ( $this->endpoint ) : - - case 'stats' : - $data = $this->routes->get_stats( array( - 'type' => isset( $wp_query->query_vars['type'] ) ? $wp_query->query_vars['type'] : null, - 'product' => isset( $wp_query->query_vars['product'] ) ? $wp_query->query_vars['product'] : null, - 'date' => isset( $wp_query->query_vars['date'] ) ? $wp_query->query_vars['date'] : null, - 'startdate' => isset( $wp_query->query_vars['startdate'] ) ? $wp_query->query_vars['startdate'] : null, - 'enddate' => isset( $wp_query->query_vars['enddate'] ) ? $wp_query->query_vars['enddate'] : null, - 'include_tax' => isset( $wp_query->query_vars['include_tax'] ) ? filter_var( $wp_query->query_vars['include_tax'], FILTER_VALIDATE_BOOLEAN ) : true, - ) ); - - break; - - case 'products' : - - $args = array( - 'product' => isset( $wp_query->query_vars['product'] ) ? absint( $wp_query->query_vars['product'] ) : null, - 'category' => isset( $wp_query->query_vars['category'] ) ? $this->sanitize_request_term( $wp_query->query_vars['category'] ) : null, - 'tag' => isset( $wp_query->query_vars['tag'] ) ? $this->sanitize_request_term( $wp_query->query_vars['tag'] ) : null, - 'term_relation' => isset( $wp_query->query_vars['term_relation'] ) ? $this->sanitize_request_term( $wp_query->query_vars['term_relation'] ) : null, - 's' => isset( $wp_query->query_vars['s'] ) ? sanitize_text_field( $wp_query->query_vars['s'] ) : null, - 'order' => isset( $wp_query->query_vars['order'] ) ? $wp_query->query_vars['order'] : 'DESC', - 'orderby' => isset( $wp_query->query_vars['orderby'] ) ? $wp_query->query_vars['orderby'] : 'date', - ); - - $data = $this->routes->get_products( $args ); - - break; - - case 'customers' : - - $args = array( - 'customer' => isset( $wp_query->query_vars['customer'] ) ? $wp_query->query_vars['customer'] : null, - 'date' => isset( $wp_query->query_vars['date'] ) ? $wp_query->query_vars['date'] : null, - 'startdate' => isset( $wp_query->query_vars['startdate'] ) ? $wp_query->query_vars['startdate'] : null, - 'enddate' => isset( $wp_query->query_vars['enddate'] ) ? $wp_query->query_vars['enddate'] : null, - ); - - $data = $this->routes->get_customers( $args ); - - break; - - case 'sales' : - - $data = $this->routes->get_recent_sales(); - - break; - - case 'discounts' : - - $discount = isset( $wp_query->query_vars['discount'] ) ? $wp_query->query_vars['discount'] : null; - - $data = $this->routes->get_discounts( $discount ); - - break; - - case 'file-download-logs' : - - $customer = isset( $wp_query->query_vars['customer'] ) ? $wp_query->query_vars['customer'] : null; - - $data = $this->get_download_logs( $customer ); - - break; - - case 'info' : - - $data = $this->routes->get_info(); - - break; - - endswitch; - - // Allow extensions to setup their own return data - $this->data = apply_filters( 'edd_api_output_data', $data, $this->endpoint, $this ); - - $after = microtime( true ); - $request_time = ( $after - $before ); - $this->data['request_speed'] = $request_time; - - // Log this API request, if enabled. We log it here because we have access to errors. - $this->log_request( $this->data ); - - // Send out data to the output function - $this->output(); - } - - /** - * Returns the API endpoint requested - * - * @access private - * @since 1.5 - * @return string $query Query mode - */ - public function get_query_mode() { - - return $this->endpoint; - } - - /** - * Determines the kind of query requested and also ensure it is a valid query - * - * @access private - * @since 2.4 - * @global $wp_query - */ - public function set_query_mode() { - - global $wp_query; - - // Whitelist our query options - $accepted = apply_filters( 'edd_api_valid_query_modes', array( - 'stats', - 'products', - 'customers', - 'sales', - 'discounts', - 'file-download-logs', - 'info', - ) ); - - $query = isset( $wp_query->query_vars['edd-api'] ) ? $wp_query->query_vars['edd-api'] : null; - $query = str_replace( $this->queried_version . '/', '', $query ); - - $error = array(); - - // Make sure our query is valid - if ( ! in_array( $query, $accepted ) ) { - $error['error'] = __( 'Invalid query!', 'easy-digital-downloads' ); - - $this->data = $error; - // 400 is Bad Request - $this->output( 400 ); - } - - $this->endpoint = $query; - } - - /** - * Get page number - * - * @access private - * @since 1.5 - * @global $wp_query - * @return int $wp_query->query_vars['page'] if page number returned (default: 1) - */ - public function get_paged() { - global $wp_query; - - return isset( $wp_query->query_vars['page'] ) ? $wp_query->query_vars['page'] : 1; - } - - - /** - * Number of results to display per page - * - * @access private - * @since 1.5 - * @global $wp_query - * @return int $per_page Results to display per page (default: 10) - */ - public function per_page() { - global $wp_query; - - $per_page = isset( $wp_query->query_vars['number'] ) ? $wp_query->query_vars['number'] : 10; - - if ( $per_page < 0 && $this->get_query_mode() == 'customers' ) { - $per_page = 99999999; // Customers query doesn't support -1 - } - - return apply_filters( 'edd_api_results_per_page', $per_page ); - } - - /** - * Sets up the dates used to retrieve earnings/sales - * - * @since 1.5.1 - * - * @param array $args Arguments to override defaults - * - * @return array $dates - */ - public function get_dates( $args = array() ) { - $dates = array(); - - $defaults = array( - 'type' => '', - 'product' => null, - 'date' => null, - 'startdate' => null, - 'enddate' => null, - ); - - $args = wp_parse_args( $args, $defaults ); - - $current_time = current_time( 'timestamp' ); - - if ( 'range' === $args['date'] ) { - $startdate = strtotime( $args['startdate'] ); - $enddate = strtotime( $args['enddate'] ); - $dates['day_start'] = date( 'd', $startdate ); - $dates['day_end'] = date( 'd', $enddate ); - $dates['m_start'] = date( 'n', $startdate ); - $dates['m_end'] = date( 'n', $enddate ); - $dates['year'] = date( 'Y', $startdate ); - $dates['year_end'] = date( 'Y', $enddate ); - } else { - // Modify dates based on predefined ranges - switch ( $args['date'] ) : - - case 'this_month' : - $dates['day'] = 1; - $dates['day_end'] = date( 't', $current_time ); - $dates['m_start'] = date( 'n', $current_time ); - $dates['m_end'] = date( 'n', $current_time ); - $dates['year'] = date( 'Y', $current_time ); - break; - - case 'last_month' : - $dates['day'] = 1; - $dates['m_start'] = date( 'n', $current_time ) == 1 ? 12 : date( 'n', $current_time ) - 1; - $dates['m_end'] = $dates['m_start']; - $dates['year'] = date( 'n', $current_time ) == 1 ? date( 'Y', $current_time ) - 1 : date( 'Y', $current_time ); - $dates['day_end'] = date( 't', strtotime( $dates['year'] . '-' . $dates['m_start'] . '-' . $dates['day'] ) ); - break; - - case 'today' : - $dates['day'] = date( 'd', $current_time ); - $dates['day_end'] = date( 'd', $current_time ); - $dates['m_start'] = date( 'n', $current_time ); - $dates['m_end'] = date( 'n', $current_time ); - $dates['year'] = date( 'Y', $current_time ); - break; - - case 'yesterday' : - - $year = date( 'Y', $current_time ); - $month = date( 'n', $current_time ); - $day = date( 'd', $current_time ); - - if ( $month == 1 && $day == 1 ) { - - $year -= 1; - $month = 12; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - - } elseif ( $month > 1 && $day == 1 ) { - - $month -= 1; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - - } else { - - $day -= 1; - - } - - $dates['day'] = $day; - $dates['day_end'] = $day; - $dates['m_start'] = $month; - $dates['m_end'] = $month; - $dates['year'] = $year; - - break; - - case 'this_quarter' : - $month_now = date( 'n', $current_time ); - - $dates['day'] = 1; - - if ( $month_now <= 3 ) { - - $dates['m_start'] = 1; - $dates['m_end'] = 3; - $dates['year'] = date( 'Y', $current_time ); - - } else if ( $month_now <= 6 ) { - - $dates['m_start'] = 4; - $dates['m_end'] = 6; - $dates['year'] = date( 'Y', $current_time ); - - } else if ( $month_now <= 9 ) { - - $dates['m_start'] = 7; - $dates['m_end'] = 9; - $dates['year'] = date( 'Y', $current_time ); - - } else { - - $dates['m_start'] = 10; - $dates['m_end'] = 12; - $dates['year'] = date( 'Y', $current_time ); - - } - - $dates['day_end'] = date( 't', strtotime( $dates['year'] . '-' . $dates['m_end'] ) ); - - break; - - case 'last_quarter' : - $month_now = date( 'n', $current_time ); - - $dates['day'] = 1; - - if ( $month_now <= 3 ) { - - $dates['m_start'] = 10; - $dates['m_end'] = 12; - $dates['year'] = date( 'Y', $current_time ) - 1; // Previous year - - } else if ( $month_now <= 6 ) { - - $dates['m_start'] = 1; - $dates['m_end'] = 3; - $dates['year'] = date( 'Y', $current_time ); - - } else if ( $month_now <= 9 ) { - - $dates['m_start'] = 4; - $dates['m_end'] = 6; - $dates['year'] = date( 'Y', $current_time ); - - } else { - - $dates['m_start'] = 7; - $dates['m_end'] = 9; - $dates['year'] = date( 'Y', $current_time ); - - } - - $dates['day_end'] = date( 't', strtotime( $dates['year'] . '-' . $dates['m_end'] ) ); - break; - - case 'this_year' : - $dates['day'] = 1; - $dates['m_start'] = 1; - $dates['m_end'] = 12; - $dates['day_end'] = 31; - $dates['year'] = date( 'Y', $current_time ); - break; - - case 'last_year' : - $dates['day'] = 1; - $dates['m_start'] = 1; - $dates['m_end'] = 12; - $dates['day_end'] = 31; - $dates['year'] = date( 'Y', $current_time ) - 1; - break; - - case 'this_week' : - case 'last_week' : - $start_of_week = get_option( 'start_of_week' ); - - if ( 'last_week' === $args['date'] ) { - $today = date( 'd', $current_time - WEEK_IN_SECONDS ); - } else { - $today = date( 'd', $current_time ); - } - - $day_of_the_week = date( 'w', $current_time ); - $month = date( 'n', $current_time ); - $year = date( 'Y', $current_time ); - - // Account for a week the spans a month change (including if that week spans over a break in the year). - if ( ( $today - $day_of_the_week ) < 1 ) { - $start_date = date( 'd', strtotime( $year . '-' . $month . '-' . $today . ' -' . $day_of_the_week . ' days' ) ); - $month = $month > 1 ? $month -- : 12; - $adjusted_month = true; - } else { - $start_date = $today - $day_of_the_week; - $adjusted_month = false; - } - - // Account for the WordPress Start of Week setting. - $adjusted_start_date = date( 'd', strtotime( $year . '-' . $month . '-' . $start_date . ' +' . $start_of_week . 'days' ) ); - - /** - * Account for when the base start of the week is the end of one month, but the WordPress Start of Week setting - * Jumps it to the following month. - */ - if ( $adjusted_start_date < $start_date ) { - if ( 12 === $month ) { - $month = 1; - $year ++; - } else { - $month ++; - } - } - - $dates['day'] = $adjusted_start_date; - $dates['m_start'] = $month; - $dates['year'] = $month === 12 && $adjusted_month ? $year - 1 : $year; - - $base_start_date = $dates['year'] . '-' . $dates['m_start'] . '-' . $dates['day']; - $base_start_timestamp = strtotime( $base_start_date . ' +6 days' ); - $dates['m_end'] = date( 'n', $base_start_timestamp ); - $dates['day_end'] = date( 'd', $base_start_timestamp ); - $dates['year_end'] = date( 'Y', $base_start_timestamp ); - break; - - endswitch; - } - - /** - * Returns the filters for the dates used to retreive earnings/sales - * - * @since 1.5.1 - * - * @param object $dates The dates used for retreiving earnings/sales - */ - - return apply_filters( 'edd_api_stat_dates', $dates ); - } - - /** - * Process Get Customers API Request - * - * @since 1.5 - * @author Daniel J Griffiths - * - * @param int $customer Customer ID - * - * @return array $customers Multidimensional array of the customers - */ - public function get_customers( $customer = null ) { - - $customer = is_array( $customer ) ? $customer['customer'] : $customer; - $customers = array(); - $error = array(); - - if ( ! user_can( $this->user_id, 'view_shop_sensitive_data' ) && ! $this->override ) { - return $customers; - } - - $paged = $this->get_paged(); - $per_page = $this->per_page(); - $offset = $per_page * ( $paged - 1 ); - - if ( is_numeric( $customer ) ) { - $field = 'id'; - } elseif ( is_array( $customer ) ) { - // Checking if search is being done by id, email, user_id fields. - if ( array_key_exists( 'id', $customer ) ) { - $field = 'id'; - } elseif ( array_key_exists( 'email', $customer ) ) { - $field = 'email'; - } elseif ( array_key_exists( 'user_id', $customer ) ) { - $field = 'user_id'; - } - - $customer = $customer[ $field ]; - } else { - $field = 'email'; - } - - $args = array( - 'number' => $per_page, - 'offset' => $offset - ); - - if ( ! is_null( $customer ) ) { - $args[ $field ] = $customer; - } - - $customer_query = edd_get_customers( $args ); - $customer_count = 0; - - if ( $customer_query ) { - - foreach ( $customer_query as $customer_obj ) { - - $names = explode( ' ', $customer_obj->name ); - $first_name = ! empty( $names[0] ) ? $names[0] : ''; - $last_name = ''; - if ( ! empty( $names[1] ) ) { - unset( $names[0] ); - $last_name = implode( ' ', $names ); - } - - $customers['customers'][ $customer_count ]['info']['id'] = ''; - $customers['customers'][ $customer_count ]['info']['user_id'] = ''; - $customers['customers'][ $customer_count ]['info']['username'] = ''; - $customers['customers'][ $customer_count ]['info']['display_name'] = ''; - $customers['customers'][ $customer_count ]['info']['customer_id'] = $customer_obj->id; - $customers['customers'][ $customer_count ]['info']['first_name'] = $first_name; - $customers['customers'][ $customer_count ]['info']['last_name'] = $last_name; - $customers['customers'][ $customer_count ]['info']['email'] = $customer_obj->email; - - if ( ! empty( $customer_obj->user_id ) && $customer_obj->user_id > 0 ) { - - $user_data = get_userdata( $customer_obj->user_id ); - - // Customer with registered account - - // id is going to get deprecated in the future, user user_id or customer_id instead - $customers['customers'][ $customer_count ]['info']['id'] = $customer_obj->user_id; - $customers['customers'][ $customer_count ]['info']['user_id'] = $customer_obj->user_id; - $customers['customers'][ $customer_count ]['info']['username'] = $user_data->user_login; - $customers['customers'][ $customer_count ]['info']['display_name'] = $user_data->display_name; - - } - - $customers['customers'][ $customer_count ]['stats']['total_purchases'] = $customer_obj->purchase_count; - $customers['customers'][ $customer_count ]['stats']['total_spent'] = $customer_obj->purchase_value; - $customers['customers'][ $customer_count ]['stats']['total_downloads'] = edd_count_file_downloads_of_customer( $customer_obj->id ); - - $customer_count ++; - - } - - } elseif ( $customer ) { - - $error['error'] = sprintf( __( 'Customer %s not found!', 'easy-digital-downloads' ), $customer ); - - return $error; - - } else { - - $error['error'] = __( 'No customers found!', 'easy-digital-downloads' ); - - return $error; - - } - - return apply_filters( 'edd_api_customers', $customers, $this ); - } - - /** - * Process Get Products API Request - * - * @author Daniel J Griffiths - * @since 1.5 - * - * @param array $args - * - * @return array $customers Multidimensional array of the products - */ - public function get_products( $args = array() ) { - $products = array(); - $error = array(); - - if ( empty( $args['product'] ) ) { - $products['products'] = array(); - - $parameters = array( - 'post_type' => 'download', - 'posts_per_page' => $this->per_page(), - 'suppress_filters' => true, - 'paged' => $this->get_paged(), - ); - - if ( isset( $args['s'] ) && ! empty( $args['s'] ) ) { - $parameters['s'] = $args['s']; - } - - $product_list = get_posts( $parameters ); - - if ( $product_list ) { - $i = 0; - foreach ( $product_list as $product_info ) { - $products['products'][ $i ] = $this->get_product_data( $product_info ); - $i ++; - } - } - } else { - if ( get_post_type( $args['product'] ) == 'download' ) { - $product_info = get_post( $args['product'] ); - - $products['products'][0] = $this->get_product_data( $product_info ); - } else { - $error['error'] = sprintf( __( 'Product %s not found!', 'easy-digital-downloads' ), $args['product'] ); - - return $error; - } - } - - return apply_filters( 'edd_api_products', $products, $this ); - } - - /** - * Given a download post object, generate the data for the API output - * - * @since 2.3.9 - * - * @param object $product_info The Download Post Object - * - * @return array Array of post data to return back in the API - */ - public function get_product_data( $product_info ) { - - $product = array(); - - $product['info']['id'] = $product_info->ID; - $product['info']['slug'] = $product_info->post_name; - $product['info']['title'] = $product_info->post_title; - $product['info']['create_date'] = $product_info->post_date; - $product['info']['modified_date'] = $product_info->post_modified; - $product['info']['status'] = $product_info->post_status; - $product['info']['link'] = html_entity_decode( $product_info->guid ); - $product['info']['permalink'] = html_entity_decode( get_permalink( $product_info->ID ) ); - $product['info']['content'] = $product_info->post_content; - $product['info']['excerpt'] = $product_info->post_excerpt; - $product['info']['thumbnail'] = wp_get_attachment_url( get_post_thumbnail_id( $product_info->ID ) ); - $product['info']['category'] = get_the_terms( $product_info, 'download_category' ); - $product['info']['tags'] = get_the_terms( $product_info, 'download_tag' ); - - if ( user_can( $this->user_id, 'view_shop_reports' ) || $this->override ) { - $product['stats']['total']['sales'] = edd_get_download_sales_stats( $product_info->ID ); - $product['stats']['total']['earnings'] = edd_get_download_earnings_stats( $product_info->ID ); - $product['stats']['monthly_average']['sales'] = edd_get_average_monthly_download_sales( $product_info->ID ); - $product['stats']['monthly_average']['earnings'] = edd_get_average_monthly_download_earnings( $product_info->ID ); - } - - if ( edd_has_variable_prices( $product_info->ID ) ) { - foreach ( edd_get_variable_prices( $product_info->ID ) as $price ) { - $product['pricing'][ sanitize_key( $price['name'] ) ] = $price['amount']; - } - } else { - $product['pricing']['amount'] = edd_get_download_price( $product_info->ID ); - } - - if ( user_can( $this->user_id, 'view_shop_sensitive_data' ) || $this->override ) { - foreach ( edd_get_download_files( $product_info->ID ) as $file ) { - $product['files'][] = $file; - } - $product['notes'] = edd_get_product_notes( $product_info->ID ); - } - - return apply_filters( 'edd_api_products_product', $product ); - - } - - /** - * Process Get Stats API Request - * - * @author Daniel J Griffiths - * @since 1.5 - * - * @global object $wpdb Used to query the database using the WordPress - * - * @param array $args Arguments provided by API Request - * - * @return array - */ - public function get_stats( $args = array() ) { - - // Parse args - $args = wp_parse_args( $args, array( - 'type' => null, - 'product' => null, - 'date' => null, - 'startdate' => null, - 'enddate' => null, - 'include_tax' => true, - ) ); - - $dates = $this->get_dates( $args ); - - $stats = array(); - $earnings = array( - 'earnings' => array(), - ); - $sales = array( - 'sales' => array(), - ); - $error = array(); - - if ( ! user_can( $this->user_id, 'view_shop_reports' ) && ! $this->override ) { - return $stats; - } - - if ( 'sales' === $args['type'] ) { - if ( null === $args['product'] ) { - if ( null === $args['date'] ) { - $sales = $this->get_default_sales_stats(); - } elseif ( 'range' === $args['date'] ) { - // Ensure the end date is later than the start date. - if ( $args['enddate'] < $args['startdate'] ) { - $error['error'] = __( 'The end date must be later than the start date!', 'easy-digital-downloads' ); - } - - // Ensure both the start and end date are specified. - if ( empty( $args['startdate'] ) || empty( $args['enddate'] ) ) { - $error['error'] = __( 'Invalid or no date range specified!', 'easy-digital-downloads' ); - } - - $start_date = EDD()->utils->date( $dates['year'] . '-' . $dates['m_start'] . '-' . $dates['day_start'], edd_get_timezone_id(), false )->startOfDay(); - $end_date = EDD()->utils->date( $dates['year_end'] . '-' . $dates['m_end'] . '-' . $dates['day_end'], edd_get_timezone_id(), false )->endOfDay(); - - // Force the data for the reports API. - $_GET['filter_from'] = $start_date->format( 'Y-m-d' ); - $_GET['filter_to'] = $end_date->format( 'Y-m-d' ); - $_GET['range'] = 'other'; - - $stats = new EDD\Stats( - array( - 'revenue_type' => 'net', - ) - ); - - // Get UTC dates for selected date range. - $utc_dates = EDD\Reports\parse_dates_for_range(); - - // Get total sales. - $sales['totals'] = $stats->get_order_count( - array( - 'start' => $utc_dates['start']->format( 'Y-m-d H:i:s' ), - 'end' => $utc_dates['end']->format( 'Y-m-d H:i:s' ), - ) - ); - - // Get sales for each day in the requested date range. - $current_date = $start_date->copy(); - while ( $current_date->lte( $end_date ) ) { - // Force the data for the reports API. - $_GET['filter_from'] = $current_date->format( 'Y-m-d' ); - $_GET['filter_to'] = $current_date->format( 'Y-m-d' ); - $_GET['range'] = 'other'; - - $date_key = str_replace( '-', '', $current_date->format( 'Y-m-d' ) ); - $utc_dates = EDD\Reports\parse_dates_for_range(); - - if ( ! isset( $sales['sales'][ $date_key ] ) ) { - $sales['sales'][ $date_key ] = $stats->get_order_count( - array( - 'start' => $utc_dates['start']->format( 'Y-m-d H:i:s' ), - 'end' => $utc_dates['end']->format( 'Y-m-d H:i:s' ), - ) - ); - } - - - $current_date->addDay(); - } - - ksort( $sales['sales'] ); - } else { - $stats = new EDD\Stats( - array( - 'range' => $args['date'], - 'revenue_type' => 'net', - ) - ); - - $sales['sales'][ $args['date'] ] = $stats->get_order_count(); - } - } elseif ( 'all' === $args['product'] ) { - $products = get_posts( array( 'post_type' => 'download', 'nopaging' => true ) ); - $i = 0; - - $stats = new EDD\Stats(); - foreach ( $products as $product_info ) { - $product_order_count = $stats->get_order_item_count( - array( - 'product_id' => $product_info->ID, - ) - ); - - $sales['sales'][ $i ] = array( - $product_info->post_name => $product_order_count, - ); - $i ++; - } - } else { - if ( 'download' === get_post_type( $args['product'] ) ) { - $stats = new EDD\Stats(); - $product_info = get_post( $args['product'] ); - $order_item_count = $stats->get_order_item_count( - array( - 'product_id' => $args['product'], - ) - ); - - $sales['sales'][0] = array( - $product_info->post_name => $order_item_count, - ); - } else { - $error['error'] = sprintf( __( 'Product %s not found!', 'easy-digital-downloads' ), $args['product'] ); - } - } - - if ( ! empty( $error ) ) { - return $error; - } - - return apply_filters( 'edd_api_stats_sales', $sales, $this ); - } elseif ( 'earnings' === $args['type'] ) { - if ( null === $args['product'] ) { - if ( null === $args['date'] ) { - $earnings = $this->get_default_earnings_stats( $args ); - } elseif ( 'range' === $args['date'] ) { - // Ensure the end date is later than the start date. - if ( $args['enddate'] < $args['startdate'] ) { - $error['error'] = __( 'The end date must be later than the start date!', 'easy-digital-downloads' ); - } - - // Ensure both the start and end date are specified. - if ( empty( $args['startdate'] ) || empty( $args['enddate'] ) ) { - $error['error'] = __( 'Invalid or no date range specified!', 'easy-digital-downloads' ); - } - - $start_date = EDD()->utils->date( $dates['year'] . '-' . $dates['m_start'] . '-' . $dates['day_start'], edd_get_timezone_id(), false )->startOfDay(); - $end_date = EDD()->utils->date( $dates['year_end'] . '-' . $dates['m_end'] . '-' . $dates['day_end'], edd_get_timezone_id(), false )->endOfDay(); - - // Force the data for the reports API. - $_GET['filter_from'] = $start_date->format( 'Y-m-d' ); - $_GET['filter_to'] = $end_date->format( 'Y-m-d' ); - $_GET['range'] = 'other'; - - $stats = new EDD\Stats( - array( - 'revenue_type' => 'net', - 'exclude_taxes' => ! $args['include_tax'], - 'output' => 'typed', - ) - ); - - // Get UTC dates for selected date range. - $utc_dates = EDD\Reports\parse_dates_for_range(); - - // Get total earnings. - $earnings['totals'] = $stats->get_order_earnings( - array( - 'start' => $utc_dates['start']->format( 'Y-m-d H:i:s' ), - 'end' => $utc_dates['end']->format( 'Y-m-d H:i:s' ), - ) - ); - - // Get earnings for each day in the requested date range. - $current_date = $start_date->copy(); - while ( $current_date->lte( $end_date ) ) { - // Force the data for the reports API. - $_GET['filter_from'] = $current_date->format( 'Y-m-d' ); - $_GET['filter_to'] = $current_date->format( 'Y-m-d' ); - $_GET['range'] = 'other'; - - $date_key = str_replace( '-', '', $current_date->format( 'Y-m-d' ) ); - $utc_dates = EDD\Reports\parse_dates_for_range(); - - if ( ! isset( $sales['earnings'][ $date_key ] ) ) { - $earnings['earnings'][ $date_key ] = $stats->get_order_earnings( - array( - 'start' => $utc_dates['start']->format( 'Y-m-d H:i:s' ), - 'end' => $utc_dates['end']->format( 'Y-m-d H:i:s' ), - ) - ); - } - - $current_date->addDay(); - } - - ksort( $earnings['earnings'] ); - } else { - $stats = new EDD\Stats( - array( - 'range' => $args['date'], - 'revenue_type' => 'net', - 'exclude_tax' => ! $args['include_tax'], - 'output' => 'typed', - ) - ); - $earnings['earnings'][ $args['date'] ] = $stats->get_order_earnings(); - } - } elseif ( 'all' === $args['product'] ) { - $products = get_posts( array( 'post_type' => 'download', 'nopaging' => true ) ); - $i = 0; - - $stats = new EDD\Stats(); - foreach ( $products as $product_info ) { - $product_earnings = $stats->get_order_item_earnings( - array( - 'product_id' => $product_info->ID, - 'output' => 'typed', - ) - ); - - $earnings['earnings'][ $i ] = array( - $product_info->post_name => $product_earnings, - ); - $i ++; - } - } else { - if ( 'download' === get_post_type( $args['product'] ) ) { - $stats = new EDD\Stats(); - $product_info = get_post( $args['product'] ); - $order_item_earnings = $stats->get_order_item_earnings( - array( - 'product_id' => $args['product'], - 'output' => 'typed', - ) - ); - - $earnings['earnings'][0] = array( - $product_info->post_name => $order_item_earnings, - ); - } else { - $error['error'] = sprintf( __( 'Product %s not found!', 'easy-digital-downloads' ), $args['product'] ); - } - } - - if ( ! empty( $error ) ) { - return $error; - } - - return apply_filters( 'edd_api_stats_earnings', $earnings, $this ); - } elseif ( 'customers' === $args['type'] ) { - $stats['customers']['total_customers'] = edd_count_customers(); - - return apply_filters( 'edd_api_stats_customers', $stats, $this ); - } elseif ( empty( $args['type'] ) ) { - $stats = array_merge( $stats, $this->get_default_sales_stats() ); - $stats = array_merge( $stats, $this->get_default_earnings_stats( $args ) ); - - return apply_filters( 'edd_api_stats', array( 'stats' => $stats, $this ) ); - } - } - - /** - * Retrieves Recent Sales - * - * @since 1.5 - * @return array - */ - public function get_recent_sales() { - global $wp_query; - - $sales = array(); - - if ( ! user_can( $this->user_id, 'view_shop_reports' ) && ! $this->override ) { - return $sales; - } - - if ( isset( $wp_query->query_vars['id'] ) ) { - $query = array(); - $query[] = new EDD_Payment( $wp_query->query_vars['id'] ); - } elseif ( isset( $wp_query->query_vars['purchasekey'] ) ) { - $query = array(); - $query[] = edd_get_payment_by( 'key', $wp_query->query_vars['purchasekey'] ); - } elseif ( isset( $wp_query->query_vars['email'] ) ) { - $query = edd_get_payments( array( - 'fields' => 'ids', - 'meta_key' => '_edd_payment_user_email', - 'meta_value' => $wp_query->query_vars['email'], - 'number' => $this->per_page(), - 'page' => $this->get_paged(), - 'status' => 'complete', - ) ); - } else { - $query = edd_get_payments( array( - 'fields' => 'ids', - 'number' => $this->per_page(), - 'page' => $this->get_paged(), - 'status' => 'complete', - ) ); - } - - if ( $query ) { - $i = 0; - foreach ( $query as $payment ) { - if ( is_numeric( $payment ) ) { - $payment = new EDD_Payment( $payment ); - } - - if ( empty( $payment ) ) { - continue; - } - - $user_info = $payment->user_info; - - $sales['sales'][ $i ]['ID'] = $payment->number; - $sales['sales'][ $i ]['transaction_id'] = $payment->transaction_id; - $sales['sales'][ $i ]['key'] = $payment->key; - $sales['sales'][ $i ]['discount'] = ! empty( $payment->discounts ) ? explode( ',', $payment->discounts ) : array(); - $sales['sales'][ $i ]['subtotal'] = $payment->subtotal; - $sales['sales'][ $i ]['tax'] = $payment->tax; - $sales['sales'][ $i ]['fees'] = $payment->fees; - $sales['sales'][ $i ]['total'] = $payment->total; - $sales['sales'][ $i ]['gateway'] = $payment->gateway; - $sales['sales'][ $i ]['email'] = $payment->email; - $sales['sales'][ $i ]['user_id'] = $payment->user_id; - $sales['sales'][ $i ]['customer_id'] = $payment->customer_id; - $sales['sales'][ $i ]['date'] = $payment->date; - $sales['sales'][ $i ]['products'] = array(); - - $c = 0; - - if ( ! empty( $payment->cart_details ) && is_array( $payment->cart_details ) ) { - foreach ( $payment->cart_details as $key => $item ) { - - $item_id = isset( $item['id'] ) ? $item['id'] : $item; - $price = isset( $item['price'] ) ? $item['price'] : false; - $price_id = isset( $item['item_number']['options']['price_id'] ) ? $item['item_number']['options']['price_id'] : null; - $quantity = isset( $item['quantity'] ) && $item['quantity'] > 0 ? $item['quantity'] : 1; - - if ( ! $price ) { - // This function is only used on payments with near 1.0 cart data structure - $price = edd_get_download_final_price( $item_id, $user_info, null ); - } - - $price_name = ''; - if ( isset( $item['item_number'] ) && isset( $item['item_number']['options'] ) ) { - $price_options = $item['item_number']['options']; - if ( isset( $price_options['price_id'] ) ) { - $price_name = edd_get_price_option_name( $item_id, $price_options['price_id'], $payment->ID ); - } - } - - $sales['sales'][ $i ]['products'][ $c ]['id'] = $item_id; - $sales['sales'][ $i ]['products'][ $c ]['quantity'] = $quantity; - $sales['sales'][ $i ]['products'][ $c ]['name'] = get_the_title( $item_id ); - $sales['sales'][ $i ]['products'][ $c ]['price'] = $price; - $sales['sales'][ $i ]['products'][ $c ]['price_name'] = $price_name; - $c ++; - } - } - - $i ++; - } - } - - return apply_filters( 'edd_api_sales', $sales, $this ); - } - - /** - * Process Get Discounts API Request - * - * @since 1.6 - * @global object $wpdb Used to query the database using the WordPress - * Database API - * - * @param int $discount Discount ID - * - * @return array $discounts Multidimensional array of the discounts - */ - public function get_discounts( $discount = null ) { - - $discount_list = $error = array(); - - if ( ! user_can( $this->user_id, 'manage_shop_discounts' ) && ! $this->override ) { - return $discount_list; - } - - if ( empty( $discount ) ) { - $count = 0; - $paged = $this->get_paged(); - $per_page = $this->per_page(); - $discounts = edd_get_discounts( array( - 'number' => $per_page, - 'offset' => ( absint( $paged ) - 1 ) * $per_page, - ) ); - - if ( empty( $discounts ) ) { - $error['error'] = __( 'No discounts found!', 'easy-digital-downloads' ); - - return $error; - } - - foreach ( $discounts as $discount ) { - $discount_list['discounts'][ $count ]['ID'] = $discount->id; - $discount_list['discounts'][ $count ]['name'] = $discount->name; - $discount_list['discounts'][ $count ]['code'] = $discount->code; - $discount_list['discounts'][ $count ]['amount'] = $discount->amount; - $discount_list['discounts'][ $count ]['min_price'] = $discount->min_charge_amount; - $discount_list['discounts'][ $count ]['type'] = $discount->amount_type; - $discount_list['discounts'][ $count ]['uses'] = $discount->use_count; - $discount_list['discounts'][ $count ]['max_uses'] = $discount->max_uses; - $discount_list['discounts'][ $count ]['start_date'] = $discount->start_date; - $discount_list['discounts'][ $count ]['exp_date'] = $discount->end_date; - $discount_list['discounts'][ $count ]['status'] = $discount->status; - $discount_list['discounts'][ $count ]['product_requirements'] = $discount->product_reqs; - $discount_list['discounts'][ $count ]['requirement_condition'] = $discount->product_condition; - $discount_list['discounts'][ $count ]['global_discount'] = 'global' === $discount->scope; - $discount_list['discounts'][ $count ]['excluded_products'] = $discount->excluded_products; - $discount_list['discounts'][ $count ]['single_use'] = $discount->once_per_customer; - - $count ++; - } - - } else { - $discount_object = edd_get_discount( $discount ); - if ( is_numeric( $discount ) && $discount_object ) { - $discount_list['discounts'][0]['ID'] = $discount_object->id; - $discount_list['discounts'][0]['name'] = $discount_object->name; - $discount_list['discounts'][0]['code'] = $discount_object->code; - $discount_list['discounts'][0]['amount'] = $discount_object->amount; - $discount_list['discounts'][0]['min_price'] = $discount_object->min_charge_amount; - $discount_list['discounts'][0]['type'] = $discount_object->amount_type; - $discount_list['discounts'][0]['uses'] = $discount_object->use_count; - $discount_list['discounts'][0]['max_uses'] = $discount_object->max_uses; - $discount_list['discounts'][0]['start_date'] = $discount_object->start_date; - $discount_list['discounts'][0]['exp_date'] = $discount_object->end_date; - $discount_list['discounts'][0]['status'] = $discount_object->status; - $discount_list['discounts'][0]['product_requirements'] = $discount_object->product_reqs; - $discount_list['discounts'][0]['requirement_condition'] = $discount_object->product_condition; - $discount_list['discounts'][0]['global_discount'] = 'global' === $discount_object->scope; - $discount_list['discounts'][0]['excluded_products'] = $discount_object->excluded_products; - $discount_list['discounts'][0]['single_use'] = $discount_object->once_per_customer; - } else { - $error['error'] = sprintf( __( 'Discount %s not found!', 'easy-digital-downloads' ), $discount ); - - return $error; - } - } - - return apply_filters( 'edd_api_discounts', $discount_list, $this ); - } - - /** - * Process Get Downloads API Request to retrieve download logs - * - * @since 2.5 - * @author Daniel J Griffiths - * - * @param int $customer_id The customer ID you wish to retrieve download logs for - * - * @return array Multidimensional array of the download logs - */ - public function get_download_logs( $customer_id = 0 ) { - $edd_logs = EDD()->debug_log; - - $downloads = array(); - $invalid_customer = false; - - $paged = $this->get_paged(); - $per_page = $this->per_page(); - $offset = $per_page * ( $paged - 1 ); - - $meta_query = array(); - if ( ! empty( $customer_id ) ) { - - $customer = new EDD_Customer( $customer_id ); - - if ( $customer->id > 0 ) { - $meta_query['relation'] = 'OR'; - - if ( $customer->id > 0 ) { - // Based on customer->user_id - $meta_query[] = array( - 'key' => '_edd_log_user_id', - 'value' => $customer->user_id, - ); - } - - // Based on customer->email - $meta_query[] = array( - 'key' => '_edd_log_user_info', - 'value' => $customer->email, - 'compare' => 'LIKE', - ); - } else { - $invalid_customer = true; - } - } - - $query = array( - 'log_type' => 'file_download', - 'paged' => $paged, - 'meta_query' => $meta_query, - 'posts_per_page' => $per_page, - 'update_post_meta_cache' => false, - 'update_post_term_cache' => false, - ); - - $logs = array(); - if ( ! $invalid_customer ) { - $logs = $edd_logs->get_connected_logs( $query ); - } - - if ( empty( $logs ) ) { - $error['error'] = __( 'No download logs found!', 'easy-digital-downloads' ); - - return $error; - } - - foreach ( $logs as $log ) { - - $log_meta = get_post_custom( $log->ID ); - $payment_id = isset( $log_meta['_edd_log_payment_id'] ) ? $log_meta['_edd_log_payment_id'][0] : false; - - $payment_customer_id = edd_get_payment_customer_id( $payment_id ); - $payment_customer = new EDD_Customer( $payment_customer_id ); - $user_id = ( $payment_customer->user_id > 0 ) ? $payment_customer->user_id : false; - $ip = $log_meta['_edd_log_ip'][0]; - $files = edd_get_payment_meta_downloads( $payment_id ); - $files = edd_get_download_files( $files[0]['id'] ); - $file_id = (int) $log_meta['_edd_log_file_id'][0]; - $file_id = $file_id !== false ? $file_id : 0; - $file_name = isset( $files[ $file_id ]['name'] ) ? $files[ $file_id ]['name'] : null; - - $item = (array) apply_filters( 'edd_api_download_log_item', array( - 'ID' => $log->ID, - 'user_id' => $user_id, - 'product_id' => $log->post_parent, - 'product_name' => get_the_title( $log->post_parent ), - 'customer_id' => $payment_customer_id, - 'payment_id' => $payment_id, - 'file' => $file_name, - 'ip' => $ip, - 'date' => $log->post_date, - ), $log, $log_meta ); - - $downloads['download_logs'][] = $item; - - } - - return apply_filters( 'edd_api_download_logs', $downloads, $this ); - } - - /** - * Process Get Info API Request - * - * @param array $args Arguments provided by API Request - * - * @return array - */ - public function get_info() { - $data = array(); - - // plugin.php required to use is_plugin_active() - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - - // Integrations - if ( is_plugin_active( 'edd-commissions/edd-commissions.php' ) ) { - $data['info']['integrations']['commissions'] = true; - } - - if ( class_exists( 'EDD_Software_Licensing' ) ) { - $data['info']['integrations']['software_licensing'] = true; - } - - if ( class_exists( 'EDD_Front_End_Submissions' ) ) { - $data['info']['integrations']['fes'] = true; - } - - if ( class_exists( 'EDD_Reviews' ) ) { - $data['info']['integrations']['reviews'] = true; - } - - if ( class_exists( 'EDD_Recurring' ) ) { - $data['info']['integrations']['recurring'] = true; - } - - // Permissions - if ( user_can( $this->user_id, 'view_shop_reports' ) ) { - $data['info']['permissions']['view_shop_reports'] = true; - } - - if ( user_can( $this->user_id, 'view_shop_sensitive_data' ) ) { - $data['info']['permissions']['view_shop_sensitive_data'] = true; - } - - if ( user_can( $this->user_id, 'manage_shop_discounts' ) ) { - $data['info']['permissions']['manage_shop_discounts'] = true; - } - - // Site Information - if ( user_can( $this->user_id, 'view_shop_sensitive_data' ) ) { - $data['info']['site']['wp_version'] = get_bloginfo( 'version' ); - $data['info']['site']['edd_version'] = EDD_VERSION; - } - - $data['info']['site']['currency'] = edd_get_currency(); - $data['info']['site']['currency_position'] = edd_get_option( 'currency_position', 'before' ); - $data['info']['site']['decimal_separator'] = edd_get_option( 'decimal_separator', '.' ); - $data['info']['site']['thousands_separator'] = edd_get_option( 'thousands_separator', ',' ); - - return apply_filters( 'edd_api_info', $data, $this ); - } - - /** - * Retrieve the output format - * - * Determines whether results should be displayed in XML or JSON - * - * @since 1.5 - * - * @return mixed|void - */ - public function get_output_format() { - global $wp_query; - - $format = isset( $wp_query->query_vars['format'] ) ? $wp_query->query_vars['format'] : 'json'; - - return apply_filters( 'edd_api_output_format', $format ); - } - - - /** - * Log each API request, if enabled - * - * @access private - * @since 1.5 - * @global $edd_logs - * @global $wp_query - * - * @param array $data - * - * @return void - */ - private function log_request( $data = array() ) { - if ( ! $this->log_requests() ) { - return; - } - - global $wp_query; - - $query = array( - 'edd-api' => $wp_query->query_vars['edd-api'], - 'key' => isset( $wp_query->query_vars['key'] ) ? $wp_query->query_vars['key'] : null, - 'token' => isset( $wp_query->query_vars['token'] ) ? $wp_query->query_vars['token'] : null, - 'query' => isset( $wp_query->query_vars['query'] ) ? $wp_query->query_vars['query'] : null, - 'type' => isset( $wp_query->query_vars['type'] ) ? $wp_query->query_vars['type'] : null, - 'product' => isset( $wp_query->query_vars['product'] ) ? $wp_query->query_vars['product'] : null, - 'customer' => isset( $wp_query->query_vars['customer'] ) ? $wp_query->query_vars['customer'] : null, - 'date' => isset( $wp_query->query_vars['date'] ) ? $wp_query->query_vars['date'] : null, - 'startdate' => isset( $wp_query->query_vars['startdate'] ) ? $wp_query->query_vars['startdate'] : null, - 'enddate' => isset( $wp_query->query_vars['enddate'] ) ? $wp_query->query_vars['enddate'] : null, - 'id' => isset( $wp_query->query_vars['id'] ) ? $wp_query->query_vars['id'] : null, - 'purchasekey' => isset( $wp_query->query_vars['purchasekey'] ) ? $wp_query->query_vars['purchasekey'] : null, - 'email' => isset( $wp_query->query_vars['email'] ) ? $wp_query->query_vars['email'] : null, - ); - - $data = array( - 'user_id' => $this->user_id, - 'api_key' => isset( $wp_query->query_vars['key'] ) ? $wp_query->query_vars['key'] : 'public', - 'token' => isset( $wp_query->query_vars['token'] ) ? $wp_query->query_vars['token'] : 'public', - 'version' => $this->get_queried_version(), - 'request' => http_build_query( $query ), - 'error' => ! empty( $data['error'] ) ? $data['error'] : '', - 'ip' => edd_get_ip(), - 'time' => $data['request_speed'], - ); - - edd_add_api_request_log( $data ); - } - - - /** - * Retrieve the output data - * - * @since 1.5.2 - * @return array - */ - public function get_output() { - return $this->data; - } - - /** - * Output Query in either JSON/XML. The query data is outputted as JSON - * by default - * - * @author Daniel J Griffiths - * @since 1.5 - * @global $wp_query - * - * @param int $status_code - */ - public function output( $status_code = 200 ) { - $format = $this->get_output_format(); - - status_header( $status_code ); - - do_action( 'edd_api_output_before', $this->data, $this, $format ); - - switch ( $format ) : - - case 'xml' : - - require_once EDD_PLUGIN_DIR . 'includes/libraries/class-ArrayToXML.php'; - $arraytoxml = new ArrayToXML(); - $xml = $arraytoxml->buildXML( $this->data, 'edd' ); - - echo $xml; - - break; - - case 'json' : - - header( 'Content-Type: application/json' ); - if ( ! empty( $this->pretty_print ) ) { - echo json_encode( $this->data, $this->pretty_print ); - } else { - echo json_encode( $this->data ); - } - - break; - - - default : - - // Allow other formats to be added via extensions - do_action( 'edd_api_output_' . $format, $this->data, $this ); - - break; - - endswitch; - - do_action( 'edd_api_output_after', $this->data, $this, $format ); - - if ( defined( 'EDD_DOING_TESTS' ) && EDD_DOING_TESTS ) { - edd_die(); - } else { - die(); - } - } - - /** - * Modify User Profile - * - * Modifies the output of profile.php to add key generation/revocation - * - * @author Daniel J Griffiths - * @since 1.5 - * - * @param object $user Current user info - * - * @return void - */ - function user_key_field( $user ) { - if ( ( edd_get_option( 'api_allow_user_keys', false ) || current_user_can( 'manage_shop_settings' ) ) && current_user_can( 'edit_user', $user->ID ) ) { - $user = get_userdata( $user->ID ); - ?> - - - - - - - -
    - get_user_public_key( $user->ID ); - $secret_key = $this->get_user_secret_key( $user->ID ); - - if ( empty( $user->edd_user_public_key ) ) { ?> -

    - -

    - -   - -
    -   - -
    -   - -
    - - - -
    - 403 ) ); - } - - if ( empty( $args['user_id'] ) ) { - wp_die( __( 'User ID Required', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 401 ) ); - } - - if ( is_numeric( $args['user_id'] ) ) { - $user_id = isset( $args['user_id'] ) ? absint( $args['user_id'] ) : get_current_user_id(); - } else { - $userdata = get_user_by( 'login', $args['user_id'] ); - $user_id = $userdata->ID; - } - $process = isset( $args['edd_api_process'] ) ? strtolower( $args['edd_api_process'] ) : false; - - if ( $user_id == get_current_user_id() && ! edd_get_option( 'allow_user_api_keys' ) && ! current_user_can( 'manage_shop_settings' ) ) { - wp_die( sprintf( __( 'You do not have permission to %s API keys for this user', 'easy-digital-downloads' ), $process ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } elseif ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_die( sprintf( __( 'You do not have permission to %s API keys for this user', 'easy-digital-downloads' ), $process ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - switch ( $process ) { - case 'generate': - if ( $this->generate_api_key( $user_id ) ) { - delete_transient( 'edd-total-api-keys' ); - edd_redirect( - edd_get_admin_url( - array( - 'page' => 'edd-tools', - 'tab' => 'api_keys', - 'edd-message' => 'api-key-generated', - ) - ) - ); - } else { - edd_redirect( - edd_get_admin_url( - array( - 'page' => 'edd-tools', - 'tab' => 'api_keys', - 'edd-message' => 'api-key-failed', - ) - ) - ); - } - break; - case 'regenerate': - $this->generate_api_key( $user_id, true ); - delete_transient( 'edd-total-api-keys' ); - edd_redirect( - edd_get_admin_url( - array( - 'page' => 'edd-tools', - 'tab' => 'api_keys', - 'edd-message' => 'api-key-regenerated', - ) - ) - ); - break; - case 'revoke': - $this->revoke_api_key( $user_id ); - delete_transient( 'edd-total-api-keys' ); - edd_redirect( - edd_get_admin_url( - array( - 'page' => 'edd-tools', - 'tab' => 'api_keys', - 'edd-message' => 'api-key-revoked', - ) - ) - ); - break; - default; - break; - } - } - - /** - * Generate new API keys for a user - * - * @since 2.0.0 - * - * @param int $user_id User ID the key is being generated for - * @param boolean $regenerate Regenerate the key for the user - * - * @return boolean True if (re)generated successfully, false otherwise. - */ - public function generate_api_key( $user_id = 0, $regenerate = false ) { - if ( empty( $user_id ) ) { - return false; - } - - $user = get_userdata( $user_id ); - - if ( ! $user ) { - return false; - } - - $public_key = $this->get_user_public_key( $user_id ); - - if ( empty( $public_key ) || $regenerate == true ) { - $new_public_key = $this->generate_public_key( $user->user_email ); - $new_secret_key = $this->generate_private_key( $user->ID ); - } else { - return false; - } - - if ( $regenerate == true ) { - $this->revoke_api_key( $user->ID ); - } - - update_user_meta( $user_id, $new_public_key, 'edd_user_public_key' ); - update_user_meta( $user_id, $new_secret_key, 'edd_user_secret_key' ); - - return true; - } - - /** - * Revoke a users API keys - * - * @since 2.0.0 - * - * @param int $user_id User ID of user to revoke key for - * - * @return string - */ - public function revoke_api_key( $user_id = 0 ) { - if ( empty( $user_id ) ) { - return false; - } - - $user = get_userdata( $user_id ); - - if ( ! $user ) { - return false; - } - - $public_key = $this->get_user_public_key( $user_id ); - $secret_key = $this->get_user_secret_key( $user_id ); - if ( ! empty( $public_key ) ) { - delete_transient( md5( 'edd_api_user_' . $public_key ) ); - delete_transient( md5( 'edd_api_user_public_key' . $user_id ) ); - delete_transient( md5( 'edd_api_user_secret_key' . $user_id ) ); - delete_user_meta( $user_id, $public_key ); - delete_user_meta( $user_id, $secret_key ); - } else { - return false; - } - - return true; - } - - public function get_version() { - return self::VERSION; - } - - - /** - * Generate and Save API key - * - * Generates the key requested by user_key_field and stores it in the database - * - * @author Daniel J Griffiths - * @since 1.5 - * - * @param int $user_id - * - * @return void - */ - public function update_key( $user_id ) { - edd_update_user_api_key( $user_id ); - } - - /** - * Generate the public key for a user - * - * @access private - * @since 1.9.9 - * - * @param string $user_email - * - * @return string - */ - public function generate_public_key( $user_email = '' ) { - $auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : ''; - $public = hash( 'md5', $user_email . $auth_key . date( 'U' ) ); - - return $public; - } - - /** - * Generate the secret key for a user - * - * @access private - * @since 1.9.9 - * - * @param int $user_id - * - * @return string - */ - public function generate_private_key( $user_id = 0 ) { - $auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : ''; - $secret = hash( 'md5', $user_id . $auth_key . date( 'U' ) ); - - return $secret; - } - - /** - * Retrieve the user's token - * - * @access private - * @since 1.9.9 - * - * @param int $user_id - * - * @return string - */ - public function get_token( $user_id = 0 ) { - return hash( 'md5', $this->get_user_secret_key( $user_id ) . $this->get_user_public_key( $user_id ) ); - } - - /** - * Generate the default sales stats returned by the 'stats' endpoint - * - * @access private - * @since 1.5.3 - * @return array default sales statistics - */ - private function get_default_sales_stats() { - - $stats = new EDD\Stats( - array( - 'range' => 'today', - 'revenue_type' => 'net', - ) - ); - $sales['sales']['today'] = $stats->get_order_count(); - - $stats = new EDD\Stats( - array( - 'range' => 'this_month', - 'revenue_type' => 'net', - ) - ); - $sales['sales']['current_month'] = $stats->get_order_count(); - - $stats = new EDD\Stats( - array( - 'range' => 'last_month', - 'revenue_type' => 'net', - ) - ); - $sales['sales']['last_month'] = $stats->get_order_count(); - - $sales['sales']['totals'] = edd_get_total_sales(); - - return $sales; - } - - /** - * Generate the default earnings stats returned by the 'stats' endpoint - * - * @access private - * @since 1.5.3 - * @return array default earnings statistics - */ - private function get_default_earnings_stats( $args ) { - - $stats = new EDD\Stats( - array( - 'range' => 'today', - 'exclude_taxes' => ! $args['include_tax'], - 'revenue_type' => 'net', - 'output' => 'typed', - ) - ); - $earnings['earnings']['today'] = $stats->get_order_earnings(); - - $stats = new EDD\Stats( - array( - 'range' => 'this_month', - 'exclude_taxes' => ! $args['include_tax'], - 'revenue_type' => 'net', - 'output' => 'typed', - ) - ); - $earnings['earnings']['current_month'] = $stats->get_order_earnings(); - - $stats = new EDD\Stats( - array( - 'range' => 'last_month', - 'exclude_taxes' => ! $args['include_tax'], - 'revenue_type' => 'net', - 'output' => 'typed', - ) - ); - $earnings['earnings']['last_month'] = $stats->get_order_earnings(); - - $earnings['earnings']['totals'] = edd_get_total_earnings( $args['include_tax'] ); - - return $earnings; - } - - /** - * A Backwards Compatibility call for the change of meta_key/value for users API Keys - * - * @since 2.4 - * - * @param string $check Wether to check the cache or not - * @param int $object_id The User ID being passed - * @param string $meta_key The user meta key - * @param bool $single If it should return a single value or array - * - * @return string The API key/secret for the user supplied - */ - public function api_key_backwards_copmat( $check, $object_id, $meta_key, $single ) { - - if ( $meta_key !== 'edd_user_public_key' && $meta_key !== 'edd_user_secret_key' ) { - return $check; - } - - $return = $check; - - switch ( $meta_key ) { - case 'edd_user_public_key': - $return = EDD()->api->get_user_public_key( $object_id ); - break; - case 'edd_user_secret_key': - $return = EDD()->api->get_user_secret_key( $object_id ); - break; - } - - if ( ! $single ) { - $return = array( $return ); - } - - return $return; - - } - - /** - * Sanitizes category and tag terms - * - * @access private - * @since 2.6 - * - * @param mixed $term Request variable - * - * @return mixed Sanitized term/s - */ - public function sanitize_request_term( $term ) { - if ( is_array( $term ) ) { - $term = array_map( 'sanitize_text_field', $term ); - } else if ( is_int( $term ) ) { - $term = absint( $term ); - } else { - $term = sanitize_text_field( $term ); - } - - return $term; - } - - /** - * Disable request logging - * - * @since 2.7 - */ - public function log_requests() { - return apply_filters( 'edd_api_log_requests', true ); - } - - /** - * Check API keys vs token - * - * @since 2.8.2 - * - * @param string $secret Secret key - * @param string $public Public key - * @param string $token Token used in API request - * - * @return bool - */ - public function check_keys( $secret, $public, $token ) { - return hash_equals( md5( $secret . $public ), $token ); - } - - /** - * Flush previous API output. This is for unit tests only as we use a static fixture. - * - * @since 3.0 - */ - public function flush_api_output() { - if ( defined( 'EDD_UNIT_TESTS' ) ) { - $this->data = array(); - } - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/api/v3/Endpoint.php b/wp-content/plugins/easy-digital-downloads/includes/api/v3/Endpoint.php deleted file mode 100644 index b817e5f3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/api/v3/Endpoint.php +++ /dev/null @@ -1,26 +0,0 @@ - \WP_REST_Server::READABLE, - 'callback' => array( $this, 'listNotifications' ), - 'permission_callback' => array( $this, 'canViewNotification' ), - ) - ) - ); - - register_rest_route( - self::$namespace, - 'notifications/(?P\d+)', - array( - array( - 'methods' => \WP_REST_Server::DELETABLE, - 'callback' => array( $this, 'dismissNotification' ), - 'permission_callback' => array( $this, 'canViewNotification' ), - 'args' => array( - 'id' => array( - 'description' => __( 'ID of the notification.', 'easy-digital-downloads' ), - 'type' => 'integer', - 'required' => true, - 'validate_callback' => function ( $param, $request, $key ) { - $notification = EDD()->notifications->get( intval( $param ) ); - - return ! empty( $notification ); - }, - 'sanitize_callback' => function ( $param, $request, $key ) { - return intval( $param ); - } - ) - ), - ) - ) - ); - } - - /** - * Whether the current user can view (and dismiss) notifications. - * - * @since 2.11.4 - * - * @return bool - */ - public function canViewNotification() { - return current_user_can( 'manage_shop_settings' ); - } - - /** - * Returns a list of notifications. - * - * @since 2.11.4 - * - * @param \WP_REST_Request $request - * - * @return \WP_REST_Response - */ - public function listNotifications( \WP_REST_Request $request ) { - $active = array_map( function ( Notification $notification ) { - return $notification->toArray(); - }, EDD()->notifications->getActiveNotifications() ); - - // @todo At a later date we may want to receive dismissed notifications too. - /*$dismissed = array_map( function ( Notification $notification ) { - return $notification->toArray(); - }, EDD()->notifications->getDismissedNotifications() );*/ - - return new \WP_REST_Response( array( - 'active' => $active, - //'dismissed' => $dismissed, - ) ); - } - - /** - * Dismisses a single notification. - * - * @since 2.11.4 - * - * @param \WP_REST_Request $request - * - * @return \WP_REST_Response - */ - public function dismissNotification( \WP_REST_Request $request ) { - $result = EDD()->notifications->update( - $request->get_param( 'id' ), - array( 'dismissed' => 1 ) - ); - - if ( ! $result ) { - return new \WP_REST_Response( array( - 'error' => __( 'Failed to dismiss notification.', 'easy-digital-downloads' ), - ), 500 ); - } - - wp_cache_delete( 'edd_active_notification_count', 'edd_notifications' ); - - return new \WP_REST_Response( null, 204 ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/images/cart.svg b/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/images/cart.svg deleted file mode 100644 index c0b78301..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/images/cart.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/images/remove.svg b/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/images/remove.svg deleted file mode 100644 index 56960599..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/images/remove.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/cart.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/cart.js deleted file mode 100644 index f631e4e1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/cart.js +++ /dev/null @@ -1,13 +0,0 @@ -jQuery( document ).ready( function ( $ ) { - $( 'body' ).on( 'edd_cart_item_added edd_cart_item_removed', function ( e, response ) { - if ( $( '.wp-block-edd-cart' ).length && response.block_cart.length ) { - if ( $( '.edd-blocks__cart-mini' ).length ) { - $( '.edd-blocks-cart__mini-quantity' ).empty().append( response.quantity_formatted ); - $( '.edd-blocks-cart__mini-total' ).empty().append( response.total ); - } - if ( $( '.edd-blocks__cart-full' ).length ) { - $( '.edd-blocks__cart-full .edd-blocks-form__cart' ).replaceWith( response.block_cart ); - } - } - } ); -} ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/checkout-forms.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/checkout-forms.js deleted file mode 100644 index 82052afb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/checkout-forms.js +++ /dev/null @@ -1,23 +0,0 @@ -jQuery( document ).ready( function ( $ ) { - $( '.edd-blocks__checkout-forms button' ).on( 'click', function ( e ) { - e.preventDefault(); - var button = $( this ), - form_id = $( this ).data( 'attr' ), - current = $( '.edd-blocks__checkout-forms' ).find( 'button:disabled' ); - $( '.edd-checkout-block__personal-info' ).empty().append( '' ); - $.ajax( { - type: 'GET', - data: { - action: 'edd_blocks_swap_personal_info', - form_id: form_id, - }, - url: edd_global_vars.ajaxurl, - success: function ( response ) { - button.prop( 'disabled', true ).hide(); - current.prop( 'disabled', false ).show(); - $( '.edd-checkout-block__personal-info' ).empty(); - $( '.edd-checkout-block__personal-info' ).html( response.data ); - }, - } ); - } ); -} ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/recaptcha.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/recaptcha.js deleted file mode 100644 index 6f699f30..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/recaptcha.js +++ /dev/null @@ -1,42 +0,0 @@ -jQuery( document ).ready( function ( $ ) { - if ( !EDDreCAPTCHA.sitekey ) { - return; - } - var reCAPTCHAinput = document.querySelector( 'input#edd-blocks-recaptcha' ); - if ( !reCAPTCHAinput ) { - return; - } - EDDreCAPTCHA.action = document.querySelector( 'input[name="edd_action"]' ).value; - EDDreCAPTCHA.submit = document.querySelector( 'input[name="edd_submit"]' ).value; - reCAPTCHAinput.addEventListener( 'invalid', function () { - grecaptcha.execute( EDDreCAPTCHA.sitekey, { action: EDDreCAPTCHA.action } ).then( function ( token ) { - $.ajax( { - type: 'POST', - data: { - action: 'edd_recaptcha_validate', - token: token, - ip: document.querySelector( '[name="edd_blocks_ip"]' ).value, - }, - url: EDDreCAPTCHA.ajaxurl, - success: function ( response ) { - var submitButton = document.querySelector( '#' + EDDreCAPTCHA.submit ); - if ( response.success ) { - reCAPTCHAinput.value = token; - submitButton.click(); - } else { - reCAPTCHAinput.value = ''; - var errorNode = document.createElement( 'div' ); - errorNode.classList.add( 'edd_errors', 'edd-alert', 'edd-alert-error', response.data.error ); - errorNode.innerHTML = '

    ' + EDDreCAPTCHA.error + ': ' + response.data.message + '

    '; - submitButton.closest( 'form' ).before( errorNode ); - } - }, - } ).fail( function ( response ) { - reCAPTCHAinput.value = ''; - if ( window.console && window.console.log ) { - console.log( response ); - } - } ); - } ); - } ); -} ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/term-image.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/term-image.js deleted file mode 100644 index 730e099f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/assets/js/term-image.js +++ /dev/null @@ -1,99 +0,0 @@ -; ( function ( document, $, undefined ) { - 'use strict'; - - var custom_uploader, - targetInputClass = '.upload-image-id', - previewClass = 'upload-image-preview', - target_input, - TermImage = {}; - - TermImage.upload = function () { - $( '.upload-image' ).on( 'click.upload', _uploadMedia ); - $( '.delete-image' ).on( 'click.delete', _deleteMedia ); - $( '#addtag #submit' ).on( 'click.term', _termImages ); - - function _uploadMedia ( e ) { - e.preventDefault(); - target_input = $( this ).prev( targetInputClass ); - - //If the uploader object has already been created, reopen the dialog - if ( custom_uploader ) { - custom_uploader.reset(); - } - - //Extend the wp.media object - custom_uploader = wp.media.frames.file_frame = wp.media( { - title: ( [ TermImage.params.text ] ), - button: { - text: ( [ TermImage.params.text ] ) - }, - multiple: false, - library: { type: 'image' } - } ); - - //When a file is selected, grab the URL and set it as the text field's value - custom_uploader.on( 'select', function () { - - var attachment = custom_uploader.state().get( 'selection' ).first().toJSON(), - preview = $( target_input ).prevAll( '.' + previewClass ), - deleteButton = $( target_input ).siblings( '.delete-image' ), - previewImage = $( '
    ', { - class: previewClass - } ).append( $( '', { - style: 'max-width:300px;', - src: _getImageURL( attachment ), - alt: '' - } ) ); - $( target_input ).val( attachment.id ); - if ( preview.length ) { - preview.remove(); - } - $( target_input ).before( previewImage ); - $( deleteButton ).show(); - } ); - - //Open the uploader dialog - custom_uploader.open(); - } - - /** - * Get the medium size image, if it exists. - * @param image - * @return {*} - * @private - */ - function _getImageURL ( image ) { - return image.sizes.medium ? image.sizes.medium.url : image.url; - } - - function _deleteMedia ( e ) { - e.preventDefault(); - target_input = $( this ).prevAll( targetInputClass ); - var previewView = $( this ).prevAll( '.' + previewClass ); - - $( target_input ).val( '' ); - $( previewView ).remove(); - $( this ).hide(); - } - - function _termImages ( e ) { - e.preventDefault(); - var submitButton = $( this ).parentsUntil( '#addtag' ), - previewView = submitButton.siblings( '.term-image-wrap' ).children( '.' + previewClass ), - clearInput = submitButton.siblings( '.term-image-wrap' ).children( targetInputClass ); - - if ( $( previewView ).length && $( submitButton ).length ) { - $( previewView ).delay( 1000 ).fadeOut( 200, function () { - $( this ).remove(); - $( clearInput ).val( '' ); - } ); - } - } - }; - - TermImage.params = typeof EDDTermImages === 'undefined' ? '' : EDDTermImages; - if ( typeof TermImage.params !== 'undefined' ) { - TermImage.upload(); - } - -} )( document, jQuery ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/block.json deleted file mode 100644 index 251792db..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/block.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/buy-button", - "version": "2.0.0", - "title": "EDD Buy Button", - "category": "easy-digital-downloads", - "icon": "button", - "description": "Quickly add a \"buy now\" button for any EDD product.", - "keywords": [ - "easy digital downloads", - "edd", - "button" - ], - "supports": { - "html": false, - "align": [ - "center", - "left", - "right", - "wide" - ] - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "attributes": { - "download_id": { - "type": "string" - }, - "width": { - "type": "string" - }, - "show_price": { - "type": "boolean", - "default": true - }, - "direct": { - "type": "boolean", - "default": false - } - }, - "example": { - "attributes": {} - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/index.asset.php deleted file mode 100644 index ce59d139..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '9575575720727823baf2'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/index.css deleted file mode 100644 index 9a08e34a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/index.css +++ /dev/null @@ -1 +0,0 @@ -.edd-no-js{display:none!important}svg.edd-blocks__icon{fill:none!important}.editor-styles-wrapper .components-placeholder{align-items:center;background-color:#fefefe;border-radius:5px}.editor-styles-wrapper .components-placeholder__fieldset{justify-content:center}.editor-styles-wrapper .components-placeholder div.edd-downloads--actions{display:flex;gap:2em;justify-content:space-around}.editor-styles-wrapper .components-placeholder div.edd-downloads--actions a.components-button{line-height:1.5;margin-right:0;padding:.5em 1em;text-decoration:none}.editor-styles-wrapper .components-placeholder div.edd-downloads--actions a.components-button.edd-downloads--primary{background-color:var(--wp-admin-theme-color);color:#fff}.editor-styles-wrapper .components-placeholder div.edd-downloads--actions a.components-button.edd-downloads--secondary{background-color:#fff;border:1px solid var(--wp-admin-theme-color);color:var(--wp-admin-theme-color)}.editor-styles-wrapper .wp-block.wp-block-edd-buy-button .components-placeholder{align-items:center;background-color:#fefefe;border-radius:5px}.editor-styles-wrapper .wp-block.wp-block-edd-buy-button .components-placeholder__fieldset{justify-content:center} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/index.js deleted file mode 100644 index 8fc8ee37..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={557:(e,o,t)=>{const l=window.wp.blocks,a=window.wp.element,n=window.wp.i18n,r=window.wp.components,s=window.wp.serverSideRender;var d=t.n(s);const i=window.wp.blockEditor,c=window.wp.data,w=(e,o)=>{const t=[];if(e&&t.push({value:"",label:(0,n.sprintf)((0,n.__)("Select a %s","easy-digital-downloads"),EDDBlocks.download_label_singular)}),o||"template"===o){let e=(0,n.sprintf)((0,n.__)("Current %s","easy-digital-downloads"),EDDBlocks.download_label_singular);"template"!==o&&(e=wp.data.select("core/editor").getCurrentPostAttribute("title")),t.push({value:o,label:e})}const l=(0,c.useSelect)((e=>{let t={per_page:-1};return o&&(t.exclude=o),e("core").getEntityRecords("postType","download",t)}));return(0,c.useSelect)((e=>e("core/data").isResolving("core","getEntityRecords",["postType","download"])))||l&&l.map((e=>{let{id:o,title:l}=e;t.push({value:o,label:l.raw})})),t};function u(){return u=Object.assign?Object.assign.bind():function(e){for(var o=1;oo=>t({[e]:o}),s=wp.data.select("core/editor").getCurrentPostType();if(!o.download_id&&s&&"download"!==s)return(0,a.createElement)("div",(0,i.useBlockProps)(),(0,a.createElement)(r.Placeholder,{icon:"download",label:(0,n.sprintf)((0,n.__)("Select a %s:","easy-digital-downloads"),EDDBlocks.download_label_singular)},(0,a.createElement)(r.SelectControl,{label:(0,n.sprintf)((0,n.__)("Published %s","easy-digital-downloads"),EDDBlocks.download_label_plural),options:w(!0),onChange:l("download_id")})));let c=!1;return o.download_id||"download"!==s?s||(c="template"):(c=wp.data.select("core/editor").getCurrentPostId(),o.download_id=c),(0,a.createElement)("div",(0,i.useBlockProps)(),(0,a.createElement)(i.InspectorControls,null,(0,a.createElement)(r.PanelBody,{title:(0,n.__)("Settings","easy-digital-downloads")},(0,a.createElement)(r.SelectControl,{label:(0,n.sprintf)((0,n.__)("Select a %s","easy-digital-downloads"),EDDBlocks.download_label_singular),value:o.download_id,options:w(!1,c),onChange:l("download_id")}),(0,a.createElement)(r.ToggleControl,{label:(0,n.__)("Show Price","easy-digital-downloads"),checked:!!o.show_price,onChange:l("show_price")}),!!EDDBlocks.supports_buy_now&&(0,a.createElement)(r.ToggleControl,{label:(0,n.__)("Buy Now","easy-digital-downloads"),checked:!!o.direct,onChange:l("direct"),help:(0,n.__)("Enable Buy Now to process a download order without going through the full checkout.","easy-digital-downloads")}))),(0,a.createElement)(r.Disabled,null,(0,a.createElement)(d(),{block:"edd/buy-button",attributes:{...o}})))}})}},t={};function l(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return o[e](n,n.exports,l),n.exports}l.m=o,e=[],l.O=(o,t,a,n)=>{if(!t){var r=1/0;for(c=0;c=n)&&Object.keys(l.O).every((e=>l.O[e](t[d])))?t.splice(d--,1):(s=!1,n0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[t,a,n]},l.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return l.d(o,{a:o}),o},l.d=(e,o)=>{for(var t in o)l.o(o,t)&&!l.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},l.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={167:0,200:0};l.O.j=o=>0===e[o];var o=(o,t)=>{var a,n,r=t[0],s=t[1],d=t[2],i=0;if(r.some((o=>0!==e[o]))){for(a in s)l.o(s,a)&&(l.m[a]=s[a]);if(d)var c=d(l)}for(o&&o(t);il(557)));a=l.O(a)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/style-index.css deleted file mode 100644 index 5cddf3ad..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/buy-button/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-edd-buy-button .edd-submit{display:table}.wp-block-edd-buy-button .aligncenter,.wp-block-edd-buy-button .alignwide{margin:0 auto}.wp-block-edd-buy-button .alignright{margin:0 0 0 auto}.wp-block-edd-buy-button .alignleft{margin:0 auto 0 0}.wp-block-edd-buy-button .alignwide{width:100%} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/block.json deleted file mode 100644 index a387a03f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/block.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/cart", - "version": "2.0.0", - "title": "EDD Cart", - "category": "easy-digital-downloads", - "icon": "cart", - "description": "Display a mini or full shopping cart outside of checkout for Easy Digital Downloads.", - "keywords": [ - "easy digital downloads", - "edd", - "cart" - ], - "supports": { - "html": false - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "attributes": { - "hide_on_checkout": { - "type": "boolean", - "default": true - }, - "mini": { - "type": "boolean", - "default": true - }, - "link": { - "type": "boolean", - "default": true - }, - "show_quantity": { - "type": "boolean", - "default": true - }, - "show_total": { - "type": "boolean", - "default": true - }, - "hide_empty": { - "type": "boolean", - "default": false - }, - "title": { - "type": "string" - } - }, - "example": { - "attributes": {} - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/index.asset.php deleted file mode 100644 index f3298dfd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => 'cf21706935ed810cf190'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/index.css deleted file mode 100644 index 5a2a9f45..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-edd-cart .description{background-color:#efefef;margin-bottom:1em;padding:1em} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/index.js deleted file mode 100644 index 8bde300d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={25:(e,o,t)=>{const n=window.wp.blocks,r=window.wp.element,l=window.wp.i18n,a=window.wp.components,s=window.wp.serverSideRender;var i=t.n(s);const c=window.wp.blockEditor,d={edd_blocks_is_block_editor:EDDBlocks.current_user},h=JSON.parse('{"u2":"edd/cart","qv":"cart"}'),m={button:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z"})),cart:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})),products:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5a.375.375 0 11-.75 0 .375.375 0 01.75 0zm7.5 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})),"yes-alt":(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})),download:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"edd-blocks__icon-downloads"},(0,r.createElement)("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})),unlock:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})),"editor-table":(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"})),money:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})),id:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5zm6-10.125a1.875 1.875 0 11-3.75 0 1.875 1.875 0 013.75 0zm1.294 6.336a6.721 6.721 0 01-3.17.789 6.721 6.721 0 01-3.168-.789 3.376 3.376 0 016.338 0z"})),category:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})),"admin-links":(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})),money:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 7.756a4.5 4.5 0 100 8.488M7.5 10.5h5.25m-5.25 3h5.25M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))};var w;(0,n.registerBlockType)(h.u2,{icon:(w=h.qv,m[w]),edit:function(e){let{attributes:o,setAttributes:t}=e;const n=e=>o=>t({[e]:o});return(0,r.createElement)("div",(0,c.useBlockProps)(),(0,r.createElement)(c.InspectorControls,null,(0,r.createElement)(a.PanelBody,{title:(0,l.__)("Settings","easy-digital-downloads")},(0,r.createElement)(a.ToggleControl,{label:(0,l.__)("Mini Cart","easy-digital-downloads"),checked:!!o.mini,onChange:n("mini")}),!o.mini&&(0,r.createElement)(a.TextControl,{label:(0,l.__)("Title","easy-digital-downloads"),value:o.title,onChange:n("title")}),(0,r.createElement)(a.ToggleControl,{label:(0,l.__)("Hide When Empty","easy-digital-downloads"),checked:!!o.hide_empty,onChange:n("hide_empty")}),(0,r.createElement)(a.ToggleControl,{label:(0,l.__)("Hide on Checkout","easy-digital-downloads"),checked:!!o.hide_on_checkout,onChange:n("hide_on_checkout")}),o.mini&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.ToggleControl,{label:(0,l.__)("Link Cart to Checkout","easy-digital-downloads"),checked:!!o.link,onChange:n("link")}),(0,r.createElement)(a.ToggleControl,{label:(0,l.__)("Show Number of Items in Cart","easy-digital-downloads"),checked:!!o.show_quantity,onChange:n("show_quantity")}),(0,r.createElement)(a.ToggleControl,{label:(0,l.__)("Show Cart Total","easy-digital-downloads"),checked:!!o.show_total,onChange:n("show_total")})))),(0,r.createElement)(a.Disabled,null,(0,r.createElement)(i(),{block:"edd/cart",attributes:{...o},urlQueryArgs:d})))}})}},t={};function n(e){var r=t[e];if(void 0!==r)return r.exports;var l=t[e]={exports:{}};return o[e](l,l.exports,n),l.exports}n.m=o,e=[],n.O=(o,t,r,l)=>{if(!t){var a=1/0;for(d=0;d=l)&&Object.keys(n.O).every((e=>n.O[e](t[i])))?t.splice(i--,1):(s=!1,l0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[t,r,l]},n.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return n.d(o,{a:o}),o},n.d=(e,o)=>{for(var t in o)n.o(o,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},n.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={16:0,388:0};n.O.j=o=>0===e[o];var o=(o,t)=>{var r,l,a=t[0],s=t[1],i=t[2],c=0;if(a.some((o=>0!==e[o]))){for(r in s)n.o(s,r)&&(n.m[r]=s[r]);if(i)var d=i(n)}for(o&&o(t);cn(25)));r=n.O(r)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/style-index.css deleted file mode 100644 index c067f0f0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/cart/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.edd-blocks-form__cart .edd_cart_remove_item_btn{border:none;margin-left:.5rem;padding:0;text-decoration:none}.edd-blocks-form__cart .edd_cart_remove_item_btn svg{opacity:.6}.edd-blocks-form__cart .edd_cart_remove_item_btn svg:hover{opacity:.9}.edd-blocks-form__cart #edd_checkout_cart{border:1px solid #eee;display:grid}.edd-blocks-form__cart .edd_cart_item_name{display:grid;gap:1rem}.edd-blocks-form__cart .edd_cart_item_name .edd_cart_actions{align-items:center;display:inline-flex;flex-basis:100%;gap:.5rem}.edd-blocks-form__cart .edd_cart_item_name .edd_cart_actions label{margin:0!important}.edd-blocks-form__cart .edd_cart_item_name .edd_cart_actions input.edd-item-quantity{width:3rem!important}.edd-blocks-form__cart .edd_checkout_cart_item_title{align-items:center;display:flex;gap:1rem}.edd-blocks-form__cart .edd_cart_fee_amount,.edd-blocks-form__cart .edd_cart_item_price{align-items:center;display:flex;gap:.5rem}@media(min-width:480px){.edd-blocks-form__cart .edd_cart_fee_amount,.edd-blocks-form__cart .edd_cart_item_price{justify-content:flex-end}}.edd-blocks-form__cart .edd-blocks-cart__row,.edd-blocks-form__cart .edd_cart_footer_row{align-items:center;display:flex;flex-wrap:wrap;gap:1rem;padding:1.5rem}.edd-blocks-form__cart .edd-blocks-cart__row>div:last-of-type:not(:first-of-type),.edd-blocks-form__cart .edd_cart_footer_row>div:last-of-type:not(:first-of-type){flex:1 1 110px}@media(min-width:480px){.edd-blocks-form__cart .edd-blocks-cart__row>div:last-of-type:not(:first-of-type),.edd-blocks-form__cart .edd_cart_footer_row>div:last-of-type:not(:first-of-type){text-align:right}}.edd-blocks-form__cart .edd-blocks-cart__items,.edd-blocks-form__cart .edd-blocks-cart__row-header{border-bottom:1px solid #eee}.edd-blocks-form__cart .edd-blocks-cart__row-header,.edd-blocks-form__cart .edd_cart_total{font-weight:700}.edd-blocks-form__cart .edd-blocks-cart__row-footer{text-align:right}.edd-blocks-form__cart .edd-blocks-cart__row-footer>div:only-child{flex-grow:1}.edd-blocks-form__cart .edd-blocks-cart__action-remove,.edd-blocks-form__cart .edd_discount_remove{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMWVtIiBoZWlnaHQ9IjFlbSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2U9ImN1cnJlbnRDb2xvciIgY2xhc3M9InctNiBoLTYiPgogIDxwYXRoIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTE0Ljc0IDlsLS4zNDYgOW0tNC43ODggMEw5LjI2IDltOS45NjgtMy4yMWMuMzQyLjA1Mi42ODIuMTA3IDEuMDIyLjE2Nm0tMS4wMjItLjE2NUwxOC4xNiAxOS42NzNhMi4yNSAyLjI1IDAgMDEtMi4yNDQgMi4wNzdIOC4wODRhMi4yNSAyLjI1IDAgMDEtMi4yNDQtMi4wNzdMNC43NzIgNS43OW0xNC40NTYgMGE0OC4xMDggNDguMTA4IDAgMDAtMy40NzgtLjM5N20tMTIgLjU2MmMuMzQtLjA1OS42OC0uMTE0IDEuMDIyLS4xNjVtMCAwYTQ4LjExIDQ4LjExIDAgMDEzLjQ3OC0uMzk3bTcuNSAwdi0uOTE2YzAtMS4xOC0uOTEtMi4xNjQtMi4wOS0yLjIwMWE1MS45NjQgNTEuOTY0IDAgMDAtMy4zMiAwYy0xLjE4LjAzNy0yLjA5IDEuMDIyLTIuMDkgMi4yMDF2LjkxNm03LjUgMGE0OC42NjcgNDguNjY3IDAgMDAtNy41IDAiIC8+Cjwvc3ZnPgo=) 50% no-repeat;background-size:1em;box-shadow:none!important;display:block;height:1em;opacity:.6;top:0;width:1em}.edd-blocks-form__cart .edd-blocks-cart__action-remove:hover,.edd-blocks-form__cart .edd_discount_remove:hover{background-position:50%;opacity:1}.edd-blocks-form__cart .edd_cart_item_image img{display:block}.edd-blocks__cart-mini,.edd-blocks__cart-mini a{align-items:center;color:unset;display:flex;gap:.25rem;justify-content:flex-end;text-decoration:none}.edd-blocks__cart-mini a svg,.edd-blocks__cart-mini svg{fill:none;height:1.5rem;width:1.5rem}.wp-block-edd-cart .edd-blocks-cart__row-footer{padding:.5rem 1.5rem} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/block.json deleted file mode 100644 index 06f996bc..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/block.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/checkout", - "version": "2.0.0", - "title": "EDD Checkout", - "category": "easy-digital-downloads", - "icon": "products", - "description": "Full checkout block for Easy Digital Downloads.", - "keywords": [ - "easy digital downloads", - "edd", - "checkout" - ], - "supports": { - "html": false - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "example": { - "attributes": {} - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/index.asset.php deleted file mode 100644 index e75d1063..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => 'a4b81968f6c606c084d6'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/index.css deleted file mode 100644 index bc5959ac..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-edd-checkout input:read-only{background-color:transparent}.wp-block-edd-checkout.block-editor-block-list__block{padding:2rem!important}.wp-block-edd-checkout .description{background-color:#efefef;margin-bottom:1em;padding:1em} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/index.js deleted file mode 100644 index e9c6f06e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={760:(e,o,t)=>{const r=window.wp.blocks,n=window.wp.element,a=window.wp.i18n,s=window.wp.components,l=window.wp.serverSideRender;var c=t.n(l);const i=window.wp.blockEditor,d={edd_blocks_is_block_editor:EDDBlocks.current_user},m=JSON.parse('{"u2":"edd/checkout","qv":"products"}'),w={button:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z"})),cart:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})),products:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5a.375.375 0 11-.75 0 .375.375 0 01.75 0zm7.5 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})),"yes-alt":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})),download:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"edd-blocks__icon-downloads"},(0,n.createElement)("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})),unlock:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})),"editor-table":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"})),money:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})),id:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5zm6-10.125a1.875 1.875 0 11-3.75 0 1.875 1.875 0 013.75 0zm1.294 6.336a6.721 6.721 0 01-3.17.789 6.721 6.721 0 01-3.168-.789 3.376 3.376 0 016.338 0z"})),category:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})),"admin-links":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})),money:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 7.756a4.5 4.5 0 100 8.488M7.5 10.5h5.25m-5.25 3h5.25M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))};var h;(0,r.registerBlockType)(m.u2,{icon:(h=m.qv,w[h]),edit:function(e){let{attributes:o,setAttributes:t}=e;return(0,n.createElement)("div",(0,i.useBlockProps)(),(0,n.createElement)("p",{className:"description"},(0,a.__)("This is an example of a cart with a product in it.","easy-digital-downloads")),(0,n.createElement)(s.Disabled,null,(0,n.createElement)(c(),{block:"edd/checkout",attributes:{...o},urlQueryArgs:d})))}})}},t={};function r(e){var n=t[e];if(void 0!==n)return n.exports;var a=t[e]={exports:{}};return o[e](a,a.exports,r),a.exports}r.m=o,e=[],r.O=(o,t,n,a)=>{if(!t){var s=1/0;for(d=0;d=a)&&Object.keys(r.O).every((e=>r.O[e](t[c])))?t.splice(c--,1):(l=!1,a0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[t,n,a]},r.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return r.d(o,{a:o}),o},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={119:0,718:0};r.O.j=o=>0===e[o];var o=(o,t)=>{var n,a,s=t[0],l=t[1],c=t[2],i=0;if(s.some((o=>0!==e[o]))){for(n in l)r.o(l,n)&&(r.m[n]=l[n]);if(c)var d=c(r)}for(o&&o(t);ir(760)));n=r.O(n)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/style-index.css deleted file mode 100644 index 227a7063..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/checkout/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.edd-blocks-form__cart .edd_cart_remove_item_btn{border:none;margin-left:.5rem;padding:0;text-decoration:none}.edd-blocks-form__cart .edd_cart_remove_item_btn svg{opacity:.6}.edd-blocks-form__cart .edd_cart_remove_item_btn svg:hover{opacity:.9}.edd-blocks-form__cart #edd_checkout_cart{border:1px solid #eee;display:grid}.edd-blocks-form__cart .edd_cart_item_name{display:grid;gap:1rem}.edd-blocks-form__cart .edd_cart_item_name .edd_cart_actions{align-items:center;display:inline-flex;flex-basis:100%;gap:.5rem}.edd-blocks-form__cart .edd_cart_item_name .edd_cart_actions label{margin:0!important}.edd-blocks-form__cart .edd_cart_item_name .edd_cart_actions input.edd-item-quantity{width:3rem!important}.edd-blocks-form__cart .edd_checkout_cart_item_title{align-items:center;display:flex;gap:1rem}.edd-blocks-form__cart .edd_cart_fee_amount,.edd-blocks-form__cart .edd_cart_item_price{align-items:center;display:flex;gap:.5rem}@media(min-width:480px){.edd-blocks-form__cart .edd_cart_fee_amount,.edd-blocks-form__cart .edd_cart_item_price{justify-content:flex-end}}.edd-blocks-form__cart .edd-blocks-cart__row,.edd-blocks-form__cart .edd_cart_footer_row{align-items:center;display:flex;flex-wrap:wrap;gap:1rem;padding:1.5rem}.edd-blocks-form__cart .edd-blocks-cart__row>div:last-of-type:not(:first-of-type),.edd-blocks-form__cart .edd_cart_footer_row>div:last-of-type:not(:first-of-type){flex:1 1 110px}@media(min-width:480px){.edd-blocks-form__cart .edd-blocks-cart__row>div:last-of-type:not(:first-of-type),.edd-blocks-form__cart .edd_cart_footer_row>div:last-of-type:not(:first-of-type){text-align:right}}.edd-blocks-form__cart .edd-blocks-cart__items,.edd-blocks-form__cart .edd-blocks-cart__row-header{border-bottom:1px solid #eee}.edd-blocks-form__cart .edd-blocks-cart__row-header,.edd-blocks-form__cart .edd_cart_total{font-weight:700}.edd-blocks-form__cart .edd-blocks-cart__row-footer{text-align:right}.edd-blocks-form__cart .edd-blocks-cart__row-footer>div:only-child{flex-grow:1}.edd-blocks-form__cart .edd-blocks-cart__action-remove,.edd-blocks-form__cart .edd_discount_remove{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMWVtIiBoZWlnaHQ9IjFlbSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2U9ImN1cnJlbnRDb2xvciIgY2xhc3M9InctNiBoLTYiPgogIDxwYXRoIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTE0Ljc0IDlsLS4zNDYgOW0tNC43ODggMEw5LjI2IDltOS45NjgtMy4yMWMuMzQyLjA1Mi42ODIuMTA3IDEuMDIyLjE2Nm0tMS4wMjItLjE2NUwxOC4xNiAxOS42NzNhMi4yNSAyLjI1IDAgMDEtMi4yNDQgMi4wNzdIOC4wODRhMi4yNSAyLjI1IDAgMDEtMi4yNDQtMi4wNzdMNC43NzIgNS43OW0xNC40NTYgMGE0OC4xMDggNDguMTA4IDAgMDAtMy40NzgtLjM5N20tMTIgLjU2MmMuMzQtLjA1OS42OC0uMTE0IDEuMDIyLS4xNjVtMCAwYTQ4LjExIDQ4LjExIDAgMDEzLjQ3OC0uMzk3bTcuNSAwdi0uOTE2YzAtMS4xOC0uOTEtMi4xNjQtMi4wOS0yLjIwMWE1MS45NjQgNTEuOTY0IDAgMDAtMy4zMiAwYy0xLjE4LjAzNy0yLjA5IDEuMDIyLTIuMDkgMi4yMDF2LjkxNm03LjUgMGE0OC42NjcgNDguNjY3IDAgMDAtNy41IDAiIC8+Cjwvc3ZnPgo=) 50% no-repeat;background-size:1em;box-shadow:none!important;display:block;height:1em;opacity:.6;top:0;width:1em}.edd-blocks-form__cart .edd-blocks-cart__action-remove:hover,.edd-blocks-form__cart .edd_discount_remove:hover{background-position:50%;opacity:1}.edd-blocks-form__cart .edd_cart_item_image img{display:block}.screen-reader-text{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.edd-button-secondary,.edd-submit{transition:all .2s ease-in-out}.edd-button-secondary:active,.edd-button-secondary:hover,.edd-submit:active,.edd-submit:hover{transform:translateY(-1px)}.edd-button-secondary{background-color:var(--edd-blocks-light-grey);border:1px solid #ddd;border-radius:4px;color:unset;margin:0;padding:.5rem 1rem}.edd-button-secondary:disabled{opacity:.6}.wp-block-edd-checkout{display:grid;gap:1rem}.wp-block-edd-checkout #edd_purchase_form .edd-blocks-form{border:1px solid var(--edd-blocks-light-grey);display:grid;gap:1.25rem;padding:2rem}.widget .wp-block-edd-checkout #edd_purchase_form .edd-blocks-form{border:none;padding:0}.wp-block-edd-checkout #edd_purchase_form .edd-blocks-form .edd-blocks-form__group,.wp-block-edd-checkout #edd_purchase_form .edd-blocks-form legend{display:block;margin:0}.wp-block-edd-checkout #edd_purchase_form .edd-blocks-form .edd-blocks-form__group>label{display:block;margin-bottom:.5rem!important}.wp-block-edd-checkout #edd_purchase_form .edd-blocks-form input[type=email],.wp-block-edd-checkout #edd_purchase_form .edd-blocks-form input[type=password],.wp-block-edd-checkout #edd_purchase_form .edd-blocks-form input[type=text],.wp-block-edd-checkout #edd_purchase_form .edd-blocks-form select{box-sizing:border-box;display:block;padding:4px 6px;width:100%}.wp-block-edd-checkout #edd_purchase_form .edd-blocks-form .edd-blocks-form__halves{display:flex!important;gap:1rem;justify-content:space-between}@media(min-width:600px){.wp-block-edd-checkout #edd_purchase_form .edd-blocks-form .edd-blocks-form__halves>*{flex-basis:50%}}.wp-block-edd-checkout #edd_purchase_form p+.edd-blocks-form{margin-top:2rem}.wp-block-edd-checkout #edd_purchase_form .edd-button-secondary,.wp-block-edd-checkout #edd_purchase_form .edd-submit{transition:all .2s ease-in-out}.wp-block-edd-checkout #edd_purchase_form .edd-button-secondary:active,.wp-block-edd-checkout #edd_purchase_form .edd-button-secondary:hover,.wp-block-edd-checkout #edd_purchase_form .edd-submit:active,.wp-block-edd-checkout #edd_purchase_form .edd-submit:hover{transform:translateY(-1px)}.wp-block-edd-checkout #edd_purchase_form .edd-button-secondary{background-color:var(--edd-blocks-light-grey);border:1px solid #ddd;border-radius:4px;color:unset;margin:0;padding:.5rem 1rem}.wp-block-edd-checkout #edd_purchase_form .edd-button-secondary:disabled{opacity:.6}.wp-block-edd-checkout #edd_purchase_form select{padding:4px 6px}.wp-block-edd-checkout .edd-blocks-form__cart,.wp-block-edd-checkout .edd-blocks-form__purchase{border:none;padding:0}.wp-block-edd-checkout #edd_discount_code{background:none;margin:0}.wp-block-edd-checkout #edd_checkout_cart_form #edd-discount-code-wrap,.wp-block-edd-checkout #edd_checkout_cart_form #edd_show_discount{background:transparent;border:none;margin:0;padding:0}.wp-block-edd-checkout #edd-payment-mode-wrap{clear:both;display:flex;flex-wrap:wrap;gap:.5rem}.wp-block-edd-checkout #edd-payment-mode-wrap label.edd-gateway-option{align-items:center;border:1px solid;border-radius:3px;display:flex!important;flex-grow:1;font-size:1rem;gap:.5rem;justify-content:center;margin:0!important;padding:.5rem 1rem;position:relative;text-align:center}.wp-block-edd-checkout #edd-payment-mode-wrap label.edd-gateway-option.edd-gateway-option-selected,.wp-block-edd-checkout #edd-payment-mode-wrap label.edd-gateway-option:hover{background-color:#eee}.wp-block-edd-checkout #edd-payment-mode-wrap label.edd-gateway-option:hover{cursor:pointer;transform:translateY(-1px)}.wp-block-edd-checkout #edd-payment-mode-wrap input{height:1em;margin:0;opacity:0;position:absolute;width:1em}.wp-block-edd-checkout #edd-payment-mode-wrap .edd-payment-icons{align-items:center;display:flex;gap:.25rem;margin:0}.wp-block-edd-checkout #edd-payment-mode-wrap .edd-payment-icons .payment-icon{margin:0;max-height:1rem;width:auto}.wp-block-edd-checkout #edd-payment-mode-wrap .edd-payment-icons .payment-icon.icon-paypal{max-height:1.5rem}.wp-block-edd-checkout .edd-discount-code-field-wrap{align-items:center;display:flex;gap:.5rem}.wp-block-edd-checkout .edd-loading-ajax.edd-loading{display:block;margin:0 auto}#edd_checkout_form_wrap.wp-block-edd-checkout>p{margin-bottom:0}.edd-blocks-form__cart .edd-blocks-cart__discount{text-align:left}.edd-blocks-form__cart #edd_checkout_cart .edd_discount{align-items:center;display:inline-flex;gap:.25rem;margin-left:.5rem}.edd-blocks__checkout-user{margin-bottom:2rem;position:relative}.edd-blocks__checkout-user fieldset.edd-blocks-form{margin-bottom:0!important}.edd-blocks__checkout-forms{display:flex;gap:.5rem;margin-bottom:1rem}.edd-blocks__checkout-forms button{padding:.5rem 1rem}@media(min-width:600px){.edd-blocks__checkout-forms{margin-bottom:0;position:absolute;right:2rem;z-index:99}}.edd-blocks-cart__row-buttons{justify-content:flex-end} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/block.json deleted file mode 100644 index e31a0a3d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/block.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/confirmation", - "version": "2.0.0", - "title": "EDD Confirmation", - "category": "easy-digital-downloads", - "icon": "yes-alt", - "description": "A brief confirmation screen to show to customers immediately after a successful purchase.", - "keywords": [ - "easy digital downloads", - "edd", - "orders" - ], - "supports": { - "html": false - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "attributes": { - "payment_key": { - "type": "boolean", - "default": false - }, - "payment_method": { - "type": "boolean", - "default": true - } - }, - "example": { - "attributes": {} - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/index.asset.php deleted file mode 100644 index 9e8d8a02..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '3ebd3d803f03e6d7cdb8'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/index.css deleted file mode 100644 index 6938d341..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-edd-confirmation .description{background-color:#efefef;margin-bottom:1em;padding:1em} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/index.js deleted file mode 100644 index 1fde02f4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={142:(e,o,t)=>{const r=window.wp.blocks,n=window.wp.element,a=window.wp.i18n,l=window.wp.components,s=window.wp.serverSideRender;var c=t.n(s);const i=window.wp.blockEditor,d=()=>(0,n.createElement)(l.Placeholder,null,(0,n.createElement)("p",null,(0,a.__)("Create at least one order to see an example of a receipt.","easy-digital-downloads"))),m={edd_blocks_is_block_editor:EDDBlocks.current_user},w=JSON.parse('{"u2":"edd/confirmation","qv":"yes-alt"}'),h={button:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z"})),cart:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})),products:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5a.375.375 0 11-.75 0 .375.375 0 01.75 0zm7.5 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})),"yes-alt":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})),download:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"edd-blocks__icon-downloads"},(0,n.createElement)("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})),unlock:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})),"editor-table":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"})),money:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})),id:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5zm6-10.125a1.875 1.875 0 11-3.75 0 1.875 1.875 0 013.75 0zm1.294 6.336a6.721 6.721 0 01-3.17.789 6.721 6.721 0 01-3.168-.789 3.376 3.376 0 016.338 0z"})),category:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})),"admin-links":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})),money:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 7.756a4.5 4.5 0 100 8.488M7.5 10.5h5.25m-5.25 3h5.25M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))};var v;(0,r.registerBlockType)(w.u2,{icon:(v=w.qv,h[v]),edit:function(e){let{attributes:o,setAttributes:t}=e;const r=e=>o=>t({[e]:o});return(0,n.createElement)("div",(0,i.useBlockProps)(),(0,n.createElement)(i.InspectorControls,null,(0,n.createElement)(l.PanelBody,{title:(0,a.__)("Settings","easy-digital-downloads")},(0,n.createElement)(l.ToggleControl,{label:(0,a.__)("Show Payment Key","easy-digital-downloads"),checked:!!o.payment_key,onChange:r("payment_key")}),(0,n.createElement)(l.ToggleControl,{label:(0,a.__)("Show Gateway","easy-digital-downloads"),checked:!!o.payment_method,onChange:r("payment_method")}))),(0,n.createElement)("p",{className:"description"},(0,a.__)("The editor will display a recent random order from your site.","easy-digital-downloads")),(0,n.createElement)(l.Disabled,null,(0,n.createElement)(c(),{block:"edd/confirmation",attributes:{...o},urlQueryArgs:m,EmptyResponsePlaceholder:d})))}})}},t={};function r(e){var n=t[e];if(void 0!==n)return n.exports;var a=t[e]={exports:{}};return o[e](a,a.exports,r),a.exports}r.m=o,e=[],r.O=(o,t,n,a)=>{if(!t){var l=1/0;for(d=0;d=a)&&Object.keys(r.O).every((e=>r.O[e](t[c])))?t.splice(c--,1):(s=!1,a0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[t,n,a]},r.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return r.d(o,{a:o}),o},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={67:0,472:0};r.O.j=o=>0===e[o];var o=(o,t)=>{var n,a,l=t[0],s=t[1],c=t[2],i=0;if(l.some((o=>0!==e[o]))){for(n in s)r.o(s,n)&&(r.m[n]=s[n]);if(c)var d=c(r)}for(o&&o(t);ir(142)));n=r.O(n)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/style-index.css deleted file mode 100644 index 043925ca..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/confirmation/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.edd-blocks__row{align-items:center;display:grid;gap:1rem}.edd-blocks__row-label{font-weight:700}@media(min-width:480px){.edd-blocks__row{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.edd-blocks__row>div:last-of-type:not(:first-of-type){text-align:right}.edd-blocks__row>div:only-child{grid-column:1/span 2}}.edd-blocks-receipt__items,.edd-blocks-receipt__totals{border:1px solid var(--edd-blocks-light-grey);display:grid;margin:0 auto 1.5rem;padding:1rem}.edd-blocks-receipt__row-item{border-bottom:1px solid var(--edd-blocks-light-grey);padding:.5rem 0}.edd-blocks-receipt__row-item:last-child{border-bottom:none!important}.edd-blocks-receipt__row-header{border-bottom:1px solid var(--edd-blocks-light-grey);font-size:1.1rem;font-weight:700;padding-bottom:.5rem} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/block.json deleted file mode 100644 index 9791c680..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/block.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/downloads", - "version": "2.0.0", - "title": "EDD Products", - "category": "easy-digital-downloads", - "icon": "download", - "description": "A block to show your Easy Digital Download products based on visual customizations and query parameters.", - "keywords": [ - "easy digital downloads", - "edd", - "downloads" - ], - "supports": { - "html": false, - "align": [ - "wide", - "full" - ] - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "attributes": { - "image_location": { - "type": "string", - "default": "before_entry_title" - }, - "image_size": { - "type": "string", - "default": "large" - }, - "image_alignment": { - "type": "string", - "default": "center" - }, - "content": { - "type": "string", - "default": "excerpt" - }, - "columns": { - "type": "number", - "default": 3 - }, - "number": { - "type": "number", - "default": 6 - }, - "align": { - "type": "string", - "default": "" - }, - "order": { - "type": "string", - "default": "DESC" - }, - "orderby": { - "type": "string", - "default": "date" - }, - "title": { - "type": "boolean", - "default": true - }, - "purchase_link": { - "type": "boolean", - "default": true - }, - "price": { - "type": "boolean", - "default": true - }, - "category": { - "type": "array", - "default": [ - "" - ] - }, - "tag": { - "type": "array", - "default": [ - "" - ] - }, - "pagination": { - "type": "boolean", - "default": true - }, - "image_link": { - "type": "boolean", - "default": true - }, - "purchase_link_align": { - "type": "string", - "default": "none" - }, - "show_price": { - "type": "boolean", - "default": true - }, - "all_access": { - "type": "boolean", - "default": false - } - }, - "example": { - "attributes": { - "columns": 1, - "number": 2, - "pagination": false - } - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/index.asset.php deleted file mode 100644 index ef8da175..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '21903bcd30e08c89eb77'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/index.css deleted file mode 100644 index e3d595e8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/index.css +++ /dev/null @@ -1 +0,0 @@ -.edd-no-js{display:none!important}svg.edd-blocks__icon{fill:none!important}.editor-styles-wrapper .components-placeholder{align-items:center;background-color:#fefefe;border-radius:5px}.editor-styles-wrapper .components-placeholder__fieldset{justify-content:center}.editor-styles-wrapper .components-placeholder div.edd-downloads--actions{display:flex;gap:2em;justify-content:space-around}.editor-styles-wrapper .components-placeholder div.edd-downloads--actions a.components-button{line-height:1.5;margin-right:0;padding:.5em 1em;text-decoration:none}.editor-styles-wrapper .components-placeholder div.edd-downloads--actions a.components-button.edd-downloads--primary{background-color:var(--wp-admin-theme-color);color:#fff}.editor-styles-wrapper .components-placeholder div.edd-downloads--actions a.components-button.edd-downloads--secondary{background-color:#fff;border:1px solid var(--wp-admin-theme-color);color:var(--wp-admin-theme-color)}.edd-blocks-term-selector select{min-height:60px!important}.edd-blocks-term-selector svg{display:none!important} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/index.js deleted file mode 100644 index 990e1706..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,a={349:(e,a,l)=>{const o=window.wp.blocks,t=window.wp.element,n=window.wp.i18n,s=window.wp.components,d=window.wp.serverSideRender;var r=l.n(d);const i=[{value:"none",label:(0,n.__)("None","easy-digital-downloads")},{value:"center",label:(0,n.__)("Center","easy-digital-downloads")},{value:"left",label:(0,n.__)("Left","easy-digital-downloads")},{value:"right",label:(0,n.__)("Right","easy-digital-downloads")}],c=[{value:"ASC",label:(0,n.__)("Ascending","easy-digital-downloads")},{value:"DESC",label:(0,n.__)("Descending","easy-digital-downloads")}],_=[{value:"thumbnail",label:(0,n.__)("Thumbnail","easy-digital-downloads")},{value:"medium",label:(0,n.__)("Medium","easy-digital-downloads")},{value:"large",label:(0,n.__)("Large","easy-digital-downloads")}],g=window.wp.blockEditor,w=[{value:"",label:(0,n.__)("Default","easy-digital-downloads")},{value:"center",label:(0,n.__)("Center","easy-digital-downloads")},{value:"left",label:(0,n.__)("Left","easy-digital-downloads")},{value:"right",label:(0,n.__)("Right","easy-digital-downloads")},{value:"wide",label:(0,n.__)("Wide","easy-digital-downloads")}],m=[{value:"date",label:(0,n.__)("Date Published","easy-digital-downloads")},{value:"price",label:(0,n.__)("Price","easy-digital-downloads")},{value:"ID",label:(0,n.__)("ID","easy-digital-downloads")},{value:"title",label:(0,n.__)("Title","easy-digital-downloads")},{value:"sales",label:(0,n.__)("Sales","easy-digital-downloads")},{value:"earnings",label:(0,n.__)("Earnings","easy-digital-downloads")},{value:"modified",label:(0,n.__)("Date Modified","easy-digital-downloads")},{value:"rand",label:(0,n.__)("Random","easy-digital-downloads")}],u=window.wp.data,h=(e,a)=>{const l=[{value:"",label:a}],o=(0,u.useSelect)((a=>a("core").getEntityRecords("taxonomy",e,{per_page:-1})));return(0,u.useSelect)((a=>a("core/data").isResolving("core","getEntityRecords",["taxonomy",e])))||o&&o.map((e=>{let{id:a,name:o}=e;l.push({value:a,label:o})})),l},v=[{value:"",label:(0,n.__)("No Content","easy-digital-downloads")},{value:"content",label:(0,n.__)("Full Content","easy-digital-downloads")},{value:"excerpt",label:(0,n.__)("Excerpt","easy-digital-downloads")}],p=[{value:"",label:(0,n.__)("No Image","easy-digital-downloads")},{value:"before_entry_title",label:(0,n.__)("Before Title","easy-digital-downloads")},{value:"after_entry_title",label:(0,n.__)("After Title","easy-digital-downloads")}],b={edd_blocks_is_block_editor:EDDBlocks.current_user};function k(){return k=Object.assign?Object.assign.bind():function(e){for(var a=1;aa=>l({[e]:a}),d=h("download_category",(0,n.__)("All Categories","easy-digital-downloads")),u=h("download_tag",(0,n.__)("All Categories","easy-digital-downloads"));return(0,t.createElement)("div",(0,g.useBlockProps)(),(0,t.createElement)(g.InspectorControls,null,(0,t.createElement)(s.PanelBody,{title:(0,n.__)("Product Block Settings","easy-digital-downloads")},(0,t.createElement)("p",{className:"description"},(0,n.__)("Decide how to display your products.","easy-digital-downloads")),(0,t.createElement)(s.RangeControl,{label:(0,n.__)("Downloads per Page","easy-digital-downloads"),value:a.number,onChange:o("number"),min:1,max:100}),!!EDDBlocks.all_access&&(0,t.createElement)(s.ToggleControl,{label:(0,n.__)("Show All Access Downloads","easy-digital-downloads"),checked:!!a.all_access,onChange:o("all_access")}),(0,t.createElement)(s.RangeControl,{label:(0,n.__)("Number of Columns","easy-digital-downloads"),value:a.columns,onChange:o("columns"),min:1,max:6}),(0,t.createElement)(s.SelectControl,{label:(0,n.__)("Order By","easy-digital-downloads"),value:a.orderby,options:m,onChange:o("orderby")}),(0,t.createElement)(s.SelectControl,{label:(0,n.__)("Order","easy-digital-downloads"),value:a.order,options:c,onChange:o("order")}),"rand"!==a.orderby&&(0,t.createElement)(s.ToggleControl,{label:(0,n.__)("Show Pagination","easy-digital-downloads"),checked:!!a.pagination,onChange:o("pagination")})),!a.all_access&&(0,t.createElement)(s.PanelBody,{title:(0,n.__)("Download Term Settings","easy-digital-downloads"),initialOpen:!1},(0,t.createElement)(s.SelectControl,{multiple:!0,className:"edd-blocks-term-selector",label:(0,n.__)("Show Downloads From Categories","easy-digital-downloads"),value:a.category,options:d,onChange:o("category")}),(0,t.createElement)(s.SelectControl,{multiple:!0,className:"edd-blocks-term-selector",label:(0,n.__)("Show Downloads From Tags","easy-digital-downloads"),value:a.tag,options:u,onChange:o("tag")})),(0,t.createElement)(s.PanelBody,{title:(0,n.__)("Individual Product Settings","easy-digital-downloads"),initialOpen:!1},(0,t.createElement)(s.ToggleControl,{label:(0,n.__)("Show Title","easy-digital-downloads"),checked:!!a.title,onChange:o("title")}),(0,t.createElement)(s.SelectControl,{label:(0,n.__)("Featured Image Location","easy-digital-downloads"),value:a.image_location,options:p,onChange:o("image_location")}),!!a.image_location&&(0,t.createElement)(s.ToggleControl,{label:(0,n.__)("Should the featured image link to the product?","easy-digital-downloads"),checked:!!a.image_link,onChange:o("image_link")}),!!a.image_location&&(0,t.createElement)(s.SelectControl,{label:(0,n.__)("Featured Image Size","easy-digital-downloads"),value:a.image_size,options:_,onChange:o("image_size")}),!!a.image_location&&(0,t.createElement)(s.SelectControl,{label:(0,n.__)("Featured Image Alignment","easy-digital-downloads"),value:a.image_alignment,options:i,onChange:o("image_alignment")}),(0,t.createElement)(s.SelectControl,{label:(0,n.__)("Content","easy-digital-downloads"),value:a.content,options:v,onChange:o("content")}),(0,t.createElement)(s.ToggleControl,{label:(0,n.__)("Show Price","easy-digital-downloads"),checked:!!a.price,onChange:o("price")}),(0,t.createElement)(s.ToggleControl,{label:(0,n.__)("Show Purchase Button","easy-digital-downloads"),checked:!!a.purchase_link,onChange:o("purchase_link")}),!!a.purchase_link&&(0,t.createElement)(t.Fragment,null,(0,t.createElement)(s.SelectControl,{label:(0,n.__)("Purchase Button Alignment","easy-digital-downloads"),value:a.purchase_link_align,options:w,onChange:o("purchase_link_align")}),(0,t.createElement)(s.ToggleControl,{label:(0,n.__)("Show Price on Button","easy-digital-downloads"),checked:!!a.show_price,onChange:o("show_price")})))),(0,t.createElement)(s.Disabled,null,(0,t.createElement)(r(),{block:"edd/downloads",attributes:{...a},urlQueryArgs:b})))}})}},l={};function o(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return a[e](n,n.exports,o),n.exports}o.m=a,e=[],o.O=(a,l,t,n)=>{if(!l){var s=1/0;for(c=0;c=n)&&Object.keys(o.O).every((e=>o.O[e](l[r])))?l.splice(r--,1):(d=!1,n0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[l,t,n]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a}),a},o.d=(e,a)=>{for(var l in a)o.o(a,l)&&!o.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:a[l]})},o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{var e={411:0,342:0};o.O.j=a=>0===e[a];var a=(a,l)=>{var t,n,s=l[0],d=l[1],r=l[2],i=0;if(s.some((a=>0!==e[a]))){for(t in d)o.o(d,t)&&(o.m[t]=d[t]);if(r)var c=r(o)}for(a&&a(l);io(349)));t=o.O(t)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/style-index.css deleted file mode 100644 index dd5f8997..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/downloads/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.edd-blocks__columns{grid-gap:1rem;display:grid}@media(min-width:600px){.edd-blocks__columns{grid-template-columns:repeat(2,50%)}}@media(min-width:960px){.edd-blocks__columns-3{grid-template-columns:repeat(3,1fr)}.edd-blocks__columns-4{grid-template-columns:repeat(4,1fr)}.edd-blocks__columns-5{grid-template-columns:repeat(5,1fr)}.edd-blocks__columns-6{grid-template-columns:repeat(6,1fr)}}.wp-block-edd-downloads .navigation{border:none;display:flex;gap:.5rem;justify-content:center;margin:2rem 0}.wp-block-edd-downloads .page-numbers{border:1px solid;border-radius:3px;padding:.5rem 1rem}.edd-blocks__downloads{display:grid;gap:2rem}.edd-blocks__columns .edd-blocks__download{display:flex;flex-direction:column;padding:1rem}.edd-blocks__columns .edd-blocks__download-content{flex-grow:1}.edd-blocks__download-image-link{border:none;padding:0}.edd-blocks__download-image-link img{display:block;height:auto;max-width:100%}.wp-block-edd-buy-button .edd-submit{display:table}.wp-block-edd-buy-button .aligncenter,.wp-block-edd-buy-button .alignwide{margin:0 auto}.wp-block-edd-buy-button .alignright{margin:0 0 0 auto}.wp-block-edd-buy-button .alignleft{margin:0 auto 0 0}.wp-block-edd-buy-button .alignwide{width:100%} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/block.json deleted file mode 100644 index 48242650..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/block.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/login", - "version": "2.0.0", - "title": "EDD Login Form", - "category": "easy-digital-downloads", - "icon": "unlock", - "description": "Login form for Easy Digital Downloads.", - "keywords": [ - "easy digital downloads", - "edd", - "login" - ], - "supports": { - "html": false - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "attributes": { - "current": { - "type": "boolean", - "default": false - }, - "redirect": { - "type": "string", - "default": "" - } - }, - "example": { - "attributes": {} - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/index.asset.php deleted file mode 100644 index f7f2556f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'edc5631c889b13e0c385'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/index.css deleted file mode 100644 index 26f36f81..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-edd-login input:read-only{background-color:transparent}.wp-block-edd-login.block-editor-block-list__block{padding:2rem!important} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/index.js deleted file mode 100644 index 8e82b8fc..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={26:()=>{const e=window.wp.blocks,o=window.wp.element,t=window.wp.i18n,r=window.wp.components,a=window.wp.blockEditor,l=JSON.parse('{"u2":"edd/login","qv":"unlock"}'),n={button:(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z"})),cart:(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})),products:(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5a.375.375 0 11-.75 0 .375.375 0 01.75 0zm7.5 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})),"yes-alt":(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})),download:(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"edd-blocks__icon-downloads"},(0,o.createElement)("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})),unlock:(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})),"editor-table":(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"})),money:(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})),id:(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5zm6-10.125a1.875 1.875 0 11-3.75 0 1.875 1.875 0 013.75 0zm1.294 6.336a6.721 6.721 0 01-3.17.789 6.721 6.721 0 01-3.168-.789 3.376 3.376 0 016.338 0z"})),category:(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})),"admin-links":(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})),money:(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 7.756a4.5 4.5 0 100 8.488M7.5 10.5h5.25m-5.25 3h5.25M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))};var s;(0,e.registerBlockType)(l.u2,{icon:(s=l.qv,n[s]),edit:function(e){let{attributes:l,setAttributes:n}=e;const s=e=>o=>n({[e]:o});return(0,o.createElement)("div",(0,a.useBlockProps)(),(0,o.createElement)(a.InspectorControls,null,(0,o.createElement)(r.PanelBody,{title:(0,t.__)("Settings","easy-digital-downloads")},(0,o.createElement)("p",{className:"description"},(0,t.__)("Once logged in, where should the user be directed? You can choose the current page, or a custom URL.","easy-digital-downloads")),(0,o.createElement)(r.ToggleControl,{label:(0,t.__)("Redirect to Current Page","easy-digital-downloads"),checked:!!l.current,onChange:s("current")}),!l.current&&(0,o.createElement)(r.TextControl,{label:(0,t.__)("Custom Redirect URL","easy-digital-downloads"),value:l.redirect,onChange:s("redirect")}))),(0,o.createElement)("p",{className:"description"},(0,t.__)("This form is a sample view of your login form. Logged in users will not see it.","easy-digital-downloads")),(0,o.createElement)("form",{className:"edd-blocks-form edd-blocks-form__login"},(0,o.createElement)("div",{className:"edd-blocks-form__group edd-blocks-form__group-username"},(0,o.createElement)("label",{htmlFor:"edd_user_login"},(0,t.__)("Username or Email","easy-digital-downloads")),(0,o.createElement)("div",{className:"edd-blocks-form__control"},(0,o.createElement)("input",{name:"edd_user_login",id:"edd_user_login",className:"edd-required edd-input",type:"text",value:"user_name",readOnly:!0}))),(0,o.createElement)("div",{className:"edd-blocks-form__group edd-blocks-form__group-password"},(0,o.createElement)("label",{htmlFor:"edd_user_pass"},(0,t.__)("Password","easy-digital-downloads")),(0,o.createElement)("div",{className:"edd-blocks-form__control"},(0,o.createElement)("input",{name:"edd_user_pass",id:"edd_user_pass",className:"edd-password edd-required edd-input",type:"password",value:"234324",readOnly:!0}))),(0,o.createElement)("div",{className:"edd-blocks-form__group edd-blocks-form__group-remember"},(0,o.createElement)("div",{className:"edd-blocks-form__control"},(0,o.createElement)(r.Disabled,null,(0,o.createElement)("input",{name:"rememberme",type:"checkbox",id:"rememberme",value:"forever",readOnly:!0}),(0,o.createElement)("label",{htmlFor:"rememberme"},(0,t.__)("Remember Me","easy-digital-downloads"))))),(0,o.createElement)("div",{className:"edd-blocks-form__group edd-blocks-form__group-submit"},(0,o.createElement)(r.Disabled,null,(0,o.createElement)("input",{name:"submit",type:"submit",className:"edd-submit button",label:(0,t.__)("Log In","easy-digital-downloads"),value:(0,t.__)("Log In","easy-digital-downloads")}))),(0,o.createElement)("p",{className:"edd-blocks-form__group edd-blocks-form__group-lost-password"},(0,o.createElement)("a",{href:""},(0,t.__)("Lost Password?","easy-digital-downloads")))))}})}},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var l=t[e]={exports:{}};return o[e](l,l.exports,r),l.exports}r.m=o,e=[],r.O=(o,t,a,l)=>{if(!t){var n=1/0;for(i=0;i=l)&&Object.keys(r.O).every((e=>r.O[e](t[d])))?t.splice(d--,1):(s=!1,l0&&e[i-1][2]>l;i--)e[i]=e[i-1];e[i]=[t,a,l]},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={751:0,710:0};r.O.j=o=>0===e[o];var o=(o,t)=>{var a,l,n=t[0],s=t[1],d=t[2],c=0;if(n.some((o=>0!==e[o]))){for(a in s)r.o(s,a)&&(r.m[a]=s[a]);if(d)var i=d(r)}for(o&&o(t);cr(26)));a=r.O(a)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/style-index.css deleted file mode 100644 index 88abc865..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/login/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.screen-reader-text{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.edd-blocks-form{border:1px solid var(--edd-blocks-light-grey);display:grid;gap:1.25rem;padding:2rem}.widget .edd-blocks-form{border:none;padding:0}.edd-blocks-form .edd-blocks-form__group,.edd-blocks-form legend{display:block;margin:0}.edd-blocks-form .edd-blocks-form__group>label{display:block;margin-bottom:.5rem!important}.edd-blocks-form input[type=email],.edd-blocks-form input[type=password],.edd-blocks-form input[type=text],.edd-blocks-form select{box-sizing:border-box;display:block;padding:4px 6px;width:100%}.edd-blocks-form .edd-blocks-form__halves{display:flex!important;gap:1rem;justify-content:space-between}@media(min-width:600px){.edd-blocks-form .edd-blocks-form__halves>*{flex-basis:50%}}p+.edd-blocks-form{margin-top:2rem}.edd-button-secondary,.edd-submit{transition:all .2s ease-in-out}.edd-button-secondary:active,.edd-button-secondary:hover,.edd-submit:active,.edd-submit:hover{transform:translateY(-1px)}.edd-button-secondary{background-color:var(--edd-blocks-light-grey);border:1px solid #ddd;border-radius:4px;color:unset;margin:0;padding:.5rem 1rem}.edd-button-secondary:disabled{opacity:.6}.wp-block-edd-login #pass-strength-result{background-color:#f0f0f1;border:1px solid #dcdcde;box-sizing:border-box;color:#1d2327;margin:-1px 1px 5px;opacity:0;padding:3px 5px;text-align:center}.wp-block-edd-login #pass-strength-result.short{background-color:#ffabaf;border-color:#e65054;opacity:1}.wp-block-edd-login #pass-strength-result.bad{background-color:#facfd2;border-color:#f86368;opacity:1}.wp-block-edd-login #pass-strength-result.good{background-color:#f5e6ab;border-color:#f0c33c;opacity:1}.wp-block-edd-login #pass-strength-result.strong{background-color:#b8e6bf;border-color:#68de7c;opacity:1}.wp-block-edd-login .wp-pwd.is-open{position:relative}.wp-block-edd-login .button.wp-hide-pw{background:transparent;border:1px solid transparent;box-shadow:none;color:#555;font-size:14px;height:2.5rem;line-height:2;margin:0;min-height:40px;min-width:40px;padding:5px 9px;position:absolute;right:0;top:0;width:2.5rem}.wp-block-edd-login .button.wp-hide-pw .dashicons{display:block}.wp-block-edd-login div.reset-pass-submit{align-items:center;display:flex;justify-content:space-between}.wp-block-edd-login .edd-alert p,.wp-block-edd-login p{margin:0;padding:0} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/block.json deleted file mode 100644 index 5f3953ed..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/block.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/order-history", - "version": "2.0.0", - "title": "EDD Order History", - "category": "easy-digital-downloads", - "icon": "editor-table", - "description": "Display the Easy Digital Downloads order history of a logged in user.", - "keywords": [ - "easy digital downloads", - "edd", - "orders" - ], - "supports": { - "html": false - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "attributes": { - "columns": { - "type": "number", - "default": 2 - }, - "number": { - "type": "number", - "default": 20 - }, - "recurring": { - "type": "boolean", - "default": false - } - }, - "example": { - "attributes": { - "columns": 1, - "number": 2 - } - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/index.asset.php deleted file mode 100644 index f5e4c429..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => 'daec310e0801da6bedd7'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/index.css deleted file mode 100644 index 017a1365..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-edd-order-history.block-editor-block-list__block{padding:2rem!important}.wp-block-edd-order-history .description{background-color:#efefef;margin-bottom:1em;padding:1em} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/index.js deleted file mode 100644 index 49c81288..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={98:(e,o,r)=>{const t=window.wp.blocks,n=window.wp.element,a=window.wp.i18n,l=window.wp.components,s=window.wp.serverSideRender;var i=r.n(s);const c=window.wp.blockEditor,d=JSON.parse('{"u2":"edd/order-history","qv":"editor-table"}'),m={button:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z"})),cart:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})),products:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5a.375.375 0 11-.75 0 .375.375 0 01.75 0zm7.5 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})),"yes-alt":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})),download:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"edd-blocks__icon-downloads"},(0,n.createElement)("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})),unlock:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})),"editor-table":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"})),money:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})),id:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5zm6-10.125a1.875 1.875 0 11-3.75 0 1.875 1.875 0 013.75 0zm1.294 6.336a6.721 6.721 0 01-3.17.789 6.721 6.721 0 01-3.168-.789 3.376 3.376 0 016.338 0z"})),category:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})),"admin-links":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})),money:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 7.756a4.5 4.5 0 100 8.488M7.5 10.5h5.25m-5.25 3h5.25M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))};var w;(0,t.registerBlockType)(d.u2,{icon:(w=d.qv,m[w]),edit:function(e){let{attributes:o,setAttributes:r}=e;const t=e=>o=>r({[e]:o});return(0,n.createElement)("div",(0,c.useBlockProps)(),(0,n.createElement)("p",{className:"description"},(0,a.__)("This is an example of a user's order history.","easy-digital-downloads")),(0,n.createElement)(c.InspectorControls,null,(0,n.createElement)(l.PanelBody,{title:(0,a.__)("Order History Settings","easy-digital-downloads")},(0,n.createElement)(l.RangeControl,{label:(0,a.__)("Columns","easy-digital-downloads"),value:o.columns,onChange:t("columns"),min:1,max:6}),(0,n.createElement)(l.RangeControl,{label:(0,a.__)("Orders per Page","easy-digital-downloads"),value:o.number,onChange:t("number"),min:1,max:100}),!!EDDBlocks.recurring&&(0,n.createElement)(l.ToggleControl,{label:(0,a.__)("Do Not Show Renewal Orders","easy-digital-downloads"),checked:!!o.recurring,onChange:t("recurring")}))),(0,n.createElement)(l.Disabled,null,(0,n.createElement)(i(),{block:"edd/order-history",attributes:{...o}})))}})}},r={};function t(e){var n=r[e];if(void 0!==n)return n.exports;var a=r[e]={exports:{}};return o[e](a,a.exports,t),a.exports}t.m=o,e=[],t.O=(o,r,n,a)=>{if(!r){var l=1/0;for(d=0;d=a)&&Object.keys(t.O).every((e=>t.O[e](r[i])))?r.splice(i--,1):(s=!1,a0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[r,n,a]},t.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},t.d=(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={278:0,840:0};t.O.j=o=>0===e[o];var o=(o,r)=>{var n,a,l=r[0],s=r[1],i=r[2],c=0;if(l.some((o=>0!==e[o]))){for(n in s)t.o(s,n)&&(t.m[n]=s[n]);if(i)var d=i(t)}for(o&&o(r);ct(98)));n=t.O(n)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/style-index.css deleted file mode 100644 index e7225cde..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/order-history/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.edd-blocks__columns{grid-gap:1rem;display:grid}@media(min-width:600px){.edd-blocks__columns{grid-template-columns:repeat(2,50%)}}@media(min-width:960px){.edd-blocks__columns-3{grid-template-columns:repeat(3,1fr)}.edd-blocks__columns-4{grid-template-columns:repeat(4,1fr)}.edd-blocks__columns-5{grid-template-columns:repeat(5,1fr)}.edd-blocks__columns-6{grid-template-columns:repeat(6,1fr)}}.edd-blocks-form{border:1px solid var(--edd-blocks-light-grey);display:grid;gap:1.25rem;padding:2rem}.widget .edd-blocks-form{border:none;padding:0}.edd-blocks-form .edd-blocks-form__group,.edd-blocks-form legend{display:block;margin:0}.edd-blocks-form .edd-blocks-form__group>label{display:block;margin-bottom:.5rem!important}.edd-blocks-form input[type=email],.edd-blocks-form input[type=password],.edd-blocks-form input[type=text],.edd-blocks-form select{box-sizing:border-box;display:block;padding:4px 6px;width:100%}.edd-blocks-form .edd-blocks-form__halves{display:flex!important;gap:1rem;justify-content:space-between}@media(min-width:600px){.edd-blocks-form .edd-blocks-form__halves>*{flex-basis:50%}}p+.edd-blocks-form{margin-top:2rem}.edd-button-secondary,.edd-submit{transition:all .2s ease-in-out}.edd-button-secondary:active,.edd-button-secondary:hover,.edd-submit:active,.edd-submit:hover{transform:translateY(-1px)}.edd-button-secondary{background-color:var(--edd-blocks-light-grey);border:1px solid #ddd;border-radius:4px;color:unset;margin:0;padding:.5rem 1rem}.edd-button-secondary:disabled{opacity:.6}.edd-blocks__orders-grid{display:grid;gap:1rem}.edd-blocks-orders__order{border:1px solid var(--edd-blocks-light-grey);display:flex;flex-direction:column;gap:1rem;padding:1rem}.edd-blocks-orders__order-data,.edd-blocks-orders__order-header{display:flex;flex-wrap:wrap;justify-content:space-between}.edd-blocks-orders__order-header{border-bottom:1px solid var(--edd-blocks-light-grey);padding-bottom:.5rem}.edd-blocks-orders__order-id{font-weight:700}.edd-blocks-orders__order-details{flex-basis:100%} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/block.json deleted file mode 100644 index 2835f77e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/block.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/receipt", - "version": "2.0.0", - "title": "EDD Receipt", - "category": "easy-digital-downloads", - "icon": "money", - "description": "Show customers their detailed receipt. Supports guest orders.", - "keywords": [ - "easy digital downloads", - "edd", - "orders" - ], - "supports": { - "html": false - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "attributes": { - "payment_key": { - "type": "boolean", - "default": false - }, - "payment_method": { - "type": "boolean", - "default": true - } - }, - "example": { - "attributes": {} - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/index.asset.php deleted file mode 100644 index d828eef4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '9c5caff2035d02a7827e'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/index.css deleted file mode 100644 index 1e2c3632..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-edd-receipt .description{background-color:#efefef;margin-bottom:1em;padding:1em} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/index.js deleted file mode 100644 index cf08aa9d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={892:(e,o,t)=>{const r=window.wp.blocks,n=window.wp.element,a=window.wp.i18n,l=window.wp.components,s=window.wp.serverSideRender;var c=t.n(s);const i=window.wp.blockEditor,d=()=>(0,n.createElement)(l.Placeholder,null,(0,n.createElement)("p",null,(0,a.__)("Create at least one order to see an example of a receipt.","easy-digital-downloads"))),m={edd_blocks_is_block_editor:EDDBlocks.current_user},w=JSON.parse('{"u2":"edd/receipt","qv":"money"}'),h={button:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z"})),cart:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})),products:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5a.375.375 0 11-.75 0 .375.375 0 01.75 0zm7.5 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})),"yes-alt":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})),download:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"edd-blocks__icon-downloads"},(0,n.createElement)("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})),unlock:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})),"editor-table":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"})),money:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})),id:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5zm6-10.125a1.875 1.875 0 11-3.75 0 1.875 1.875 0 013.75 0zm1.294 6.336a6.721 6.721 0 01-3.17.789 6.721 6.721 0 01-3.168-.789 3.376 3.376 0 016.338 0z"})),category:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})),"admin-links":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})),money:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 7.756a4.5 4.5 0 100 8.488M7.5 10.5h5.25m-5.25 3h5.25M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))};var v;(0,r.registerBlockType)(w.u2,{icon:(v=w.qv,h[v]),edit:function(e){let{attributes:o,setAttributes:t}=e;const r=e=>o=>t({[e]:o});return(0,n.createElement)("div",(0,i.useBlockProps)(),(0,n.createElement)(i.InspectorControls,null,(0,n.createElement)(l.PanelBody,{title:(0,a.__)("Settings","easy-digital-downloads")},(0,n.createElement)(l.ToggleControl,{label:(0,a.__)("Show Payment Key","easy-digital-downloads"),checked:!!o.payment_key,onChange:r("payment_key")}),(0,n.createElement)(l.ToggleControl,{label:(0,a.__)("Show Gateway","easy-digital-downloads"),checked:!!o.payment_method,onChange:r("payment_method")}))),(0,n.createElement)("p",{className:"description"},(0,a.__)("The editor will display a sample random order from your site.","easy-digital-downloads")),(0,n.createElement)(l.Disabled,null,(0,n.createElement)(c(),{block:"edd/receipt",attributes:{...o},urlQueryArgs:m,EmptyResponsePlaceholder:d})))}})}},t={};function r(e){var n=t[e];if(void 0!==n)return n.exports;var a=t[e]={exports:{}};return o[e](a,a.exports,r),a.exports}r.m=o,e=[],r.O=(o,t,n,a)=>{if(!t){var l=1/0;for(d=0;d=a)&&Object.keys(r.O).every((e=>r.O[e](t[c])))?t.splice(c--,1):(s=!1,a0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[t,n,a]},r.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return r.d(o,{a:o}),o},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={136:0,882:0};r.O.j=o=>0===e[o];var o=(o,t)=>{var n,a,l=t[0],s=t[1],c=t[2],i=0;if(l.some((o=>0!==e[o]))){for(n in s)r.o(s,n)&&(r.m[n]=s[n]);if(c)var d=c(r)}for(o&&o(t);ir(892)));n=r.O(n)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/style-index.css deleted file mode 100644 index 26defe55..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/receipt/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.screen-reader-text{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.edd-blocks__row{align-items:center;display:grid;gap:1rem}.edd-blocks__row-label{font-weight:700}@media(min-width:480px){.edd-blocks__row{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.edd-blocks__row>div:last-of-type:not(:first-of-type){text-align:right}.edd-blocks__row>div:only-child{grid-column:1/span 2}}.edd-blocks-form{border:1px solid var(--edd-blocks-light-grey);display:grid;gap:1.25rem;padding:2rem}.widget .edd-blocks-form{border:none;padding:0}.edd-blocks-form .edd-blocks-form__group,.edd-blocks-form legend{display:block;margin:0}.edd-blocks-form .edd-blocks-form__group>label{display:block;margin-bottom:.5rem!important}.edd-blocks-form input[type=email],.edd-blocks-form input[type=password],.edd-blocks-form input[type=text],.edd-blocks-form select{box-sizing:border-box;display:block;padding:4px 6px;width:100%}.edd-blocks-form .edd-blocks-form__halves{display:flex!important;gap:1rem;justify-content:space-between}@media(min-width:600px){.edd-blocks-form .edd-blocks-form__halves>*{flex-basis:50%}}p+.edd-blocks-form{margin-top:2rem}.edd-button-secondary,.edd-submit{transition:all .2s ease-in-out}.edd-button-secondary:active,.edd-button-secondary:hover,.edd-submit:active,.edd-submit:hover{transform:translateY(-1px)}.edd-button-secondary{background-color:var(--edd-blocks-light-grey);border:1px solid #ddd;border-radius:4px;color:unset;margin:0;padding:.5rem 1rem}.edd-button-secondary:disabled{opacity:.6}.edd-blocks-receipt__items,.edd-blocks-receipt__totals{border:1px solid var(--edd-blocks-light-grey);display:grid;margin:0 auto 1.5rem;padding:1rem}.edd-blocks-receipt__row-item{border-bottom:1px solid var(--edd-blocks-light-grey);padding:.5rem 0}.edd-blocks-receipt__row-item:last-child{border-bottom:none!important}.edd-blocks-receipt__row-header{border-bottom:1px solid var(--edd-blocks-light-grey);font-size:1.1rem;font-weight:700;padding-bottom:.5rem}.edd-blocks-receipt__items .edd-blocks__row{border-bottom:1px solid var(--edd-blocks-light-grey);padding:.5rem 0} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/block.json deleted file mode 100644 index 7d04a12c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/block.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/register", - "version": "2.0.0", - "title": "EDD Registration Form", - "category": "easy-digital-downloads", - "icon": "id", - "description": "Registration form for Easy Digital Downloads.", - "keywords": [ - "easy digital downloads", - "edd", - "registration" - ], - "supports": { - "html": false - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "attributes": { - "current": { - "type": "boolean", - "default": true - }, - "redirect": { - "type": "string", - "default": "" - } - }, - "example": { - "attributes": {} - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/index.asset.php deleted file mode 100644 index 8a7e7d51..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '48f22fda332b4e2cd8f3'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/index.css deleted file mode 100644 index 92f54247..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-edd-register input:read-only{background-color:transparent}.wp-block-edd-register.block-editor-block-list__block{padding:2rem!important} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/index.js deleted file mode 100644 index 4f38d6c2..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,r={883:()=>{const e=window.wp.blocks,r=window.wp.element,t=window.wp.i18n,o=window.wp.components,a=window.wp.blockEditor,s=JSON.parse('{"u2":"edd/register","qv":"id"}'),n={button:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z"})),cart:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})),products:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5a.375.375 0 11-.75 0 .375.375 0 01.75 0zm7.5 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})),"yes-alt":(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})),download:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"edd-blocks__icon-downloads"},(0,r.createElement)("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})),unlock:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})),"editor-table":(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"})),money:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})),id:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5zm6-10.125a1.875 1.875 0 11-3.75 0 1.875 1.875 0 013.75 0zm1.294 6.336a6.721 6.721 0 01-3.17.789 6.721 6.721 0 01-3.168-.789 3.376 3.376 0 016.338 0z"})),category:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})),"admin-links":(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})),money:(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,r.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 7.756a4.5 4.5 0 100 8.488M7.5 10.5h5.25m-5.25 3h5.25M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))};var l;(0,e.registerBlockType)(s.u2,{icon:(l=s.qv,n[l]),edit:function(e){let{attributes:s,setAttributes:n}=e;const l=e=>r=>n({[e]:r});return(0,r.createElement)("div",(0,a.useBlockProps)(),(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(o.PanelBody,{title:(0,t.__)("Settings","easy-digital-downloads")},(0,r.createElement)("p",{className:"description"},(0,t.__)("Once registered, where should the user be directed? You can choose the current page, or a custom URL.","easy-digital-downloads")),(0,r.createElement)(o.ToggleControl,{label:(0,t.__)("Redirect to Current Page","easy-digital-downloads"),checked:!!s.current,onChange:l("current")}),!s.current&&(0,r.createElement)(o.TextControl,{label:(0,t.__)("Custom Redirect URL","easy-digital-downloads"),value:s.redirect,onChange:l("redirect")}))),(0,r.createElement)("p",{className:"description"},(0,t.__)("This form is a sample view of your registration form. Logged in users will not see it.","easy-digital-downloads")),(0,r.createElement)("form",{id:"edd-blocks-form__register",className:"edd-blocks-form edd-blocks-form__register"},(0,r.createElement)("div",{className:"edd-blocks-form__group edd-blocks-form__group-username"},(0,r.createElement)("label",{htmlFor:"edd_user_register"},(0,t.__)("Username or Email","easy-digital-downloads"),(0,r.createElement)("span",{className:"edd-required-indicator"},"*"),(0,r.createElement)("span",{className:"screen-reader-text"},(0,t.__)("Required","easy-digital-downloads"))),(0,r.createElement)("div",{className:"edd-blocks-form__control"},(0,r.createElement)("input",{name:"edd_user_register",id:"edd_user_register",className:"edd-required edd-input",type:"text",readOnly:!0}))),(0,r.createElement)("div",{className:"edd-blocks-form__group edd-blocks-form__group-email"},(0,r.createElement)("label",{htmlFor:"edd-user-email"},(0,t.__)("Email","easy-digital-downloads"),(0,r.createElement)("span",{className:"edd-required-indicator"},"*"),(0,r.createElement)("span",{className:"screen-reader-text"},(0,t.__)("Required","easy-digital-downloads"))),(0,r.createElement)("div",{className:"edd-blocks-form__control"},(0,r.createElement)("input",{name:"edd-user-email",id:"edd_user_login",className:"edd-password edd-required edd-input",type:"email",readOnly:!0}))),(0,r.createElement)("div",{className:"edd-blocks-form__group edd-blocks-form__group-password"},(0,r.createElement)("label",{htmlFor:"edd-user-pass"},(0,t.__)("Password","easy-digital-downloads"),(0,r.createElement)("span",{className:"edd-required-indicator"},"*"),(0,r.createElement)("span",{className:"screen-reader-text"},(0,t.__)("Required","easy-digital-downloads"))),(0,r.createElement)("div",{className:"edd-blocks-form__control"},(0,r.createElement)("input",{id:"edd-user-pass",className:"password required edd-input",type:"password",name:"edd_user_pass",readOnly:!0}))),(0,r.createElement)("div",{className:"edd-blocks-form__group edd-blocks-form__group-password-confirm"},(0,r.createElement)("label",{htmlFor:"edd-user-pass2"},(0,t.__)("Confirm Password","easy-digital-downloads"),(0,r.createElement)("span",{className:"edd-required-indicator"},"*"),(0,r.createElement)("span",{className:"screen-reader-text"},(0,t.__)("Required","easy-digital-downloads"))),(0,r.createElement)("div",{className:"edd-blocks-form__control"},(0,r.createElement)("input",{id:"edd-user-pass2",className:"password required edd-input",type:"password",name:"edd_user_pass2",readOnly:!0}))),(0,r.createElement)("div",{className:"edd-blocks-form__group edd-blocks-form__group-submit"},(0,r.createElement)(o.Disabled,null,(0,r.createElement)("input",{name:"submit",type:"submit",className:"edd-submit button",label:(0,t.__)("Log In","easy-digital-downloads"),value:(0,t.__)("Log In","easy-digital-downloads")})))))}})}},t={};function o(e){var a=t[e];if(void 0!==a)return a.exports;var s=t[e]={exports:{}};return r[e](s,s.exports,o),s.exports}o.m=r,e=[],o.O=(r,t,a,s)=>{if(!t){var n=1/0;for(i=0;i=s)&&Object.keys(o.O).every((e=>o.O[e](t[d])))?t.splice(d--,1):(l=!1,s0&&e[i-1][2]>s;i--)e[i]=e[i-1];e[i]=[t,a,s]},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={889:0,750:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var a,s,n=t[0],l=t[1],d=t[2],c=0;if(n.some((r=>0!==e[r]))){for(a in l)o.o(l,a)&&(o.m[a]=l[a]);if(d)var i=d(o)}for(r&&r(t);co(883)));a=o.O(a)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/style-index.css deleted file mode 100644 index 8c3f7cf0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/register/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.screen-reader-text{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.edd-blocks-form{border:1px solid var(--edd-blocks-light-grey);display:grid;gap:1.25rem;padding:2rem}.widget .edd-blocks-form{border:none;padding:0}.edd-blocks-form .edd-blocks-form__group,.edd-blocks-form legend{display:block;margin:0}.edd-blocks-form .edd-blocks-form__group>label{display:block;margin-bottom:.5rem!important}.edd-blocks-form input[type=email],.edd-blocks-form input[type=password],.edd-blocks-form input[type=text],.edd-blocks-form select{box-sizing:border-box;display:block;padding:4px 6px;width:100%}.edd-blocks-form .edd-blocks-form__halves{display:flex!important;gap:1rem;justify-content:space-between}@media(min-width:600px){.edd-blocks-form .edd-blocks-form__halves>*{flex-basis:50%}}p+.edd-blocks-form{margin-top:2rem}.edd-button-secondary,.edd-submit{transition:all .2s ease-in-out}.edd-button-secondary:active,.edd-button-secondary:hover,.edd-submit:active,.edd-submit:hover{transform:translateY(-1px)}.edd-button-secondary{background-color:var(--edd-blocks-light-grey);border:1px solid #ddd;border-radius:4px;color:unset;margin:0;padding:.5rem 1rem}.edd-button-secondary:disabled{opacity:.6}.wp-block-edd-register .edd-blocks-form__group-password .edd-blocks-form__control{position:relative}.wp-block-edd-register #pass-strength-result{background-color:#f0f0f1;border:1px solid #dcdcde;box-sizing:border-box;color:#1d2327;margin:-1px 1px 5px;opacity:0;padding:3px 5px;text-align:center}.wp-block-edd-register #pass-strength-result.short{background-color:#ffabaf;border-color:#e65054;opacity:1}.wp-block-edd-register #pass-strength-result.bad{background-color:#facfd2;border-color:#f86368;opacity:1}.wp-block-edd-register #pass-strength-result.good{background-color:#f5e6ab;border-color:#f0c33c;opacity:1}.wp-block-edd-register #pass-strength-result.strong{background-color:#b8e6bf;border-color:#68de7c;opacity:1}.wp-block-edd-register .wp-pwd.is-open{position:relative}.wp-block-edd-register .button.wp-hide-pw{background:transparent;border:1px solid transparent;box-shadow:none;color:#555;font-size:14px;height:2.5rem;line-height:2;margin:0;min-height:40px;min-width:40px;padding:5px 9px;position:absolute;right:0;top:0;width:2.5rem}.wp-block-edd-register .button.wp-hide-pw .dashicons{display:block}.wp-block-edd-register div.edd-blocks-form__group-submit{align-items:center;display:flex;justify-content:space-between}.wp-block-edd-register .edd-alert p,.wp-block-edd-register p{margin:0;padding:0} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/block.json deleted file mode 100644 index 7d549e7a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/block.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/terms", - "version": "2.0.0", - "title": "EDD Download Terms", - "category": "easy-digital-downloads", - "icon": "category", - "description": "Show categories, or tags for Easy Digital Download products.", - "keywords": [ - "easy digital downloads", - "edd", - "downloads" - ], - "supports": { - "html": false, - "align": [ - "wide", - "full" - ] - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "attributes": { - "taxonomy": { - "type": "string", - "default": "download_category" - }, - "thumbnails": { - "type": "boolean", - "default": true - }, - "description": { - "type": "boolean", - "default": true - }, - "columns": { - "type": "number", - "default": 3 - }, - "align": { - "type": "string", - "default": "" - }, - "order": { - "type": "string", - "default": "DESC" - }, - "orderby": { - "type": "string", - "default": "count" - }, - "title": { - "type": "boolean", - "default": true - }, - "count": { - "type": "boolean", - "default": true - }, - "show_empty": { - "type": "boolean", - "default": false - }, - "image_size": { - "type": "string", - "default": "large" - }, - "image_alignment": { - "type": "string", - "default": "center" - } - }, - "example": { - "attributes": { - "columns": 1 - } - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/index.asset.php deleted file mode 100644 index 88f244c4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => 'db173b2cb95eaab8c3ff'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/index.css deleted file mode 100644 index 8b137891..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/index.css +++ /dev/null @@ -1 +0,0 @@ - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/index.js deleted file mode 100644 index b2997dbf..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={874:(e,o,a)=>{const l=window.wp.blocks,t=window.wp.element,n=window.wp.i18n,r=window.wp.components,s=window.wp.serverSideRender;var i=a.n(s);const d=window.wp.blockEditor,c=[{value:"none",label:(0,n.__)("None","easy-digital-downloads")},{value:"center",label:(0,n.__)("Center","easy-digital-downloads")},{value:"left",label:(0,n.__)("Left","easy-digital-downloads")},{value:"right",label:(0,n.__)("Right","easy-digital-downloads")}],m=[{value:"ASC",label:(0,n.__)("Ascending","easy-digital-downloads")},{value:"DESC",label:(0,n.__)("Descending","easy-digital-downloads")}],w=[{value:"thumbnail",label:(0,n.__)("Thumbnail","easy-digital-downloads")},{value:"medium",label:(0,n.__)("Medium","easy-digital-downloads")},{value:"large",label:(0,n.__)("Large","easy-digital-downloads")}],g=[{value:"download_category",label:(0,n.sprintf)((0,n.__)("%s Categories","easy-digital-downloads"),EDDBlocks.download_label_singular)},{value:"download_tag",label:(0,n.sprintf)((0,n.__)("%s Tags","easy-digital-downloads"),EDDBlocks.download_label_singular)}],h=JSON.parse('{"u2":"edd/terms","qv":"category"}'),u={button:(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z"})),cart:(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})),products:(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5a.375.375 0 11-.75 0 .375.375 0 01.75 0zm7.5 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})),"yes-alt":(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})),download:(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"edd-blocks__icon-downloads"},(0,t.createElement)("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})),unlock:(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})),"editor-table":(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"})),money:(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})),id:(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5zm6-10.125a1.875 1.875 0 11-3.75 0 1.875 1.875 0 013.75 0zm1.294 6.336a6.721 6.721 0 01-3.17.789 6.721 6.721 0 01-3.168-.789 3.376 3.376 0 016.338 0z"})),category:(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})),"admin-links":(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})),money:(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,t.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 7.756a4.5 4.5 0 100 8.488M7.5 10.5h5.25m-5.25 3h5.25M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))};var v;(0,l.registerBlockType)(h.u2,{icon:(v=h.qv,u[v]),edit:function(e){let{attributes:o,setAttributes:a}=e;const l=e=>o=>a({[e]:o}),s=[{value:"count",label:(0,n.__)("Count","easy-digital-downloads")},{value:"id",label:(0,n.__)("ID","easy-digital-downloads")},{value:"name",label:(0,n.__)("Name","easy-digital-downloads")},{value:"slug",label:(0,n.__)("Slug","easy-digital-downloads")}];return(0,t.createElement)("div",(0,d.useBlockProps)(),(0,t.createElement)(d.InspectorControls,null,(0,t.createElement)(r.PanelBody,{title:(0,n.__)("Term Block Settings","easy-digital-downloads")},(0,t.createElement)(r.SelectControl,{label:(0,n.__)("Select Taxonomy","easy-digital-downloads"),value:o.taxonomy,options:g,onChange:l("taxonomy")}),(0,t.createElement)(r.SelectControl,{label:(0,n.__)("Order By","easy-digital-downloads"),value:o.orderby,options:s,onChange:l("orderby")}),(0,t.createElement)(r.SelectControl,{label:(0,n.__)("Order","easy-digital-downloads"),value:o.order,options:m,onChange:l("order")}),(0,t.createElement)(r.RangeControl,{label:(0,n.__)("Number of Columns","easy-digital-downloads"),value:o.columns,onChange:l("columns"),min:1,max:6}),(0,t.createElement)(r.ToggleControl,{label:(0,n.__)("Show Empty Categories","easy-digital-downloads"),checked:!!o.show_empty,onChange:l("show_empty")})),(0,t.createElement)(r.PanelBody,{title:(0,n.__)("Individual Term Settings","easy-digital-downloads"),initialOpen:!1},(0,t.createElement)(r.ToggleControl,{label:(0,n.__)("Show Title","easy-digital-downloads"),checked:!!o.title,onChange:l("title")}),(0,t.createElement)(r.ToggleControl,{label:(0,n.__)("Show Thumbnails","easy-digital-downloads"),checked:!!o.thumbnails,onChange:l("thumbnails")}),!!o.thumbnails&&(0,t.createElement)(r.SelectControl,{label:(0,n.__)("Image Size","easy-digital-downloads"),value:o.image_size,options:w,onChange:l("image_size")}),!!o.thumbnails&&(0,t.createElement)(r.SelectControl,{label:(0,n.__)("Image Alignment","easy-digital-downloads"),value:o.image_alignment,options:c,onChange:l("image_alignment")}),(0,t.createElement)(r.ToggleControl,{label:(0,n.__)("Show Description","easy-digital-downloads"),checked:!!o.description,onChange:l("description")}),(0,t.createElement)(r.ToggleControl,{label:(0,n.__)("Show Count","easy-digital-downloads"),checked:!!o.count,onChange:l("count")}))),(0,t.createElement)(r.Disabled,null,(0,t.createElement)(i(),{block:"edd/terms",attributes:{...o}})))}})}},a={};function l(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return o[e](n,n.exports,l),n.exports}l.m=o,e=[],l.O=(o,a,t,n)=>{if(!a){var r=1/0;for(c=0;c=n)&&Object.keys(l.O).every((e=>l.O[e](a[i])))?a.splice(i--,1):(s=!1,n0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[a,t,n]},l.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return l.d(o,{a:o}),o},l.d=(e,o)=>{for(var a in o)l.o(o,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:o[a]})},l.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={996:0,699:0};l.O.j=o=>0===e[o];var o=(o,a)=>{var t,n,r=a[0],s=a[1],i=a[2],d=0;if(r.some((o=>0!==e[o]))){for(t in s)l.o(s,t)&&(l.m[t]=s[t]);if(i)var c=i(l)}for(o&&o(a);dl(874)));t=l.O(t)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/style-index.css deleted file mode 100644 index ba241a3d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/terms/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.edd-blocks__columns{grid-gap:1rem;display:grid}@media(min-width:600px){.edd-blocks__columns{grid-template-columns:repeat(2,50%)}}@media(min-width:960px){.edd-blocks__columns-3{grid-template-columns:repeat(3,1fr)}.edd-blocks__columns-4{grid-template-columns:repeat(4,1fr)}.edd-blocks__columns-5{grid-template-columns:repeat(5,1fr)}.edd-blocks__columns-6{grid-template-columns:repeat(6,1fr)}}.wp-block-edd-terms{grid-gap:1rem;display:grid}.wp-block-edd-terms img{display:block;height:auto;max-width:100%}.edd-blocks__term-title{align-items:center;display:flex;gap:.5rem} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/block.json b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/block.json deleted file mode 100644 index c07e30f4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/block.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 2, - "name": "edd/user-downloads", - "version": "2.0.0", - "title": "EDD User Downloads", - "category": "easy-digital-downloads", - "icon": "admin-links", - "description": "Allows a user to access the Easy Digital Downloads products they have purchased.", - "keywords": [ - "easy digital downloads", - "edd", - "orders" - ], - "supports": { - "html": false - }, - "textdomain": "easy-digital-downloads", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "attributes": { - "search": { - "type": "boolean", - "default": false - }, - "variations": { - "type": "boolean", - "default": true - }, - "nofiles": { - "type": "string", - "default": "No downloadable files found." - }, - "hide_empty": { - "type": "boolean", - "default": true - } - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/index.asset.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/index.asset.php deleted file mode 100644 index 4667f6b0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '323ff8718132587855ee'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/index.css deleted file mode 100644 index 71f9d87a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-edd-user-downloads.block-editor-block-list__block{padding:2rem!important}.wp-block-edd-user-downloads .description{background-color:#efefef;margin-bottom:1em;padding:1em}.wp-block-edd-user-downloads .warning{border:1px solid #ddd;border-left:4px solid #f0b849;margin-bottom:1em;padding:1em} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/index.js b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/index.js deleted file mode 100644 index 0a0435ad..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={939:(e,o,t)=>{const a=window.wp.blocks,n=window.wp.element,r=window.wp.i18n,l=window.wp.components,s=window.wp.serverSideRender;var i=t.n(s);const d=window.wp.blockEditor,c={edd_blocks_is_block_editor:EDDBlocks.current_user},h=JSON.parse('{"u2":"edd/user-downloads","qv":"admin-links"}'),w={button:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z"})),cart:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})),products:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5a.375.375 0 11-.75 0 .375.375 0 01.75 0zm7.5 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})),"yes-alt":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})),download:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"edd-blocks__icon-downloads"},(0,n.createElement)("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 01.75.75v11.69l3.22-3.22a.75.75 0 111.06 1.06l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 111.06-1.06l3.22 3.22V3a.75.75 0 01.75-.75zm-9 13.5a.75.75 0 01.75.75v2.25a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5V16.5a.75.75 0 011.5 0v2.25a3 3 0 01-3 3H5.25a3 3 0 01-3-3V16.5a.75.75 0 01.75-.75z",clipRule:"evenodd"})),unlock:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})),"editor-table":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"})),money:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 00-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 01-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 003 15h-.75M15 10.5a3 3 0 11-6 0 3 3 0 016 0zm3 0h.008v.008H18V10.5zm-12 0h.008v.008H6V10.5z"})),id:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5zm6-10.125a1.875 1.875 0 11-3.75 0 1.875 1.875 0 013.75 0zm1.294 6.336a6.721 6.721 0 01-3.17.789 6.721 6.721 0 01-3.168-.789 3.376 3.376 0 016.338 0z"})),category:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})),"admin-links":(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"})),money:(0,n.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"edd-blocks__icon"},(0,n.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 7.756a4.5 4.5 0 100 8.488M7.5 10.5h5.25m-5.25 3h5.25M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))};var m;(0,a.registerBlockType)(h.u2,{icon:(m=h.qv,w[m]),edit:function(e){let{attributes:o,setAttributes:t}=e;const a=e=>o=>t({[e]:o});return(0,n.createElement)("div",(0,d.useBlockProps)(),(0,n.createElement)("p",{className:"description"},(0,r.__)("This is an example of a user's available downloads.","easy-digital-downloads")),EDDBlocks.no_redownload&&(0,n.createElement)("p",{className:"warning"},(0,r.__)('Your store has disabled redownloading files, so your users will not be able to access their files from this block. You can change the "Disable Redownload" setting by visiting Downloads > Settings > Misc > File Downloads.',"easy-digital-downloads")),(0,n.createElement)(d.InspectorControls,null,(0,n.createElement)(l.PanelBody,{title:(0,r.__)("User Download Settings","easy-digital-downloads")},EDDBlocks.is_pro&&(0,n.createElement)(l.ToggleControl,{label:(0,r.__)("Show a Search Form","easy-digital-downloads"),checked:!!o.search,onChange:a("search")}),!EDDBlocks.is_pro&&(0,n.createElement)(l.ToggleControl,{label:(0,r.__)("Show a Search Form","easy-digital-downloads"),checked:"",disabled:"true",help:(0,r.__)("This feature is available in EDD (Pro).","easy-digital-downloads")}),(0,n.createElement)(l.ToggleControl,{label:(0,r.__)("Show Product Variations","easy-digital-downloads"),checked:!!o.variations,onChange:a("variations"),help:(0,r.__)("If your product variations all use the same deliverable files, you may want to disable this.","easy-digital-downloads")}),(0,n.createElement)(l.ToggleControl,{label:(0,r.__)("Hide Products With No Files","easy-digital-downloads"),checked:!!o.hide_empty,onChange:a("hide_empty")}),!o.hide_empty&&(0,n.createElement)(l.TextControl,{label:(0,r.__)("Text to show if there are no files","easy-digital-downloads"),value:o.nofiles,onChange:a("nofiles")}))),(0,n.createElement)(l.Disabled,null,(0,n.createElement)(i(),{block:"edd/user-downloads",attributes:{...o},urlQueryArgs:c})))}})}},t={};function a(e){var n=t[e];if(void 0!==n)return n.exports;var r=t[e]={exports:{}};return o[e](r,r.exports,a),r.exports}a.m=o,e=[],a.O=(o,t,n,r)=>{if(!t){var l=1/0;for(c=0;c=r)&&Object.keys(a.O).every((e=>a.O[e](t[i])))?t.splice(i--,1):(s=!1,r0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[t,n,r]},a.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return a.d(o,{a:o}),o},a.d=(e,o)=>{for(var t in o)a.o(o,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},a.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={187:0,35:0};a.O.j=o=>0===e[o];var o=(o,t)=>{var n,r,l=t[0],s=t[1],i=t[2],d=0;if(l.some((o=>0!==e[o]))){for(n in s)a.o(s,n)&&(a.m[n]=s[n]);if(i)var c=i(a)}for(o&&o(t);da(939)));n=a.O(n)})(); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/style-index.css b/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/style-index.css deleted file mode 100644 index 073b77ca..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/build/user-downloads/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.screen-reader-text{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.edd-pro-search__control{display:flex;justify-content:flex-end;margin-bottom:2em}.edd-pro-search__control input{max-width:100%;width:300px}.edd-pro-search__hidden{display:none!important}.edd-blocks__row{align-items:center;display:grid;gap:1rem}.edd-blocks__row-label{font-weight:700}@media(min-width:480px){.edd-blocks__row{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.edd-blocks__row>div:last-of-type:not(:first-of-type){text-align:right}.edd-blocks__row>div:only-child{grid-column:1/span 2}}div.edd-blocks__user-downloads{border:1px solid var(--edd-blocks-light-grey);padding:1rem}div.edd-blocks__user-downloads .edd-blocks__row-column{text-align:left}.edd-order-item__product,.edd-order-items__header{border-bottom:1px solid var(--edd-blocks-light-grey);gap:1em;padding:.5em 0}.edd-order-item__product:last-child,.edd-order-items__header:last-child{border-bottom:none;padding-bottom:0}.edd-order-items__header{padding-top:0} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/edd-blocks.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/edd-blocks.php deleted file mode 100644 index f2f4634c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/edd-blocks.php +++ /dev/null @@ -1,103 +0,0 @@ - __( 'Confirmation', 'easy-digital-downloads' ), - 'post_content' => '

    ' . __( 'Thank you for your purchase!', 'easy-digital-downloads' ) . '

    ', - ); - $pages['success_page'] = array( - 'post_title' => __( 'Receipt', 'easy-digital-downloads' ), - 'post_content' => '', - ); - $pages['purchase_history_page'] = array( - 'post_title' => __( 'Order History', 'easy-digital-downloads' ), - 'post_content' => '', - ); - $pages['purchase_page']['post_content'] = ''; - - return $pages; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/functions.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/functions.php deleted file mode 100644 index 9d5be510..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/functions.php +++ /dev/null @@ -1,66 +0,0 @@ -ID ) { - $post_states['edd_login_page'] = __( 'Login Page', 'easy-digital-downloads' ); - } - - if ( intval( edd_get_option( 'purchase_history_page' ) ) === $post->ID ) { - $post_states['edd_purchase_history_page'] = __( 'Order History Page', 'easy-digital-downloads' ); - } - - if ( intval( edd_get_option( 'success_page' ) ) === $post->ID ) { - $post_states['edd_success_page'] = __( 'Receipt Page', 'easy-digital-downloads' ); - } - - if ( intval( edd_get_option( 'confirmation_page' ) ) === $post->ID ) { - $post_states['edd_confirmation_page'] = __( 'Confirmation Page', 'easy-digital-downloads' ); - } - - return $post_states; -} - -add_filter( 'widget_types_to_hide_from_legacy_widget_block', __NAMESPACE__ . '\remove_legacy_widgets' ); -/** - * Removes legacy widgets if they're not being used on the site and have block equivalents. - * - * @since 2.0 - * @param array $widget_types - * @return array - */ -function remove_legacy_widgets( $widget_types ) { - $legacy_widgets = array( - 'edd_cart_widget', - 'edd_categories_tags_widget', - ); - - foreach ( $legacy_widgets as $widget ) { - if ( ! is_active_widget( false, false, $widget ) ) { - $widget_types[] = $widget; - } - } - - return $widget_types; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/notices.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/notices.php deleted file mode 100644 index bb2b8bdc..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/notices.php +++ /dev/null @@ -1,32 +0,0 @@ - -
    -

    -

    -
    - 'recaptcha', - 'name' => __( 'reCAPTCHA v3', 'easy-digital-downloads' ), - 'desc' => sprintf( - /* translators: 1. opening anchor tag; 2. closing anchor tag */ - __( '%1$sRegister with Google%2$s to get reCAPTCHA v3 keys. Setting the keys here will enable reCAPTCHA on your registration block and when a user requests a password reset using the login block.', 'easy-digital-downloads' ), - '', - '' - ), - 'type' => 'descriptive_text', - ); - - $settings['main']['recaptcha_site_key'] = array( - 'id' => 'recaptcha_site_key', - 'name' => __( 'reCAPTCHA Site Key', 'easy-digital-downloads' ), - 'type' => 'text', - 'std' => '', - ); - - $settings['main']['recaptcha_secret_key'] = array( - 'id' => 'recaptcha_secret_key', - 'name' => __( 'reCAPTCHA Secret Key', 'easy-digital-downloads' ), - 'type' => 'password', - 'std' => '', - ); - - return $settings; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/scripts.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/scripts.php deleted file mode 100644 index 4766f94c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/scripts.php +++ /dev/null @@ -1,79 +0,0 @@ - 'download', - 'posts_per_page' => 1, - 'no_found_rows' => true, - ); - - $published_downloads = new \WP_Query( - array_merge( - $download_query_args, - array( - 'post_status' => array( 'publish' ), - ) - ) - ); - - $draft_downloads = new \WP_Query( - array_merge( - $download_query_args, - array( - 'post_status' => array( 'draft' ), - ) - ) - ); - - wp_localize_script( - 'wp-block-editor', - 'EDDBlocks', - array( - 'current_user' => md5( $user->user_email ), - 'all_access' => function_exists( 'edd_all_access' ), - 'recurring' => function_exists( 'EDD_Recurring' ), - 'is_pro' => edd_is_pro(), - 'no_redownload' => edd_no_redownload(), - 'supports_buy_now' => edd_shop_supports_buy_now(), - 'has_published_downloads' => $published_downloads->have_posts(), - 'has_draft_downloads' => $draft_downloads->have_posts(), - 'new_download_link' => add_query_arg( 'post_type', 'download', admin_url( 'post-new.php' ) ), - 'view_downloads_link' => add_query_arg( 'post_type', 'download', admin_url( 'edit.php' ) ), - 'download_label_singular' => edd_get_label_singular(), - 'download_label_plural' => edd_get_label_plural(), - ) - ); -} - -/** - * Makes sure the payment icons show on the checkout block in the editor. - * - * @since 2.0 - */ -add_action( 'admin_print_footer_scripts', '\edd_print_payment_icons_on_checkout' ); - -add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\add_edd_styles_block_editor' ); -/** - * If the EDD styles are registered, load them for the block editor. - * - * @since 2.0 - * @return void - */ -function add_edd_styles_block_editor() { - if ( wp_style_is( 'edd-styles', 'registered' ) ) { - wp_enqueue_style( 'edd-styles' ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/settings.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/settings.php deleted file mode 100644 index dd9f3f10..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/admin/settings.php +++ /dev/null @@ -1,199 +0,0 @@ -'; - $login_description .= sprintf( - /* translators: 1. opening code tag, do not translate; 2. closing code tag, do not translate. */ - __( 'Do not use this with the %1$s[edd_login]%2$s shortcode; it does not support resetting passwords.', 'easy-digital-downloads' ), - '', - '' - ); - - // Login page. - $login_page = array( - array( - 'id' => 'login_page', - 'name' => __( 'Login Page', 'easy-digital-downloads' ), - 'desc' => $login_description, - 'type' => 'select', - 'options' => $pages, - 'chosen' => true, - 'placeholder' => __( 'Select a page', 'easy-digital-downloads' ), - ), - ); - array_splice( $settings['pages'], -1, 0, $login_page ); - - if ( ! empty( $settings['pages']['purchase_page']['desc'] ) ) { - $description = __( 'This is the checkout page where customers will complete their purchases.', 'easy-digital-downloads' ); - $description .= '
    '; - $description .= sprintf( - /* translators: 1. opening code tag, do not translate; 2. closing code tag, do not translate. */ - __( 'The Checkout block or %1$s[download_checkout]%2$s shortcode must be on this page.', 'easy-digital-downloads' ), - '', - '' - ); - - $settings['pages']['purchase_page']['desc'] = $description; - } - - // Update the login redirect description. - if ( ! empty( $settings['pages']['login_redirect_page']['desc'] ) ) { - $description = sprintf( - /* translators: 1. opening code tag, do not translate; 2. closing code tag, do not translate. */ - __( 'If a customer logs in using the EDD Login block or %1$s[edd_login]%2$s shortcode, will be redirected to this page.', 'easy-digital-downloads' ), - '', - '' - ); - $description .= '
    '; - $description .= __( 'This can be overridden in the block settings or shortcode parameters.', 'easy-digital-downloads' ); - - $settings['pages']['login_redirect_page']['desc'] = $description; - } - - // Update the purchase history page setting name/description. - if ( ! empty( $settings['pages']['purchase_history_page']['desc'] ) ) { - $description = __( 'This page shows a complete order history for the current user, including download links.', 'easy-digital-downloads' ); - $description .= '
    '; - $description .= sprintf( - /* translators: 1. opening code tag, do not translate; 2. closing code tag, do not translate. */ - __( 'Either the EDD Order History block or the %1$s[purchase_history]%2$s shortcode must be on this page.', 'easy-digital-downloads' ), - '', - '' - ); - - $settings['pages']['purchase_history_page']['desc'] = $description; - $settings['pages']['purchase_history_page']['name'] = __( 'Order History Page', 'easy-digital-downloads' ); - } - - $confirmation_description = __( 'This page must include the EDD Confirmation block.', 'easy-digital-downloads' ); - $confirmation_description .= '
    '; - $confirmation_description .= __( 'Use this page separately from your receipt page to ensure proper conversion tracking.', 'easy-digital-downloads' ); - $confirmation_page = array( - 'confirmation_page' => array( - 'id' => 'confirmation_page', - 'name' => __( 'Confirmation Page', 'easy-digital-downloads' ), - 'desc' => $confirmation_description, - 'type' => 'select', - 'options' => $pages, - 'chosen' => true, - 'placeholder' => __( 'Select a page', 'easy-digital-downloads' ), - ), - ); - - // Insert the confirmation page after checkout and before the receipt. - array_splice( $settings['pages'], 2, 0, $confirmation_page ); - - if ( ! empty( $settings['pages']['success_page']['desc'] ) ) { - $receipt_description = __( 'This is the page to show a detailed receipt for an order.', 'easy-digital-downloads' ); - $receipt_description .= '
    '; - $receipt_description .= sprintf( - /* translators: 1. opening code tag, do not translate; 2. closing code tag, do not translate. */ - __( 'Use the EDD Receipt block or the %1$s[edd_receipt]%2$s shortcode to work with the confirmation page.', 'easy-digital-downloads' ), - '', - '' - ); - - $settings['pages']['success_page']['desc'] = $receipt_description; - $settings['pages']['success_page']['name'] = __( 'Receipt Page', 'easy-digital-downloads' ); - } - - return $settings; -} - -add_filter( 'edd_settings_misc', __NAMESPACE__ . '\button_color' ); -/** - * Adds the EDD block button color setting to the miscellaneous section. - * - * @since 2.0 - * @param array $settings - * @return array - */ -function button_color( $settings ) { - $color_settings = array( - 'button_colors' => array( - 'id' => 'blocks_button_colors', - 'name' => __( 'Default Button Colors', 'easy-digital-downloads' ), - 'type' => 'hook', - ), - ); - array_splice( $settings['button_text'], 1, 0, $color_settings ); - - $new_colors = edd_get_option( 'button_colors' ); - if ( ! empty( $new_colors['background'] ) ) { - unset( $settings['button_text']['checkout_color'] ); - } - - return $settings; -} - -add_action( 'edd_blocks_button_colors', __NAMESPACE__ . '\button_colors' ); -/** - * Renders the settings field for the button colors. - * - * @since 2.0 - * @param array $args - * @return void - */ -function button_colors( $args ) { - $colors = edd_get_option( 'button_colors' ); - $settings = array( - 'background' => __( 'Background', 'easy-digital-downloads' ), - 'text' => __( 'Text', 'easy-digital-downloads' ), - ); - - echo '
    '; - foreach ( $settings as $setting => $label ) { - $color_value = ! empty( $colors[ $setting ] ) ? $colors[ $setting ] : ''; - ?> -
    - - -
    - '; -} - -add_filter( 'edd_settings_misc', __NAMESPACE__ . '\disable_redownload' ); -/** - * Update the text for the `disable_redownload` setting. - * - * @since 2.0.4 - * @param array $settings - * @return array - */ -function disable_redownload( $settings ) { - if ( ! empty( $settings['file_downloads']['disable_redownload']['desc'] ) ) { - $settings['file_downloads']['disable_redownload']['desc'] = __( 'Do not allow users to redownload items from their order history.', 'easy-digital-downloads' ); - } - - return $settings; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/ajax.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/ajax.php deleted file mode 100644 index 9c28bac3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/ajax.php +++ /dev/null @@ -1,51 +0,0 @@ -' . esc_html( __( 'Your cart is empty.', 'easy-digital-downloads' ) ) . '

    '; - } else { - $is_cart_widget = true; - ob_start(); - include EDD_BLOCKS_DIR . 'views/checkout/cart/cart.php'; - - $response['block_cart'] = ob_get_clean(); - } - - $response['quantity_formatted'] = \EDD\Blocks\Checkout\Functions\get_quantity_string(); - - return $response; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/checkout.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/checkout.php deleted file mode 100644 index ca2ad047..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/checkout.php +++ /dev/null @@ -1,392 +0,0 @@ - array( - 'render_callback' => __NAMESPACE__ . '\cart', - 'view_script' => 'edd-blocks-cart', - ), - 'checkout' => array( - 'render_callback' => __NAMESPACE__ . '\checkout', - ), - ); - - foreach ( $blocks as $block => $args ) { - register_block_type( EDD_BLOCKS_DIR . 'build/' . $block, $args ); - } -} - -/** - * Renders the cart. - * - * @since 2.0 - * @param array $block_attributes The block attributes. - * @return string Cart HTML. - */ -function cart( $block_attributes = array() ) { - - $block_attributes = wp_parse_args( - $block_attributes, - array( - 'hide_on_checkout' => true, - 'mini' => true, - 'show_quantity' => true, - 'show_total' => true, - 'link' => true, - 'hide_empty' => false, - 'title' => '', - ) - ); - if ( edd_is_checkout() && $block_attributes['hide_on_checkout'] ) { - return ''; - } - - wp_enqueue_script( 'edd-blocks-cart' ); - - $classes = Helpers\get_block_classes( - $block_attributes, - array( - 'wp-block-edd-cart', - 'edd-blocks__cart', - ) - ); - if ( ! empty( $block_attributes['mini'] ) ) { - $classes[] = 'edd-blocks__cart-mini'; - } else { - $classes[] = 'edd-blocks__cart-full'; - } - - ob_start(); - ?> -
    - -
    - -

    - -

    - - - edd_get_option( 'show_register_form' ), - ) - ); - - $classes = Helpers\get_block_classes( - $block_attributes, - array( - 'wp-block-edd-checkout', - 'edd-blocks__checkout', - ) - ); - - $cart_items = get_cart_contents(); - - if ( ! $cart_items && ! edd_cart_has_fees() ) { - return '

    ' . esc_html( __( 'Your cart is empty.', 'easy-digital-downloads' ) ) . '

    '; - } - - if ( edd_item_quantities_enabled() ) { - add_action( 'edd_cart_footer_buttons', 'edd_update_cart_button' ); - } - - // Check if the Save Cart button should be shown. - if ( ! edd_is_cart_saving_disabled() ) { - add_action( 'edd_cart_footer_buttons', 'edd_save_cart_button' ); - } - - ob_start(); - ?> -
    - -
    - 'download', - 'fields' => 'ids', - 'posts_per_page' => 10, - 'no_found_rows' => true, - ) - ); - if ( empty( $downloads->posts ) ) { - return false; - } - $download_id = array_rand( array_flip( $downloads->posts ) ); - $download = edd_get_download( $download_id ); - $price_id = null; - if ( $download->has_variable_prices() ) { - $price_ids = $download->get_prices(); - $price_ids = wp_list_pluck( $price_ids, 'index' ); - $price_id = array_rand( array_flip( $price_ids ) ); - } - - return array( - array( - 'id' => $download_id, - 'options' => array( - 'price_id' => $price_id, - ), - 'quantity' => 1, - ), - ); -} - -add_action( 'edd_purchase_form_top', __NAMESPACE__ . '\remove_default_purchase_fields' ); -/** - * Remove some of the default EDD fields from the purchase form. - * Loaded in this hook because we have to account for ajax. - * - * @since 2.0 - * @return void - */ -function remove_default_purchase_fields() { - if ( ! Functions\checkout_has_blocks() ) { - return; - } - remove_action( 'edd_purchase_form_after_user_info', 'edd_user_info_fields' ); - remove_action( 'edd_register_fields_before', 'edd_user_info_fields' ); - remove_action( 'edd_purchase_form_before_submit', 'edd_checkout_final_total', 999 ); - add_filter( 'edd_get_option_show_register_form', function() { return 'none'; } ); - add_filter( 'edd_pre_cc_address_fields', '__return_true' ); - add_filter( 'edd_pre_cc_fields', '__return_true' ); -} - -add_filter( 'edd_get_checkout_cart', __NAMESPACE__ . '\do_checkout_cart' ); -/** - * Gets the checkout cart markup when EDD recalculates taxes. - * - * @param string $cart The cart HTML markup. - * @return string - */ -function do_checkout_cart( $cart ) { - if ( ! Functions\checkout_has_blocks() ) { - return $cart; - } - $cart_items = get_cart_contents(); - ob_start(); - do_action( 'edd_before_checkout_cart' ); - include EDD_BLOCKS_DIR . 'views/checkout/cart/cart.php'; - - return ob_get_clean(); -} - -/** - * Gets the array of customer information from the session and potentially the logged in user information. - * - * @since 2.0 - * @return array - */ -function get_customer() { - $session = EDD()->session->get( 'customer' ); - $customer = wp_parse_args( - $session, - array( - 'first_name' => '', - 'last_name' => '', - 'email' => '', - ) - ); - - if ( is_user_logged_in() ) { - $user_data = get_userdata( get_current_user_id() ); - foreach ( $customer as $key => $field ) { - if ( 'email' === $key && empty( $field ) ) { - $customer[ $key ] = $user_data->user_email; - } elseif ( empty( $field ) ) { - $customer[ $key ] = $user_data->$key; - } - } - } - - return array_map( 'sanitize_text_field', $customer ); -} - -/** - * Gets the customer address for checkout. - * - * @since 2.0 - * @param array $customer - * @return array - */ -function get_customer_address( $customer ) { - $address = array( - 'line1' => '', - 'line2' => '', - 'city' => '', - 'zip' => '', - 'state' => '', - 'country' => '', - ); - - if ( is_user_logged_in() ) { - $user_address = edd_get_customer_address(); - foreach ( $address as $key => $field ) { - if ( empty( $field ) && ! empty( $user_address[ $key ] ) ) { - $address[ $key ] = $user_address[ $key ]; - } - } - } - - /** - * Filter the billing address details that will be pre-populated on the checkout form. - * - * @since 2.8 - * - * @param array $address The customer address. - * @param array $customer The customer data from the session - */ - return array_map( 'sanitize_text_field', apply_filters( 'edd_checkout_billing_details_address', $address, $customer ) ); -} - -add_action( 'edd_cc_address_fields', __NAMESPACE__ . '\do_address' ); -/** - * Renders the customer address fields for checkout. - * - * @since 2.0 - * @return void - */ -function do_address() { - $customer = get_customer(); - $customer['address'] = get_customer_address( $customer ); - - include EDD_BLOCKS_DIR . 'views/checkout/purchase-form/address.php'; -} - -add_action( 'edd_cc_fields', __NAMESPACE__ . '\do_cc_fields' ); -/** - * Renders the default credit card fields on checkout. - * - * @since 2.0 - * @return void - */ -function do_cc_fields() { - do_action( 'edd_before_cc_fields' ); - include EDD_BLOCKS_DIR . 'views/checkout/purchase-form/credit-card.php'; - do_action( 'edd_after_cc_fields' ); -} - -add_filter( 'edd_is_checkout', __NAMESPACE__ . '\is_checkout' ); -/** - * If the checkout block is on a page that isn't set as the checkout option, set edd_is_checkout to true. - * - * @since 2.0 - * @param bool $is_checkout - * @return bool - */ -function is_checkout( $is_checkout ) { - if ( $is_checkout ) { - return $is_checkout; - } - - if ( has_block( 'edd/checkout' ) ) { - return true; - } - - $current_page = ! empty( $_POST['current_page'] ) ? absint( $_POST['current_page'] ) : false; - if ( $current_page && edd_doing_ajax() && has_block( 'edd/checkout', $current_page ) ) { - return true; - } - - return $is_checkout; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/forms.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/forms.php deleted file mode 100644 index 8cd7a524..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/forms.php +++ /dev/null @@ -1,195 +0,0 @@ - array( - 'label' => __( 'Log in', 'easy-digital-downloads' ), - 'view' => EDD_BLOCKS_DIR . 'views/checkout/purchase-form/login.php', - ), - 'register' => array( - 'label' => __( 'Register for a new account', 'easy-digital-downloads' ), - 'view' => EDD_BLOCKS_DIR . 'views/checkout/purchase-form/register.php', - ), - 'guest' => array( - 'label' => __( 'Check out as a guest', 'easy-digital-downloads' ), - 'view' => EDD_BLOCKS_DIR . 'views/checkout/purchase-form/personal-info.php', - ), - ); - if ( ! edd_no_guest_checkout() || ( ! $customer_info_complete && is_user_logged_in() ) ) { - $forms['guest'] = $options['guest']; - } - if ( ! empty( $block_attributes['show_register_form'] ) && ! is_user_logged_in() ) { - $setting = $block_attributes['show_register_form']; - if ( 'both' === $setting ) { - $forms['login'] = $options['login']; - $forms['register'] = $options['register']; - } elseif ( 'registration' === $setting ) { - $forms['register'] = $options['register']; - } elseif ( ! empty( $options[ $setting ] ) ) { - $forms[ $setting ] = $options[ $setting ]; - } - } - - // If no forms have been set, add the registration form (guest checkout is disabled). - if ( empty( $forms ) ) { - $forms['register'] = $options['register']; - } - - return $forms; -} - -/** - * Shows the login and/or registration form for guest users in checkout. - * - * @since 2.0 - * @param array $block_attributes The block attributes. - * @return void - */ -function do_personal_info_forms( $block_attributes ) { - $customer = \EDD\Blocks\Checkout\get_customer(); - $customer_info_complete = true; - if ( is_user_logged_in() ) { - include EDD_BLOCKS_DIR . 'views/checkout/purchase-form/logged-in.php'; - - if ( ! empty( $customer['email'] ) && ! empty( $customer['first_name'] ) && ! has_action( 'edd_purchase_form_user_info_fields' ) ) { - return; - } - $customer_info_complete = false; - } - ?> -
    - 1 ) { - wp_enqueue_script( 'edd-blocks-checkout-forms' ); - $i = 0; - echo '
    '; - foreach ( $forms as $id => $form ) { - printf( - '', - esc_attr( $id ), - empty( $i ) ? ' disabled' : '', - esc_html( $form['label'] ), - 'guest' === $id ? ' style="display:none;"' : '' - ); - $i++; - } - echo '
    '; - } - $form = reset( $forms ); - echo '
    '; - if ( is_callable( $form['view'] ) ) { - echo call_user_func( $form['view'], array( 'current' => true ) ); - } else { - include $form['view']; - } - ?> -
    -
    - -
    - 0 ) { - include EDD_BLOCKS_DIR . 'views/checkout/purchase-form/gateways.php'; - } - if ( ! edd_show_gateways() ) { - do_action( 'edd_purchase_form' ); - } else { - ?> -
    - -
    - 'both' ) ); - $form = $forms[ $form_id ]; - $customer = \EDD\Blocks\Checkout\get_customer(); - if ( is_callable( $form['view'] ) ) { - wp_send_json_success( call_user_func( $form['view'], array( 'current' => true ) ) ); - } - - ob_start(); - $form = include $form['view']; - wp_send_json_success( ob_get_clean() ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/functions.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/functions.php deleted file mode 100644 index 087cbeca..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/checkout/functions.php +++ /dev/null @@ -1,68 +0,0 @@ -'; - foreach ( $payment_icons as $key => $option ) { - if ( ! in_array( $key, $gateway_icons, true ) ) { - continue; - } - echo edd_get_payment_image( $key, $option ); - } - echo '
    '; -} - -/** - * Gets the accepted payment icons for a gateway. - * - * @since 2.0 - * @param array $gateway - * @return array|false - */ -function get_gateway_icons( $gateway_id, $gateway ) { - if ( ! empty( $gateway['icons'] ) ) { - return $gateway['icons']; - } - - if ( 'stripe' === $gateway_id ) { - return array( - 'mastercard', - 'visa', - 'discover', - 'americanexpress', - ); - } - - if ( false !== strpos( $gateway_id, 'paypal' ) ) { - return array( 'paypal' ); - } - - return false; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/downloads/downloads.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/downloads/downloads.php deleted file mode 100644 index 7d66fe45..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/downloads/downloads.php +++ /dev/null @@ -1,220 +0,0 @@ - array( - 'render_callback' => __NAMESPACE__ . '\downloads', - ), - 'buy-button' => array( - 'render_callback' => __NAMESPACE__ . '\buy_button', - ), - ); - - foreach ( $blocks as $block => $args ) { - register_block_type( EDD_BLOCKS_DIR . 'build/' . $block, $args ); - } -} - -/** - * Renders the order history block. - * - * @since 2.0 - * @param array $block_attributes The block attributes. - * @return string Order history HTML. - */ -function downloads( $block_attributes = array() ) { - // Set up defaults. - $defaults = array( - 'image_location' => 'before_entry_header', - 'image_size' => 'large', - 'image_alignment' => 'center', - 'title' => true, - 'content' => 'excerpt', - 'columns' => 3, - 'orderby' => 'post_date', - 'order' => 'DESC', - 'pagination' => true, - 'buy_button' => true, - 'category' => array(), - 'pagination' => true, - 'number' => 6, - 'price' => true, - 'image_link' => true, - 'purchase_link_align' => 'none', - 'tag' => array(), - 'show_price' => true, - 'all_access' => false, - ); - - $block_attributes = wp_parse_args( $block_attributes, $defaults ); - if ( 'rand' === $block_attributes['orderby'] ) { - $block_attributes['pagination'] = false; - } - if ( ! empty( $block_attributes['all_access'] ) ) { - $block_attributes['all_access_customer_downloads_only'] = true; - } - - require_once EDD_BLOCKS_DIR . 'includes/downloads/query.php'; - - $query = new Query( $block_attributes ); - $query_args = $query->get_query(); - $downloads = new \WP_Query( $query_args ); - if ( ! $downloads->have_posts() ) { - /* translators: the plurals downloads name. */ - return sprintf( _x( 'No %s found.', 'download post type name', 'easy-digital-downloads' ), edd_get_label_plural() ); - } - - // Set up classes. - $classes = array( - 'wp-block-edd-downloads', - 'edd-blocks__downloads', - ); - $classes = Functions\get_block_classes( $block_attributes, $classes ); - - if ( ! empty( $block_attributes['image_location'] ) ) { - add_action( "edd_blocks_downloads_{$block_attributes['image_location']}", __NAMESPACE__ . '\image' ); - } - - // Always disable the Stripe express checkout buttons in the block editor. - if ( \EDD\Blocks\Functions\is_block_editor() ) { - add_filter( 'edds_prb_purchase_link_enabled', '__return_false' ); - } - - ob_start(); - include EDD_BLOCKS_DIR . 'views/downloads/downloads.php'; - - wp_reset_postdata(); - if ( ! empty( $block_attributes['image_location'] ) ) { - remove_action( "edd_blocks_downloads_{$block_attributes['image_location']}", __NAMESPACE__ . '\image' ); - } - - return ob_get_clean(); -} - -/** - * Renders the EDD buy button block. - * - * @since 2.0 - * @param array $block_attributes The block attributes. - * @return string Buy button HTML. - */ -function buy_button( $block_attributes = array() ) { - $block_attributes = wp_parse_args( - $block_attributes, - array( - 'download_id' => get_the_ID(), - 'show_price' => true, - 'align' => '', - 'direct' => false, - 'text' => edd_get_option( 'add_to_cart_text', __( 'Purchase', 'easy-digital-downloads' ) ), - ) - ); - if ( empty( $block_attributes['download_id'] ) || 'download' !== get_post_type( $block_attributes['download_id'] ) ) { - return ''; - } - $block_attributes_for_classes = $block_attributes; - unset( $block_attributes_for_classes['align'] ); - $classes = array( - 'wp-block-edd-buy-button', - 'edd-blocks__buy-button', - ); - $classes = Functions\get_block_classes( $block_attributes_for_classes, $classes ); - remove_filter( 'edd_purchase_link_args', __NAMESPACE__ . '\maybe_update_purchase_links', 100 ); - if ( wp_style_is( 'edd-styles', 'registered' ) ) { - wp_enqueue_style( 'edd-styles' ); - } - - $args = array( - 'class' => implode( ' ', get_purchase_link_classes( $block_attributes ) ), - 'download_id' => absint( $block_attributes['download_id'] ), - 'price' => (bool) $block_attributes['show_price'], - 'text' => $block_attributes['text'], - ); - if ( $block_attributes['direct'] && edd_shop_supports_buy_now() ) { - $args['direct'] = true; - $args['text'] = edd_get_option( 'buy_now_text', __( 'Buy Now', 'easy-digital-downloads' ) ); - } - - $output = sprintf( '
    ', esc_attr( implode( ' ', $classes ) ) ); - $output .= edd_get_purchase_link( $args ); - $output .= '
    '; - - add_filter( 'edd_purchase_link_args', __NAMESPACE__ . '\maybe_update_purchase_links', 100 ); - - return $output; -} - -/** - * Gets the array of classes for the purchase link buttons from the block attributes. - * - * @since 2.0 - * @param array $block_attributes The block attributes. - * @return array - */ -function get_purchase_link_classes( $block_attributes = array() ) { - $classes = array( - 'edd-submit', - ); - if ( ! empty( $block_attributes['align'] ) ) { - $classes[] = "align{$block_attributes['align']}"; - } - - return $classes; -} - -add_filter( 'edd_purchase_link_args', __NAMESPACE__ . '\maybe_update_purchase_links', 100 ); -/** - * If the blocks button colors have been defined, update all purchase links everywhere. - * - * @since 2.0 - * @param array $args - * @return array - */ -function maybe_update_purchase_links( $args ) { - $classes = get_purchase_link_classes(); - $current_class = explode( ' ', $args['class'] ); - $classes = array_merge( $classes, $current_class ); - $args['class'] = implode( ' ', array_unique( $classes ) ); - - return $args; -} - -/** - * Renders a featured image if one is set. - * - * @since 2.0 - * @param array $block_attributes - * @return void - */ -function image( $block_attributes ) { - if ( ! \has_post_thumbnail() ) { - return; - } - include EDD_BLOCKS_DIR . 'views/downloads/image.php'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/downloads/query.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/downloads/query.php deleted file mode 100644 index cb16faa0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/downloads/query.php +++ /dev/null @@ -1,327 +0,0 @@ -attributes = $block_attributes; - } - - /** - * Gets the downloads query parameters from the block attributes. - * - * @since 2.0 - * @return array - */ - public function get_query() { - $query = array( - 'post_type' => 'download', - 'order' => $this->attributes['order'], - ); - $query = $this->parse_pagination( $query, $this->attributes ); - $query = $this->parse_orderby( $query, $this->attributes ); - $query = $this->parse_tax_query( $query, $this->attributes ); - - if ( ! empty( $this->attributes['ids'] ) ) { - $query['post__in'] = explode( ',', $this->attributes['ids'] ); - } - - $query['paged'] = (int) $this->get_paged(); - - /** - * Allow extensions to filter the downloads query. - * This is the same filter used in EDD core for the downloads shortcode query. - * - * @since 2.0 - * @param array $query The array of query parameters. - * @param array $this->attributes The block attributes. - */ - return apply_filters( 'edd_downloads_query', $query, $this->attributes ); - } - - /** - * Parses the pagination parameters for the downloads query. - * - * @since 2.0 - * @param array $query Download query args. - * @return array - */ - private function parse_pagination( $query ) { - if ( $this->attributes['pagination'] || ( ! $this->attributes['pagination'] && $this->attributes['number'] ) ) { - - $query['posts_per_page'] = (int) $this->attributes['number']; - - if ( $query['posts_per_page'] < 0 ) { - $query['posts_per_page'] = abs( $query['posts_per_page'] ); - } - } else { - $query['nopaging'] = true; - } - - return $query; - } - - /** - * Parses the orderby parameters for the downloads query. - * - * @since 2.0 - * @param array $query Download query args. - * @return array - */ - private function parse_orderby( $query ) { - switch ( $this->attributes['orderby'] ) { - case 'price': - $query['meta_key'] = 'edd_price'; - $query['orderby'] = 'meta_value_num'; - break; - - case 'sales': - $query['meta_key'] = '_edd_download_sales'; - $query['orderby'] = 'meta_value_num'; - break; - - case 'earnings': - $query['meta_key'] = '_edd_download_earnings'; - $query['orderby'] = 'meta_value_num'; - break; - - default: - $query['orderby'] = $this->attributes['orderby']; - break; - } - - return $query; - } - - /** - * Parses the taxonomy parameters for the downloads query. - * - * @since 2.0 - * @param array $query Download query args. - * @return array - */ - private function parse_tax_query( $query ) { - if ( empty( $this->attributes['tag'] ) && empty( $this->attributes['category'] ) && empty( $this->attributes['exclude_category'] ) && empty( $this->attributes['exclude_tags'] ) ) { - return $query; - } - - $query['tax_query'] = array( - 'relation' => ! empty( $this->attributes['relation'] ) ? $this->attributes['relation'] : 'AND', - ); - - $query = $this->parse_tags( $query, $this->attributes ); - $query = $this->parse_categories( $query, $this->attributes ); - $query = $this->parse_exclude_category( $query, $this->attributes ); - $query = $this->parse_exclude_tags( $query, $this->attributes ); - $query = $this->parse_author( $query, $this->attributes ); - - if ( ! empty( $this->attributes['exclude_tags'] ) || ! empty( $this->attributes['exclude_category'] ) ) { - $query['tax_query']['relation'] = 'AND'; - } - - return $query; - } - - /** - * Parses the tag parameters for the downloads query. - * - * @since 2.0 - * @param array $query Download query args. - * @return array - */ - private function parse_tags( $query ) { - if ( empty( $this->attributes['tag'] ) ) { - return $query; - } - - $term_ids = $this->get_term_ids( array_filter( (array) $this->attributes['tag'] ), 'download_tag' ); - if ( ! empty( $term_ids ) ) { - $query['tax_query'][] = array( - 'taxonomy' => 'download_tag', - 'field' => 'term_id', - 'terms' => $term_ids, - ); - } - - return $query; - } - - /** - * Parses the category parameters for the downloads query. - * - * @since 2.0 - * @param array $query Download query args. - * @return array - */ - private function parse_categories( $query ) { - if ( empty( $this->attributes['category'] ) ) { - return $query; - } - - $term_ids = $this->get_term_ids( array_filter( (array) $this->attributes['category'] ) ); - if ( ! empty( $term_ids ) ) { - $query['tax_query'][] = array( - 'taxonomy' => 'download_category', - 'field' => 'term_id', - 'terms' => $term_ids, - ); - } - - return $query; - } - - /** - * Parses the excluded category parameters for the downloads query. - * - * @since 2.0 - * @param array $query Download query args. - * @return array - */ - private function parse_exclude_category( $query ) { - if ( empty( $this->attributes['exclude_category'] ) ) { - return $query; - } - - $term_ids = $this->get_term_ids( $this->attributes['exclude_category'] ); - if ( ! empty( $term_ids ) ) { - $query['tax_query'][] = array( - 'taxonomy' => 'download_category', - 'field' => 'term_id', - 'terms' => $term_ids, - 'operator' => 'NOT IN', - ); - } - - return $query; - } - - /** - * Parses the excluded tags parameters for the downloads query. - * - * @since 2.0 - * @param array $query Download query args. - * @return array - */ - private function parse_exclude_tags( $query ) { - if ( empty( $this->attributes['exclude_tags'] ) ) { - return $query; - } - - $term_ids = $this->get_term_ids( $this->attributes['exclude_tags'], 'download_tag' ); - if ( ! empty( $term_ids ) ) { - $query['tax_query'][] = array( - 'taxonomy' => 'download_tag', - 'field' => 'term_id', - 'terms' => $term_ids, - 'operator' => 'NOT IN', - ); - } - - return $query; - } - - /** - * Gets an array of term ids for a parameter. - * - * @param array|string $list The term IDs to evaluate. - * @param string $taxonomy The taxonomy to check. - * @return array - */ - private function get_term_ids( $list, $taxonomy = 'download_category' ) { - $term_list = is_array( $list ) ? $list : explode( ',', $list ); - $term_ids = array(); - - foreach ( $term_list as $term ) { - - $t_id = (int) $term; - $is_id = is_int( $t_id ) && ! empty( $t_id ); - - if ( $is_id ) { - $term_ids[] = $t_id; - continue; - } - - $term_object = get_term_by( 'slug', $term, $taxonomy ); - if ( ! empty( $term_object->term_id ) ) { - $term_ids[] = $term_object->term_id; - } - } - - return $term_ids; - } - - /** - * Parses the author parameters for the downloads query. - * - * @since 2.0 - * @param array $query - * @return array - */ - private function parse_author( $query ) { - if ( empty( $this->attributes['author'] ) ) { - return $query; - } - - $authors = explode( ',', $this->attributes['author'] ); - if ( ! empty( $authors ) ) { - $author_ids = array(); - $author_names = array(); - - foreach ( $authors as $author ) { - if ( is_numeric( $author ) ) { - $author_ids[] = $author; - } else { - $user = get_user_by( 'login', $author ); - if ( $user ) { - $author_ids[] = $user->ID; - } - } - } - - if ( ! empty( $author_ids ) ) { - $author_ids = array_unique( array_map( 'absint', $author_ids ) ); - $query['author'] = implode( ',', $author_ids ); - } - } - - return $query; - } - - /** - * Parses the paged parameters for the downloads query. - * - * @since 2.0 - * @return int - */ - private function get_paged() { - if ( get_query_var( 'paged' ) ) { - return get_query_var( 'paged' ); - } - - if ( get_query_var( 'page' ) ) { - return get_query_var( 'page' ); - } - - return 1; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/downloads/rest.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/downloads/rest.php deleted file mode 100644 index 431b9940..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/downloads/rest.php +++ /dev/null @@ -1,83 +0,0 @@ - __NAMESPACE__ . '\get_term_meta', - ) - ); - } -} - -/** - * Get term meta. - * - * @since 2.0 - * @param array $object - * @param string $field_name - * @param mixed $request - * - * @return array - */ -function get_term_meta( $object, $field_name, $request ) { - - if ( empty( $object['id'] ) ) { - return false; - } - - // Get the image ID. - $image_id = get_term_meta( $object['id'], 'download_term_image', true ); - - // Build meta array. - return array( 'image' => wp_get_attachment_image( $image_id ) ); -} - -add_filter( 'edd_api_products_product', __NAMESPACE__ . '\update_products_api' ); -/** - * Add data to the products API output. - * - * @since 2.0 - * @param array $product - * @return array - */ -function update_products_api( $product ) { - - // Get the product ID. - $product_id = $product['info']['id']; - - // Download Image. - $product['info']['image'] = wp_get_attachment_image( get_post_meta( $product_id, '_thumbnail_id', true ) ); - - // Purchase link. - $product['info']['purchase_link'] = edd_get_purchase_link( array( 'download_id' => $product_id ) ); - - // Price. - $product['info']['price'] = edd_price( $product_id, false ); - - return $product; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/forms/forms.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/forms/forms.php deleted file mode 100644 index 43cc1b53..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/forms/forms.php +++ /dev/null @@ -1,161 +0,0 @@ - array( - 'render_callback' => __NAMESPACE__ . '\login', - ), - 'register' => array( - 'render_callback' => __NAMESPACE__ . '\registration', - ), - ); - - foreach ( $blocks as $block => $args ) { - register_block_type( EDD_BLOCKS_DIR . 'build/' . $block, $args ); - } -} - -/** - * Renders the login form block. - * - * @since 2.0 - * @param array $block_attributes The block attributes. - * @return string Login form HTML. - */ -function login( $block_attributes = array() ) { - if ( is_user_logged_in() && empty( $_GET['reauth'] ) ) { - return ''; - } - $block_attributes = wp_parse_args( - $block_attributes, - array( - 'current' => false, - 'redirect' => '', - ) - ); - - $action = ! empty( $_GET['action'] ) ? sanitize_text_field( $_GET['action'] ) : false; - if ( 'rp' === $action ) { - list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ] ), 2 ); - $user = check_password_reset_key( $rp_key, $rp_login ); - if ( ! $user || is_wp_error( $user ) ) { - $action = 'lostpassword'; - edd_set_error( 'invalidkey', __( 'Your password reset link appears to be invalid. Please request a new link below.', 'easy-digital-downloads' ) ); - } - } - $block_classes = array( 'wp-block-edd-login' ); - if ( $action ) { - $block_classes[] = "wp-block-edd-login__{$action}"; - } - $classes = Functions\get_block_classes( $block_attributes, $block_classes ); - ob_start(); - - ?> -
    - -
    - true, - 'redirect' => '', - ) - ); - ob_start(); - ?> -
    - -
    - $site_key, - ), - 'https://www.google.com/recaptcha/api.js' - ); - wp_register_script( 'google-recaptcha', esc_url_raw( $url ), array(), '3', true ); - wp_register_script( 'edd-recaptcha', EDD_BLOCKS_URL . 'assets/js/recaptcha.js', array( 'google-recaptcha' ), EDD_VERSION, true ); - wp_localize_script( - 'edd-recaptcha', - 'EDDreCAPTCHA', - get_localize_args() - ); -} - -/** - * Initialize reCAPTCHA scripts and fields. - * - * @since 2.0 - * @return void - */ -function initialize() { - if ( ! get_site_key() ) { - return; - } - enqueue(); - do_inputs(); -} - -/** - * Renders the hidden inputs needed for reCAPTCHA validation. - * - * @since 2.0 - * @return void - */ -function do_inputs() { - ?> - - - 'invalid_recaptcha_missing', - 'message' => __( 'reCAPTCHA validation missing.', 'easy-digital-downloads' ), - ) - ); - } - - try { - $args = array( - 'headers' => array( - 'Content-type' => 'application/x-www-form-urlencoded', - ), - 'body' => array( - 'secret' => edd_get_option( 'recaptcha_secret_key', false ), - 'response' => $token, - 'remoteip' => trim( sanitize_text_field( $_POST['ip'] ) ), - ), - ); - - $validated = validate_recaptcha( - wp_safe_remote_post( - 'https://www.google.com/recaptcha/api/siteverify', - $args - ) - ); - - // No errors with data validation. - if ( true === $validated ) { - wp_send_json_success( - array( 'success' => true ) - ); - } else { - wp_send_json_error( $validated ); - } - } catch ( Exception $e ) { - wp_send_json_error( - array( - 'error' => 'invalid_recaptcha_bad', - 'message' => __( 'There was an error validating the reCAPTCHA. Please try again.', 'easy-digital-downloads' ), - ) - ); - } -} - -/** - * Evaluates the reCAPTCHA response. - * - * @since 2.0 - * @param array|WP_Error $response - * @return bool - */ -function validate_recaptcha( $response ) { - if ( is_wp_error( $response ) ) { - return array( - 'error' => 'invalid_recaptcha_bad', - 'message' => __( 'Unexpected reCAPTCHA error. Please try again.', 'easy-digital-downloads' ), - ); - } - $verify = json_decode( wp_remote_retrieve_body( $response ) ); - if ( true !== $verify->success ) { - return array( - 'error' => 'invalid_recaptcha_bad', - 'message' => __( 'reCAPTCHA verification failed. Please contact a site administrator.', 'easy-digital-downloads' ), - ); - } - - if ( isset( $verify->score ) && (float) $verify->score < 0.5 ) { - return array( - 'error' => 'invalid_recaptcha_low_score', - 'message' => __( 'reCAPTCHA verification failed with low score. Please contact a site administrator.', 'easy-digital-downloads' ), - ); - } - - return true; -} - -/** - * Gets the array of localized parameters for the recaptcha. - * - * @since 2.0 - * @return array - */ -function get_localize_args() { - return array( - 'ajaxurl' => edd_get_ajax_url(), - 'sitekey' => get_site_key(), - 'error' => __( 'Error', 'easy-digital-downloads' ), - ); -} - -/** - * Gets the reCAPTCHA site key if both the site key and secret key are set. - * - * @since 2.0 - * @return false|string - */ -function get_site_key() { - $site_key = edd_get_option( 'recaptcha_site_key', false ); - $secret_key = edd_get_option( 'recaptcha_secret_key', false ); - - return ! empty( $site_key ) && ! empty( $secret_key ) ? $site_key : false; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/functions.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/functions.php deleted file mode 100644 index 0e659bdc..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/functions.php +++ /dev/null @@ -1,146 +0,0 @@ - 'easy-digital-downloads', - 'title' => __( 'Easy Digital Downloads', 'easy-digital-downloads' ), - 'icon' => 'download', - ); - - return $block_categories; -} - -/** - * Gets the array of classes for a block. - * - * @since 2.0 - * @param array $block_attributes - * @param array $classes - * @return array - */ -function get_block_classes( $block_attributes, $classes = array() ) { - if ( ! empty( $block_attributes['columns'] ) && 1 < (int) $block_attributes['columns'] ) { - $columns = (int) $block_attributes['columns']; - $classes[] = 'edd-blocks__columns'; - if ( 3 <= $columns ) { - $classes[] = "edd-blocks__columns-{$columns}"; - } - } - if ( ! empty( $block_attributes['align'] ) ) { - $classes[] = "align{$block_attributes['align']}"; - } - if ( ! empty( $block_attributes['className'] ) ) { - $additional_classes = explode( ' ', $block_attributes['className'] ); - if ( $additional_classes ) { - $classes = array_merge( $classes, $additional_classes ); - } - } - - return array_filter( array_unique( array_map( 'sanitize_html_class', $classes ) ) ); -} - -/** - * Marks a field as required with the HTML5 attribute. - * - * @since 2.0 - * @param string $field - * @return void - */ -function mark_field_required( $field ) { - if ( edd_field_is_required( $field ) ) { - echo 'required'; - } -} - -/** - * Gets an array of CSS classes for an edd-submit button. - * - * @since 2.0 - * @param array $classes Optional custom classes. - * @return array - */ -function get_button_classes( $classes = array() ) { - $button_classes = array_merge( - $classes, - array( - 'button', - 'edd-submit', - edd_get_button_color_class(), - ) - ); - - return array_filter( $button_classes ); -} - -/** - * Gets an array of classes for a given input field. - * - * @since 2.0 - * @param string $field - * @param array $classes - * @return array - */ -function get_input_classes( $field, $classes = array() ) { - - $classes = array_merge( array( $field ), $classes ); - if ( edd_field_is_required( $field ) ) { - $classes[] = 'required'; - } - - return array_filter( array_unique( $classes ) ); -} - -/** - * Checks whether we are viewing content in the block editor. - * - * @since 2.0 - * @param string $current_user_can Whether the current user needs to have a specific capability. - * @return false|string - */ -function is_block_editor( $current_user_can = '' ) { - $is_block_editor = ! empty( $_GET['edd_blocks_is_block_editor'] ) ? $_GET['edd_blocks_is_block_editor'] : false; - - // If not the block editor or custom capabilities are not required, return. - if ( ! $is_block_editor || empty( $current_user_can ) ) { - return $is_block_editor; - } - $user = wp_get_current_user(); - - return hash_equals( md5( $user->user_email ), $is_block_editor ) && current_user_can( $current_user_can ); -} - -add_action( 'send_headers', __NAMESPACE__ . '\update_headers' ); -/** - * Prevents clickjacking by sending the X-Frame-Options header - * when a page has either the checkout or login block. - * - * @since 2.0.5.1 - * @return void - */ -function update_headers() { - if ( ! has_block( 'edd/checkout' ) && ! has_block( 'edd/login' ) && ! has_block( 'edd/register' ) ) { - return; - } - header( 'X-Frame-Options: SAMEORIGIN' ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/orders/functions.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/orders/functions.php deleted file mode 100644 index 33d3148d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/orders/functions.php +++ /dev/null @@ -1,184 +0,0 @@ -is_recoverable() ) : - $recovery_url = $order->get_recovery_url(); - if ( $recovery_url ) : - ?> - — - - - - - - elements. - * - * @since 2.0 - * @param string $string - * @return string - */ -function replace_table_markup( $string ) { - $string = str_replace( ' get_current_user_id(), - 'type' => 'sale', - 'number' => $number, - 'offset' => $number * ( intval( $current_page ) - 1 ), - 'status__not_in' => array( 'trash' ) - ); - if ( ! empty( $block_attributes['recurring'] ) ) { - $args['status__not_in'] = array( 'edd_subscription' ); - } - - return apply_filters( 'edd_blocks_order_history_args', $args, $block_attributes ); -} - -/** - * Gets the EDD purchase session, unless the user is in the block editor. - * Then it creates a dummy purchase session and uses that to show a sample confirmation screen. - * - * @since 2.0 - * @return array|false - */ -function get_purchase_session() { - if ( ! \EDD\Blocks\Functions\is_block_editor() ) { - return edd_get_purchase_session(); - } - $sample_order_key = get_sample_order_payment_key(); - if ( $sample_order_key ) { - return array( - 'purchase_key' => $sample_order_key, - ); - } - - return false; -} - -/** - * Gets the payment key: - * Checks the URL directly - * Checks for the order ID and hashed order value - * Checks the current purchase session - * - * @since 2.0 - * @return string|false - */ -function get_payment_key() { - if ( \EDD\Blocks\Functions\is_block_editor( 'edit_shop_payments' ) ) { - $sample_order_key = get_sample_order_payment_key(); - if ( $sample_order_key ) { - return $sample_order_key; - } - } - if ( isset( $_GET['payment_key'] ) ) { - return urldecode( $_GET['payment_key'] ); - } - - if ( ! empty( $_GET['order'] ) && ! empty( $_GET['id'] ) ) { - return edd_get_payment_key( absint( $_GET['id'] ) ); - } - - $session = edd_get_purchase_session(); - if ( $session ) { - return $session['purchase_key']; - } - - return false; -} - -/** - * Gets some orders from the site for use in the editor. - * - * @since 2.0 - * @return false|array - */ -function get_sample_order_payment_key() { - if ( ! \EDD\Blocks\Functions\is_block_editor( 'edit_shop_payments' ) ) { - return false; - } - - $orders = edd_get_orders( - array( - 'number' => 10, - 'type' => 'sale', - 'status' => 'complete', - 'fields' => 'payment_key', - 'orderby' => array_rand( array_flip( array( 'email', 'id', 'payment_key', 'total', 'customer_id', 'date_created' ) ) ), - 'order' => 'ASC', - 'no_found_rows' => true, - ) - ); - - return $orders ? array_rand( array_flip( $orders ) ) : false; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/orders/orders.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/orders/orders.php deleted file mode 100644 index 27792e96..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/orders/orders.php +++ /dev/null @@ -1,605 +0,0 @@ - array( - 'render_callback' => __NAMESPACE__ . '\orders', - ), - 'confirmation' => array( - 'render_callback' => __NAMESPACE__ . '\confirmation', - ), - 'receipt' => array( - 'render_callback' => __NAMESPACE__ . '\receipt', - ), - 'user-downloads' => array( - 'render_callback' => __NAMESPACE__ . '\downloads', - ), - ); - - foreach ( $blocks as $block => $args ) { - register_block_type( EDD_BLOCKS_DIR . 'build/' . $block, $args ); - } -} - -/** - * Renders the order history block. - * - * @since 2.0 - * @param array $block_attributes The block attributes. - * @return string - */ -function orders( $block_attributes = array() ) { - if ( ! is_user_logged_in() ) { - return ''; - } - - if ( edd_user_pending_verification() ) { - ob_start(); - include EDD_BLOCKS_DIR . 'views/orders/pending.php'; - - return ob_get_clean(); - } - - $block_attributes = wp_parse_args( - $block_attributes, - array( - 'number' => 20, - 'columns' => 2, - ) - ); - - $number = (int) $block_attributes['number']; - $args = Functions\get_order_history_args( $block_attributes ); - - // Set up classes. - $classes = array( - 'wp-block-edd-orders', - 'edd-blocks__orders', - ); - ob_start(); - ?> -
    - -
    - ' . esc_html( __( 'To view a sample confirmation screen, you need to have at least one order in your store.', 'easy-digital-downloads' ) ) . '

    '; - } - - return '

    ' . esc_html( __( 'Your purchase session could not be retrieved.', 'easy-digital-downloads' ) ) . '

    '; - } - - global $edd_receipt_args; - - $edd_receipt_args = wp_parse_args( - $block_attributes, - array( - 'payment_key' => false, - 'payment_method' => true, - ) - ); - - // Set up classes. - $classes = array( - 'wp-block-edd-confirmation', - 'edd-blocks__confirmation', - ); - ob_start(); - ?> -
    - id; - include EDD_BLOCKS_DIR . 'views/orders/receipt-items.php'; - include EDD_BLOCKS_DIR . 'views/orders/totals.php'; - ?> -
    - - - -
    -
    - __( 'Sorry, trouble retrieving order receipt.', 'easy-digital-downloads' ), - 'payment_key' => false, - 'payment_method' => true, - ) - ); - $payment_key = Functions\get_payment_key(); - - // No key found. - if ( ! $payment_key ) { - if ( Helpers\is_block_editor() ) { - return '

    ' . esc_html( __( 'To view a sample receipt, you need to have at least one order in your store.', 'easy-digital-downloads' ) ) . '

    '; - } - - return '

    ' . esc_html( $edd_receipt_args['error'] ) . '

    '; - } - - ob_start(); - edd_print_errors(); - - $order = edd_get_order_by( 'payment_key', $payment_key ); - $user_can_view = edd_can_view_receipt( $order ); - if ( ! $user_can_view ) { - show_no_access_message( $order ); - - return ob_get_clean(); - } - - $classes = array( - 'wp-block-edd-receipt', - 'edd-blocks__receipt', - ); - ?> -
    - -
    - %s

    ', - esc_html__( 'Sorry, you do not have permission to view this receipt.', 'easy-digital-downloads' ) - ); - return; - } - - // User is not logged in and can view a guest order. - if ( empty( $order->user_id ) ) { - printf( - '

    %s

    ', - esc_html__( 'Please confirm your email address to access your downloads.', 'easy-digital-downloads' ) - ); - include EDD_BLOCKS_DIR . 'views/orders/guest.php'; - - return; - } - - // Otherwise, the order was made by a customer with a user account. - printf( - '

    %s

    ', - esc_html__( 'Please log in to view your order.', 'easy-digital-downloads' ) - ); - echo \EDD\Blocks\Forms\login( array( 'redirect' => edd_get_receipt_page_uri( $order->id ) ) ); -} - -/** - * Shows the full receipt details if criteria are met; otherwise show a verification or login form. - * - * @since 2.0 - * @param EDD\Orders\Order $order - * @return void - */ -function maybe_show_receipt( $order ) { - $session = edd_get_purchase_session(); - if ( is_user_logged_in() || ( ! empty( $session['purchase_key'] ) && $session['purchase_key'] === $order->payment_key ) ) { - global $edd_receipt_args; - include EDD_BLOCKS_DIR . 'views/orders/receipt-items.php'; - - /** - * Fires after the order receipt table. - * - * @since 3.0 - * @param \EDD\Orders\Order $order Current order. - * @param array $edd_receipt_args [edd_receipt] shortcode arguments. - */ - do_action( 'edd_order_receipt_after_table', $order, $edd_receipt_args ); - return; - } - - // The order belongs to a registered WordPress user. - ?> -

    - -

    - true ) ); -} - -add_action( 'edd_view_receipt_guest', __NAMESPACE__ . '\verify_guest_email' ); -/** - * Verfies the email address to view the details for a guest order. - * - * @since 2.0 - * @param array $data - * @return void - */ -function verify_guest_email( $data ) { - if ( empty( $data['edd_guest_email'] ) || empty( $data['edd_guest_nonce'] ) || ! wp_verify_nonce( $data['edd_guest_nonce'], 'edd-guest-nonce' ) ) { - edd_set_error( 'edd-guest-error', __( 'Your email address could not be verified.', 'easy-digital-downloads' ) ); - return; - } - $order = edd_get_order( $data['order_id'] ); - if ( $order instanceof \EDD\Orders\Order && $data['edd_guest_email'] === $order->email ) { - edd_set_purchase_session( - array( - 'purchase_key' => $order->payment_key, - ) - ); - return; - } - edd_set_error( 'edd-guest-error', __( 'Your email address could not be verified.', 'easy-digital-downloads' ) ); -} - -/** - * Renders the download history block. - * - * @since 2.0.5 - * @param array $block_attributes - * @return string - */ -function downloads( $block_attributes = array() ) { - if ( ! is_user_logged_in() ) { - return ''; - } - - if ( edd_user_pending_verification() ) { - ob_start(); - include EDD_BLOCKS_DIR . 'views/orders/pending.php'; - - return ob_get_clean(); - } - - $block_attributes = wp_parse_args( - $block_attributes, - array( - 'search' => false, - 'variations' => true, - 'nofiles' => __( 'No downloadable files found.', 'easy-digital-downloads' ), - 'hide_empty' => true, - ) - ); - - $downloads = get_purchased_products( $block_attributes ); - if ( ! $downloads ) { - return ''; - } - - // Set up classes. - $classes = array( - 'wp-block-edd-user-downloads', - 'edd-blocks__user-downloads', - ); - ob_start(); - ?> -
    - -
    - $column ) { - $header = $column['header']; - - $header_classes = array( - 'edd-blocks__row-label', - 'edd-blocks__row-label--' . $column_id, - ); - - if ( ! empty( $header['classes'] ) ) { - $header_classes = array_merge( $header_classes, $header['classes'] ); - } - ?> -
    - -
    - -
    - $item ) { - include EDD_BLOCKS_DIR . 'views/orders/downloads.php'; - } - ?> -
    - get_current_user_id(), - 'fields' => 'ids', - 'status__in' => \edd_get_complete_order_statuses(), - 'number' => 9999, - ); - if ( Helpers\is_block_editor() ) { - $args['number'] = 50; - unset( $args['user_id'] ); - } - $order_ids = edd_get_orders( $args ); - if ( empty( $order_ids ) ) { - return false; - } - - $items = edd_get_order_items( - array( - 'order_id__in' => $order_ids, - 'number' => 99999, - 'status__in' => \edd_get_deliverable_order_item_statuses(), - ) - ); - if ( empty( $items ) ) { - return false; - } - - $valid_items = array(); - $downloads = array(); - foreach ( $items as $item ) { - if ( edd_is_bundled_product( $item->product_id ) ) { - $key = ! empty( $block_attributes['variations'] ) ? $item->product_name : edd_get_download_name( $item->product_id ); - $valid_key = $item->product_id; - if ( in_array( $valid_key, $valid_items, true ) ) { - continue; - } - $bundled_products = edd_get_bundled_products( $item->product_id, $item->price_id ); - foreach ( $bundled_products as $bundle_item ) { - $product_id = edd_get_bundle_item_id( $bundle_item ); - $price_id = edd_get_bundle_item_price_id( $bundle_item ); - $key = edd_get_download_name( $product_id ); - $valid_key = $product_id; - $order_item_args = array( - 'order_id' => $item->order_id, - 'status' => $item->status, - 'product_id' => $product_id, - 'product_name' => $key, - ); - if ( is_numeric( $price_id ) && edd_has_variable_prices( $product_id ) ) { - if ( ! empty( $block_attributes['variations'] ) ) { - $key = edd_get_download_name( $product_id, $price_id ); - $order_item_args['product_name'] = $key; - } else { - $download_files = edd_get_download_files( $product_id, $price_id ); - $conditions = wp_list_pluck( $download_files, 'condition' ); - if ( ! empty( $conditions ) && ! in_array( 'all', $conditions, true ) ) { - $key = edd_get_download_name( $product_id, $price_id ); - $order_item_args['product_name'] = $key; - } - } - $order_item_args['price_id'] = $price_id; - $valid_key .= "_{$price_id}"; - } - if ( in_array( $valid_key, $valid_items, true ) ) { - continue; - } - $valid_items[] = $valid_key; - $downloads[ $key ] = new \EDD\Orders\Order_Item( $order_item_args ); - } - continue; - } - $key = $item->product_name; - $valid_key = $item->product_id; - if ( is_numeric( $item->price_id ) && edd_has_variable_prices( $item->product_id ) ) { - if ( empty( $block_attributes['variations'] ) ) { - $download_files = edd_get_download_files( $item->product_id, $item->price_id ); - $conditions = wp_list_pluck( $download_files, 'condition' ); - if ( empty( $conditions ) || in_array( 'all', $conditions, true ) ) { - $key = edd_get_download_name( $item->product_id ); - } - } else { - $valid_key .= "_{$item->price_id}"; - } - } - if ( in_array( $valid_key, $valid_items, true ) ) { - continue; - } - $valid_items[] = $valid_key; - $downloads[ $key ] = $item; - } - - return ! empty( $downloads ) ? $downloads : false; -} - -/** - * Get the registered User Downloads block columns. - * - * @since 2.0.6 - * @return array - */ -function get_user_downloads_block_columns() { - $columns = array( - 'product' => array( - 'header' => array(), - 'row' => array( - 'classes' => array( 'edd-blocks__row-label' ), - ), - ), - ); - - if ( ! edd_no_redownload() ) { - $columns['files'] = array( - 'header' => array(), - 'row' => array( - 'classes' => array( 'edd-order-item__files' ), - ), - ); - } - - /** - * Filters the registered User Downloads block columns. - * - * @since 2.0.6 - * - * @param array $columns The registered columns. - * A column should have a unique array key and be an array with two keys 'header' and 'row'. - * Each of these can contain an array key 'classes' which should be an array of classes to add to the header or row. - * - * By default we add base classes as well as the columns array key to the header and row, so developers should only add additional - * classes they want. - * - * Developers will need to hook into the following actions to output the content for the header and column: - * - edd_blocks_user_downloads_block_header_{your_column_key} - * - edd_blocks_user_downloads_block_column_{your_column_key} - * - * @return array - */ - $columns = apply_filters( 'edd_blocks_user_downloads_block_columns', $columns ); - - // Ensure that all registered columns have the required keys. - foreach ( $columns as $column_id => $column ) { - $default_keys = array( - 'header' => array(), - 'row' => array(), - ); - - $columns[ $column_id ] = array_merge( $default_keys, $columns[ $column_id ] ); - } - - return $columns; -} - -/** - * Render the User Downloads block product header - * - * @since 2.0.6 - * - * @param array $block_attributes The block attributes. - */ -function render_user_downloads_product_header( $block_attributes = array() ) { - esc_html_e( 'Product', 'easy-digital-downloads' ); -} -add_action( 'edd_blocks_user_downloads_block_header_product', __NAMESPACE__ . '\render_user_downloads_product_header', 10, 1 ); - -/** - * Render the User Downloads block product column. - * - * @since 2.0.6 - * - * @param array $action_args The action arguments. - */ -function render_user_downloads_product_column( $action_args = array() ) { - echo esc_html( $action_args['name'] ); -} -add_action( 'edd_blocks_user_downloads_block_column_product', __NAMESPACE__ . '\render_user_downloads_product_column', 10, 1 ); - -/** - * Render the User Downloads block files header - * This is only used if the 'Disable Redownload' option is not enabled. - * - * @since 2.0.6 - * - * @param array $block_attributes The block attributes. - */ -function render_user_downloads_files_header( $block_attributes = array() ) { - echo esc_html( __( 'Files', 'easy-digital-downloads' ) ); -} -add_action( 'edd_blocks_user_downloads_block_header_files', __NAMESPACE__ . '\render_user_downloads_files_header', 10, 1 ); - -/** - * Render the User Downloads block files column. - * This is only used if the 'Disable Redownload' option is not enabled. - * - * @since 2.0.6 - * - * @param array $action_args The action arguments. - */ -function render_user_downloads_files_column( $action_args = array() ) { - // If there are no files, return early. - if ( empty( $action_args['download_files'] ) ) { - echo esc_html( $action_args['block_attributes']['nofiles'] ); - } - - foreach ( $action_args['download_files'] as $filekey => $file ) : - $order = $action_args['order']; - $item = $action_args['order_item']; - $download_url = edd_get_download_file_url( $order, $order->email, $filekey, $item->product_id, $item->price_id ); - ?> -
    - - - -
    - $value ) { - if ( empty( $value ) ) { - continue; - } - $styles[] = "--edd-blocks-button-{$setting}:{$value };"; - if ( 'text' === $setting ) { - $rules[] = '.edd-submit,.has-edd-button-text-color{color: var(--edd-blocks-button-text) !important;}'; - } elseif ( 'background' === $setting ) { - $rules[] = '.edd-submit,.has-edd-button-background-color{background-color: var(--edd-blocks-button-background) !important;}'; - $rules[] = '.has-edd-button-background-text-color{color: var(--edd-blocks-button-background) !important;}'; - } - } - } - if ( empty( $styles ) ) { - return; - } - $inline_style = 'body{' . implode( ' ', $styles ) . '}'; - if ( ! empty( $rules ) ) { - $inline_style .= implode( ' ', $rules ); - } - $stylesheet = wp_style_is( 'edd-styles', 'registered' ) ? 'edd-styles' : 'global-styles'; - wp_add_inline_style( $stylesheet, $inline_style ); -} - -add_filter( 'edd_button_color_class', __NAMESPACE__ . '\update_button_color_class' ); -/** - * Update the EDD button color class from the new color settings. - * - * @since 2.0 - * @param string $class - * @return string - */ -function update_button_color_class( $class ) { - $classes = array(); - $color_options = edd_get_option( 'button_colors' ); - if ( ! empty( $color_options['background'] ) ) { - $classes[] = 'has-edd-button-background-color'; - } - if ( ! empty( $color_options['text'] ) ) { - $classes[] = 'has-edd-button-text-color'; - } - - return ! empty( $classes ) ? implode( ' ', $classes ) : $class; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/terms/images.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/terms/images.php deleted file mode 100644 index 1a147d03..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/terms/images.php +++ /dev/null @@ -1,286 +0,0 @@ -meta_key, - array( - 'type' => 'integer', - 'single' => true, - ) - ); - - foreach ( $this->taxonomies as $taxonomy ) { - add_action( "{$taxonomy}_add_form_fields", array( $this, 'add_taxonomy_meta_fields' ), 5, 2 ); - add_action( "{$taxonomy}_edit_form_fields", array( $this, 'edit_taxonomy_meta_fields' ), 5, 2 ); - add_action( "edited_{$taxonomy}", array( $this, 'save_term_meta' ) ); - add_action( "create_{$taxonomy}", array( $this, 'save_term_meta' ) ); - add_action( "edit_{$taxonomy}", array( $this, 'save_term_meta' ) ); - add_filter( "manage_edit-{$taxonomy}_columns", array( $this, 'add_column' ) ); - add_action( "manage_{$taxonomy}_custom_column", array( $this, 'manage_taxonomy_column' ), 10, 3 ); - } - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); - } - - /** - * Enqueues the JS needed for uploading term images. - * - * @since 2.0 - * @return void - */ - public function enqueue_scripts() { - - $screen = get_current_screen(); - if ( empty( $screen ) || ! in_array( $screen->taxonomy, $this->taxonomies, true ) ) { - return; - } - - wp_enqueue_media(); - wp_enqueue_script( 'edd-term-image-upload', EDD_BLOCKS_URL . 'assets/js/term-image.js', array( 'jquery', 'media-upload', 'thickbox' ), EDD_VERSION, true ); - wp_localize_script( - 'edd-term-image-upload', - 'EDDTermImages', - array( - 'text' => __( 'Select Image', 'easy-digital-downloads' ), - ) - ); - } - - /** - * Displays the term image UI for adding a new term. - * - * @since 2.0 - * - * @return void - */ - public function add_taxonomy_meta_fields() { - ?> -
    - meta_key}_save-settings", "{$this->meta_key}_nonce", false ); ?> - - render_buttons( $this->meta_key ); ?> -

    - -

    -
    - term_id; - $image_id = $this->get_meta( $term_id ); - - wp_nonce_field( "{$this->meta_key}_save-settings", "{$this->meta_key}_nonce", false ); - ?> - - - - - - render_image_preview( $image_id, $term->name ); - } - $this->render_buttons( $this->meta_key, $image_id ); - ?> -

    - name ) - ); - ?> -

    - - - -
    - <?php echo esc_attr( $alt_text ); ?> -
    - - - - - user_can_save( "{$this->meta_key}_save-settings", "{$this->meta_key}_nonce" ) ) { - return; - } - $input = filter_input( INPUT_POST, $this->meta_key, FILTER_SANITIZE_NUMBER_INT ); - if ( $input ) { - update_term_meta( $term_id, $this->meta_key, absint( $input ) ); - } else { - delete_term_meta( $term_id, $this->meta_key ); - } - } - - /** - * Adds a featured image column for download terms. - * - * @param array $columns The array of registered columns. - */ - public function add_column( $columns ) { - - $new_columns = $columns; - array_splice( $new_columns, 1 ); - - $new_columns['featured_image'] = __( 'Image', 'easy-digital-downloads' ); - - return array_merge( $new_columns, $columns ); - } - - /** - * Render the featured image column for terms. - * - * @param string $value Blank (because WP). - * @param string $column Column ID. - * @param int $term_id The term ID. - */ - public function manage_taxonomy_column( $value, $column, $term_id ) { - - if ( 'featured_image' !== $column ) { - return; - } - - $image_id = $this->get_meta( $term_id ); - if ( ! $image_id ) { - return; - } - - $source = wp_get_attachment_image_src( $image_id, 'thumbnail' ); - if ( ! $source ) { - return; - } - - $taxonomy = ! empty( $_POST['taxonomy'] ) ? sanitize_text_field( $_POST['taxonomy'] ) : null; - $taxonomy = ! is_null( $taxonomy ) ? $taxonomy : get_current_screen()->taxonomy; - ?> - <?php echo esc_attr( get_term( $term_id, $taxonomy )->name ); ?> - meta_key, true ); - } - - /** - * Determines if the user has permission to save the information from the submenu - * page. - * - * @since 2.0 - * - * @param string $action The name of the action specified on the submenu page - * @param string $nonce The nonce specified on the submenu page - * - * @return bool True if the user has permission to save; false, otherwise. - */ - private function user_can_save( $action, $nonce ) { - $is_nonce_set = isset( $_POST[ $nonce ] ); - $is_valid_nonce = false; - - if ( $is_nonce_set ) { - $is_valid_nonce = wp_verify_nonce( $_POST[ $nonce ], $action ); - } - - return ( $is_nonce_set && $is_valid_nonce ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/terms/query.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/terms/query.php deleted file mode 100644 index 6aa8a4b6..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/terms/query.php +++ /dev/null @@ -1,58 +0,0 @@ -attributes = $block_attributes; - } - - /** - * Gets the downloads query parameters from the block attributes. - * - * @since 2.0 - * @return array - */ - public function get_query() { - $query = array( - 'taxonomy' => $this->attributes['taxonomy'], - 'orderby' => $this->attributes['orderby'], - 'order' => $this->attributes['order'], - 'hide_empty' => false === $this->attributes['show_empty'], - ); - - // Hide child download categories by default. - if ( 'download_category' === $this->attributes['taxonomy'] ) { - $query['parent'] = 0; - } - - /** - * Allow extensions to filter the terms query. - * - * @since 2.0.1 - * @param array $query The array of query parameters. - * @param array $this->attributes The block attributes. - */ - return apply_filters( 'edd_blocks_terms_query', $query, $this->attributes ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/terms/terms.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/terms/terms.php deleted file mode 100644 index 437b0be6..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/includes/terms/terms.php +++ /dev/null @@ -1,103 +0,0 @@ - array( - 'render_callback' => __NAMESPACE__ . '\terms', - ), - ); - - foreach ( $blocks as $block => $args ) { - register_block_type( EDD_BLOCKS_DIR . 'build/' . $block, $args ); - } -} - -add_action( 'admin_init', __NAMESPACE__ . '\meta' ); -/** - * Adds functionality to set featured images for download terms. - * - * @since 2.0 - * @return void - */ -function meta() { - // If the original EDD Blocks are active, defer to that for setting term images. - if ( class_exists( 'EDD_Term_Images' ) ) { - return; - } - require_once EDD_BLOCKS_DIR . 'includes/terms/images.php'; - new \EDD\Blocks\Terms\Images(); -} - -/** - * Renders the terms block. - * - * @since 2.0 - * @param array $block_attributes The block attributes. - * @return string - */ -function terms( $block_attributes = array() ) { - // Set up defaults. - $defaults = array( - 'thumbnails' => true, - 'title' => true, - 'description' => true, - 'show_empty' => false, - 'columns' => 3, - 'count' => true, - 'orderby' => 'count', - 'order' => 'DESC', - 'taxonomy' => 'download_category', - 'image_size' => 'large', - 'image_alignment' => 'center', - 'align' => '', - ); - - $block_attributes = wp_parse_args( $block_attributes, $defaults ); - - // Taxonomy must be specified. - if ( empty( $block_attributes['taxonomy'] ) ) { - return; - } - - require_once EDD_BLOCKS_DIR . 'includes/terms/query.php'; - - $query = new Query( $block_attributes ); - $query_args = $query->get_query(); - $query = new \WP_Term_Query( $query_args ); - if ( empty( $query->terms ) ) { - return ''; - } - - // Set up classes. - $classes = array( - 'wp-block-edd-terms', - 'edd-blocks__terms', - ); - $classes = Functions\get_block_classes( $block_attributes, $classes ); - - ob_start(); - include EDD_BLOCKS_DIR . 'views/terms.php'; - - return ob_get_clean(); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/readme.md b/wp-content/plugins/easy-digital-downloads/includes/blocks/readme.md deleted file mode 100644 index 3df59f6d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# EDD Blocks - -The EDD Blocks plugin can be installed and activated separately from EDD, but to use it, you will need to run the following command to install the build scripts (this command just needs to be run once): - -``` -npm install -``` - -To test a branch, run: - -``` -npm run dev -``` - -This command will make sure that your build directory is created and has the correct JavaScript and CSS files. diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-discounts.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-discounts.php deleted file mode 100644 index 177aff33..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-discounts.php +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-fees.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-fees.php deleted file mode 100644 index 95aa6aec..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-fees.php +++ /dev/null @@ -1,24 +0,0 @@ - $fee ) : ?> - - -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-item.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-item.php deleted file mode 100644 index 1bc4fd81..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-item.php +++ /dev/null @@ -1,59 +0,0 @@ -
    -
    -
    - '; - echo get_the_post_thumbnail( $item['id'], apply_filters( 'edd_checkout_image_size', array( 25, 25 ) ) ); - echo '
    '; - } - echo esc_html( edd_get_cart_item_name( $item ) ); - echo '
    '; - /** - * Runs after the item in cart's title is echoed - * @since 2.6 - * - * @param array $item Cart Item - * @param int $key Cart key - */ - do_action( 'edd_checkout_cart_item_title_after', $item, $key ); - if ( $is_checkout_block && edd_item_quantities_enabled() && ! edd_download_quantities_disabled( $item['id'] ) ) : - ?> -
    - - - - -
    - -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-subtotal.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-subtotal.php deleted file mode 100644 index 541253e0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-subtotal.php +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-taxes.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-taxes.php deleted file mode 100644 index 908234bf..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-taxes.php +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-total.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-total.php deleted file mode 100644 index b35389e9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart-total.php +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart.php deleted file mode 100644 index c42f8e78..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/cart.php +++ /dev/null @@ -1,55 +0,0 @@ - -
    - -
    - -
    -
    -
    -
    - -
    - $item ) { - include 'cart-item.php'; - } - ?> -
    - -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/mini.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/mini.php deleted file mode 100644 index 03a064a1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/cart/mini.php +++ /dev/null @@ -1,22 +0,0 @@ - - - ' . \EDD\Blocks\Checkout\Functions\get_quantity_string() . ''; -} -if ( ! empty( $block_attributes['show_total'] ) ) { - $output[] = '' . edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ) . ''; -} -if ( ! empty( $output ) ) { - echo wp_kses_post( implode( ' - ', $output ) ); -} -if ( ! empty( $block_attributes['link'] ) && ! edd_is_checkout() ) { - ?> - - -
    -
    - -
    -
    - - - - - - - -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/logged-in.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/logged-in.php deleted file mode 100644 index 5aab5f89..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/logged-in.php +++ /dev/null @@ -1,13 +0,0 @@ -

    - : -   - ', - '' - ); - ?> -

    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/address.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/address.php deleted file mode 100644 index 87617ff9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/address.php +++ /dev/null @@ -1,111 +0,0 @@ - -
    - - -
    - - -
    -
    - - /> -
    -
    - - /> -
    -
    - - /> -
    -
    -
    - - - - - /> - -
    -
    - - /> -
    -
    - - -
    - - - -
    - 'lock', - 'width' => 16, - 'height' => 16, - 'title' => __( 'Secure SSL encrypted payment', 'easy-digital-downloads' ), - 'classes' => array( 'edd-icon', 'edd-icon-lock' ), - ) - ); - ?> - -
    - -
    - - -
    -
    - - -
    -
    -
    - - -
    - -
    - - - / - -
    - -
    - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/gateways.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/gateways.php deleted file mode 100644 index 7a214daf..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/gateways.php +++ /dev/null @@ -1,57 +0,0 @@ -
    - - - -
    - - -
    - - -
    - $gateway ) { - $checked = $gateway_id === $default ? 'checked' : checked( $gateway_id, $payment_mode, false ); - $class = 'edd-gateway-option'; - if ( $checked ) { - $class .= ' edd-gateway-option-selected'; - } - - ?> - - -
    - - -
    - -
    - - - -
    - - -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/logged-in.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/logged-in.php deleted file mode 100644 index ce04dc69..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/logged-in.php +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/login.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/login.php deleted file mode 100644 index 1b515fc4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/login.php +++ /dev/null @@ -1,29 +0,0 @@ -
    - -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - - -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/personal-info.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/personal-info.php deleted file mode 100644 index d2b8e24a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/personal-info.php +++ /dev/null @@ -1,56 +0,0 @@ - -
    - - -
    - - -

    -
    - - -
    - - /> -

    -
    - - -
    - - /> -

    -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/register.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/register.php deleted file mode 100644 index d7578c6a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/checkout/purchase-form/register.php +++ /dev/null @@ -1,38 +0,0 @@ - -
    - -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    - -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/content.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/content.php deleted file mode 100644 index 574f2e25..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/content.php +++ /dev/null @@ -1,30 +0,0 @@ -
    - -
    - %s', - absint( get_the_ID() ), - esc_html__( 'Free', 'easy-digital-downloads' ) - ); - } elseif ( edd_has_variable_prices( get_the_ID() ) ) { - echo wp_kses_post( edd_price_range( get_the_ID() ) ); - } else { - edd_price( get_the_ID(), true ); - } - ?> -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/downloads.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/downloads.php deleted file mode 100644 index 51d105fb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/downloads.php +++ /dev/null @@ -1,35 +0,0 @@ - -
    - have_posts() ) { - $downloads->the_post(); - ?> -
    - -
    - -
    - - get_the_ID(), - 'align' => $block_attributes['purchase_link_align'], - 'show_price' => (bool) $block_attributes['show_price'], - 'direct' => 'direct' === edd_get_download_button_behavior( get_the_ID() ), - ); - echo EDD\Blocks\Downloads\buy_button( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - ?> - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/header.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/header.php deleted file mode 100644 index f99b129e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/header.php +++ /dev/null @@ -1,14 +0,0 @@ - -
    - %s', - esc_url( get_the_permalink() ), - esc_html( get_the_title() ) - ); - } - do_action( 'edd_blocks_downloads_after_entry_title', $block_attributes ); - ?> -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/image.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/image.php deleted file mode 100644 index fd41b15f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/downloads/image.php +++ /dev/null @@ -1,27 +0,0 @@ - - - aria-hidden="true" - tabindex="-1" - - > - "align{$block_attributes['image_alignment']} edd-blocks__download-image", - 'alt' => '', - ) -); -if ( $block_attributes['image_link'] ) : - ?> - - 'download', - 'format' => '?paged=%#%', - 'current' => max( 1, $query_args['paged'] ), - 'total' => $downloads->max_num_pages, -); - -if ( is_single() ) { - $args['base'] = get_permalink() . '%#%'; -} else { - $big = 999999; - $search_for = array( $big, '#038;' ); - $replace_with = array( '%#%', '&' ); - $args['base'] = str_replace( $search_for, $replace_with, get_pagenum_link( $big ) ); -} - -edd_pagination( $args ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/login.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/login.php deleted file mode 100644 index 0dfad001..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/login.php +++ /dev/null @@ -1,48 +0,0 @@ - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/lost-password.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/lost-password.php deleted file mode 100644 index 23ab86af..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/lost-password.php +++ /dev/null @@ -1,30 +0,0 @@ - -

    - -

    -
    -
    - -
    - -
    -
    -
    - - - - - - -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/registration.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/registration.php deleted file mode 100644 index 7b7f323b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/registration.php +++ /dev/null @@ -1,76 +0,0 @@ - -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - - -
    -
    -
    -
    -
    - - -
    -
    -
    - -
    - -
    -
    - -

    -
    - - - - - - - -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/reset-password.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/reset-password.php deleted file mode 100644 index 79a54b1c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/forms/reset-password.php +++ /dev/null @@ -1,46 +0,0 @@ - -

    - -

    -
    - - -
    - -
    - - - -
    -
    -
    -
    -
    - - -
    -
    - -
    - -
    - -
    -
    - -

    -
    - - - - - - -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/credits.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/credits.php deleted file mode 100644 index 675e76e4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/credits.php +++ /dev/null @@ -1,22 +0,0 @@ -get_credits(); -if ( empty( $credits ) ) { - return; -} -?> -
    -
    :
    -
    -description ) ) { - $label = $credit->description; - } - ?> -
    -
    -
    total ), $order->currency ) ); ?>
    -
    - get_discounts(); -if ( ! $order_discounts ) { - return; -} - -$label = _n( 'Discount', 'Discounts', count( $order_discounts ), 'easy-digital-downloads' ); -?> -
    -
    :
    -
    -description; - if ( 'percent' === edd_get_discount_type( $order_discount->type_id ) ) { - $rate = edd_format_discount_rate( 'percent', edd_get_discount_amount( $order_discount->type_id ) ); - $label .= " ({$rate})"; - } - ?> -
    -
    -
    total ), $order->currency ) ); ?>
    -
    - product_id, $item->price_id ); -if ( $block_attributes['hide_empty'] && empty( $download_files ) ) { - return; -} -$order = edd_get_order( $item->order_id ); -$classes = array( - 'edd-blocks__row', - 'edd-order-item__product', -); -if ( $block_attributes['search'] && edd_is_pro() ) { - $classes[] = 'edd-pro-search__product'; -} - -$registered_columns = EDD\Blocks\Orders\get_user_downloads_block_columns(); -?> -
    - $column ) { - $row = $column['row']; - - $classes = array( - 'edd-blocks__row-column', - 'edd-blocks__row-column--' . $column_id, - ); - - if ( ! empty( $row['classes'] ) ) { - $classes = array_merge( $classes, $row['classes'] ); - } - - ?> -
    - $name, - 'order_item' => $item, - 'order' => $order, - 'block_attributes' => $block_attributes, - 'download_files' => $download_files, - ); - /** - * Renders a column in the user downloads block. - * - * To add a new column, use the `edd_blocks_user_download_columns` filter. - * - * @since 2.0.6 - * @param array $action_args The arguments to pass to the hook. - * @param string $name The name of the product. - * @param EDD\Orders\Order_Item $item The order item. - * @param EDD\Orders\Order $order The order object. - * @param array $block_attributes The block attributes. - * @param array $download_files The download files. - */ - do_action( 'edd_blocks_user_downloads_block_column_' . $column_id, $action_args ); - ?> -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/fees.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/fees.php deleted file mode 100644 index 3b0af109..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/fees.php +++ /dev/null @@ -1,22 +0,0 @@ -get_fees(); -if ( empty( $fees ) ) { - return; -} -?> -
    -
    :
    -
    -description ) ) { - $label = $fee->description; - } - ?> -
    -
    -
    subtotal, $order->currency ) ); ?>
    -
    - -
    -
    - -
    - -
    -
    -
    - - - - -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/orders.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/orders.php deleted file mode 100644 index 44341385..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/orders.php +++ /dev/null @@ -1,41 +0,0 @@ - -

    - -
    - -
    -
    -
    - get_number() ) - ); - ?> -
    -
    status ) ); ?>
    -
    -
    -
    - utils->date( $order->date_created, null, true )->toDateTimeString() ) ); ?> -
    -
    - total, $order->currency ) ); ?> -
    -
    -
    - -
    -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/pagination.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/pagination.php deleted file mode 100644 index 7cac2e7b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/pagination.php +++ /dev/null @@ -1,16 +0,0 @@ - -
    - 'purchase_history', - 'total' => ceil( $count / $number ), - ) - ); - ?> -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/pending.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/pending.php deleted file mode 100644 index 830a309b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/pending.php +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/receipt-files.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/receipt-files.php deleted file mode 100644 index e550d7d0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/receipt-files.php +++ /dev/null @@ -1,73 +0,0 @@ -is_deliverable() || ! edd_receipt_show_download_files( $item->product_id, $edd_receipt_args, $item ) ) { - return; -} -$download_files = edd_get_download_files( $item->product_id, $item->price_id ); -?> -
      - $file ) : - ?> -
    • - -
    • - product_id The product ID. - * @param int $order->id The order ID. - */ - do_action( 'edd_order_receipt_files', $filekey, $file, $item->product_id, $order->id ); - endforeach; - elseif ( edd_is_bundled_product( $item->product_id ) ) : - $bundled_products = edd_get_bundled_products( $item->product_id, $item->price_id ); - - foreach ( $bundled_products as $bundle_item ) : - ?> - -
    • - -
        - $file ) : - ?> -
      • - -
      • - product_id The product ID. - * @param array $bundle_item The array of information about the bundled item. - * @param int $order->id The order ID. - */ - do_action( 'edd_order_receipt_bundle_files', $filekey, $file, $item->product_id, $bundle_item, $order->id ); - endforeach; - else : - echo '
      • ' . esc_html__( 'No downloadable files found for this bundled item.', 'easy-digital-downloads' ) . '
      • '; - endif; - ?> -
      -
    • - ' . esc_html( apply_filters( 'edd_receipt_no_files_found_text', __( 'No downloadable files found.', 'easy-digital-downloads' ), $item->product_id ) ) . ''; - endif; - ?> -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/receipt-item.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/receipt-item.php deleted file mode 100644 index ec110ba9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/receipt-item.php +++ /dev/null @@ -1,48 +0,0 @@ -
    -
    -
    - product_name ); - - if ( ! empty( $item->status ) && 'complete' !== $item->status ) { - echo ' – ' . esc_html( edd_get_status_label( $item->status ) ); - } - ?> -
    - product_id ); - if ( ! empty( $notes ) ) : - ?> -
    - -
    - - product_id ) ); ?> -
    - - -
    - - quantity ); ?> -
    - -
    -
    - total, $order->currency ) ); ?> -
    -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/receipt-items.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/receipt-items.php deleted file mode 100644 index 6b339fd7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/receipt-items.php +++ /dev/null @@ -1,32 +0,0 @@ - - -
    - -
    - - get_items(); -if ( empty( $order_items ) ) { - return; -} -?> - -

    - -
    - $item ) { - // Skip this item if we can't view it. - if ( ! apply_filters( 'edd_user_can_view_receipt_item', true, $item ) ) { - continue; - } - include 'receipt-item.php'; - } - ?> -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/totals.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/totals.php deleted file mode 100644 index 12b2d4f2..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/orders/totals.php +++ /dev/null @@ -1,77 +0,0 @@ - -
    -
    -
    :
    -
    get_number() ); ?>
    -
    - -
    -
    :
    -
    status ) ); ?>
    -
    - - -
    -
    :
    -
    payment_key ); ?>
    -
    - - - -
    -
    :
    -
    gateway ) ); ?>
    -
    - - -
    -
    :
    -
    utils->date( $order->date_created, null, true )->toDateTimeString() ) ); ?>
    -
    - -
    -
    :
    -
    - id ) ); ?> -
    -
    - - - - tax > 0 ) : ?> -
    -
    :
    -
    id ) ); ?>
    -
    - - - -
    -
    :
    -
    id ) ); ?>
    -
    - - -
    - -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/terms.php b/wp-content/plugins/easy-digital-downloads/includes/blocks/views/terms.php deleted file mode 100644 index d493c4d9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/blocks/views/terms.php +++ /dev/null @@ -1,46 +0,0 @@ - -
    - terms as $term ) : - $term_description = term_description( $term->term_id, $term->taxonomy ); - $attachment_id = get_term_meta( $term->term_id, 'download_term_image', true ); - ?> -
    - -
    - - - -
    - - - -
    -

    name ); ?>

    - - (count ); ?>) - -
    - - - -
    - -
    - -
    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/cart/actions.php b/wp-content/plugins/easy-digital-downloads/includes/cart/actions.php deleted file mode 100644 index 19c34896..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/cart/actions.php +++ /dev/null @@ -1,193 +0,0 @@ -query_vars['edd-add'] ) ) { - $download_id = absint( $wp_query->query_vars['edd-add'] ); - $cart = edd_add_to_cart( $download_id, array() ); - - edd_redirect( edd_get_checkout_uri() ); - } - - // Removes an item from the cart with a /edd-remove/# URL. - if ( isset( $wp_query->query_vars['edd-remove'] ) ) { - $cart_key = absint( $wp_query->query_vars['edd-remove'] ); - $cart = edd_remove_from_cart( $cart_key ); - - edd_redirect( edd_get_checkout_uri() ); - } -} -add_action( 'template_redirect', 'edd_process_cart_endpoints', 100 ); - -/** - * Process the 'Add to Cart' request. - * - * @since 1.0 - * - * @param array $data - */ -function edd_process_add_to_cart( $data ) { - $download_id = ! empty( $data['download_id'] ) ? absint( $data['download_id'] ) : false; - $options = isset( $data['edd_options'] ) ? (array) $data['edd_options'] : array(); - - if ( ! empty( $data['edd_download_quantity'] ) ) { - $options['quantity'] = absint( $data['edd_download_quantity'] ); - } - - if ( isset( $options['price_id'] ) && is_array( $options['price_id'] ) ) { - foreach ( $options['price_id'] as $key => $price_id ) { - $options['quantity'][ $key ] = isset( $data[ 'edd_download_quantity_' . $price_id ] ) ? absint( $data[ 'edd_download_quantity_' . $price_id ] ) : 1; - } - } - - if ( ! empty( $download_id ) ) { - edd_add_to_cart( $download_id, $options ); - } - - if ( edd_straight_to_checkout() && ! edd_is_checkout() ) { - $query_args = remove_query_arg( array( 'edd_action', 'download_id', 'edd_options' ) ); - $query_part = strpos( $query_args, "?" ); - $url_parameters = ''; - - if ( false !== $query_part ) { - $url_parameters = substr( $query_args, $query_part ); - } - - edd_redirect( edd_get_checkout_uri() . $url_parameters, 303 ); - } else { - edd_redirect( remove_query_arg( array( 'edd_action', 'download_id', 'edd_options' ) ) ); - } -} -add_action( 'edd_add_to_cart', 'edd_process_add_to_cart' ); - -/** - * Process the 'Remove from Cart' request. - * - * @since 1.0 - * - * @param $data - */ -function edd_process_remove_from_cart( $data ) { - $cart_key = absint( $_GET['cart_item'] ); - - if ( ! isset( $_GET['edd_remove_from_cart_nonce'] ) ) { - edd_debug_log( __( 'Missing nonce when removing an item from the cart. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), true ); - } - - $nonce = ! empty( $_GET['edd_remove_from_cart_nonce'] ) - ? sanitize_text_field( $_GET['edd_remove_from_cart_nonce'] ) - : ''; - - $nonce_verified = wp_verify_nonce( $nonce, 'edd-remove-from-cart-' . $cart_key ); - if ( false !== $nonce_verified ) { - edd_remove_from_cart( $cart_key ); - } - - edd_redirect( remove_query_arg( array( 'edd_action', 'cart_item', 'nocache' ) ) ); -} -add_action( 'edd_remove', 'edd_process_remove_from_cart' ); - -/** - * Process the Remove fee from Cart request. - * - * @since 2.0 - * - * @param $data - */ -function edd_process_remove_fee_from_cart( $data ) { - $fee = sanitize_text_field( $data['fee'] ); - EDD()->fees->remove_fee( $fee ); - edd_redirect( remove_query_arg( array( 'edd_action', 'fee', 'nocache' ) ) ); -} -add_action( 'edd_remove_fee', 'edd_process_remove_fee_from_cart' ); - -/** - * Process the Collection Purchase request. - * - * @since 1.0 - * - * @param $data - */ -function edd_process_collection_purchase( $data ) { - $taxonomy = urldecode( $data['taxonomy'] ); - $terms = urldecode( $data['terms'] ); - - edd_add_collection_to_cart( $taxonomy, $terms ); - edd_redirect( add_query_arg( 'added', '1', remove_query_arg( array( 'edd_action', 'taxonomy', 'terms' ) ) ) ); -} -add_action( 'edd_purchase_collection', 'edd_process_collection_purchase' ); - -/** - * Process cart updates, primarily for quantities. - * - * @since 1.7 - */ -function edd_process_cart_update( $data ) { - if ( ! empty( $data['edd-cart-downloads'] ) && is_array( $data['edd-cart-downloads'] ) ) { - foreach ( $data['edd-cart-downloads'] as $key => $cart_download_id ) { - $options = json_decode( stripslashes( $data[ 'edd-cart-download-' . $key . '-options' ] ), true ); - $quantity = absint( $data[ 'edd-cart-download-' . $key . '-quantity' ] ); - edd_set_cart_item_quantity( $cart_download_id, $quantity, $options ); - } - } -} -add_action( 'edd_update_cart', 'edd_process_cart_update' ); - -/** - * Process cart save. - * - * @since 1.8 - */ -function edd_process_cart_save( $data ) { - $cart = edd_save_cart(); - - if ( ! $cart ) { - edd_redirect( edd_get_checkout_uri() ); - } -} -add_action( 'edd_save_cart', 'edd_process_cart_save' ); - -/** - * Process cart save - * - * @since 1.8 - * @return void - */ -function edd_process_cart_restore( $data ) { - $cart = edd_restore_cart(); - - if ( ! is_wp_error( $cart ) ) { - edd_redirect( edd_get_checkout_uri() ); - } -} -add_action( 'edd_restore_cart', 'edd_process_cart_restore' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/cart/class-edd-cart.php b/wp-content/plugins/easy-digital-downloads/includes/cart/class-edd-cart.php deleted file mode 100644 index abb98474..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/cart/class-edd-cart.php +++ /dev/null @@ -1,1515 +0,0 @@ -get_contents_from_session(); - $this->get_contents(); - $this->get_contents_details(); - $this->get_all_fees(); - $this->get_discounts_from_session(); - $this->get_quantity(); - } - - /** - * Retrieves the tax rate. - * - * This sets up the tax rate once so we don't have to recaculate it each time we need it. - * - * @link https://github.com/easydigitaldownloads/easy-digital-downloads/issues/8455 - * - * @since 3.0 - * @return float - */ - private function get_tax_rate() { - if ( null === $this->tax_rate ) { - $this->tax_rate = edd_use_taxes() ? edd_get_tax_rate() : 0; - } - - return $this->tax_rate; - } - - /** - * Sets the tax rate. - * - * @param float $tax_rate - * - * @since 3.0 - */ - public function set_tax_rate( $tax_rate ) { - $this->tax_rate = $tax_rate; - } - - /** - * Populate the cart with the data stored in the session - * - * @since 2.7 - * @return void - */ - public function get_contents_from_session() { - $cart = EDD()->session->get( 'edd_cart' ); - $this->contents = $cart; - - do_action( 'edd_cart_contents_loaded_from_session', $this ); - } - - /** - * Populate the discounts with the data stored in the session. - * - * @since 2.7 - * @return void - */ - public function get_discounts_from_session() { - $discounts = EDD()->session->get( 'cart_discounts' ); - $this->discounts = $discounts; - - do_action( 'edd_cart_discounts_loaded_from_session', $this ); - } - - /** - * Get cart contents - * - * @since 2.7 - * @return array List of cart contents. - */ - public function get_contents() { - if ( ! did_action( 'edd_cart_contents_loaded_from_session' ) ) { - $this->get_contents_from_session(); - } - - $cart = is_array( $this->contents ) && ! empty( $this->contents ) ? array_values( $this->contents ) : array(); - $cart_count = count( $cart ); - - foreach ( $cart as $key => $item ) { - $download = new EDD_Download( $item['id'] ); - - // If the item is not a download or it's status has changed since it was added to the cart. - if ( empty( $download->ID ) || ! $download->can_purchase() ) { - unset( $cart[ $key ] ); - } - } - - // We've removed items, reset the cart session - if ( count( $cart ) < $cart_count ) { - $this->contents = $cart; - $this->update_cart(); - } - - $this->contents = apply_filters( 'edd_cart_contents', $cart ); - - do_action( 'edd_cart_contents_loaded' ); - - return (array) $this->contents; - } - - /** - * Get cart contents details - * - * @since 2.7 - * @return array - */ - public function get_contents_details() { - global $edd_is_last_cart_item, $edd_flat_discount_total; - - if ( empty( $this->contents ) ) { - return array(); - } - - $details = array(); - $length = count( $this->contents ) - 1; - - foreach ( $this->contents as $key => $item ) { - if( $key >= $length ) { - $edd_is_last_cart_item = true; - } - - $item['quantity'] = edd_item_quantities_enabled() ? absint( $item['quantity'] ) : 1; - $item['quantity'] = max( 1, $item['quantity'] ); // Force quantity to 1 - - $options = isset( $item['options'] ) ? $item['options'] : array(); - - $price_id = isset( $options['price_id'] ) ? $options['price_id'] : null; - - $item_price = $this->get_item_price( $item['id'], $options ); - $discount = $this->get_item_discount_amount( $item ); - $discount = apply_filters( 'edd_get_cart_content_details_item_discount_amount', $discount, $item ); - $quantity = $this->get_item_quantity( $item['id'], $options ); - $fees = $this->get_fees( 'fee', $item['id'], $price_id ); - $subtotal = floatval( $item_price ) * $quantity; - - // Subtotal for tax calculation must exclude fees that are greater than 0. See $this->get_tax_on_fees() - $subtotal_for_tax = $subtotal; - - foreach ( $fees as $fee ) { - - $fee_amount = (float) $fee['amount']; - $subtotal += $fee_amount; - - if( $fee_amount > 0 ) { - continue; - } - - $subtotal_for_tax += $fee_amount; - } - - $tax = $this->get_item_tax( $item['id'], $options, $subtotal_for_tax - $discount ); - - if ( edd_prices_include_tax() ) { - $subtotal -= round( $tax, edd_currency_decimal_filter() ); - } - - $total = $subtotal - $discount + $tax; - - if ( $total < 0 ) { - $total = 0; - } - - $details[ $key ] = array( - 'name' => get_the_title( $item['id'] ), - 'id' => $item['id'], - 'item_number' => $item, - 'item_price' => round( $item_price, edd_currency_decimal_filter() ), - 'quantity' => $quantity, - 'discount' => round( $discount, edd_currency_decimal_filter() ), - 'subtotal' => round( $subtotal, edd_currency_decimal_filter() ), - 'tax' => round( $tax, edd_currency_decimal_filter() ), - 'fees' => $fees, - 'price' => round( $total, edd_currency_decimal_filter() ) - ); - - if ( $edd_is_last_cart_item ) { - $edd_is_last_cart_item = false; - $edd_flat_discount_total = 0.00; - } - } - - $this->details = $details; - - return $this->details; - } - - /** - * Get Discounts. - * - * @since 2.7 - * @return array $discounts The active discount codes - */ - public function get_discounts() { - $this->get_discounts_from_session(); - $this->discounts = ! empty( $this->discounts ) ? explode( '|', $this->discounts ) : array(); - return $this->discounts; - } - - /** - * Update Cart - * - * @since 2.7 - * @return void - */ - public function update_cart() { - EDD()->session->set( 'edd_cart', $this->contents ); - } - - /** - * Checks if any discounts have been applied to the cart - * - * @since 2.7 - * @return bool - */ - public function has_discounts() { - if ( null !== $this->has_discounts ) { - return $this->has_discounts; - } - - $has_discounts = false; - - $discounts = $this->get_discounts(); - if ( ! empty( $discounts ) ) { - $has_discounts = true; - } - - $this->has_discounts = apply_filters( 'edd_cart_has_discounts', $has_discounts ); - - return $this->has_discounts; - } - - /** - * Get quantity - * - * @since 2.7 - * @return int - */ - public function get_quantity() { - $total_quantity = 0; - - $contents = $this->get_contents(); - if ( ! empty( $contents ) ) { - $quantities = wp_list_pluck( $this->contents, 'quantity' ); - $total_quantity = absint( array_sum( $quantities ) ); - } - - $this->quantity = apply_filters( 'edd_get_cart_quantity', $total_quantity, $this->contents ); - return $this->quantity; - } - - /** - * Checks if the cart is empty - * - * @since 2.7 - * @return boolean - */ - public function is_empty() { - return 0 === count( (array) $this->get_contents() ); - } - - /** - * Add to cart - * - * As of EDD 2.7, items can only be added to the cart when the object passed extends EDD_Cart_Item - * - * @since 2.7 - * @return array $cart Updated cart object - */ - public function add( $download_id, $options = array() ) { - $download = new EDD_Download( $download_id ); - - if ( empty( $download->ID ) ) { - return; // Not a download product - } - - if ( ! $download->can_purchase() ) { - return; // Do not allow draft/pending to be purchased if can't edit. Fixes #1056 - } - - do_action( 'edd_pre_add_to_cart', $download_id, $options ); - - /** - * Pre-Add to Cart Contents. - * - * Prior to adding the new item to the cart, allow filtering of the current contents - * - * @since - * @since 3.0 Added the additional $download_id and $options arguments. - * - * @param array The current cart contents. - * @param int The download ID being added to the cart. - * @param array The options for the item being added including but not limited to quantity. - */ - $this->contents = apply_filters( 'edd_pre_add_to_cart_contents', $this->contents, $download_id, $options ); - - $quantities_enabled = edd_item_quantities_enabled() && ! edd_download_quantities_disabled( $download_id ); - - if ( $download->has_variable_prices() && ! isset( $options['price_id'] ) ) { - // Forces to the default price ID if none is specified and download has variable prices - $options['price_id'] = $download->get_default_price_id(); - } - - if ( isset( $options['quantity'] ) ) { - if ( is_array( $options['quantity'] ) ) { - $quantity = array(); - foreach ( $options['quantity'] as $q ) { - $quantity[] = $quantities_enabled ? absint( preg_replace( '/[^0-9\.]/', '', $q ) ) : 1; - } - } else { - $quantity = $quantities_enabled ? absint( preg_replace( '/[^0-9\.]/', '', $options['quantity'] ) ) : 1; - } - - unset( $options['quantity'] ); - } else { - $quantity = 1; - } - - // If the price IDs are a string and is a coma separated list, make it an array (allows custom add to cart URLs) - if ( isset( $options['price_id'] ) && ! is_array( $options['price_id'] ) && false !== strpos( $options['price_id'], ',' ) ) { - $options['price_id'] = explode( ',', $options['price_id'] ); - } - - $items = array(); - - if ( isset( $options['price_id'] ) && is_array( $options['price_id'] ) ) { - // Process multiple price options at once - foreach ( $options['price_id'] as $key => $price ) { - $items[] = array( - 'id' => $download_id, - 'options' => array( - 'price_id' => preg_replace( '/[^0-9\.-]/', '', $price ) - ), - 'quantity' => is_array( $quantity ) && isset( $quantity[ $key ] ) ? $quantity[ $key ] : $quantity, - ); - } - } else { - // Sanitize price IDs - foreach( $options as $key => $option ) { - if ( 'price_id' == $key ) { - $options[ $key ] = preg_replace( '/[^0-9\.-]/', '', $option ); - } - } - - // Add a single item - $items[] = array( - 'id' => $download_id, - 'options' => $options, - 'quantity' => $quantity - ); - } - - foreach ( $items as &$item ) { - $item = apply_filters( 'edd_add_to_cart_item', $item ); - $to_add = $item; - - if ( ! is_array( $to_add ) ) { - return; - } - - if ( ! isset( $to_add['id'] ) || empty( $to_add['id'] ) ) { - return; - } - - if ( edd_item_in_cart( $to_add['id'], $to_add['options'] ) && edd_item_quantities_enabled() ) { - $key = edd_get_item_position_in_cart( $to_add['id'], $to_add['options'] ); - - if ( is_array( $quantity ) ) { - $this->contents[ $key ]['quantity'] += $quantity[ $key ]; - } else { - $this->contents[ $key ]['quantity'] += $quantity; - } - } else { - $this->contents[] = $to_add; - } - } - - unset( $item ); - - $this->update_cart(); - - do_action( 'edd_post_add_to_cart', $download_id, $options, $items ); - - // Clear all the checkout errors, if any - edd_clear_errors(); - - return count( $this->contents ) - 1; - } - - /** - * Remove from cart - * - * @since 2.7 - * - * @param int $key Cart key to remove. This key is the numerical index of the item contained within the cart array. - * @return array Updated cart contents - */ - public function remove( $key ) { - $cart = $this->get_contents(); - - do_action( 'edd_pre_remove_from_cart', $key ); - - if ( ! is_array( $cart ) ) { - return true; // Empty cart - } else { - $item_id = isset( $cart[ $key ]['id'] ) ? $cart[ $key ]['id'] : null; - unset( $cart[ $key ] ); - } - - $this->contents = $cart; - $this->update_cart(); - - do_action( 'edd_post_remove_from_cart', $key, $item_id ); - - edd_clear_errors(); - - return $this->contents; - } - - /** - * Generate the URL to remove an item from the cart. - * - * @since 2.7 - * - * @param int $cart_key Cart item key - * @return string $remove_url URL to remove the cart item - */ - public function remove_item_url( $cart_key ) { - - $current_page = edd_doing_ajax() - ? edd_get_checkout_uri() - : edd_get_current_page_url(); - - $remove_url = edd_add_cache_busting( add_query_arg( array( - 'cart_item' => urlencode( $cart_key ), - 'edd_action' => 'remove', - ), $current_page ) ); - - return apply_filters( 'edd_remove_item_url', $remove_url ); - } - - /** - * Generate the URL to remove a fee from the cart. - * - * @since 2.7 - * - * @param int $fee_id Fee ID. - * @return string $remove_url URL to remove the cart item - */ - public function remove_fee_url( $fee_id = '' ) { - - $current_page = edd_doing_ajax() - ? edd_get_checkout_uri() - : edd_get_current_page_url(); - - $remove_url = add_query_arg( array( - 'fee' => urlencode( $fee_id ), - 'edd_action' => 'remove_fee', - 'nocache' => 'true' - ), $current_page ); - - return apply_filters( 'edd_remove_fee_url', $remove_url ); - } - - /** - * Empty the cart - * - * @since 2.7 - * @return void - */ - public function empty_cart() { - - // Remove cart contents. - EDD()->session->set( 'edd_cart', NULL ); - - // Remove all cart fees. - EDD()->session->set( 'edd_cart_fees', NULL ); - - // Remove any resuming payments. - EDD()->session->set( 'edd_resume_payment', NULL ); - - // Remove any active discounts - $this->remove_all_discounts(); - $this->contents = array(); - - do_action( 'edd_empty_cart' ); - } - - /** - * Remove discount from the cart - * - * @since 2.7 - * @return array Discount codes - */ - public function remove_discount( $code = '' ) { - if ( empty( $code ) ) { - return; - } - - if ( $this->discounts ) { - $key = array_search( $code, $this->discounts ); - - if ( false !== $key ) { - unset( $this->discounts[ $key ] ); - } - - $this->discounts = implode( '|', array_values( $this->discounts ) ); - - // update the active discounts - EDD()->session->set( 'cart_discounts', $this->discounts ); - } - - do_action( 'edd_cart_discount_removed', $code, $this->discounts ); - do_action( 'edd_cart_discounts_updated', $this->discounts ); - - return $this->discounts; - } - - /** - * Remove all discount codes - * - * @since 2.7 - * @return void - */ - public function remove_all_discounts() { - EDD()->session->set( 'cart_discounts', null ); - do_action( 'edd_cart_discounts_removed' ); - } - - /** - * Get the discounted amount on a price - * - * @since 2.7 - * @since 3.0 Use `edd_get_item_discount_amount()` for calculations. - * - * @param array $item Cart item. - * @param bool|string $discount False to use the cart discounts or a string to check with a discount code. - * @return float The discounted amount - */ - public function get_item_discount_amount( $item = array(), $discount = false ) { - // Validate item. - if ( empty( $item ) || empty( $item['id'] ) ) { - return 0; - } - - if ( ! isset( $item['quantity'] ) ) { - return 0; - } - - if ( ! isset( $item['options'] ) ) { - $item['options'] = array(); - - /* - * Support for variable pricing when calling `edd_get_cart_item_discount_amount()` - * @link https://github.com/easydigitaldownloads/easy-digital-downloads/issues/8246 - */ - if ( isset( $item['item_number']['options'] ) ) { - $item['options'] = $item['item_number']['options']; - } - } - - $discounts = false === $discount - ? $this->get_discounts() - : array( $discount ); - - $item_price = $this->get_item_price( $item['id'], $item['options'] ); - $discount_amount = edd_get_item_discount_amount( $item, $this->get_contents(), $discounts, $item_price ); - - $discounted_amount = ( $item_price - $discount_amount ); - - /** - * Filters the amount to be discounted from the original cart item amount. - * - * @since unknown - * - * @param float $discounted_amount Amount to be discounted from the cart item amount. - * @param string[] $discounts Discount codes applied to the Cart. - * @param array $item Cart item. - * @param float $item_price Cart item price. - */ - $discounted_amount = apply_filters( - 'edd_get_cart_item_discounted_amount', - $discounted_amount, - $discounts, - $item, - $item_price - ); - - // Recalculate using the legacy filter discounted amount. - $discount_amount = round( ( $item_price - $discounted_amount ), edd_currency_decimal_filter() ); - - return $discount_amount; - } - - /** - * Shows the fully formatted cart discount - * - * @since 2.7 - * - * @param bool $echo Echo? - * @return string $amount Fully formatted cart discount - */ - public function display_cart_discount( $echo = false ) { - $discounts = $this->get_discounts(); - - if ( empty( $discounts ) ) { - return false; - } - - $discount_id = edd_get_discount_id_by_code( $discounts[0] ); - $amount = edd_format_discount_rate( edd_get_discount_type( $discount_id ), edd_get_discount_amount( $discount_id ) ); - - if ( $echo ) { - echo esc_html( $amount ); - } - - return $amount; - } - - /** - * Checks to see if an item is in the cart. - * - * @since 2.7 - * - * @param int $download_id Download ID of the item to check. - * @param array $options - * @return bool - */ - public function is_item_in_cart( $download_id = 0, $options = array() ) { - $cart = $this->get_contents(); - - $ret = false; - - if ( is_array( $cart ) ) { - foreach ( $cart as $item ) { - if ( $item['id'] == $download_id ) { - if ( isset( $options['price_id'] ) && isset( $item['options']['price_id'] ) ) { - if ( $options['price_id'] == $item['options']['price_id'] ) { - $ret = true; - break; - } - } else { - $ret = true; - break; - } - } - } - } - - return (bool) apply_filters( 'edd_item_in_cart', $ret, $download_id, $options ); - } - - /** - * Get the position of an item in the cart - * - * @since 2.7 - * - * @param int $download_id Download ID of the item to check. - * @param array $options - * @return mixed int|false - */ - public function get_item_position( $download_id = 0, $options = array() ) { - $cart = $this->get_contents(); - - if ( ! is_array( $cart ) ) { - return false; - } else { - foreach ( $cart as $position => $item ) { - if ( $item['id'] == $download_id ) { - if ( isset( $options['price_id'] ) && isset( $item['options']['price_id'] ) ) { - if ( (int) $options['price_id'] == (int) $item['options']['price_id'] ) { - return $position; - } - } else { - return $position; - } - } - } - } - - return false; - } - - /** - * Get the quantity of an item in the cart. - * - * @since 2.7 - * - * @param int $download_id Download ID of the item - * @param array $options - * @return int Numerical index of the position of the item in the cart - */ - public function get_item_quantity( $download_id = 0, $options = array() ) { - $key = $this->get_item_position( $download_id, $options ); - - $quantity = isset( $this->contents[ $key ]['quantity'] ) && edd_item_quantities_enabled() ? $this->contents[ $key ]['quantity'] : 1; - - if ( $quantity < 1 ) { - $quantity = 1; - } - - return absint( apply_filters( 'edd_get_cart_item_quantity', $quantity, $download_id, $options ) ); - } - - /** - * Set the quantity of an item in the cart. - * - * @since 2.7 - * - * @param int $download_id Download ID of the item - * @param int $quantity Updated quantity of the item - * @param array $options - * @return array $contents Updated cart object. - */ - public function set_item_quantity( $download_id = 0, $quantity = 1, $options = array() ) { - $key = $this->get_item_position( $download_id, $options ); - - if ( false === $key ) { - return $this->contents; - } - - if ( $quantity < 1 ) { - $quantity = 1; - } - - $this->contents[ $key ]['quantity'] = $quantity; - $this->update_cart(); - - do_action( 'edd_after_set_cart_item_quantity', $download_id, $quantity, $options, $this->contents ); - - return $this->contents; - } - - /** - * Cart Item Price. - * - * @since 2.7 - * - * @param int $item_id Download (cart item) ID number - * @param array $options Optional parameters, used for defining variable prices - * @return string Fully formatted price - */ - public function item_price( $item_id = 0, $options = array() ) { - $price = $this->get_item_price( $item_id, $options ); - $label = ''; - - $price_id = isset( $options['price_id'] ) ? $options['price_id'] : false; - - if ( ! edd_is_free_download( $item_id, $price_id ) && ! edd_download_is_tax_exclusive( $item_id ) ) { - if ( edd_prices_show_tax_on_checkout() && ! edd_prices_include_tax() ) { - $price += edd_get_cart_item_tax( $item_id, $options, $price ); - } - - if ( ! edd_prices_show_tax_on_checkout() && edd_prices_include_tax() ) { - $price -= edd_get_cart_item_tax( $item_id, $options, $price ); - } - - if ( edd_display_tax_rate() ) { - $label = ' – '; - - if ( edd_prices_show_tax_on_checkout() ) { - $label .= sprintf( __( 'includes %s tax', 'easy-digital-downloads' ), edd_get_formatted_tax_rate() ); - } else { - $label .= sprintf( __( 'excludes %s tax', 'easy-digital-downloads' ), edd_get_formatted_tax_rate() ); - } - - $label = apply_filters( 'edd_cart_item_tax_description', $label, $item_id, $options ); - } - } - - $price = edd_currency_filter( edd_format_amount( $price ) ); - - return apply_filters( 'edd_cart_item_price_label', $price . $label, $item_id, $options ); - } - - /** - * Gets the price of the cart item. Always exclusive of taxes. - * - * Do not use this for getting the final price (with taxes and discounts) of an item. - * Use edd_get_cart_item_final_price() - * - * @since 2.7 - * - * @param int $download_id Download ID for the cart item - * @param array $options Optional parameters, used for defining variable prices - * @param bool $remove_tax_from_inclusive Remove the tax amount from tax inclusive priced products. - * @return float|bool Price for this item - */ - public function get_item_price( $download_id = 0, $options = array(), $remove_tax_from_inclusive = false ) { - $price = 0; - $variable_prices = edd_has_variable_prices( $download_id ); - - if ( $variable_prices ) { - $prices = edd_get_variable_prices( $download_id ); - - if ( $prices ) { - if ( ! empty( $options ) ) { - $price = isset( $prices[ $options['price_id'] ] ) ? $prices[ $options['price_id'] ]['amount'] : false; - } else { - $price = false; - } - } - } - - if ( ! $variable_prices || false === $price ) { - // Get the standard Download price if not using variable prices - $price = edd_get_download_price( $download_id ); - } - - if ( $remove_tax_from_inclusive && edd_prices_include_tax() ) { - $price -= $this->get_item_tax( $download_id, $options, $price ); - } - - return apply_filters( 'edd_cart_item_price', $price, $download_id, $options ); - } - - /** - * Final Price of Item in Cart (incl. discounts and taxes) - * - * @since 2.7 - * - * @param int $item_key Cart item key - * @return float Final price for the item - */ - public function get_item_final_price( $item_key = 0 ) { - $final_price = $this->details[ $item_key ]['price']; - - return apply_filters( 'edd_cart_item_final_price', $final_price, $item_key ); - } - - /** - * Calculate the tax for an item in the cart. - * - * @since 2.7 - * - * @param array $download_id Download ID - * @param array $options Cart item options - * @param float $subtotal Cart item subtotal - * @return float Tax amount - */ - public function get_item_tax( $download_id = 0, $options = array(), $subtotal = '' ) { - $tax = 0; - - if ( ! edd_download_is_tax_exclusive( $download_id ) ) { - $country = ! empty( $_POST['billing_country'] ) ? $_POST['billing_country'] : false; - $state = ! empty( $_POST['card_state'] ) ? $_POST['card_state'] : false; - - $tax = edd_calculate_tax( $subtotal, $country, $state, true, $this->get_tax_rate() ); - } - - $tax = max( $tax, 0 ); - - return apply_filters( 'edd_get_cart_item_tax', $tax, $download_id, $options, $subtotal ); - } - - /** - * Get Cart Fees - * - * @since 2.7 - * @return array Cart fees - */ - public function get_fees( $type = 'all', $download_id = 0, $price_id = null ) { - return EDD()->fees->get_fees( $type, $download_id, $price_id ); - } - - /** - * Get All Cart Fees. - * - * @since 2.7 - * @return array - */ - public function get_all_fees() { - $this->fees = EDD()->fees->get_fees( 'all' ); - return $this->fees; - } - - /** - * Get Cart Items Subtotal. - * - * @since 2.7 - * - * @param array $items Cart items array - * @return float items subtotal - */ - public function get_items_subtotal( $items ) { - $subtotal = 0.00; - - if ( is_array( $items ) && ! empty( $items ) ) { - $prices = wp_list_pluck( $items, 'subtotal' ); - - if ( is_array( $prices ) ) { - $subtotal = array_sum( $prices ); - } else { - $subtotal = 0.00; - } - - if ( $subtotal < 0 ) { - $subtotal = 0.00; - } - } - - $this->subtotal = apply_filters( 'edd_get_cart_items_subtotal', $subtotal ); - - return $this->subtotal; - } - - /** - * Get Discountable Subtotal. - * - * @since 2.7 - * @return float Total discountable amount before taxes - */ - public function get_discountable_subtotal( $code_id ) { - $cart_items = $this->get_contents_details(); - $items = array(); - - $excluded_products = edd_get_discount_excluded_products( $code_id ); - - if ( $cart_items ) { - foreach( $cart_items as $item ) { - if ( ! in_array( $item['id'], $excluded_products ) ) { - $items[] = $item; - } - } - } - - $subtotal = $this->get_items_subtotal( $items ); - - return apply_filters( 'edd_get_cart_discountable_subtotal', $subtotal ); - } - - /** - * Get Discounted Amount. - * - * @since 2.7 - * - * @param bool $discounts Discount codes - * @return float|mixed|void Total discounted amount - */ - public function get_discounted_amount( $discounts = false ) { - $amount = 0.00; - $items = $this->get_contents_details(); - - if ( $items ) { - $discounts = wp_list_pluck( $items, 'discount' ); - - if ( is_array( $discounts ) ) { - $discounts = array_map( 'floatval', $discounts ); - $amount = array_sum( $discounts ); - } - } - - return apply_filters( 'edd_get_cart_discounted_amount', $amount ); - } - - /** - * Get Cart Subtotal. - * - * Gets the total price amount in the cart before taxes and before any discounts. - * - * @since 2.7 - * - * @return float Total amount before taxes - */ - public function get_subtotal() { - $items = $this->get_contents_details(); - $subtotal = $this->get_items_subtotal( $items ); - - return apply_filters( 'edd_get_cart_subtotal', $subtotal ); - } - - /** - * Subtotal (before taxes). - * - * @since 2.7 - * @return float Total amount before taxes fully formatted - */ - public function subtotal() { - return esc_html( edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ) ); - } - - /** - * Get Total Cart Amount. - * - * @since 2.7 - * - * @param bool $discounts Array of discounts to apply (needed during AJAX calls) - * @return float Cart amount - */ - public function get_total( $discounts = false ) { - $subtotal = (float) $this->get_subtotal(); - $discounts = (float) $this->get_discounted_amount(); - $fees = (float) $this->get_total_fees(); - $cart_tax = (float) $this->get_tax(); - $total_wo_tax = $subtotal - $discounts + $fees; - $total = $subtotal - $discounts + $cart_tax + $fees; - - if ( $total < 0 || ! $total_wo_tax > 0 ) { - $total = 0.00; - } - - $this->total = (float) apply_filters( 'edd_get_cart_total', $total ); - - return $this->total; - } - - /** - * Fully Formatted Total Cart Amount. - * - * @since 2.7 - * - * @param bool $echo - * @return mixed|string|void - */ - public function total( $echo = false ) { - $total = apply_filters( 'edd_cart_total', edd_currency_filter( edd_format_amount( $this->get_total() ) ) ); - - if ( $echo ) { - echo esc_html( $total ); - } - - return $total; - } - - /** - * Get Cart Fee Total - * - * @since 2.7 - * @return double - */ - public function get_total_fees() { - $fee_total = 0.00; - - foreach ( $this->get_fees() as $fee ) { - - // Since fees affect cart item totals, we need to not count them towards the cart total if there is an association. - if ( ! empty( $fee['download_id'] ) ) { - continue; - } - - $fee_total += $fee['amount']; - } - - return apply_filters( 'edd_get_fee_total', $fee_total, $this->fees ); - } - - /** - * Get the price ID for an item in the cart. - * - * @since 2.7 - * - * @param array $item Item details - * @return string $price_id Price ID - */ - public function get_item_price_id( $item = array() ) { - if ( isset( $item['item_number'] ) ) { - $price_id = isset( $item['item_number']['options']['price_id'] ) ? $item['item_number']['options']['price_id'] : null; - } else { - $price_id = isset( $item['options']['price_id'] ) ? $item['options']['price_id'] : null; - } - - return $price_id; - } - - /** - * Get the price name for an item in the cart. - * - * @since 2.7 - * - * @param array $item Item details - * @return string $name Price name - */ - public function get_item_price_name( $item = array() ) { - $price_id = (int) $this->get_item_price_id( $item ); - $prices = edd_get_variable_prices( $item['id'] ); - $name = ! empty( $prices[ $price_id ] ) ? $prices[ $price_id ]['name'] : ''; - - return apply_filters( 'edd_get_cart_item_price_name', $name, $item['id'], $price_id, $item ); - } - - /** - * Get the name of an item in the cart. - * - * @since 2.7 - * @since 3.1.2 Updated to use edd_get_download_name() for consistency - * - * @param array $item Item details - * @return string $name Item name - */ - public function get_item_name( $item = array() ) { - $download_id = $item['id']; - $price_id = $this->get_item_price_id( $item ); - - $item_title = edd_get_download_name( $download_id, $price_id ); - - // In the event that we dont' get a name back, use the ID. - if ( empty( $item_title ) ) { - $item_title = $item['id']; - } - - return apply_filters( 'edd_get_cart_item_name', $item_title, $item['id'], $item ); - } - - /** - * Get all applicable tax for the items in the cart - * - * @since 2.7 - * @return float Total tax amount - */ - public function get_tax() { - $cart_tax = 0; - $items = $this->get_contents_details(); - - if ( $items ) { - - $taxes = wp_list_pluck( $items, 'tax' ); - - if ( is_array( $taxes ) ) { - $cart_tax = array_sum( $taxes ); - } - } - $cart_tax += $this->get_tax_on_fees(); - - $subtotal = $this->get_subtotal(); - if ( empty( $subtotal ) ) { - $cart_tax = 0; - } - - $cart_tax = apply_filters( 'edd_get_cart_tax', edd_sanitize_amount( $cart_tax ) ); - - return $cart_tax; - } - - /** - * Gets the total tax amount for the cart contents in a fully formatted way - * - * @since 2.7 - * - * @param boolean $echo Decides if the result should be returned or not - * @return string Total tax amount - */ - public function tax( $echo = false ) { - $cart_tax = $this->get_tax(); - $cart_tax = edd_currency_filter( edd_format_amount( $cart_tax ) ); - - $tax = max( $cart_tax, 0 ); - $tax = apply_filters( 'edd_cart_tax', $cart_tax ); - - if ( $echo ) { - echo esc_html( $tax ); - } - - return $tax; - } - - /** - * Get tax applicable for fees. - * - * @since 2.7 - * @return float Total taxable amount for fees - */ - public function get_tax_on_fees() { - $tax = 0; - $fees = edd_get_cart_fees(); - - if ( $fees ) { - foreach ( $fees as $fee_id => $fee ) { - if ( ! empty( $fee['no_tax'] ) || $fee['amount'] < 0 ) { - continue; - } - - /** - * Fees (at this time) must be exclusive of tax - */ - add_filter( 'edd_prices_include_tax', '__return_false' ); - $tax += edd_calculate_tax( $fee['amount'], '', '', true, $this->get_tax_rate() ); - remove_filter( 'edd_prices_include_tax', '__return_false' ); - } - } - - return apply_filters( 'edd_get_cart_fee_tax', $tax ); - } - - /** - * Is Cart Saving Enabled? - * - * @since 2.7 - * @return bool - */ - public function is_saving_enabled() { - return edd_get_option( 'enable_cart_saving', false ); - } - - /** - * Checks if the cart has been saved - * - * @since 2.7 - * @return bool - */ - public function is_saved() { - if ( ! $this->is_saving_enabled() ) { - return false; - } - - $saved_cart = get_user_meta( get_current_user_id(), 'edd_saved_cart', true ); - - if ( is_user_logged_in() ) { - if ( ! $saved_cart ) { - return false; - } - - if ( $saved_cart === EDD()->session->get( 'edd_cart' ) ) { - return false; - } - - return true; - } else { - if ( ! isset( $_COOKIE['edd_saved_cart'] ) ) { - return false; - } - - if ( json_decode( stripslashes( $_COOKIE['edd_saved_cart'] ), true ) === EDD()->session->get( 'edd_cart' ) ) { - return false; - } - - return true; - } - } - - /** - * Save Cart - * - * @since 2.7 - * @return bool - */ - public function save() { - - // Bail if carts cannot be saved - if ( ! $this->is_saving_enabled() ) { - return false; - } - - // Get cart & cart token - $cart = EDD()->session->get( 'edd_cart' ); - $token = edd_generate_cart_token(); - - if ( is_user_logged_in() ) { - $user_id = get_current_user_id(); - update_user_meta( $user_id, 'edd_saved_cart', $cart, false ); - update_user_meta( $user_id, 'edd_cart_token', $token, false ); - } else { - $cart = json_encode( $cart ); - $expires = time() + WEEK_IN_SECONDS; - @setcookie( 'edd_saved_cart', $cart, $expires, COOKIEPATH, COOKIE_DOMAIN ); - @setcookie( 'edd_cart_token', $token, $expires, COOKIEPATH, COOKIE_DOMAIN ); - } - - // Get all cart messages - $messages = EDD()->session->get( 'edd_cart_messages' ); - - // Make sure it's an array, if empty - if ( empty( $messages ) ) { - $messages = array(); - } - - $checkout_url = add_query_arg( - array( - 'edd_action' => 'restore_cart', - 'edd_cart_token' => sanitize_key( $token ), - ), - edd_get_checkout_uri() - ); - - // Add the success message - $messages['edd_cart_save_successful'] = sprintf( - '%1$s: %2$s %3$s', - __( 'Success', 'easy-digital-downloads' ), - __( 'Cart saved successfully. You can restore your cart using this URL:', 'easy-digital-downloads' ), - esc_url( edd_get_checkout_uri() . '?edd_action=restore_cart&edd_cart_token=' . urlencode( $token ) ) - ); - - // Set these messages in the session - EDD()->session->set( 'edd_cart_messages', $messages ); - - // Return if cart saved - return ! empty( $cart ); - } - - /** - * Restore Cart - * - * @since 2.7 - * @return bool - */ - public function restore() { - if ( ! $this->is_saving_enabled() ) { - return false; - } - - $user_id = get_current_user_id(); - $saved_cart = get_user_meta( $user_id, 'edd_saved_cart', true ); - $token = $this->get_token(); - - if ( is_user_logged_in() && $saved_cart ) { - $messages = EDD()->session->get( 'edd_cart_messages' ); - - if ( ! $messages ) { - $messages = array(); - } - - if ( isset( $_GET['edd_cart_token'] ) && ! hash_equals( $_GET['edd_cart_token'], $token ) ) { - $messages['edd_cart_restoration_failed'] = sprintf( '%1$s: %2$s', __( 'Error', 'easy-digital-downloads' ), __( 'Cart restoration failed. Invalid token.', 'easy-digital-downloads' ) ); - EDD()->session->set( 'edd_cart_messages', $messages ); - } - - delete_user_meta( $user_id, 'edd_saved_cart' ); - delete_user_meta( $user_id, 'edd_cart_token' ); - - if ( isset( $_GET['edd_cart_token'] ) && $_GET['edd_cart_token'] != $token ) { - return new WP_Error( 'invalid_cart_token', __( 'The cart cannot be restored. Invalid token.', 'easy-digital-downloads' ) ); - } - } elseif ( ! is_user_logged_in() && isset( $_COOKIE['edd_saved_cart'] ) && $token ) { - $saved_cart = $_COOKIE['edd_saved_cart']; - - if ( ! hash_equals( $_GET['edd_cart_token'], $token ) ) { - $messages['edd_cart_restoration_failed'] = sprintf( '%1$s: %2$s', __( 'Error', 'easy-digital-downloads' ), __( 'Cart restoration failed. Invalid token.', 'easy-digital-downloads' ) ); - EDD()->session->set( 'edd_cart_messages', $messages ); - - return new WP_Error( 'invalid_cart_token', __( 'The cart cannot be restored. Invalid token.', 'easy-digital-downloads' ) ); - } - - $saved_cart = json_decode( stripslashes( $saved_cart ), true ); - - setcookie( 'edd_saved_cart', '', time()-3600, COOKIEPATH, COOKIE_DOMAIN ); - setcookie( 'edd_cart_token', '', time()-3600, COOKIEPATH, COOKIE_DOMAIN ); - } - - $messages['edd_cart_restoration_successful'] = sprintf( '%1$s: %2$s', __( 'Success', 'easy-digital-downloads' ), __( 'Cart restored successfully.', 'easy-digital-downloads' ) ); - EDD()->session->set( 'edd_cart', $saved_cart ); - EDD()->session->set( 'edd_cart_messages', $messages ); - - // @e also have to set this instance to what the session is. - $this->contents = $saved_cart; - - return true; - } - - /** - * Retrieve a saved cart token. Used in validating saved carts - * - * @since 2.7 - * @return int - */ - public function get_token() { - $user_id = get_current_user_id(); - - if ( is_user_logged_in() ) { - $token = get_user_meta( $user_id, 'edd_cart_token', true ); - } else { - $token = isset( $_COOKIE['edd_cart_token'] ) ? $_COOKIE['edd_cart_token'] : false; - } - - return apply_filters( 'edd_get_cart_token', $token, $user_id ); - } - - /** - * Generate URL token to restore the cart via a URL - * - * @since 2.7 - * @return int - */ - public function generate_token() { - return apply_filters( 'edd_generate_cart_token', md5( mt_rand() . time() ) ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/cart/functions.php b/wp-content/plugins/easy-digital-downloads/includes/cart/functions.php deleted file mode 100644 index 8ec800d3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/cart/functions.php +++ /dev/null @@ -1,676 +0,0 @@ -cart->get_contents(); -} - -/** - * Retrieve the Cart Content Details - * - * Includes prices, tax, etc of all items. - * - * @since 1.0 - * @return array $details Cart content details - */ -function edd_get_cart_content_details() { - return EDD()->cart->get_contents_details(); -} - -/** - * Get Cart Quantity - * - * @since 1.0 - * @return int Sum quantity of items in the cart - */ -function edd_get_cart_quantity() { - return EDD()->cart->get_quantity(); -} - -/** - * Add To Cart - * - * Adds a download ID to the shopping cart. - * - * @since 1.0 - * - * @param int $download_id Download IDs to be added to the cart - * @param array $options Array of options, such as variable price - * - * @return string Cart key of the new item - */ -function edd_add_to_cart( $download_id, $options = array() ) { - return EDD()->cart->add( $download_id, $options ); -} - -/** - * Removes a Download from the Cart - * - * @since 1.0 - * @param int $cart_key the cart key to remove. This key is the numerical index of the item contained within the cart array. - * @return array Updated cart items - */ -function edd_remove_from_cart( $cart_key ) { - return EDD()->cart->remove( $cart_key ); -} - -/** - * Checks to see if an item is already in the cart and returns a boolean - * - * @since 1.0 - * - * @param int $download_id ID of the download to remove - * @param array $options - * @return bool Item in the cart or not? - */ -function edd_item_in_cart( $download_id = 0, $options = array() ) { - return EDD()->cart->is_item_in_cart( $download_id, $options ); -} - -/** - * Get the Item Position in Cart - * - * @since 1.0.7.2 - * - * @param int $download_id ID of the download to get position of - * @param array $options array of price options - * @return bool|int|string false if empty cart | position of the item in the cart - */ -function edd_get_item_position_in_cart( $download_id = 0, $options = array() ) { - return EDD()->cart->get_item_position( $download_id, $options ); -} - -/** - * Check if quantities are enabled - * - * @since 1.7 - * @return bool - */ -function edd_item_quantities_enabled() { - $ret = edd_get_option( 'item_quantities', false ); - return (bool) apply_filters( 'edd_item_quantities_enabled', $ret ); -} - -/** - * Set Cart Item Quantity - * - * @since 1.7 - * - * @param int $download_id Download (cart item) ID number - * @param int $quantity - * @param array $options Download options, such as price ID - * @return mixed New Cart array - */ -function edd_set_cart_item_quantity( $download_id = 0, $quantity = 1, $options = array() ) { - return EDD()->cart->set_item_quantity( $download_id, $quantity, $options ); -} - -/** - * Get Cart Item Quantity - * - * @since 1.0 - * @param int $download_id Download (cart item) ID number - * @param array $options Download options, such as price ID - * @return int $quantity Cart item quantity - */ -function edd_get_cart_item_quantity( $download_id = 0, $options = array() ) { - return EDD()->cart->get_item_quantity( $download_id, $options ); -} - -/** - * Get Cart Item Price - * - * @since 1.0 - * - * @param int $item_id Download (cart item) ID number - * @param array $options Optional parameters, used for defining variable prices - * @return string Fully formatted price - */ -function edd_cart_item_price( $item_id = 0, $options = array() ) { - return EDD()->cart->item_price( $item_id, $options ); -} - -/** - * Get Cart Item Price - * - * Gets the price of the cart item. Always exclusive of taxes - * - * Do not use this for getting the final price (with taxes and discounts) of an item. - * Use edd_get_cart_item_final_price() - * - * @since 1.0 - * @param int $download_id Download ID number - * @param array $options Optional parameters, used for defining variable prices - * @param bool $remove_tax_from_inclusive Remove the tax amount from tax inclusive priced products. - * @return float|bool Price for this item - */ -function edd_get_cart_item_price( $download_id = 0, $options = array(), $remove_tax_from_inclusive = false ) { - return EDD()->cart->get_item_price( $download_id, $options, $remove_tax_from_inclusive ); -} - -/** - * Get cart item's final price - * - * Gets the amount after taxes and discounts - * - * @since 1.9 - * @param int $item_key Cart item key - * @return float Final price for the item - */ -function edd_get_cart_item_final_price( $item_key = 0 ) { - return EDD()->cart->get_item_final_price( $item_key ); -} - -/** - * Get cart item tax - * - * @since 1.9 - * @param array $download_id Download ID - * @param array $options Cart item options - * @param float $subtotal Cart item subtotal - * @return float Tax amount - */ -function edd_get_cart_item_tax( $download_id = 0, $options = array(), $subtotal = '' ) { - return EDD()->cart->get_item_tax( $download_id, $options, $subtotal ); -} - -/** - * Get Price Name - * - * Gets the name of the specified price option, - * for variable pricing only. - * - * @since 1.0 - * - * @param $download_id Download ID number - * @param array $options Optional parameters, used for defining variable prices - * @return mixed|void Name of the price option - */ -function edd_get_price_name( $download_id = 0, $options = array() ) { - $return = false; - - if ( edd_has_variable_prices( $download_id ) && ! empty( $options ) ) { - $prices = edd_get_variable_prices( $download_id ); - $name = false; - - if ( $prices ) { - if ( isset( $prices[ $options['price_id'] ] ) ) { - $name = $prices[ $options['price_id'] ]['name']; - } - } - $return = $name; - } - - return apply_filters( 'edd_get_price_name', $return, $download_id, $options ); -} - -/** - * Get cart item price id - * - * @since 1.0 - * - * @param array $item Cart item array - * @return int Price id - */ -function edd_get_cart_item_price_id( $item = array() ) { - return EDD()->cart->get_item_price_id( $item ); -} - -/** - * Get cart item price name - * - * @since 1.8 - * @param int $item Cart item array - * @return string Price name - */ -function edd_get_cart_item_price_name( $item = array() ) { - return EDD()->cart->get_item_price_name( $item ); -} - -/** - * Get cart item title - * - * @since 2.4.3 - * @param array $item Cart item array - * @return string item title - */ -function edd_get_cart_item_name( $item = array() ) { - return EDD()->cart->get_item_name( $item ); -} - -/** - * Cart Subtotal - * - * Shows the subtotal for the shopping cart (no taxes) - * - * @since 1.4 - * @return float Total amount before taxes fully formatted - */ -function edd_cart_subtotal() { - return EDD()->cart->subtotal(); -} - -/** - * Get Cart Subtotal - * - * Gets the total price amount in the cart before taxes and before any discounts - * uses edd_get_cart_contents(). - * - * @since 1.3.3 - * @return float Total amount before taxes - */ -function edd_get_cart_subtotal() { - return EDD()->cart->get_subtotal(); -} - -/** - * Get Cart Discountable Subtotal. - * - * @return float Total discountable amount before taxes - */ -function edd_get_cart_discountable_subtotal( $code_id ) { - return EDD()->cart->get_discountable_subtotal( $code_id ); -} - -/** - * Get cart items subtotal - * @param array $items Cart items array - * - * @return float items subtotal - */ -function edd_get_cart_items_subtotal( $items ) { - return EDD()->cart->get_items_subtotal( $items ); -} -/** - * Get Total Cart Amount - * - * Returns amount after taxes and discounts - * - * @since 1.4.1 - * @param bool $discounts Array of discounts to apply (needed during AJAX calls) - * @return float Cart amount - */ -function edd_get_cart_total( $discounts = false ) { - return EDD()->cart->get_total( $discounts ); -} - - -/** - * Get Total Cart Amount - * - * Gets the fully formatted total price amount in the cart. - * uses edd_get_cart_amount(). - * - * @since 1.3.3 - * - * @param bool $echo - * @return mixed|string|void - */ -function edd_cart_total( $echo = true ) { - return EDD()->cart->total( $echo ); -} - -/** - * Check if cart has fees applied - * - * Just a simple wrapper function for EDD_Fees::has_fees() - * - * @since 1.5 - * @param string $type - * @uses EDD()->fees->has_fees() - * @return bool Whether the cart has fees applied or not - */ -function edd_cart_has_fees( $type = 'all' ) { - return EDD()->fees->has_fees( $type ); -} - -/** - * Get Cart Fees - * - * Just a simple wrapper function for EDD_Fees::get_fees() - * - * @since 1.5 - * @param string $type - * @param int $download_id - * @uses EDD()->fees->get_fees() - * @return array All the cart fees that have been applied - */ -function edd_get_cart_fees( $type = 'all', $download_id = 0, $price_id = NULL ) { - return EDD()->cart->get_fees( $type, $download_id, $price_id ); -} - -/** - * Get Cart Fee Total - * - * Just a simple wrapper function for EDD_Fees::total() - * - * @since 1.5 - * @uses EDD()->fees->total() - * @return float Total Cart Fees - */ -function edd_get_cart_fee_total() { - return EDD()->cart->get_total_fees(); -} - -/** - * Get cart tax on Fees - * - * @since 2.0 - * @uses EDD()->fees->get_fees() - * @return float Total Cart tax on Fees - */ -function edd_get_cart_fee_tax() { - return EDD()->cart->get_tax_on_fees(); -} - -/** - * Is the cart empty? - * - * @since 3.0 - * @uses EDD()->cart->is_empty() - * @return bool Is the cart empty? - */ -function edd_is_cart_empty() { - return EDD()->cart->is_empty(); -} - -/** - * Get Purchase Summary - * - * Retrieves the purchase summary. - * - * @since 1.0 - * - * @param $purchase_data - * @param bool $email - * @return string - */ -function edd_get_purchase_summary( $purchase_data, $email = true ) { - $summary = ''; - - if ( $email ) { - $summary .= $purchase_data['user_email'] . ' - '; - } - - if ( ! empty( $purchase_data['downloads'] ) ) { - foreach ( $purchase_data['downloads'] as $download ) { - $summary .= get_the_title( $download['id'] ) . ', '; - } - - $summary = substr( $summary, 0, -2 ); - } - - return apply_filters( 'edd_get_purchase_summary', $summary, $purchase_data, $email ); -} - -/** - * Gets the total tax amount for the cart contents - * - * @since 1.2.3 - * - * @return mixed|void Total tax amount - */ -function edd_get_cart_tax() { - return EDD()->cart->get_tax(); -} - -/** - * Gets the tax rate charged on the cart. - * - * @since 2.7 - * @param string $country Country code for tax rate. - * @param string $state State for tax rate. - * @param string $postal_code Postal code for tax rate. Not used by core, but for developers. - * @return float Tax rate. - */ -function edd_get_cart_tax_rate( $country = '', $state = '', $postal_code = '' ) { - $rate = edd_get_tax_rate( $country, $state ); - - return (float) apply_filters( 'edd_get_cart_tax_rate', $rate, $country, $state, $postal_code ); -} - -/** - * Gets the total tax amount for the cart contents in a fully formatted way - * - * @since 1.2.3 - * @param bool $echo Whether to echo the tax amount or not (default: false) - * @return string Total tax amount (if $echo is set to true) - */ -function edd_cart_tax( $echo = false ) { - return EDD()->cart->tax( $echo ); -} - -/** - * Add Collection to Cart - * - * Adds all downloads within a taxonomy term to the cart. - * - * @since 1.0.6 - * @param string $taxonomy Name of the taxonomy - * @param mixed $terms Slug or ID of the term from which to add | An array of terms - * @return array Array of IDs for each item added to the cart - */ -function edd_add_collection_to_cart( $taxonomy, $terms ) { - - // Bail if taxonomy is not a string - if ( ! is_string( $taxonomy ) ) { - return false; - } - - if ( is_numeric( $terms ) ) { - $terms = get_term( $terms, $taxonomy ); - $terms = $terms->slug; - } - - $cart_item_ids = array(); - - $items = get_posts( array( - 'post_type' => 'download', - 'posts_per_page' => -1, - $taxonomy => $terms - ) ); - - if ( ! empty( $items ) ) { - foreach ( $items as $item ) { - edd_add_to_cart( $item->ID ); - $cart_item_ids[] = $item->ID; - } - } - - return $cart_item_ids; -} - -/** - * Returns the URL to remove an item from the cart - * - * @since 1.0 - * @global $post - * @param int $cart_key Cart item key - * @return string $remove_url URL to remove the cart item - */ -function edd_remove_item_url( $cart_key ) { - return EDD()->cart->remove_item_url( $cart_key ); -} - -/** - * Returns the URL to remove an item from the cart - * - * @since 1.0 - * @global $post - * @param string $fee_id Fee ID - * @return string $remove_url URL to remove the cart item - */ -function edd_remove_cart_fee_url( $fee_id = '') { - return EDD()->cart->remove_fee_url( $fee_id ); -} - -/** - * Empties the Cart - * - * @since 1.0 - * @uses EDD()->session->set() - * @return void - */ -function edd_empty_cart() { - EDD()->cart->empty_cart(); -} - -/** - * Store Purchase Data in Sessions - * - * Used for storing info about purchase - * - * @since 1.1.5 - * - * @param $purchase_data - * - * @uses EDD()->session->set() - */ -function edd_set_purchase_session( $purchase_data = array() ) { - EDD()->session->set( 'edd_purchase', $purchase_data ); -} - -/** - * Retrieve Purchase Data from Session - * - * Used for retrieving info about purchase - * after completing a purchase - * - * @since 1.1.5 - * @uses EDD()->session->get() - * @return mixed array | false - */ -function edd_get_purchase_session() { - return EDD()->session->get( 'edd_purchase' ); -} - -/** - * Checks if cart saving has been disabled - * - * @since 1.8 - * @return bool Whether or not cart saving has been disabled - */ -function edd_is_cart_saving_disabled() { - return ! EDD()->cart->is_saving_enabled(); -} - -/** - * Checks if a cart has been saved - * - * @since 1.8 - * @return bool - */ -function edd_is_cart_saved() { - return EDD()->cart->is_saved(); -} - -/** - * Process the Cart Save - * - * @since 1.8 - * @return bool - */ -function edd_save_cart() { - return EDD()->cart->save(); -} - - -/** - * Process the Cart Restoration - * - * @since 1.8 - * @return mixed || false Returns false if cart saving is disabled - */ -function edd_restore_cart() { - return EDD()->cart->restore(); -} - -/** - * Retrieve a saved cart token. Used in validating saved carts - * - * @since 1.8 - * @return int - */ -function edd_get_cart_token() { - return EDD()->cart->get_token(); -} - -/** - * Delete Saved Carts after one week - * - * This function is only intended to be used by WordPress cron. - * - * @since 1.8 - * @global $wpdb - * @return void - */ -function edd_delete_saved_carts() { - global $wpdb; - - // Bail if not in WordPress cron - if ( ! edd_doing_cron() ) { - return; - } - - $start = date( 'Y-m-d', strtotime( '-7 days' ) ); - $carts = $wpdb->get_results( - " - SELECT user_id, meta_key, FROM_UNIXTIME(meta_value, '%Y-%m-%d') AS date - FROM {$wpdb->usermeta} - WHERE meta_key = 'edd_cart_token' - ", ARRAY_A - ); - - if ( $carts ) { - foreach ( $carts as $cart ) { - $user_id = $cart['user_id']; - $meta_value = $cart['date']; - - if ( strtotime( $meta_value ) < strtotime( '-1 week' ) ) { - $wpdb->delete( - $wpdb->usermeta, - array( - 'user_id' => $user_id, - 'meta_key' => 'edd_cart_token' - ) - ); - - $wpdb->delete( - $wpdb->usermeta, - array( - 'user_id' => $user_id, - 'meta_key' => 'edd_saved_cart' - ) - ); - } - } - } -} -add_action( 'edd_weekly_scheduled_events', 'edd_delete_saved_carts' ); - -/** - * Generate URL token to restore the cart via a URL - * - * @since 1.8 - * @return string UNIX timestamp - */ -function edd_generate_cart_token() { - return EDD()->cart->generate_token(); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/cart/template.php b/wp-content/plugins/easy-digital-downloads/includes/cart/template.php deleted file mode 100644 index d0a5ec3d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/cart/template.php +++ /dev/null @@ -1,289 +0,0 @@ -'; - echo '
    '; - do_action( 'edd_checkout_cart_top' ); - edd_get_template_part( 'checkout_cart' ); - do_action( 'edd_checkout_cart_bottom' ); - echo '
    '; - echo ''; - do_action( 'edd_after_checkout_cart' ); -} - -/** - * Renders the Shopping Cart - * - * @since 1.0 - * - * @param bool $echo - * @return string Fully formatted cart - */ -function edd_shopping_cart( $echo = false ) { - ob_start(); - - do_action( 'edd_before_cart' ); - - edd_get_template_part( 'widget', 'cart' ); - - do_action( 'edd_after_cart' ); - - if ( $echo ) { - echo ob_get_clean(); - } else { - return ob_get_clean(); - } -} - -/** - * Get Cart Item Template - * - * @since 1.0 - * @param int $cart_key Cart key - * @param array $item Cart item - * @param bool $ajax AJAX? - * @return string Cart item -*/ -function edd_get_cart_item_template( $cart_key, $item, $ajax = false ) { - global $post; - - $id = is_array( $item ) ? $item['id'] : $item; - - $remove_url = edd_remove_item_url( $cart_key ); - $title = get_the_title( $id ); - $options = !empty( $item['options'] ) ? $item['options'] : array(); - $quantity = edd_get_cart_item_quantity( $id, $options ); - $price = edd_get_cart_item_price( $id, $options ); - - if ( ! empty( $options ) ) { - $title .= ( edd_has_variable_prices( $item['id'] ) ) ? ' - ' . edd_get_price_name( $id, $item['options'] ) : edd_get_price_name( $id, $item['options'] ); - } - - ob_start(); - - edd_get_template_part( 'widget', 'cart-item' ); - - $item = ob_get_clean(); - - $item = str_replace( '{item_title}', $title, $item ); - $item = str_replace( '{item_amount}', edd_currency_filter( edd_format_amount( $price ) ), $item ); - $item = str_replace( '{cart_item_id}', absint( $cart_key ), $item ); - $item = str_replace( '{item_id}', absint( $id ), $item ); - $item = str_replace( '{item_quantity}', absint( $quantity ), $item ); - $item = str_replace( '{remove_url}', esc_url( $remove_url ), $item ); - $subtotal = ''; - if ( $ajax ){ - $subtotal = edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ) ; - } - $item = str_replace( '{subtotal}', $subtotal, $item ); - - return apply_filters( 'edd_cart_item', $item, $id ); -} - -/** - * Returns the Empty Cart Message - * - * @since 1.0 - * @return string Cart is empty message - */ -function edd_empty_cart_message() { - return apply_filters( 'edd_empty_cart_message', '' . __( 'Your cart is empty.', 'easy-digital-downloads' ) . '' ); -} - -/** - * Echoes the Empty Cart Message - * - * @since 1.0 - * @return void - */ -function edd_empty_checkout_cart() { - echo edd_empty_cart_message(); -} -add_action( 'edd_cart_empty', 'edd_empty_checkout_cart' ); - -/* - * Calculate the number of columns in the cart table dynamically. - * - * @since 1.8 - * @return int The number of columns - */ -function edd_checkout_cart_columns() { - global $wp_filter, $wp_version; - - $columns_count = 3; - - if ( ! empty( $wp_filter['edd_checkout_table_header_first'] ) ) { - $header_first_count = 0; - $callbacks = $wp_filter['edd_checkout_table_header_first']->callbacks; - - foreach ( $callbacks as $callback ) { - $header_first_count += count( $callback ); - } - $columns_count += $header_first_count; - } - - if ( ! empty( $wp_filter['edd_checkout_table_header_last'] ) ) { - $header_last_count = 0; - $callbacks = $wp_filter['edd_checkout_table_header_last']->callbacks; - - foreach ( $callbacks as $callback ) { - $header_last_count += count( $callback ); - } - $columns_count += $header_last_count; - } - - return apply_filters( 'edd_checkout_cart_columns', $columns_count ); -} - -/** - * Display the "Save Cart" button on the checkout - * - * @since 1.8 - * @return void - */ -function edd_save_cart_button() { - if ( edd_is_cart_saving_disabled() ) { - return; - } - - $color = edd_get_button_color_class(); - - if ( edd_is_cart_saved() ) : ?> - - - - 'restore_cart', 'edd_cart_token' => urlencode( edd_get_cart_token() ) ) ) ) . '">' . esc_html__( 'Restore Previous Cart.', 'easy-digital-downloads' ) . ''; - } -} -add_action( 'edd_cart_empty', 'edd_empty_cart_restore_cart_link' ); - -/** - * Display the "Save Cart" button on the checkout - * - * @since 1.8 - * @return void - */ -function edd_update_cart_button() { - if ( ! edd_item_quantities_enabled() ) - return; - - $color = edd_get_button_color_class(); -?> - - -session->get( 'edd_cart_messages' ); - - if ( $messages ) { - foreach ( $messages as $message_id => $message ) { - - // Try and detect what type of message this is - if ( strpos( strtolower( $message ), 'error' ) ) { - $type = 'error'; - } elseif ( strpos( strtolower( $message ), 'success' ) ) { - $type = 'success'; - } else { - $type = 'info'; - } - - $classes = apply_filters( 'edd_' . $type . '_class', array( - 'edd_errors', 'edd-alert', 'edd-alert-' . $type - ) ); - - echo '
    '; - // Loop message codes and display messages - echo '

    ' . $message . '

    '; - echo '
    '; - - } - - // Remove all of the cart saving messages - EDD()->session->set( 'edd_cart_messages', null ); - } -} -add_action( 'edd_before_checkout_cart', 'edd_display_cart_messages' ); - -/** - * Show Added To Cart Messages - * - * @since 1.0 - * @param int $download_id Download (Post) ID - * @return void - */ -function edd_show_added_to_cart_messages( $download_id ) { - if ( isset( $_POST['edd_action'] ) && $_POST['edd_action'] == 'add_to_cart' ) { - if ( $download_id != absint( $_POST['download_id'] ) ) - $download_id = absint( $_POST['download_id'] ); - - $alert = '
    ' - . sprintf( __('You have successfully added %s to your shopping cart.','easy-digital-downloads' ), get_the_title( $download_id ) ) - . ' ' . __('Checkout.','easy-digital-downloads' ) . '' - . '
    '; - - echo apply_filters( 'edd_show_added_to_cart_messages', $alert ); - } -} -add_action('edd_after_download_content', 'edd_show_added_to_cart_messages'); diff --git a/wp-content/plugins/easy-digital-downloads/includes/checkout/functions.php b/wp-content/plugins/easy-digital-downloads/includes/checkout/functions.php deleted file mode 100644 index fcab1eac..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/checkout/functions.php +++ /dev/null @@ -1,584 +0,0 @@ -queried_object ); - $is_object_id_set = isset( $wp_query->queried_object_id ); - $is_checkout = is_page( edd_get_option( 'purchase_page' ) ); - - if ( ! $is_object_set ) { - unset( $wp_query->queried_object ); - } elseif ( is_singular() ) { - $content = $wp_query->queried_object->post_content; - } - - if ( ! $is_object_id_set ) { - unset( $wp_query->queried_object_id ); - } - - // If we know this isn't the primary checkout page, check other methods. - if ( ! $is_checkout && isset( $content ) ) { - if ( has_shortcode( $content, 'download_checkout' ) || ( edd_has_core_blocks() && has_block( 'edd/checkout', $content ) ) ) { - $is_checkout = true; - } - } - - return apply_filters( 'edd_is_checkout', $is_checkout ); -} - -/** - * Determines if a user can checkout or not - * - * @since 1.3.3 - * @return bool Can user checkout? - */ -function edd_can_checkout() { - $can_checkout = true; // Always true for now - - return (bool) apply_filters( 'edd_can_checkout', $can_checkout ); -} - -/** - * Get the URL of the Checkout page - * - * @since 1.0.8 - * @param array $args Extra query args to add to the URI - * @return mixed Full URL to the checkout page, if present | null if it doesn't exist - */ -function edd_get_checkout_uri( $args = array() ) { - $uri = false; - - if ( edd_is_checkout() ) { - global $post; - $uri = $post instanceof WP_Post ? get_permalink( $post->ID ) : NULL; - } - - // If we are not on a checkout page, determine the URI from the default. - if ( empty( $uri ) ) { - $uri = edd_get_option( 'purchase_page', false ); - $uri = isset( $uri ) ? get_permalink( $uri ) : NULL; - } - - if ( ! empty( $args ) ) { - // Check for backward compatibility - if ( is_string( $args ) ) { - $args = str_replace( '?', '', $args ); - } - - $args = wp_parse_args( $args ); - - $uri = add_query_arg( $args, $uri ); - } - - $scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin'; - - $ajax_url = admin_url( 'admin-ajax.php', $scheme ); - - if ( ( ! preg_match( '/^https/', $uri ) && preg_match( '/^https/', $ajax_url ) && edd_is_ajax_enabled() ) || edd_is_ssl_enforced() ) { - $uri = preg_replace( '/^http:/', 'https:', $uri ); - } - - if ( edd_get_option( 'no_cache_checkout', false ) ) { - $uri = edd_add_cache_busting( $uri ); - } - - return apply_filters( 'edd_get_checkout_uri', $uri ); -} - -/** - * Send back to checkout. - * - * Used to redirect a user back to the purchase - * page if there are errors present. - * - * @param array $args - * @since 1.0 - * @return Void - */ -function edd_send_back_to_checkout( $args = array() ) { - $redirect = edd_get_checkout_uri(); - - if ( ! empty( $args ) ) { - // Check for backward compatibility - if ( is_string( $args ) ) { - $args = str_replace( '?', '', $args ); - } - - $args = wp_parse_args( $args ); - - $redirect = add_query_arg( $args, $redirect ); - } - - edd_redirect( apply_filters( 'edd_send_back_to_checkout', $redirect, $args ) ); -} - -/** - * Get the URL of the Transaction Failed page - * - * @since 1.3.4 - * @param bool $extras Extras to append to the URL - * @return mixed|void Full URL to the Transaction Failed page, if present, home page if it doesn't exist - */ -function edd_get_failed_transaction_uri( $extras = false ) { - $uri = edd_get_option( 'failure_page', '' ); - $uri = ! empty( $uri ) ? trailingslashit( get_permalink( $uri ) ) : home_url(); - - if ( $extras ) { - $uri .= $extras; - } - - return apply_filters( 'edd_get_failed_transaction_uri', $uri ); -} - -/** - * Determines if we're currently on the Failed Transaction page. - * - * @since 2.1 - * @return bool True if on the Failed Transaction page, false otherwise. - */ -function edd_is_failed_transaction_page() { - $ret = edd_get_option( 'failure_page', false ); - $ret = isset( $ret ) ? is_page( $ret ) : false; - - return apply_filters( 'edd_is_failure_page', $ret ); -} - -/** - * Mark payments as Failed when returning to the Failed Transaction page - * - * @since 1.9.9 - * @return void -*/ -function edd_listen_for_failed_payments() { - - $failed_page = edd_get_option( 'failure_page', 0 ); - - if( ! empty( $failed_page ) && is_page( $failed_page ) && ! empty( $_GET['payment-id'] ) ) { - - $payment_id = absint( $_GET['payment-id'] ); - $payment = get_post( $payment_id ); - $status = edd_get_payment_status( $payment ); - - if ( $status && 'pending' === strtolower( $status ) ) { - edd_update_payment_status( $payment_id, 'failed' ); - } - } -} -add_action( 'template_redirect', 'edd_listen_for_failed_payments' ); - -/** - * Check if a field is required - * - * @param string $field - * @since 1.7 - * @return bool -*/ -function edd_field_is_required( $field = '' ) { - $required_fields = edd_purchase_form_required_fields(); - return array_key_exists( $field, $required_fields ); -} - -/** - * Retrieve an array of banned_emails - * - * @since 2.0 - * @return array - */ -function edd_get_banned_emails() { - $banned = edd_get_option( 'banned_emails', array() ); - $emails = ! is_array( $banned ) - ? explode( "\n", $banned ) - : $banned; - - $emails = array_map( 'trim', $emails ); - - return apply_filters( 'edd_get_banned_emails', $emails ); -} - -/** - * Determines if an email is banned - * - * @since 2.0 - * @param string $email Email to check if is banned. - * @return bool - */ -function edd_is_email_banned( $email = '' ) { - - $email = trim( $email ); - if( empty( $email ) ) { - return false; - } - - $email = strtolower( $email ); - $banned_emails = edd_get_banned_emails(); - - if( ! is_array( $banned_emails ) || empty( $banned_emails ) ) { - return false; - } - - $return = false; - foreach( $banned_emails as $banned_email ) { - - $banned_email = strtolower( $banned_email ); - - if( is_email( $banned_email ) ) { - - // Complete email address - $return = ( $banned_email == $email ? true : false ); - - } elseif ( strpos( $banned_email, '.' ) === 0 ) { - - // TLD block - $return = ( substr( $email, ( strlen( $banned_email ) * -1 ) ) == $banned_email ) ? true : false; - - } else { - - // Domain block - $return = ( stristr( $email, $banned_email ) ? true : false ); - - } - - if( true === $return ) { - break; - } - } - - return apply_filters( 'edd_is_email_banned', $return, $email ); -} - -/** - * Determines if secure checkout pages are enforced - * - * @since 2.0 - * @return bool True if enforce SSL is enabled, false otherwise - */ -function edd_is_ssl_enforced() { - $ssl_enforced = edd_get_option( 'enforce_ssl', false ); - return (bool) apply_filters( 'edd_is_ssl_enforced', $ssl_enforced ); -} - -/** - * Handle redirections for SSL enforced checkouts - * - * @since 2.0 - * @return void - */ -function edd_enforced_ssl_redirect_handler() { - - if ( ! edd_is_ssl_enforced() || ! edd_is_checkout() || is_admin() || is_ssl() ) { - return; - } - - if ( edd_is_checkout() && false !== strpos( edd_get_current_page_url(), 'https://' ) ) { - return; - } - - $uri = "https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; - - edd_redirect( $uri ); -} -add_action( 'template_redirect', 'edd_enforced_ssl_redirect_handler' ); - -/** - * Handle rewriting asset URLs for SSL enforced checkouts - * - * @since 2.0 - * @return void - */ -function edd_enforced_ssl_asset_handler() { - if ( ! edd_is_ssl_enforced() || ! edd_is_checkout() || is_admin() ) { - return; - } - - $filters = array( - 'post_thumbnail_html', - 'wp_get_attachment_url', - 'wp_get_attachment_image_attributes', - 'wp_get_attachment_url', - 'option_stylesheet_url', - 'option_template_url', - 'script_loader_src', - 'style_loader_src', - 'template_directory_uri', - 'stylesheet_directory_uri', - 'site_url' - ); - - $filters = apply_filters( 'edd_enforced_ssl_asset_filters', $filters ); - - foreach ( $filters as $filter ) { - add_filter( $filter, 'edd_enforced_ssl_asset_filter', 1 ); - } -} -add_action( 'template_redirect', 'edd_enforced_ssl_asset_handler' ); - -/** - * Filter filters and convert http to https - * - * @since 2.0 - * @param mixed $content - * @return mixed - */ -function edd_enforced_ssl_asset_filter( $content ) { - - if ( is_array( $content ) ) { - $content = array_map( 'edd_enforced_ssl_asset_filter', $content ); - - } else { - - // Detect if URL ends in a common domain suffix. We want to only affect assets - $extension = untrailingslashit( edd_get_file_extension( $content ) ); - $suffixes = array( - 'br', - 'ca', - 'cn', - 'com', - 'de', - 'dev', - 'edu', - 'fr', - 'in', - 'info', - 'jp', - 'local', - 'mobi', - 'name', - 'net', - 'nz', - 'org', - 'ru', - ); - - if ( ! in_array( $extension, $suffixes ) ) { - $content = str_replace( 'http:', 'https:', $content ); - } - } - - return $content; -} - -/** - * Given a number and algorithm, determine if we have a valid credit card format - * - * @since 2.4 - * @param integer $number The Credit Card Number to validate - * @return bool If the card number provided matches a specific format of a valid card - */ -function edd_validate_card_number_format( $number = 0 ) { - - $number = trim( $number ); - if ( empty( $number ) ) { - return false; - } - - if ( ! is_numeric( $number ) ) { - return false; - } - - $is_valid_format = false; - - // First check if it passes with the passed method, Luhn by default - $is_valid_format = edd_validate_card_number_format_luhn( $number ); - - // Run additional checks before we start the regexing and looping by type - $is_valid_format = apply_filters( 'edd_valiate_card_format_pre_type', $is_valid_format, $number ); - - if ( true === $is_valid_format ) { - // We've passed our method check, onto card specific checks - $card_type = edd_detect_cc_type( $number ); - $is_valid_format = ! empty( $card_type ) ? true : false; - } - - return apply_filters( 'edd_cc_is_valid_format', $is_valid_format, $number ); -} - -/** - * Validate credit card number based on the luhn algorithm - * - * @since 2.4 - * @param string $number - * @return bool - */ -function edd_validate_card_number_format_luhn( $number ) { - - // Strip any non-digits (useful for credit card numbers with spaces and hyphens) - $number = preg_replace( '/\D/', '', $number ); - - // Set the string length and parity - $length = strlen( $number ); - $parity = $length % 2; - - // Loop through each digit and do the math - $total = 0; - for ( $i = 0; $i < $length; $i++ ) { - $digit = $number[ $i ]; - - // Multiply alternate digits by two - if ( $i % 2 == $parity ) { - $digit *= 2; - - // If the sum is two digits, add them together (in effect) - if ( $digit > 9 ) { - $digit -= 9; - } - } - - // Total up the digits - $total += $digit; - } - - // If the total mod 10 equals 0, the number is valid - return ( $total % 10 == 0 ) ? true : false; - -} - -/** - * Detect credit card type based on the number and return an - * array of data to validate the credit card number - * - * @since 2.4 - * @param string $number - * @return string|bool - */ -function edd_detect_cc_type( $number ) { - - $return = false; - - $card_types = array( - array( - 'name' => 'amex', - 'pattern' => '/^3[4|7]/', - 'valid_length' => array( 15 ), - ), - array( - 'name' => 'diners_club_carte_blanche', - 'pattern' => '/^30[0-5]/', - 'valid_length' => array( 14 ), - ), - array( - 'name' => 'diners_club_international', - 'pattern' => '/^36/', - 'valid_length' => array( 14 ), - ), - array( - 'name' => 'jcb', - 'pattern' => '/^35(2[89]|[3-8][0-9])/', - 'valid_length' => array( 16 ), - ), - array( - 'name' => 'laser', - 'pattern' => '/^(6304|670[69]|6771)/', - 'valid_length' => array( 16, 17, 18, 19 ), - ), - array( - 'name' => 'visa_electron', - 'pattern' => '/^(4026|417500|4508|4844|491(3|7))/', - 'valid_length' => array( 16 ), - ), - array( - 'name' => 'visa', - 'pattern' => '/^4/', - 'valid_length' => array( 16 ), - ), - array( - 'name' => 'mastercard', - 'pattern' => '/^5[1-5]/', - 'valid_length' => array( 16 ), - ), - array( - 'name' => 'maestro', - 'pattern' => '/^(5018|5020|5038|6304|6759|676[1-3])/', - 'valid_length' => array( 12, 13, 14, 15, 16, 17, 18, 19 ), - ), - array( - 'name' => 'discover', - 'pattern' => '/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/', - 'valid_length' => array( 16 ), - ), - ); - - $card_types = apply_filters( 'edd_cc_card_types', $card_types ); - - if ( ! is_array( $card_types ) ) { - return false; - } - - foreach ( $card_types as $card_type ){ - - if ( preg_match( $card_type['pattern'], $number ) ) { - - $number_length = strlen( $number ); - if ( in_array( $number_length, $card_type['valid_length'] ) ) { - $return = $card_type['name']; - break; - } - } - } - - return apply_filters( 'edd_cc_found_card_type', $return, $number, $card_types ); -} - -/** - * Validate credit card expiration date - * - * @since 2.4 - * @param string $exp_month - * @param string $exp_year - * @return bool - */ -function edd_purchase_form_validate_cc_exp_date( $exp_month, $exp_year ) { - - $month_name = date( 'M', mktime( 0, 0, 0, $exp_month, 10 ) ); - $expiration = strtotime( date( 't', strtotime( $month_name . ' ' . $exp_year ) ) . ' ' . $month_name . ' ' . $exp_year . ' 11:59:59PM' ); - - return $expiration >= time(); -} - -/** - * Print the payment icons on the checkout page footer. - * - * @since 3.0 - */ -function edd_print_payment_icons_on_checkout() { - - // Only load icons at EDD Checkout. - if ( ! edd_is_checkout() ) { - return; - } - - // Get payment methods. - $methods = (array) edd_get_option( 'accepted_cards', array() ); - $icons = array_keys( $methods ); - - if ( is_ssl() ) { - $icons[] = 'lock'; - } - - // Bail if no icons. - if ( empty( $icons ) ) { - return; - } - - // Output icons. - edd_print_payment_icons( $icons ); -} -add_action( 'wp_print_footer_scripts', 'edd_print_payment_icons_on_checkout', 9999 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/checkout/pages.php b/wp-content/plugins/easy-digital-downloads/includes/checkout/pages.php deleted file mode 100644 index bd878644..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/checkout/pages.php +++ /dev/null @@ -1,92 +0,0 @@ - $order_id, - 'order' => urlencode( md5( $order_id . $order->payment_key . $order->email ) ), - ); - - return add_query_arg( $query_args, get_permalink( $page_id ) ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/checkout/template.php b/wp-content/plugins/easy-digital-downloads/includes/checkout/template.php deleted file mode 100644 index 1002f63a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/checkout/template.php +++ /dev/null @@ -1,1101 +0,0 @@ -'; - if ( edd_get_cart_contents() || edd_cart_has_fees() ) : - edd_checkout_cart(); ?> -
    - -
    - -
    - -
    - '; - return ob_get_clean(); -} - -/** - * Renders the Purchase Form, hooks are provided to add to the purchase form. - * The default Purchase Form rendered displays a list of the enabled payment - * gateways, a user registration form (if enable) and a credit card info form - * if credit cards are enabled - * - * @since 1.4 - * @return string - */ -function edd_show_purchase_form() { - $payment_mode = edd_get_chosen_gateway(); - - /** - * Hooks in at the top of the purchase form. - * - * @since 1.4 - */ - do_action( 'edd_purchase_form_top' ); - - // Maybe load purchase form. - if ( edd_can_checkout() ) { - - /** - * Fires before the register/login form. - * - * @since 1.4 - */ - do_action( 'edd_purchase_form_before_register_login' ); - - $show_register_form = edd_get_option( 'show_register_form', 'none' ); - if ( ( 'registration' === $show_register_form || ( 'both' === $show_register_form && ! isset( $_GET['login'] ) ) ) && ! is_user_logged_in() ) : ?> -
    - -
    - -
    - -
    - - - 0 ) { - - // Load the credit card form and allow gateways to load their own if they wish. - if ( has_action( 'edd_' . $payment_mode . '_cc_form' ) ) { - do_action( 'edd_' . $payment_mode . '_cc_form' ); - } else { - do_action( 'edd_cc_form' ); - } - } - - /** - * Hooks in after the credit card form. - * - * @since 1.4 - */ - do_action( 'edd_purchase_form_after_cc_form' ); - - // Can't checkout. - } else { - do_action( 'edd_purchase_form_no_access' ); - } - - /** - * Hooks in at the bottom of the purchase form. - * - * @since 1.4 - */ - do_action( 'edd_purchase_form_bottom' ); -} -add_action( 'edd_purchase_form', 'edd_show_purchase_form' ); - -/** - * Shows the User Info fields in the Personal Info box, more fields can be added - * via the hooks provided. - * - * @since 1.3.3 - * @return void - */ -function edd_user_info_fields() { - $customer = EDD()->session->get( 'customer' ); - $customer = wp_parse_args( $customer, array( 'first_name' => '', 'last_name' => '', 'email' => '' ) ); - - if ( is_user_logged_in() ) { - $user_data = get_userdata( get_current_user_id() ); - foreach ( $customer as $key => $field ) { - if ( 'email' === $key && empty( $field ) ) { - $customer[ $key ] = $user_data->user_email; - } elseif ( empty( $field ) ) { - $customer[ $key ] = $user_data->$key; - } - } - } - - $customer = array_map( 'sanitize_text_field', $customer ); - ?> -
    - - -

    - - - /> -

    - -

    - - - aria-describedby="edd-first-description" /> -

    -

    - - - aria-describedby="edd-last-description"/> -

    - - -
    - - - - -
    - - -
    - 'lock', - 'width' => 16, - 'height' => 16, - 'title' => __( 'Secure SSL encrypted payment', 'easy-digital-downloads' ), - 'classes' => array( 'edd-icon', 'edd-icon-lock' ) - ) - ); - ?> - -
    - -

    - - - -

    -

    - - - -

    -

    - - - -

    - -

    - - - - / - -

    - - -
    - session->get( 'customer' ); - - $customer = wp_parse_args( $customer, array( - 'address' => array( - 'line1' => '', - 'line2' => '', - 'city' => '', - 'zip' => '', - 'state' => '', - 'country' => '', - ), - ) ); - - $customer['address'] = array_map( 'sanitize_text_field', $customer['address'] ); - - if ( $logged_in ) { - $user_address = edd_get_customer_address(); - - foreach ( $customer['address'] as $key => $field ) { - if ( empty( $field ) && ! empty( $user_address[ $key ] ) ) { - $customer['address'][ $key ] = $user_address[ $key ]; - } else { - $customer['address'][ $key ] = ''; - } - } - } - - /** - * Filter the billing address details that will be pre-populated on the checkout form.. - * - * @since 2.8 - * - * @param array $address The customer address. - * @param array $customer The customer data from the session - */ - $customer['address'] = apply_filters( 'edd_checkout_billing_details_address', $customer['address'], $customer ); - - ob_start(); ?> -
    - - -

    - - - /> -

    -

    - - - /> -

    -

    - - - /> -

    -

    - - - /> -

    -

    - - - -

    -

    - - - - - - - -

    - - -
    - -
    - - -

    - -

    - - - - -
    - - -

    - - - -

    -

    - - - -

    -

    - - - -

    - -
    - - - - - - - - -
    - -
    - -

    - - -

    - - - - -

    - - -

    - -

    - - -

    - - -
    - -
    - - - -
    - - -
    - - -
    - $gateway ) { - $label = apply_filters( 'edd_gateway_checkout_label_' . $gateway_id, $gateway['checkout_label'] ); - $checked = checked( $gateway_id, $chosen_gateway, false ); - $checked_class = $checked ? 'edd-gateway-option-selected' : ''; - $nonce = ' data-' . esc_attr( $gateway_id ) . '-nonce="' . wp_create_nonce( 'edd-gateway-selected-' . esc_attr( $gateway_id ) ) .'"'; - - echo ''; - } - - do_action( 'edd_payment_mode_after_gateways' ); - ?> -
    - - -
    - -
    -

    - -

    -
    - - -
    - - -
    -
    - - '; - - foreach ( $payment_methods as $key => $option ) { - echo edd_get_payment_image( $key, $option ); - } - - echo '
    '; -} -add_action( 'edd_payment_mode_top', 'edd_show_payment_icons' ); -add_action( 'edd_checkout_form_top', 'edd_show_payment_icons' ); - -/** - * Renders the Discount Code field which allows users to enter a discount code. - * This field is only displayed if there are any active discounts on the site else - * it's not displayed. - * - * @since 1.2.2 - * @return void -*/ -function edd_discount_field() { - if ( isset( $_GET['payment-mode'] ) && edd_is_ajax_disabled() ) { - return; // Only show before a payment method has been selected if ajax is disabled - } - - if ( ! edd_is_checkout() ) { - return; - } - - if ( edd_has_active_discounts() && edd_get_cart_total() ) : - $color = edd_get_button_color_class(); - $style = edd_get_option( 'button_style', 'button' ); ?> -
    - -

    - - - - - - - - -

    -
    - -
    - - - - -
    - - -
    - - -
    - - -
    -
    - - - -
    - - - -
    - - -
    - -
    - - -
    - - -
    - - -

    - - -

    - -
    - - - - - - - - - -

    - -
    - - - - - - - - - - - - - order_id ) ) { - $order = edd_get_order_by( 'id', $order_item->order_id ); - $cart = edd_get_payment_meta_cart_details( $order->id, true ); - $item = $cart[ $item->cart_index ]; - } - $ret = apply_filters( 'edd_receipt_show_download_files', $ret, $item_id, $receipt_args, $item ); - } - - // If the $order_item is an array, get the order item object instead. - if ( is_array( $order_item ) && ! empty( $order_item['order_item_id'] ) ) { - $order_item = edd_get_order_item( $order_item['order_item_id'] ); - } - - /** - * Modifies whether the receipt should show download files. - * - * @since 3.0 - * @param bool $ret True if the download files should be shown. - * @param int $item_id The download ID. - * @param array $receipt_args Args specified in the [edd_receipt] shortcode. - * @param \EDD\Orders\Order_Item $item The order item object. - */ - return apply_filters( 'edd_order_receipt_show_download_files', $ret, $item_id, $receipt_args, $order_item ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-base-object.php b/wp-content/plugins/easy-digital-downloads/includes/class-base-object.php deleted file mode 100644 index 393f9fe6..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-base-object.php +++ /dev/null @@ -1,131 +0,0 @@ -set_vars( $args ); - } - - /** - * Magic isset'ter for immutability. - * - * @since 3.0 - * - * @param string $key - * @return mixed - */ - public function __isset( $key = '' ) { - - // No more uppercase ID properties ever - if ( 'ID' === $key ) { - $key = 'id'; - } - - // Class method to try and call - $method = "get_{$key}"; - - // Return property if exists - if ( method_exists( $this, $method ) ) { - return true; - - // Return get method results if exists - } elseif ( property_exists( $this, $key ) ) { - return true; - } - - // Return false if not exists - return false; - } - - /** - * Magic getter for immutability. - * - * @since 3.0 - * - * @param string $key - * @return mixed - */ - public function __get( $key = '' ) { - - // No more uppercase ID properties ever - if ( 'ID' === $key ) { - $key = 'id'; - } - - // Class method to try and call - $method = "get_{$key}"; - - // Return property if exists - if ( method_exists( $this, $method ) ) { - return call_user_func( array( $this, $method ) ); - - // Return get method results if exists - } elseif ( property_exists( $this, $key ) ) { - return $this->{$key}; - } - - // Return null if not exists - return null; - } - - /** - * Converts the given object to an array. - * - * @since 3.0 - * - * @return array Array version of the given object. - */ - public function to_array() { - return get_object_vars( $this ); - } - - /** - * Set class variables from arguments. - * - * @since 3.0 - * @param array $args - */ - protected function set_vars( $args = array() ) { - - // Bail if empty or not an array - if ( empty( $args ) ) { - return; - } - - // Cast to an array - if ( ! is_array( $args ) ) { - $args = (array) $args; - } - - // Set all properties - foreach ( $args as $key => $value ) { - $this->{$key} = $value; - } - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-component.php b/wp-content/plugins/easy-digital-downloads/includes/class-component.php deleted file mode 100644 index 189b23a4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-component.php +++ /dev/null @@ -1,148 +0,0 @@ - false, - 'table' => false, - 'query' => false, - 'object' => false, - 'meta' => false - ); - - /** - * Construct an EDD component - * - * @since 3.0 - * @param array $args - */ - public function __construct( $args = array() ) { - parent::__construct( $args ); - } - - /** - * Return an interface object - * - * @since 3.0 - * - * @param string $name - * @return object - */ - public function get_interface( $name = '' ) { - return isset( $this->interfaces[ $name ] ) - ? $this->interfaces[ $name ] - : false; - } - - /** - * Setup an EDD component based on parsing in constructor - * - * @since 3.0 - * @param array $args - */ - protected function set_vars( $args = array() ) { - - // Get the interface keys - $keys = array_keys( $this->interface_keys ); - - // Loop through args... - foreach ( $args as $key => $value ) { - - // Set arg as a Component Interface - if ( in_array( $key, $keys, true ) && class_exists( $value ) ) { - $this->interfaces[ $key ] = new $value; - - // Set arg as a Component property - } else { - $this->{$key} = $value; - } - } - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-easy-digital-downloads.php b/wp-content/plugins/easy-digital-downloads/includes/class-easy-digital-downloads.php deleted file mode 100644 index 0f9049a8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-easy-digital-downloads.php +++ /dev/null @@ -1,912 +0,0 @@ -setup_constants(); - self::$instance->setup_files(); - self::$instance->setup_application(); - self::$instance->setup_compat(); - - // APIs - self::$instance->roles = new EDD_Roles(); - self::$instance->fees = new EDD_Fees(); - self::$instance->api = new EDD_API(); - self::$instance->debug_log = new EDD_Logging(); - self::$instance->utils = new EDD\Utilities(); - self::$instance->session = new EDD_Session(); - self::$instance->html = new EDD_HTML_Elements(); - self::$instance->emails = new EDD_Emails(); - self::$instance->email_tags = new EDD_Email_Template_Tags(); - self::$instance->email_summary_cron = new EDD_Email_Summary_Cron(); - self::$instance->payment_stats = new EDD_Payment_Stats(); - self::$instance->cart = new EDD_Cart(); - self::$instance->structured_data = new EDD\Structured_Data(); - self::$instance->notifications = new \EDD\Database\NotificationsDB(); - self::$instance->extensionRegistry = new \EDD\Extensions\ExtensionRegistry(); - - // Admin APIs - if ( is_admin() ) { - self::$instance->notices = new EDD_Notices(); - self::$instance->email_summary_admin = new EDD_Email_Summary_Admin(); - } - - // Parachute - self::$instance->backcompat_globals(); - - self::$instance->registerApiEndpoints(); - - // Check if the pro code is present. - if ( class_exists( '\\EDD\\Pro\\Core' ) ) { - self::$instance->pro = true; - if ( edd_is_pro() ) { - new EDD\Pro\Core(); - } - } - if ( ! edd_is_pro() && class_exists( '\\EDD\\Lite\\Core' ) ) { - new EDD\Lite\Core(); - } - - self::$instance->tracking = edd_is_pro() ? new EDD\Pro\Telemetry\Tracking() : new EDD_Tracking(); - - // Return the instance - return self::$instance; - } - - /** - * Throw error on object clone. - * - * The whole idea of the singleton design pattern is that there is a single - * object therefore, we don't want the object to be cloned. - * - * @since 1.6 - * @access protected - * @return void - */ - public function __clone() { - // Cloning instances of the class is forbidden. - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'easy-digital-downloads' ), '1.6' ); - } - - /** - * Disable un-serializing of the class. - * - * @since 1.6 - * @access protected - * @return void - */ - public function __wakeup() { - // Unserializing instances of the class is forbidden. - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'easy-digital-downloads' ), '1.6' ); - } - - /** - * Backwards compatibility for some database properties - * - * This is probably still not working right, so don't count on it yet. - * - * @since 3.0 - * - * @param string $key - * @return mixed - */ - public function __get( $key = '' ) { - switch ( $key ) { - case 'customers' : - return new EDD\Compat\Customer(); - case 'customermeta' : - case 'customer_meta' : - return new EDD\Compat\CustomerMeta(); - - default : - return isset( $this->{$key} ) - ? $this->{$key} - : null; - } - } - - /** - * Whether the current install is a pro install. - * - * @since 3.1.1 - * @return bool - */ - public function is_pro() { - return $this->pro; - } - - /** - * Return whether the main loading class has been instantiated or not. - * - * @since 3.0 - * - * @return boolean True if instantiated. False if not. - */ - private static function is_instantiated() { - - // Return true if instance is correct class - if ( ! empty( self::$instance ) && ( self::$instance instanceof Easy_Digital_Downloads ) ) { - return true; - } - - // Return false if not instantiated correctly - return false; - } - - /** - * Setup the singleton instance - * - * @since 3.0 - * @param string $file - */ - private static function setup_instance( $file = '' ) { - if ( empty( $file ) && defined( EDD_PLUGIN_FILE ) ) { - $file = EDD_PLUGIN_FILE; - } - self::$instance = new Easy_Digital_Downloads(); - self::$instance->file = $file; - } - - /** - * Setup plugin constants. - * - * @access private - * @since 1.4 - * @return void - */ - private function setup_constants() { - - // Plugin version. - if ( ! defined( 'EDD_VERSION' ) ) { - define( 'EDD_VERSION', '3.1.4' ); - } - - // Make sure CAL_GREGORIAN is defined. - if ( ! defined( 'CAL_GREGORIAN' ) ) { - define( 'CAL_GREGORIAN', 1 ); - } - } - - /** - * Include required files. - * - * @access private - * @since 1.4 - * @return void - */ - private function setup_files() { - $this->include_options(); - $this->include_utilities(); - $this->include_reports(); - $this->include_components(); - $this->include_backcompat(); - $this->include_objects(); - $this->include_functions(); - - // Admin - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { - $this->include_admin(); - } else { - $this->include_frontend(); - } - } - - /** - * Setup backwards compatibility hooks - * - * This method exists to setup the bridges between EDD versions, most - * notably between versions less than 2.9 and greater than 3.0. - * - * Compatibility classes are not set up during EDD uninstall in order to allow us to use WordPress functions - * to cleanly delete the old custom post types from pre-3.0. - * - * @access private - * @since 3.0 - * @return void - */ - private function setup_compat() { - if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) || plugin_basename( $this->file ) !== WP_UNINSTALL_PLUGIN ) { - new EDD\Compat\Discount(); - new EDD\Compat\Customer(); - new EDD\Compat\Log(); - new EDD\Compat\Payment(); - new EDD\Compat\Tax(); - new EDD\Compat\Template(); - } - } - - /** - * Setup the rest of the application - * - * @since 3.0 - */ - private function setup_application() { - add_action( 'plugins_loaded', 'edd_setup_components', 100 ); - - $GLOBALS['edd_options'] = edd_get_settings(); - - // Load Amazon Payments. - PayWithAmazon\EDD_Amazon_Payments::getInstance(); - - // Load cache helper. - new EDD_Cache_Helper(); - } - - /** Includes **************************************************************/ - - /** - * Setup all of the custom database tables - * - * This method invokes all of the classes for each custom database table, - * and returns them in an array for easier testing. - * - * In a normal request, this method is called extremely early in EDD's load - * order, to ensure these tables have been created & upgraded before any - * other utility occurs on them (query, migration, etc...) - * - * @access public - * @since 3.0 - * @return array - */ - private function include_components() { - - // Component helpers are loaded before everything - require_once EDD_PLUGIN_DIR . 'includes/interface-edd-exception.php'; - require_once EDD_PLUGIN_DIR . 'includes/component-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-component.php'; - - // Database Engine - require_once EDD_PLUGIN_DIR . 'includes/database/engine/class-base.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/engine/class-column.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/engine/class-schema.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/engine/class-query.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/engine/class-row.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/engine/class-table.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/engine/class-meta.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/engine/class-date.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/engine/class-compare.php'; - - // Database Schemas - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-adjustments.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-customer-addresses.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-customer-email-addresses.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-customers.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-logs.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-logs-api-requests.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-logs-file-downloads.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-notes.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-orders.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-order-addresses.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-order-adjustments.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-order-items.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/schemas/class-order-transactions.php'; - - // Database Objects - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-adjustment.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-customer.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-customer-address.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-customer-email-address.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-log.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-log-api-request.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-log-file-download.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-note.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-order.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-order-address.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-order-adjustment.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-order-item.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/rows/class-order-transaction.php'; - - // Database Tables - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-adjustments.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-customer-addresses.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-customer-email-addresses.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-customers.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-logs.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-logs-api-requests.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-logs-api-request-meta.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-logs-file-downloads.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-logs-file-download-meta.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-notes.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-orders.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-order-addresses.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-order-adjustments.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-order-adjustment-meta.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-order-items.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-order-transactions.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-customer-meta.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-adjustment-meta.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-log-meta.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-note-meta.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-order-meta.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/tables/class-order-item-meta.php'; - - // Database Table Query Interfaces - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-adjustment.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-customer.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-customer-email-address.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-customer-address.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-log.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-log-api-request.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-log-file-download.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-note.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-order.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-order-address.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-order-adjustment.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-order-item.php'; - require_once EDD_PLUGIN_DIR . 'includes/database/queries/class-order-transaction.php'; - - // Old Database Components - require_once EDD_PLUGIN_DIR . 'includes/class-edd-db.php'; - } - - /** - * Setup all EDD settings & options - * - * @since 3.0 - */ - private function include_options() { - require_once EDD_PLUGIN_DIR . 'includes/admin/settings/register-settings.php'; - } - - /** - * Setup utilities - * - * @since 3.0 - */ - private function include_utilities() { - require_once EDD_PLUGIN_DIR . 'includes/class-utilities.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-base-object.php'; - } - - /** - * Setup all EDD settings & options - * - * @since 3.0 - */ - private function include_reports() { - require_once EDD_PLUGIN_DIR . 'includes/reports/class-init.php'; - } - - /** - * Setup backwards compatibility - * - * @since 3.0 - */ - private function include_backcompat() { - - // PHP functions - require_once EDD_PLUGIN_DIR . 'includes/compat-functions.php'; - - // Backwards Compatibility - require_once EDD_PLUGIN_DIR . 'includes/compat/class-base.php'; - require_once EDD_PLUGIN_DIR . 'includes/compat/class-customer.php'; - require_once EDD_PLUGIN_DIR . 'includes/compat/class-customermeta.php'; - require_once EDD_PLUGIN_DIR . 'includes/compat/class-discount.php'; - require_once EDD_PLUGIN_DIR . 'includes/compat/class-discount-query.php'; - require_once EDD_PLUGIN_DIR . 'includes/compat/class-log.php'; - require_once EDD_PLUGIN_DIR . 'includes/compat/class-payment.php'; - require_once EDD_PLUGIN_DIR . 'includes/compat/class-tax.php'; - require_once EDD_PLUGIN_DIR . 'includes/compat/class-template.php'; - - // Original Classes - require_once EDD_PLUGIN_DIR . 'includes/class-edd-customer.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-customer-query.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-discount.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-download.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-cache-helper.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-register-meta.php'; - - // Classes - require_once EDD_PLUGIN_DIR . 'includes/class-edd-cron.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-fees.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-html-elements.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-license-handler.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-logging.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-session.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-stats.php'; - require_once EDD_PLUGIN_DIR . 'includes/class-edd-roles.php'; - - // Deprecated Functions - if ( file_exists( EDD_PLUGIN_DIR . 'includes/deprecated-functions.php' ) ) { - require_once EDD_PLUGIN_DIR . 'includes/deprecated-functions.php'; - } - require_once EDD_PLUGIN_DIR . 'includes/deprecated-hooks.php'; - } - - /** - * Setup objects - * - * @since 3.0 - */ - private function include_objects() { - - // CLI - if ( defined( 'WP_CLI' ) && WP_CLI ) { - require_once EDD_PLUGIN_DIR . 'includes/class-edd-cli.php'; - } - - // Traits - require_once EDD_PLUGIN_DIR . 'includes/traits/trait-refundable-item.php'; - - // Adjustments - require_once EDD_PLUGIN_DIR . 'includes/adjustments/class-adjustment.php'; - require_once EDD_PLUGIN_DIR . 'includes/adjustments/functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/adjustments/meta.php'; - - // API - require_once EDD_PLUGIN_DIR . 'includes/api/class-edd-api.php'; - require_once EDD_PLUGIN_DIR . 'includes/api/v3/Endpoint.php'; - - // Checkout - require_once EDD_PLUGIN_DIR . 'includes/checkout/template.php'; - require_once EDD_PLUGIN_DIR . 'includes/checkout/functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/checkout/pages.php'; - - // Customers - require_once EDD_PLUGIN_DIR . 'includes/customers/class-customer-address.php'; - require_once EDD_PLUGIN_DIR . 'includes/customers/class-customer-email-address.php'; - - // Cart - require_once EDD_PLUGIN_DIR . 'includes/cart/class-edd-cart.php'; - require_once EDD_PLUGIN_DIR . 'includes/cart/functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/cart/template.php'; - require_once EDD_PLUGIN_DIR . 'includes/cart/actions.php'; - - // Currency - require_once EDD_PLUGIN_DIR . 'includes/currency/functions.php'; - - // Gateways - require_once EDD_PLUGIN_DIR . 'includes/gateways/actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/gateways/functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/gateways/amazon-payments.php'; - require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal-standard.php'; - require_once EDD_PLUGIN_DIR . 'includes/gateways/paypal/paypal.php'; - require_once EDD_PLUGIN_DIR . 'includes/gateways/manual.php'; - - $stripe = EDD_PLUGIN_DIR . 'includes/gateways/stripe/edd-stripe.php'; - - if ( file_exists( $stripe ) ) { - require_once( $stripe ); - } - - // Logs - require_once EDD_PLUGIN_DIR . 'includes/logs/api-request-log/class-api-request-log.php'; - require_once EDD_PLUGIN_DIR . 'includes/logs/api-request-log/functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/logs/api-request-log/meta.php'; - - require_once EDD_PLUGIN_DIR . 'includes/logs/file-download-log/class-file-download-log.php'; - require_once EDD_PLUGIN_DIR . 'includes/logs/file-download-log/functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/logs/file-download-log/meta.php'; - - require_once EDD_PLUGIN_DIR . 'includes/logs/log/class-log.php'; - require_once EDD_PLUGIN_DIR . 'includes/logs/log/functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/logs/log/meta.php'; - - // Notes - require_once EDD_PLUGIN_DIR . 'includes/notes/class-note.php'; - require_once EDD_PLUGIN_DIR . 'includes/notes/functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/notes/meta.php'; - - // Orders - require_once EDD_PLUGIN_DIR . 'includes/orders/classes/class-order.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/classes/class-order-address.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/classes/class-order-adjustment.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/classes/class-order-item.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/classes/class-order-transaction.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/classes/class-refund-validator.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/types.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/orders.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/meta.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/items.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/refunds.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/addresses.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/adjustments.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/transactions.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/ui.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/transitions.php'; - require_once EDD_PLUGIN_DIR . 'includes/orders/functions/statuses.php'; - - // Payments - require_once EDD_PLUGIN_DIR . 'includes/payments/functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/payments/actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/payments/class-payment-stats.php'; - require_once EDD_PLUGIN_DIR . 'includes/payments/class-payments-query.php'; - require_once EDD_PLUGIN_DIR . 'includes/payments/class-edd-payment.php'; - - // Emails - require_once EDD_PLUGIN_DIR . 'includes/emails/class-edd-emails.php'; - require_once EDD_PLUGIN_DIR . 'includes/emails/class-edd-email-tags.php'; - require_once EDD_PLUGIN_DIR . 'includes/emails/functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/emails/tags.php'; - require_once EDD_PLUGIN_DIR . 'includes/emails/tags-inserter.php'; - require_once EDD_PLUGIN_DIR . 'includes/emails/template.php'; - require_once EDD_PLUGIN_DIR . 'includes/emails/actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/emails/email-summary/class-edd-email-summary-cron.php'; - require_once EDD_PLUGIN_DIR . 'includes/emails/email-summary/class-edd-email-summary.php'; - require_once EDD_PLUGIN_DIR . 'includes/emails/email-summary/class-edd-email-summary-blurb.php'; - - // Stats - require_once EDD_PLUGIN_DIR . 'includes/class-stats.php'; - - // Downloads - require_once EDD_PLUGIN_DIR . 'includes/models/Download.php'; - - // Blocks - $blocks = EDD_PLUGIN_DIR . 'includes/blocks/edd-blocks.php'; - - if ( file_exists( $blocks ) ) { - require_once $blocks; - } - } - - /** - * Setup functions - * - * @since 3.0 - */ - private function include_functions() { - require_once EDD_PLUGIN_DIR . 'includes/actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/mime-types.php'; - require_once EDD_PLUGIN_DIR . 'includes/formatting.php'; - require_once EDD_PLUGIN_DIR . 'includes/widgets.php'; - require_once EDD_PLUGIN_DIR . 'includes/scripts.php'; - require_once EDD_PLUGIN_DIR . 'includes/post-types.php'; - require_once EDD_PLUGIN_DIR . 'includes/plugin-compatibility.php'; - require_once EDD_PLUGIN_DIR . 'includes/error-tracking.php'; - require_once EDD_PLUGIN_DIR . 'includes/ajax-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/template-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/template-actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/country-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/extensions/licensing-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/date-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/misc-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/discount-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/download-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/downloads/recalculations.php'; - require_once EDD_PLUGIN_DIR . 'includes/customer-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/customers/customer-actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/privacy-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/utils/class-tokenizer.php'; - require_once EDD_PLUGIN_DIR . 'includes/user-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/query-filters.php'; - require_once EDD_PLUGIN_DIR . 'includes/tax-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/refund-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/process-purchase.php'; - require_once EDD_PLUGIN_DIR . 'includes/users/login.php'; - require_once EDD_PLUGIN_DIR . 'includes/users/lost-password.php'; - require_once EDD_PLUGIN_DIR . 'includes/users/register.php'; - require_once EDD_PLUGIN_DIR . 'includes/shortcodes.php'; - require_once EDD_PLUGIN_DIR . 'includes/install.php'; - require_once EDD_PLUGIN_DIR . 'includes/upgrades/functions.php'; - - // Admin files to load globally (cron, bar, etc...) - require_once EDD_PLUGIN_DIR . 'includes/admin/tracking.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/admin-bar.php'; - } - - /** - * Setup administration - * - * @since 3.0 - */ - private function include_admin() { - require_once EDD_PLUGIN_DIR . 'includes/admin/admin-footer.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/admin-actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/class-edd-notices.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/class-edd-heartbeat.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/class-list-table.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/class-sections.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/admin-pages.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/thickbox.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/upload-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/downloads/dashboard-columns.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/adjustments/adjustment-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/customers/customers.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/customers/customer-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/customers/customer-actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/notes/note-actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/notes/note-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/downloads/metabox.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/downloads/contextual-help.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/discounts/contextual-help.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/discounts/discount-actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/discounts/discount-codes.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/emails/email-summary/class-edd-email-summary-admin.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/import/import-actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/import/import-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/payments/actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/payments/refunds.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/payments/orders.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/payments/class-order-sections.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/payments/payments-history.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/payments/contextual-help.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/contextual-help.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/class-reports-sections.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/export/export-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/reports.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/reports-callbacks.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/class-edd-graph.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/class-edd-pie-graph.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/reporting/graphing.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/settings/display-settings.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/tools.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/plugins.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/deprecated-upgrade-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/downgrades.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/v3/upgrade-actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/tools/tools-actions.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/settings/settings-compatibility.php'; - require_once EDD_PLUGIN_DIR . 'includes/admin/admin-deprecated-functions.php'; - - require_once EDD_PLUGIN_DIR . 'includes/libraries/class-persistent-dismissible.php'; - } - - /** - * Setup front-end specific code - * - * @since 3.0 - */ - private function include_frontend() { - require_once EDD_PLUGIN_DIR . 'includes/process-download.php'; - require_once EDD_PLUGIN_DIR . 'includes/theme-compatibility.php'; - } - - /** - * Backwards compatibility for old global values - * - * @since 3.0 - */ - private function backcompat_globals() { - - // The $edd_logs global - $GLOBALS['edd_logs'] = self::$instance->debug_log; - } - - /** - * Registers REST API endpoints. - * - * @todo move this somewhere better - * - * @since 2.11.4 - */ - private function registerApiEndpoints() { - add_action( 'rest_api_init', function() { - $endpoints = array( - '\\EDD\\API\\v3\\Notifications', - ); - - foreach( $endpoints as $endpointClassName ) { - $endpointNamePieces = explode( '\\', $endpointClassName ); - $endpointName = end( $endpointNamePieces ); - - require_once EDD_PLUGIN_DIR . 'includes/api/v3/' . $endpointName . '.php'; - - if ( class_exists( $endpointClassName ) ) { - $endpoint = new $endpointClassName(); - $endpoint->register(); - } - } - } ); - } -} -endif; // End if class_exists check. - -/** - * Returns the instance of Easy_Digital_Downloads. - * - * The main function responsible for returning the one true Easy_Digital_Downloads - * instance to functions everywhere. - * - * Use this function like you would a global variable, except without needing - * to declare the global. - * - * Example: - * - * @since 1.4 - * @return Easy_Digital_Downloads The one true Easy_Digital_Downloads instance. - */ -function EDD() { - return Easy_Digital_Downloads::instance(); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-cache-helper.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-cache-helper.php deleted file mode 100644 index 5e9226ff..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-cache-helper.php +++ /dev/null @@ -1,144 +0,0 @@ -post_name; - } - - if ( ! is_null( $success_page ) ) { - $page_uris[] = '/' . $success_page->post_name; - } - - set_transient( 'edd_cache_excluded_uris', $page_uris ); - } - - if ( is_array( $page_uris ) ) { - foreach ( $page_uris as $uri ) { - if ( strstr( $_SERVER['REQUEST_URI'], $uri ) ) { - $this->nocache(); - break; - } - } - } - } - - /** - * Set nocache constants and headers. - * - * @since 1.7 - * @access private - */ - private function nocache() { - if ( ! defined( 'DONOTCACHEPAGE' ) ) { - define( 'DONOTCACHEPAGE', 'true' ); - } - - nocache_headers(); - } - - /** - * Admin notices. - * - * @since 1.7 - */ - public function notices() { - - // W3 Total Cache. - if ( function_exists( 'w3tc_pgcache_flush' ) && function_exists( 'w3_instance' ) ) { - $config = w3_instance( 'W3_Config' ); - $enabled = $config->get_integer( 'dbcache.enabled' ); - $settings = $config->get_array( 'dbcache.reject.sql' ); - - if ( $enabled && ! in_array( '_wp_session_', $settings, true ) ) { - ?> -
    -

    - database caching to work with Easy Digital Downloads you must add _wp_session_ to the "Ignored query stems" option in W3 Total Cache settings here.', 'easy-digital-downloads' ), - esc_url( admin_url( 'admin.php?page=w3tc_dbcache' ) ) - ); - ?> -

    -
    - api = new EDD_API(); - edd_do_automatic_upgrades(); - } - - - /** - * Get EDD details - * - * ## OPTIONS - * - * None. Returns basic info regarding your EDD instance. - * - * ## EXAMPLES - * - * wp edd details - * - * @param array $args - * @param array $assoc_args - */ - public function details( $args, $assoc_args ) { - $symlink_file_downloads = edd_get_option( 'symlink_file_downloads', false ); - $purchase_page = edd_get_option( 'purchase_page', '' ); - $success_page = edd_get_option( 'success_page', '' ); - $failure_page = edd_get_option( 'failure_page', '' ); - - WP_CLI::line( sprintf( __( 'You are running EDD version: %s', 'easy-digital-downloads' ), EDD_VERSION ) ); - WP_CLI::line( "\n" . sprintf( __( 'Test mode is: %s', 'easy-digital-downloads' ), ( edd_is_test_mode() ? __( 'Enabled', 'easy-digital-downloads' ) : __( 'Disabled', 'easy-digital-downloads' ) ) ) ); - WP_CLI::line( sprintf( __( 'AJAX is: %s', 'easy-digital-downloads' ), ( edd_is_ajax_enabled() ? __( 'Enabled', 'easy-digital-downloads' ) : __( 'Disabled', 'easy-digital-downloads' ) ) ) ); - WP_CLI::line( sprintf( __( 'Guest checkouts are: %s', 'easy-digital-downloads' ), ( edd_no_guest_checkout() ? __( 'Disabled', 'easy-digital-downloads' ) : __( 'Enabled', 'easy-digital-downloads' ) ) ) ); - WP_CLI::line( sprintf( __( 'Symlinks are: %s', 'easy-digital-downloads' ), ( apply_filters( 'edd_symlink_file_downloads', isset( $symlink_file_downloads ) ) && function_exists( 'symlink' ) ? __( 'Enabled', 'easy-digital-downloads' ) : __( 'Disabled', 'easy-digital-downloads' ) ) ) ); - WP_CLI::line( "\n" . sprintf( __( 'Checkout page is: %s', 'easy-digital-downloads' ), ( ! edd_get_option( 'purchase_page', false ) ) ? __( 'Valid', 'easy-digital-downloads' ) : __( 'Invalid', 'easy-digital-downloads' ) ) ); - WP_CLI::line( sprintf( __( 'Checkout URL is: %s', 'easy-digital-downloads' ), ( ! empty( $purchase_page ) ? get_permalink( $purchase_page ) : __( 'Undefined', 'easy-digital-downloads' ) ) ) ); - WP_CLI::line( sprintf( __( 'Success URL is: %s', 'easy-digital-downloads' ), ( ! empty( $success_page ) ? get_permalink( $success_page ) : __( 'Undefined', 'easy-digital-downloads' ) ) ) ); - WP_CLI::line( sprintf( __( 'Failure URL is: %s', 'easy-digital-downloads' ), ( ! empty( $failure_page ) ? get_permalink( $failure_page ) : __( 'Undefined', 'easy-digital-downloads' ) ) ) ); - WP_CLI::line( sprintf( __( 'Downloads slug is: %s', 'easy-digital-downloads' ), ( defined( 'EDD_SLUG' ) ? '/' . EDD_SLUG : '/downloads' ) ) ); - WP_CLI::line( "\n" . sprintf( __( 'Taxes are: %s', 'easy-digital-downloads' ), ( edd_use_taxes() ? __( 'Enabled', 'easy-digital-downloads' ) : __( 'Disabled', 'easy-digital-downloads' ) ) ) ); - WP_CLI::line( sprintf( __( 'Tax rate is: %s', 'easy-digital-downloads' ), edd_get_formatted_tax_rate() ) ); - - $rates = edd_get_tax_rates(); - if ( ! empty( $rates ) ) { - foreach ( $rates as $rate ) { - WP_CLI::line( sprintf( __( 'Country: %s, State: %s, Rate: %s', 'easy-digital-downloads' ), $rate['country'], $rate['state'], $rate['rate'] ) ); - } - } - } - - - /** - * Get stats for your EDD site - * - * ## OPTIONS - * - * --product=: The ID of a specific product to retrieve stats for, or all - * --date=[range|this_month|last_month|today|yesterday|this_quarter|last_quarter|this_year|last_year]: A specific - * date range to retrieve stats for - * --startdate=: The start date of a date range to retrieve stats for - * --enddate=: The end date of a date range to retrieve stats for - * - * ## EXAMPLES - * - * wp edd stats --date=this_month - * wp edd stats --start-date=01/02/2014 --end-date=02/23/2014 - * wp edd stats --date=last_year - * wp edd stats --date=last_year --product=15 - */ - public function stats( $args, $assoc_args ) { - - $stats = new EDD_Payment_Stats(); - $date = isset( $assoc_args ) && array_key_exists( 'date', $assoc_args ) ? $assoc_args['date'] : false; - $start_date = isset( $assoc_args ) && array_key_exists( 'startdate', $assoc_args ) ? $assoc_args['startdate'] : false; - $end_date = isset( $assoc_args ) && array_key_exists( 'enddate', $assoc_args ) ? $assoc_args['enddate'] : false; - $download = isset( $assoc_args ) && array_key_exists( 'product', $assoc_args ) ? $assoc_args['product'] : 0; - - if ( ! empty( $date ) ) { - $start_date = $date; - $end_date = false; - } elseif ( empty( $date ) && empty( $start_date ) ) { - $start_date = 'this_month'; - $end_date = false; - } - - $earnings = $stats->get_earnings( $download, $start_date, $end_date ); - $sales = $stats->get_sales( $download, $start_date, $end_date ); - - WP_CLI::line( sprintf( __( 'Earnings: %s', 'easy-digital-downloads' ), $earnings ) ); - WP_CLI::line( sprintf( __( 'Sales: %s', 'easy-digital-downloads' ), $sales ) ); - - } - - - /** - * Get the products currently posted on your EDD site - * - * ## OPTIONS - * - * --id=: A specific product ID to retrieve - * - * - * ## EXAMPLES - * - * wp edd products --id=103 - */ - public function products( $args, $assoc_args ) { - $product_id = isset( $assoc_args ) && array_key_exists( 'id', $assoc_args ) ? absint( $assoc_args['id'] ) : false; - $products = $this->api->get_products( $product_id ); - - if ( isset( $products['error'] ) ) { - WP_CLI::error( $products['error'] ); - } - - if ( empty( $products ) ) { - WP_CLI::error( __( 'No Downloads found', 'easy-digital-downloads' ) ); - - return; - } - - foreach ( $products['products'] as $product ) { - $categories = ''; - $tags = ''; - $pricing = array(); - - if ( is_array( $product['info']['category'] ) ) { - $categories = array(); - foreach ( $product['info']['category'] as $category ) { - $categories[] = $category->name; - } - - $categories = implode( ', ', $categories ); - } - - if ( is_array( $product['info']['tags'] ) ) { - $tags = array(); - foreach ( $product['info']['tags'] as $tag ) { - $tags[] = $tag->name; - } - - $tags = implode( ', ', $tags ); - } - - foreach ( $product['pricing'] as $price => $value ) { - if ( 'amount' !== $price ) { - $price = $price . ' - '; - } - - $pricing[] = $price . ': ' . edd_format_amount( $value ) . ' ' . edd_get_currency(); - } - - $pricing = implode( ', ', $pricing ); - - WP_CLI::line( WP_CLI::colorize( '%G' . $product['info']['title'] . '%N' ) ); - WP_CLI::line( sprintf( __( 'ID: %d', 'easy-digital-downloads' ), $product['info']['id'] ) ); - WP_CLI::line( sprintf( __( 'Status: %s', 'easy-digital-downloads' ), $product['info']['status'] ) ); - WP_CLI::line( sprintf( __( 'Posted: %s', 'easy-digital-downloads' ), $product['info']['create_date'] ) ); - WP_CLI::line( sprintf( __( 'Categories: %s', 'easy-digital-downloads' ), $categories ) ); - WP_CLI::line( sprintf( __( 'Tags: %s', 'easy-digital-downloads' ), ( is_array( $tags ) ? '' : $tags ) ) ); - WP_CLI::line( sprintf( __( 'Pricing: %s', 'easy-digital-downloads' ), $pricing ) ); - WP_CLI::line( sprintf( __( 'Sales: %s', 'easy-digital-downloads' ), $product['stats']['total']['sales'] ) ); - WP_CLI::line( sprintf( __( 'Earnings: %s', 'easy-digital-downloads' ), edd_format_amount( $product['stats']['total']['earnings'] ) ) ) . ' ' . edd_get_currency(); - WP_CLI::line( '' ); - WP_CLI::line( sprintf( __( 'Slug: %s', 'easy-digital-downloads' ), $product['info']['slug'] ) ); - WP_CLI::line( sprintf( __( 'Permalink: %s', 'easy-digital-downloads' ), $product['info']['link'] ) ); - - if ( array_key_exists( 'files', $product ) ) { - WP_CLI::line( '' ); - WP_CLI::line( __( 'Download Files:', 'easy-digital-downloads' ) ); - - foreach ( $product['files'] as $file ) { - WP_CLI::line( ' ' . sprintf( __( 'File: %s (%s)', 'easy-digital-downloads' ), $file['name'], $file['file'] ) ); - - if ( isset( $file['condition'] ) && 'all' !== $file['condition'] ) { - WP_CLI::line( ' ' . sprintf( __( 'Price Assignment: %s', 'easy-digital-downloads' ), $file['condition'] ) ); - } - } - } - - WP_CLI::line( '' ); - } - - } - - - /** - * Get the customers currently on your EDD site. Can also be used to create customers records - * - * ## OPTIONS - * - * --id=: A specific customer ID to retrieve - * --email=: The email address of the customer to retrieve - * --create=: The number of arbitrary customers to create. Leave as 1 or blank to create a customer with a - * speciific email - * - * ## EXAMPLES - * - * wp edd customers --id=103 - * wp edd customers --email=john@test.com - * wp edd customers --create=1 --email=john@test.com - * wp edd customers --create=1 --email=john@test.com --name="John Doe" - * wp edd customers --create=1 --email=john@test.com --name="John Doe" user_id=1 - * wp edd customers --create=1000 - */ - public function customers( $args, $assoc_args ) { - $customer_id = isset( $assoc_args ) && array_key_exists( 'id', $assoc_args ) ? absint( $assoc_args['id'] ) : false; - $email = isset( $assoc_args ) && array_key_exists( 'email', $assoc_args ) ? $assoc_args['email'] : false; - $name = isset( $assoc_args ) && array_key_exists( 'name', $assoc_args ) ? $assoc_args['name'] : null; - $user_id = isset( $assoc_args ) && array_key_exists( 'user_id', $assoc_args ) ? $assoc_args['user_id'] : null; - $create = isset( $assoc_args ) && array_key_exists( 'create', $assoc_args ) ? $assoc_args['create'] : false; - $start = time(); - - if ( $create ) { - $number = 1; - - // Create one or more customers - if ( ! $email ) { - - // If no email is specified, look to see if we are generating arbitrary customer accounts - $number = is_numeric( $create ) ? absint( $create ) : 1; - } - - for ( $i = 0; $i < $number; $i ++ ) { - if ( ! $email ) { - - // Generate fake email - $email = 'customer-' . uniqid() . '@test.com'; - } - - $args = array( - 'email' => $email, - 'name' => $name, - 'user_id' => $user_id, - ); - - $customer_id = edd_add_customer( $args ); - - if ( $customer_id ) { - WP_CLI::line( sprintf( __( 'Customer %d created successfully', 'easy-digital-downloads' ), $customer_id ) ); - } else { - WP_CLI::error( __( 'Failed to create customer', 'easy-digital-downloads' ) ); - } - - // Reset email to false so it is generated on the next loop (if creating customers) - $email = false; - - } - - WP_CLI::line( WP_CLI::colorize( '%G' . sprintf( __( '%d customers created in %d seconds', 'easy-digital-downloads' ), $create, time() - $start ) . '%N' ) ); - } else { - // Search for customers - $search = false; - - // Checking if search is being done by id, email or user_id fields. - if ( $customer_id || $email || ( 'null' !== $user_id ) ) { - $search = array(); - $customer_details = array(); - - if ( $customer_id ) { - $customer_details['id'] = $customer_id; - } elseif ( $email ) { - $customer_details['email'] = $email; - } elseif ( null !== $user_id ) { - $customer_details['user_id'] = $user_id; - } - - $search['customer'] = $customer_details; - } - - $customers = $this->api->get_customers( $search ); - - if ( isset( $customers['error'] ) ) { - WP_CLI::error( $customers['error'] ); - } - - if ( empty( $customers ) ) { - WP_CLI::error( __( 'No customers found', 'easy-digital-downloads' ) ); - - return; - } - - foreach ( $customers['customers'] as $customer ) { - WP_CLI::line( WP_CLI::colorize( '%G' . $customer['info']['email'] . '%N' ) ); - WP_CLI::line( sprintf( __( 'Customer User ID: %s', 'easy-digital-downloads' ), $customer['info']['id'] ) ); - WP_CLI::line( sprintf( __( 'Username: %s', 'easy-digital-downloads' ), $customer['info']['username'] ) ); - WP_CLI::line( sprintf( __( 'Display Name: %s', 'easy-digital-downloads' ), $customer['info']['display_name'] ) ); - - if ( array_key_exists( 'first_name', $customer ) ) { - WP_CLI::line( sprintf( __( 'First Name: %s', 'easy-digital-downloads' ), $customer['info']['first_name'] ) ); - } - - if ( array_key_exists( 'last_name', $customer ) ) { - WP_CLI::line( sprintf( __( 'Last Name: %s', 'easy-digital-downloads' ), $customer['info']['last_name'] ) ); - } - - WP_CLI::line( sprintf( __( 'Email: %s', 'easy-digital-downloads' ), $customer['info']['email'] ) ); - - WP_CLI::line( '' ); - WP_CLI::line( sprintf( __( 'Purchases: %s', 'easy-digital-downloads' ), $customer['stats']['total_purchases'] ) ); - WP_CLI::line( sprintf( __( 'Total Spent: %s', 'easy-digital-downloads' ), edd_format_amount( $customer['stats']['total_spent'] ) . ' ' . edd_get_currency() ) ); - WP_CLI::line( sprintf( __( 'Total Downloads: %s', 'easy-digital-downloads' ), $customer['stats']['total_downloads'] ) ); - - WP_CLI::line( '' ); - } - - } - - } - - - /** - * Get the recent sales for your EDD site - * - * ## OPTIONS - * - * --email=: The email address of the customer to retrieve - * - * ## EXAMPLES - * - * wp edd sales - * wp edd sales --email=john@test.com - */ - public function sales( $args, $assoc_args ) { - $email = isset( $assoc_args ) && array_key_exists( 'email', $assoc_args ) ? $assoc_args['email'] : ''; - - global $wp_query; - - $wp_query->query_vars['email'] = $email; - - $sales = $this->api->get_recent_sales(); - - if ( empty( $sales ) ) { - WP_CLI::error( __( 'No sales found', 'easy-digital-downloads' ) ); - - return; - } - - foreach ( $sales['sales'] as $sale ) { - WP_CLI::line( WP_CLI::colorize( '%G' . $sale['ID'] . '%N' ) ); - WP_CLI::line( sprintf( __( 'Purchase Key: %s', 'easy-digital-downloads' ), $sale['key'] ) ); - WP_CLI::line( sprintf( __( 'Email: %s', 'easy-digital-downloads' ), $sale['email'] ) ); - WP_CLI::line( sprintf( __( 'Date: %s', 'easy-digital-downloads' ), $sale['date'] ) ); - WP_CLI::line( sprintf( __( 'Subtotal: %s', 'easy-digital-downloads' ), edd_format_amount( $sale['subtotal'] ) . ' ' . edd_get_currency() ) ); - WP_CLI::line( sprintf( __( 'Tax: %s', 'easy-digital-downloads' ), edd_format_amount( $sale['tax'] ) . ' ' . edd_get_currency() ) ); - - if ( array_key_exists( 0, $sale['fees'] ) ) { - WP_CLI::line( __( 'Fees:', 'easy-digital-downloads' ) ); - - foreach ( $sale['fees'] as $fee ) { - WP_CLI::line( sprintf( __( ' Fee: %s - %s', 'easy-digital-downloads' ), edd_format_amount( $fee['amount'] ), edd_get_currency() ) ); - } - } - - WP_CLI::line( sprintf( __( 'Total: %s', 'easy-digital-downloads' ), edd_format_amount( $sale['total'] ) . ' ' . edd_get_currency() ) ); - WP_CLI::line( '' ); - WP_CLI::line( sprintf( __( 'Gateway: %s', 'easy-digital-downloads' ), $sale['gateway'] ) ); - - if ( array_key_exists( 0, $sale['products'] ) ) { - WP_CLI::line( __( 'Products:', 'easy-digital-downloads' ) ); - - foreach ( $sale['products'] as $product ) { - $price_name = ! empty( $product['price_name'] ) ? ' (' . $product['price_name'] . ')' : ''; - WP_CLI::line( sprintf( __( ' Product: %s - %s', 'easy-digital-downloads' ), $product['name'], edd_format_amount( $product['price'] ) . ' ' . edd_get_currency() . $price_name ) ); - } - } - - WP_CLI::line( '' ); - } - } - - - /** - * Get discount details for on your EDD site - * - * ## OPTIONS - * - * --id=: A specific discount ID to retrieve - * - * ## EXAMPLES - * - * wp edd discounts --id=103 - */ - public function discounts( $args, $assoc_args ) { - - $discount_id = isset( $assoc_args ) && array_key_exists( 'id', $assoc_args ) ? absint( $assoc_args['id'] ) : false; - - $discounts = $this->api->get_discounts( $discount_id ); - - if ( isset( $discounts['error'] ) ) { - WP_CLI::error( $discounts['error'] ); - } - - if ( empty( $discounts ) ) { - WP_CLI::error( __( 'No discounts found', 'easy-digital-downloads' ) ); - - return; - } - - foreach ( $discounts['discounts'] as $discount ) { - WP_CLI::line( WP_CLI::colorize( '%G' . $discount['ID'] . '%N' ) ); - WP_CLI::line( sprintf( __( 'Name: %s', 'easy-digital-downloads' ), $discount['name'] ) ); - WP_CLI::line( sprintf( __( 'Code: %s', 'easy-digital-downloads' ), $discount['code'] ) ); - - if ( $discount['type'] == 'percent' ) { - $amount = $discount['amount'] . '%'; - } else { - $amount = edd_format_amount( $discount['amount'] ) . ' ' . edd_get_currency(); - } - - WP_CLI::line( sprintf( __( 'Amount: %s', 'easy-digital-downloads' ), $amount ) ); - WP_CLI::line( sprintf( __( 'Uses: %s', 'easy-digital-downloads' ), $discount['uses'] ) ); - WP_CLI::line( sprintf( __( 'Max Uses: %s', 'easy-digital-downloads' ), ( $discount['max_uses'] == '0' ? __( 'Unlimited', 'easy-digital-downloads' ) : $discount['max_uses'] ) ) ); - WP_CLI::line( sprintf( __( 'Start Date: %s', 'easy-digital-downloads' ), ( empty( $discount['start_date'] ) ? __( 'No Start Date', 'easy-digital-downloads' ) : $discount['start_date'] ) ) ); - WP_CLI::line( sprintf( __( 'Expiration Date: %s', 'easy-digital-downloads' ), ( empty( $discount['exp_date'] ) ? __( 'No Expiration', 'easy-digital-downloads' ) : $discount['exp_date'] ) ) ); - WP_CLI::line( sprintf( __( 'Status: %s', 'easy-digital-downloads' ), ucwords( $discount['status'] ) ) ); - - WP_CLI::line( '' ); - - if ( array_key_exists( 0, $discount['product_requirements'] ) ) { - WP_CLI::line( __( 'Product Requirements:', 'easy-digital-downloads' ) ); - - foreach ( $discount['product_requirements'] as $req => $req_id ) { - WP_CLI::line( sprintf( __( ' Product: %s', 'easy-digital-downloads' ), $req_id ) ); - } - } - - WP_CLI::line( '' ); - - WP_CLI::line( sprintf( __( 'Global Discount: %s', 'easy-digital-downloads' ), ( empty( $discount['global_discount'] ) ? 'False' : 'True' ) ) ); - WP_CLI::line( sprintf( __( 'Single Use: %s', 'easy-digital-downloads' ), ( empty( $discount['single_use'] ) ? 'False' : 'True' ) ) ); - - WP_CLI::line( '' ); - } - } - - /** - * Create sample purchase data for your EDD site - * - * ## OPTIONS - * - * --number: The number of purchases to create - * --status=: The status to create purchases as - * --id=: A specific product to create purchase data for - * --price_id=: A price ID of the specified product - * - * ## EXAMPLES - * - * wp edd payments create --number=10 --status=complete - * wp edd payments create --number=10 --id=103 - */ - public function payments( $args, $assoc_args ) { - - $error = false; - - // At some point we'll likely add another action for payments - if ( ! isset( $args ) || 0 === count( $args ) ) { - $error = __( 'No action specified, did you mean', 'easy-digital-downloads' ); - } elseif ( isset( $args ) && ! in_array( 'create', $args, true ) ) { - $error = __( 'Invalid action specified, did you mean', 'easy-digital-downloads' ); - } - - if ( $error ) { - $query = ''; - foreach ( $assoc_args as $key => $value ) { - $query .= ' --' . $key . '=' . $value; - } - - WP_CLI::error( - sprintf( $error . ' %s?', 'wp edd payments create' . $query ) - ); - - return; - } - - - // Setup some defaults - $number = 1; - $status = 'complete'; - $id = false; - $price_id = null; - $tax = 0; - $email = 'guest@edd.local'; - $fname = 'Pippin'; - $lname = 'Williamson'; - $date = false; - $range = 30; - $currency = edd_get_currency(); - $gateway = 'manual'; - - $generate_users = false; - - if ( count( $assoc_args ) > 0 ) { - $number = ( array_key_exists( 'number', $assoc_args ) ) ? absint( $assoc_args['number'] ) : $number; - $id = ( array_key_exists( 'id', $assoc_args ) ) ? absint( $assoc_args['id'] ) : $id; - $price_id = ( array_key_exists( 'price_id', $assoc_args ) ) ? absint( $assoc_args['price_id'] ) : $price_id; - $tax = ( array_key_exists( 'tax', $assoc_args ) ) ? floatval( $assoc_args['tax'] ) : $tax; - $email = ( array_key_exists( 'email', $assoc_args ) ) ? sanitize_email( $assoc_args['email'] ) : $email; - $fname = ( array_key_exists( 'fname', $assoc_args ) ) ? sanitize_text_field( $assoc_args['fname'] ) : $fname; - $lname = ( array_key_exists( 'lname', $assoc_args ) ) ? sanitize_text_field( $assoc_args['lname'] ) : $lname; - $date = ( array_key_exists( 'date', $assoc_args ) ) ? sanitize_text_field( $assoc_args['date'] ) : $date; - $range = ( array_key_exists( 'range', $assoc_args ) ) ? absint( $assoc_args['range'] ) : $range; - - $generate_users = ( array_key_exists( 'generate_users', $assoc_args ) ) ? (bool) absint( $assoc_args['generate_users'] ) : $generate_users; - - // Status requires a bit more validation. - if ( array_key_exists( 'status', $assoc_args ) ) { - $statuses = array_keys( edd_get_payment_statuses() ); - - if ( in_array( $assoc_args['status'], $statuses, true ) ) { - $status = ( 'publish' === $assoc_args['status'] ) - ? 'complete' - : $assoc_args['status']; - } else { - WP_CLI::warning( sprintf( - __( "Invalid status '%s', defaulting to 'complete'", 'easy-digital-downloads' ), - $assoc_args['status'] - ) ); - } - } - } - - // Build the user info array. - $user_info = array( - 'id' => 0, - 'email' => $email, - 'first_name' => $fname, - 'last_name' => $lname, - 'discount' => 'none', - ); - - $progress = \WP_CLI\Utils\make_progress_bar( 'Creating Orders', $number ); - - for ( $i = 0; $i < $number; $i ++ ) { - $products = array(); - $total = 0; - - // No specified product - if ( ! $id ) { - $products = get_posts( array( - 'post_type' => 'download', - 'orderby' => 'rand', - 'order' => 'ASC', - 'posts_per_page' => rand( 1, 3 ), - ) ); - } else { - $product = get_post( $id ); - - if ( 'download' !== $product->post_type ) { - WP_CLI::error( __( 'Specified ID is not a product', 'easy-digital-downloads' ) ); - - return; - } - - $products[] = $product; - } - - $cart_details = array(); - - // Add each download to the order. - foreach ( $products as $key => $download ) { - if ( ! $download instanceof WP_Post ) { - continue; - } - - $options = array(); - $final_downloads = array(); - - // Variable price. - if ( edd_has_variable_prices( $download->ID ) ) { - $prices = edd_get_variable_prices( $download->ID ); - - if ( false === $price_id || ! array_key_exists( $price_id, (array) $prices ) ) { - $item_price_id = array_rand( $prices ); - } else { - $item_price_id = $price_id; - } - - $item_price = $prices[ $item_price_id ]['amount']; - $options['price_id'] = $item_price_id; - - // Flat price. - } else { - $item_price = edd_get_download_price( $download->ID ); - } - - $item_number = array( - 'id' => $download->ID, - 'quantity' => 1, - 'options' => $options, - ); - - $cart_details[ $key ] = array( - 'name' => edd_get_download_name( $download->ID, $price_id ), - 'id' => $download->ID, - 'item_number' => $item_number, - 'item_price' => edd_sanitize_amount( $item_price ), - 'subtotal' => edd_sanitize_amount( $item_price ), - 'price' => edd_sanitize_amount( $item_price ), - 'quantity' => 1, - 'discount' => 0, - 'tax' => edd_calculate_tax( $item_price ), - ); - - $final_downloads[ $key ] = $item_number; - - $total += $item_price; - } - - // Generate random date. - if ( 'random' === $date ) { - // Randomly grab a date from the current past 30 days - $oldest_time = strtotime( '-' . $range . ' days', current_time( 'timestamp' ) ); - $newest_time = current_time( 'timestamp' ); - - $timestamp = rand( $oldest_time, $newest_time ); - $timestring = date( "Y-m-d H:i:s", $timestamp ); - } elseif ( empty( $date ) ) { - $timestring = false; - } else { - if ( is_numeric( $date ) ) { - $timestring = date( "Y-m-d H:i:s", $date ); - } else { - $parsed_time = strtotime( $date ); - $timestring = date( "Y-m-d H:i:s", $parsed_time ); - } - } - - // Maybe generate users. - if ( $generate_users ) { - $fname = $this->get_fname(); - $lname = $this->get_lname(); - $domain = $this->get_domain(); - $tld = $this->get_tld(); - - $email = $fname . '.' . $lname . '@' . $domain . '.' . $tld; - - $user_info = array( - 'id' => 0, - 'email' => $email, - 'first_name' => $fname, - 'last_name' => $lname, - 'discount' => 'none', - ); - } - - // Allow random currencies. - if ( ! empty( $assoc_args['currency'] ) && 'random' === $assoc_args['currency'] ) { - $currencies = array( 'USD', 'EUR', 'GBP' ); - $currency = $currencies[ array_rand( $currencies ) ]; - } - - // Allow random gateways. - if ( ! empty( $assoc_args['gateway'] ) && 'random' === $assoc_args['gateway'] ) { - $gateways = array_keys( edd_get_payment_gateways() ); - $gateway = $gateways[ array_rand( $gateways ) ]; - } - - // Build purchase data. - $purchase_data = array( - 'price' => edd_sanitize_amount( $total ), - 'tax' => edd_calculate_tax( $total ), - 'purchase_key' => strtolower( md5( uniqid() ) ), - 'user_email' => $email, - 'user_info' => $user_info, - 'currency' => $currency, - 'downloads' => $final_downloads, - 'cart_details' => $cart_details, - 'status' => 'pending', - ); - - if ( ! empty( $timestring ) ) { - $purchase_data['date_created'] = $timestring; - } - - $order_id = edd_build_order( $purchase_data ); - - // Ensure purchase receipts do not get sent. - remove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999 ); - - // Trigger payment status actions. - if ( 'pending' !== $status ) { - edd_update_order_status( $order_id, $status ); - } - - if ( ! empty( $timestring ) ) { - $payment = new EDD_Payment( $order_id ); - $payment->completed_date = $timestring; - $payment->gateway = $gateway; - $payment->save(); - } - - $progress->tick(); - } - - $progress->finish(); - - WP_CLI::success( sprintf( __( 'Created %s orders', 'easy-digital-downloads' ), $number ) ); - - return; - } - - /** - * Create discount codes for your EDD site - * - * ## OPTIONS - * - * --legacy: Create legacy discount codes using pre-3.0 schema - * --number: The number of discounts to create - * - * ## EXAMPLES - * - * wp edd create_discounts --number=100 - * wp edd create_discounts --number=50 --legacy - */ - public function create_discounts( $args, $assoc_args ) { - $number = array_key_exists( 'number', $assoc_args ) ? absint( $assoc_args['number'] ) : 1; - $legacy = array_key_exists( 'legacy', $assoc_args ) ? true : false; - - $progress = \WP_CLI\Utils\make_progress_bar( 'Creating Discount Codes', $number ); - - for ( $i = 0; $i < $number; $i ++ ) { - if ( $legacy ) { - $discount_id = wp_insert_post( array( - 'post_type' => 'edd_discount', - 'post_title' => 'Auto-Generated Legacy Discount #' . $i, - 'post_status' => 'active', - ) ); - - $download_ids = get_posts( array( - 'post_type' => 'download', - 'posts_per_page' => 2, - 'fields' => 'ids', - 'orderby' => 'rand', - ) ); - - $meta = array( - 'code' => 'LEGACY' . $i, - 'status' => 'active', - 'uses' => 10, - 'max_uses' => 20, - 'name' => 'Auto-Generated Legacy Discount #' . $i, - 'amount' => 20, - 'start' => '01/01/2000 00:00:00', - 'expiration' => '12/31/2050 23:59:59', - 'type' => 'percent', - 'min_price' => '10.50', - 'product_reqs' => array( $download_ids[0] ), - 'product_condition' => 'all', - 'excluded_products' => array( $download_ids[1] ), - 'is_not_global' => true, - 'is_single_use' => true, - ); - - remove_action( 'pre_get_posts', '_edd_discount_get_post_doing_it_wrong', 99, 1 ); - remove_filter( 'add_post_metadata', '_edd_discount_update_meta_backcompat', 99 ); - - foreach ( $meta as $key => $value ) { - add_post_meta( $discount_id, '_edd_discount_' . $key, $value ); - } - - add_filter( 'add_post_metadata', '_edd_discount_update_meta_backcompat', 99, 5 ); - add_action( 'pre_get_posts', '_edd_discount_get_post_doing_it_wrong', 99, 1 ); - } else { - $type = array( 'flat', 'percent' ); - $status = array( 'active', 'inactive' ); - $product_condition = array( 'any', 'all' ); - - $type_index = array_rand( $type, 1 ); - $status_index = array_rand( $status, 1 ); - $product_condition_index = array_rand( $product_condition, 1 ); - - $post = array( - 'code' => md5( time() ), - 'uses' => mt_rand( 0, 100 ), - 'max' => mt_rand( 0, 100 ), - 'name' => 'Auto-Generated Discount #' . $i, - 'type' => $type[ $type_index ], - 'amount' => mt_rand( 10, 95 ), - 'start' => '12/12/2010 00:00:00', - 'expiration' => '12/31/2050 23:59:59', - 'min_price' => mt_rand( 30, 255 ), - 'status' => $status[ $status_index ], - 'product_condition' => $product_condition[ $product_condition_index ], - ); - - edd_store_discount( $post ); - - $progress->tick(); - } - } - - $progress->finish(); - - WP_CLI::success( sprintf( __( 'Created %s discounts', 'easy-digital-downloads' ), $number ) ); - - return; - } - - /** - * Run the EDD 3.0 Migration via WP-CLI - * - * ## OPTIONS - * - * --force=: If the routine should be run even if the upgrade routine has been run already - * - * @param $args - * @param $assoc_args - */ - public function v30_migration( $args, $assoc_args ) { - - // Suspend the cache addition while we're migrating. - wp_suspend_cache_addition( true ); - - $this->maybe_install_v3_tables(); - update_option( 'edd_v30_cli_migration_running', true ); - $this->migrate_tax_rates( $args, $assoc_args ); - $this->migrate_discounts( $args, $assoc_args ); - $this->migrate_payments( $args, $assoc_args ); - $this->migrate_customer_data( $args, $assoc_args ); - $this->migrate_logs( $args, $assoc_args ); - $this->migrate_order_notes( $args, $assoc_args ); - $this->migrate_customer_notes( $args, $assoc_args ); - edd_v30_is_migration_complete(); - $this->remove_legacy_data( $args, $assoc_args ); - } - - /** - * Installs any new 3.0 database tables that haven't yet been installed - * - * @access private - * @since 3.0 - */ - private function maybe_install_v3_tables() { - static $installed = false; - - if ( $installed ) { - return; - } - - foreach ( EDD()->components as $component ) { - // Install the main component table. - $table = $component->get_interface( 'table' ); - if ( $table instanceof EDD\Database\Table && ! $table->exists() ) { - $table->install(); - } - - // Install the associated meta table, if there is one. - $meta = $component->get_interface( 'meta' ); - if ( $meta instanceof EDD\Database\Table && ! $meta->exists() ) { - $meta->install(); - } - } - - // Only need to do this once. - $installed = true; - } - - /** - * Migrate Discounts to the custom tables - * - * ## OPTIONS - * - * --force=: If the routine should be run even if the upgrade routine has been run already - * - * ## EXAMPLES - * - * wp edd migrate_discounts - * wp edd migrate_discounts --force - */ - public function migrate_discounts( $args, $assoc_args ) { - global $wpdb; - - $this->maybe_install_v3_tables(); - - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/v3/class-data-migrator.php'; - - $force = isset( $assoc_args['force'] ) - ? true - : false; - - $destroy = (bool) ( $force && isset( $assoc_args['destroy'] ) ); - - if ( $destroy ) { - WP_CLI::confirm( __( 'This process will remove and recreate discounts in your database. Please make sure you\'ve backed up your EDD database tables. Are you sure you want to delete discounts that have already been migrated and run the migration again?', 'easy-digital-downloads' ) ); - } - - $upgrade_completed = edd_has_upgrade_completed( 'migrate_discounts' ); - - if ( ! $force && $upgrade_completed ) { - WP_CLI::error( __( 'The discounts custom database migration has already been run. To do this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } - - $sql = "SELECT * FROM {$wpdb->posts} WHERE post_type = 'edd_discount'"; - $results = $wpdb->get_results( $sql ); - $total = count( $results ); - - if ( ! empty( $total ) ) { - - $progress = new \cli\progress\Bar( 'Migrating Discounts', $total ); - - foreach ( $results as $result ) { - if ( $destroy ) { - edd_delete_discount( $result->ID ); - } - \EDD\Admin\Upgrades\v3\Data_Migrator::discounts( $result ); - - $progress->tick(); - } - - $progress->finish(); - - WP_CLI::line( __( 'Migration complete: Discounts', 'easy-digital-downloads' ) ); - $new_count = edd_get_discount_count(); - $old_count = $wpdb->get_col( "SELECT count(ID) FROM $wpdb->posts WHERE post_type ='edd_discount'", 0 ); - WP_CLI::line( __( 'Old Records: ', 'easy-digital-downloads' ) . $old_count[0] ); - WP_CLI::line( __( 'New Records: ', 'easy-digital-downloads' ) . $new_count ); - - edd_set_upgrade_complete( 'migrate_discounts' ); - - } else { - - WP_CLI::line( __( 'No discount records found.', 'easy-digital-downloads' ) ); - edd_set_upgrade_complete( 'migrate_discounts' ); - - } - } - - /** - * Migrate logs to the custom tables. - * - * ## OPTIONS - * - * --force=: If the routine should be run even if the upgrade routine has been run already - * - * ## EXAMPLES - * - * wp edd migrate_logs - * wp edd migrate_logs --force - */ - public function migrate_logs( $args, $assoc_args ) { - global $wpdb; - - $this->maybe_install_v3_tables(); - - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/v3/class-data-migrator.php'; - - $force = isset( $assoc_args['force'] ) - ? true - : false; - - $upgrade_completed = edd_has_upgrade_completed( 'migrate_logs' ); - - if ( ! $force && $upgrade_completed ) { - WP_CLI::error( __( 'The logs custom table migration has already been run. To do this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } - - WP_CLI::line( __( 'Preparing to migrate logs (this can take several minutes).', 'easy-digital-downloads' ) ); - - // New Progress indicator. - $progress = new \cli\notify\Spinner( __( 'Migrating Logs', 'easy-digital-downloads' ) ); - $progress->tick(); - - // Base SQL to get legacy logs (LIMIT added below) - $sql_base = " - SELECT p.*, t.slug - FROM {$wpdb->posts} AS p - LEFT JOIN {$wpdb->term_relationships} AS tr ON (p.ID = tr.object_id) - LEFT JOIN {$wpdb->term_taxonomy} AS tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) - LEFT JOIN {$wpdb->terms} AS t ON (tt.term_id = t.term_id) - WHERE - p.post_type = 'edd_log' - AND - t.slug != 'sale' - ORDER BY p.ID ASC - "; - - // Query & count. - $sql = $sql_base . " LIMIT 1"; - $check_result = $wpdb->get_results( $sql ); - $check_total = count( $check_result ); - $has_results = ! empty( $check_total ); - - // Setup base iteration variables. - $step = 0; - $offset = 0; - $number = isset( $assoc_args['number'] ) && is_numeric( $assoc_args['number'] ) - ? (int) $assoc_args['number'] - : 1000; - - // Maximum 10,000 - this ain't no VTEC. - if ( $number > 10000 ) { - $number = 10000; - } - - // Starting total. - $total = 0; - - while ( $has_results ) { - $progress->tick(); - - // Query & count. - $sql = $sql_base . " LIMIT {$offset}, {$number}"; - $results = $wpdb->get_results( $sql ); - - // Not empty, so lets chug through them! - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - \EDD\Admin\Upgrades\v3\Data_Migrator::logs( $result ); - - // Tick the spinner... - $progress->tick(); - - // Bump the total... - $total++; - } - - // Increment step for the next offset... - $step++; - - // EG: 1 * 1000 = 1000, 2 * 1000 = 2000. - $offset = ( $step * $number ); - - // Done! - } else { - $has_results = false; - } - } - - $progress->finish(); - - if ( 0 === $step ) { - WP_CLI::line( __( 'No log records found.', 'easy-digital-downloads' ) ); - } else { - // This migration is completed on a data set. - WP_CLI::line( __( 'Migration complete: Logs', 'easy-digital-downloads' ) ); - $new_count = edd_count_logs() + edd_count_file_download_logs() + edd_count_api_request_logs(); - WP_CLI::line( __( 'Old Records: ', 'easy-digital-downloads' ) . $total ); - WP_CLI::line( __( 'New Records: ', 'easy-digital-downloads' ) . $new_count ); - } - - edd_set_upgrade_complete( 'migrate_logs' ); - - } - - /** - * Migrate order notes to the custom tables. - * - * ## OPTIONS - * - * --force=: If the routine should be run even if the upgrade routine has been run already - * - * ## EXAMPLES - * - * wp edd migrate_notes - * wp edd migrate_notes --force - */ - public function migrate_order_notes( $args, $assoc_args ) { - global $wpdb; - - $this->maybe_install_v3_tables(); - - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/v3/class-data-migrator.php'; - - $force = isset( $assoc_args['force'] ) - ? true - : false; - - $upgrade_completed = edd_has_upgrade_completed( 'migrate_order_notes' ); - - if ( ! $force && $upgrade_completed ) { - WP_CLI::error( __( 'The order notes custom table migration has already been run. To do this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } - - WP_CLI::line( __( 'Preparing to migrate order notes.', 'easy-digital-downloads' ) ); - - $progress = new \cli\notify\Spinner( __( 'Migrating Order Notes', 'easy-digital-downloads' ) ); - $progress->tick(); - - $sql_base = " - SELECT * FROM {$wpdb->comments} - WHERE comment_type = 'edd_payment_note' - ORDER BY comment_ID ASC - "; - - // Query & count. - $sql = $sql_base . " LIMIT 1"; - $check_result = $wpdb->get_results( $sql ); - $check_total = count( $check_result ); - $has_results = ! empty( $check_total ); - - // Setup base iteration variables. - $step = 0; - $offset = 0; - $number = isset( $assoc_args['number'] ) && is_numeric( $assoc_args['number'] ) - ? (int) $assoc_args['number'] - : 1000; - - // Maximum 10,000 - this ain't no VTEC. - if ( $number > 10000 ) { - $number = 10000; - } - - $total = 0; - - while ( $has_results ) { - $progress->tick(); - - // Query & count. - $sql = $sql_base . " LIMIT {$offset}, {$number}"; - $results = $wpdb->get_results( $sql ); - - // Not empty, so lets process the order notes. - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - $result->object_id = $result->comment_post_ID; - \EDD\Admin\Upgrades\v3\Data_Migrator::order_notes( $result ); - - // Tick the spinner... - $progress->tick(); - - // Bump the total... - $total++; - } - - // Increment step for the next offset... - $step++; - - // EG: 1 * 1000 = 1000, 2 * 1000 = 2000. - $offset = ( $step * $number ); - - // Done! - } else { - $has_results = false; - } - } - - $progress->finish(); - - if ( 0 === $step ) { - WP_CLI::line( __( 'No order notes found.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Migration complete: Order Notes', 'easy-digital-downloads' ) ); - $new_count = edd_count_notes( array( 'object_type' => 'order' ) ); - WP_CLI::line( __( 'Old order notes: ', 'easy-digital-downloads' ) . $total ); - WP_CLI::line( __( 'New order notes: ', 'easy-digital-downloads' ) . $new_count ); - } - - edd_set_upgrade_complete( 'migrate_order_notes' ); - } - - /** - * Migrate customer notes to the custom tables. - * - * ## OPTIONS - * - * --force=: If the routine should be run even if the upgrade routine has been run already - * - * ## EXAMPLES - * - * wp edd migrate_notes - * wp edd migrate_notes --force - */ - public function migrate_customer_notes( $args, $assoc_args ) { - global $wpdb; - - $this->maybe_install_v3_tables(); - - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/v3/class-data-migrator.php'; - - $force = isset( $assoc_args['force'] ) - ? true - : false; - - $upgrade_completed = edd_has_upgrade_completed( 'migrate_customer_notes' ); - - if ( ! $force && $upgrade_completed ) { - WP_CLI::error( __( 'The customer notes custom table migration has already been run. To do this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Preparing to migrate customer notes.', 'easy-digital-downloads' ) ); - - $progress = new \cli\notify\Spinner( __( 'Migrating Customer Notes', 'easy-digital-downloads' ) ); - $progress->tick(); - - $sql_base = "SELECT * FROM {$wpdb->edd_customers}"; - - // Query & count. - $sql = $sql_base . " LIMIT 1"; - $check_result = $wpdb->get_results( $sql ); - $check_total = count( $check_result ); - $has_results = ! empty( $check_total ); - - // Setup base iteration variables. - $step = 0; - $offset = 0; - $number = isset( $assoc_args['number'] ) && is_numeric( $assoc_args['number'] ) - ? (int) $assoc_args['number'] - : 1000; - - // Maximum 10,000 - this ain't no VTEC. - if ( $number > 10000 ) { - $number = 10000; - } - - $total = 0; - - while ( $has_results ) { - $progress->tick(); - - // Query & count. - $sql = $sql_base . " LIMIT {$offset}, {$number}"; - $results = $wpdb->get_results( $sql ); - - // Not empty, so lets process the customer notes. - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - \EDD\Admin\Upgrades\v3\Data_Migrator::customer_notes( $result ); - - - // Tick the spinner... - $progress->tick(); - - // Bump the total... - $total++; - } - - // Increment step for the next offset... - $step++; - - // EG: 1 * 1000 = 1000, 2 * 1000 = 2000. - $offset = ( $step * $number ); - - // Done! - } else { - $has_results = false; - } - } - - $progress->finish(); - - if ( 0 === $step ) { - WP_CLI::line( __( 'No customer notes found.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Migration complete: Customer Notes', 'easy-digital-downloads' ) ); - $new_count = edd_count_notes( array( 'object_type' => 'customer' ) ); - WP_CLI::line( __( 'Old customer notes: ', 'easy-digital-downloads' ) . $total ); - WP_CLI::line( __( 'New customer notes: ', 'easy-digital-downloads' ) . $new_count ); - } - - edd_set_upgrade_complete( 'migrate_customer_notes' ); - } - } - - /** - * Migrate customer data to the custom tables. - * - * ## OPTIONS - * - * --force=: If the routine should be run even if the upgrade routine has been run already - * - * ## EXAMPLES - * - * wp edd migrate_customer_data - * wp edd migrate_customer_data --force - */ - public function migrate_customer_data( $args, $assoc_args ) { - global $wpdb; - - $this->maybe_install_v3_tables(); - - $customers = new EDD\Database\Tables\Customers(); - $customers->maybe_upgrade(); - - $meta = new EDD\Database\Tables\Customer_Meta(); - $meta->maybe_upgrade(); - - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/v3/class-data-migrator.php'; - - $force = isset( $assoc_args['force'] ) - ? true - : false; - - WP_CLI::line( __( 'Preparing to migrate additional customer data.', 'easy-digital-downloads' ) ); - - // Create the tables if they do not exist. - $components = array( - array( 'order', 'table' ), - array( 'order', 'meta' ), - array( 'customer', 'table' ), - array( 'customer', 'meta' ), - array( 'customer_address', 'table' ), - array( 'customer_email_address', 'table' ), - ); - - foreach ( $components as $component ) { - /** @var EDD\Database\Tables\Base $table */ - $table = edd_get_component_interface( $component[0], $component[1] ); - - if ( $table instanceof EDD\Database\Tables\Base && ! $table->exists() ) { - @$table->create(); - } - } - - // Migrate Customer Addresses. - $customer_addresses_complete = edd_has_upgrade_completed( 'migrate_customer_addresses' ); - - if ( ! $force && $customer_addresses_complete ) { - WP_CLI::warning( __( 'The user addresses custom table migration has already been run. To do this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Preparing to migrate customer address data.', 'easy-digital-downloads' ) ); - $progress = new \cli\notify\Spinner( __( 'Migrating Customer Addresses', 'easy-digital-downloads' ) ); - $progress->tick(); - - // Migrate user addresses first. - $sql_base = " - SELECT * - FROM {$wpdb->usermeta} - WHERE meta_key = '_edd_user_address' - "; - - // Query & count. - $sql = $sql_base . " LIMIT 1"; - $check_result = $wpdb->get_results( $sql ); - $check_total = count( $check_result ); - $has_results = ! empty( $check_total ); - - // Setup base iteration variables. - $step = 0; - $offset = 0; - $number = isset( $assoc_args['number'] ) && is_numeric( $assoc_args['number'] ) - ? (int) $assoc_args['number'] - : 1000; - - // Maximum 10,000 - this ain't no VTEC. - if ( $number > 10000 ) { - $number = 10000; - } - - $total = 0; - - while ( $has_results ) { - $progress->tick(); - - // Query & count. - $sql = $sql_base . " LIMIT {$offset}, {$number}"; - $results = $wpdb->get_results( $sql ); - - // Not empty, so lets process the customer address. - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - \EDD\Admin\Upgrades\v3\Data_Migrator::customer_addresses( $result, 'billing' ); - - // Tick the spinner... - $progress->tick(); - - // Bump the total... - $total++; - } - - // Increment step for the next offset... - $step++; - - // EG: 1 * 1000 = 1000, 2 * 1000 = 2000. - $offset = ( $step * $number ); - - // Done! - } else { - $has_results = false; - } - } - - $progress->tick(); - $progress->finish(); - - edd_set_upgrade_complete( 'migrate_customer_addresses' ); - } - - // Migrate Customer Email Addresses. - $customer_email_addresses_complete = edd_has_upgrade_completed( 'migrate_customer_email_addresses' ); - - if ( ! $force && $customer_email_addresses_complete ) { - WP_CLI::warning( __( 'The user email addresses custom table migration has already been run. To do this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Preparing to migrate customer email addresses (this can take several minutes).', 'easy-digital-downloads' ) ); - $progress = new \cli\notify\Spinner( __( 'Migrating Customer Email Addresses', 'easy-digital-downloads' ) ); - $progress->tick(); - - // Migrate email addresses next. - $sql = " - SELECT * - FROM {$wpdb->edd_customermeta} - WHERE meta_key = 'additional_email' - "; - - // Query & count. - $sql = $sql_base . " LIMIT 1"; - $check_result = $wpdb->get_results( $sql ); - $check_total = count( $check_result ); - $has_results = ! empty( $check_total ); - - // Setup base iteration variables. - $step = 0; - $offset = 0; - $number = isset( $assoc_args['number'] ) && is_numeric( $assoc_args['number'] ) - ? (int) $assoc_args['number'] - : 1000; - - // Maximum 10,000 - this ain't no VTEC. - if ( $number > 10000 ) { - $number = 10000; - } - - $total = 0; - - while ( $has_results ) { - $progress->tick(); - - // Query & count. - $sql = $sql_base . " LIMIT {$offset}, {$number}"; - $results = $wpdb->get_results( $sql ); - - // Not empty, so lets process the customer email addresses. - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - \EDD\Admin\Upgrades\v3\Data_Migrator::customer_email_addresses( $result ); - - // Tick the spinner... - $progress->tick(); - - // Bump the total... - $total++; - } - - // Increment step for the next offset... - $step++; - - // EG: 1 * 1000 = 1000, 2 * 1000 = 2000. - $offset = ( $step * $number ); - - // Done! - } else { - $has_results = false; - } - } - - $progress->finish(); - edd_set_upgrade_complete( 'migrate_customer_email_addresses' ); - WP_CLI::line( __( 'Migration complete: Customer Email Addresses', 'easy-digital-downloads' ) ); - } - - } - - /** - * Migrate tax rates. - * - * ## OPTIONS - * - * --force=: If the routine should be run even if the upgrade routine has been run already - * - * ## EXAMPLES - * - * wp edd migrate_tax_rates - * wp edd migrate_tax_rates --force - */ - public function migrate_tax_rates( $args, $assoc_args ) { - global $wpdb; - - $this->maybe_install_v3_tables(); - - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/v3/class-data-migrator.php'; - - $force = isset( $assoc_args['force'] ) - ? true - : false; - - $upgrade_completed = edd_has_upgrade_completed( 'migrate_tax_rates' ); - - if ( ! $force && $upgrade_completed ) { - WP_CLI::error( __( 'The tax rates custom table migration has already been run. To do this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } - - WP_CLI::line( __( 'Checking for default tax rate', 'easy-digital-downloads' ) ); - $default_tax_rate = edd_get_option( 'tax_rate', false ); - if ( ! empty( $default_tax_rate ) ) { - WP_CLI::line( __( 'Migrating default tax rate', 'easy-digital-downloads' ) ); - edd_add_tax_rate( - array( - 'scope' => 'global', - 'amount' => floatval( $default_tax_rate ), - ) - ); - } - - // Migrate user addresses first. - $tax_rates = get_option( 'edd_tax_rates', array() ); - - if ( ! empty( $tax_rates ) ) { - $progress = new \cli\progress\Bar( 'Migrating Tax Rates', count( $tax_rates ) ); - - foreach ( $tax_rates as $result ) { - \EDD\Admin\Upgrades\v3\Data_Migrator::tax_rates( $result ); - - $progress->tick(); - } - - $progress->finish(); - } - - WP_CLI::line( __( 'Migration complete: Tax Rates', 'easy-digital-downloads' ) ); - $new_count = edd_count_adjustments( array( 'type' => 'tax_rate' ) ); - WP_CLI::line( __( 'Old Records: ', 'easy-digital-downloads' ) . count( $tax_rates ) ); - WP_CLI::line( __( 'New Records: ', 'easy-digital-downloads' ) . $new_count ); - - edd_set_upgrade_complete( 'migrate_tax_rates' ); - } - - /** - * Migrate payments to the custom tables. - * - * ## OPTIONS - * - * --force=: If the routine should be run even if the upgrade routine has been run already - * --id=: Run the migration for a specific order. - * --start=: Run the migration beginning with a specific order ID. - * --end=: Run the migration ending with a specific order ID. - * --destroy=: Destroy existing orders that have already been migrated. - * - * ## EXAMPLES - * - * wp edd migrate_payments - * wp edd migrate_payments --force - * wp edd migrate_payments --force --id=3 Migrate payment ID 3. - * wp edd migrate_payments --force --start=3 Migrate payments beginning with and including ID 3. - * wp edd migrate_payments --force --end=3 Migrate payments up to and including ID 3, but not higher. - * wp edd migrate_payments --force --destroy Destroy existing orders and migrate them again. - */ - public function migrate_payments( $args, $assoc_args ) { - global $wpdb; - - $this->maybe_install_v3_tables(); - - require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/v3/class-data-migrator.php'; - - $force = isset( $assoc_args['force'] ) - ? true - : false; - - $destroy = (bool) ( $force && isset( $assoc_args['destroy'] ) ); - - if ( $destroy ) { - WP_CLI::confirm( __( 'This process will remove and recreate orders in your database. Please make sure you\'ve backed up your EDD database tables. Are you sure you want to delete orders that have already been migrated and run the migration again?', 'easy-digital-downloads' ) ); - } - - $upgrade_completed = edd_has_upgrade_completed( 'migrate_orders' ); - - if ( ! $force && $upgrade_completed ) { - WP_CLI::error( __( 'The payments custom table migration has already been run. To do this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } - - WP_CLI::line( __( 'Preparing to migrate payments.', 'easy-digital-downloads' ) ); - - // New Progress indicator. - $progress = new \cli\notify\Spinner( __( 'Migrating Payments', 'easy-digital-downloads' ) ); - $progress->tick(); - - $sql_base = " - SELECT * - FROM {$wpdb->posts} - WHERE post_type = 'edd_payment' - "; - - // Query & count. - $sql = $sql_base . " LIMIT 1"; - $check_result = $wpdb->get_results( $sql ); - $check_total = count( $check_result ); - $has_results = ! empty( $check_total ); - - // Setup base iteration variables. - $step = 0; - $offset = 0; - $full_migration = true; - - // Migrate one specific order. - if ( ! empty( $assoc_args['id'] ) ) { - if ( is_numeric( $assoc_args['id'] ) ) { - $id = absint( $assoc_args['id'] ); - $sql_base .= " AND ID = {$id}"; - $full_migration = false; - if ( ! $wpdb->get_results( $sql_base ) ) { - WP_CLI::error( __( 'An EDD Payment could not be found for that ID.', 'easy-digital-downloads' ) ); - } - } else { - WP_CLI::error( __( 'The payment ID must be an integer from the post_id column.', 'easy-digital-downloads' ) ); - } - } elseif ( ! empty( $assoc_args['start'] ) || ! empty( $assoc_args['end'] ) ) { - - // Begin the order migration at a specific payment ID. - if ( ! empty( $assoc_args['start'] ) ) { - if ( is_numeric( $assoc_args['start'] ) ) { - $start = absint( $assoc_args['start'] ); - $sql_base .= " AND ID >= {$start}"; - $full_migration = false; - } else { - WP_CLI::error( __( 'The starting ID must be an integer from the post_id column.', 'easy-digital-downloads' ) ); - } - } - // Stop the order migration at a specific payment ID. - if ( ! empty( $assoc_args['end'] ) ) { - if ( is_numeric( $assoc_args['end'] ) ) { - $end = absint( $assoc_args['end'] ); - $sql_base .= " AND ID <= {$end}"; - $full_migration = false; - } else { - WP_CLI::error( __( 'The ending ID must be an integer from the post_id column.', 'easy-digital-downloads' ) ); - } - } - } - - // Confirm any partial migrations if the upgrade hasn't been completed. - if ( ! $full_migration && ! $upgrade_completed ) { - WP_CLI::confirm( __( 'Are you sure you want to run a partial order migration?', 'easy-digital-downloads' ) ); - } - - $sql_base .= ' ORDER BY ID ASC'; - - $number = isset( $assoc_args['number'] ) && is_numeric( $assoc_args['number'] ) - ? (int) $assoc_args['number'] - : 1000; - - // Maximum 10,000 - this ain't no VTEC. - if ( $number > 10000 ) { - $number = 10000; - } - - // Starting total. - $total = 0; - - while ( $has_results ) { - $orders = new \EDD\Database\Queries\Order(); - $progress->tick(); - - // Query & count. - $sql = $sql_base . " LIMIT {$offset}, {$number}"; - $results = $wpdb->get_results( $sql ); - - // Not empty, so lets chug through them! - if ( ! empty( $results ) ) { - foreach ( $results as $result ) { - - // Check if order has already been migrated. - $migrated = $orders->get_item( $result->ID ); - $parent_id = false; - - // Delete the existing order to re-run the migration fresh. - if ( $destroy ) { - $parent_id = 'refund' === $migrated->type && ! empty( $migrated->parent ) ? $migrated->parent : false; - - // EDD has detected a collision between a refund ID and a payment ID. - if ( ! empty( $parent_id ) ) { - WP_CLI::line( - sprintf( - /* translators: 1. the refund order ID; 2. the original payment ID. */ - __( '%1$d is a refund order. EDD will delete the refund and migrate payment %1$d, then re-migrate payment %2$d.', 'easy-digital-downloads' ), - $result->ID, - $parent_id - ) - ); - } elseif ( $result->post_date_gmt !== $migrated->date_created ) { - // The migrated order does not appear to be the same as the original order, so let's confirm. - WP_CLI::confirm( - sprintf( - /* translators: 1. the order/payment ID. */ - __( 'Order ID %1$d appears to be a different record from Payment ID %1$d. Are you sure you want to destroy this order and overwrite it?', 'easy-digital-downloads' ), - $result->ID - ) - ); - } - edd_destroy_order( $result->ID ); - $migrated = false; - } - - if ( $migrated ) { - $progress->tick(); - continue; - } - - $success = \EDD\Admin\Upgrades\v3\Data_Migrator::orders( $result ); - - /** - * We detected that a refund order ID collided with an edd_payment post ID. - * We deleted the refund already; now delete the original order and re-migrate it to regenerate the refund. - */ - if ( $parent_id ) { - edd_destroy_order( $parent_id ); - $result = $wpdb->get_row( - $wpdb->prepare( - "SELECT * - FROM {$wpdb->posts} - WHERE post_type = 'edd_payment' - AND ID = %d", - $parent_id - ) - ); - \EDD\Admin\Upgrades\v3\Data_Migrator::orders( $result ); - } - if ( ! $full_migration && empty( $success ) ) { - /* translators: payment ID. */ - WP_CLI::line( sprintf( __( 'Migration failed for payment %d.', 'easy-digital-downloads' ), $result->ID ) ); - } - - // Tick the spinner... - $progress->tick(); - - // Bump the total... - $total++; - } - - // Increment step for the next offset... - $step++; - - // EG: 1 * 1000 = 1000, 2 * 1000 = 2000. - $offset = ( $step * $number ); - - // Done! - } else { - $has_results = false; - } - } - - if ( 0 === $step ) { - WP_CLI::line( __( 'No payment records found.', 'easy-digital-downloads' ) ); - if ( $full_migration ) { - edd_set_upgrade_complete( 'migrate_orders' ); - edd_set_upgrade_complete( 'remove_legacy_payments' ); - } - } else { - if ( ! $full_migration ) { - WP_CLI::line( __( 'Partial order migration complete. Orders Processed: ', 'easy-digital-downloads' ) . $total ); - WP_CLI::line( __( 'To recalculate all download sales and earnings, run `wp edd recalculate_download_sales_earnings`.', 'easy-digital-downloads' ) ); - WP_CLI::line( __( 'To recalculate all customer sales and earnings, run `wp edd recalculate_customer_values`.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Migration complete: Orders', 'easy-digital-downloads' ) ); - $new_count = edd_count_orders( array( 'type' => 'sale' ) ); - $old_count = $wpdb->get_col( "SELECT count(ID) FROM {$wpdb->posts} WHERE post_type = 'edd_payment'", 0 ); - WP_CLI::line( __( 'Old Records: ', 'easy-digital-downloads' ) . $old_count[0] ); - WP_CLI::line( __( 'New Records: ', 'easy-digital-downloads' ) . $new_count ); - - $refund_count = edd_count_orders( array( 'type' => 'refund' ) ); - WP_CLI::line( __( 'Refund Records Created: ', 'easy-digital-downloads' ) . $refund_count ); - - edd_set_upgrade_complete( 'migrate_orders' ); - - $progress->tick(); - $this->recalculate_download_sales_earnings(); - $this->recalculate_customer_values(); - } - } - - $progress->finish(); - } - - /** - * Display the legacy data for an EDD_Payment. - * - * @param array $args - * @return void - */ - public function display_legacy_payment_data( $args ) { - $id = ! empty( $args[0] ) ? (int) $args[0] : false; - if ( ! $id ) { - WP_CLI::error( __( 'You must enter a payment ID to display legacy data.', 'easy-digital-downloads' ) ); - } - - global $wpdb; - - $results = $wpdb->get_results( - $wpdb->prepare( - "SELECT * - FROM {$wpdb->postmeta} - WHERE post_id = %d", - $id - ) - ); - - if ( empty( $results ) ) { - WP_CLI::error( __( 'The legacy payment data could not be found.', 'easy-digital-downloads' ) ); - } - - foreach ( $results as $result ) { - $meta_value = maybe_unserialize( $result->meta_value ); - if ( is_array( $meta_value ) ) { - WP_CLI::line( $result->meta_key . ' =>' ); - foreach ( $meta_value as $key => $value ) { - WP_CLI::line( $key . ' => ' . print_r( maybe_unserialize( $value ), true ) ); - } - WP_CLI::line( '/' . $result->meta_key ); - } else { - WP_CLI::line( $result->meta_key . ' => ' . print_r( $meta_value, true ) ); - } - } - } - - /** - * Recalculates the sales and earnings for all downloads. - * - * @since 3.0 - * @return void - * - * wp edd recalculate_download_sales_earnings - */ - public function recalculate_download_sales_earnings() { - global $wpdb; - - $downloads = $wpdb->get_results( - "SELECT ID - FROM {$wpdb->posts} - WHERE post_type = 'download' - ORDER BY ID ASC" - ); - $total = count( $downloads ); - if ( ! empty( $total ) ) { - $progress = new \cli\progress\Bar( 'Recalculating Download Sales and Earnings', $total ); - foreach ( $downloads as $download ) { - edd_recalculate_download_sales_earnings( $download->ID ); - $progress->tick(); - } - $progress->finish(); - } - WP_CLI::line( __( 'Sales and Earnings successfully recalculated for all downloads.', 'easy-digital-downloads' ) ); - WP_CLI::line( __( 'Downloads Updated: ', 'easy-digital-downloads' ) . $total ); - } - - /** - * Recalculates all customer values. - * - * @since 3.1.2 - * @return void - */ - public function recalculate_customer_values() { - $customers = edd_get_customers( - array( - 'number' => 9999999, - ) - ); - $total = count( $customers ); - - if ( ! empty( $total ) ) { - $progress = new \cli\progress\Bar( 'Recalculating Customer Values', $total ); - foreach ( $customers as $customer ) { - $customer->recalculate_stats(); - $progress->tick(); - } - $progress->finish(); - } - - WP_CLI::line( __( 'Sales and Earnings successfully recalculated for all customers.', 'easy-digital-downloads' ) ); - WP_CLI::line( __( 'Customers Updated: ', 'easy-digital-downloads' ) . $total ); - } - - /** - * Removes legacy data from 2.9 and earlier that has been migrated to 3.0. - * - * ## OPTIONS - * - * --force=: If the routine should be run even if the upgrade routine has been run already - * - * ## EXAMPLES - * - * wp edd remove_legacy_data - * wp edd remove_legacy_data --force - */ - public function remove_legacy_data( $args, $assoc_args ) { - global $wpdb; - - WP_CLI::confirm( __( 'Do you want to remove legacy data? This will permanently remove legacy discounts, logs, and order notes.', 'easy-digital-downloads' ) ); - - $force = isset( $assoc_args['force'] ) ? true : false; - - /** - * Discounts - */ - if ( ! $force && edd_has_upgrade_completed( 'remove_legacy_discounts' ) ) { - WP_CLI::warning( __( 'Legacy discounts have already been removed. To run this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Removing old discount data.', 'easy-digital-downloads' ) ); - - $discount_ids = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type = 'edd_discount'" ); - $discount_ids = wp_list_pluck( $discount_ids, 'ID' ); - $discount_ids = implode( ', ', $discount_ids ); - - if ( ! empty( $discount_ids ) ) { - $delete_posts_query = "DELETE FROM $wpdb->posts WHERE ID IN ({$discount_ids})"; - $wpdb->query( $delete_posts_query ); - - $delete_postmeta_query = "DELETE FROM $wpdb->postmeta WHERE post_id IN ({$discount_ids})"; - $wpdb->query( $delete_postmeta_query ); - } - - edd_set_upgrade_complete( 'remove_legacy_discounts' ); - } - - /** - * Logs - */ - if ( ! $force && edd_has_upgrade_completed( 'remove_legacy_logs' ) ) { - WP_CLI::warning( __( 'Legacy logs have already been removed. To run this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Removing old logs.', 'easy-digital-downloads' ) ); - - $log_ids = $wpdb->get_results( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'edd_log'" ); - $log_ids = wp_list_pluck( $log_ids, 'ID' ); - $log_ids = implode( ', ', $log_ids ); - - if ( ! empty( $log_ids ) ) { - $delete_query = "DELETE FROM {$wpdb->posts} WHERE post_type = 'edd_log'"; - $wpdb->query( $delete_query ); - - $delete_postmeta_query = "DELETE FROM {$wpdb->posts} WHERE ID IN ({$log_ids})"; - $wpdb->query( $delete_postmeta_query ); - } - - edd_set_upgrade_complete( 'remove_legacy_logs' ); - } - - /** - * Order notes - */ - if ( ! $force && edd_has_upgrade_completed( 'remove_legacy_order_notes' ) ) { - WP_CLI::warning( __( 'Legacy order notes have already been removed. To run this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Removing old order notes.', 'easy-digital-downloads' ) ); - - $note_ids = $wpdb->get_results( "SELECT comment_ID FROM {$wpdb->comments} WHERE comment_type = 'edd_payment_note'" ); - $note_ids = wp_list_pluck( $note_ids, 'comment_ID' ); - $note_ids = implode( ', ', $note_ids ); - - if ( ! empty( $note_ids ) ) { - $delete_query = "DELETE FROM {$wpdb->comments} WHERE comment_type = 'edd_payment_note'"; - $wpdb->query( $delete_query ); - - $delete_postmeta_query = "DELETE FROM {$wpdb->commentmeta} WHERE comment_id IN ({$note_ids})"; - $wpdb->query( $delete_postmeta_query ); - } - - edd_set_upgrade_complete( 'remove_legacy_order_notes' ); - } - - /** - * Customers - * - * @var \EDD\Database\Tables\Customers|false $customer_table - */ - $customer_table = edd_get_component_interface( 'customer', 'table' ); - if ( $customer_table instanceof \EDD\Database\Tables\Customers ) { - WP_CLI::line( __( 'Updating customers database table.', 'easy-digital-downloads' ) ); - - if ( $customer_table->column_exists( 'payment_ids' ) ) { - WP_CLI::line( __( 'Removing Payment IDs column.', 'easy-digital-downloads' ) ); - - $wpdb->query( "ALTER TABLE {$wpdb->edd_customers} DROP `payment_ids`" ); - } - - if ( $customer_table->column_exists( 'notes' ) ) { - WP_CLI::line( __( 'Removing notes column.', 'easy-digital-downloads' ) ); - - $wpdb->query( "ALTER TABLE {$wpdb->edd_customers} DROP `notes`" ); - } - } - - /** - * Customer emails - */ - if ( ! $force && edd_has_upgrade_completed( 'remove_legacy_customer_emails' ) ) { - WP_CLI::warning( __( 'Legacy customer emails have already been removed. To run this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Removing old customer emails.', 'easy-digital-downloads' ) ); - - $wpdb->query( "DELETE FROM {$wpdb->edd_customermeta} WHERE meta_key = 'additional_email'" ); - - edd_set_upgrade_complete( 'remove_legacy_customer_emails' ); - } - - /** - * Customer addresses - */ - if ( ! $force && edd_has_upgrade_completed( 'remove_legacy_customer_addresses' ) ) { - WP_CLI::warning( __( 'Legacy customer addresses have already been removed. To run this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Removing old customer addresses.', 'easy-digital-downloads' ) ); - - $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key = '_edd_user_address'" ); - - edd_set_upgrade_complete( 'remove_legacy_customer_addresses' ); - } - - /** - * Orders - */ - if ( ! $force && edd_has_upgrade_completed( 'remove_legacy_orders' ) ) { - WP_CLI::warning( __( 'Legacy orders have already been removed. To run this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'Removing old orders.', 'easy-digital-downloads' ) ); - - $wpdb->query( - "DELETE orders, order_meta FROM {$wpdb->posts} orders - LEFT JOIN {$wpdb->postmeta} order_meta ON( orders.ID = order_meta.post_id ) - WHERE orders.post_type = 'edd_payment'" - ); - - edd_set_upgrade_complete( 'remove_legacy_orders' ); - } - } - - /* - * Create sample file download log data for your EDD site - * - * ## OPTIONS - * - * --number: The number of download logs to create - * - * ## EXAMPLES - * - * wp edd download_logs create --number=10 - */ - public function download_logs( $args, $assoc_args ) { - global $wpdb, $edd_logs; - - $error = false; - - // At some point we'll likely add another action for payments - if ( ! isset( $args ) || count( $args ) == 0 ) { - $error = __( 'No action specified, did you mean', 'easy-digital-downloads' ); - } elseif ( isset( $args ) && ! in_array( 'create', $args ) ) { - $error = __( 'Invalid action specified, did you mean', 'easy-digital-downloads' ); - } - - if ( $error ) { - $query = ''; - foreach ( $assoc_args as $key => $value ) { - $query .= ' --' . $key . '=' . $value; - } - - WP_CLI::error( - sprintf( $error . ' %s?', 'wp edd download_logs create' . $query ) - ); - - return; - } - - // Setup some defaults - $number = 1; - - if ( count( $assoc_args ) > 0 ) { - $number = ( array_key_exists( 'number', $assoc_args ) ) ? absint( $assoc_args['number'] ) : $number; - } - - - // First we need to find all downloads that have files associated. - $download_ids_with_file_meta = $wpdb->get_results( "SELECT post_id, meta_value FROM {$wpdb->postmeta} WHERE meta_key = 'edd_download_files'" ); - $download_ids_with_files = array(); - foreach ( $download_ids_with_file_meta as $meta_item ) { - if ( empty( $meta_item->meta_value ) ) { - continue; - } - $files = maybe_unserialize( $meta_item->meta_value ); - - // We have an empty array; - if ( empty( $files ) ) { - continue; - } - - $download_ids_with_files[ $meta_item->post_id ] = array_keys( $files ); - } - - global $wpdb; - $product_ids = implode('","', array_keys( $download_ids_with_files ) ); - $table = $wpdb->prefix . 'edd_order_items'; - $sql = 'SELECT order_id, product_id, price_id, uuid FROM ' . $table . ' WHERE product_id IN ( "' . $product_ids . '")'; - $results = $wpdb->get_results( $sql ); - - // Now generate some download logs for the files. - $progress = \WP_CLI\Utils\make_progress_bar( 'Creating File Download Logs', $number ); - $i = 1; - while ( $i <= $number ) { - $found_item = array_rand( $results, 1 ); - $item = $results[ $found_item ]; - - $order_id = (int) $item->order_id; - $order = edd_get_order( $order_id ); - $product_id = (int) $item->product_id; - - if ( edd_has_variable_prices( $product_id ) ) { - $price_id = (int) $item->price_id; - } else { - $price_id = false; - } - - $customer = new EDD_Customer( $order->customer_id ); - - $user_info = array( - 'email' => $order->email, - 'id' => $order->user_id, - 'name' => $order->name, - ); - - if ( empty( $download_ids_with_files[ $product_id ] ) ) { - continue; - } - - $file_id_key = array_rand( $download_ids_with_files[ $product_id ], 1 ); - $file_key = $download_ids_with_files[ $product_id ][ $file_id_key ]; - edd_record_download_in_log( - absint( $product_id ), - absint( $file_key ), - array(), - edd_get_ip(), - absint( $order_id ), - absint( $price_id ), - 'EDD; WPCLI; download_logs;' - ); - - $progress->tick(); - $i ++; - } - $progress->finish(); - } - - protected function get_fname() { - $names = array( - 'Ilse', - 'Emelda', - 'Aurelio', - 'Chiquita', - 'Cheryl', - 'Norbert', - 'Neville', - 'Wendie', - 'Clint', - 'Synthia', - 'Tobi', - 'Nakita', - 'Marisa', - 'Maybelle', - 'Onie', - 'Donnette', - 'Henry', - 'Sheryll', - 'Leighann', - 'Wilson', - ); - - return $names[ rand( 0, ( count( $names ) - 1 ) ) ]; - } - - protected function get_lname() { - $names = array( - 'Warner', - 'Roush', - 'Lenahan', - 'Theiss', - 'Sack', - 'Troutt', - 'Vanderburg', - 'Lisi', - 'Lemons', - 'Christon', - 'Kogut', - 'Broad', - 'Wernick', - 'Horstmann', - 'Schoenfeld', - 'Dolloff', - 'Murph', - 'Shipp', - 'Hursey', - 'Jacobi', - ); - - return $names[ rand( 0, ( count( $names ) - 1 ) ) ]; - } - - protected function get_domain() { - $domains = array( - 'example', - 'edd', - 'rcp', - 'affwp', - ); - - return $domains[ rand( 0, ( count( $domains ) - 1 ) ) ]; - } - - protected function get_tld() { - $tlds = array( - 'local', - 'test', - 'example', - 'localhost', - 'invalid', - ); - - return $tlds[ rand( 0, ( count( $tlds ) - 1 ) ) ]; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-cron.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-cron.php deleted file mode 100644 index e6957bc0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-cron.php +++ /dev/null @@ -1,90 +0,0 @@ - 604800, - 'display' => __( 'Once Weekly', 'easy-digital-downloads' ) - ); - - return $schedules; - } - - /** - * Schedules our events - * - * @since 1.6 - * @return void - */ - public function schedule_events() { - $this->weekly_events(); - $this->daily_events(); - } - - /** - * Schedule weekly events - * - * @access private - * @since 1.6 - * @return void - */ - private function weekly_events() { - if ( ! wp_next_scheduled( 'edd_weekly_scheduled_events' ) ) { - wp_schedule_event( current_time( 'timestamp', true ), 'weekly', 'edd_weekly_scheduled_events' ); - } - } - - /** - * Schedule daily events - * - * @access private - * @since 1.6 - * @return void - */ - private function daily_events() { - if ( ! wp_next_scheduled( 'edd_daily_scheduled_events' ) ) { - wp_schedule_event( current_time( 'timestamp', true ), 'daily', 'edd_daily_scheduled_events' ); - } - } - -} -$edd_cron = new EDD_Cron; diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-customer-query.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-customer-query.php deleted file mode 100644 index f2516d26..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-customer-query.php +++ /dev/null @@ -1,103 +0,0 @@ -setup_customer( $customer ); - } - - /** - * Given the customer data, let's set the variables - * - * @since 2.3 - * - * @param object $customer Customer object. - * @return bool True if the object was setup correctly, false otherwise. - */ - private function setup_customer( $customer ) { - if ( ! is_object( $customer ) ) { - return false; - } - - foreach ( $customer as $key => $value ) { - switch ( $key ) { - case 'purchase_value': - $this->$key = floatval( $value ); - break; - case 'purchase_count': - $this->$key = absint( $value ); - break; - default: - $this->$key = $value; - break; - } - } - - // Customer ID and email are the only things that are necessary, make sure they exist - if ( ! empty( $this->id ) && ! empty( $this->email ) ) { - return true; - } - - return false; - } - - /** - * Magic __get method to dispatch a call to retrieve a protected property. - * - * @since 3.0 - * - * @param string $key - * @return mixed - */ - public function __get( $key = '' ) { - switch ( $key ) { - case 'emails': - return $this->get_emails(); - case 'payment_ids': - $payment_ids = $this->get_payment_ids(); - $payment_ids = implode( ',', $payment_ids ); - return $payment_ids; - default: - return isset( $this->{$key} ) - ? $this->{$key} - : edd_get_customer_meta( $this->id, $key ); - } - } - - /** - * Magic __set method to dispatch a call to update a protected property. - * - * @since 3.0 - * - * @param string $key Property name. - * @param mixed $value Property value. - * - * @return mixed Return value of setter being dispatched to. - */ - public function __set( $key, $value ) { - $key = sanitize_key( $key ); - - // Only real properties can be saved. - $keys = array_keys( get_class_vars( get_called_class() ) ); - - if ( ! in_array( $key, $keys, true ) ) { - return false; - } - - // Dispatch to setter method if value needs to be sanitized. - if ( method_exists( $this, 'set_' . $key ) ) { - return call_user_func( array( $this, 'set_' . $key ), $key, $value ); - } else { - $this->{$key} = $value; - } - } - - /** - * Creates a customer based on class vars. - * - * @since 2.3 - * - * @param array $data Array of attributes for a customer - * @return mixed False if not a valid creation, Customer ID if user is found or valid creation - */ - public function create( $data = array() ) { - if ( 0 !== $this->id || empty( $data ) ) { - return false; - } - - $defaults = array( - 'payment_ids' => '', - ); - - $args = wp_parse_args( $data, $defaults ); - $args = $this->sanitize_columns( $args ); - - if ( empty( $args['email'] ) || ! is_email( $args['email'] ) ) { - return false; - } - - /** - * Fires before a customer is created - * - * @param array $args Contains customer information such as payment ID, name, and email. - */ - do_action( 'edd_customer_pre_create', $args ); - - $created = false; - - // Add the customer - $customer_id = edd_add_customer( $args ); - - if ( ! empty( $customer_id ) ) { - - // Add the primary email address for this customer - edd_add_customer_email_address( array( - 'customer_id' => $customer_id, - 'email' => $args['email'], - 'type' => 'primary' - ) ); - - // Maybe add payments - if ( ! empty( $args['payment_ids'] ) && is_array( $args['payment_ids'] ) ) { - $payment_ids = array_unique( array_values( $args['payment_ids'] ) ); - - foreach ( $payment_ids as $payment_id ) { - edd_update_order( $payment_id, array( - 'customer_id' => $customer_id - ) ); - } - } - - // We've successfully added/updated the customer, reset the class vars with the new data - $customer = edd_get_customer( $customer_id ); - - // Setup the customer data with the values from DB - $this->setup_customer( $customer ); - - $created = $this->id; - } - - /** - * Fires after a customer is created - * - * @param int $created If created successfully, the customer ID. Defaults to false. - * @param array $args Contains customer information such as payment ID, name, and email. - */ - do_action( 'edd_customer_post_create', $created, $args ); - - return $created; - } - - /** - * Update a customer record. - * - * @since 2.3 - * - * @param array $data Array of data attributes for a customer (checked via whitelist) - * @return bool True if update was successful, false otherwise. - */ - public function update( $data = array() ) { - if ( empty( $data ) ) { - return false; - } - - $data = $this->sanitize_columns( $data ); - - do_action( 'edd_customer_pre_update', $this->id, $data ); - - $updated = false; - - if ( edd_update_customer( $this->id, $data ) ) { - $customer = edd_get_customer( $this->id ); - $this->setup_customer( $customer ); - - $updated = true; - } - - do_action( 'edd_customer_post_update', $updated, $this->id, $data ); - - return $updated; - } - - /** - * Attach an email address to the customer. - * - * @since 2.6 - * @since 3.0.1 This method will return customer email ID or false, instead of bool - * - * @param string $email The email address to remove from the customer. - * @param bool $primary Allows setting the email added as the primary. - * - * @return int|false ID of newly created customer email address, false on error. - */ - public function add_email( $email = '', $primary = false ) { - if ( ! is_email( $email ) ) { - return false; - } - - // Bail if email exists in the universe. - if ( $this->email_exists( $email ) ) { - return false; - } - - do_action( 'edd_customer_pre_add_email', $email, $this->id, $this ); - - // Primary or secondary - $type = ( true === $primary ) - ? 'primary' - : 'secondary'; - - // Update is used to ensure duplicate emails are not added. - $ret = edd_add_customer_email_address( - array( - 'customer_id' => $this->id, - 'email' => $email, - 'type' => $type, - ) - ); - - do_action( 'edd_customer_post_add_email', $email, $this->id, $this ); - - if ( $ret && true === $primary ) { - $this->set_primary_email( $email ); - } - - return $ret; - } - - /** - * Remove an email address from the customer. - * - * @since 2.6 - * @since 3.0 Updated to use custom table. - * - * @param string $email The email address to remove from the customer. - * @return bool True if the email was removed successfully, false otherwise. - */ - public function remove_email( $email = '' ) { - if ( ! is_email( $email ) ) { - return false; - } - - do_action( 'edd_customer_pre_remove_email', $email, $this->id, $this ); - - $email_address = edd_get_customer_email_address_by( 'email', $email ); - - $ret = $email_address - ? (bool) edd_delete_customer_email_address( $email_address->id ) - : false; - - do_action( 'edd_customer_post_remove_email', $email, $this->id, $this ); - - return $ret; - } - - /** - * Check if an email address already exists somewhere in the known universe - * of WordPress Users, or EDD customer email addresses. - * - * We intentionally skip the edd_customers table, to avoid race conditions - * when adding new customers and their email addresses at the same time. - * - * @since 3.0 - * - * @param string $email Email address to check. - * @return boolean True if assigned to existing customer, false otherwise. - */ - public function email_exists( $email = '' ) { - - // Bail if not an email address - if ( ! is_email( $email ) ) { - return false; - } - - // Return true if found in users table - if ( email_exists( $email ) ) { - return true; - } - - // Query email addresses table for this address - $exists = edd_get_customer_email_address_by( 'email' , $email ); - - // Return true if found in email addresses table - if ( ! empty( $exists ) ) { - return true; - } - - // Not found - return false; - } - - /** - * Set an email address as the customer's primary email. - * - * This will move the customer's previous primary email to an additional email. - * - * @since 2.6 - * @param string $new_primary_email The email address to remove from the customer. - * @return bool True if the email was set as primary successfully, false otherwise. - */ - public function set_primary_email( $new_primary_email = '' ) { - - // Default return value - $retval = false; - - // Bail if not an email - if ( ! is_email( $new_primary_email ) ) { - return $retval; - } - - do_action( 'edd_customer_pre_set_primary_email', $new_primary_email, $this->id, $this ); - - // Bail if already primary - if ( $new_primary_email === $this->email ) { - return true; - } - - // Get customer emails - $emails = edd_get_customer_email_addresses( array( - 'customer_id' => $this->id - ) ); - - // Pluck addresses, to help with in_array() calls - $plucked = wp_list_pluck( $emails, 'email' ); - - // Maybe fix a missing primary email address in the new table - if ( ! in_array( $this->email, $plucked, true ) ) { - - // Attempt to add the current primary if it's missing - $added = edd_add_customer_email_address( array( - 'customer_id' => $this->id, - 'email' => $this->email, - 'type' => 'primary' - ) ); - - // Maybe re-get all customer emails and re-pluck them - if ( ! empty( $added ) ) { - - // Get customer emails - $emails = edd_get_customer_email_addresses( array( - 'customer_id' => $this->id - ) ); - - // Pluck addresses, and look for the new one - $plucked = wp_list_pluck( $emails, 'email' ); - } - } - - // Bail if not an address for this customer - if ( ! in_array( $new_primary_email, $plucked, true ) ) { - return $retval; - } - - // Loop through addresses and juggle them - foreach ( $emails as $email ) { - - // Make old primary a secondary - if ( ( 'primary' === $email->type ) && ( $new_primary_email !== $email->email ) ) { - edd_update_customer_email_address( $email->id, array( - 'type' => 'secondary' - ) ); - } - - // Make new address primary - if ( ( 'secondary' === $email->type ) && ( $new_primary_email === $email->email ) ) { - edd_update_customer_email_address( $email->id, array( - 'type' => 'primary' - ) ); - } - } - - // Mismatch, so update the customer column - if ( $this->email !== $new_primary_email ) { - - // Update the email column on the customer row - $this->update( array( 'email' => $new_primary_email ) ); - - // Reload the customer emails for this object - $this->email = $new_primary_email; - $this->emails = $this->get_emails(); - $retval = true; - } - - do_action( 'edd_customer_post_set_primary_email', $new_primary_email, $this->id, $this ); - - return (bool) $retval; - } - - /** - * Before 3.0, when the primary email address was changed, it would cascade - * through all previous purchases and update the email address associated - * with it. Since 3.0, that is no longer the case. - * - * This method contains code that is no longer used, and is provided here as - * a convenience function if needed. - * - * @since 3.0 - */ - public function update_order_email_addresses( $email = '' ) { - - // Get the payments - $payment_ids = $this->get_payment_ids(); - - // Bail if no payments - if ( empty( $payment_ids ) ) { - return; - } - - // Update payment emails to primary email - foreach ( $payment_ids as $payment_id ) { - edd_update_payment_meta( $payment_id, 'email', $email ); - } - } - - /** - * Get the payment ids of the customer in an array. - * - * @since 2.6 - * - * @return array An array of payment IDs for the customer, or an empty array if none exist. - */ - public function get_payment_ids() { - - // Bail if no customer - if ( empty( $this->id ) ) { - return array(); - } - - // Get total orders - $count = edd_count_orders( array( - 'customer_id' => $this->id - ) ); - - // Get order IDs - $ids = edd_get_orders( array( - 'customer_id' => $this->id, - 'number' => $count, - 'fields' => 'ids', - 'no_found_rows' => true - ) ); - - // Cast IDs to ints - return array_map( 'absint', $ids ); - } - - /** - * Get an array of EDD_Payment objects from the payment_ids attached to the customer. - * - * @since 2.6 - * - * @param array|string $status A single status as a string or an array of statuses. - * @return array An array of EDD_Payment objects or an empty array. - */ - public function get_payments( $status = array() ) { - - // Get payment IDs - $payment_ids = $this->get_payment_ids(); - $payments = array(); - - // Bail if no IDs - if ( empty( $payment_ids ) ) { - return $payments; - } - - // Get payments one at a time (ugh...) - foreach ( $payment_ids as $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - - if ( empty( $status ) || ( is_array( $status ) && in_array( $payment->status, $status, true ) ) || $status === $payment->status ) { - $payments[] = $payment; - } - } - - return $payments; - } - - /** - * Attach payment to the customer then triggers increasing statistics. - * - * @since 2.3 - * - * @param int $order_id The Order ID to attach to the customer. - * @param bool $update_stats For backwards compatibility, if we should increase the stats or not. - * - * @return bool True if the attachment was successfully, false otherwise. - */ - public function attach_payment( $order_id = 0, $update_stats = true ) { - - // Bail if no payment ID. - if ( empty( $order_id ) ) { - return false; - } - - // Get order. - $order = edd_get_order( $order_id ); - - // Bail if payment does not exist. - if ( empty( $order ) ) { - return false; - } - - do_action( 'edd_customer_pre_attach_payment', $order->id, $this->id, $this ); - - $success = (int) $order->customer_id === (int) $this->id; - - // Update the order if it isn't already attached. - if ( ! $success ) { - // Update the order. - $success = (bool) edd_update_order( - $order_id, - array( - 'customer_id' => $this->id, - 'email' => $this->email, - ) - ); - } - - // Maybe update stats. - if ( ! empty( $success ) && ! empty( $update_stats ) ) { - $this->recalculate_stats(); - } - - do_action( 'edd_customer_post_attach_payment', $success, $order->id, $this->id, $this ); - - return $success; - } - - /** - * Remove a payment from this customer, then triggers reducing stats - * - * @since 2.3 - * - * @param integer $payment_id The Payment ID to remove. - * @param bool $update_stats For backwards compatibility, if we should increase the stats or not. - * - * @return bool $detached True if removed successfully, false otherwise. - */ - public function remove_payment( $payment_id = 0, $update_stats = true ) { - - // Bail if no payment ID - if ( empty( $payment_id ) ) { - return false; - } - - // Get payment - $payment = edd_get_payment( $payment_id ); - - // Bail if payment does not exist - if ( empty( $payment ) ) { - return false; - } - - // Get all previous payment IDs - $payments = $this->get_payment_ids(); - - // Bail if already attached - if ( ! in_array( $payment_id, $payments, true ) ) { - return true; - } - - // Only update stats when published or revoked - if ( ! in_array( $payment->status, array( 'complete', 'revoked' ), true ) ) { - $update_stats = false; - } - - do_action( 'edd_customer_pre_remove_payment', $payment->ID, $this->id, $this ); - - // Update the order - $success = (bool) edd_update_order( $payment_id, array( - 'customer_id' => 0, - 'email' => '' - ) ); - - // Maybe update stats - if ( ! empty( $success ) && ! empty( $update_stats ) ) { - $this->recalculate_stats(); - } - - do_action( 'edd_customer_post_remove_payment', $success, $payment->ID, $this->id, $this ); - - return $success; - } - - /** - * Recalculate stats for this customer. - * - * This replaces the older, less accurate increase/decrease methods. - * - * @since 3.0 - */ - public function recalculate_stats() { - $this->purchase_count = edd_count_orders( - array( - 'customer_id' => $this->id, - 'status' => edd_get_net_order_statuses(), - 'type' => 'sale', - ) - ); - - global $wpdb; - $statuses = edd_get_gross_order_statuses(); - $status_string = implode(', ', array_fill( 0, count( $statuses ), '%s' ) ); - - $this->purchase_value = (float) $wpdb->get_var( $wpdb->prepare( - "SELECT SUM(total / rate) - FROM {$wpdb->edd_orders} - WHERE customer_id = %d - AND status IN({$status_string})", - $this->id, - ...$statuses - ) ); - - // Update the customer purchase count & value - return $this->update( - array( - 'purchase_count' => $this->purchase_count, - 'purchase_value' => $this->purchase_value, - ) - ); - } - - /** Notes *****************************************************************/ - - /** - * Get the parsed notes for a customer as an array. - * - * @since 2.3 - * @since 3.0 Use the new Notes component & API. - * - * @param integer $length The number of notes to get. - * @param integer $paged What note to start at. - * - * @return array The notes requested. - */ - public function get_notes( $length = 20, $paged = 1 ) { - - // Number - $length = is_numeric( $length ) - ? absint( $length ) - : 20; - - // Offset - $offset = is_numeric( $paged ) && ( 1 !== $paged ) - ? ( ( absint( $paged ) - 1 ) * $length ) - : 0; - - // Return the paginated notes for back-compat - return edd_get_notes( array( - 'object_id' => $this->id, - 'object_type' => 'customer', - 'number' => $length, - 'offset' => $offset, - 'order' => 'desc', - ) ); - } - - /** - * Get the total number of notes we have after parsing. - * - * @since 2.3 - * @since 3.0 Use the new Notes component & API. - * - * @return int The number of notes for the customer. - */ - public function get_notes_count() { - return edd_count_notes( array( - 'object_id' => $this->id, - 'object_type' => 'customer', - ) ); - } - - /** - * Add a customer note. - * - * @since 2.3 - * @since 3.0 Use the new Notes component & API - * - * @param string $note The note to add - * @return string|boolean The new note if added successfully, false otherwise - */ - public function add_note( $note = '' ) { - - // Bail if note content is empty - $note = trim( $note ); - if ( empty( $note ) ) { - return false; - } - - /** - * Filter the note of a customer before it's added - * - * @since 2.3 - * @since 3.0 No longer includes the datetime stamp - * - * @param string $note The content of the note to add - * @return string - */ - $note = apply_filters( 'edd_customer_add_note_string', $note ); - - /** - * Allow actions before a note is added - * - * @since 2.3 - */ - do_action( 'edd_customer_pre_add_note', $note, $this->id, $this ); - - // Sanitize note - $note = trim( wp_kses( stripslashes( $note ), edd_get_allowed_tags() ) ); - - // Try to add the note - edd_add_note( array( - 'user_id' => 0, // Authored by System/Bot - 'object_id' => $this->id, - 'object_type' => 'customer', - 'content' => $note, - ) ); - - /** - * Allow actions after a note is added - * - * @since 3.0 Changed to an empty string since notes were moved out - */ - do_action( 'edd_customer_post_add_note', '', $note, $this->id, $this ); - - // Return the formatted note, so we can test, as well as update any displays - return $note; - } - - /** Meta ******************************************************************/ - - /** - * Retrieve customer meta field for a customer. - * - * @since 2.6 - * - * @param string $key Optional. The meta key to retrieve. By default, returns data for all keys. Default empty. - * @param bool $single Optional, default is false. If true, return only the first value of the specified meta_key. - * This parameter has no effect if meta_key is not specified. - * - * @return mixed Will be an array if $single is false. Will be value of meta data field if $single is true. - */ - public function get_meta( $key = '', $single = true ) { - return edd_get_customer_meta( $this->id, $key, $single ); - } - - /** - * Add meta data field to a customer. - * - * @since 2.6 - * - * @param string $meta_key Meta data name. - * @param mixed $meta_value Meta data value. Must be serializable if non-scalar. - * @param bool $unique Optional. Whether the same key should not be added. Default false. - * - * @return int|false Meta ID on success, false on failure. - */ - public function add_meta( $meta_key = '', $meta_value = '', $unique = false ) { - return edd_add_customer_meta( $this->id, $meta_key, $meta_value, $unique ); - } - - /** - * Update customer meta field based on customer ID. - * - * Use the $prev_value parameter to differentiate between meta fields with the - * same key and order ID. - * - * If the meta field for the order does not exist, it will be added. - * - * @since 2.6 - * - * @param string $meta_key Meta data key. - * @param mixed $meta_value Meta data value. Must be serializable if non-scalar. - * @param mixed $prev_value Optional. Previous value to check before removing. Default empty. - * - * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure. - */ - public function update_meta( $meta_key = '', $meta_value = '', $prev_value = '' ) { - return edd_update_customer_meta( $this->id, $meta_key, $meta_value, $prev_value ); - } - - /** - * Remove meta data matching criteria from a customer. - * - * You can match based on the key, or key and value. Removing based on key and value, will keep from removing duplicate - * meta data with the same key. It also allows removing all meta data matching key, if needed. - * - * @since 2.6 - * - * @param string $meta_key Meta data name. - * @param mixed $meta_value Optional. Meta data value. Must be serializable if non-scalar. Default empty. - * - * @return bool True on success, false on failure. - */ - public function delete_meta( $meta_key = '', $meta_value = '' ) { - return edd_delete_customer_meta( $this->id, $meta_key, $meta_value ); - } - - /** Private ***************************************************************/ - - /** - * Sanitize the data for update/create. - * - * @since 2.3 - * - * @param array $data The data to sanitize. - * @return array The sanitized data, based off column defaults. - */ - private function sanitize_columns( $data = array() ) { - $default_values = array(); - - foreach ( $data as $key => $type ) { - - // Only sanitize data that we were provided - if ( ! array_key_exists( $key, $data ) ) { - continue; - } - - switch ( $type ) { - case '%s': - if ( 'email' === $key ) { - $data[ $key ] = sanitize_email( $data[ $key ] ); - } else { - $data[ $key ] = sanitize_text_field( $data[ $key ] ); - } - break; - - case '%d': - if ( ! is_numeric( $data[ $key ] ) || absint( $data[ $key ] ) !== (int) $data[ $key ] ) { - $data[ $key ] = $default_values[ $key ]; - } else { - $data[ $key ] = absint( $data[ $key ] ); - } - break; - - case '%f': - // Convert what was given to a float - $value = floatval( $data[ $key ] ); - - if ( ! is_float( $value ) ) { - $data[ $key ] = $default_values[ $key ]; - } else { - $data[ $key ] = $value; - } - break; - - default: - $data[ $key ] = sanitize_text_field( $data[ $key ] ); - break; - } - } - - return $data; - } - - /** Helpers ***************************************************************/ - - /** - * Retrieve all of the IP addresses used by the customer. - * - * @since 3.0 - * - * @return array Array of objects containing IP address. - */ - public function get_ips() { - return edd_get_orders( array( - 'customer_id' => $this->id, - 'fields' => 'ip', - 'groupby' => 'ip', - ) ); - } - - /** - * Retrieve all the email addresses associated with this customer. - * - * @since 3.0 - * - * @return array - */ - public function get_emails() { - - // Add primary email. - $retval = array( $this->email ); - - // Fetch email addresses from the database. - $emails = edd_get_customer_email_addresses( array( - 'customer_id' => $this->id - ) ); - - // Pluck addresses and merg them - if ( ! empty( $emails ) ) { - - // We only want the email addresses - $emails = wp_list_pluck( $emails, 'email' ); - - // Merge with primary email - $retval = array_merge( $retval, $emails ); - } - - // Return unique results (to avoid duplicates) - return array_unique( $retval ); - } - - /** - * Retrieve an address. - * - * @since 3.0 - * - * @param boolean $is_primary Whether the address is the primary address. Default true. - * - * @return array|\EDD\Customers\Customer_Address|null Object if primary address requested, array otherwise. Null if no result for primary address. - */ - public function get_address( $is_primary = true ) { - $args = array( - 'customer_id' => $this->id, - 'is_primary' => $is_primary, - ); - if ( $is_primary ) { - $args['number'] = 1; - $args['orderby'] = 'date_created'; - $args['order'] = 'desc'; - } - $address = edd_get_customer_addresses( $args ); - if ( ! $is_primary ) { - return $address; - } - if ( is_array( $address ) && ! empty( $address[0] ) ) { - return $address[0]; - } - - return null; - } - - /** - * Retrieve all addresses. - * - * @since 3.0 - * - * @param string $type Address type. Default empty. - * - * @return \EDD\Customers\Customer_Address[] Array of addresses. - */ - public function get_addresses( $type = '' ) { - $addresses = edd_get_customer_addresses( array( - 'customer_id' => $this->id, - ) ); - - if ( ! empty( $type ) ) { - $addresses = wp_filter_object_list( $addresses, array( 'type' => $type ) ); - } - - return $addresses; - } - - /** Deprecated ************************************************************/ - - /** - * Increase the purchase count of a customer. - * - * @since 2.3 - * @deprecated 3.0 Use recalculate_stats() - * - * @param int $count The number to increment purchase count by. Default 1. - * @return int New purchase count. - */ - public function increase_purchase_count( $count = 1 ) { - - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Customer::recalculate_stats()' ); - - // Make sure it's numeric and not negative - if ( ! is_numeric( $count ) || absint( $count ) !== $count ) { - return false; - } - - $new_total = (int) $this->purchase_count + (int) $count; - - do_action( 'edd_customer_pre_increase_purchase_count', $count, $this->id, $this ); - - if ( $this->update( array( 'purchase_count' => $new_total ) ) ) { - $this->purchase_count = $new_total; - } - - do_action( 'edd_customer_post_increase_purchase_count', $this->purchase_count, $count, $this->id, $this ); - - return $this->purchase_count; - } - - /** - * Decrease the customer's purchase count. - * - * @since 2.3 - * @deprecated 3.0 Use recalculate_stats() - * - * @param int $count The number to decrement purchase count by. Default 1. - * @return mixed New purchase count if successful, false otherwise. - */ - public function decrease_purchase_count( $count = 1 ) { - - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Customer::recalculate_stats()' ); - - // Make sure it's numeric and not negative - if ( ! is_numeric( $count ) || absint( $count ) !== $count ) { - return false; - } - - $new_total = (int) $this->purchase_count - (int) $count; - - if ( $new_total < 0 ) { - $new_total = 0; - } - - do_action( 'edd_customer_pre_decrease_purchase_count', $count, $this->id, $this ); - - if ( $this->update( array( 'purchase_count' => $new_total ) ) ) { - $this->purchase_count = $new_total; - } - - do_action( 'edd_customer_post_decrease_purchase_count', $this->purchase_count, $count, $this->id, $this ); - - return $this->purchase_count; - } - - /** - * Increase the customer's lifetime value. - * - * @since 2.3 - * @deprecated 3.0 Use recalculate_stats() - * - * @param float $value The value to increase by. - * @return mixed New lifetime value if successful, false otherwise. - */ - public function increase_value( $value = 0.00 ) { - - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Customer::recalculate_stats()' ); - - $value = floatval( apply_filters( 'edd_customer_increase_value', $value, $this ) ); - $new_value = floatval( $this->purchase_value ) + $value; - - do_action( 'edd_customer_pre_increase_value', $value, $this->id, $this ); - - if ( $this->update( array( 'purchase_value' => $new_value ) ) ) { - $this->purchase_value = $new_value; - } - - do_action( 'edd_customer_post_increase_value', $this->purchase_value, $value, $this->id, $this ); - - return $this->purchase_value; - } - - /** - * Decrease a customer's lifetime value. - * - * @since 2.3 - * @deprecated 3.0 Use recalculate_stats() - * - * @param float $value The value to decrease by. - * @return mixed New lifetime value if successful, false otherwise. - */ - public function decrease_value( $value = 0.00 ) { - - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Customer::recalculate_stats()' ); - - $value = floatval( apply_filters( 'edd_customer_decrease_value', $value, $this ) ); - $new_value = floatval( $this->purchase_value ) - $value; - - if ( $new_value < 0 ) { - $new_value = 0.00; - } - - do_action( 'edd_customer_pre_decrease_value', $value, $this->id, $this ); - - if ( $this->update( array( 'purchase_value' => $new_value ) ) ) { - $this->purchase_value = $new_value; - } - - do_action( 'edd_customer_post_decrease_value', $this->purchase_value, $value, $this->id, $this ); - - return $this->purchase_value; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-db-customer-meta.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-db-customer-meta.php deleted file mode 100644 index 8855ff00..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-db-customer-meta.php +++ /dev/null @@ -1,21 +0,0 @@ -get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) ); - } - - /** - * Retrieve a row by a specific column / value - * - * @since 2.1 - * @return object - */ - public function get_by( $column, $row_id ) { - global $wpdb; - $column = esc_sql( $column ); - return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $column = %s LIMIT 1;", $row_id ) ); - } - - /** - * Retrieve a specific column's value by the primary key - * - * @since 2.1 - * @return string - */ - public function get_column( $column, $row_id ) { - global $wpdb; - $column = esc_sql( $column ); - return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) ); - } - - /** - * Retrieve a specific column's value by the the specified column / value - * - * @since 2.1 - * @return string - */ - public function get_column_by( $column, $column_where, $column_value ) { - global $wpdb; - $column_where = esc_sql( $column_where ); - $column = esc_sql( $column ); - return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $column_where = %s LIMIT 1;", $column_value ) ); - } - - /** - * Insert a new row - * - * @since 2.1 - * @return int - */ - public function insert( $data, $type = '' ) { - global $wpdb; - - // Set default values - $data = wp_parse_args( $data, $this->get_column_defaults() ); - - do_action( 'edd_pre_insert_' . $type, $data ); - - // Initialise column format array - $column_formats = $this->get_columns(); - - // Force fields to lower case - $data = array_change_key_case( $data ); - - // White list columns - $data = array_intersect_key( $data, $column_formats ); - - // Reorder $column_formats to match the order of columns given in $data - $data_keys = array_keys( $data ); - $column_formats = array_merge( array_flip( $data_keys ), $column_formats ); - - $wpdb->insert( $this->table_name, $data, $column_formats ); - $wpdb_insert_id = $wpdb->insert_id; - - do_action( 'edd_post_insert_' . $type, $wpdb_insert_id, $data ); - - return $wpdb_insert_id; - } - - /** - * Update a row - * - * @since 2.1 - * @return bool - */ - public function update( $row_id, $data = array(), $where = '' ) { - - global $wpdb; - - // Row ID must be positive integer - $row_id = absint( $row_id ); - - if( empty( $row_id ) ) { - return false; - } - - if( empty( $where ) ) { - $where = $this->primary_key; - } - - // Initialise column format array - $column_formats = $this->get_columns(); - - // Force fields to lower case - $data = array_change_key_case( $data ); - - // White list columns - $data = array_intersect_key( $data, $column_formats ); - - // Reorder $column_formats to match the order of columns given in $data - $data_keys = array_keys( $data ); - $column_formats = array_merge( array_flip( $data_keys ), $column_formats ); - - if ( false === $wpdb->update( $this->table_name, $data, array( $where => $row_id ), $column_formats ) ) { - return false; - } - - return true; - } - - /** - * Delete a row identified by the primary key - * - * @since 2.1 - * @return bool - */ - public function delete( $row_id = 0 ) { - - global $wpdb; - - // Row ID must be positive integer - $row_id = absint( $row_id ); - - if( empty( $row_id ) ) { - return false; - } - - if ( false === $wpdb->query( $wpdb->prepare( "DELETE FROM $this->table_name WHERE $this->primary_key = %d", $row_id ) ) ) { - return false; - } - - return true; - } - - /** - * Check if the given table exists - * - * @since 2.4 - * @param string $table The table name - * @return bool If the table name exists - */ - public function table_exists( $table ) { - global $wpdb; - $table = sanitize_text_field( $table ); - - return $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE '%s'", $table ) ) === $table; - } - - /** - * Check if the table was ever installed - * - * @since 2.4 - * @return bool Returns if the customers table was installed and upgrade routine run - */ - public function installed() { - return $this->table_exists( $this->table_name ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-discount.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-discount.php deleted file mode 100644 index d2b17684..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-discount.php +++ /dev/null @@ -1,1910 +0,0 @@ -find_by_code( $_id_or_code_or_name ); - - // Name - } elseif ( $by_name ) { - $discount = $this->find_by_name( $_id_or_code_or_name ); - - // Default to ID - } else { - $discount = edd_get_discount( absint( $_id_or_code_or_name ) ); - } - - // Setup or bail - if ( ! empty( $discount ) ) { - $this->setup_discount( $discount ); - } else { - return false; - } - } - - /** - * Magic __get method to dispatch a call to retrieve a protected property. - * - * @since 2.7 - * - * @param mixed $key - * @return mixed - */ - public function __get( $key = '' ) { - $key = sanitize_key( $key ); - - // Back compat for ID - if ( 'discount_id' === $key || 'ID' === $key ) { - return (int) $this->id; - - // Method - } elseif ( method_exists( $this, "get_{$key}" ) ) { - return call_user_func( array( $this, "get_{$key}" ) ); - - // Property - } elseif ( property_exists( $this, $key ) ) { - return $this->{$key}; - - // Other... - } else { - - // Account for old property keys from pre 3.0 - switch ( $key ) { - case 'post_author': - break; - - case 'post_date': - case 'post_date_gmt': - return $this->date_created; - - case 'post_modified': - case 'post_modified_gmt': - return $this->date_modified; - - case 'post_content': - case 'post_title': - return $this->name; - - case 'post_excerpt': - case 'post_status': - return $this->status; - - case 'comment_status': - case 'ping_status': - case 'post_password': - case 'post_name': - case 'to_ping': - case 'pinged': - case 'post_modified': - case 'post_modified_gmt': - case 'post_content_filtered': - case 'post_parent': - case 'guid': - case 'menu_order': - case 'post_mime_type': - case 'comment_count': - case 'filter': - return ''; - - case 'post_type': - return 'edd_discount'; - - case 'expiration': - return $this->get_expiration(); - - case 'start': - return $this->start_date; - - case 'min_price': - return $this->min_charge_amount; - - case 'use_once': - case 'is_single_use': - case 'once_per_customer': - return $this->get_is_single_use(); - - case 'uses': - return $this->use_count; - - case 'not_global': - case 'is_not_global': - return 'global' === $this->scope ? false : true; - } - - return new WP_Error( 'edd-discount-invalid-property', sprintf( __( 'Can\'t get property %s', 'easy-digital-downloads' ), $key ) ); - } - } - - /** - * Magic __set method to dispatch a call to update a protected property. - * - * @since 2.7 - * - * @see set() - * - * @param string $key Property name. - * @param mixed $value Property value. - * - * @return mixed Value of setter being dispatched to. - */ - public function __set( $key, $value ) { - $key = sanitize_key( $key ); - - // Only real properties can be saved. - $keys = array_keys( get_class_vars( get_called_class() ) ); - $old_keys = array( - 'is_single_use', - 'uses', - 'expiration', - 'start', - 'min_price', - 'use_once', - 'is_not_global', - ); - - if ( ! in_array( $key, $keys, true ) && ! in_array( $key, $old_keys, true ) ) { - return false; - } - - // Dispatch to setter method if value needs to be sanitized - if ( method_exists( $this, 'set_' . $key ) ) { - return call_user_func( array( $this, 'set_' . $key ), $key, $value ); - } elseif ( in_array( $key, $old_keys, true ) ) { - switch ( $key ) { - case 'expiration': - $this->end_date = $value; - break; - case 'start': - $this->start_date = $value; - break; - case 'min_price': - $this->min_charge_amount = $value; - break; - case 'use_once': - case 'is_single_use': - $this->once_per_customer = $value; - break; - case 'uses': - $this->use_count = $value; - break; - case 'not_global': - case 'is_not_global': - $this->scope = $value ? 'not_global' : 'global'; - break; - } - } else { - $this->{$key} = $value; - } - } - - /** - * Handle method dispatch dynamically. - * - * @param string $method Method name. - * @param array $args Arguments to be passed to method. - * - * @return mixed - */ - public function __call( $method, $args ) { - $property = strtolower( str_replace( array( 'setup_', 'get_' ), '', $method ) ); - if ( ! method_exists( $this, $method ) && property_exists( $this, $property ) ) { - return $this->{$property}; - } - } - - /** - * Magic __toString method. - * - * @since 3.0 - */ - public function __toString() { - return $this->code; - } - - /** - * Converts the instance of the EDD_Discount object into an array for special cases. - * - * @since 2.7 - * - * @return array EDD_Discount object as an array. - */ - public function array_convert() { - return get_object_vars( $this ); - } - - /** - * Find a discount in the database with the code supplied. - * - * @since 2.7 - * @access private - * - * @param string $code Discount code. - * @return object WP_Post instance of the discount. - */ - private function find_by_code( $code = '' ) { - return edd_get_discount_by( 'code', $code ); - } - - /** - * Find a discount in the database with the name supplied. - * - * @since 2.7 - * @access private - * - * @param string $name Discount name. - * @return object WP_Post instance of the discount. - */ - private function find_by_name( $name = '' ) { - return edd_get_discount_by( 'name', $name ); - } - - /** - * Setup object vars with discount WP_Post object. - * - * @since 2.7 - * @access private - * - * @param object $discount WP_Post instance of the discount. - * @return bool Object initialization successful or not. - */ - private function setup_discount( $discount = null ) { - if ( is_null( $discount ) ) { - return false; - } - - if ( ! is_object( $discount ) ) { - return false; - } - - if ( is_wp_error( $discount ) ) { - return false; - } - - /** - * Fires before the instance of the EDD_Discount object is set up. - * - * @since 2.7 - * - * @param object EDD_Discount EDD_Discount instance of the discount object. - * @param object WP_Post $discount WP_Post instance of the discount object. - */ - do_action( 'edd_pre_setup_discount', $this, $discount ); - - $vars = get_object_vars( $discount ); - - foreach ( $vars as $key => $value ) { - switch ( $key ) { - case 'start_date': - case 'end_date': - if ( '0000-00-00 00:00:00' === $value || is_null( $value ) ) { - $this->{$key} = false; - break; - } - case 'notes': - if ( ! empty( $value ) ) { - $this->{$key} = $value; - } - break; - case 'id': - $this->{$key} = (int) $value; - break; - case 'min_charge_amount': - $this->min_charge_amount = $value; - break; - default: - if ( is_string( $value ) ) { - @json_decode( $value ); - if ( json_last_error() !== JSON_ERROR_NONE ) { - $this->{$key} = json_decode( $value ); - } - } - - $this->{$key} = $value; - break; - } - } - - /** - * Some object vars need to be setup manually as the values need to be - * pulled in from the `edd_adjustmentmeta` table. - */ - $this->excluded_products = (array) edd_get_adjustment_meta( $this->id, 'excluded_product', false ); - $this->product_reqs = (array) edd_get_adjustment_meta( $this->id, 'product_requirement', false ); - $this->product_condition = (string) edd_get_adjustment_meta( $this->id, 'product_condition', true ); - - /** - * Fires after the instance of the EDD_Discount object is set up. Allows extensions to add items to this object via hook. - * - * @since 2.7 - * - * @param object EDD_Discount EDD_Discount instance of the discount object. - * @param object WP_Post $discount WP_Post instance of the discount object. - */ - do_action( 'edd_setup_discount', $this, $discount ); - - if ( ! empty( $this->id ) ) { - return true; - } - - return false; - } - - /** - * Helper method to retrieve meta data associated with the discount. - * - * @since 2.7 - * - * @param string $key Meta key. - * @param bool $single Return single item or array. - * - * @return mixed - */ - public function get_meta( $key = '', $single = true ) { - return edd_get_adjustment_meta( $this->id, $key, $single ); - } - - /** - * Helper method to update meta data associated with the discount. - * - * @since 2.7 - * - * @param string $key Meta key to update. - * @param string $value New meta value to set. - * @param string $prev_value Optional. Previous meta value. - * - * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure. - */ - public function update_meta( $key, $value = '', $prev_value = '' ) { - $filter_key = '_edd_discount_' . $key; - - /** - * Filters the meta value being updated. - * The key is prefixed with `_edd_discount_` for 2.9 backwards compatibility. - * - * @param mixed $value Value being set. - * @param int $id Discount ID. - */ - $value = apply_filters( 'edd_update_discount_meta_' . $filter_key, $value, $this->id ); - - return edd_update_adjustment_meta( $this->id, $key, $value, $prev_value ); - } - - /** - * Retrieve the code used to apply the discount. - * - * @since 2.7 - * - * @return string Discount code. - */ - public function get_code() { - /** - * Filters the discount code. - * - * @since 2.7 - * - * @param string $code Discount code. - * @param int $ID Discount ID. - */ - return apply_filters( 'edd_get_discount_code', $this->code, $this->id ); - } - - /** - * Retrieve the status of the discount - * - * @since 2.7 - * - * @return string Discount code status (active/inactive). - */ - public function get_status() { - /** - * Filters the discount status. - * - * @since 2.7 - * - * @param string $code Discount status (active or inactive). - * @param int $ID Discount ID. - */ - return apply_filters( 'edd_get_discount_status', $this->status, $this->id ); - } - - /** - * Retrieves the status label of the discount. - * - * This method exists as a helper, until legitimate Status classes can be - * registered that will contain an array of status-specific labels. - * - * @since 2.9 - * - * @return string Status label for the current discount. - */ - public function get_status_label() { - - // Default label - $label = ucwords( $this->status ); - - // Specific labels - switch ( $this->status ) { - case '': - $label = __( 'None', 'easy-digital-downloads' ); - break; - case 'draft': - $label = __( 'Draft', 'easy-digital-downloads' ); - break; - case 'expired': - $label = __( 'Expired', 'easy-digital-downloads' ); - break; - case 'inactive': - $label = __( 'Inactive', 'easy-digital-downloads' ); - break; - case 'active': - $label = __( 'Active', 'easy-digital-downloads' ); - break; - case 'inherit': - if ( ! empty( $this->parent ) ) { - $parent = edd_get_discount( $this->parent ); - $label = $parent->get_status_label(); - break; - } - } - - /** - * Filters the discount status. - * - * @since 2.9 - * - * @param string $label Discount status label. - * @param string $status Discount status (active or inactive). - * @param int $id Discount ID. - */ - return apply_filters( 'edd_get_discount_status_label', $label, $this->status, $this->id ); - } - - /** - * Retrieve the type of discount. - * - * @since 2.7 - * - * @return string Discount type (percent or flat amount). - */ - public function get_type() { - /** - * Filters the discount type. - * - * @since 2.7 - * - * @param string $code Discount type (percent or flat amount). - * @param int $ID Discount ID. - */ - return apply_filters( 'edd_get_discount_type', $this->amount_type, $this->id ); - } - - /** - * Retrieve the discount amount. - * - * @since 2.7 - * - * @return mixed float Discount amount. - */ - public function get_amount() { - /** - * Filters the discount amount. - * - * @since 2.7 - * - * @param float $amount Discount amount. - * @param int $ID Discount ID. - */ - return (float) apply_filters( 'edd_get_discount_amount', $this->amount, $this->id ); - } - - /** - * Retrieve the discount requirements for the discount to be satisfied. - * - * @since 2.7 - * - * @return array IDs of required downloads. - */ - public function get_product_reqs() { - - /** - * Filters the download requirements. - * - * @since 2.7 - * - * @param array $product_reqs IDs of required products. - * @param int $ID Discount ID. - */ - return (array) apply_filters( 'edd_get_discount_product_reqs', $this->product_reqs, $this->id ); - } - - /** - * Retrieve the discount scope. - * - * This used to be called "is_not_global". That filter is still here for backwards compatibility. - * - * @since 3.0 - * - * @return string The scope, i.e. "global". - */ - public function get_scope() { - $legacy_value = apply_filters( 'edd_discount_is_not_global', null, $this->id ); - - if ( ! is_null( $legacy_value ) ) { - $this->scope = $legacy_value ? 'global' : 'not_global'; - } - - return apply_filters( 'edd_get_discount_scope', $this->scope, $this->id ); - } - - /** - * Retrieve the product condition. - * - * @since 2.7 - * - * @return string Product condition - */ - public function get_product_condition() { - /** - * Filters the product condition. - * - * @since 2.7 - * - * @param string $product_condition Product condition. - * @param int $ID Discount ID. - */ - return apply_filters( 'edd_discount_product_condition', $this->product_condition, $this->id ); - } - - /** - * Retrieve the downloads that are excluded from having this discount code applied. - * - * @since 2.7 - * - * @return array IDs of excluded downloads. - */ - public function get_excluded_products() { - /** - * Filters the excluded downloads. - * - * @since 2.7 - * - * @param array $excluded_products IDs of excluded products. - * @param int $ID Discount ID. - */ - return (array) apply_filters( 'edd_get_discount_excluded_products', $this->excluded_products, $this->id ); - } - - /** - * Retrieve the start date. - * - * @since 2.7 - * - * @return string Start date. - */ - public function get_start_date() { - /** - * Filters the start date. - * - * @since 2.7 - * - * @param string $start Discount start date. - * @param int $ID Discount ID. - */ - return apply_filters( 'edd_get_discount_start', $this->start_date, $this->id ); - } - - /** - * Retrieve the end date. - * - * @since 2.7 - * - * @return string End date. - */ - public function get_expiration() { - /** - * Filters the end date. - * - * @since 2.7 - * - * @param string $expiration Discount expiration date. - * @param int $ID Discount ID. - */ - return apply_filters( 'edd_get_discount_expiration', $this->end_date, $this->id ); - } - - /** - * Retrieve the uses for the discount code. - * - * @since 2.7 - * - * @return int Uses. - */ - public function get_uses() { - /** - * Filters the maximum uses. - * - * @since 2.7 - * - * @param int $max_uses Maximum uses. - * @param int $ID Discount ID. - */ - return (int) apply_filters( 'edd_get_discount_uses', $this->use_count, $this->id ); - } - - /** - * Retrieve the maximum uses for the discount code. - * - * @since 2.7 - * - * @return int Maximum uses. - */ - public function get_max_uses() { - /** - * Filters the maximum uses. - * - * @since 2.7 - * - * @param int $max_uses Maximum uses. - * @param int $ID Discount ID. - */ - return (int) apply_filters( 'edd_get_discount_max_uses', $this->max_uses, $this->id ); - } - - /** - * Retrieve the minimum spend required for the discount to be satisfied. - * - * @since 2.7 - * - * @return mixed float Minimum spend. - */ - public function get_min_price() { - /** - * Filters the minimum price. - * - * @since 2.7 - * - * @param float $min_price Minimum price. - * @param int $ID Discount ID. - */ - return (float) apply_filters( 'edd_get_discount_min_price', $this->min_charge_amount, $this->id ); - } - - /** - * Retrieve the usage limit per limit (if the discount can only be used once per customer). - * - * @since 2.7 - * - * @return bool Once use per customer? - */ - public function get_is_single_use() { - return $this->get_once_per_customer(); - } - - /** - * Retrieve the usage limit per limit (if the discount can only be used once per customer). - * - * @since 3.0 - * - * @return bool Once use per customer? - */ - public function get_once_per_customer() { - /** - * Filters the single use meta value. - * - * @since 2.7 - * - * @param bool $is_single_use Is the discount only allowed to be used once per customer. - * @param int $ID Discount ID. - */ - return (bool) apply_filters( 'edd_is_discount_single_use', $this->once_per_customer, $this->id ); - } - - /** - * Check if a discount exists. - * - * @since 2.7 - * - * @return bool Discount exists. - */ - public function exists() { - if ( ! $this->id > 0 ) { - return false; - } - - return true; - } - - /** - * Once object variables has been set, an update is needed to persist them to the database. - * - * This is now simply a wrapper to the add() method which handles creating new discounts and updating existing ones. - * - * @since 2.7 - * - * @return bool True if the save was successful, false if it failed or wasn't needed. - */ - public function save() { - $args = get_object_vars( $this ); - $saved = $this->add( $args ); - - return $saved; - } - - /** - * Create a new discount. If the discount already exists in the database, update it. - * - * @since 2.7 - * - * @param array $args Discount details. - * @return mixed bool|int false if data isn't passed and class not instantiated for creation, or post ID for the new discount. - */ - public function add( $args = array() ) { - - // If no code is provided, return early with false - if ( empty( $args['code'] ) ) { - return false; - } - - if ( ! empty( $this->id ) && $this->exists() ) { - return $this->update( $args ); - - } else { - $args = self::convert_legacy_args( $args ); - - if ( ! empty( $args['start_date'] ) ) { - $args['start_date'] = date( 'Y-m-d H:i:s', strtotime( $args['start_date'], current_time( 'timestamp' ) ) ); - } - - if ( ! empty( $args['end_date'] ) ) { - $args['end_date'] = date( 'Y-m-d H:i:s', strtotime( $args['end_date'], current_time( 'timestamp' ) ) ); - - if ( strtotime( $args['end_date'], current_time( 'timestamp' ) ) < current_time( 'timestamp' ) ) { - $args['status'] = 'expired'; - } - } - - if ( ! empty( $args['start_date'] ) && ! empty( $args['end_date'] ) ) { - $start_timestamp = strtotime( $args['start_date'], current_time( 'timestamp' ) ); - $end_timestamp = strtotime( $args['end_date'], current_time( 'timestamp' ) ); - - if ( $start_timestamp > $end_timestamp ) { - // Set the expiration date to the start date if start is later than expiration - $args['end_date'] = $args['start_date']; - } - } - - // Assume discount status is "active" if it has not been set - if ( ! isset( $args['status'] ) ) { - $args['status'] = 'active'; - } - - /** - * Add a new discount to the database. - */ - - /** - * Filters the args before being inserted into the database. - * - * @since 2.7 - * - * @param array $args Discount args. - */ - $args = apply_filters( 'edd_insert_discount', $args ); - - /** - * Filters the args before being inserted into the database (kept for backwards compatibility purposes) - * - * @since 2.7 - * @since 3.0 Updated parameters to pass $args twice for backwards compatibility. - * - * @param array $args Discount args. - */ - $args = apply_filters( 'edd_insert_discount_args', $args, $args ); - - $args = $this->sanitize_columns( $args ); - - /** - * Fires before the discount has been added to the database. - * - * @since 2.7 - * - * @param array $args Discount args. - */ - do_action( 'edd_pre_insert_discount', $args ); - - foreach ( $args as $key => $value ) { - $this->{$key} = $value; - } - - // We have to ensure an ID is not passed to edd_add_discount() - unset( $args['id'] ); - - $id = edd_add_discount( $args ); - - // The DB class 'add' implies an update if the discount being asked to be created already exists - if ( ! empty( $id ) ) { - - // We need to update the ID of the instance of the object in order to add meta - $this->id = $id; - - if ( isset( $args['excluded_products'] ) ) { - if ( is_array( $args['excluded_products'] ) ) { - foreach ( $args['excluded_products'] as $product ) { - edd_add_adjustment_meta( $this->id, 'excluded_product', absint( $product ) ); - } - } - } - - if ( isset( $args['product_reqs'] ) ) { - if ( is_array( $args['product_reqs'] ) ) { - foreach ( $args['product_reqs'] as $product ) { - edd_add_adjustment_meta( $this->id, 'product_requirement', absint( $product ) ); - } - } - } - } - - /** - * Fires after the discount code is inserted. - * - * @since 2.7 - * - * @param array $meta { - * The discount details. - * - * @type string $code The discount code. - * @type string $name The name of the discount. - * @type string $status The discount status. Defaults to active. - * @type int $uses The current number of uses. - * @type int $max_uses The max number of uses. - * @type string $start The start date. - * @type int $min_price The minimum price required to use the discount code. - * @type array $product_reqs The product IDs required to use the discount code. - * @type string $product_condition The conditions in which a product(s) must meet to use the discount code. - * @type array $excluded_products Product IDs excluded from this discount code. - * @type bool $is_not_global If the discount code is not globally applied to all products. Defaults to false. - * @type bool $is_single_use If the code cannot be used more than once per customer. Defaults to false. - * } - * @param int $ID The ID of the discount that was inserted. - */ - do_action( 'edd_post_insert_discount', $args, $this->id ); - - // Discount code created - return $id; - } - } - - /** - * Update an existing discount in the database. - * - * @since 2.7 - * - * @param array $args Discount details. - * @return bool True if update is successful, false otherwise. - */ - public function update( $args = array() ) { - $args = self::convert_legacy_args( $args ); - $ret = false; - - /** - * Filter the data being updated - * - * @since 2.7 - * - * @param array $args Discount args. - * @param int $ID Discount ID. - */ - $args = apply_filters( 'edd_update_discount', $args, $this->id ); - $args = $this->sanitize_columns( $args ); - - // Get current time once to avoid inconsistencies - $current_time = current_time( 'timestamp' ); - - if ( ! empty( $args['start_date'] ) && ! empty( $args['end_date'] ) ) { - $start_timestamp = strtotime( $args['start_date'], $current_time ); - $end_timestamp = strtotime( $args['end_date'], $current_time ); - - // Set the expiration date to the start date if start is later than expiration - if ( $start_timestamp > $end_timestamp ) { - $args['end_date'] = $args['start_date']; - } - } - - // Start date - if ( ! empty( $args['start_date'] ) ) { - $args['start_date'] = date( 'Y-m-d H:i:s', strtotime( $args['start_date'], $current_time ) ); - } - - // End date - if ( ! empty( $args['end_date'] ) ) { - $args['end_date'] = date( 'Y-m-d H:i:s', strtotime( $args['end_date'], $current_time ) ); - } - - if ( isset( $args['excluded_products'] ) ) { - // Reset meta - edd_delete_adjustment_meta( $this->id, 'excluded_product' ); - - if ( is_array( $args['excluded_products'] ) ) { - // Now add each newly excluded product - foreach ( $args['excluded_products'] as $product ) { - edd_add_adjustment_meta( $this->id, 'excluded_product', absint( $product ) ); - } - } - } - - if ( isset( $args['product_reqs'] ) ) { - // Reset meta - edd_delete_adjustment_meta( $this->id, 'product_requirement' ); - - if ( is_array( $args['product_reqs'] ) ) { - // Now add each newly required product - foreach ( $args['product_reqs'] as $product ) { - edd_add_adjustment_meta( $this->id, 'product_requirement', absint( $product ) ); - } - } - } - - // Switch `type` to `amount_type` - if ( ! isset( $args['amount_type'] ) && ! empty( $args['type'] ) && 'discount' !== $args['type'] ) { - $args['amount_type'] = $args['type']; - } - - // Force `type` to `discount` - $args['type'] = 'discount'; - - /** - * Fires before the discount has been updated in the database. - * - * @since 2.7 - * - * @param array $args Discount args. - * @param int $ID Discount ID. - */ - do_action( 'edd_pre_update_discount', $args, $this->id ); - - // If we are using the discounts DB - if ( edd_update_discount( $this->id, $args ) ) { - $discount = edd_get_discount( $this->id ); - $this->setup_discount( $discount ); - $ret = true; - } - - /** - * Fires after the discount has been updated in the database. - * - * @since 2.7 - * - * @param array $args Discount args. - * @param int $ID Discount ID. - */ - do_action( 'edd_post_update_discount', $args, $this->id ); - - return $ret; - } - - /** - * Update the status of the discount. - * - * @since 2.7 - * - * @param string $new_status New status (default: active) - * @return bool If the status been updated or not. - */ - public function update_status( $new_status = 'active' ) { - - /** - * Fires before the status of the discount is updated. - * - * @since 2.7 - * - * @param int $ID Discount ID. - * @param string $new_status New status. - * @param string $post_status Post status. - */ - do_action( 'edd_pre_update_discount_status', $this->id, $new_status, $this->status ); - - $ret = $this->update( array( 'status' => $new_status ) ); - - /** - * Fires after the status of the discount is updated. - * - * @since 2.7 - * - * @param int $ID Discount ID. - * @param string $new_status New status. - * @param string $status Post status. - */ - do_action( 'edd_post_update_discount_status', $this->id, $new_status, $this->status ); - - return (bool) $ret; - } - - /** - * Check if the discount has started. - * - * @since 2.7 - * - * @param bool $set_error Whether an error message be set in session. - * @return bool Is discount started? - */ - public function is_started( $set_error = true ) { - $return = false; - - if ( $this->start_date ) { - $start_date = strtotime( $this->start_date ); - - if ( $start_date < time() ) { - // Discount has pased the start date - $return = true; - } elseif ( $set_error ) { - edd_set_error( 'edd-discount-error', _x( 'This discount is invalid.', 'error shown when attempting to use a discount before its start date', 'easy-digital-downloads' ) ); - } - } else { - // No start date for this discount, so has to be true - $return = true; - } - - /** - * Filters if the discount has started or not. - * - * @since 2.7 - * - * @param bool $return Has the discount started or not. - * @param int $ID Discount ID. - * @param bool $set_error Whether an error message be set in session. - */ - return apply_filters( 'edd_is_discount_started', $return, $this->id, $set_error ); - } - - /** - * Check if the discount has expired. - * - * @since 2.7 - * - * @param bool $update Update the discount to expired if an one is found but has an active status - * @return bool Has the discount expired? - */ - public function is_expired( $update = true ) { - $return = false; - - if ( empty( $this->end_date ) || '0000-00-00 00:00:00' === $this->end_date ) { - return $return; - } - - $end_date = strtotime( $this->end_date ); - - if ( $end_date < time() ) { - if ( $update ) { - $this->update_status( 'expired' ); - } - $return = true; - } - - /** - * Filters if the discount has expired or not. - * - * @since 2.7 - * - * @param bool $return Has the discount expired or not. - * @param int $ID Discount ID. - */ - return apply_filters( 'edd_is_discount_expired', $return, $this->id ); - } - - /** - * Check if the discount has maxed out. - * - * @since 2.7 - * - * @param bool $set_error Whether an error message be set in session. - * @return bool Is discount maxed out? - */ - public function is_maxed_out( $set_error = true ) { - $return = false; - - if ( $this->uses >= $this->max_uses && ! empty( $this->max_uses ) ) { - if ( $set_error ) { - edd_set_error( 'edd-discount-error', __( 'This discount has reached its maximum usage.', 'easy-digital-downloads' ) ); - } - - $return = true; - } - - /** - * Filters if the discount is maxed out or not. - * - * @since 2.7 - * - * @param bool $return Is the discount maxed out or not. - * @param int $ID Discount ID. - * @param bool $set_error Whether an error message be set in session. - */ - return apply_filters( 'edd_is_discount_maxed_out', $return, $this->id, $set_error ); - } - - /** - * Check if the minimum cart amount is satisfied for the discount to hold. - * - * @since 2.7 - * - * @param bool $set_error Whether an error message be set in session. - * @return bool Is the minimum cart amount met? - */ - public function is_min_price_met( $set_error = true ) { - $return = false; - - $cart_amount = edd_get_cart_discountable_subtotal( $this->id ); - - if ( (float) $cart_amount >= (float) $this->min_charge_amount ) { - $return = true; - } elseif ( $set_error ) { - edd_set_error( 'edd-discount-error', sprintf( __( 'Minimum order of %s not met.', 'easy-digital-downloads' ), edd_currency_filter( edd_format_amount( $this->min_charge_amount ) ) ) ); - } - - /** - * Filters if the minimum cart amount has been met to satisfy the discount. - * - * @since 2.7 - * - * @param bool $return Is the minimum cart amount met or not. - * @param int $ID Discount ID. - * @param bool $set_error Whether an error message be set in session. - */ - return apply_filters( 'edd_is_discount_min_met', $return, $this->id, $set_error ); - } - - /** - * Is the discount single use or not? - * - * @since 2.7 - * - * @return bool Is the discount single use or not? - */ - public function is_single_use() { - /** - * Filters if the discount is single use or not. - * - * @since 2.7 - * - * @param bool $single_use Is the discount is single use or not. - * @param int $ID Discount ID. - */ - return (bool) apply_filters( 'edd_is_discount_single_use', $this->once_per_customer, $this->id ); - } - - /** - * Are the product requirements met for the discount to hold. - * - * @since 2.7 - * - * @param bool $set_error Whether an error message be set in session. - * @return bool Are required products in the cart? - */ - public function is_product_requirements_met( $set_error = true ) { - $product_reqs = $this->get_product_reqs(); - $excluded_ps = $this->get_excluded_products(); - $cart_items = edd_get_cart_contents(); - $cart_ids = $cart_items ? wp_list_pluck( $cart_items, 'id' ) : null; - $is_met = true; - - /** - * Normalize our data for product requirements, exclusions and cart data. - */ - - // First absint the items, then sort, and reset the array keys - $product_reqs = array_map( 'absint', $product_reqs ); - asort( $product_reqs ); - $product_reqs = array_filter( array_values( $product_reqs ) ); - - $cart_ids = array_map( 'absint', $cart_ids ); - asort( $cart_ids ); - $cart_ids = array_values( $cart_ids ); - - // Ensure we have requirements before proceeding - if ( ! empty( $product_reqs ) ) { - $matches = array_intersect( $product_reqs, $cart_ids ); - - switch ( $this->get_product_condition() ) { - case 'all': - $is_met = count( $matches ) === count( $product_reqs ); - break; - default: - $is_met = 0 < count( $matches ); - } - - if ( ! $is_met && $set_error ) { - edd_set_error( 'edd-discount-error', __( 'The product requirements for this discount are not met.', 'easy-digital-downloads' ) ); - } - } - - $excluded_ps = array_map( 'absint', $excluded_ps ); - asort( $excluded_ps ); - $excluded_ps = array_filter( array_values( $excluded_ps ) ); - - if ( ! empty( $excluded_ps ) ) { - if ( count( array_intersect( $cart_ids, $excluded_ps ) ) === count( $cart_ids ) ) { - $is_met = false; - - if ( $set_error ) { - edd_set_error( 'edd-discount-error', __( 'This discount is not valid for the cart contents.', 'easy-digital-downloads' ) ); - } - } - } - - /** - * Filters whether the product requirements are met for the discount to hold. - * - * @since 2.7 - * - * @param bool $is_met Are the product requirements met or not. - * @param int $ID Discount ID. - * @param string $product_condition Product condition. - * @param bool $set_error Whether an error message be set in session. - */ - return (bool) apply_filters( 'edd_is_discount_products_req_met', $is_met, $this->id, $this->product_condition, $set_error ); - } - - /** - * Has the discount code been used. - * - * @since 2.7 - * @since 3.0 Refactored to use new query methods. - * - * @param string $user User info. - * @param bool $set_error Whether an error message be set in session. - * - * @return bool Whether the discount has been used or not. - */ - public function is_used( $user = '', $set_error = true ) { - $return = false; - - if ( $this->is_single_use ) { - $payments = array(); - - if ( edd_get_component_interface( 'customer', 'table' )->exists() ) { - $by_user_id = ! is_email( $user ); - - $customer = new EDD_Customer( $user, $by_user_id ); - - $payments = explode( ',', $customer->payment_ids ); - } else { - $user_found = false; - - if ( is_email( $user ) ) { - $user_found = true; // All we need is the email - $key = '_edd_payment_user_email'; - $value = $user; - } else { - $user_data = get_user_by( 'login', $user ); - - if ( $user_data ) { - $user_found = true; - $key = '_edd_payment_user_id'; - $value = $user_data->ID; - } - } - - if ( $user_found ) { - $query_args = array( - 'post_type' => 'edd_payment', - 'meta_query' => array( - array( - 'key' => $key, - 'value' => $value, - 'compare' => '=', - ), - ), - 'fields' => 'ids', - ); - - $payments = get_posts( $query_args ); // Get all payments with matching email - } - } - - if ( $payments ) { - foreach ( $payments as $payment ) { - $payment = new EDD_Payment( $payment ); - - if ( empty( $payment->discounts ) ) { - continue; - } - - if ( in_array( $payment->status, edd_get_incomplete_order_statuses(), true ) ) { - continue; - } - - $discounts = explode( ',', $payment->discounts ); - - if ( is_array( $discounts ) ) { - $discounts = array_map( 'strtoupper', $discounts ); - $key = array_search( strtoupper( $this->code ), $discounts, true ); - - if ( false !== $key ) { - if ( $set_error ) { - edd_set_error( 'edd-discount-error', __( 'This discount has already been redeemed.', 'easy-digital-downloads' ) ); - } - - $return = true; - break; - } - } - } - } - } - - /** - * Filters if the discount is used or not. - * - * @since 2.7 - * - * @param bool $return If the discount is used or not. - * @param int $ID Discount ID. - * @param string $user User info. - * @param bool $set_error Whether an error message be set in session. - */ - return apply_filters( 'edd_is_discount_used', $return, $this->id, $user, $set_error ); - } - - /** - * Checks whether a discount holds at the time of purchase. - * - * @since 2.7 - * - * @param string $user User info. - * @param bool $set_error Whether an error message be set in session. - * @return bool Is the discount valid or not? - */ - public function is_valid( $user = '', $set_error = true ) { - $return = false; - $user = trim( $user ); - - if ( edd_get_cart_contents() && $this->id ) { - if ( - $this->is_active( true, $set_error ) && - $this->is_started( $set_error ) && - ! $this->is_maxed_out( $set_error ) && - ! $this->is_used( $user, $set_error ) && - $this->is_product_requirements_met( $set_error ) && - $this->is_min_price_met( $set_error ) - ) { - $return = true; - } - } elseif ( $set_error ) { - edd_set_error( 'edd-discount-error', _x( 'This discount is invalid.', 'error for when a discount is invalid based on its configuration', 'easy-digital-downloads' ) ); - } - - /** - * Filters whether the discount is valid or not. - * - * @since 2.7 - * - * @param bool $return If the discount is used or not. - * @param int $ID Discount ID. - * @param string $code Discount code. - * @param string $user User info. - * @param bool $set_error Whether an error message be set in session. - */ - return apply_filters( 'edd_is_discount_valid', $return, $this->id, $this->code, $user, $set_error ); - } - - /** - * Checks if a discount code is active. - * - * @since 2.7 - * - * @param bool $update Update the discount to expired if an one is found but has an active status. - * @param bool $set_error Whether an error message be set in session. - * @return bool If the discount is active or not. - */ - public function is_active( $update = true, $set_error = true ) { - $return = false; - - if ( $this->exists() ) { - - if ( $this->is_expired( $update ) ) { - if ( edd_doing_ajax() && $set_error ) { - edd_set_error( 'edd-discount-error', __( 'This discount is expired.', 'easy-digital-downloads' ) ); - } - } elseif ( 'active' === $this->status ) { - $return = true; - } elseif ( edd_doing_ajax() && $set_error ) { - edd_set_error( 'edd-discount-error', __( 'This discount is not active.', 'easy-digital-downloads' ) ); - } - } - - /** - * Filters if the discount is active or not. - * - * @since 2.7 - * - * @param bool $return Is the discount active or not. - * @param int $ID Discount ID. - * @param bool $set_error Whether an error message be set in session. - */ - return apply_filters( 'edd_is_discount_active', $return, $this->id, $set_error ); - } - - /** - * Get Discounted Amount. - * - * @since 2.7 - * - * @param string|int $base_price Price before discount. - * @return float $discounted_price Amount after discount. - */ - public function get_discounted_amount( $base_price ) { - $base_price = floatval( $base_price ); - - if ( 'flat' === $this->amount_type ) { - $amount = $base_price - floatval( $this->amount ); - - if ( $amount < 0 ) { - $amount = 0; - } - } else { - // Percentage discount - $amount = $base_price - ( $base_price * ( floatval( $this->amount ) / 100 ) ); - } - - /** - * Filter the discounted amount calculated. - * - * @since 2.7 - * @access public - * - * @param float $amount Calculated discounted amount. - * @param EDD_Discount $this Discount object. - */ - return apply_filters( 'edd_discounted_amount', $amount, $this ); - } - - /** - * Increment the usage of the discount. - * - * @since 2.7 - * - * @return int New discount usage. - */ - public function increase_usage() { - if ( $this->get_uses() ) { - $this->use_count++; - } else { - $this->use_count = 1; - } - - $args = array( 'use_count' => $this->use_count ); - - $this->max_uses = absint( $this->max_uses ); - - if ( 0 !== $this->max_uses && $this->max_uses <= $this->use_count ) { - $args['status'] = 'inactive'; - } - - $this->update( $args ); - - /** - * Fires after the usage count has been increased. - * - * @since 2.7 - * - * @param int $use_count Discount usage. - * @param int $ID Discount ID. - * @param string $code Discount code. - */ - do_action( 'edd_discount_increase_use_count', $this->use_count, $this->id, $this->code ); - - return (int) $this->use_count; - } - - /** - * Decrement the usage of the discount. - * - * @since 2.7 - * - * @return int New discount usage. - */ - public function decrease_usage() { - if ( $this->get_uses() ) { - $this->use_count--; - } - - if ( $this->use_count < 0 ) { - $this->use_count = 0; - } - - $args = array( 'use_count' => $this->use_count ); - - if ( 0 !== $this->max_uses && $this->max_uses > $this->use_count ) { - $args['status'] = 'active'; - } - - $this->update( $args ); - - /** - * Fires after the usage count has been decreased. - * - * @since 2.7 - * - * @param int $use_count Discount usage. - * @param int $ID Discount ID. - * @param string $code Discount code. - */ - do_action( 'edd_discount_decrease_use_count', $this->use_count, $this->id, $this->code ); - - return (int) $this->use_count; - } - - /** - * Edit Discount Link. - * - * @since 2.7 - * - * @return string Link to the `Edit Discount` page. - */ - public function edit_url() { - return esc_url( - edd_get_admin_url( - array( - 'page' => 'edd-discounts', - 'edd-action' => 'edit_discount', - 'discount' => absint( $this->id ), - ) - ) - ); - } - - /** - * Sanitize the data for update/create - * - * @since 3.0 - * @param array $data The data to sanitize - * @return array The sanitized data, based off column defaults - */ - private function sanitize_columns( $data ) { - $default_values = array(); - - foreach ( $data as $key => $type ) { - - // Only sanitize data that we were provided - if ( ! array_key_exists( $key, $data ) ) { - continue; - } - - switch ( $type ) { - - case '%s': - if ( 'email' === $key ) { - $data[ $key ] = sanitize_email( $data[ $key ] ); - } elseif ( 'notes' === $key ) { - $data[ $key ] = strip_tags( $data[ $key ] ); - } else { - if ( is_array( $data[ $key ] ) ) { - $data[ $key ] = json_encode( $data[ $key ] ); - } else { - $data[ $key ] = sanitize_text_field( $data[ $key ] ); - } - } - break; - - case '%d': - if ( ! is_numeric( $data[ $key ] ) || absint( $data[ $key ] ) !== (int) $data[ $key ] ) { - $data[ $key ] = $default_values[ $key ]; - } else { - $data[ $key ] = absint( $data[ $key ] ); - } - break; - - case '%f': - // Convert what was given to a float - $value = floatval( $data[ $key ] ); - - if ( ! is_float( $value ) ) { - $data[ $key ] = $default_values[ $key ]; - } else { - $data[ $key ] = $value; - } - break; - - default: - $data[ $key ] = ! is_array( $data[ $key ] ) - ? sanitize_text_field( $data[ $key ] ) - : maybe_serialize( array_map( 'sanitize_text_field', $data[ $key ] ) ); - break; - } - } - - return $data; - } - - /** - * Converts pre-3.0 arguments to the 3.0+ version. - * - * @since 3.0 - * @static - * - * @param $args array Arguments to be converted. - * @return array The converted arguments. - */ - public static function convert_legacy_args( $args = array() ) { - - // Loop through arguments provided and adjust old key names for the new schema introduced in 3.0 - $old = array( - 'uses' => 'use_count', - 'max' => 'max_uses', - 'start' => 'start_date', - 'expiration' => 'end_date', - 'min_price' => 'min_charge_amount', - 'products' => 'product_reqs', - 'excluded-products' => 'excluded_products', - 'not_global' => 'scope', - 'is_not_global' => 'scope', - 'use_once' => 'once_per_customer', - 'is_single_use' => 'once_per_customer', - ); - - foreach ( $old as $old_key => $new_key ) { - if ( isset( $args[ $old_key ] ) ) { - if ( in_array( $old_key, array( 'not_global', 'is_not_global' ), true ) && ! array_key_exists( 'scope', $args ) ) { - $args[ $new_key ] = ! empty( $args[ $old_key ] ) - ? 'not_global' - : 'global'; - } else { - $args[ $new_key ] = $args[ $old_key ]; - } - } - unset( $args[ $old_key ] ); - } - - // Default status needs to be active for regression purposes. - // See https://github.com/easydigitaldownloads/easy-digital-downloads/issues/6806 - if ( ! isset( $args['status'] ) ) { - $args['status'] = 'active'; - } - - return $args; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-download.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-download.php deleted file mode 100644 index 8b45eb15..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-download.php +++ /dev/null @@ -1,923 +0,0 @@ -setup_download( $download ); - } - - /** - * Given the download data, let's set the variables - * - * @since 2.3.6 - * @param WP_Post $download The WP_Post object for download. - * @return bool If the setup was successful or not - */ - private function setup_download( $download ) { - - if ( ! is_object( $download ) ) { - return false; - } - - if ( ! $download instanceof WP_Post ) { - return false; - } - - if ( 'download' !== $download->post_type ) { - return false; - } - - foreach ( $download as $key => $value ) { - $this->{$key} = $value; - } - - return true; - } - - /** - * Magic __get function to dispatch a call to retrieve a private property - * - * @since 2.2 - */ - public function __get( $key = '' ) { - if ( method_exists( $this, "get_{$key}" ) ) { - return call_user_func( array( $this, "get_{$key}" ) ); - } else { - return new WP_Error( 'edd-download-invalid-property', sprintf( __( 'Can\'t get property %s', 'easy-digital-downloads' ), $key ) ); - } - } - - /** - * Creates a download - * - * @since 2.3.6 - * @param array $data Array of attributes for a download - * @return mixed false if data isn't passed and class not instantiated for creation, or New Download ID - */ - public function create( $data = array() ) { - - if ( $this->id != 0 ) { - return false; - } - - $defaults = array( - 'post_type' => 'download', - 'post_status' => 'draft', - 'post_title' => __( 'New Download Product', 'easy-digital-downloads' ) - ); - - $args = wp_parse_args( $data, $defaults ); - - /** - * Fired before a download is created - * - * @param array $args The post object arguments used for creation. - */ - do_action( 'edd_download_pre_create', $args ); - - $id = wp_insert_post( $args, true ); - - $download = WP_Post::get_instance( $id ); - - /** - * Fired after a download is created - * - * @param int $id The post ID of the created item. - * @param array $args The post object arguments used for creation. - */ - do_action( 'edd_download_post_create', $id, $args ); - - return $this->setup_download( $download ); - } - - /** - * Retrieve the ID - * - * @since 2.2 - * @return int ID of the download - */ - public function get_ID() { - return $this->ID; - } - - /** - * Retrieve the download name - * - * @since 2.5.8 - * @return string Name of the download - */ - public function get_name() { - return get_the_title( $this->ID ); - } - - /** - * Retrieve the price - * - * @since 2.2 - * @return float Price of the download - */ - public function get_price() { - - if ( ! isset( $this->price ) ) { - $this->price = get_post_meta( $this->ID, 'edd_price', true ); - - if ( $this->price ) { - $this->price = edd_sanitize_amount( $this->price ); - } else { - $this->price = 0; - } - } - - /** - * Override the download price. - * - * @since 2.2 - * - * @param string $price The download price(s). - * @param string|int $id The downloads ID. - */ - return apply_filters( 'edd_get_download_price', $this->price, $this->ID ); - } - - /** - * Retrieve the variable prices - * - * @since 2.2 - * @return array List of the variable prices - */ - public function get_prices() { - - $this->prices = array(); - - if ( true === $this->has_variable_prices() ) { - if ( empty( $this->prices ) ) { - $this->prices = get_post_meta( $this->ID, 'edd_variable_prices', true ); - } - } - - /** - * Override variable prices - * - * @since 2.2 - * - * @param array $prices The array of variables prices. - * @param int|string The ID of the download. - */ - return array_filter( (array) apply_filters( 'edd_get_variable_prices', $this->prices, $this->ID ) ); - } - - /** - * Get the default Price ID for variable priced products. - * - * Since it is possible for the value to not be set on older products, we'll set it to the first price in the array - * if one is not set, as that has been the default behavior since default prices were introduced. - * - * Storing it as the first if found, is just more consistent and intentional. - * - * @since 3.1.2 - * - * @return int|null The default price ID, or null if the product does not have variable prices. - */ - public function get_default_price_id() { - if ( ! $this->has_variable_prices() ) { - return null; - } - - $default_price_id = get_post_meta( $this->ID, '_edd_default_price_id', true ); - - // If no default price ID is set, or the default price ID is not in the prices array, set the first price as the default. - $prices = $this->get_prices(); - if ( is_array( $prices ) && ( ! is_numeric( $default_price_id ) || ! array_key_exists( (int) $default_price_id, $prices ) ) ) { - $default_price_id = key( $prices ); - - // Set the default price ID - update_post_meta( $this->ID, '_edd_default_price_id', $default_price_id ); - } - - return absint( apply_filters( 'edd_variable_default_price_id', $default_price_id, $this->ID ) ); - } - - /** - * Determine if single price mode is enabled or disabled - * - * @since 2.2 - * @return bool True if download is in single price mode, false otherwise - */ - public function is_single_price_mode() { - $ret = $this->has_variable_prices() && get_post_meta( $this->ID, '_edd_price_options_mode', true ); - - /** - * Override the price mode for a download when checking if is in single price mode. - * - * @since 2.3 - * - * @param bool $ret Is download in single price mode? - * @param int|string The ID of the download. - */ - return (bool) apply_filters( 'edd_single_price_option_mode', $ret, $this->ID ); - } - - /** - * Determine if the download has variable prices enabled - * - * @since 2.2 - * @return bool True when the download has variable pricing enabled, false otherwise - */ - public function has_variable_prices() { - $ret = get_post_meta( $this->ID, '_variable_pricing', true ); - - /** - * Override whether the download has variables prices. - * - * @since 2.3 - * - * @param bool $ret Does download have variable prices? - * @param int|string The ID of the download. - */ - return (bool) apply_filters( 'edd_has_variable_prices', $ret, $this->ID ); - } - - /** - * Retrieve the file downloads - * - * @since 2.2 - * @param integer $variable_price_id - * @return array List of download files - */ - public function get_files( $variable_price_id = null ) { - if ( ! isset( $this->files ) ) { - - $this->files = array(); - - // Bundled products are not allowed to have files - if ( $this->is_bundled_download() ) { - return $this->files; - } - - $download_files = get_post_meta( $this->ID, 'edd_download_files', true ); - - if ( ! empty( $download_files ) ) { - if ( ! is_null( $variable_price_id ) && $this->has_variable_prices() ) { - foreach ( $download_files as $key => $file_info ) { - if ( isset( $file_info['condition'] ) ) { - if ( $file_info['condition'] == $variable_price_id || 'all' === $file_info['condition'] ) { - $this->files[ $key ] = $file_info; - } - } - } - - } else { - $this->files = $download_files; - } - } - } - - return apply_filters( 'edd_download_files', $this->files, $this->ID, $variable_price_id ); - } - - /** - * Retrieve the file download limit - * - * @since 2.2 - * @return int Number of download limit - */ - public function get_file_download_limit() { - - if ( ! isset( $this->file_download_limit ) ) { - $limit = get_post_meta( $this->ID, '_edd_download_limit', true ); - $global = edd_get_option( 'file_download_limit', 0 ); - - // Download specific limit - if ( is_numeric( $limit ) ) { - $retval = absint( $limit ); - - // Use global - } elseif ( '' === $limit ) { - $retval = ''; - - // Global limit - } elseif ( ! empty( $global ) ) { - $retval = absint( $global ); - - // Default - } else { - $retval = 0; - } - - $this->file_download_limit = $retval; - } - - return apply_filters( 'edd_file_download_limit', $this->file_download_limit, $this->ID ); - } - - /** - * Retrieve the refund window - * - * @since 3.0 - * @return int Number of days - */ - public function get_refund_window() { - - if ( ! isset( $this->refund_window ) ) { - $window = get_post_meta( $this->ID, '_edd_refund_window', true ); - $global = edd_get_option( 'refund_window', 0 ); // needs to be 0 here - - // Download specific window - if ( is_numeric( $window ) ) { - $retval = absint( $window ); - - // Use global - } elseif ( '' === $window ) { - $retval = ''; - - // Global limit - } elseif ( ! empty( $global ) ) { - $retval = absint( $global ); - - // Default - } else { - $retval = 0; - } - - $this->refund_window = $retval; - } - - return $this->refund_window; // No filter - } - - /** - * Retrieve whether the product is refundable. - * - * @since 3.0 - * - * @return string `refundable` or `nonrefundable` - */ - public function get_refundability() { - - if ( ! isset( $this->refundability ) ) { - $default = 'refundable'; - $refundable = get_post_meta( $this->ID, '_edd_refundability', true ); - $global = edd_get_option( 'refundability', $default ); - - // Download specific window - if ( ! empty( $refundable ) ) { - $retval = $refundable; - - // Use global - } elseif ( ! empty( $global ) ) { - $retval = $global; - - // Default - } else { - $retval = $default; - } - - $this->refundability = $retval; - } - - return $this->refundability; // No filter - } - - /** - * Retrieve the price option that has access to the specified file - * - * @since 2.2 - * @return int|string - */ - public function get_file_price_condition( $file_key = 0 ) { - $files = $this->get_files(); - $condition = isset( $files[ $file_key ]['condition'] ) - ? $files[ $file_key ]['condition'] - : 'all'; - - return apply_filters( 'edd_get_file_price_condition', $condition, $this->ID, $files ); - } - - /** - * Retrieve the download type, default or bundle - * - * @since 2.2 - * @return string Type of download, either 'default' or 'bundle' - */ - public function get_type() { - if ( ! isset( $this->type ) ) { - $this->type = get_post_meta( $this->ID, '_edd_product_type', true ); - - if ( empty( $this->type ) ) { - $this->type = 'default'; - } - } - - return apply_filters( 'edd_get_download_type', $this->type, $this->ID ); - } - - /** - * Determine if this is a bundled download - * - * @since 2.2 - * @return bool True when download is a bundle, false otherwise - */ - public function is_bundled_download() { - return 'bundle' === $this->get_type(); - } - - /** - * Retrieves the Download IDs that are bundled with this Download - * - * @since 2.2 - * @return array List of bundled downloads - */ - public function get_bundled_downloads() { - - if ( ! isset( $this->bundled_downloads ) ) { - $this->bundled_downloads = (array) get_post_meta( $this->ID, '_edd_bundled_products', true ); - } - - return (array) apply_filters( 'edd_get_bundled_products', array_filter( $this->bundled_downloads ), $this->ID ); - } - - /** - * Retrieve the Download IDs that are bundled with this Download based on the variable pricing ID passed - * - * @since 2.7 - * @param int $price_id Variable pricing ID - * @return array List of bundled downloads - */ - public function get_variable_priced_bundled_downloads( $price_id = null ) { - if ( null === $price_id ) { - return $this->get_bundled_downloads(); - } - - $downloads = array(); - $bundled_downloads = $this->get_bundled_downloads(); - $price_assignments = $this->get_bundle_pricing_variations(); - - if ( ! $price_assignments ) { - return $bundled_downloads; - } - - $price_assignments = $price_assignments[0]; - - foreach ( $price_assignments as $key => $value ) { - if ( isset( $bundled_downloads[ $key ] ) && ( $value == $price_id || $value == 'all' ) ) { - $downloads[] = $bundled_downloads[ $key ]; - } - } - - return $downloads; - } - - /** - * Retrieve the download notes - * - * @since 2.2 - * @return string Note related to the download - */ - public function get_notes() { - - if ( ! isset( $this->notes ) ) { - $this->notes = get_post_meta( $this->ID, 'edd_product_notes', true ); - } - - return (string) apply_filters( 'edd_product_notes', $this->notes, $this->ID ); - } - - /** - * Retrieve the download sku - * - * @since 2.2 - * @return string SKU of the download - */ - public function get_sku() { - - if ( ! isset( $this->sku ) ) { - - $this->sku = get_post_meta( $this->ID, 'edd_sku', true ); - - if ( empty( $this->sku ) ) { - $this->sku = '-'; - } - } - - return apply_filters( 'edd_get_download_sku', $this->sku, $this->ID ); - } - - /** - * Retrieve the purchase button behavior - * - * @since 2.2 - * @return string - */ - public function get_button_behavior() { - - if ( ! isset( $this->button_behavior ) ) { - - $this->button_behavior = get_post_meta( $this->ID, '_edd_button_behavior', true ); - - if ( empty( $this->button_behavior ) || ! edd_shop_supports_buy_now() ) { - $this->button_behavior = 'add_to_cart'; - } - } - - return apply_filters( 'edd_get_download_button_behavior', $this->button_behavior, $this->ID ); - } - - /** - * Retrieve the sale count for the download - * - * @since 2.2 - * @return int Number of times this has been purchased - */ - public function get_sales() { - - if ( ! isset( $this->sales ) ) { - - if ( '' == get_post_meta( $this->ID, '_edd_download_sales', true ) ) { - add_post_meta( $this->ID, '_edd_download_sales', 0 ); - } - - $this->sales = get_post_meta( $this->ID, '_edd_download_sales', true ); - - // Never let sales be less than zero - $this->sales = max( $this->sales, 0 ); - } - - return $this->sales; - } - - /** - * Increment the sale count by one - * - * @since 2.2 - * @param int $quantity The quantity to increase the sales by - * @return int New number of total sales - */ - public function increase_sales( $quantity = 1 ) { - - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Download::recalculate_net_sales_earnings()' ); - edd_recalculate_download_sales_earnings( $this->ID ); - - $this->get_sales(); - do_action( 'edd_download_increase_sales', $this->ID, $this->sales, $this ); - - return $this->sales; - } - - /** - * Decrement the sale count by one - * - * @since 2.2 - * @param int $quantity The quantity to decrease by - * @return int New number of total sales - */ - public function decrease_sales( $quantity = 1 ) { - - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Download::recalculate_net_sales_earnings()' ); - $this->recalculate_net_sales_earnings(); - - $this->get_sales(); - do_action( 'edd_download_decrease_sales', $this->ID, $this->sales, $this ); - - return $this->sales; - } - - /** - * Retrieve the total earnings for the download - * - * @since 2.2 - * @return float Total download earnings - */ - public function get_earnings() { - - if ( ! isset( $this->earnings ) ) { - if ( '' == get_post_meta( $this->ID, '_edd_download_earnings', true ) ) { - add_post_meta( $this->ID, '_edd_download_earnings', 0 ); - } - - $this->earnings = get_post_meta( $this->ID, '_edd_download_earnings', true ); - - // Never let earnings be less than zero - $this->earnings = max( $this->earnings, 0 ); - } - - return $this->earnings; - } - - /** - * Increase the earnings by the given amount - * - * @since 2.2 - * @param int|float $amount Amount to increase the earnings by - * @return float New number of total earnings - */ - public function increase_earnings( $amount = 0 ) { - - _edd_deprecated_function( __METHOD__, '3.0', 'edd_recalculate_download_sales_earnings()' ); - edd_recalculate_download_sales_earnings( $this->ID ); - - $this->get_earnings(); - do_action( 'edd_download_increase_earnings', $this->ID, $this->earnings, $this ); - - return $this->earnings; - } - - /** - * Decrease the earnings by the given amount - * - * @since 2.2 - * @param int|float $amount Number to decrease earning with - * @return float New number of total earnings - */ - public function decrease_earnings( $amount ) { - - _edd_deprecated_function( __METHOD__, '3.0', 'EDD_Download::recalculate_net_sales_earnings()' ); - - $this->recalculate_net_sales_earnings(); - $this->get_earnings(); - - do_action( 'edd_download_decrease_earnings', $this->ID, $this->earnings, $this ); - - return $this->earnings; - } - - /** - * Updates the gross sales and earnings for a download. - * - * @since 3.0 - * @return void - */ - public function recalculate_gross_sales_earnings() { - $download_model = new Download( $this->ID ); - - // This currently uses the post meta functions as we do not yet guarantee that the meta exists. - update_post_meta( $this->ID, '_edd_download_gross_sales', $download_model->get_gross_sales() ); - update_post_meta( $this->ID, '_edd_download_gross_earnings', floatval( $download_model->get_gross_earnings() ) ); - } - - /** - * Recalculates the net sales and earnings for a download. - * - * @since 3.0 - * @return void - */ - public function recalculate_net_sales_earnings() { - $download_model = new Download( $this->ID ); - - $this->update_meta( '_edd_download_sales', intval( $download_model->get_net_sales() ) ); - $this->update_meta( '_edd_download_earnings', floatval( $download_model->get_net_earnings() ) ); - } - - /** - * Determine if the download is free or if the given price ID is free - * - * @since 2.2 - * @param bool $price_id ID of variation if needed - * @return bool True when the download is free, false otherwise - */ - public function is_free( $price_id = false ) { - - $is_free = false; - $variable_pricing = edd_has_variable_prices( $this->ID ); - - if ( $variable_pricing && ! is_null( $price_id ) && $price_id !== false ) { - $price = edd_get_price_option_amount( $this->ID, $price_id ); - - } elseif ( $variable_pricing && $price_id === false ) { - $lowest_price = (float) edd_get_lowest_price_option( $this->ID ); - $highest_price = (float) edd_get_highest_price_option( $this->ID ); - - if ( $lowest_price === 0.00 && $highest_price === 0.00 ) { - $price = 0; - } - - } elseif ( ! $variable_pricing ) { - - $price = get_post_meta( $this->ID, 'edd_price', true ); - } - - if ( isset( $price ) && (float) $price == 0 ) { - $is_free = true; - } - - return (bool) apply_filters( 'edd_is_free_download', $is_free, $this->ID, $price_id ); - } - - /** - * Is quantity input disabled on this product? - * - * @since 2.7 - * @return bool - */ - public function quantities_disabled() { - $ret = (bool) get_post_meta( $this->ID, '_edd_quantities_disabled', true ); - return apply_filters( 'edd_download_quantity_disabled', $ret, $this->ID ); - } - - /** - * Updates a single meta entry for the download - * - * @since 2.3 - * @access private - * @param string $meta_key The meta_key to update - * @param string|array|object $meta_value The value to put into the meta - * @return bool The result of the update query - */ - private function update_meta( $meta_key = '', $meta_value = '' ) { - global $wpdb; - - if ( empty( $meta_key ) || ( ! is_numeric( $meta_value ) && empty( $meta_value ) ) ) { - return false; - } - - // Make sure if it needs to be serialized, we do - $meta_value = maybe_serialize( $meta_value ); - - if ( is_numeric( $meta_value ) ) { - $value_type = is_float( $meta_value ) ? '%f' : '%d'; - } else { - $value_type = "'%s'"; - } - - $sql = $wpdb->prepare( "UPDATE $wpdb->postmeta SET meta_value = $value_type WHERE post_id = $this->ID AND meta_key = '%s'", $meta_value, $meta_key ); - - if ( $wpdb->query( $sql ) ) { - - clean_post_cache( $this->ID ); - return true; - - } - - return false; - } - - /** - * Checks if the download can be purchased - * - * NOTE: Currently only checks on edd_get_cart_contents() and edd_add_to_cart() - * - * @since 2.6.4 - * @return bool If the current user can purchase the download ID - */ - public function can_purchase() { - $can_purchase = true; - - if ( 'publish' !== $this->post_status && ! current_user_can( 'edit_post', $this->ID ) ) { - $can_purchase = false; - } - - return (bool) apply_filters( 'edd_can_purchase_download', $can_purchase, $this ); - } - - /** - * Get pricing variations for bundled items - * - * @since 2.7 - * @return array - */ - public function get_bundle_pricing_variations() { - return get_post_meta( $this->ID, '_edd_bundled_products_conditions' ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-fees.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-fees.php deleted file mode 100644 index b89479f1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-fees.php +++ /dev/null @@ -1,362 +0,0 @@ - 1 ) { - - $args = func_get_args(); - $amount = $args[0]; - $label = isset( $args[1] ) ? $args[1] : ''; - $id = isset( $args[2] ) ? $args[2] : ''; - $type = 'fee'; - - $args = array( - 'amount' => $amount, - 'label' => $label, - 'id' => $id, - 'type' => $type, - 'no_tax' => false, - 'download_id' => 0, - 'price_id' => NULL - ); - - } else { - - $defaults = array( - 'amount' => 0, - 'label' => '', - 'id' => '', - 'no_tax' => false, - 'type' => 'fee', - 'download_id' => 0, - 'price_id' => NULL - ); - - $args = wp_parse_args( $args, $defaults ); - - if( $args['type'] != 'fee' && $args['type'] != 'item' ) { - $args['type'] = 'fee'; - } - - } - - // If the fee is for an "item" but we passed in a download id - if( 'item' === $args['type'] && ! empty( $args['download_id'] ) ) { - unset( $args['download_id'] ); - unset( $args['price_id'] ); - } - - if ( ! empty( $args['download_id'] ) ) { - $options = isset( $args['price_id'] ) ? array( 'price_id' => $args['price_id'] ) : array(); - if ( ! edd_item_in_cart( $args['download_id'], $options ) ) { - return false; - } - } - - $fees = $this->get_fees( 'all' ); - - // Determine the key - $key = empty( $args['id'] ) ? sanitize_key( $args['label'] ) : sanitize_key( $args['id'] ); - - // Remove the unneeded id key - unset( $args['id'] ); - - // Sanitize the amount - $args['amount'] = edd_sanitize_amount( $args['amount'] ); - - // Force the amount to have the proper number of decimal places. - $args['amount'] = number_format( (float) $args['amount'], edd_currency_decimal_filter(), '.', '' ); - - // Force no_tax to true if the amount is negative - if( $args['amount'] < 0 ) { - $args['no_tax'] = true; - } - - // Set the fee - $fees[ $key ] = apply_filters( 'edd_fees_add_fee', $args, $this ); - - // Allow 3rd parties to process the fees before storing them in the session - $fees = apply_filters( 'edd_fees_set_fees', $fees, $this ); - - // Update fees - EDD()->session->set( 'edd_cart_fees', $fees ); - - do_action( 'edd_post_add_fee', $fees, $key, $args ); - - return $fees; - } - - /** - * Remove an Existing Fee - * - * @since 1.5 - * @param string $id Fee ID - * @uses EDD_Fees::get_fees() - * @uses EDD_Session::set() - * @return array Remaining fees - */ - public function remove_fee( $id = '' ) { - - $fees = $this->get_fees( 'all' ); - - if ( isset( $fees[ $id ] ) ) { - unset( $fees[ $id ] ); - EDD()->session->set( 'edd_cart_fees', $fees ); - - do_action( 'edd_post_remove_fee', $fees, $id ); - } - - return $fees; - } - - /** - * Check if any fees are present - * - * @since 1.5 - * @param string $type Fee type, "fee" or "item" - * @uses EDD_Fees::get_fees() - * @return bool True if there are fees, false otherwise - */ - public function has_fees( $type = 'fee' ) { - - if( 'all' == $type || 'fee' == $type ) { - if( ! edd_get_cart_contents() ) { - $type = 'item'; - } - - } - - $fees = $this->get_fees( $type ); - return ! empty( $fees ) && is_array( $fees ); - } - - /** - * Retrieve all active fees - * - * @since 1.5 - * @param string $type Fee type, "fee" or "item" - * @param int $download_id The download ID whose fees to retrieve - * @param null|int $price_id The variable price ID whose fees to retrieve - * @uses EDD_Session::get() - * @return array|bool List of fees when available, false when there are no fees - */ - public function get_fees( $type = 'fee', $download_id = 0, $price_id = null ) { - $fees = EDD()->session->get( 'edd_cart_fees' ); - - if ( EDD()->cart->is_empty() ) { - // We can only get item type fees when the cart is empty - $type = 'item'; - } - - if ( ! empty( $fees ) && ! empty( $type ) && 'all' !== $type ) { - foreach ( $fees as $key => $fee ) { - if ( ! empty( $fee['type'] ) && $type != $fee['type'] ) { - unset( $fees[ $key ] ); - } - } - } - - if ( ! empty( $fees ) && ! empty( $download_id ) ) { - // Remove fees that don't belong to the specified Download - $applied_fees = array(); - foreach ( $fees as $key => $fee ) { - - if ( empty( $fee['download_id'] ) || (int) $download_id !== (int) $fee['download_id'] ) { - unset( $fees[ $key ] ); - } - - $string_to_hash = "{$key}_{$download_id}"; - if ( ! is_null( $price_id ) && isset( $fee['price_id'] ) ) { - $string_to_hash .= "_{$fee['price_id']}"; - } - $fee_hash = md5( $string_to_hash ); - - if ( in_array( $fee_hash, $applied_fees, true ) ) { - unset( $fees[ $key ] ); - } - - $applied_fees[] = $fee_hash; - } - } - - // Now that we've removed any fees that are for other Downloads, lets also remove any fees that don't match this price id - if ( ! empty( $fees ) && ! empty( $download_id ) && ! is_null( $price_id ) ) { - // Remove fees that don't belong to the specified Download AND Price ID - foreach ( $fees as $key => $fee ) { - if ( is_null( $fee['price_id'] ) ) { - continue; - } - - if ( (int) $price_id !== (int) $fee['price_id'] ){ - unset( $fees[ $key ] ); - } - } - } - - if ( ! empty( $fees ) ) { - // Remove fees that belong to a specific download but are not in the cart - foreach ( $fees as $key => $fee ) { - if ( empty( $fee['download_id'] ) ) { - continue; - } - - if ( ! edd_item_in_cart( $fee['download_id'] ) ) { - unset( $fees[ $key ] ); - } - } - } - - // Allow 3rd parties to process the fees before returning them - return apply_filters( 'edd_fees_get_fees', ! empty( $fees ) ? $fees : array(), $this ); - } - - /** - * Retrieve a specific fee - * - * @since 1.5 - * - * @param string $id ID of the fee to get - * @return array|bool The fee array when available, false otherwise - */ - public function get_fee( $id = '' ) { - $fees = $this->get_fees( 'all' ); - - if ( ! isset( $fees[ $id ] ) ) - return false; - - return $fees[ $id ]; - } - - /** - * Calculate the total fee amount for a specific fee type - * - * Can be negative - * - * @since 2.0 - * @param string $type Fee type, "fee" or "item" - * @uses EDD_Fees::get_fees() - * @uses EDD_Fees::has_fees() - * @return float Total fee amount - */ - public function type_total( $type = 'fee' ) { - $fees = $this->get_fees( $type ); - $total = (float) 0.00; - - if ( $this->has_fees( $type ) ) { - foreach ( $fees as $fee ) { - $total += edd_sanitize_amount( $fee['amount'] ); - } - } - - return edd_sanitize_amount( $total ); - } - - /** - * Calculate the total fee amount - * - * Can be negative - * - * @since 1.5 - * @uses EDD_Fees::get_fees() - * @uses EDD_Fees::has_fees() - * @param int $download_id The download ID whose fees to retrieve - * @return float Total fee amount - */ - public function total( $download_id = 0 ) { - $fees = $this->get_fees( 'all', $download_id ); - $total = (float) 0.00; - - if ( $this->has_fees( 'all' ) ) { - foreach ( $fees as $fee ) { - $total += edd_sanitize_amount( $fee['amount'] ); - } - } - - return edd_sanitize_amount( $total ); - } - - /** - * Stores the fees in the payment meta - * - * @since 1.5 - * @uses EDD_Session::set() - * @param array $payment_meta The meta data to store with the payment - * @param array $payment_data The info sent from process-purchase.php - * @return array Return the payment meta with the fees added - */ - public function record_fees( $payment_meta, $payment_data ) { - if ( $this->has_fees( 'all' ) ) { - - $payment_meta['fees'] = $this->get_fees( 'all' ); - - // Only clear fees from session when status is not pending - if( ! empty( $payment_data['status'] ) && 'pending' !== strtolower( $payment_data['status'] ) ) { - - EDD()->session->set( 'edd_cart_fees', null ); - - } - } - - return $payment_meta; - } - - /** - * Gets the tax to be added to a fee. - * - * @since 3.0 - * @param array $fee - * @param float $tax_rate - * @return float - */ - public function get_calculated_tax( $fee, $tax_rate ) { - $tax = 0.00; - if ( ! ( $tax_rate || empty( $fee['no_tax'] ) ) || $fee['amount'] < 0 ) { - return $tax; - } - - return ( floatval( $fee['amount'] ) * $tax_rate ) / 100; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-html-elements.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-html-elements.php deleted file mode 100644 index 1f5d9a45..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-html-elements.php +++ /dev/null @@ -1,1023 +0,0 @@ - 'products', - 'id' => 'products', - 'class' => '', - 'multiple' => false, - 'selected' => 0, - 'chosen' => false, - 'number' => 30, - 'bundles' => true, - 'variations' => false, - 'show_variations_only' => false, - 'placeholder' => sprintf( __( 'Choose a %s', 'easy-digital-downloads' ), edd_get_label_singular() ), - 'data' => array( - 'search-type' => 'download', - 'search-placeholder' => sprintf( __( 'Search %s', 'easy-digital-downloads' ), edd_get_label_plural() ), - ), - 'required' => false, - 'products' => array(), - ); - - $args = wp_parse_args( $args, $defaults ); - - $products = $args['products']; - if ( empty( $args['products'] ) ) { - $products = $this->get_products( $args ); - } - $existing_ids = wp_list_pluck( $products, 'ID' ); - if ( ! empty( $args['selected'] ) ) { - - $selected_items = $args['selected']; - if ( ! is_array( $selected_items ) ) { - $selected_items = array( $selected_items ); - } - - foreach ( $selected_items as $selected_item ) { - if ( ! in_array( $selected_item, $existing_ids, true ) ) { - - // If the selected item has a variation, we just need the product ID. - $has_variation = strpos( $selected_item, '_' ); - if ( false !== $has_variation ) { - $selected_item = substr( $selected_item, 0, $has_variation ); - } - - $post = get_post( $selected_item ); - if ( ! is_null( $post ) ) { - $products[] = $post; - } - } - } - } - - $options = array( - '' => '', - ); - if ( $products ) { - foreach ( $products as $product ) { - $has_variations = edd_has_variable_prices( $product->ID ); - - // If a product has no variations, just add it to the list and continue. - if ( ! $has_variations ) { - $title = esc_html( $product->post_title ); - $options[ absint( $product->ID ) ] = $title; - - continue; - } - - // The product does have variations. Add the top level product to the list - // if not showing variations, or not showing variations only. - if ( false === $args['variations'] || ! $args['show_variations_only'] ) { - $title = esc_html( $product->post_title ); - if ( ! $args['show_variations_only'] ) { - $title .= ' (' . __( 'All Price Options', 'easy-digital-downloads' ) . ')'; - } - $options[ absint( $product->ID ) ] = $title; - } - - // If showing variations, add them to the list. - if ( $args['variations'] ) { - $prices = edd_get_variable_prices( $product->ID ); - if ( ! empty( $prices ) ) { - foreach ( $prices as $key => $value ) { - $name = ! empty( $value['name'] ) ? $value['name'] : ''; - if ( $name ) { - $options[ absint( $product->ID ) . '_' . $key ] = esc_html( $product->post_title . ': ' . $name ); - } - } - } - } - } - } - - // This ensures that any selected products are included in the drop down - if ( is_array( $args['selected'] ) ) { - foreach ( $args['selected'] as $item ) { - if ( ! array_key_exists( $item, $options ) ) { - - $parsed_item = edd_parse_product_dropdown_value( $item ); - - if ( $parsed_item['price_id'] !== false ) { - $prices = edd_get_variable_prices( (int) $parsed_item['download_id'] ); - foreach ( $prices as $key => $value ) { - $name = ( isset( $value['name'] ) && ! empty( $value['name'] ) ) ? $value['name'] : ''; - - if ( $name && (int) $parsed_item['price_id'] === (int) $key ) { - $options[ absint( $product->ID ) . '_' . $key ] = esc_html( get_the_title( (int) $parsed_item['download_id'] ) . ': ' . $name ); - } - } - } else { - $options[ $parsed_item['download_id'] ] = get_the_title( $parsed_item['download_id'] ); - } - } - } - } elseif ( false !== $args['selected'] && $args['selected'] !== 0 ) { - if ( ! array_key_exists( $args['selected'], $options ) ) { - $parsed_item = edd_parse_product_dropdown_value( $args['selected'] ); - - if ( $parsed_item['price_id'] !== false ) { - $prices = edd_get_variable_prices( (int) $parsed_item['download_id'] ); - - foreach ( $prices as $key => $value ) { - $name = ( isset( $value['name'] ) && ! empty( $value['name'] ) ) ? $value['name'] : ''; - - if ( $name && (int) $parsed_item['price_id'] === (int) $key ) { - $options[ absint( $product->ID ) . '_' . $key ] = esc_html( get_the_title( (int) $parsed_item['download_id'] ) . ': ' . $name ); - } - } - } else { - $options[ $parsed_item['download_id'] ] = get_the_title( $parsed_item['download_id'] ); - } - } - } - - if ( ! $args['bundles'] ) { - $args['class'] .= ' no-bundles'; - } - - if ( $args['variations'] ) { - $args['class'] .= ' variations'; - } - - if ( $args['show_variations_only'] ) { - $args['class'] .= ' variations-only'; - } - - // 'all' gets created as an option if passed via the `selected` argument. - if ( isset( $options['all'] ) ) { - unset( $options['all'] ); - } - - $output = $this->select( array( - 'name' => $args['name'], - 'selected' => $args['selected'], - 'id' => $args['id'], - 'class' => $args['class'], - 'options' => $options, - 'chosen' => $args['chosen'], - 'multiple' => $args['multiple'], - 'placeholder' => $args['placeholder'], - 'show_option_all' => isset( $args['show_option_all'] ) ? $args['show_option_all'] : false, - 'show_option_none' => false, - 'data' => $args['data'], - 'required' => $args['required'], - ) ); - - return $output; - } - - /** - * Get EDD products for the product dropdown. - * - * @param array $args Parameters for the get_posts function. - * @return array WP_Post[] Array of download objects. - */ - public function get_products( $args = array() ) { - $defaults = array( - 'number' => 30, - 'bundles' => true, - ); - - $args = wp_parse_args( $args, $defaults ); - - $product_args = array( - 'post_type' => 'download', - 'orderby' => 'title', - 'order' => 'ASC', - 'posts_per_page' => $args['number'], - ); - - if ( ! current_user_can( 'edit_products' ) ) { - $product_args['post_status'] = apply_filters( 'edd_product_dropdown_status_nopriv', array( 'publish' ) ); - } else { - $product_args['post_status'] = apply_filters( - 'edd_product_dropdown_status', - array( - 'publish', - 'draft', - 'private', - 'future', - ) - ); - } - - if ( is_array( $product_args['post_status'] ) ) { - - // Given the array, sanitize them. - $product_args['post_status'] = array_map( 'sanitize_text_field', $product_args['post_status'] ); - } else { - - // If we didn't get an array, fallback to 'publish'. - $product_args['post_status'] = array( 'publish' ); - } - - // Maybe disable bundles. - if ( ! $args['bundles'] ) { - $product_args['meta_query'] = array( - 'relation' => 'OR', - array( - 'key' => '_edd_product_type', - 'value' => 'bundle', - 'compare' => '!=', - ), - array( - 'key' => '_edd_product_type', - 'value' => 'bundle', - 'compare' => 'NOT EXISTS', - ), - ); - } - - $product_args = apply_filters( 'edd_product_dropdown_args', $product_args ); - - return get_posts( $product_args ); - } - - /** - * Renders an HTML Dropdown of all customers - * - * @since 2.2 - * - * @param array $args - * - * @return string $output Customer dropdown - */ - public function customer_dropdown( $args = array() ) { - $defaults = array( - 'name' => 'customers', - 'id' => 'customers', - 'class' => '', - 'multiple' => false, - 'selected' => 0, - 'chosen' => true, - 'placeholder' => __( 'Choose a Customer', 'easy-digital-downloads' ), - 'number' => 30, - 'data' => array( - 'search-type' => 'customer', - 'search-placeholder' => __( 'Search Customers', 'easy-digital-downloads' ), - ), - 'none_selected' => __( 'No customer attached', 'easy-digital-downloads' ), - 'required' => false, - ); - - $args = wp_parse_args( $args, $defaults ); - - $customers = edd_get_customers( array( - 'number' => $args['number'], - ) ); - - $options = array(); - - if ( $customers ) { - $options[0] = $args['none_selected']; - foreach ( $customers as $customer ) { - $options[ absint( $customer->id ) ] = esc_html( $customer->name . ' (' . $customer->email . ')' ); - } - } else { - $options[0] = __( 'No customers found', 'easy-digital-downloads' ); - } - - if ( ! empty( $args['selected'] ) ) { - - // If a selected customer has been specified, we need to ensure it's in the initial list of customers displayed - if ( ! array_key_exists( $args['selected'], $options ) ) { - $customer = new EDD_Customer( $args['selected'] ); - - if ( $customer ) { - $options[ absint( $args['selected'] ) ] = esc_html( $customer->name . ' (' . $customer->email . ')' ); - } - } - } - - $output = $this->select( array( - 'name' => $args['name'], - 'selected' => $args['selected'], - 'id' => $args['id'], - 'class' => $args['class'] . ' edd-customer-select', - 'options' => $options, - 'multiple' => $args['multiple'], - 'placeholder' => $args['placeholder'], - 'chosen' => $args['chosen'], - 'show_option_all' => false, - 'show_option_none' => false, - 'data' => $args['data'], - 'required' => $args['required'], - ) ); - - return $output; - } - - /** - * Renders an HTML Dropdown of all the Users - * - * @since 2.6.9 - * - * @param array $args - * - * @return string $output User dropdown - */ - public function user_dropdown( $args = array() ) { - $defaults = array( - 'name' => 'users', - 'id' => 'users', - 'class' => '', - 'multiple' => false, - 'selected' => 0, - 'chosen' => true, - 'placeholder' => __( 'Select a User', 'easy-digital-downloads' ), - 'number' => 30, - 'data' => array( - 'search-type' => 'user', - 'search-placeholder' => __( 'Search Users', 'easy-digital-downloads' ), - ), - 'required' => false, - ); - - $args = wp_parse_args( $args, $defaults ); - - $user_args = array( - 'number' => $args['number'], - ); - $users = get_users( $user_args ); - $options = array(); - - if ( $users ) { - foreach ( $users as $user ) { - $options[ $user->ID ] = esc_html( $user->display_name ); - } - } else { - $options[0] = __( 'No users found', 'easy-digital-downloads' ); - } - - $selected = $args['selected']; - if ( ! is_array( $selected ) ) { - $selected = array( $selected ); - } - // If a selected user has been specified, we need to ensure it's in the initial list of user displayed - if ( ! empty( $selected ) ) { - foreach ( $selected as $selected_user ) { - if ( ! array_key_exists( $selected_user, $options ) ) { - $user = get_userdata( $selected_user ); - - if ( $user ) { - $options[ absint( $user->ID ) ] = esc_html( $user->display_name ); - } - } - } - } - - $output = $this->select( array( - 'name' => $args['name'], - 'selected' => $args['selected'], - 'id' => $args['id'], - 'class' => $args['class'] . ' edd-user-select', - 'options' => $options, - 'multiple' => $args['multiple'], - 'placeholder' => $args['placeholder'], - 'chosen' => $args['chosen'], - 'show_option_all' => false, - 'show_option_none' => false, - 'data' => $args['data'], - 'required' => $args['required'], - ) ); - - return $output; - } - - /** - * Renders an HTML Dropdown of all the Discounts - * - * @since 1.5.2 - * @since 3.0 Allow $args to be passed. - * - * @param string $name Name attribute of the dropdown. - * @param int $selected Discount to select automatically. - * @param string $status Discount post_status to retrieve. - * - * @return string $output Discount dropdown - */ - public function discount_dropdown( $name = 'edd_discounts', $selected = 0, $status = '' ) { - $defaults = array( - 'name' => 'discounts', - 'id' => 'discounts', - 'class' => '', - 'multiple' => false, - 'selected' => 0, - 'chosen' => true, - 'placeholder' => __( 'Choose a Discount', 'easy-digital-downloads' ), - 'show_option_all' => __( 'All Discounts', 'easy-digital-downloads' ), - 'number' => 30, - 'data' => array( - 'search-type' => 'discount', - 'search-placeholder' => __( 'Search Discounts', 'easy-digital-downloads' ), - ), - 'required' => false, - ); - - $args = func_get_args(); - - if ( 1 === func_num_args() && is_array( $args[0] ) ) { - $args = wp_parse_args( $args[0], $defaults ); - } else { - $args = wp_parse_args( array( - 'name' => $name, - 'selected' => $selected, - 'nopaging' => true, - ), $defaults ); - } - - $discount_args = array( - 'number' => $args['number'], - ); - - if ( ! empty( $status ) ) { - $discount_args['status'] = $status; - } - - $discounts = edd_get_discounts( $discount_args ); - $options = array(); - - if ( $discounts ) { - foreach ( $discounts as $discount ) { - $options[ absint( $discount->id ) ] = esc_html( $discount->name ); - } - } else { - $options[0] = __( 'No discounts found', 'easy-digital-downloads' ); - } - - $output = $this->select( array( - 'name' => $args['name'], - 'selected' => $args['selected'], - 'id' => $args['id'], - 'class' => $args['class'] . ' edd-user-select', - 'options' => $options, - 'multiple' => $args['multiple'], - 'placeholder' => $args['placeholder'], - 'chosen' => $args['chosen'], - 'show_option_all' => $args['show_option_all'], - 'show_option_none' => false, - 'required' => $args['required'], - ) ); - - return $output; - } - - /** - * Renders an HTML Dropdown of all the Categories - * - * @since 1.5.2 - * - * @param string $name Name attribute of the dropdown - * @param int $selected Category to select automatically - * - * @return string $output Category dropdown - */ - public function category_dropdown( $name = 'edd_categories', $selected = 0 ) { - $categories = get_terms( 'download_category', apply_filters( 'edd_category_dropdown', array() ) ); - $options = array(); - - foreach ( $categories as $category ) { - $options[ absint( $category->term_id ) ] = esc_html( $category->name ); - } - - $category_labels = edd_get_taxonomy_labels( 'download_category' ); - $output = $this->select( array( - 'name' => $name, - 'selected' => $selected, - 'options' => $options, - 'show_option_all' => sprintf( _x( 'All %s', 'plural: Example: "All Categories"', 'easy-digital-downloads' ), $category_labels['name'] ), - 'show_option_none' => false, - ) ); - - return $output; - } - - /** - * Renders an HTML Dropdown of years - * - * @since 1.5.2 - * - * @param string $name Name attribute of the dropdown. - * @param int $selected Year to select automatically. - * @param int $years_before Number of years before the current year the dropdown should start with. - * @param int $years_after Number of years after the current year the dropdown should finish at. - * @param string $id A unique identifier for the field. - * @return string $output Year dropdown - */ - public function year_dropdown( $name = 'year', $selected = 0, $years_before = 5, $years_after = 0, $id = 'edd_year_select' ) { - $current = date( 'Y' ); - $start_year = $current - absint( $years_before ); - $end_year = $current + absint( $years_after ); - $selected = empty( $selected ) ? date( 'Y' ) : $selected; - $options = array(); - - while ( $start_year <= $end_year ) { - $options[ absint( $start_year ) ] = $start_year; - $start_year ++; - } - - $output = $this->select( - array( - 'name' => $name, - 'id' => $id . '_' . $name, - 'selected' => $selected, - 'options' => $options, - 'show_option_all' => false, - 'show_option_none' => false, - ) - ); - - return $output; - } - - /** - * Renders an HTML Dropdown of months - * - * @since 1.5.2 - * - * @param string $name Name attribute of the dropdown. - * @param int $selected Month to select automatically. - * @param string $id A unique identifier for the field. - * @param boolean $return_long_name Whether to use the long name for the month. - * - * @return string $output Month dropdown - */ - public function month_dropdown( $name = 'month', $selected = 0, $id = 'edd_month_select', $return_long_name = false ) { - $month = 1; - $options = array(); - $selected = empty( $selected ) ? date( 'n' ) : $selected; - - while ( $month <= 12 ) { - $options[ absint( $month ) ] = edd_month_num_to_name( $month, $return_long_name ); - $month ++; - } - - $output = $this->select( - array( - 'name' => $name, - 'id' => $id . '_' . $name, - 'selected' => $selected, - 'options' => $options, - 'show_option_all' => false, - 'show_option_none' => false, - ) - ); - - return $output; - } - - /** - * Gets the countries dropdown. - * - * @since 3.0 - * @param array $args The array of parameters passed to the method - * @param string $country The selected country - * @return string - */ - public function country_select( $args = array(), $country = '' ) { - $args = wp_parse_args( - $args, - array( - 'name' => 'edd_countries', - 'class' => 'edd_countries_filter', - 'options' => edd_get_country_list(), - 'chosen' => true, - 'selected' => $country, - 'show_option_none' => false, - 'placeholder' => __( 'Choose a Country', 'easy-digital-downloads' ), - 'show_option_all' => __( 'All Countries', 'easy-digital-downloads' ), - 'data' => array( - 'nonce' => wp_create_nonce( 'edd-country-field-nonce' ), - ), - 'required' => false, - ) - ); - - if ( false === strpos( $args['class'], 'edd_countries_filter' ) ) { - $args['class'] .= ' edd_countries_filter'; - } - - return $this->select( $args ); - } - - /** - * Gets the regions dropdown. - * - * @since 3.0 - * @param array $args The array of parameters passed to the method - * @param string $country The country from which to populate the regions - * @param string $region The selected region - * @return string - */ - public function region_select( $args = array(), $country = '', $region = '' ) { - if ( ! $country ) { - $country = edd_get_shop_country(); - } - $args = wp_parse_args( - $args, - array( - 'name' => 'edd_regions', - 'class' => 'edd_regions_filter', - 'options' => edd_get_shop_states( $country ), - 'chosen' => true, - 'selected' => $region, - 'show_option_none' => false, - 'placeholder' => __( 'Choose a Region', 'easy-digital-downloads' ), - 'show_option_all' => __( 'All Regions', 'easy-digital-downloads' ), - 'required' => false, - ) - ); - - if ( false === strpos( $args['class'], 'edd_regions_filter' ) ) { - $args['class'] .= ' edd_regions_filter'; - } - - return $this->select( $args ); - } - - /** - * Renders an HTML Dropdown - * - * @since 1.6 - * - * @param array $args - * - * @return string - */ - public function select( $args = array() ) { - - $args = wp_parse_args( $args, array( - 'options' => array(), - 'name' => null, - 'class' => '', - 'id' => '', - 'selected' => 0, - 'chosen' => false, - 'placeholder' => null, - 'multiple' => false, - 'show_option_all' => _x( 'All', 'all dropdown items', 'easy-digital-downloads' ), - 'show_option_none' => _x( 'None', 'no dropdown items', 'easy-digital-downloads' ), - 'data' => array(), - 'readonly' => false, - 'disabled' => false, - 'required' => false, - ) ); - - $data_elements = ''; - foreach ( $args['data'] as $key => $value ) { - $data_elements .= ' data-' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; - } - - if ( $args['multiple'] ) { - $multiple = ' MULTIPLE'; - } else { - $multiple = ''; - } - - if ( $args['chosen'] ) { - $args['class'] .= ' edd-select-chosen'; - if ( is_rtl() ) { - $args['class'] .= ' chosen-rtl'; - } - } - - if ( $args['placeholder'] ) { - $placeholder = $args['placeholder']; - } else { - $placeholder = ''; - } - - if ( isset( $args['readonly'] ) && $args['readonly'] ) { - $readonly = ' readonly="readonly"'; - } else { - $readonly = ''; - } - - if ( isset( $args['disabled'] ) && $args['disabled'] ) { - $disabled = ' disabled="disabled"'; - } else { - $disabled = ''; - } - - $required = ''; - if ( ! empty( $args['required'] ) ) { - $required = ' required'; - } - - $class = implode( ' ', array_map( 'esc_attr', explode( ' ', $args['class'] ) ) ); - $output = ''; - - if ( ! isset( $args['selected'] ) || ( is_array( $args['selected'] ) && empty( $args['selected'] ) ) || ! $args['selected'] ) { - $selected = ""; - } - - if ( ! empty( $args['show_option_all'] ) ) { - if ( $args['multiple'] && ! empty( $args['selected'] ) ) { - $selected = selected( true, in_array( 0, (array) $args['selected'] ), false ); - } elseif ( isset( $args['selected'] ) && ! is_array( $args['selected'] ) ) { - $selected = selected( $args['selected'], 0, false ); - } - $output .= ''; - } - - if ( ! empty( $args['options'] ) ) { - if ( $args['show_option_none'] ) { - if ( $args['multiple'] ) { - $selected = selected( true, in_array( - 1, $args['selected'] ), false ); - } elseif ( isset( $args['selected'] ) && ! is_array( $args['selected'] ) && ! empty( $args['selected'] ) ) { - $selected = selected( $args['selected'], - 1, false ); - } - $output .= ''; - } - - foreach ( $args['options'] as $key => $option ) { - if ( $args['multiple'] && is_array( $args['selected'] ) ) { - $selected = selected( true, in_array( (string) $key, $args['selected'] ), false ); - } elseif ( isset( $args['selected'] ) && ! is_array( $args['selected'] ) ) { - $selected = selected( $args['selected'], $key, false ); - } - - $output .= ''; - } - } - - $output .= ''; - - return $output; - } - - /** - * Renders an HTML Checkbox - * - * @since 1.9 - * @since 3.0 Added `label` argument. - * - * @param array $args - * - * @return string Checkbox HTML code - */ - public function checkbox( $args = array() ) { - $defaults = array( - 'name' => null, - 'current' => null, - 'class' => 'edd-checkbox', - 'options' => array( - 'disabled' => false, - 'readonly' => false, - ), - 'label' => '', - 'value' => null, - ); - - $args = wp_parse_args( $args, $defaults ); - - $classes = explode( ' ', $args['class'] ); - $classes[] = $args['name']; - $class = implode( ' ', array_map( 'sanitize_html_class', array_unique( array_filter( $classes ) ) ) ); - - $options = ''; - if ( ! empty( $args['options']['disabled'] ) ) { - $options .= ' disabled="disabled"'; - } elseif ( ! empty( $args['options']['readonly'] ) ) { - $options .= ' readonly'; - } - - $value = ''; - if ( ! empty( $args['value'] ) ) { - $value .= ' value="' . esc_attr( $args['value'] ) . '"'; - } - - // Checked could mean 'on' or 1 or true, so sanitize it for checked() - $to_check = ! empty( $args['current'] ); - $checked = checked( true, $to_check, false ); - - // Get the HTML to output - $output = ''; - - if ( ! empty( $args['label'] ) ) { - $output .= ''; - } - - return $output; - } - - /** - * Renders an HTML Text field - * - * @since 1.5.2 - * - * @param array $args Arguments for the text field - * - * @return string Text field - */ - public function text( $args = array() ) { - // Backwards compatibility - if ( func_num_args() > 1 ) { - $args = func_get_args(); - - $name = $args[0]; - $value = isset( $args[1] ) ? $args[1] : ''; - $label = isset( $args[2] ) ? $args[2] : ''; - $desc = isset( $args[3] ) ? $args[3] : ''; - } - - $defaults = array( - 'id' => '', - 'name' => isset( $name ) ? $name : 'text', - 'value' => isset( $value ) ? $value : null, - 'label' => isset( $label ) ? $label : null, - 'desc' => isset( $desc ) ? $desc : null, - 'placeholder' => '', - 'class' => 'regular-text', - 'disabled' => false, - 'autocomplete' => '', - 'data' => false, - 'required' => false, - ); - - $args = wp_parse_args( $args, $defaults ); - - $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) ); - $disabled = ''; - if ( $args['disabled'] ) { - $disabled = ' disabled="disabled"'; - } - - $required = ''; - if ( ! empty( $args['required'] ) ) { - $required = ' required'; - } - - $data = ''; - if ( ! empty( $args['data'] ) ) { - foreach ( $args['data'] as $key => $value ) { - $data .= 'data-' . edd_sanitize_key( $key ) . '="' . esc_attr( $value ) . '" '; - } - } - - $output = ''; - if ( ! empty( $args['label'] ) ) { - $output .= ''; - } - - if ( ! empty( $args['desc'] ) ) { - $output .= '' . esc_html( $args['desc'] ) . ''; - } - - $output .= ''; - - $output .= ''; - - return $output; - } - - /** - * Renders a date picker - * - * @since 2.4 - * - * @param array $args Arguments for the text field - * - * @return string Datepicker field - */ - public function date_field( $args = array() ) { - - if ( empty( $args['class'] ) ) { - $args['class'] = 'edd_datepicker'; - $args['data']['format'] = edd_get_date_picker_format(); - - } elseif ( ! strpos( $args['class'], 'edd_datepicker' ) ) { - $args['class'] .= ' edd_datepicker'; - $args['data']['format'] = edd_get_date_picker_format(); - } - - return $this->text( $args ); - } - - /** - * Renders an HTML textarea - * - * @since 1.9 - * - * @param array $args Arguments for the textarea - * - * @return string textarea - */ - public function textarea( $args = array() ) { - $defaults = array( - 'name' => 'textarea', - 'value' => null, - 'label' => null, - 'desc' => null, - 'class' => 'large-text', - 'disabled' => false, - ); - - $args = wp_parse_args( $args, $defaults ); - - $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) ); - $disabled = ''; - if ( $args['disabled'] ) { - $disabled = ' disabled="disabled"'; - } - - $output = ''; - - if ( ! empty( $args['label'] ) ) { - $output .= ''; - } - - $output .= ''; - - if ( ! empty( $args['desc'] ) ) { - $output .= '' . esc_html( $args['desc'] ) . ''; - } - - $output .= ''; - - return $output; - } - - /** - * Renders an ajax user search field - * - * @since 2.0 - * - * @param array $args - * - * @return string text field with ajax search - */ - public function ajax_user_search( $args = array() ) { - - // Parse args - $args = wp_parse_args( $args, array( - 'id' => 'user_id', - 'name' => 'user_id', - 'value' => null, - 'placeholder' => __( 'Enter Username', 'easy-digital-downloads' ), - 'label' => null, - 'desc' => null, - 'class' => 'edd-user-dropdown', - 'disabled' => false, - 'autocomplete' => 'off', - 'data' => false, - ) ); - - // Setup the AJAX class - $args['class'] = 'edd-ajax-user-search ' . sanitize_html_class( $args['class'] ); - - // Concatenate output - $output = ''; - $output .= $this->text( $args ); - $output .= ''; - $output .= ''; - $output .= ''; - - return $output; - } - - /** - * Show a required indicator on a field. - * - * @return string - */ - public function show_required() { - - $output = ''; - $output .= sprintf( '%s', __( 'Required', 'easy-digital-downloads' ) ); - - return $output; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-license-handler.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-license-handler.php deleted file mode 100644 index 450b8e40..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-license-handler.php +++ /dev/null @@ -1,523 +0,0 @@ -file = $_file; - $this->item_name = $_item_name; - - if ( is_numeric( $_item_id ) ) { - $this->item_id = absint( $_item_id ); - } - - $this->item_shortname = 'edd_' . preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $this->item_name ) ) ); - $this->version = $_version; - $this->edd_license = new License( $this->item_name, $_optname ); - if ( empty( $_api_url ) && ( empty( $this->edd_license->key ) || empty( $this->edd_license->license ) ) ) { - $pro_license = new License( 'pro' ); - if ( ! empty( $pro_license->key ) ) { - $this->is_pro_license = true; - $this->edd_license = $pro_license; - } - } - $this->license = $this->edd_license->key; - $this->author = $_author; - $this->api_handler = new API( $_api_url ); - $this->api_url = $_api_url; - $this->pass_manager = new \EDD\Admin\Pass_Manager(); - - // Setup hooks - $this->hooks(); - - /** - * Maintain an array of active, licensed plugins that have a license key entered. - * This is to help us more easily determine if the site has a license key entered - * at all. Initializing it this way helps us limit the data to activated plugins only. - * If we relied on the options table (`edd_%_license_active`) then we could accidentally - * be picking up plugins that have since been deactivated. - * - * @see \EDD\Admin\Promos\Notices\License_Upgrade_Notice::__construct() - */ - if ( is_null( $this->api_url ) ) { - global $edd_licensed_products; - if ( ! is_array( $edd_licensed_products ) ) { - $edd_licensed_products = array(); - } - $edd_licensed_products[ $this->item_shortname ] = (int) (bool) ( $this->license && empty( $this->edd_license->error ) ); - } - } - - /** - * Include the updater class - * - * @access private - * @return void - */ - private function includes() {} - - /** - * Setup hooks - * - * @access private - * @return void - */ - private function hooks() { - - // Register settings - add_filter( 'edd_settings_licenses', array( $this, 'settings' ) ); - - // Check that license is valid once per week - add_action( 'edd_weekly_scheduled_events', array( $this, 'weekly_license_check' ) ); - - // For testing license notices, uncomment this line to force checks on every page load - //add_action( 'admin_init', array( $this, 'weekly_license_check' ) ); - - // Updater - add_action( 'init', array( $this, 'auto_updater' ) ); - - // Display notices to admins - add_action( 'admin_notices', array( $this, 'notices' ) ); - - add_action( 'in_plugin_update_message-' . plugin_basename( $this->file ), array( $this, 'plugin_row_license_missing' ), 10, 2 ); - - // Register plugins for beta support - add_filter( 'edd_beta_enabled_extensions', array( $this, 'register_beta_support' ) ); - - // Add the EDD version to the API parameters. - add_filter( 'edd_sl_plugin_updater_api_params', array( $this, 'filter_sl_api_params' ), 10, 3 ); - - // Fix missing Stripe keys due to option name change. - add_action( 'admin_init', array( $this, 'fix_stripe_key' ) ); - } - - /** - * Auto updater - * - * @access private - * @return void - */ - public function auto_updater() { - - $doing_cron = defined( 'DOING_CRON' ) && DOING_CRON; - if ( ! current_user_can( 'manage_options' ) && ! $doing_cron ) { - return; - } - - $license = $this->license; - // Fall back to the highest license key if one is not saved for this extension or there isn't a pro license. - if ( empty( $license ) && empty( $this->api_url ) ) { - if ( $this->pass_manager->highest_license_key ) { - $license = $this->pass_manager->highest_license_key; - } - } - - // Don't check for updates if there isn't a license key. - if ( empty( $license ) ) { - return; - } - - $args = array( - 'version' => $this->version, - 'license' => $license, - 'author' => $this->author, - 'beta' => function_exists( 'edd_extension_has_beta_support' ) && edd_extension_has_beta_support( $this->item_shortname ), - ); - - if ( ! empty( $this->item_id ) ) { - $args['item_id'] = $this->item_id; - } else { - $args['item_name'] = $this->item_name; - } - - if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) { - require_once 'EDD_SL_Plugin_Updater.php'; - } - - // Setup the updater - new EDD_SL_Plugin_Updater( - is_null( $this->api_url ) ? $this->api_handler->get_url() : $this->api_url, - $this->file, - $args - ); - } - - /** - * Add license field to settings - * - * @param array $settings - * @return array - */ - public function settings( $settings ) { - return array_merge( $settings, array( - array( - 'id' => $this->item_shortname . '_license_key', - 'name' => $this->item_name, - 'desc' => '', - 'type' => 'license_key', - 'options' => array( - 'is_valid_license_option' => $this->item_shortname . '_license_active', - 'item_id' => $this->item_id, - 'api_url' => $this->api_url, - 'file' => $this->file, - ), - 'size' => 'regular', - ) - ) ); - } - - /** - * Check if license key is valid once per week - * - * @since 2.5 - * @return void - */ - public function weekly_license_check() { - - // If a pro license is active, that license check is handled separately. - if ( $this->is_pro_license && empty( $this->api_url ) ) { - return; - } - - // Don't fire when saving settings. - if ( ! empty( $_POST['edd_settings'] ) ) { - return; - } - - if ( empty( $this->license ) ) { - return; - } - - // data to send in our API request - $api_params = array( - 'edd_action' => 'check_license', - 'license' => $this->license, - 'item_name' => urlencode( $this->item_name ), - ); - - if ( ! empty( $this->item_id ) ) { - $api_params['item_id'] = $this->item_id; - } - - $license_data = $this->api_handler->make_request( $api_params ); - if ( ! $license_data ) { - return false; - } - - if ( empty( $this->api_url ) ) { - $this->pass_manager->maybe_set_pass_flag( $this->license, $license_data ); - } - $this->edd_license->save( $license_data ); - } - - /** - * Admin notices for errors - * - * @return void - */ - public function notices() { - if ( empty( $this->license ) ) { - return; - } - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - if ( ! empty( $_GET['tab'] ) && 'licenses' === $_GET['tab'] ) { - return; - } - - if ( ( empty( $this->edd_license->license ) || 'valid' !== $this->edd_license->license ) ) { - - EDD()->notices->add_notice( - array( - 'id' => 'edd-missing-license', - 'class' => "error {$this->item_shortname}-license-error", - 'message' => sprintf( - /* translators: 1. opening anchor tag; 2. closing anchor tag */ - __( 'You have invalid or expired license keys for Easy Digital Downloads. %1$sActivate License(s)%2$s', 'easy-digital-downloads' ), - '', - '' - ), - 'is_dismissible' => false, - ) - ); - } - } - - /** - * Displays message inline on plugin row that the license key is missing - * - * @since 2.5 - * @return void - */ - public function plugin_row_license_missing( $plugin_data, $version_info ) { - static $showed_imissing_key_message = array(); - - $license = $this->edd_license; - - if ( ( empty( $license->license ) || 'valid' !== $license->license ) && empty( $showed_imissing_key_message[ $this->item_shortname ] ) ) { - echo ' ' . __( 'Enter valid license key for automatic updates.', 'easy-digital-downloads' ) . ''; - $showed_imissing_key_message[ $this->item_shortname ] = true; - } - - } - - /** - * Adds this plugin to the beta page - * - * @param array $products - * @since 2.6.11 - * @return void - */ - public function register_beta_support( $products ) { - $products[ $this->item_shortname ] = $this->item_name; - - return $products; - } - - /** - * Adds the EDD version to the API parameters. - * - * @since 2.11 - * @param array $api_params The array of parameters sent in the API request. - * @param array $api_data The array of API data defined when instantiating the class. - * @param string $plugin_file The path to the plugin file. - * @return array - */ - public function filter_sl_api_params( $api_params, $api_data, $plugin_file ) { - - if ( $this->file === $plugin_file ) { - $api_params['easy-digital-downloads_version'] = defined( 'EDD_VERSION' ) ? EDD_VERSION : ''; - } - - return $api_params; - } - - /** - * If the original Stripe gateway key is set and the new one is not, - * update the license key to fix automatic updates. - * - * @since 3.0.4 - * @return void - */ - public function fix_stripe_key() { - $license_key = edd_get_option( 'edd_stripe_pro_payment_gateway_license_key' ); - if ( $license_key ) { - return; - } - $old_key = edd_get_option( 'edd_stripe_payment_gateway_license_key' ); - if ( $old_key ) { - edd_update_option( 'edd_stripe_pro_payment_gateway_license_key', sanitize_text_field( $old_key ) ); - edd_delete_option( 'edd_stripe_payment_gateway_license_key' ); - } - - $old_license_status = get_option( 'edd_stripe_payment_gateway_license_key_active' ); - if ( $old_license_status ) { - update_option( 'edd_stripe_pro_payment_gateway_license_key_active', santize_text_field( $old_license_status ) ); - delete_option( 'edd_stripe_payment_gateway_license_key_active' ); - } - } - - /** - * Activate the license key. - * - * @deprecated 3.1.1 - * @return void - */ - public function activate_license() { - - if ( ! isset( $_POST['edd_settings'] ) ) { - return; - } - - if ( ! isset( $_REQUEST[ $this->item_shortname . '_license_key-nonce'] ) || ! wp_verify_nonce( $_REQUEST[ $this->item_shortname . '_license_key-nonce'], $this->item_shortname . '_license_key-nonce' ) ) { - return; - } - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - if ( empty( $_POST['edd_settings'][ $this->item_shortname . '_license_key'] ) ) { - delete_option( $this->item_shortname . '_license_active' ); - return; - } - - foreach ( $_POST as $key => $value ) { - if ( false !== strpos( $key, 'license_key_deactivate' ) ) { - // Don't activate a key when deactivating a different key - return; - } - } - - if ( 'valid' === $this->edd_license->license ) { - return; - } - - $license = sanitize_text_field( $_POST['edd_settings'][ $this->item_shortname . '_license_key' ] ); - - if ( empty( $license ) ) { - return; - } - - // Data to send to the API - $api_params = array( - 'edd_action' => 'activate_license', - 'license' => $license, - 'item_name' => urlencode( $this->item_name ), - 'url' => home_url() - ); - - if ( ! empty( $this->item_id ) ) { - $api_params['item_id'] = $this->item_id; - } - - // Call the API - $license_data = $this->api_handler->make_request( $api_params ); - - // Make sure there are no errors - if ( ! $license_data ) { - return; - } - - // Tell WordPress to look for updates - set_site_transient( 'update_plugins', null ); - - $this->pass_manager->maybe_set_pass_flag( $license, $license_data ); - - // Clear the option for licensed extensions to force regeneration. - if ( ! empty( $license_data->license ) && 'valid' === $license_data->license ) { - delete_option( 'edd_licensed_extensions' ); - } - - $this->edd_license->save( $license_data ); - } - - /** - * Deactivate the license key - * - * @deprecated 3.1.1 - * @return void - */ - public function deactivate_license() { - - if ( ! isset( $_POST['edd_settings'] ) ) { - return; - } - - if ( ! isset( $_POST['edd_settings'][ $this->item_shortname . '_license_key'] ) ) { - return; - } - - if ( ! wp_verify_nonce( $_REQUEST[ $this->item_shortname . '_license_key-nonce'], $this->item_shortname . '_license_key-nonce' ) ) { - wp_die( __( 'Nonce verification failed', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - // Run on deactivate button press - if ( isset( $_POST[ $this->item_shortname . '_license_key_deactivate'] ) ) { - - // Data to send to the API - $api_params = array( - 'edd_action' => 'deactivate_license', - 'license' => $this->license, - 'item_name' => urlencode( $this->item_name ), - 'url' => home_url() - ); - - if ( ! empty( $this->item_id ) ) { - $api_params['item_id'] = $this->item_id; - } - - // Call the API - $response = $this->api_handler->make_request( $api_params ); - - // Make sure there are no errors - if ( ! $response ) { - return; - } - - $this->pass_manager->maybe_remove_pass_flag( $this->license ); - - delete_option( $this->item_shortname . '_license_active' ); - } - } - - /** - * Display help text at the top of the Licenses tag - * - * @since 2.5 - * @deprecated 3.1.1.4 - * @param string $active_tab - * @return void - */ - public function license_help_text( $active_tab = '' ) {} -} - -endif; // end class_exists check diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-logging.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-logging.php deleted file mode 100644 index 522a5009..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-logging.php +++ /dev/null @@ -1,857 +0,0 @@ -log_types() ); - } - - /** - * Create new log entry - * - * This is just a simple and fast way to log something. Use $this->insert_log() - * if you need to store custom meta data - * - * @since 1.3.1 - * - * @param string $title Log entry title. - * @param string $message Log entry message. - * @param int $parent Download ID. - * @param string $type Log type (default: null). - * - * @return int ID of the newly created log item. - */ - public function add( $title = '', $message = '', $parent = 0, $type = null ) { - return $this->insert_log( array( - 'post_title' => $title, - 'post_content' => $message, - 'post_parent' => $parent, - 'log_type' => $type - ) ); - } - - /** - * Easily retrieves log items for a particular object ID. - * - * @since 1.3.1 - * - * @param int $object_id Object ID (default: 0). - * @param string $type Log type (default: null). - * @param int $paged Page number (default: null). - * - * @return array Array of the connected logs. - */ - public function get_logs( $object_id = 0, $type = null, $paged = null ) { - return $this->get_connected_logs( array( - 'post_parent' => $object_id, - 'paged' => $paged, - 'log_type' => $type - ) ); - } - - /** - * Stores a log entry. - * - * @since 1.3.1 - * @since 3.0 Updated to use the new database classes as part of the migration to custom tables. - * - * @param array $log_data Log entry data. - * @param array $log_meta Log entry meta. - * @return int The ID of the newly created log item. - */ - public function insert_log( $log_data = array(), $log_meta = array() ) { - - // Parse args - $args = wp_parse_args( $log_data, array( - 'post_type' => 'edd_log', - 'post_status' => 'publish', - 'post_parent' => 0, - 'post_content' => '', - 'log_type' => false, - ) ); - - /** - * Triggers just before a log is inserted. - * - * @param array $args Log entry data. - * @param array $log_meta Log meta data. - */ - do_action( 'edd_pre_insert_log', $args, $log_meta ); - - // Used to dynamically dispatch the method call to insert() to the correct class. - $insert_method = 'edd_add_log'; - - // Set up variables to hold data to go into the logs table by default. - $data = array( - 'content' => $args['post_content'], - 'object_id' => isset( $args['post_parent'] ) - ? $args['post_parent'] - : 0, - 'object_type' => isset( $args['log_type'] ) - ? $args['log_type'] - : null, - /* - * Fallback user ID is the current user, due to it previously being set to that by WordPress - * core when setting post_author on the CPT. - */ - 'user_id' => ! empty( $log_meta['user'] ) ? $log_meta['user'] : get_current_user_id() - ); - - $type = $args['log_type']; - if ( ! empty( $type ) ) { - $data['type'] = $type; - } - - if ( array_key_exists( 'post_title', $args ) ) { - $data['title'] = $args['post_title']; - } - - $meta_to_unset = array( 'user' ); - - // Override $data and $insert_method based on the log type. - if ( 'api_request' === $args['log_type'] ) { - $insert_method = 'edd_add_api_request_log'; - - $data = array( - 'user_id' => ! empty( $log_meta['user'] ) ? $log_meta['user'] : 0, - 'api_key' => ! empty( $log_meta['key'] ) ? $log_meta['key'] : 'public', - 'token' => ! empty( $log_meta['token'] ) ? $log_meta['token'] : 'public', - 'version' => ! empty( $log_meta['version'] ) ? $log_meta['version'] : '', - 'request' => ! empty( $args['post_excerpt'] ) ? $args['post_excerpt'] : '', - 'error' => ! empty( $args['post_content'] ) ? $args['post_content'] : '', - 'ip' => ! empty( $log_meta['request_ip'] ) ? $log_meta['request_ip'] : '', - 'time' => ! empty( $log_meta['time'] ) ? $log_meta['time'] : '', - ); - - $meta_to_unset = array( 'user', 'key', 'token', 'version', 'request_ip', 'time' ); - } elseif ( 'file_download' === $args['log_type'] ) { - $insert_method = 'edd_add_file_download_log'; - - if ( ! class_exists( 'Browser' ) ) { - require_once EDD_PLUGIN_DIR . 'includes/libraries/browser.php'; - } - - $browser = new Browser(); - - $user_agent = $browser->getBrowser() . ' ' . $browser->getVersion() . '/' . $browser->getPlatform(); - - $data = array( - 'product_id' => $args['post_parent'], - 'file_id' => ! empty( $log_meta['file_id'] ) ? $log_meta['file_id'] : 0, - 'order_id' => ! empty( $log_meta['payment_id'] ) ? $log_meta['payment_id'] : 0, - 'price_id' => ! empty( $log_meta['price_id'] ) ? $log_meta['price_id'] : 0, - 'customer_id' => ! empty( $log_meta['customer_id'] ) ? $log_meta['customer_id'] : 0, - 'ip' => ! empty( $log_meta['ip'] ) ? $log_meta['ip'] : '', - 'user_agent' => $user_agent, - ); - - $meta_to_unset = array( 'file_id', 'payment_id', 'price_id', 'customer_id', 'ip', 'user_id' ); - } - - // Now unset the meta we've used up in the main data array. - foreach ( $meta_to_unset as $meta_key ) { - unset( $log_meta[ $meta_key ] ); - } - - // Get the log ID if method is callable - $log_id = is_callable( $insert_method ) - ? call_user_func( $insert_method, $data ) - : false; - - // Set log meta, if any - if ( $log_id && ! empty( $log_meta ) ) { - - // Use the right log fetching function based on the type of log this is. - if ( 'edd_add_api_request_log' === $insert_method ) { - $add_meta_function = 'edd_add_api_request_log_meta'; - } elseif ( 'edd_add_file_download_log' === $insert_method ) { - $add_meta_function = 'edd_add_file_download_log_meta'; - } else { - $add_meta_function = 'edd_add_log_meta'; - } - - if ( is_callable( $add_meta_function ) ) { - foreach ( (array) $log_meta as $key => $meta ) { - $add_meta_function( $log_id, sanitize_key( $key ), $meta ); - } - } - } - - /** - * Triggers after a log has been inserted. - * - * @param int $log_id ID of the new log. - * @param array $args Log data. - * @param array $log_meta Log meta data. - */ - do_action( 'edd_post_insert_log', $log_id, $args, $log_meta ); - - return $log_id; - } - - /** - * Update and existing log item - * - * @since 1.3.1 - * @since 3.0 - Added $log_id parameter and boolean return type. - * - * @param array $log_data Log entry data. - * @param array $log_meta Log entry meta. - * @param int $log_id Log ID. - * @return bool True on success, false otherwise. - */ - public function update_log( $log_data = array(), $log_meta = array(), $log_id = 0 ) { - // $log_id is at the end because it was introduced in 3.0 - do_action( 'edd_pre_update_log', $log_data, $log_meta, $log_id ); - - $defaults = array( - 'post_content' => '', - 'post_title' => '', - 'object_id' => 0, - 'object_type' => '', - ); - - $args = wp_parse_args( $log_data, $defaults ); - - if ( isset( $args['ID'] ) && empty( $log_id ) ) { - $log_id = $args['ID']; - } - - // Bail if the log ID is still empty. - if ( empty( $log_id ) ) { - return false; - } - - // Used to dynamically dispatch the method call to insert() to the correct class. - $update_method = 'edd_update_log'; - $update_meta_function = 'edd_update_log_meta'; - - $type = $args['log_type']; - if ( ! empty( $type ) ) { - $data['type'] = $args['log_type']; - } - - $data = array( - 'object_id' => $args['object_id'], - 'object_type' => $args['object_type'], - 'title' => $args['title'], - 'message' => $args['message'], - ); - - if ( 'api_request' === $data['type'] ) { - $update_meta_function = 'edd_update_api_request_log_meta'; - $legacy = array( - 'user' => 'user_id', - 'key' => 'api_key', - 'token' => 'token', - 'version' => 'version', - 'post_excerpt' => 'request', - 'post_content' => 'error', - 'request_ip' => 'ip', - 'time' => 'time', - ); - - foreach ( $legacy as $old_key => $new_key ) { - if ( isset( $log_meta[ $old_key ] ) ) { - $data[ $new_key ] = $log_meta[ $old_key ]; - - unset( $log_meta[ $old_key ] ); - } - } - } elseif ( 'file_download' === $data['type'] ) { - $update_meta_function = 'edd_update_file_download_log_meta'; - $legacy = array( - 'file_id' => 'file_id', - 'payment_id' => 'payment_id', - 'price_id' => 'price_id', - 'user_id' => 'user_id', - 'ip' => 'ip', - ); - - foreach ( $legacy as $old_key => $new_key ) { - if ( isset( $log_meta[ $old_key ] ) ) { - $data[ $new_key ] = $log_meta[ $old_key ]; - - unset( $log_meta[ $old_key ] ); - } - } - - if ( isset( $args['post_parent'] ) ) { - $data['download_id'] = $args['post_parent']; - } - } - - unset( $data['type'] ); - - // Bail if not callable - if ( ! is_callable( $update_method ) ) { - return false; - } - - call_user_func( $update_method, $data ); - - // Set log meta, if any - if ( is_callable( $update_meta_function ) ) { - if ( 'edd_update_log' === $update_method && ! empty( $log_meta ) ) { - foreach ( (array) $log_meta as $key => $meta ) { - $update_meta_function( $log_id, sanitize_key( $key ), $meta ); - } - } - } - - do_action( 'edd_post_update_log', $log_id, $log_data, $log_meta ); - } - - /** - * Retrieve all connected logs. - * - * Used for retrieving logs related to particular items, such as a specific purchase. - * - * @access public - * @since 1.3.1 - * - * @param array $args Query arguments. - * @return mixed array Logs fetched, false otherwise. - */ - public function get_connected_logs( $args = array() ) { - - $log_type = isset( $args['log_type'] ) - ? $args['log_type'] - : false; - - // Parse arguments - $r = $this->parse_args( $args ); - - // Used to dynamically dispatch the call to the correct class. - $log_type = $this->get_log_table( $log_type ); - $func = "edd_get_{$log_type}"; - $logs = is_callable( $func ) - ? call_user_func( $func, $r ) - : false; - - // Return the logs (or false) - return $logs; - } - - /** - * Retrieves number of log entries connected to particular object ID. - * - * @since 1.3.1 - * @since 1.9 - Added date query support. - * - * @param int $object_id Object ID (default: 0). - * @param string $type Log type (default: null). - * @param array $meta_query Log meta query (default: null). - * @param array $date_query Log date query (default: null) [since 1.9]. - * - * @return int Log count. - */ - public function get_log_count( $object_id = 0, $type = null, $meta_query = null, $date_query = null ) { - $r = array( - $this->get_object_id_column_name_for_type( $type ) => $object_id, - ); - - if ( ! empty( $type ) && $this->valid_type( $type ) ) { - $r['type'] = $type; - } - - if ( ! empty( $meta_query ) ) { - $r['meta_query'] = $meta_query; - } - - if ( ! empty( $date_query ) ) { - $r['date_query'] = $date_query; - } - - // Used to dynamically dispatch the call to the correct class. - $log_type = $this->get_log_table( $type ); - - // Call the func, or not - $func = "edd_count_{$log_type}"; - $count = is_callable( $func ) - ? call_user_func( $func, $r ) - : 0; - - return $count; - } - - /** - * Delete logs based on parameters passed. - * - * @since 1.3.1 - * - * @param int $object_id Object ID (default: 0). - * @param string $type Log type (default: null). - * @param array $meta_query Log meta query (default: null). - */ - public function delete_logs( $object_id = 0, $type = null, $meta_query = null ) { - $r = array( - $this->get_object_id_column_name_for_type( $type ) => $object_id, - ); - - if ( ! empty( $type ) && $this->valid_type( $type ) ) { - $r['type'] = $type; - } - - if ( ! empty( $meta_query ) ) { - $r['meta_query'] = $meta_query; - } - - // Used to dynamically dispatch the call to the correct class. - $log_type = $this->get_log_table( $type ); - - // Call the func, or not. - $func = "edd_get_{$log_type}"; - $logs = is_callable( $func ) - ? call_user_func( $func, $r ) - : array(); - - // Bail if no logs. - if ( empty( $logs ) ) { - return; - } - - // Maybe bail if delete function does not exist. - $func = rtrim( "edd_delete_{$log_type}", 's' ); - if ( ! is_callable( $func ) ) { - return; - } - - // Loop through and delete logs. - foreach ( $logs as $log ) { - call_user_func( $func, $log->id ); - } - } - - /** - * Get the new log type from the old type. - * - * @since 3.0 - * - * @param string $type - * - * @return string - */ - private function get_log_table( $type = '' ) { - $retval = 'logs'; - - if ( 'api_request' === $type ) { - $retval = 'api_request_logs'; - } elseif ( 'file_download' === $type ) { - $retval = 'file_download_logs'; - } - - return $retval; - } - - /** - * Parse arguments. Contains back-compat argument aliasing. - * - * @since 3.0 - * - * @param array $args - * @return array - */ - private function parse_args( $args = array() ) { - - // Parse args - $r = wp_parse_args( $args, array( - 'log_type' => false, - 'post_type' => 'edd_log', - 'post_status' => 'publish', - 'post_parent' => 0, - 'posts_per_page' => 20, - 'paged' => get_query_var( 'paged' ), - 'orderby' => 'id', - ) ); - - // Back-compat for ID ordering - if ( 'ID' === $r['orderby'] ) { - $r['orderby'] = 'id'; - } - - // Back-compat for log_type - if ( ! empty( $r['log_type'] ) ) { - $r['type'] = $r['log_type']; - } - - // Back-compat for post_parent. - if ( ! empty( $r['post_parent'] ) ) { - $type = ! empty( $r['log_type'] ) ? $r['log_type'] : ''; - $r[ $this->get_object_id_column_name_for_type( $type ) ] = $r['post_parent']; - } - - // Back compat for posts_per_page - $r['number'] = $r['posts_per_page']; - - // Unset old keys - unset( - $r['posts_per_page'], - $r['post_parent'], - $r['post_status'], - $r['post_type'], - $r['log_type'] - ); - - if ( ! isset( $r['offset'] ) ) { - $r['offset'] = $r['paged'] > 1 - ? ( ( $r['paged'] - 1 ) * $r['number'] ) - : 0; - unset( $r['paged'] ); - } - - // Return parsed args - return $r; - } - - /** - * Gets the object ID column name based on the log type. - * - * @since 3.1 - * @param string $type The log type. - * @return string The column name to query for the object ID. - */ - private function get_object_id_column_name_for_type( $type = '' ) { - - switch ( $type ) { - case 'file_download': - $object_id = 'product_id'; - break; - - case 'api_request': - $object_id = 'user_id'; - break; - - default: - $object_id = 'object_id'; - break; - } - - return $object_id; - } - - /** File System ***********************************************************/ - - /** - * Sets up the log file if it is writable - * - * @since 2.8.7 - * @return void - */ - public function setup_log_file() { - $this->init_fs(); - - $upload_dir = wp_upload_dir(); - $this->filename = wp_hash( home_url( '/' ) ) . '-edd-debug.log'; - $this->file = trailingslashit( $upload_dir['basedir'] ) . $this->filename; - - if ( ! $this->get_fs()->is_writable( $upload_dir['basedir'] ) ) { - $this->is_writable = false; - } - } - - /** - * Initialize the WordPress file system - * - * @since 3.0 - * - * @global WP_Filesystem_Base $wp_filesystem - */ - private function init_fs() { - global $wp_filesystem; - - if ( ! empty( $wp_filesystem ) ) { - return; - } - - // Include the file-system - require_once ABSPATH . 'wp-admin/includes/file.php'; - - // Initialize the file system - WP_Filesystem(); - } - - /** - * Get the WordPress file-system - * - * @since 3.0 - * - * @return WP_Filesystem_Base - */ - private function get_fs() { - return ! empty( $GLOBALS['wp_filesystem'] ) - ? $GLOBALS['wp_filesystem'] - : false; - } - - /** - * Log message to file. - * - * @access public - * @since 2.8.7 - * - * @param string $message Message to insert in the log. - */ - public function log_to_file( $message = '' ) { - $message = date( 'Y-n-d H:i:s' ) . ' - ' . $message . "\r\n"; - $this->write_to_log( $message ); - } - - /** - * Return the location of the log file that EDD_Logging will use. - * - * @since 2.9.1 - * - * @return string - */ - public function get_log_file_path() { - return $this->file; - } - - /** - * Retrieve the log data. - * - * @access public - * @since 2.8.7 - * - * @return string Log data. - */ - public function get_file_contents() { - return $this->get_file(); - } - - /** - * Retrieve the file data is written to - * - * @access protected - * @since 2.8.7 - * - * @return string File data. - */ - protected function get_file() { - $file = ''; - - if ( $this->get_fs()->exists( $this->file ) ) { - if ( ! $this->get_fs()->is_writable( $this->file ) ) { - $this->is_writable = false; - } - - $file = $this->get_fs()->get_contents( $this->file ); - } else { - $this->get_fs()->put_contents( $this->file, '' ); - $this->get_fs()->chmod( $this->file, 0664 ); - } - - return $file; - } - - /** - * Write the log message. - * - * @access protected - * @since 2.8.7 - */ - protected function write_to_log( $message = '' ) { - file_put_contents( $this->file, $message, FILE_APPEND ); - } - - /** - * Delete the log file or removes all contents in the log file if we cannot delete it. - * - * @access public - * @since 2.8.7 - * - * @return bool True if the log was cleared, false otherwise. - */ - public function clear_log_file() { - $this->get_fs()->delete( $this->file ); - - if ( $this->get_fs()->exists( $this->file ) ) { - - // It's still there, so maybe server doesn't have delete rights - $this->get_fs()->chmod( $this->file, 0664 ); - $this->get_fs()->delete( $this->file ); - - // See if it's still there... - if ( $this->get_fs()->exists( $this->file ) ) { - $this->get_fs()->put_contents( $this->file, '' ); - } - } - - $this->file = ''; - return true; - } - - /** Deprecated ************************************************************/ - - /** - * Registers the edd_log post type. - * - * @since 1.3.1 - * @deprecated 3.0 Due to migration to custom tables. - */ - public function register_post_type() { - _edd_deprecated_function( __FUNCTION__, '3.0.0' ); - } - - /** - * Register the log type taxonomy. - * - * @since 1.3.1 - * @deprecated 3.0 Due to migration to custom tables. - */ - public function register_taxonomy() { - _edd_deprecated_function( __FUNCTION__, '3.0.0' ); - } -} - -/** - * Helper method to insert a new log into the database. - * - * @since 1.3.3 - * - * @see EDD_Logging::add() - * - * @param string $title Log title. - * @param string $message Log message. - * @param int $parent Download ID. - * @param null $type Log type. - * - * @return int ID of the new log. - */ -function edd_record_log( $title = '', $message = '', $parent = 0, $type = null ) { - $edd_logs = EDD()->debug_log; - - return $edd_logs->add( $title, $message, $parent, $type ); -} - -/** - * Logs a message to the debug log file. - * - * @since 2.8.7 - * @since 2.9.4 Added the 'force' option. - * - * @param string $message Log message. - * @param bool $force Whether to force a log entry to be added. Default false. - */ -function edd_debug_log( $message = '', $force = false ) { - $edd_logs = EDD()->debug_log; - - if ( edd_is_debug_mode() || $force ) { - - if ( function_exists( 'mb_convert_encoding' ) ) { - - $message = mb_convert_encoding( $message, 'UTF-8' ); - - } - - $edd_logs->log_to_file( $message ); - } -} - -/** - * Logs an exception to the debug log file. - * - * @since 3.0 - * - * @param \Exception $exception Exception object. - */ -function edd_debug_log_exception( $exception ) { - - $label = get_class( $exception ); - - if ( $exception->getCode() ) { - - $message = sprintf( '%1$s: %2$s - %3$s', - $label, - $exception->getCode(), - $exception->getMessage() - ); - - } else { - - $message = sprintf( '%1$s: %2$s', - $label, - $exception->getMessage() - ); - - } - - edd_debug_log( $message ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-register-meta.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-register-meta.php deleted file mode 100644 index 1e473357..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-register-meta.php +++ /dev/null @@ -1,472 +0,0 @@ -hooks(); - } - - /** - * Get the one true instance of EDD_Register_Meta. - * - * @since 2.5 - * @return $instance - */ - static public function instance() { - - if ( !self::$instance ) { - self::$instance = new EDD_Register_Meta(); - } - - return self::$instance; - - } - - /** - * Register the hooks to kick off meta registration. - * - * @since 2.5 - * @return void - */ - private function hooks() { - add_action( 'init', array( $this, 'register_download_meta' ) ); - add_action( 'init', array( $this, 'register_payment_meta' ) ); - } - - /** - * Register the meta for the download post type. - * - * @since 2.5 - * @return void - */ - public function register_download_meta() { - register_meta( - 'post', - '_edd_download_earnings', - array( - 'object_subtype' => 'download', - 'sanitize_callback' => 'edd_sanitize_amount', - 'type' => 'float', - 'description' => __( 'The total earnings for the specified product', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_download_sales', - array( - 'object_subtype' => 'download', - 'sanitize_callback' => array( $this, 'intval_wrapper' ), - 'type' => 'float', - 'description' => __( 'The number of sales for the specified product.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - 'edd_price', - array( - 'object_subtype' => 'download', - 'sanitize_callback' => array( $this, 'sanitize_price' ), - 'type' => 'float', - 'description' => __( 'The price of the product.', 'easy-digital-downloads' ), - 'show_in_rest' => true, - ) - ); - - /** - * Even though this is an array, we're using 'object' as the type here. Since the variable pricing can be either - * 1 or 0 based for the array keys, we use the additional properties to avoid WP Core resetting the variable price IDs - */ - register_meta( - 'post', - 'edd_variable_prices', - array( - 'object_subtype' => 'download', - 'sanitize_callback' => array( $this, 'sanitize_variable_prices' ), - 'single' => true, - 'type' => 'object', - 'description' => __( 'An array of variable prices for the product.', 'easy-digital-downloads' ), - 'show_in_rest' => array( - 'schema' => array( - 'type' => 'object', - 'properties' => array(), - 'additionalProperties' => array( - 'type' => 'object', - 'properties' => array( - 'index' => array( - 'type' => 'integer', - ), - 'name' => array( - 'type' => 'string', - ), - 'amount' => array( - 'type' => 'number', - ), - ), - 'additionalProperties' => true, - ), - ), - ), - ) - ); - - register_meta( - 'post', - 'edd_download_files', - array( - 'object_subtype' => 'download', - 'sanitize_callback' => array( $this, 'sanitize_files' ), - 'type' => 'array', - 'description' => __( 'The files associated with the product, available for download.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_bundled_products', - array( - 'object_subtype' => 'download', - 'sanitize_callback' => array( $this, 'sanitize_array' ), - 'single' => true, - 'type' => 'array', - 'description' => __( 'An array of product IDs to associate with a bundle.', 'easy-digital-downloads' ), - 'show_in_rest' => array( - 'schema' => array( - 'type' => 'array', - 'items' => array( - 'type' => 'string', - ) - ) - ), - ) - ); - - register_meta( - 'post', - '_edd_button_behavior', - array( - 'object_subtype' => 'download', - 'sanitize_callback' => 'sanitize_text_field', - 'type' => 'string', - 'description' => __( "Defines how this product's 'Purchase' button should behave, either add to cart or buy now", 'easy-digital-downloads' ), - 'show_in_rest' => true, - ) - ); - - register_meta( - 'post', - '_edd_default_price_id', - array( - 'object_subtype' => 'download', - 'sanitize_callback' => array( $this, 'intval_wrapper' ), - 'type' => 'int', - 'description' => __( 'When variable pricing is enabled, this value defines which option should be chosen by default.', 'easy-digital-downloads' ), - 'show_in_rest' => true, - ) - ); - } - - /** - * Register the meta for the edd_payment post type. - * - * @since 2.5 - * @return void - */ - public function register_payment_meta() { - - register_meta( - 'post', - '_edd_payment_user_email', - array( - 'object_subtype' => 'edd_payment', - 'sanitize_callback' => 'sanitize_email', - 'type' => 'string', - 'description' => __( 'The email address associated with the purchase.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_payment_customer_id', - array( - 'object_subtype' => 'edd_payment', - 'sanitize_callback' => array( $this, 'intval_wrapper' ), - 'type' => 'int', - 'description' => __( 'The Customer ID associated with the payment.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_payment_user_id', - array( - 'object_subtype' => 'edd_payment', - 'sanitize_callback' => array( $this, 'intval_wrapper' ), - 'type' => 'int', - 'description' => __( 'The User ID associated with the payment.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_payment_user_ip', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'type' => 'string', - 'description' => __( 'The IP address the payment was made from.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_payment_purchase_key', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'type' => 'string', - 'description' => __( 'The unique purchase key for this payment.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_payment_total', - array( - 'sanitize_callback' => 'edd_sanitize_amount', - 'type' => 'float', - 'description' => __( 'The purchase total for this payment.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_payment_mode', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'type' => 'string', - 'description' => __( 'Identifies if the purchase was made in Test or Live mode.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_payment_gateway', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'type' => 'string', - 'description' => __( 'The registered gateway that was used to process this payment.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_payment_meta', - array( - 'sanitize_callback' => array( $this, 'sanitize_array' ), - 'type' => 'array', - 'description' => __( 'Array of payment meta that contains cart details, downloads, amounts, taxes, discounts, and subtotals, etc.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_payment_tax', - array( - 'sanitize_callback' => 'edd_sanitize_amount', - 'type' => 'float', - 'description' => __( 'The total amount of tax paid for this payment.', 'easy-digital-downloads' ), - ) - ); - - register_meta( - 'post', - '_edd_completed_date', - array( - 'sanitize_callback' => 'sanitize_text_field', - 'type' => 'string', - 'description' => __( 'The date this payment was changed to the `completed` status.', 'easy-digital-downloads' ), - ) - ); - } - - /** - * Wrapper for intval - * Setting intval as the callback was stating an improper number of arguments, this avoids that. - * - * @since 2.5 - * @param int $value The value to sanitize. - * @return int The value sanitiezed to be an int. - */ - public function intval_wrapper( $value ) { - return intval( $value ); - } - - /** - * Sanitize values that come in as arrays - * - * @since 2.5 - * @param array $value The value passed into the meta. - * @return array The sanitized value. - */ - public function sanitize_array( $value = array() ) { - - if ( ! is_array( $value ) ) { - - if ( is_object( $value ) ) { - $value = (array) $value; - } - - if ( is_serialized( $value ) ) { - - preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $value, $matches ); - if ( ! empty( $matches ) ) { - return false; - } - - $value = (array) maybe_unserialize( $value ); - - } - - } - - return $value; - } - - /** - * Perform some sanitization on the amount field including not allowing negative values by default - * - * @since 2.6.5 - * @param float $price The price to sanitize - * @return float A sanitized price - */ - public function sanitize_price( $price ) { - - $allow_negative_prices = apply_filters( 'edd_allow_negative_prices', false ); - - if ( ! $allow_negative_prices && $price < 0 ) { - $price = 0; - } - - return edd_sanitize_amount( $price ); - } - - /** - * Sanitize the variable prices - * - * Ensures prices are correctly mapped to an array starting with an index of 0 - * - * @since 2.5 - * @param array $prices Variable prices - * @return array $prices Array of the remapped variable prices - */ - public function sanitize_variable_prices( $prices = array() ) { - $prices = $this->remove_blank_rows( $prices ); - - if ( ! is_array( $prices ) ) { - return array(); - } - - foreach ( $prices as $id => $price ) { - - if ( empty( $price['amount'] ) && empty( $price['name'] ) ) { - - unset( $prices[ $id ] ); - continue; - - } elseif ( empty( $price['amount'] ) ) { - - $price['amount'] = 0; - - } - - $prices[ $id ]['amount'] = $this->sanitize_price( $price['amount'] ); - - } - - return $prices; - } - - /** - * Sanitize the file downloads - * - * Ensures files are correctly mapped to an array starting with an index of 0 - * - * @since 2.5 - * @param array $files Array of all the file downloads - * @return array $files Array of the remapped file downloads - */ - function sanitize_files( $files = array() ) { - $files = $this->remove_blank_rows( $files ); - - // Files should always be in array format, even when there are none. - if ( ! is_array( $files ) ) { - $files = array(); - } - - // Clean up filenames to ensure whitespaces are stripped - foreach( $files as $id => $file ) { - - if( ! empty( $files[ $id ]['file'] ) ) { - $files[ $id ]['file'] = trim( $file['file'] ); - } - - if( ! empty( $files[ $id ]['name'] ) ) { - $files[ $id ]['name'] = sanitize_text_field( $file['name'] ); - } - } - - // Make sure all files are rekeyed starting at 0 - return $files; - } - - /** - * Don't save blank rows. - * - * When saving, check the price and file table for blank rows. - * If the name of the price or file is empty, that row should not - * be saved. - * - * @since 2.5 - * @param array $new Array of all the meta values - * @return array $new New meta value with empty keys removed - */ - private function remove_blank_rows( $new ) { - - if ( is_array( $new ) ) { - foreach ( $new as $key => $value ) { - if ( empty( $value['name'] ) && empty( $value['amount'] ) && empty( $value['file'] ) ) { - unset( $new[ $key ] ); - } - } - } - - return $new; - } - -} -EDD_Register_Meta::instance(); diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-requirements-check.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-requirements-check.php deleted file mode 100644 index f238b4a8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-requirements-check.php +++ /dev/null @@ -1,508 +0,0 @@ - array( - 'minimum' => '7.1', - 'name' => 'PHP', - 'exists' => true, - 'current' => false, - 'checked' => false, - 'met' => false, - ), - - // WordPress - 'wp' => array( - 'minimum' => '5.4', - 'name' => 'WordPress', - 'exists' => true, - 'current' => false, - 'checked' => false, - 'met' => false, - ), - ); - - /** - * Setup plugin requirements - * - * @since 3.0 - */ - public function __construct() { - - // Setup file & base - $this->file = EDD_PLUGIN_FILE; - $this->base = EDD_PLUGIN_BASE; - - // Load or quit - $this->met() - ? $this->load() - : $this->quit(); - } - - /** - * Quit without loading - * - * @since 3.0 - */ - private function quit() { - add_action( 'admin_head', array( $this, 'admin_head' ) ); - add_filter( "plugin_action_links_{$this->base}", array( $this, 'plugin_row_links' ) ); - add_action( "after_plugin_row_{$this->base}", array( $this, 'plugin_row_notice' ) ); - } - - /** Specific Methods ******************************************************/ - - /** - * Load normally - * - * @since 3.0 - */ - private function load() { - - require_once dirname( $this->file ) . '/vendor/autoload.php'; - - // Maybe include the bundled bootstrapper - if ( ! class_exists( 'Easy_Digital_Downloads' ) ) { - require_once dirname( $this->file ) . '/includes/class-easy-digital-downloads.php'; - } - - // Maybe hook-in the bootstrapper - if ( class_exists( 'Easy_Digital_Downloads' ) ) { - - // Bootstrap to plugins_loaded before priority 10 to make sure - // add-ons are loaded after us. - add_action( 'plugins_loaded', array( $this, 'bootstrap' ), 4 ); - - // Register the activation hook - register_activation_hook( $this->file, array( $this, 'install' ) ); - } - } - - /** - * Install, usually on an activation hook. - * - * @since 3.0 - */ - public function install() { - - // Bootstrap to include all of the necessary files. - $this->bootstrap(); - - // Network wide? - $network_wide = ! empty( $_GET['networkwide'] ) - ? (bool) $_GET['networkwide'] - : false; - - // Call the installer directly during the activation hook. - edd_install( $network_wide ); - } - - /** - * Bootstrap everything. - * - * @since 3.0 - */ - public function bootstrap() { - \Easy_Digital_Downloads::instance( $this->file ); - } - - /** - * Plugin specific URL for an external requirements page. - * - * @since 3.0 - * @return string - */ - private function unmet_requirements_url() { - return 'https://easydigitaldownloads.com/recommended-wordpress-hosting/'; - } - - /** - * Plugin specific text to quickly explain what's wrong. - * - * @since 3.0 - * @return string - */ - private function unmet_requirements_text() { - esc_html_e( 'This plugin is not fully active.', 'easy-digital-downloads' ); - } - - /** - * Plugin specific text to describe a single unmet requirement. - * - * @since 3.0 - * @return string - */ - private function unmet_requirements_description_text() { - return esc_html__( 'Requires %1$s (%2$s), but (%3$s) is installed.', 'easy-digital-downloads' ); - } - - /** - * Plugin specific text to describe a single missing requirement. - * - * @since 3.0 - * @return string - */ - private function unmet_requirements_missing_text() { - return esc_html__( 'Requires %1$s (%2$s), but it appears to be missing.', 'easy-digital-downloads' ); - } - - /** - * Plugin specific text used to link to an external requirements page. - * - * @since 3.0 - * @return string - */ - private function unmet_requirements_link() { - return esc_html__( 'Requirements', 'easy-digital-downloads' ); - } - - /** - * Plugin specific aria label text to describe the requirements link. - * - * @since 3.0 - * @return string - */ - private function unmet_requirements_label() { - return esc_html__( 'Easy Digital Download Requirements', 'easy-digital-downloads' ); - } - - /** - * Plugin specific text used in CSS to identify attribute IDs and classes. - * - * @since 3.0 - * @return string - */ - private function unmet_requirements_name() { - return 'edd-requirements'; - } - - /** Agnostic Methods ******************************************************/ - - /** - * Plugin agnostic method to output the additional plugin row - * - * @since 3.0 - */ - public function plugin_row_notice() { - // wp_is_auto_update_enabled_for_type was introduced in WordPress 5.5. - $colspan = function_exists( 'wp_is_auto_update_enabled_for_type' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ? 2 : 1; - ?> - - - - - - unmet_requirements_text(); ?> - - - unmet_requirements_description(); ?> - - - requirements as $properties ) { - if ( empty( $properties['met'] ) ) { - $this->unmet_requirement_description( $properties ); - } - } - } - - /** - * Plugin agnostic method to output specific unmet requirement information - * - * @since 3.0 - * @param array $requirement - */ - private function unmet_requirement_description( $requirement = array() ) { - - // Requirement exists, but is out of date - if ( ! empty( $requirement['exists'] ) ) { - $text = sprintf( - $this->unmet_requirements_description_text(), - '' . esc_html( $requirement['name'] ) . '', - '' . esc_html( $requirement['minimum'] ) . '', - '' . esc_html( $requirement['current'] ) . '' - ); - - // Requirement could not be found - } else { - $text = sprintf( - $this->unmet_requirements_missing_text(), - '' . esc_html( $requirement['name'] ) . '', - '' . esc_html( $requirement['minimum'] ) . '' - ); - } - - // Output the description - echo '

    ' . $text . '

    '; - } - - /** - * Plugin agnostic method to output unmet requirements styling - * - * @since 3.0 - */ - public function admin_head() { - - // Get the requirements row name - $name = $this->unmet_requirements_name(); - ?> - - - unmet_requirements_url() ) . '" aria-label="' . esc_attr( $this->unmet_requirements_label() ) . '">' - . esc_html( $this->unmet_requirements_link() ) - . ''; - - // Return links with Requirements link - return $links; - } - - /** Checkers **************************************************************/ - - /** - * Plugin specific requirements checker - * - * @since 3.0 - */ - private function check() { - - // Loop through requirements - foreach ( $this->requirements as $dependency => $properties ) { - - // Which dependency are we checking? - switch ( $dependency ) { - - // PHP - case 'php': - $version = phpversion(); - break; - - // WP - case 'wp': - $version = get_bloginfo( 'version' ); - break; - - // Unknown - default: - $version = false; - break; - } - - // Merge to original array - if ( ! empty( $version ) ) { - $this->requirements[ $dependency ] = array_merge( - $this->requirements[ $dependency ], - array( - 'current' => $version, - 'checked' => true, - 'met' => version_compare( $version, $properties['minimum'], '>=' ), - ) - ); - } - } - } - - /** - * Have all requirements been met? - * - * @since 3.0 - * - * @return boolean - */ - public function met() { - - // Run the check - $this->check(); - - $to_meet = wp_list_pluck( $this->requirements, 'met' ); - - // Look for unmet dependencies, and exit if so - foreach ( $to_meet as $met ) { - if ( empty( $met ) ) { - return false; - } - } - - return true; - } - - /** Translations **********************************************************/ - - /** - * Plugin specific text-domain loader. - * - * @deprecated 3.1.1.3. Since EDD no longer bundles any language files, - * and WordPress Core automatically loads the custom wp-content/languages/easy-digital-downloads/.mo file if it's found, - * this is no longer needed. - * @since 1.4 - * @return void - */ - public function load_textdomain() { - - /* - * Due to the introduction of language packs through translate.wordpress.org, - * loading our textdomain is complex. - * - * In v2.4.6, our textdomain changed from "edd" to "easy-digital-downloads". - * - * To support existing translation files from before the change, we must - * look for translation files in several places and under several names. - * - * - wp-content/languages/plugins/easy-digital-downloads (introduced with language packs) - * - wp-content/languages/edd/ (custom folder we have supported since 1.4) - * - wp-content/plugins/easy-digital-downloads/languages/ - * - * In wp-content/languages/edd/ we must look for: - * - "easy-digital-downloads-{lang}_{country}.mo" - * - * In wp-content/languages/edd/ we must look for: - * - "edd-{lang}_{country}.mo" as that was the old file naming convention - * - * In wp-content/languages/plugins/easy-digital-downloads/ we only need to look for: - * - "easy-digital-downloads-{lang}_{country}.mo" as that is the new structure - * - * In wp-content/plugins/easy-digital-downloads/languages/, we must look for: - * - both naming conventions. This is done by filtering "load_textdomain_mofile" - */ - add_filter( 'load_textdomain_mofile', array( $this, 'load_old_textdomain' ), 10, 2 ); - - // Set filter for plugin's languages directory. - $edd_lang_dir = dirname( $this->base ) . '/languages/'; - $edd_lang_dir = apply_filters( 'edd_languages_directory', $edd_lang_dir ); - - unload_textdomain( 'easy-digital-downloads' ); - - /** - * Defines the plugin language locale used in Easy Digital Downloads. - * - * @var $get_locale The locale to use. - */ - $locale = apply_filters( 'plugin_locale', get_user_locale(), 'easy-digital-downloads' ); - $mofile = sprintf( '%1$s-%2$s.mo', 'easy-digital-downloads', $locale ); - - // Look for wp-content/languages/edd/easy-digital-downloads-{lang}_{country}.mo - $mofile_global1 = WP_LANG_DIR . "/edd/easy-digital-downloads-{$locale}.mo"; - - // Look for wp-content/languages/edd/edd-{lang}_{country}.mo - $mofile_global2 = WP_LANG_DIR . "/edd/edd-{$locale}.mo"; - - // Look in wp-content/languages/plugins/easy-digital-downloads - $mofile_global3 = WP_LANG_DIR . "/plugins/easy-digital-downloads/{$mofile}"; - - // Try to load from first global location - if ( file_exists( $mofile_global1 ) ) { - load_textdomain( 'easy-digital-downloads', $mofile_global1 ); - - // Try to load from next global location - } elseif ( file_exists( $mofile_global2 ) ) { - load_textdomain( 'easy-digital-downloads', $mofile_global2 ); - - // Try to load from next global location - } elseif ( file_exists( $mofile_global3 ) ) { - load_textdomain( 'easy-digital-downloads', $mofile_global3 ); - - // Load the default language files - } else { - load_plugin_textdomain( 'easy-digital-downloads', false, $edd_lang_dir ); - } - } - - /** - * Load a .mo file for the old textdomain if one exists. - * - * @deprecated 3.1.1.3 - * @see https://github.com/10up/grunt-wp-plugin/issues/21#issuecomment-62003284 - */ - public function load_old_textdomain( $mofile, $textdomain ) { - - // Fallback for old text domain - if ( ( 'easy-digital-downloads' === $textdomain ) && ! file_exists( $mofile ) ) { - $mofile = dirname( $mofile ) . DIRECTORY_SEPARATOR . str_replace( $textdomain, 'edd', basename( $mofile ) ); - } - - // Return (possibly overridden) mofile - return $mofile; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-roles.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-roles.php deleted file mode 100644 index 7970c4d0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-roles.php +++ /dev/null @@ -1,297 +0,0 @@ - true, - 'edit_posts' => true, - 'delete_posts' => true, - 'unfiltered_html' => true, - 'upload_files' => true, - 'export' => true, - 'import' => true, - 'delete_others_pages' => true, - 'delete_others_posts' => true, - 'delete_pages' => true, - 'delete_private_pages' => true, - 'delete_private_posts' => true, - 'delete_published_pages' => true, - 'delete_published_posts' => true, - 'edit_others_pages' => true, - 'edit_others_posts' => true, - 'edit_pages' => true, - 'edit_private_pages' => true, - 'edit_private_posts' => true, - 'edit_published_pages' => true, - 'edit_published_posts' => true, - 'manage_categories' => true, - 'manage_links' => true, - 'moderate_comments' => true, - 'publish_pages' => true, - 'publish_posts' => true, - 'read_private_pages' => true, - 'read_private_posts' => true, - ) ); - - add_role( 'shop_accountant', __( 'Shop Accountant', 'easy-digital-downloads' ), array( - 'read' => true, - 'edit_posts' => false, - 'delete_posts' => false, - ) ); - - add_role( 'shop_worker', __( 'Shop Worker', 'easy-digital-downloads' ), array( - 'read' => true, - 'edit_posts' => false, - 'upload_files' => true, - 'delete_posts' => false, - ) ); - - add_role( 'shop_vendor', __( 'Shop Vendor', 'easy-digital-downloads' ), array( - 'read' => true, - 'edit_posts' => false, - 'upload_files' => true, - 'delete_posts' => false, - ) ); - } - - /** - * Add new shop-specific capabilities. - * - * @since 1.4.4 - */ - public function add_caps() { - global $wp_roles; - - if ( class_exists( 'WP_Roles' ) ) { - if ( ! isset( $wp_roles ) ) { - $wp_roles = new WP_Roles(); // WPCS: override ok. - } - } - - if ( is_object( $wp_roles ) ) { - $wp_roles->add_cap( 'shop_manager', 'view_shop_reports' ); - $wp_roles->add_cap( 'shop_manager', 'view_shop_sensitive_data' ); - $wp_roles->add_cap( 'shop_manager', 'export_shop_reports' ); - $wp_roles->add_cap( 'shop_manager', 'manage_shop_settings' ); - $wp_roles->add_cap( 'shop_manager', 'manage_shop_discounts' ); - - $wp_roles->add_cap( 'administrator', 'view_shop_reports' ); - $wp_roles->add_cap( 'administrator', 'view_shop_sensitive_data' ); - $wp_roles->add_cap( 'administrator', 'export_shop_reports' ); - $wp_roles->add_cap( 'administrator', 'manage_shop_discounts' ); - $wp_roles->add_cap( 'administrator', 'manage_shop_settings' ); - - // Add the main post type capabilities. - $capabilities = $this->get_core_caps(); - foreach ( $capabilities as $cap_group ) { - foreach ( $cap_group as $cap ) { - $wp_roles->add_cap( 'shop_manager', $cap ); - $wp_roles->add_cap( 'administrator', $cap ); - $wp_roles->add_cap( 'shop_worker', $cap ); - } - } - - $wp_roles->add_cap( 'shop_accountant', 'edit_products' ); - $wp_roles->add_cap( 'shop_accountant', 'read_private_products' ); - $wp_roles->add_cap( 'shop_accountant', 'view_shop_reports' ); - $wp_roles->add_cap( 'shop_accountant', 'export_shop_reports' ); - $wp_roles->add_cap( 'shop_accountant', 'edit_shop_payments' ); - - $wp_roles->add_cap( 'shop_vendor', 'edit_product' ); - $wp_roles->add_cap( 'shop_vendor', 'edit_products' ); - $wp_roles->add_cap( 'shop_vendor', 'delete_product' ); - $wp_roles->add_cap( 'shop_vendor', 'delete_products' ); - $wp_roles->add_cap( 'shop_vendor', 'publish_products' ); - $wp_roles->add_cap( 'shop_vendor', 'edit_published_products' ); - $wp_roles->add_cap( 'shop_vendor', 'upload_files' ); - $wp_roles->add_cap( 'shop_vendor', 'assign_product_terms' ); - } - } - - /** - * Gets the core post type capabilities. - * - * @since 1.4.4 - * - * @return array $capabilities Core post type capabilities. - */ - public function get_core_caps() { - $capabilities = array(); - - $capability_types = array( 'product', 'shop_payment', 'shop_discount' ); - - foreach ( $capability_types as $capability_type ) { - $capabilities[ $capability_type ] = array( - // Post type - "edit_{$capability_type}", - "read_{$capability_type}", - "delete_{$capability_type}", - "edit_{$capability_type}s", - "edit_others_{$capability_type}s", - "publish_{$capability_type}s", - "read_private_{$capability_type}s", - "delete_{$capability_type}s", - "delete_private_{$capability_type}s", - "delete_published_{$capability_type}s", - "delete_others_{$capability_type}s", - "edit_private_{$capability_type}s", - "edit_published_{$capability_type}s", - - // Terms - "manage_{$capability_type}_terms", - "edit_{$capability_type}_terms", - "delete_{$capability_type}_terms", - "assign_{$capability_type}_terms", - - // Custom - "view_{$capability_type}_stats", - "import_{$capability_type}s", - ); - } - - return $capabilities; - } - - /** - * Map meta caps to primitive caps. - * - * @since 2.0 - * - * @param array $caps Capabilities for meta capability. - * @param string $cap Capability name. - * @param int $user_id User ID. - * @param mixed $args Arguments. - * - * @return array $caps - */ - public function meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) { - - // Ensure user ID is a valid integer. - $user_id = absint( $user_id ); - - switch ( $cap ) { - case 'view_product_stats': - if ( empty( $args[0] ) ) { - break; - } - - $download = get_post( $args[0] ); - - // Bail if download was not found. - if ( empty( $download ) ) { - break; - } - - // No stats for auto-drafts. - if ( 'auto-draft' === $download->post_status ) { - $caps = array( 'do_not_allow' ); - break; - } - - if ( user_can( $user_id, 'view_shop_reports' ) || absint( $download->post_author ) === $user_id ) { - $caps = array(); - } - - break; - } - - return $caps; - - } - - /** - * Remove core post type capabilities (called on uninstall). - * - * @since 1.5.2 - */ - public function remove_caps() { - global $wp_roles; - - if ( class_exists( 'WP_Roles' ) ) { - if ( ! isset( $wp_roles ) ) { - $wp_roles = new WP_Roles(); // WPCS: override ok. - } - } - - if ( is_object( $wp_roles ) ) { - - /** Shop Manager Capabilities */ - $wp_roles->remove_cap( 'shop_manager', 'view_shop_reports' ); - $wp_roles->remove_cap( 'shop_manager', 'view_shop_sensitive_data' ); - $wp_roles->remove_cap( 'shop_manager', 'export_shop_reports' ); - $wp_roles->remove_cap( 'shop_manager', 'manage_shop_discounts' ); - $wp_roles->remove_cap( 'shop_manager', 'manage_shop_settings' ); - - /** Site Administrator Capabilities */ - $wp_roles->remove_cap( 'administrator', 'view_shop_reports' ); - $wp_roles->remove_cap( 'administrator', 'view_shop_sensitive_data' ); - $wp_roles->remove_cap( 'administrator', 'export_shop_reports' ); - $wp_roles->remove_cap( 'administrator', 'manage_shop_discounts' ); - $wp_roles->remove_cap( 'administrator', 'manage_shop_settings' ); - - /** Remove the Main Post Type Capabilities */ - $capabilities = $this->get_core_caps(); - - foreach ( $capabilities as $cap_group ) { - foreach ( $cap_group as $cap ) { - $wp_roles->remove_cap( 'shop_manager', $cap ); - $wp_roles->remove_cap( 'administrator', $cap ); - $wp_roles->remove_cap( 'shop_worker', $cap ); - } - } - - /** Shop Accountant Capabilities */ - $wp_roles->remove_cap( 'shop_accountant', 'edit_products' ); - $wp_roles->remove_cap( 'shop_accountant', 'read_private_products' ); - $wp_roles->remove_cap( 'shop_accountant', 'view_shop_reports' ); - $wp_roles->remove_cap( 'shop_accountant', 'export_shop_reports' ); - - /** Shop Vendor Capabilities */ - $wp_roles->remove_cap( 'shop_vendor', 'edit_product' ); - $wp_roles->remove_cap( 'shop_vendor', 'edit_products' ); - $wp_roles->remove_cap( 'shop_vendor', 'delete_product' ); - $wp_roles->remove_cap( 'shop_vendor', 'delete_products' ); - $wp_roles->remove_cap( 'shop_vendor', 'publish_products' ); - $wp_roles->remove_cap( 'shop_vendor', 'edit_published_products' ); - $wp_roles->remove_cap( 'shop_vendor', 'upload_files' ); - } - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-session.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-session.php deleted file mode 100644 index 8b2fb5cd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-session.php +++ /dev/null @@ -1,426 +0,0 @@ -use_php_sessions = $this->use_php_sessions(); - - if ( $this->use_php_sessions ) { - if ( is_multisite() ) { - $this->prefix = '_' . get_current_blog_id(); - } - - // Use PHP SESSION (must be enabled via the EDD_USE_PHP_SESSIONS constant) - add_action( 'init', array( $this, 'maybe_start_session' ), -2 ); - } else { - if ( ! $this->should_start_session() ) { - return; - } - - // Use WP_Session (default) - if ( ! defined( 'WP_SESSION_COOKIE' ) ) { - define( 'WP_SESSION_COOKIE', 'edd_wp_session' ); - } - - if ( ! class_exists( 'Recursive_ArrayAccess' ) ) { - require_once EDD_PLUGIN_DIR . 'includes/libraries/class-recursive-arrayaccess.php'; - } - - if ( ! class_exists( 'WP_Session' ) ) { - require_once EDD_PLUGIN_DIR . 'includes/libraries/class-wp-session.php'; - require_once EDD_PLUGIN_DIR . 'includes/libraries/wp-session.php'; - } - - add_filter( 'wp_session_expiration_variant', array( $this, 'set_expiration_variant_time' ), 99999 ); - add_filter( 'wp_session_expiration', array( $this, 'set_expiration_time' ), 99999 ); - } - - // Based off our session handling, we need to use different hooks and priorities. - if ( empty( $this->session ) && ! $this->use_php_sessions ) { - $hook = 'plugins_loaded'; - $priority = 10; - } else { - $hook = 'init'; - $priority = -1; - } - - add_action( $hook, array( $this, 'init' ), $priority ); - } - - /** - * Setup the WP_Session instance. - * - * @since 1.5 - */ - public function init() { - if ( $this->use_php_sessions ) { - $key = 'edd' . $this->prefix; - $this->session = isset( $_SESSION[ $key ] ) && is_array( $_SESSION[ $key ] ) - ? $_SESSION[ $key ] - : array(); - } else { - $this->session = WP_Session::get_instance(); - } - - $use_cookie = $this->use_cart_cookie(); - $cart = $this->get( 'edd_cart' ); - $purchase = $this->get( 'edd_purchase' ); - - if ( $use_cookie ) { - if ( ! empty( $cart ) || ! empty( $purchase ) ) { - $this->set_cart_cookie(); - } else { - $this->set_cart_cookie( false ); - } - } - - return $this->session; - } - - /** - * Retrieve session ID. - * - * @since 1.6 - * - * @return string Session ID - */ - public function get_id() { - return $this->session->session_id; - } - - /** - * Retrieve a session variable. - * - * @since 1.5 - * - * @param string $key Session key. - * @return mixed Session variable. - */ - public function get( $key ) { - $key = sanitize_key( $key ); - $return = false; - - if ( isset( $this->session[ $key ] ) && ! empty( $this->session[ $key ] ) ) { - preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $this->session[ $key ], $matches ); - - if ( ! empty( $matches ) ) { - $this->set( $key, null ); - return false; - } - - if ( is_numeric( $this->session[ $key ] ) ) { - $return = $this->session[ $key ]; - } else { - $maybe_json = json_decode( $this->session[ $key ] ); - - // Since json_last_error is PHP 5.3+, we have to rely on a `null` value for failing to parse JSON. - if ( is_null( $maybe_json ) ) { - $is_serialized = is_serialized( $this->session[ $key ] ); - if ( $is_serialized ) { - $value = @unserialize( $this->session[ $key ] ); - $this->set( $key, (array) $value ); - $return = $value; - } else { - $return = $this->session[ $key ]; - } - } else { - $return = json_decode( $this->session[ $key ], true ); - } - } - } - - return $return; - } - - /** - * Set a session variable. - * - * @since 1.5 - * - * @param string $key Session key. - * @param int|string|array $value Session variable. - * - * @return mixed Session variable - */ - public function set( $key, $value ) { - $key = sanitize_key( $key ); - - if ( is_array( $value ) ) { - $this->session[ $key ] = wp_json_encode( $value ); - } else { - $this->session[ $key ] = esc_attr( $value ); - } - - if ( $this->use_php_sessions ) { - $_SESSION[ 'edd' . $this->prefix ] = $this->session; - } - - return $this->session[ $key ]; - } - - /** - * Set a cookie to identify whether the cart is empty or not. - * - * This is for hosts and caching plugins to identify if caching should be disabled. - * - * @since 1.8 - * - * @param bool $set Whether to set or destroy. Default true. - */ - public function set_cart_cookie( $set = true ) { - - // Bail if headers already sent. - if ( headers_sent() ) { - return; - } - - if ( $set ) { - @setcookie( 'edd_items_in_cart', '1', time() + 30 * 60, COOKIEPATH, COOKIE_DOMAIN, is_ssl() ); - } elseif ( isset( $_COOKIE['edd_items_in_cart'] ) ) { - @setcookie( 'edd_items_in_cart', '', time() - 3600, COOKIEPATH, COOKIE_DOMAIN, is_ssl() ); - } - } - - /** - * Force the cookie expiration variant time to 23 hours. - * - * @since 2.0 - * @since 3.0 Set default value of $exp parameter to 1 as it is unused. - * - * @param int $exp Default expiration (1 hour). - * @return int Cookie expiration variant time. - */ - public function set_expiration_variant_time( $exp = 1 ) { - return HOUR_IN_SECONDS * 23; - } - - /** - * Force the cookie expiration time to 24 hours. - * - * @since 1.9 - * @since 3.0 Set default value of $exp parameter to 1 as it is unused. - * - * @param int $exp Default expiration (1 hour). - * @return int Cookie expiration time. - */ - public function set_expiration_time( $exp = 1 ) { - return HOUR_IN_SECONDS * 24; - } - - /** - * Starts a new session if one hasn't started yet. - * - * Checks to see if the server supports PHP sessions - * or if the EDD_USE_PHP_SESSIONS constant is defined - * - * @since 2.1 - * @return bool $ret True if we are using PHP sessions, false otherwise. - */ - public function use_php_sessions() { - - // Set default return value to false. - $ret = false; - - // If the database variable is already set, no need to run autodetection. - $edd_use_php_sessions = (bool) get_option( 'edd_use_php_sessions' ); - - if ( ! $edd_use_php_sessions ) { - - // Attempt to detect if the server supports PHP sessions - if ( function_exists( 'session_start' ) ) { - $this->set( 'edd_use_php_sessions', 1 ); - - if ( $this->get( 'edd_use_php_sessions' ) ) { - $ret = true; - - // Set the database option - update_option( 'edd_use_php_sessions', true ); - } - } - } else { - $ret = $edd_use_php_sessions; - } - - // Enable or disable PHP Sessions based on the EDD_USE_PHP_SESSIONS constant. - if ( defined( 'EDD_USE_PHP_SESSIONS' ) && EDD_USE_PHP_SESSIONS ) { - $ret = true; - } else if ( defined( 'EDD_USE_PHP_SESSIONS' ) && ! EDD_USE_PHP_SESSIONS ) { - $ret = false; - } - - // Filter & return. - return (bool) apply_filters( 'edd_use_php_sessions', $ret ); - } - - /** - * Determines if a user has set the EDD_USE_CART_COOKIE. - * - * @since 2.5 - * - * @return bool If the store should use the edd_items_in_cart cookie to help avoid caching - */ - public function use_cart_cookie() { - - // Set default return value to true. - $ret = true; - - if ( defined( 'EDD_USE_CART_COOKIE' ) && ! EDD_USE_CART_COOKIE ) { - $ret = false; - } - - // Filter & return. - return (bool) apply_filters( 'edd_use_cart_cookie', $ret ); - } - - /** - * Determines if we should start sessions. - * - * @since 2.5.11 - * - * @return bool True if sessions should start, false otherwise. - */ - public function should_start_session() { - - // Set default return value to true. - $start_session = true; - - if ( ! empty( $_SERVER['REQUEST_URI'] ) ) { - $blacklist = $this->get_blacklist(); - $uri = ltrim( $_SERVER['REQUEST_URI'], '/' ); - $uri = untrailingslashit( $uri ); - - if ( in_array( $uri, $blacklist, true ) ) { - $start_session = false; - } - - if ( false !== strpos( $uri, 'feed=' ) ) { - $start_session = false; - } - - // We do not want to start sessions in the admin unless we're processing an ajax request. - if ( is_admin() && false === strpos( $uri, 'wp-admin/admin-ajax.php' ) ) { - $start_session = false; - } - - // Starting sessions while saving the file editor can break the save process, so don't start. - if ( false !== strpos( $uri, 'wp_scrape_key' ) ) { - $start_session = false; - } - } - - // Filter & return. - return (bool) apply_filters( 'edd_start_session', $start_session ); - } - - /** - * Retrieve the URI blacklist. - * - * These are the URIs where we never start sessions. - * - * @since 2.5.11 - * - * @return array URI blacklist. - */ - public function get_blacklist() { - $blacklist = apply_filters( 'edd_session_start_uri_blacklist', array( - 'feed', - 'feed/rss', - 'feed/rss2', - 'feed/rdf', - 'feed/atom', - 'comments/feed' - ) ); - - // Look to see if WordPress is in a sub folder or this is a network site that uses sub folders - $folder = str_replace( network_home_url(), '', get_site_url() ); - - if ( ! empty( $folder ) ) { - foreach ( $blacklist as $path ) { - $blacklist[] = $folder . '/' . $path; - } - } - - return $blacklist; - } - - /** - * Starts a new session if one hasn't started yet. - * - * @since 2.1.3 - */ - public function maybe_start_session() { - - // Bail if should not start session. - if ( ! $this->should_start_session() ) { - return; - } - - // Bail if headers already sent. - if ( headers_sent() ) { - return; - } - - // Start if old version of PHP & no session ID exists. - if ( version_compare( PHP_VERSION, '5.4', '<' ) && ! session_id() ) { - session_start(); - - // Start if modern PHP and session-status is not active. - } elseif ( defined( 'PHP_SESSION_ACTIVE' ) && ( session_status() !== PHP_SESSION_ACTIVE ) ) { - session_start(); - } - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-edd-stats.php b/wp-content/plugins/easy-digital-downloads/includes/class-edd-stats.php deleted file mode 100644 index c1ce208a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-edd-stats.php +++ /dev/null @@ -1,522 +0,0 @@ - __( 'Today', 'easy-digital-downloads' ), - 'yesterday' => __( 'Yesterday', 'easy-digital-downloads' ), - 'this_week' => __( 'This Week', 'easy-digital-downloads' ), - 'last_week' => __( 'Last Week', 'easy-digital-downloads' ), - 'this_month' => __( 'This Month', 'easy-digital-downloads' ), - 'last_month' => __( 'Last Month', 'easy-digital-downloads' ), - 'this_quarter' => __( 'This Quarter', 'easy-digital-downloads' ), - 'last_quarter' => __( 'Last Quarter', 'easy-digital-downloads' ), - 'this_year' => __( 'This Year', 'easy-digital-downloads' ), - 'last_year' => __( 'Last Year', 'easy-digital-downloads' ) - ) ); - } - - /** - * Setup the dates passed to our constructor. - * - * This calls the convert_date() member function to ensure the dates are formatted correctly - * - * @since 1.8 - * @return void - */ - public function setup_dates( $_start_date = 'this_month', $_end_date = false ) { - - if ( empty( $_start_date ) ) { - $_start_date = 'this_month'; - } - - if ( empty( $_end_date ) ) { - $_end_date = $_start_date; - } - - $this->start_date = $this->convert_date( $_start_date ); - $this->end_date = $this->convert_date( $_end_date, true ); - - } - - /** - * Converts a date to a timestamp - * - * @since 1.8 - * @return array|WP_Error If the date is invalid, a WP_Error object will be returned - */ - public function convert_date( $date, $end_date = false ) { - - $this->timestamp = false; - $second = $end_date ? 59 : 0; - $minute = $end_date ? 59 : 0; - $hour = $end_date ? 23 : 0; - $day = 1; - $month = date( 'n', current_time( 'timestamp' ) ); - $year = date( 'Y', current_time( 'timestamp' ) ); - - if ( ( is_string( $date ) || is_int( $date ) ) && array_key_exists( $date, $this->get_predefined_dates() ) ) { - - // This is a predefined date rate, such as last_week - switch( $date ) { - - case 'this_month' : - - if ( $end_date ) { - - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - - } - - break; - - case 'last_month' : - - if ( $month == 1 ) { - - $month = 12; - $year--; - - } else { - - $month--; - - } - - if ( $end_date ) { - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - } - - break; - - case 'today' : - - $day = date( 'd', current_time( 'timestamp' ) ); - - if ( $end_date ) { - $hour = 23; - $minute = 59; - $second = 59; - } - - break; - - case 'yesterday' : - - $day = date( 'd', current_time( 'timestamp' ) ) - 1; - - // Check if Today is the first day of the month (meaning subtracting one will get us 0) - if ( $day < 1 ) { - - // If current month is 1 - if ( 1 == $month ) { - - $year -= 1; // Today is January 1, so skip back to last day of December - $month = 12; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - - } else { - - // Go back one month and get the last day of the month - $month -= 1; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - - } - } - - break; - - case 'this_week' : - - $days_to_week_start = ( date( 'w', current_time( 'timestamp' ) ) - 1 ) *60*60*24; - $today = date( 'd', current_time( 'timestamp' ) ) *60*60*24; - - if ( $today < $days_to_week_start ) { - - if ( $month > 1 ) { - $month -= 1; - } else { - $month = 12; - } - - } - - if ( ! $end_date ) { - - // Getting the start day - - $day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 1; - $day += get_option( 'start_of_week' ); - - } else { - - // Getting the end day - - $day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 1; - $day += get_option( 'start_of_week' ) + 6; - - } - - break; - - case 'last_week' : - - $days_to_week_start = ( date( 'w', current_time( 'timestamp' ) ) - 1 ) *60*60*24; - $today = date( 'd', current_time( 'timestamp' ) ) *60*60*24; - - if ( $today < $days_to_week_start ) { - - if ( $month > 1 ) { - $month -= 1; - } else { - $month = 12; - } - - } - - if ( ! $end_date ) { - - // Getting the start day - - $day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 8; - $day += get_option( 'start_of_week' ); - - } else { - - // Getting the end day - - $day = date( 'd', current_time( 'timestamp' ) - $days_to_week_start ) - 8; - $day += get_option( 'start_of_week' ) + 6; - - } - - break; - - case 'this_quarter' : - - $month_now = date( 'n', current_time( 'timestamp' ) ); - - if ( $month_now <= 3 ) { - - if ( ! $end_date ) { - $month = 1; - } else { - $month = 3; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - } - - } else if ( $month_now <= 6 ) { - - if ( ! $end_date ) { - $month = 4; - } else { - $month = 6; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - } - - } else if ( $month_now <= 9 ) { - - if ( ! $end_date ) { - $month = 7; - } else { - $month = 9; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - } - - } else { - - if ( ! $end_date ) { - $month = 10; - } else { - $month = 12; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - } - } - - break; - - case 'last_quarter' : - - $month_now = date( 'n', current_time( 'timestamp' ) ); - - if ( $month_now <= 3 ) { - - if ( ! $end_date ) { - $month = 10; - } else { - $year -= 1; - $month = 12; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - } - - } else if ( $month_now <= 6 ) { - - if ( ! $end_date ) { - $month = 1; - } else { - $month = 3; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - } - - } else if ( $month_now <= 9 ) { - - if ( ! $end_date ) { - $month = 4; - } else { - $month = 6; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - } - - } else { - - if ( ! $end_date ) { - $month = 7; - } else { - $month = 9; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - } - } - - break; - - case 'this_year' : - - if ( ! $end_date ) { - $month = 1; - } else { - $month = 12; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - } - - break; - - case 'last_year' : - - $year -= 1; - if ( ! $end_date ) { - $month = 1; - $day = 1; - } else { - $month = 12; - $day = cal_days_in_month( CAL_GREGORIAN, $month, $year ); - $hour = 23; - $minute = 59; - $second = 59; - } - - break; - - } - - - } else if ( is_numeric( $date ) ) { - - // return $date unchanged since it is a timestamp - $this->timestamp = true; - - } else if ( false !== strtotime( $date ) ) { - - $date = strtotime( $date, current_time( 'timestamp' ) ); - $year = date( 'Y', $date ); - $month = date( 'm', $date ); - $day = date( 'd', $date ); - - } else { - return new WP_Error( 'invalid_date', __( 'Improper date provided.', 'easy-digital-downloads' ) ); - } - - // Create an exact timestamp - if ( false === $this->timestamp ) { - $date = mktime( $hour, $minute, $second, $month, $day, $year ); - } - - return apply_filters( 'edd_stats_date', $date, $end_date, $this ); - } - - /** - * Modifies the WHERE flag for payment counts - * - * Only get payments in our date range - * - * @since 1.8 - * @return string - */ - public function count_where( $where = '' ) { - - $start_where = $end_where = ''; - - if ( $this->start_date ) { - - if ( $this->timestamp ) { - $format = 'Y-m-d H:i:s'; - } else { - $format = 'Y-m-d 00:00:00'; - } - - $start_date = date( $format, $this->start_date ); - $start_where = " AND date_created >= '{$start_date}'"; - } - - if ( $this->end_date ) { - - if ( $this->timestamp ) { - $format = 'Y-m-d H:i:s'; - } else { - $format = 'Y-m-d 23:59:59'; - } - - $end_date = date( $format, $this->end_date ); - - $end_where = " AND date_created <= '{$end_date}'"; - } - - $where .= "{$start_where}{$end_where}"; - - return $where; - } - - /** - * Modifies the WHERE flag for payment queries - * - * @since 1.8 - * @return string - */ - public function payments_where( $where = '' ) { - global $wpdb; - - $start_where = ''; - $end_where = ''; - - if ( ! is_wp_error( $this->start_date ) ) { - - if ( $this->timestamp ) { - $format = 'Y-m-d H:i:s'; - } else { - $format = 'Y-m-d 00:00:00'; - } - - $start_date = date( $format, $this->start_date ); - $start_where = " AND {$wpdb->posts}.post_date >= '{$start_date}'"; - } - - if ( ! is_wp_error( $this->end_date ) ) { - - if ( $this->timestamp ) { - $format = 'Y-m-d H:i:s'; - } else { - $format = 'Y-m-d 23:59:59'; - } - - $end_date = date( $format, $this->end_date ); - - $end_where = " AND {$wpdb->posts}.post_date <= '{$end_date}'"; - } - - $where .= "{$start_where}{$end_where}"; - - return $where; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-stats.php b/wp-content/plugins/easy-digital-downloads/includes/class-stats.php deleted file mode 100644 index f0bd0373..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-stats.php +++ /dev/null @@ -1,3237 +0,0 @@ -set_date_ranges(); - - // Maybe parse query. - if ( ! empty( $query ) ) { - $this->parse_query( $query ); - - $this->query_var_originals = $this->query_vars; - - // Set defaults. - } else { - $this->query_var_originals = $this->query_vars = array( - 'start' => '', - 'end' => '', - 'range' => '', - 'exclude_taxes' => false, - 'currency' => false, - 'currency_sql' => '', - 'status' => array(), - 'status_sql' => '', - 'type' => array(), - 'type_sql' => '', - 'where_sql' => '', - 'date_query_sql' => '', - 'date_query_column' => '', - 'column' => '', - 'table' => '', - 'function' => 'SUM', - 'output' => 'raw', - 'relative' => false, - 'relative_start' => '', - 'relative_end' => '', - 'grouped' => false, - 'product_id' => '', - 'price_id' => null, - 'revenue_type' => 'gross', - ); - } - - } - - /** - * Builds a fully qualified amount column and function, given the currency settings, - * tax settings, and accepted functions. - * - * @param array $args { - * Optional arguments. - * - * @type string $column_prefix Column prefix (table alias or name). - * @type array $accepted_function Accepted functions for this query. - * } - * - * @return string Example: `SUM( total / rate )` - * @throws \InvalidArgumentException - */ - private function get_amount_column_and_function( $args = array() ) { - $args = wp_parse_args( $args, array( - 'column_prefix' => '', - 'accepted_functions' => array(), - 'requested_function' => false, - 'rate' => true, - ) ); - - $column = $this->query_vars['column']; - $column_prefix = ''; - - if ( ! empty( $args['column_prefix'] ) ) { - $column_prefix = $args['column_prefix'] . '.'; - } - - if ( empty( $column ) ) { - $column = true === $this->query_vars['exclude_taxes'] ? "{$column_prefix}total - {$column_prefix}tax" : $column_prefix . 'total'; - } else { - $column = $column_prefix . $column; - } - - $default_function = is_array( $args['accepted_functions'] ) && isset( $args['accepted_functions'][0] ) ? $args['accepted_functions'][0] : false; - $function = ! empty( $this->query_vars['function'] ) ? $this->query_vars['function'] : $default_function; - - if ( ! empty( $args['requested_function'] ) ) { - $function = $args['requested_function']; - } - - if ( empty( $function ) ) { - throw new \InvalidArgumentException( 'Missing select function.' ); - } - - if ( ! empty( $args['accepted_functions'] ) && ! in_array( strtoupper( $function ), $args['accepted_functions'], true ) ) { - if ( ! empty( $default_function ) ) { - $function = $default_function; - } else { - throw new \InvalidArgumentException( sprintf( 'Invalid function "%s". Must be one of: %s', $this->query_vars['function'], json_encode( $args['accepted_functions'] ) ) ); - } - } - - $function = strtoupper( $function ); - - // Multiply by rate if currency conversion is enabled. - if ( - ! empty( $args['rate'] ) && - in_array( $function, array( 'SUM', 'AVG' ), true ) && - ( empty( $this->query_vars['currency'] ) || 'convert' === $this->query_vars['currency'] ) && - ( false !== strpos( $column, 'total' ) || false !== strpos( $column, 'tax' ) ) - ) { - $column = sprintf( '(%s) / %s', $column, $column_prefix . 'rate' ); - } - - return sprintf( '%s(%s)', $function, $column ); - } - - /** Calculation Methods ***************************************************/ - - /** Orders ***************************************************************/ - - /** - * Calculate order earnings. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type bool $exclude_taxes If taxes should be excluded from calculations. Default `false`. - * @type string $function SQL function. Accepts `SUM` and `AVG`. Default `SUM`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return string Formatted order earnings. - */ - public function get_order_earnings( $query = array() ) { - $this->parse_query( $query ); - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['date_query_column'] = 'date_created'; - - if ( empty( $this->query_vars['function'] ) ) { - $this->query_vars['function'] = 'SUM'; - } - - /* - * By default we're checking sales only and excluding refunds. This gives us gross order earnings. - * This may be overridden in $query parameters that get passed through. - */ - $this->query_vars['type'] = $this->get_revenue_type_order_types(); - $this->query_vars['status'] = edd_get_gross_order_statuses(); - - /** - * Filters Order statuses that should be included when calculating stats. - * - * @since 2.7 - * - * @param array $statuses Order statuses to include when generating stats. - */ - $this->query_vars['status'] = array_unique( apply_filters( 'edd_payment_stats_post_statuses', $this->query_vars['status'] ) ); - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'SUM', 'AVG' ) - ) ); - - $initial_query = "SELECT {$function} AS total - FROM {$this->query_vars['table']} - WHERE 1=1 - {$this->query_vars['status_sql']} - {$this->query_vars['type_sql']} - {$this->query_vars['currency_sql']} - {$this->query_vars['where_sql']} - {$this->query_vars['date_query_sql']}"; - - $initial_result = $this->get_db()->get_row( $initial_query ); - - if ( true === $this->query_vars['relative'] ) { - - $relative_date_query_sql = $this->generate_relative_date_query_sql(); - - $relative_query = "SELECT {$function} AS total - FROM {$this->query_vars['table']} - WHERE 1=1 - {$this->query_vars['status_sql']} - {$this->query_vars['type_sql']} - {$this->query_vars['currency_sql']} - {$this->query_vars['where_sql']} - {$relative_date_query_sql}"; - - - $relative_result = $this->get_db()->get_row( $relative_query ); - } - - $total = null === $initial_result->total - ? 0.00 - : (float) $initial_result->total; - - if ( 'array' === $this->query_vars['output'] ) { - $output = array( - 'value' => $total, - 'relative_data' => ( true === $this->query_vars['relative'] ) ? $this->generate_relative_data( floatval( $total ), floatval( $relative_result->total ) ) : array(), - ); - } else { - if ( true === $this->query_vars['relative'] ) { - $output = $this->generate_relative_markup( floatval( $total ), floatval( $relative_result->total ) ); - } else { - $output = $this->maybe_format( $total ); - } - } - - // Reset query vars. - $this->post_query(); - - return $output; - } - - /** - * Calculate the number of orders. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `COUNT` and `AVG`. Default `COUNT`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return int Number of orders. - */ - public function get_order_count( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - /* - * By default we're checking sales only and excluding refunds. This gives us gross order counts. - * This may be overridden in $query parameters that get passed through. - */ - $this->query_vars['type'] = 'sale'; - $this->query_vars['status'] = $this->get_revenue_type_statuses(); - - /** - * Filters Order statuses that should be included when calculating stats. - * - * @since 2.7 - * - * @param array $statuses Order statuses to include when generating stats. - */ - $this->query_vars['status'] = apply_filters( 'edd_payment_stats_post_statuses', $this->query_vars['status'] ); - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'COUNT', 'AVG' ) - ) ); - - // First get the 'current' date filter's results. - $initial_query = "SELECT COUNT(id) AS total - FROM {$this->query_vars['table']} - WHERE 1=1 - {$this->query_vars['status_sql']} - {$this->query_vars['type_sql']} - {$this->query_vars['currency_sql']} - {$this->query_vars['where_sql']} - {$this->query_vars['date_query_sql']}"; - - $initial_result = $this->get_db()->get_row( $initial_query ); - - if ( true === $this->query_vars['relative'] ) { - - // Now get the relative data. - $relative_date_query_sql = $this->generate_relative_date_query_sql(); - - $relative_query = "SELECT COUNT(id) AS total - FROM {$this->query_vars['table']} - WHERE 1=1 - {$this->query_vars['status_sql']} - {$this->query_vars['type_sql']} - {$this->query_vars['currency_sql']} - {$this->query_vars['where_sql']} - {$relative_date_query_sql}"; - - $relative_result = $this->get_db()->get_row( $relative_query ); - } - - $total = null === $initial_result - ? 0 - : absint( $initial_result->total ); - - if ( true === $this->query_vars['relative'] ) { - $total = $this->generate_relative_markup( absint( $total ), absint( $relative_result->total ) ); - } - - // Reset query vars. - $this->post_query(); - - return $total; - } - - /** - * Calculate the busiest day of the week for stores. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return string Busiest day of the week. - */ - public function get_busiest_day( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $sql = "SELECT DAYOFWEEK(date_created) AS day, COUNT({$this->query_vars['column']}) as total - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} {$this->query_vars['currency_sql']} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY day - ORDER BY total DESC - LIMIT 1"; - - $result = $this->get_db()->get_row( $sql ); - - $days = array( - __( 'Sunday', 'easy-digital-downloads' ), - __( 'Monday', 'easy-digital-downloads' ), - __( 'Tuesday', 'easy-digital-downloads' ), - __( 'Wednesday', 'easy-digital-downloads' ), - __( 'Thursday', 'easy-digital-downloads' ), - __( 'Friday', 'easy-digital-downloads' ), - __( 'Saturday', 'easy-digital-downloads' ), - ); - - $day = null === $result - ? '' - : $days[ $result->day - 1 ]; - - // Reset query vars. - $this->post_query(); - - return $day; - } - - /** - * Calculate number of refunded orders. - * - * @since 3.0 - * - * @see \EDD\Stats::get_order_count() - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `COUNT` and `AVG`. Default `COUNT`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return int Number of refunded orders. - */ - public function get_order_refund_count( $query = array() ) { - $query['status'] = isset( $query['status'] ) - ? $query['status'] - : array( 'complete' ); - - if ( ! array( $query['status'] ) ) { - $query['status'] = array( $query['status'] ); - } - - $query['type'] = array( 'refund' ); - - return $this->get_order_count( $query ); - } - - /** - * Calculate number of refunded order items. - * - * @since 3.0 - * - * @see \EDD\Stats::get_order_item_count() - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `COUNT` and `AVG`. Default `COUNT`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return int Number of refunded orders. - */ - public function get_order_item_refund_count( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_order_items; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - if ( empty( $this->query_vars['function'] ) ) { - $this->query_vars['function'] = 'COUNT'; - } - - // Base value for status. - $query['status'] = isset( $query['status'] ) - ? $query['status'] - : array( 'refunded' ); - - /* - * The type should be `sale` because we're querying for fully refunded order items only. - * That means we look in `type` = `sale` and `status` = `refunded`. - */ - $this->query_vars['where_sql'] .= " AND {$this->get_db()->edd_orders}.type = 'sale' "; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'column_prefix' => $this->query_vars['table'], - 'accepted_functions' => array( 'COUNT', 'AVG' ) - ) ); - - $product_id = ! empty( $this->query_vars['product_id'] ) - ? $this->get_db()->prepare( 'AND product_id = %d', absint( $this->query_vars['product_id'] ) ) - : ''; - - $price_id = $this->generate_price_id_query_sql(); - - $currency_sql = str_replace( $this->get_db()->edd_order_items, $this->get_db()->edd_orders, $this->query_vars['currency_sql'] ); - - // Calculating an average requires a subquery. - if ( 'AVG' === $this->query_vars['function'] ) { - $sql = "SELECT AVG(id) AS total - FROM ( - SELECT COUNT({$this->query_vars['table']}.id) AS id - FROM {$this->query_vars['table']} - INNER JOIN {$this->get_db()->edd_orders} ON( {$this->get_db()->edd_orders}.id = {$this->query_vars['table']}.order_id ) - WHERE 1=1 {$product_id} {$price_id} {$this->query_vars['status_sql']} {$currency_sql} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY order_id - ) AS counts"; - } elseif ( true === $this->query_vars['grouped'] ) { - $sql = "SELECT {$this->query_vars['table']}.product_id, {$this->query_vars['table']}.price_id, {$function} AS total - FROM {$this->query_vars['table']} - INNER JOIN {$this->get_db()->edd_orders} ON( {$this->get_db()->edd_orders}.id = {$this->query_vars['table']}.order_id ) - WHERE 1=1 {$product_id} {$price_id} {$this->query_vars['status_sql']} {$currency_sql} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY product_id, price_id - ORDER BY total DESC"; - } else { - $sql = "SELECT {$function} AS total - FROM {$this->query_vars['table']} - INNER JOIN {$this->get_db()->edd_orders} ON( {$this->get_db()->edd_orders}.id = {$this->query_vars['table']}.order_id ) - WHERE 1=1 {$product_id} {$price_id} {$this->query_vars['status_sql']} {$currency_sql} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - } - - $result = $this->get_db()->get_results( $sql ); - - if ( true === $this->query_vars['grouped'] ) { - array_walk( $result, function ( &$value ) { - - // Format resultant object. - $value->product_id = absint( $value->product_id ); - $value->price_id = is_numeric( $value->price_id ) ? absint( $value->price_id ) : null; - $value->total = absint( $value->total ); - - // Add instance of EDD_Download to resultant object. - $value->object = edd_get_download( $value->product_id ); - } ); - } else { - $result = null === $result[0]->total - ? 0.00 - : absint( $result[0]->total ); - } - - // Reset query vars. - $this->post_query(); - - return $result; - - return $this->get_order_item_count( $query ); - } - - /** - * Calculate total amount for refunded orders. - * - * @since 3.0 - * - * @see \EDD\Stats::get_order_earnings() - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type bool $exclude_taxes If taxes should be excluded from calculations. Default `false`. - * @type string $function SQL function. Default `SUM`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return string Formatted amount from refunded orders. - */ - public function get_order_refund_amount( $query = array() ) { - $this->parse_query( $query ); - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['date_query_column'] = 'date_created'; - - if ( empty( $this->query_vars['function'] ) ) { - $this->query_vars['function'] = 'SUM'; - } - - /* - * By default we're checking refunds only and excluding any other types. This gives us gross refund amounts. - * This may be overridden in $query parameters that get passed through. - */ - $this->query_vars['type'] = 'refund'; - $this->query_vars['status'] = array( 'complete' ); - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'SUM', 'AVG' ) - ) ); - - $initial_query = "SELECT {$function} AS total - FROM {$this->query_vars['table']} - WHERE 1=1 - {$this->query_vars['status_sql']} - {$this->query_vars['type_sql']} - {$this->query_vars['currency_sql']} - {$this->query_vars['where_sql']} - {$this->query_vars['date_query_sql']}"; - - $initial_result = $this->get_db()->get_row( $initial_query ); - - if ( true === $this->query_vars['relative'] ) { - - $relative_date_query_sql = $this->generate_relative_date_query_sql(); - - $relative_query = "SELECT {$function} AS total - FROM {$this->query_vars['table']} - WHERE 1=1 - {$this->query_vars['status_sql']} - {$this->query_vars['type_sql']} - {$this->query_vars['currency_sql']} - {$this->query_vars['where_sql']} - {$relative_date_query_sql}"; - - $relative_result = $this->get_db()->get_row( $relative_query ); - } - - $total = null === $initial_result->total - ? 0.00 - : (float) $initial_result->total; - - if ( true === $this->query_vars['relative'] ) { - $total = -( floatval( $initial_result->total ) ); - $relative = -( floatval( $relative_result->total ) ); - $total = $this->generate_relative_markup( $total, $relative, true ); - } else { - $total = $this->maybe_format( -( $total ) ); - } - - // Reset query vars. - $this->post_query(); - - return $total; - } - - /** - * Calculate average time for an order to be refunded. - * - * @since 3.0 - * - * @see \EDD\Stats::get_order_earnings() - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `AVG` only. Default `AVG`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return string Average time for an order to be refunded in human readable format. - */ - public function get_average_refund_time( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['column'] = 'date_completed'; - $this->query_vars['date_query_column'] = 'date_created'; - - $type_sql = $this->get_db()->prepare( 'AND o2.type = %s', esc_sql( 'refund' ) ); - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $sql = "SELECT AVG( TIMESTAMPDIFF( SECOND, {$this->query_vars['table']}.{$this->query_vars['column']}, o2.date_created ) ) AS time_to_refund - FROM {$this->query_vars['table']} - INNER JOIN {$this->query_vars['table']} o2 ON {$this->query_vars['table']}.id = o2.parent - WHERE 1=1 {$type_sql} {$this->query_vars['currency_sql']} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - - $result = $this->get_db()->get_var( $sql ); - - $time_to_refund = null === $result - ? '' - : $result; - - // Beginning of time. - $base = strtotime( '1970-01-01 00:00:00' ); - - if ( ! empty( $time_to_refund ) ) { - $time_to_refund = absint( $time_to_refund ); - - $intervals = array( 'year', 'month', 'day', 'hour', 'minute', 'second' ); - $diffs = array(); - - foreach ( $intervals as $interval ) { - $time = strtotime( '+1 ' . $interval, $base ); - - $add = 1; - $looped = 0; - - while ( $time_to_refund >= $time ) { - $add++; - $time = strtotime( '+' . $add . ' ' . $interval, $base ); - $looped++; - } - - $base = strtotime( '+' . $looped . ' ' . $interval, $base ); - $diffs[ $interval ] = $looped; - } - - $count = 0; - $times = array(); - - foreach ( $diffs as $interval => $value ) { - - // Keep precision to 2. - if ( $count >= 2 ) { - break; - } - - // Add value and interval if value is bigger than 0. - if ( $value > 0 ) { - $interval = substr( $interval, 0, 1 ); - - // Add value and interval to times array. - $times[] = $value . $interval; - $count ++; - } - } - } - - // Reset query vars. - $this->post_query(); - - return empty( $time_to_refund ) - ? '' - : implode( ' ', $times ); - } - - /** - * Calculate refund rate. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * @type bool $exclude_taxes If taxes should be excluded from calculations. Default `false`. - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return float|int Rate of refunded orders. - */ - public function get_refund_rate( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $status_sql = $this->get_db()->prepare( "AND status = %s AND type = '%s'", esc_sql( 'complete' ), esc_sql( 'refund' ) ); - - $ignore_free = $this->get_db()->prepare( "AND {$this->query_vars['table']}.total > %d", 0 ); - - $sql = "SELECT COUNT(id ) / o.number_orders * 100 AS `refund_rate` - FROM {$this->query_vars['table']} - CROSS JOIN ( - SELECT COUNT(id) AS number_orders - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} {$this->query_vars['currency_sql']} {$ignore_free} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - ) o - WHERE 1=1 {$status_sql} {$this->query_vars['currency_sql']} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - - $result = $this->get_db()->get_var( $sql ); - - $total = null === $result - ? 0 - : round( $result, 2 ); - - if ( 'formatted' === $this->query_vars['output'] ) { - $total .= '%'; - $total = esc_html( $total ); - } - - // Reset query vars. - $this->post_query(); - - return $total; - } - - /** Order Items **********************************************************/ - - /** - * Calculate order item earnings. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type bool $exclude_taxes If taxes should be excluded from calculations. Default `false`. - * @type string $function SQL function. Default `SUM`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type int $product_id Product ID. If empty, an aggregation of the values in the `total` column in the - * `edd_order_items` table will be returned. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return array|float|int Formatted order item earnings. - */ - public function get_order_item_earnings( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_order_items; - $this->query_vars['column'] = true === $this->query_vars['exclude_taxes'] ? 'total - tax' : 'total'; - $this->query_vars['date_query_column'] = 'date_created'; - $this->query_vars['status'] = edd_get_gross_order_statuses(); - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $product_id = ! empty( $this->query_vars['product_id'] ) - ? $this->get_db()->prepare( "AND {$this->query_vars['table']}.product_id = %d", absint( $this->query_vars['product_id'] ) ) - : ''; - - $price_id = $this->generate_price_id_query_sql(); - - $region = ! empty( $this->query_vars['region'] ) - ? $this->get_db()->prepare( 'AND edd_oa.region = %s', esc_sql( $this->query_vars['region'] ) ) - : ''; - - $country = ! empty( $this->query_vars['country'] ) - ? $this->get_db()->prepare( 'AND edd_oa.country = %s', esc_sql( $this->query_vars['country'] ) ) - : ''; - - $status = ! empty( $this->query_vars['status'] ) - ? " AND {$this->query_vars['table']}.status IN ('" . implode( "', '", $this->query_vars['status'] ) . "')" - : ''; - - $join = $currency = ''; - if ( ! empty( $country ) || ! empty( $region ) ) { - $join .= " INNER JOIN {$this->get_db()->edd_order_addresses} edd_oa ON {$this->query_vars['table']}.order_id = edd_oa.order_id "; - } - - $join .= " INNER JOIN {$this->get_db()->edd_orders} edd_o ON ({$this->query_vars['table']}.order_id = edd_o.id) AND edd_o.status IN ('" . implode( "', '", $this->query_vars['status'] ) . "') "; - - if ( ! empty( $this->query_vars['currency'] ) && array_key_exists( strtoupper( $this->query_vars['currency'] ), edd_get_currencies() ) ) { - $currency = $this->get_db()->prepare( "AND edd_o.currency = %s", strtoupper( $this->query_vars['currency'] ) ); - } - - /** - * The adjustments query needs a different order status check than the order items. This is due to the fact that - * adjustments refunded would end up being double counted, and therefore create an inaccurate revenue report. - */ - $adjustments_join = " INNER JOIN {$this->get_db()->edd_orders} edd_o ON ({$this->query_vars['table']}.order_id = edd_o.id) AND edd_o.type = 'sale' AND edd_o.status IN ('" . implode( "', '", edd_get_net_order_statuses() ) . "') "; - - /** - * With the addition of including fees into the calcualtion, the order_items - * and order_adjustments for the order items needs to be a SUM and then the final function - * (SUM or AVG) needs to be run on the final UNION Query. - */ - $order_item_function = $this->get_amount_column_and_function( array( - 'column_prefix' => $this->query_vars['table'], - 'accepted_functions' => array( 'SUM', 'AVG' ), - 'requested_function' => 'SUM', - ) ); - - $order_adjustment_function = $this->get_amount_column_and_function( array( - 'column_prefix' => 'oadj', - 'accepted_functions' => array( 'SUM', 'AVG' ), - 'requested_function' => 'SUM', - ) ); - - $union_function = $this->get_amount_column_and_function( array( - 'column_prefix' => '', - 'accepted_functions' => array( 'SUM', 'AVG' ), - 'rate' => false, - ) ); - - if ( true === $this->query_vars['grouped'] ) { - $order_items = "SELECT - {$this->query_vars['table']}.product_id, - {$this->query_vars['table']}.price_id, - {$order_item_function} AS total - FROM {$this->query_vars['table']} - {$join} - WHERE 1=1 - {$product_id} - {$price_id} - {$region} - {$country} - {$currency} - {$this->query_vars['where_sql']} - {$this->query_vars['date_query_sql']} - GROUP BY {$this->query_vars['table']}.product_id, {$this->query_vars['table']}.price_id"; - - $order_adjustments = "SELECT - {$this->query_vars['table']}.product_id as product_id, - {$this->query_vars['table']}.price_id as price_id, - {$order_adjustment_function} as total - FROM {$this->get_db()->edd_order_adjustments} oadj - INNER JOIN {$this->query_vars['table']} ON - ({$this->query_vars['table']}.id = oadj.object_id) - {$product_id} - {$price_id} - {$region} - {$country} - {$currency} - {$adjustments_join} - WHERE oadj.object_type = 'order_item' - AND oadj.type != 'discount' - {$this->query_vars['date_query_sql']} - GROUP BY {$this->query_vars['table']}.product_id, {$this->query_vars['table']}.price_id"; - - $sql = "SELECT product_id, price_id, {$union_function} AS total - FROM ({$order_items} UNION {$order_adjustments})a - GROUP BY product_id, price_id - ORDER BY total DESC"; - } else { - $order_items = "SELECT - {$order_item_function} AS total - FROM {$this->query_vars['table']} - {$join} - WHERE 1=1 - {$product_id} - {$price_id} - {$region} - {$country} - {$currency} - {$this->query_vars['where_sql']} - {$this->query_vars['date_query_sql']}"; - - $order_adjustments = "SELECT - {$order_adjustment_function} as total - FROM {$this->get_db()->edd_order_adjustments} oadj - INNER JOIN {$this->query_vars['table']} ON - ({$this->query_vars['table']}.id = oadj.object_id) - {$product_id} - {$price_id} - {$region} - {$country} - {$currency} - {$adjustments_join} - WHERE oadj.object_type = 'order_item' - AND oadj.type != 'discount' - {$this->query_vars['date_query_sql']}"; - - $sql = "SELECT {$union_function} AS total FROM ({$order_items} UNION {$order_adjustments})a"; - } - - $result = $this->get_db()->get_results( $sql ); - - if ( true === $this->query_vars['grouped'] ) { - array_walk( $result, function ( &$value ) { - - // Format resultant object. - $value->product_id = absint( $value->product_id ); - $value->price_id = is_numeric( $value->price_id ) ? absint( $value->price_id ) : null; - $value->total = $this->maybe_format( $value->total ); - - // Add instance of EDD_Download to resultant object. - $value->object = edd_get_download( $value->product_id ); - } ); - } else { - $result = null === $result[0]->total - ? $this->maybe_format( 0.00 ) - : $this->maybe_format( floatval( $result[0]->total ) ); - } - - // Reset query vars. - $this->post_query(); - - return $result; - } - - /** - * Calculate the number of times a specific item has been purchased. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `COUNT` and `AVG`. Default `COUNT`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type int $product_id Product ID. If empty, an aggregation of the values in the `total` column in the - * `edd_order_items` table will be returned. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return array|int Number of times a specific item has been purchased. - */ - public function get_order_item_count( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_order_items; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - $this->query_vars['status'] = array( 'complete', 'partially_refunded' ); - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'column_prefix' => $this->query_vars['table'], - 'accepted_functions' => array( 'COUNT', 'AVG' ), - ) ); - - $product_id = ! empty( $this->query_vars['product_id'] ) - ? $this->get_db()->prepare( 'AND product_id = %d', absint( $this->query_vars['product_id'] ) ) - : ''; - - $price_id = $this->generate_price_id_query_sql(); - - $region = ! empty( $this->query_vars['region'] ) - ? $this->get_db()->prepare( 'AND edd_oa.region = %s', esc_sql( $this->query_vars['region'] ) ) - : ''; - - $country = ! empty( $this->query_vars['country'] ) - ? $this->get_db()->prepare( 'AND edd_oa.country = %s', esc_sql( $this->query_vars['country'] ) ) - : ''; - - $statuses = edd_get_net_order_statuses(); - $status_string = $this->get_placeholder_string( $statuses ); - - $join = $this->get_db()->prepare( - "INNER JOIN {$this->get_db()->edd_orders} edd_o ON ({$this->query_vars['table']}.order_id = edd_o.id) AND edd_o.status IN({$status_string}) AND edd_o.type = 'sale' ", - ...$statuses - ); - - $currency = ''; - if ( ! empty( $country ) || ! empty( $region ) ) { - $join .= " INNER JOIN {$this->get_db()->edd_order_addresses} edd_oa ON {$this->query_vars['table']}.order_id = edd_oa.order_id "; - } - if ( ! empty( $this->query_vars['currency'] ) && array_key_exists( strtoupper( $this->query_vars['currency'] ), edd_get_currencies() ) ) { - $currency = $this->get_db()->prepare( "AND edd_o.currency = %s", strtoupper( $this->query_vars['currency'] ) ); - } - - // Calculating an average requires a subquery. - if ( 'AVG' === $this->query_vars['function'] ) { - $sql = "SELECT AVG(id) AS total - FROM ( - SELECT COUNT({$this->query_vars['table']}.id) AS id - FROM {$this->query_vars['table']} - {$join} - WHERE 1=1 {$product_id} {$price_id} {$region} {$country} {$currency} {$this->query_vars['status_sql']} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY order_id - ) AS counts"; - } elseif ( true === $this->query_vars['grouped'] ) { - $sql = "SELECT product_id, price_id, {$function} AS total - FROM {$this->query_vars['table']} - {$join} - WHERE 1=1 {$product_id} {$price_id} {$region} {$country} {$currency} {$this->query_vars['status_sql']} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY product_id, price_id - ORDER BY total DESC"; - } else { - $sql = "SELECT {$function} AS total - FROM {$this->query_vars['table']} - {$join} - WHERE 1=1 {$product_id} {$price_id} {$region} {$country} {$currency} {$this->query_vars['status_sql']} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - } - - $result = $this->get_db()->get_results( $sql ); - - if ( true === $this->query_vars['grouped'] ) { - array_walk( $result, function ( &$value ) { - - // Format resultant object. - $value->product_id = absint( $value->product_id ); - $value->price_id = is_numeric( $value->price_id ) ? absint( $value->price_id ) : null; - $value->total = absint( $value->total ); - - // Add instance of EDD_Download to resultant object. - $value->object = edd_get_download( $value->product_id ); - } ); - } else { - $result = null === $result[0]->total - ? 0 - : absint( $result[0]->total ); - } - - // Reset query vars. - $this->post_query(); - - return $result; - } - - /** - * Calculate most valuable order items. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type bool $exclude_taxes If taxes should be excluded from calculations. Default `false`. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended to the - * query. - * @type int $number Number of order items to fetch. Default 1. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return array Array of objects with most valuable order items. Each object has the product ID, total earnings, - * and an instance of EDD_Download. - */ - public function get_most_valuable_order_items( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_order_items; - $this->query_vars['date_query_column'] = 'date_created'; - $this->query_vars['exclude_taxes'] = true; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - // By default, the most valuable customer is returned. - $number = isset( $this->query_vars['number'] ) - ? absint( $this->query_vars['number'] ) - : 1; - - $function = $this->get_amount_column_and_function( array( - 'column_prefix' => $this->query_vars['table'], - 'accepted_functions' => array( 'SUM' ) - ) ); - - $statuses = edd_get_net_order_statuses(); - $status_string = $this->get_placeholder_string( $statuses ); - - $where = $this->get_db()->prepare( - "AND {$this->get_db()->edd_order_items}.status IN('complete','partially_refunded') - AND {$this->get_db()->edd_orders}.status IN({$status_string}) ", - ...$statuses - ); - if ( ! empty( $this->query_vars['currency'] ) && array_key_exists( strtoupper( $this->query_vars['currency'] ), edd_get_currencies() ) ) { - $where .= $this->get_db()->prepare( - " AND {$this->get_db()->edd_orders}.currency = %s ", - strtoupper( $this->query_vars['currency'] ) - ); - } - - $sql = "SELECT product_id, price_id, {$function} AS total - FROM {$this->query_vars['table']} - INNER JOIN {$this->get_db()->edd_orders} ON({$this->get_db()->edd_orders}.id = {$this->query_vars['table']}.order_id) - WHERE 1=1 {$where} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY product_id, price_id - ORDER BY total DESC - LIMIT {$number}"; - - $result = $this->get_db()->get_results( $sql ); - - array_walk( $result, function ( &$value ) { - - // Format resultant object. - $value->product_id = absint( $value->product_id ); - $value->price_id = is_numeric( $value->price_id ) ? absint( $value->price_id ) : null; - $download_model = new \EDD\Models\Download( - $value->product_id, - $value->price_id, - array( - 'start' => $this->query_vars['start'], - 'end' => $this->query_vars['end'], - ) - ); - - $value->sales = absint( $download_model->get_net_sales() ); - $value->total = $this->maybe_format($download_model->get_net_earnings() ); - - // Add instance of EDD_Download to resultant object. - $value->object = edd_get_download( $value->product_id ); - } ); - - // Reset query vars. - $this->post_query(); - - return $result; - } - - /** Discounts ************************************************************/ - - /** - * Calculate the usage count of discount codes. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $discount_code Discount code to fetch the usage count for. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return int Number of times a discount code has been used. - */ - public function get_discount_usage_count( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_order_adjustments; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $discount_code = isset( $this->query_vars['discount_code'] ) - ? $this->get_db()->prepare( 'AND type = %s AND description = %s', 'discount', sanitize_text_field( $this->query_vars['discount_code'] ) ) - : $this->get_db()->prepare( 'AND type = %s', 'discount' ); - - $sql = "SELECT COUNT({$this->query_vars['column']}) - FROM {$this->query_vars['table']} - WHERE 1=1 {$discount_code} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - - $result = $this->get_db()->get_var( $sql ); - - $total = null === $result - ? 0 - : absint( $result ); - - // Reset query vars. - $this->post_query(); - - return $total; - } - - /** - * Retrieve the most popular discount code. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $discount_code Discount code to fetch the usage count for. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return array Most popular discounts with usage count. - */ - public function get_most_popular_discounts( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_order_adjustments; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - // By default, the most valuable discount is returned. - $number = isset( $this->query_vars['number'] ) - ? absint( $this->query_vars['number'] ) - : 1; - - $discount = $this->get_db()->prepare( 'AND type = %s', 'discount' ); - - $sql = "SELECT description AS code, COUNT({$this->query_vars['column']}) AS count - FROM {$this->query_vars['table']} - WHERE 1=1 {$discount} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY description - ORDER BY count DESC - LIMIT {$number}"; - - $result = $this->get_db()->get_results( $sql ); - - array_walk( $result, function ( &$value ) { - - // Add instance of EDD_Discount to resultant object. - $value->object = edd_get_discount_by_code( $value->code ); - - // Format resultant object. - if ( ! empty( $value->object ) ) { - $value->discount_id = absint( $value->object->id ); - $value->count = absint( $value->count ); - } else { - $value->discount_id = 0; - $value->count = '—'; - } - } ); - - // Reset query vars. - $this->post_query(); - - return $result; - } - - /** - * Calculate the savings from using a discount code. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type bool $exclude_taxes If taxes should be excluded from calculations. Default `false`. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $discount_code Discount code to fetch the savings amount for. Default empty. If empty, the amount - * saved from using any discount will be returned. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return float Savings from using a discount code. - */ - public function get_discount_savings( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_order_adjustments; - $this->query_vars['column'] = true === $this->query_vars['exclude_taxes'] ? 'total - tax' : 'total'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'SUM' ) - ) ); - - $discount_code = ! empty( $this->query_vars['discount_code'] ) - ? $this->get_db()->prepare( 'AND type = %s AND description = %s', 'discount', sanitize_text_field( $this->query_vars['discount_code'] ) ) - : $this->get_db()->prepare( 'AND type = %s', 'discount' ); - - $sql = "SELECT {$function} - FROM {$this->query_vars['table']} - WHERE 1=1 {$discount_code} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - - $result = $this->get_db()->get_var( $sql ); - - $total = null === $result - ? 0.00 - : floatval( $result ); - - $total = $this->maybe_format( $total ); - - // Reset query vars. - $this->post_query(); - - return $total; - } - - /** - * Calculate the average discount amount applied to an order. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type bool $exclude_taxes If taxes should be excluded from calculations. Default `false`. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return float Average discount amount applied to an order. - */ - public function get_average_discount_amount( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_order_adjustments; - $this->query_vars['column'] = 'total'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'AVG' ) - ) ); - - $type_discount = $this->get_db()->prepare( 'AND type = %s', 'discount' ); - - $sql = "SELECT {$function} - FROM {$this->query_vars['table']} - WHERE 1=1 {$type_discount} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - - $result = $this->get_db()->get_var( $sql ); - - $total = null === $result - ? 0.00 - : floatval( $result ); - - $total = $this->maybe_format( $total ); - - // Reset query vars. - $this->post_query(); - - return $total; - } - - /** - * Calculate the ratio of discounted to non-discounted orders. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return string Ratio of discounted to non-discounted orders. Format is A:B where A and B are integers. - */ - public function get_ratio_of_discounted_orders( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $sql = "SELECT COUNT(id) AS total, o.discounted_orders - FROM {$this->query_vars['table']} - CROSS JOIN ( - SELECT COUNT(id) AS discounted_orders - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} AND discount > 0 {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - ) o - WHERE 1=1 {$this->query_vars['status_sql']} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - - $result = $this->get_db()->get_row( $sql ); - - // No need to calculate the ratio if there are no orders. - if ( 0 === (int) $result->discounted_orders || 0 === (int) $result->total ) { - return 0; - } - - // Calculate GCD. - $result->total = absint( $result->total ); - $result->discounted_orders = absint( $result->discounted_orders ); - - $original_result = clone $result; - - while ( 0 !== $result->total ) { - $remainder = $result->discounted_orders % $result->total; - $result->discounted_orders = $result->total; - $result->total = $remainder; - } - - $ratio = absint( $result->discounted_orders ); - - // Reset query vars. - $this->post_query(); - - // Return the formatted ratio. - return ( $original_result->discounted_orders / $ratio ) . ':' . ( $original_result->total / $ratio ); - } - - /** Gateways *************************************************************/ - - /** - * Perform gateway calculations based on data passed. - * - * @internal This method must remain `private`, it exists to reduce duplicated code. - * - * @since 3.0 - * @access private - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * @type bool $exclude_taxes If taxes should be excluded from calculations. Default `false`. - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `COUNT`, `AVG`, and `SUM`. Default `COUNT`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $gateway Gateway name. This is checked against a list of registered payment gateways. - * If a gateway is not passed, a list of objects are returned for each gateway and the - * number of orders processed with that gateway. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return mixed array|int|float Either a list of payment gateways and counts or just a single value. - */ - private function get_gateway_data( $query = array() ) { - $query = wp_parse_args( $query, array( - 'type' => 'sale', - 'status' => edd_get_gross_order_statuses(), - ) ); - - $this->parse_query( $query ); - - // Set up default values. - $gateways = edd_get_payment_gateways(); - $defaults = array(); - - // Set up an object for each gateway. - foreach ( $gateways as $id => $data ) { - $object = new \stdClass(); - $object->gateway = $id; - $object->total = 0; - - $defaults[] = $object; - } - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'COUNT', 'AVG', 'SUM' ) - ) ); - - $gateway = ! empty( $this->query_vars['gateway'] ) - ? $this->get_db()->prepare( 'AND gateway = %s', sanitize_text_field( $this->query_vars['gateway'] ) ) - : ''; - - $sql = "SELECT gateway, {$function} AS total - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['type_sql']} {$this->query_vars['status_sql']} {$this->query_vars['currency_sql']} {$gateway} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY gateway"; - - $result = $this->get_db()->get_results( $sql ); - - // Ensure count values are always valid integers if counting sales. - if ( 'COUNT' === $this->query_vars['function'] ) { - array_walk( $result, function ( &$value ) { - $value->total = absint( $value->total ); - } ); - } elseif ( 'SUM' === $this->query_vars['function'] || 'AVG' === $this->query_vars['function'] ) { - array_walk( $result, function ( &$value ) { - $value->total = floatval( abs( $value->total ) ); - } ); - } - - if ( empty( $gateway ) && true === $this->query_vars['grouped'] ) { - $results = array(); - - // Merge defaults with values returned from the database. - foreach ( $defaults as $key => $value ) { - - // Filter based on gateway. - $filter = wp_filter_object_list( $result, array( 'gateway' => $value->gateway ) ); - - $filter = ! empty( $filter ) - ? array_values( $filter ) - : array(); - - if ( ! empty( $filter ) ) { - $results[] = $filter[0]; - } else { - $results[] = $defaults[ $key ]; - } - } - } elseif ( false === $this->query_vars['grouped'] ) { - $total = 0; - - array_walk( $result, function( $value ) use ( &$total ) { - $total += $value->total; - } ); - - $results = 'COUNT' === $this->query_vars['function'] - ? absint( $total ) - : $this->maybe_format( $total ); - } - - if ( ! empty( $gateway ) && true === $this->query_vars['grouped'] ) { - - // Filter based on gateway if passed. - $filter = wp_filter_object_list( $result, array( 'gateway' => $this->query_vars['gateway'] ) ); - - $results = 'COUNT' === $this->query_vars['function'] - ? absint( $filter[0]->total ) - : $this->maybe_format( $filter[0]->total ); - } - - // Reset query vars. - $this->post_query(); - - // Return array of objects with gateway name and count. - return $results; - } - - /** - * Calculate the number of processed by a gateway. - * - * @since 3.0 - * - * @see \EDD\Stats::get_gateway_data() - * - * @param array $query See \EDD\Stats::get_gateway_data(). - * - * @return int|array List of objects containing the number of sales processed either for every gateway or the gateway - * passed as a query parameter. - */ - public function get_gateway_sales( $query = array() ) { - - $query['column'] = 'id'; - $query['function'] = 'COUNT'; - - // Dispatch to \EDD\Stats::get_gateway_data(). - return $this->get_gateway_data( $query ); - } - - /** - * Calculate the total order amount of processed by a gateway. - * - * @since 3.0 - * - * @see \EDD\Stats::get_gateway_data() - * - * @param array $query See \EDD\Stats::get_gateway_data(). - * - * @return array List of objects containing the amount processed either for every gateway or the gateway - * passed as a query parameter. - */ - public function get_gateway_earnings( $query = array() ) { - - // Summation is required as we are returning earnings. - $query['function'] = isset( $query['function'] ) - ? $query['function'] - : 'SUM'; - - // Dispatch to \EDD\Stats::get_gateway_data(). - $result = $this->get_gateway_data( $query ); - - // Rename object var. - if ( is_array( $result ) ) { - array_walk( $result, function ( &$value ) { - $value->earnings = $value->total; - $value->earnings = $this->maybe_format( $value->earnings ); - unset( $value->total ); - } ); - } else { - $result = $this->maybe_format( $result ); - } - - // Reset query vars. - $this->post_query(); - - // Return array of objects with gateway name and earnings. - return $result; - } - - /** - * Calculate the amount for refunded orders processed by a gateway. - * - * @since 3.0 - * - * @see \EDD\Stats::get_gateway_earnings() - * - * @param array $query See \EDD\Stats::get_gateway_earnings(). - * - * @return array List of objects containing the amount for refunded orders processed either for every - * gateway or the gateway passed as a query parameter. - */ - public function get_gateway_refund_amount( $query = array() ) { - - // Ensure orders are refunded. - $this->query_vars['where_sql'] = $this->get_db()->prepare( 'AND status = %s', 'refunded' ); - - // Dispatch to \EDD\Stats::get_gateway_data(). - $result = $this->get_gateway_earnings( $query ); - - // Reset query vars. - $this->post_query(); - - // Return array of objects with gateway name and amount from refunded orders. - return $result; - } - - /** - * Calculate the average order amount of processed by a gateway. - * - * @since 3.0 - * - * @see \EDD\Stats::get_gateway_data() - * - * @param array $query See \EDD\Stats::get_gateway_data(). - * - * @return array List of objects containing the average order value processed either for every gateway - * pr the gateway passed as a query parameter. - */ - public function get_gateway_average_value( $query = array() ) { - - // Function needs to be `AVG`. - $query['function'] = 'AVG'; - - // Dispatch to \EDD\Stats::get_gateway_data(). - $result = $this->get_gateway_data( $query ); - - // Rename object var. - array_walk( $result, function( &$value ) { - $value->earnings = $value->count; - $value->earnings = $this->maybe_format( $value->earnings ); - unset( $value->count ); - } ); - - // Reset query vars. - $this->post_query(); - - // Return array of objects with gateway name and earnings. - return $result; - } - - /** Tax ******************************************************************/ - - /** - * Calculate total tax collected. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `SUM` and `AVG`. Default `SUM`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return string Formatted amount of total tax collected. - */ - public function get_tax( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['column'] = 'tax'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'SUM', 'AVG' ) - ) ); - - $product_id = ! empty( $this->query_vars['download_id'] ) - ? $this->get_db()->prepare( 'AND product_id = %d', absint( $this->query_vars['download_id'] ) ) - : ''; - - $price_id = $this->generate_price_id_query_sql(); - - if ( true === $this->query_vars['relative'] ) { - $relative_date_query_sql = $this->generate_relative_date_query_sql(); - - $sql = "SELECT IFNULL({$function}, 0) AS total, IFNULL(relative, 0) AS relative - FROM {$this->query_vars['table']} - CROSS JOIN ( - SELECT IFNULL({$function}, 0) AS relative - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} {$this->query_vars['currency_sql']} {$this->query_vars['where_sql']} {$relative_date_query_sql} - ) o - WHERE 1=1 {$this->query_vars['status_sql']} {$this->query_vars['currency_sql']} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - } elseif ( ! empty( $product_id ) || ! empty( $price_id ) ) { - - // Regenerate SQL clauses due to alias. - $table = $this->query_vars['table']; - $this->query_vars['table'] = 'o'; - $this->pre_query( $query ); - $this->query_vars['table'] = $table; - - $function = $this->get_amount_column_and_function( array( - 'column_prefix' => 'oi', - 'accepted_functions' => array( 'SUM', 'AVG' ) - ) ); - - $sql = "SELECT {$function} AS total - FROM {$this->query_vars['table']} o - INNER JOIN {$this->get_db()->edd_order_items} oi ON o.id = oi.order_id - WHERE 1=1 {$product_id} {$price_id} {$this->query_vars['status_sql']} {$this->query_vars['currency_sql']} {$this->query_vars['date_query_sql']}"; - - $this->pre_query( $query ); - } else { - $sql = "SELECT {$function} AS total - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} {$this->query_vars['currency_sql']} {$this->query_vars['date_query_sql']}"; - } - - $result = $this->get_db()->get_row( $sql ); - - $total = null === $result->total - ? 0.00 - : (float) $result->total; - - if ( true === $this->query_vars['relative'] ) { - $total = floatval( $result->total ); - $relative = floatval( $result->relative ); - $total = $this->generate_relative_markup( $total, $relative ); - } else { - $total = $this->maybe_format( $total ); - } - - // Reset query vars. - $this->post_query(); - - return $total; - } - - /** - * Calculate total tax collected for country and state passed. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Default `COUNT`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $country Country name. Defaults to store's base country. - * @type string $region Region name. Defaults to store's base state. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return string Formatted amount of total tax collected for country and state passed. - */ - public function get_tax_by_location( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['column'] = 'tax'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'column_prefix' => $this->query_vars['table'], - 'accepted_functions' => array( 'SUM', 'AVG' ) - ) ); - - $region = ! empty( $this->query_vars['region'] ) - ? $this->get_db()->prepare( 'AND oa.region = %s', esc_sql( $this->query_vars['region'] ) ) - : ''; - - $country = ! empty( $this->query_vars['country'] ) - ? $this->get_db()->prepare( 'AND oa.country = %s', esc_sql( $this->query_vars['country'] ) ) - : ''; - - $product_id = ! empty( $this->query_vars['download_id'] ) - ? $this->get_db()->prepare( 'AND oi.product_id = %d', absint( $this->query_vars['download_id'] ) ) - : ''; - - $price_id = ! is_null( $this->query_vars['price_id'] ) && is_numeric( $this->query_vars['price_id'] ) - ? $this->get_db()->prepare( 'AND oi.price_id = %d', absint( $this->query_vars['price_id'] ) ) - : ''; - - $join = ! empty( $product_id ) - ? "INNER JOIN {$this->get_db()->edd_order_items} oi ON {$this->query_vars['table']}.id = oi.order_id" - : ''; - - // Re-parse function to fetch tax from the order items table. - if ( ! empty( $product_id ) && 'tax' === $this->query_vars['column'] ) { - $function = $this->get_amount_column_and_function( array( - 'column_prefix' => 'oi', - 'accepted_functions' => array( 'SUM', 'AVG' ) - ) ); - } - - $sql = "SELECT {$function} AS total - FROM {$this->query_vars['table']} - INNER JOIN {$this->get_db()->edd_order_addresses} oa ON {$this->query_vars['table']}.id = oa.order_id - {$join} - WHERE 1=1 {$region} {$country} {$product_id} {$price_id} {$this->query_vars['status_sql']} {$this->query_vars['currency_sql']} {$this->query_vars['date_query_sql']}"; - - $result = $this->get_db()->get_row( $sql ); - - $total = null === $result->total - ? 0.00 - : (float) $result->total; - - $total = $this->maybe_format( $total ); - - // Reset query vars. - $this->post_query(); - - return $total; - } - - /** Customers ************************************************************/ - - /** - * Calculate the number of customers. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return int Number of customers. - */ - public function get_customer_count( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_customers; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $where = $this->query_vars['where_sql']; - // Allow `purchase_count` to be set to `true` to query only customers with orders. - if ( isset( $query['purchase_count'] ) && true === $query['purchase_count'] ) { - $where .= " AND {$this->query_vars['table']}.purchase_count > 0"; - } - - if ( true === $this->query_vars['relative'] ) { - $relative_date_query_sql = $this->generate_relative_date_query_sql(); - - $sql = "SELECT IFNULL(COUNT(id), 0) AS total, IFNULL(relative, 0) AS relative - FROM {$this->query_vars['table']} - CROSS JOIN ( - SELECT IFNULL(COUNT(id), 0) AS relative - FROM {$this->query_vars['table']} - WHERE 1=1 {$where} {$relative_date_query_sql} - ) o - WHERE 1=1 {$where} {$this->query_vars['date_query_sql']}"; - } else { - $sql = "SELECT COUNT(id) AS total - FROM {$this->query_vars['table']} - WHERE 1=1 {$where} {$this->query_vars['date_query_sql']}"; - } - - $result = $this->get_db()->get_row( $sql ); - - $total = null === $result->total - ? 0 - : absint( $result->total ); - - if ( 'array' === $this->query_vars['output'] ) { - $output = array( - 'value' => $total, - 'relative_data' => ( true === $this->query_vars['relative'] ) ? $this->generate_relative_data( absint( $result->total ), absint( $result->relative ) ) : array(), - ); - } else { - if ( true === $this->query_vars['relative'] ) { - $output = $this->generate_relative_markup( absint( $result->total ), absint( $result->relative ) ); - } else { - $output = $this->maybe_format( $total ); - } - } - - // Reset query vars. - $this->post_query(); - - return $output; - } - - /** - * Calculate the lifetime value of a customer. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type bool $exclude_taxes If taxes should be excluded from calculations. Default `false`. - * @type string $function SQL function. Accepts `AVG` and `SUM`. Default `SUM`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type int $customer_id Customer ID. Default empty. - * @type int $user_id User ID. Default empty. - * @type string $email Email address. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return string Formatted lifetime value of a customer. - */ - public function get_customer_lifetime_value( $query = array() ) { - $this->parse_query( $query ); - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['column'] = 'total'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'SUM', 'AVG' ) - ) ); - - $user = isset( $this->query_vars['user_id'] ) - ? $this->get_db()->prepare( 'AND user_id = %d', absint( $this->query_vars['user_id'] ) ) - : ''; - - $customer = isset( $this->query_vars['customer'] ) - ? $this->get_db()->prepare( 'AND customer_id = %d', absint( $this->query_vars['customer'] ) ) - : ''; - - $email = isset( $this->query_vars['email'] ) - ? $this->get_db()->prepare( 'AND email = %s', absint( $this->query_vars['email'] ) ) - : ''; - - $function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'SUM', 'AVG' ), - 'rate' => false - ) ); - - $inner_function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'SUM' ) - ) ); - - $sql = "SELECT {$function} AS total - FROM ( - SELECT {$inner_function} AS total - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} {$this->query_vars['currency_sql']} {$user} {$customer} {$email} {$this->query_vars['date_query_sql']} - GROUP BY customer_id - ) o"; - - $result = $this->get_db()->get_row( $sql ); - - $total = null === $result->total - ? 0.00 - : (float) $result->total; - - $total = $this->maybe_format( $total ); - - // Reset query vars. - $this->post_query(); - - return $total; - } - - /** - * Calculate the number of orders made by a customer. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `AVG` and `SUM`. Default `SUM`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type int $customer_id Customer ID. Default empty. - * @type int $user_id User ID. Default empty. - * @type string $email Email address. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return int Number of orders made by a customer. - */ - public function get_customer_order_count( $query = array() ) { - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $function = $this->get_amount_column_and_function( array( - 'accepted_functions' => array( 'COUNT', 'AVG' ) - ) ); - - $user = isset( $this->query_vars['user_id'] ) - ? $this->get_db()->prepare( 'AND user_id = %d', absint( $this->query_vars['user_id'] ) ) - : ''; - - $customer = isset( $this->query_vars['customer'] ) - ? $this->get_db()->prepare( 'AND customer_id = %d', absint( $this->query_vars['customer'] ) ) - : ''; - - $email = isset( $this->query_vars['email'] ) - ? $this->get_db()->prepare( 'AND email = %s', sanitize_email( $this->query_vars['email'] ) ) - : ''; - - if ( true === $this->query_vars['relative'] ) { - $relative_date_query_sql = $this->generate_relative_date_query_sql(); - - if ( 'AVG(id)' === $function ) { - $sql = "SELECT COUNT(id) / COUNT(DISTINCT customer_id) AS total, IFNULL(relative, 0) AS relative - FROM {$this->query_vars['table']} - CROSS JOIN ( - SELECT COUNT(id) / COUNT(DISTINCT customer_id) AS relative - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} {$user} {$customer} {$email} {$this->query_vars['where_sql']} {$relative_date_query_sql} - ) o - WHERE 1=1 {$this->query_vars['status_sql']} {$user} {$customer} {$email} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - } else { - $sql = "SELECT COUNT(id) AS total, IFNULL(relative, 0) AS relative - FROM {$this->query_vars['table']} - CROSS JOIN ( - SELECT COUNT(id), IFNULL(relative, 0) AS relative - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} {$user} {$customer} {$email} {$this->query_vars['where_sql']} {$relative_date_query_sql} - ) o - WHERE 1=1 {$this->query_vars['status_sql']} {$user} {$customer} {$email} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - } - } else { - if ( 'AVG(id)' === $function ) { - $sql = "SELECT COUNT(id) / COUNT(DISTINCT customer_id) AS total - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} {$user} {$customer} {$email} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - } else { - $sql = "SELECT COUNT(id) as total - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} {$user} {$customer} {$email} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - } - } - $result = $this->get_db()->get_row( $sql ); - - $total = null === $result - ? 0 - : absint( $result->total ); - - if ( true === $this->query_vars['relative'] ) { - $total = absint( $result->total ); - $relative = absint( $result->relative ); - $total = $this->generate_relative_markup( $total, $relative ); - } else { - $total = $this->maybe_format( $total ); - } - - // Reset query vars. - $this->post_query(); - return $total; - } - - /** - * Calculate the average age of a customer. - * - * @since 3.0 - * - * @see \EDD\Stats::get_order_count() - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return int|float Average age of a customer. - */ - public function get_customer_age( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_customers; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $sql = "SELECT AVG(DATEDIFF(NOW(), date_created)) - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['date_query_sql']}"; - - $result = $this->get_db()->get_var( $sql ); - - // Reset query vars. - $this->post_query(); - - return null === $result - ? 0 - : round( $result, 2 ); - } - - /** - * Calculate the most valuable customers. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type bool $exclude_taxes If taxes should be excluded from calculations. Default `false`. - * @type string $function This method does not allow any SQL functions to be passed. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type int $number Number of customers to fetch. Default 1. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return array Array of objects with most valuable customers. Each object has the customer ID, total amount spent - * by that customer and an instance of EDD_Customer. - */ - public function get_most_valuable_customers( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_orders; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - // By default, the most valuable customer is returned. - $number = isset( $this->query_vars['number'] ) - ? absint( $this->query_vars['number'] ) - : 1; - - $column = true === $this->query_vars['exclude_taxes'] - ? 'total - tax' - : 'total'; - - $sql = "SELECT customer_id, SUM({$column}) AS total - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['status_sql']} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY customer_id - ORDER BY total DESC - LIMIT {$number}"; - - $result = $this->get_db()->get_results( $sql ); - - array_walk( $result, function ( &$value ) { - - // Format resultant object. - $value->customer_id = absint( $value->customer_id ); - $value->total = $this->maybe_format( $value->total ); - - // Add instance of EDD_Download to resultant object. - $value->object = edd_get_customer( $value->customer_id ); - } ); - - // Reset query vars. - $this->post_query(); - - return $result; - } - - /** File Downloads *******************************************************/ - - /** - * Calculate the number of file downloads. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `COUNT` and `AVG`. Default `COUNT`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return int Number of file downloads. - */ - public function get_file_download_count( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_logs_file_downloads; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - // Only `COUNT` and `AVG` are accepted by this method. - $accepted_functions = array( 'COUNT', 'AVG' ); - - $function = isset( $this->query_vars['function'] ) && in_array( strtoupper( $this->query_vars['function'] ), $accepted_functions, true ) - ? $this->query_vars['function'] . "({$this->query_vars['column']})" - : 'COUNT(id)'; - - $product_id = ! empty( $this->query_vars['download_id'] ) - ? $this->get_db()->prepare( 'AND product_id = %d', absint( $this->query_vars['download_id'] ) ) - : ''; - - $price_id = $this->generate_price_id_query_sql(); - - if ( true === $this->query_vars['relative'] ) { - $relative_date_query_sql = $this->generate_relative_date_query_sql(); - - $sql = "SELECT IFNULL({$function}, 0) AS total, IFNULL(relative, 0) AS relative - FROM {$this->query_vars['table']} - CROSS JOIN ( - SELECT IFNULL({$function}, 0) AS relative - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['where_sql']} {$relative_date_query_sql} - ) o - WHERE 1=1 {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']}"; - } else { - $sql = "SELECT {$function} AS total - FROM {$this->query_vars['table']} - WHERE 1=1 {$product_id} {$price_id} {$this->query_vars['date_query_sql']}"; - } - - $result = $this->get_db()->get_row( $sql ); - - $total = null === $result->total - ? 0 - : absint( $result->total ); - - if ( true === $this->query_vars['relative'] ) { - $total = absint( $result->total ); - $relative = absint( $result->relative ); - $total = $this->generate_relative_markup( $total, $relative ); - } else { - $total = $this->maybe_format( $total ); - } - - // Reset query vars. - $this->post_query(); - - return $total; - } - - /** - * Calculate most downloaded products. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `COUNT` and `AVG`. Default `COUNT`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return array Array of objects with most valuable order items. Each object has the product ID, number of downloads, - * and an instance of EDD_Download. - */ - public function get_most_downloaded_products( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_logs_file_downloads; - $this->query_vars['column'] = 'id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - // By default, the most valuable customer is returned. - $number = isset( $this->query_vars['number'] ) - ? absint( $this->query_vars['number'] ) - : 1; - - $sql = "SELECT product_id, file_id, COUNT(id) AS total - FROM {$this->query_vars['table']} - WHERE 1=1 {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY product_id - ORDER BY total DESC - LIMIT {$number}"; - - $result = $this->get_db()->get_results( $sql ); - - array_walk( $result, function ( &$value ) { - - // Format resultant object. - $value->product_id = absint( $value->product_id ); - $value->file_id = absint( $value->file_id ); - $value->total = absint( $value->total ); - - // Add instance of EDD_Download to resultant object. - $value->object = edd_get_download( $value->product_id ); - } ); - - // Reset query vars. - $this->post_query(); - - return $result; - } - - /** - * Calculate average number of file downloads. - * - * @since 3.0 - * - * @param array $query { - * Optional. Array of query parameters. - * Default empty. - * - * Each method accepts query parameters to be passed. Parameters passed to methods override the ones passed in - * the constructor. This is by design to allow for multiple calculations to be executed from one instance of - * this class. - * - * @type string $start Start day and time (based on the beginning of the given day). - * @type string $end End day and time (based on the end of the given day). - * @type string $range Date range. If a range is passed, this will override and `start` and `end` - * values passed. See \EDD\Reports\get_dates_filter_options() for valid date ranges. - * @type string $function SQL function. Accepts `COUNT` and `AVG`. Default `COUNT`. - * @type string $where_sql Reserved for internal use. Allows for additional WHERE clauses to be appended - * to the query. - * @type string $output The output format of the calculation. Accepts `raw` and `formatted`. Default `raw`. - * } - * - * @return int Average file downloads. - */ - public function get_average_file_download_count( $query = array() ) { - - // Add table and column name to query_vars to assist with date query generation. - $this->query_vars['table'] = $this->get_db()->edd_logs_file_downloads; - $this->query_vars['column'] = 'customer_id'; - $this->query_vars['date_query_column'] = 'date_created'; - - // Run pre-query checks and maybe generate SQL. - $this->pre_query( $query ); - - $product_id = ! empty( $this->query_vars['download_id'] ) - ? $this->get_db()->prepare( 'AND product_id = %d', absint( $this->query_vars['download_id'] ) ) - : ''; - - $price_id = $this->generate_price_id_query_sql(); - - $file_id = ! empty( $this->query_vars['file_id'] ) - ? $this->get_db()->prepare( 'AND file_id = %d', absint( $this->query_vars['file_id'] ) ) - : ''; - - $sql = "SELECT AVG(total) AS total - FROM ( - SELECT {$this->query_vars['column']}, COUNT(id) AS total - FROM {$this->query_vars['table']} - WHERE 1=1 {$product_id} {$price_id} {$this->query_vars['where_sql']} {$this->query_vars['date_query_sql']} - GROUP BY {$this->query_vars['column']} - ) o"; - - $result = $this->get_db()->get_var( $sql ); - - $result = null === $result - ? 0 - : absint( $result ); - - // Reset query vars. - $this->post_query(); - - return $result; - } - - /** Private Methods ******************************************************/ - - /** - * Parse query vars to be passed to the calculation methods. - * - * @since 3.0 - * @access private - * - * @see \EDD\Stats::__construct() - * - * @param array $query Array of arguments. See \EDD\Stats::__construct(). - */ - private function parse_query( $query = array() ) { - $query_var_defaults = array( - 'start' => '', - 'end' => '', - 'range' => '', - 'exclude_taxes' => false, - 'currency' => false, - 'currency_sql' => '', - 'status' => array(), - 'status_sql' => '', - 'type' => array(), - 'type_sql' => '', - 'where_sql' => '', - 'date_query_sql' => '', - 'date_query_column' => '', - 'column' => '', - 'table' => '', - 'function' => 'SUM', - 'output' => 'raw', - 'relative' => false, - 'relative_start' => '', - 'relative_end' => '', - 'grouped' => false, - 'product_id' => '', - 'price_id' => null, - 'revenue_type' => 'gross', - 'country' => '', - 'region' => '', - ); - - if ( empty( $this->query_vars ) ) { - $this->query_vars_defaults = $this->query_vars = wp_parse_args( $query, $query_var_defaults ); - } else { - $this->query_vars = wp_parse_args( $query, $this->query_vars ); - } - - // Use Carbon to set up start and end date based on range passed. - if ( ! empty( $this->query_vars['range'] ) && isset( $this->date_ranges[ $this->query_vars['range'] ] ) ) { - - if ( ! empty( $this->date_ranges[ $this->query_vars['range'] ]['start'] ) ) { - $this->query_vars['start'] = $this->date_ranges[ $this->query_vars['range'] ]['start']->format( 'mysql' ); - } - - if ( ! empty( $this->date_ranges[ $this->query_vars['range'] ]['end'] ) ) { - $this->query_vars['end'] = $this->date_ranges[ $this->query_vars['range'] ]['end']->format( 'mysql' ); - } - } - - // Use Carbon to set up start and end date based on range passed. - if ( true === $this->query_vars['relative'] && ! empty( $this->query_vars['range'] ) && isset( $this->relative_date_ranges[ $this->query_vars['range'] ] ) ) { - - if ( ! empty( $this->relative_date_ranges[ $this->query_vars['range'] ]['start'] ) ) { - $this->query_vars['relative_start'] = $this->relative_date_ranges[ $this->query_vars['range'] ]['start']->format( 'mysql' ); - } - - if ( ! empty( $this->relative_date_ranges[ $this->query_vars['range'] ]['end'] ) ) { - $this->query_vars['relative_end'] = $this->relative_date_ranges[ $this->query_vars['range'] ]['end']->format( 'mysql' ); - } - } - - // Validate currency. - if ( empty( $this->query_vars['currency'] ) ) { - $this->query_vars['currency'] = false; - } elseif ( array_key_exists( strtoupper( $this->query_vars['currency'] ), edd_get_currencies() ) ) { - $this->query_vars['currency'] = strtoupper( $this->query_vars['currency'] ); - } else { - $this->query_vars['currency'] = 'convert'; - } - - // Correctly format functions and column names. - if ( ! empty( $this->query_vars['function'] ) ) { - $this->query_vars['function'] = strtoupper( $this->query_vars['function'] ); - } - - if ( ! empty( $this->query_vars['column'] ) ) { - $this->query_vars['column'] = strtolower( $this->query_vars['column'] ); - } - - /** Parse country ****************************************************/ - $country = isset( $this->query_vars['country'] ) - ? sanitize_text_field( $this->query_vars['country'] ) - : ''; - - if ( $country ) { - $country_list = array_filter( edd_get_country_list() ); - - // Maybe convert country code to country name. - $country = in_array( $country, array_flip( $country_list ), true ) - ? $country_list[ $country ] - : $country; - - // Ensure a valid county has been passed. - $country = in_array( $country, $country_list, true ) - ? $country - : null; - - // Convert back to country code for SQL query. - $country_list = array_flip( $country_list ); - $this->query_vars['country'] = is_null( $country ) - ? '' - : $country_list[ $country ]; - } - - /** Parse state ******************************************************/ - - $state = isset( $this->query_vars['region'] ) - ? sanitize_text_field( $this->query_vars['region'] ) - : ''; - - // Only parse state if one was passed. - if ( $state ) { - $state_list = array_filter( edd_get_shop_states( $this->query_vars['country'] ) ); - - // Maybe convert state code to state name. - $state = in_array( $state, array_flip( $state_list ), true ) - ? $state_list[ $state ] - : $state; - - // Ensure a valid state has been passed. - $state = in_array( $state, $state_list, true ) - ? $state - : null; - - // Convert back to state code for SQL query. - $state_codes = array_flip( $state_list ); - $this->query_vars['region'] = is_null( $state ) - ? '' - : $state_codes[ $state ]; - } - - /** - * Fires after the item query vars have been parsed. - * - * @since 3.0 - * - * @param \EDD\Stats &$this The \EDD\Stats (passed by reference). - */ - do_action_ref_array( 'edd_order_stats_parse_query', array( &$this ) ); - } - - /** - * Ensures arguments exist before going ahead and calculating statistics. - * - * @since 3.0 - * @access private - * - * @param array $query - */ - private function pre_query( $query = array() ) { - - // Maybe parse query. - if ( ! empty( $query ) ) { - $this->parse_query( $query ); - } - - // Generate date query SQL if dates have been set. - if ( ! empty( $this->query_vars['start'] ) || ! empty( $this->query_vars['end'] ) ) { - $date_query_sql = ' AND '; - - if ( ! empty( $this->query_vars['start'] ) ) { - $start_date = EDD()->utils->date( $this->query_vars['start'], edd_get_timezone_id(), false )->format( 'mysql' ); - $date_query_sql .= "{$this->query_vars['table']}.{$this->query_vars['date_query_column']} "; - $date_query_sql .= $this->get_db()->prepare( '>= %s', $start_date ); - } - - // Join dates with `AND` if start and end date set. - if ( ! empty( $this->query_vars['start'] ) && ! empty( $this->query_vars['end'] ) ) { - $date_query_sql .= ' AND '; - } - - if ( ! empty( $this->query_vars['end'] ) ) { - $end_date = EDD()->utils->date( $this->query_vars['end'], edd_get_timezone_id(), false )->format( 'mysql' ); - $date_query_sql .= $this->get_db()->prepare( "{$this->query_vars['table']}.{$this->query_vars['date_query_column']} <= %s", $end_date ); - } - - $this->query_vars['date_query_sql'] = $date_query_sql; - } - - // Generate status SQL if statuses have been set. - if ( ! empty( $this->query_vars['status'] ) ) { - if ( 'any' === $this->query_vars['status'] ) { - $this->query_vars['status_sql'] = ''; - } else { - $this->query_vars['status'] = array_map( 'sanitize_text_field', $this->query_vars['status'] ); - - $placeholders = $this->get_placeholder_string( $this->query_vars['status'] ); - - $this->query_vars['status_sql'] = $this->get_db()->prepare( "AND {$this->query_vars['table']}.status IN ({$placeholders})", $this->query_vars['status'] ); - } - } - - if ( ! empty( $this->query_vars['type'] ) ) { - - // We always want to format this as an array, so account for a possible string. - if ( ! is_array( $this->query_vars['type'] ) ) { - $this->query_vars['type'] = array( $this->query_vars['type'] ); - } - - $this->query_vars['type'] = array_map( 'sanitize_text_field', $this->query_vars['type'] ); - - $placeholders = $this->get_placeholder_string( $this->query_vars['type'] ); - - $this->query_vars['type_sql'] = $this->get_db()->prepare( "AND {$this->query_vars['table']}.type IN ({$placeholders})", $this->query_vars['type'] ); - } - - if ( ! empty( $this->query_vars['currency'] ) && 'convert' !== strtolower( $this->query_vars['currency'] ) ) { - $this->query_vars['currency_sql'] = $this->get_db()->prepare( "AND {$this->query_vars['table']}.currency = %s", $this->query_vars['currency'] ); - } - } - - /** - * Runs after a query. Resets query vars back to the originals passed in via the constructor. - * - * @since 3.0 - * @access private - */ - private function post_query() { - $this->query_vars = $this->query_var_originals; - } - - /** - * Format the data if requested via the query parameter. - * - * @since 3.0 - * @access private - * - * @param mixed $data Data to format. - * - * @return mixed Raw or formatted data depending on query parameter. - */ - private function maybe_format( $data = null ) { - - // Bail if nothing was passed. - if ( null === $data ) { - return $data; - } - - $allowed_output_formats = array( 'raw', 'typed', 'formatted' ); - - // Output format. Default raw. - $output = isset( $this->query_vars['output'] ) && in_array( $this->query_vars['output'], $allowed_output_formats, true ) - ? $this->query_vars['output'] - : 'raw'; - - // Return data as is if the format is raw. - if ( 'raw' === $output ) { - return $data; - } - - $currency = $this->query_vars['currency']; - if ( empty( $currency ) || 'convert' === strtolower( $currency ) ) { - $currency = edd_get_currency(); - } - - if ( is_object( $data ) ) { - foreach ( array_keys( get_object_vars( $data ) ) as $field ) { - if ( is_numeric( $data->{$field} ) ) { - $data->{$field} = edd_format_amount( $data->{$field}, true, $currency, $output ); - - if ( 'formatted' === $output ) { - $data->{$field} = edd_currency_filter( $data->{$field}, $currency ); - } - } - } - } elseif ( is_array( $data ) ) { - foreach ( array_keys( $data ) as $field ) { - if ( is_numeric( $data[ $field ] ) ) { - $data[ $field ] = edd_format_amount( $data[ $field ], true, $currency, $output ); - - if ( 'formatted' === $output ) { - $data[ $field ] = edd_currency_filter( $data[ $field ], $currency ); - } - } - } - } else { - if ( is_numeric( $data ) ) { - $data = edd_format_amount( $data, true, $currency, $output ); - - if ( 'formatted' === $output ) { - $data = edd_currency_filter( $data, $currency ); - } - } - } - - return $data; - } - - /** - * Generate date query SQL for relative time periods. - * - * @since 3.0 - * @access protected - * - * @return string Date query SQL. - */ - private function generate_relative_date_query_sql() { - - // Bail if relative calculation not requested. - if ( false === $this->query_vars['relative'] ) { - return ''; - } - - // Generate date query SQL if dates have been set. - if ( ! empty( $this->query_vars['relative_start'] ) || ! empty( $this->query_vars['relative_end'] ) ) { - $date_query_sql = "AND {$this->query_vars['table']}.{$this->query_vars['date_query_column']} "; - - if ( ! empty( $this->query_vars['relative_start'] ) ) { - $date_query_sql .= $this->get_db()->prepare( '>= %s', $this->query_vars['relative_start'] ); - } - - // Join dates with `AND` if start and end date set. - if ( ! empty( $this->query_vars['relative_start'] ) && ! empty( $this->query_vars['relative_end'] ) ) { - $date_query_sql .= ' AND '; - } - - if ( ! empty( $this->query_vars['relative_end'] ) ) { - $date_query_sql .= $this->get_db()->prepare( "{$this->query_vars['table']}.{$this->query_vars['date_query_column']} <= %s", $this->query_vars['relative_end'] ); - } - - return $date_query_sql; - } - } - - /** - * Generates price ID query SQL. - * - * @since 3.0 - * @return string - */ - private function generate_price_id_query_sql() { - return ! is_null( $this->query_vars['price_id'] ) && is_numeric( $this->query_vars['price_id'] ) - ? $this->get_db()->prepare( "AND {$this->query_vars['table']}.price_id = %d", absint( $this->query_vars['price_id'] ) ) - : ''; - } - - /** Private Getters *******************************************************/ - - /** - * Return the global database interface. - * - * @since 3.0 - * @access private - * @static - * - * @return \wpdb|\stdClass - */ - private static function get_db() { - return isset( $GLOBALS['wpdb'] ) - ? $GLOBALS['wpdb'] - : new \stdClass(); - } - - /** Private Setters ******************************************************/ - - /** - * Set up the date ranges available. - * - * @since 3.0 - * @access private - */ - private function set_date_ranges() { - - // Retrieve the time in UTC for the date ranges to be correctly parsed. - $date = EDD()->utils->date( 'now', edd_get_timezone_id(), false ); - - $date_filters = Reports\get_dates_filter_options(); - $filter = Reports\get_filter_value( 'dates' ); - - foreach ( $date_filters as $range => $label ) { - $this->date_ranges[ $range ] = Reports\parse_dates_for_range( $range ); - $this->relative_date_ranges[ $range ] = Reports\parse_relative_dates_for_range( $range ); - } - - } - - /** - * Based on the query_vars['revenue_type'], use gross or net statuses. - * - * @since 3.0 - * - * @return array The statuses of orders to use for the stats generation. - */ - private function get_revenue_type_statuses() { - if ( 'net' === $this->query_vars['revenue_type'] ) { - return edd_get_net_order_statuses(); - } - - return edd_get_gross_order_statuses(); - } - - /** - * Based on the query_vars['revenue_type'], use just sale or also include refunds. - * - * @since 3.0 - * - * @return array The order types to use when generating stats. - */ - private function get_revenue_type_order_types() { - $order_types = array( 'sale' ); - if ( 'net' === $this->query_vars['revenue_type'] ) { - $order_types[] = 'refund'; - } - - return $order_types; - } - - /** - * Calculates the relative change between two datasets - * and outputs an array of details about comparison. - * - * @since 3.1 - * - * @param int|float $total The primary value result for the stat. - * @param int|float $relative The value relative to the previous date range. - * @param bool $reverse If the stat being displayed is a 'reverse' state, where lower is better. - * - * @return array Details about the relative change between two datasets. - */ - public function generate_relative_data( $total = 0, $relative = 0, $reverse = false ) { - $output = array( - 'comparable' => true, - 'no_change' => false, - 'percentage_change' => false, - 'formatted_percentage_change' => false, - 'positive_change' => false, - 'total' => $total, - 'relative' => $relative, - 'reverse' => $reverse, - ); - - if ( ( floatval( 0 ) === floatval( $total ) && floatval( 0 ) === floatval( $relative ) ) || ( $total === $relative ) ) { - // There is no change between datasets. - $output['no_change'] = true; - } else if ( floatval( 0 ) !== floatval( $relative ) ) { - // There is a calculatable difference between datasets. - $percentage_change = ( $total - $relative ) / $relative * 100; - $formatted_percentage_change = absint( $percentage_change ); - $positive_change = false; - - if ( absint( $percentage_change ) < 100 ) { - $formatted_percentage_change = number_format( $percentage_change, 2 ); - $formatted_percentage_change = $formatted_percentage_change < 1 ? $formatted_percentage_change * -1 : $formatted_percentage_change; - } - - // Check if stat is in a 'reverse' state, where lower is better. - $positive_change = (bool) ! $reverse; - if ( 0 > $percentage_change ) { - $positive_change = (bool) $reverse; - } - - $output['percentage_change'] = $percentage_change; - $output['formatted_percentage_change'] = $formatted_percentage_change; - $output['positive_change'] = $positive_change; - } else { - // There is no data to compare. - $output['comparable'] = false; - } - - return $output; - } - - /** - * Generates output for the report tiles when a relative % change is requested. - * - * @since 3.0 - * - * @param int|float $total The primary value result for the stat. - * @param int|float $relative The value relative to the previous date range. - * @param bool $reverse If the stat being displayed is a 'reverse' state, where lower is better. - */ - private function generate_relative_markup( $total = 0, $relative = 0, $reverse = false ) { - - $relative_data = $this->generate_relative_data( $total, $relative, $reverse ); - $total_output = $this->maybe_format( $relative_data['total'] ); - $relative_markup = ''; - - if ( $relative_data['no_change'] ) { - $relative_output = esc_html__( 'No Change', 'easy-digital-downloads' ); - } else if ( $relative_data['comparable'] ) { - if ( 0 < $relative_data['percentage_change'] ) { - $direction = $relative_data['reverse'] ? 'up reverse' : 'up'; - $relative_output = ' ' . $relative_data['formatted_percentage_change'] . '%'; - } else { - $direction = $relative_data['reverse'] ? 'down reverse' : 'down'; - $relative_output = ' ' . $relative_data['formatted_percentage_change'] . '%'; - } - } else { - $relative_output = '' . __( 'No data to compare', 'easy-digital-downloads' ) . ''; - } - - $relative_markup = $total_output; - if ( ! empty( $relative_output ) ) { - $relative_markup .= '
    ' . $relative_output . '
    '; - } - - return $relative_markup; - } - - /** - * Gets a placeholder string from an array. - * - * @since 3.1 - * @param array $array - * @return string - */ - private function get_placeholder_string( $array ) { - return implode( ', ', array_fill( 0, count( $array ), '%s' ) ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/class-utilities.php b/wp-content/plugins/easy-digital-downloads/includes/class-utilities.php deleted file mode 100644 index 351e890e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/class-utilities.php +++ /dev/null @@ -1,415 +0,0 @@ -set_gmt_offset(); - $this->set_date_format(); - $this->set_time_format(); - $this->set_time_zone(); - $this->includes(); - } - - /** - * Loads needed files for core utilities. - * - * @since 3.0 - */ - private function includes() { - $utils_dir = EDD_PLUGIN_DIR . 'includes/utils/'; - - // Interfaces. - require_once $utils_dir . 'interface-static-registry.php'; - require_once $utils_dir . 'interface-error-logger.php'; - - // Exceptions. - require_once $utils_dir . 'class-edd-exception.php'; - require_once $utils_dir . 'exceptions/class-attribute-not-found.php'; - require_once $utils_dir . 'exceptions/class-invalid-argument.php'; - require_once $utils_dir . 'exceptions/class-invalid-parameter.php'; - - // Date management. - require_once $utils_dir . 'class-date.php'; - - // Registry. - require_once $utils_dir . 'class-registry.php'; - } - - /** - * Retrieves a given registry instance by name. - * - * @since 3.0 - * - * @param string $name Registry name. - * @return \EDD\Utils\Registry|\WP_Error The registry instance if it exists, otherwise a WP_Error.. - */ - public function get_registry( $name ) { - switch ( $name ) { - case 'reports': - if ( ! did_action( 'edd_reports_init' ) ) { - _doing_it_wrong( __FUNCTION__, 'The Report registry cannot be retrieved prior to the edd_reports_init hook.', 'EDD 3.0' ); - } elseif ( class_exists( '\EDD\Reports\Data\Report_Registry' ) ) { - $registry = Reports\Data\Report_Registry::instance(); - } - break; - - case 'reports:endpoints': - if ( ! did_action( 'edd_reports_init' ) ) { - _doing_it_wrong( __FUNCTION__, 'The Endpoints registry cannot be retrieved prior to the edd_reports_init hook.', 'EDD 3.0' ); - } elseif ( class_exists( '\EDD\Reports\Data\Endpoint_Registry' ) ) { - $registry = Reports\Data\Endpoint_Registry::instance(); - } - break; - - case 'reports:endpoints:views': - if ( ! did_action( 'edd_reports_init' ) ) { - _doing_it_wrong( __FUNCTION__, 'The Endpoint Views registry cannot be retrieved prior to the edd_reports_init hook.', 'EDD 3.0' ); - } elseif ( class_exists( '\EDD\Reports\Data\Endpoint_View_Registry' ) ) { - $registry = Reports\Data\Endpoint_View_Registry::instance(); - } - break; - - default: - $registry = new \WP_Error( 'invalid_registry', "The '{$name}' registry does not exist." ); - break; - } - - return $registry; - } - - /** - * Retrieves a date format string based on a given short-hand format. - * - * @see edd_get_date_format() - * @see edd_get_date_picker_format() - * - * @since 3.0 - * - * @param string $format Shorthand date format string. Accepts 'date', 'time', 'mysql', 'datetime', - * 'picker-field' or 'picker-js'. If none of the accepted values, the - * original value will simply be returned. Default is the value of the - * `$date_format` property, derived from the core 'date_format' option. - * @return string date_format()-compatible date format string. - */ - public function get_date_format_string( $format = 'date' ) { - - // Default to 'date' if empty - if ( empty( $format ) ) { - $format = 'date'; - } - - // Bail if format is not known - if ( ! in_array( $format, array( 'date', 'time', 'datetime', 'mysql', 'date-attribute', 'date-js', 'date-mysql', 'time-mysql' ), true ) ) { - return $format; - } - - // What known format are we getting? - switch ( $format ) { - - // jQuery UI Datepicker fields, placeholders, etc... - case 'date-attribute': - $retval = 'yyyy-mm-dd'; - break; - - // jQuery UI Datepicker JS variable - case 'date-js': - $retval = 'yy-mm-dd'; - break; - - // Date in MySQL format - case 'date-mysql': - $retval = 'Y-m-d'; - break; - - // Time in MySQL format - case 'time-mysql': - $retval = 'H:i:s'; - break; - - // MySQL datetime columns - case 'mysql': - $retval = 'Y-m-d H:i:s'; - break; - - // WordPress date_format + time_format - case 'datetime': - $retval = $this->get_date_format() . ' ' . $this->get_time_format(); - break; - - // WordPress time_format only - case 'time': - $retval = $this->get_time_format(); - break; - - // WordPress date_format only - case 'date': - default: - $retval = $this->get_date_format(); - break; - } - - return $retval; - } - - /** - * Retrieves a date instance for the WP timezone (and offset) based on the given date string. - * - * @since 3.0 - * - * @param string $date_string Optional. Date string. Default 'now'. - * @param string $timezone Optional. Timezone to generate the Carbon instance for. - * Default is the timezone set in WordPress settings. - * @param bool $localize Optional. Whether to apply the offset in seconds to the generated - * date. Default false. - * - * @return \EDD\Utils\Date Date instance. Time is returned as UTC. - * @throws \Exception - */ - public function date( $date_string = 'now', $timezone = null, $localize = false ) { - - // Fallback to this time zone - if ( null === $timezone && true === $localize ) { - $timezone = $this->get_time_zone(); - } elseif ( null === $timezone && false === $localize ) { - $timezone = 'UTC'; - } - - // If the date string cannot be property converted to a valid time, reset it to now. - if ( ! strtotime( $date_string ) ) { - $date_string = 'now'; - } - - /* - * Create the DateTime object with the "local" WordPress timezone. - * - * Note that supplying the timezone during DateTime instantiation doesn't actually - * convert the UNIX timestamp, it just lays the groundwork for deriving the offset. - */ - $date = new Utils\Date( $date_string, new \DateTimezone( $timezone ) ); - - if ( false === $localize ) { - /* - * The offset is automatically applied when the Date object is instantiated. - * - * If $apply_offset is false, the interval needs to be removed again after the fact. - */ - $offset = $date->getOffset(); - $interval = \DateInterval::createFromDateString( "-{$offset} seconds" ); - $date->add( $interval ); - } - - return $date; - } - - /** - * Retrieves the WordPress GMT offset property, as cached at run-time. - * - * @since 3.0 - * - * @param bool $refresh Optional. Whether to refresh the `$gmt_offset` value before retrieval. - * Default false. - * @return int Value of the gmt_offset property. - */ - public function get_gmt_offset( $refresh = false ) { - if ( is_null( $this->gmt_offset ) || ( true === $refresh ) ) { - $this->set_gmt_offset(); - } - - return $this->gmt_offset; - } - - /** - * Retrieves the WordPress date format, as cached at run-time. - * - * @since 3.0 - * - * @param bool $refresh Optional. Whether to refresh the `$gmt_offset` value before retrieval. - * Default false. - * @return string Value of the `$date_format` property. - */ - public function get_date_format( $refresh = false ) { - if ( is_null( $this->date_format ) || ( true === $refresh ) ) { - $this->set_date_format(); - } - - return $this->date_format; - } - - /** - * Retrieves the WordPress time format, as cached at run-time. - * - * @since 3.0 - * - * @param bool $refresh Optional. Whether to refresh the `$gmt_offset` value before retrieval. - * Default false. - * @return string Value of the `$time_format` property. - */ - public function get_time_format( $refresh = false ) { - if ( is_null( $this->time_format ) || ( true === $refresh ) ) { - $this->set_time_format(); - } - - return $this->time_format; - } - - /** - * Retrieves the WordPress time zone, as cached at run-time. - * - * @since 3.0 - * - * @param bool $refresh Optional. Whether to refresh the `$time_zone` value before retrieval. - * Default false. - * @return string Value of the `$time_zone` property. - */ - public function get_time_zone( $refresh = false ) { - if ( is_null( $this->time_zone ) || ( true === $refresh ) ) { - $this->set_time_zone(); - } - - return $this->time_zone; - } - - /** - * Gets a valid date string in the format Y-m-d HH:MM:00 - * - * @since 3.0 - * @param string $date A valid date string. - * @param int $hour The hour. - * @param int $minute The minute. - * @return string - */ - public function get_date_string( $date = '', $hour = 0, $minute = 0 ) { - if ( empty( $date ) || ! strtotime( $date ) ) { - $date = date( 'Y-m-d' ); - } - - $hour = absint( $hour ); - if ( $hour > 23 ) { - $hour = 23; - } - $hour = str_pad( $hour, 2, '0', STR_PAD_LEFT ); - - $minute = absint( $minute ); - if ( $minute > 59 ) { - $minute = 59; - } - $minute = str_pad( $minute, 2, '0', STR_PAD_LEFT ); - - return "{$date} {$hour}:{$minute}:00"; - } - - /** Private Setters *******************************************************/ - - /** - * Private setter for GMT offset - * - * @since 3.0 - */ - private function set_gmt_offset() { - $this->gmt_offset = get_option( 'gmt_offset', 0 ) * HOUR_IN_SECONDS; - } - - /** - * Private setter for date format - * - * @since 3.0 - */ - private function set_date_format() { - $this->date_format = get_option( 'date_format', 'M j, Y' ); - } - - /** - * Private setter for time format - * - * @since 3.0 - */ - private function set_time_format() { - $this->time_format = get_option( 'time_format', 'g:i a' ); - } - - /** - * Private setter for time zone - * - * @since 3.0 - */ - private function set_time_zone() { - - // Default return value - $retval = 'UTC'; - - // Get some useful values - $timezone = get_option( 'timezone_string' ); - $gmt_offset = $this->get_gmt_offset(); - - // Use timezone string if it's available - if ( ! empty( $timezone ) ) { - $retval = $timezone; - - // Use GMT offset to calculate - } elseif ( is_numeric( $gmt_offset ) ) { - $hours = abs( floor( $gmt_offset / HOUR_IN_SECONDS ) ); - $minutes = abs( floor( ( $gmt_offset / MINUTE_IN_SECONDS ) % MINUTE_IN_SECONDS ) ); - $math = ( $gmt_offset >= 0 ) ? '+' : '-'; - $value = ! empty( $minutes ) ? "{$hours}:{$minutes}" : $hours; - $retval = "GMT{$math}{$value}"; - } - - // Set - $this->time_zone = $retval; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat-functions.php b/wp-content/plugins/easy-digital-downloads/includes/compat-functions.php deleted file mode 100644 index 503a6009..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat-functions.php +++ /dev/null @@ -1,102 +0,0 @@ - $value ) { - if ( substr( $name, 0, 5 ) == 'HTTP_' ) { - $headers[ str_replace( ' ', '-', ucwords( strtolower( str_replace( '_', ' ', substr( $name, 5 ) ) ) ) ) ] = $value; - } - } - return $headers; - } -endif; - -if ( ! function_exists( 'wp_timezone_string' ) ) : - /** - * Polyfill for wp_timezone_string() function added in WP 5.3.0 - * - * Retrieves the timezone of the site as a string. - * - * @since 3.1.0.3 - * @return string PHP timezone name or a ±HH:MM offset. - */ - function wp_timezone_string() { - $timezone_string = get_option( 'timezone_string' ); - - if ( $timezone_string ) { - return $timezone_string; - } - - $offset = (float) get_option( 'gmt_offset' ); - $hours = (int) $offset; - $minutes = ( $offset - $hours ); - - $sign = ( $offset < 0 ) ? '-' : '+'; - $abs_hour = abs( $hours ); - $abs_mins = abs( $minutes * 60 ); - $tz_offset = sprintf( '%s%02d:%02d', $sign, $abs_hour, $abs_mins ); - - return $tz_offset; - } -endif; diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat/class-base.php b/wp-content/plugins/easy-digital-downloads/includes/compat/class-base.php deleted file mode 100644 index ecf65f6d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat/class-base.php +++ /dev/null @@ -1,78 +0,0 @@ -hooks(); - - $this->show_notices = apply_filters( 'edd_show_deprecated_notices', ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ); - $this->show_backtrace = apply_filters( 'edd_show_backtrace', ( defined( 'WP_DEBUG' ) && WP_DEBUG ) && ! defined( 'EDD_DOING_TESTS' ) ); - } - - /** - * Getter for component. - * - * @since 3.0 - * - * @return string Component. - */ - public function get_component() { - return $this->component; - } - - /** - * Backwards compatibility hooks for component. - * - * @since 3.0 - * @access protected - */ - abstract protected function hooks(); -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat/class-customer.php b/wp-content/plugins/easy-digital-downloads/includes/compat/class-customer.php deleted file mode 100644 index a6ed560f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat/class-customer.php +++ /dev/null @@ -1,303 +0,0 @@ -edd_customers; - - case 'primary_key' : - return 'id'; - - case 'version' : - $table = edd_get_component_interface( 'customer', 'table' ); - - return $table instanceof Table ? $table->get_version() : false; - case 'meta_type' : - return 'customer'; - - case 'date_key' : - return 'date_created'; - - case 'cache_group' : - return 'customers'; - } - - return null; - } - - /** - * Magic method to handle calls to method that no longer exist. - * - * @since 3.0 - * - * @param string $name Name of the method. - * @param array $arguments Enumerated array containing the parameters passed to the $name'ed method. - * @return mixed Dependent on the method being dispatched to. - */ - public function __call( $name, $arguments ) { - switch ( $name ) { - case 'add': - case 'insert': - return edd_add_customer( $arguments[0] ); - - case 'update': - return edd_update_customer( $arguments[0], $arguments[1] ); - - case 'delete': - if ( ! is_bool( $arguments[0] ) ) { - return false; - } - - $column = is_email( $arguments[0] ) ? 'email' : 'id'; - $customer = edd_get_customer_by( $column, $arguments[0] ); - edd_delete_customer( $customer->id ); - break; - case 'exists': - return (bool) edd_get_customer_by( 'email', $arguments[0] ); - - case 'get_customer_by': - return edd_get_customer_by( $arguments[0], $arguments[1] ); - - case 'get_customers': - return edd_get_customers( $arguments[0] ); - - case 'count': - return edd_count_customers(); - - case 'get_column': - return edd_get_customer_by( $arguments[0], $arguments[1] ); - - case 'attach_payment': - /** @var $customer \EDD_Customer */ - $customer = edd_get_customer( $arguments[0] ); - - if ( ! $customer ) { - return false; - } - - return $customer->attach_payment( $arguments[1], false ); - - case 'remove_payment': - /** @var $customer \EDD_Customer */ - $customer = edd_get_customer( $arguments[0] ); - - if ( ! $customer ) { - return false; - } - - return $customer->remove_payment( $arguments[1], false ); - - case 'increment_stats': - /** @var $customer \EDD_Customer */ - $customer = edd_get_customer( $arguments[0] ); - - if ( ! $customer ) { - return false; - } - - $increased_count = $customer->increase_purchase_count(); - $increased_value = $customer->increase_value( $arguments[1] ); - - return ( $increased_count && $increased_value ) - ? true - : false; - - case 'decrement_stats': - /** @var $customer \EDD_Customer */ - $customer = edd_get_customer( $arguments[0] ); - - if ( ! $customer ) { - return false; - } - - $decreased_count = $customer->decrease_purchase_count(); - $decreased_value = $customer->decrease_value( $arguments[1] ); - - return ( $decreased_count && $decreased_value ) - ? true - : false; - } - } - - /** - * Backwards compatibility hooks for customers. - * - * @since 3.0 - * @access protected - */ - protected function hooks() { - - /** Filters **********************************************************/ - - add_filter( 'get_user_metadata', array( $this, 'get_user_meta' ), 99, 4 ); - add_filter( 'update_user_metadata', array( $this, 'update_user_meta' ), 99, 5 ); - add_filter( 'add_user_metadata', array( $this, 'update_user_meta' ), 99, 5 ); - } - - /** - * Backwards compatibility filters for get_user_meta() calls on customers. - * - * @since 3.0 - * - * @param mixed $value The value get_post_meta would return if we don't filter. - * @param int $object_id The object ID post meta was requested for. - * @param string $meta_key The meta key requested. - * @param bool $single If a single value or an array of the value is requested. - * - * @return mixed The value to return. - */ - public function get_user_meta( $value, $object_id, $meta_key, $single ) { - if ( 'get_user_metadata' !== current_filter() ) { - $message = __( 'This function is not meant to be called directly. It is only here for backwards compatibility purposes.', 'easy-digital-downloads' ); - _doing_it_wrong( __FUNCTION__, esc_html( $message ), 'EDD 3.0' ); - } - - if ( '_edd_user_address' !== $meta_key ) { - return $value; - } - - $value = edd_get_customer_address( $object_id ); - - if ( $this->show_notices ) { - _doing_it_wrong( 'get_user_meta()', 'User addresses being stored in meta have been deprecated since Easy Digital Downloads 3.0! Use edd_get_customer_address() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - return array( $value ); - } - - /** - * Listen for calls to update_user_meta() for customers and see if we need to filter them. - * - * This is here for backwards compatibility purposes with the migration to custom tables in EDD 3.0. - * - * @since 3.0 - * - * @param null|bool $check Whether to allow updating metadata for the given type. - * @param int $object_id Object ID. - * @param string $meta_key Meta key. - * @param mixed $meta_value Meta value. Must be serializable if non-scalar. - * @param mixed $prev_value Optional. If specified, only update existing metadata entries with the specified value. - * Otherwise, update all entries. - * - * @return mixed Returns 'null' if no action should be taken and WordPress core can continue, or non-null to avoid usermeta. - */ - public function update_user_meta( $check, $object_id, $meta_key, $meta_value, $prev_value ) { - if ( '_edd_user_address' !== $meta_key ) { - return $check; - } - - // Fetch saved primary address. - $addresses = edd_get_customer_addresses( - array( - 'number' => 1, - 'is_primary' => true, - 'customer_id' => $object_id, - ) - ); - - // Defaults. - $defaults = array( - 'line1' => '', - 'line2' => '', - 'city' => '', - 'state' => '', - 'country' => '', - 'zip' => '', - ); - - $address = wp_parse_args( (array) $meta_value, $defaults ); - - if ( is_array( $addresses ) && ! empty( $addresses[0] ) ) { - $customer_address = $addresses[0]; - - edd_update_customer_address( - $customer_address->id, - array( - 'address' => $address['line1'], - 'address2' => $address['line2'], - 'city' => $address['city'], - 'region' => $address['state'], - 'postal_code' => $address['zip'], - 'country' => $address['country'], - ) - ); - } else { - $customer = edd_get_customer_by( 'user_id', absint( $object_id ) ); - - if ( $customer ) { - edd_add_customer_address( - array( - 'customer_id' => $customer->id, - 'address' => $address['line1'], - 'address2' => $address['line2'], - 'city' => $address['city'], - 'region' => $address['state'], - 'postal_code' => $address['zip'], - 'country' => $address['country'], - 'is_primary' => true, - ) - ); - } - } - - if ( $this->show_notices ) { - _doing_it_wrong( 'add_user_meta()/update_user_meta()', 'User addresses being stored in meta have been deprecated since Easy Digital Downloads 3.0! Use edd_add_customer_address()/edd_update_customer_address()() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - return $check; - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat/class-customermeta.php b/wp-content/plugins/easy-digital-downloads/includes/compat/class-customermeta.php deleted file mode 100644 index 0a2d5bfd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat/class-customermeta.php +++ /dev/null @@ -1,100 +0,0 @@ -edd_customermeta; - - case 'primary_key' : - return 'meta_id'; - - case 'version' : - $table = edd_get_component_interface( 'customer', 'meta' ); - - return $table instanceof Table ? $table->get_version() : false; - } - - return null; - } - - /** - * Magic method to handle calls to method that no longer exist. - * - * @since 3.0 - * - * @param string $name Name of the method. - * @param array $arguments Enumerated array containing the parameters passed to the $name'ed method. - * @return mixed Dependent on the method being dispatched to. - */ - public function __call( $name, $arguments ) { - switch ( $name ) { - case 'get_meta' : - return edd_get_customer_meta( - isset( $arguments[0] ) ? $arguments[0] : 0, - isset( $arguments[1] ) ? $arguments[1] : '', - isset( $arguments[2] ) ? $arguments[2] : false - ); - - case 'add_meta' : - return edd_add_customer_meta( - isset( $arguments[0] ) ? $arguments[0] : 0, - isset( $arguments[1] ) ? $arguments[1] : '', - isset( $arguments[2] ) ? $arguments[2] : false, - isset( $arguments[3] ) ? $arguments[3] : false - ); - - case 'update_meta' : - return edd_update_customer_meta( - isset( $arguments[0] ) ? $arguments[0] : 0, - isset( $arguments[1] ) ? $arguments[1] : '', - isset( $arguments[2] ) ? $arguments[2] : false, - isset( $arguments[3] ) ? $arguments[3] : '' - ); - - case 'delete_meta' : - return edd_delete_customer_meta( - isset( $arguments[0] ) ? $arguments[0] : 0, - isset( $arguments[1] ) ? $arguments[1] : '', - isset( $arguments[2] ) ? $arguments[2] : '' - ); - } - - return null; - } - - /** - * Backwards compatibility hooks for customer meta. - * - * @since 3.0 - * @access protected - */ - protected function hooks() { - // No hooks. - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat/class-discount-query.php b/wp-content/plugins/easy-digital-downloads/includes/compat/class-discount-query.php deleted file mode 100644 index 01640a2d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat/class-discount-query.php +++ /dev/null @@ -1,81 +0,0 @@ -swap_types( $query ) ); - } - - /** - * Swap out types in an item. - * - * @since 3.0 - * - * @param array $item Array of item arguments - * @return array - */ - public function filter_item( $item = array() ) { - return parent::filter_item( $this->swap_types( $item ) ); - } - - /** - * Swap out the type arguments. - * - * @since 3.0 - * - * @param array $args - * @return array - */ - private function swap_types( $args = array() ) { - - // Switch `type` to `amount_type` - if ( empty( $args['amount_type'] ) && ! empty( $args['type'] ) ) { - $args['amount_type'] = $args['type']; - } - - // Force `type` to `discount` - $args['type'] = 'discount'; - - // Return swapped arguments - return $args; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat/class-discount.php b/wp-content/plugins/easy-digital-downloads/includes/compat/class-discount.php deleted file mode 100644 index a3795052..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat/class-discount.php +++ /dev/null @@ -1,546 +0,0 @@ -get( 'post_type' ) ) { - return; - } - - // Force filters to run - $query->set( 'suppress_filters', false ); - - // Setup doing-it-wrong message - $message = sprintf( - __( 'As of Easy Digital Downloads 3.0, discounts no longer exist in the %1$s table. They have been migrated to %2$s. Discounts should be accessed using %3$s, %4$s or instantiating a new instance of %5$s. See %6$s for more information.', 'easy-digital-downloads' ), - '' . $wpdb->posts . '', - '' . edd_get_component_interface( 'adjustment', 'table' )->table_name . '', - 'edd_get_discounts()', - 'edd_get_discount()', - 'EDD_Discount', - 'https://easydigitaldownloads.com/development/' - ); - - _doing_it_wrong( 'get_posts()/get_post()', $message, '3.0' ); - } - - /** - * Backwards compatibility layer for wp_count_posts(). - * - * @since 3.0 - * - * @param string $query SQL query. - * @return string $request Rewritten SQL query. - */ - public function wp_count_posts( $query ) { - global $wpdb; - - $expected = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = 'edd_discount' GROUP BY post_status"; - - if ( $expected === $query ) { - $query = "SELECT status AS post_status, COUNT( * ) AS num_posts FROM {$wpdb->edd_adjustments} WHERE type = 'discount' GROUP BY post_status"; - } - - return $query; - } - - /** - * Fill the returned WP_Post objects with the data from the discounts table. - * - * @since 3.0 - * - * @param array $posts Posts returned from the SQL query. - * @param \WP_Query $query Instance of WP_Query. - * - * @return array New WP_Post objects. - */ - public function posts_results( $posts, $query ) { - if ( 'posts_results' !== current_filter() ) { - $message = __( 'This function is not meant to be called directly. It is only here for backwards compatibility purposes.', 'easy-digital-downloads' ); - _doing_it_wrong( __FUNCTION__, esc_html( $message ), 'EDD 3.0' ); - } - - if ( 'edd_discount' === $query->get( 'post_type' ) ) { - $new_posts = array(); - - foreach ( $posts as $post ) { - $discount = edd_get_discount( $post->id ); - - $object_vars = array( - 'ID' => $discount->id, - 'post_title' => $discount->name, - 'post_status' => $discount->status, - 'post_type' => 'edd_discount', - 'post_date' => EDD()->utils->date( $discount->date_created, null, true )->toDateTimeString(), - 'post_date_gmt' => $discount->date_created, - 'post_modified' => EDD()->utils->date( $discount->date_modified, null, true )->toDateTimeString(), - 'post_modified_gmt' => $discount->date_created, - ); - - foreach ( $object_vars as $object_var => $value ) { - $post->{$object_var} = $value; - } - - $post = new \WP_Post( $post ); - - $new_posts[] = $post; - } - - return $new_posts; - } - - return $posts; - } - - /** - * Hijack the SQL query and rewrite it to fetch data from the discounts table. - * - * @since 3.0 - * - * @param string $request SQL query. - * @param \WP_Query $query Instance of WP_Query. - * - * @return string $request Rewritten SQL query. - */ - public function posts_request( $request, $query ) { - global $wpdb; - - if ( 'posts_request' !== current_filter() ) { - $message = __( 'This function is not meant to be called directly. It is only here for backwards compatibility purposes.', 'easy-digital-downloads' ); - _doing_it_wrong( __FUNCTION__, esc_html( $message ), '3.0' ); - } - - if ( 'edd_discount' === $query->get( 'post_type' ) ) { - $defaults = array( - 'number' => 30, - 'status' => array( 'active', 'inactive', 'expired' ), - 'order' => 'DESC', - 'orderby' => 'date_created', - ); - - $args = array( - 'number' => $query->get( 'posts_per_page' ), - 'status' => $query->get( 'post_status', array( 'active', 'inactive' ) ), - ); - - $orderby = $query->get( 'orderby', false ); - if ( $orderby ) { - switch ( $orderby ) { - case 'none': - case 'ID': - case 'author': - case 'post__in': - case 'type': - case 'post_type': - $args['orderby'] = 'id'; - break; - case 'title': - $args['orderby'] = 'name'; - break; - case 'date': - case 'post_date': - case 'modified': - case 'post_modified': - $args['orderby'] = 'date_created'; - break; - default: - $args['orderby'] = 'id'; - break; - } - } - - $offset = $query->get( 'offset', false ); - if ( $offset ) { - $args['offset'] = absint( $offset ); - } else { - $args['offset'] = 0; - } - - if ( 'any' === $args['status'] ) { - $args['status'] = $defaults['status']; - } - - $args = wp_parse_args( $args, $defaults ); - - if ( array_key_exists( 'number', $args ) ) { - $args['number'] = absint( $args['number'] ); - } - - $table_name = edd_get_component_interface( 'adjustment', 'table' )->table_name; - - $meta_query = $query->get( 'meta_query' ); - - $clauses = array(); - $sql_where = "WHERE type = 'discount'"; - - $meta_key = $query->get( 'meta_key', false ); - $meta_value = $query->get( 'meta_value', false ); - $columns = wp_list_pluck( edd_get_component_interface( 'adjustment', 'schema' )->columns, 'name' ); - - // 'meta_key' and 'meta_value' passed as arguments - if ( $meta_key && $meta_value ) { - /** - * Check that the key exists as a column in the table. - * Note: there is no backwards compatibility support for product requirements and excluded - * products as these would be serialized under the old schema. - */ - if ( in_array( $meta_key, $columns, true ) ) { - $sql_where .= ' ' . $wpdb->prepare( "{$meta_key} = %s", $meta_value ); - } - } - - if ( ! empty( $meta_query ) ) { - foreach ( $meta_query as $key => $query ) { - $relation = 'AND'; // Default relation - - if ( is_string( $query ) && 'relation' === $key ) { - $relation = $query; - } - - if ( is_array( $query ) ) { - if ( array_key_exists( 'key', $query ) ) { - $query['key'] = str_replace( '_edd_discount_', '', $query['key'] ); - - /** - * Check that the key exists as a column in the table. - * Note: there is no backwards compatibility support for product requirements and excluded - * products as these would be serialized under the old schema. - */ - if ( in_array( $query['key'], $columns, true ) && array_key_exists( 'value', $query ) ) { - $meta_compare = ! empty( $query['compare'] ) ? $query['compare'] : '='; - $meta_compare = strtoupper( $meta_compare ); - - $meta_value = $query['value']; - - $where = null; - - switch ( $meta_compare ) { - case 'IN': - case 'NOT IN': - $meta_compare_string = '(' . substr( str_repeat( ',%s', count( $meta_value ) ), 1 ) . ')'; - $where = $wpdb->prepare( $meta_compare_string, $meta_value ); - break; - - case 'BETWEEN': - case 'NOT BETWEEN': - $meta_value = array_slice( $meta_value, 0, 2 ); - $where = $wpdb->prepare( '%1$s AND %1$s', $meta_value ); - break; - - case 'LIKE': - case 'NOT LIKE': - $meta_value = '%' . $wpdb->esc_like( $meta_value ) . '%'; - $where = $wpdb->prepare( '%s', $meta_value ); - break; - - // EXISTS with a value is interpreted as '='. - case 'EXISTS': - $where = $wpdb->prepare( '%s', $meta_value ); - break; - - // 'value' is ignored for NOT EXISTS. - case 'NOT EXISTS': - $where = $query['key'] . ' IS NULL'; - break; - - default: - $where = $wpdb->prepare( '%s', $meta_value ); - break; - } - - if ( ! is_null( $where ) ) { - $clauses['where'][] = $query['key'] . ' ' . $meta_compare . ' ' . $where; - } - } - } - - if ( ! empty( $clauses['where'] ) && is_array( $clauses['where'] ) ) { - $sql_where .= ' AND ( ' . implode( ' ' . $relation . ' ', $clauses['where'] ) . ' )'; - } - } - } - } - - $request = "SELECT id FROM {$table_name} {$sql_where} ORDER BY {$args['orderby']} {$args['order']} LIMIT {$args['offset']}, {$args['number']};"; - } - - return $request; - } - - /** - * Backwards compatibility filters for get_post_meta() calls on discounts. - * - * @since 3.0 - * - * @param mixed $value The value get_post_meta would return if we don't filter. - * @param int $object_id The object ID post meta was requested for. - * @param string $meta_key The meta key requested. - * @param bool $single If a single value or an array of the value is requested. - * - * @return mixed The value to return. - */ - public function get_post_metadata( $value, $object_id, $meta_key, $single ) { - - $meta_keys = apply_filters( 'edd_post_meta_discount_backwards_compat_keys', array( - '_edd_discount_status', - '_edd_discount_amount', - '_edd_discount_uses', - '_edd_discount_name', - '_edd_discount_code', - '_edd_discount_expiration', - '_edd_discount_start', - '_edd_discount_is_single_use', - '_edd_discount_is_not_global', - '_edd_discount_product_condition', - '_edd_discount_min_price', - '_edd_discount_max_uses' - ) ); - - // Bail early of not a back-compat key - if ( ! in_array( $meta_key, $meta_keys, true ) ) { - return $value; - } - - // Bail if discount does not exist - $discount = edd_get_discount( $object_id ); - if ( empty( $discount->id ) ) { - return $value; - } - - switch ( $meta_key ) { - case '_edd_discount_name': - case '_edd_discount_status': - case '_edd_discount_amount': - case '_edd_discount_uses': - case '_edd_discount_code': - case '_edd_discount_expiration': - case '_edd_discount_start': - case '_edd_discount_product_condition': - case '_edd_discount_min_price': - case '_edd_discount_max_uses': - $key = str_replace( '_edd_discount_', '', $meta_key ); - - $value = $discount->{$key}; - - if ( $this->show_notices ) { - _doing_it_wrong( 'get_post_meta()', 'All discount postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_get_adjustment_meta() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - break; - - case '_edd_discount_is_single_use': - $value = $discount->get_once_per_customer(); - - if ( $this->show_notices ) { - _doing_it_wrong( 'get_post_meta()', 'All discount postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_get_adjustment_meta() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - break; - - case '_edd_discount_is_not_global': - $value = $discount->get_scope(); - - if ( $this->show_notices ) { - _doing_it_wrong( 'get_post_meta()', 'All discount postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_get_adjustment_meta() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - break; - default: - /* - * Developers can hook in here with add_filter( 'edd_get_post_meta_discount_backwards_compat-meta_key... in order to - * Filter their own meta values for backwards compatibility calls to get_post_meta instead of EDD_Discount::get_meta - */ - $value = apply_filters( 'edd_get_post_meta_discount_backwards_compat-' . $meta_key, $value, $object_id ); - break; - } - - return $value; - } - - - /** - * Backwards compatibility filters for add/update_post_meta() calls on discounts. - * - * @since 3.0 - * - * @param mixed $check Comes in 'null' but if returned not null, WordPress Core will not interact with the postmeta table. - * @param int $object_id The object ID post meta was requested for. - * @param string $meta_key The meta key requested. - * @param mixed $meta_value The value get_post_meta would return if we don't filter. - * @param mixed $prev_value The previous value of the meta - * - * @return mixed Returns 'null' if no action should be taken and WordPress core can continue, or non-null to avoid postmeta. - */ - public function update_post_metadata( $check, $object_id, $meta_key, $meta_value, $prev_value ) { - - $meta_keys = apply_filters( 'edd_update_post_meta_discount_backwards_compat_keys', array( - '_edd_discount_status', - '_edd_discount_amount', - '_edd_discount_uses', - '_edd_discount_name', - '_edd_discount_code', - '_edd_discount_expiration', - '_edd_discount_start', - '_edd_discount_is_single_use', - '_edd_discount_is_not_global', - '_edd_discount_product_condition', - '_edd_discount_min_price', - '_edd_discount_max_uses' - ) ); - - // Bail early of not a back-compat key - if ( ! in_array( $meta_key, $meta_keys, true ) ) { - return $check; - } - - // Bail if discount does not exist - $discount = edd_get_discount( $object_id ); - if ( empty( $discount->id ) ) { - return $check; - } - - switch ( $meta_key ) { - case '_edd_discount_name': - case '_edd_discount_status': - case '_edd_discount_amount': - case '_edd_discount_uses': - case '_edd_discount_code': - case '_edd_discount_expiration': - case '_edd_discount_start': - case '_edd_discount_product_condition': - case '_edd_discount_min_price': - case '_edd_discount_max_uses': - $key = str_replace( '_edd_discount_', '', $meta_key ); - $discount->{$key} = $meta_value; - $check = $discount->save(); - - if ( $this->show_notices ) { - _doing_it_wrong( 'add_post_meta()/update_post_meta()', 'All discount postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_add_adjustment_meta()/edd_update_adjustment_meta() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - break; - case '_edd_discount_is_single_use': - $discount->once_per_customer = $meta_value; - $check = $discount->save(); - - // Since the old discounts data was simply stored in a single post meta entry, just don't let it be added. - if ( $this->show_notices ) { - _doing_it_wrong( 'add_post_meta()/update_post_meta()', 'All discount postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_add_adjustment_meta()/edd_update_adjustment_meta() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - break; - case '_edd_discount_is_not_global': - $discount->scope = $meta_value; - $check = $discount->save(); - - // Since the old discounts data was simply stored in a single post meta entry, just don't let it be added. - if ( $this->show_notices ) { - _doing_it_wrong( 'add_post_meta()/update_post_meta()', 'All discount postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_add_adjustment_meta()/edd_update_adjustment_meta() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - break; - default: - /* - * Developers can hook in here with add_filter( 'edd_get_post_meta_discount_backwards_compat-meta_key... in order to - * Filter their own meta values for backwards compatibility calls to get_post_meta instead of EDD_Discount::get_meta - */ - $check = apply_filters( 'edd_update_post_meta_discount_backwards_compat-' . $meta_key, $check, $object_id, $meta_value, $prev_value ); - break; - } - - return $check; - - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat/class-edd-payment-compat.php b/wp-content/plugins/easy-digital-downloads/includes/compat/class-edd-payment-compat.php deleted file mode 100644 index 19328a6e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat/class-edd-payment-compat.php +++ /dev/null @@ -1,972 +0,0 @@ -ID = absint( $payment_id ); - $this->payment = get_post( $this->ID ); - if ( ! $this->payment instanceof WP_Post ) { - return false; - } - $this->setup(); - } - - /** - * Sets up the payment object. - * - * @since 3.0 - * @return void - */ - private function setup() { - $this->payment_meta = $this->get_meta(); - $this->cart_details = $this->setup_cart_details(); - $this->status = $this->setup_status(); - $this->completed_date = $this->setup_completed_date(); - $this->mode = $this->setup_mode(); - $this->total = $this->setup_total(); - $this->tax = $this->setup_tax(); - $this->tax_rate = $this->setup_tax_rate(); - $this->fees_total = $this->setup_fees_total(); - $this->subtotal = $this->setup_subtotal(); - $this->discounts = $this->setup_discounts(); - $this->currency = $this->setup_currency(); - $this->fees = $this->setup_fees(); - $this->gateway = $this->setup_gateway(); - $this->transaction_id = $this->setup_transaction_id(); - $this->ip = $this->setup_ip(); - $this->customer_id = $this->setup_customer_id(); - $this->user_id = $this->setup_user_id(); - $this->email = $this->setup_email(); - $this->user_info = $this->setup_user_info(); - $this->address = $this->setup_address(); - $this->key = $this->setup_payment_key(); - $this->number = $this->setup_payment_number(); - $this->downloads = $this->setup_downloads(); - $this->has_unlimited_downloads = $this->setup_has_unlimited(); - $this->order = $this->_shim_order(); - } - - /** - * Get a post meta item for the payment - * - * @since 3.0 - * @param string $meta_key The Meta Key - * @param boolean $single Return single item or array - * @return mixed The value from the post meta - */ - private function get_meta( $meta_key = '_edd_payment_meta', $single = true ) { - - $meta = get_post_meta( $this->ID, $meta_key, $single ); - if ( '_edd_payment_meta' === $meta_key ) { - - if ( empty( $meta ) ) { - $meta = array(); - } - - // #5228 Fix possible data issue introduced in 2.6.12 - if ( is_array( $meta ) && isset( $meta[0] ) ) { - $bad_meta = $meta[0]; - unset( $meta[0] ); - - if ( is_array( $bad_meta ) ) { - $meta = array_merge( $meta, $bad_meta ); - } - - update_post_meta( $this->ID, '_edd_payment_meta', $meta ); - } - - // Payment meta was simplified in EDD v1.5, so these are here for backwards compatibility - if ( empty( $meta['key'] ) ) { - $meta['key'] = $this->setup_payment_key(); - } - - if ( empty( $meta['email'] ) ) { - $meta['email'] = $this->setup_email(); - } - - if ( empty( $meta['date'] ) ) { - $meta['date'] = get_post_field( 'post_date', $this->ID ); - } - } - - $meta = apply_filters( 'edd_get_payment_meta_' . $meta_key, $meta, $this->ID ); - - if ( is_serialized( $meta ) ) { - preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $meta, $matches ); - if ( ! empty( $matches ) ) { - $meta = array(); - } - } - - return apply_filters( 'edd_get_payment_meta', $meta, $this->ID, $meta_key ); - } - - /** - * Setup the payment completed date - * - * @since 3.0 - * @return string The date the payment was completed - */ - private function setup_completed_date() { - if ( in_array( $this->payment->post_status, array( 'pending', 'preapproved', 'processing' ), true ) ) { - return false; // This payment was never completed - } - $date = $this->get_meta( '_edd_completed_date', true ); - - // phpcs:ignore WordPress.PHP.DisallowShortTernary - return $date ?: $this->payment->date; - } - - /** - * Setup the payment mode - * - * @since 3.0 - * @return string The payment mode - */ - private function setup_mode() { - return $this->get_meta( '_edd_payment_mode' ); - } - - /** - * Setup the payment total - * - * @since 3.0 - * @return float The payment total - */ - private function setup_total() { - $amount = $this->get_meta( '_edd_payment_total', true ); - - if ( empty( $amount ) && '0.00' != $amount ) { - $meta = $this->get_meta( '_edd_payment_meta', true ); - $meta = maybe_unserialize( $meta ); - - if ( isset( $meta['amount'] ) ) { - $amount = $meta['amount']; - } - } - - return $amount; - } - - /** - * Setup the payment tax - * - * @since 3.0 - * @return float The tax for the payment - */ - private function setup_tax() { - $tax = $this->get_meta( '_edd_payment_tax', true ); - - // We don't have tax as its own meta and no meta was passed - if ( '' === $tax ) { - - $tax = isset( $this->payment_meta['tax'] ) ? $this->payment_meta['tax'] : 0; - - } - - return $tax; - - } - - /** - * Setup the payment tax rate - * - * @since 3.0 - * @return float The tax rate for the payment - */ - private function setup_tax_rate() { - return $this->get_meta( '_edd_payment_tax_rate', true ); - } - - /** - * Setup the payment fees - * - * @since 3.0 - * @return float The fees total for the payment - */ - private function setup_fees_total() { - $fees_total = (float) 0.00; - - $payment_fees = isset( $this->payment_meta['fees'] ) ? $this->payment_meta['fees'] : array(); - if ( ! empty( $payment_fees ) ) { - foreach ( $payment_fees as $fee ) { - $fees_total += (float) $fee['amount']; - } - } - - return $fees_total; - - } - - /** - * Setup the payment subtotal - * - * @since 3.0 - * @return float The subtotal of the payment - */ - private function setup_subtotal() { - $subtotal = 0; - $cart_details = $this->cart_details; - - if ( is_array( $cart_details ) ) { - - foreach ( $cart_details as $item ) { - - if ( isset( $item['subtotal'] ) ) { - - $subtotal += $item['subtotal']; - - } - } - } else { - - $subtotal = $this->total; - $tax = edd_use_taxes() ? $this->tax : 0; - $subtotal -= $tax; - - } - - return $subtotal; - } - - /** - * Setup the payments discount codes - * - * @since 3.0 - * @return array Array of discount codes on this payment - */ - private function setup_discounts() { - return ! empty( $this->payment_meta['user_info']['discount'] ) ? $this->payment_meta['user_info']['discount'] : array(); - } - - /** - * Setup the currency code - * - * @since 3.0 - * @return string The currency for the payment - */ - private function setup_currency() { - return isset( $this->payment_meta['currency'] ) ? $this->payment_meta['currency'] : apply_filters( 'edd_payment_currency_default', edd_get_currency(), $this ); - } - - /** - * Setup any fees associated with the payment - * - * @since 3.0 - * @return array The Fees - */ - private function setup_fees() { - return isset( $this->payment_meta['fees'] ) ? $this->payment_meta['fees'] : array(); - } - - /** - * Setup the gateway used for the payment - * - * @since 3.0 - * @return string The gateway - */ - private function setup_gateway() { - return $this->get_meta( '_edd_payment_gateway', true ); - } - - /** - * Setup the transaction ID - * - * @since 3.0 - * @return string The transaction ID for the payment - */ - private function setup_transaction_id() { - $transaction_id = $this->get_meta( '_edd_payment_transaction_id', true ); - - if ( empty( $transaction_id ) || (int) $transaction_id === (int) $this->ID ) { - - $gateway = $this->gateway; - $transaction_id = apply_filters( 'edd_get_payment_transaction_id-' . $gateway, $this->ID ); - - } - - return $transaction_id; - } - - /** - * Setup the IP Address for the payment - * - * @since 3.0 - * @return string The IP address for the payment - */ - private function setup_ip() { - return $this->get_meta( '_edd_payment_user_ip', true ); - } - - /** - * Setup the customer ID - * - * @since 3.0 - * @return int The Customer ID - */ - private function setup_customer_id() { - return $this->get_meta( '_edd_payment_customer_id', true ); - } - - /** - * Setup the User ID associated with the purchase - * - * @since 3.0 - * @return int The User ID - */ - private function setup_user_id() { - $user_id = $this->get_meta( '_edd_payment_user_id', true ); - $customer = new EDD_Customer( $this->customer_id ); - - // Make sure it exists, and that it matches that of the associated customer record - if ( ! empty( $customer->user_id ) && ( empty( $user_id ) || (int) $user_id !== (int) $customer->user_id ) ) { - - $user_id = $customer->user_id; - - // Backfill the user ID, or reset it to be correct in the event of data corruption - update_post_meta( $this->ID, '_edd_payment_user_id', $user_id ); - - } - - return $user_id; - } - - /** - * Setup the email address for the purchase - * - * @since 3.0 - * @return string The email address for the payment - */ - private function setup_email() { - $email = $this->get_meta( '_edd_payment_user_email', true ); - - if ( empty( $email ) ) { - $email = EDD()->customers->get_column( 'email', $this->customer_id ); - } - - return $email; - } - - /** - * Setup the user info - * - * @since 3.0 - * @return array The user info associated with the payment - */ - private function setup_user_info() { - $defaults = array( - 'first_name' => $this->first_name, - 'last_name' => $this->last_name, - 'discount' => $this->discounts, - ); - - $user_info = isset( $this->payment_meta['user_info'] ) ? $this->payment_meta['user_info'] : array(); - - if ( is_serialized( $user_info ) ) { - preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $user_info, $matches ); - if ( ! empty( $matches ) ) { - $user_info = array(); - } - } - - // As per Github issue #4248, we need to run maybe_unserialize here still. - $user_info = wp_parse_args( maybe_unserialize( $user_info ), $defaults ); - - // Ensure email index is in the old user info array - if ( empty( $user_info['email'] ) ) { - $user_info['email'] = $this->email; - } - - if ( empty( $user_info ) ) { - // Get the customer, but only if it's been created - $customer = new EDD_Customer( $this->customer_id ); - - if ( $customer->id > 0 ) { - $name = explode( ' ', $customer->name, 2 ); - $user_info = array( - 'first_name' => $name[0], - 'last_name' => $name[1], - 'email' => $customer->email, - 'discount' => 'none', - ); - } - } else { - // Get the customer, but only if it's been created - $customer = new EDD_Customer( $this->customer_id ); - if ( $customer->id > 0 ) { - foreach ( $user_info as $key => $value ) { - if ( ! empty( $value ) ) { - continue; - } - - switch ( $key ) { - case 'first_name': - $name = explode( ' ', $customer->name, 2 ); - - $user_info[ $key ] = $name[0]; - break; - - case 'last_name': - $name = explode( ' ', $customer->name, 2 ); - $last_name = ! empty( $name[1] ) ? $name[1] : ''; - - $user_info[ $key ] = $last_name; - break; - - case 'email': - $user_info[ $key ] = $customer->email; - break; - } - } - } - } - - return $user_info; - } - - /** - * Setup the Address for the payment - * - * @since 3.0 - * @return array The Address information for the payment - */ - private function setup_address() { - $address = ! empty( $this->payment_meta['user_info']['address'] ) ? $this->payment_meta['user_info']['address'] : array(); - $defaults = array( - 'line1' => '', - 'line2' => '', - 'city' => '', - 'country' => '', - 'state' => '', - 'zip' => '', - ); - - return wp_parse_args( $address, $defaults ); - } - - /** - * Setup the payment key - * - * @since 3.0 - * @return string The Payment Key - */ - private function setup_payment_key() { - return $this->get_meta( '_edd_payment_purchase_key', true ); - } - - /** - * Setup the payment number - * - * @since 3.0 - * @return int|string Integer by default, or string if sequential order numbers is enabled - */ - private function setup_payment_number() { - $number = false; - if ( edd_get_option( 'enable_sequential' ) ) { - $number = $this->get_meta( '_edd_payment_number', true ); - } - - return $number ?: $this->ID; - } - - /** - * Setup the cart details - * - * @since 3.0 - * @return array The cart details - */ - private function setup_cart_details() { - return isset( $this->payment_meta['cart_details'] ) ? maybe_unserialize( $this->payment_meta['cart_details'] ) : array(); - } - - /** - * Setup the downloads array - * - * @since 3.0 - * @return array Downloads associated with this payment - */ - private function setup_downloads() { - return isset( $this->payment_meta['downloads'] ) ? maybe_unserialize( $this->payment_meta['downloads'] ) : array(); - } - - /** - * Setup the Unlimited downloads setting - * - * @since 3.0 - * @return bool If this payment has unlimited downloads - */ - private function setup_has_unlimited() { - return (bool) $this->get_meta( '_edd_payment_unlimited_downloads', true ); - } - - /** - * Sets up the payment status. - * - * @since 3.0 - * @return string - */ - private function setup_status() { - return 'publish' === $this->payment->post_status ? 'complete' : $this->payment->post_status; - } - - /** - * Shims the payment, as much as possible, into an EDD Order object. - * @todo deprecate in 3.1 - * - * @return EDD\Orders\Order - */ - public function _shim_order() { - return new \EDD\Orders\Order( - array( - 'id' => $this->ID, - 'parent' => $this->payment->parent, - 'order_number' => $this->number, - 'status' => $this->status, - 'type' => 'sale', - 'user_id' => $this->user_id, - 'customer_id' => $this->customer_id, - 'email' => $this->email, - 'ip' => $this->ip, - 'gateway' => $this->gateway, - 'mode' => $this->mode, - 'currency' => $this->currency, - 'payment_key' => $this->key, - 'subtotal' => $this->subtotal, - 'discount' => $this->discounted_amount, - 'tax' => $this->tax, - 'total' => $this->total, - 'rate' => $this->get_order_tax_rate(), - 'date_created' => $this->payment->post_date_gmt, - 'date_modified' => $this->payment->post_modified, - 'date_completed' => $this->completed_date, - 'items' => $this->get_order_items(), - ) - ); - } - - /** - * Updates the payment tax rate to match the expected order tax rate. - * - * @since 3.0 - * @return float - */ - private function get_order_tax_rate() { - $tax_rate = (float) $this->tax_rate; - if ( $tax_rate < 1 ) { - $tax_rate = $tax_rate * 100; - } - - return $tax_rate; - } - - /** - * Gets an array of order item objects from the cart details. - * - * @since 3.0 - * @return array - */ - private function get_order_items() { - $order_items = array(); - if ( empty( $this->cart_details ) ) { - return $order_items; - } - foreach ( $this->cart_details as $key => $cart_item ) { - $product_name = isset( $cart_item['name'] ) - ? $cart_item['name'] - : ''; - $price_id = $this->get_valid_price_id_for_cart_item( $cart_item ); - if ( ! empty( $product_name ) ) { - $option_name = edd_get_price_option_name( $cart_item['id'], $price_id ); - if ( ! empty( $option_name ) ) { - $product_name .= ' — ' . $option_name; - } - } - $order_item_args = array( - 'order_id' => $this->ID, - 'product_id' => $cart_item['id'], - 'product_name' => $product_name, - 'price_id' => $price_id, - 'cart_index' => $key, - 'type' => 'download', - 'status' => $this->status, - 'quantity' => ! empty( $cart_item['quantity'] ) ? $cart_item['quantity'] : 1, - 'amount' => ! empty( $cart_item['item_price'] ) ? (float) $cart_item['item_price'] : (float) $cart_item['price'], - 'subtotal' => (float) $cart_item['subtotal'], - 'discount' => ! empty( $cart_item['discount'] ) ? (float) $cart_item['discount'] : 0.00, - 'tax' => $cart_item['tax'], - 'total' => (float) $cart_item['price'], - 'date_created' => $this->payment->post_date_gmt, - 'date_modified' => $this->payment->post_modified_gmt, - ); - - $order_items[] = new EDD\Orders\Order_Item( $order_item_args ); - } - - return $order_items; - } - - /** - * Retrieves a valid price ID for a given cart item. - * If the product does not have variable prices, then `null` is always returned. - * If the supplied price ID does not match a price ID that actually exists, then the default - * variable price is returned instead of the supplied one. - * - * @since 3.0 - * - * @param array $cart_item Array of cart item details. - * - * @return int|null - */ - private function get_valid_price_id_for_cart_item( $cart_item ) { - // If the product doesn't have variable prices, just return `null`. - if ( ! edd_has_variable_prices( $cart_item['id'] ) ) { - return null; - } - - $variable_prices = edd_get_variable_prices( $cart_item['id'] ); - if ( ! is_array( $variable_prices ) || empty( $variable_prices ) ) { - return null; - } - - // Get the price ID that's set to the cart item right now. - $price_id = isset( $cart_item['item_number']['options']['price_id'] ) && is_numeric( $cart_item['item_number']['options']['price_id'] ) - ? absint( $cart_item['item_number']['options']['price_id'] ) - : null; - - // Now let's confirm it's actually a valid price ID. - $variable_price_ids = array_map( 'intval', array_column( $variable_prices, 'index' ) ); - - return in_array( $price_id, $variable_price_ids, true ) ? $price_id : edd_get_default_variable_price( $cart_item['id'] ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat/class-log.php b/wp-content/plugins/easy-digital-downloads/includes/compat/class-log.php deleted file mode 100644 index 912f96cb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat/class-log.php +++ /dev/null @@ -1,344 +0,0 @@ -{$key}; - break; - } - - if ( $this->show_notices ) { - _doing_it_wrong( 'get_post_meta()', 'All log postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_get_api_request_log() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - return $value; - } - - /** - * Listen for calls to update_post_meta for API request logs and see if we need to filter them. - * - * This is here for backwards compatibility purposes with the migration to custom tables in EDD 3.0. - * - * @since 3.0 - * - * @param mixed $check Comes in 'null' but if returned not null, WordPress Core will not interact with the - * postmeta table. - * @param int $object_id The object ID post meta was requested for. - * @param string $meta_key The meta key requested. - * @param mixed $meta_value The value get_post_meta would return if we don't filter. - * @param mixed $prev_value The previous value of the meta. - * @return mixed Returns 'null' if no action should be taken and WordPress core can continue, or non-null to avoid postmeta. - */ - public function api_request_log_update_post_meta( $check, $object_id, $meta_key, $meta_value, $prev_value ) { - $meta_keys = array( - '_edd_log_request_ip', - '_edd_log_user', - '_edd_log_key', - '_edd_log_token', - '_edd_log_time', - '_edd_log_version', - ); - - if ( ! in_array( $meta_key, $meta_keys, true ) ) { - return $check; - } - - $api_request_log = edd_get_api_request_log( $object_id ); - - if ( ! $api_request_log ) { - return $check; - } - - switch ( $meta_key ) { - case '_edd_log_request_ip': - case '_edd_log_user': - case '_edd_log_key': - case '_edd_log_token': - case '_edd_log_time': - case '_edd_log_version': - $key = str_replace( '_edd_log_', '', $meta_key ); - - switch ( $key ) { - case 'request_ip': - $key = 'ip'; - break; - case 'key': - $key = 'api_key'; - break; - case 'user': - $key = 'user_id'; - break; - } - - $check = edd_update_api_request_log( $object_id, array( - $key => $meta_value, - ) ); - break; - } - - if ( $this->show_notices ) { - _doing_it_wrong( 'add_post_meta()/update_post_meta()', 'All log postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_add_order_meta()/edd_update_order_meta()() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - return $check; - } - - /** - * Backwards compatibility filters for get_post_meta() calls on file download logs. - * - * @since 3.0 - * - * @param mixed $value The value get_post_meta would return if we don't filter. - * @param int $object_id The object ID post meta was requested for. - * @param string $meta_key The meta key requested. - * @param bool $single If a single value or an array of the value is requested. - * - * @return mixed The value to return. - */ - public function file_download_log_get_post_meta( $value, $object_id, $meta_key, $single ) { - if ( 'get_post_metadata' !== current_filter() ) { - $message = __( 'This function is not meant to be called directly. It is only here for backwards compatibility purposes.', 'easy-digital-downloads' ); - _doing_it_wrong( __FUNCTION__, $message, 'EDD 3.0' ); - } - - $meta_keys = array( - '_edd_log_user_info', - '_edd_log_user_id', - '_edd_log_file_id', - '_edd_log_ip', - '_edd_log_payment_id', - '_edd_log_price_id', - '_edd_log_customer_id', - ); - - if ( ! in_array( $meta_key, $meta_keys, true ) ) { - return $value; - } - - $file_download_log = edd_get_file_download_log( $object_id ); - - if ( ! $file_download_log ) { - return $value; - } - - switch ( $meta_key ) { - case '_edd_log_user_id': - case '_edd_log_file_id': - case '_edd_log_ip': - case '_edd_log_payment_id': - case '_edd_log_price_id': - case '_edd_log_customer_id': - $key = str_replace( '_edd_log_', '', $meta_key ); - - switch ( $key ) { - case 'request_ip': - $key = 'ip'; - break; - case 'key': - $key = 'api_key'; - break; - case 'user': - $key = 'user_id'; - break; - case 'payment_id': - $key = 'order_id'; - break; - } - - if ( isset( $file_download_log->{$key} ) ) { - $value = $file_download_log->{$key}; - } - - if ( 'user_id' === $key ) { - $customer = new \EDD_Customer( $file_download_log->customer_id ); - $value = ! empty( $customer->user_id ) ? $customer->user_id : 0; - } - break; - } - - if ( $this->show_notices ) { - _doing_it_wrong( 'get_post_meta()', __( 'All log postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_get_api_request_log() instead.', 'easy-digital-downloads' ), 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - return $value; - } - - /** - * Listen for calls to update_post_meta for file download logs and see if we need to filter them. - * - * This is here for backwards compatibility purposes with the migration to custom tables in EDD 3.0. - * - * @since 3.0 - * - * @param mixed $check Comes in 'null' but if returned not null, WordPress Core will not interact with - * the postmeta table. - * @param int $object_id The object ID post meta was requested for. - * @param string $meta_key The meta key requested. - * @param mixed $meta_value The value get_post_meta would return if we don't filter. - * @param mixed $prev_value The previous value of the meta - * - * @return mixed Returns 'null' if no action should be taken and WordPress core can continue, or non-null to avoid postmeta - */ - public function file_download_log_update_post_meta( $check, $object_id, $meta_key, $meta_value, $prev_value ) { - $meta_keys = array( - '_edd_log_user_info', - '_edd_log_user_id', - '_edd_log_file_id', - '_edd_log_ip', - '_edd_log_payment_id', - '_edd_log_price_id', - '_edd_log_customer_id', - ); - - if ( ! in_array( $meta_key, $meta_keys, true ) ) { - return $check; - } - - $file_download_log = edd_get_file_download_log( $object_id ); - - if ( ! $file_download_log ) { - return $check; - } - - switch ( $meta_key ) { - case '_edd_log_user_id': - case '_edd_log_file_id': - case '_edd_key_ip': - case '_edd_log_payment_id': - case '_edd_log_price_id': - case '_edd_log_customer_id': - $key = str_replace( '_edd_log_', '', $meta_key ); - - if ( 'payment_id' === $key ) { - $key = 'order_id'; - } - - $check = edd_update_file_download_log( $object_id, array( - $key => $meta_value, - ) ); - break; - } - - return $check; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat/class-payment.php b/wp-content/plugins/easy-digital-downloads/includes/compat/class-payment.php deleted file mode 100644 index 2493a3ad..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat/class-payment.php +++ /dev/null @@ -1,313 +0,0 @@ -posts} WHERE post_type = 'edd_payment' GROUP BY post_status"; - - if ( $expected === $query ) { - $query = "SELECT status AS post_status, COUNT( * ) AS num_posts FROM {$wpdb->edd_orders} GROUP BY post_status"; - } - - return $query; - } - - /** - * Add a message for anyone to trying to get payments via get_post/get_posts/WP_Query. - * Force filters to run for all queries that have `edd_discount` as the post type. - * - * This is here for backwards compatibility purposes with the migration to custom tables in EDD 3.0. - * - * @since 3.0 - * - * @param \WP_Query $query - */ - public function pre_get_posts( $query ) { - global $wpdb; - - if ( 'pre_get_posts' !== current_filter() ) { - $message = __( 'This function is not meant to be called directly. It is only here for backwards compatibility purposes.', 'easy-digital-downloads' ); - _doing_it_wrong( __FUNCTION__, $message, 'EDD 3.0' ); - } - - // Bail if not a payment - if ( 'edd_payment' !== $query->get( 'post_type' ) ) { - return; - } - - // Force filters to run - $query->set( 'suppress_filters', false ); - - // Setup doing-it-wrong message - $message = sprintf( - __( 'As of Easy Digital Downloads 3.0, orders no longer exist in the %1$s table. They have been migrated to %2$s. Orders should be accessed using %3$s or %4$s. See %5$s for more information.', 'easy-digital-downloads' ), - '' . $wpdb->posts . '', - '' . edd_get_component_interface( 'order', 'table' )->table_name . '', - 'edd_get_orders()', - 'edd_get_order()', - 'https://easydigitaldownloads.com/development/' - ); - - _doing_it_wrong( 'get_posts()/get_post()/WP_Query', $message, 'EDD 3.0' ); - } - - /** - * Backwards compatibility filters for get_post_meta() calls on payments. - * - * @since 3.0 - * - * @param mixed $value The value get_post_meta would return if we don't filter. - * @param int $object_id The object ID post meta was requested for. - * @param string $meta_key The meta key requested. - * @param bool $single If a single value or an array of the value is requested. - * - * @return mixed The value to return. - */ - public function get_post_metadata( $value, $object_id, $meta_key, $single ) { - - if ( 'get_post_metadata' !== current_filter() ) { - $message = __( 'This function is not meant to be called directly. It is only here for backwards compatibility purposes.', 'easy-digital-downloads' ); - _doing_it_wrong( __FUNCTION__, esc_html( $message ), 'EDD 3.0' ); - } - - // Bail early of not a back-compat key - if ( ! in_array( $meta_key, $this->get_meta_key_whitelist(), true ) ) { - return $value; - } - - // Bail if order does not exist - $order = $this->_shim_edd_get_order( $object_id ); - if ( empty( $order ) ) { - return $value; - } - - switch ( $meta_key ) { - case '_edd_payment_purchase_key': - $value = $order->payment_key; - break; - case '_edd_payment_transaction_id': - $value = $order->get_transaction_id(); - break; - case '_edd_payment_user_email': - $value = $order->email; - break; - case '_edd_payment_meta': - $p = edd_get_payment( $object_id ); - $value = array( $p->get_meta( '_edd_payment_meta' ) ); - break; - case '_edd_completed_date': - $value = $order->date_completed; - break; - case '_edd_payment_gateway': - $value = $order->gateway; - break; - case '_edd_payment_user_id': - $value = $order->user_id; - break; - case '_edd_payment_user_ip': - $value = $order->ip; - break; - case '_edd_payment_mode': - $value = $order->mode; - break; - case '_edd_payment_tax_rate': - $value = $order->get_tax_rate(); - /* - * Tax rates are now stored as percentages (e.g. `20.00`) but previously they were stored as - * decimals (e.g. `0.2`) so we convert it back to a decimal. - */ - if ( is_numeric( $value ) ) { - $value = $value / 100; - } - break; - case '_edd_payment_customer_id': - $value = $order->customer_id; - break; - case '_edd_payment_total': - $value = $order->total; - break; - case '_edd_payment_tax': - $value = $order->tax; - break; - case '_edd_payment_number': - $value = $order->get_number(); - break; - default : - $value = edd_get_order_meta( $order->id, $meta_key, true ); - break; - } - - if ( $this->show_notices ) { - _doing_it_wrong( 'get_post_meta()', 'All payment postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_get_order() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - return $value; - } - - /** - * Backwards compatibility filters for add/update_post_meta() calls on payments. - * - * @since 3.0 - * - * @param mixed $check Comes in 'null' but if returned not null, WordPress Core will not interact with the postmeta table. - * @param int $object_id The object ID post meta was requested for. - * @param string $meta_key The meta key requested. - * @param mixed $meta_value The value get_post_meta would return if we don't filter. - * @param mixed $prev_value The previous value of the meta - * - * @return mixed Returns 'null' if no action should be taken and WordPress core can continue, or non-null to avoid postmeta. - */ - public function update_post_metadata( $check, $object_id, $meta_key, $meta_value, $prev_value ) { - - // Bail early of not a back-compat key - if ( ! in_array( $meta_key, $this->get_meta_key_whitelist(), true ) ) { - return $check; - } - - // Bail if payment does not exist - $payment = edd_get_payment( $object_id ); - if ( empty( $payment ) ) { - return $check; - } - - $check = $payment->update_meta( $meta_key, $meta_value ); - - if ( $this->show_notices ) { - _doing_it_wrong( 'add_post_meta()/update_post_meta()', 'All payment postmeta has been deprecated since Easy Digital Downloads 3.0! Use edd_add_order_meta()/edd_update_order_meta()() instead.', 'EDD 3.0' ); - - if ( $this->show_backtrace ) { - $backtrace = debug_backtrace(); - trigger_error( print_r( $backtrace, 1 ) ); - } - } - - return $check; - } - - /** - * Retrieves a list of whitelisted meta keys that we want to catch in get/update post meta calls. - * - * @since 3.0 - * @return array - */ - private function get_meta_key_whitelist() { - $meta_keys = array( - '_edd_payment_purchase_key', - '_edd_payment_transaction_id', - '_edd_payment_meta', - '_edd_completed_date', - '_edd_payment_gateway', - '_edd_payment_user_id', - '_edd_payment_user_email', - '_edd_payment_user_ip', - '_edd_payment_mode', - '_edd_payment_tax_rate', - '_edd_payment_customer_id', - '_edd_payment_total', - '_edd_payment_tax', - '_edd_payment_number', - '_edd_sl_upgraded_payment_id', // EDD SL - '_edd_sl_is_renewal', // EDD SL - '_edds_stripe_customer_id', // EDD Stripe - ); - - /** - * Allows the whitelisted post meta keys to be filtered. Extensions should add their meta key(s) to this - * list if they want add/update/get post meta calls to be routed to order meta. - * - * @param array $meta_keys - * - * @since 3.0 - */ - $meta_keys = apply_filters( 'edd_30_post_meta_key_whitelist', $meta_keys ); - - return (array) $meta_keys; - } - - /** - * Gets the order from the database. - * This is a duplicate of edd_get_order, but is defined separately here - * for pending migration purposes. - * - * @todo deprecate in 3.1 - * - * @param int $order_id - * @return false|EDD\Orders\Order - */ - private function _shim_edd_get_order( $order_id ) { - $orders = new \EDD\Database\Queries\Order(); - - // Return order - return $orders->get_item( $order_id ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat/class-tax.php b/wp-content/plugins/easy-digital-downloads/includes/compat/class-tax.php deleted file mode 100644 index a41b2953..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat/class-tax.php +++ /dev/null @@ -1,97 +0,0 @@ - $tax_rate['country'], - 'scope' => $scope, - 'amount' => floatval( $tax_rate['rate'] ), - 'description' => $region, - ); - - edd_add_tax_rate( $adjustment_data ); - } - - // Return the value so it is stored for backwards compatibility purposes. - return $value; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/compat/class-template.php b/wp-content/plugins/easy-digital-downloads/includes/compat/class-template.php deleted file mode 100644 index 86924574..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/compat/class-template.php +++ /dev/null @@ -1,119 +0,0 @@ -exists( $template ) && $wp_filesystem->is_writable( $template ) ) { - $contents = $wp_filesystem->get_contents( $template ); - - $get_post_call_exists = strstr( $contents, 'get_post( $edd_receipt_args[\'id\'] )' ); - - if ( false === $get_post_call_exists ) { - return; - } - - $contents = str_replace( 'get_post( $edd_receipt_args[\'id\'] )', 'edd_get_payment( $edd_receipt_args[\'id\'] )', $contents ); - $updated = $wp_filesystem->put_contents( $template, $contents ); - - // Only display a notice if we could not update the file. - if ( ! $updated ) { - add_action( 'admin_notices', function() use ( $template ) { - ?> -
    -

    -

    ', '' ); ?>

    -

    -
    - $name, - 'schema' => '\\EDD\\Database\\Schema', - 'table' => '\\EDD\\Database\\Table', - 'query' => '\\EDD\\Database\\Query', - 'object' => '\\EDD\\Database\\Row', - 'meta' => false - ) ); - - // Setup the component - EDD()->components[ $name ] = new EDD\Component( $r ); - - // Component registered - do_action( 'edd_registered_component', $name, $r, $args ); -} - -/** - * Get an EDD Component object - * - * @since 3.0 - * @param string $name - * - * @return EDD\Component|false False if not exists, EDD\Component if exists - */ -function edd_get_component( $name = '' ) { - $name = sanitize_key( $name ); - - // Return component if exists, or false - return isset( EDD()->components[ $name ] ) - ? EDD()->components[ $name ] - : false; -} - -/** - * Get an EDD Component interface - * - * @since 3.0 - * @param string $component - * @param string $interface - * - * @return mixed False if not exists, EDD Component interface if exists - */ -function edd_get_component_interface( $component = '', $interface = '' ) { - - // Get component - $c = edd_get_component( $component ); - - // Bail if no component - if ( empty( $c ) ) { - return $c; - } - - // Return interface, or false if not exists - return $c->get_interface( $interface ); -} - -/** - * Setup all EDD components - * - * @since 3.0 - */ -function edd_setup_components() { - static $setup = false; - - // Never register components more than 1 time per request - if ( false !== $setup ) { - return; - } - - // Register customer. - edd_register_component( 'customer', array( - 'schema' => '\\EDD\\Database\\Schemas\\Customers', - 'table' => '\\EDD\\Database\\Tables\\Customers', - 'meta' => '\\EDD\\Database\\Tables\\Customer_Meta', - 'query' => '\\EDD\\Database\\Queries\\Customer', - 'object' => 'EDD_Customer' - ) ); - - // Register customer address. - edd_register_component( 'customer_address', array( - 'schema' => '\\EDD\\Database\\Schemas\\Customer_Addresses', - 'table' => '\\EDD\\Database\\Tables\\Customer_Addresses', - 'query' => '\\EDD\\Database\\Queries\\Customer_Address', - 'object' => '\\EDD\\Customers\\Customer_Address', - 'meta' => false - ) ); - - // Register customer email address. - edd_register_component( 'customer_email_address', array( - 'schema' => '\\EDD\\Database\\Schemas\\Customer_Email_Addresses', - 'table' => '\\EDD\\Database\\Tables\\Customer_Email_Addresses', - 'query' => '\\EDD\\Database\\Queries\\Customer_Email_Address', - 'object' => '\\EDD\\Customers\\Customer_Email_Address', - 'meta' => false - ) ); - - // Register adjustment. - edd_register_component( 'adjustment', array( - 'schema' => '\\EDD\\Database\\Schemas\\Adjustments', - 'table' => '\\EDD\\Database\\Tables\\Adjustments', - 'meta' => '\\EDD\\Database\\Tables\\Adjustment_Meta', - 'query' => '\\EDD\\Database\\Queries\\Adjustment', - 'object' => '\\EDD\\Adjustments\\Adjustment' - ) ); - - // Register note. - edd_register_component( 'note', array( - 'schema' => '\\EDD\\Database\\Schemas\\Notes', - 'table' => '\\EDD\\Database\\Tables\\Notes', - 'meta' => '\\EDD\\Database\\Tables\\Note_Meta', - 'query' => '\\EDD\\Database\\Queries\\Note', - 'object' => '\\EDD\\Notes\\Note' - ) ); - - // Register order. - edd_register_component( 'order', array( - 'schema' => '\\EDD\\Database\\Schemas\\Orders', - 'table' => '\\EDD\\Database\\Tables\\Orders', - 'meta' => '\\EDD\\Database\\Tables\\Order_Meta', - 'query' => '\\EDD\\Database\\Queries\\Order', - 'object' => '\\EDD\\Orders\\Order' - ) ); - - // Register order item. - edd_register_component( 'order_item', array( - 'schema' => '\\EDD\\Database\\Schemas\\Order_Items', - 'table' => '\\EDD\\Database\\Tables\\Order_Items', - 'meta' => '\\EDD\\Database\\Tables\\Order_Item_Meta', - 'query' => '\\EDD\\Database\\Queries\\Order_Item', - 'object' => '\\EDD\\Orders\\Order_Item' - ) ); - - // Register order adjustment. - edd_register_component( 'order_adjustment', array( - 'schema' => '\\EDD\\Database\\Schemas\\Order_Adjustments', - 'table' => '\\EDD\\Database\\Tables\\Order_Adjustments', - 'meta' => '\\EDD\\Database\\Tables\\Order_Adjustment_Meta', - 'query' => '\\EDD\\Database\\Queries\\Order_Adjustment', - 'object' => '\\EDD\\Orders\\Order_Adjustment', - ) ); - - // Register order address. - edd_register_component( 'order_address', array( - 'schema' => '\\EDD\\Database\\Schemas\\Order_Addresses', - 'table' => '\\EDD\\Database\\Tables\\Order_Addresses', - 'query' => '\\EDD\\Database\\Queries\\Order_Address', - 'object' => '\\EDD\\Orders\\Order_Address', - 'meta' => false - ) ); - - // Register order transaction. - edd_register_component( 'order_transaction', array( - 'schema' => '\\EDD\\Database\\Schemas\\Order_Transactions', - 'table' => '\\EDD\\Database\\Tables\\Order_Transactions', - 'query' => '\\EDD\\Database\\Queries\\Order_Transaction', - 'object' => '\\EDD\\Orders\\Order_Transaction', - 'meta' => false - ) ); - - // Register log. - edd_register_component( 'log', array( - 'schema' => '\\EDD\\Database\\Schemas\\Logs', - 'table' => '\\EDD\\Database\\Tables\\Logs', - 'meta' => '\\EDD\\Database\\Tables\\Log_Meta', - 'query' => '\\EDD\\Database\\Queries\\Log', - 'object' => '\\EDD\\Logs\\Log' - ) ); - - // Register log API request. - edd_register_component( 'log_api_request', array( - 'schema' => '\\EDD\\Database\\Schemas\\Logs_Api_Requests', - 'table' => '\\EDD\\Database\\Tables\\Logs_Api_Requests', - 'meta' => '\\EDD\\Database\\Tables\\Logs_Api_Request_Meta', - 'query' => '\\EDD\\Database\\Queries\\Log_Api_Request', - 'object' => '\\EDD\\Logs\\Api_Request_Log', - ) ); - - // Register log file download. - edd_register_component( 'log_file_download', array( - 'schema' => '\\EDD\\Database\\Schemas\\Logs_File_Downloads', - 'table' => '\\EDD\\Database\\Tables\\Logs_File_Downloads', - 'meta' => '\\EDD\\Database\\Tables\\Logs_File_Download_Meta', - 'query' => '\\EDD\\Database\\Queries\\Log_File_Download', - 'object' => '\\EDD\\Logs\\File_Download_Log', - ) ); - - edd_register_component( 'notification', array( - 'schema' => '\\EDD\\Database\\Schemas\\Notifications', - 'table' => '\\EDD\\Database\\Tables\\Notifications', - 'query' => '\\EDD\\Database\\Queries\\Notification', - 'object' => '\\EDD\\Notifications\\Notification', - 'meta' => false, - ) ); - - // Set the locally static setup var. - $setup = true; - - // Action to allow third party components to be setup. - do_action( 'edd_setup_components' ); -} - -/** - * Install all component database tables - * - * This function installs all database tables used by all components (including - * third-party and add-ons that use the Component API) - * - * This is used by unit tests and tools. - * - * @since 3.0 - */ -function edd_install_component_database_tables() { - - // Get the components - $components = EDD()->components; - - // Bail if no components setup yet - if ( empty( $components ) ) { - return; - } - - // Drop all component tables - foreach ( $components as $component ) { - - // Objects - $object = $component->get_interface( 'table' ); - if ( $object instanceof \EDD\Database\Table && ! $object->exists() ) { - $object->install(); - } - - // Meta - $meta = $component->get_interface( 'meta' ); - if ( $meta instanceof \EDD\Database\Table && ! $meta->exists() ) { - $meta->install(); - } - } -} - -/** - * Uninstall all component database tables - * - * This function is destructive and disastrous, so do not call it directly - * unless you fully intend to destroy all data (including third-party add-ons - * that use the Component API) - * - * This is used by unit tests and tools. - * - * @since 3.0 - */ -function edd_uninstall_component_database_tables() { - - // Get the components - $components = EDD()->components; - - // Bail if no components setup yet - if ( empty( $components ) ) { - return; - } - - // Drop all component tables - foreach ( $components as $component ) { - - // Objects - $object = $component->get_interface( 'table' ); - if ( $object instanceof \EDD\Database\Table && $object->exists() ) { - $object->uninstall(); - } - - // Meta - $meta = $component->get_interface( 'meta' ); - if ( $meta instanceof \EDD\Database\Table && $meta->exists() ) { - $meta->uninstall(); - } - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/country-functions.php b/wp-content/plugins/easy-digital-downloads/includes/country-functions.php deleted file mode 100644 index 68fcecf7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/country-functions.php +++ /dev/null @@ -1,420 +0,0 @@ -get_states( $country ); - - return apply_filters( 'edd_shop_states', $states, $country ); -} - -/** - * Get Country List - * - * @since 1.0 - * @return array $countries A list of the available countries - */ -function edd_get_country_list() { - return apply_filters( 'edd_countries', include EDD_PLUGIN_DIR . 'i18n/countries.php' ); -} - -/** - * Get States List - * - * @since 1.2 - * @return array - */ -function edd_get_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_us_states', $countries->get_states( 'US' ) ); -} - -/** - * Get Angola States - * - * @since 2.8.5 - * @return array $states A list of states - */ -function edd_get_angola_provinces_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_angola_provinces', $countries->get_states( 'AO' ) ); -} - -/** - * Get Provinces List - * - * @since 1.2 - * @return array - */ -function edd_get_provinces_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_canada_provinces', $countries->get_states( 'CA' ) ); -} - -/** - * Get Australian States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_australian_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_australian_states', $countries->get_states( 'AU' ) ); -} - -/** - * Get Bangladeshi States (districts) - * - * @since 2.2.3 - * @return array $states A list of states - */ -function edd_get_bangladeshi_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_bangladeshi_states', $countries->get_states( 'BD' ) ); -} - -/** - * Get Brazil States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_brazil_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_brazil_states', $countries->get_states( 'BR' ) ); -} - -/** - * Get Bulgarian States - * - * @since 2.2.3 - * @return array $states A list of states - */ -function edd_get_bulgarian_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_bulgarian_states', $countries->get_states( 'BG' ) ); -} - -/** - * Get Hong Kong States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_hong_kong_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_hong_kong_states', $countries->get_states( 'HK' ) ); -} - -/** - * Get Hungary States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_hungary_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_hungary_states', $countries->get_states( 'HU' ) ); -} - -/** - * Get Japanese States - * - * @since 2.2.3 - * @return array $states A list of states - */ -function edd_get_japanese_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_japanese_states', $countries->get_states( 'JP' ) ); -} - -/** - * Get Chinese States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_chinese_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_chinese_states', $countries->get_states( 'CN' ) ); -} - -/** - * Get United Kingdom States - * - * @since 2.9 - * @return array $states A list of states - */ -function edd_get_united_kingdom_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_united_kingdom_states', $countries->get_states( 'GB' ) ); -} - -/** - * Get New Zealand States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_new_zealand_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_new_zealand_states', $countries->get_states( 'NZ' ) ); -} - -/** - * Get Peruvian States - * - * @since 2.2.3 - * @return array $states A list of states - */ -function edd_get_peruvian_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_peruvian_states', $countries->get_states( 'PE' ) ); -} - -/** - * Get Indonesian States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_indonesian_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_indonesia_states', $countries->get_states( 'ID' ) ); -} - -/** - * Get Indian States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_indian_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_indian_states', $countries->get_states( 'IN' ) ); -} - -/** - * Get Iranian States - * - * @since 2.2.3 - * @return array $states A list of states - */ -function edd_get_iranian_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_iranian_states', $countries->get_states( 'IR' ) ); -} - -/** - * Get Italian Provinces - * - * @since 2.2.3 - * @return array $states A list of states - */ -function edd_get_italian_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_italian_states', $countries->get_states( 'IT' ) ); -} - -/** - * Get Malaysian States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_malaysian_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_malaysian_states', $countries->get_states( 'MY' ) ); -} - -/** - * Get Mexican States - * - * @since 2.2.3 - * @return array $states A list of states - */ -function edd_get_mexican_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_mexican_states', $countries->get_states( 'MX' ) ); -} - -/** - * Get Nepalese States (Districts) - * - * @since 2.2.3 - * @return array $states A list of states - */ -function edd_get_nepalese_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_nepalese_states', $countries->get_states( 'NP' ) ); -} - -/** - * Get South African States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_south_african_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_south_african_states', $countries->get_states( 'ZA' ) ); -} - -/** - * Get Thailand States - * - * @since 1.6 - * @return array $states A list of states - */ -function edd_get_thailand_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_thailand_states', $countries->get_states( 'TH' ) ); -} - -/** - * Get Turkey States - * - * @since 2.2.3 - * @return array $states A list of states - */ -function edd_get_turkey_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_turkey_states', $countries->get_states( 'TR' ) ); -} - -/** - * Get Spain States - * - * @since 2.2 - * @return array $states A list of states - */ -function edd_get_spain_states_list() { - $countries = new EDD\Utils\Countries(); - - return apply_filters( 'edd_spain_states', $countries->get_states( 'ES' ) ); -} - -/** - * Returns a list of Netherland's provinces. - * - * @since 3.0 - * @return array $states A list of Netherland's provinces. - */ -function edd_get_netherlands_provinces_list() { - $countries = new EDD\Utils\Countries(); - - /** - * Filters the list of Netherland's provinces. - * - * @since 3.0 - * - * @param array $states A list of Netherland's provinces. - */ - return apply_filters( 'edd_netherlands_provinces', $countries->get_states( 'NL' ) ); -} - -/** - * Given a country code, return the country name - * - * @since 2.8.7 - * @param string $country_code The ISO Code for the country - * - * @return string - */ -function edd_get_country_name( $country_code = '' ) { - $country_list = edd_get_country_list(); - $country_name = isset( $country_list[ $country_code ] ) ? $country_list[ $country_code ] : $country_code; - - return apply_filters( 'edd_get_country_name', $country_name, $country_code ); -} - -/** - * Given a country and state code, return the state name - * - * @since 2.9 - * @param string $country_code The ISO Code for the country - * @param string $state_code The ISO Code for the state - * - * @return string - */ -function edd_get_state_name( $country_code = '', $state_code = '' ) { - if ( empty( $country_code ) ) { - $country_code = edd_get_shop_country(); - } - $countries = new EDD\Utils\Countries(); - $state_name = $countries->get_state_name( $country_code, $state_code ); - - return apply_filters( 'edd_get_state_name', $state_name, $state_code ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/currency/functions.php b/wp-content/plugins/easy-digital-downloads/includes/currency/functions.php deleted file mode 100644 index d9bacec3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/currency/functions.php +++ /dev/null @@ -1,119 +0,0 @@ - __( 'US Dollars ($)', 'easy-digital-downloads' ), - 'EUR' => __( 'Euros (€)', 'easy-digital-downloads' ), - 'GBP' => __( 'Pound Sterling (£)', 'easy-digital-downloads' ), - 'AUD' => __( 'Australian Dollars ($)', 'easy-digital-downloads' ), - 'BRL' => __( 'Brazilian Real (R$)', 'easy-digital-downloads' ), - 'CAD' => __( 'Canadian Dollars ($)', 'easy-digital-downloads' ), - 'CZK' => __( 'Czech Koruna', 'easy-digital-downloads' ), - 'DKK' => __( 'Danish Krone', 'easy-digital-downloads' ), - 'HKD' => __( 'Hong Kong Dollar ($)', 'easy-digital-downloads' ), - 'HUF' => __( 'Hungarian Forint', 'easy-digital-downloads' ), - 'ILS' => __( 'Israeli Shekel (₪)', 'easy-digital-downloads' ), - 'JPY' => __( 'Japanese Yen (¥)', 'easy-digital-downloads' ), - 'MYR' => __( 'Malaysian Ringgits', 'easy-digital-downloads' ), - 'MXN' => __( 'Mexican Peso ($)', 'easy-digital-downloads' ), - 'NZD' => __( 'New Zealand Dollar ($)', 'easy-digital-downloads' ), - 'NOK' => __( 'Norwegian Krone', 'easy-digital-downloads' ), - 'PHP' => __( 'Philippine Pesos', 'easy-digital-downloads' ), - 'PLN' => __( 'Polish Zloty', 'easy-digital-downloads' ), - 'SGD' => __( 'Singapore Dollar ($)', 'easy-digital-downloads' ), - 'SEK' => __( 'Swedish Krona', 'easy-digital-downloads' ), - 'CHF' => __( 'Swiss Franc', 'easy-digital-downloads' ), - 'TWD' => __( 'Taiwan New Dollars', 'easy-digital-downloads' ), - 'THB' => __( 'Thai Baht (฿)', 'easy-digital-downloads' ), - 'INR' => __( 'Indian Rupee (₹)', 'easy-digital-downloads' ), - 'TRY' => __( 'Turkish Lira (₺)', 'easy-digital-downloads' ), - 'RIAL' => __( 'Iranian Rial (﷼)', 'easy-digital-downloads' ), - 'RUB' => __( 'Russian Rubles', 'easy-digital-downloads' ), - 'AOA' => __( 'Angolan Kwanza', 'easy-digital-downloads' ), - ); - - return apply_filters( 'edd_currencies', $currencies ); -} - -/** - * Accepts an amount (ideally from the database, unmodified) and formats it - * for display. The amount itself is formatted and the currency prefix/suffix - * is applied and positioned. - * - * @since 3.0 - * - * @param int|float|string $amount - * @param string $currency - * - * @return string - */ -function edd_display_amount( $amount, $currency ) { - $formatter = new Money_Formatter( $amount, new Currency( $currency ) ); - - return $formatter->format_for_display() - ->apply_symbol(); -} - -/** - * Get the store's set currency - * - * @since 1.5.2 - * @return string The currency code - */ -function edd_get_currency() { - $currency = edd_get_option( 'currency', 'USD' ); - return apply_filters( 'edd_currency', $currency ); -} - -/** - * Given a currency determine the symbol to use. If no currency given, site default is used. - * If no symbol is determined, the currency string is returned. - * - * @since 2.2 - * - * @param string $currency The currency string - * - * @return string The symbol to use for the currency - */ -function edd_currency_symbol( $currency = '' ) { - if ( empty( $currency ) ) { - $currency = edd_get_currency(); - } - - $currency = new Currency( $currency ); - - return $currency->symbol; -} - -/** - * Get the name of a currency - * - * @since 2.2 - * - * @param string $code The currency code - * - * @return string The currency's name - */ -function edd_get_currency_name( $code = 'USD' ) { - $currencies = edd_get_currencies(); - $name = isset( $currencies[ $code ] ) ? $currencies[ $code ] : $code; - return apply_filters( 'edd_currency_name', $name ); -} - diff --git a/wp-content/plugins/easy-digital-downloads/includes/customer-functions.php b/wp-content/plugins/easy-digital-downloads/includes/customer-functions.php deleted file mode 100644 index 201a38ad..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/customer-functions.php +++ /dev/null @@ -1,971 +0,0 @@ -add_item( $data ); -} - -/** - * Delete a customer. - * - * @since 3.0 - * - * @param int ID of customer to delete. - * @return int|false `1` if the customer was deleted successfully, false on error. - */ -function edd_delete_customer( $customer_id = 0 ) { - $customers = new EDD\Database\Queries\Customer(); - - return $customers->delete_item( $customer_id ); -} - -/** - * Destroy a customer. - * - * Completely deletes a customer, and the addresses and email addresses with it. - * - * @since 3.0 - * - * @param int $customer_id Customer ID. - * @return int|false `1` if the customer was deleted successfully, false on error. - */ -function edd_destroy_customer( $customer_id = 0 ) { - - // Bail if a customer ID was not passed. - if ( empty( $customer_id ) ) { - return false; - } - - // Get email addresses. - $email_addresses = edd_get_customer_email_addresses( array( - 'customer_id' => $customer_id, - 'no_found_rows' => true, - ) ); - - // Destroy email addresses. - if ( ! empty( $email_addresses ) ) { - foreach ( $email_addresses as $email_address ) { - edd_delete_customer_email_address( $email_address->id ); - } - } - - // Get addresses. - $addresses = edd_get_customer_addresses( array( - 'customer_id' => $customer_id, - 'no_found_rows' => true, - ) ); - - // Destroy addresses. - if ( ! empty( $addresses ) ) { - foreach ( $addresses as $address ) { - edd_delete_customer_address( $address->id ); - } - } - - // Delete the customer. - $customer_destroyed = edd_delete_customer( $customer_id ); - if ( ! empty( $customer_destroyed ) ) { - /** - * Action that runs when a customer is destroyed with the edd_destroy_customer function. - * - * This action is similar to edd_customer_deleted and includes running that action, - * but also includes deleting all customer addresses and email addresses. - * - * @since 3.0.4 - * - * @param int $customer_id Customer ID being destroyed. - */ - do_action( 'edd_customer_destroyed', $customer_id ); - } - - return $customer_destroyed; -} - -/** - * Update a customer. - * - * @since 3.0 - * - * @param int $customer_id Customer ID. - * @param array $data { - * Array of customer data. Default empty. - * - * @type int $user_id WordPress user ID linked to the customer account. - * Default 0. - * @type string $email Customer's primary email address. Default empty. - * @type string $name Customer's name. Default empty. - * @type string $status Customer's status. Default `active`. - * @type float $purchase_value Aggregated purchase value of the customer. - * Default 0. - * @type int $purchase_count Aggregated purchase count of the customer. - * Default 0. - * @type string $date_created Optional. Automatically calculated on add/edit. - * The date & time the customer was created. - * Format: YYYY-MM-DD HH:MM:SS. Default empty. - * @type string $date_modified Optional. Automatically calculated on add/edit. - * The date & time the customer was last modified. - * Format: YYYY-MM-DD HH:MM:SS. Default empty. - * } - * - * @return int|false Number of rows updated if successful, false otherwise. - */ -function edd_update_customer( $customer_id = 0, $data = array() ) { - $customers = new EDD\Database\Queries\Customer(); - - return $customers->update_item( $customer_id, $data ); -} - -/** - * Get a customer item by ID. - * - * @since 3.0 - * - * @param int $customer_id Customer ID. - * @return EDD_Customer|false Customer object if successful, false otherwise. - */ -function edd_get_customer( $customer_id = 0 ) { - $customers = new EDD\Database\Queries\Customer(); - - // Return customer. - return $customers->get_item( $customer_id ); -} - -/** - * Get a customer item by a specific field value. - * - * @since 3.0 - * - * @param string $field Database table field. - * @param string $value Value of the row. - * - * @return EDD_Customer|false Customer object if successful, false otherwise. - */ -function edd_get_customer_by( $field = '', $value = '' ) { - // For backwards compatibility in filters only. - $customers_db = EDD()->customers; - - /** - * Filters the Customer before querying the database. - * - * Return a non-null value to bypass the default query and return early. - * - * @since 2.9.23 - * - * @param mixed|null $customer Customer to return instead. Default null to use default method. - * @param string $field The field to retrieve by. - * @param mixed $value The value to search by. - * @param EDD\Compat\Customer $edd_customers_db Customer database class. Deprecated in 3.0. - */ - $found = apply_filters( 'edd_pre_get_customer', null, $field, $value, $customers_db ); - - if ( null !== $found ) { - return $found; - } - - $customers = new EDD\Database\Queries\Customer(); - if ( 'email' === $field ) { - $customer_emails = new EDD\Database\Queries\Customer_Email_Address(); - $customer_email = $customer_emails->get_item_by( 'email', $value ); - - $customer = false; - if ( ! empty( $customer_email->customer_id ) ) { - $customer = $customers->get_item_by( 'id', $customer_email->customer_id ); - } - } else { - $customer = $customers->get_item_by( $field, $value ); - } - - /** - * Filters the single Customer retrieved from the database based on field. - * - * @since 2.9.23 - * - * @param EDD_Customer|false $customer Customer query result. False if no Customer is found. - * @param array $args Arguments used to query the Customer. - * @param EDD\Compat\Customer $edd_customers_db Customer database class. Deprecated in 3.0. - */ - $customer = apply_filters( "edd_get_customer_by_{$field}", $customer, $customers->query_vars, $customers_db ); - - /** - * Filters the single Customer retrieved from the database. - * - * @since 2.9.23 - * - * @param EDD_Customer|false $customer Customer query result. False if no Customer is found. - * @param array $args Arguments used to query the Customer. - * @param EDD_DB_Customers $edd_customers_db Customer database class. - */ - $customer = apply_filters( 'edd_get_customer', $customer, $customers->query_vars, $customers_db ); - - return $customer; -} - -/** - * Get a field from a customer object. - * - * @since 3.0 - * - * @param int $customer_id Customer ID. Default `0`. - * @param string $field Field to retrieve from object. Default empty. - * - * @return mixed Null if customer does not exist. Value of Customer if exists. - */ -function edd_get_customer_field( $customer_id = 0, $field = '' ) { - $customer = edd_get_customer( $customer_id ); - - // Check that field exists. - return isset( $customer->{$field} ) - ? $customer->{$field} - : null; -} - -/** - * Query for customers. - * - * @see \EDD\Database\Queries\Customer::__construct() - * - * @since 3.0 - * - * @param array $args Arguments. See `EDD\Database\Queries\Customer` for - * accepted arguments. - * @return \EDD_Customer[] Array of `EDD_Customer` objects. - */ -function edd_get_customers( $args = array() ) { - - // Parse args - $r = wp_parse_args( $args, array( - 'number' => 30 - ) ); - - if ( -1 == $r['number'] ) { - _doing_it_wrong( __FUNCTION__, esc_html__( 'Do not use -1 to retrieve all results.', 'easy-digital-downloads' ), '3.0' ); - $r['number'] = 9999999; - } - - // Instantiate a query object - $customers = new EDD\Database\Queries\Customer(); - - // Return customers - return $customers->query( $r ); -} - -/** - * Get total number of customers. - * - * @see \EDD\Database\Queries\Customer::__construct() - * - * @since 3.0 - * - * @param array $args Arguments. See `EDD\Database\Queries\Customer` for - * accepted arguments. - * @return int Number of customers returned based on query arguments passed. - */ -function edd_count_customers( $args = array() ) { - - // Parse args - $r = wp_parse_args( $args, array( - 'count' => true - ) ); - - // Query for count(s) - $customers = new EDD\Database\Queries\Customer( $r ); - - // Return count(s) - return absint( $customers->found_items ); -} - -/** - * Query for and return array of customer counts, keyed by status. - * - * @since 3.0 - * - * @param array $args Arguments. See `EDD\Database\Queries\Customer` for - * accepted arguments. - * @return array Customer counts keyed by status. - */ -function edd_get_customer_counts( $args = array() ) { - - // Parse arguments - $r = wp_parse_args( $args, array( - 'count' => true, - 'groupby' => 'status' - ) ); - - // Query for count - $counts = new EDD\Database\Queries\Customer( $r ); - - // Format & return - return edd_format_counts( $counts, $r['groupby'] ); -} - -/** - * Return the role used to edit customers. - * - * @since 3.0 - * - * @return string Role used to edit customers. - */ -function edd_get_edit_customers_role() { - - /** - * Filter role used to edit customers. - * - * @since 2.3 - * - * @param string WordPress role used to edit customers. Default `edit_shop_payments`. - */ - return apply_filters( 'edd_edit_customers_role', 'edit_shop_payments' ); -} - -/** - * Retrieve all of the IP addresses used by a customer. - * - * @since 3.0 - * - * @param int $customer_id Customer ID. - * - * @return array Array of objects containing IP addresses. - */ -function edd_get_customer_ip_addresses( $customer_id = 0 ) { - - // Bail if no customer ID was passed. - if ( empty( $customer_id ) ) { - return array(); - } - - $customer = edd_get_customer( $customer_id ); - - return $customer->get_ips(); -} - -/** Meta **********************************************************************/ - -/** - * Add meta data field to a customer. - * - * @since 3.0 - * - * @param int $customer_id Customer ID. - * @param string $meta_key Meta data name. - * @param mixed $meta_value Meta data value. Must be serializable if non-scalar. - * @param bool $unique Optional. Whether the same key should not be added. - * Default false. - * - * @return int|false Meta ID on success, false on failure. - */ -function edd_add_customer_meta( $customer_id, $meta_key, $meta_value, $unique = false ) { - return add_metadata( 'edd_customer', $customer_id, $meta_key, $meta_value, $unique ); -} - -/** - * Remove meta data matching criteria from a customer. - * - * You can match based on the key, or key and value. Removing based on key and - * value, will keep from removing duplicate meta data with the same key. It also - * allows removing all meta data matching key, if needed. - * - * @since 3.0 - * - * @param int $customer_id Customer ID. - * @param string $meta_key Meta data name. - * @param mixed $meta_value Optional. Meta data value. Must be serializable if - * non-scalar. Default empty. - * - * @return bool True on success, false on failure. - */ -function edd_delete_customer_meta( $customer_id, $meta_key, $meta_value = '' ) { - return delete_metadata( 'edd_customer', $customer_id, $meta_key, $meta_value ); -} - -/** - * Retrieve customer meta field for a customer. - * - * @since 3.0 - * - * @param int $customer_id Customer ID. - * @param string $key Optional. The meta key to retrieve. By default, returns - * data for all keys. Default empty. - * @param bool $single Optional, default is false. - * If true, return only the first value of the specified meta_key. - * This parameter has no effect if meta_key is not specified. - * - * @return mixed Will be an array if $single is false. Will be value of meta data - * field if $single is true. - */ -function edd_get_customer_meta( $customer_id, $key = '', $single = false ) { - return get_metadata( 'edd_customer', $customer_id, $key, $single ); -} - -/** - * Update customer meta field based on customer ID. - * - * Use the $prev_value parameter to differentiate between meta fields with the - * same key and customer ID. - * - * If the meta field for the customer does not exist, it will be added. - * - * @since 3.0 - * - * @param int $customer_id Customer ID. - * @param string $meta_key Meta data key. - * @param mixed $meta_value Meta data value. Must be serializable if non-scalar. - * @param mixed $prev_value Optional. Previous value to check before removing. - * Default empty. - * - * @return int|bool Meta ID if the key didn't exist, true on successful update, - * false on failure. - */ -function edd_update_customer_meta( $customer_id, $meta_key, $meta_value, $prev_value = '' ) { - return update_metadata( 'edd_customer', $customer_id, $meta_key, $meta_value, $prev_value ); -} - -/** - * Delete everything from customer meta matching meta key. - * - * @since 3.0 - * - * @param string $meta_key Key to search for when deleting. - * - * @return bool Whether the customer meta key was deleted from the database. - */ -function edd_delete_customer_meta_by_key( $meta_key ) { - return delete_metadata( 'edd_customer', null, $meta_key, '', true ); -} - -/** Customer Addresses **********************************************************/ - -/** - * Get a customer address by ID. - * - * @internal This method is named edd_fetch_customer_address as edd_get_customer_address - * exists for backwards compatibility purposes and returns an array instead of - * an object. - * - * @since 3.0 - * - * @param int $customer_address_id Customer address ID. - * @return EDD\Customers\Customer_Address Customer address object. - */ -function edd_fetch_customer_address( $customer_address_id = 0 ) { - $customer_addresses = new EDD\Database\Queries\Customer_Address(); - - // Return customer address. - return $customer_addresses->get_item( $customer_address_id ); -} - -/** - * Add a customer address. - * - * @since 3.0 - * - * @param array $data { - * Array of customer address data. Default empty. - * - * The `date_created` and `date_modified` parameters do not need to be passed. - * They will be automatically populated if empty. - * - * @type int $customer_id Customer ID. Default `0`. - * @type string $type Address type. Default `billing`. - * @type string $status Address status, if used or not. Default `active`. - * @type string $address First line of address. Default empty. - * @type string $address2 Second line of address. Default empty. - * @type string $city City. Default empty. - * @type string $region Region. See `edd_get_shop_states()` for - * accepted values. Default empty. - * @type string $postal_code Postal code. Default empty. - * @type string $country Country. See `edd_get_country_list()` for - * accepted values. Default empty. - * @type string $date_created Optional. Automatically calculated on add/edit. - * The date & time the address was inserted. - * Format: YYYY-MM-DD HH:MM:SS. Default empty. - * @type string $date_modified Optional. Automatically calculated on add/edit. - * The date & time the address was last modified. - * Format: YYYY-MM-DD HH:MM:SS. Default empty. - * } - * @return int|false ID of newly created customer address, false on error. - */ -function edd_add_customer_address( $data = array() ) { - - // A customer ID must be supplied for every address inserted. - if ( empty( $data['customer_id'] ) ) { - return false; - } - - $customer_addresses = new EDD\Database\Queries\Customer_Address(); - - return $customer_addresses->add_item( $data ); -} - -/** - * Delete a customer address. - * - * @since 3.0 - * - * @param int $customer_address_id Customer address ID. - * @return int|false `1` if the adjustment was deleted successfully, false on error. - */ -function edd_delete_customer_address( $customer_address_id = 0 ) { - $customer_addresses = new EDD\Database\Queries\Customer_Address(); - - return $customer_addresses->delete_item( $customer_address_id ); -} - -/** - * Update a customer address. - * - * @since 3.0 - * - * @param int $customer_address_id Customer address ID. - * @param array $data { - * Array of customer address data. Default empty. - * - * @type int $customer_id Customer ID. Default `0`. - * @type string $type Address type. Default `billing`. - * @type string $status Address status, if used or not. Default `active`. - * @type string $address First line of address. Default empty. - * @type string $address2 Second line of address. Default empty. - * @type string $city City. Default empty. - * @type string $region Region. See `edd_get_shop_states()` for - * accepted values. Default empty. - * @type string $postal_code Postal code. Default empty. - * @type string $country Country. See `edd_get_country_list()` for - * accepted values. Default empty. - * @type string $date_created Optional. Automatically calculated on add/edit. - * The date & time the adjustment was inserted. - * Format: YYYY-MM-DD HH:MM:SS. Default empty. - * @type string $date_modified Optional. Automatically calculated on add/edit. - * The date & time the adjustment was last modified. - * Format: YYYY-MM-DD HH:MM:SS. Default empty. - * } - * - * @return int|false Number of rows updated if successful, false otherwise. - */ -function edd_update_customer_address( $customer_address_id = 0, $data = array() ) { - $customer_addresses = new EDD\Database\Queries\Customer_Address(); - - return $customer_addresses->update_item( $customer_address_id, $data ); -} - -/** - * Get a customer address by a specific field value. - * - * @since 3.0 - * - * @param string $field Database table field. - * @param string $value Value of the row. - * - * @return \EDD\Customers\Customer_Address|false Customer_Address if successful, - * false otherwise. - */ -function edd_get_customer_address_by( $field = '', $value = '' ) { - $customer_addresses = new EDD\Database\Queries\Customer_Address(); - - // Return customer address - return $customer_addresses->get_item_by( $field, $value ); -} - -/** - * Query for customer addresses. - * - * @see \EDD\Database\Queries\Customer_Address::__construct() - * - * @since 3.0 - * - * @param array $args Arguments. See `EDD\Database\Queries\Customer_Address` for - * accepted arguments. - * @return \EDD\Customers\Customer_Address[] Array of `Customer_Address` objects. - */ -function edd_get_customer_addresses( $args = array() ) { - - // Parse args - $r = wp_parse_args( $args, array( - 'number' => 30 - ) ); - - // Instantiate a query object - $customer_addresses = new EDD\Database\Queries\Customer_Address(); - - // Return addresses - return $customer_addresses->query( $r ); -} - -/** - * Count customer addresses. - * - * @see \EDD\Database\Queries\Customer_Address::__construct() - * - * @since 3.0 - * - * @param array $args Arguments. See `EDD\Database\Queries\Customer_Address` for - * accepted arguments. - * @return int Number of customer addresses returned based on query arguments passed. - */ -function edd_count_customer_addresses( $args = array() ) { - - // Parse args - $r = wp_parse_args( $args, array( - 'count' => true - ) ); - - // Query for count(s) - $customer_addresses = new EDD\Database\Queries\Customer_Address( $r ); - - // Return count(s) - return absint( $customer_addresses->found_items ); -} - -/** - * Maybe add a customer address. Only unique addresses will be added. Used - * by `edd_build_order()` and `edd_add_manual_order()` to maybe add order - * addresses to the customer addresses table. Also used by the data migrator - * class when migrating orders from 2.9. - * - * @since 3.0 - * - * @param int $customer_id Customer ID. - * @param array $data { - * Array of customer address data. Default empty. - * - * @type string $type Address type. Default `billing`. - * @type string $status Address status, if used or not. Default `active`. - * @type string $address First line of address. Default empty. - * @type string $address2 Second line of address. Default empty. - * @type string $city City. Default empty. - * @type string $region Region. See `edd_get_shop_states()` for - * accepted values. Default empty. - * @type string $postal_code Postal code. Default empty. - * @type string $country Country. See `edd_get_country_list()` for - * accepted values. Default empty. - * @type string $date_created Optional. Automatically calculated on add/edit. - * The date & time the address was inserted. - * Format: YYYY-MM-DD HH:MM:SS. Default empty. - * @type string $date_modified Optional. Automatically calculated on add/edit. - * The date & time the address was last modified. - * Format: YYYY-MM-DD HH:MM:SS. Default empty. - * } - * - * @return int|false ID of the insert customer address. False otherwise. - */ -function edd_maybe_add_customer_address( $customer_id = 0, $data = array() ) { - - // Bail if nothing passed. - if ( empty( $customer_id ) || empty( $data ) ) { - return false; - } - - // Set up an array with empty address keys. If all of these are empty in $data, the address should not be added. - $empty_address = array( - 'address' => '', - 'address2' => '', - 'city' => '', - 'region' => '', - 'country' => '', - 'postal_code' => '', - ); - $address_to_check = array_intersect_key( $data, $empty_address ); - $address_to_check = array_filter( $address_to_check ); - if ( empty( $address_to_check ) ) { - return false; - } - $address_to_check['customer_id'] = $customer_id; - $address_to_check['type'] = empty( $data['type'] ) ? 'billing' : $data['type']; - - // Check if this address is already assigned to the customer. - $address_exists = edd_get_customer_addresses( $address_to_check ); - if ( ! empty( $address_exists ) ) { - if ( 'billing' === $address_to_check['type'] ) { - edd_update_customer_address( $address_exists[0], array( 'is_primary' => true ) ); - } - return false; - } - - $data['customer_id'] = $customer_id; - if ( 'billing' === $address_to_check['type'] ) { - $data['is_primary'] = true; - } - - // Add the new address to the customer record. - return edd_add_customer_address( $data ); -} - -/** - * Query for and return array of customer address counts, keyed by status. - * - * @see \EDD\Database\Queries\Customer_Address::__construct() - * - * @since 3.0 - * - * @param array $args Arguments. See `EDD\Database\Queries\Customer_Address` for - * accepted arguments. - * @return array Customer address counts keyed by status. - */ -function edd_get_customer_address_counts( $args = array() ) { - - // Parse args - $r = wp_parse_args( $args, array( - 'count' => true, - 'groupby' => 'status' - ) ); - - // Query for count - $counts = new EDD\Database\Queries\Customer_Address( $r ); - - // Format & return - return edd_format_counts( $counts, $r['groupby'] ); -} - -/** Customer Email Addresses *************************************************/ - -/** - * Add a customer email address. - * - * @since 3.0 - * - * @param array $data { - * Array of customer email address data. Default empty. - * - * The `date_created` and `date_modified` parameters do not need to be passed. - * They will be automatically populated if empty. - * - * @type int $customer_id Customer ID. Default `0`. - * @type string $type Email address type. Default `secondary`. - * @type string $status Email address type. Default `active`. - * @type string $email Email address. Default empty. - * @type string $date_created Optional. Automatically calculated on add/edit. - * The date & time the email address was inserted. - * Format: YYYY-MM-DD HH:MM:SS. Default empty. - * @type string $date_modified Optional. Automatically calculated on add/edit. - * The date & time the email address was last - * modified. Format: YYYY-MM-DD HH:MM:SS. Default empty. - * } - * @return int|false ID of newly created customer email address, false on error. - */ -function edd_add_customer_email_address( $data ) { - - // A customer ID and email must be supplied for every address inserted. - if ( empty( $data['customer_id'] ) || empty( $data['email'] ) ) { - return false; - } - - // Instantiate a query object. - $customer_email_addresses = new EDD\Database\Queries\Customer_Email_Address(); - - // Check if the address already exists for this customer. - $existing_addresses = $customer_email_addresses->query( - array( - 'customer_id' => $data['customer_id'], - 'email' => $data['email'], - ) - ); - if ( ! empty( $existing_addresses ) ) { - return false; - } - - // Add the email address to the customer. - return $customer_email_addresses->add_item( $data ); -} - -/** - * Delete a customer email address. - * - * @since 3.0 - * - * @param int $customer_email_address_id Customer email address ID. - * @return int|false `1` if the customer email address was deleted successfully, - * false on error. - */ -function edd_delete_customer_email_address( $customer_email_address_id ) { - $customer_email_addresses = new EDD\Database\Queries\Customer_Email_Address(); - - return $customer_email_addresses->delete_item( $customer_email_address_id ); -} - -/** - * Update a customer email address. - * - * @since 3.0 - * - * @param int $customer_email_address_id Customer email address ID. - * @param array $data { - * Array of customer email address data. Default empty. - * - * @type int $customer_id Customer ID. Default `0`. - * @type string $type Email address type. Default `secondary`. - * @type string $status Email address type. Default `active`. - * @type string $email Email address. Default empty. - * @type string $date_created Optional. Automatically calculated on add/edit. - * The date & time the email address was inserted. - * Format: YYYY-MM-DD HH:MM:SS. Default empty. - * @type string $date_modified Optional. Automatically calculated on add/edit. - * The date & time the email address was last - * modified. Format: YYYY-MM-DD HH:MM:SS. Default empty. - * } - * - * @return int|false Number of rows updated if successful, false otherwise. - */ -function edd_update_customer_email_address( $customer_email_address_id, $data = array() ) { - $customer_email_addresses = new EDD\Database\Queries\Customer_Email_Address(); - - return $customer_email_addresses->update_item( $customer_email_address_id, $data ); -} - -/** - * Get a customer email address by ID. - * - * @since 3.0 - * - * @param int $customer_email_address_id Customer email address ID. - * @return \EDD\Customers\Customer_Email_Address|false Customer_Email_Address if - * successful, false otherwise. - */ -function edd_get_customer_email_address( $customer_email_address_id ) { - $customer_email_addresses = new EDD\Database\Queries\Customer_Email_Address(); - - // Return customer email address - return $customer_email_addresses->get_item( $customer_email_address_id ); -} - -/** - * Get a customer email address by a specific field value. - * - * @since 3.0 - * - * @param string $field Database table field. - * @param string $value Value of the row. - * - * @return \EDD\Customers\Customer_Email_Address|false Customer_Email_Address if - * successful, false otherwise. - */ -function edd_get_customer_email_address_by( $field = '', $value = '' ) { - $customer_email_addresses = new EDD\Database\Queries\Customer_Email_Address(); - - // Return customer email address - return $customer_email_addresses->get_item_by( $field, $value ); -} - -/** - * Query for customer email addresses. - * - * @see \EDD\Database\Queries\Customer_Email_Address::__construct() - * - * @since 3.0 - * - * @param array $args Arguments. See `EDD\Database\Queries\Customer_Email_Address` - * for accepted arguments. - * @return \EDD\Customers\Customer_Email_Address[] Array of `Customer_Email_Address` objects. - */ -function edd_get_customer_email_addresses( $args = array() ) { - - // Parse args - $r = wp_parse_args( $args, array( - 'number' => 30 - ) ); - - // Instantiate a query object - $customer_email_addresses = new EDD\Database\Queries\Customer_Email_Address(); - - // Return customer email addresses - return $customer_email_addresses->query( $r ); -} - -/** - * Count customer addresses. - * - * @see \EDD\Database\Queries\Customer_Email_Address::__construct() - * - * @since 3.0 - * - * @param array $args Arguments. See `EDD\Database\Queries\Customer_Email_Address` - * for accepted arguments. - * @return int Number of customer email addresses returned based on query arguments passed. - */ -function edd_count_customer_email_addresses( $args = array() ) { - - // Parse args - $r = wp_parse_args( $args, array( - 'count' => true - ) ); - - // Query for count(s) - $customer_email_addresses = new EDD\Database\Queries\Customer_Email_Address( $r ); - - // Return count(s) - return absint( $customer_email_addresses->found_items ); -} - -/** - * Query for and return array of customer email counts, keyed by status. - * - * @see \EDD\Database\Queries\Customer_Email_Address::__construct() - * - * @since 3.0 - * - * @param array $args Arguments. See `EDD\Database\Queries\Customer_Email_Address` - * for accepted arguments. - * @return array Customer email addresses keyed by status. - */ -function edd_get_customer_email_address_counts( $args = array() ) { - - // Parse args - $r = wp_parse_args( $args, array( - 'count' => true, - 'groupby' => 'status' - ) ); - - // Query for count - $counts = new EDD\Database\Queries\Customer_Email_Address( $r ); - - // Format & return - return edd_format_counts( $counts, $r['groupby'] ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/customers/class-customer-address.php b/wp-content/plugins/easy-digital-downloads/includes/customers/class-customer-address.php deleted file mode 100644 index 6768d070..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/customers/class-customer-address.php +++ /dev/null @@ -1,145 +0,0 @@ - $customer_id, - 'email' => $data['email'], - 'type' => 'primary', - ) - ); -} -add_action( 'edd_customer_added', 'edd_process_customer_added', 10, 2 ); - -/** - * Is intended to be used when updating a customer directly with edd_add_customer function. - * - * Because the edd_update_customer function only directly interacts with the customers DB table, we may - * need to do some additional actions like managing email addresses. - * - * @since 3.0.4 - * - * @param int $customer_id The customer ID being updated. - * @param array $data The data passed in to update the customer with. - * @param EDD_Customer $prev_customer_obj The customer object, prior to these updates. - */ -function edd_process_customer_updated( $customer_id, $data, $prev_customer_obj ) { - $customer = edd_get_customer( $customer_id ); - $email_updated = false; - - // Process a User ID change. - if ( intval( $customer->user_id ) !== intval( $prev_customer_obj->user_id ) ) { - // Attach the User Email to the customer as well. - $user = new WP_User( $customer->user_id ); - if ( $user instanceof WP_User ) { - - // Only update this if it doesn't match already. - if ( $customer->email !== $user->user_email ) { - $customers = new EDD\Database\Queries\Customer(); - $customers->update_item( $customer_id, array( 'email' => $user->user_email ) ); - } - - // Our transition hook for the type will handle demoting any other email addresses. - edd_add_customer_email_address( - array( - 'customer_id' => $customer->id, - 'email' => $user->user_email, - 'type' => 'primary', - ) - ); - - $email_updated = true; - } - - // Remove the old user email from this account. - $previous_user = new WP_User( $prev_customer_obj->user_id ); - if ( $previous_user instanceof WP_User ) { - $existing_email_addresses = edd_get_customer_email_addresses( - array( - 'customer_id' => $customer->id, - 'email' => $previous_user->user_email, - ) - ); - - if ( ! empty( $existing_email_addresses ) ) { - // Should only be one, but let's foreach to be safe. - foreach ( $existing_email_addresses as $existing_address ) { - edd_delete_customer_email_address( $existing_address->id ); - } - } - } - - // Update some payment meta if we need to. - $order_ids = edd_get_orders( array( 'customer_id' => $customer->id, 'number' => 9999999 ) ); - - foreach ( $order_ids as $order_id ) { - edd_update_order( $order_id, array( 'user_id' => $customer->user_id ) ); - } - } - - // If the email address changed, set the new one as primary. - if ( false === $email_updated && $prev_customer_obj->email !== $customer->email ) { - - // Our transition hook for the type will handle demoting any other email addresses. - edd_add_customer_email_address( - array( - 'customer_id' => $customer->id, - 'email' => $customer->email, - 'type' => 'primary', - ) - ); - } -} -add_action( 'edd_customer_updated', 'edd_process_customer_updated', 10, 3 ); - -/** - * When a new primary email address is added to the database, any other primary email addresses should be demoted. - * - * @param string $old_value The previous value of `type`. - * @param string $new_value The new value of `type`. - * @param int $item_id The address ID in the edd_customer_email_addresses table. - * @return void - */ -function edd_demote_customer_primary_email_addresses( $old_value, $new_value, $item_id ) { - if ( ! $new_value ) { - return; - } - - // If we're not setting the `type` to `primary` we do not need to make any adjustments. - if ( 'primary' !== $new_value ) { - return; - } - - $email_address = edd_get_customer_email_address( $item_id ); - $previous_primary_email_addresses = edd_get_customer_email_addresses( - array( - 'id__not_in' => array( $item_id ), - 'fields' => 'ids', - 'customer_id' => $email_address->customer_id, - 'type' => 'primary', - ) - ); - - if ( empty( $previous_primary_email_addresses ) ) { - return; - } - - foreach ( $previous_primary_email_addresses as $previous ) { - edd_update_customer_email_address( $previous, array( 'type' => 'secondary' ) ); - } -} -add_action( 'edd_transition_customer_email_address_type', 'edd_demote_customer_primary_email_addresses', 10, 3 ); - -/** - * When a new primary address is added to the database, any other primary addresses should be demoted. - * - * @param string $old_value The previous value of `is_primary`. - * @param string $new_value The new value of `is_primary`. - * @param int $item_id The address ID in the edd_customer_addresses table. - * @return void - */ -function edd_demote_customer_primary_addresses( $old_value, $new_value, $item_id ) { - if ( ! $new_value ) { - return; - } - $address = edd_fetch_customer_address( $item_id ); - $previous_primary_addresses = edd_get_customer_addresses( - array( - 'id__not_in' => array( $item_id ), - 'fields' => 'ids', - 'customer_id' => $address->customer_id, - 'is_primary' => true, - ) - ); - if ( empty( $previous_primary_addresses ) ) { - return; - } - foreach ( $previous_primary_addresses as $previous ) { - edd_update_customer_address( $previous, array( 'is_primary' => false ) ); - } -} -add_action( 'edd_transition_customer_address_is_primary', 'edd_demote_customer_primary_addresses', 10, 3 ); - -/** - * Updates the email address of a customer record when the email on a user is updated. - * - * @since 2.4.0 - * - * @param int $user_id User ID. - * @param WP_User $old_user_data Object containing user's data prior to update. - * - * @return void - */ -function edd_update_customer_email_on_user_update( $user_id, $old_user_data ) { - $user = get_userdata( $user_id ); - - // Bail if the email address didn't actually change just now. - if ( empty( $user ) || $user->user_email === $old_user_data->user_email ) { - return; - } - - $customer = edd_get_customer_by( 'user_id', $user_id ); - - if ( empty( $customer ) || $user->user_email === $customer->email ) { - return; - } - - // Bail if we have another customer with this email address already. - if ( edd_get_customer_by( 'email', $user->user_email ) ) { - return; - } - - $success = edd_update_customer( $customer->id, array( 'email' => $user->user_email ) ); - - if ( ! $success ) { - return; - } - - /** - * Triggers after the customer has been successfully updated. - * - * @param WP_User $user - * @param EDD_Customer $customer - */ - do_action( 'edd_update_customer_email_on_user_update', $user, $customer ); -} -add_action( 'profile_update', 'edd_update_customer_email_on_user_update', 10, 2 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/README.md b/wp-content/plugins/easy-digital-downloads/includes/database/README.md deleted file mode 100644 index 749da0ca..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/README.md +++ /dev/null @@ -1,384 +0,0 @@ -# Custom Tables # - -### The schema for each custom table is described below - -## The Adjustments Table: -This table stores things that can be used to adjust an order. This includes things like discount codes and tax rates. Note that these things do not represent an adjustment that was used for a specific order. To see a record of those, look at the order_adjustments table. - -This table's data is intended to be mutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| parent | This column does not currently serve any purpose, but might be used in the future. | -| name | The name of the adjustment. For discount codes, this is the name of the discount. For tax rates, this is the name of the country for which the tax rate applies. All tax rates in a country share the same value in this column. For example, all tax rates in Canada will use "CA" here. | -| code | For discount codes, this is the value which users can enter upon checkout. For tax rates, this column is blank. | -| status | A string which indicates the status of the adjustment. For tax rates this will be "active" or "inactive". For discount codes, this will be "active" even if the discount has expired, and this is intentional. | -| type | The type of adjustment this is. For discounts this is "discount". For tax rates this is "tax_rate". | -| scope | A value which defines how the adjustment can be used. For discount codes the value is always "global". For tax rates, the values can be "country", or "region". | -| amount_type | The type of amount this is, either "percent" or "flat", with flat being a monetary value. | -| amount | The amount of the adjustment, stored as a decimal and representing either a percent or flat amount. | -| description | For tax rates, this is the "state" or "province". For example, for Ontario (the province in Canada), this value will be "ON". For discount codes this column is not currently used. | -| max_uses | An integer indicating the maximum number of times this adjustment can be used. | -| use_count | An integer indicating the number of times this adjustment has been used. | -| once_per_customer | A boolean value in the form of 1 (for true) and 0 (for false). If 1, this adjustment should only be used once per customer. If 0, there is no limit to the number of times it can be used. | -| min_charge_amount | For discount codes, this is the minimum amount required in the cart prior to this adjustment being applied. For tax rates this is typically not applicable. | -| start_date | For discount codes, this is the date when a discount code will begin to work. This is not applicable to tax rates. | -| end_date | For discount codes, this is the date when a discount code will cease to work. This is not applicable to tax rates. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Adjustment Meta Table: -This table stores various and custom/extra information about an adjustment. - -This table's data is intended to be mutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| meta_id | The unique id of the row, which auto increments. | -| edd_adjustment_id | The id of the adjustment to which this row relates. | -| meta_key | The reference key (like a variable name) of the data in question. | -| meta_value | The value. This can be anything needed as its purpose is for anything extra. | - -## The Customer Addresses Table: -This table stores the addresses of customers. - -This table's data is intended to be mutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| customer_id | The id of the customer to which this address belongs. This id corresponds to the id column in the Customers table. | -| name | The name of the person connected to this physical address. | -| type | The type of address this row represents. Typical values are "billing" and "shipping". | -| status | This currently does not serve any purpose, but might in the future. | -| address | The first line of a physical address. | -| address2 | The second line of a physical address. | -| city | The city of a physical address. | -| region | A 2 letter representation of the region/state/province. For example, in the US, this is the "State". In Canada, this is the "Province". | -| postal_code | The postal code for a physical address. It accepts any string. | -| country | The 2 letter representation of a country for a physical address. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Customer Email Addresses Table: -This table stores the email addresses of customers. - -This table's data is intended to be mutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| customer_id | The id of the customer to which this email address belongs. This id corresponds to the id column in the Customers table. | -| type | A string representing the priority (or importance) of this email address. Typical values are "primary" and "secondary". | -| status | This does not serve any purpose at this time, but might in the future. | -| email | An email address, which is connected to a customer. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Customer Meta Table: -This table stores various and custom/extra information about a customer. - -This table's data is intended to be mutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| meta_id | The unique id of the row, which auto increments. | -| edd_customer_id | The id of the customer to which this row relates. | -| meta_key | The reference key (like a variable name) of the data in question. | -| meta_value | The value. This can be anything needed as its purpose is for anything extra. | - -## The Customers Table: -This table stores customers. Customers are people who have made a purchase in your store. - -This table's data is intended to be mutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. This is also the id of the customer. | -| user_id | The id of the WordPress user which is linked to this customer. The same real-world person owns both, the WP user, and the EDD customer. | -| email | The primary email address of this customer. This value will typically match whatever the "primary" email is in the customer emails table in the "type" column. | -| name | This is the customer's name, and includes their first and last name together in a single string. | -| status | Currently, this stores the word "active" for all customers, until such time as functionality for "inactive" customers gets added to EDD. | -| purchase_value | This is the total amount of money this customer has paid. | -| purchase_count | This is the total number of purchases this customer has initiated. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Log Meta Table: -This table stores various and custom/extra information about a log. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| meta_id | The unique id of the row, which auto increments. | -| edd_log_id | The id of the log to which this row relates. | -| meta_key | The reference key (like a variable name) of the data in question. | -| meta_value | The value. This can be anything needed as its purpose is for anything extra. | - -## The Logs Table: -This table stores general-purpose logs, which are typically records of events happening, like a payment being completed or refunded. Note that logs are intended to be "created by a machine" as opposed to "created by a human". If you are writing code that automatically logs something, make it a log in this table. If you are writing code that creates a UI which allows a human being to write a note, store it in the notes table. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| object_id | The id of the thing to which this log relates. For example, the id of the "order" or the "discount code". | -| object_type | This describes the type of thing this log is for. For example, "order" indicates this log is for an order. | -| user_id | This is the ID of the WordPress user who created this log. | -| type | This column indicates the type of log this is. For example, the word "refund" would indicate that this log is about a refund taking place. | -| title | This is the title of the log. Typically this is a short sentence describing what the log is about. | -| content | This is a longer description of the log. Typically this will be a sentence or paragraph describing the event which took place. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Logs API Requests Table: -Every time a request is made to the EDD REST API, that request is logged in this table. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| user_id | This stores the ID of the WordPress user who created this log. | -| api_key | This stores the api key used to make this API request. | -| token | This stores the token used to make this API request. | -| version | This stores the version of the API for which this call was made. | -| request | This stores what the URL variables were when the request was made. | -| error | Errors that took place during the call. Defaults to be empty. | -| ip | The IP address of the machine which made the request. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Log API Request Meta Table: -This table stores various and custom/extra information about an API Request Log. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| meta_id | The unique id of the row, which auto increments. | -| edd_logs_api_request_id | The id of the api request log to which this row relates. | -| meta_key | The reference key (like a variable name) of the data in question. | -| meta_value | The value. This can be anything needed as its purpose is for anything extra. | - -## The Logs File Downloads Table: -Every time a deliverable file is downloaded via EDD, it is logged in this table. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| product_id | The ID of the EDD product whose file was downloaded. | -| file_id | The id of the file being downloaded. This ID comes from the files attached to an EDD product. | -| order_id | The ID of the order which is enabling this download to take place. | -| price_id | The variable price ID which was purchased, and which enabled this download to take place. 0 if the product is not variably-priced. | -| customer_id | The ID of the customer who downloaded this file. | -| ip | The IP address of the machine which made the request to download the file. | -| user_agent | The name/user-agent of the browser which was used to download the file. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Log File Download Meta Table: -This table stores various and custom/extra information about a file download log. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| meta_id | The unique id of the row, which auto increments. | -| edd_logs_file_download_id | The id of the file download log to which this row relates. | -| meta_key | The reference key (like a variable name) of the data in question. | -| meta_value | The value. This can be anything needed as its purpose is for anything extra. | - -## The Note Meta Table: -This table stores various and custom/extra information about a note. - -This table's data is intended to be mutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| meta_id | The unique id of the row, which auto increments. | -| edd_note_id | The id of the note to which this row relates. | -| meta_key | The reference key (like a variable name) of the data in question. | -| meta_value | The value. This can be anything needed as its purpose is for anything extra. | - -## The Notes Table: -This table is for storing notes created by human beings, as opposed to notes/logs/data created automatically by code or automatic code events happening. Note that logs are intended to be "created by a machine" as opposed to "created by a human". If you are writing code that automatically logs something, make it a log in the logs table. If you are writing code that creates a UI which allows a human being to write a note, store it in the notes table here. - -This table's data is intended to be mutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| object_id | The id of the thing to which this note relates. For example, the id of the "order" for which this note was created. | -| object_type | This describes the type of thing this note is for. For example, "order" indicates this note is for/about an order. | -| user_id | This is the ID of the WordPress user who created this note. | -| content | This is the main/unique content of the note, the note itself. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Order Addresses Table: -When a user completes a purchase/order and enters their address on the checkout page, that address is stored in a new row here. This allows the address attached to the order to remain what it was at the time of purchase, regardless of whether the customer changes their address in the future. This is because the address attached to an order should remain unchanged forever. These addresses should be considered immutable. Even if a customer has 2 orders and uses the exact same address for each order, a new row will be created here, unique to that order, despite possibly being identical to a previous row. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| order_id | The id of the order to which this address is attached. | -| name | The name of the person attached to this physical address. | -| type | The type of address this row represents. Typical values are "billing" and "shipping". | -| address | The first line of a physical address. | -| address2 | The second line of a physical address. | -| city | The city of a physical address. | -| region | A 2 letter representation of the region/state/province. For example, in the US, this is the "State". In Canada, this is the "Province". | -| postal_code | The postal code for a physical address. It accepts any string. | -| country | The 2 letter representation of a country for a physical address. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Order Adjustment Meta Table: - This table stores various and custom/extra information about an order adjustment. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| meta_id | The unique id of the row, which auto increments. | -| edd_order_adjustment_id | The id of the adjustment to which this row relates. | -| meta_key | The reference key (like a variable name) of the data in question. | -| meta_value | The value. This can be anything needed as its purpose is for anything extra. | - -## The Order Adjustments Table: -This table stores things that adjusted the total amount of a specific order, or the amount of an item within an order. This includes things like discount codes and tax rates. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| parent | The ID of another order adjustment which is considered to be the parent of this adjustment. This is used for adjustments attached to refunds. The parent references the ID of the original order adjustment that was refunded. | -| object_id | The ID of the row that this row adjusted the amount/cost of. This is typically an order (in the orders table) or an order_item (in the order_items table). The type of object is indicated in the object_type column. | -| object_type | This typically indicates the EDD custom table that the object_id value can be found within, and to which row within that table this row relates. For example, the orders table (indicated by the word "order") or the order_items table (indicated by the word "order_item"). | -| type_id | This value indicates the row ID in the adjustments table from which this order adjustment originated. For example, if this value is "25", go to the adjustments table and look at the row with the ID "25" to see the corresponding adjustment. | -| type | A string which indicates the type of adjustment this is. Typically this is something like "fee", "tax_rate", or "discount". | -| type_key | The fees API allows for customizing the array key value for a given fee. This can be a string or numeric. This "fee ID" is stored as the type_key, as it represents the fee's key in the 2.x array. | -| description | A description of the order adjustment. | -| subtotal | If the amount type for this row is a percentage, the value in this column is intentionally unused. Otherwise, it stores the monetary amount of this adjustment before tax. For example, if you have a $10 shipping fee with a 10% tax rate, $10 is stored in this column. | -| tax | If the object_type for this row is a percentage, the value in this column is intentionally unused. Otherwise, it stores the monetary amount of the tax on this adjustment. For example, if you have a $10 shipping fee, the tax on the $10 is stored in this column. | -| total | Like the subtotal and tax columns, this column stores a monetary amount sometimes, and at others stores a percentage rate. To determine the type of amount being stored, percentage vs flat amount, trace the row back to the adjustments table using the type_id value from this table, and check the amount_type column's value from the adjustments table. For example, if you have a $10 shipping fee with a 10% tax rate, $11 is stored in this column. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Order Item Meta Table: -This table stores various and custom/extra information about an order item. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| meta_id | The unique id of the row, which auto increments. | -| edd_order_item_id | The id of the order item to which this row relates. | -| meta_key | The reference key (like a variable name) of the data in question. | -| meta_value | The value. This can be anything needed as its purpose is for anything extra. | - -## The Order Items Table: -This table stores items (or "products", also known as "downloads" in EDD) that were part of an order. It also stores various data about the items, like the tax that was on the item,. - -One way to think about this is that a "for-sale thing" is called a "product" when in an un-purchased state, and called an "item" when in a purchased state. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| parent | The ID of another order item which is considered to be the parent of this item. This is used for order items attached to refunds. The parent references the ID of the original order item that was refunded. | -| order_id | The ID of the order to which this item belongs. | -| product_id | The ID of the product which was purchased. | -| product_name | This is what the name of the product was at the time of this purchase. | -| price_id | This is the ID of the variable price which was purchased. | -| price_name | This is what the name of the variable price was at the time of this purchase. | -| cart_index | This is the position at which this item was sitting in the cart when this order took place, starting at 0 for the first position. | -| type | This indicates the type of product that this item is. In its current form, all things sold in EDD have the type of "download", and thus does not currently have any functional relevance. This is here to enable possible future changes only. | -| status | This indicates the status of this item in regards to purchase completion. Typical values include (but are not limited to) "completed", and "refunded". When set to "inherit", it will inherit the status of the order to which it belongs. When set to anything other than "inherit" it will override the status of the order, but only for this item. | -| quantity | A single item in the cart can have a quantity. This indicates that quantity. Through this column's data, a single order_item can actually represent multiple items, and the values in the subtotal and total columns reflect that quantity. | -| amount | This is what the unadjusted price of this item was at the time of purchase. It does not include tax, discounts, fees, or any other price adjusters. | -| subtotal | This is the cost of the line item in the cart including quantity, but not including tax, discounts, fees, or any other price adjusters. | -| discount | This column stores the portion of the discount from the total that applied directly to this item. | -| tax | This column stores the portion of tax from the total that applied directly to this item. | -| total | This contains the total cost of this item, including quantity, taxes, item-specific discounts (but not cart-wide discounts). *Note that this amount does not include any fees in the cart that are specific to this item. For example, a shipping fee that exists because of this item is not included in the total found in this column. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Order Transactions Table: -Where a transaction represents an actual exchange of money, this table stores all of the transactions that were part of an order. Some orders will contain multiple transactions. For example, many payment gateways (for example: Stripe and PayPal) do not allow the purchasing of multiple recurring-enabled items in a single transaction. This is because 1 item could be monthly, and another could yearly. Each item will create a different transaction on the customer's credit card, and will show up separately on the customer's credit card statement. This table helps you to keep track of which transactions were part of which order. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. | -| object_id | The ID of the row to which this transaction belongs. Typically this will be the ID of an order in the orders table. | -| object_type | The table that the object_id value can be found within, and to which row within that table this row relates. For example, the orders table is indicated by the word "order", and is typically the value that will be found here. | -| transaction_id | The ID of the transaction, which originates from the payment gateway. | -| gateway | The name of the payment gateway where this transaction took place. | -| status | The status of this transaction. For example, if complete, the status will be set to "complete". | -| total | The total amount of this transaction. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | - -## The Order Meta Table: -This table stores various and custom/extra information about an order. - -This table's data is intended to be immutable. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| meta_id | The unique id of the row, which auto increments. | -| edd_order_id | The id of the order item to which this row relates. | -| meta_key | The reference key (like a variable name) of the data in question. | -| meta_value | The value. This can be anything needed as its purpose is for anything extra. | - -## The Orders Table: -This table stores orders (called "payments" prior to EDD 3.0). It also stores various data about the order, like the customer ID, the email entered by the customer at checkout, the IP address of the machine where checkout was completed, and more. See table below for full breakdown of each column. - -This table's data is intended to be immutable. However, some column data is also intended to be mutable. The user_id customer_id, and email column values will change if an order is re-assigned to a new customer. - -| Table Column | Table Column's Description | -| ------------- | ------------- | -| id | The unique id of the row, which auto increments. This also serves as the id of the order itself. | -| parent | The ID of another order which is considered to be the parent of this order. This is used in scenarios like refund orders, which are automatically generated when a refund takes place. Refund orders use this column to refer to the original order where the item being refunded was originally purchased. Another scenario where this is used is for renewal payments done through the EDD Recurring Payments extension. Each renewal payment will use this column to indicate which order was the one where the customer originally initiated the subscription. | -| order_number | This column serves several different purposes:

    1. By default, it will be blank for every order (except "refund" orders).

    2. If the order in question is a "refund" order, this will contain a string in this format: "ORIGINAL_ORDER_NUMBER-R-THE_NUMBER_OF_REFUNDS_IN_THAT_ORDER". So if it is the 2nd refund from order #1, it will be "1-R-2".

    3. If you have "Sequential Order Numbers" enabled in your EDD settings, this column will be populated by the value determined by your settings for that.

    4. If the order in question is a refund for a "Sequentially Ordered" order, the format is the same as for "Non-Sequentially Ordered" orders, but it is important to note that the ORIGINAL_ORDER_NUMBER value will be the value from the "id" column of the original order, not the "order_number" column.

    5. Extensions may modify the way this column works. For example, the "Advanced Sequential Order Numbers" extension for EDD will put its own value in this column, overriding the values from EDD core. | -| status | This column has 2 purposes:

    1) It identifies the financial/accounting status of the order.
    a) If the transaction(s) for the order have completed successfully, this value here will be "complete".
    b) If the transaction(s) for the order have not yet completed successfully, this value here will be "pending".
    c) If the transaction(s) for the order have not completed successfully and it has been 7 days, this value here will be "abandoned".
    d) If the transaction(s) for the order failed at the payment gateway (for example, insufficient funds), this will be set to "failed".
    e) If this order has been partially refunded, the status of the order currently remains set to "complete".
    f) If all of the items in this order have been refunded, this value will be "refunded".

    2) It identifies if the order is in the trash. If the order has been put in the trash, the financial status is no longer stored here, but gets moved to the order_meta table with the key "pre_trash_status". The value in this column will then be "trash". | -| type | The type of order this is. Typical values are "sale" or "refund". | -| user_id | The ID of the user currently attached to this order. Note that this column is mutable and will change if the user attached to the EDD customer changes, or if the customer attached to an order changes. | -| customer_id | The ID of the customer currently attached to this order. Note that this column is mutable and will change if the customer attached to the EDD order changes, or if the user attached to a customer changes. | -| email | The email address currently attached to this order. Note that this column is mutable and will change if the customer attached to the EDD order changes, or if the customer's email is updated. | -| ip | The IP address of the machine on which this order was completed. | -| gateway | A string representing the payment gateway which was used to complete the payments on this order. | -| mode | This stores whether the order was done in test mode or live mode. | -| currency | The 3 letter currency code which this order used/will-use. | -| payment_key | A unique key representing this payment. This key is generated by combining a few different values about this order, like the email address, the date, an optional auth key which can be defined as a constant, and a unique id generated by the uniqid function in PHP. See class-edd-payment.php for the full breakdown of how this is generated. | -| subtotal | This is the amount of the items in the cart added together. It does not include any taxes or discounts. Note: Fees are considered to be both line items and adjustments. In relation to the orders table, fees are treated as line items, and are thus included in the subtotal. But note that they are the only "adjustments" that are included in the subtotal, as other adjustments are not included in the subtotal. | -| discount | This is the total amount of discount(s) that were applied to the order. | -| tax | This is the total amount of the tax that was applied to the order. | -| total | This is the total amount of the order. | -| date_created | The date this row was created. | -| date_modified | The date this row was last modified. | -| uuid | A unique identifying string representing this row. | diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-base.php b/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-base.php deleted file mode 100644 index cc837bc7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-base.php +++ /dev/null @@ -1,337 +0,0 @@ -{$key}; - } - - // Return null if not exists - return null; - } - - /** - * Converts the given object to an array. - * - * @since 1.0.0 - * - * @return array Array version of the given object. - */ - public function to_array() { - return get_object_vars( $this ); - } - - /** Protected *************************************************************/ - - /** - * Maybe append the prefix to string. - * - * @since 1.0.0 - * - * @param string $string - * @param string $sep - * @return string - */ - protected function apply_prefix( $string = '', $sep = '_' ) { - return ! empty( $this->prefix ) - ? "{$this->prefix}{$sep}{$string}" - : $string; - } - - /** - * Return the first letters of a string of words with a separator. - * - * Used primarily to guess at table aliases when none is manually set. - * - * Applies the following formatting to a string: - * - Trim whitespace - * - No accents - * - No trailing underscores - * - * @since 1.0.0 - * - * @param string $string - * @param string $sep - * @return string - */ - protected function first_letters( $string = '', $sep = '_' ) { - - // Set empty default return value - $retval = ''; - - // Bail if empty or not a string - if ( empty( $string ) || ! is_string( $string ) ) { - return $retval; - } - - // Trim spaces off the ends - $unspace = trim( $string ); - $accents = remove_accents( $unspace ); - $lower = strtolower( $accents ); - $parts = explode( $sep, $lower ); - - // Loop through parts and concatenate the first letters together - foreach ( $parts as $part ) { - $retval .= substr( $part, 0, 1 ); - } - - // Return the result - return $retval; - } - - /** - * Sanitize a table name string. - * - * Used to make sure that a table name value meets MySQL expectations. - * - * Applies the following formatting to a string: - * - Trim whitespace - * - No accents - * - No special characters - * - No hyphens - * - No double underscores - * - No trailing underscores - * - * @since 1.0.0 - * - * @param string $name The name of the database table - * - * @return string Sanitized database table name - */ - protected function sanitize_table_name( $name = '' ) { - - // Bail if empty or not a string - if ( empty( $name ) || ! is_string( $name ) ) { - return false; - } - - // Trim spaces off the ends - $unspace = trim( $name ); - - // Only non-accented table names (avoid truncation) - $accents = remove_accents( $unspace ); - - // Only lowercase characters, hyphens, and dashes (avoid index corruption) - $lower = sanitize_key( $accents ); - - // Replace hyphens with single underscores - $under = str_replace( '-', '_', $lower ); - - // Single underscores only - $single = str_replace( '__', '_', $under ); - - // Remove trailing underscores - $clean = trim( $single, '_' ); - - // Bail if table name was garbaged - if ( empty( $clean ) ) { - return false; - } - - // Return the cleaned table name - return $clean; - } - - /** - * Set class variables from arguments. - * - * @since 1.0.0 - * @param array $args - */ - protected function set_vars( $args = array() ) { - - // Bail if empty or not an array - if ( empty( $args ) ) { - return; - } - - // Cast to an array - if ( ! is_array( $args ) ) { - $args = (array) $args; - } - - // Set all properties - foreach ( $args as $key => $value ) { - $this->{$key} = $value; - } - } - - /** - * Return the global database interface. - * - * See: https://core.trac.wordpress.org/ticket/31556 - * - * @since 1.0.0 - * - * @return \wpdb Database interface, or False if not set - */ - protected function get_db() { - - // Default database return value (might change) - $retval = false; - - // Look for a commonly used global database interface - if ( isset( $GLOBALS[ $this->db_global ] ) ) { - $retval = $GLOBALS[ $this->db_global ]; - } - - /* - * Developer note: - * - * It should be impossible for a database table to be interacted with - * before the primary database interface it is setup. - * - * However, because applications are complicated, it is unsafe to assume - * anything, so this silently returns false instead of halting everything. - * - * If you are here because this method is returning false for you, that - * means the database table is being invoked too early in the lifecycle - * of the application. - * - * In WordPress, that means before the $wpdb global is created; in other - * environments, you will need to adjust accordingly. - */ - - // Return the database interface - return $retval; - } - - /** - * Check if an operation succeeded. - * - * @since 1.0.0 - * - * @param mixed $result - * @return bool - */ - protected function is_success( $result = false ) { - - // Bail if no row exists - if ( empty( $result ) ) { - $retval = false; - - // Bail if an error occurred - } elseif ( is_wp_error( $result ) ) { - $this->last_error = $result; - $retval = false; - - // No errors - } else { - $retval = true; - } - - // Return the result - return (bool) $retval; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-column.php b/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-column.php deleted file mode 100644 index b72c1972..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-column.php +++ /dev/null @@ -1,965 +0,0 @@ -parse_args( $args ); - - // Maybe set variables from arguments - if ( ! empty( $r ) ) { - $this->set_vars( $r ); - } - } - - /** Argument Handlers *****************************************************/ - - /** - * Parse column arguments - * - * @since 1.0.0 - * @param array $args Default empty array. - * @return array - */ - private function parse_args( $args = array() ) { - - // Parse arguments - $r = wp_parse_args( $args, array( - - // Table - 'name' => '', - 'type' => '', - 'length' => '', - 'unsigned' => false, - 'zerofill' => false, - 'binary' => false, - 'allow_null' => false, - 'default' => '', - 'extra' => '', - 'encoding' => $this->get_db()->charset, - 'collation' => $this->get_db()->collate, - 'comment' => '', - - // Query - 'pattern' => false, - 'searchable' => false, - 'sortable' => false, - 'date_query' => false, - 'transition' => false, - 'in' => true, - 'not_in' => true, - - // Special - 'primary' => false, - 'created' => false, - 'modified' => false, - 'uuid' => false, - - // Cache - 'cache_key' => false, - - // Validation - 'validate' => '', - - // Capabilities - 'caps' => array(), - - // Backwards Compatibility - 'aliases' => array(), - - // Column Relationships - 'relationships' => array() - ) ); - - // Force some arguments for special column types - $r = $this->special_args( $r ); - - // Set the args before they are sanitized - $this->set_vars( $r ); - - // Return array - return $this->validate_args( $r ); - } - - /** - * Validate arguments after they are parsed. - * - * @since 1.0.0 - * @param array $args Default empty array. - * @return array - */ - private function validate_args( $args = array() ) { - - // Sanitization callbacks - $callbacks = array( - 'name' => 'sanitize_key', - 'type' => 'strtoupper', - 'length' => 'intval', - 'unsigned' => 'wp_validate_boolean', - 'zerofill' => 'wp_validate_boolean', - 'binary' => 'wp_validate_boolean', - 'allow_null' => 'wp_validate_boolean', - 'default' => array( $this, 'sanitize_default' ), - 'extra' => 'wp_kses_data', - 'encoding' => 'wp_kses_data', - 'collation' => 'wp_kses_data', - 'comment' => 'wp_kses_data', - - 'primary' => 'wp_validate_boolean', - 'created' => 'wp_validate_boolean', - 'modified' => 'wp_validate_boolean', - 'uuid' => 'wp_validate_boolean', - - 'searchable' => 'wp_validate_boolean', - 'sortable' => 'wp_validate_boolean', - 'date_query' => 'wp_validate_boolean', - 'transition' => 'wp_validate_boolean', - 'in' => 'wp_validate_boolean', - 'not_in' => 'wp_validate_boolean', - 'cache_key' => 'wp_validate_boolean', - - 'pattern' => array( $this, 'sanitize_pattern' ), - 'validate' => array( $this, 'sanitize_validation' ), - 'caps' => array( $this, 'sanitize_capabilities' ), - 'aliases' => array( $this, 'sanitize_aliases' ), - 'relationships' => array( $this, 'sanitize_relationships' ) - ); - - // Default args array - $r = array(); - - // Loop through and try to execute callbacks - foreach ( $args as $key => $value ) { - - // Callback is callable - if ( isset( $callbacks[ $key ] ) && is_callable( $callbacks[ $key ] ) ) { - $r[ $key ] = call_user_func( $callbacks[ $key ], $value ); - - // Callback is malformed so just let it through to avoid breakage - } else { - $r[ $key ] = $value; - } - } - - // Return sanitized arguments - return $r; - } - - /** - * Force column arguments for special column types - * - * @since 1.0.0 - * @param array $args Default empty array. - * @return array - */ - private function special_args( $args = array() ) { - - // Primary key columns are always used as cache keys - if ( ! empty( $args['primary'] ) ) { - $args['cache_key'] = true; - - // All UUID columns need to follow a very specific pattern - } elseif ( ! empty( $args['uuid'] ) ) { - $args['name'] = 'uuid'; - $args['type'] = 'varchar'; - $args['length'] = '100'; - $args['in'] = false; - $args['not_in'] = false; - $args['searchable'] = false; - $args['sortable'] = false; - } - - // Return args - return (array) $args; - } - - /** Public Helpers ********************************************************/ - - /** - * Return if a column type is numeric or not. - * - * @since 1.0.0 - * @return bool - */ - public function is_numeric() { - return $this->is_type( array( - 'tinyint', - 'int', - 'mediumint', - 'bigint' - ) ); - } - - /** Private Helpers *******************************************************/ - - /** - * Return if this column is of a certain type. - * - * @since 1.0.0 - * @param mixed $type Default empty string. The type to check. Also accepts an array. - * @return bool True if of type, False if not - */ - private function is_type( $type = '' ) { - - // If string, cast to array - if ( is_string( $type ) ) { - $type = (array) $type; - } - - // Make them lowercase - $types = array_map( 'strtolower', $type ); - - // Return if match or not - return (bool) in_array( strtolower( $this->type ), $types, true ); - } - - /** Private Sanitizers ****************************************************/ - - /** - * Sanitize capabilities array - * - * @since 1.0.0 - * @param array $caps Default empty array. - * @return array - */ - private function sanitize_capabilities( $caps = array() ) { - return wp_parse_args( $caps, array( - 'select' => 'exist', - 'insert' => 'exist', - 'update' => 'exist', - 'delete' => 'exist' - ) ); - } - - /** - * Sanitize aliases array using `sanitize_key()` - * - * @since 1.0.0 - * @param array $aliases Default empty array. - * @return array - */ - private function sanitize_aliases( $aliases = array() ) { - return array_map( 'sanitize_key', $aliases ); - } - - /** - * Sanitize relationships array - * - * @todo - * @since 1.0.0 - * @param array $relationships Default empty array. - * @return array - */ - private function sanitize_relationships( $relationships = array() ) { - return array_filter( $relationships ); - } - - /** - * Sanitize the default value - * - * @since 1.0.0 - * @param string $default - * @return string|null - */ - private function sanitize_default( $default = '' ) { - - // Null - if ( ( true === $this->allow_null ) && is_null( $default ) ) { - return null; - - // String - } elseif ( is_string( $default ) ) { - return wp_kses_data( $default ); - - // Integer - } elseif ( $this->is_numeric( $default ) ) { - return (int) $default; - } - - // @todo datetime, decimal, and other column types - - // Unknown, so return the default's default - return ''; - } - - /** - * Sanitize the pattern - * - * @since 1.0.0 - * @param mixed $pattern - * @return string - */ - private function sanitize_pattern( $pattern = false ) { - - // Allowed patterns - $allowed_patterns = array( '%s', '%d', '%f' ); - - // Return pattern if allowed - if ( in_array( $pattern, $allowed_patterns, true ) ) { - return $pattern; - } - - // Fallback to digit or string - return $this->is_numeric() - ? '%d' - : '%s'; - } - - /** - * Sanitize the validation callback - * - * @since 1.0.0 - * @param string $callback Default empty string. A callable PHP function name or method - * @return string The most appropriate callback function for the value - */ - private function sanitize_validation( $callback = '' ) { - - // Return callback if it's callable - if ( is_callable( $callback ) ) { - return $callback; - } - - // UUID special column - if ( true === $this->uuid ) { - $callback = array( $this, 'validate_uuid' ); - - // Datetime fallback - } elseif ( $this->is_type( 'datetime' ) ) { - $callback = array( $this, 'validate_datetime' ); - - // Decimal fallback - } elseif ( $this->is_type( 'decimal' ) ) { - $callback = array( $this, 'validate_decimal' ); - - // Intval fallback - } elseif ( $this->is_numeric() ) { - $callback = 'intval'; - } - - // Return the callback - return $callback; - } - - /** Public Validators *****************************************************/ - - /** - * Fallback to validate a datetime value if no other is set. - * - * This assumes NO_ZERO_DATES is off or overridden. - * - * If MySQL drops support for zero dates, this method will need to be - * updated to support different default values based on the environment. - * - * @since 1.0.0 - * @param string $value Default ''. A datetime value that needs validating - * @return string A valid datetime value - */ - public function validate_datetime( $value = '' ) { - - // Handle "empty" values - if ( empty( $value ) || ( '0000-00-00 00:00:00' === $value ) ) { - $value = ! empty( $this->default ) - ? $this->default - : ''; - - // Convert to MySQL datetime format via date() && strtotime - } elseif ( function_exists( 'date' ) ) { - $value = date( 'Y-m-d H:i:s', strtotime( $value ) ); - } - - // Return the validated value - return $value; - } - - /** - * Validate a decimal - * - * (Recommended decimal column length is '18,9'.) - * - * This is used to validate a mixed value before it is saved into a decimal - * column in a database table. - * - * Uses number_format() which does rounding to the last decimal if your - * value is longer than specified. - * - * @since 1.0.0 - * @param mixed $value Default empty string. The decimal value to validate - * @param int $decimals Default 9. The number of decimal points to accept - * @return float - */ - public function validate_decimal( $value = 0, $decimals = 9 ) { - - // Protect against non-numeric values - if ( ! is_numeric( $value ) ) { - $value = 0; - } - - // Protect against non-numeric decimals - if ( ! is_numeric( $decimals ) ) { - $decimals = 9; - } - - // Is the value negative? - $negative_exponent = ( $value < 0 ) - ? -1 - : 1; - - // Only numbers and period - $value = preg_replace( '/[^0-9\.]/', '', (string) $value ); - - // Format to number of decimals, and cast as float - $formatted = number_format( $value, $decimals, '.', '' ); - - // Adjust for negative values - $retval = $formatted * $negative_exponent; - - // Return - return $retval; - } - - /** - * Validate a UUID. - * - * This uses the v4 algorithm to generate a UUID that is used to uniquely - * and universally identify a given database row without any direct - * connection or correlation to the data in that row. - * - * From http://php.net/manual/en/function.uniqid.php#94959 - * - * @since 1.0.0 - * @param string $value The UUID value (empty on insert, string on update) - * @return string Generated UUID. - */ - public function validate_uuid( $value = '' ) { - - // Default URN UUID prefix - $prefix = 'urn:uuid:'; - - // Bail if not empty and correctly prefixed - // (UUIDs should _never_ change once they are set) - if ( ! empty( $value ) && ( 0 === strpos( $value, $prefix ) ) ) { - return $value; - } - - // Put the pieces together - $value = sprintf( "{$prefix}%04x%04x-%04x-%04x-%04x-%04x%04x%04x", - - // 32 bits for "time_low" - mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), - - // 16 bits for "time_mid" - mt_rand( 0, 0xffff ), - - // 16 bits for "time_hi_and_version", - // four most significant bits holds version number 4 - mt_rand( 0, 0x0fff ) | 0x4000, - - // 16 bits, 8 bits for "clk_seq_hi_res", - // 8 bits for "clk_seq_low", - // two most significant bits holds zero and one for variant DCE1.1 - mt_rand( 0, 0x3fff ) | 0x8000, - - // 48 bits for "node" - mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) - ); - - // Return the new UUID - return $value; - } - - /** Table Helpers *********************************************************/ - - /** - * Return a string representation of what this column's properties look like - * in a MySQL. - * - * @todo - * @since 1.0.0 - * @return string - */ - public function get_create_string() { - - // Default return val - $retval = ''; - - // Bail if no name - if ( ! empty( $this->name ) ) { - $retval .= $this->name; - } - - // Type - if ( ! empty( $this->type ) ) { - $retval .= " {$this->type}"; - } - - // Length - if ( ! empty( $this->length ) ) { - $retval .= '(' . $this->length . ')'; - } - - // Unsigned - if ( ! empty( $this->unsigned ) ) { - $retval .= " unsigned"; - } - - // Zerofill - if ( ! empty( $this->zerofill ) ) { - // TBD - } - - // Binary - if ( ! empty( $this->binary ) ) { - // TBD - } - - // Allow null - if ( ! empty( $this->allow_null ) ) { - $retval .= " NOT NULL "; - } - - // Default - if ( ! empty( $this->default ) ) { - $retval .= " default '{$this->default}'"; - - // A literal false means no default value - } elseif ( false !== $this->default ) { - - // Numeric - if ( $this->is_numeric() ) { - $retval .= " default '0'"; - } elseif ( $this->is_type( 'datetime' ) ) { - $retval .= " default '0000-00-00 00:00:00'"; - } else { - $retval .= " default ''"; - } - } - - // Extra - if ( ! empty( $this->extra ) ) { - $retval .= " {$this->extra}"; - } - - // Encoding - if ( ! empty( $this->encoding ) ) { - - } else { - - } - - // Collation - if ( ! empty( $this->collation ) ) { - - } else { - - } - - // Return the create string - return $retval; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-compare.php b/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-compare.php deleted file mode 100644 index b82ca271..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-compare.php +++ /dev/null @@ -1,157 +0,0 @@ - array(), - 'join' => array(), - ); - - if ( isset( $clause['compare'] ) ) { - $clause['compare'] = strtoupper( $clause['compare'] ); - } else { - $clause['compare'] = isset( $clause['value'] ) && is_array( $clause['value'] ) ? 'IN' : '='; - } - - if ( ! in_array( - $clause['compare'], array( - '=', - '!=', - '>', - '>=', - '<', - '<=', - 'LIKE', - 'NOT LIKE', - 'IN', - 'NOT IN', - 'BETWEEN', - 'NOT BETWEEN', - 'EXISTS', - 'NOT EXISTS', - 'REGEXP', - 'NOT REGEXP', - 'RLIKE', - ), true - ) ) { - $clause['compare'] = '='; - } - - if ( isset( $clause['compare_key'] ) && 'LIKE' === strtoupper( $clause['compare_key'] ) ) { - $clause['compare_key'] = strtoupper( $clause['compare_key'] ); - } else { - $clause['compare_key'] = '='; - } - - $compare = $clause['compare']; - $compare_key = $clause['compare_key']; - - // Build the WHERE clause. - - // Column name and value. - if ( array_key_exists( 'key', $clause ) && array_key_exists( 'value', $clause ) ) { - $column = sanitize_key( $clause['key'] ); - $value = $clause['value']; - - if ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ), true ) ) { - if ( ! is_array( $value ) ) { - $value = preg_split( '/[,\s]+/', $value ); - } - } else { - $value = trim( $value ); - } - - switch ( $compare ) { - case 'IN': - case 'NOT IN': - $compare_string = '(' . substr( str_repeat( ',%s', count( $value ) ), 1 ) . ')'; - $where = $wpdb->prepare( $compare_string, $value ); - break; - - case 'BETWEEN': - case 'NOT BETWEEN': - $value = array_slice( $value, 0, 2 ); - $where = $wpdb->prepare( '%s AND %s', $value ); - break; - - case 'LIKE': - case 'NOT LIKE': - $value = '%' . $wpdb->esc_like( $value ) . '%'; - $where = $wpdb->prepare( '%s', $value ); - break; - - // EXISTS with a value is interpreted as '='. - case 'EXISTS': - $compare = '='; - $where = $wpdb->prepare( '%s', $value ); - break; - - // 'value' is ignored for NOT EXISTS. - case 'NOT EXISTS': - $where = ''; - break; - - default: - $where = $wpdb->prepare( '%s', $value ); - break; - - } - - if ( $where ) { - $sql_chunks['where'][] = "{$column} {$compare} {$where}"; - } - } - - /* - * Multiple WHERE clauses (for meta_key and meta_value) should - * be joined in parentheses. - */ - if ( 1 < count( $sql_chunks['where'] ) ) { - $sql_chunks['where'] = array( '( ' . implode( ' AND ', $sql_chunks['where'] ) . ' )' ); - } - - return $sql_chunks; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-date.php b/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-date.php deleted file mode 100644 index f40dc656..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-date.php +++ /dev/null @@ -1,1242 +0,0 @@ -', - '>=', - '<', - '<=', - 'IN', - 'NOT IN', - 'BETWEEN', - 'NOT BETWEEN' - ); - - /** - * Supported multi-value comparison types - * - * @since 1.1.0 - * @var array - */ - public $multi_value_keys = array( - 'IN', - 'NOT IN', - 'BETWEEN', - 'NOT BETWEEN' - ); - - /** - * Supported relation types - * - * @since 1.1.0 - * @var array - */ - public $relation_keys = array( - 'OR', - 'AND' - ); - - /** - * Constructor. - * - * Time-related parameters that normally require integer values ('year', 'month', 'week', 'dayofyear', 'day', - * 'dayofweek', 'dayofweek_iso', 'hour', 'minute', 'second') accept arrays of integers for some values of - * 'compare'. When 'compare' is 'IN' or 'NOT IN', arrays are accepted; when 'compare' is 'BETWEEN' or 'NOT - * BETWEEN', arrays of two valid values are required. See individual argument descriptions for accepted values. - * - * @since 1.0.0 - * - * @param array $date_query { - * Array of date query clauses. - * - * @type array { - * @type string $column Optional. The column to query against. If undefined, inherits the value of - * 'date_created'. Accepts 'date_created', 'date_created_gmt', - * 'post_modified','post_modified_gmt', 'comment_date', 'comment_date_gmt'. - * Default 'date_created'. - * @type string $compare Optional. The comparison operator. Accepts '=', '!=', '>', '>=', '<', '<=', - * 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'. Default '='. - * @type string $relation Optional. The boolean relationship between the date queries. Accepts 'OR' or 'AND'. - * Default 'OR'. - * @type array { - * Optional. An array of first-order clause parameters, or another fully-formed date query. - * - * @type string|array $before { - * Optional. Date to retrieve posts before. Accepts `strtotime()`-compatible string, - * or array of 'year', 'month', 'day' values. - * - * @type string $year The four-digit year. Default empty. Accepts any four-digit year. - * @type string $month Optional when passing array.The month of the year. - * Default (string:empty)|(array:1). Accepts numbers 1-12. - * @type string $day Optional when passing array.The day of the month. - * Default (string:empty)|(array:1). Accepts numbers 1-31. - * } - * @type string|array $after { - * Optional. Date to retrieve posts after. Accepts `strtotime()`-compatible string, - * or array of 'year', 'month', 'day' values. - * - * @type string $year The four-digit year. Accepts any four-digit year. Default empty. - * @type string $month Optional when passing array. The month of the year. Accepts numbers 1-12. - * Default (string:empty)|(array:12). - * @type string $day Optional when passing array.The day of the month. Accepts numbers 1-31. - * Default (string:empty)|(array:last day of month). - * } - * @type string $column Optional. Used to add a clause comparing a column other than the - * column specified in the top-level `$column` parameter. Accepts - * 'date_created', 'date_created_gmt', 'post_modified', 'post_modified_gmt', - * 'comment_date', 'comment_date_gmt'. Default is the value of - * top-level `$column`. - * @type string $compare Optional. The comparison operator. Accepts '=', '!=', '>', '>=', - * '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'. 'IN', - * 'NOT IN', 'BETWEEN', and 'NOT BETWEEN'. Comparisons support - * arrays in some time-related parameters. Default '='. - * @type bool $inclusive Optional. Include results from dates specified in 'before' or - * 'after'. Default false. - * @type int|array $year Optional. The four-digit year number. Accepts any four-digit year - * or an array of years if `$compare` supports it. Default empty. - * @type int|array $month Optional. The two-digit month number. Accepts numbers 1-12 or an - * array of valid numbers if `$compare` supports it. Default empty. - * @type int|array $week Optional. The week number of the year. Accepts numbers 0-53 or an - * array of valid numbers if `$compare` supports it. Default empty. - * @type int|array $dayofyear Optional. The day number of the year. Accepts numbers 1-366 or an - * array of valid numbers if `$compare` supports it. - * @type int|array $day Optional. The day of the month. Accepts numbers 1-31 or an array - * of valid numbers if `$compare` supports it. Default empty. - * @type int|array $dayofweek Optional. The day number of the week. Accepts numbers 1-7 (1 is - * Sunday) or an array of valid numbers if `$compare` supports it. - * Default empty. - * @type int|array $dayofweek_iso Optional. The day number of the week (ISO). Accepts numbers 1-7 - * (1 is Monday) or an array of valid numbers if `$compare` supports it. - * Default empty. - * @type int|array $hour Optional. The hour of the day. Accepts numbers 0-23 or an array - * of valid numbers if `$compare` supports it. Default empty. - * @type int|array $minute Optional. The minute of the hour. Accepts numbers 0-60 or an array - * of valid numbers if `$compare` supports it. Default empty. - * @type int|array $second Optional. The second of the minute. Accepts numbers 0-60 or an - * array of valid numbers if `$compare` supports it. Default empty. - * } - * } - * } - */ - public function __construct( $date_query = array() ) { - - // Bail if not an array. - if ( ! is_array( $date_query ) ) { - return; - } - - // Support for passing time-based keys in the top level of the array. - if ( ! isset( $date_query[0] ) && ! empty( $date_query ) ) { - $date_query = array( $date_query ); - } - - // Bail if empty. - if ( empty( $date_query ) ) { - return; - } - - // Set column, compare, relation, and queries. - $this->column = $this->get_column( $date_query ); - $this->compare = $this->get_compare( $date_query ); - $this->relation = $this->get_relation( $date_query ); - $this->queries = $this->sanitize_query( $date_query ); - } - - /** - * Recursive-friendly query sanitizer. - * - * Ensures that each query-level clause has a 'relation' key, and that - * each first-order clause contains all the necessary keys from - * `$defaults`. - * - * @since 1.0.0 - * - * @param array $queries - * @param array $parent_query - * - * @return array Sanitized queries. - */ - public function sanitize_query( $queries = array(), $parent_query = array() ) { - - // Default return value. - $retval = array(); - - // Setup defaults. - $defaults = array( - 'column' => $this->get_column(), - 'compare' => $this->get_compare(), - 'relation' => $this->get_relation() - ); - - // Numeric keys should always have array values. - foreach ( $queries as $qkey => $qvalue ) { - if ( is_numeric( $qkey ) && ! is_array( $qvalue ) ) { - unset( $queries[ $qkey ] ); - } - } - - // Each query should have a value for each default key. - // Inherit from the parent when possible. - foreach ( $defaults as $dkey => $dvalue ) { - - // Skip if already set. - if ( isset( $queries[ $dkey ] ) ) { - continue; - } - - // Set the query. - if ( isset( $parent_query[ $dkey ] ) ) { - $queries[ $dkey ] = $parent_query[ $dkey ]; - } else { - $queries[ $dkey ] = $dvalue; - } - } - - // Validate the dates passed in the query. - if ( $this->is_first_order_clause( $queries ) ) { - $this->validate_date_values( $queries ); - } - - // Add queries to return array. - foreach ( $queries as $key => $q ) { - - // This is a first-order query. Trust the values and sanitize when building SQL. - if ( ! is_array( $q ) || in_array( $key, $this->time_keys, true ) ) { - $retval[ $key ] = $q; - - // Any array without a time key is another query, so we recurse. - } else { - $retval[] = $this->sanitize_query( $q, $queries ); - } - } - - // Return sanitized queries. - return $retval; - } - - /** - * Determine whether this is a first-order clause. - * - * Checks to see if the current clause has any time-related keys. - * If so, it's first-order. - * - * @since 1.0.0 - * - * @param array $query Query clause. - * - * @return bool True if this is a first-order clause. - */ - protected function is_first_order_clause( $query = array() ) { - $time_keys = array_intersect( $this->time_keys, array_keys( $query ) ); - - return ! empty( $time_keys ); - } - - /** - * Determines and validates what comparison operator to use. - * - * @since 1.0.0 - * - * @param array $query A date query or a date subquery. - * - * @return string The comparison operator. - */ - public function get_column( $query = array() ) { - - // Use column if passed - $retval = ! empty( $query['column'] ) - ? esc_sql( $this->validate_column( $query['column'] ) ) - : $this->column; - - return $retval; - } - - /** - * Determines and validates what comparison operator to use. - * - * @since 1.0.0 - * - * @param array $query A date query or a date subquery. - * - * @return string The comparison operator. - */ - public function get_compare( $query = array() ) { - - // Compare must be in the allowed array - $retval = ! empty( $query['compare'] ) && in_array( $query['compare'], $this->comparison_keys, true ) - ? strtoupper( $query['compare'] ) - : $this->compare; - - return $retval; - } - - /** - * Determines and validates what relation to use. - * - * @since 1.0.0 - * - * @param array $query A date query or a date subquery. - * @return string The relation operator. - */ - public function get_relation( $query = array() ) { - - // Relation must be in the allowed array - $retval = ! empty( $query['relation'] ) && in_array( $query['relation'], $this->relation_keys, true ) - ? strtoupper( $query['relation'] ) - : $this->relation; - - return $retval; - } - - /** - * Validates the given date_query values. - * - * Note that date queries with invalid date ranges are allowed to - * continue (though of course no items will be found for impossible dates). - * This method only generates debug notices for these cases. - * - * @since 1.0.0 - * - * @param array $date_query The date_query array. - * - * @return bool True if all values in the query are valid, false if one or more fail. - */ - public function validate_date_values( $date_query = array() ) { - - // Bail if empty. - if ( empty( $date_query ) ) { - return false; - } - - $valid = true; - - /* - * Validate 'before' and 'after' up front, then let the - * validation routine continue to be sure that all invalid - * values generate errors too. - */ - if ( array_key_exists( 'before', $date_query ) && is_array( $date_query['before'] ) ) { - $valid = $this->validate_date_values( $date_query['before'] ); - } - - if ( array_key_exists( 'after', $date_query ) && is_array( $date_query['after'] ) ) { - $valid = $this->validate_date_values( $date_query['after'] ); - } - - // Values are passthroughs. - if ( array_key_exists( 'value', $date_query ) ) { - $valid = true; - } - - // Array containing all min-max checks. - $min_max_checks = array(); - - // Days per year. - if ( array_key_exists( 'year', $date_query ) ) { - /* - * If a year exists in the date query, we can use it to get the days. - * If multiple years are provided (as in a BETWEEN), use the first one. - */ - if ( is_array( $date_query['year'] ) ) { - $_year = reset( $date_query['year'] ); - } else { - $_year = $date_query['year']; - } - - $max_days_of_year = date( 'z', mktime( 0, 0, 0, 12, 31, $_year ) ) + 1; - - // Otherwise we use the max of 366 (leap-year) - } else { - $max_days_of_year = 366; - } - - // Days of year. - $min_max_checks['dayofyear'] = array( - 'min' => 1, - 'max' => $max_days_of_year, - ); - - // Days per week. - $min_max_checks['dayofweek'] = array( - 'min' => 1, - 'max' => 7, - ); - - // Days per week. - $min_max_checks['dayofweek_iso'] = array( - 'min' => 1, - 'max' => 7, - ); - - // Months per year. - $min_max_checks['month'] = array( - 'min' => 1, - 'max' => 12, - ); - - // Weeks per year. - if ( isset( $_year ) ) { - /* - * If we have a specific year, use it to calculate number of weeks. - * Note: the number of weeks in a year is the date in which Dec 28 appears. - */ - $week_count = date( 'W', mktime( 0, 0, 0, 12, 28, $_year ) ); - - // Otherwise set the week-count to a maximum of 53. - } else { - $week_count = 53; - } - - // Weeks per year. - $min_max_checks['week'] = array( - 'min' => 1, - 'max' => $week_count, - ); - - // Days per month. - $min_max_checks['day'] = array( - 'min' => 1, - 'max' => 31, - ); - - // Hours per day. - $min_max_checks['hour'] = array( - 'min' => 0, - 'max' => 23, - ); - - // Minutes per hour. - $min_max_checks['minute'] = array( - 'min' => 0, - 'max' => 59, - ); - - // Seconds per minute. - $min_max_checks['second'] = array( - 'min' => 0, - 'max' => 59, - ); - - // Loop through min/max checks. - foreach ( $min_max_checks as $key => $check ) { - - // Skip if not in query. - if ( ! array_key_exists( $key, $date_query ) ) { - continue; - } - - // Check for invalid values. - foreach ( (array) $date_query[ $key ] as $_value ) { - $is_between = ( $_value >= $check['min'] ) && ( $_value <= $check['max'] ); - - if ( ! is_numeric( $_value ) || empty( $is_between ) ) { - $valid = false; - } - } - } - - // Bail if invalid query. - if ( false === $valid ) { - return $valid; - } - - // Check what kinds of dates are being queried for. - $day_exists = array_key_exists( 'day', $date_query ) && is_numeric( $date_query['day'] ); - $month_exists = array_key_exists( 'month', $date_query ) && is_numeric( $date_query['month'] ); - $year_exists = array_key_exists( 'year', $date_query ) && is_numeric( $date_query['year'] ); - - // Checking at least day & month. - if ( ! empty( $day_exists ) && ! empty( $month_exists ) ) { - - // Check for year query, or fallback to 2012 (for flexibility). - $year = ! empty( $year_exists ) - ? $date_query['year'] - : '2012'; - - // Parse the date to check. - $to_check = sprintf( '%s-%s-%s', $year, $date_query['month'], $date_query['day'] ); - - // Check the date. - if ( ! $this->checkdate( $date_query['month'], $date_query['day'], $year, $to_check ) ) { - $valid = false; - } - } - - // Return if valid or not - return $valid; - } - - /** - * Validates a column name parameter. - * - * @since 1.0.0 - * - * @param string $column The user-supplied column name. - * - * @return string A validated column name value. - */ - public function validate_column( $column = '' ) { - return preg_replace( '/[^a-zA-Z0-9_$\.]/', '', $column ); - } - - /** - * Generate WHERE clause to be appended to a main query. - * - * @since 1.0.0 - * - * @return string MySQL WHERE clauses. - */ - public function get_sql() { - $sql = $this->get_sql_clauses(); - - /** - * Filters the date query clauses. - * - * @since 1.0.0 - * - * @param string $sql Clauses of the date query. - * @param Date $this The Date query instance. - */ - return apply_filters( 'get_date_sql', $sql, $this ); - } - - /** - * Generate SQL clauses to be appended to a main query. - * - * Called by the public Date::get_sql(), this method is abstracted - * out to maintain parity with the other Query classes. - * - * @since 1.0.0 - * - * @return array { - * Array containing JOIN and WHERE SQL clauses to append to the main query. - * - * @type string $join SQL fragment to append to the main JOIN clause. - * @type string $where SQL fragment to append to the main WHERE clause. - * } - */ - protected function get_sql_clauses() { - $sql = $this->get_sql_for_query( $this->queries ); - - if ( ! empty( $sql['where'] ) ) { - $sql['where'] = ' AND ' . $sql['where']; - } - - return apply_filters( 'get_date_sql_clauses', $sql, $this ); - } - - /** - * Generate SQL clauses for a single query array. - * - * If nested subqueries are found, this method recurses the tree to - * produce the properly nested SQL. - * - * @since 1.0.0 - * - * @param array $query Query to parse. - * @param int $depth Optional. Number of tree levels deep we currently are. - * Used to calculate indentation. Default 0. - * @return array { - * Array containing JOIN and WHERE SQL clauses to append to a single query array. - * - * @type string $join SQL fragment to append to the main JOIN clause. - * @type string $where SQL fragment to append to the main WHERE clause. - * } - */ - protected function get_sql_for_query( $query = array(), $depth = 0 ) { - $sql_chunks = array( - 'join' => array(), - 'where' => array(), - ); - - $sql = array( - 'join' => '', - 'where' => '', - ); - - $indent = ''; - for ( $i = 0; $i < $depth; $i++ ) { - $indent .= ' '; - } - - foreach ( $query as $key => $clause ) { - - if ( 'relation' === $key ) { - $relation = $query['relation']; - - } elseif ( is_array( $clause ) ) { - - // This is a first-order clause. - if ( $this->is_first_order_clause( $clause ) ) { - - // Get clauses & where count - $clause_sql = $this->get_sql_for_clause( $clause, $query ); - $where_count = count( $clause_sql['where'] ); - - if ( ! $where_count ) { - $sql_chunks['where'][] = ''; - - } elseif ( 1 === $where_count ) { - $sql_chunks['where'][] = $clause_sql['where'][0]; - - } else { - $sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )'; - } - - $sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] ); - - // This is a subquery, so we recurse. - } else { - $clause_sql = $this->get_sql_for_query( $clause, $depth + 1 ); - - $sql_chunks['where'][] = $clause_sql['where']; - $sql_chunks['join'][] = $clause_sql['join']; - } - } - } - - // Filter to remove empties. - $sql_chunks['join'] = array_filter( $sql_chunks['join'] ); - $sql_chunks['where'] = array_filter( $sql_chunks['where'] ); - - if ( empty( $relation ) ) { - $relation = 'AND'; - } - - // Filter duplicate JOIN clauses and combine into a single string. - if ( ! empty( $sql_chunks['join'] ) ) { - $sql['join'] = implode( ' ', array_unique( $sql_chunks['join'] ) ); - } - - // Generate a single WHERE clause with proper brackets and indentation. - if ( ! empty( $sql_chunks['where'] ) ) { - $sql['where'] = '( ' . "\n " . $indent . implode( ' ' . "\n " . $indent . $relation . ' ' . "\n " . $indent, $sql_chunks['where'] ) . "\n" . $indent . ')'; - } - - // Filter and return - return apply_filters( 'get_date_sql_for_query', $sql, $query, $depth, $this ); - } - - /** - * Turns a first-order date query into SQL for a WHERE clause. - * - * @since 1.0.0 - * - * @param array $query Date query clause. - * @param array $parent_query Parent query of the current date query. - * - * @return array { - * Array containing JOIN and WHERE SQL clauses to append to the main query. - * - * @type string $join SQL fragment to append to the main JOIN clause. - * @type string $where SQL fragment to append to the main WHERE clause. - * } - */ - protected function get_sql_for_clause( $query = array(), $parent_query = array() ) { - - // The sub-parts of a $where part. - $where_parts = array(); - - $column = $this->get_column( $query ); - $compare = $this->get_compare( $query ); - $inclusive = ! empty( $query['inclusive'] ); - - // Assign greater-than and less-than values. - $lt = '<'; - $gt = '>'; - - if ( $inclusive ) { - $lt .= '='; - $gt .= '='; - } - - // Range queries. - if ( ! empty( $query['after'] ) ) { - $where_parts[] = $this->get_db()->prepare( "{$column} {$gt} %s", $this->build_mysql_datetime( $query['after'], ! $inclusive ) ); - } - - if ( ! empty( $query['before'] ) ) { - $where_parts[] = $this->get_db()->prepare( "{$column} {$lt} %s", $this->build_mysql_datetime( $query['before'], $inclusive ) ); - } - - // Specific value queries. - if ( isset( $query['year'] ) && $value = $this->build_numeric_value( $compare, $query['year'] ) ) { - $where_parts[] = "YEAR( {$column} ) {$compare} {$value}"; - } - - if ( isset( $query['month'] ) && $value = $this->build_numeric_value( $compare, $query['month'] ) ) { - $where_parts[] = "MONTH( {$column} ) {$compare} {$value}"; - } elseif ( isset( $query['monthnum'] ) && $value = $this->build_numeric_value( $compare, $query['monthnum'] ) ) { - $where_parts[] = "MONTH( {$column} ) {$compare} {$value}"; - } - - if ( isset( $query['week'] ) && false !== ( $value = $this->build_numeric_value( $compare, $query['week'] ) ) ) { - $where_parts[] = _wp_mysql_week( $column ) . " {$compare} {$value}"; - } elseif ( isset( $query['w'] ) && false !== ( $value = $this->build_numeric_value( $compare, $query['w'] ) ) ) { - $where_parts[] = _wp_mysql_week( $column ) . " {$compare} {$value}"; - } - - if ( isset( $query['dayofyear'] ) && $value = $this->build_numeric_value( $compare, $query['dayofyear'] ) ) { - $where_parts[] = "DAYOFYEAR( {$column} ) {$compare} {$value}"; - } - - if ( isset( $query['day'] ) && $value = $this->build_numeric_value( $compare, $query['day'] ) ) { - $where_parts[] = "DAYOFMONTH( {$column} ) {$compare} {$value}"; - } - - if ( isset( $query['dayofweek'] ) && $value = $this->build_numeric_value( $compare, $query['dayofweek'] ) ) { - $where_parts[] = "DAYOFWEEK( {$column} ) {$compare} {$value}"; - } - - if ( isset( $query['dayofweek_iso'] ) && $value = $this->build_numeric_value( $compare, $query['dayofweek_iso'] ) ) { - $where_parts[] = "WEEKDAY( {$column} ) + 1 {$compare} {$value}"; - } - - // Straight value compare - if ( isset( $query['value'] ) ) { - $value = $this->build_value( $compare, $query['value'] ); - $where_parts[] = "{$column} {$compare} $value"; - } - - // Hour/Minute/Second - if ( isset( $query['hour'] ) || isset( $query['minute'] ) || isset( $query['second'] ) ) { - - // Avoid notices. - foreach ( array( 'hour', 'minute', 'second' ) as $unit ) { - if ( ! isset( $query[ $unit ] ) ) { - $query[ $unit ] = null; - } - } - - $time_query = $this->build_time_query( $column, $compare, $query['hour'], $query['minute'], $query['second'] ); - - if ( ! empty( $time_query ) ) { - $where_parts[] = $time_query; - } - } - - /* - * Return an array of 'join' and 'where' for compatibility - * with other query classes. - */ - return array( - 'where' => $where_parts, - 'join' => array(), - ); - } - - /** - * Builds and validates a value string based on the comparison operator. - * - * @since 1.0.0 - * - * @param string $compare The compare operator to use - * @param string|array $value The value - * - * @return string|false|int The value to be used in SQL or false on error. - */ - public function build_numeric_value( $compare = '=', $value = null ) { - - // Bail if null value - if ( is_null( $value ) ) { - return false; - } - - switch ( $compare ) { - case 'IN': - case 'NOT IN': - $value = (array) $value; - - // Remove non-numeric values. - $value = array_filter( $value, 'is_numeric' ); - - if ( empty( $value ) ) { - return false; - } - - return '(' . implode( ',', array_map( 'intval', $value ) ) . ')'; - - case 'BETWEEN': - case 'NOT BETWEEN': - if ( ! is_array( $value ) || 2 != count( $value ) ) { - $value = array( $value, $value ); - } else { - $value = array_values( $value ); - } - - // If either value is non-numeric, bail. - foreach ( $value as $v ) { - if ( ! is_numeric( $v ) ) { - return false; - } - } - - $value = array_map( 'intval', $value ); - - return $value[0] . ' AND ' . $value[1]; - - default: - if ( ! is_numeric( $value ) ) { - return false; - } - - return (int) $value; - } - } - - /** - * Builds and validates a value string based on the comparison operator. - * - * @since 1.0.0 - * - * @param string $compare The compare operator to use - * @param string|array $value The value - * - * @return string|false|int The value to be used in SQL or false on error. - */ - public function build_value( $compare = '=', $value = null ) { - - if ( in_array( $compare, $this->multi_value_keys, true ) ) { - if ( ! is_array( $value ) ) { - $value = preg_split( '/[,\s]+/', $value ); - } - } else { - $value = trim( $value ); - } - - switch ( $compare ) { - case 'IN': - case 'NOT IN': - $compare_string = '(' . substr( str_repeat( ',%s', count( $value ) ), 1 ) . ')'; - $where = $this->get_db()->prepare( $compare_string, $value ); - break; - - case 'BETWEEN': - case 'NOT BETWEEN': - $value = array_slice( $value, 0, 2 ); - $where = $this->get_db()->prepare( '%s AND %s', $value ); - break; - - case 'LIKE': - case 'NOT LIKE': - $value = '%' . $this->get_db()->esc_like( $value ) . '%'; - $where = $this->get_db()->prepare( '%s', $value ); - break; - - // EXISTS with a value is interpreted as '='. - case 'EXISTS': - $compare = '='; - $where = $this->get_db()->prepare( '%s', $value ); - break; - - // 'value' is ignored for NOT EXISTS. - case 'NOT EXISTS': - $where = ''; - break; - - default: - $where = $this->get_db()->prepare( '%s', $value ); - break; - } - - return $where; - } - - /** - * Builds a MySQL format date/time based on some query parameters. - * - * You can pass an array of values (year, month, etc.) with missing parameter values being defaulted to - * either the maximum or minimum values (controlled by the $default_to parameter). Alternatively you can - * pass a string that will be run through strtotime(). - * - * @since 1.0.0 - * - * @param string|array $datetime An array of parameters or a strtotime() string - * @param bool $default_to_max Whether to round up incomplete dates. Supported by values - * of $datetime that are arrays, or string values that are a - * subset of MySQL date format ('Y', 'Y-m', 'Y-m-d', 'Y-m-d H:i'). - * Default: false. - * - * @return string|false A MySQL format date/time or false on failure - */ - public function build_mysql_datetime( $datetime = '', $default_to_max = false ) { - - // Get current time - $now = time(); - - // Datetime is string - if ( is_string( $datetime ) ) { - - // Define matches so linters don't complain - $matches = array(); - - /* - * Try to parse some common date formats, so we can detect - * the level of precision and support the 'inclusive' parameter. - */ - - // Y - if ( preg_match( '/^(\d{4})$/', $datetime, $matches ) ) { - $datetime = array( - 'year' => intval( $matches[1] ), - ); - - // Y-m - } elseif ( preg_match( '/^(\d{4})\-(\d{2})$/', $datetime, $matches ) ) { - $datetime = array( - 'year' => intval( $matches[1] ), - 'month' => intval( $matches[2] ), - ); - - // Y-m-d - } elseif ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2})$/', $datetime, $matches ) ) { - $datetime = array( - 'year' => intval( $matches[1] ), - 'month' => intval( $matches[2] ), - 'day' => intval( $matches[3] ), - ); - - // Y-m-d H:i - } elseif ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})$/', $datetime, $matches ) ) { - $datetime = array( - 'year' => intval( $matches[1] ), - 'month' => intval( $matches[2] ), - 'day' => intval( $matches[3] ), - 'hour' => intval( $matches[4] ), - 'minute' => intval( $matches[5] ), - ); - } - - // If no match is found, we don't support default_to_max. - if ( ! is_array( $datetime ) ) { - return gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ); - } - } - - // Map to ints - $datetime = array_map( 'absint', $datetime ); - - // Year - if ( ! isset( $datetime['year'] ) ) { - $datetime['year'] = date( 'Y', $now ); - } - - // Month - if ( ! isset( $datetime['month'] ) ) { - $datetime['month'] = ! empty( $default_to_max ) - ? 12 - : 1; - } - - // Day - if ( ! isset( $datetime['day'] ) ) { - $datetime['day'] = ! empty( $default_to_max ) - ? (int) date( 't', mktime( 0, 0, 0, $datetime['month'], 1, $datetime['year'] ) ) - : 1; - } - - // Hour - if ( ! isset( $datetime['hour'] ) ) { - $datetime['hour'] = ! empty( $default_to_max ) - ? 23 - : 0; - } - - // Minute - if ( ! isset( $datetime['minute'] ) ) { - $datetime['minute'] = ! empty( $default_to_max ) - ? 59 - : 0; - } - - // Second - if ( ! isset( $datetime['second'] ) ) { - $datetime['second'] = ! empty( $default_to_max ) - ? 59 - : 0; - } - - // Combine and return - return sprintf( - '%04d-%02d-%02d %02d:%02d:%02d', - $datetime['year'], - $datetime['month'], - $datetime['day'], - $datetime['hour'], - $datetime['minute'], - $datetime['second'] - ); - } - - /** - * Return a MySQL expression for selecting the week number based on the - * day that the week starts. - * - * Uses the WordPress site option, if set. - * - * @since 1.0.0 - * - * @param string $column Database column. - * @param int $start_of_week Day that week starts on. 0 = Sunday. - * - * @return string SQL clause. - */ - public function build_mysql_week( $column = '', $start_of_week = 0 ) { - - // Start of week option - $start_of_week = (int) get_option( 'start_of_week', $start_of_week ); - - // When does the week start? - switch ( $start_of_week ) { - - // Monday - case 1: - $retval = "WEEK( {$column}, 1 )"; - break; - - // Tuesday - Saturday - case 2: - case 3: - case 4: - case 5: - case 6: - $retval = "WEEK( DATE_SUB( {$column}, INTERVAL {$start_of_week} DAY ), 0 )"; - break; - - // Sunday - case 0: - default: - $retval = "WEEK( {$column}, 0 )"; - break; - } - - // Return SQL - return $retval; - } - - /** - * Builds a query string for comparing time values (hour, minute, second). - * - * If just hour, minute, or second is set than a normal comparison will be done. - * However if multiple values are passed, a pseudo-decimal time will be created - * in order to be able to accurately compare against. - * - * @since 1.0.0 - * - * @param string $column The column to query against. Needs to be pre-validated! - * @param string $compare The comparison operator. Needs to be pre-validated! - * @param int|null $hour Optional. An hour value (0-23). - * @param int|null $minute Optional. A minute value (0-59). - * @param int|null $second Optional. A second value (0-59). - * - * @return string|false A query part or false on failure. - */ - public function build_time_query( $column, $compare, $hour = null, $minute = null, $second = null ) { - - // Have to have at least one - if ( ! isset( $hour ) && ! isset( $minute ) && ! isset( $second ) ) { - return false; - } - - // Complex combined queries aren't supported for multi-value queries - if ( in_array( $compare, $this->multi_value_keys, true ) ) { - $retval = array(); - - // Hour - if ( isset( $hour ) && false !== ( $value = $this->build_numeric_value( $compare, $hour ) ) ) { - $retval[] = "HOUR( {$column} ) {$compare} {$value}"; - } - - // Minute - if ( isset( $minute ) && false !== ( $value = $this->build_numeric_value( $compare, $minute ) ) ) { - $retval[] = "MINUTE( {$column} ) {$compare} {$value}"; - } - - // Second - if ( isset( $second ) && false !== ( $value = $this->build_numeric_value( $compare, $second ) ) ) { - $retval[] = "SECOND( {$column} ) {$compare} {$value}"; - } - - return implode( ' AND ', $retval ); - } - - // Cases where just one unit is set - - // Hour - if ( isset( $hour ) && ! isset( $minute ) && ! isset( $second ) && false !== ( $value = $this->build_numeric_value( $compare, $hour ) ) ) { - return "HOUR( {$column} ) {$compare} {$value}"; - - // Minute - } elseif ( ! isset( $hour ) && isset( $minute ) && ! isset( $second ) && false !== ( $value = $this->build_numeric_value( $compare, $minute ) ) ) { - return "MINUTE( {$column} ) {$compare} {$value}"; - - // Second - } elseif ( ! isset( $hour ) && ! isset( $minute ) && isset( $second ) && false !== ( $value = $this->build_numeric_value( $compare, $second ) ) ) { - return "SECOND( {$column} ) {$compare} {$value}"; - } - - // Single units were already handled. Since hour & second isn't allowed, - // minute must to be set. - if ( ! isset( $minute ) ) { - return false; - } - - // Defaults - $format = $time = ''; - - // Hour - if ( null !== $hour ) { - $format .= '%H.'; - $time .= sprintf( '%02d', $hour ) . '.'; - } else { - $format .= '0.'; - $time .= '0.'; - } - - // Minute - $format .= '%i'; - $time .= sprintf( '%02d', $minute ); - - // Second - if ( isset( $second ) ) { - $format .= '%s'; - $time .= sprintf( '%02d', $second ); - } - - // Build the SQL - $query = "DATE_FORMAT( {$column}, %s ) {$compare} %f"; - - // Return the prepared SQL - return $this->get_db()->prepare( $query, $format, $time ); - } - - /** - * Test if the supplied date is valid for the Gregorian calendar. - * - * @since 1.0.0 - * - * @link https://www.php.net/manual/en/function.checkdate.php - * - * @param int $month Month number. - * @param int $day Day number. - * @param int $year Year number. - * @param string $source_date The date to filter. - * - * @return bool True if valid date, false if not valid date. - */ - public function checkdate( $month = 0, $day = 0, $year = 0, $source_date = '' ) { - - // Check the date - $retval = checkdate( $month, $day, $year ); - - /** - * Filters whether the given date is valid for the Gregorian calendar. - * - * @since 1.0.0 - * - * @param bool $checkdate Whether the given date is valid. - * @param string $source_date Date to check. - */ - return (bool) apply_filters( 'wp_checkdate', $retval, $source_date ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-meta.php b/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-meta.php deleted file mode 100644 index ae9c4165..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-meta.php +++ /dev/null @@ -1,29 +0,0 @@ - '', - 'from' => '', - 'where' => array(), - 'groupby' => '', - 'orderby' => '', - 'limits' => '' - ); - - /** - * Request clauses. - * - * @since 1.0.0 - * @var array - */ - protected $request_clauses = array( - 'select' => '', - 'from' => '', - 'where' => '', - 'groupby' => '', - 'orderby' => '', - 'limits' => '' - ); - - /** - * Meta query container. - * - * @since 1.0.0 - * @var object|Queries\Meta - */ - protected $meta_query = false; - - /** - * Date query container. - * - * @since 1.0.0 - * @var object|Queries\Date - */ - protected $date_query = false; - - /** - * Compare query container. - * - * @since 1.0.0 - * @var object|Queries\Compare - */ - protected $compare_query = false; - - /** Query Variables *******************************************************/ - - /** - * Parsed query vars set by the application, possibly filtered and changed. - * - * This is specifically marked as public, to allow byref actions to change - * them from outside the class methods proper and inside filter functions. - * - * @since 1.0.0 - * @var array - */ - public $query_vars = array(); - - /** - * Original query vars set by the application. - * - * These are the original query variables before any filters are applied, - * and are the results of merging $query_var_defaults with $query_vars. - * - * @since 1.0.0 - * @var array - */ - protected $query_var_originals = array(); - - /** - * Default values for query vars. - * - * These are computed at runtime based on the registered columns for the - * database table this query relates to. - * - * @since 1.0.0 - * @var array - */ - protected $query_var_defaults = array(); - - /** - * This private variable temporarily holds onto a random string used as the - * default query var value. This is used internally when performing - * comparisons, and allows for querying by falsy values. - * - * @since 1.1.0 - * @var string - */ - protected $query_var_default_value = ''; - - /** Results ***************************************************************/ - - /** - * List of items located by the query. - * - * @since 1.0.0 - * @var array - */ - public $items = array(); - - /** - * The amount of found items for the current query. - * - * @since 1.0.0 - * @var int - */ - protected $found_items = 0; - - /** - * The number of pages. - * - * @since 1.0.0 - * @var int - */ - protected $max_num_pages = 0; - - /** - * SQL for database query. - * - * @since 1.0.0 - * @var string - */ - protected $request = ''; - - /** Methods ***************************************************************/ - - /** - * Sets up the item query, based on the query vars passed. - * - * @since 1.0.0 - * - * @param string|array $query { - * Optional. Array or query string of item query parameters. - * Default empty. - * - * @type string $fields Site fields to return. Accepts 'ids' (returns an array of item IDs) - * or empty (returns an array of complete item objects). Default empty. - * To do a date query against a field, append the field name with _query - * @type bool $count Whether to return a item count (true) or array of item objects. - * Default false. - * @type int $number Limit number of items to retrieve. Use 0 for no limit. - * Default 100. - * @type int $offset Number of items to offset the query. Used to build LIMIT clause. - * Default 0. - * @type bool $no_found_rows Whether to disable the `SQL_CALC_FOUND_ROWS` query. - * Default true. - * @type string|array $orderby Accepts false, an empty array, or 'none' to disable `ORDER BY` clause. - * Default 'id'. - * @type string $item How to item retrieved items. Accepts 'ASC', 'DESC'. - * Default 'DESC'. - * @type string $search Search term(s) to retrieve matching items for. - * Default empty. - * @type array $search_columns Array of column names to be searched. - * Default empty array. - * @type bool $update_item_cache Whether to prime the cache for found items. - * Default false. - * @type bool $update_meta_cache Whether to prime the meta cache for found items. - * Default false. - * } - */ - public function __construct( $query = array() ) { - - // Setup - $this->set_alias(); - $this->set_prefix(); - $this->set_columns(); - $this->set_item_shape(); - $this->set_query_var_defaults(); - - // Maybe execute a query if arguments were passed - if ( ! empty( $query ) ) { - $this->query( $query ); - } - } - - /** - * Queries the database and retrieves items or counts. - * - * This method is public to allow subclasses to perform JIT manipulation - * of the parameters passed into it. - * - * @since 1.0.0 - * - * @param string|array $query Array or URL query string of parameters. - * @return array|int List of items, or number of items when 'count' is passed as a query var. - */ - public function query( $query = array() ) { - $this->parse_query( $query ); - - return $this->get_items(); - } - - /** Private Setters *******************************************************/ - - /** - * Set the time when items were last changed. - * - * We set this locally to avoid inconsistencies between method calls. - * - * @since 1.0.0 - */ - protected function set_last_changed() { - $this->last_changed = microtime(); - } - - /** - * Set up the table alias if not already set in the class. - * - * This happens before prefixes are applied. - * - * @since 1.0.0 - */ - protected function set_alias() { - if ( empty( $this->table_alias ) ) { - $this->table_alias = $this->first_letters( $this->table_name ); - } - } - - /** - * Prefix table names, cache groups, and other things. - * - * This is to avoid conflicts with other plugins or themes that might be - * doing their own things. - * - * @since 1.0.0 - */ - protected function set_prefix() { - $this->table_name = $this->apply_prefix( $this->table_name ); - $this->table_alias = $this->apply_prefix( $this->table_alias ); - $this->cache_group = $this->apply_prefix( $this->cache_group, '-' ); - } - - /** - * Set columns objects - * - * @since 1.0.0 - */ - protected function set_columns() { - - // Bail if no table schema - if ( ! class_exists( $this->table_schema ) ) { - return; - } - - // Invoke a new table schema class - $schema = new $this->table_schema; - - // Maybe get the column objects - if ( ! empty( $schema->columns ) ) { - $this->columns = $schema->columns; - } - } - - /** - * Set the default item shape if none exists - * - * @since 1.0.0 - */ - protected function set_item_shape() { - if ( empty( $this->item_shape ) || ! class_exists( $this->item_shape ) ) { - $this->item_shape = __NAMESPACE__ . '\\Row'; - } - } - - /** - * Set default query vars based on columns - * - * @since 1.0.0 - */ - protected function set_query_var_defaults() { - - // Default query variable value - $this->query_var_default_value = function_exists( 'random_bytes' ) - ? $this->apply_prefix( bin2hex( random_bytes( 18 ) ) ) - : $this->apply_prefix( uniqid( '_', true ) ); - - // Default query variables - $this->query_var_defaults = array( - 'fields' => '', - 'number' => 100, - 'offset' => '', - 'orderby' => 'id', - 'order' => 'DESC', - 'groupby' => '', - 'search' => '', - 'search_columns' => array(), - 'count' => false, - 'meta_query' => null, // See Queries\Meta - 'date_query' => null, // See Queries\Date - 'compare_query' => null, // See Queries\Compare - 'no_found_rows' => true, - - // Caching - 'update_item_cache' => true, - 'update_meta_cache' => true - ); - - // Bail if no columns - if ( empty( $this->columns ) ) { - return; - } - - // Direct column names - $names = wp_list_pluck( $this->columns, 'name' ); - foreach ( $names as $name ) { - $this->query_var_defaults[ $name ] = $this->query_var_default_value; - } - - // Possible ins - $possible_ins = $this->get_columns( array( 'in' => true ), 'and', 'name' ); - foreach ( $possible_ins as $in ) { - $key = "{$in}__in"; - $this->query_var_defaults[ $key ] = false; - } - - // Possible not ins - $possible_not_ins = $this->get_columns( array( 'not_in' => true ), 'and', 'name' ); - foreach ( $possible_not_ins as $in ) { - $key = "{$in}__not_in"; - $this->query_var_defaults[ $key ] = false; - } - - // Possible dates - $possible_dates = $this->get_columns( array( 'date_query' => true ), 'and', 'name' ); - foreach ( $possible_dates as $date ) { - $key = "{$date}_query"; - $this->query_var_defaults[ $key ] = false; - } - } - - /** - * Set the request clauses - * - * @since 1.0.0 - * - * @param array $clauses - */ - protected function set_request_clauses( $clauses = array() ) { - - // Found rows - $found_rows = empty( $this->query_vars['no_found_rows'] ) - ? 'SQL_CALC_FOUND_ROWS' - : ''; - - // Fields - $fields = ! empty( $clauses['fields'] ) - ? $clauses['fields'] - : ''; - - // Join - $join = ! empty( $clauses['join'] ) - ? $clauses['join'] - : ''; - - // Where - $where = ! empty( $clauses['where'] ) - ? "WHERE {$clauses['where']}" - : ''; - - // Group by - $groupby = ! empty( $clauses['groupby'] ) - ? "GROUP BY {$clauses['groupby']}" - : ''; - - // Order by - $orderby = ! empty( $clauses['orderby'] ) - ? "ORDER BY {$clauses['orderby']}" - : ''; - - // Limits - $limits = ! empty( $clauses['limits'] ) - ? $clauses['limits'] - : ''; - - // Select & From - $table = $this->get_table_name(); - $select = "SELECT {$found_rows} {$fields}"; - $from = "FROM {$table} {$this->table_alias} {$join}"; - - // Put query into clauses array - $this->request_clauses['select'] = $select; - $this->request_clauses['from'] = $from; - $this->request_clauses['where'] = $where; - $this->request_clauses['groupby'] = $groupby; - $this->request_clauses['orderby'] = $orderby; - $this->request_clauses['limits'] = $limits; - } - - /** - * Set the request - * - * @since 1.0.0 - */ - protected function set_request() { - $filtered = array_filter( $this->request_clauses ); - $clauses = array_map( 'trim', $filtered ); - $this->request = implode( ' ', $clauses ); - } - - /** - * Set items by mapping them through the single item callback. - * - * @since 1.0.0 - * @param array $item_ids - */ - protected function set_items( $item_ids = array() ) { - - // Bail if counting, to avoid shaping items - if ( ! empty( $this->query_vars['count'] ) ) { - $this->items = $item_ids; - return; - } - - // Cast to integers - $item_ids = array_map( 'intval', $item_ids ); - - // Prime item caches - $this->prime_item_caches( $item_ids ); - - // Shape the items - $this->items = $this->shape_items( $item_ids ); - } - - /** - * Populates found_items and max_num_pages properties for the current query - * if the limit clause was used. - * - * @since 1.0.0 - * - * @param array $item_ids Optional array of item IDs - */ - protected function set_found_items( $item_ids = array() ) { - - // Items were not found - if ( empty( $item_ids ) ) { - return; - } - - // Default to number of item IDs - $this->found_items = count( (array) $item_ids ); - - // Count query - if ( ! empty( $this->query_vars['count'] ) ) { - - // Not grouped - if ( is_numeric( $item_ids ) && empty( $this->query_vars['groupby'] ) ) { - $this->found_items = intval( $item_ids ); - } - - // Not a count query - } elseif ( is_array( $item_ids ) && ( ! empty( $this->query_vars['number'] ) && empty( $this->query_vars['no_found_rows'] ) ) ) { - - /** - * Filters the query used to retrieve found item count. - * - * @since 1.0.0 - * - * @param string $found_items_query SQL query. Default 'SELECT FOUND_ROWS()'. - * @param object $item_query The object instance. - */ - $found_items_query = (string) apply_filters_ref_array( $this->apply_prefix( "found_{$this->item_name_plural}_query" ), array( 'SELECT FOUND_ROWS()', &$this ) ); - - // Maybe query for found items - if ( ! empty( $found_items_query ) ) { - $this->found_items = (int) $this->get_db()->get_var( $found_items_query ); - } - } - } - - /** Public Setters ********************************************************/ - - /** - * Set a query var, to both defaults and request arrays. - * - * This method is used to expose the private query_vars array to hooks, - * allowing them to manipulate query vars just-in-time. - * - * @since 1.0.0 - * - * @param string $key - * @param string $value - */ - public function set_query_var( $key = '', $value = '' ) { - $this->query_var_defaults[ $key ] = $value; - $this->query_vars[ $key ] = $value; - } - - /** - * Check whether a query variable strictly equals the unique default - * starting value. - * - * @since 1.1.0 - * @param string $key - * @return bool - */ - public function is_query_var_default( $key = '' ) { - return (bool) ( $this->query_vars[ $key ] === $this->query_var_default_value ); - } - - /** Private Getters *******************************************************/ - - /** - * Pass-through method to return a new Meta object. - * - * @since 1.0.0 - * - * @param array $args See Queries\Meta - * - * @return Queries\Meta - */ - private function get_meta_query( $args = array() ) { - return new Queries\Meta( $args ); - } - - /** - * Pass-through method to return a new Compare object. - * - * @since 1.0.0 - * - * @param array $args See Queries\Compare - * - * @return Queries\Compare - */ - private function get_compare_query( $args = array() ) { - return new Queries\Compare( $args ); - } - - /** - * Pass-through method to return a new Queries\Date object. - * - * @since 1.0.0 - * - * @param array $args See Queries\Date - * - * @return Queries\Date - */ - private function get_date_query( $args = array() ) { - return new Queries\Date( $args ); - } - - /** - * Return the current time as a UTC timestamp - * - * This is used by add_item() and update_item() - * - * @since 1.0.0 - * - * @return string - */ - protected function get_current_time() { - return gmdate( "Y-m-d\TH:i:s\Z" ); - } - - /** - * Return the literal table name (with prefix) from the database interface. - * - * @since 1.0.0 - * - * @return string - */ - protected function get_table_name() { - return $this->get_db()->{$this->table_name}; - } - - /** - * Return array of column names - * - * @since 1.0.0 - * - * @return array - */ - protected function get_column_names() { - return array_flip( $this->get_columns( array(), 'and', 'name' ) ); - } - - /** - * Return the primary database column name - * - * @since 1.0.0 - * - * @return string Default "id", Primary column name if not empty - */ - protected function get_primary_column_name() { - return $this->get_column_field( array( 'primary' => true ), 'name', 'id' ); - } - - /** - * Get a column from an array of arguments - * - * @since 1.0.0 - * - * @return mixed Column object, or false - */ - protected function get_column_field( $args = array(), $field = '', $default = false ) { - - // Get column - $column = $this->get_column_by( $args ); - - // Return field, or default - return isset( $column->{$field} ) - ? $column->{$field} - : $default; - } - - /** - * Get a column from an array of arguments - * - * @since 1.0.0 - * - * @return mixed Column object, or false - */ - protected function get_column_by( $args = array() ) { - - // Filter columns - $filter = $this->get_columns( $args ); - - // Return column or false - return ! empty( $filter ) - ? reset( $filter ) - : false; - } - - /** - * Get columns from an array of arguments - * - * @since 1.0.0 - */ - protected function get_columns( $args = array(), $operator = 'and', $field = false ) { - - // Filter columns - $filter = wp_filter_object_list( $this->columns, $args, $operator, $field ); - - // Return column or false - return ! empty( $filter ) - ? array_values( $filter ) - : array(); - } - - /** - * Get a single database row by any column and value, skipping cache. - * - * @since 1.0.0 - * - * @param string $column_name Name of database column - * @param string $column_value Value to query for - * @return object|false False if empty/error, Object if successful - */ - protected function get_item_raw( $column_name = '', $column_value = '' ) { - - // Bail if no name or value - if ( empty( $column_name ) || empty( $column_value ) ) { - return false; - } - - // Bail if values aren't query'able - if ( ! is_string( $column_name ) || ! is_scalar( $column_value ) ) { - return false; - } - - // Query database for row - $pattern = $this->get_column_field( array( 'name' => $column_name ), 'pattern', '%s' ); - $table = $this->get_table_name(); - $select = $this->get_db()->prepare( "SELECT * FROM {$table} WHERE {$column_name} = {$pattern}", $column_value ); - $result = $this->get_db()->get_row( $select ); - - // Bail on failure - if ( ! $this->is_success( $result ) ) { - return false; - } - - // Return row - return $result; - } - - /** - * Retrieves a list of items matching the query vars. - * - * @since 1.0.0 - * - * @return array|int List of items, or number of items when 'count' is passed as a query var. - */ - protected function get_items() { - - /** - * Fires before object items are retrieved. - * - * @since 1.0.0 - * - * @param Query &$this Current instance of Query, passed by reference. - */ - do_action_ref_array( $this->apply_prefix( "pre_get_{$this->item_name_plural}" ), array( &$this ) ); - - // Never limit, never update item/meta caches when counting - if ( ! empty( $this->query_vars['count'] ) ) { - $this->query_vars['number'] = false; - $this->query_vars['no_found_rows'] = true; - $this->query_vars['update_item_cache'] = false; - $this->query_vars['update_meta_cache'] = false; - } - - // Check the cache - $cache_key = $this->get_cache_key(); - $cache_value = $this->cache_get( $cache_key, $this->cache_group ); - - // No cache value - if ( false === $cache_value ) { - $item_ids = $this->get_item_ids(); - - // Set the number of found items - $this->set_found_items( $item_ids ); - - // Format the cached value - $cache_value = array( - 'item_ids' => $item_ids, - 'found_items' => intval( $this->found_items ), - ); - - // Add value to the cache - $this->cache_add( $cache_key, $cache_value, $this->cache_group ); - - // Value exists in cache - } else { - $item_ids = $cache_value['item_ids']; - $this->found_items = intval( $cache_value['found_items'] ); - } - - // Pagination - if ( ! empty( $this->found_items ) && ! empty( $this->query_vars['number'] ) ) { - $this->max_num_pages = ceil( $this->found_items / $this->query_vars['number'] ); - } - - // Cast to int if not grouping counts - if ( ! empty( $this->query_vars['count'] ) && empty( $this->query_vars['groupby'] ) ) { - $item_ids = intval( $item_ids ); - } - - // Set items from IDs - $this->set_items( $item_ids ); - - // Return array of items - return $this->items; - } - - /** - * Used internally to get a list of item IDs matching the query vars. - * - * @since 1.0.0 - * - * @return int|array A single count of item IDs if a count query. An array of item IDs if a full query. - */ - protected function get_item_ids() { - - // Setup primary column, and parse the where clause - $this->parse_where(); - - // Order & Order By - $order = $this->parse_order( $this->query_vars['order'] ); - $orderby = $this->get_order_by( $order ); - - // Limit & Offset - $limit = absint( $this->query_vars['number'] ); - $offset = absint( $this->query_vars['offset'] ); - - // Limits - if ( ! empty( $limit ) ) { - $limits = ! empty( $offset ) - ? "LIMIT {$offset}, {$limit}" - : "LIMIT {$limit}"; - } else { - $limits = ''; - } - - // Where & Join - $where = implode( ' AND ', $this->query_clauses['where'] ); - $join = implode( ', ', $this->query_clauses['join'] ); - - // Group by - $groupby = $this->parse_groupby( $this->query_vars['groupby'] ); - - // Fields - $fields = $this->parse_fields( $this->query_vars['fields'] ); - - // Setup the query array (compact() is too opaque here) - $query = array( - 'fields' => $fields, - 'join' => $join, - 'where' => $where, - 'orderby' => $orderby, - 'limits' => $limits, - 'groupby' => $groupby - ); - - /** - * Filters the item query clauses. - * - * @since 1.0.0 - * - * @param array $pieces A compacted array of item query clauses. - * @param Query &$this Current instance passed by reference. - */ - $clauses = (array) apply_filters_ref_array( $this->apply_prefix( "{$this->item_name_plural}_query_clauses" ), array( $query, &$this ) ); - - // Setup request - $this->set_request_clauses( $clauses ); - $this->set_request(); - - // Return count - if ( ! empty( $this->query_vars['count'] ) ) { - - // Get vars or results - $retval = empty( $this->query_vars['groupby'] ) - ? $this->get_db()->get_var( $this->request ) - : $this->get_db()->get_results( $this->request, ARRAY_A ); - - // Return vars or results - return $retval; - } - - // Get IDs - $item_ids = $this->get_db()->get_col( $this->request ); - - // Return parsed IDs - return wp_parse_id_list( $item_ids ); - } - - /** - * Get the ORDERBY clause. - * - * @since 1.0.0 - * - * @param string $order - * @return string - */ - protected function get_order_by( $order = '' ) { - - // Default orderby primary column - $orderby = "{$this->parse_orderby()} {$order}"; - - // Disable ORDER BY if counting, or: 'none', an empty array, or false. - if ( ! empty( $this->query_vars['count'] ) || in_array( $this->query_vars['orderby'], array( 'none', array(), false ), true ) ) { - $orderby = ''; - - // Ordering by something, so figure it out - } elseif ( ! empty( $this->query_vars['orderby'] ) ) { - - // Array of keys, or comma separated - $ordersby = is_array( $this->query_vars['orderby'] ) - ? $this->query_vars['orderby'] - : preg_split( '/[,\s]/', $this->query_vars['orderby'] ); - - $orderby_array = array(); - $possible_ins = $this->get_columns( array( 'in' => true ), 'and', 'name' ); - $sortables = $this->get_columns( array( 'sortable' => true ), 'and', 'name' ); - - // Loop through possible order by's - foreach ( $ordersby as $_key => $_value ) { - - // Skip if empty - if ( empty( $_value ) ) { - continue; - } - - // Key is numeric - if ( is_int( $_key ) ) { - $_orderby = $_value; - $_item = $order; - - // Key is string - } else { - $_orderby = $_key; - $_item = $_value; - } - - // Skip if not sortable - if ( ! in_array( $_value, $sortables, true ) ) { - continue; - } - - // Parse orderby - $parsed = $this->parse_orderby( $_orderby ); - - // Skip if empty - if ( empty( $parsed ) ) { - continue; - } - - // Set if __in - if ( in_array( $_orderby, $possible_ins, true ) ) { - $orderby_array[] = "{$parsed} {$order}"; - continue; - } - - // Append parsed orderby to array - $orderby_array[] = $parsed . ' ' . $this->parse_order( $_item ); - } - - // Only set if valid orderby - if ( ! empty( $orderby_array ) ) { - $orderby = implode( ', ', $orderby_array ); - } - } - - // Return parsed orderby - return $orderby; - } - - /** - * Used internally to generate an SQL string for searching across multiple columns. - * - * @since 1.0.0 - * - * @param string $string Search string. - * @param array $columns Columns to search. - * @return string Search SQL. - */ - protected function get_search_sql( $string = '', $columns = array() ) { - - // Array or String - $like = ( false !== strpos( $string, '*' ) ) - ? '%' . implode( '%', array_map( array( $this->get_db(), 'esc_like' ), explode( '*', $string ) ) ) . '%' - : '%' . $this->get_db()->esc_like( $string ) . '%'; - - // Default array - $searches = array(); - - // Build search SQL - foreach ( $columns as $column ) { - $searches[] = $this->get_db()->prepare( "{$column} LIKE %s", $like ); - } - - // Return the clause - return '(' . implode( ' OR ', $searches ) . ')'; - } - - /** Private Parsers *******************************************************/ - - /** - * Parses arguments passed to the item query with default query parameters. - * - * @since 1.0.0 - * - * @see Query::__construct() - * - * @param string|array $query Array or string of Query arguments. - */ - private function parse_query( $query = array() ) { - - // Setup the query_vars_original var - $this->query_var_originals = wp_parse_args( $query ); - - // Setup the query_vars parsed var - $this->query_vars = wp_parse_args( - $this->query_var_originals, - $this->query_var_defaults - ); - - /** - * Fires after the item query vars have been parsed. - * - * @since 1.0.0 - * - * @param Query &$this The Query instance (passed by reference). - */ - do_action_ref_array( $this->apply_prefix( "parse_{$this->item_name_plural}_query" ), array( &$this ) ); - } - - /** - * Parse the where clauses for all known columns - * - * @since 1.0.0 - */ - private function parse_where() { - - // Defaults - $where = $join = $searchable = $date_query = array(); - - // Loop through columns - foreach ( $this->columns as $column ) { - - // Maybe add name to searchable array - if ( true === $column->searchable ) { - $searchable[] = $column->name; - } - - // Literal column comparison - if ( ! $this->is_query_var_default( $column->name ) ) { - - // Array (unprepared) - if ( is_array( $this->query_vars[ $column->name ] ) ) { - $where_id = "'" . implode( "', '", $this->get_db()->_escape( $this->query_vars[ $column->name ] ) ) . "'"; - $statement = "{$this->table_alias}.{$column->name} IN ({$where_id})"; - - // Add to where array - $where[ $column->name ] = $statement; - - // Numeric/String/Float (prepared) - } else { - $pattern = $this->get_column_field( array( 'name' => $column->name ), 'pattern', '%s' ); - $where_id = $this->query_vars[ $column->name ]; - $statement = "{$this->table_alias}.{$column->name} = {$pattern}"; - - // Add to where array - $where[ $column->name ] = $this->get_db()->prepare( $statement, $where_id ); - } - } - - // __in - if ( true === $column->in ) { - $where_id = "{$column->name}__in"; - - // Parse item for an IN clause. - if ( isset( $this->query_vars[ $where_id ] ) && is_array( $this->query_vars[ $where_id ] ) ) { - - // Convert single item arrays to literal column comparisons - if ( 1 === count( $this->query_vars[ $where_id ] ) ) { - $column_value = reset( $this->query_vars[ $where_id ] ); - $statement = "{$this->table_alias}.{$column->name} = %s"; - - $where[ $column->name ] = $this->get_db()->prepare( $statement, $column_value ); - - // Implode - } else { - $where[ $where_id ] = "{$this->table_alias}.{$column->name} IN ( '" . implode( "', '", $this->get_db()->_escape( $this->query_vars[ $where_id ] ) ) . "' )"; - } - } - } - - // __not_in - if ( true === $column->not_in ) { - $where_id = "{$column->name}__not_in"; - - // Parse item for a NOT IN clause. - if ( isset( $this->query_vars[ $where_id ] ) && is_array( $this->query_vars[ $where_id ] ) ) { - - // Convert single item arrays to literal column comparisons - if ( 1 === count( $this->query_vars[ $where_id ] ) ) { - $column_value = reset( $this->query_vars[ $where_id ] ); - $statement = "{$this->table_alias}.{$column->name} != %s"; - - $where[ $column->name ] = $this->get_db()->prepare( $statement, $column_value ); - - // Implode - } else { - $where[ $where_id ] = "{$this->table_alias}.{$column->name} NOT IN ( '" . implode( "', '", $this->get_db()->_escape( $this->query_vars[ $where_id ] ) ) . "' )"; - } - } - } - - // date_query - if ( true === $column->date_query ) { - $where_id = "{$column->name}_query"; - $column_date = $this->query_vars[ $where_id ]; - - // Parse item - if ( ! empty( $column_date ) ) { - - // Default arguments - $defaults = array( - 'column' => "{$this->table_alias}.{$column->name}", - 'before' => $column_date, - 'inclusive' => true - ); - - // Default date query - if ( is_string( $column_date ) ) { - $date_query[] = $defaults; - - // Array query var - } elseif ( is_array( $column_date ) ) { - - // Auto-fill column if empty - if ( empty( $column_date['column'] ) ) { - $column_date['column'] = $defaults['column']; - } - - // Add clause to date query - $date_query[] = $column_date; - } - } - } - } - - // Maybe search if columns are searchable. - if ( ! empty( $searchable ) && strlen( $this->query_vars['search'] ) ) { - $search_columns = array(); - - // Intersect against known searchable columns - if ( ! empty( $this->query_vars['search_columns'] ) ) { - $search_columns = array_intersect( - $this->query_vars['search_columns'], - $searchable - ); - } - - // Default to all searchable columns - if ( empty( $search_columns ) ) { - $search_columns = $searchable; - } - - /** - * Filters the columns to search in a Query search. - * - * @since 1.0.0 - * - * @param array $search_columns Array of column names to be searched. - * @param string $search Text being searched. - * @param object $this The current Query instance. - */ - $search_columns = (array) apply_filters( $this->apply_prefix( "{$this->item_name_plural}_search_columns" ), $search_columns, $this->query_vars['search'], $this ); - - // Add search query clause - $where['search'] = $this->get_search_sql( $this->query_vars['search'], $search_columns ); - } - - // Get the primary column & table - $primary = $this->get_primary_column_name(); - $table = $this->get_meta_type(); - $and = '/^\s*AND\s*/'; - - // Maybe perform a meta query. - $meta_query = $this->query_vars['meta_query']; - if ( ! empty( $meta_query ) && is_array( $meta_query ) ) { - $this->meta_query = $this->get_meta_query( $meta_query ); - $clauses = $this->meta_query->get_sql( $table, $this->table_alias, $primary, $this ); - - // Not all objects have meta, so make sure this one exists - if ( false !== $clauses ) { - - // Set join - if ( ! empty( $clauses['join'] ) ) { - $join['meta_query'] = $clauses['join']; - } - - // Remove " AND " from meta_query query where clause - if ( ! empty( $clauses['where'] ) ) { - $where['meta_query'] = preg_replace( $and, '', $clauses['where'] ); - } - } - } - - // Maybe perform a compare query. - $compare_query = $this->query_vars['compare_query']; - if ( ! empty( $compare_query ) && is_array( $compare_query ) ) { - $this->compare_query = $this->get_compare_query( $compare_query ); - $clauses = $this->compare_query->get_sql( $table, $this->table_alias, $primary, $this ); - - // Not all objects can compare, so make sure this one exists - if ( false !== $clauses ) { - - // Set join - if ( ! empty( $clauses['join'] ) ) { - $join['compare_query'] = $clauses['join']; - } - - // Remove " AND " from query where clause. - $where['compare_query'] = preg_replace( $and, '', $clauses['where'] ); - } - } - - // Only do a date query with an array - $date_query = ! empty( $date_query ) - ? $date_query - : $this->query_vars['date_query']; - - // Maybe perform a date query - if ( ! empty( $date_query ) && is_array( $date_query ) ) { - $this->date_query = $this->get_date_query( $date_query ); - $clauses = $this->date_query->get_sql( $this->table_name, $this->table_alias, $primary, $this ); - - // Not all objects are dates, so make sure this one exists - if ( false !== $clauses ) { - - // Set join - if ( ! empty( $clauses['join'] ) ) { - $join['date_query'] = $clauses['join']; - } - - // Remove " AND " from query where clause. - $where['date_query'] = preg_replace( $and, '', $clauses['where'] ); - } - } - - // Set where and join clauses - $this->query_clauses['where'] = $where; - $this->query_clauses['join'] = $join; - } - - /** - * Parse which fields to query for - * - * @since 1.0.0 - * - * @param string $fields - * @param bool $alias - * @return string - */ - private function parse_fields( $fields = '', $alias = true ) { - - // Default return value - $primary = $this->get_primary_column_name(); - $retval = ( true === $alias ) - ? "{$this->table_alias}.{$primary}" - : $primary; - - // No fields - if ( empty( $fields ) && ! empty( $this->query_vars['count'] ) ) { - - // Possible fields to group by - $groupby_names = $this->parse_groupby( $this->query_vars['groupby'], $alias ); - $groupby_names = ! empty( $groupby_names ) - ? "{$groupby_names}" - : ''; - - // Group by or total count - $retval = ! empty( $groupby_names ) - ? "{$groupby_names}, COUNT(*) as count" - : 'COUNT(*)'; - } - - // Return fields (or COUNT) - return $retval; - } - - /** - * Parses and sanitizes the 'groupby' keys passed into the item query - * - * @since 1.0.0 - * - * @param string $groupby - * @param bool $alias - * @return string - */ - private function parse_groupby( $groupby = '', $alias = true ) { - - // Bail if empty - if ( empty( $groupby ) ) { - return ''; - } - - // Sanitize groupby columns - $groupby = (array) array_map( 'sanitize_key', (array) $groupby ); - - // Re'flip column names back around - $columns = array_flip( $this->get_column_names() ); - - // Get the intersection of allowed column names to groupby columns - $intersect = array_intersect( $columns, $groupby ); - - // Bail if invalid column - if ( empty( $intersect ) ) { - return ''; - } - - // Default return value - $retval = array(); - - // Maybe prepend table alias to key - foreach ( $intersect as $key ) { - $retval[] = ( true === $alias ) - ? "{$this->table_alias}.{$key}" - : $key; - } - - // Separate sanitized columns - return implode( ',', array_values( $retval ) ); - } - - /** - * Parses and sanitizes 'orderby' keys passed to the item query. - * - * @since 1.0.0 - * - * @param string $orderby Field for the items to be ordered by. - * @return string|false Value to used in the ORDER clause. False otherwise. - */ - private function parse_orderby( $orderby = 'id' ) { - - // Default value - $parsed = "{$this->table_alias}.{$this->get_primary_column_name()}"; - - // __in - if ( false !== strstr( $orderby, '__in' ) ) { - $column_name = str_replace( '__in', '', $orderby ); - $column = $this->get_column_by( array( 'name' => $column_name ) ); - $item_in = $column->is_numeric() - ? implode( ',', array_map( 'absint', $this->query_vars[ $orderby ] ) ) - : implode( ',', $this->query_vars[ $orderby ] ); - - $parsed = "FIELD( {$this->table_alias}.{$column->name}, {$item_in} )"; - - // Specific column - } else { - - // Orderby is a literal, sortable column name - $sortables = $this->get_columns( array( 'sortable' => true ), 'and', 'name' ); - if ( in_array( $orderby, $sortables, true ) ) { - $parsed = "{$this->table_alias}.{$orderby}"; - } - } - - // Return parsed value - return $parsed; - } - - /** - * Parses an 'order' query variable and cast it to 'ASC' or 'DESC' as necessary. - * - * @since 1.0.0 - * - * @param string $order The 'order' query variable. - * @return string The sanitized 'order' query variable. - */ - private function parse_order( $order = '' ) { - - // Bail if malformed - if ( empty( $order ) || ! is_string( $order ) ) { - return 'DESC'; - } - - // Ascending or Descending - return ( 'ASC' === strtoupper( $order ) ) - ? 'ASC' - : 'DESC'; - } - - /** Private Shapers *******************************************************/ - - /** - * Shape items into their most relevant objects. - * - * This will try to use item_shape, but will fallback to a private - * method for querying and caching items. - * - * If using the `fields` parameter, results will have unique shapes based on - * exactly what was requested. - * - * @since 1.0.0 - * - * @param array $items - * @return array - */ - private function shape_items( $items = array() ) { - - // Force to stdClass if querying for fields - if ( ! empty( $this->query_vars['fields'] ) ) { - $this->item_shape = 'stdClass'; - } - - // Default return value - $retval = array(); - - // Use foreach because it's faster than array_map() - if ( ! empty( $items ) ) { - foreach ( $items as $item ) { - $retval[] = $this->get_item( $item ); - } - } - - /** - * Filters the object query results. - * - * Looks like `edd_get_customers` - * - * @since 1.0.0 - * - * @param array $retval An array of items. - * @param object &$this Current instance of Query, passed by reference. - */ - $retval = (array) apply_filters_ref_array( $this->apply_prefix( "the_{$this->item_name_plural}" ), array( $retval, &$this ) ); - - // Return filtered results - return ! empty( $this->query_vars['fields'] ) - ? $this->get_item_fields( $retval ) - : $retval; - } - - /** - * Get specific item fields based on query_vars['fields']. - * - * @since 1.0.0 - * - * @param array $items - * @return array - */ - private function get_item_fields( $items = array() ) { - - // Get the primary column - $primary = $this->get_primary_column_name(); - $fields = $this->query_vars['fields']; - - // Strings need to be single columns - if ( is_string( $fields ) ) { - $field = sanitize_key( $fields ); - $items = ( 'ids' === $fields ) - ? wp_list_pluck( $items, $primary ) - : wp_list_pluck( $items, $field, $primary ); - - // Arrays could be anything - } elseif ( is_array( $fields ) ) { - $new_items = array(); - $fields = array_flip( $fields ); - - // Loop through items and pluck out the fields - foreach ( $items as $item_id => $item ) { - $new_items[ $item_id ] = (object) array_intersect_key( (array) $item, $fields ); - } - - // Set the items and unset the new items - $items = $new_items; - unset( $new_items ); - } - - // Return the item, possibly reduced - return $items; - } - - /** - * Shape an item ID from an object, array, or numeric value - * - * @since 1.0.0 - * - * @param mixed $item - * @return int - */ - private function shape_item_id( $item = 0 ) { - - // Default return value - $retval = 0; - - // Get the primary column name - $primary = $this->get_primary_column_name(); - - // Numeric item ID - if ( is_numeric( $item ) ) { - $retval = $item; - - // Object item - } elseif ( is_object( $item ) && isset( $item->{$primary} ) ) { - $retval = $item->{$primary}; - - // Array item - } elseif ( is_array( $item ) && isset( $item[ $primary ] ) ) { - $retval = $item[ $primary ]; - } - - // Return the item ID - return absint( $retval ); - } - - /** Queries ***************************************************************/ - - /** - * Get a single database row by the primary column ID, possibly from cache. - * - * Accepts an integer, object, or array, and attempts to get the ID from it, - * then attempts to retrieve that item fresh from the database or cache. - * - * @since 1.0.0 - * - * @param int|array|object $item_id The ID of the item - * @return object|false False if empty/error, Object if successful - */ - public function get_item( $item_id = 0 ) { - - // Shape the item ID - $item_id = $this->shape_item_id( $item_id ); - - // Bail if no item to get by - if ( empty( $item_id ) ) { - return false; - } - - // Get the primary column name - $column_name = $this->get_primary_column_name(); - - // Get item by ID - return $this->get_item_by( $column_name, $item_id ); - } - - /** - * Get a single database row by any column and value, possibly from cache. - * - * Take care to only use this method on columns with unique values, - * preferably with a cache group for that column. See: get_item(). - * - * @since 1.0.0 - * - * @param string $column_name Name of database column - * @param int|string $column_value Value to query for - * @return object|false False if empty/error, Object if successful - */ - public function get_item_by( $column_name = '', $column_value = '' ) { - - // Default return value - $retval = false; - - // Bail if no key or value - if ( empty( $column_name ) || empty( $column_value ) ) { - return $retval; - } - - // Bail if name is not a string - if ( ! is_string( $column_name ) ) { - return $retval; - } - - // Bail if value is not scalar (null values also not allowed) - if ( ! is_scalar( $column_value ) ) { - return $retval; - } - - // Get column names - $columns = $this->get_column_names(); - - // Bail if column does not exist - if ( ! isset( $columns[ $column_name ] ) ) { - return $retval; - } - - // Cache groups - $groups = $this->get_cache_groups(); - - // Check cache - if ( ! empty( $groups[ $column_name ] ) ) { - $retval = $this->cache_get( $column_value, $groups[ $column_name ] ); - } - - // Item not cached - if ( false === $retval ) { - - // Try to get item directly from DB - $retval = $this->get_item_raw( $column_name, $column_value ); - - // Bail on failure - if ( ! $this->is_success( $retval ) ) { - return false; - } - - // Cache - $this->update_item_cache( $retval ); - } - - // Reduce the item - $retval = $this->reduce_item( 'select', $retval ); - - // Return result - return $this->shape_item( $retval ); - } - - /** - * Add an item to the database - * - * @since 1.0.0 - * - * @param array $data - * @return false|int Returns the item ID on success; false on failure. - */ - public function add_item( $data = array() ) { - - // Get primary column - $primary = $this->get_primary_column_name(); - - // If data includes primary column, check if item already exists - if ( ! empty( $data[ $primary ] ) ) { - - // Shape the primary item ID - $item_id = $this->shape_item_id( $data[ $primary ] ); - - // Get item by ID (from database, not cache) - $item = $this->get_item_raw( $primary, $item_id ); - - // Bail if item already exists - if ( ! empty( $item ) ) { - return false; - } - - // Set data primary ID to newly shaped ID - $data[ $primary ] = $item_id; - } - - // Get default values for item (from columns) - $item = $this->default_item(); - - // Unset the primary key if not part of data array (auto-incremented) - if ( empty( $data[ $primary ] ) ) { - unset( $item[ $primary ] ); - } - - // Cut out non-keys for meta - $columns = $this->get_column_names(); - $data = array_merge( $item, $data ); - $meta = array_diff_key( $data, $columns ); - $save = array_intersect_key( $data, $columns ); - - // Get the current time (maybe used by created/modified) - $time = $this->get_current_time(); - - // If date-created exists, but is empty or default, use the current time - $created = $this->get_column_by( array( 'created' => true ) ); - if ( ! empty( $created ) && ( empty( $save[ $created->name ] ) || ( $save[ $created->name ] === $created->default ) ) ) { - $save[ $created->name ] = $time; - } - - // If date-modified exists, but is empty or default, use the current time - $modified = $this->get_column_by( array( 'modified' => true ) ); - if ( ! empty( $modified ) && ( empty( $save[ $modified->name ] ) || ( $save[ $modified->name ] === $modified->default ) ) ) { - $save[ $modified->name ] = $time; - } - - // Try to add - $table = $this->get_table_name(); - $reduce = $this->reduce_item( 'insert', $save ); - $save = $this->validate_item( $reduce ); - $result = ! empty( $save ) - ? $this->get_db()->insert( $table, $save ) - : false; - - // Bail on failure - if ( ! $this->is_success( $result ) ) { - return false; - } - - // Get the new item ID - $item_id = $this->get_db()->insert_id; - - // Maybe save meta keys - if ( ! empty( $meta ) ) { - $this->save_extra_item_meta( $item_id, $meta ); - } - - // Use get item to prime caches - $this->update_item_cache( $item_id ); - - // Transition item data - $this->transition_item( $save, $item_id ); - - /** - * Adds a hook for a successfully added item. - * Custom for EDD. - * - * @since 3.1.1.4 - * @param int $item_id The item id. - * @param array $data The array of data for the update. - */ - do_action( $this->apply_prefix( "{$this->item_name}_added" ), $item_id, $data ); - - // Return result - return $item_id; - } - - /** - * Update an item in the database - * - * @since 1.0.0 - * - * @param int $item_id - * @param array $data - * @return bool - */ - public function update_item( $item_id = 0, $data = array() ) { - - // Bail if no item ID - $item_id = $this->shape_item_id( $item_id ); - if ( empty( $item_id ) ) { - return false; - } - - // Get primary column - $primary = $this->get_primary_column_name(); - - // Get item to update (from database, not cache) - $item_raw = $this->get_item_raw( $primary, $item_id ); - - // Bail if item does not exist to update - if ( empty( $item_raw ) ) { - return false; - } - - // Cast as an array for easier manipulation - $item = (array) $item_raw; - - // Unset the primary key from data to parse - unset( $data[ $primary ] ); - - // Splice new data into item, and cut out non-keys for meta - $columns = $this->get_column_names(); - $data = array_merge( $item, $data ); - $meta = array_diff_key( $data, $columns ); - $save = array_intersect_key( $data, $columns ); - - // Maybe save meta keys - if ( ! empty( $meta ) ) { - $this->save_extra_item_meta( $item_id, $meta ); - } - - // Bail if no change - if ( (array) $save === (array) $item ) { - return true; - } - - // Unset the primary key from data to save - unset( $save[ $primary ] ); - - // If date-modified is empty, use the current time - $modified = $this->get_column_by( array( 'modified' => true ) ); - if ( ! empty( $modified ) ) { - $save[ $modified->name ] = $this->get_current_time(); - } - - // Try to update - $where = array( $primary => $item_id ); - $table = $this->get_table_name(); - $reduce = $this->reduce_item( 'update', $save ); - $save = $this->validate_item( $reduce ); - $result = ! empty( $save ) - ? $this->get_db()->update( $table, $save, $where ) - : false; - - // Bail on failure - if ( ! $this->is_success( $result ) ) { - return false; - } - - // Use get item to prime caches - $this->update_item_cache( $item_id ); - - // Transition item data - $this->transition_item( $save, $item ); - - /** - * Adds a hook for a successfully updated item. - * Custom for EDD. - * - * @since 3.1.1.4 - * @param int $item_id The item id. - * @param array $data The array of data for the update. - * @param object $item_raw The original item. - */ - do_action( $this->apply_prefix( "{$this->item_name}_updated" ), $item_id, $data, $item_raw ); - - // Return result - return $result; - } - - /** - * Delete an item from the database - * - * @since 1.0.0 - * - * @param int $item_id - * @return bool - */ - public function delete_item( $item_id = 0 ) { - - // Bail if no item ID - $item_id = $this->shape_item_id( $item_id ); - if ( empty( $item_id ) ) { - return false; - } - - // Get vars - $primary = $this->get_primary_column_name(); - - // Get item (before it's deleted) - $item = $this->get_item_raw( $primary, $item_id ); - - // Bail if item does not exist to delete - if ( empty( $item ) ) { - return false; - } - - // Attempt to reduce this item - $item = $this->reduce_item( 'delete', $item ); - - // Bail if item was reduced to nothing - if ( empty( $item ) ) { - return false; - } - - // Try to delete - $table = $this->get_table_name(); - $where = array( $primary => $item_id ); - $result = $this->get_db()->delete( $table, $where ); - - // Bail on failure - if ( ! $this->is_success( $result ) ) { - return false; - } - - // Clean caches on successful delete - $this->delete_all_item_meta( $item_id ); - $this->clean_item_cache( $item ); - - /** - * Adds a hook for a successfully deleted item. - * Custom for EDD. - * - * @since 3.1.1.4 - * @param int $item_id The item id. - */ - do_action( $this->apply_prefix( "{$this->item_name}_deleted" ), $item_id ); - - // Return result - return $result; - } - - /** - * Filter an item before it is inserted of updated in the database. - * - * This method is public to allow subclasses to perform JIT manipulation - * of the parameters passed into it. - * - * @since 1.0.0 - * - * @param array $item - * @return array - */ - public function filter_item( $item = array() ) { - return (array) apply_filters_ref_array( $this->apply_prefix( "filter_{$this->item_name}_item" ), array( $item, &$this ) ); - } - - /** - * Shape an item from the database into the type of object it always wanted - * to be when it grew up. - * - * @since 1.0.0 - * - * @param mixed ID of item, or row from database - * @return mixed False on error, Object of single-object class type on success - */ - private function shape_item( $item = 0 ) { - - // Get the item from an ID - if ( is_numeric( $item ) ) { - $item = $this->get_item( $item ); - } - - // Return the item if it's already shaped - if ( $item instanceof $this->item_shape ) { - return $item; - } - - // Shape the item as needed - $item = ! empty( $this->item_shape ) - ? new $this->item_shape( $item ) - : (object) $item; - - // Return the item object - return $item; - } - - /** - * Validate an item before it is updated in or added to the database. - * - * @since 1.0.0 - * - * @param array $item - * @return array|false False on error, Array of validated values on success - */ - private function validate_item( $item = array() ) { - - // Bail if item is empty or not an array - if ( empty( $item ) || ! is_array( $item ) ) { - return $item; - } - - // Loop through item attributes - foreach ( $item as $key => $value ) { - - // Strip slashes from all strings - if ( is_string( $value ) ) { - $value = stripslashes( $value ); - } - - // Get column - $column = $this->get_column_by( array( 'name' => $key ) ); - - // Null value is special for all item keys - if ( is_null( $value ) ) { - - // Bail if null is not allowed - if ( false === $column->allow_null ) { - return false; - } - - // Attempt to validate - } elseif ( ! empty( $column->validate ) && is_callable( $column->validate ) ) { - $validated = call_user_func( $column->validate, $value ); - - // Bail if error - if ( is_wp_error( $validated ) ) { - return false; - } - - // Update the value - $item[ $key ] = $validated; - - /** - * Fallback to using the raw value. - * - * Note: This may change at a later date, so do not rely on this. - * Please always validate all data. - */ - } else { - $item[ $key ] = $value; - } - } - - // Return the validated item - return $this->filter_item( $item ); - } - - /** - * Reduce an item down to the keys and values the current user has the - * appropriate capabilities to select|insert|update|delete. - * - * Note that internally, this method works with both arrays and objects of - * any type, and also resets the key values. It looks weird, but is - * currently by design to protect the integrity of the return value. - * - * @since 1.0.0 - * - * @param string $method select|insert|update|delete - * @param array|object $item Object|Array of keys/values to reduce - * - * @return mixed Object|Array without keys the current user does not have caps for - */ - private function reduce_item( $method = 'update', $item = array() ) { - - // Bail if item is empty - if ( empty( $item ) ) { - return $item; - } - - // Loop through item attributes - foreach ( $item as $key => $value ) { - - // Get callback for column - $caps = $this->get_column_field( array( 'name' => $key ), 'caps' ); - - // Unset if not explicitly allowed - if ( empty( $caps[ $method ] ) || ! current_user_can( $caps[ $method ] ) ) { - if ( is_array( $item ) ) { - unset( $item[ $key ] ); - } elseif ( is_object( $item ) ) { - $item->{$key} = null; - } - - // Set if explicitly allowed - } elseif ( is_array( $item ) ) { - $item[ $key ] = $value; - } elseif ( is_object( $item ) ) { - $item->{$key} = $value; - } - } - - // Return the reduced item - return $item; - } - - /** - * Return an item comprised of all default values - * - * This is used by `add_item()` to populate known default values, to ensure - * new item data is always what we expect it to be. - * - * @since 1.0.0 - * - * @return array - */ - private function default_item() { - - // Default return value - $retval = array(); - - // Get column names and defaults - $names = $this->get_columns( array(), 'and', 'name' ); - $defaults = $this->get_columns( array(), 'and', 'default' ); - - // Put together an item using default values - foreach ( $names as $key => $name ) { - $retval[ $name ] = $defaults[ $key ]; - } - - // Return - return $retval; - } - - /** - * Transition an item when adding or updating. - * - * This method takes the data being saved, looks for any columns that are - * known to transition between values, and fires actions on them. - * - * @since 1.0.0 - * - * @param array $item - * @return array - */ - private function transition_item( $new_data = array(), $old_data = array() ) { - - // Look for transition columns - $columns = $this->get_columns( array( 'transition' => true ), 'and', 'name' ); - - // Bail if no columns to transition - if ( empty( $columns ) ) { - return; - } - - // Get the item ID - $item_id = $this->shape_item_id( $old_data ); - - // Bail if item ID cannot be retrieved - if ( empty( $item_id ) ) { - return; - } - - // If no old value(s), it's new - if ( ! is_array( $old_data ) ) { - $old_data = $new_data; - - // Set all old values to "new" - foreach ( $old_data as $key => $value ) { - $value = 'new'; - $old_data[ $key ] = $value; - } - } - - // Compare - $keys = array_flip( $columns ); - $new = array_intersect_key( $new_data, $keys ); - $old = array_intersect_key( $old_data, $keys ); - - // Get the difference - $diff = array_diff( $new, $old ); - - // Bail if nothing is changing - if ( empty( $diff ) ) { - return; - } - - // Do the actions - foreach ( $diff as $key => $value ) { - $old_value = $old_data[ $key ]; - $new_value = $new_data[ $key ]; - $key_action = $this->apply_prefix( "transition_{$this->item_name}_{$key}" ); - - /** - * Fires after an object value has transitioned. - * - * @since 1.0.0 - * - * @param mixed $old_value The value being transitioned FROM. - * @param mixed $new_value The value being transitioned TO. - * @param int $item_id The ID of the item that is transitioning. - */ - do_action( $key_action, $old_value, $new_value, $item_id ); - } - } - - /** Meta ******************************************************************/ - - /** - * Add meta data to an item - * - * @since 1.0.0 - * - * @param int $item_id - * @param string $meta_key - * @param string $meta_value - * @param string $unique - * @return int|false The meta ID on success, false on failure. - */ - protected function add_item_meta( $item_id = 0, $meta_key = '', $meta_value = '', $unique = false ) { - - // Bail if no meta was returned - $item_id = $this->shape_item_id( $item_id ); - if ( empty( $item_id ) || empty( $meta_key ) ) { - return false; - } - - // Bail if no meta table exists - if ( false === $this->get_meta_table_name() ) { - return false; - } - - // Return results of get meta data - return add_metadata( $table, $item_id, $meta_key, $meta_value, $unique ); - } - - /** - * Get meta data for an item - * - * @since 1.0.0 - * - * @param int $item_id - * @param string $meta_key - * @param bool $single - * @return mixed Single metadata value, or array of values - */ - protected function get_item_meta( $item_id = 0, $meta_key = '', $single = false ) { - - // Bail if no meta was returned - $item_id = $this->shape_item_id( $item_id ); - if ( empty( $item_id ) || empty( $meta_key ) ) { - return false; - } - - // Bail if no meta table exists - if ( false === $this->get_meta_table_name() ) { - return false; - } - - // Get meta type - $meta_type = $this->get_meta_type(); - - // Return results of getting meta data - return get_metadata( $meta_type, $item_id, $meta_key, $single ); - } - - /** - * Update meta data for an item - * - * @since 1.0.0 - * - * @param int $item_id - * @param string $meta_key - * @param string $meta_value - * @param string $prev_value - * @return bool True on successful update, false on failure. - */ - protected function update_item_meta( $item_id = 0, $meta_key = '', $meta_value = '', $prev_value = '' ) { - - // Bail if no meta was returned - $item_id = $this->shape_item_id( $item_id ); - if ( empty( $item_id ) || empty( $meta_key ) ) { - return false; - } - - // Bail if no meta table exists - if ( false === $this->get_meta_table_name() ) { - return false; - } - - // Get meta type - $meta_type = $this->get_meta_type(); - - // Return results of updating meta data - return update_metadata( $meta_type, $item_id, $meta_key, $meta_value, $prev_value ); - } - - /** - * Delete meta data for an item - * - * @since 1.0.0 - * - * @param int $item_id - * @param string $meta_key - * @param string $meta_value - * @param string $delete_all - * @return bool True on successful delete, false on failure. - */ - protected function delete_item_meta( $item_id = 0, $meta_key = '', $meta_value = '', $delete_all = false ) { - - // Bail if no meta was returned - $item_id = $this->shape_item_id( $item_id ); - if ( empty( $item_id ) || empty( $meta_key ) ) { - return false; - } - - // Bail if no meta table exists - if ( false === $this->get_meta_table_name() ) { - return false; - } - - // Get meta type - $meta_type = $this->get_meta_type(); - - // Return results of deleting meta data - return delete_metadata( $meta_type, $item_id, $meta_key, $meta_value, $delete_all ); - } - - /** - * Get registered meta data keys - * - * @since 1.0.0 - * - * @param string $object_subtype The sub-type of meta keys - * - * @return array - */ - private function get_registered_meta_keys( $object_subtype = '' ) { - - // Get the object type - $object_type = $this->get_meta_type(); - - // Return the keys - return get_registered_meta_keys( $object_type, $object_subtype ); - } - - /** - * Maybe update meta values on item update/save - * - * @since 1.0.0 - * - * @param array $meta - */ - private function save_extra_item_meta( $item_id = 0, $meta = array() ) { - - // Bail if there is no bulk meta to save - $item_id = $this->shape_item_id( $item_id ); - if ( empty( $item_id ) || empty( $meta ) ) { - return; - } - - // Bail if no meta table exists - if ( false === $this->get_meta_table_name() ) { - return; - } - - // Only save registered keys - $keys = $this->get_registered_meta_keys(); - $meta = array_intersect_key( $meta, $keys ); - - // Bail if no registered meta keys - if ( empty( $meta ) ) { - return; - } - - // Save or delete meta data - foreach ( $meta as $key => $value ) { - ! empty( $value ) - ? $this->update_item_meta( $item_id, $key, $value ) - : $this->delete_item_meta( $item_id, $key ); - } - } - - /** - * Delete all meta data for an item - * - * @since 1.0.0 - * - * @param int $item_id - */ - private function delete_all_item_meta( $item_id = 0 ) { - - // Bail if no meta was returned - $item_id = $this->shape_item_id( $item_id ); - if ( empty( $item_id ) ) { - return; - } - - // Get the meta table name - $table = $this->get_meta_table_name(); - - // Bail if no meta table exists - if ( empty( $table ) ) { - return; - } - - // Guess the item ID column for the meta table - $primary_id = $this->get_primary_column_name(); - $item_id_column = $this->apply_prefix( "{$this->item_name}_{$primary_id}" ); - - // Get meta IDs - $query = "SELECT meta_id FROM {$table} WHERE {$item_id_column} = %d"; - $prepared = $this->get_db()->prepare( $query, $item_id ); - $meta_ids = $this->get_db()->get_col( $prepared ); - - // Bail if no meta IDs to delete - if ( empty( $meta_ids ) ) { - return; - } - - // Get the meta type - $meta_type = $this->get_meta_type(); - - // Delete all meta data for this item ID - foreach ( $meta_ids as $mid ) { - delete_metadata_by_mid( $meta_type, $mid ); - } - } - - /** - * Get the meta table for this query - * - * Forked from WordPress\_get_meta_table() so it can be more accurately - * predicted in a future iteration and default to returning false. - * - * @since 1.0.0 - * - * @return mixed Table name if exists, False if not - */ - private function get_meta_table_name() { - - // Get the meta-type - $type = $this->get_meta_type(); - - // Append "meta" to end of meta-type - $table_name = "{$type}meta"; - - // Variable'ize the database interface, to use inside empty() - $db = $this->get_db(); - - // If not empty, return table name - if ( ! empty( $db->{$table_name} ) ) { - return $db->{$table_name}; - } - - // Default return false - return false; - } - - /** - * Get the meta type for this query - * - * This method exists to reduce some duplication for now. Future iterations - * will likely use Column::relationships to - * - * @since 1.1.0 - * - * @return string - */ - private function get_meta_type() { - return $this->apply_prefix( $this->item_name ); - } - - /** Cache *****************************************************************/ - - /** - * Get cache key from query_vars and query_var_defaults. - * - * @since 1.0.0 - * - * @return string - */ - private function get_cache_key( $group = '' ) { - - // Slice query vars - $slice = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ); - - // Unset `fields` so it does not effect the cache key - unset( $slice['fields'] ); - - // Setup key & last_changed - $key = md5( serialize( $slice ) ); - $last_changed = $this->get_last_changed_cache( $group ); - - // Concatenate and return cache key - return "get_{$this->item_name_plural}:{$key}:{$last_changed}"; - } - - /** - * Get the cache group, or fallback to the primary one. - * - * @since 1.0.0 - * - * @param string $group - * @return string - */ - private function get_cache_group( $group = '' ) { - - // Get the primary column - $primary = $this->get_primary_column_name(); - - // Default return value - $retval = $this->cache_group; - - // Only allow non-primary groups - if ( ! empty( $group ) && ( $group !== $primary ) ) { - $retval = $group; - } - - // Return the group - return $retval; - } - - /** - * Get array of which database columns have uniquely cached groups - * - * @since 1.0.0 - * - * @return array - */ - private function get_cache_groups() { - - // Return value - $cache_groups = array(); - - // Get cache groups - $groups = $this->get_columns( array( 'cache_key' => true ), 'and', 'name' ); - - if ( ! empty( $groups ) ) { - - // Get the primary column - $primary = $this->get_primary_column_name(); - - // Setup return values - foreach ( $groups as $name ) { - if ( $primary !== $name ) { - $cache_groups[ $name ] = "{$this->cache_group}-by-{$name}"; - } else { - $cache_groups[ $name ] = $this->cache_group; - } - } - } - - // Return cache groups array - return $cache_groups; - } - - /** - * Maybe prime item & item-meta caches by querying 1 time for all un-cached - * items. - * - * Accepts a single ID, or an array of IDs. - * - * The reason this accepts only IDs is because it gets called immediately - * after an item is inserted in the database, but before items have been - * "shaped" into proper objects, so object properties may not be set yet. - * - * @since 1.0.0 - * - * @param array $item_ids - * @param bool $force - * - * @return bool False if empty - */ - private function prime_item_caches( $item_ids = array(), $force = false ) { - - // Bail if no items to cache - if ( empty( $item_ids ) ) { - return false; - } - - // Accepts single values, so cast to array - $item_ids = (array) $item_ids; - - // Update item caches - if ( ! empty( $force ) || ! empty( $this->query_vars['update_item_cache'] ) ) { - - // Look for non-cached IDs - $ids = $this->get_non_cached_ids( $item_ids, $this->cache_group ); - - // Bail if IDs are cached - if ( empty( $ids ) ) { - return false; - } - - // Query - $table = $this->get_table_name(); - $primary = $this->get_primary_column_name(); - $query = "SELECT * FROM {$table} WHERE {$primary} IN (%s)"; - $ids = join( ',', array_map( 'absint', $ids ) ); - $prepare = sprintf( $query, $ids ); - $results = $this->get_db()->get_results( $prepare ); - - // Update item caches - $this->update_item_cache( $results ); - } - - // Update meta data caches - if ( ! empty( $this->query_vars['update_meta_cache'] ) ) { - $singular = rtrim( $this->table_name, 's' ); // sic - update_meta_cache( $singular, $item_ids ); - } - } - - /** - * Update the cache for an item. Does not update item-meta cache. - * - * Accepts a single object, or an array of objects. - * - * The reason this does not accept ID's is because this gets called - * after an item is already updated in the database, so we want to avoid - * querying for it again. It's just safer this way. - * - * @since 1.0.0 - * - * @param array $items - */ - private function update_item_cache( $items = array() ) { - - // Maybe query for single item - if ( is_numeric( $items ) ) { - $primary = $this->get_primary_column_name(); - $items = $this->get_item_raw( $primary, $items ); - } - - // Bail if no items to cache - if ( empty( $items ) ) { - return false; - } - - // Make sure items are an array (without casting objects to arrays) - if ( ! is_array( $items ) ) { - $items = array( $items ); - } - - // Get cache groups - $groups = $this->get_cache_groups(); - - // Loop through all items and cache them - foreach ( $items as $item ) { - - // Skip if item is not an object - if ( ! is_object( $item ) ) { - continue; - } - - // Loop through groups and set cache - if ( ! empty( $groups ) ) { - foreach ( $groups as $key => $group ) { - $this->cache_set( $item->{$key}, $item, $group ); - } - } - } - - // Update last changed - $this->update_last_changed_cache(); - } - - /** - * Clean the cache for an item. Does not clean item-meta. - * - * Accepts a single object, or an array of objects. - * - * The reason this does not accept ID's is because this gets called - * after an item is already deleted from the database, so it cannot be - * queried and may not exist in the cache. It's just safer this way. - * - * @since 1.0.0 - * - * @param mixed $items Single object item, or Array of object items - * - * @return bool - */ - private function clean_item_cache( $items = array() ) { - - // Bail if no items to clean - if ( empty( $items ) ) { - return false; - } - - // Make sure items are an array - if ( ! is_array( $items ) ) { - $items = array( $items ); - } - - // Get all cache groups - $groups = $this->get_cache_groups(); - - // Loop through all items and clean them - foreach ( $items as $item ) { - - // Skip if item is not an object - if ( ! is_object( $item ) ) { - continue; - } - - // Loop through groups and delete cache - if ( ! empty( $groups ) ) { - foreach ( $groups as $key => $group ) { - $this->cache_delete( $item->{$key}, $group ); - } - } - } - - // Update last changed - $this->update_last_changed_cache(); - } - - /** - * Update the last_changed key for the cache group - * - * @since 1.0.0 - */ - private function update_last_changed_cache( $group = '' ) { - - // Fallback to microtime - if ( empty( $this->last_changed ) ) { - $this->set_last_changed(); - } - - // Set the last changed time for this cache group - $this->cache_set( 'last_changed', $this->last_changed, $group ); - - // Return the last changed time - return $this->last_changed; - } - - /** - * Get the last_changed key for a cache group - * - * @since 1.0.0 - * - * @param string $group Cache group. Defaults to $this->cache_group - * - * @return int The last time a cache group was changed - */ - private function get_last_changed_cache( $group = '' ) { - - // Get the last changed cache value - $last_changed = $this->cache_get( 'last_changed', $group ); - - // Maybe update the last changed value - if ( false === $last_changed ) { - $last_changed = $this->update_last_changed_cache( $group ); - } - - // Return the last changed value for the cache group - return $last_changed; - } - - /** - * Get array of non-cached item IDs. - * - * @since 1.0.0 - * - * @param array $item_ids Array of item IDs - * @param string $group Cache group. Defaults to $this->cache_group - * - * @return array - */ - private function get_non_cached_ids( $item_ids = array(), $group = '' ) { - $retval = array(); - - // Bail if no item IDs - if ( empty( $item_ids ) ) { - return $retval; - } - - // Loop through item IDs - foreach ( $item_ids as $id ) { - $id = $this->shape_item_id( $id ); - - if ( false === $this->cache_get( $id, $group ) ) { - $retval[] = $id; - } - } - - // Return array of IDs - return $retval; - } - - /** - * Add a cache value for a key and group. - * - * @since 1.0.0 - * - * @param string $key Cache key. - * @param mixed $value Cache value. - * @param string $group Cache group. Defaults to $this->cache_group - * @param int $expire Expiration. - */ - private function cache_add( $key = '', $value = '', $group = '', $expire = 0 ) { - - // Bail if cache invalidation is suspended - if ( wp_suspend_cache_addition() ) { - return; - } - - // Bail if no cache key - if ( empty( $key ) ) { - return; - } - - // Get the cache group - $group = $this->get_cache_group( $group ); - - // Add to the cache - wp_cache_add( $key, $value, $group, $expire ); - } - - /** - * Get a cache value for a key and group. - * - * @since 1.0.0 - * - * @param string $key Cache key. - * @param string $group Cache group. Defaults to $this->cache_group - * @param bool $force - */ - private function cache_get( $key = '', $group = '', $force = false ) { - - // Bail if no cache key - if ( empty( $key ) ) { - return; - } - - // Get the cache group - $group = $this->get_cache_group( $group ); - - // Get from the cache - return wp_cache_get( $key, $group, $force ); - } - - /** - * Set a cache value for a key and group. - * - * @since 1.0.0 - * - * @param string $key Cache key. - * @param mixed $value Cache value. - * @param string $group Cache group. Defaults to $this->cache_group - * @param int $expire Expiration. - */ - private function cache_set( $key = '', $value = '', $group = '', $expire = 0 ) { - - // Bail if cache invalidation is suspended - if ( wp_suspend_cache_addition() ) { - return; - } - - // Bail if no cache key - if ( empty( $key ) ) { - return; - } - - // Get the cache group - $group = $this->get_cache_group( $group ); - - // Update the cache - wp_cache_set( $key, $value, $group, $expire ); - } - - /** - * Delete a cache key for a group. - * - * @since 1.0.0 - * - * @global bool $_wp_suspend_cache_invalidation - * - * @param string $key Cache key. - * @param string $group Cache group. Defaults to $this->cache_group - */ - private function cache_delete( $key = '', $group = '' ) { - global $_wp_suspend_cache_invalidation; - - // Bail if cache invalidation is suspended - if ( ! empty( $_wp_suspend_cache_invalidation ) ) { - return; - } - - // Bail if no cache key - if ( empty( $key ) ) { - return; - } - - // Get the cache group - $group = $this->get_cache_group( $group ); - - // Delete the cache - wp_cache_delete( $key, $group ); - } - - /** - * Fetch raw results directly from the database. - * - * @since 1.0.0 - * - * @param array $cols Columns for `SELECT`. - * @param array $where_cols Where clauses. Each key-value pair in the array - * represents a column and a comparison. - * @param int $limit Optional. LIMIT value. Default 25. - * @param null $offset Optional. OFFSET value. Default null. - * @param string $output Optional. Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants. - * Default OBJECT. - * With one of the first three, return an array of - * rows indexed from 0 by SQL result row number. - * Each row is an associative array (column => value, ...), - * a numerically indexed array (0 => value, ...), - * or an object. ( ->column = value ), respectively. - * With OBJECT_K, return an associative array of - * row objects keyed by the value of each row's - * first column's value. - * - * @return array|object|null Database query results. - */ - public function get_results( $cols = array(), $where_cols = array(), $limit = 25, $offset = null, $output = OBJECT ) { - - // Bail if no columns have been passed. - if ( empty( $cols ) ) { - return null; - } - - // Fetch all the columns for the table being queried. - $column_names = $this->get_column_names(); - - // Ensure valid column names have been passed for the `SELECT` clause. - foreach ( $cols as $index => $column ) { - if ( ! array_key_exists( $column, $column_names ) ) { - unset( $cols[ $index ] ); - } - } - - // Setup base SQL query. - $query = "SELECT "; - $query .= implode( ',', $cols ); - $query .= " FROM {$this->get_table_name()} {$this->table_alias} "; - $query .= " WHERE 1=1 "; - - // Ensure valid columns have been passed for the `WHERE` clause. - if ( ! empty( $where_cols ) ) { - - // Get keys from where columns - $columns = array_keys( $where_cols ); - - // Loop through columns and unset any invalid names - foreach ( $columns as $index => $column ) { - if ( ! array_key_exists( $column, $column_names ) ) { - unset( $where_cols[ $index ] ); - } - } - - // Parse WHERE clauses. - foreach ( $where_cols as $column => $compare ) { - - // Basic WHERE clause. - if ( ! is_array( $compare ) ) { - $pattern = $this->get_column_field( array( 'name' => $column ), 'pattern', '%s' ); - $statement = " AND {$this->table_alias}.{$column} = {$pattern} "; - $query .= $this->get_db()->prepare( $statement, $compare ); - - // More complex WHERE clause. - } else { - $value = isset( $compare['value'] ) - ? $compare['value'] - : false; - - // Skip if a value was not provided. - if ( false === $value ) { - continue; - } - - // Default compare clause to equals. - $compare_clause = isset( $compare['compare_query'] ) - ? trim( strtoupper( $compare['compare_query'] ) ) - : '='; - - // Array (unprepared) - if ( is_array( $compare['value'] ) ) { - - // Default to IN if clause not specified. - if ( ! in_array( $compare_clause, array( 'IN', 'NOT IN', 'BETWEEN' ), true ) ) { - $compare_clause = 'IN'; - } - - // Parse & escape for IN and NOT IN. - if ( 'IN' === $compare_clause || 'NOT IN' === $compare_clause ) { - $value = "('" . implode( "','", $this->get_db()->_escape( $compare['value'] ) ) . "')"; - - // Parse & escape for BETWEEN. - } elseif ( is_array( $value ) && 2 === count( $value ) && 'BETWEEN' === $compare_clause ) { - $_this = $this->get_db()->_escape( $value[0] ); - $_that = $this->get_db()->_escape( $value[1] ); - $value = " {$_this} AND {$_that} "; - } - } - - // Add WHERE clause. - $query .= " AND {$this->table_alias}.{$column} {$compare_clause} {$value} "; - } - } - } - - // Maybe set an offset. - if ( ! empty( $offset ) ) { - $values = explode( ',', $offset ); - $values = array_filter( $values, 'intval' ); - $offset = implode( ',', $values ); - $query .= " OFFSET {$offset} "; - } - - // Maybe set a limit. - if ( ! empty( $limit ) && ( $limit > 0 ) ) { - $limit = intval( $limit ); - $query .= " LIMIT {$limit} "; - } - - // Execute query. - $results = $this->get_db()->get_results( $query, $output ); - - // Return results. - return $results; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-row.php b/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-row.php deleted file mode 100644 index 853757e7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-row.php +++ /dev/null @@ -1,65 +0,0 @@ -init( $item ); - } - } - - /** - * Initialize class properties based on data array. - * - * @since 1.0.0 - * - * @param array $data - */ - private function init( $data = array() ) { - $this->set_vars( $data ); - } - - /** - * Determines whether the current row exists. - * - * @since 1.0.0 - * - * @return bool - */ - public function exists() { - return ! empty( $this->id ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-schema.php b/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-schema.php deleted file mode 100644 index 19228991..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-schema.php +++ /dev/null @@ -1,88 +0,0 @@ -columns ) || ! is_array( $this->columns ) ) { - return; - } - - // Juggle original columns array - $columns = $this->columns; - $this->columns = array(); - - // Loop through columns and create objects from them - foreach ( $columns as $column ) { - if ( is_array( $column ) ) { - $this->columns[] = new Column( $column ); - } elseif ( $column instanceof Column ) { - $this->columns[] = $column; - } - } - } - - /** - * Return the schema in string form. - * - * @since 1.0.0 - * - * @return string Calls get_create_string() on every column. - */ - protected function to_string() { - - // Default return value - $retval = ''; - - // Bail if no columns to convert - if ( empty( $this->columns ) ) { - return $retval; - } - - // Loop through columns... - foreach ( $this->columns as $column_info ) { - if ( method_exists( $column_info, 'get_create_string' ) ) { - $retval .= '\n' . $column_info->get_create_string() . ', '; - } - } - - // Return the string - return $retval; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-table.php b/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-table.php deleted file mode 100644 index 0fc88c20..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/engine/class-table.php +++ /dev/null @@ -1,933 +0,0 @@ - value array of versions => methods. - * - * @since 1.0.0 - * @var array - */ - protected $upgrades = array(); - - /** Methods ***************************************************************/ - - /** - * Hook into queries, admin screens, and more! - * - * @since 1.0.0 - */ - public function __construct() { - - // Setup the database table - $this->setup(); - - // Bail if setup failed - if ( empty( $this->name ) || empty( $this->db_version_key ) ) { - return; - } - - // Add the table to the database interface - $this->set_db_interface(); - - // Set the database schema - $this->set_schema(); - - // Add hooks - $this->add_hooks(); - - // Maybe force upgrade if testing - if ( $this->is_testing() ) { - $this->maybe_upgrade(); - } - } - - /** Abstract **************************************************************/ - - /** - * Setup this database table. - * - * @since 1.0.0 - */ - protected abstract function set_schema(); - - /** Multisite *************************************************************/ - - /** - * Update table version & references. - * - * Hooked to the "switch_blog" action. - * - * @since 1.0.0 - * - * @param int $site_id The site being switched to - */ - public function switch_blog( $site_id = 0 ) { - - // Update DB version based on the current site - if ( ! $this->is_global() ) { - $this->db_version = get_blog_option( $site_id, $this->db_version_key, false ); - } - - // Update interface for switched site - $this->set_db_interface(); - } - - /** Public Helpers ********************************************************/ - - /** - * Maybe upgrade the database table. Handles creation & schema changes. - * - * Hooked to the `admin_init` action. - * - * @since 1.0.0 - */ - public function maybe_upgrade() { - - // Bail if not upgradeable - if ( ! $this->is_upgradeable() ) { - return; - } - - // Bail if upgrade not needed - if ( ! $this->needs_upgrade() ) { - return; - } - - // Upgrade - if ( $this->exists() ) { - $this->upgrade(); - - // Install - } else { - $this->install(); - } - } - - /** - * Return whether this table needs an upgrade. - * - * @since 1.0.0 - * - * @param mixed $version Database version to check if upgrade is needed - * - * @return bool True if table needs upgrading. False if not. - */ - public function needs_upgrade( $version = false ) { - - // Use the current table version if none was passed - if ( empty( $version ) ) { - $version = $this->version; - } - - // Get the current database version - $this->get_db_version(); - - // Is the database table up to date? - $is_current = version_compare( $this->db_version, $version, '>=' ); - - // Return false if current, true if out of date - return ( true === $is_current ) - ? false - : true; - } - - /** - * Return whether this table can be upgraded. - * - * @since 1.0.0 - * - * @return bool True if table can be upgraded. False if not. - */ - public function is_upgradeable() { - - // Bail if global and upgrading global tables is not allowed - if ( $this->is_global() && ! wp_should_upgrade_global_tables() ) { - return false; - } - - // Kinda weird, but assume it is - return true; - } - - /** - * Return the current table version from the database. - * - * This is public method for accessing a private variable so that it cannot - * be externally modified. - * - * @since 1.0.0 - * - * @return string - */ - public function get_version() { - $this->get_db_version(); - - return $this->db_version; - } - - /** - * Install a database table by creating the table and setting the version. - * - * @since 1.0.0 - */ - public function install() { - $created = $this->create(); - - // Set the DB version if create was successful - if ( true === $created ) { - $this->set_db_version(); - } - } - - /** - * Destroy a database table by dropping the table and deleting the version. - * - * @since 1.0.0 - */ - public function uninstall() { - $dropped = $this->drop(); - - // Delete the DB version if drop was successful - if ( true === $dropped ) { - $this->delete_db_version(); - } - } - - /** Public Management *****************************************************/ - - /** - * Check if table already exists. - * - * @since 1.0.0 - * - * @return bool - */ - public function exists() { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return false; - } - - // Query statement - $query = "SHOW TABLES LIKE %s"; - $like = $db->esc_like( $this->table_name ); - $prepared = $db->prepare( $query, $like ); - $result = $db->get_var( $prepared ); - - // Does the table exist? - return $this->is_success( $result ); - } - - /** - * Create the table. - * - * @since 1.0.0 - * - * @return bool - */ - public function create() { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return false; - } - - // Query statement - $query = "CREATE TABLE {$this->table_name} ( {$this->schema} ) {$this->charset_collation}"; - $result = $db->query( $query ); - - // Was the table created? - return $this->is_success( $result ); - } - - /** - * Drop the database table. - * - * @since 1.0.0 - * - * @return bool - */ - public function drop() { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return false; - } - - // Query statement - $query = "DROP TABLE {$this->table_name}"; - $result = $db->query( $query ); - - // Did the table get dropped? - return $this->is_success( $result ); - } - - /** - * Truncate the database table. - * - * @since 1.0.0 - * - * @return bool - */ - public function truncate() { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return false; - } - - // Query statement - $query = "TRUNCATE TABLE {$this->table_name}"; - $result = $db->query( $query ); - - // Did the table get truncated? - return $this->is_success( $result ); - } - - /** - * Delete all items from the database table. - * - * @since 1.0.0 - * - * @return bool - */ - public function delete_all() { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return false; - } - - // Query statement - $query = "DELETE FROM {$this->table_name}"; - $deleted = $db->query( $query ); - - // Did the table get emptied? - return $deleted; - } - - /** - * Clone this database table. - * - * Pair with copy(). - * - * @since 1.1.0 - * - * @param string $new_table_name The name of the new table, without prefix - * - * @return bool - */ - public function _clone( $new_table_name = '' ) { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return false; - } - - // Sanitize the new table name - $table_name = $this->sanitize_table_name( $new_table_name ); - - // Bail if new table name is invalid - if ( empty( $table_name ) ) { - return false; - } - - // Query statement - $table = $this->apply_prefix( $table_name ); - $query = "CREATE TABLE {$table} LIKE {$this->table_name}"; - $result = $db->query( $query ); - - // Did the table get cloned? - return $this->is_success( $result ); - } - - /** - * Copy the contents of this table to a new table. - * - * Pair with clone(). - * - * @since 1.1.0 - * - * @param string $new_table_name The name of the new table, without prefix - * - * @return bool - */ - public function copy( $new_table_name = '' ) { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return false; - } - - // Sanitize the new table name - $table_name = $this->sanitize_table_name( $new_table_name ); - - // Bail if new table name is invalid - if ( empty( $table_name ) ) { - return false; - } - - // Query statement - $table = $this->apply_prefix( $table_name ); - $query = "INSERT INTO {$table} SELECT * FROM {$this->table_name}"; - $result = $db->query( $query ); - - // Did the table get copied? - return $this->is_success( $result ); - } - - /** - * Count the number of items in the database table. - * - * @since 1.0.0 - * - * @return int - */ - public function count() { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return 0; - } - - // Query statement - $query = "SELECT COUNT(*) FROM {$this->table_name}"; - $count = $db->get_var( $query ); - - // Query success/fail - return intval( $count ); - } - - /** - * Check if column already exists. - * - * @since 1.0.0 - * - * @param string $name Value - * - * @return bool - */ - public function column_exists( $name = '' ) { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return false; - } - - // Query statement - $query = "SHOW COLUMNS FROM {$this->table_name} LIKE %s"; - $like = $db->esc_like( $name ); - $prepared = $db->prepare( $query, $like ); - $result = $db->query( $prepared ); - - // Does the column exist? - return $this->is_success( $result ); - } - - /** - * Check if index already exists. - * - * @since 1.0.0 - * - * @param string $name Value - * @param string $column Column name - * - * @return bool - */ - public function index_exists( $name = '', $column = 'Key_name' ) { - - // Get the database interface - $db = $this->get_db(); - - // Bail if no database interface is available - if ( empty( $db ) ) { - return false; - } - - $column = esc_sql( $column ); - - // Query statement - $query = "SHOW INDEXES FROM {$this->table_name} WHERE {$column} LIKE %s"; - $like = $db->esc_like( $name ); - $prepared = $db->prepare( $query, $like ); - $result = $db->query( $prepared ); - - // Does the index exist? - return $this->is_success( $result ); - } - - /** Upgrades **************************************************************/ - - /** - * Upgrade this database table. - * - * @since 1.0.0 - * - * @return bool - */ - public function upgrade() { - - // Get pending upgrades - $upgrades = $this->get_pending_upgrades(); - - // Bail if no upgrades - if ( empty( $upgrades ) ) { - $this->set_db_version(); - - // Return, without failure - return true; - } - - // Default result - $result = false; - - // Try to do the upgrades - foreach ( $upgrades as $version => $callback ) { - - // Do the upgrade - $result = $this->upgrade_to( $version, $callback ); - - // Bail if an error occurs, to avoid skipping upgrades - if ( ! $this->is_success( $result ) ) { - return false; - } - } - - // Success/fail - return $this->is_success( $result ); - } - - /** - * Return array of upgrades that still need to run. - * - * @since 1.1.0 - * - * @return array Array of upgrade callbacks, keyed by their db version. - */ - public function get_pending_upgrades() { - - // Default return value - $upgrades = array(); - - // Bail if no upgrades, or no database version to compare to - if ( empty( $this->upgrades ) || empty( $this->db_version ) ) { - return $upgrades; - } - - // Loop through all upgrades, and pick out the ones that need doing - foreach ( $this->upgrades as $version => $callback ) { - if ( true === version_compare( $version, $this->db_version, '>' ) ) { - $upgrades[ $version ] = $callback; - } - } - - // Return - return $upgrades; - } - - /** - * Upgrade to a specific database version. - * - * @since 1.0.0 - * - * @param mixed $version Database version to check if upgrade is needed - * @param string $callback Callback function or class method to call - * - * @return bool - */ - public function upgrade_to( $version = '', $callback = '' ) { - - // Bail if no upgrade is needed - if ( ! $this->needs_upgrade( $version ) ) { - return false; - } - - // Allow self-named upgrade callbacks - if ( empty( $callback ) ) { - $callback = $version; - } - - // Is the callback... callable? - $callable = $this->get_callable( $callback ); - - // Bail if no callable upgrade was found - if ( empty( $callable ) ) { - return false; - } - - // Do the upgrade - $result = call_user_func( $callable ); - $success = $this->is_success( $result ); - - // Bail if upgrade failed - if ( true !== $success ) { - return false; - } - - // Set the database version to this successful version - $this->set_db_version( $version ); - - // Return success - return true; - } - - /** Private ***************************************************************/ - - /** - * Setup the necessary table variables. - * - * @since 1.0.0 - */ - private function setup() { - - // Bail if no database interface is available - if ( ! $this->get_db() ) { - return; - } - - // Sanitize the database table name - $this->name = $this->sanitize_table_name( $this->name ); - - // Bail if database table name was garbage - if ( false === $this->name ) { - return; - } - - // Separator - $glue = '_'; - - // Setup the prefixed name - $this->prefixed_name = $this->apply_prefix( $this->name, $glue ); - - // Maybe create database key - if ( empty( $this->db_version_key ) ) { - $this->db_version_key = implode( - $glue, - array( - sanitize_key( $this->db_global ), - $this->prefixed_name, - 'version' - ) - ); - } - } - - /** - * Set this table up in the database interface. - * - * This must be done directly because the database interface does not - * have a common mechanism for manipulating them safely. - * - * @since 1.0.0 - */ - private function set_db_interface() { - - // Get the database once, to avoid duplicate function calls - $db = $this->get_db(); - - // Bail if no database - if ( empty( $db ) ) { - return; - } - - // Set variables for global tables - if ( $this->is_global() ) { - $site_id = 0; - $tables = 'ms_global_tables'; - - // Set variables for per-site tables - } else { - $site_id = null; - $tables = 'tables'; - } - - // Set the table prefix and prefix the table name - $this->table_prefix = $db->get_blog_prefix( $site_id ); - - // Get the prefixed table name - $prefixed_table_name = "{$this->table_prefix}{$this->prefixed_name}"; - - // Set the database interface - $db->{$this->prefixed_name} = $this->table_name = $prefixed_table_name; - - // Create the array if it does not exist - if ( ! isset( $db->{$tables} ) ) { - $db->{$tables} = array(); - } - - // Add the table to the global table array - $db->{$tables}[] = $this->prefixed_name; - - // Charset - if ( ! empty( $db->charset ) ) { - $this->charset_collation = "DEFAULT CHARACTER SET {$db->charset}"; - } - - // Collation - if ( ! empty( $db->collate ) ) { - $this->charset_collation .= " COLLATE {$db->collate}"; - } - } - - /** - * Set the database version for the table. - * - * @since 1.0.0 - * - * @param mixed $version Database version to set when upgrading/creating - */ - private function set_db_version( $version = '' ) { - - // If no version is passed during an upgrade, use the current version - if ( empty( $version ) ) { - $version = $this->version; - } - - // Update the DB version - $this->is_global() - ? update_network_option( get_main_network_id(), $this->db_version_key, $version ) - : update_option( $this->db_version_key, $version ); - - // Set the DB version - $this->db_version = $version; - } - - /** - * Get the table version from the database. - * - * @since 1.0.0 - */ - private function get_db_version() { - $this->db_version = $this->is_global() - ? get_network_option( get_main_network_id(), $this->db_version_key, 1 ) - : get_option( $this->db_version_key, 1 ); - } - - /** - * Delete the table version from the database. - * - * @since 1.0.0 - */ - private function delete_db_version() { - $this->db_version = $this->is_global() - ? delete_network_option( get_main_network_id(), $this->db_version_key ) - : delete_option( $this->db_version_key ); - } - - /** - * Add class hooks to the parent application actions. - * - * @since 1.0.0 - */ - private function add_hooks() { - - // Add table to the global database object - add_action( 'switch_blog', array( $this, 'switch_blog' ) ); - add_action( 'admin_init', array( $this, 'maybe_upgrade' ) ); - } - - /** - * Check if the current request is from some kind of test. - * - * This is primarily used to skip 'admin_init' and force-install tables. - * - * @since 1.0.0 - * - * @return bool - */ - private function is_testing() { - return edd_is_doing_unit_tests(); - } - - /** - * Check if table is global. - * - * @since 1.0.0 - * - * @return bool - */ - private function is_global() { - return ( true === $this->global ); - } - - /** - * Try to get a callable upgrade, with some magic to avoid needing to - * do this dance repeatedly inside subclasses. - * - * @since 1.0.0 - * - * @param string $callback - * - * @return mixed Callable string, or false if not callable - */ - private function get_callable( $callback = '' ) { - - // Default return value - $callable = $callback; - - // Look for global function - if ( ! is_callable( $callable ) ) { - - // Fallback to local class method - $callable = array( $this, $callback ); - if ( ! is_callable( $callable ) ) { - - // Fallback to class method prefixed with "__" - $callable = array( $this, "__{$callback}" ); - if ( ! is_callable( $callable ) ) { - $callable = false; - } - } - } - - // Return callable string, or false if not callable - return $callable; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/queries/class-adjustment.php b/wp-content/plugins/easy-digital-downloads/includes/database/queries/class-adjustment.php deleted file mode 100644 index b354afab..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/queries/class-adjustment.php +++ /dev/null @@ -1,170 +0,0 @@ -parse_query_for_emails( $query ); - - return parent::query( $query ); - } - - /** - * If we are querying for an email, this queries the email addresses table first, - * then updates the queries with the matching customer IDs. - * - * @since 3.1.1 - * @param array $query - * @return array - */ - private function parse_query_for_emails( $query ) { - if ( empty( $query['email'] ) && empty( $query['email__in'] ) && empty( $query['email__not_in'] ) ) { - return $query; - } - $operator = 'id__in'; - $args = array( - 'fields' => array( 'customer_id' ), - ); - if ( ! empty( $query['email'] ) ) { - $args['email'] = $query['email']; - unset( $query['email'] ); - } elseif ( ! empty( $query['email__in'] ) ) { - $args['email__in'] = $query['email__in']; - unset( $query['email__in'] ); - } elseif ( ! empty( $query['email__not_in'] ) ) { - /** - * Speical treatment for email__not_in - * - * When we are searching for email__not_in, we want to actually find any email - * addresses in the customer email addresses table that match the email__not_in parameter - * find the customer IDs for these excluded email addresses, and pass them back in as id__not_in - * to the main query, so that we can ensure we're excluding them even if their main email value is - * one of the excluded ones. - */ - $operator = 'id__not_in'; - $args['email__in'] = $query['email__not_in']; - } - - $customer_ids = edd_get_customer_email_addresses( $args ); - $query[ $operator ] = array_map( 'absint', wp_list_pluck( $customer_ids, 'customer_id' ) ); - - return $query; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/queries/class-log-api-request.php b/wp-content/plugins/easy-digital-downloads/includes/database/queries/class-log-api-request.php deleted file mode 100644 index 94832f0d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/queries/class-log-api-request.php +++ /dev/null @@ -1,156 +0,0 @@ - $status ) { - if ( 'publish' === $status ) { - unset( $query['status'][ $key ] ); - } - } - - $query['status'][] = 'complete'; - } elseif ( 'publish' === $query['status'] ) { - $query['status'] = 'complete'; - } - } - - parent::__construct( $query ); - } - - /** - * Set up the filter callback to add the country and region from the order addresses table. - * - * @since 3.0 - * @access public - * - * @param string|array $query See Order::__construct() for accepted arguments. - * - * @see Order::__construct() - */ - public function query( $query = array() ) { - $query_clauses_filters = $this->get_query_clauses_filters( $query ); - foreach ( $query_clauses_filters as $filter ) { - if ( $filter['condition'] ) { - add_filter( 'edd_orders_query_clauses', array( $this, $filter['callback'] ) ); - } - } - - $result = parent::query( $query ); - - foreach ( $query_clauses_filters as $filter ) { - if ( $filter['condition'] ) { - remove_filter( 'edd_orders_query_clauses', array( $this, $filter['callback'] ) ); - } - } - - return $result; - } - - /** - * Filter the query clause to add the country and region from the order addresses table. - * - * @since 3.0 - * @access public - * - * @param string|array $clauses The clauses which will generate the final SQL query. - */ - public function query_by_country( $clauses ) { - - if ( empty( $this->query_vars['country'] ) || 'all' === $this->query_vars['country'] ) { - return $clauses; - } - - global $wpdb; - - $primary_alias = $this->table_alias; - $primary_column = parent::get_primary_column_name(); - - $order_addresses_query = new \EDD\Database\Queries\Order_Address(); - $join_alias = $order_addresses_query->table_alias; - - // Filter by the order address's region (state/province/etc).. - if ( ! empty( $this->query_vars['region'] ) && 'all' !== $this->query_vars['region'] ) { - $location_join = $wpdb->prepare( - " INNER JOIN {$order_addresses_query->table_name} {$join_alias} ON ({$primary_alias}.{$primary_column} = {$join_alias}.order_id AND {$join_alias}.country = %s AND {$join_alias}.region = %s)", - $this->query_vars['country'], - $this->query_vars['region'] - ); - - // Add the region to the query var defaults. - $this->query_var_defaults['region'] = $this->query_vars['region']; - - // Filter only by the country, not by region. - } else { - $location_join = $wpdb->prepare( - " INNER JOIN {$order_addresses_query->table_name} {$join_alias} ON ({$primary_alias}.{$primary_column} = {$join_alias}.order_id AND {$join_alias}.country = %s)", - $this->query_vars['country'] - ); - - // Add the country to the query var defaults. - $this->query_var_defaults['country'] = $this->query_vars['country']; - } - - // Add the customized join to the query. - $clauses['join'] .= ' ' . $location_join; - - return $clauses; - } - - /** - * Filter the query clause to filter by product ID. - * - * @since 3.0 - * @access public - * - * @param string|array $clauses The clauses which will generate the final SQL query. - */ - public function query_by_product( $clauses ) { - if ( - empty( $this->query_vars['product_id'] ) && - ( ! isset( $this->query_vars['product_price_id'] ) || ! is_numeric( $this->query_vars['product_price_id'] ) ) - ) { - return $clauses; - } - - global $wpdb; - - $primary_column = parent::get_primary_column_name(); - $order_items_query = new Order_Item(); - - // Build up our conditions. - $conditions = array(); - foreach ( array( 'product_id' => 'product_id', 'product_price_id' => 'price_id' ) as $query_var => $db_col ) { - if ( isset( $this->query_vars[ $query_var ] ) && is_numeric( $this->query_vars[ $query_var ] ) ) { - $conditions[] = $wpdb->prepare( - "AND {$order_items_query->table_alias}.{$db_col} = %d", - absint( $this->query_vars[ $query_var ] ) - ); - } - } - - $conditions = implode( ' ', $conditions ); - - $clauses['join'] .= " INNER JOIN {$order_items_query->table_name} {$order_items_query->table_alias} ON( - {$this->table_alias}.{$primary_column} = {$order_items_query->table_alias}.order_id - {$conditions} - )"; - - return $clauses; - } - - /** - * Filter the query clause to filter by transaction ID. - * - * @since 3.0.2 - * @param string $clauses - * @return string - */ - public function query_by_txn( $clauses ) { - if ( empty( $this->query_vars['txn'] ) ) { - return $clauses; - } - - global $wpdb; - - $primary_column = parent::get_primary_column_name(); - $order_transaction_query = new Order_Transaction(); - - $clauses['join'] .= $wpdb->prepare( - " INNER JOIN {$order_transaction_query->table_name} {$order_transaction_query->table_alias} - ON( {$this->table_alias}.{$primary_column} = {$order_transaction_query->table_alias}.object_id - AND {$order_transaction_query->table_alias}.transaction_id = %s )", - sanitize_text_field( $this->query_vars['txn'] ) - ); - - return $clauses; - } - - /** - * Filter the query clause to filter by discount ID. - * - * @since 3.0.2 - * @param string $clauses - * @return string - */ - public function query_by_discount_id( $clauses ) { - if ( empty( $this->query_vars['discount_id'] ) ) { - return $clauses; - } - - global $wpdb; - - $primary_column = parent::get_primary_column_name(); - $order_adjustment_query = new Order_Adjustment(); - - $clauses['join'] .= $wpdb->prepare( - " INNER JOIN {$order_adjustment_query->table_name} {$order_adjustment_query->table_alias} - ON( {$this->table_alias}.{$primary_column} = {$order_adjustment_query->table_alias}.object_id - AND {$order_adjustment_query->table_alias}.type_id = %d )", - absint( $this->query_vars['discount_id'] ) - ); - - return $clauses; - } - - /** - * When searching by a numeric order number, we need to override the default where clause - * to return orders matching either the ID or order number. - * - * @since 3.1.1.4 - * @param array $clauses - * @return array - */ - public function query_by_order_search( $clauses ) { - global $wpdb; - $clauses['where'] = $wpdb->prepare( - "{$this->table_alias}.id = %d OR {$this->table_alias}.order_number = %d", - absint( $this->query_vars['id'] ), - absint( $this->query_vars['order_number'] ) - ); - - return $clauses; - } - - /** - * Set the query var defaults for country and region. - * - * @since 3.0 - * @access public - */ - protected function set_query_var_defaults() { - parent::set_query_var_defaults(); - - $this->query_var_defaults['country'] = false; - $this->query_var_defaults['region'] = false; - $this->query_var_defaults['product_id'] = false; - $this->query_var_defaults['product_product_id'] = false; - } - - /** - * Adds an item to the database - * - * @since 3.0 - * - * @param array $data - * @return false|int Returns the item ID on success; false on failure. - */ - public function add_item( $data = array() ) { - // Every order should have a currency assigned. - if ( empty( $data['currency'] ) ) { - $data['currency'] = edd_get_currency(); - } - - // If the payment key isn't already created, generate it. - if ( empty( $data['payment_key'] ) ) { - $email = ! empty( $data['email'] ) ? $data['email'] : ''; - $data['payment_key'] = edd_generate_order_payment_key( $email ); - } - - // Add the IP address if it hasn't been already. - if ( empty( $data['ip'] ) ) { - $data['ip'] = edd_get_ip(); - } - - return parent::add_item( $data ); - } - - /** - * Get the array of possible query clause filters. - * - * @since 3.0.2 - * @param array $query - * @return array - */ - private function get_query_clauses_filters( $query ) { - return array( - array( - 'condition' => ! empty( $query['country'] ), - 'callback' => 'query_by_country', - ), - array( - 'condition' => ! empty( $query['product_id'] ) || ( isset( $query['product_price_id'] ) && is_numeric( $query['product_price_id'] ) ), - 'callback' => 'query_by_product', - ), - array( - 'condition' => ! empty( $query['txn'] ), - 'callback' => 'query_by_txn', - ), - array( - 'condition' => ! empty( $query['discount_id'] ), - 'callback' => 'query_by_discount_id', - ), - array( - 'condition' => ! empty( $query['id'] ) && ! empty( $query['order_number'] ) && $query['id'] === $query['order_number'], - 'callback' => 'query_by_order_search', - ), - ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/rows/class-adjustment.php b/wp-content/plugins/easy-digital-downloads/includes/database/rows/class-adjustment.php deleted file mode 100644 index 44fc9b1b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/rows/class-adjustment.php +++ /dev/null @@ -1,33 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true, - ), - - // parent. - array( - 'name' => 'parent', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true, - 'transition' => true, - ), - - // name. - array( - 'name' => 'name', - 'type' => 'varchar', - 'length' => '200', - 'searchable' => true, - 'sortable' => true, - ), - - // code. - array( - 'name' => 'code', - 'type' => 'varchar', - 'length' => '50', - 'searchable' => true, - 'sortable' => true, - 'cache_key' => true, - ), - - // status. - array( - 'name' => 'status', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'draft', - 'sortable' => true, - 'transition' => true, - ), - - // type - array( - 'name' => 'type', - 'type' => 'varchar', - 'length' => '20', - 'default' => '', - 'sortable' => true, - 'transition' => true, - ), - - // scope. - array( - 'name' => 'scope', - 'type' => 'varchar', - 'length' => '20', - 'default' => '', - 'sortable' => true, - 'transition' => true, - ), - - // amount_type. - array( - 'name' => 'amount_type', - 'type' => 'varchar', - 'length' => '20', - 'default' => '', - 'sortable' => true, - 'transition' => true, - ), - - // amount. - array( - 'name' => 'amount', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - ), - - // description. - array( - 'name' => 'description', - 'type' => 'longtext', - 'default' => '', - 'searchable' => true, - ), - - // max_uses. - array( - 'name' => 'max_uses', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - ), - - // use_count. - array( - 'name' => 'use_count', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true, - ), - - // once_per_customer. - array( - 'name' => 'once_per_customer', - 'type' => 'int', - 'length' => '1', - 'default' => '0', - ), - - // min_charge_amount. - array( - 'name' => 'min_charge_amount', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - ), - - // start_date. - array( - 'name' => 'start_date', - 'type' => 'datetime', - 'default' => null, - 'allow_null' => true, - 'date_query' => true, - 'sortable' => true, - ), - - // end_date. - array( - 'name' => 'end_date', - 'type' => 'datetime', - 'default' => null, - 'allow_null' => true, - 'date_query' => true, - 'sortable' => true, - ), - - // date_created. - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class. - 'created' => true, - 'date_query' => true, - 'sortable' => true, - ), - - // date_modified. - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class. - 'modified' => true, - 'date_query' => true, - 'sortable' => true, - ), - - // uuid. - array( - 'uuid' => true, - ), - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-customer-addresses.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-customer-addresses.php deleted file mode 100644 index 34ae3707..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-customer-addresses.php +++ /dev/null @@ -1,169 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // customer_id - array( - 'name' => 'customer_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0' - ), - - // is_primary - array( - 'name' => 'is_primary', - 'type' => 'tinyint', - 'length' => '1', - 'unsigned' => false, - 'default' => '0', - 'sortable' => true, - 'transition' => true, - ), - - // type - array( - 'name' => 'type', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'billing', - 'sortable' => true, - 'transition' => true - ), - - // status - array( - 'name' => 'status', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'active', - 'sortable' => true, - 'transition' => true - ), - - // name - array( - 'name' => 'name', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // address - array( - 'name' => 'address', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // address2 - array( - 'name' => 'address2', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // city - array( - 'name' => 'city', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // region - array( - 'name' => 'region', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // postal_code - array( - 'name' => 'postal_code', - 'type' => 'varchar', - 'length' => '32', - 'default' => '', - 'searchable' => true, - 'sortable' => true - ), - - // country - array( - 'name' => 'country', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-customer-email-addresses.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-customer-email-addresses.php deleted file mode 100644 index 76747d57..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-customer-email-addresses.php +++ /dev/null @@ -1,112 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // customer_id - array( - 'name' => 'customer_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'cache_key' => true - ), - - // type - array( - 'name' => 'type', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'secondary', - 'sortable' => true, - 'transition' => true - ), - - // status - array( - 'name' => 'status', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'active', - 'sortable' => true, - 'transition' => true - ), - - // email - array( - 'name' => 'email', - 'type' => 'varchar', - 'length' => '100', - 'default' => '', - 'cache_key' => true, - 'searchable' => true, - 'sortable' => true - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-customers.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-customers.php deleted file mode 100644 index a0224819..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-customers.php +++ /dev/null @@ -1,128 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // user_id - array( - 'name' => 'user_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'cache_key' => true - ), - - // email - array( - 'name' => 'email', - 'type' => 'varchar', - 'length' => '100', - 'cache_key' => true, - 'searchable' => true, - 'sortable' => true - ), - - // name - array( - 'name' => 'name', - 'type' => 'varchar', - 'length' => '255', - 'searchable' => true, - 'sortable' => true - ), - - // status - array( - 'name' => 'status', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'active', - 'sortable' => true, - 'transition' => true - ), - - // purchase_value - array( - 'name' => 'purchase_value', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true - ), - - // purchase_count - array( - 'name' => 'purchase_count', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-logs-api-requests.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-logs-api-requests.php deleted file mode 100644 index 87284cfb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-logs-api-requests.php +++ /dev/null @@ -1,148 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // user_id - array( - 'name' => 'user_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // api_key - array( - 'name' => 'api_key', - 'type' => 'varchar', - 'length' => '32', - 'default' => 'public', - 'searchable' => true, - 'sortable' => true - ), - - // token - array( - 'name' => 'token', - 'type' => 'varchar', - 'length' => '32', - 'default' => '', - 'searchable' => true, - 'sortable' => true - ), - - // version - array( - 'name' => 'version', - 'type' => 'varchar', - 'length' => '32', - 'default' => '', - 'sortable' => true - ), - - // request - array( - 'name' => 'request', - 'type' => 'longtext', - 'default' => '', - 'searchable' => true, - 'in' => false, - 'not_in' => false - ), - - // error - array( - 'name' => 'error', - 'type' => 'longtext', - 'default' => '', - 'searchable' => true, - 'in' => false, - 'not_in' => false - ), - - // ip - array( - 'name' => 'ip', - 'type' => 'varchar', - 'length' => '60', - 'default' => '', - 'searchable' => true, - 'sortable' => true - ), - - // time - array( - 'name' => 'time', - 'type' => 'varchar', - 'length' => '60', - 'default' => '', - 'sortable' => true - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-logs-file-downloads.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-logs-file-downloads.php deleted file mode 100644 index 38ea17c3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-logs-file-downloads.php +++ /dev/null @@ -1,139 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // product_id - array( - 'name' => 'product_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // file_id - array( - 'name' => 'file_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // order_id - array( - 'name' => 'order_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // price_id - array( - 'name' => 'price_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0' - ), - - // customer_id - array( - 'name' => 'customer_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // ip - array( - 'name' => 'ip', - 'type' => 'varchar', - 'length' => '60', - 'default' => '', - 'sortable' => true, - 'searchable' => true - ), - - // user_agent - array( - 'name' => 'user_agent', - 'type' => 'varchar', - 'length' => '200', - 'default' => '', - 'sortable' => true, - 'searchable' => true, - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-logs.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-logs.php deleted file mode 100644 index ba156c4d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-logs.php +++ /dev/null @@ -1,134 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // object_id - array( - 'name' => 'object_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true, - 'cache_key' => true, - ), - - // object_type - array( - 'name' => 'object_type', - 'type' => 'varchar', - 'length' => '20', - 'default' => '', - 'sortable' => true, - 'cache_key' => true, - 'allow_null' => true - ), - - // user_id - array( - 'name' => 'user_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true, - 'cache_key' => true, - ), - - // type - array( - 'name' => 'type', - 'type' => 'varchar', - 'length' => '20', - 'default' => '', - 'sortable' => true - ), - - // title - array( - 'name' => 'title', - 'type' => 'varchar', - 'length' => '200', - 'default' => '', - 'searchable' => true, - 'sortable' => true, - 'in' => false, - 'not_in' => false - ), - - // content - array( - 'name' => 'content', - 'type' => 'longtext', - 'default' => '', - 'searchable' => true, - 'in' => false, - 'not_in' => false - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-notes.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-notes.php deleted file mode 100644 index c74208ba..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-notes.php +++ /dev/null @@ -1,109 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // object_id - array( - 'name' => 'object_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // object_type - array( - 'name' => 'object_type', - 'type' => 'varchar', - 'length' => '20', - 'default' => '', - 'sortable' => true - ), - - // user_id - array( - 'name' => 'user_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // content - array( - 'name' => 'content', - 'type' => 'longtext', - 'default' => '', - 'searchable' => true, - 'in' => false, - 'not_in' => false - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-addresses.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-addresses.php deleted file mode 100644 index 0347dda3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-addresses.php +++ /dev/null @@ -1,148 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // order_id - array( - 'name' => 'order_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0' - ), - - // type. - array( - 'name' => 'type', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'billing', - 'sortable' => true, - 'transition' => true, - ), - - // name - array( - 'name' => 'name', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // address - array( - 'name' => 'address', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // address2 - array( - 'name' => 'address2', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // city - array( - 'name' => 'city', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // region - array( - 'name' => 'region', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // postal_code - array( - 'name' => 'postal_code', - 'type' => 'varchar', - 'length' => '32', - 'default' => '', - 'searchable' => true, - 'sortable' => true - ), - - // country - array( - 'name' => 'country', - 'type' => 'mediumtext', - 'searchable' => true, - 'sortable' => true - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-adjustments.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-adjustments.php deleted file mode 100644 index 587c3b62..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-adjustments.php +++ /dev/null @@ -1,178 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // parent - array( - 'name' => 'parent', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // object_id - array( - 'name' => 'object_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // object_type - array( - 'name' => 'object_type', - 'type' => 'varchar', - 'length' => '20', - 'default' => '', - 'sortable' => true - ), - - // type_id - array( - 'name' => 'type_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => null, - 'sortable' => true, - 'allow_null' => true, - ), - - // type - array( - 'name' => 'type', - 'type' => 'varchar', - 'length' => '20', - 'default' => '', - 'sortable' => true, - 'transition' => true - ), - - // type key - array( - 'name' => 'type_key', - 'type' => 'varchar', - 'length' => '255', - 'default' => null, - 'allow_null' => true, - 'sortable' => true, - ), - - // description - array( - 'name' => 'description', - 'type' => 'varchar', - 'length' => '100', - 'default' => '', - 'searchable' => true, - 'sortable' => true - ), - - // subtotal - array( - 'name' => 'subtotal', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount' - ), - - // tax - array( - 'name' => 'tax', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount' - ), - - // total - array( - 'name' => 'total', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount' - ), - - // rate - array( - 'name' => 'rate', - 'type' => 'decimal', - 'length' => '10,5', - 'default' => '1.00000', - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-items.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-items.php deleted file mode 100644 index 5b34d50e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-items.php +++ /dev/null @@ -1,219 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // parent - array( - 'name' => 'parent', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // order_id - array( - 'name' => 'order_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // product_id - array( - 'name' => 'product_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // product_name - array( - 'name' => 'product_name', - 'type' => 'text', - 'default' => '', - 'searchable' => true, - 'in' => false, - 'not_in' => false - ), - - // price_id - array( - 'name' => 'price_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => null, - 'sortable' => true, - 'allow_null' => true, - ), - - // cart_index - array( - 'name' => 'cart_index', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // type - array( - 'name' => 'type', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'download', - 'sortable' => true, - 'transition' => true - ), - - // status - array( - 'name' => 'status', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'pending', - 'sortable' => true, - 'transition' => true - ), - - // quantity - array( - 'name' => 'quantity', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // amount - array( - 'name' => 'amount', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount' - ), - - // subtotal - array( - 'name' => 'subtotal', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount' - ), - - // discount - array( - 'name' => 'discount', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount' - ), - - // tax - array( - 'name' => 'tax', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount' - ), - - // total - array( - 'name' => 'total', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount' - ), - - // rate - array( - 'name' => 'rate', - 'type' => 'decimal', - 'length' => '10,5', - 'default' => '1.00000', - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-transactions.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-transactions.php deleted file mode 100644 index 4119d087..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-order-transactions.php +++ /dev/null @@ -1,134 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true - ), - - // object_id - array( - 'name' => 'object_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true - ), - - // object_type - array( - 'name' => 'object_type', - 'type' => 'varchar', - 'length' => '20', - 'default' => '', - 'sortable' => true - ), - - // transaction_id - array( - 'name' => 'transaction_id', - 'type' => 'varchar', - 'length' => '256', - 'cache_key' => true, - 'searchable' => true, - 'sortable' => true - ), - - // gateway - array( - 'name' => 'gateway', - 'type' => 'varchar', - 'length' => '20', - 'sortable' => true, - ), - - // status - array( - 'name' => 'status', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'pending', - 'sortable' => true, - 'transition' => true - ), - - // total - array( - 'name' => 'total', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true - ), - - // rate - array( - 'name' => 'rate', - 'type' => 'decimal', - 'length' => '10,5', - 'default' => '1.00000', - ), - - // date_created - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'created' => true, - 'date_query' => true, - 'sortable' => true - ), - - // date_modified - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class - 'modified' => true, - 'date_query' => true, - 'sortable' => true - ), - - // uuid - array( - 'uuid' => true, - ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-orders.php b/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-orders.php deleted file mode 100644 index e0cfbc23..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/schemas/class-orders.php +++ /dev/null @@ -1,256 +0,0 @@ - 'id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'extra' => 'auto_increment', - 'primary' => true, - 'sortable' => true, - ), - - // parent. - array( - 'name' => 'parent', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true, - ), - - // order_number. - array( - 'name' => 'order_number', - 'type' => 'varchar', - 'length' => '255', - 'searchable' => true, - 'sortable' => true, - ), - - // status. - array( - 'name' => 'status', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'pending', - 'sortable' => true, - 'transition' => true, - ), - - // type. - array( - 'name' => 'type', - 'type' => 'varchar', - 'length' => '20', - 'default' => 'sale', - 'sortable' => true, - ), - - // user_id. - array( - 'name' => 'user_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true, - ), - - // customer_id. - array( - 'name' => 'customer_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => '0', - 'sortable' => true, - ), - - // email. - array( - 'name' => 'email', - 'type' => 'varchar', - 'length' => '100', - 'searchable' => true, - 'sortable' => true, - ), - - // ip. - array( - 'name' => 'ip', - 'type' => 'varchar', - 'length' => '60', - 'sortable' => true, - ), - - // gateway. - array( - 'name' => 'gateway', - 'type' => 'varchar', - 'length' => '100', - 'sortable' => true, - 'default' => 'manual', - ), - - // mode. - array( - 'name' => 'mode', - 'type' => 'varchar', - 'length' => '20', - ), - - // currency. - array( - 'name' => 'currency', - 'type' => 'varchar', - 'length' => '20', - 'validate' => 'strtoupper', - ), - - // payment_key. - array( - 'name' => 'payment_key', - 'type' => 'varchar', - 'length' => '64', - 'searchable' => true, - ), - - // tax_rate_id. - array( - 'name' => 'tax_rate_id', - 'type' => 'bigint', - 'length' => '20', - 'unsigned' => true, - 'default' => null, - 'allow_null' => true, - 'sortable' => true, - ), - - // subtotal. - array( - 'name' => 'subtotal', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount', - ), - - // discount. - array( - 'name' => 'discount', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount', - ), - - // tax. - array( - 'name' => 'tax', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount', - ), - - // total. - array( - 'name' => 'total', - 'type' => 'decimal', - 'length' => '18,9', - 'default' => '0', - 'sortable' => true, - 'validate' => 'edd_sanitize_amount', - ), - - // rate. - array( - 'name' => 'rate', - 'type' => 'decimal', - 'length' => '10,5', - 'default' => '1.00000', - ), - - // date_created. - array( - 'name' => 'date_created', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class. - 'created' => true, - 'date_query' => true, - 'sortable' => true, - ), - - // date_modified. - array( - 'name' => 'date_modified', - 'type' => 'datetime', - 'default' => '', // Defaults to current time in query class. - 'modified' => true, - 'date_query' => true, - 'sortable' => true, - ), - - // date_completed. - array( - 'name' => 'date_completed', - 'type' => 'datetime', - 'default' => null, - 'allow_null' => true, - 'date_query' => true, - 'sortable' => true, - ), - - // date_refundable. - array( - 'name' => 'date_refundable', - 'type' => 'datetime', - 'default' => null, - 'allow_null' => true, - 'date_query' => true, - 'sortable' => true, - ), - - // uuid. - array( - 'uuid' => true, - ), - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-adjustment-meta.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-adjustment-meta.php deleted file mode 100644 index 095507af..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-adjustment-meta.php +++ /dev/null @@ -1,68 +0,0 @@ -schema = "meta_id bigint(20) unsigned NOT NULL auto_increment, - edd_adjustment_id bigint(20) unsigned NOT NULL default '0', - meta_key varchar(255) DEFAULT NULL, - meta_value longtext DEFAULT NULL, - PRIMARY KEY (meta_id), - KEY edd_adjustment_id (edd_adjustment_id), - KEY meta_key (meta_key({$max_index_length}))"; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-adjustments.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-adjustments.php deleted file mode 100644 index 24f05d14..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-adjustments.php +++ /dev/null @@ -1,206 +0,0 @@ - 201906031, - '202002121' => 202002121, - '202102161' => 202102161 - ); - - /** - * Setup the database schema. - * - * @access protected - * @since 3.0 - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL auto_increment, - parent bigint(20) unsigned NOT NULL default '0', - name varchar(200) NOT NULL default '', - code varchar(50) NOT NULL default '', - status varchar(20) NOT NULL default '', - type varchar(20) NOT NULL default '', - scope varchar(20) NOT NULL default 'all', - amount_type varchar(20) NOT NULL default '', - amount decimal(18,9) NOT NULL default '0', - description longtext NOT NULL default '', - max_uses bigint(20) unsigned NOT NULL default '0', - use_count bigint(20) unsigned NOT NULL default '0', - once_per_customer int(1) NOT NULL default '0', - min_charge_amount decimal(18,9) NOT NULL default '0', - start_date datetime default null, - end_date datetime default null, - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY type_status (type(20), status(20)), - KEY code (code), - KEY date_created (date_created), - KEY date_start_end (start_date,end_date)"; - } - - /** - * Create the table - * - * @since 3.0 - * - * @return bool - */ - public function create() { - - $created = parent::create(); - - // After successful creation, we need to set the auto_increment for legacy orders. - if ( ! empty( $created ) ) { - - $result = $this->get_db()->get_var( "SELECT ID FROM {$this->get_db()->prefix}posts WHERE post_type = 'edd_discount' ORDER BY ID DESC LIMIT 1;" ); - - if ( ! empty( $result ) ) { - $auto_increment = $result + 1; - $this->get_db()->query( "ALTER TABLE {$this->table_name} AUTO_INCREMENT = {$auto_increment};" ); - } - - } - - return $created; - - } - - /** - * Upgrade to version 201906031 - * - Drop the `product_condition` column. - * - * @since 3.0 - * - * @return boolean True if upgrade was successful, false otherwise. - */ - protected function __201906031() { - - // Look for column - $result = $this->column_exists( 'product_condition' ); - - // Maybe remove column - if ( true === $result ) { - - // Try to remove it - $result = ! $this->get_db()->query( " - ALTER TABLE {$this->table_name} DROP COLUMN `product_condition` - " ); - - // Return success/fail - return $this->is_success( $result ); - - // Return true because column is already gone - } else { - return $this->is_success( true ); - } - } - - /** - * Upgrade to version 202002121 - * - Change default value to `null` for columns `start_date` and `end_date`. - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @return bool - */ - protected function __202002121() { - - // Update `start_date`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `start_date` datetime default null; - " ); - - if ( $this->is_success( $result ) ) { - $this->get_db()->query( "UPDATE {$this->table_name} SET `start_date` = NULL WHERE `start_date` = '0000-00-00 00:00:00'" ); - } - - // Update `end_date`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `end_date` datetime default null; - " ); - - if ( $this->is_success( $result ) ) { - $this->get_db()->query( "UPDATE {$this->table_name} SET `end_date` = NULL WHERE `end_date` = '0000-00-00 00:00:00'" ); - } - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - - /** - * Upgrade to version 202102161 - * - Drop old `code_status_type_scope_amount` index - * - Create new `status_type` index - * - Create new `code` index - * - * @since 3.0 - * @return bool - */ - protected function __202102161() { - if ( $this->index_exists( 'code_status_type_scope_amount' ) ) { - $this->get_db()->query( "ALTER TABLE {$this->table_name} DROP INDEX code_status_type_scope_amount" ); - } - - $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX type_status (type(20), status(20))" ); - $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX code (code)" ); - - return true; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customer-addresses.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customer-addresses.php deleted file mode 100644 index 68b0e57f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customer-addresses.php +++ /dev/null @@ -1,149 +0,0 @@ - 201906251, - '202002141' => 202002141, - '202004051' => 202004051, - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL AUTO_INCREMENT, - customer_id bigint(20) unsigned NOT NULL default '0', - is_primary tinyint(1) signed NOT NULL default '0', - type varchar(20) NOT NULL default 'billing', - status varchar(20) NOT NULL default 'active', - name mediumtext NOT NULL, - address mediumtext NOT NULL, - address2 mediumtext NOT NULL, - city mediumtext NOT NULL, - region mediumtext NOT NULL, - postal_code varchar(32) NOT NULL default '', - country mediumtext NOT NULL, - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY customer_is_primary (customer_id, is_primary), - KEY type (type(20)), - KEY status (status(20)), - KEY date_created (date_created)"; - } - - /** - * Upgrade to version 201906251 - * - Add the `name` mediumtext column - * - * @since 3.0 - * - * @return boolean - */ - protected function __201906251() { - - $result = $this->column_exists( 'name' ); - - if ( false === $result ) { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} ADD COLUMN `name` mediumtext AFTER `status`; - " ); - } - - return $this->is_success( $result ); - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - - /** - * Upgrade to version 202004051 - * - Update the customer physical address table to have `is_primary` - * - * @since 3.0 - * @return bool - */ - protected function __202004051() { - - $result = $this->column_exists( 'is_primary' ); - if ( false === $result ) { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} ADD COLUMN `is_primary` tinyint SIGNED NOT NULL default '0' AFTER `customer_id`; - " ); - } - - return $this->is_success( $result ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customer-email-addresses.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customer-email-addresses.php deleted file mode 100644 index 7e87081e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customer-email-addresses.php +++ /dev/null @@ -1,101 +0,0 @@ - 202002141, - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL AUTO_INCREMENT, - customer_id bigint(20) unsigned NOT NULL default '0', - type varchar(20) NOT NULL default 'secondary', - status varchar(20) NOT NULL default 'active', - email varchar(100) NOT NULL default '', - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY customer (customer_id), - KEY email (email), - KEY type (type(20)), - KEY status (status(20)), - KEY date_created (date_created)"; - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customer-meta.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customer-meta.php deleted file mode 100644 index a46c2b74..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customer-meta.php +++ /dev/null @@ -1,131 +0,0 @@ - 201807111 - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $max_index_length = 191; - $this->schema = "meta_id bigint(20) unsigned NOT NULL auto_increment, - edd_customer_id bigint(20) unsigned NOT NULL default '0', - meta_key varchar(255) DEFAULT NULL, - meta_value longtext DEFAULT NULL, - PRIMARY KEY (meta_id), - KEY edd_customer_id (edd_customer_id), - KEY meta_key (meta_key({$max_index_length}))"; - } - - /** - * Override the Base class `maybe_upgrade()` routine to do a very unique and - * special check against the old option. - * - * Maybe upgrades the database table from 2.x to 3.x standards. This method - * should be kept up-to-date with schema changes in `set_schema()` above. - * - * - Hooked to the "admin_init" action. - * - Calls the parent class `maybe_upgrade()` method - * - * @since 3.0 - */ - public function maybe_upgrade() { - - if ( $this->needs_initial_upgrade() ) { - - // Delete old/irrelevant database options. - delete_option( $this->table_prefix . 'edd_customermeta_db_version' ); - delete_option( 'wp_edd_customermeta_db_version' ); - - $this->get_db()->query( "ALTER TABLE {$this->table_name} CHANGE `customer_id` `edd_customer_id` bigint(20) unsigned NOT NULL default '0';" ); - $this->get_db()->query( "ALTER TABLE {$this->table_name} DROP INDEX customer_id" ); - $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX edd_customer_id (edd_customer_id)" ); - } - - parent::maybe_upgrade(); - } - - /** - * Whether the initial upgrade from the 1.0 database needs to be run. - * - * @since 3.0.3 - * @return bool - */ - private function needs_initial_upgrade() { - return $this->exists() && $this->column_exists( 'customer_id' ) && ! $this->column_exists( 'edd_customer_id' ); - } - - /** - * Upgrade to version 201807111 - * - Rename `customer_id` column to `edd_customer_id` - * - Add `status` column. - * - * @since 3.0 - * - * @return bool - */ - protected function __201807111() { - - // Alter the database with separate queries so indexes succeed - if ( $this->column_exists( 'customer_id' ) && ! $this->column_exists( 'edd_customer_id' ) ) { - $this->get_db()->query( "ALTER TABLE {$this->table_name} CHANGE `customer_id` `edd_customer_id` bigint(20) unsigned NOT NULL default '0'" ); - $this->get_db()->query( "ALTER TABLE {$this->table_name} DROP INDEX customer_id" ); - $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX edd_customer_id (edd_customer_id)" ); - } - - // Return success/fail - return $this->is_success( true ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customers.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customers.php deleted file mode 100644 index 672db177..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-customers.php +++ /dev/null @@ -1,265 +0,0 @@ - 202006101, - '202301021' => 202301021, - '202303220' => 202303220, - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL AUTO_INCREMENT, - user_id bigint(20) unsigned NOT NULL default '0', - email varchar(100) NOT NULL default '', - name varchar(255) NOT NULL default '', - status varchar(20) NOT NULL default '', - purchase_value decimal(18,9) NOT NULL default '0', - purchase_count bigint(20) unsigned NOT NULL default '0', - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - UNIQUE KEY email (email), - KEY user (user_id), - KEY status (status(20)), - KEY date_created (date_created)"; - } - - /** - * Whether the initial upgrade from the 1.0 database needs to be run. - * - * @since 3.0.3 - * @since 3.1.1 Explicitly checks each of these cases to ensure a non-fully updated table is updated, but not currently used. - * @return bool - */ - private function needs_initial_upgrade() { - if ( $this->exists() && ! $this->column_exists( 'status' ) ) { - return true; - } - - if ( $this->exists() && ! $this->column_exists( 'uuid' ) ) { - return true; - } - - if ( $this->exists() && ! $this->column_exists( 'date_modified' ) ) { - return true; - } - - return false; - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - - /** - * Upgrade to version 202006101 - * - Remove the payment_ids column if it still exists. - * - * @since 3.0 - * @return bool - */ - protected function __202006101() { - - $result = true; - - // Remove the column. - if ( $this->column_exists( 'payment_ids' ) ) { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} DROP `payment_ids` - " ); - } - - return $this->is_success( $result ); - } - - /** - * Checks the status of the edd_customers table for health and state and performs - * any necessary changes that haven't been prevoiusly made. - * - * @since 3.1.1 - * @return bool - */ - protected function __202301021() { - // Verify that columns that existed prior to 3.0 get the proper changes made. - $columns = $this->get_db()->get_results( "SHOW COLUMNS FROM {$this->table_name}" ); - $existing_column_updates = array(); - - // Set an array to hold the result of each query run. - $query_results = array(); - - foreach ( $columns as $column ) { - switch ( $column->Field ) { - case 'email': - if ( 'varchar(100)' !== $column->Type ) { - $existing_column_updates['alter-email-type'] = "ALTER TABLE {$this->table_name} MODIFY `email` varchar(100) NOT NULL default ''"; - } - break; - - case 'name': - if ( 'varchar(255)' !== $column->Type ) { - $existing_column_updates['alter-name-type'] = "ALTER TABLE {$this->table_name} MODIFY `name` varchar(255) NOT NULL default ''"; - } - break; - - case 'user_id': - if ( 'bigint(20)' !== $column->Type ) { - $existing_column_updates['alter-user_id-type'] = "ALTER TABLE {$this->table_name} MODIFY `user_id` bigint(20) unsigned NOT NULL default '0'"; - } - break; - - case 'purchase_value': - if ( 'decimal(18,9)' !== $column->Type ) { - $existing_column_updates['alter-purchase_value-type'] = "ALTER TABLE {$this->table_name} MODIFY `purchase_value` decimal(18,9) NOT NULL default '0'"; - } - break; - - case 'purchase_count': - if ( 'bigint(20)' !== $column->Type ) { - $existing_column_updates['alter-purchase_count-type'] = "ALTER TABLE {$this->table_name} MODIFY `purchase_count` bigint(20) unsigned NOT NULL default '0'"; - } - break; - - case 'date_created': - if ( 'datetime' !== $column->Type ) { - $existing_column_updates['alter-date_created-type'] = "ALTER TABLE {$this->table_name} MODIFY `date_created` datetime NOT NULL default CURRENT_TIMESTAMP"; - } - break; - - case 'payment_ids': - $existing_column_updates['drop-payment_ids'] = "ALTER TABLE {$this->table_name} DROP COLUMN `payment_ids`"; - break; - - case 'notes': - // Only remove the customer notes column if they've already run the customer notes migration. - if ( edd_has_upgrade_completed( 'v30_legacy_data_removed' ) ) { - $existing_column_updates['drop-notes'] = "ALTER TABLE {$this->table_name} DROP COLUMN `notes`"; - } - break; - } - } - - if ( ! empty( $existing_column_updates ) ) { - foreach ( $existing_column_updates as $query_key => $update_sql ) { - $query_results[ $query_key ] = $this->is_success( $this->get_db()->query( $update_sql ) ); - } - } - - // Now verify that new columns are created and exist. - if ( ! $this->column_exists( 'status' ) ) { - $query_results['add-status-column'] = $this->is_success( $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD COLUMN `status` varchar(20) NOT NULL default 'active' AFTER `name`;" ) ); - $query_results['index-status'] = $this->is_success( $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX status (status(20))" ) ); - } - - if ( ! $this->column_exists( 'date_modified' ) ) { - $query_results['add-date_modified-column'] = $this->is_success( $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD COLUMN `date_modified` datetime DEFAULT CURRENT_TIMESTAMP AFTER `date_created`" ) ); - $query_results['update-modified-with-created'] = $this->is_success( $this->get_db()->query( "UPDATE {$this->table_name} SET `date_modified` = `date_created`" ) ); - $query_results['index-date_created'] = $this->is_success( $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX date_created (date_created)" ) ); - } - - if ( ! $this->column_exists( 'uuid' ) ) { - $query_results['add-uuid-column'] = $this->is_success( $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD COLUMN `uuid` varchar(100) default '' AFTER `date_modified`;" ) ); - } - - $return_result = true; - - // Loop through each of the query results and force a debug log for any failures. - foreach ( $query_results as $query_key => $query_result ) { - if ( false === $query_result ) { - $return_result = false; - edd_debug_log( 'Customer\'s table version ' . $this->version . ' update failed for: ' . $query_key, true ); - } - } - - delete_option( $this->table_prefix . 'edd_customers_db_version' ); - delete_option( 'wp_edd_customers_db_version' ); - - return $this->is_success( $return_result ); - } - - /** - * Upgrades the customer database for sites which got into a bit of a snarl with the database versions. - * - * @since 3.1.1.3 - * @return bool - */ - protected function __202303220() { - if ( $this->needs_initial_upgrade() ) { - return $this->__202301021(); - } - - return true; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-log-meta.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-log-meta.php deleted file mode 100644 index 926300a9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-log-meta.php +++ /dev/null @@ -1,60 +0,0 @@ -schema = "meta_id bigint(20) unsigned NOT NULL auto_increment, - edd_log_id bigint(20) unsigned NOT NULL default '0', - meta_key varchar(255) DEFAULT NULL, - meta_value longtext DEFAULT NULL, - PRIMARY KEY (meta_id), - KEY edd_log_id (edd_log_id), - KEY meta_key (meta_key({$max_index_length}))"; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-api-request-meta.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-api-request-meta.php deleted file mode 100644 index 7a1fd204..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-api-request-meta.php +++ /dev/null @@ -1,60 +0,0 @@ -schema = "meta_id bigint(20) unsigned NOT NULL auto_increment, - edd_logs_api_request_id bigint(20) unsigned NOT NULL default '0', - meta_key varchar(255) DEFAULT NULL, - meta_value longtext DEFAULT NULL, - PRIMARY KEY (meta_id), - KEY edd_logs_api_request_id (edd_logs_api_request_id), - KEY meta_key (meta_key({$max_index_length}))"; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-api-requests.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-api-requests.php deleted file mode 100644 index 0b40bf0a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-api-requests.php +++ /dev/null @@ -1,102 +0,0 @@ - 202002141, - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL auto_increment, - user_id bigint(20) unsigned NOT NULL default '0', - api_key varchar(32) NOT NULL default 'public', - token varchar(32) NOT NULL default '', - version varchar(32) NOT NULL default '', - request longtext NOT NULL default '', - error longtext NOT NULL default '', - ip varchar(60) NOT NULL default '', - time varchar(60) NOT NULL default '', - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY user_id (user_id), - KEY date_created (date_created)"; - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-file-download-meta.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-file-download-meta.php deleted file mode 100644 index 011fce67..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-file-download-meta.php +++ /dev/null @@ -1,60 +0,0 @@ -schema = "meta_id bigint(20) unsigned NOT NULL auto_increment, - edd_logs_file_download_id bigint(20) unsigned NOT NULL default '0', - meta_key varchar(255) DEFAULT NULL, - meta_value longtext DEFAULT NULL, - PRIMARY KEY (meta_id), - KEY edd_logs_file_download_id (edd_logs_file_download_id), - KEY meta_key (meta_key({$max_index_length}))"; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-file-downloads.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-file-downloads.php deleted file mode 100644 index 2c26ed9d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs-file-downloads.php +++ /dev/null @@ -1,102 +0,0 @@ - 202002141, - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL auto_increment, - product_id bigint(20) unsigned NOT NULL default '0', - file_id bigint(20) unsigned NOT NULL default '0', - order_id bigint(20) unsigned NOT NULL default '0', - price_id bigint(20) unsigned NOT NULL default '0', - customer_id bigint(20) unsigned NOT NULL default '0', - ip varchar(60) NOT NULL default '', - user_agent varchar(200) NOT NULL default '', - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY customer_id (customer_id), - KEY product_id (product_id), - KEY date_created (date_created)"; - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs.php deleted file mode 100644 index faf06487..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-logs.php +++ /dev/null @@ -1,101 +0,0 @@ - 202002141, - ); - - /** - * Setup the database schema. - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL auto_increment, - object_id bigint(20) unsigned NOT NULL default '0', - object_type varchar(20) DEFAULT NULL, - user_id bigint(20) unsigned NOT NULL default '0', - type varchar(20) DEFAULT NULL, - title varchar(200) DEFAULT NULL, - content longtext DEFAULT NULL, - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY object_id_type (object_id,object_type(20)), - KEY user_id (user_id), - KEY type (type(20)), - KEY date_created (date_created)"; - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-note-meta.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-note-meta.php deleted file mode 100644 index aca2ecc1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-note-meta.php +++ /dev/null @@ -1,60 +0,0 @@ -schema = "meta_id bigint(20) unsigned NOT NULL auto_increment, - edd_note_id bigint(20) unsigned NOT NULL default '0', - meta_key varchar(255) DEFAULT NULL, - meta_value longtext DEFAULT NULL, - PRIMARY KEY (meta_id), - KEY edd_note_id (edd_note_id), - KEY meta_key (meta_key({$max_index_length}))"; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-notes.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-notes.php deleted file mode 100644 index 9ecbdbbf..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-notes.php +++ /dev/null @@ -1,99 +0,0 @@ - 202002141, - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL auto_increment, - object_id bigint(20) unsigned NOT NULL default '0', - object_type varchar(20) NOT NULL default '', - user_id bigint(20) unsigned NOT NULL default '0', - content longtext NOT NULL default '', - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY object_id_type (object_id,object_type(20)), - KEY user_id (user_id), - KEY date_created (date_created)"; - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-addresses.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-addresses.php deleted file mode 100644 index a32036d1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-addresses.php +++ /dev/null @@ -1,174 +0,0 @@ - 201906251, - '201906281' => 201906281, - '202002141' => 202002141, - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $max_index_length = 191; - $this->schema = "id bigint(20) unsigned NOT NULL AUTO_INCREMENT, - order_id bigint(20) unsigned NOT NULL default '0', - type varchar(20) NOT NULL default 'billing', - name mediumtext NOT NULL, - address mediumtext NOT NULL, - address2 mediumtext NOT NULL, - city mediumtext NOT NULL, - region mediumtext NOT NULL, - postal_code varchar(32) NOT NULL default '', - country mediumtext NOT NULL, - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY order_id (order_id), - KEY city (city({$max_index_length})), - KEY region (region({$max_index_length})), - KEY postal_code (postal_code(32)), - KEY country (country({$max_index_length})), - KEY date_created (date_created)"; - } - - /** - * Upgrade to version 201906251 - * - Adds the 'name' column - * - Combines the `first_name` and `last_name` columns to the `name` column. - * - Removes the `first_name` and `last_name` columns. - * - * @since 3.0 - * - * @return boolean - */ - protected function __201906251() { - - $success = true; - - $column_exists = $this->column_exists( 'name' ); - - // Don't take any action if the column already exists. - if ( false === $column_exists ) { - $column_exists = $this->get_db()->query( " - ALTER TABLE {$this->table_name} ADD COLUMN `name` mediumtext NOT NULL AFTER `last_name`; - " ); - - } - - $deprecated_columns_exist = ( $this->column_exists( 'first_name' ) && $this->column_exists( 'last_name' ) ); - if ( $column_exists && $deprecated_columns_exist ) { - $data_merged = $this->get_db()->query( " - UPDATE {$this->table_name} SET name = CONCAT(first_name, ' ', last_name); - " ); - - if ( $data_merged ) { - $success = $this->get_db()->query( " - ALTER TABLE {$this->table_name} DROP first_name, DROP last_name; - " ); - } - } - - return $this->is_success( $success ); - } - - /** - * Upgrade to version 201906281 - * - Add the `type` varchar column - * - * @since 3.0 - * - * @return boolean - */ - protected function __201906281() { - - // Look for column. - $result = $this->column_exists( 'type' ); - - // Maybe add column. - if ( false === $result ) { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} ADD COLUMN `type` varchar(20) default 'billing' AFTER `order_id`; - " ); - } - - // Return success/fail. - return $this->is_success( $result ); - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-adjustment-meta.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-adjustment-meta.php deleted file mode 100644 index 149c30e6..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-adjustment-meta.php +++ /dev/null @@ -1,60 +0,0 @@ -schema = "meta_id bigint(20) unsigned NOT NULL auto_increment, - edd_order_adjustment_id bigint(20) unsigned NOT NULL default '0', - meta_key varchar(255) DEFAULT NULL, - meta_value longtext DEFAULT NULL, - PRIMARY KEY (meta_id), - KEY edd_order_adjustment_id (edd_order_adjustment_id), - KEY meta_key (meta_key({$max_index_length}))"; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-adjustments.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-adjustments.php deleted file mode 100644 index 18224bdf..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-adjustments.php +++ /dev/null @@ -1,187 +0,0 @@ - 202002141, - '202011122' => 202011122, - '202103151' => 202103151, - '202105221' => 202105221, - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL auto_increment, - parent bigint(20) unsigned NOT NULL default '0', - object_id bigint(20) unsigned NOT NULL default '0', - object_type varchar(20) DEFAULT NULL, - type_id bigint(20) unsigned DEFAULT NULL, - type varchar(20) DEFAULT NULL, - type_key varchar(255) DEFAULT NULL, - description varchar(100) DEFAULT NULL, - subtotal decimal(18,9) NOT NULL default '0', - tax decimal(18,9) NOT NULL default '0', - total decimal(18,9) NOT NULL default '0', - rate decimal(10,5) NOT NULL DEFAULT 1.00000, - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY object_id_type (object_id,object_type(20)), - KEY date_created (date_created), - KEY parent (parent)"; - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - - /** - * Upgrade to version 202011122 - * - Change default value to `NULL` for `type_id` column. - * - Add `type_key` column. - * - * @since 3.0 - * @return bool - */ - protected function __202011122() { - - // Update `type_id`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `type_id` bigint(20) default NULL; - " ); - - // Add `type_key`. - $column_exists = $this->column_exists( 'type_key' ); - if ( false === $column_exists ) { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} ADD COLUMN `type_key` varchar(255) default NULL AFTER `type`; - " ); - } else { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY `type_key` varchar(255) default NULL AFTER `type` - " ); - } - - // Change `type_id` with `0` value to `null` to support new default. - $this->get_db()->query( "UPDATE {$this->table_name} SET type_id = null WHERE type_id = 0;" ); - - return $this->is_success( $result ); - } - - /** - * Upgrade to version 202103151 - * - Add column `parent` - * - Add index on `parent` column. - * - * @since 3.0 - * @return bool - */ - protected function __202103151() { - // Look for column - $result = $this->column_exists( 'parent' ); - - // Maybe add column - if ( false === $result ) { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} ADD COLUMN parent bigint(20) unsigned NOT NULL default '0' AFTER id; - " ); - } - - if ( ! $this->index_exists( 'parent' ) ) { - $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX parent (parent)" ); - } - - // Return success/fail. - return $this->is_success( $result ); - } - - /** - * Upgrade to version 202105221 - * - Add `rate` column. - * - * @since 3.0 - * @return bool - */ - protected function __202105221() { - if ( ! $this->column_exists( 'rate' ) ) { - return $this->is_success( - $this->get_db()->query( - "ALTER TABLE {$this->table_name} ADD COLUMN rate decimal(10,5) NOT NULL DEFAULT 1.00000 AFTER total" - ) - ); - } - - return true; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-item-meta.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-item-meta.php deleted file mode 100644 index 4d4358d4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-item-meta.php +++ /dev/null @@ -1,60 +0,0 @@ -schema = "meta_id bigint(20) unsigned NOT NULL auto_increment, - edd_order_item_id bigint(20) unsigned NOT NULL default '0', - meta_key varchar(255) DEFAULT NULL, - meta_value longtext DEFAULT NULL, - PRIMARY KEY (meta_id), - KEY edd_order_item_id (edd_order_item_id), - KEY meta_key (meta_key({$max_index_length}))"; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-items.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-items.php deleted file mode 100644 index 4d128454..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-items.php +++ /dev/null @@ -1,209 +0,0 @@ - 201906241, - '202002141' => 202002141, - '202102010' => 202102010, - '202103151' => 202103151, - '202105221' => 202105221, - '202110141' => 202110141, - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL auto_increment, - parent bigint(20) unsigned NOT NULL default '0', - order_id bigint(20) unsigned NOT NULL default '0', - product_id bigint(20) unsigned NOT NULL default '0', - product_name text NOT NULL default '', - price_id bigint(20) unsigned default null, - cart_index bigint(20) unsigned NOT NULL default '0', - type varchar(20) NOT NULL default 'download', - status varchar(20) NOT NULL default 'pending', - quantity int signed NOT NULL default '0', - amount decimal(18,9) NOT NULL default '0', - subtotal decimal(18,9) NOT NULL default '0', - discount decimal(18,9) NOT NULL default '0', - tax decimal(18,9) NOT NULL default '0', - total decimal(18,9) NOT NULL default '0', - rate decimal(10,5) NOT NULL DEFAULT 1.00000, - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY order_product_price_id (order_id,product_id,price_id), - KEY type_status (type(20),status(20)), - KEY parent (parent)"; - } - - /** - * Upgrade to version 201906241 - * - Make the quantity column signed so it can contain negative numbers. - * - Switch the quantity column from bigint to int for storage optimization. - * - * @since 3.0 - * - * @return bool - */ - protected function __201906241() { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY `quantity` int signed NOT NULL default '0'; - " ); - - // Return success/fail - return $this->is_success( $result ); - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - - /** - * Upgrade to version 202102010. - * - Change default value for `status` column to 'pending'. - * - * @return bool - */ - protected function __202102010() { - // Update `status`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `status` varchar(20) NOT NULL default 'pending'; - " ); - - return $this->is_success( $result ); - } - - /** - * Upgrade to version 202103151 - * - Add column `parent` - * - Add index on `parent` column. - * - * @since 3.0 - * @return bool - */ - protected function __202103151() { - // Look for column - $result = $this->column_exists( 'parent' ); - - // Maybe add column - if ( false === $result ) { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} ADD COLUMN parent bigint(20) unsigned NOT NULL default '0' AFTER id; - " ); - } - - if ( ! $this->index_exists( 'parent' ) ) { - $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX parent (parent)" ); - } - - // Return success/fail. - return $this->is_success( $result ); - } - - /** - * Upgrade to version 202105221 - * - Add `rate` column. - * - * @since 3.0 - * @return bool - */ - protected function __202105221() { - if ( ! $this->column_exists( 'rate' ) ) { - return $this->is_success( - $this->get_db()->query( - "ALTER TABLE {$this->table_name} ADD COLUMN rate decimal(10,5) NOT NULL DEFAULT 1.00000 AFTER total" - ) - ); - } - - return true; - } - - /** - * Upgrade to version 202110141 - * - Change default value for `price_id` to `null`. - * - * @since 3.0 - * @return bool - */ - protected function __202110141() { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN price_id bigint(20) unsigned default null; - " ); - - return $this->is_success( $result ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-meta.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-meta.php deleted file mode 100644 index 58b9aaa1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-meta.php +++ /dev/null @@ -1,60 +0,0 @@ -schema = "meta_id bigint(20) unsigned NOT NULL auto_increment, - edd_order_id bigint(20) unsigned NOT NULL default '0', - meta_key varchar(255) DEFAULT NULL, - meta_value longtext DEFAULT NULL, - PRIMARY KEY (meta_id), - KEY edd_order_id (edd_order_id), - KEY meta_key (meta_key({$max_index_length}))"; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-transactions.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-transactions.php deleted file mode 100644 index 3ba4d8a2..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-order-transactions.php +++ /dev/null @@ -1,161 +0,0 @@ - 202002141, - '202005261' => 202005261, - '202105291' => 202105291, - '202205241' => 202205241, - ); - - /** - * Setup the database schema - * - * @access protected - * @since 3.0 - * @return void - */ - protected function set_schema() { - $this->schema = "id bigint(20) unsigned NOT NULL auto_increment, - object_id bigint(20) unsigned NOT NULL default '0', - object_type varchar(20) NOT NULL default '', - transaction_id varchar(256) NOT NULL default '', - gateway varchar(20) NOT NULL default '', - status varchar(20) NOT NULL default '', - total decimal(18,9) NOT NULL default '0', - rate decimal(10,5) NOT NULL DEFAULT 1.00000, - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY transaction_id (transaction_id(64)), - KEY gateway (gateway(20)), - KEY status (status(20)), - KEY date_created (date_created), - KEY object_type_object_id (object_type, object_id)"; - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - return $this->is_success( $result ); - - } - - /** - * Upgrade to version 202005261 - * - Changed the column length from 64 to 256 in order to account for future updates to gateway data. - * - * @since 3.0 - * - * @return bool - */ - protected function __202005261() { - - // Increase the transaction_id column. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `transaction_id` varchar(256) NOT NULL default ''; - " ); - - return $this->is_success( $result ); - } - - /** - * Upgrade to version 202105291 - * - Add `rate` column. - * - * @since 3.0 - * @return bool - */ - protected function __202105291() { - if ( ! $this->column_exists( 'rate' ) ) { - return $this->is_success( - $this->get_db()->query( - "ALTER TABLE {$this->table_name} ADD COLUMN rate decimal(10,5) NOT NULL DEFAULT 1.00000 AFTER total" - ) - ); - } - - return true; - } - - /** - * Upgrade to version 202205241 - * - Add combined index for object_type, object_id. - * - * @since 3.0 - * @return bool - */ - protected function __202205241() { - if ( $this->index_exists( 'object_type_object_id' ) ) { - return true; - } - - $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX object_type_object_id (object_type, object_id)" ); - - return true; - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-orders.php b/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-orders.php deleted file mode 100644 index 9b83940f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/database/tables/class-orders.php +++ /dev/null @@ -1,304 +0,0 @@ - 201901111, - '202002141' => 202002141, - '202012041' => 202012041, - '202102161' => 202102161, - '202103261' => 202103261, - '202105221' => 202105221, - '202108041' => 202108041, - '202302241' => 202302241, - ); - - /** - * Setup the database schema. - * - * @access protected - * @since 3.0 - */ - protected function set_schema() { - $max_index_length = 191; - $this->schema = "id bigint(20) unsigned NOT NULL auto_increment, - parent bigint(20) unsigned NOT NULL default '0', - order_number varchar(255) NOT NULL default '', - status varchar(20) NOT NULL default 'pending', - type varchar(20) NOT NULL default 'sale', - user_id bigint(20) unsigned NOT NULL default '0', - customer_id bigint(20) unsigned NOT NULL default '0', - email varchar(100) NOT NULL default '', - ip varchar(60) NOT NULL default '', - gateway varchar(100) NOT NULL default 'manual', - mode varchar(20) NOT NULL default '', - currency varchar(20) NOT NULL default '', - payment_key varchar(64) NOT NULL default '', - tax_rate_id bigint(20) DEFAULT NULL, - subtotal decimal(18,9) NOT NULL default '0', - discount decimal(18,9) NOT NULL default '0', - tax decimal(18,9) NOT NULL default '0', - total decimal(18,9) NOT NULL default '0', - rate decimal(10,5) NOT NULL DEFAULT 1.00000, - date_created datetime NOT NULL default CURRENT_TIMESTAMP, - date_modified datetime NOT NULL default CURRENT_TIMESTAMP, - date_completed datetime default null, - date_refundable datetime default null, - uuid varchar(100) NOT NULL default '', - PRIMARY KEY (id), - KEY order_number (order_number({$max_index_length})), - KEY status_type (status, type), - KEY user_id (user_id), - KEY customer_id (customer_id), - KEY email (email(100)), - KEY payment_key (payment_key(64)), - KEY date_created_completed (date_created,date_completed), - KEY currency (currency)"; - } - - /** - * Create the table - * - * @since 3.0 - * - * @return bool - */ - public function create() { - - $created = parent::create(); - - // After successful creation, we need to set the auto_increment for legacy orders. - if ( ! empty( $created ) ) { - - $last_payment_id = $this->get_db()->get_var( "SELECT ID FROM {$this->get_db()->prefix}posts WHERE post_type = 'edd_payment' ORDER BY ID DESC LIMIT 1;" ); - - if ( ! empty( $last_payment_id ) ) { - update_option( 'edd_v3_migration_pending', $last_payment_id, false ); - $auto_increment = $last_payment_id + 1; - $this->get_db()->query( "ALTER TABLE {$this->table_name} AUTO_INCREMENT = {$auto_increment};" ); - } - - } - - return $created; - - } - - /** - * Upgrade to version 201901111 - * - Set any 'publish' status items to 'complete'. - * - * @since 3.0 - * - * @return boolean - */ - protected function __201901111() { - $this->get_db()->query( " - UPDATE {$this->table_name} set `status` = 'complete' WHERE `status` = 'publish'; - " ); - - return $this->is_success( true ); - } - - /** - * Upgrade to version 202002141 - * - Change default value to `CURRENT_TIMESTAMP` for columns `date_created` and `date_modified`. - * - Change default value to `null` for columns `date_completed` and `date_refundable`. - * - * @since 3.0 - * @return bool - */ - protected function __202002141() { - - // Update `date_created`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_created` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_modified`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_modified` datetime NOT NULL default CURRENT_TIMESTAMP; - " ); - - // Update `date_completed`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_completed` datetime default null; - " ); - - if ( $this->is_success( $result ) ) { - $this->get_db()->query( "UPDATE {$this->table_name} SET `date_completed` = NULL WHERE `date_completed` = '0000-00-00 00:00:00'" ); - } - - // Update `date_refundable`. - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `date_refundable` datetime default null; - " ); - - if ( $this->is_success( $result ) ) { - $this->get_db()->query( "UPDATE {$this->table_name} SET `date_refundable` = NULL WHERE `date_refundable` = '0000-00-00 00:00:00'" ); - } - - return $this->is_success( $result ); - - } - - /** - * Upgrade to version 202012041 - * - Add column `tax_rate_id` - * - * @since 3.0 - * @return bool - */ - protected function __202012041() { - // Look for column - $result = $this->column_exists( 'tax_rate_id' ); - - // Maybe add column - if ( false === $result ) { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} ADD COLUMN tax_rate_id bigint(20) DEFAULT NULL AFTER payment_key; - " ); - } - - // Return success/fail. - return $this->is_success( $result ); - } - - /** - * Upgrade to version 202102161 - * - Drop `status` index - * - Create new `status_type` index - * - * @since 3.0 - * @return bool - */ - protected function __202102161() { - if ( $this->index_exists( 'status' ) ) { - $this->get_db()->query( "ALTER TABLE {$this->table_name} DROP INDEX status" ); - } - - if ( ! $this->index_exists( 'status_type' ) ) { - $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX status_type (status, type)" ); - } - - return true; - } - - /** - * Upgrade to version 202103261 - * - Change length of `gateway` column to `100`. - * - * @since 3.0 - * @return bool - */ - protected function __202103261() { - $result = $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `gateway` varchar(100) NOT NULL default ''; - " ); - - return $this->is_success( $result ); - } - - /** - * Upgrade to version 202105221 - * - Add `rate` column. - * - * @since 3.0 - * @return bool - */ - protected function __202105221() { - if ( ! $this->column_exists( 'rate' ) ) { - return $this->is_success( - $this->get_db()->query( - "ALTER TABLE {$this->table_name} ADD COLUMN rate decimal(10,5) NOT NULL DEFAULT 1.00000 AFTER total" - ) - ); - } - - return true; - } - - /** - * Upgrade to version 202108041 - * - Set any empty gateway items to 'manual'. - * - * @since 3.0 - * - * @return boolean - */ - protected function __202108041() { - $this->get_db()->query( " - UPDATE {$this->table_name} set `gateway` = 'manual' WHERE `gateway` = ''; - " ); - - $this->get_db()->query( " - ALTER TABLE {$this->table_name} MODIFY COLUMN `gateway` varchar(100) NOT NULL default 'manual'; - " ); - - return true; - } - - /** - * Upgrade to version 202302241 - * - Set an index for the 'currency' column as we use that in the admin frequenly. - * - * @since 3.1.1 - * - * @return boolean - */ - protected function __202302241() { - - if ( ! $this->index_exists( 'currency' ) ) { - $success = $this->get_db()->query( "ALTER TABLE {$this->table_name} ADD INDEX currency (currency)" ); - } else { - $success = true; - } - - return $this->is_success( $success ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/date-functions.php b/wp-content/plugins/easy-digital-downloads/includes/date-functions.php deleted file mode 100644 index 7703467c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/date-functions.php +++ /dev/null @@ -1,297 +0,0 @@ -utils->date( 'now', edd_get_timezone_id(), false ); - - return date_i18n( $format, (int) $timestamp + $date->getOffset() ); -} - -/** - * Retrieve timezone ID - * - * @since 1.6 - * @return string $timezone The timezone ID - */ -function edd_get_timezone_id() { - return EDD()->utils->get_time_zone( true ); -} - -/** - * Accept an EDD date object and get the UTC equivalent version of it. - * The EDD date object passed-in can be in any timezone. The one you'll get back will be the UTC equivalent of that time. - * This is useful when querying data from the tables by a user-defined date range, like "today". - * - * @since 3.0 - * @param EDD\Utils\Date $edd_date_object The EDD Date object for which you wish to get the UTC equiavalent. - * @return EDD\Utils\Date The EDD date object set at the UTC equivalent time. - */ -function edd_get_utc_equivalent_date( $edd_date_object ) { - - $instance_check = 'EDD\Utils\Date'; - if ( ! $edd_date_object instanceof $instance_check ) { - return false; - } - - // Convert the timezone (and thus, also the time) from the WP/EDD Timezone to the UTC equivalent. - $utc_timezone = new DateTimeZone( 'utc' ); - $edd_date_object->setTimezone( $utc_timezone ); - - return $edd_date_object; -} - -/** - * Accept an EDD date object set in UTC, and get the WP/EDD Timezone equivalent version of it. - * The EDD date object must be in UTC. The one you'll get back will be the WP timezone equivalent of that time. - * This is useful when showing date information to the user, so that they see it in the proper timezone, instead of UTC. - * - * @since 3.0 - * @param EDD\Utils\Date $edd_date_object The EDD Date object for which you wish to get the UTC equiavalent. - * @return EDD\Utils\Date The EDD date object set at the UTC equivalent time. - */ -function edd_get_edd_timezone_equivalent_date_from_utc( $edd_date_object ) { - - $instance_check = 'EDD\Utils\Date'; - if ( ! $edd_date_object instanceof $instance_check ) { - return false; - } - - // If you passed a date object to this function that isn't set to UTC, that is incorrect usage. - if ( 'UTC' !== $edd_date_object->format( 'T' ) ) { - return false; - } - - // Convert the timezone (and thus, also the time) from UTC to the WP/EDD Timezone. - $edd_timezone = new DateTimeZone( edd_get_timezone_id() ); - $edd_date_object->setTimezone( $edd_timezone ); - - return $edd_date_object; -} - -/** - * Get the timezone abbreviation for the WordPress timezone setting. - * - * @since 3.0 - * - * @return string The abreviation for the current WordPress timezone setting. - */ -function edd_get_timezone_abbr() { - $edd_timezone = edd_get_timezone_id(); - $edd_date_object = EDD()->utils->date( 'now', $edd_timezone, true ); - return $edd_date_object->format( 'T' ); -} - -/** - * Retrieves a date format string based on a given short-hand format. - * - * @since 3.0 - * - * @see \EDD_Utilities::get_date_format_string() - * - * @param string $format Shorthand date format string. Accepts 'date', 'time', 'mysql', or - * 'datetime'. If none of the accepted values, the original value will - * simply be returned. Default 'date' represents the value of the - * 'date_format' option. - * - * @return string date_format()-compatible date format string. - */ -function edd_get_date_format( $format = 'date' ) { - return EDD()->utils->get_date_format_string( $format ); -} - -/** - * Get the format used by jQuery UI Datepickers. - * - * Use this if you need to use placeholder or format attributes in input fields. - * - * This is a bit different than `edd_get_date_format()` because these formats - * are exposed to users as hints and also used by jQuery UI so the Datepicker - * knows what format it returns into it's connected input value. - * - * Previous to this function existing, all values were hard-coded, causing some - * inconsistencies across admin-area screens. - * - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/commit/e9855762892b6eec578b0a402f7950f22bd19632 - * - * @since 3.0 - * - * @param string $context The context we are getting the format for. Accepts 'display' or 'js'. - * Use 'js' for use with jQuery UI Datepicker. Use 'display' for HTML attributes. - * @return string - */ -function edd_get_date_picker_format( $context = 'display' ) { - - // What is the context that we are getting the picker format for? - switch ( $context ) { - - // jQuery UI Datepicker does its own thing - case 'js' : - case 'javascript' : - $retval = EDD()->utils->get_date_format_string( 'date-js' ); - break; - - // Used to display in an attribute, placeholder, etc... - case 'display' : - default : - $retval = EDD()->utils->get_date_format_string( 'date-attribute' ); - break; - } - - /** - * Filter the date picker format, allowing for custom overrides - * - * @since 3.0 - * - * @param string $retval Date format for date picker - * @param string $context The context this format is for - */ - return apply_filters( 'edd_get_date_picker_format', $retval, $context ); -} - -/** - * Return an array of values used to populate an hour dropdown - * - * @since 3.0 - * - * @return array - */ -function edd_get_hour_values() { - return (array) apply_filters( 'edd_get_hour_values', array( - '00' => '00', - '01' => '01', - '02' => '02', - '03' => '03', - '04' => '04', - '05' => '05', - '06' => '06', - '07' => '07', - '08' => '08', - '09' => '09', - '10' => '10', - '11' => '11', - '12' => '12', - '13' => '13', - '14' => '14', - '15' => '15', - '16' => '16', - '17' => '17', - '18' => '18', - '19' => '19', - '20' => '20', - '21' => '21', - '22' => '22', - '23' => '23', - '24' => '24' - ) ); -} - -/** - * Return an array of values used to populate a minute dropdown - * - * @since 3.0 - * - * @return array - */ -function edd_get_minute_values() { - return (array) apply_filters( 'edd_get_minute_values', array( - '00' => '00', - '01' => '01', - '02' => '02', - '03' => '03', - '04' => '04', - '05' => '05', - '06' => '06', - '07' => '07', - '08' => '08', - '09' => '09', - '10' => '10', - '11' => '11', - '12' => '12', - '13' => '13', - '14' => '14', - '15' => '15', - '16' => '16', - '17' => '17', - '18' => '18', - '19' => '19', - '20' => '20', - '21' => '21', - '22' => '22', - '23' => '23', - '24' => '24', - '25' => '25', - '26' => '26', - '27' => '27', - '28' => '28', - '29' => '29', - '30' => '30', - '31' => '31', - '32' => '32', - '33' => '33', - '34' => '34', - '35' => '35', - '36' => '36', - '37' => '37', - '38' => '38', - '39' => '39', - '40' => '40', - '41' => '41', - '42' => '42', - '43' => '43', - '44' => '44', - '45' => '45', - '46' => '46', - '47' => '47', - '48' => '48', - '49' => '49', - '50' => '50', - '51' => '51', - '52' => '52', - '53' => '53', - '54' => '54', - '55' => '55', - '56' => '56', - '57' => '57', - '58' => '58', - '59' => '59' - ) ); -} - -/** - * Gets the UTC equivalent of a date in the local timezone. - * - * @since 3.1.4 - * @param string $date_string The date string to convert. - * @param string $format The format to return the date in. - * @return string - */ -function edd_get_utc_date_string( $date_string = 'now', $format = 'Y-m-d H:i:s' ) { - return EDD()->utils->date( $date_string, edd_get_timezone_id(), false )->get_utc_from_local( $format ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/deprecated-functions.php b/wp-content/plugins/easy-digital-downloads/includes/deprecated-functions.php deleted file mode 100644 index 01b82a60..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/deprecated-functions.php +++ /dev/null @@ -1,2154 +0,0 @@ -session->get( 'edd_local_tax_opt_in' ); - return ! empty( $opted_in ); -} - -/** - * Show taxes on individual prices? - * - * @since 1.4 - * @deprecated 1.9 - * @global $edd_options - * @return bool Whether or not to show taxes on prices - */ -function edd_taxes_on_prices() { - global $edd_options; - - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '1.9', 'no alternatives', $backtrace ); - - return apply_filters( 'edd_taxes_on_prices', isset( $edd_options['taxes_on_prices'] ) ); -} - -/** - * Show Has Purchased Item Message - * - * Prints a notice when user has already purchased the item. - * - * @since 1.0 - * @deprecated 1.8 - * @global $user_ID - */ -function edd_show_has_purchased_item_message() { - - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '1.8', 'no alternatives', $backtrace ); - - global $user_ID, $post; - - if ( !isset( $post->ID ) ) { - return; - } - - if ( edd_has_user_purchased( $user_ID, $post->ID ) ) { - $alert = '

    ' . __( 'You have already purchased this item, but you may purchase it again.', 'easy-digital-downloads' ) . '

    '; - echo apply_filters( 'edd_show_has_purchased_item_message', $alert ); - } -} - -/** - * Flushes the total earning cache when a new payment is created - * - * @since 1.2 - * @deprecated 1.8.4 - * @param int $payment Payment ID - * @param array $payment_data Payment Data - * @return void - */ -function edd_clear_earnings_cache( $payment, $payment_data ) { - - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '1.8.4', 'no alternatives', $backtrace ); - - delete_transient( 'edd_total_earnings' ); -} -//add_action( 'edd_insert_payment', 'edd_clear_earnings_cache', 10, 2 ); - -/** - * Get Cart Amount - * - * @since 1.0 - * @deprecated 1.9 - * @param bool $add_taxes Whether to apply taxes (if enabled) (default: true) - * @param bool $local_override Force the local opt-in param - used for when not reading $_POST (default: false) - * @return float Total amount -*/ -function edd_get_cart_amount( $add_taxes = true, $local_override = false ) { - - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '1.9', 'edd_get_cart_subtotal() or edd_get_cart_total()', $backtrace ); - - $amount = edd_get_cart_subtotal( ); - if ( ! empty( $_POST['edd-discount'] ) || edd_get_cart_discounts() !== false ) { - // Retrieve the discount stored in cookies - $discounts = edd_get_cart_discounts(); - - // Check for a posted discount - $posted_discount = isset( $_POST['edd-discount'] ) ? trim( $_POST['edd-discount'] ) : ''; - - if ( $posted_discount && ! in_array( $posted_discount, $discounts ) ) { - // This discount hasn't been applied, so apply it - $amount = edd_get_discounted_amount( $posted_discount, $amount ); - } - - if ( ! empty( $discounts ) ) { - // Apply the discounted amount from discounts already applied - $amount -= edd_get_cart_discounted_amount(); - } - } - - if ( edd_use_taxes() && edd_is_cart_taxed() && $add_taxes ) { - $tax = edd_get_cart_tax(); - $amount += $tax; - } - - if ( $amount < 0 ) { - $amount = 0.00; - } - - return apply_filters( 'edd_get_cart_amount', $amount, $add_taxes, $local_override ); -} - -/** - * Get Purchase Receipt Template Tags - * - * Displays all available template tags for the purchase receipt. - * - * @since 1.6 - * @deprecated 1.9 - * @author Daniel J Griffiths - * @return string $tags - */ -function edd_get_purchase_receipt_template_tags() { - $tags = __('Enter the email that is sent to users after completing a successful purchase. HTML is accepted. Available template tags:','easy-digital-downloads' ) . '
    ' . - '{download_list} - ' . __('A list of download links for each download purchased','easy-digital-downloads' ) . '
    ' . - '{file_urls} - ' . __('A plain-text list of download URLs for each download purchased','easy-digital-downloads' ) . '
    ' . - '{name} - ' . __('The buyer\'s first name','easy-digital-downloads' ) . '
    ' . - '{fullname} - ' . __('The buyer\'s full name, first and last','easy-digital-downloads' ) . '
    ' . - '{username} - ' . __('The buyer\'s user name on the site, if they registered an account','easy-digital-downloads' ) . '
    ' . - '{user_email} - ' . __('The buyer\'s email address','easy-digital-downloads' ) . '
    ' . - '{billing_address} - ' . __('The buyer\'s billing address','easy-digital-downloads' ) . '
    ' . - '{date} - ' . __('The date of the purchase','easy-digital-downloads' ) . '
    ' . - '{subtotal} - ' . __('The price of the purchase before taxes','easy-digital-downloads' ) . '
    ' . - '{tax} - ' . __('The taxed amount of the purchase','easy-digital-downloads' ) . '
    ' . - '{price} - ' . __('The total price of the purchase','easy-digital-downloads' ) . '
    ' . - '{payment_id} - ' . __('The unique ID number for this purchase','easy-digital-downloads' ) . '
    ' . - '{receipt_id} - ' . __('The unique ID number for this purchase receipt','easy-digital-downloads' ) . '
    ' . - '{payment_method} - ' . __('The method of payment used for this purchase','easy-digital-downloads' ) . '
    ' . - '{sitename} - ' . __('Your site name','easy-digital-downloads' ) . '
    ' . - '{receipt_link} - ' . __( 'Adds a link so users can view their receipt directly on your website if they are unable to view it in the browser correctly.', 'easy-digital-downloads' ); - - return apply_filters( 'edd_purchase_receipt_template_tags_description', $tags ); -} - - -/** - * Get Sale Notification Template Tags - * - * Displays all available template tags for the sale notification email - * - * @since 1.7 - * @deprecated 1.9 - * @author Daniel J Griffiths - * @return string $tags - */ -function edd_get_sale_notification_template_tags() { - $tags = __( 'Enter the email that is sent to sale notification emails after completion of a purchase. HTML is accepted. Available template tags:', 'easy-digital-downloads' ) . '
    ' . - '{download_list} - ' . __('A list of download links for each download purchased','easy-digital-downloads' ) . '
    ' . - '{file_urls} - ' . __('A plain-text list of download URLs for each download purchased','easy-digital-downloads' ) . '
    ' . - '{name} - ' . __('The buyer\'s first name','easy-digital-downloads' ) . '
    ' . - '{fullname} - ' . __('The buyer\'s full name, first and last','easy-digital-downloads' ) . '
    ' . - '{username} - ' . __('The buyer\'s user name on the site, if they registered an account','easy-digital-downloads' ) . '
    ' . - '{user_email} - ' . __('The buyer\'s email address','easy-digital-downloads' ) . '
    ' . - '{billing_address} - ' . __('The buyer\'s billing address','easy-digital-downloads' ) . '
    ' . - '{date} - ' . __('The date of the purchase','easy-digital-downloads' ) . '
    ' . - '{subtotal} - ' . __('The price of the purchase before taxes','easy-digital-downloads' ) . '
    ' . - '{tax} - ' . __('The taxed amount of the purchase','easy-digital-downloads' ) . '
    ' . - '{price} - ' . __('The total price of the purchase','easy-digital-downloads' ) . '
    ' . - '{payment_id} - ' . __('The unique ID number for this purchase','easy-digital-downloads' ) . '
    ' . - '{receipt_id} - ' . __('The unique ID number for this purchase receipt','easy-digital-downloads' ) . '
    ' . - '{payment_method} - ' . __('The method of payment used for this purchase','easy-digital-downloads' ) . '
    ' . - '{sitename} - ' . __('Your site name','easy-digital-downloads' ); - - return apply_filters( 'edd_sale_notification_template_tags_description', $tags ); -} - -/** - * Email Template Header - * - * @access private - * @since 1.0.8.2 - * @deprecated 2.0 - * @return string Email template header - */ -function edd_get_email_body_header() { - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '2.0', '', $backtrace ); - - ob_start(); - ?> - - - - - - - - - 'AND', - array( - 'key' => '_edd_payment_purchase_key', - 'value' => $key - ), - array( - 'key' => '_edd_payment_user_email', - 'value' => $email - ) - ); - - $accepted_stati = apply_filters( 'edd_allowed_download_stati', array( 'publish', 'complete' ) ); - - $payments = get_posts( array( 'meta_query' => $meta_query, 'post_type' => 'edd_payment', 'post_status' => $accepted_stati ) ); - - if ( $payments ) { - foreach ( $payments as $payment ) { - - $cart_details = edd_get_payment_meta_cart_details( $payment->ID, true ); - - if ( ! empty( $cart_details ) ) { - foreach ( $cart_details as $cart_key => $cart_item ) { - - if ( $cart_item['id'] != $download_id ) { - continue; - } - - $price_options = isset( $cart_item['item_number']['options'] ) ? $cart_item['item_number']['options'] : false; - $price_id = isset( $price_options['price_id'] ) ? $price_options['price_id'] : false; - - $file_condition = edd_get_file_price_condition( $cart_item['id'], $file_key ); - - // Check to see if the file download limit has been reached - if ( edd_is_file_at_download_limit( $cart_item['id'], $payment->ID, $file_key, $price_id ) ) { - wp_die( apply_filters( 'edd_download_limit_reached_text', __( 'Sorry but you have hit your download limit for this file.', 'easy-digital-downloads' ) ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // If this download has variable prices, we have to confirm that this file was included in their purchase - if ( ! empty( $price_options ) && $file_condition != 'all' && edd_has_variable_prices( $cart_item['id'] ) ) { - if ( $file_condition == $price_options['price_id'] ) { - return $payment->ID; - } - } - - // Make sure the link hasn't expired - - if ( base64_encode( base64_decode( $expire, true ) ) === $expire ) { - $expire = base64_decode( $expire ); // If it is a base64 string, decode it. Old expiration dates were in base64 - } - - if ( current_time( 'timestamp' ) > $expire ) { - wp_die( apply_filters( 'edd_download_link_expired_text', __( 'Sorry but your download link has expired.', 'easy-digital-downloads' ) ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - return $payment->ID; // Payment has been verified and link is still valid - } - } - } - - } else { - wp_die( __( 'No payments matching your request were found.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - // Payment not verified - return false; -} - -/** - * Get Success Page URL - * - * @param string $query_string - * @since 1.0 - * @deprecated 2.6 Please avoid usage of this function in favor of edd_get_success_page_uri() - * @return string -*/ -function edd_get_success_page_url( $query_string = null ) { - - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '2.6', 'edd_get_success_page_uri()', $backtrace ); - - return apply_filters( 'edd_success_page_url', edd_get_success_page_uri( $query_string ) ); -} - -/** - * Reduces earnings and sales stats when a purchase is refunded - * - * @since 1.8.2 - * @param int $payment_id the ID number of the payment - * @param string $new_status the status of the payment, probably "publish" - * @param string $old_status the status of the payment prior to being marked as "complete", probably "pending" - * @deprecated 2.5.7 Please avoid usage of this function in favor of refund() in EDD_Payment - * @internal param Arguments $data passed - */ -function edd_undo_purchase_on_refund( $payment_id, $new_status, $old_status ) { - - $backtrace = debug_backtrace(); - _edd_deprecated_function( 'edd_undo_purchase_on_refund', '2.5.7', 'EDD_Payment->refund()', $backtrace ); - - $payment = new EDD_Payment( $payment_id ); - $payment->refund(); -} - -/** - * Get Earnings By Date - * - * @since 1.0 - * @deprecated 2.7 - * @param int $day Day number - * @param int $month_num Month number - * @param int $year Year - * @param int $hour Hour - * @return int $earnings Earnings - */ -function edd_get_earnings_by_date( $day, $month_num = null, $year = null, $hour = null, $include_taxes = true ) { - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '2.7', 'EDD_Payment_Stats()->get_earnings()', $backtrace ); - - global $wpdb; - - $args = array( - 'post_type' => 'edd_payment', - 'nopaging' => true, - 'year' => $year, - 'monthnum' => $month_num, - 'post_status' => array( 'publish', 'revoked' ), - 'fields' => 'ids', - 'include_taxes' => $include_taxes, - 'update_post_term_cache' => false, - ); - - if ( ! empty( $day ) ) { - $args['day'] = $day; - } - - if ( ! empty( $hour ) || $hour == 0 ) { - $args['hour'] = $hour; - } - - $args = apply_filters( 'edd_get_earnings_by_date_args', $args ); - $cached = get_transient( 'edd_stats_earnings' ); - $key = md5( json_encode( $args ) ); - - if ( ! isset( $cached[ $key ] ) ) { - $sales = get_posts( $args ); - $earnings = 0; - if ( $sales ) { - $sales = implode( ',', $sales ); - - $total_earnings = $wpdb->get_var( "SELECT SUM(meta_value) FROM $wpdb->postmeta WHERE meta_key = '_edd_payment_total' AND post_id IN ({$sales})" ); - $total_tax = 0; - - if ( ! $include_taxes ) { - $total_tax = $wpdb->get_var( "SELECT SUM(meta_value) FROM $wpdb->postmeta WHERE meta_key = '_edd_payment_tax' AND post_id IN ({$sales})" ); - } - - $earnings += ( $total_earnings - $total_tax ); - } - // Cache the results for one hour - $cached[ $key ] = $earnings; - set_transient( 'edd_stats_earnings', $cached, HOUR_IN_SECONDS ); - } - - $result = $cached[ $key ]; - - return round( $result, 2 ); -} - -/** - * Get Sales By Date - * - * @since 1.1.4.0 - * @deprecated 2.7 - * @author Sunny Ratilal - * @param int $day Day number - * @param int $month_num Month number - * @param int $year Year - * @param int $hour Hour - * @return int $count Sales - */ -function edd_get_sales_by_date( $day = null, $month_num = null, $year = null, $hour = null ) { - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '2.7', 'EDD_Payment_Stats()->get_sales()', $backtrace ); - - $args = array( - 'post_type' => 'edd_payment', - 'nopaging' => true, - 'year' => $year, - 'fields' => 'ids', - 'post_status' => array( 'publish', 'revoked' ), - 'update_post_meta_cache' => false, - 'update_post_term_cache' => false - ); - - $show_free = apply_filters( 'edd_sales_by_date_show_free', true, $args ); - - if ( false === $show_free ) { - $args['meta_query'] = array( - array( - 'key' => '_edd_payment_total', - 'value' => 0, - 'compare' => '>', - 'type' => 'NUMERIC', - ), - ); - } - - if ( ! empty( $month_num ) ) { - $args['monthnum'] = $month_num; - } - - if ( ! empty( $day ) ) { - $args['day'] = $day; - } - - if ( ! empty( $hour ) ) { - $args['hour'] = $hour; - } - - $args = apply_filters( 'edd_get_sales_by_date_args', $args ); - - $cached = get_transient( 'edd_stats_sales' ); - $key = md5( json_encode( $args ) ); - - if ( ! isset( $cached[ $key ] ) ) { - $sales = new WP_Query( $args ); - $count = (int) $sales->post_count; - - // Cache the results for one hour - $cached[ $key ] = $count; - set_transient( 'edd_stats_sales', $cached, HOUR_IN_SECONDS ); - } - - $result = $cached[ $key ]; - - return $result; -} - -/** - * Set the Page Style for PayPal Purchase page - * - * @since 1.4.1 - * @deprecated 2.8 - * @return string - */ -function edd_get_paypal_page_style() { - - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '2.8', 'edd_get_paypal_image_url', $backtrace ); - - $page_style = trim( edd_get_option( 'paypal_page_style', 'PayPal' ) ); - return apply_filters( 'edd_paypal_page_style', $page_style ); -} - -/** - * Should we add schema.org microdata? - * - * @since 1.7 - * @since 3.0 - Deprecated as the switch was made to JSON-LD. - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/issues/5240 - * - * @return bool - */ -function edd_add_schema_microdata() { - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '3.0', 'EDD_Structured_Data', $backtrace ); - - // Don't modify anything until after wp_head() is called - $ret = (bool)did_action( 'wp_head' ); - return apply_filters( 'edd_add_schema_microdata', $ret ); -} - -/** - * Add Microdata to download titles - * - * @since 1.5 - * @since 3.0 - Deprecated as the switch was made to JSON-LD. - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/issues/5240 - * - * @param string $title Post Title - * @param int $id Post ID - * @return string $title New title - */ -function edd_microdata_title( $title, $id = 0 ) { - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '3.0', 'EDD_Structured_Data', $backtrace ); - - global $post; - - if ( ! edd_add_schema_microdata() || ! is_object( $post ) ) { - return $title; - } - - if ( $post->ID == $id && is_singular( 'download' ) && 'download' == get_post_type( intval( $id ) ) ) { - $title = '' . $title . ''; - } - - return $title; -} - -/** - * Start Microdata to wrapper download - * - * @since 2.3 - * @since 3.0 - Deprecated as the switch was made to JSON-LD. - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/issues/5240 - * - * @return void - */ -function edd_microdata_wrapper_open( $query ) { - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '3.0', 'EDD_Structured_Data', $backtrace ); - - static $microdata_open = NULL; - - if ( ! edd_add_schema_microdata() || true === $microdata_open || ! is_object( $query ) ) { - return; - } - - if ( $query && ! empty( $query->query['post_type'] ) && $query->query['post_type'] == 'download' && is_singular( 'download' ) && $query->is_main_query() ) { - $microdata_open = true; - echo '
    '; - } -} - -/** - * End Microdata to wrapper download - * - * @since 2.3 - * @since 3.0 - Deprecated as the switch was made to JSON-LD. - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/issues/5240 - * - * @return void - */ -function edd_microdata_wrapper_close() { - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '3.0', 'EDD_Structured_Data', $backtrace ); - - global $post; - - static $microdata_close = NULL; - - if ( ! edd_add_schema_microdata() || true === $microdata_close || ! is_object( $post ) ) { - return; - } - - if ( $post && $post->post_type == 'download' && is_singular( 'download' ) && is_main_query() ) { - $microdata_close = true; - echo '
    '; - } -} - -/** - * Add Microdata to download description - * - * @since 1.5 - * @since 3.0 - Deprecated as the switch was made to JSON-LD. - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/issues/5240 - * - * @param $content - * @return mixed|void New title - */ -function edd_microdata_description( $content ) { - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '3.0', 'EDD_Structured_Data', $backtrace ); - - global $post; - - static $microdata_description = NULL; - - if ( ! edd_add_schema_microdata() || true === $microdata_description || ! is_object( $post ) ) { - return $content; - } - - if ( $post && $post->post_type == 'download' && is_singular( 'download' ) && is_main_query() ) { - $microdata_description = true; - $content = apply_filters( 'edd_microdata_wrapper', '
    ' . $content . '
    ' ); - } - return $content; -} - -/** - * Output schema markup for single price products. - * - * @since 2.6.14 - * @since 3.0 - Deprecated as the switch was made to JSON-LD. - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/issues/5240 - * - * @param int $download_id The download being output. - * @return void - */ -function edd_purchase_link_single_pricing_schema( $download_id = 0, $args = array() ) { - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '3.0', 'EDD_Structured_Data', $backtrace ); - - // Bail if the product has variable pricing, or if we aren't showing schema data. - if ( edd_has_variable_prices( $download_id ) || ! edd_add_schema_microdata() ) { - return; - } - - // Grab the information we need. - $download = new EDD_Download( $download_id ); - ?> - - - - - 403 ) ); - } - - $current_view = 'earnings'; - $views = edd_reports_default_views(); - - if ( isset( $_GET['view'] ) && array_key_exists( $_GET['view'], $views ) ) { - $current_view = $_GET['view']; - } - - /** - * Legacy: fired inside the old global 'Reports' tab. - * - * The dynamic portion of the hook name, `$current_view`, represented the parsed value of - * the 'view' query variable. - * - * @since 1.3 - * @deprecated 3.0 Unused. - */ - edd_do_action_deprecated( 'edd_reports_view_' . $current_view, array(), '3.0' ); - -} - -/** - * Default Report Views - * - * Checks the $_GET['view'] parameter to ensure it exists within the default allowed views. - * - * @param string $default Default view to use. - * - * @since 1.9.6 - * @deprecated 3.0 Unused. - * - * @return string $view Report View - */ -function edd_get_reporting_view( $default = 'earnings' ) { - - _edd_deprecated_function( __FUNCTION__, '3.0' ); - - if ( ! isset( $_GET['view'] ) || ! in_array( $_GET['view'], array_keys( edd_reports_default_views() ) ) ) { - $view = $default; - } else { - $view = $_GET['view']; - } - - /** - * Legacy: filters the current reporting view (now implemented solely via the 'tab' var). - * - * @since 1.9.6 - * @deprecated 3.0 Unused. - * - * @param string $view View slug. - */ - return edd_apply_filters_deprecated( 'edd_get_reporting_view', array( $view ), '3.0' ); -} - -/** - * Renders the Reports Page Views Drop Downs - * - * @since 1.3 - * @deprecated 3.0 Unused. - * - * @return void - */ -function edd_report_views() { - - _edd_deprecated_function( __FUNCTION__, '3.0' ); - - /** - * Legacy: fired before the view actions drop-down was output. - * - * @since 1.3 - * @deprecated 3.0 Unused. - */ - edd_do_action_deprecated( 'edd_report_view_actions', array(), '3.0' ); - - /** - * Legacy: fired after the view actions drop-down was output. - * - * @since 1.3 - * @deprecated 3.0 Unused. - */ - edd_do_action_deprecated( 'edd_report_view_actions_after', array(), '3.0' ); - - return; -} - -/** - * Show report graph date filters. - * - * @since 1.3 - * @deprecated 3.0 Unused. - */ -function edd_reports_graph_controls() { - _edd_deprecated_function( __FUNCTION__, 'EDD 3.0' ); -} - -/** - * Sets up the dates used to filter graph data - * - * Date sent via $_GET is read first and then modified (if needed) to match the - * selected date-range (if any) - * - * @since 1.3 - * @deprecated 3.0 Use \EDD\Reports\get_dates_filter() instead - * @see \EDD\Reports\get_dates_filter() - * - * @param string $timezone Optional. Timezone to force for report filter dates calculations. - * Default is the WP timezone. - * @return array Array of report filter dates. - */ -function edd_get_report_dates( $timezone = null ) { - - _edd_deprecated_function( __FUNCTION__, '3.0', '\EDD\Reports\get_dates_filter' ); - - Reports\Init::bootstrap(); - - add_filter( 'edd_get_dates_filter_range', '\EDD\Reports\compat_filter_date_range' ); - - $filter_dates = Reports\get_dates_filter( 'objects', $timezone ); - $range = Reports\get_dates_filter_range(); - - remove_filter( 'edd_get_report_dates_default_range', '\EDD\Reports\compat_filter_date_range' ); - - $dates = array( - 'range' => $range, - 'day' => $filter_dates['start']->format( 'd' ), - 'day_end' => $filter_dates['end']->format( 'd' ), - 'm_start' => $filter_dates['start']->month, - 'm_end' => $filter_dates['end']->month, - 'year' => $filter_dates['start']->year, - 'year_end' => $filter_dates['end']->year, - ); - - /** - * Filters the legacy list of parsed report dates for use in the Reports API. - * - * @since 1.3 - * @deprecated 3.0 - * - * @param array $dates Array of legacy date parts. - */ - return edd_apply_filters_deprecated( 'edd_report_dates', array( $dates ), '3.0' ); -} - -/** - * Intercept default Edit post links for EDD orders and rewrite them to the View Order Details screen. - * - * @since 1.8.3 - * @deprecated 3.0 No alternative present as get_post() does not work with orders. - * - * @param $url - * @param $post_id - * @param $context - * - * @return string - */ -function edd_override_edit_post_for_payment_link( $url = '', $post_id = 0, $context = '') { - _edd_deprecated_function( __FUNCTION__, '3.0', '' ); - - $post = get_post( $post_id ); - - if ( empty( $post ) ) { - return $url; - } - - if ( 'edd_payment' !== $post->post_type ) { - return $url; - } - - return edd_get_admin_url( array( - 'page' => 'edd-payment-history', - 'view' => 'view-order-details', - 'id' => absint( $post_id ), - ) ); -} - -/** - * Record sale as a log. - * - * Stores log information for a download sale. - * - * @since 1.0 - * @deprecated 3.0 Sales logs are no longed stored. - * - * @param int $download_id Download ID - * @param int $payment_id Payment ID. - * @param int $price_id Optional. Price ID. - * @param string $sale_date Optional. Date of the sale. - */ -function edd_record_sale_in_log( $download_id, $payment_id, $price_id = false, $sale_date = null ) { - _edd_deprecated_function( __FUNCTION__, '3.0' ); - - $edd_logs = EDD()->debug_log; - - $log_data = array( - 'post_parent' => $download_id, - 'log_type' => 'sale', - 'post_date' => ! empty( $sale_date ) ? $sale_date : null, - 'post_date_gmt' => ! empty( $sale_date ) ? get_gmt_from_date( $sale_date ) : null, - ); - - $log_meta = array( - 'payment_id' => $payment_id, - 'price_id' => (int) $price_id, - ); - - $edd_logs->insert_log( $log_data, $log_meta ); -} - -/** - * Outputs the JavaScript code for the Agree to Terms section to toggle - * the T&Cs text - * - * @since 1.0 - * @deprecated 3.0 Moved to external scripts in assets/js/frontend/checkout/components/agree-to-terms - */ -function edd_agree_to_terms_js() { - _edd_deprecated_function( __FUNCTION__, '3.0' ); -} - -/** - * Record payment status change - * - * @since 1.4.3 - * @deprecated since 3.0 - * @param int $payment_id the ID number of the payment. - * @param string $new_status the status of the payment, probably "publish". - * @param string $old_status the status of the payment prior to being marked as "complete", probably "pending". - * @return void - */ -function edd_record_status_change( $payment_id, $new_status, $old_status ) { - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '3.0', 'edd_record_order_status_change', $backtrace ); - - // Get the list of statuses so that status in the payment note can be translated - $stati = edd_get_payment_statuses(); - $old_status = isset( $stati[ $old_status ] ) ? $stati[ $old_status ] : $old_status; - $new_status = isset( $stati[ $new_status ] ) ? $stati[ $new_status ] : $new_status; - - $status_change = sprintf( __( 'Status changed from %s to %s', 'easy-digital-downloads' ), $old_status, $new_status ); - - edd_insert_payment_note( $payment_id, $status_change ); -} - -/** - * Shows checkbox to automatically refund payments made in PayPal. - * - * @deprecated 3.0 In favour of `edd_paypal_refund_checkbox()` - * @see edd_paypal_refund_checkbox() - * - * @since 2.6.0 - * - * @param int $payment_id The current payment ID. - * @return void - */ -function edd_paypal_refund_admin_js( $payment_id = 0 ) { - - $backtrace = debug_backtrace(); - - _edd_deprecated_function( __FUNCTION__, '3.0', 'edd_paypal_refund_checkbox', $backtrace ); - - // If not the proper gateway, return early. - if ( 'paypal' !== edd_get_payment_gateway( $payment_id ) ) { - return; - } - - // If our credentials are not set, return early. - $key = edd_get_payment_meta( $payment_id, '_edd_payment_mode', true ); - $username = edd_get_option( 'paypal_' . $key . '_api_username' ); - $password = edd_get_option( 'paypal_' . $key . '_api_password' ); - $signature = edd_get_option( 'paypal_' . $key . '_api_signature' ); - - if ( empty( $username ) || empty( $password ) || empty( $signature ) ) { - return; - } - - // Localize the refund checkbox label. - $label = __( 'Refund Payment in PayPal', 'easy-digital-downloads' ); - - ?> - - ID ) ) { - return; - } - - if ( empty( $_POST['edd-paypal-refund'] ) ) { - return; - } - - $processed = $payment->get_meta( '_edd_paypal_refunded', true ); - - // If the status is not set to "refunded", return early. - if ( 'complete' !== $payment->old_status && 'revoked' !== $payment->old_status ) { - return; - } - - // If not PayPal/PayPal Express, return early. - if ( 'paypal' !== $payment->gateway ) { - return; - } - - // If the payment has already been refunded in the past, return early. - if ( $processed ) { - return; - } - - // Process the refund in PayPal. - edd_refund_paypal_purchase( $payment ); -} - -/** - * Jilt Callback - * - * Renders Jilt Settings - * - * @deprecated 2.10.2 - * - * @param array $args arguments passed by the setting. - * @return void - */ -function edd_jilt_callback( $args ) { - - _edd_deprecated_function( __FUNCTION__, '2.10.2' ); - - $activated = is_callable( 'edd_jilt' ); - $connected = $activated && edd_jilt()->get_integration()->is_jilt_connected(); - $connect_url = $activated ? edd_jilt()->get_connect_url() : ''; - $account_url = $connected ? edd_jilt()->get_integration()->get_jilt_app_url() : ''; - - echo wp_kses_post( $args['desc'] ); - - if ( $activated ) : - ?> - - - -

    - -

    - -

    - tag, %2$s - tag */ - __( '%1$sClick here%2$s to visit your Jilt dashboard', 'easy-digital-downloads' ), - '', - '' - ) - ); - ?> -

    - - - -

    - - - -

    - - - - - -

    - -

    - - __( 'You do not have permission to do this.', 'easy-digital-downloads' ), - ) - ); - } - - include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; - include_once ABSPATH . 'wp-admin/includes/file.php'; - include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - - $plugins = get_plugins(); - - if ( ! array_key_exists( 'jilt-for-edd/jilt-for-edd.php', $plugins ) ) { - /* - * Use the WordPress Plugins API to get the plugin download link. - */ - $api = plugins_api( - 'plugin_information', - array( - 'slug' => 'jilt-for-edd', - ) - ); - - if ( is_wp_error( $api ) ) { - wp_send_json_error( - array( - 'error' => $api->get_error_message(), - 'debug' => $api, - ) - ); - } - - /* - * Use the AJAX Upgrader skin to quietly install the plugin. - */ - $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() ); - $install = $upgrader->install( $api->download_link ); - if ( is_wp_error( $install ) ) { - wp_send_json_error( - array( - 'error' => $install->get_error_message(), - 'debug' => $api, - ) - ); - } - - activate_plugin( $upgrader->plugin_info() ); - - } else { - - activate_plugin( 'jilt-for-edd/jilt-for-edd.php' ); - } - - /* - * Final check to see if Jilt is available. - */ - if ( ! class_exists( 'EDD_Jilt_Loader' ) ) { - wp_send_json_error( - array( - 'error' => __( 'Something went wrong. Jilt was not installed correctly.', 'easy-digital-downloads' ), - ) - ); - } - - wp_send_json_success(); -} - -/** - * Handle connection for Jilt via AJAX - * - * @deprecated 2.10.2 - * @since n.n.n - */ -function edd_jilt_connect_handler() { - - _edd_deprecated_function( __FUNCTION__, '2.10.2' ); - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_send_json_error( - array( - 'error' => __( 'You do not have permission to do this.', 'easy-digital-downloads' ), - ) - ); - } - - if ( ! is_callable( 'edd_jilt' ) ) { - wp_send_json_error( - array( - 'error' => __( 'Something went wrong. Jilt was not installed correctly.', 'easy-digital-downloads' ), - ) - ); - } - - wp_send_json_success( array( 'connect_url' => edd_jilt()->get_connect_url() ) ); -} - -/** - * Handle disconnection and deactivation for Jilt via AJAX - * - * @deprecated 2.10.2 - * @since n.n.n - */ -function edd_jilt_disconnect_handler() { - - _edd_deprecated_function( __FUNCTION__, '2.10.2' ); - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_send_json_error( - array( - 'error' => __( 'You do not have permission to do this.', 'easy-digital-downloads' ), - ) - ); - } - - if ( is_callable( 'edd_jilt' ) ) { - - edd_jilt()->get_integration()->unlink_shop(); - edd_jilt()->get_integration()->revoke_authorization(); - edd_jilt()->get_integration()->clear_connection_data(); - } - - deactivate_plugins( 'jilt-for-edd/jilt-for-edd.php' ); - - wp_send_json_success(); -} - -/** - * Maybe adds a notice to abandoned payments if Jilt isn't installed. - * - * @deprecated 2.10.2 - * @since n.n.n - * - * @param int $payment_id The ID of the abandoned payment, for which a jilt notice is being thrown. - */ -function maybe_add_jilt_notice_to_abandoned_payment( $payment_id ) { - - _edd_deprecated_function( __FUNCTION__, '2.10.2' ); - - if ( ! is_callable( 'edd_jilt' ) - && ! is_plugin_active( 'recapture-for-edd/recapture.php' ) - && 'abandoned' === edd_get_payment_status( $payment_id ) - && ! get_user_meta( get_current_user_id(), '_edd_try_jilt_dismissed', true ) - ) { - ?> -
    -

    - tag, %2$s - tag, %3$s - tag, %4$s - tag */ - __( '%1$sRecover abandoned purchases like this one.%2$s %3$sTry Jilt for free%4$s.', 'easy-digital-downloads' ), - '', - '', - '', - '' - ) - ); - ?> -

    - 'dismiss_notices', - 'edd_notice' => 'try_jilt', - ) - ) - ), - '" type="button" class="notice-dismiss">', - '', - ' - ' - ) - ); - ?> -
    - SendWP) - $connected = ''; - $connected .= __( 'Access your SendWP account', 'easy-digital-downloads' ); - $connected .= '.'; - - $disconnected = sprintf( - __( 'Note: Email sending is currently disabled. Click here to enable it.', 'easy-digital-downloads' ) - ); - - // Checks if SendWP is connected - $client_connected = function_exists( 'sendwp_client_connected' ) && sendwp_client_connected() ? true : false; - - // Checks if email sending is enabled in SendWP - $forwarding_enabled = function_exists( 'sendwp_forwarding_enabled' ) && sendwp_forwarding_enabled() ? true : false; - - ob_start(); - - echo $args['desc']; - - // Output the appropriate button and label based on connection status - if( $client_connected ) : - ?> -
    -

    - -

    - -

    -
    - -

    - ', '' ); ?> -

    -

    - -

    - - __( 'You do not have permission to do this.', 'easy-digital-downloads' ) - ) ); - } - - include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; - include_once ABSPATH . 'wp-admin/includes/file.php'; - include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - - $plugins = get_plugins(); - - if( ! array_key_exists( 'sendwp/sendwp.php', $plugins ) ) { - - /* - * Use the WordPress Plugins API to get the plugin download link. - */ - $api = plugins_api( 'plugin_information', array( - 'slug' => 'sendwp', - ) ); - - if ( is_wp_error( $api ) ) { - wp_send_json_error( array( - 'error' => $api->get_error_message(), - 'debug' => $api - ) ); - } - - /* - * Use the AJAX Upgrader skin to quietly install the plugin. - */ - $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() ); - $install = $upgrader->install( $api->download_link ); - if ( is_wp_error( $install ) ) { - wp_send_json_error( array( - 'error' => $install->get_error_message(), - 'debug' => $api - ) ); - } - - $activated = activate_plugin( $upgrader->plugin_info() ); - - } else { - - $activated = activate_plugin( 'sendwp/sendwp.php' ); - - } - - /* - * Final check to see if SendWP is available. - */ - if( ! function_exists('sendwp_get_server_url') ) { - wp_send_json_error( array( - 'error' => __( 'Something went wrong. SendWP was not installed correctly.', 'easy-digital-downloads' ) - ) ); - } - - wp_send_json_success( array( - 'partner_id' => 81, - 'register_url' => sendwp_get_server_url() . '_/signup', - 'client_name' => sendwp_get_client_name(), - 'client_secret' => sendwp_get_client_secret(), - 'client_redirect' => admin_url( 'edit.php?post_type=download&page=edd-settings&tab=emails&edd-message=sendwp-connected' ), - ) ); -} -add_action( 'wp_ajax_edd_sendwp_remote_install', 'edd_sendwp_remote_install_handler' ); - -/** - * Handle deactivation of SendWP via ajax - * - * @since 2.9.15 - */ -function edd_sendwp_disconnect () { - - _edd_deprecated_function( __FUNCTION__, '2.11.4' ); - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_send_json_error( array( - 'error' => __( 'You do not have permission to do this.', 'easy-digital-downloads' ) - ) ); - } - - sendwp_disconnect_client(); - - deactivate_plugins( 'sendwp/sendwp.php' ); - - wp_send_json_success(); -} -add_action( 'wp_ajax_edd_sendwp_disconnect', 'edd_sendwp_disconnect' ); - -/** - * Reverts to the original download URL validation. - * - * @since 2.11.4 - * @todo Remove this function in 3.0. - * - * @param bool $ret - * @param string $url - * @param array $query_args - * @param string $original_url - */ -add_filter( 'edd_validate_url_token', function( $ret, $url, $query_args, $original_url ) { - // If the URL is already validated, we don't need to validate it again. - if ( $ret ) { - return $ret; - } - $allowed = edd_get_url_token_parameters(); - $remove = array(); - foreach ( $query_args as $key => $value ) { - if ( ! in_array( $key, $allowed, true ) ) { - $remove[] = $key; - } - } - - if ( ! empty( $remove ) ) { - $original_url = remove_query_arg( $remove, $original_url ); - } - - return isset( $query_args['token'] ) && hash_equals( $query_args['token'], edd_get_download_token( $original_url ) ); -}, 10, 4 ); - -/** - * Get the path of the Product Reviews plugin - * - * @since 2.9.20 - * - * @return mixed|string - */ -function edd_reviews_location() { - - _edd_deprecated_function( __FUNCTION__, '2.11.4' ); - - $possible_locations = array( 'edd-reviews/edd-reviews.php', 'EDD-Reviews/edd-reviews.php' ); - $reviews_location = ''; - - foreach ( $possible_locations as $location ) { - - if ( 0 !== validate_plugin( $location ) ) { - continue; - } - $reviews_location = $location; - } - - return $reviews_location; -} - -/** - * Outputs a metabox for the Product Reviews extension to show or activate it. - * - * @since 2.8 - * @return void - */ -function edd_render_review_status_metabox() { - - _edd_deprecated_function( __FUNCTION__, '2.11.4' ); - - $reviews_location = edd_reviews_location(); - - ob_start(); - - if ( ! empty( $reviews_location ) ) { - $review_path = ''; - $base_url = wp_nonce_url( admin_url( 'plugins.php' ), 'activate-plugin_' . sanitize_key( $reviews_location ) ); - $args = array( - 'action' => 'activate', - 'plugin' => sanitize_text_field( $reviews_location ), - 'plugin_status' => 'all', - ); - $activate_url = add_query_arg( $args, $base_url ); - ?>

    'edit-download', - 'utm_content' => 'product-reviews', - ) - ); - ?> -

    - Product Reviews extension.', 'easy-digital-downloads' ), $url ) ); - ?> -

    - get_sales(); -} - -/** - * Decreases the sale count of a download. Primarily for when a purchase is - * refunded. - * - * @since 1.0.8.1 - * - * @param int $download_id Download ID. - * @param int $quantity Optional. Quantity to decrease by. Default 1. - * - * @return bool|int Updated sale count, false if download does not exist. - */ -function edd_decrease_purchase_count( $download_id = 0, $quantity = 1 ) { - - _edd_deprecated_function( __FUNCTION__, '3.0' ); - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - if ( ! $download ) { - return false; - } - - return $download->get_sales(); -} - -/** - * Increases the total earnings of a download. - * - * @since 1.0 - * - * @param int $download_id Download ID. - * @param float $amount Earnings to increase by. - * - * @return float|false Updated earnings, false if invalid data passed. - */ -function edd_increase_earnings( $download_id = 0, $amount = 0.00 ) { - - _edd_deprecated_function( __FUNCTION__, '3.0' ); - - // Bail if no download ID or amount was passed. - if ( empty( $download_id ) || empty( $amount ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - if ( ! $download ) { - return false; - } - - return $download->get_earnings(); -} - -/** - * Decreases the total earnings of a download. Primarily for when a purchase - * is refunded. - * - * @since 1.0.8.1 - * - * @param int $download_id Download ID. - * @param float $amount Earnings to decrease by. - * - * @return float|false Updated earnings, false if invalid data passed. - */ -function edd_decrease_earnings( $download_id = 0, $amount = 0.00 ) { - - _edd_deprecated_function( __FUNCTION__, '3.0' ); - - // Bail if no download ID or amount was passed. - if ( empty( $download_id ) || empty( $amount ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - if ( ! $download ) { - return false; - } - - return $download->get_earnings(); -} - -/** - * Check to see if we should be displaying promotional content - * - * In various parts of the plugin, we may choose to promote something like a sale for a limited time only. This - * function should be used to set the conditions under which the promotions will display. - * - * @since 2.9.20 - * @deprecated 3.1 - * - * @return bool - */ -function edd_is_promo_active() { - _edd_deprecated_function( __FUNCTION__, '3.1' ); - - return false; -} - -/** - * Outputs a metabox for promotional content. - * - * @since 2.9.20 - * @deprecated 3.1 - * - * @return void - */ -function edd_render_promo_metabox() { - _edd_deprecated_function( __FUNCTION__, '3.1' ); - return; -} - -/** - * Plugin row meta links - * - * @since 1.8 - * @deprecated 3.1 - * @param array $links already defined meta links. - * @param string $file plugin file path and name being processed. - * @return array $input - */ -function edd_plugin_row_meta( $links = array(), $file = '' ) { - _edd_deprecated_function( __FUNCTION__, '3.1' ); - return $links; -} - -/** - * Listens to the updated_postmeta hook for our backwards compatible payment_meta updates, and runs through them - * - * Previously hooked into: updated_postmeta - * - * @since 2.3 - * @deprecated 3.1.0.3 - * @param int $meta_id The Meta ID that was updated - * @param int $object_id The Object ID that was updated (post ID) - * @param string $meta_key The Meta key that was updated - * @param string|int|float $meta_value The Value being updated - * @return bool|int If successful the number of rows updated, if it fails, false - */ -function edd_update_payment_backwards_compat( $meta_id, $object_id, $meta_key, $meta_value ) { - - _edd_deprecated_function( __FUNCTION__, '3.1.0.3' ); - - $meta_keys = array( '_edd_payment_meta', '_edd_payment_tax' ); - - if ( ! in_array( $meta_key, $meta_keys ) ) { - return; - } - - global $wpdb; - switch( $meta_key ) { - - case '_edd_payment_meta': - $meta_value = maybe_unserialize( $meta_value ); - - if( ! isset( $meta_value['tax'] ) ){ - return; - } - - $tax_value = $meta_value['tax']; - - $data = array( 'meta_value' => $tax_value ); - $where = array( 'post_id' => $object_id, 'meta_key' => '_edd_payment_tax' ); - $data_format = array( '%f' ); - $where_format = array( '%d', '%s' ); - break; - - case '_edd_payment_tax': - $tax_value = ! empty( $meta_value ) ? $meta_value : 0; - $current_meta = edd_get_payment_meta( $object_id, '_edd_payment_meta', true ); - - $current_meta['tax'] = $tax_value; - $new_meta = maybe_serialize( $current_meta ); - - $data = array( 'meta_value' => $new_meta ); - $where = array( 'post_id' => $object_id, 'meta_key' => '_edd_payment_meta' ); - $data_format = array( '%s' ); - $where_format = array( '%d', '%s' ); - - break; - - } - - $updated = $wpdb->update( $wpdb->postmeta, $data, $where, $data_format, $where_format ); - - if ( ! empty( $updated ) ) { - // Since we did a direct DB query, clear the postmeta cache. - wp_cache_delete( $object_id, 'post_meta' ); - } - - return $updated; - -} - -/** - * Deletes edd_stats_ transients that have expired to prevent database clogs - * - * Previously hooked into: edd_daily_scheduled_events - * - * @since 2.6.7 - * @deprecated 3.1.0.3 - * @return void -*/ -function edd_cleanup_stats_transients() { - - _edd_deprecated_function( __FUNCTION__, '3.1.0.3' ); - - global $wpdb; - - if ( defined( 'WP_SETUP_CONFIG' ) ) { - return; - } - - if ( defined( 'WP_INSTALLING' ) ) { - return; - } - - $now = current_time( 'timestamp' ); - $transients = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '%\_transient_timeout\_edd\_stats\_%' AND option_value+0 < $now LIMIT 0, 200;" ); - $to_delete = array(); - - if( ! empty( $transients ) ) { - - foreach( $transients as $transient ) { - - $to_delete[] = $transient->option_name; - $to_delete[] = str_replace( '_timeout', '', $transient->option_name ); - - } - - } - - if ( ! empty( $to_delete ) ) { - - $option_names = implode( "','", $to_delete ); - $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')" ); - - } - -} - -/** - * Updates all old payments, prior to 1.2, with new - * meta for the total purchase amount - * - * This is so that payments can be queried by their totals - * - * Prevsiouly hooked into: edd_upgrade_payments - * - * @since 1.2 - * @deprecated 3.1.0.3 - * @param array $data Arguments passed - * @return void -*/ -function edd_update_old_payments_with_totals( $data ) { - _edd_deprecated_function( __FUNCTION__, '3.1.0.3' ); - - if ( ! wp_verify_nonce( $data['_wpnonce'], 'edd_upgrade_payments_nonce' ) ) { - return; - } - - if ( get_option( 'edd_payment_totals_upgraded' ) ) { - return; - } - - $payments = edd_get_payments( array( - 'offset' => 0, - 'number' => 9999999, - 'mode' => 'all', - ) ); - - if ( $payments ) { - foreach ( $payments as $payment ) { - - $payment = new EDD_Payment( $payment->ID ); - $meta = $payment->get_meta(); - - $payment->total = $meta['amount']; - $payment->save(); - } - } - - add_option( 'edd_payment_totals_upgraded', 1 ); -} - -/** - * Flushes the current user's purchase history transient when a payment status - * is updated - * - * Previously hooked into: edd_update_payment_status - * - * @since 1.2.2 - * @deprecated 3.1.0.3 - * @param int $payment_id the ID number of the payment - * @param string $new_status the status of the payment, probably "publish" - * @param string $old_status the status of the payment prior to being marked as "complete", probably "pending" - */ -function edd_clear_user_history_cache( $payment_id, $new_status, $old_status ) { - - _edd_deprecated_function( __FUNCTION__, '3.1.0.3' ); - - $payment = new EDD_Payment( $payment_id ); - - if( ! empty( $payment->user_id ) ) { - delete_transient( 'edd_user_' . $payment->user_id . '_purchases' ); - } -} - -/** - * Filters the WHERE SQL query for the edd_download_search. - * This searches the download titles only, not the excerpt/content. - * - * @since 3.1.0.2 - * @deprecated 3.1.0.5 - * @param string $where - * @param WP_Query $wp_query - * @return string - */ -function edd_ajax_filter_download_where( $where, $wp_query ) { - - _edd_deprecated_function( __FUNCTION__, '3.1.0.5' ); - - $search = new EDD\Downloads\Search(); - - return $search->filter_where( $where, $wp_query ); -} - -/** - * Gets the next available order number. - * - * This is used when inserting a new order. - * - * @deprecated 3.1.2 - * @since 2.0 - * @return false|int $number The next available order number, unformatted. - */ -function edd_get_next_payment_number() { - - _edd_deprecated_function( __FUNCTION__, '3.1.2', 'EDD\Orders\Number\get_next_payment_number' ); - $order_number = new EDD\Orders\Number(); - - return $order_number->get_next_payment_number(); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/deprecated-hooks.php b/wp-content/plugins/easy-digital-downloads/includes/deprecated-hooks.php deleted file mode 100644 index f27ed12d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/deprecated-hooks.php +++ /dev/null @@ -1,272 +0,0 @@ -product_id The product ID. - * @param int $order->id The order ID. - */ -add_action( 'edd_order_receipt_files', function( $filekey, $file, $product_id, $order_id ) { - if ( ! has_action( 'edd_receipt_files' ) ) { - return; - } - $meta = edd_get_payment_meta( $order_id ); - do_action( 'edd_receipt_files', $filekey, $file, $product_id, $order_id, $meta ); -}, 10, 4 ); - - -/** - * Fires after the order receipt bundled items, if needed. - * - * @deprecated 3.0 - * @todo Formally deprecate in EDD 3.1 - * @param int $filekey Index of array of files returned by edd_get_download_files() that this download link is for. - * @param array $file The array of file information. - * @param int $item->product_id The product ID. - * @param array $bundle_item The array of information about the bundled item. - * @param int $order->id The order ID. - */ -add_action( 'edd_order_receipt_bundle_files', function( $filekey, $file, $product_id, $bundle_item, $order_id ) { - if ( ! has_action( 'edd_receipt_bundle_files' ) ) { - return; - } - $meta = edd_get_payment_meta( $order_id ); - do_action( 'edd_receipt_bundle_files', $filekey, $file, $product_id, $bundle_item, $order_id, $meta ); -}, 10, 5 ); - -/** - * Fires at the end of the product cell. - * - * @deprecated 3.0 - * @todo Formally deprecate in EDD 3.1 - * @param \EDD\Orders\Order_Item $item The current order item. - * @param \EDD\Orders\Order $order The current order object. - */ -add_action( 'edd_order_receipt_after_files', function( $item, $order ) { - if ( ! has_action( 'edd_purchase_receipt_after_files' ) ) { - return; - } - $meta = edd_get_payment_meta( $order->id ); - do_action( 'edd_purchase_receipt_after_files', $item->product_id, $order->id, $meta, $item->price_id ); -}, 10, 2 ); - -/** - * Fires before the order receipt table, if needed. - * - * @deprecated 3.0 - * @todo Formally deprecate in EDD 3.1 - * @param \EDD\Orders\Order $order The current order object. - * @param array $edd_receipt_args The shortcode parameters for the receipt. - */ -add_action( 'edd_order_receipt_before_table', function( $order, $edd_receipt_args ) { - if ( ! has_action( 'edd_payment_receipt_before_table' ) ) { - return; - } - $payment = edd_get_payment( $order->id ); - do_action( 'edd_payment_receipt_before_table', $payment, $edd_receipt_args ); -}, 10, 2 ); - -/** - * Fires at the beginning of the order receipt `thead`, if needed. - * - * @deprecated 3.0 - * @todo Formally deprecate in EDD 3.1 - * @param \EDD\Orders\Order $order The current order object. - * @param array $edd_receipt_args The shortcode parameters for the receipt. - */ -add_action( 'edd_order_receipt_before', function( $order, $edd_receipt_args ) { - if ( ! has_action( 'edd_payment_receipt_before' ) ) { - return; - } - $payment = edd_get_payment( $order->id ); - do_action( 'edd_payment_receipt_before', $payment, $edd_receipt_args ); -}, 10, 2 ); - -/** - * Fires at the end of the order receipt `tbody`, if needed. - * - * @deprecated 3.0 - * @todo Formally deprecate in EDD 3.1 - * @param \EDD\Orders\Order $order The current order object. - * @param array $edd_receipt_args The shortcode parameters for the receipt. - */ -add_action( 'edd_order_receipt_after', function( $order, $edd_receipt_args ) { - if ( ! has_action( 'edd_payment_receipt_after' ) ) { - return; - } - $payment = edd_get_payment( $order->id ); - do_action( 'edd_payment_receipt_after', $payment, $edd_receipt_args ); -}, 10, 2 ); - -/** - * Fires after the order receipt table, if needed. - * - * @deprecated 3.0 - * @todo Formally deprecate in EDD 3.1 - * @param \EDD\Orders\Order $order The current order object. - * @param array $edd_receipt_args The shortcode parameters for the receipt. - */ -add_action( 'edd_order_receipt_after_table', function( $order, $edd_receipt_args ) { - if ( ! has_action( 'edd_payment_receipt_after_table' ) ) { - return; - } - $payment = edd_get_payment( $order->id ); - do_action( 'edd_payment_receipt_after_table', $payment, $edd_receipt_args ); -}, 10, 2 ); - -/** - * Fires the edd_before_purchase_history hook in the purchase history, if needed. - * - * @deprecated 3.0 - * @todo Formally deprecate in EDD 3.1 - * @param \EDD\Orders\Order[] $orders The array of the current user's orders. - */ -add_action( 'edd_before_order_history', function( $orders ) { - if ( ! has_action( 'edd_before_purchase_history' ) ) { - return; - } - - $payments = array(); - - if ( ! empty( $orders ) ) { - $order_ids = wp_list_pluck( $orders, 'id' ); - $payments = edd_get_payments( - array( - 'id__in' => $order_ids, - 'orderby' => 'date', - ) - ); - } - - do_action( 'edd_before_purchase_history', $payments ); -} ); - -/** - * Fires at the beginning of the purchase history row, if needed. - * - * @deprecated 3.0 - * @todo Formally deprecate in EDD 3.1 - * @param \EDD\Orders\Order $order The current order object. - */ -add_action( 'edd_order_history_row_start', function( \EDD\Orders\Order $order ) { - if ( ! has_action( 'edd_purchase_history_row_start' ) ) { - return; - } - - $payment = edd_get_payment( $order->id ); - if ( ! $payment ) { - return; - } - - do_action( 'edd_purchase_history_row_start', $payment->ID, $payment->payment_meta ); -} ); - -/** - * Fires at the end of the purchase history row, if needed. - * - * @deprecated 3.0 - * @todo Formally deprecate in EDD 3.1 - * @param \EDD\Orders\Order $order The current order object. - */ -add_action( 'edd_order_history_row_end', function( \EDD\Orders\Order $order ) { - if ( ! has_action( 'edd_purchase_history_row_end' ) ) { - return; - } - - $payment = edd_get_payment( $order->id ); - if ( ! $payment ) { - return; - } - - do_action( 'edd_purchase_history_row_end', $payment->ID, $payment->payment_meta ); -} ); - -/** - * Fires the edd_after_purchase_history hook in the purchase history, if needed. - * - * @deprecated 3.0 - * @todo Formally deprecate in EDD 3.1 - * @param \EDD\Orders\Order[] $orders The array of the current user's orders. - */ -add_action( 'edd_after_order_history', function( $orders ) { - if ( ! has_action( 'edd_after_purchase_history' ) ) { - return; - } - - $payments = array(); - - if ( ! empty( $orders ) ) { - $order_ids = wp_list_pluck( $orders, 'id' ); - $payments = edd_get_payments( - array( - 'id__in' => $order_ids, - 'orderby' => 'date', - ) - ); - } - - do_action( 'edd_after_purchase_history', $payments ); -} ); - -/** - * Fires after the individual download file in the downloads history, if needed. - * - * @deprecated 3.0 - * @todo Formally deprecate in 3.1 - * @param int $filekey Download file ID. - * @param array $file Array of file information. - * @param \EDD\Orders\Order_Item $item The order item object. - * @param \EDD\Orders\Order $order The order object. - */ -add_action( 'edd_download_history_download_file', function( $filekey, $file, $item, $order ) { - if ( ! has_action( 'edd_download_history_files' ) ) { - return; - } - $purchase_data = edd_get_payment_meta( $order->id ); - do_action( 'edd_download_history_files', $filekey, $file, $item->product_id, $order->id, $purchase_data ); -}, 10, 4 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/discount-functions.php b/wp-content/plugins/easy-digital-downloads/includes/discount-functions.php deleted file mode 100644 index 9d8ca234..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/discount-functions.php +++ /dev/null @@ -1,1597 +0,0 @@ -add_item( $data ); - - // Maybe add requirements & exclusions. - if ( ! empty( $discount_id ) ) { - - // Product requirements. - if ( ! empty( $product_requirements ) ) { - if ( is_string( $product_requirements ) ) { - $product_requirements = maybe_unserialize( $product_requirements ); - } - - if ( is_array( $product_requirements ) ) { - foreach ( array_filter( $product_requirements ) as $product_requirement ) { - edd_add_adjustment_meta( $discount_id, 'product_requirement', $product_requirement ); - } - } - } - - // Excluded products. - if ( ! empty( $excluded_products ) ) { - if ( is_string( $excluded_products ) ) { - $excluded_products = maybe_unserialize( $excluded_products ); - } - - if ( is_array( $excluded_products ) ) { - foreach ( array_filter( $excluded_products ) as $excluded_product ) { - edd_add_adjustment_meta( $discount_id, 'excluded_product', $excluded_product ); - } - } - } - - if ( ! empty( $product_condition ) ) { - edd_add_adjustment_meta( $discount_id, 'product_condition', $product_condition ); - } - - // If the end date has passed, mark the discount as expired. - edd_is_discount_expired( $discount_id ); - } - - /** - * Fires after the discount code is inserted. This hook exists for - * backwards compatibility purposes. It uses the $pre_convert_args variable - * to ensure the arguments maintain backwards compatible array keys. - * - * @since 2.7 - * - * @param array $pre_convert_args Discount args. - * @param int $return Discount ID. - */ - do_action( 'edd_post_insert_discount', $pre_convert_args, $discount_id ); - - // Return the new discount ID. - return $discount_id; -} - -/** - * Delete a discount. - * - * @since 3.0 - * - * @param int $discount_id Discount ID. - * @return int - */ -function edd_delete_discount( $discount_id = 0 ) { - $discount = edd_get_discount( $discount_id ); - - // Do not allow for a discount to be deleted if it has been used. - if ( $discount && 0 < $discount->use_count ) { - return false; - } - - $discounts = new EDD\Compat\Discount_Query(); - - // Pre-3.0 pre action. - do_action( 'edd_pre_delete_discount', $discount_id ); - - $retval = $discounts->delete_item( $discount_id ); - - // Pre-3.0 post action. - do_action( 'edd_post_delete_discount', $discount_id ); - - return $retval; -} - -/** - * Get Discount. - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object - * @since 3.0 Updated to call use new query class. - * - * @param int $discount_id Discount ID. - * @return \EDD_Discount|bool EDD_Discount object or false if not found. - */ -function edd_get_discount( $discount_id = 0 ) { - $discounts = new EDD\Compat\Discount_Query(); - - // Return discount - return $discounts->get_item( $discount_id ); -} - -/** - * Get discount by code. - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object - * @since 3.0 Updated to call use new query class. - * @since 3.0 Updated to include a filter. - * - * @param string $code Discount code. - * @return EDD_Discount|bool EDD_Discount object or false if not found. - */ -function edd_get_discount_by_code( $code = '' ) { - $discount = edd_get_discount_by( 'code', $code ); - - /** - * Filters the get discount by request. - * - * @since 3.0 - * - * @param \EDD_Discount $discount Discount object. - * @param string $code Discount code. - */ - return apply_filters( 'edd_get_discount_by_code', $discount, $code ); -} - -/** - * Retrieve discount by a given field - * - * @since 2.0 - * @since 2.7 Updated to use EDD_Discount object - * @since 3.0 Updated to call use new query class. - * - * @param string $field The field to retrieve the discount with. - * @param mixed $value The value for $field. - * @return mixed EDD_Discount|bool EDD_Discount object or false if not found. - */ -function edd_get_discount_by( $field = '', $value = '' ) { - $discounts = new EDD\Compat\Discount_Query(); - - // Return discount - return $discounts->get_item_by( $field, $value ); -} - -/** - * Retrieve discount by a given field - * - * @since 2.0 - * @since 2.7 Updated to use EDD_Discount object - * @since 3.0 Updated to call edd_get_discount() - * - * @param int $discount_id Discount ID. - * @param string $field The field to retrieve the discount with. - * @return mixed object|bool EDD_Discount object or false if not found. - */ -function edd_get_discount_field( $discount_id, $field = '' ) { - $discount = edd_get_discount( $discount_id ); - - // Check that field exists - return isset( $discount->{$field} ) - ? $discount->{$field} - : null; -} - -/** - * Update a discount - * - * @since 3.0 - * @param int $discount_id Discount ID. - * @param array $data - * @return int - */ -function edd_update_discount( $discount_id = 0, $data = array() ) { - - // Pre-3.0 pre action - do_action( 'edd_pre_update_discount', $data, $discount_id ); - - // Product requirements. - if ( isset( $data['product_reqs'] ) && ! empty( $data['product_reqs'] ) ) { - if ( is_string( $data['product_reqs'] ) ) { - $data['product_reqs'] = maybe_unserialize( $data['product_reqs'] ); - } - - if ( is_array( $data['product_reqs'] ) ) { - edd_delete_adjustment_meta( $discount_id, 'product_requirement' ); - - foreach ( $data['product_reqs'] as $product_requirement ) { - edd_add_adjustment_meta( $discount_id, 'product_requirement', $product_requirement ); - } - } - - unset( $data['product_reqs'] ); - } elseif ( isset( $data['product_reqs'] ) ) { - edd_delete_adjustment_meta( $discount_id, 'product_requirement' ); - - // We don't have product conditions when there are no product requirements. - edd_delete_adjustment_meta( $discount_id, 'product_condition' ); - unset( $data['product_condition'] ); - } - - // Excluded products are handled differently. - if ( isset( $data['excluded_products'] ) && ! empty( $data['excluded_products'] ) ) { - if ( is_string( $data['excluded_products'] ) ) { - $data['excluded_products'] = maybe_unserialize( $data['excluded_products'] ); - } - - if ( is_array( $data['excluded_products'] ) ) { - edd_delete_adjustment_meta( $discount_id, 'excluded_product' ); - - foreach ( $data['excluded_products'] as $excluded_product ) { - edd_add_adjustment_meta( $discount_id, 'excluded_product', $excluded_product ); - } - } - - unset( $data['excluded_products'] ); - } elseif( isset( $data['excluded_products'] ) ) { - edd_delete_adjustment_meta( $discount_id, 'excluded_product' ); - } - - if ( isset( $data['product_condition'] ) ) { - $product_condition = sanitize_text_field( $data['product_condition'] ); - edd_update_adjustment_meta( $discount_id, 'product_condition', $product_condition ); - } - - $discounts = new EDD\Compat\Discount_Query(); - - $retval = $discounts->update_item( $discount_id, $data ); - - // Pre-3.0 post action - do_action( 'edd_post_update_discount', $data, $discount_id ); - - return $retval; -} - -/** - * Get Discounts - * - * Retrieves an array of all available discount codes. - * - * @since 1.0 - * @param array $args Query arguments - * @return mixed array if discounts exist, false otherwise - */ -function edd_get_discounts( $args = array() ) { - - // Parse arguments. - $r = wp_parse_args( $args, array( - 'number' => 30 - ) ); - - // Back compat for old query arg. - if ( isset( $r['posts_per_page'] ) ) { - $r['number'] = $r['posts_per_page']; - } - - // Instantiate a query object. - $discounts = new EDD\Compat\Discount_Query(); - - // Return discounts - return $discounts->query( $r ); -} - -/** - * Return total number of discounts - * - * @since 3.0 - * - * @param array $args Arguments. - * @return int - */ -function edd_get_discount_count( $args = array() ) { - - // Parse args. - $r = wp_parse_args( $args, array( - 'count' => true - ) ); - - // Query for count(s). - $discounts = new EDD\Compat\Discount_Query( $r ); - - // Return count(s). - return absint( $discounts->found_items ); -} - -/** - * Query for and return array of discount counts, keyed by status. - * - * @since 3.0 - * - * @return array - */ -function edd_get_discount_counts( $args = array() ) { - - // Parse arguments - $r = wp_parse_args( $args, array( - 'count' => true, - 'groupby' => 'status' - ) ); - - // Query for count. - $counts = new EDD\Compat\Discount_Query( $r ); - - // Format & return - return edd_format_counts( $counts, $r['groupby'] ); -} - -/** - * Query for discount notes. - * - * @since 3.0 - * - * @param int $discount_id Discount ID. - * @return array Retrieved notes. - */ -function edd_get_discount_notes( $discount_id = 0 ) { - return edd_get_notes( array( - 'object_id' => $discount_id, - 'object_type' => 'discount', - 'order' => 'asc' - ) ); -} - -/** - * Checks if there is any active discounts, returns a boolean. - * - * @since 1.0 - * @since 3.0 Updated to be more efficient and make direct calls to the EDD_Discount object. - * - * @return bool - */ -function edd_has_active_discounts() { - - // Query for active discounts. - $discounts = edd_get_discounts( array( - 'number' => 10, - 'status' => 'active' - ) ); - - // Bail if none. - if ( empty( $discounts ) ) { - return false; - } - - // Check each discount for active status, applying filters, etc... - foreach ( $discounts as $discount ) { - /** @var $discount EDD_Discount */ - if ( $discount->is_active( false, true ) ) { - return true; - } - } - - return false; -} - -/** - * Stores a discount code. If the code already exists, it updates it, otherwise - * it creates a new one. - * - * @internal This method exists for backwards compatibility. `edd_add_discount()` should be used. - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to use new query class. - * @deprecated 3.0 Use edd_add_discount() - * - * @param array $details Discount args. - * @param int $discount_id Discount ID. - * @return mixed bool|int The discount ID of the discount code, or false on failure. - */ -function edd_store_discount( $details, $discount_id = null ) { - - edd_debug_log( - sprintf( - __( '%1$s is deprecated since Easy Digital Downloads version %2$s! Use %3$s instead.', 'easy-digital-downloads' ), - __FUNCTION__, - '3.0', - 'edd_add_discount()' - ), - true - ); - - // Set default return value to false. - $return = false; - - // Back-compat for start date. - if ( isset( $details['start'] ) && strstr( $details['start'], '/' ) ) { - $time_format = date( 'H:i:s', strtotime( $details['start'] ) ); - $date_format = date( 'Y-m-d', strtotime( $details['start'] ) ) . ' ' . $time_format; - $details['start_date'] = edd_get_utc_equivalent_date( EDD()->utils->date( $date_format, edd_get_timezone_id(), false )); - unset( $details['start'] ); - } - - // Back-compat for end date. - if ( isset( $details['expiration'] ) && strstr( $details['expiration'], '/' ) ) { - $time_format = date( 'H:i:s', strtotime( $details['expiration'] ) ); - $date_format = date( 'Y-m-d', strtotime( $details['expiration'] ) ) . ' ' . ( '00:00:00' !== $time_format ? $time_format : '23:59:59' ); - $details['end_date'] = edd_get_utc_equivalent_date( EDD()->utils->date( $date_format, edd_get_timezone_id(), false ) ); - unset( $details['expiration'] ); - } - - /** - * Filters the args before being inserted into the database. This hook - * exists for backwards compatibility purposes. - * - * @since 2.7 - * - * @param array $details Discount args. - */ - $details = apply_filters( 'edd_insert_discount', $details ); - - /** - * Fires before the discount has been added to the database. This hook - * exists for backwards compatibility purposes. It fires before the - * call to `EDD_Discount::convert_legacy_args` to ensure the arguments - * maintain backwards compatible array keys. - * - * @since 2.7 - * - * @param array $details Discount args. - */ - do_action( 'edd_pre_insert_discount', $details ); - - // Convert legacy arguments to new ones accepted by `edd_add_discount()`. - $details = EDD_Discount::convert_legacy_args( $details ); - - if ( null === $discount_id ) { - $return = (int) edd_add_discount( $details ); - } else { - edd_update_discount( $discount_id, $details ); - $return = $discount_id; - } - - return $return; -} - -/** - * Deletes a discount code. - * - * @internal This method exists for backwards compatibility. `edd_delete_discount()` should be used. - * - * @since 1.0 - * @deprecated 3.0 - * - * @param int $discount_id Discount ID. - */ -function edd_remove_discount( $discount_id = 0 ) { - edd_delete_discount( $discount_id ); -} - -/** - * Updates a discount status from one status to another. - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount() - * - * @param int $discount_id Discount ID (default: 0) - * @param string $new_status New status (default: active) - * - * @return bool Whether the status has been updated or not. - */ -function edd_update_discount_status( $discount_id = 0, $new_status = 'active' ) { - - // Bail if an invalid ID is passed. - if ( $discount_id <= 0 ) { - return false; - } - - // Set defaults. - $updated = false; - $new_status = sanitize_key( $new_status ); - $discount = edd_get_discount( $discount_id ); - - // No change. - if ( $new_status === $discount->status ) { - return true; - } - - // Try to update status. - if ( ! empty( $discount->id ) ) { - $updated = (bool) edd_update_discount( $discount->id, array( - 'status' => $new_status - ) ); - } - - // Return. - return $updated; -} - -/** - * Checks to see if a discount code already exists. - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount(). - * - * @param int $discount_id Discount ID. - * - * @return bool Whether or not the discount exists. - */ -function edd_discount_exists( $discount_id ) { - $discount = edd_get_discount( $discount_id ); - - return $discount instanceof EDD_Discount && $discount->exists(); -} - -/** - * Checks whether a discount code is active. - * - * @since 1.0 - * @since 2.6.11 Added $update parameter. - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount(). - * - * @param int $discount_id Discount ID. - * @param bool $update Update the discount to expired if an one is found but has an active status/ - * @param bool $set_error Whether an error message should be set in session. - * @return bool Whether or not the discount is active. - */ -function edd_is_discount_active( $discount_id = 0, $update = true, $set_error = true ) { - $discount = edd_get_discount( $discount_id ); - - if ( ! $discount instanceof EDD_Discount ) { - return false; - } - - return $discount->is_active( $update, $set_error ); -} - -/** - * Retrieve the discount code. - * - * @since 1.4 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_field() - * - * @param int $discount_id Discount ID. - * @return string $code Discount Code. - */ -function edd_get_discount_code( $discount_id = 0 ) { - return edd_get_discount_field( $discount_id, 'code' ); -} - -/** - * Retrieve the discount code start date. - * - * @since 1.4 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_field() - * - * @param int $discount_id Discount ID. - * @return string $start Discount start date. - */ -function edd_get_discount_start_date( $discount_id = 0 ) { - return edd_get_discount_field( $discount_id, 'start_date' ); -} - -/** - * Retrieve the discount code expiration date. - * - * @since 1.4 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_field() - * - * @param int $discount_id Discount ID. - * @return string $expiration Discount expiration. - */ -function edd_get_discount_expiration( $discount_id = 0 ) { - return edd_get_discount_field( $discount_id, 'end_date' ); -} - -/** - * Retrieve the maximum uses that a certain discount code. - * - * @since 1.4 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_field() - * - * @param int $discount_id Discount ID. - * @return int $max_uses Maximum number of uses for the discount code. - */ -function edd_get_discount_max_uses( $discount_id = 0 ) { - return edd_get_discount_field( $discount_id, 'max_uses' ); -} - -/** - * Retrieve number of times a discount has been used. - * - * @since 1.4 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_field(). - * - * @param int $discount_id Discount ID. - * @return int $uses Number of times a discount has been used. - */ -function edd_get_discount_uses( $discount_id = 0 ) { - return (int) edd_get_discount_field( $discount_id, 'use_count' ); -} - -/** - * Retrieve the minimum purchase amount for a discount. - * - * @since 1.4 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_field(). - * - * @param int $discount_id Discount ID. - * @return float $min_price Minimum purchase amount. - */ -function edd_get_discount_min_price( $discount_id = 0 ) { - return edd_format_amount( edd_get_discount_field( $discount_id, 'min_charge_amount' ) ); -} - -/** - * Retrieve the discount amount. - * - * @since 1.4 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_field(). - * - * @param int $discount_id Discount ID. - * @return float $amount Discount amount. - */ -function edd_get_discount_amount( $discount_id = 0 ) { - return edd_get_discount_field( $discount_id, 'amount' ); -} - -/** - * Retrieve the discount type - * - * @since 1.4 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_field(). - * - * @param int $discount_id Discount ID. - * @return string $type Discount type - */ -function edd_get_discount_type( $discount_id = 0 ) { - return edd_get_discount_field( $discount_id, 'type' ); -} - -/** - * Retrieve the products the discount cannot be applied to. - * - * @since 1.9 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount() - * - * @param int $discount_id Discount ID. - * @return array $excluded_products IDs of the required products. - */ -function edd_get_discount_excluded_products( $discount_id = 0 ) { - $discount = edd_get_discount( $discount_id ); - - return $discount instanceof EDD_Discount ? $discount->excluded_products : array(); -} - -/** - * Retrieve the discount product requirements. - * - * @since 1.5 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount() - * - * @param int $discount_id Discount ID. - * @return array $product_reqs IDs of the required products. - */ -function edd_get_discount_product_reqs( $discount_id = 0 ) { - $discount = edd_get_discount( $discount_id ); - - return $discount instanceof EDD_Discount ? $discount->product_reqs : array(); -} - -/** - * Retrieve the product condition. - * - * @since 1.5 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_field() - * - * @param int $discount_id Discount ID. - * - * @return string Product condition. - */ -function edd_get_discount_product_condition( $discount_id = 0 ) { - $discount = edd_get_discount( $discount_id ); - - return $discount instanceof EDD_Discount ? $discount->product_condition : ''; -} - -/** - * Retrieves the discount status label. - * - * @since 2.9 - * - * @param int $discount_id Discount ID. - * @return string Product condition. - */ -function edd_get_discount_status_label( $discount_id = null ) { - $discount = edd_get_discount( $discount_id ); - - return $discount instanceof EDD_Discount ? $discount->get_status_label() : ''; -} - -/** - * Check if a discount is not global. - * - * By default discounts are applied to all products in the cart. Non global discounts are - * applied only to the products selected as requirements. - * - * @since 1.5 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Please use edd_get_discount_scope() instead. - * - * @param int $discount_id Discount ID. - * - * @return boolean Whether or not discount code is not global. - */ -function edd_is_discount_not_global( $discount_id = 0 ) { - return ( 'not_global' === edd_get_discount_field( $discount_id, 'scope' ) ); -} - -/** - * Retrieve the discount scope. - * - * By default this will return "global" as discounts are applied to all products in the cart. Non global discounts are - * applied only to the products selected as requirements. - * - * @since 3.0 - * - * @param int $discount_id Discount ID. - * - * @return string global or not_global. - */ -function edd_get_discount_scope( $discount_id = 0 ) { - return edd_get_discount_field( $discount_id, 'scope' ); -} - -/** - * Checks whether a discount code is expired. - * - * @since 1.0 - * @since 2.6.11 Added $update parameter. - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount() - * - * @param int $discount_id Discount ID. - * @param bool $update Update the discount to expired if an one is found but has an active status. - * @return bool Whether on not the discount has expired. - */ -function edd_is_discount_expired( $discount_id = 0, $update = true ) { - $discount = edd_get_discount( $discount_id ); - return ! empty( $discount->id ) - ? $discount->is_expired( $update ) - : false; -} - -/** - * Checks whether a discount code is available to use yet (start date). - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount() - * - * @param int $discount_id Discount ID. - * @param bool $set_error Whether an error message be set in session. - * @return bool Is discount started? - */ -function edd_is_discount_started( $discount_id = 0, $set_error = true ) { - $discount = edd_get_discount( $discount_id ); - return ! empty( $discount->id ) - ? $discount->is_started( $set_error ) - : false; -} - -/** - * Is Discount Maxed Out. - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount() - * - * @param int $discount_id Discount ID. - * @param bool $set_error Whether an error message be set in session. - * @return bool Is discount maxed out? - */ -function edd_is_discount_maxed_out( $discount_id = 0, $set_error = true ) { - $discount = edd_get_discount( $discount_id ); - return ! empty( $discount->id ) - ? $discount->is_maxed_out( $set_error ) - : false; -} - -/** - * Checks to see if the minimum purchase amount has been met. - * - * @since 1.1.7 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount() - * - * @param int $discount_id Discount ID. - * @param bool $set_error Whether an error message be set in session. - * @return bool Whether the minimum amount has been met or not. - */ -function edd_discount_is_min_met( $discount_id = 0, $set_error = true ) { - $discount = edd_get_discount( $discount_id ); - return ! empty( $discount->id ) - ? $discount->is_min_price_met( $set_error ) - : false; -} - -/** - * Is the discount limited to a single use per customer? - * - * @since 1.5 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_field() - * - * @param int $discount_id Discount ID. - * - * @return bool Whether the discount is single use or not. - */ -function edd_discount_is_single_use( $discount_id = 0 ) { - return (bool) edd_get_discount_field( $discount_id, 'once_per_customer' ); -} - -/** - * Checks to see if the required products are in the cart - * - * @since 1.5 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount() - * - * @param int $discount_id Discount ID. - * @param bool $set_error Whether an error message be set in session. - * @return bool Are required products in the cart for the discount to hold. - */ -function edd_discount_product_reqs_met( $discount_id = 0, $set_error = true ) { - $discount = edd_get_discount( $discount_id ); - - return $discount instanceof EDD_Discount && $discount->is_product_requirements_met( $set_error ); -} - -/** - * Checks to see if a user has already used a discount. - * - * @since 1.1.5 - * @since 1.5 Added $discount_id parameter. - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount() - * - * @param string $code Discount Code. - * @param string $user User info. - * @param int $discount_id Discount ID. - * @param bool $set_error Whether an error message be set in session - * - * @return bool $return Whether the the discount code is used. - */ -function edd_is_discount_used( $code = null, $user = '', $discount_id = 0, $set_error = true ) { - $discount = ( null == $code ) - ? edd_get_discount( $discount_id ) - : edd_get_discount_by_code( $code ); - - return $discount instanceof EDD_Discount && $discount->is_used( $user, $set_error ); -} - -/** - * Check whether a discount code is valid (when purchasing). - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_by_code() - * - * @param string $code Discount Code. - * @param string $user User info. - * @param bool $set_error Whether an error message be set in session. - * @return bool Whether the discount code is valid. - */ -function edd_is_discount_valid( $code = '', $user = '', $set_error = true ) { - $discount = edd_get_discount_by_code( $code ); - - if ( ! empty( $discount->id ) ) { - return $discount->is_valid( $user, $set_error ); - } elseif ( $set_error ) { - edd_set_error( 'edd-discount-error', _x( 'This discount is invalid.', 'error for when a discount is invalid based on its configuration', 'easy-digital-downloads' ) ); - return false; - } else { - return false; - } -} - -/** - * Retrieves a discount ID from the code. - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_by_code() - * - * @param string $code Discount code. - * @return int|bool Discount ID, or false if discount does not exist. - */ -function edd_get_discount_id_by_code( $code = '' ) { - $discount = edd_get_discount_by_code( $code ); - - return ( $discount instanceof EDD_Discount ) ? $discount->id : false; -} - -/** - * Get Discounted Amount. - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_by_code() - * - * @param string $code Code to calculate a discount for. - * @param mixed string|int $base_price Price before discount. - * @return string Amount after discount. - */ -function edd_get_discounted_amount( $code = '', $base_price = 0 ) { - $discount = edd_get_discount_by_code( $code ); - - return ! empty( $discount->id ) - ? $discount->get_discounted_amount( $base_price ) - : $base_price; -} - -/** - * Increases the use count of a discount code. - * - * @since 1.0 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_by_code() - * - * @param string $code Discount code to be incremented. - * @return int New usage. - */ -function edd_increase_discount_usage( $code = '' ) { - $discount = edd_get_discount_by_code( $code ); - - // Increase if discount exists - return ! empty( $discount->id ) - ? (int) $discount->increase_usage() - : false; -} - -/** - * Decreases the use count of a discount code. - * - * @since 2.5.7 - * @since 2.7 Updated to use EDD_Discount object. - * @since 3.0 Updated to call edd_get_discount_by_code() - * - * @param string $code Discount code to be decremented. - * @return int New usage. - */ -function edd_decrease_discount_usage( $code = '' ) { - $discount = edd_get_discount_by_code( $code ); - - // Decrease if discount exists - return ! empty( $discount->id ) - ? (int) $discount->decrease_usage() - : false; -} - -/** - * Format Discount Rate - * - * @since 1.0 - * @param string $type Discount code type - * @param string|int $amount Discount code amount - * @return string $amount Formatted amount - */ -function edd_format_discount_rate( $type = '', $amount = '' ) { - return ( 'flat' === $type ) - ? edd_currency_filter( edd_format_amount( $amount ) ) - : edd_format_amount( $amount ) . '%'; -} - -/** - * Retrieves a discount amount for an item. - * - * Calculates an amount based on the context of other items. - * - * @since 3.0 - * - * @global float $edd_flat_discount_total Track flat rate discount total for penny adjustments. - * @link https://github.com/easydigitaldownloads/easy-digital-downloads/issues/2757 - * - * @param array $item { - * Order Item data, matching Cart line item format. - * - * @type string $id Download ID. - * @type array $options { - * Download options. - * - * @type string $price_id Download Price ID. - * } - * @type int $quantity Purchase quantity. - * } - * @param array $items All items (including item being calculated). - * @param \EDD_Discount[]|string[] $discounts Discount to determine adjustment from. - * A discount code can be passed as a string. - * @param int $item_unit_price (Optional) Pass in a defined price for a specific context, such as the cart. - * @return float Discount amount. 0 if Discount is invalid or no Discount is applied. - */ -function edd_get_item_discount_amount( $item, $items, $discounts, $item_unit_price = false ) { - global $edd_flat_discount_total; - - // Validate item. - if ( empty( $item ) || empty( $item['id'] ) ) { - return 0; - } - - if ( ! isset( $item['quantity'] ) ) { - return 0; - } - - if ( ! isset( $item['options'] ) ) { - $item['options'] = array(); - - /* - * Support for variable pricing when the `item_number` key is set (cart details). - */ - if ( isset( $item['item_number']['options'] ) ) { - $item['options'] = $item['item_number']['options']; - } - } - - // Validate and normalize Discounts. - $discounts = array_map( - function( $discount ) { - // Convert a Discount code to a Discount object. - if ( is_string( $discount ) ) { - $discount = edd_get_discount_by_code( $discount ); - } - - if ( ! $discount instanceof \EDD_Discount ) { - return false; - } - - return $discount; - }, - $discounts - ); - - $discounts = array_filter( $discounts ); - - if ( false === $item_unit_price ) { - // Determine the price of the item. - if ( edd_has_variable_prices( $item['id'] ) ) { - // Mimics the original behavior of `\EDD_Cart::get_item_amount()` that - // does not fallback to the first Price ID if none is provided. - if ( ! isset( $item['options']['price_id'] ) ) { - return 0; - } - - $item_unit_price = edd_get_price_option_amount( $item['id'], $item['options']['price_id'] ); - } else { - $item_unit_price = edd_get_download_price( $item['id'] ); - } - } - - $item_amount = ( $item_unit_price * $item['quantity'] ); - $discount_amount = 0; - - foreach ( $discounts as $discount ) { - $reqs = $discount->get_product_reqs(); - $excluded_products = $discount->get_excluded_products(); - - // Make sure requirements are set and that this discount shouldn't apply to the whole cart. - if ( ! empty( $reqs ) && 'global' !== $discount->get_scope() ) { - // This is a product(s) specific discount. - foreach ( $reqs as $download_id ) { - if ( $download_id == $item['id'] && ! in_array( $item['id'], $excluded_products ) ) { - $discount_amount += ( $item_amount - $discount->get_discounted_amount( $item_amount ) ); - } - } - } else { - // This is a global cart discount. - if ( ! in_array( $item['id'], $excluded_products ) ) { - if ( 'flat' === $discount->get_type() ) { - // In order to correctly record individual item amounts, global flat rate discounts - // are distributed across all items. - // - // The discount amount is divided by the number of items in the cart and then a - // portion is evenly applied to each item. - $items_amount = 0; - - foreach ( $items as $i ) { - - if ( ! in_array( $i['id'], $excluded_products ) ) { - $i_amount = 0; - - if ( edd_has_variable_prices( $i['id'] ) ) { - $price_id = isset( $i['options']['price_id'] ) ? $i['options']['price_id'] : $i['item_number']['options']['price_id']; - $i_amount = edd_get_price_option_amount( $i['id'], $price_id ); - } else { - $i_amount = edd_get_download_price( $i['id'] ); - } - - $items_amount += ( $i_amount * $i['quantity'] ); - } - } - - $subtotal_percent = ! empty( $items_amount ) ? ( $item_amount / $items_amount ) : 0; - $discount_amount += ( $discount->get_amount() * $subtotal_percent ); - - $edd_flat_discount_total += round( $discount_amount, edd_currency_decimal_filter() ); - - if ( $item['id'] === end( $items )['id'] && $edd_flat_discount_total < $discount->get_amount() ) { - $adjustment = ( $discount->get_amount() - $edd_flat_discount_total ); - $discount_amount += $adjustment; - } - - if ( $discount_amount > $item_amount ) { - $discount_amount = $item_amount; - } - } else { - $discount_amount += ( $item_amount - $discount->get_discounted_amount( $item_amount ) ); - } - } - } - } - - return $discount_amount; -} - -/** Cart **********************************************************************/ - -/** - * Set the active discount for the shopping cart - * - * @since 1.4.1 - * @param string $code Discount code - * @return string[] All currently active discounts - */ -function edd_set_cart_discount( $code = '' ) { - - // Get all active cart discounts - if ( edd_multiple_discounts_allowed() ) { - $discounts = edd_get_cart_discounts(); - - // Only one discount allowed per purchase, so override any existing - } else { - $discounts = false; - } - - if ( $discounts ) { - $key = array_search( strtolower( $code ), array_map( 'strtolower', $discounts ) ); - - // Can't set the same discount more than once - if ( false !== $key ) { - unset( $discounts[ $key ] ); - } - $discounts[] = $code; - } else { - $discounts = array(); - $discounts[] = $code; - } - - EDD()->session->set( 'cart_discounts', implode( '|', $discounts ) ); - - do_action( 'edd_cart_discount_set', $code, $discounts ); - do_action( 'edd_cart_discounts_updated', $discounts ); - - return $discounts; -} - -/** - * Remove an active discount from the shopping cart - * - * @since 1.4.1 - * @param string $code Discount code - * @return array $discounts All remaining active discounts - */ -function edd_unset_cart_discount( $code = '' ) { - $discounts = edd_get_cart_discounts(); - - if ( $discounts ) { - $discounts = array_map( 'strtoupper', $discounts ); - $key = array_search( strtoupper( $code ), $discounts ); - - if ( false !== $key ) { - unset( $discounts[ $key ] ); - } - - $discounts = implode( '|', array_values( $discounts ) ); - // update the active discounts - EDD()->session->set( 'cart_discounts', $discounts ); - } - - do_action( 'edd_cart_discount_removed', $code, $discounts ); - do_action( 'edd_cart_discounts_updated', $discounts ); - - return $discounts; -} - -/** - * Remove all active discounts - * - * @since 1.4.1 - * @return void - */ -function edd_unset_all_cart_discounts() { - EDD()->cart->remove_all_discounts(); -} - -/** - * Retrieve the currently applied discount - * - * @since 1.4.1 - * @return array $discounts The active discount codes - */ -function edd_get_cart_discounts() { - return EDD()->cart->get_discounts(); -} - -/** - * Check if the cart has any active discounts applied to it - * - * @since 1.4.1 - * @return bool - */ -function edd_cart_has_discounts() { - return EDD()->cart->has_discounts(); -} - -/** - * Retrieves the total discounted amount on the cart - * - * @since 1.4.1 - * - * @param bool $discounts Discount codes - * - * @return float|mixed|void Total discounted amount - */ -function edd_get_cart_discounted_amount( $discounts = false ) { - return EDD()->cart->get_discounted_amount( $discounts ); -} - -/** - * Get the discounted amount on a price - * - * @since 1.9 - * @param array $item Cart item array - * @param bool|string $discount False to use the cart discounts or a string to check with a discount code - * @return float The discounted amount - */ -function edd_get_cart_item_discount_amount( $item = array(), $discount = false ) { - return EDD()->cart->get_item_discount_amount( $item, $discount ); -} - -/** - * Outputs the HTML for all discounts applied to the cart - * - * @since 1.4.1 - * - * @return void - */ -function edd_cart_discounts_html() { - echo edd_get_cart_discounts_html(); -} - -/** - * Retrieves the HTML for all discounts applied to the cart - * - * @since 1.4.1 - * - * @param mixed $discounts Array of cart discounts. - * @return string - */ -function edd_get_cart_discounts_html( $discounts = false ) { - if ( ! $discounts ) { - $discounts = EDD()->cart->get_discounts(); - } - - if ( empty( $discounts ) ) { - return apply_filters( 'edd_get_cart_discounts_html', '', $discounts, 0, '' ); - } - - $html = _n( 'Discount', 'Discounts', count( $discounts ), 'easy-digital-downloads' ) . ': '; - - foreach ( $discounts as $discount ) { - $discount_id = edd_get_discount_id_by_code( $discount ); - $discount_amount = 0; - $items = EDD()->cart->get_contents_details(); - - if ( is_array( $items ) && ! empty( $items ) ) { - foreach ( $items as $key => $item ) { - $discount_amount += edd_get_item_discount_amount( $item, $items, array( $discount ), $item['item_price'] ); - } - } - - $type = edd_get_discount_type( $discount_id ); - $rate = edd_format_discount_rate( $type, edd_get_discount_amount( $discount_id ) ); - - $remove_url = add_query_arg( - array( - 'edd_action' => 'remove_cart_discount', - 'discount_id' => urlencode( $discount_id ), - 'discount_code' => urlencode( $discount ), - ), - edd_get_checkout_uri() - ); - - $discount_html = ''; - $discount_html .= "\n"; - $discount_amount = edd_currency_filter( edd_format_amount( $discount_amount ) ); - $discount_html .= "{$discount} – {$discount_amount}\n"; - if ( 'percent' === $type ) { - $discount_html .= "($rate)\n"; - } - $discount_html .= sprintf( - '%s', - esc_url( $remove_url ), - esc_attr( $discount ), - esc_attr__( 'Remove discount', 'easy-digital-downloads' ) - ); - $discount_html .= "\n"; - - $html .= apply_filters( 'edd_get_cart_discount_html', $discount_html, $discount, $rate, $remove_url ); - } - - return apply_filters( 'edd_get_cart_discounts_html', $html, $discounts, $rate, $remove_url ); -} - -/** - * Show the fully formatted cart discount - * - * Note the $formatted parameter was removed from the display_cart_discount() function - * within EDD_Cart in 2.7 as it was a redundant parameter. - * - * @since 1.4.1 - * @param bool $formatted - * @param bool $echo Echo? - * @return string $amount Fully formatted cart discount - */ -function edd_display_cart_discount( $formatted = false, $echo = false ) { - if ( ! $echo ) { - return EDD()->cart->display_cart_discount( $echo ); - } else { - EDD()->cart->display_cart_discount( $echo ); - } -} - -/** - * Processes a remove discount from cart request - * - * @since 1.4.1 - * @return void - */ -function edd_remove_cart_discount() { - - // Get ID - $discount_id = isset( $_GET['discount_id'] ) - ? absint( $_GET['discount_id'] ) - : 0; - - // Get code - $discount_code = isset( $_GET['discount_code'] ) - ? urldecode( $_GET['discount_code'] ) - : ''; - - // Bail if either ID or code are empty - if ( empty( $discount_id ) || empty( $discount_code ) ) { - return; - } - - // Pre-3.0 pre action - do_action( 'edd_pre_remove_cart_discount', $discount_id ); - - edd_unset_cart_discount( $discount_code ); - - // Pre-3.0 post action - do_action( 'edd_post_remove_cart_discount', $discount_id ); - - // Redirect - edd_redirect( edd_get_checkout_uri() ); -} -add_action( 'edd_remove_cart_discount', 'edd_remove_cart_discount' ); - -/** - * Checks whether discounts are still valid when removing items from the cart - * - * If a discount requires a certain product, and that product is no longer in - * the cart, the discount is removed. - * - * @since 1.5.2 - * - * @param int $cart_key - */ -function edd_maybe_remove_cart_discount( $cart_key = 0 ) { - - $discounts = edd_get_cart_discounts(); - - if ( empty( $discounts ) ) { - return; - } - - foreach ( $discounts as $discount ) { - if ( ! edd_is_discount_valid( $discount ) ) { - edd_unset_cart_discount( $discount ); - } - } -} -add_action( 'edd_post_remove_from_cart', 'edd_maybe_remove_cart_discount' ); - -/** - * Checks whether multiple discounts can be applied to the same purchase - * - * @since 1.7 - * @return bool - */ -function edd_multiple_discounts_allowed() { - $ret = edd_get_option( 'allow_multiple_discounts', false ); - return (bool) apply_filters( 'edd_multiple_discounts_allowed', $ret ); -} - -/** - * Listens for a discount and automatically applies it if present and valid - * - * @since 2.0 - * @return void - */ -function edd_listen_for_cart_discount() { - - // Bail if in admin - if ( is_admin() ) { - return; - } - - // Array stops the bulk delete of discount codes from storing as a preset_discount - if ( empty( $_REQUEST['discount'] ) || is_array( $_REQUEST['discount'] ) ) { - return; - } - - $code = preg_replace('/[^a-zA-Z0-9-_]+/', '', $_REQUEST['discount'] ); - - EDD()->session->set( 'preset_discount', $code ); -} -add_action( 'init', 'edd_listen_for_cart_discount', 0 ); - -/** - * Applies the preset discount, if any. This is separated from edd_listen_for_cart_discount() in order to allow items to be - * added to the cart and for it to persist across page loads if necessary - * - * @return void - */ -function edd_apply_preset_discount() { - - // Bail if in admin - if ( is_admin() ) { - return; - } - - $code = sanitize_text_field( EDD()->session->get( 'preset_discount' ) ); - - if ( empty( $code ) ) { - return; - } - - if ( ! edd_is_discount_valid( $code, '', false ) ) { - return; - } - - $code = apply_filters( 'edd_apply_preset_discount', $code ); - - edd_set_cart_discount( $code ); - - EDD()->session->set( 'preset_discount', null ); -} -add_action( 'init', 'edd_apply_preset_discount', 999 ); - -/** - * Validate discount code, optionally against an array of download IDs. - * Note: this function does not evaluate whether a current user can use the discount, - * or check the discount minimum cart requirement. - * - * @param int $discount_id Discount ID. - * @param array $download_ids Array of download IDs. - * - * @return boolean True if discount holds, false otherwise. - */ -function edd_validate_discount( $discount_id = 0, $download_ids = array() ) { - - // Bail if discount ID not passed. - if ( empty( $discount_id ) ) { - return false; - } - - $discount = edd_get_discount( $discount_id ); - - // Bail if discount not found. - if ( ! $discount ) { - return false; - } - - // Check if discount is active, started, and not maxed out. - if ( ! $discount->is_active( true, false ) || ! $discount->is_started( false ) || $discount->is_maxed_out( false ) ) { - return false; - } - - $product_requirements = $discount->get_product_reqs(); - $excluded_products = $discount->get_excluded_products(); - - // Return true if there are no requirements/excluded products set. - if ( empty( $product_requirements ) && empty( $excluded_products ) ) { - return true; - } - - // At this point, we assume the discount is valid. - $is_valid = true; - - $product_requirements = array_map( 'absint', $product_requirements ); - asort( $product_requirements ); - $product_requirements = array_filter( array_values( $product_requirements ) ); - - if ( ! empty( $product_requirements ) ) { - - $matches = array_intersect( $product_requirements, $download_ids ); - - switch ( $discount->get_product_condition() ) { - case 'all': - $is_valid = count( $matches ) === count( $product_requirements ); - break; - default: - $is_valid = 0 < count( $matches ); - } - } - - $excluded_products = array_map( 'absint', $excluded_products ); - asort( $excluded_products ); - $excluded_products = array_filter( array_values( $excluded_products ) ); - - if ( ! empty( $excluded_products ) ) { - $is_valid = false === (bool) array_intersect( $excluded_products, $download_ids ); - } - - /** - * Filters the validity of a discount. - * - * @since 3.0 - * - * @param bool $is_valid True if valid, false otherwise. - * @param \EDD_Discount $discount Discount object. - * @param array $download_ids Download IDs to check against. - */ - return apply_filters( 'edd_validate_discount', $is_valid, $discount, $download_ids ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/download-functions.php b/wp-content/plugins/easy-digital-downloads/includes/download-functions.php deleted file mode 100644 index 19615662..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/download-functions.php +++ /dev/null @@ -1,1626 +0,0 @@ - 'download', - 'name' => $value, - 'posts_per_page' => 1, - 'post_status' => 'any', - ) ); - - if ( $download ) { - $download = $download[0]; - } - - break; - - case 'sku': - $download = get_posts( array( - 'post_type' => 'download', - 'meta_key' => 'edd_sku', - 'meta_value' => $value, - 'posts_per_page' => 1, - 'post_status' => 'any', - ) ); - - if ( $download ) { - $download = $download[0]; - } - - break; - - default: - return false; - } - - return $download ?: false; -} - -/** - * Retrieves a download post object by ID or slug. - * - * @since 1.0 - * @since 2.9 - Return an EDD_Download object. - * - * @param int $download_id Download ID. - * @return EDD_Download|null EDD_Download object if found, null otherwise. - */ -function edd_get_download( $download_id = 0 ) { - $download = null; - - if ( is_numeric( $download_id ) ) { - $found_download = new EDD_Download( $download_id ); - - if ( ! empty( $found_download->ID ) ) { - $download = $found_download; - } - - // Fetch download by name. - } else { - $args = array( - 'post_type' => 'download', - 'name' => $download_id, - 'post_per_page' => 1, - 'fields' => 'ids', - ); - - $downloads = new WP_Query( $args ); - - if ( is_array( $downloads->posts ) && ! empty( $downloads->posts ) ) { - $download_id = $downloads->posts[0]; - - $download = new EDD_Download( $download_id ); - } - } - - return $download; -} - -/** - * Checks whether or not a download is free. - * - * @since 2.1 - * - * @param int $download_id Download ID. - * @param int $price_id Optional. Price ID. - * @return bool $is_free True if the product is free, false if the product is not free or the check fails - */ -function edd_is_free_download( $download_id = 0, $price_id = false ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->is_free( $price_id ) - : false; -} - -/** - * Return the name of a download. - * - * Pass a price ID to append the specific price variation name. - * - * @since 3.0 - * - * @param int $download_id - * @param int|null $price_id - * - * @return false|string - */ -function edd_get_download_name( $download_id = 0, $price_id = null ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) || ! is_numeric( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - // Bail if the download cannot be retrieved. - if ( ! $download instanceof EDD_Download ) { - return false; - } - - // Get the download title - $retval = $download->get_name(); - - // Check for variable pricing - if ( $download->has_variable_prices() && is_numeric( $price_id ) ) { - - // Check for price option name - $price_name = edd_get_price_option_name( $download_id, $price_id ); - - // Product has prices - if ( ! empty( $price_name ) ) { - $retval .= ' — ' . $price_name; - } - } - - /** - * Override the download name. - * - * @since 3.0 - * - * @param string $retval The download name. - * @param int $id The download ID. - * @param int $price_id The price ID, if any. - */ - return apply_filters( 'edd_get_download_name', $retval, $download_id, $price_id ); -} - -/** - * Returns the price of a download, but only for non-variable priced downloads. - * - * @since 1.0 - * - * @param int $download_id Download ID. - * @return string|int Price of the download. - */ -function edd_get_download_price( $download_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->get_price() - : 0; -} - -/** - * Displays a formatted price for a download. - * - * @since 1.0 - * - * @param int $download_id Download ID. - * @param bool $echo Optional. Whether to echo or return the result. Default true. - * @param int $price_id Optional. Price ID. - * - * @return string Download price if $echo set to false. - */ -function edd_price( $download_id = 0, $echo = true, $price_id = false ) { - - // Attempt to get the ID of the current item in the WordPress loop. - if ( empty( $download_id ) || ! is_numeric( $download_id ) ) { - $download_id = get_the_ID(); - } - - // Variable prices - if ( edd_has_variable_prices( $download_id ) ) { - - // Get the price variations - $prices = edd_get_variable_prices( $download_id ); - - // Use the amount for the price ID - if ( is_numeric( $price_id ) && isset( $prices[ $price_id ] ) ) { - $price = edd_get_price_option_amount( $download_id, $price_id ); - - // Maybe use the default variable price - } elseif ( $default = edd_get_default_variable_price( $download_id ) ) { - $price = edd_get_price_option_amount( $download_id, $default ); - - // Maybe guess the lowest price - } else { - $price = edd_get_lowest_price_option( $download_id ); - } - - // Single price (not variable) - } else { - $price = edd_get_download_price( $download_id ); - } - - // Filter the price (already sanitized) - $price = apply_filters( 'edd_download_price', $price, $download_id, $price_id ); - - // Format the price (do not escape $price) - $formatted_price = '' . $price . ''; - $formatted_price = apply_filters( 'edd_download_price_after_html', $formatted_price, $download_id, $price, $price_id ); - - // Echo or return - if ( ! empty( $echo ) ) { - echo $formatted_price; // WPCS: XSS ok. - } else { - return $formatted_price; - } -} -add_filter( 'edd_download_price', 'edd_format_amount', 10 ); -add_filter( 'edd_download_price', 'edd_currency_filter', 20 ); - -/** - * Retrieves the final price of a downloadable product after purchase. - * This price includes any necessary discounts that were applied - * - * @since 1.0 - * @param int $download_id ID of the download - * @param array $user_purchase_info - an array of all information for the payment - * @param string $amount_override a custom amount that over rides the 'edd_price' meta, used for variable prices - * @return string - the price of the download - */ -function edd_get_download_final_price( $download_id, $user_purchase_info, $amount_override = null ) { - if ( is_null( $amount_override ) ) { - $original_price = get_post_meta( $download_id, 'edd_price', true ); - } else { - $original_price = $amount_override; - } - - if ( isset( $user_purchase_info['discount'] ) && 'none' !== $user_purchase_info['discount'] ) { - - // If the discount was a percentage, we modify the amount. - // Flat rate discounts are ignored - if ( EDD_Discount::FLAT !== edd_get_discount_type( edd_get_discount_id_by_code( $user_purchase_info['discount'] ) ) ) { - $price = edd_get_discounted_amount( $user_purchase_info['discount'], $original_price ); - } else { - $price = $original_price; - } - } else { - $price = $original_price; - } - - // Filter & return. - return apply_filters( 'edd_final_price', $price, $download_id, $user_purchase_info ); -} - -/** - * Retrieves the variable prices for a download. - * - * @since 1.2 - * - * @param int $download_id Download ID. - * @return array|false Variable prices if found, false otherwise. - */ -function edd_get_variable_prices( $download_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->get_prices() - : false; -} - -/** - * Checks to see if a download has variable prices enabled. - * - * @since 1.0.7 - * - * @param int $download_id Download ID. - * @return bool True if the download has variable prices, false otherwise. - */ -function edd_has_variable_prices( $download_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = new EDD_Download( $download_id ); - - return $download - ? $download->has_variable_prices() - : false; -} - -/** - * Returns the default price ID for variable pricing, or the first price if - * none set. - * - * @since 2.2 - * @since 3.1.2 Moved this behavior into the EDD_Download class as it really does belong there. - * - * @param int $download_id Download ID. - * @return int|null The default price ID, or false if the product does not have variable prices. - */ -function edd_get_default_variable_price( $download_id = 0 ) { - - // Bail if no download ID was passed. - if ( ! is_numeric( $download_id ) || empty( $download_id ) ) { - return null; - } - - $download = new EDD_Download( $download_id ); - - return $download->get_default_price_id(); -} - -/** - * Retrieves the name of a variable price option. - * - * @since 1.0.9 - * @since 3.0 Renamed $payment_id parameter to $order_id. - * - * @param int $download_id Download ID. - * @param int $price_id Price ID. - * @param int $order_id Optional. Order ID for use in filters. - * - * @return string $price_name Name of the price option. - */ -function edd_get_price_option_name( $download_id = 0, $price_id = 0, $order_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - // Fetch variable prices. - $prices = edd_get_variable_prices( $download_id ); - - $price_name = ''; - - if ( $prices && is_array( $prices ) ) { - if ( isset( $prices[ $price_id ] ) ) { - $price_name = $prices[ $price_id ]['name']; - } - } - - return apply_filters( 'edd_get_price_option_name', $price_name, $download_id, $order_id, $price_id ); -} - -/** - * Retrieves the amount for a variable price option. - * - * @since 1.8.2 - * - * @param int $download_id Download ID. - * @param int $price_id Price ID. - * - * @return float $amount Price option amount. - */ -function edd_get_price_option_amount( $download_id = 0, $price_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - // Fetch variable prices. - $prices = edd_get_variable_prices( $download_id ); - - // Set default prices. - $amount = 0.00; - - if ( $prices && is_array( $prices ) ) { - if ( isset( $prices[ $price_id ] ) ) { - $amount = $prices[ $price_id ]['amount']; - } - } - - // Filter & return. - return apply_filters( 'edd_get_price_option_amount', edd_sanitize_amount( $amount ), $download_id, $price_id ); -} - -/** - * Retrieve the lowest price option of a variable priced download. - * - * @since 1.4.4 - * - * @param int $download_id Download ID. - * @return float Amount of the lowest price option. - */ -function edd_get_lowest_price_option( $download_id = 0 ) { - - // Attempt to get the ID of the current item in the WordPress loop. - if ( empty( $download_id ) ) { - $download_id = get_the_ID(); - } - - // Bail if download ID is still empty. - if ( empty( $download_id ) ) { - return false; - } - - // Return download price if variable prices do not exist for download. - if ( ! edd_has_variable_prices( $download_id ) ) { - return edd_get_download_price( $download_id ); - } - - // Set lowest to 0. - $lowest = 0.00; - $prices = edd_get_variable_prices( $download_id ); - $list_handler = new EDD\Utils\ListHandler( $prices ); - $min_key = $list_handler->search( 'amount', 'min' ); - if ( false !== $min_key ) { - $lowest = $prices[ $min_key ]['amount']; - } - - return edd_sanitize_amount( $lowest ); -} - -/** - * Retrieves the ID for the cheapest price option of a variable priced download. - * - * @since 2.2 - * - * @param int $download_id Download ID. - * @return int|false ID of the lowest price, false if download does not exist. - */ -function edd_get_lowest_price_id( $download_id = 0 ) { - - // Attempt to get the ID of the current item in the WordPress loop. - if ( empty( $download_id ) ) { - $download_id = get_the_ID(); - } - - // Bail if download ID is still empty. - if ( empty( $download_id ) ) { - return false; - } - - // Return download price if variable prices do not exist for download. - if ( ! edd_has_variable_prices( $download_id ) ) { - return edd_get_download_price( $download_id ); - } - - $list_handler = new EDD\Utils\ListHandler( edd_get_variable_prices( $download_id ) ); - $min_key = $list_handler->search( 'amount', 'min' ); - - return false !== $min_key ? absint( $min_key ) : false; -} - -/** - * Retrieves most expensive price option of a variable priced download - * - * @since 1.4.4 - * @param int $download_id ID of the download - * @return float Amount of the highest price - */ -function edd_get_highest_price_option( $download_id = 0 ) { - - // Attempt to get the ID of the current item in the WordPress loop. - if ( empty( $download_id ) ) { - $download_id = get_the_ID(); - } - - // Bail if download ID is still empty. - if ( empty( $download_id ) ) { - return false; - } - - // Return download price if variable prices do not exist for download. - if ( ! edd_has_variable_prices( $download_id ) ) { - return edd_get_download_price( $download_id ); - } - - // Set highest to 0. - $highest = 0.00; - $prices = edd_get_variable_prices( $download_id ); - $list_handler = new EDD\Utils\ListHandler( $prices ); - $max_key = $list_handler->search( 'amount', 'max' ); - if ( false !== $max_key ) { - $highest = $prices[ $max_key ]['amount']; - } - - return edd_sanitize_amount( $highest ); -} - -/** - * Retrieves a price from from low to high of a variable priced download. - * - * @since 1.4.4 - * - * @param int $download_id Download ID. - * @return string $range A fully formatted price range. - */ -function edd_price_range( $download_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $low = edd_get_lowest_price_option( $download_id ); - $high = edd_get_highest_price_option( $download_id ); - $range = '' . edd_currency_filter( edd_format_amount( $low ) ) . ''; - $range .= ' – '; - $range .= '' . edd_currency_filter( edd_format_amount( $high ) ) . ''; - - return apply_filters( 'edd_price_range', $range, $download_id, $low, $high ); -} - -/** - * Checks to see if multiple price options can be purchased at once. - * - * @since 1.4.2 - * - * @param int $download_id Download ID. - * @return bool True if multiple price options can be purchased at once, false otherwise. - */ -function edd_single_price_option_mode( $download_id = 0 ) { - - // Attempt to get the ID of the current item in the WordPress loop. - if ( empty( $download_id ) ) { - $download_id = get_the_ID(); - } - - // Bail if download ID is still empty. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - return $download - ? $download->is_single_price_mode() - : false; -} - -/** - * Get product types. - * - * @since 1.8 - * - * @return array $types Download types. - */ -function edd_get_download_types() { - $types = array( - '0' => __( 'Single Product', 'easy-digital-downloads' ), - 'bundle' => __( 'Bundle', 'easy-digital-downloads' ), - ); - - return apply_filters( 'edd_download_types', $types ); -} - -/** - * Get the download type: either `default` or `bundled`. - * - * @since 1.6 - * - * @param int $download_id Download ID. - * @return string $type Download type. - */ -function edd_get_download_type( $download_id = 0 ) { - $download = edd_get_download( $download_id ); - - return $download - ? $download->type - : false; -} - -/** - * Determines if a product is a bundle. - * - * @since 1.6 - * - * @param int $download_id Download ID. - * @return bool True if a bundle, false otherwise. - */ -function edd_is_bundled_product( $download_id = 0 ) { - $download = edd_get_download( $download_id ); - - return $download - ? $download->is_bundled_download() - : false; -} - - -/** - * Retrieves the product IDs of bundled products. - * - * @since 1.6 - * @since 2.7 Added $price_id parameter. - * - * @param int $download_id Download ID. - * @param int $price_id Optional. Price ID. Default null. - * - * @return array|false Products in the bundle, false if download does not exist. - */ -function edd_get_bundled_products( $download_id = 0, $price_id = null ) { - $download = edd_get_download( $download_id ); - - // Bail if download does not exist. - if ( ! $download ) { - return false; - } - - if ( null !== $price_id ) { - return $download->get_variable_priced_bundled_downloads( $price_id ); - } else { - return $download->bundled_downloads; - } -} - -/** - * Returns the total earnings for a download. - * - * @since 1.0 - * - * @param int $download_id Download ID. - * @return float|false $earnings Download earnings, false if download not found. - */ -function edd_get_download_earnings_stats( $download_id = 0 ) { - $download = edd_get_download( $download_id ); - - return $download - ? $download->earnings - : false; -} - -/** - * Return the sales number for a download. - * - * @since 1.0 - * - * @param int $download_id Download ID. - * @return int|false Number of sales, false if download was not found. - */ -function edd_get_download_sales_stats( $download_id = 0 ) { - $download = edd_get_download( $download_id ); - - return $download - ? $download->sales - : false; -} - -/** - * Record a file download. - * - * @since 1.0 - * @since 3.0 Refactored to use new query methods. - * - * @param int $download_id Download ID. - * @param int $file_id File ID. - * @param array $user_info User information (deprecated). - * @param string $ip Optional. IP address. - * @param int $order_id Order ID. - * @param int $price_id Optional. Price ID, - * @param string $user_agent Optional. User agent. - * @return void - */ -function edd_record_download_in_log( $download_id = 0, $file_id = 0, $user_info = array(), $ip = '', $order_id = 0, $price_id = 0, $user_agent = '' ) { - $order = edd_get_order( $order_id ); - - if ( empty( $user_agent ) ) { - if ( ! class_exists( 'Browser' ) ) { - require_once EDD_PLUGIN_DIR . 'includes/libraries/browser.php'; - } - $browser = new Browser(); - $user_agent = $browser->getBrowser() . ' ' . $browser->getVersion() . '/' . $browser->getPlatform(); - } - - if ( empty( $ip ) ) { - $ip = edd_get_ip(); - } - - $file_id = absint( $file_id ); - $files = edd_get_download_files( $download_id ); - $file_name = ''; - - if ( is_array( $files ) ) { - foreach ( $files as $key => $file ) { - if ( absint( $key ) === $file_id ) { - $file_name = edd_get_file_name( $file ); - break; - } - } - } - - $log_id = edd_add_file_download_log( array( - 'product_id' => absint( $download_id ), - 'file_id' => $file_id, - 'order_id' => absint( $order_id ), - 'price_id' => absint( $price_id ), - 'customer_id' => $order->customer_id, - 'ip' => sanitize_text_field( $ip ), - 'user_agent' => $user_agent, - ) ); - - if ( $log_id && ! empty( $file_name ) ) { - edd_add_file_download_log_meta( $log_id, 'file_name', $file_name ); - } -} - -/** - * Delete log entries when deleting downloads. - * - * Removes all related log entries when a download is completely deleted. - * (Does not run when a download is trashed) - * - * @since 1.3.4 - * @since 3.0 Updated to use new query methods. - * - * @param int $download_id Download ID. - */ -function edd_remove_download_logs_on_delete( $download_id = 0 ) { - global $wpdb; - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return; - } - - // Ensure download ID is an integer. - $download_id = absint( $download_id ); - - // Bail if the post type is not `download`. - if ( 'download' !== get_post_type( $download_id ) ) { - return; - } - - // Delete file download logs. - $wpdb->delete( $wpdb->edd_logs_file_downloads, array( - 'product_id' => $download_id, - ), array( '%d' ) ); - - // Delete logs. - $wpdb->delete( $wpdb->edd_logs, array( - 'object_id' => $download_id, - 'object_type' => 'download', - ), array( '%d', '%s' ) ); -} -add_action( 'delete_post', 'edd_remove_download_logs_on_delete' ); - -/** - * Recalculates both the net and gross sales and earnings for a download. - * - * @since 3.0 - * @param int $download_id - * @return void - */ -function edd_recalculate_download_sales_earnings( $download_id ) { - $download = edd_get_download( $download_id ); - if ( ! $download instanceof \EDD_Download ) { - return; - } - $download->recalculate_net_sales_earnings(); - $download->recalculate_gross_sales_earnings(); -} - -/** - * Retrieves the average monthly earnings for a specific download. - * - * @since 1.3 - * - * @param int $download_id Download ID. - * @return float $earnings Average monthly earnings. - */ -function edd_get_average_monthly_download_earnings( $download_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return 0; - } - - $earnings = edd_get_download_earnings_stats( $download_id ); - $release_date = get_post_field( 'post_date', $download_id ); - - $diff = abs( current_time( 'timestamp' ) - strtotime( $release_date ) ); - - // Number of months since publication - $months = floor( $diff / ( 30 * 60 * 60 * 24 ) ); - - if ( $months > 0 ) { - $earnings = ( $earnings / $months ); - } - - return $earnings < 0 - ? 0 - : $earnings; -} - -/** - * Retrieves the average monthly sales for a specific download. - * - * @since 1.3 - * - * @param int $download_id Download ID. - * @return float $sales Average monthly sales. - */ -function edd_get_average_monthly_download_sales( $download_id = 0 ) { - $sales = edd_get_download_sales_stats( $download_id ); - $release_date = get_post_field( 'post_date', $download_id ); - - $diff = abs( current_time( 'timestamp' ) - strtotime( $release_date ) ); - - // Number of months since publication - $months = floor( $diff / ( 30 * 60 * 60 * 24 ) ); - - if ( $months > 0 ) { - $sales = ( $sales / $months ); - } - - return $sales; -} - -/** - * Gets all download files for a product. - * - * @since 1.0 - * @since 3.0 Renamed $variable_price_id parameter to $price)id for consistency. - * - * @param int $download_id Download ID. - * @param int $price_id Optional. Price ID. Default null. - * - * @return array|false Download files, false if invalid data was passed. - */ -function edd_get_download_files( $download_id = 0, $price_id = null ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->get_files( $price_id ) - : false; -} - -/** - * Retrieves a file name for a file attached to a download. Defaults to the - * file's actual name if no 'name' key is present. - * - * @since 1.6 - * - * @param array $file File information. - * @return string Filename. - */ -function edd_get_file_name( $file = array() ) { - - // Bail if no data was passed. - if ( empty( $file ) || ! is_array( $file ) ) { - return false; - } - - $name = ! empty( $file['name'] ) - ? esc_html( $file['name'] ) - : basename( $file['file'] ); - - return $name; -} - -/** - * Gets the number of times a file has been downloaded for a specific order. - * - * @since 1.6 - * @since 3.0 Renamed parameters for consistency across new query methods - * introduced. - * Refactored to use new query methods. - * - * @param int $download_id Download ID. - * @param int $file_id File ID. - * @param int $order_id Order ID. - * - * @return int Number of times the file has been downloaded for the order. - */ -function edd_get_file_downloaded_count( $download_id = 0, $file_id = 0, $order_id = 0 ) { - - // Bail if no download ID or order ID was passed. - if ( empty( $download_id ) || empty( $order_id ) ) { - return false; - } - - // Ensure arguments passed are valid. - $download_id = absint( $download_id ); - $file_id = absint( $file_id ); - $order_id = absint( $order_id ); - - return edd_count_file_download_logs( array( - 'product_id' => $download_id, - 'order_id' => $order_id, - 'file_id' => $file_id, - ) ); -} - - -/** - * Gets the file download file limit for a particular download. This limit refers - * to the maximum number of times files connected to a product can be downloaded. - * - * @since 1.3.1 - * - * @param int $download_id Download ID. - * @return int|false File download limit, false if invalid download ID passed. - */ -function edd_get_file_download_limit( $download_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->get_file_download_limit() - : false; -} - -/** - * Gets the file refund window for a particular download - * - * This window refers to the maximum number of days it can be refunded after - * it has been purchased. - * - * @since 3.0 - * - * @param int $download_id Download ID. - * @return int Refund window. - */ -function edd_get_download_refund_window( $download_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->get_refund_window() - : false; -} - -/** - * Get the refundability status for a download. - * - * @since 3.0 - * - * @param int $download_id Download ID. - * @return string `refundable` or `nonrefundable`. - */ -function edd_get_download_refundability( $download_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->get_refundability() - : false; -} - -/** - * Gets the file download file limit override for a particular download. - * The override allows the main file download limit to be bypassed. - * - * @since 1.3.2 - * @since 3.0 Renamed $payment_id parameter to $order_id. - * - * @param int $download_id Download ID. - * @param int $order_id Order ID. - * - * @return int|false New file download limit, false if invalid download ID passed. -*/ -function edd_get_file_download_limit_override( $download_id = 0, $order_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $limit_override = get_post_meta( $download_id, '_edd_download_limit_override_' . $order_id, true ); - - return $limit_override - ? absint( $limit_override ) - : 0; -} - -/** - * Sets the file download file limit override for a particular download. - * - * The override allows the main file download limit to be bypassed. - * If no override is set yet, the override is set to the main limit + 1. - * If the override is already set, then it is simply incremented by 1. - * - * @since 1.3.2 - * @since 3.0 Renamed $payment_id parameter to $order_id. - * - * @param int $download_id Download ID. - * @param int $order_id Order ID. - * - * @return false False if invalid download ID or order ID was passed. - */ -function edd_set_file_download_limit_override( $download_id = 0, $order_id = 0 ) { - - // Bail if no download ID or order ID was passed. - if ( empty( $download_id ) || empty( $order_id ) ) { - return false; - } - - $override = edd_get_file_download_limit_override( $download_id, $order_id ); - $limit = edd_get_file_download_limit( $download_id ); - - if ( ! empty( $override ) ) { - $override = $override += 1; - } else { - $override = $limit += 1; - } - - update_post_meta( $download_id, '_edd_download_limit_override_' . $order_id, $override ); -} - - -/** - * Checks if a file is at its download limit - * - * This limit refers to the maximum number of times files connected to a product - * can be downloaded. - * - * @since 1.3.1 - * @since 3.0 Refactored to use new query methods. - * Renamed $payment_id parameter to $order_id. - * Set default value of $price_id to 0. - * - * @param int $download_id Download ID. - * @param int $order_id Order ID. - * @param int $file_id File ID. - * @param int $price_id Price ID. - * - * @return bool True if at limit, false otherwise. - */ -function edd_is_file_at_download_limit( $download_id = 0, $order_id = 0, $file_id = 0, $price_id = 0 ) { - - // Bail if invalid data was passed. - if ( empty( $download_id ) || empty( $order_id ) ) { - return false; - } - - // Sanitize parameters. - $download_id = absint( $download_id ); - $order_id = absint( $order_id ); - $file_id = absint( $file_id ); - $price_id = absint( $price_id ); - - // Default to false. - $ret = false; - $download_limit = edd_get_file_download_limit( $download_id ); - - if ( ! empty( $download_limit ) ) { - $unlimited_purchase = edd_payment_has_unlimited_downloads( $order_id ); - - if ( empty( $unlimited_purchase ) ) { - // Retrieve the file download count. - $download_count = edd_count_file_download_logs( array( - 'product_id' => $download_id, - 'file_id' => $file_id, - 'order_id' => $order_id, - 'price_id' => $price_id, - ) ); - - if ( $download_count >= $download_limit ) { - $ret = true; - - // Check to make sure the limit isn't overwritten. - // A limit is overwritten when purchase receipt is resent. - $limit_override = edd_get_file_download_limit_override( $download_id, $order_id ); - - if ( ! empty( $limit_override ) && $download_count < $limit_override ) { - $ret = false; - } - } - } - } - - /** - * Filters whether or not a file is at its download limit. - * - * @param bool $ret - * @param int $download_id - * @param int $payment_id - * @param int $file_id - * @param int $price_id - * - * @since 2.10 Added `$price_id` parameter. - */ - return (bool) apply_filters( 'edd_is_file_at_download_limit', $ret, $download_id, $order_id, $file_id, $price_id ); -} - -/** - * Retrieve the price option that has access to the specified file. - * - * @since 1.0.9 - * - * @param int $download_id Download ID. - * @param string $file_key File key. - * - * @return string|false Price ID if restricted, "all" otherwise, false if no download ID was passed. - */ -function edd_get_file_price_condition( $download_id = 0, $file_key = '' ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->get_file_price_condition( $file_key ) - : false; -} - -/** - * Constructs a secure file download url for a specific file. - * - * @since 1.0 - * @since 3.0 Updated to use new query methods. - * - * @param string $order_or_key The order object or payment key. Using the payment key will eventually be deprecated. - * @param string $email Customer email address. Use edd_get_payment_user_email() to get user email. - * @param int $filekey Index of array of files returned by edd_get_download_files() that this download link is for. - * @param int $download_id Optional. ID of download this download link is for. Default is 0. - * @param bool|int $price_id Optional. Price ID when using variable prices. Default is false. - * - * @return string Secure download URL. - */ -function edd_get_download_file_url( $order_or_key, $email, $filekey, $download_id = 0, $price_id = false ) { - $hours = absint( edd_get_option( 'download_link_expiration', 24 ) ); - - if ( ! ( $date = strtotime( '+' . $hours . 'hours', current_time( 'timestamp' ) ) ) ) { - $date = 2147472000; // Highest possible date, January 19, 2038 - } - - // Fetch order. - if ( $order_or_key instanceof EDD\Orders\Order ) { - $order = $order_or_key; - $key = $order->payment_key; - } else { - $key = $order_or_key; - $order = edd_get_order_by( 'payment_key', $key ); - } - - // Leaving in this array and the filter for backwards compatibility now - $old_args = array( - 'download_key' => rawurlencode( $key ), - 'email' => rawurlencode( $email ), - 'file' => rawurlencode( $filekey ), - 'price_id' => (int) $price_id, - 'download_id' => $download_id, - 'expire' => rawurlencode( $date ), - ); - - $params = apply_filters( 'edd_download_file_url_args', $old_args ); - - // Bail if order wasn't found. - if ( ! $order ) { - return false; - } - - // Get the array of parameters in the same order in which they will be validated. - $args = array_fill_keys( edd_get_url_token_parameters(), '' ); - - // Simply the URL by concatenating required data using a colon as a delimiter. - if ( ! is_numeric( $price_id ) ) { - $eddfile = sprintf( '%d:%d:%d', $order->id, $params['download_id'], $params['file'] ); - } else { - $eddfile = sprintf( '%d:%d:%d:%d', $order->id, $params['download_id'], $params['file'], $price_id ); - } - $args['eddfile'] = rawurlencode( $eddfile ); - - if ( isset( $params['expire'] ) ) { - $args['ttl'] = $params['expire']; - } - - // Ensure all custom args registered with extensions through edd_download_file_url_args get added to the URL, but without adding all the old args - $args = array_merge( $args, array_diff_key( $params, $old_args ) ); - - /** - * Allow the file download args to be filtered. - * - * @since 3.1.1 Includes the order object as the fourth parameter. - * @param array $args The full array of parameters. - * @param int $order_id The order ID. - * @param array $params The original array of parameters. - * @param EDD\Orders\Order $order The order object. - */ - $args = apply_filters( 'edd_get_download_file_url_args', $args, $order->id, $params, $order ); - - $args['file'] = $params['file']; - $args['token'] = edd_get_download_token( add_query_arg( array_filter( $args ), untrailingslashit( site_url() ) ) ); - - return add_query_arg( array_filter( $args ), site_url( 'index.php' ) ); -} - -/** - * Gets the array of parameters to be used for the URL token generation and validation. - * Used by `edd_get_download_file_url` and `edd_validate_url_token` so that their parameters are ordered the same. - * - * @since 2.11.4 - * @return array - */ -function edd_get_url_token_parameters() { - return apply_filters( - 'edd_url_token_allowed_params', - array( - 'eddfile', - 'ttl', - 'file', - 'token', - ) - ); -} - -/** - * Get product notes. - * - * @since 1.2.1 - * - * @param int $download_id Download ID. - * @return string|false Product notes, false if invalid data was passed. - */ -function edd_get_product_notes( $download_id = 0 ) { - - // Bail if download ID was not passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->notes - : false; -} - -/** - * Retrieves a download SKU by ID. - * - * @since 1.6 - * - * @param int $download_id Download ID. - * @return string|false Download SKU, false if invalid data was passed. - */ -function edd_get_download_sku( $download_id = 0 ) { - - // Bail if download ID was not passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->sku - : false; -} - -/** - * Retrieve the download button behavior: either add to cart or direct. - * - * @since 1.7 - * - * @param int $download_id Download ID. - * @return string|false `add_to_cart` or `direct`, false if invalid data was passed. - */ -function edd_get_download_button_behavior( $download_id = 0 ) { - - // Bail if download ID was not passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->button_behavior - : false; -} - -/** - * Is quantity input disabled on this product? - * - * @since 2.7 - * - * @param int $download_id Download ID. - * @return bool - */ -function edd_download_quantities_disabled( $download_id = 0 ) { - - // Bail if download ID was not passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->quantities_disabled() - : false; -} - -/** - * Get the file download method. - * - * @since 1.6 - * - * @return string File download method. - */ -function edd_get_file_download_method() { - $method = edd_get_option( 'download_method', 'direct' ); - - return apply_filters( 'edd_file_download_method', $method ); -} - -/** - * Returns a random download. - * - * @since 1.7 - * - * @param bool $post_ids Optional. True for of download IDs, false for WP_Post - * objects. Default true. - * @return array Download IDs/WP_Post objects. - */ -function edd_get_random_download( $post_ids = true ) { - return edd_get_random_downloads( 1, $post_ids ); -} - -/** - * Returns random downloads. - * - * @since 1.7 - * - * @param int $num Number of downloads to return. Default 3. - * @param bool $post_ids Optional. True for array of WP_Post objects, else - * array of IDs. Default true. - * - * @return array Download IDs/WP_Post objects. - */ -function edd_get_random_downloads( $num = 3, $post_ids = true ) { - $args = array( - 'post_type' => 'download', - 'orderby' => 'rand', - 'numberposts' => $num, - ); - - if ( $post_ids ) { - $args['fields'] = 'ids'; - } - - $args = apply_filters( 'edd_get_random_downloads', $args ); - - return get_posts( $args ); -} - -/** - * Generates a token for a given URL. - * - * An 'o' query parameter on a URL can include optional variables to test - * against when verifying a token without passing those variables around in - * the URL. For example, downloads can be limited to the IP that the URL was - * generated for by adding 'o=ip' to the query string. - * - * Or suppose when WordPress requested a URL for automatic updates, the user - * agent could be tested to ensure the URL is only valid for requests from - * that user agent. - * - * @since 2.3 - * - * @param string $url URL to generate a token for. - * @return string Token for the URL. - */ -function edd_get_download_token( $url = '' ) { - $args = array(); - $hash = apply_filters( 'edd_get_url_token_algorithm', 'sha256' ); - $secret = apply_filters( 'edd_get_url_token_secret', hash( $hash, wp_salt() ) ); - - /* - * Add additional args to the URL for generating the token. - * Allows for restricting access to IP and/or user agent. - */ - $parts = wp_parse_url( $url ); - $options = array(); - - if ( isset( $parts['query'] ) ) { - wp_parse_str( $parts['query'], $query_args ); - - // o = option checks (ip, user agent). - if ( ! empty( $query_args['o'] ) ) { - - // Multiple options can be checked by separating them with a colon in the query parameter. - $options = explode( ':', rawurldecode( $query_args['o'] ) ); - - if ( in_array( 'ip', $options, true ) ) { - $args['ip'] = edd_get_ip(); - } - - if ( in_array( 'ua', $options, true ) ) { - $ua = isset( $_SERVER['HTTP_USER_AGENT'] ) - ? $_SERVER['HTTP_USER_AGENT'] - : ''; - - $args['user_agent'] = rawurlencode( $ua ); - } - } - } - - /* - * Filter to modify arguments and allow custom options to be tested. - * Be sure to rawurlencode any custom options for consistent results. - */ - $args = apply_filters( 'edd_get_url_token_args', $args, $url, $options ); - - $args['secret'] = $secret; - $args['token'] = false; // Removes a token if present. - - $url = add_query_arg( $args, $url ); - $parts = wp_parse_url( $url ); - - // In the event there isn't a path, set an empty one so we can MD5 the token - if ( ! isset( $parts['path'] ) ) { - $parts['path'] = ''; - } - - $token = hash_hmac( 'sha256', $parts['path'] . '?' . $parts['query'], wp_salt( 'edd_file_download_link' ) ); - return $token; -} - -/** - * Generate a token for a URL and match it against the existing token to make - * sure the URL hasn't been tampered with. - * - * @since 2.3 - * - * @param string $url URL to test. - * @return bool - */ -function edd_validate_url_token( $url = '' ) { - $ret = false; - $parts = parse_url( $url ); - $query_args = array(); - $original_url = $url; - - if ( isset( $parts['query'] ) ) { - wp_parse_str( $parts['query'], $query_args ); - - // If the TTL is in the past, die out before we go any further. - if ( isset( $query_args['ttl'] ) && current_time( 'timestamp' ) > $query_args['ttl'] ) { - wp_die( apply_filters( 'edd_download_link_expired_text', esc_html__( 'Sorry but your download link has expired.', 'easy-digital-downloads' ) ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // These are the only URL parameters that are allowed to affect the token validation. - $allowed_args = edd_get_url_token_parameters(); - - // Collect the allowed tags in proper order, remove all tags, and re-add only the allowed ones. - $validated_query_args = array(); - - foreach ( $allowed_args as $key ) { - if ( true === array_key_exists( $key, $query_args ) ) { - $validated_query_args[ $key ] = $query_args[ $key ]; - } - } - - // strtok allows a quick clearing of existing query string parameters, so we can re-add the allowed ones. - $url = add_query_arg( $validated_query_args, strtok( $url, '?' ) ); - - if ( isset( $query_args['token'] ) && hash_equals( $query_args['token'], edd_get_download_token( $url ) ) ) { - $ret = true; - } - } - - /** - * Filters the URL token validation. - * - * @param bool $ret Whether the URL has validated or not. - * @param string $url The URL used for validation. - * @param array $query_args The array of query parameters. - * @param string $original_url The original URL (added 2.11.3). - */ - return apply_filters( 'edd_validate_url_token', $ret, $url, $query_args, $original_url ); -} - -/** - * Allows parsing of the values saved by the product drop down. - * - * @since 2.6.9 - * - * @param array $values Parse the values from the product dropdown into a readable array. - * @return array A parsed set of values for download_id and price_id. - */ -function edd_parse_product_dropdown_values( $values = array() ) { - $parsed_values = array(); - - if ( is_array( $values ) ) { - foreach ( $values as $value ) { - $value = edd_parse_product_dropdown_value( $value ); - - $parsed_values[] = array( - 'download_id' => $value['download_id'], - 'price_id' => $value['price_id'], - ); - } - } else { - $value = edd_parse_product_dropdown_value( $values ); - $parsed_values[] = array( - 'download_id' => $value['download_id'], - 'price_id' => $value['price_id'], - ); - } - - return $parsed_values; -} - -/** - * Given a value from the product dropdown array, parse its parts. - * - * @since 2.6.9 - * - * @param string $value A value saved in a product dropdown array - * @return array A parsed set of values for download_id and price_id. - */ -function edd_parse_product_dropdown_value( $value ) { - $parts = explode( '_', $value ); - $download_id = $parts[0]; - $price_id = isset( $parts[1] ) - ? $parts[1] - : false; - - return array( - 'download_id' => $download_id, - 'price_id' => $price_id, - ); -} - -/** - * Get bundle pricing variations - * - * @since 2.7 - * - * @param int $download_id Download ID. - * @return array|false Bundle pricing variations, false if invalid data was passed. - */ -function edd_get_bundle_pricing_variations( $download_id = 0 ) { - - // Bail if no download ID was passed. - if ( empty( $download_id ) ) { - return false; - } - - $download = edd_get_download( $download_id ); - - return $download - ? $download->get_bundle_pricing_variations() - : false; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/downloads/recalculations.php b/wp-content/plugins/easy-digital-downloads/includes/downloads/recalculations.php deleted file mode 100644 index 23b017de..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/downloads/recalculations.php +++ /dev/null @@ -1,158 +0,0 @@ -status === $data['status'] ) && - ( empty( $data['quantity'] ) || $previous_order_item->quantity === $data['quantity'] ) && - ( ! isset( $data['total'] ) || $previous_order_item->total == $data['total'] ) && - ( ! isset( $data['subtotal'] ) || $previous_order_item->subtotal == $data['subtotal'] ) && - ( ! isset( $data['discount'] ) || $previous_order_item->discount == $data['discount'] ) && - ( ! isset( $data['tax'] ) || $previous_order_item->tax == $data['tax'] ) && - ( ! isset( $data['rate'] ) || $previous_order_item->rate == $data['rate'] ) && - ( empty( $data['product_id'] ) || $previous_order_item->product_id == $data['product_id'] ) - ) { - return; - } - - // Recalculate the previous product values if the product ID has changed. - if ( ! empty( $data['product_id'] ) && $previous_order_item->product_id != $data['product_id'] ) { - edd_maybe_schedule_download_recalculation( $previous_order_item->product_id ); - } - } - - $order_item = edd_get_order_item( $order_item_id ); - if ( empty( $order_item->product_id ) ) { - return; - } - - edd_maybe_schedule_download_recalculation( $order_item->product_id ); -} - -add_action( 'edd_order_adjustment_added', 'edd_recalculate_order_adjustment_download', 10, 2 ); -add_action( 'edd_order_adjustment_updated', 'edd_recalculate_order_adjustment_download', 10, 3 ); -/** - * Attempts to reschedule download recalculations when an order adjustment is added or updated. - * - * @since 3.1 - * @param int $order_adjustment_id The order adjustment ID. - * @param array $data The array of data for the new/updated order adjustment. - * @param bool|EDD\Orders\Order_Adjustment $previous_order_adjustment The previous order adjustment object. - * @return void - */ -function edd_recalculate_order_adjustment_download( $order_adjustment_id, $data = array(), $previous_order_adjustment = false ) { - if ( get_option( '_edd_v30_doing_order_migration', false ) ) { - return; - } - - if ( $previous_order_adjustment instanceof EDD\Orders\Order_Adjustment ) { - $columns_affecting_stats = array( 'total', 'subtotal', 'object_id', 'object_type' ); - - // If the data being updated isn't one of these columns then we don't need to recalculate. - if ( empty( array_intersect( array_keys( $data ), $columns_affecting_stats ) ) ) { - return; - } - - // If the data exists but matches, we don't need to recalculate. - if ( - ( ! isset( $data['total'] ) || $previous_order_adjustment->total == $data['total'] ) && - ( ! isset( $data['subtotal'] ) || $previous_order_adjustment->subtotal == $data['subtotal'] ) && - ( empty( $data['object_id'] ) || $previous_order_adjustment->object_id == $data['object_id'] ) && - ( empty( $data['object_type'] ) || $previous_order_adjustment->object_type == $data['object_type'] ) - ) { - return; - } - } - - $order_adjustment = edd_get_order_adjustment( $order_adjustment_id ); - if ( empty( $order_adjustment->object_type ) || 'order_item' !== $order_adjustment->object_type ) { - return; - } - - $order_item = edd_get_order_item( $order_adjustment->object_id ); - if ( ! empty( $order_item->product_id ) ) { - edd_maybe_schedule_download_recalculation( $order_item->product_id ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/emails/actions.php b/wp-content/plugins/easy-digital-downloads/includes/emails/actions.php deleted file mode 100644 index 0d70b8b5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/emails/actions.php +++ /dev/null @@ -1,123 +0,0 @@ -order instanceof \EDD\Orders\Order && 'refund' === $payment->order->type ) { - return; - } - - // Send email with secure download link - edd_email_purchase_receipt( $payment_id, true, '', $payment, $customer ); -} -add_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999, 3 ); - -/** - * Resend the Email Purchase Receipt. (This can be done from the Payment History page) - * - * @since 1.0 - * @param array $data Payment Data - * @return void - */ -function edd_resend_purchase_receipt( $data ) { - - $purchase_id = absint( $data['purchase_id'] ); - - if( empty( $purchase_id ) ) { - return; - } - - if( ! current_user_can( 'edit_shop_payments' ) ) { - wp_die( __( 'You do not have permission to edit this payment record', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $email = ! empty( $data['email'] ) ? sanitize_email( $data['email'] ) : ''; - - if( empty( $email ) ) { - $customer = new EDD_Customer( edd_get_payment_customer_id( $purchase_id ) ); - $email = $customer->email; - } - - $sent = edd_email_purchase_receipt( $purchase_id, false, $email ); - - // Grab all downloads of the purchase and update their file download limits, if needed - // This allows admins to resend purchase receipts to grant additional file downloads - $downloads = edd_get_payment_meta_cart_details( $purchase_id, true ); - - if ( is_array( $downloads ) ) { - foreach ( $downloads as $download ) { - $limit = edd_get_file_download_limit( $download['id'] ); - if ( ! empty( $limit ) ) { - edd_set_file_download_limit_override( $download['id'], $purchase_id ); - } - } - } - - edd_redirect( - add_query_arg( - array( - 'edd-message' => $sent ? 'email_sent' : 'email_send_failed', - 'edd-action' => false, - 'purchase_id' => false, - 'email' => false, - ) - ) - ); -} -add_action( 'edd_email_links', 'edd_resend_purchase_receipt' ); - -/** - * Trigger the sending of a Test Email - * - * @since 1.5 - * @param array $data Parameters sent from Settings page - * @return void - */ -function edd_send_test_email( $data ) { - if ( ! wp_verify_nonce( $data['_wpnonce'], 'edd-test-email' ) ) { - return; - } - - // Send a test email - edd_email_test_purchase_receipt(); - - $url = edd_get_admin_url( - array( - 'page' => 'edd-settings', - 'tab' => 'emails', - 'section' => 'purchase_receipts', - 'edd-message' => 'test-purchase-email-sent', - ) - ); - edd_redirect( $url ); -} -add_action( 'edd_send_test_email', 'edd_send_test_email' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/emails/class-edd-email-tags.php b/wp-content/plugins/easy-digital-downloads/includes/emails/class-edd-email-tags.php deleted file mode 100644 index e609b9d9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/emails/class-edd-email-tags.php +++ /dev/null @@ -1,149 +0,0 @@ -tags[ $tag ] = array( - 'tag' => $tag, - 'label' => ! empty( $label ) ? $label : ucwords( str_replace( '_', ' ', $tag ) ), - 'description' => $description, - 'func' => $func, - ); - } - } - - /** - * Remove an email tag - * - * @since 1.9 - * - * @param string $tag Email tag to remove hook from - */ - public function remove( $tag ) { - unset( $this->tags[ $tag ] ); - } - - /** - * Check if $tag is a registered email tag - * - * @since 1.9 - * - * @param string $tag Email tag that will be searched - * - * @return bool - */ - public function email_tag_exists( $tag ) { - return array_key_exists( $tag, $this->tags ); - } - - /** - * Returns a list of all email tags - * - * @since 1.9 - * - * @return array - */ - public function get_tags() { - return (array) $this->tags; - } - - /** - * Search content for email tags and filter email tags through their hooks - * - * @param string $content Content to search for email tags - * @param int $payment_id The payment id - * - * @since 1.9 - * - * @return string Content with email tags filtered out. - */ - public function do_tags( $content, $payment_id ) { - - // Check if there is at least one tag added. - if ( empty( $this->tags ) || ! is_array( $this->tags ) ) { - return $content; - } - - $this->payment_id = $payment_id; - - $new_content = preg_replace_callback( '/{([A-z0-9\-\_]+)}/s', array( $this, 'do_tag' ), $content ); - - $this->payment_id = null; - - return $new_content; - } - - /** - * Do a specific tag, this function should not be used. Please use edd_do_email_tags instead. - * - * @since 1.9 - * - * @param $m message - * - * @return mixed - */ - public function do_tag( $m ) { - - // Get tag - $tag = $m[1]; - - // Return tag if tag not set - if ( ! $this->email_tag_exists( $tag ) ) { - return $m[0]; - } - - return call_user_func( $this->tags[ $tag ]['func'], $this->payment_id, $tag ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/emails/class-edd-emails.php b/wp-content/plugins/easy-digital-downloads/includes/emails/class-edd-emails.php deleted file mode 100644 index 0607cb62..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/emails/class-edd-emails.php +++ /dev/null @@ -1,381 +0,0 @@ -get_template() ) { - $this->html = false; - } - - add_action( 'edd_email_send_before', array( $this, 'send_before' ) ); - add_action( 'edd_email_send_after', array( $this, 'send_after' ) ); - - } - - /** - * Set a property - * - * @since 2.1 - */ - public function __set( $key, $value ) { - $this->$key = $value; - } - - /** - * Get a property - * - * @since 2.6.9 - */ - public function __get( $key ) { - return $this->$key; - } - - /** - * Get the email from name - * - * @since 2.1 - */ - public function get_from_name() { - if ( ! $this->from_name ) { - $this->from_name = edd_get_option( 'from_name', get_bloginfo( 'name' ) ); - } - - return apply_filters( 'edd_email_from_name', wp_specialchars_decode( $this->from_name ), $this ); - } - - /** - * Get the email from address - * - * @since 2.1 - */ - public function get_from_address() { - if ( ! $this->from_address ) { - $this->from_address = edd_get_option( 'from_email' ); - } - - if( empty( $this->from_address ) || ! is_email( $this->from_address ) ) { - $this->from_address = get_option( 'admin_email' ); - } - - return apply_filters( 'edd_email_from_address', $this->from_address, $this ); - } - - /** - * Get the email content type - * - * @since 2.1 - */ - public function get_content_type() { - if ( ! $this->content_type && $this->html ) { - $this->content_type = apply_filters( 'edd_email_default_content_type', 'text/html', $this ); - } else if ( ! $this->html ) { - $this->content_type = 'text/plain'; - } - - return apply_filters( 'edd_email_content_type', $this->content_type, $this ); - } - - /** - * Get the email headers - * - * @since 2.1 - */ - public function get_headers() { - if ( ! $this->headers ) { - $this->headers = "From: {$this->get_from_name()} <{$this->get_from_address()}>\r\n"; - $this->headers .= "Reply-To: {$this->get_from_address()}\r\n"; - $this->headers .= "Content-Type: {$this->get_content_type()}; charset=utf-8\r\n"; - } - - return apply_filters( 'edd_email_headers', $this->headers, $this ); - } - - /** - * Retrieve email templates - * - * @since 2.1 - */ - public function get_templates() { - $templates = array( - 'default' => __( 'Default Template', 'easy-digital-downloads' ), - 'none' => __( 'No template, plain text only', 'easy-digital-downloads' ) - ); - - return apply_filters( 'edd_email_templates', $templates ); - } - - /** - * Get the enabled email template - * - * @since 2.1 - * - * @return string|null - */ - public function get_template() { - if ( ! $this->template ) { - $this->template = edd_get_option( 'email_template', 'default' ); - } - - return apply_filters( 'edd_email_template', $this->template ); - } - - /** - * Get the header text for the email - * - * @since 2.1 - */ - public function get_heading() { - return apply_filters( 'edd_email_heading', $this->heading ); - } - - /** - * Parse email template tags - * - * @since 2.1 - * @param string $content - */ - public function parse_tags( $content ) { - - // The email tags are parsed during setup for purchase receipts and sale notifications - // Onoce tags are not restricted to payments, we'll expand this. See https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/2151 - - return $content; - } - - /** - * Build the final email - * - * @since 2.1 - * @param string $message - * - * @return string - */ - public function build_email( $message ) { - - if ( false === $this->html ) { - return apply_filters( 'edd_email_message', wp_strip_all_tags( $message ), $this ); - } - - $message = $this->text_to_html( $message ); - - ob_start(); - - edd_get_template_part( 'emails/header', $this->get_template(), true ); - - /** - * Hooks into the email header - * - * @since 2.1 - */ - do_action( 'edd_email_header', $this ); - - if ( has_action( 'edd_email_template_' . $this->get_template() ) ) { - /** - * Hooks into the template of the email - * - * @param string $this->template Gets the enabled email template - * @since 2.1 - */ - do_action( 'edd_email_template_' . $this->get_template() ); - } else { - edd_get_template_part( 'emails/body', $this->get_template(), true ); - } - - /** - * Hooks into the body of the email - * - * @since 2.1 - */ - do_action( 'edd_email_body', $this ); - - edd_get_template_part( 'emails/footer', $this->get_template(), true ); - - /** - * Hooks into the footer of the email - * - * @since 2.1 - */ - do_action( 'edd_email_footer', $this ); - - $body = ob_get_clean(); - $message = str_replace( '{email}', $message, $body ); - - return apply_filters( 'edd_email_message', $message, $this ); - } - - /** - * Send the email - * @param string $to The To address to send to. - * @param string $subject The subject line of the email to send. - * @param string $message The body of the email to send. - * @param string|array $attachments Attachments to the email in a format supported by wp_mail() - * - * @return bool Whether the email was sent successfully. - * @since 2.1 - */ - public function send( $to, $subject, $message, $attachments = '' ) { - - if ( ! did_action( 'init' ) && ! did_action( 'admin_init' ) ) { - _doing_it_wrong( __FUNCTION__, __( 'You cannot send email with EDD_Emails until init/admin_init has been reached', 'easy-digital-downloads' ), null ); - return false; - } - - /** - * Hooks before the email is sent - * - * @since 2.1 - */ - do_action( 'edd_email_send_before', $this ); - - $subject = $this->parse_tags( $subject ); - $message = $this->parse_tags( $message ); - - $message = $this->build_email( $message ); - - $attachments = apply_filters( 'edd_email_attachments', $attachments, $this ); - - $sent = wp_mail( $to, $subject, $message, $this->get_headers(), $attachments ); - $log_errors = apply_filters( 'edd_log_email_errors', true, $to, $subject, $message ); - - if( ! $sent && true === $log_errors ) { - if ( is_array( $to ) ) { - $to = implode( ',', $to ); - } - - $log_message = sprintf( - __( "Email from Easy Digital Downloads failed to send.\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'easy-digital-downloads' ), - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), - $to, - $subject - ); - - error_log( $log_message ); - } - - /** - * Hooks after the email is sent - * - * @since 2.1 - */ - do_action( 'edd_email_send_after', $this ); - - return $sent; - - } - - /** - * Add filters / actions before the email is sent - * - * @since 2.1 - */ - public function send_before() { - add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) ); - add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) ); - add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) ); - } - - /** - * Remove filters / actions after the email is sent - * - * @since 2.1 - */ - public function send_after() { - remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) ); - remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) ); - remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) ); - - // Reset heading to an empty string - $this->heading = ''; - } - - /** - * Converts text to formatted HTML. This is primarily for turning line breaks into

    and
    tags. - * - * @since 2.1 - */ - public function text_to_html( $message ) { - - if ( 'text/html' == $this->content_type || true === $this->html ) { - $message = apply_filters( 'edd_email_template_wpautop', true ) ? wpautop( $message ) : $message; - $message = apply_filters( 'edd_email_template_make_clickable', true ) ? make_clickable( $message ) : $message; - $message = str_replace( '&', '&', $message ); - } - - return $message; - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/class-edd-email-summary-blurb.php b/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/class-edd-email-summary-blurb.php deleted file mode 100644 index 1c33d3d0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/class-edd-email-summary-blurb.php +++ /dev/null @@ -1,297 +0,0 @@ -environment_checker = new EnvironmentChecker(); - - } - - /** - * Fetch all blurbs from remote endpoint. - * - * @since 3.1 - * - * @return array - */ - public function fetch_blurbs() { - $blurbs = array(); - $request_body = false; - - $request = wp_safe_remote_get( self::BLURBS_ENDPOINT_URL ); - - // @todo - Detect first response code, before redirect! - if ( ! is_wp_error( $request ) && 200 === wp_remote_retrieve_response_code( $request ) ) { - $request_body = wp_remote_retrieve_body( $request ); - $blurbs = json_decode( $request_body, true ); - } - - if ( empty( $request_body ) ) { - // HTTP Request for blurbs is empty, fallback to local .json file. - $fallback_json = wp_json_file_decode( EDD_PLUGIN_DIR . 'includes/admin/promos/email-summary/blurbs.json', array( 'associative' => true ) ); - if ( ! empty( $fallback_json ) ) { - $blurbs = $fallback_json; - } - } - - return $blurbs; - } - - - /** - * Get the next blurb that can be sent. - * - * @since 3.1 - * - * @return array - */ - public function get_next() { - $all_data = $this->fetch_blurbs(); - $blurbs = array(); - $blurbs_sent = get_option( 'email_summary_blurbs_sent', array() ); - $next_blurb = false; - - if ( empty( $all_data['blurbs'] ) ) { - return false; - } - - // Loop through the fetched blurbs and filter out all that meet the conditions. - foreach ( $all_data['blurbs'] as $key => $blurb ) { - if ( $this->does_blurb_meet_conditions( $blurb ) ) { - $blurbs[] = $blurb; - } - } - - // Find first blurb that was not yet sent. - foreach ( $blurbs as $blurb ) { - $blurb_hash = $this->get_blurb_hash( $blurb ); - if ( is_array( $blurbs_sent ) && ! in_array( $blurb_hash, $blurbs_sent, true ) ) { - $next_blurb = $blurb; - break; - } - } - - // If all of the available blurbs were already sent out, choose random blurb. - if ( ! $next_blurb && ! empty( $blurbs ) ) { - $next_blurb = $blurbs[ array_rand( $blurbs ) ]; - } - - return $next_blurb; - } - - /** - * Save blurb as sent to the options. - * - * @since 3.1 - * - * @param array $blurb Blurb data. - * @return void - */ - public function mark_blurb_sent( $blurb ) { - $blurbs_sent = get_option( 'email_summary_blurbs_sent', array() ); - if ( ! empty( $blurb ) ) { - $blurb_hash = $this->get_blurb_hash( $blurb ); - if ( ! in_array( $blurb_hash, $blurbs_sent, true ) ) { - $blurbs_sent[] = $blurb_hash; - } - } - - update_option( 'email_summary_blurbs_sent', $blurbs_sent ); - } - - - /** - * Hash blurb array - * - * @since 3.1 - * - * @param array $blurb Blurb data. - * @return string MD5 hashed blurb. - */ - public function get_blurb_hash( $blurb ) { - if ( empty( $blurb ) ) { - return false; - } - // We want to sort the array, so that we can get reliable hash everytime even if array properties order changed. - array_multisort( $blurb ); - return md5( wp_json_encode( $blurb ) ); - } - - /** - * Check if store pass matches the condition from the blurb. - * - * @since 3.1 - * - * @param string $condition Pass details. - * @return bool - */ - public function check_blurb_current_pass( $condition ) { - return $this->environment_checker->meetsCondition( $condition ); - } - - /** - * Check if store has all requested plugins active. - * - * @since 3.1 - * - * @param array $active_plugins An array of plugins that all need to be active. - * @return bool - */ - public function check_blurb_active_plugins( $active_plugins ) { - foreach ( $active_plugins as $plugin_name ) { - if ( ! is_plugin_active( $plugin_name ) ) { - return false; - } - } - - return true; - } - - /** - * Check if store has certain plugins inactive. - * - * @since 3.1 - * - * @param array $inactive_plugins An array of plugins that needs to be inactive. - * @return bool - */ - public function check_blurb_inactive_plugins( $inactive_plugins ) { - foreach ( $inactive_plugins as $plugin_name ) { - if ( is_plugin_active( $plugin_name ) ) { - return false; - } - } - - return true; - } - - /** - * Check if store has specific products/downloads active. - * - * @since 3.1 - * - * @param array $conditions An array of predefined conditions. - * @return bool - */ - public function check_blurb_has_downloads( $conditions ) { - foreach ( $conditions as $condition_name ) { - // Check if store has any products that are free. - if ( 'free' === $condition_name ) { - $args = array( - 'post_type' => 'download', - 'posts_per_page' => 1, - 'fields' => 'ids', - 'no_found_rows' => true, - 'meta_query' => array( - array( - 'key' => 'edd_price', - 'value' => '0.00', - ), - ), - ); - - $downloads = new WP_Query( $args ); - if ( 0 === $downloads->post_count ) { - return false; - } - } - } - - return true; - } - - /** - * Check if blurb meets conditions. - * - * @since 3.1 - * - * @param array $blurb Blurb data. - * @return bool - */ - public function does_blurb_meet_conditions( $blurb ) { - if ( isset( $blurb['conditions'] ) && ! empty( $blurb['conditions'] ) ) { - foreach ( $blurb['conditions'] as $condition_name => $condition ) { - if ( empty( $condition ) ) { - continue; - } - - // Pass check. - if ( 'current_pass' === $condition_name ) { - if ( ! $this->check_blurb_current_pass( $condition ) ) { - return false; - } - } - - // Active plugins check. - if ( 'active_plugins' === $condition_name ) { - if ( ! $this->check_blurb_active_plugins( $condition ) ) { - return false; - } - } - - // Inactive plugins check. - if ( 'inactive_plugins' === $condition_name ) { - if ( ! $this->check_blurb_inactive_plugins( $condition ) ) { - return false; - } - } - - // Check for specific product/downloads. - if ( 'has_downloads' === $condition_name ) { - if ( ! $this->check_blurb_has_downloads( $condition ) ) { - return false; - } - } - } - } - - return true; - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/class-edd-email-summary-cron.php b/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/class-edd-email-summary-cron.php deleted file mode 100644 index e39593ed..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/class-edd-email-summary-cron.php +++ /dev/null @@ -1,164 +0,0 @@ -is_enabled() || wp_next_scheduled( self::CRON_EVENT_NAME ) ) { - return; - } - - // Get the event date based on user settings. - $days = EDD()->utils->date()->getDays(); - $email_frequency = edd_get_option( 'email_summary_frequency', 'weekly' ); - $week_start_day = $days[ (int) get_option( 'start_of_week' ) ]; - - if ( 'monthly' === $email_frequency ) { - $next_time_string = 'first day of next month 8am'; - } else { - $next_time_string = "next {$week_start_day} 8am"; - } - - $date = new \DateTime( $next_time_string, new DateTimeZone( edd_get_timezone_id() ) ); - wp_schedule_single_event( $date->getTimestamp(), self::CRON_EVENT_NAME ); - } - - /** - * Clear all cron events related to email summary. - * - * @since 3.1 - * - * @return void - */ - public function clear_cron_events() { - wp_clear_scheduled_hook( self::CRON_EVENT_NAME ); - } - - /** - * Detect when settings that affect the - * schedule of email summaries are updated. - * - * @since 3.1 - * - * @param string $option_name WordPress option that was changed. - * @param string $old_value Old option value. - * @param string $new_value New option value. - * - * @return void - */ - public function settings_changed( $option_name, $old_value, $new_value ) { - if ( ! in_array( $option_name, array( 'edd_settings', 'start_of_week', 'timezone_string', 'gmt_offset' ), true ) ) { - return; - } - - // If `edd_settings` were changed, listen - // only to changes in specific fields. - if ( 'edd_settings' === $option_name ) { - $change_detected = false; - $field_listeners = array( 'email_summary_frequency', 'disable_email_summary' ); - foreach ( $field_listeners as $field ) { - if ( ( empty( $old_value[ $field ] ) || empty( $new_value[ $field ] ) ) || ( $old_value[ $field ] !== $new_value[ $field ] ) ) { - $change_detected = true; - break; - } - } - - if ( ! $change_detected ) { - return; - } - - // Reload EDD options so that we have the newest values in class methods. - global $edd_options; - $edd_options = get_option( 'edd_settings' ); - } - - $this->clear_cron_events(); - $this->schedule_cron_events(); - } - - /** - * Initialize the cron with all the proper checks. - * - * @since 3.1 - * - * @return void - */ - public function run_cron() { - // This is not cron, abort! - if ( ! wp_doing_cron() ) { - return; - } - - $email = new EDD_Email_Summary(); - $email->send_email(); - - // Schedule the next event. - $this->schedule_cron_events(); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/class-edd-email-summary.php b/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/class-edd-email-summary.php deleted file mode 100644 index 4aa82d7e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/class-edd-email-summary.php +++ /dev/null @@ -1,418 +0,0 @@ -test_mode = $test_mode; - $this->email_options = array( - 'email_summary_frequency' => edd_get_option( 'email_summary_frequency', 'weekly' ), - ); - } - - /** - * Get site URL. - * - * @since 3.1 - * - * @return string Host of the site url. - */ - public function get_site_url() { - $site_url = get_site_url(); - $site_url_parsed = wp_parse_url( $site_url ); - $site_url = isset( $site_url_parsed['host'] ) ? $site_url_parsed['host'] : $site_url; - - return $site_url; - } - - /** - * Get email subject. - * - * @since 3.1 - * - * @return string Email subject. - */ - public function get_email_subject() { - /* Translators: Site domain name */ - $email_subject = sprintf( __( 'Easy Digital Downloads Summary - %s', 'easy-digital-downloads' ), $this->get_site_url() ); - - if ( $this->test_mode ) { - $email_subject = '[TEST] ' . $email_subject; - } - - return $email_subject; - } - - /** - * Get email recipients. - * - * @since 3.1 - * - * @return array Recipients to receive the email. - */ - public function get_email_recipients() { - $recipients = array(); - - if ( 'admin' === edd_get_option( 'email_summary_recipient', 'admin' ) ) { - $recipients[] = get_option( 'admin_email' ); - } else { - $emails = edd_get_option( 'email_summary_custom_recipients', '' ); - $emails = array_map( 'trim', explode( "\n", $emails ) ); - foreach ( $emails as $email ) { - if ( is_email( $email ) ) { - $recipients[] = $email; - } - } - } - - if ( empty( $recipients ) ) { - edd_debug_log( __( 'Missing email recipients for Email Summary', 'easy-digital-downloads' ), true ); - } - - return apply_filters( 'edd_email_summary_recipients', $recipients ); - } - - /** - * Get report start date. - * - * @since 3.1 - * - * @return EDD\Utils\Date An array of start date and its relative counterpart as the EDD date object set at the UTC equivalent time. - */ - public function get_report_start_date() { - $date = EDD()->utils->date( 'now', edd_get_timezone_id(), false ); - - if ( 'monthly' === $this->email_options['email_summary_frequency'] ) { - $start_date = $date->copy()->subMonth( 1 )->startOfMonth(); - $relative_start_date = $date->copy()->subMonth( 2 )->startOfMonth(); - } else { - $start_date = $date->copy()->subDay( 7 )->startOfDay(); - $relative_start_date = $date->copy()->subDay( 14 )->startOfDay(); - } - - return array( - 'start_date' => $start_date, - 'relative_start_date' => $relative_start_date, - ); - } - - /** - * Get report end date. - * - * @since 3.1 - * - * @return EDD\Utils\Date An array of end date and its relative counterpart as the EDD date object set at the UTC equivalent time. - */ - public function get_report_end_date() { - $date = EDD()->utils->date( 'now', edd_get_timezone_id(), false ); - - if ( 'monthly' === $this->email_options['email_summary_frequency'] ) { - $end_date = $date->copy()->subMonth( 1 )->endOfMonth(); - $relative_end_date = $date->copy()->subMonth( 2 )->endOfMonth(); - } else { - $end_date = $date->copy()->endOfDay(); - $relative_end_date = $date->copy()->subDay( 7 )->endOfDay(); - } - - return array( - 'end_date' => $end_date, - 'relative_end_date' => $relative_end_date, - ); - } - - /** - * Get report date range. - * - * @since 3.1 - * - * @return array Array of start and end date objects in \EDD\Utils\Date[] format. - */ - public function get_report_date_range() { - // @todo - Check if we have to convert this to UTC because of DB? - return array_merge( - $this->get_report_start_date(), - $this->get_report_end_date() - ); - } - /** - * Retrieve ! TEST ! dataset for email content. - * - * @since 3.1 - * - * @return array Data and statistics for the period. - */ - public function get_test_report_dataset() { - $stats = new EDD\Stats(); - $args = array( - 'post_type' => 'download', - 'posts_per_page' => 5, - 'fields' => 'ids', - 'no_found_rows' => true, - ); - - $downloads = new WP_Query( $args ); - $top_selling_products = array(); - - foreach ( $downloads->posts as $post ) { - $download = new EDD_Download( $post ); - - $product = new stdClass(); - $product->object = $download; - $product->total = 100; - - $top_selling_products[] = $product; - } - - $data = array( - 'earnings_gross' => array( - 'value' => 5000, - 'relative_data' => $stats->generate_relative_data( 5000, 4000 ), - ), - 'earnings_net' => array( - 'value' => 4500, - 'relative_data' => $stats->generate_relative_data( 4500, 3500 ), - ), - 'average_order_value' => array( - 'value' => 29, - 'relative_data' => $stats->generate_relative_data( 20, 35 ), - ), - 'new_customers' => array( - 'value' => 25, - 'relative_data' => $stats->generate_relative_data( 25, 20 ), - ), - 'top_selling_products' => $top_selling_products, - 'order_count' => array( 'value' => 172 ), - ); - - return $data; - } - - /** - * Retrieve dataset for email content. - * - * @since 3.1 - * - * @return array Data and statistics for the period. - */ - public function get_report_dataset() { - if ( $this->test_mode ) { - return $this->get_test_report_dataset(); - } - - $date_range = $this->get_report_date_range(); - $start_date = $date_range['start_date']->format( 'Y-m-d H:i:s' ); - $end_date = $date_range['end_date']->format( 'Y-m-d H:i:s' ); - $relative_start_date = $date_range['relative_start_date']->format( 'Y-m-d H:i:s' ); - $relative_end_date = $date_range['relative_end_date']->format( 'Y-m-d H:i:s' ); - $stats = new EDD\Stats( - array( - 'output' => 'array', - 'start' => $start_date, - 'end' => $end_date, - 'relative' => true, - 'relative_start' => $relative_start_date, - 'relative_end' => $relative_end_date, - ) - ); - - $earnings_gross = $stats->get_order_earnings( - array( - 'function' => 'SUM', - 'exclude_taxes' => false, - 'revenue_type' => 'gross', - ) - ); - - $earnings_net = $stats->get_order_earnings( - array( - 'function' => 'SUM', - 'exclude_taxes' => true, - 'revenue_type' => 'net', - ) - ); - - $average_order_value = $stats->get_order_earnings( - array( - 'function' => 'AVG', - 'exclude_taxes' => false, - ) - ); - - $new_customers = $stats->get_customer_count( - array( - 'purchase_count' => true, - ) - ); - - $top_selling_products = $stats->get_most_valuable_order_items( - array( - 'number' => 5, - ) - ); - - $order_count = $stats->get_order_count(); - - return compact( - 'earnings_gross', - 'earnings_net', - 'average_order_value', - 'new_customers', - 'top_selling_products', - 'order_count' - ); - } - - /** - * Generate HTML for relative markup. - * - * @since 3.1 - * - * @param array $relative_data Calculated relative data. - * - * @return string HTML for relative markup. - */ - private function build_relative_markup( $relative_data ) { - $arrow = $relative_data['positive_change'] ? 'icon-arrow-up.png' : 'icon-arrow-down.png'; - $output = __( 'No data to compare', 'easy-digital-downloads' ); - if ( $relative_data['no_change'] ) { - $output = __( 'No Change', 'easy-digital-downloads' ); - } elseif ( $relative_data['comparable'] ) { - $output = $relative_data['formatted_percentage_change'] . '%'; - } - ob_start(); - ?> - - - - - - - get_report_dataset(); - // If there were no sales, do not build an email template. - if ( empty( $dataset['order_count'] ) || 0 === $dataset['order_count'] ) { - return false; - } - - $date_range = $this->get_report_date_range(); - $site_url = get_site_url(); - $view_more_url = edd_get_admin_url( - array( - 'page' => 'edd-reports', - 'range' => ( 'monthly' === $this->email_options['email_summary_frequency'] ) ? 'last_month' : 'last_week', - 'relative_range' => 'previous_period', - ) - ); - $wp_date_format = get_option( 'date_format' ); - $period_name = ( 'monthly' === $this->email_options['email_summary_frequency'] ) ? __( 'month', 'easy-digital-downloads' ) : __( 'week', 'easy-digital-downloads' ); - /* Translators: period name (e.g. week) */ - $relative_text = sprintf( __( 'vs previous %s', 'easy-digital-downloads' ), $period_name ); - - ob_start(); - include EDD_PLUGIN_DIR . 'includes/emails/email-summary/edd-email-summary-template.php'; - - return ob_get_clean(); - } - - /** - * Prepare and send email. - * - * @since 3.1 - * - * @return bool True if email was sent, false if there was an error. - */ - public function send_email() { - // Get next blurb. - $email_blurbs = new EDD_Email_Summary_Blurb(); - $next_blurb = false; - - if ( ! $this->test_mode ) { - $next_blurb = $email_blurbs->get_next(); - } - - // Prepare email. - $email_body = $this->build_email_template( $next_blurb ); - // If there is no email body, we cannot continue. - if ( ! $email_body ) { - edd_debug_log( __( 'Email body for Email Summary was empty.', 'easy-digital-downloads' ), true ); - return false; - } - - $email_subject = $this->get_email_subject(); - $email_recipients = $this->get_email_recipients(); - $email_headers = array( 'Content-Type: text/html; charset=UTF-8' ); - - // Everything is ok, send email. - $email_sent = wp_mail( $email_recipients, $email_subject, $email_body, $email_headers ); - if ( $email_sent ) { - $email_blurbs->mark_blurb_sent( $next_blurb ); - } - - return $email_sent; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/edd-email-summary-template.php b/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/edd-email-summary-template.php deleted file mode 100644 index 4eddf0e2..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/emails/email-summary/edd-email-summary-template.php +++ /dev/null @@ -1,418 +0,0 @@ - - - - <?php echo esc_html( $this->get_email_subject() ); ?> - - - - - - - - - - - - - -

    - format( $wp_date_format ) ); ?> - format( $wp_date_format ) ); ?> -
    - - - - - - - - - - - - - - - - diff --git a/wp-content/plugins/easy-digital-downloads/includes/emails/functions.php b/wp-content/plugins/easy-digital-downloads/includes/emails/functions.php deleted file mode 100644 index ad6cd114..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/emails/functions.php +++ /dev/null @@ -1,410 +0,0 @@ -get_meta( '_edd_payment_meta', true ); - - $from_name = edd_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); - $from_name = apply_filters( 'edd_purchase_from_name', $from_name, $payment_id, $payment_data ); - - $from_email = edd_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); - $from_email = apply_filters( 'edd_purchase_from_address', $from_email, $payment_id, $payment_data ); - - if ( empty( $to_email ) ) { - $to_email = $payment->email; - } - - $subject = edd_get_option( 'purchase_subject', __( 'Purchase Receipt', 'easy-digital-downloads' ) ); - $subject = apply_filters( 'edd_purchase_subject', wp_strip_all_tags( $subject ), $payment_id ); - $subject = wp_specialchars_decode( edd_do_email_tags( $subject, $payment_id ) ); - - $heading = edd_get_option( 'purchase_heading', __( 'Purchase Receipt', 'easy-digital-downloads' ) ); - $heading = apply_filters( 'edd_purchase_heading', $heading, $payment_id, $payment_data ); - $heading = edd_do_email_tags( $heading, $payment_id ); - - $attachments = apply_filters( 'edd_receipt_attachments', array(), $payment_id, $payment_data ); - - $message = edd_do_email_tags( edd_get_email_body_content( $payment_id, $payment_data ), $payment_id ); - - $emails = EDD()->emails; - - $emails->__set( 'from_name', $from_name ); - $emails->__set( 'from_email', $from_email ); - $emails->__set( 'heading', $heading ); - - $headers = apply_filters( 'edd_receipt_headers', $emails->get_headers(), $payment_id, $payment_data ); - $emails->__set( 'headers', $headers ); - - $sent = $emails->send( $to_email, $subject, $message, $attachments ); - - if ( $admin_notice && ! edd_admin_notices_disabled( $payment_id ) ) { - do_action( 'edd_admin_sale_notice', $payment_id, $payment_data ); - } - - return $sent; -} - -/** - * Email the download link(s) and payment confirmation to the admin accounts for testing. - * - * @since 1.5 - * @return void - */ -function edd_email_test_purchase_receipt() { - - $from_name = edd_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); - $from_name = apply_filters( 'edd_purchase_from_name', $from_name, 0, array() ); - - $from_email = edd_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); - $from_email = apply_filters( 'edd_test_purchase_from_address', $from_email, 0, array() ); - - $subject = edd_get_option( 'purchase_subject', __( 'Purchase Receipt', 'easy-digital-downloads' ) ); - $subject = apply_filters( 'edd_purchase_subject', wp_strip_all_tags( $subject ), 0 ); - $subject = wp_specialchars_decode( edd_do_email_tags( $subject, 0 ) ); - - $heading = edd_get_option( 'purchase_heading', __( 'Purchase Receipt', 'easy-digital-downloads' ) ); - $heading = edd_email_preview_template_tags( apply_filters( 'edd_purchase_heading', $heading, 0, array() ) ); - - $attachments = apply_filters( 'edd_receipt_attachments', array(), 0, array() ); - - $message = edd_email_preview_template_tags( edd_get_email_body_content( 0, array() ), 0 ); - - $emails = EDD()->emails; - $emails->__set( 'from_name' , $from_name ); - $emails->__set( 'from_email', $from_email ); - $emails->__set( 'heading' , $heading ); - - $headers = apply_filters( 'edd_receipt_headers', $emails->get_headers(), 0, array() ); - $emails->__set( 'headers', $headers ); - - $emails->send( edd_get_admin_notice_emails(), $subject, $message, $attachments ); - -} - -/** - * Sends the Admin Sale Notification Email - * - * @since 1.4.2 - * @param int $payment_id Payment ID (default: 0) - * @param array $payment_data Payment Meta and Data - * @return void - */ -function edd_admin_email_notice( $payment_id = 0, $payment_data = array() ) { - - $payment_id = absint( $payment_id ); - - if( empty( $payment_id ) ) { - return; - } - - if( ! edd_get_payment_by( 'id', $payment_id ) ) { - return; - } - - $from_name = edd_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); - $from_name = apply_filters( 'edd_purchase_from_name', $from_name, $payment_id, $payment_data ); - - $from_email = edd_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); - $from_email = apply_filters( 'edd_admin_sale_from_address', $from_email, $payment_id, $payment_data ); - - $subject = edd_get_option( 'sale_notification_subject', sprintf( __( 'New download purchase - Order #%1$s', 'easy-digital-downloads' ), $payment_id ) ); - $subject = apply_filters( 'edd_admin_sale_notification_subject', wp_strip_all_tags( $subject ), $payment_id ); - $subject = wp_specialchars_decode( edd_do_email_tags( $subject, $payment_id ) ); - - $heading = edd_get_option( 'sale_notification_heading', __( 'New Sale!', 'easy-digital-downloads' ) ); - $heading = apply_filters( 'edd_admin_sale_notification_heading', $heading, $payment_id, $payment_data ); - $heading = edd_do_email_tags( $heading, $payment_id ); - - $attachments = apply_filters( 'edd_admin_sale_notification_attachments', array(), $payment_id, $payment_data ); - - $message = edd_get_sale_notification_body_content( $payment_id, $payment_data ); - - $emails = EDD()->emails; - - $emails->__set( 'from_name', $from_name ); - $emails->__set( 'from_email', $from_email ); - $emails->__set( 'heading', $heading ); - - $headers = apply_filters( 'edd_admin_sale_notification_headers', $emails->get_headers(), $payment_id, $payment_data ); - $emails->__set( 'headers', $headers ); - - $emails->send( edd_get_admin_notice_emails(), $subject, $message, $attachments ); - -} -add_action( 'edd_admin_sale_notice', 'edd_admin_email_notice', 10, 2 ); - -/** - * Retrieves the emails for which admin notifications are sent to (these can be - * changed in the EDD Settings) - * - * @since 1.0 - * @return mixed - */ -function edd_get_admin_notice_emails() { - $emails = edd_get_option( 'admin_notice_emails', false ); - $emails = strlen( trim( $emails ) ) > 0 ? $emails : get_bloginfo( 'admin_email' ); - $emails = array_map( 'trim', explode( "\n", $emails ) ); - - return apply_filters( 'edd_admin_notice_emails', $emails ); -} - -/** - * Checks whether admin sale notices are disabled - * - * @since 1.5.2 - * - * @param int $payment_id - * @return mixed - */ -function edd_admin_notices_disabled( $payment_id = 0 ) { - $ret = edd_get_option( 'disable_admin_notices', false ); - return (bool) apply_filters( 'edd_admin_notices_disabled', $ret, $payment_id ); -} - -/** - * Get sale notification email text - * - * Returns the stored email text if available, the standard email text if not - * - * @since 1.7 - * @author Daniel J Griffiths - * @return string $message - */ -function edd_get_default_sale_notification_email() { - $default_email_body = __( 'Hello', 'easy-digital-downloads' ) . "\n\n" . sprintf( __( 'A %s purchase has been made', 'easy-digital-downloads' ), edd_get_label_plural() ) . ".\n\n"; - $default_email_body .= sprintf( __( '%s sold:', 'easy-digital-downloads' ), edd_get_label_plural() ) . "\n\n"; - $default_email_body .= '{download_list}' . "\n\n"; - $default_email_body .= __( 'Purchased by: ', 'easy-digital-downloads' ) . ' {name}' . "\n"; - $default_email_body .= __( 'Amount: ', 'easy-digital-downloads' ) . ' {price}' . "\n"; - $default_email_body .= __( 'Payment Method: ', 'easy-digital-downloads' ) . ' {payment_method}' . "\n\n"; - $default_email_body .= __( 'Thank you', 'easy-digital-downloads' ); - - $message = edd_get_option( 'sale_notification', false ); - $message = ! empty( $message ) ? $message : $default_email_body; - - return $message; -} - -/** - * Get various correctly formatted names used in emails - * - * @since 1.9 - * @param $user_info - * @param $payment EDD_Payment for getting the names - * - * @return array $email_names - */ -function edd_get_email_names( $user_info, $payment = false ) { - $email_names = array(); - $email_names['fullname'] = ''; - - if ( $payment instanceof EDD_Payment ) { - - $email_names['name'] = $payment->email; - $email_names['username'] = $payment->email; - if ( $payment->user_id > 0 ) { - - $user_data = get_userdata( $payment->user_id ); - $email_names['name'] = $payment->first_name; - $email_names['fullname'] = trim( $payment->first_name . ' ' . $payment->last_name ); - if ( ! empty( $user_data->user_login ) ) { - $email_names['username'] = $user_data->user_login; - } - - } elseif ( ! empty( $payment->first_name ) ) { - - $email_names['name'] = $payment->first_name; - $email_names['fullname'] = trim( $payment->first_name . ' ' . $payment->last_name ); - $email_names['username'] = $payment->first_name; - - } - } else { - - if ( is_serialized( $user_info ) ) { - - preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $user_info, $matches ); - if ( ! empty( $matches ) ) { - return array( - 'name' => '', - 'fullname' => '', - 'username' => '', - ); - } else { - $user_info = maybe_unserialize( $user_info ); - } - - } - - if ( isset( $user_info['id'] ) && $user_info['id'] > 0 && isset( $user_info['first_name'] ) ) { - $user_data = get_userdata( $user_info['id'] ); - $email_names['name'] = $user_info['first_name']; - $email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name']; - $email_names['username'] = $user_data->user_login; - } elseif ( isset( $user_info['first_name'] ) ) { - $email_names['name'] = $user_info['first_name']; - $email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name']; - $email_names['username'] = $user_info['first_name']; - } else { - $email_names['name'] = $user_info['email']; - $email_names['username'] = $user_info['email']; - } - - } - - return $email_names; -} - -/** - * Handle installation and connection for Recapture via ajax - * - * @since 2.10.2 - */ -function edd_recapture_remote_install_handler () { - - if ( ! current_user_can( 'manage_shop_settings' ) || ! current_user_can( 'install_plugins' ) ) { - wp_send_json_error( array( - 'error' => __( 'You do not have permission to do this.', 'easy-digital-downloads' ) - ) ); - } - - include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; - include_once ABSPATH . 'wp-admin/includes/file.php'; - include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - - $plugins = get_plugins(); - - if( ! array_key_exists( 'recapture-for-edd/recapture.php', $plugins ) ) { - - /* - * Use the WordPress Plugins API to get the plugin download link. - */ - $api = plugins_api( 'plugin_information', array( - 'slug' => 'recapture-for-edd', - ) ); - - if ( is_wp_error( $api ) ) { - wp_send_json_error( array( - 'error' => $api->get_error_message(), - 'debug' => $api - ) ); - } - - /* - * Use the AJAX Upgrader skin to quietly install the plugin. - */ - $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() ); - $install = $upgrader->install( $api->download_link ); - if ( is_wp_error( $install ) ) { - wp_send_json_error( array( - 'error' => $install->get_error_message(), - 'debug' => $api - ) ); - } - - $activated = activate_plugin( $upgrader->plugin_info() ); - - } else { - - $activated = activate_plugin( 'recapture-for-edd/recapture.php' ); - - } - - /* - * Final check to see if Recapture is available. - */ - if ( is_wp_error( $activated ) ) { - wp_send_json_error( array( - 'error' => __( 'Something went wrong. Recapture for EDD was not installed correctly.', 'easy-digital-downloads' ) - ) ); - } - - wp_send_json_success(); -} -add_action( 'wp_ajax_edd_recapture_remote_install', 'edd_recapture_remote_install_handler' ); - -/** - * Maybe adds a notice to abandoned payments if Recapture isn't installed. - * - * @since 2.10.2 - * - * @param int $payment_id The ID of the abandoned payment, for which a Recapture notice is being thrown. - */ -function maybe_add_recapture_notice_to_abandoned_payment( $payment_id ) { - - if ( ! class_exists( 'Recapture' ) - && 'abandoned' === edd_get_payment_status( $payment_id ) - && ! get_user_meta( get_current_user_id(), '_edd_try_recapture_dismissed', true ) - ) { - ?> -
    -

    - tag, %2$s - tag, %3$s - tag, %4$s - tag */ - __( '%1$sRecover abandoned purchases like this one.%2$s %3$sTry Recapture for free%4$s.', 'easy-digital-downloads' ), - '', - '', - '', - '' - ) - ); - ?> -

    - 'dismiss_notices', - 'edd_notice' => 'try_recapture', - ) - ), - 'edd_notice_nonce' - ) - ), - '" type="button" class="notice-dismiss">', - '', - ' - ' - ) - ); - ?> -
    - - - - - - $tag['label'] ? $tag['label'] : $tag['tag'], - 'tag' => $tag['tag'], - 'keywords' => array_merge( - explode( ' ', $tag['description'] ), - array( $tag['tag'] ) - ), - ); - } - - wp_localize_script( - 'edd-admin-email-tags', - 'eddEmailTagsInserter', - array( - 'items' => $items, - ) - ); -} - -/** - * Output Thickbox content. - * - * @since 3.0 - */ -function edd_email_tags_inserter_thickbox_content() { - $tags = edd_get_email_tags(); - ?> - - email_tags->add( $tag, $description, $func, $label ); -} - -/** - * Remove an email tag - * - * @since 1.9 - * - * @param string $tag Email tag to remove hook from - */ -function edd_remove_email_tag( $tag ) { - EDD()->email_tags->remove( $tag ); -} - -/** - * Check if $tag is a registered email tag - * - * @since 1.9 - * - * @param string $tag Email tag that will be searched - * - * @return bool - */ -function edd_email_tag_exists( $tag ) { - return EDD()->email_tags->email_tag_exists( $tag ); -} - -/** - * Get all email tags - * - * @since 1.9 - * - * @return array - */ -function edd_get_email_tags() { - return EDD()->email_tags->get_tags(); -} - -/** - * Get a formatted HTML list of all available email tags. - * - * @since 1.9 - * - * @return string - */ -function edd_get_emails_tags_list() { - - // Begin with empty list. - $list = ''; - - // Get all tags. - $email_tags = (array) edd_get_email_tags(); - - // Check. - if ( count( $email_tags ) > 0 ) { - - // Loop. - foreach ( $email_tags as $email_tag ) { - - // Add email tag to list. - $list .= '{' . $email_tag['tag'] . '} - ' . $email_tag['description'] . '
    '; - } - } - - // Return the list. - return $list; -} - -/** - * Search content for email tags and filter email tags through their hooks. - * - * @since 1.9 - * @since 3.0 Renamed `$payment_id` parameter to `$order_id`. - * Set default value of `$order_id` to 0. - * Set default value of `$content` to empty string. - * - * @param string $content Content to search for email tags. - * @param int $order_id Order ID. - * - * @return string Content with email tags filtered out. - */ -function edd_do_email_tags( $content = '', $order_id = 0 ) { - - // Replace all tags. - $content = EDD()->email_tags->do_tags( $content, $order_id ); - - // Maintaining backwards compatibility. - $content = apply_filters( 'edd_email_template_tags', $content, edd_get_payment_meta( $order_id ), $order_id ); - - // Return content. - return $content; -} - -/** - * Load email tags. - * - * @since 1.9 - */ -function edd_load_email_tags() { - do_action( 'edd_add_email_tags' ); -} -add_action( 'init', 'edd_load_email_tags', -999 ); - -/** - * Add default EDD email template tags. - * - * @since 1.9 - */ -function edd_setup_email_tags() { - $email_tags = array( - array( - 'tag' => 'download_list', - 'label' => __( 'Download List', 'easy-digital-downloads' ), - 'description' => __( 'A list of download links for each download purchased.', 'easy-digital-downloads' ), - 'function' => 'text/html' === EDD()->emails->get_content_type() - ? 'edd_email_tag_download_list' - : 'edd_email_tag_download_list_plain', - ), - array( - 'tag' => 'file_urls', - 'label' => __( 'File URLs', 'easy-digital-downloads' ), - 'description' => __( 'A plain-text list of download URLs for each download purchased.', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_file_urls', - ), - array( - 'tag' => 'name', - 'label' => __( 'First Name', 'easy-digital-downloads' ), - 'description' => __( "The buyer's first name.", 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_first_name', - ), - array( - 'tag' => 'fullname', - 'label' => __( 'Full Name', 'easy-digital-downloads' ), - 'description' => __( "The buyer's full name: first and last.", 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_fullname', - ), - array( - 'tag' => 'username', - 'label' => __( 'Username', 'easy-digital-downloads' ), - 'description' => __( "The buyer's user name on the site, if they registered an account.", 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_username', - ), - array( - 'tag' => 'user_email', - 'label' => __( 'Email', 'easy-digital-downloads' ), - 'description' => __( "The buyer's email address.", 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_user_email', - ), - array( - 'tag' => 'billing_address', - 'label' => __( 'Billing Address', 'easy-digital-downloads' ), - 'description' => __( "The buyer's billing address.", 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_billing_address', - ), - array( - 'tag' => 'date', - 'label' => __( 'Purchase Date', 'easy-digital-downloads' ), - 'description' => __( 'The date of the purchase.', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_date', - ), - array( - 'tag' => 'subtotal', - 'label' => __( 'Subtotal', 'easy-digital-downloads' ), - 'description' => __( 'The price of the purchase before taxes.', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_subtotal', - ), - array( - 'tag' => 'tax', - 'label' => __( 'Tax', 'easy-digital-downloads' ), - 'description' => __( 'The taxed amount of the purchase', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_tax', - ), - array( - 'tag' => 'price', - 'label' => __( 'Price', 'easy-digital-downloads' ), - 'description' => __( 'The total price of the purchase', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_price', - ), - array( - 'tag' => 'payment_id', - 'label' => __( 'Payment ID', 'easy-digital-downloads' ), - 'description' => __( 'The unique identifier for this purchase.', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_payment_id', - ), - array( - 'tag' => 'receipt_id', - 'label' => __( 'Receipt ID', 'easy-digital-downloads' ), - 'description' => __( 'The unique identifier for the receipt of this purchase.', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_receipt_id', - ), - array( - 'tag' => 'payment_method', - 'label' => __( 'Payment Method', 'easy-digital-downloads' ), - 'description' => __( 'The method of payment used for this purchase.', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_payment_method', - ), - array( - 'tag' => 'sitename', - 'label' => __( 'Site Name', 'easy-digital-downloads' ), - 'description' => __( 'Your site name.', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_sitename', - ), - array( - 'tag' => 'receipt', - 'label' => __( 'Receipt', 'easy-digital-downloads' ), - 'description' => __( 'Links to the EDD success page with the text "View Receipt".', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_receipt', - ), - array( - 'tag' => 'receipt_link', - 'label' => __( 'Receipt Link', 'easy-digital-downloads' ), - 'description' => __( 'Adds a link so users can view their receipt directly on a simplified page on your site if they are unable to view it in the browser correctly.', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_receipt_link', - ), - array( - 'tag' => 'discount_codes', - 'label' => __( 'Discount Codes', 'easy-digital-downloads' ), - 'description' => __( 'Adds a list of any discount codes applied to this purchase.', 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_discount_codes', - ), - array( - 'tag' => 'ip_address', - 'label' => __( 'IP Address', 'easy-digital-downloads' ), - 'description' => __( "The buyer's IP Address.", 'easy-digital-downloads' ), - 'function' => 'edd_email_tag_ip_address', - ), - ); - - // Apply edd_email_tags filter - $email_tags = apply_filters( 'edd_email_tags', $email_tags ); - - // Add email tags - foreach ( $email_tags as $email_tag ) { - $label = isset( $email_tag['label'] ) ? $email_tag['label'] : ''; - edd_add_email_tag( $email_tag['tag'], $email_tag['description'], $email_tag['function'], $label ); - } - -} -add_action( 'edd_add_email_tags', 'edd_setup_email_tags' ); - -/** - * Email template tag: download_list - * A list of download links for each download purchased - * - * @param int $payment_id - * - * @return string download_list - */ -function edd_email_tag_download_list( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - $order = edd_get_order( $payment_id ); - - if ( ! $order ) { - return ''; - } - - $download_list = '
      '; - $cart_items = $payment->cart_details; - $needs_notes = array(); - - if ( $order->get_items() ) { - $show_names = apply_filters( 'edd_email_show_names', true ); - $show_links = apply_filters( 'edd_email_show_links', true ); - - foreach ( $order->get_items() as $item ) { - - if ( edd_use_skus() ) { - $sku = edd_get_download_sku( $item->product_id ); - } - - if ( edd_item_quantities_enabled() ) { - $quantity = $item->quantity; - } - - if ( $show_names ) { - - $title = '' . $item->product_name . ''; - - if ( ! empty( $quantity ) && $quantity > 1 ) { - $title .= " – " . __( 'Quantity', 'easy-digital-downloads' ) . ': ' . $quantity; - } - - if ( ! empty( $sku ) ) { - $title .= " – " . __( 'SKU', 'easy-digital-downloads' ) . ': ' . $sku; - } - - $download_list .= '
    • ' . apply_filters( 'edd_email_receipt_download_title', $title, $cart_items[ $item->cart_index ], $item->price_id, $payment_id ) . '
      '; - } - - $files = edd_get_download_files( $item->product_id, $item->price_id ); - - if ( ! empty( $files ) ) { - - foreach ( $files as $filekey => $file ) { - - if ( $show_links ) { - $download_list .= '
      '; - $file_url = edd_get_download_file_url( $order, $order->email, $filekey, $item->product_id, $item->price_id ); - $download_list .= '' . edd_get_file_name( $file ) . ''; - $download_list .= '
      '; - } else { - $download_list .= '
      '; - $download_list .= edd_get_file_name( $file ); - $download_list .= '
      '; - } - - } - - } elseif ( edd_is_bundled_product( $item->product_id ) ) { - - $bundled_products = apply_filters( 'edd_email_tag_bundled_products', edd_get_bundled_products( $item->product_id, $item->price_id ), $item, $payment_id, 'download_list' ); - - foreach ( $bundled_products as $bundle_item ) { - - $download_list .= '
      ' . get_the_title( $bundle_item ) . '
      '; - - $bundle_item_id = edd_get_bundle_item_id( $bundle_item ); - $bundle_item_price_id = edd_get_bundle_item_price_id( $bundle_item ); - $download_files = edd_get_download_files( $bundle_item_id, $bundle_item_price_id ); - - foreach ( $download_files as $filekey => $file ) { - if ( $show_links ) { - $download_list .= '
      '; - $file_url = edd_get_download_file_url( $order, $order->email, $filekey, $bundle_item_id, $bundle_item_price_id ); - $download_list .= '' . edd_get_file_name( $file ) . ''; - $download_list .= '
      '; - } else { - $download_list .= '
      '; - $download_list .= edd_get_file_name( $file ); - $download_list .= '
      '; - } - } - } - - } else { - - $no_downloads_message = apply_filters( 'edd_receipt_no_files_found_text', __( 'No downloadable files found.', 'easy-digital-downloads' ), $item->product_id ); - $no_downloads_message = apply_filters( 'edd_email_receipt_no_downloads_message', $no_downloads_message, $item->product_id, $item->price_id, $payment_id ); - - if ( ! empty( $no_downloads_message ) ){ - $download_list .= '
      '; - $download_list .= $no_downloads_message; - $download_list .= '
      '; - } - } - - if ( ! array_key_exists( $item->product_id, $needs_notes ) ) { - $item_notes = edd_get_product_notes( $item->product_id ); - if ( $item_notes ) { - $needs_notes[ $item->product_id ] = array( - 'item_name' => get_the_title( $item->product_id ), - 'item_notes' => $item_notes, - ); - } - } - - if ( $show_names ) { - $download_list .= '
    • '; - } - } - } - $download_list .= '
    '; - - // Remove any empty values. - $needs_notes = array_filter( $needs_notes ); - if ( ! empty( $needs_notes ) ) { - $download_list .= __( 'Additional information about your purchase:', 'easy-digital-downloads' ); - - $download_list .= '
      '; - foreach ( $needs_notes as $note ) { - $download_list .= '
    • ' . $note['item_name'] . "\n" . '' . $note['item_notes'] . '
    • '; - } - $download_list .= '
    '; - } - - return $download_list; -} - -/** - * Email template tag: download_list - * A list of download links for each download purchased in plaintext - * - * @since 2.1.1 - * @param int $payment_id - * - * @return string download_list - */ -function edd_email_tag_download_list_plain( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - $order = edd_get_order( $payment_id ); - - $payment_data = $payment->get_meta(); - $cart_items = $payment->cart_details; - $download_list = ''; - - if ( $order->get_items() ) { - $show_names = apply_filters( 'edd_email_show_names', true ); - $show_links = apply_filters( 'edd_email_show_links', true ); - - foreach ( $order->get_items() as $item ) { - - if ( edd_use_skus() ) { - $sku = edd_get_download_sku( $item->product_id ); - } - - if ( edd_item_quantities_enabled() ) { - $quantity = $item->quantity; - } - - if ( $show_names ) { - - $title = $item->product_name; - - if ( ! empty( $quantity ) && $quantity > 1 ) { - $title .= __( 'Quantity', 'easy-digital-downloads' ) . ': ' . $quantity; - } - - if ( ! empty( $sku ) ) { - $title .= __( 'SKU', 'easy-digital-downloads' ) . ': ' . $sku; - } - - $download_list .= "\n"; - - $download_list .= apply_filters( 'edd_email_receipt_download_title', $title, $cart_items[ $item->cart_index ], $item->price_id, $payment_id ) . "\n"; - } - - $files = edd_get_download_files( $item->product_id, $item->price_id ); - - if ( ! empty( $files ) ) { - - foreach ( $files as $filekey => $file ) { - if( $show_links ) { - $download_list .= "\n"; - $file_url = edd_get_download_file_url( $order, $order->email, $filekey, $item->product_id, $item->price_id ); - $download_list .= edd_get_file_name( $file ) . ': ' . $file_url . "\n"; - } else { - $download_list .= "\n"; - $download_list .= edd_get_file_name( $file ) . "\n"; - } - } - - } elseif ( edd_is_bundled_product( $item->product_id ) ) { - - $bundled_products = apply_filters( 'edd_email_tag_bundled_products', edd_get_bundled_products( $item->product_id ), $cart_items[ $item->cart_index ], $payment_id, 'download_list' ); - - foreach ( $bundled_products as $bundle_item ) { - - $download_list .= '
    ' . get_the_title( $bundle_item ) . '
    '; - - $files = edd_get_download_files( $bundle_item ); - - foreach ( $files as $filekey => $file ) { - if( $show_links ) { - $file_url = edd_get_download_file_url( $order, $order->email, $filekey, $bundle_item, $item->price_id ); - $download_list .= edd_get_file_name( $file ) . ': ' . $file_url . "\n"; - } else { - $download_list .= edd_get_file_name( $file ) . "\n"; - } - } - } - } - - - if ( '' != edd_get_product_notes( $item->product_id ) ) { - $download_list .= "\n"; - $download_list .= edd_get_product_notes( $item->product_id ) . "\n"; - } - } - } - - return $download_list; -} - -/** - * Email template tag: file_urls - * A plain-text list of download URLs for each download purchased - * - * @param int $payment_id - * - * @return string $file_urls - */ -function edd_email_tag_file_urls( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - - $payment_data = $payment->get_meta(); - $file_urls = ''; - $cart_items = $payment->cart_details; - $email = $payment->email; - - foreach ( $cart_items as $item ) { - - $price_id = edd_get_cart_item_price_id( $item ); - $files = edd_get_download_files( $item['id'], $price_id ); - - if ( $files ) { - foreach ( $files as $filekey => $file ) { - $file_url = edd_get_download_file_url( $payment_data['key'], $email, $filekey, $item['id'], $price_id ); - - $file_urls .= esc_html( $file_url ) . '
    '; - } - } - elseif ( edd_is_bundled_product( $item['id'] ) ) { - - $bundled_products = apply_filters( 'edd_email_tag_bundled_products', edd_get_bundled_products( $item['id'] ), $item, $payment_id, 'file_urls' ); - - foreach ( $bundled_products as $bundle_item ) { - - $files = edd_get_download_files( $bundle_item ); - foreach ( $files as $filekey => $file ) { - $file_url = edd_get_download_file_url( $payment_data['key'], $email, $filekey, $bundle_item, $price_id ); - $file_urls .= esc_html( $file_url ) . '
    '; - } - - } - } - - } - - return $file_urls; -} - -/** - * Email template tag: name - * The buyer's first name - * - * @param int $payment_id - * - * @return string name - */ -function edd_email_tag_first_name( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - $user_info = $payment->user_info; - - if( empty( $user_info) ) { - return ''; - } - - $email_name = edd_get_email_names( $user_info, $payment ); - - return $email_name['name']; -} - -/** - * Email template tag: fullname - * The buyer's full name, first and last - * - * @param int $payment_id - * - * @return string fullname - */ -function edd_email_tag_fullname( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - $user_info = $payment->user_info; - - if( empty( $user_info ) ) { - return ''; - } - - $email_name = edd_get_email_names( $user_info, $payment ); - return $email_name['fullname']; -} - -/** - * Email template tag: username - * The buyer's user name on the site, if they registered an account - * - * @param int $payment_id - * - * @return string username - */ -function edd_email_tag_username( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - $user_info = $payment->user_info; - - if( empty( $user_info ) ) { - return ''; - } - - $email_name = edd_get_email_names( $user_info, $payment ); - return $email_name['username']; -} - -/** - * Email template tag: user_email - * The buyer's email address - * - * @param int $payment_id - * - * @return string user_email - */ -function edd_email_tag_user_email( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - - return $payment->email; -} - -/** - * Email template tag: billing_address - * The buyer's billing address - * - * @param int $payment_id - * - * @return string billing_address - */ -function edd_email_tag_billing_address( $payment_id ) { - - $user_info = edd_get_payment_meta_user_info( $payment_id ); - $user_address = ! empty( $user_info['address'] ) ? $user_info['address'] : array( 'line1' => '', 'line2' => '', 'city' => '', 'country' => '', 'state' => '', 'zip' => '' ); - - $return = $user_address['line1'] . "\n"; - if( ! empty( $user_address['line2'] ) ) { - $return .= $user_address['line2'] . "\n"; - } - $return .= $user_address['city'] . ' ' . $user_address['zip'] . ' ' . $user_address['state'] . "\n"; - $return .= $user_address['country']; - - return $return; -} - -/** - * Email template tag: date - * Date of purchase - * - * @param int $payment_id - * - * @return string date - */ -function edd_email_tag_date( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - return date_i18n( get_option( 'date_format' ), strtotime( $payment->date ) ); -} - -/** - * Email template tag: subtotal - * Price of purchase before taxes - * - * @param int $payment_id - * - * @return string subtotal - */ -function edd_email_tag_subtotal( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - $subtotal = edd_currency_filter( edd_format_amount( $payment->subtotal ), $payment->currency ); - return html_entity_decode( $subtotal, ENT_COMPAT, 'UTF-8' ); -} - -/** - * Email template tag: tax - * The taxed amount of the purchase - * - * @param int $payment_id - * - * @return string tax - */ -function edd_email_tag_tax( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - $tax = edd_currency_filter( edd_format_amount( $payment->tax ), $payment->currency ); - return html_entity_decode( $tax, ENT_COMPAT, 'UTF-8' ); -} - -/** - * Email template tag: price - * The total price of the purchase - * - * @param int $payment_id - * - * @return string price - */ -function edd_email_tag_price( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - $price = edd_currency_filter( edd_format_amount( $payment->total ), $payment->currency ); - return html_entity_decode( $price, ENT_COMPAT, 'UTF-8' ); -} - -/** - * Email template tag: payment_id - * The unique ID number for this purchase - * - * @param int $payment_id - * - * @return int payment_id - */ -function edd_email_tag_payment_id( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - return $payment->number; -} - -/** - * Email template tag: receipt_id - * The unique ID number for this purchase receipt - * - * @param int $payment_id - * - * @return string receipt_id - */ -function edd_email_tag_receipt_id( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - return $payment->key; -} - -/** - * Email template tag: payment_method - * The method of payment used for this purchase - * - * @param int $payment_id - * - * @return string gateway - */ -function edd_email_tag_payment_method( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - return edd_get_gateway_checkout_label( $payment->gateway ); -} - -/** - * Email template tag: sitename - * Your site name - * - * @param int $payment_id - * - * @return string sitename - */ -function edd_email_tag_sitename( $payment_id ) { - return wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ); -} - -/** - * Email template tag: receipt - * - * Adds a link to the user's receipt page on the website. - * - * @param [type] $order_id - * @return void - */ -function edd_email_tag_receipt( $order_id ) { - - return sprintf( - '%s', - esc_url( edd_get_receipt_page_uri( $order_id ) ), - __( 'View Receipt', 'easy-digital-downloads' ) - ); -} - -/** - * Email template tag: receipt_link - * Adds a link so users can view their receipt directly on your website if they are unable to view it in the browser correctly - * - * @param $payment_id int - * - * @return string receipt_link - */ -function edd_email_tag_receipt_link( $payment_id ) { - $receipt_url = esc_url( - add_query_arg( - array( - 'payment_key' => urlencode( edd_get_payment_key( $payment_id ) ), - 'edd_action' => 'view_receipt', - ), - home_url() - ) - ); - $formatted = sprintf( __( '%1$sView it in your browser %2$s', 'easy-digital-downloads' ), '', '»' ); - - if ( edd_get_option( 'email_template' ) !== 'none' ) { - return $formatted; - } else { - return $receipt_url; - } -} - -/** - * Email template tag: discount_codes - * Adds a list of any discount codes applied to this purchase - * - * @since 2.0 - * @param int $payment_id - * @return string $discount_codes - */ -function edd_email_tag_discount_codes( $payment_id ) { - $user_info = edd_get_payment_meta_user_info( $payment_id ); - - $discount_codes = ''; - - if( isset( $user_info['discount'] ) && $user_info['discount'] !== 'none' ) { - $discount_codes = $user_info['discount']; - } - - return $discount_codes; -} - -/** - * Email template tag: IP address - * IP address of the customer - * - * @since 2.3 - * @param int $payment_id - * @return string IP address - */ -function edd_email_tag_ip_address( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - return $payment->ip; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/emails/template.php b/wp-content/plugins/easy-digital-downloads/includes/emails/template.php deleted file mode 100644 index 9c280182..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/emails/template.php +++ /dev/null @@ -1,306 +0,0 @@ -get_templates() - * - * @since 1.0.8.2 - * @return array $templates All the registered email templates - */ -function edd_get_email_templates() { - $templates = new EDD_Emails; - return $templates->get_templates(); -} - -/** - * Email Template Tags - * - * @since 1.0 - * - * @param string $message Message with the template tags - * @param array $payment_data Payment Data - * @param int $payment_id Payment ID - * @param bool $admin_notice Whether or not this is a notification email - * - * @return string $message Fully formatted message - */ -function edd_email_template_tags( $message, $payment_data, $payment_id, $admin_notice = false ) { - return edd_do_email_tags( $message, $payment_id ); -} - -/** - * Email Preview Template Tags - * - * @since 1.0 - * @param string $message Email message with template tags - * @return string $message Fully formatted message - */ -function edd_email_preview_template_tags( $message ) { - $download_list = '
      '; - $download_list .= '
    • ' . __( 'Sample Product Title', 'easy-digital-downloads' ) . '
      '; - $download_list .= '
      '; - $download_list .= '' . __( 'Sample Download File Name', 'easy-digital-downloads' ) . ' - ' . __( 'Optional notes about this download.', 'easy-digital-downloads' ) . ''; - $download_list .= '
      '; - $download_list .= '
    • '; - $download_list .= '
    '; - - $file_urls = esc_html( trailingslashit( get_site_url() ) . 'test.zip?test=key&key=123' ); - - $price = edd_currency_filter( edd_format_amount( 10.50 ) ); - - $gateway = edd_get_gateway_admin_label( edd_get_default_gateway() ); - - $receipt_id = strtolower( md5( uniqid() ) ); - - $notes = __( 'These are some sample notes added to a product.', 'easy-digital-downloads' ); - - $tax = edd_currency_filter( edd_format_amount( 1.00 ) ); - - $sub_total = edd_currency_filter( edd_format_amount( 9.50 ) ); - - $payment_id = rand(1, 100); - - $user = wp_get_current_user(); - - $message = str_replace( '{download_list}', $download_list, $message ); - $message = str_replace( '{file_urls}', $file_urls, $message ); - $message = str_replace( '{name}', $user->display_name, $message ); - $message = str_replace( '{fullname}', $user->display_name, $message ); - $message = str_replace( '{username}', $user->user_login, $message ); - $message = str_replace( '{date}', edd_date_i18n( current_time( 'timestamp' ) ), $message ); - $message = str_replace( '{subtotal}', $sub_total, $message ); - $message = str_replace( '{tax}', $tax, $message ); - $message = str_replace( '{price}', $price, $message ); - $message = str_replace( '{receipt_id}', $receipt_id, $message ); - $message = str_replace( '{payment_method}', $gateway, $message ); - $message = str_replace( '{sitename}', get_bloginfo( 'name' ), $message ); - $message = str_replace( '{product_notes}', $notes, $message ); - $message = str_replace( '{payment_id}', $payment_id, $message ); - $message = str_replace( '{receipt_link}', edd_email_tag_receipt_link( $payment_id ), $message ); - $message = str_replace( '{receipt}', edd_email_tag_receipt( $payment_id ), $message ); - - $message = apply_filters( 'edd_email_preview_template_tags', $message ); - - return apply_filters( 'edd_email_template_wpautop', true ) ? wpautop( $message ) : $message; -} - -/** - * Email Template Preview - * - * @access private - * @since 1.0.8.2 - */ -function edd_email_template_preview() { - if( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - ob_start(); - ?> - - - emails->heading = edd_email_preview_template_tags( edd_get_option( 'purchase_heading', __( 'Purchase Receipt', 'easy-digital-downloads' ) ) ); - - echo EDD()->emails->build_email( edd_email_preview_template_tags( edd_get_email_body_content( 0, array() ) ) ); - - exit; - -} -add_action( 'template_redirect', 'edd_display_email_template_preview' ); - -/** - * Email Template Body - * - * @since 1.0.8.2 - * @param int $payment_id Payment ID - * @param array $payment_data Payment Data - * @return string $email_body Body of the email - */ -function edd_get_email_body_content( $payment_id = 0, $payment_data = array() ) { - $default_email_body = __( "Dear", "easy-digital-downloads" ) . " {name},\n\n"; - $default_email_body .= __( "Thank you for your purchase. Please click on the link(s) below to download your files.", "easy-digital-downloads" ) . "\n\n"; - $default_email_body .= "{download_list}\n\n"; - $default_email_body .= "{sitename}"; - - $email = edd_get_option( 'purchase_receipt', false ); - $email = $email ? stripslashes( $email ) : $default_email_body; - - $email_body = apply_filters( 'edd_email_template_wpautop', true ) ? wpautop( $email ) : $email; - - $email_body = apply_filters( 'edd_purchase_receipt_' . EDD()->emails->get_template(), $email_body, $payment_id, $payment_data ); - - return apply_filters( 'edd_purchase_receipt', $email_body, $payment_id, $payment_data ); -} - -/** - * Sale Notification Template Body - * - * @since 1.7 - * @author Daniel J Griffiths - * @param int $payment_id Payment ID - * @param array $payment_data Payment Data - * @return string $email_body Body of the email - */ -function edd_get_sale_notification_body_content( $payment_id = 0, $payment_data = array() ) { - $payment = edd_get_payment( $payment_id ); - $order = edd_get_order( $payment_id ); - - $name = $payment->email; - if ( $payment->user_id > 0 ) { - $user_data = get_userdata( $payment->user_id ); - if ( ! empty( $user_data->display_name ) ) { - $name = $user_data->display_name; - } - } elseif ( ! empty( $payment->first_name ) && ! empty( $payment->last_name ) ) { - $name = $payment->first_name . ' ' . $payment->last_name; - } - - $download_list = ''; - - $order_items = $order->get_items(); - if( ! empty( $order_items ) ) { - foreach( $order_items as $item ) { - $download_list .= html_entity_decode( $item->product_name, ENT_COMPAT, 'UTF-8' ) . "\n"; - } - } - - $gateway = edd_get_gateway_checkout_label( $payment->gateway ); - - $default_email_body = __( 'Hello', 'easy-digital-downloads' ) . "\n\n" . sprintf( __( 'A %s purchase has been made', 'easy-digital-downloads' ), edd_get_label_plural() ) . ".\n\n"; - $default_email_body .= sprintf( __( '%s sold:', 'easy-digital-downloads' ), edd_get_label_plural() ) . "\n\n"; - $default_email_body .= $download_list . "\n\n"; - $default_email_body .= __( 'Purchased by: ', 'easy-digital-downloads' ) . " " . html_entity_decode( $name, ENT_COMPAT, 'UTF-8' ) . "\n"; - $default_email_body .= __( 'Amount: ', 'easy-digital-downloads' ) . " " . html_entity_decode( edd_currency_filter( edd_format_amount( $payment->total ) ), ENT_COMPAT, 'UTF-8' ) . "\n"; - $default_email_body .= __( 'Payment Method: ', 'easy-digital-downloads' ) . " " . $gateway . "\n\n"; - $default_email_body .= __( 'Thank you', 'easy-digital-downloads' ); - - $message = edd_get_option( 'sale_notification', false ); - $message = $message ? stripslashes( $message ) : $default_email_body; - - //$email_body = edd_email_template_tags( $email, $payment_data, $payment_id, true ); - $email_body = edd_do_email_tags( $message, $payment_id ); - - $email_body = apply_filters( 'edd_email_template_wpautop', true ) ? wpautop( $email_body ) : $email_body; - - return apply_filters( 'edd_sale_notification', $email_body, $payment_id, $payment_data ); -} - -/** - * Render Receipt in the Browser - * - * A link is added to the Purchase Receipt to view the email in the browser and - * this function renders the Purchase Receipt in the browser. It overrides the - * Purchase Receipt template and provides its only styling. - * - * @since 1.5 - * @author Sunny Ratilal - * @param array $data The request data. - */ -function edd_render_receipt_in_browser( $data ) { - if ( ! isset( $data['payment_key'] ) ) { - wp_die( __( 'Missing purchase key.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ) ); - } - - if ( ! empty( $_POST['edd_action'] ) && ! empty( $_POST['edd_user_login'] ) && ! empty( $_POST['edd_login_nonce'] ) ) { - return; - } - - $key = urlencode( $data['payment_key'] ); - - ob_start(); - - // Disallows caching of the page - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); // HTTP/1.0 - header("Expires: Sat, 23 Oct 1977 05:00:00 PST"); // Date in the past -?> - - - - <?php esc_html_e( 'Receipt', 'easy-digital-downloads' ); ?> - - - - - - -
    - - - -
    - - - -session->get( 'edd_success_errors' ); - if ( $errors || $successes ) { - - echo edd_build_errors_html( $errors ); - echo edd_build_successes_html( $successes ); - - edd_clear_errors(); - } -} -add_action( 'edd_purchase_form_before_submit', 'edd_print_errors' ); -add_action( 'edd_ajax_checkout_errors', 'edd_print_errors' ); -add_action( 'edd_print_errors', 'edd_print_errors' ); - -/** - * Formats error messages and returns an HTML string. - * - * @param array $errors - * - * @since 2.11 - * @return string - */ -function edd_build_errors_html( $errors ) { - $error_html = ''; - - $classes = apply_filters( 'edd_error_class', array( - 'edd_errors', 'edd-alert', 'edd-alert-error' - ) ); - - if ( ! empty( $errors ) && is_array( $errors ) ) { - $error_html .= '
    '; - // Loop error codes and display errors - foreach ( $errors as $error_id => $error ) { - $error_html .= '

    ' . __( 'Error', 'easy-digital-downloads' ) . ': ' . $error . '

    '; - - } - $error_html .= '
    '; - } - - return $error_html; -} - -/** - * Builds the HTML output for the sucess messages. - * - * @since 3.1 - * @param array $successes - * @return string - */ -function edd_build_successes_html( $successes ) { - if ( empty( $successes ) || ! is_array( $successes ) ) { - return ''; - } - - $html = '
    '; - foreach ( $successes as $id => $message ) { - $html .= '

    '; - $html .= '' . esc_html__( 'Success', 'easy-digital-downloads' ) . ': '; - $html .= $message; - $html .= '

    '; - } - $html .= '
    '; - - return $html; -} - -/** - * Get Errors - * - * Retrieves all error messages stored during the checkout process. - * If errors exist, they are returned. - * - * @since 1.0 - * @uses EDD_Session::get() - * @return mixed array if errors are present, false if none found - */ -function edd_get_errors() { - $errors = EDD()->session->get( 'edd_errors' ); - $errors = apply_filters( 'edd_errors', $errors ); - return $errors; -} - -/** - * Set Error - * - * Stores an error in a session var. - * - * @since 1.0 - * @uses EDD_Session::get() - * @param int $error_id ID of the error being set - * @param string $error_message Message to store with the error - * @return void - */ -function edd_set_error( $error_id, $error_message ) { - $errors = edd_get_errors(); - if ( ! $errors ) { - $errors = array(); - } - $errors[ $error_id ] = $error_message; - EDD()->session->set( 'edd_errors', $errors ); -} - -/** - * Stores an array of success messages in a session variable. - * - * @since 3.1 - * @uses EDD_Session::set() - * @param string $error_id - * @param string $error_message - * @return void - */ -function edd_set_success( $error_id, $error_message ) { - $successes = EDD()->session->get( 'edd_success_errors' ); - if ( ! $successes ) { - $successes = array(); - } - $successes[ $error_id ] = $error_message; - - EDD()->session->set( 'edd_success_errors', $successes ); -} - -/** - * Clears all stored errors. - * - * @since 1.0 - * @uses EDD_Session::set() - * @return void - */ -function edd_clear_errors() { - EDD()->session->set( 'edd_errors', null ); - EDD()->session->set( 'edd_success_errors', null ); -} - -/** - * Removes (unsets) a stored error - * - * @since 1.3.4 - * @uses EDD_Session::set() - * @param int $error_id ID of the error being set - * @return string - */ -function edd_unset_error( $error_id ) { - $errors = edd_get_errors(); - - if ( $errors && isset( $errors[ $error_id ] ) ) { - unset( $errors[ $error_id ] ); - EDD()->session->set( 'edd_errors', $errors ); - } -} - -/** - * Register die handler for edd_die() - * - * @author Sunny Ratilal - * @since 1.6 - * - * @return void - */ -function _edd_die_handler() { - die(); -} - -/** - * Wrapper function for wp_die(). - * - * This function adds filters for wp_die() which kills execution of the script - * using wp_die(). This allows us to then to work with functions using edd_die() - * in the unit tests. - * - * @author Sunny Ratilal - * @since 1.6 - * @return void - */ -function edd_die( $message = '', $title = '', $status = 400 ) { - if ( ! defined( 'EDD_UNIT_TESTS' ) ) { - add_filter( 'wp_die_ajax_handler', '_edd_die_handler', 10, 3 ); - add_filter( 'wp_die_handler' , '_edd_die_handler', 10, 3 ); - add_filter( 'wp_die_json_handler', '_edd_die_handler', 10, 3 ); - } - - wp_die( $message, $title, array( 'response' => $status ) ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/extensions/licensing-functions.php b/wp-content/plugins/easy-digital-downloads/includes/extensions/licensing-functions.php deleted file mode 100644 index db7eb54f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/extensions/licensing-functions.php +++ /dev/null @@ -1,114 +0,0 @@ - strtotime( '+1 day' ), - 'products' => get_licensed_products(), - ) ), false ); - } -}, 200 ); - -/** - * Returns licensed EDD extensions that are active on this site. - * Array values are the `$item_shortname` from `\EDD_License` - * - * @see \EDD_License::$item_shortname - * - * @since 2.11.4 - * @return array - */ -function get_licensed_extension_slugs() { - $products = get_option( 'edd_licensed_extensions' ); - - /* - * If this isn't set for some reason, fall back to trying the global. There are - * probably a very limited number of cases where the option would be empty when - * the global is not, but worth a shot. - */ - if ( empty( $products ) ) { - return get_licensed_products(); - } - - $products = json_decode( $products, true ); - - return isset( $products['products'] ) && is_array( $products['products'] ) - ? $products['products'] - : array(); -} - -/** - * Triggers our hook for registering extensions. - * This needs to run after all plugins have definitely been loaded. - * - * @since 2.11.4 - */ -add_action( 'plugins_loaded', function() { - /** - * Extensions should hook in here to register themselves. - * - * @since 2.11.4 - * - * @param ExtensionRegistry - */ - do_action( 'edd_extension_license_init', EDD()->extensionRegistry ); -}, PHP_INT_MAX ); - -/** - * Helper function to get the actually licensed products from the global. - * In 3.1.1.2, all products using the licensing class add their slug to the global, - * but we are now tracking unlicensed products as well as licensed ones. - * - * @return void - */ -function get_licensed_products() { - $products = array(); - global $edd_licensed_products; - if ( empty( $edd_licensed_products ) || ! is_array( $edd_licensed_products ) ) { - return $products; - } - foreach ( $edd_licensed_products as $slug => $is_licensed ) { - if ( $is_licensed ) { - $products[] = $slug; - } - } - - return $products; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/formatting.php b/wp-content/plugins/easy-digital-downloads/includes/formatting.php deleted file mode 100644 index ed7cfe40..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/formatting.php +++ /dev/null @@ -1,349 +0,0 @@ -format_for_typed( $decimals )->typed_amount; - break; - case 'display': - default: - $return_value = $formatter->format_for_display( $decimals )->amount; - break; - } - - return $return_value; -} - -/** - * Formats the currency display - * - * @since 1.0 - * - * @param string $price Price. This should already be formatted. - * @param string $currency Currency code. When this function is used on an order's amount, the order's currency - * should always be provided here. If omitted, the store currency is used instead. - * But to ensure immutability with orders, the currency should always be explicitly provided - * if known and tied to an existing order. - * - * @return string $currency Currencies displayed correctly - */ -function edd_currency_filter( $price = '', $currency = '' ) { - - // Fallback to default currency - if ( empty( $currency ) ) { - $currency = edd_get_currency(); - } - - $currency = new \EDD\Currency\Currency( $currency ); - if ( '' === $price ) { - return $currency->symbol; - } - - $formatter = new \EDD\Currency\Money_Formatter( $price, $currency ); - - return $formatter->apply_symbol(); -} - -/** - * Set the number of decimal places per currency - * - * @since 1.4.2 - * @since 3.0 Updated to allow currency to be passed in. - * - * @param int $decimals Number of decimal places. - * @param string $currency Currency. - * - * @return int $decimals Number of decimal places for currency. -*/ -function edd_currency_decimal_filter( $decimals = 2, $currency = '' ) { - $currency = empty( $currency ) - ? edd_get_currency() - : $currency; - - switch ( $currency ) { - case 'RIAL' : - case 'JPY' : - case 'TWD' : - case 'HUF' : - $decimals = 0; - break; - } - - return apply_filters( 'edd_currency_decimal_count', $decimals, $currency ); -} -add_filter( 'edd_sanitize_amount_decimals', 'edd_currency_decimal_filter' ); -add_filter( 'edd_format_amount_decimals', 'edd_currency_decimal_filter', 10, 2 ); - -/** - * Sanitizes a string key for EDD Settings - * - * Keys are used as internal identifiers. Alphanumeric characters, dashes, - * underscores, stops, colons and slashes are allowed. - * - * This differs from `sanitize_key()` in that it allows uppercase letters, - * stops, colons, and slashes. - * - * @since 2.5.8 - * @param string $key String key - * @return string Sanitized key - */ -function edd_sanitize_key( $key = '' ) { - $raw_key = $key; - $key = preg_replace( '/[^a-zA-Z0-9_\-\.\:\/]/', '', $key ); - - /** - * Filter a sanitized key string. - * - * @since 2.5.8 - * @param string $key Sanitized key. - * @param string $raw_key The key prior to sanitization. - */ - return apply_filters( 'edd_sanitize_key', $key, $raw_key ); -} - -/** - * Never let a numeric value be less than zero. - * - * Adapted from bbPress. - * - * @since 3.0 - * - * @param int $number Default 0. - * @return int. - */ -function edd_number_not_negative( $number = 0 ) { - - // Protect against formatted strings - if ( is_string( $number ) ) { - $number = strip_tags( $number ); // No HTML - $number = preg_replace( '/[^0-9-]/', '', $number ); // No number-format - // Protect against objects, arrays, scalars, etc... - } elseif ( ! is_numeric( $number ) ) { - $number = 0; - } - - // Make the number an integer - $casted_number = is_float( $number ) - ? floatval( $number ) - : intval( $number ); - - $max_value = is_float( $number ) - ? 0.00 - : 0; - - // Pick the maximum value, never less than zero - $not_less_than_zero = max( $max_value, $casted_number ); - - // Filter & return - return (int) apply_filters( 'edd_number_not_negative', $not_less_than_zero, $casted_number, $number ); -} - -/** - * Return array of allowed HTML tags. - * - * Used with wp_kses() to filter unsafe HTML out of settings and notes. - * - * @since 3.0 - * - * @return array - */ -function edd_get_allowed_tags() { - return (array) apply_filters( 'edd_allowed_html_tags', array( - 'p' => array( - 'class' => array(), - 'id' => array(), - ), - 'span' => array( - 'class' => array(), - 'id' => array(), - ), - 'a' => array( - 'href' => array(), - 'target' => array(), - 'title' => array(), - 'class' => array(), - 'id' => array(), - ), - 'code' => array(), - 'strong' => array(), - 'em' => array(), - 'br' => array(), - 'img' => array( - 'src' => array(), - 'title' => array(), - 'alt' => array(), - 'id' => array(), - ), - 'div' => array( - 'class' => array(), - 'id' => array(), - ), - 'ul' => array( - 'class' => array(), - 'id' => array(), - ), - 'li' => array( - 'class' => array(), - 'id' => array(), - ), - ) ); -} - -/** - * Return a translatable and display ready string for an address type. - * - * @since 3.0 - * @param string $address_type The type of address to get the display label for. - * - * @return string The translatable string for the display type, in lowercase. - */ -function edd_get_address_type_label( $address_type = 'billing' ) { - - // Core default address types and their labels. - $address_type_labels = array( - 'billing' => __( 'Billing', 'easy-digital-downloads' ), - ); - - /** - * Physical address type labels. - * - * A key/value array of billing types found in the 'type' column of the customer address table, and their translatable - * strings for output. - * - * @since 3.0 - * @param array $address_type_labels - * Array of the address type labels, in key/value form. The key should match the database entry for the - * wp_edd_customer_addresses table in the 'type' column. The value of each array entry should be a translatable - * string for output in the UI. - */ - $address_type_labels = apply_filters( 'edd_address_type_labels', $address_type_labels ); - - // Fallback to just applying an upper case to any words not in the filter. - return array_key_exists( $address_type, $address_type_labels ) ? - $address_type_labels[ $address_type ] : - $address_type; - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/actions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/actions.php deleted file mode 100644 index 20663cf1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/actions.php +++ /dev/null @@ -1,80 +0,0 @@ - 0 ) { - remove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields' ); - remove_action( 'edd_cc_form', 'edd_get_cc_form' ); - if ( current_user_can( 'manage_shop_settings' ) ) { - $error_message = __( 'You must enable a payment gateway to use Easy Digital Downloads', 'easy-digital-downloads' ); - } else { - $error_message = __( 'Your order cannot be completed at this time. Please try again or contact site support.', 'easy-digital-downloads' ); - } - edd_set_error( 'no_gateways', $error_message ); - } else { - edd_unset_error( 'no_gateways' ); - } -} -add_action( 'init', 'edd_no_gateway_error' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/amazon-payments.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/amazon-payments.php deleted file mode 100644 index cd9270bf..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/amazon-payments.php +++ /dev/null @@ -1,1174 +0,0 @@ -reference_id = ! empty( $_REQUEST['amazon_reference_id'] ) - ? sanitize_text_field( $_REQUEST['amazon_reference_id'] ) - : ''; - - // Run this separate so we can ditch as early as possible - $this->register(); - - if ( ! edd_is_gateway_active( $this->gateway_id ) ) { - return; - } - - $this->config(); - $this->includes(); - $this->setup_client(); - $this->filters(); - $this->actions(); - } - - /** - * Retrieve current instance - * - * @access private - * @since 2.4 - * @return EDD_Amazon_Payments instance - */ - public static function getInstance() { - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof EDD_Amazon_Payments ) ) { - self::$instance = new EDD_Amazon_Payments; - } - - return self::$instance; - } - - /** - * Register the payment gateway - * - * @access private - * @since 2.4 - * @return void - */ - private function register() { - add_filter( 'edd_payment_gateways', array( $this, 'register_gateway' ), 1, 1 ); - } - - /** - * Setup constant configuration for file paths - * - * @access private - * @since 2.4 - * @return void - */ - private function config() { - if ( ! defined( 'EDD_AMAZON_CLASS_DIR' ) ) { - $path = trailingslashit( plugin_dir_path( EDD_PLUGIN_FILE ) ) . 'includes/gateways/libs/amazon'; - define( 'EDD_AMAZON_CLASS_DIR', trailingslashit( $path ) ); - } - } - - /** - * Method to check if all the required settings have been filled out, allowing us to not output information without it. - * - * @since 2.7 - * @return bool - */ - public function is_setup() { - if ( null !== $this->is_setup ) { - return $this->is_setup; - } - - $required_items = array( 'merchant_id', 'client_id', 'access_key', 'secret_key' ); - - $current_values = array( - 'merchant_id' => edd_get_option( 'amazon_seller_id', '' ), - 'client_id' => edd_get_option( 'amazon_client_id', '' ), - 'access_key' => edd_get_option( 'amazon_mws_access_key', '' ), - 'secret_key' => edd_get_option( 'amazon_mws_secret_key', '' ), - ); - - $this->is_setup = true; - - foreach ( $required_items as $key ) { - if ( empty( $current_values[ $key ] ) ) { - $this->is_setup = false; - break; - } - } - - return $this->is_setup; - } - - /** - * Load additional files - * - * @access private - * @since 2.4 - * @return void - */ - private function includes() { - require_once EDD_AMAZON_CLASS_DIR . 'Client.php'; // Requires the other files itself - require_once EDD_AMAZON_CLASS_DIR . 'IpnHandler.php'; - } - - /** - * Add filters - * - * @since 2.4 - * @return void - */ - private function filters() { - - add_filter( 'edd_accepted_payment_icons', array( $this, 'register_payment_icon' ), 10, 1 ); - add_filter( 'edd_show_gateways', array( $this, 'maybe_hide_gateway_select' ) ); - - // Since the Amazon Gateway loads scripts on page, it needs the scripts to load in the header. - add_filter( 'edd_load_scripts_in_footer', '__return_false' ); - - if ( is_admin() ) { - add_filter( 'edd_settings_sections_gateways', array( $this, 'register_gateway_section' ), 1, 1 ); - add_filter( 'edd_settings_gateways', array( $this, 'register_gateway_settings' ), 1, 1 ); - add_filter( 'edd_payment_details_transaction_id-' . $this->gateway_id, array( $this, 'link_transaction_id' ), 10, 2 ); - } - } - - /** - * Add actions - * - * @access private - * @since 2.4 - * @return void - */ - private function actions() { - add_action( 'wp_enqueue_scripts', array( $this, 'print_client' ), 10 ); - add_action( 'wp_enqueue_scripts', array( $this, 'load_scripts' ), 11 ); - add_action( 'edd_pre_process_purchase', array( $this, 'check_config' ), 1 ); - add_action( 'init', array( $this, 'capture_oauth' ), 9 ); - add_action( 'init', array( $this, 'signin_redirect' ) ); - add_action( 'edd_purchase_form_before_register_login', array( $this, 'login_form' ) ); - add_action( 'edd_checkout_error_check', array( $this, 'checkout_errors' ), 10, 2 ); - add_action( 'edd_gateway_amazon', array( $this, 'process_purchase' ) ); - add_action( 'wp_ajax_edd_amazon_get_address', array( $this, 'ajax_get_address' ) ); - add_action( 'wp_ajax_nopriv_edd_amazon_get_address', array( $this, 'ajax_get_address' ) ); - add_action( 'edd_pre_process_purchase', array( $this, 'disable_address_requirement' ), 99999 ); - add_action( 'init', array( $this, 'process_ipn' ) ); - - if ( empty( $this->reference_id ) ) { - return; - } - - add_action( 'edd_amazon_cc_form', array( $this, 'wallet_form' ) ); - } - - /** - * Show an error message on checkout if Amazon is enabled but not setup. - * - * @since 2.7 - */ - public function check_config() { - $is_enabled = edd_is_gateway_active( $this->gateway_id ); - if ( ( ! $is_enabled || false === $this->is_setup() ) && 'amazon' == edd_get_chosen_gateway() ) { - edd_set_error( 'amazon_gateway_not_configured', __( 'There is an error with the Amazon Payments configuration.', 'easy-digital-downloads' ) ); - } - } - - /** - * Retrieve the client object - * - * @access private - * @since 2.4 - * @return PayWithAmazon\Client - */ - private function get_client() { - - if ( ! $this->is_setup() ) { - return false; - } - - if ( ! is_null( $this->client ) ) { - return $this->client; - } - - $this->setup_client(); - - return $this->client; - } - - /** - * Setup the client object - * - * @access private - * @since 2.4 - * @return void - */ - private function setup_client() { - - if ( ! $this->is_setup() ) { - return; - } - - $region = edd_get_shop_country(); - - if ( 'GB' === $region ) { - $region = 'UK'; - } - - $config = array( - 'merchant_id' => edd_get_option( 'amazon_seller_id', '' ), - 'client_id' => edd_get_option( 'amazon_client_id', '' ), - 'access_key' => edd_get_option( 'amazon_mws_access_key', '' ), - 'secret_key' => edd_get_option( 'amazon_mws_secret_key', '' ), - 'region' => $region, - 'sandbox' => edd_is_test_mode(), - ); - - $config = apply_filters( 'edd_amazon_client_config', $config ); - - $this->client = new Client( $config ); - } - - /** - * Register the gateway - * - * @since 2.4 - * @param $gateways array - * @return array - */ - public function register_gateway( $gateways ) { - - $default_amazon_info = array( - $this->gateway_id => array( - 'admin_label' => __( 'Amazon', 'easy-digital-downloads' ), - 'checkout_label' => __( 'Amazon', 'easy-digital-downloads' ), - 'supports' => array(), - 'icons' => array( 'amazon' ), - ), - ); - - $default_amazon_info = apply_filters( 'edd_register_amazon_gateway', $default_amazon_info ); - $gateways = array_merge( $gateways, $default_amazon_info ); - - return $gateways; - } - - /** - * Register the payment icon - * - * @since 2.4 - * @param array $payment_icons Array of payment icons - * @return array The array of icons with Amazon Added - */ - public function register_payment_icon( $payment_icons ) { - $payment_icons['amazon'] = 'Amazon'; - - return $payment_icons; - } - - /** - * Hides payment gateway select options after return from Amazon - * - * @since 2.7.6 - * @param bool $show Should gateway select be shown - * @return bool - */ - public function maybe_hide_gateway_select( $show ) { - - if ( ! empty( $_REQUEST['payment-mode'] ) && 'amazon' == $_REQUEST['payment-mode'] && ! empty( $_REQUEST['amazon_reference_id'] ) && ! empty( $_REQUEST['state'] ) && 'authorized' == $_REQUEST['state'] ) { - $show = false; - } - - return $show; - } - - /** - * Register the payment gateways setting section - * - * @since 2.5 - * @param array $gateway_sections Array of sections for the gateways tab - * @return array Added Amazon Payments into sub-sections - */ - public function register_gateway_section( $gateway_sections ) { - $gateway_sections['amazon'] = __( 'Amazon Payments', 'easy-digital-downloads' ); - - return $gateway_sections; - } - - /** - * Register the gateway settings - * - * @since 2.4 - * @param $gateway_settings array - * @return array - */ - public function register_gateway_settings( $gateway_settings ) { - $default_amazon_settings = array( - 'amazon_register' => array( - 'id' => 'amazon_register', - 'name' => __( 'Register with Amazon', 'easy-digital-downloads' ), - 'desc' => '

    ' . - __( 'Connect Easy Digital Downloads to Amazon', 'easy-digital-downloads' ) . - '

    ' . - '

    ' . - __( 'Once registration is complete, enter your API credentials below.', 'easy-digital-downloads' ) . - '

    ', - 'type' => 'descriptive_text', - ), - 'amazon_seller_id' => array( - 'id' => 'amazon_seller_id', - 'name' => __( 'Seller ID', 'easy-digital-downloads' ), - 'desc' => __( 'Found in the Integration settings. Also called a Merchant ID', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - ), - 'amazon_mws_access_key' => array( - 'id' => 'amazon_mws_access_key', - 'name' => __( 'MWS Access Key', 'easy-digital-downloads' ), - 'desc' => __( 'Found on Seller Central in the MWS Keys section', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - ), - 'amazon_mws_secret_key' => array( - 'id' => 'amazon_mws_secret_key', - 'name' => __( 'MWS Secret Key', 'easy-digital-downloads' ), - 'desc' => __( 'Found on Seller Central in the MWS Keys section', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - ), - 'amazon_client_id' => array( - 'id' => 'amazon_client_id', - 'name' => __( 'Client ID', 'easy-digital-downloads' ), - 'desc' => __( 'The Amazon Client ID. Should look like `amzn1.application-oa2...`', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - ), - 'amazon_mws_callback_url' => array( - 'id' => 'amazon_callback_url', - 'name' => __( 'Amazon MWS Callback URL', 'easy-digital-downloads' ), - 'desc' => __( 'The Return URL to provide in your MWS Application. Enter this under your Login and Pay → Web Settings', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'large', - 'std' => $this->get_amazon_authenticate_redirect(), - 'faux' => true, - ), - 'amazon_mws_ipn_url' => array( - 'id' => 'amazon_ipn_url', - 'name' => __( 'Amazon Merchant IPN URL', 'easy-digital-downloads' ), - 'desc' => sprintf( __( 'The IPN URL to provide in your MWS account. Enter this under your Integration Settings', 'easy-digital-downloads' ), 'https://sellercentral.amazon.com/gp/pyop/seller/account/settings/user-settings-edit.html' ), - 'type' => 'text', - 'size' => 'large', - 'std' => $this->get_amazon_ipn_url(), - 'faux' => true, - ), - ); - - $default_amazon_settings = apply_filters( 'edd_default_amazon_settings', $default_amazon_settings ); - $gateway_settings['amazon'] = $default_amazon_settings; - - return $gateway_settings; - } - - /** - * Load javascript files and localized variables - * - * @since 2.4 - * @return void - */ - public function load_scripts() { - - if ( ! $this->is_setup() ) { - return; - } - - if ( ! edd_is_checkout() ) { - return; - } - - $test_mode = edd_is_test_mode(); - $seller_id = edd_get_option( 'amazon_seller_id', '' ); - $client_id = edd_get_option( 'amazon_client_id', '' ); - - $default_amazon_scope = array( - 'profile', - 'postal_code', - 'payments:widget', - ); - - if ( edd_use_taxes() ) { - $default_amazon_scope[] = 'payments:shipping_address'; - } - - $default_amazon_button_settings = array( - 'type' => 'PwA', - 'color' => 'Gold', - 'size' => 'medium', - 'scope' => implode( ' ', $default_amazon_scope ), - 'popup' => true, - ); - - $amazon_button_settings = apply_filters( 'edd_amazon_button_settings', $default_amazon_button_settings ); - $base_url = ''; - $sandbox = $test_mode ? 'sandbox/' : ''; - - switch ( edd_get_shop_country() ) { - case 'GB': - $base_url = 'https://static-eu.payments-amazon.com/OffAmazonPayments/uk/' . $sandbox . 'lpa/'; - break; - case 'DE': - $base_url = 'https://static-eu.payments-amazon.com/OffAmazonPayments/de/' . $sandbox. 'lpa/'; - break; - default: - $base_url = 'https://static-na.payments-amazon.com/OffAmazonPayments/us/' . $sandbox; - break; - } - - if ( ! empty( $base_url ) ) { - $url = $base_url . 'js/Widgets.js?sellerId=' . $seller_id; - - wp_enqueue_script( 'edd-amazon-widgets', $url, array( 'jquery' ), null, false ); - wp_localize_script( 'edd-amazon-widgets', 'edd_amazon', apply_filters( 'edd_amazon_checkout_vars', array( - 'sellerId' => $seller_id, - 'clientId' => $client_id, - 'referenceID' => $this->reference_id, - 'buttonType' => $amazon_button_settings['type'], - 'buttonColor' => $amazon_button_settings['color'], - 'buttonSize' => $amazon_button_settings['size'], - 'scope' => $amazon_button_settings['scope'], - 'popup' => $amazon_button_settings['popup'], - 'checkoutUri' => $this->get_amazon_checkout_uri(), - 'redirectUri' => $this->get_amazon_authenticate_redirect(), - 'signinUri' => $this->get_amazon_signin_redirect(), - ) ) ); - } - } - - /** - * Print client ID in header - * - * @since 2.4 - * @return void - */ - public function print_client() { - - if ( ! $this->is_setup() ) { - return false; - } - - if ( ! edd_is_checkout() ) { - return; - } - ?> - - client->getUserInfo( $_GET['access_token'] ); - - EDD()->session->set( 'amazon_access_token', $_GET['access_token'] ); - EDD()->session->set( 'amazon_profile', $profile ); - } catch( Exception $e ) { - wp_die( print_r( $e, true ) ); - } - } - - /** - * Set customer details after authentication - * - * @since 2.4 - * @return void - */ - public function signin_redirect() { - - if ( ! isset( $_GET['edd-listener'] ) || $_GET['edd-listener'] !== 'amazon' ) { - return; - } - - if ( ! isset( $_GET['state'] ) || $_GET['state'] !== 'signed-in' ) { - return; - } - - $profile = EDD()->session->get( 'amazon_profile' ); - $reference = $_GET['amazon_reference_id']; - - if ( ! is_user_logged_in() ) { - $user = get_user_by( 'email', $profile['email'] ); - - if ( $user ) { - edd_log_user_in( $user->ID, $user->user_login, '' ); - - $customer = array( - 'first_name' => $user->first_name, - 'last_name' => $user->last_name, - 'email' => $user->user_email - ); - - } else { - $names = explode( ' ', $profile['name'], 2 ); - - $customer = array( - 'first_name' => $names[0], - 'last_name' => isset( $names[1] ) ? $names[1] : '', - 'email' => $profile['email'] - ); - - // Create a customer account if registration is not disabled - if ( 'none' !== edd_get_option( 'show_register_form' ) ) { - $args = array( - 'user_email' => $profile['email'], - 'user_login' => $profile['email'], - 'display_name' => $profile['name'], - 'first_name' => $customer['first_name'], - 'last_name' => $customer['last_name'], - 'user_pass' => wp_generate_password( 20 ), - ); - - $user_id = wp_insert_user( $args ); - - edd_log_user_in( $user_id, $args['user_login'], $args['user_pass'] ); - } - } - - EDD()->session->set( 'customer', $customer ); - } - - edd_redirect( edd_get_checkout_uri( array( 'payment-mode' => 'amazon', 'state' => 'authorized', 'amazon_reference_id' => urlencode( $reference ) ) ) ); - } - - /** - * Display the log in button - * - * @since 2.4 - * @return void - */ - public function login_form() { - - if ( ! $this->is_setup() ) { - return false; - } - - if ( empty( $this->reference_id ) && 'amazon' == edd_get_chosen_gateway() ) : - - remove_all_actions( 'edd_purchase_form_after_cc_form' ); - remove_all_actions( 'edd_purchase_form_after_user_info' ); - remove_all_actions( 'edd_purchase_form_register_fields' ); - remove_all_actions( 'edd_purchase_form_login_fields' ); - remove_all_actions( 'edd_register_fields_before' ); - remove_all_actions( 'edd_cc_form' ); - remove_all_actions( 'edd_checkout_form_top' ); - - ob_start(); ?> -
    - -
    - - -
    - - is_setup() ) { - return false; - } - - $profile = EDD()->session->get( 'amazon_profile' ); - remove_action( 'edd_purchase_form_after_cc_form', 'edd_checkout_tax_fields', 999 ); - ob_start(); ?> - -
    -

    - : - () -

    - -
    - -
    - - -
    - - - - - - - -
    -
    - - is_setup() ) { - return false; - } - - if ( empty( $_POST['reference_id'] ) ) { - die( '-2' ); - } - - $request = $this->client->getOrderReferenceDetails( array( - 'merchant_id' => edd_get_option( 'amazon_seller_id', '' ), - 'amazon_order_reference_id' => $_POST['reference_id'], - 'address_consent_token' => EDD()->session->get( 'amazon_access_token' ) - ) ); - - $address = array(); - $data = new ResponseParser( $request->response ); - $data = $data->toArray(); - - if ( isset( $data['GetOrderReferenceDetailsResult']['OrderReferenceDetails']['Destination']['PhysicalDestination'] ) ) { - - $address = $data['GetOrderReferenceDetailsResult']['OrderReferenceDetails']['Destination']['PhysicalDestination']; - $address = wp_parse_args( $address, array( 'City', 'CountryCode', 'StateOrRegion', 'PostalCode', 'AddressLine1', 'AddressLine2' ) ); - - } - - echo json_encode( $address ); exit; - } - - /** - * Check for errors during checkout - * - * @since 2.4 - * @param $valid_data Customer / product data from checkout - * @param $post_data $_POST - * @return void - */ - public function checkout_errors( $valid_data, $post_data ) { - - // should validate that we have a reference ID here, perhaps even fire the API call here - if ( empty( $post_data['edd_amazon_reference_id'] ) ) { - edd_set_error( 'missing_reference_id', __( 'Missing Reference ID, please try again.', 'easy-digital-downloads' ) ); - } - } - - /** - * Process the purchase and create the charge in Amazon - * - * @since 2.4 - * @param $purchase_data array Cart details - * @return void - */ - public function process_purchase( $purchase_data ) { - - if ( empty( $purchase_data['post_data']['edd_amazon_reference_id'] ) ) { - edd_set_error( 'missing_reference_id', __( 'Missing Reference ID, please try again.', 'easy-digital-downloads' ) ); - } - - $errors = edd_get_errors(); - if ( ! empty( $errors ) ) { - edd_send_back_to_checkout( '?payment-mode=amazon' ); - } - - $args = apply_filters( 'edd_amazon_charge_args', array( - 'merchant_id' => edd_get_option( 'amazon_seller_id', '' ), - 'amazon_reference_id' => $purchase_data['post_data']['edd_amazon_reference_id'], - 'authorization_reference_id' => $purchase_data['purchase_key'], - 'charge_amount' => $purchase_data['price'], - 'currency_code' => edd_get_currency(), - 'charge_note' => html_entity_decode( edd_get_purchase_summary( $purchase_data, false ) ), - 'charge_order_id' => $purchase_data['purchase_key'], - 'store_name' => remove_accents( wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ), - 'transaction_timeout' => 0 - ), $purchase_data ); - - $args['platform_id'] = 'A3JST9YM1SX7LB'; - - $charge = $this->client->charge( $args ); - - if ( 200 == $charge->response['Status'] ) { - $charge = new ResponseParser( $charge->response ); - $charge = $charge->toArray(); - - $status = $charge['AuthorizeResult']['AuthorizationDetails']['AuthorizationStatus']['State']; - - if ( 'Declined' === $status ) { - - $reason = $charge['AuthorizeResult']['AuthorizationDetails']['AuthorizationStatus']['ReasonCode']; - edd_set_error( 'payment_declined', sprintf( __( 'Your payment could not be authorized, please try a different payment method. Reason: %s', 'easy-digital-downloads' ), $reason ) ); - edd_send_back_to_checkout( '?payment-mode=amazon&amazon_reference_id=' . $purchase_data['post_data']['edd_amazon_reference_id'] ); - } - - // Setup payment data to be recorded - $payment_data = array( - 'price' => $purchase_data['price'], - 'date' => $purchase_data['date'], - 'user_email' => $purchase_data['user_email'], - 'purchase_key' => $purchase_data['purchase_key'], - 'currency' => edd_get_currency(), - 'downloads' => $purchase_data['downloads'], - 'user_info' => $purchase_data['user_info'], - 'cart_details' => $purchase_data['cart_details'], - 'gateway' => $this->gateway_id, - 'status' => 'pending', - ); - - $payment_id = edd_insert_payment( $payment_data ); - - $authorization_id = $charge['AuthorizeResult']['AuthorizationDetails']['AmazonAuthorizationId']; - $capture_id = str_replace( '-A', '-C', $authorization_id ); - $reference_id = sanitize_text_field( $_POST['edd_amazon_reference_id'] ); - - // Confirm the capture was completed - $capture = $this->client->getCaptureDetails( array( - 'merchant_id' => edd_get_option( 'amazon_seller_id', '' ), - 'amazon_capture_id' => $capture_id - ) ); - - $capture = new ResponseParser( $capture->response ); - $capture = $capture->toArray(); - - edd_update_payment_meta( $payment_id, '_edd_amazon_authorization_id', $authorization_id ); - edd_update_payment_meta( $payment_id, '_edd_amazon_capture_id', $capture_id ); - - edd_set_payment_transaction_id( $payment_id, $reference_id, $purchase_data['price'] ); - - edd_update_payment_status( $payment_id, 'complete' ); - - // Empty the shopping cart - edd_empty_cart(); - edd_send_to_success_page(); - - // Set an error - } else { - edd_set_error( 'amazon_error',sprintf( __( 'There was an issue processing your payment. Amazon error: %s', 'easy-digital-downloads' ), print_r( $charge, true ) ) ); - edd_send_back_to_checkout( '?payment-mode=amazon&amazon_reference_id=' . $purchase_data['post_data']['edd_amazon_reference_id'] ); - } - } - - /** - * Retrieve the checkout URL for Amazon after authentication is complete - * - * @since 2.4 - * @return string - */ - private function get_amazon_checkout_uri() { - if ( is_null( $this->checkout_uri ) ) { - $this->checkout_uri = esc_url_raw( add_query_arg( array( 'payment-mode' => 'amazon' ), edd_get_checkout_uri() ) ); - } - - return $this->checkout_uri; - } - - /** - * Retrieve the return URL for Amazon after authentication on Amazon is complete - * - * @since 2.4 - * @return string - */ - private function get_amazon_authenticate_redirect() { - if ( is_null( $this->redirect_uri ) ) { - $this->redirect_uri = esc_url_raw( add_query_arg( array( 'edd-listener' => 'amazon', 'state' => 'return_auth' ), edd_get_checkout_uri() ) ); - } - - return $this->redirect_uri; - } - - /** - * Retrieve the URL to send customers too once sign-in is complete - * - * @since 2.4 - * @return string - */ - private function get_amazon_signin_redirect() { - if ( is_null( $this->signin_redirect ) ) { - $this->signin_redirect = esc_url_raw( add_query_arg( array( 'edd-listener' => 'amazon', 'state' => 'signed-in' ), home_url() ) ); - } - - return $this->signin_redirect; - } - - /** - * Retrieve the IPN URL for Amazon - * - * @since 2.4 - * @return string - */ - private function get_amazon_ipn_url() { - return esc_url_raw( add_query_arg( array( 'edd-listener' => 'amazon' ), home_url( 'index.php' ) ) ); - } - - /** - * Removes the requirement for entering the billing address - * - * Address is pulled directly from Amazon - * - * @since 2.4 - * @return void - */ - public function disable_address_requirement() { - if ( ! empty( $_POST['edd-gateway'] ) && $this->gateway_id == $_REQUEST['edd-gateway'] ) { - add_filter( 'edd_require_billing_address', '__return_false', 9999 ); - } - } - - /** - * Given a transaction ID, generate a link to the Amazon transaction ID details - * - * @since 2.4 - * @param string $transaction_id The Transaction ID - * @param int $payment_id The payment ID for this transaction - * @return string A link to the PayPal transaction details - */ - public function link_transaction_id( $transaction_id, $payment_id ) { - $base_url = 'https://sellercentral.amazon.com/hz/me/pmd/payment-details?orderReferenceId='; - $transaction_url = '' . esc_html( $transaction_id ) . ''; - - return apply_filters( 'edd_' . $this->gateway_id . '_link_payment_details_transaction_id', $transaction_url ); - } - - /** - * Process IPN messages from Amazon - * - * @since 2.4 - * @return void - */ - public function process_ipn() { - - if ( ! isset( $_GET['edd-listener'] ) || $_GET['edd-listener'] !== 'amazon' ) { - return; - } - - if ( isset( $_GET['state'] ) ) { - return; - } - - // Get the IPN headers and Message body - $headers = getallheaders(); - $body = file_get_contents( 'php://input' ); - - $this->doing_ipn = true; - - try { - $ipn = new IpnHandler( $headers, $body ); - $data = $ipn->toArray(); - $seller_id = $data['SellerId']; - - if ( $seller_id != edd_get_option( 'amazon_seller_id', '' ) ) { - wp_die( __( 'Invalid Amazon seller ID', 'easy-digital-downloads' ), __( 'IPN Error', 'easy-digital-downloads' ), array( 'response' => 401 ) ); - } - - switch( $data['NotificationType'] ) { - case 'OrderReferenceNotification' : - break; - - case 'PaymentAuthorize' : - break; - - case 'PaymentCapture' : - $key = $data['CaptureDetails']['CaptureReferenceId']; - $status = $data['CaptureDetails']['CaptureStatus']['State']; - - if ( 'Declined' === $status ) { - $payment_id = edd_get_purchase_id_by_key( $key ); - - edd_update_payment_status( $payment_id, 'failed' ); - - edd_insert_payment_note( $payment_id, __( 'Capture declined in Amazon', 'easy-digital-downloads' ) ); - } - - break; - - case 'PaymentRefund' : - $trans_id = substr( $data['RefundDetails']['AmazonRefundId'], 0, 19 ); - $status = $data['RefundDetails']['RefundStatus']['State']; - - if ( 'Completed' === $status ) { - $payment_id = edd_get_purchase_id_by_transaction_id( $trans_id ); - - edd_update_payment_status( $payment_id, 'refunded' ); - - edd_insert_payment_note( $payment_id, sprintf( __( 'Refund completed in Amazon. Refund ID: %s', 'easy-digital-downloads' ), $data['RefundDetails']['AmazonRefundId'] ) ); - } - - break; - } - - } catch( Exception $e ) { - wp_die( $e->getErrorMessage(), __( 'IPN Error', 'easy-digital-downloads' ), array( 'response' => 401 ) ); - } - } - - /** - * Detect a refund action from EDD - * - * @deprecated 3.0 Due to issues with Amazon, refunds must be processed at the gateway. - * @since 2.4 - * @param $payment_id int The ID number of the payment being refunded - * @param $new_status string The new status assigned to the payment - * @param $old_status string The previous status of the payment - * @return void - */ - public function process_refund( $payment_id, $new_status, $old_status ) { - _edd_deprecated_function( __METHOD__, '3.0' ); - - if ( 'complete' !== $old_status && 'revoked' !== $old_status ) { - return; - } - - if ( 'refunded' !== $new_status ) { - return; - } - - if ( ! empty( $this->doing_ipn ) ) { - return; - } - - if ( 'amazon' !== edd_get_payment_gateway( $payment_id ) ) { - return; - } - - $this->refund( $payment_id ); - - } - - /** - * Refund a charge in Amazon - * - * @since 2.4 - * @param $payment_id int The ID number of the payment being refunded - * @return string - */ - private function refund( $payment_id = 0 ) { - - $refund = $this->client->refund( array( - 'merchant_id' => edd_get_option( 'amazon_seller_id', '' ), - 'amazon_capture_id' => edd_get_payment_meta( $payment_id, '_edd_amazon_capture_id', true ), - 'refund_reference_id' => md5( edd_get_payment_key( $payment_id ) . '-refund' ), - 'refund_amount' => edd_get_payment_amount( $payment_id ), - 'currency_code' => edd_get_payment_currency_code( $payment_id ), - ) ); - - if ( 200 == $refund->response['Status'] ) { - $refund = new ResponseParser( $refund->response ); - $refund = $refund->toArray(); - - $reference_id = $refund['RefundResult']['RefundDetails']['RefundReferenceId']; - $status = $refund['RefundResult']['RefundDetails']['RefundStatus']['State']; - - switch( $status ) { - case 'Declined' : - $note = __( 'Refund declined in Amazon. Refund ID: %s', 'easy-digital-downloads' ); - break; - - case 'Completed' : - $refund_id = $refund['RefundResult']['RefundDetails']['AmazonRefundId']; - $note = sprintf( __( 'Refund completed in Amazon. Refund ID: %s', 'easy-digital-downloads' ), $refund_id ); - break; - - case 'Pending' : - $note = sprintf( __( 'Refund initiated in Amazon. Reference ID: %s', 'easy-digital-downloads' ), $reference_id ); - break; - } - edd_insert_payment_note( $payment_id, $note ); - - } else { - edd_insert_payment_note( $payment_id, __( 'Refund request failed in Amazon.', 'easy-digital-downloads' ) ); - } - } - - /** - * Retrieve the URL for connecting Amazon account to EDD - * - * @since 2.4 - * @since 2.9.8 - Updated registration URL per Amazon Reps - * @return string - */ - private function get_registration_url() { - - switch ( edd_get_shop_country() ) { - case 'GB': - $base_url = 'https://payments.amazon.co.uk/preregistration/lpa'; - break; - case 'DE': - $base_url = 'https://payments.amazon.de/preregistration/lpa'; - break; - default: - $base_url = 'https://sellercentral.amazon.com/hz/me/sp/signup'; - break; - } - - $query_args = array( - 'registration_source' => 'SPPD', - 'spId' => 'A3JST9YM1SX7LB', - ); - - return add_query_arg( $query_args, $base_url ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/functions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/functions.php deleted file mode 100644 index b48649c8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/functions.php +++ /dev/null @@ -1,619 +0,0 @@ - array( - 'admin_label' => __( 'Live', 'easy-digital-downloads' ) - ), - 'test' => array( - 'admin_label' => __( 'Test', 'easy-digital-downloads' ) - ) - ); - } - - return (array) apply_filters( 'edd_payment_modes', $modes ); -} - -/** - * Returns a list of all available gateways. - * - * @since 1.0 - * - * @return array $gateways All the available gateways. - */ -function edd_get_payment_gateways() { - static $gateways = null; - - // Default, built-in gateways - if ( is_null( $gateways ) ) { - $gateways = array( - 'paypal_commerce' => array( - 'admin_label' => __( 'PayPal', 'easy-digital-downloads' ), - 'checkout_label' => __( 'PayPal', 'easy-digital-downloads' ), - 'supports' => array( - 'buy_now', - ), - 'icons' => array( - 'paypal', - ), - ), - /** - * PayPal Standard is available only if it was used prior to 2.11 and the store owner hasn't - * yet been onboarded to PayPal Commerce. - * - * @see \EDD\Gateways\PayPal\maybe_remove_paypal_standard() - */ - 'paypal' => array( - 'admin_label' => __( 'PayPal Standard', 'easy-digital-downloads' ), - 'checkout_label' => __( 'PayPal', 'easy-digital-downloads' ), - 'supports' => array( - 'buy_now', - ), - 'icons' => array( - 'paypal', - ), - ), - 'manual' => array( - 'admin_label' => __( 'Store Gateway', 'easy-digital-downloads' ), - 'checkout_label' => __( 'Store Gateway', 'easy-digital-downloads' ), - ), - ); - } - - $gateways = apply_filters( 'edd_payment_gateways', $gateways ); - - // Since Stripe is added via a filter still, move to the top. - if ( array_key_exists( 'stripe', $gateways ) ) { - $stripe_attributes = $gateways['stripe']; - unset( $gateways['stripe'] ); - - $gateways = array_merge( array( 'stripe' => $stripe_attributes ), $gateways ); - } - - return (array) apply_filters( 'edd_payment_gateways', $gateways ); -} - -/** - * Enforce the gateway order (from the sortable admin area UI). - * - * @since 3.0 - * - * @param array $gateways - * @return array - */ -function edd_order_gateways( $gateways = array() ) { - - // Get the order option - $order = edd_get_option( 'gateways_order', '' ); - - // If order is set, enforce it - if ( ! empty( $order ) ) { - $order = array_flip( explode( ',', $order ) ); - $order = array_intersect_key( $order, $gateways ); - $gateways = array_merge( $order, $gateways ); - } - - // Return ordered gateways - return $gateways; -} -add_filter( 'edd_payment_gateways', 'edd_order_gateways', 99 ); -add_filter( 'edd_enabled_payment_gateways_before_sort', 'edd_order_gateways', 99 ); - -/** - * Returns a list of all enabled gateways. - * - * @since 1.0 - * @param bool $sort If true, the default gateway will be first - * @return array $gateway_list All the available gateways -*/ -function edd_get_enabled_payment_gateways( $sort = false ) { - $gateways = edd_get_payment_gateways(); - $enabled = (array) edd_get_option( 'gateways', false ); - - $gateway_list = array(); - - foreach ( $gateways as $key => $gateway ) { - if ( isset( $enabled[ $key ] ) && 1 === (int) $enabled[ $key ] ) { - $gateway_list[ $key ] = $gateway; - } - } - - /** - * Filter the enabled payment gateways before the default is bumped to the - * front of the array. - * - * @since 3.0 - * - * @param array $gateway_list List of enabled payment gateways - * @return array Array of sorted gateways - */ - $gateway_list = apply_filters( 'edd_enabled_payment_gateways_before_sort', $gateway_list ); - - // Reorder our gateways so the default is first - if ( true === $sort ) { - $default_gateway_id = edd_get_default_gateway(); - - // Only put default on top if it's active - if ( edd_is_gateway_active( $default_gateway_id ) ) { - $default_gateway = array( $default_gateway_id => $gateway_list[ $default_gateway_id ] ); - unset( $gateway_list[ $default_gateway_id ] ); - - $gateway_list = array_merge( $default_gateway, $gateway_list ); - } - } - - return apply_filters( 'edd_enabled_payment_gateways', $gateway_list ); -} - -/** - * Checks whether a specified gateway is activated. - * - * @since 1.0 - * - * @param string $gateway Name of the gateway to check for. - * @return boolean true if enabled, false otherwise. -*/ -function edd_is_gateway_active( $gateway ) { - $gateways = edd_get_enabled_payment_gateways(); - $retval = array_key_exists( $gateway, $gateways ); - - return apply_filters( 'edd_is_gateway_active', $retval, $gateway, $gateways ); -} - -/** - * Gets the default payment gateway selected from the EDD Settings. - * - * @since 1.5 - * - * @return string $default Default gateway ID. - */ -function edd_get_default_gateway() { - $default = edd_get_option( 'default_gateway', 'paypal' ); - - // Use the first enabled one - if ( ! edd_is_gateway_active( $default ) ) { - $gateways = edd_get_enabled_payment_gateways(); - $gateways = array_keys( $gateways ); - $default = reset( $gateways ); - } - - return apply_filters( 'edd_default_gateway', $default ); -} - -/** - * Returns the admin label for the specified gateway - * - * @since 1.0.8.3 - * - * @param string $gateway Name of the gateway to retrieve a label for - * @return string Gateway admin label - */ -function edd_get_gateway_admin_label( $gateway ) { - $gateways = edd_get_payment_gateways(); - - $label = isset( $gateways[ $gateway ] ) - ? $gateways[ $gateway ]['admin_label'] - : ucwords( $gateway ); - - return apply_filters( 'edd_gateway_admin_label', $label, $gateway ); -} - -/** - * Returns the checkout label for the specified gateway. - * - * @since 1.0.8.5 - * - * @param string $gateway Name of the gateway to retrieve a label for. - * @return string Checkout label for the gateway. - */ -function edd_get_gateway_checkout_label( $gateway ) { - $gateways = edd_get_payment_gateways(); - $label = isset( $gateways[ $gateway ] ) ? $gateways[ $gateway ]['checkout_label'] : $gateway; - - return apply_filters( 'edd_gateway_checkout_label', $label, $gateway ); -} - -/** - * Returns the options a gateway supports. - * - * @since 1.8 - * - * @param string $gateway ID of the gateway to retrieve a label for. - * @return array Options the gateway supports. - */ -function edd_get_gateway_supports( $gateway ) { - $gateways = edd_get_enabled_payment_gateways(); - $supports = isset( $gateways[ $gateway ]['supports'] ) ? $gateways[ $gateway ]['supports'] : array(); - - return apply_filters( 'edd_gateway_supports', $supports, $gateway ); -} - -/** - * Checks if a gateway supports buy now. - * - * @since 1.8 - * - * @param string $gateway ID of the gateway to retrieve a label for. - * @return bool True if the gateway supports buy now, false otherwise. - */ -function edd_gateway_supports_buy_now( $gateway ) { - $supports = edd_get_gateway_supports( $gateway ); - $ret = in_array( 'buy_now', $supports, true ); - - return apply_filters( 'edd_gateway_supports_buy_now', $ret, $gateway ); -} - -/** - * Checks if an enabled gateway supports buy now. - * - * @since 1.8 - * - * @return bool True if the shop supports buy now, false otherwise. - */ -function edd_shop_supports_buy_now() { - $gateways = edd_get_enabled_payment_gateways(); - $ret = false; - - if ( ! edd_use_taxes() && $gateways && 1 === count( $gateways ) ) { - foreach ( $gateways as $gateway_id => $gateway ) { - if ( edd_gateway_supports_buy_now( $gateway_id ) ) { - $ret = true; - break; - } - } - } - - return apply_filters( 'edd_shop_supports_buy_now', $ret ); -} - -/** - * Build the purchase data for a straight-to-gateway purchase button - * - * @since 1.7 - * - * @param int $download_id - * @param array $options - * @param int $quantity - * - * @return mixed|void - */ -function edd_build_straight_to_gateway_data( $download_id = 0, $options = array(), $quantity = 1 ) { - $price_options = array(); - - if ( empty( $options ) || ! edd_has_variable_prices( $download_id ) ) { - $price = edd_get_download_price( $download_id ); - } else { - - if ( is_array( $options['price_id'] ) ) { - $price_id = $options['price_id'][0]; - } else { - $price_id = $options['price_id']; - } - - $prices = edd_get_variable_prices( $download_id ); - - // Make sure a valid price ID was supplied - if ( ! isset( $prices[ $price_id ] ) ) { - wp_die( __( 'The requested price ID does not exist.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 404 ) ); - } - - $price_options = array( - 'price_id' => $price_id, - 'amount' => $prices[ $price_id ]['amount'] - ); - $price = $prices[ $price_id ]['amount']; - } - - // Set up Downloads array - $downloads = array( - array( - 'id' => $download_id, - 'options' => $price_options - ) - ); - - // Set up Cart Details array - $cart_details = array( - array( - 'name' => get_the_title( $download_id ), - 'id' => $download_id, - 'item_number' => array( - 'id' => $download_id, - 'options' => $price_options - ), - 'tax' => 0, - 'discount' => 0, - 'item_price' => $price, - 'subtotal' => ( $price * $quantity ), - 'price' => ( $price * $quantity ), - 'quantity' => $quantity, - ) - ); - - if ( is_user_logged_in() ) { - $current_user = wp_get_current_user(); - } - - // Setup user information - $user_info = array( - 'id' => is_user_logged_in() ? get_current_user_id() : -1, - 'email' => is_user_logged_in() ? $current_user->user_email : '', - 'first_name' => is_user_logged_in() ? $current_user->user_firstname : '', - 'last_name' => is_user_logged_in() ? $current_user->user_lastname : '', - 'discount' => 'none', - 'address' => array() - ); - - // Setup purchase information - $purchase_data = array( - 'downloads' => $downloads, - 'fees' => edd_get_cart_fees(), - 'subtotal' => $price * $quantity, - 'discount' => 0, - 'tax' => 0, - 'price' => $price * $quantity, - 'purchase_key' => strtolower( md5( uniqid() ) ), - 'user_email' => $user_info['email'], - 'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ), - 'user_info' => $user_info, - 'post_data' => array(), - 'cart_details' => $cart_details, - 'gateway' => \EDD\Gateways\PayPal\paypal_standard_enabled() ? 'paypal' : 'paypal_commerce', - 'buy_now' => true, - 'card_info' => array() - ); - - return apply_filters( 'edd_straight_to_gateway_purchase_data', $purchase_data ); -} - -/** - * Sends all the payment data to the specified gateway - * - * @since 1.0 - * - * @param string $gateway Name of the gateway. - * @param array $payment_data All the payment data to be sent to the gateway. -*/ -function edd_send_to_gateway( $gateway, $payment_data ) { - $payment_data['gateway_nonce'] = wp_create_nonce( 'edd-gateway' ); - - // $gateway must match the ID used when registering the gateway - do_action( 'edd_gateway_' . $gateway, $payment_data ); -} - -/** - * Determines if the gateway menu should be shown - * - * If the cart amount is zero, no option is shown and the cart uses the manual gateway - * to emulate a no-gateway-setup for a free download - * - * @since 1.3.2 - * - * @return bool $show_gateways Whether or not to show the gateways - */ -function edd_show_gateways() { - $gateways = edd_get_enabled_payment_gateways(); - $show_gateways = false; - - if ( count( $gateways ) > 1 ) { - $show_gateways = true; - - if ( edd_get_cart_total() <= 0 ) { - $show_gateways = false; - } - } - - return apply_filters( 'edd_show_gateways', $show_gateways ); -} - -/** - * Determines what the currently selected gateway is - * - * If the cart amount is zero, no option is shown and the cart uses the manual - * gateway to emulate a no-gateway-setup for a free download - * - * @since 1.3.2 - * @return string $chosen_gateway The slug of the gateway - */ -function edd_get_chosen_gateway() { - - // Use the default gateway by default - $retval = edd_get_default_gateway(); - - // Get the chosen gateway - $chosen = isset( $_REQUEST['payment-mode'] ) - ? $_REQUEST['payment-mode'] - : false; - - // Sanitize the gateway - if ( false !== $chosen ) { - $chosen = preg_replace( '/[^a-zA-Z0-9-_]+/', '', $chosen ); - $chosen = urldecode( $chosen ); - - // Set return value if gateway is active - if ( ! empty( $chosen ) && edd_is_gateway_active( $chosen ) ) { - $retval = $chosen; - } - } - - // Override to manual if no price - if ( edd_get_cart_subtotal() <= 0 ) { - $retval = 'manual'; - } - - return apply_filters( 'edd_chosen_gateway', $retval, $chosen ); -} - -/** - * Record a gateway error - * - * A simple wrapper function for edd_record_log() - * - * @since 1.3.3 - * - * @param string $title Title of the log entry (default: empty) - * @param string $message Message to store in the log entry (default: empty) - * @param int $parent Parent log entry (default: 0) - * - * @return int ID of the new log entry. - */ -function edd_record_gateway_error( $title = '', $message = '', $parent = 0 ) { - return edd_record_log( $title, $message, $parent, 'gateway_error' ); -} - -/** - * Counts the number of orders made with a specific gateway. - * - * @since 1.6 - * @since 3.0 Use edd_count_orders(). - * - * @param string $gateway_label Gateway label. - * @param string $status Order status. - * - * @return int Number of orders placed based on the gateway. - */ -function edd_count_sales_by_gateway( $gateway_label = 'paypal', $status = 'complete' ) { - return edd_count_orders( array( - 'gateway' => $gateway_label, - 'status' => $status, - ) ); -} - -/** - * Determines if a gateway is setup. - * - * @since 3.1.2 - * - * @param string $gateway The gateway to check. - * - * @return bool True if the gateway is setup, false otherwise. - */ -function edd_is_gateway_setup( $gateway = '' ) { - // Return false if no gateway is passed. - if ( empty( $gateway ) ) { - return false; - } - - $gateways = edd_get_payment_gateways(); - - // If the gateway is not registered, return false. - if ( ! array_key_exists( $gateway, $gateways ) ) { - return false; - } - - // Some core gateways, we can just determine here, otherwise we'll use the default case to run the filter. - switch ( $gateway ) { - case 'stripe': - $api_key = edd_is_test_mode() - ? edd_get_option( 'test_publishable_key' ) - : edd_get_option( 'live_publishable_key' ); - - $is_setup = ! empty( $api_key ); - break; - - case 'paypal_commerce': - $is_setup = EDD\Gateways\PayPal\ready_to_accept_payments(); - break; - - default: - /** - * Run a filter to determine if a gateway is setup. - * - * This defaults to 'true' so that gateways that do not have a setup check to - * continue to work. - * - * This hook would fire on the gateway slug, prefixed with `edd_is_gateway_setup_`. - * Example: edd_is_gateway_setup_paypal_express - * - * @since 3.1.2 - * - * @param bool $is_setup Whether or not the gateway is setup. - */ - $is_setup = apply_filters( 'edd_is_gateway_setup_' . $gateway, true ); - break; - } - - return $is_setup; -} - -/** - * Gets the URL to the gateway settings page. - * - * @since 3.1.2 - * - * @param string $gateway The gateway to get the settings URL for. - * - * @return string The URL to the gateway settings page. - */ -function edd_get_gateway_settings_url( $gateway = '' ) { - // Return false if no gateway is passed. - if ( empty( $gateway ) ) { - return ''; - } - - $gateways = edd_get_payment_gateways(); - - // If the gateway is not registered, return false. - if ( ! array_key_exists( $gateway, $gateways ) ) { - return ''; - } - - // Some core gateways, we can just determine here, otherwise we'll use the default case to run the filter. - switch ( $gateway ) { - case 'stripe': - $gateway_settings_url = edd_get_admin_url( - array( - 'page' => 'edd-settings', - 'tab' => 'gateways', - 'section' => 'edd-stripe', - ) - ); - break; - - case 'paypal_commerce': - $gateway_settings_url = EDD\Gateways\PayPal\Admin\get_settings_url(); - break; - - default: - /** - * Run a filter to assign a settings URL for the gateway. - * - * This defaults to an empty string so that gateways that do not have - * a setup check to continue to work. - * - * This hook would fire on the gateway slug, prefixed with `edd_gateway_settings_url_`. - * Example: edd_gateway_settings_url_paypal_express - * - * @since 3.1.2 - * - * @param string $gateway_settings_url The URL to the gateway settings. - */ - $gateway_settings_url = apply_filters( 'edd_gateway_settings_url_' . $gateway, '' ); - break; - } - - return $gateway_settings_url; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/Client.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/Client.php deleted file mode 100644 index 62897f7e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/Client.php +++ /dev/null @@ -1,1582 +0,0 @@ - null, - 'secret_key' => null, - 'access_key' => null, - 'region' => null, - 'currency_code' => null, - 'sandbox' => false, - 'platform_id' => null, - 'cabundle_file' => null, - 'application_name' => null, - 'application_version' => null, - 'proxy_host' => null, - 'proxy_port' => -1, - 'proxy_username' => null, - 'proxy_password' => null, - 'client_id' => null, - 'handle_throttle' => true - ); - - private $modePath = null; - - // Final URL to where the API parameters POST done, based off the config['region'] and respective $mwsServiceUrls - private $mwsServiceUrl = null; - - private $mwsServiceUrls = array('eu' => 'mws-eu.amazonservices.com', - 'na' => 'mws.amazonservices.com', - 'jp' => 'mws.amazonservices.jp'); - - // Production profile end points to get the user information - private $liveProfileEndpoint = array('uk' => 'https://api.amazon.co.uk', - 'us' => 'https://api.amazon.com', - 'de' => 'https://api.amazon.de', - 'jp' => 'https://api.amazon.co.jp'); - - // Sandbox profile end points to get the user information - private $sandboxProfileEndpoint = array('uk' => 'https://api.sandbox.amazon.co.uk', - 'us' => 'https://api.sandbox.amazon.com', - 'de' => 'https://api.sandbox.amazon.de', - 'jp' => 'https://api.sandbox.amazon.co.jp'); - - private $regionMappings = array('de' => 'eu', - 'uk' => 'eu', - 'us' => 'na', - 'jp' => 'jp'); - - // Boolean variable to check if the API call was a success - public $success = false; - - /* Takes user configuration array from the user as input - * Takes JSON file path with configuration information as input - * Validates the user configuration array against existing config array - */ - - public function __construct($config = null) - { - if (!is_null($config)) { - - if (is_array($config)) { - $configArray = $config; - } elseif (!is_array($config)) { - $configArray = $this->checkIfFileExists($config); - } - - if (is_array($configArray)) { - $this->checkConfigKeys($configArray); - } else { - throw new \Exception('$config is of the incorrect type ' . gettype($configArray) . ' and should be of the type array'); - } - } else { - throw new \Exception('$config cannot be null.'); - } - } - - /* checkIfFileExists - check if the JSON file exists in the path provided */ - - private function checkIfFileExists($config) - { - if(file_exists($config)) - { - $jsonString = file_get_contents($config); - $configArray = json_decode($jsonString, true); - - $jsonError = json_last_error(); - - if ($jsonError != 0) { - $errorMsg = "Error with message - content is not in json format" . $this->getErrorMessageForJsonError($jsonError) . " " . $configArray; - throw new \Exception($errorMsg); - } - } else { - $errorMsg ='$config is not a Json File path or the Json File was not found in the path provided'; - throw new \Exception($errorMsg); - } - return $configArray; - } - - /* Checks if the keys of the input configuration matches the keys in the config array - * if they match the values are taken else throws exception - * strict case match is not performed - */ - - private function checkConfigKeys($config) - { - $config = array_change_key_case($config, CASE_LOWER); - $config = $this->trimArray($config); - - foreach ($config as $key => $value) { - if (array_key_exists($key, $this->config)) { - $this->config[$key] = $value; - } else { - throw new \Exception('Key ' . $key . ' is either not part of the configuration or has incorrect Key name. - check the config array key names to match your key names of your config array', 1); - } - } - } - - /* Convert a json error code to a descriptive error message - * - * @param int $jsonError message code - * - * @return string error message - */ - - private function getErrorMessageForJsonError($jsonError) - { - switch ($jsonError) { - case JSON_ERROR_DEPTH: - return " - maximum stack depth exceeded."; - break; - case JSON_ERROR_STATE_MISMATCH: - return " - invalid or malformed JSON."; - break; - case JSON_ERROR_CTRL_CHAR: - return " - control character error."; - break; - case JSON_ERROR_SYNTAX: - return " - syntax error."; - break; - default: - return "."; - break; - } - } - - /* Setter for sandbox - * Sets the Boolean value for config['sandbox'] variable - */ - - public function setSandbox($value) - { - if (is_bool($value)) { - $this->config['sandbox'] = $value; - } else { - throw new \Exception($value . ' is of type ' . gettype($value) . ' and should be a boolean value'); - } - } - - /* Setter for config['client_id'] - * Sets the value for config['client_id'] variable - */ - - public function setClientId($value) - { - if (!empty($value)) { - $this->config['client_id'] = $value; - } else { - throw new \Exception('setter value for client ID provided is empty'); - } - } - - /* Setter for Proxy - * input $proxy [array] - * @param $proxy['proxy_user_host'] - hostname for the proxy - * @param $proxy['proxy_user_port'] - hostname for the proxy - * @param $proxy['proxy_user_name'] - if your proxy required a username - * @param $proxy['proxy_user_password'] - if your proxy required a password - */ - - public function setProxy($proxy) - { - $proxy = $this->trimArray($proxy); - - if (!empty($proxy['proxy_user_host'])) - $this->config['proxy_user_host'] = $proxy['proxy_user_host']; - - if (!empty($proxy['proxy_user_port'])) - $this->config['proxy_user_port'] = $proxy['proxy_user_port']; - - if (!empty($proxy['proxy_user_name'])) - $this->config['proxy_user_name'] = $proxy['proxy_user_name']; - - if (!empty($proxy['proxy_user_password'])) - $this->config['proxy_user_password'] = $proxy['proxy_user_password']; - } - - /* Setter for $mwsServiceUrl - * Set the URL to which the post request has to be made for unit testing - */ - - public function setMwsServiceUrl($url) - { - $this->mwsServiceUrl = $url; - } - - /* Getter - * Gets the value for the key if the key exists in config - */ - - public function __get($name) - { - if (array_key_exists(strtolower($name), $this->config)) { - return $this->config[strtolower($name)]; - } else { - throw new \Exception('Key ' . $name . ' is either not a part of the configuration array config or the' . $name . 'does not match the key name in the config array', 1); - } - } - - /* Getter for parameters string - * Gets the value for the parameters string for unit testing - */ - - public function getParameters() - { - return trim($this->parameters); - } - - /* Trim the input Array key values */ - - private function trimArray($array) - { - foreach ($array as $key => $value) - { - $array[$key] = trim($value); - } - return $array; - } - - /* GetUserInfo convenience function - Returns user's profile information from Amazon using the access token returned by the Button widget. - * - * @see http://login.amazon.com/website Step 4 - * @param $accessToken [String] - */ - - public function getUserInfo($accessToken) - { - // Get the correct Profile Endpoint URL based off the country/region provided in the config['region'] - $this->profileEndpointUrl(); - - if (empty($accessToken)) { - throw new \InvalidArgumentException('Access Token is a required parameter and is not set'); - } - - // To make sure double encoding doesn't occur decode first and encode again. - $accessToken = urldecode($accessToken); - $url = $this->profileEndpoint . '/auth/o2/tokeninfo?access_token=' . urlEncode($accessToken); - - $httpCurlRequest = new HttpCurl(); - - $response = $httpCurlRequest->httpGet($url); - $data = json_decode($response); - - if ($data->aud != $this->config['client_id']) { - // The access token does not belong to us - throw new \Exception('The Access token entered is incorrect'); - } - - // Exchange the access token for user profile - $url = $this->profileEndpoint . '/user/profile'; - $httpCurlRequest = new HttpCurl(); - - $httpCurlRequest->setAccessToken($accessToken); - $httpCurlRequest->setHttpHeader(true); - $response = $httpCurlRequest->httpGet($url); - - $userInfo = json_decode($response, true); - return $userInfo; - } - - /* setParametersAndPost - sets the parameters array with non empty values from the requestParameters array sent to API calls. - * If Provider Credit Details is present, values are set by setProviderCreditDetails - * If Provider Credit Reversal Details is present, values are set by setProviderCreditDetails - */ - - private function setParametersAndPost($parameters, $fieldMappings, $requestParameters) - { - /* For loop to take all the non empty parameters in the $requestParameters and add it into the $parameters array, - * if the keys are matched from $requestParameters array with the $fieldMappings array - */ - foreach ($requestParameters as $param => $value) { - - if(!is_array($value)) { - $value = trim($value); - } - - if (array_key_exists($param, $fieldMappings) && $value!='') { - - if(is_array($value)) { - // If the parameter is a provider_credit_details or provider_credit_reversal_details, call the respective functions to set the values - if($param === 'provider_credit_details') { - $parameters = $this->setProviderCreditDetails($parameters,$value); - } elseif ($param === 'provider_credit_reversal_details') { - $parameters = $this->setProviderCreditReversalDetails($parameters,$value); - } - - } else{ - // For variables that are boolean values, strtolower them - if($this->checkIfBool($value)) - { - $value = strtolower($value); - } - - $parameters[$fieldMappings[$param]] = $value; - } - } - } - - $parameters = $this->setDefaultValues($parameters, $fieldMappings, $requestParameters); - $responseObject = $this->calculateSignatureAndPost($parameters); - - return $responseObject; - } - - /* checkIfBool - checks if the input is a boolean */ - - private function checkIfBool($string) - { - $string = strtolower($string); - return in_array($string, array('true', 'false')); - } - - /* calculateSignatureAndPost - convert the Parameters array to string and curl POST the parameters to MWS */ - - private function calculateSignatureAndPost($parameters) - { - // Call the signature and Post function to perform the actions. Returns XML in array format - $parametersString = $this->calculateSignatureAndParametersToString($parameters); - - // POST using curl the String converted Parameters - $response = $this->invokePost($parametersString); - - // Send this response as args to ResponseParser class which will return the object of the class. - $responseObject = new ResponseParser($response); - return $responseObject; - } - - /* If merchant_id is not set via the requestParameters array then it's taken from the config array - * - * Set the platform_id if set in the config['platform_id'] array - * - * If currency_code is set in the $requestParameters and it exists in the $fieldMappings array, strtoupper it - * else take the value from config array if set - */ - - private function setDefaultValues($parameters, $fieldMappings, $requestParameters) - { - if (empty($requestParameters['merchant_id'])) - $parameters['SellerId'] = $this->config['merchant_id']; - - if (array_key_exists('platform_id', $fieldMappings)) { - if (empty($requestParameters['platform_id']) && !empty($this->config['platform_id'])) - $parameters[$fieldMappings['platform_id']] = $this->config['platform_id']; - } - - if (array_key_exists('currency_code', $fieldMappings)) { - if (!empty($requestParameters['currency_code'])) { - $parameters[$fieldMappings['currency_code']] = strtoupper($requestParameters['currency_code']); - } else { - $parameters[$fieldMappings['currency_code']] = strtoupper($this->config['currency_code']); - } - } - - return $parameters; - } - - /* setProviderCreditDetails - sets the provider credit details sent via the Capture or Authorize API calls - * @param provider_id - [String] - * @param credit_amount - [String] - * @optional currency_code - [String] - */ - - private function setProviderCreditDetails($parameters, $providerCreditInfo) - { - $providerIndex = 0; - $providerString = 'ProviderCreditList.member.'; - - $fieldMappings = array( - 'provider_id' => 'ProviderId', - 'credit_amount' => 'CreditAmount.Amount', - 'currency_code' => 'CreditAmount.CurrencyCode' - ); - - foreach ($providerCreditInfo as $key => $value) - { - $value = array_change_key_case($value, CASE_LOWER); - $providerIndex = $providerIndex + 1; - - foreach ($value as $param => $val) - { - if (array_key_exists($param, $fieldMappings) && trim($val)!='') { - $parameters[$providerString.$providerIndex. '.' .$fieldMappings[$param]] = $val; - } - } - - // If currency code is not entered take it from the config array - if(empty($parameters[$providerString.$providerIndex. '.' .$fieldMappings['currency_code']])) - { - $parameters[$providerString.$providerIndex. '.' .$fieldMappings['currency_code']] = strtoupper($this->config['currency_code']); - } - } - - return $parameters; - } - - /* setProviderCreditReversalDetails - sets the reverse provider credit details sent via the Refund API call. - * @param provider_id - [String] - * @param credit_amount - [String] - * @optional currency_code - [String] - */ - - private function setProviderCreditReversalDetails($parameters, $providerCreditInfo) - { - $providerIndex = 0; - $providerString = 'ProviderCreditReversalList.member.'; - - $fieldMappings = array( - 'provider_id' => 'ProviderId', - 'credit_reversal_amount' => 'CreditReversalAmount.Amount', - 'currency_code' => 'CreditReversalAmount.CurrencyCode' - ); - - foreach ($providerCreditInfo as $key => $value) - { - $value = array_change_key_case($value, CASE_LOWER); - $providerIndex = $providerIndex + 1; - - foreach ($value as $param => $val) - { - if (array_key_exists($param, $fieldMappings) && trim($val)!='') { - $parameters[$providerString.$providerIndex. '.' .$fieldMappings[$param]] = $val; - } - } - - // If currency code is not entered take it from the config array - if(empty($parameters[$providerString.$providerIndex. '.' .$fieldMappings['currency_code']])) - { - $parameters[$providerString.$providerIndex. '.' .$fieldMappings['currency_code']] = strtoupper($this->config['currency_code']); - } - } - - return $parameters; - } - - /* GetOrderReferenceDetails API call - Returns details about the Order Reference object and its current state. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_GetOrderReferenceDetails.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_order_reference_id'] - [String] - * @optional requestParameters['address_consent_token'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function getOrderReferenceDetails($requestParameters = array()) - { - - $parameters['Action'] = 'GetOrderReferenceDetails'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_order_reference_id' => 'AmazonOrderReferenceId', - 'address_consent_token' => 'AddressConsentToken', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - return ($responseObject); - } - - /* SetOrderReferenceDetails API call - Sets order reference details such as the order total and a description for the order. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_SetOrderReferenceDetails.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_order_reference_id'] - [String] - * @param requestParameters['amount'] - [String] - * @param requestParameters['currency_code'] - [String] - * @optional requestParameters['platform_id'] - [String] - * @optional requestParameters['seller_note'] - [String] - * @optional requestParameters['seller_order_id'] - [String] - * @optional requestParameters['store_name'] - [String] - * @optional requestParameters['custom_information'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function setOrderReferenceDetails($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'SetOrderReferenceDetails'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_order_reference_id' => 'AmazonOrderReferenceId', - 'amount' => 'OrderReferenceAttributes.OrderTotal.Amount', - 'currency_code' => 'OrderReferenceAttributes.OrderTotal.CurrencyCode', - 'platform_id' => 'OrderReferenceAttributes.PlatformId', - 'seller_note' => 'OrderReferenceAttributes.SellerNote', - 'seller_order_id' => 'OrderReferenceAttributes.SellerOrderAttributes.SellerOrderId', - 'store_name' => 'OrderReferenceAttributes.SellerOrderAttributes.StoreName', - 'custom_information' => 'OrderReferenceAttributes.SellerOrderAttributes.CustomInformation', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* ConfirmOrderReferenceDetails API call - Confirms that the order reference is free of constraints and all required information has been set on the order reference. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_ConfirmOrderReference.html - - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_order_reference_id'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function confirmOrderReference($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'ConfirmOrderReference'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_order_reference_id' => 'AmazonOrderReferenceId', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* CancelOrderReferenceDetails API call - Cancels a previously confirmed order reference. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_CancelOrderReference.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_order_reference_id'] - [String] - * @optional requestParameters['cancelation_reason'] [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function cancelOrderReference($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'CancelOrderReference'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_order_reference_id' => 'AmazonOrderReferenceId', - 'cancelation_reason' => 'CancelationReason', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* CloseOrderReferenceDetails API call - Confirms that an order reference has been fulfilled (fully or partially) - * and that you do not expect to create any new authorizations on this order reference. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_CloseOrderReference.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_order_reference_id'] - [String] - * @optional requestParameters['closure_reason'] [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function closeOrderReference($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'CloseOrderReference'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_order_reference_id' => 'AmazonOrderReferenceId', - 'closure_reason' => 'ClosureReason', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* CloseAuthorization API call - Closes an authorization. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_CloseOrderReference.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_authorization_id'] - [String] - * @optional requestParameters['closure_reason'] [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function closeAuthorization($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'CloseAuthorization'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_authorization_id' => 'AmazonAuthorizationId', - 'closure_reason' => 'ClosureReason', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* Authorize API call - Reserves a specified amount against the payment method(s) stored in the order reference. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_Authorize.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_order_reference_id'] - [String] - * @param requestParameters['authorization_amount'] [String] - * @param requestParameters['currency_code'] - [String] - * @param requestParameters['authorization_reference_id'] [String] - * @optional requestParameters['capture_now'] [String] - * @optional requestParameters['provider_credit_details'] - [array (array())] - * @optional requestParameters['seller_authorization_note'] [String] - * @optional requestParameters['transaction_timeout'] [String] - Defaults to 1440 minutes - * @optional requestParameters['soft_descriptor'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function authorize($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'Authorize'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_order_reference_id' => 'AmazonOrderReferenceId', - 'authorization_amount' => 'AuthorizationAmount.Amount', - 'currency_code' => 'AuthorizationAmount.CurrencyCode', - 'authorization_reference_id' => 'AuthorizationReferenceId', - 'capture_now' => 'CaptureNow', - 'provider_credit_details' => array(), - 'seller_authorization_note' => 'SellerAuthorizationNote', - 'transaction_timeout' => 'TransactionTimeout', - 'soft_descriptor' => 'SoftDescriptor', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* GetAuthorizationDetails API call - Returns the status of a particular authorization and the total amount captured on the authorization. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_GetAuthorizationDetails.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_authorization_id'] [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function getAuthorizationDetails($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'GetAuthorizationDetails'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_authorization_id' => 'AmazonAuthorizationId', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* Capture API call - Captures funds from an authorized payment instrument. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_Capture.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_authorization_id'] - [String] - * @param requestParameters['capture_amount'] - [String] - * @param requestParameters['currency_code'] - [String] - * @param requestParameters['capture_reference_id'] - [String] - * @optional requestParameters['provider_credit_details'] - [array (array())] - * @optional requestParameters['seller_capture_note'] - [String] - * @optional requestParameters['soft_descriptor'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function capture($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'Capture'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_authorization_id' => 'AmazonAuthorizationId', - 'capture_amount' => 'CaptureAmount.Amount', - 'currency_code' => 'CaptureAmount.CurrencyCode', - 'capture_reference_id' => 'CaptureReferenceId', - 'provider_credit_details' => array(), - 'seller_capture_note' => 'SellerCaptureNote', - 'soft_descriptor' => 'SoftDescriptor', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* GetCaptureDetails API call - Returns the status of a particular capture and the total amount refunded on the capture. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_GetCaptureDetails.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_capture_id'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function getCaptureDetails($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'GetCaptureDetails'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_capture_id' => 'AmazonCaptureId', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* Refund API call - Refunds a previously captured amount. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_Refund.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_capture_id'] - [String] - * @param requestParameters['refund_reference_id'] - [String] - * @param requestParameters['refund_amount'] - [String] - * @param requestParameters['currency_code'] - [String] - * @optional requestParameters['provider_credit_reversal_details'] - [array(array())] - * @optional requestParameters['seller_refund_note'] [String] - * @optional requestParameters['soft_descriptor'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function refund($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'Refund'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_capture_id' => 'AmazonCaptureId', - 'refund_reference_id' => 'RefundReferenceId', - 'refund_amount' => 'RefundAmount.Amount', - 'currency_code' => 'RefundAmount.CurrencyCode', - 'provider_credit_reversal_details' => array(), - 'seller_refund_note' => 'SellerRefundNote', - 'soft_descriptor' => 'SoftDescriptor', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* GetRefundDetails API call - Returns the status of a particular refund. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_GetRefundDetails.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_refund_id'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function getRefundDetails($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'GetRefundDetails'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_refund_id' => 'AmazonRefundId', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* GetServiceStatus API Call - Returns the operational status of the Off-Amazon Payments API section - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_GetServiceStatus.html - * - * The GetServiceStatus operation returns the operational status of the Off-Amazon Payments API - * section of Amazon Marketplace Web Service (Amazon MWS). - * Status values are GREEN, GREEN_I, YELLOW, and RED. - * - * @param requestParameters['merchant_id'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function getServiceStatus($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'GetServiceStatus'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* CreateOrderReferenceForId API Call - Creates an order reference for the given object - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_CreateOrderReferenceForId.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['Id'] - [String] - * @optional requestParameters['inherit_shipping_address'] [Boolean] - * @optional requestParameters['ConfirmNow'] - [Boolean] - * @optional Amount (required when confirm_now is set to true) [String] - * @optional requestParameters['currency_code'] - [String] - * @optional requestParameters['seller_note'] - [String] - * @optional requestParameters['seller_order_id'] - [String] - * @optional requestParameters['store_name'] - [String] - * @optional requestParameters['custom_information'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function createOrderReferenceForId($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'CreateOrderReferenceForId'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'id' => 'Id', - 'id_type' => 'IdType', - 'inherit_shipping_address' => 'InheritShippingAddress', - 'confirm_now' => 'ConfirmNow', - 'amount' => 'OrderReferenceAttributes.OrderTotal.Amount', - 'currency_code' => 'OrderReferenceAttributes.OrderTotal.CurrencyCode', - 'platform_id' => 'OrderReferenceAttributes.PlatformId', - 'seller_note' => 'OrderReferenceAttributes.SellerNote', - 'seller_order_id' => 'OrderReferenceAttributes.SellerOrderAttributes.SellerOrderId', - 'store_name' => 'OrderReferenceAttributes.SellerOrderAttributes.StoreName', - 'custom_information' => 'OrderReferenceAttributes.SellerOrderAttributes.CustomInformation', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* GetBillingAgreementDetails API Call - Returns details about the Billing Agreement object and its current state. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_GetBillingAgreementDetails.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_billing_agreement_id'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function getBillingAgreementDetails($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'GetBillingAgreementDetails'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', - 'address_consent_token' => 'AddressConsentToken', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* SetBillingAgreementDetails API call - Sets Billing Agreement details such as a description of the agreement and other information about the seller. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_SetBillingAgreementDetails.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_billing_agreement_id'] - [String] - * @param requestParameters['amount'] - [String] - * @param requestParameters['currency_code'] - [String] - * @optional requestParameters['platform_id'] - [String] - * @optional requestParameters['seller_note'] - [String] - * @optional requestParameters['seller_billing_agreement_id'] - [String] - * @optional requestParameters['store_name'] - [String] - * @optional requestParameters['custom_information'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function setBillingAgreementDetails($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'SetBillingAgreementDetails'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', - 'platform_id' => 'BillingAgreementAttributes.PlatformId', - 'seller_note' => 'BillingAgreementAttributes.SellerNote', - 'seller_billing_agreement_id' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.SellerBillingAgreementId', - 'custom_information' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.CustomInformation', - 'store_name' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.StoreName', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* ConfirmBillingAgreement API Call - Confirms that the Billing Agreement is free of constraints and all required information has been set on the Billing Agreement. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_ConfirmBillingAgreement.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_billing_agreement_id'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function confirmBillingAgreement($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'ConfirmBillingAgreement'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* ValidateBillignAgreement API Call - Validates the status of the Billing Agreement object and the payment method associated with it. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_ValidateBillingAgreement.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_billing_agreement_id'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function validateBillingAgreement($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'ValidateBillingAgreement'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* AuthorizeOnBillingAgreement API call - Reserves a specified amount against the payment method(s) stored in the Billing Agreement. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_AuthorizeOnBillingAgreement.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_billing_agreement_id'] - [String] - * @param requestParameters['authorization_reference_id'] [String] - * @param requestParameters['authorization_amount'] [String] - * @param requestParameters['currency_code'] - [String] - * @optional requestParameters['seller_authorization_note'] [String] - * @optional requestParameters['transaction_timeout'] - Defaults to 1440 minutes - * @optional requestParameters['capture_now'] [String] - * @optional requestParameters['soft_descriptor'] - - [String] - * @optional requestParameters['seller_note'] - [String] - * @optional requestParameters['platform_id'] - [String] - * @optional requestParameters['custom_information'] - [String] - * @optional requestParameters['seller_order_id'] - [String] - * @optional requestParameters['store_name'] - [String] - * @optional requestParameters['inherit_shipping_address'] [Boolean] - Defaults to true - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function authorizeOnBillingAgreement($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'AuthorizeOnBillingAgreement'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', - 'authorization_reference_id' => 'AuthorizationReferenceId', - 'authorization_amount' => 'AuthorizationAmount.Amount', - 'currency_code' => 'AuthorizationAmount.CurrencyCode', - 'seller_authorization_note' => 'SellerAuthorizationNote', - 'transaction_timeout' => 'TransactionTimeout', - 'capture_now' => 'CaptureNow', - 'soft_descriptor' => 'SoftDescriptor', - 'seller_note' => 'SellerNote', - 'platform_id' => 'PlatformId', - 'custom_information' => 'SellerOrderAttributes.CustomInformation', - 'seller_order_id' => 'SellerOrderAttributes.SellerOrderId', - 'store_name' => 'SellerOrderAttributes.StoreName', - 'inherit_shipping_address' => 'InheritShippingAddress', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* CloseBillingAgreement API Call - Returns details about the Billing Agreement object and its current state. - * @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_CloseBillingAgreement.html - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_billing_agreement_id'] - [String] - * @optional requestParameters['closure_reason'] [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function closeBillingAgreement($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'CloseBillingAgreement'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', - 'closure_reason' => 'ClosureReason', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* charge convenience method - * Performs the API calls - * 1. SetOrderReferenceDetails / SetBillingAgreementDetails - * 2. ConfirmOrderReference / ConfirmBillingAgreement - * 3. Authorize (with Capture) / AuthorizeOnBillingAgreeemnt (with Capture) - * - * @param requestParameters['merchant_id'] - [String] - * - * @param requestParameters['amazon_reference_id'] - [String] : Order Reference ID /Billing Agreement ID - * If requestParameters['amazon_reference_id'] is empty then the following is required, - * @param requestParameters['amazon_order_reference_id'] - [String] : Order Reference ID - * or, - * @param requestParameters['amazon_billing_agreement_id'] - [String] : Billing Agreement ID - * - * @param $requestParameters['charge_amount'] - [String] : Amount value to be captured - * @param requestParameters['currency_code'] - [String] : Currency Code for the Amount - * @param requestParameters['authorization_reference_id'] - [String]- Any unique string that needs to be passed - * @optional requestParameters['charge_note'] - [String] : Seller Note sent to the buyer - * @optional requestParameters['transaction_timeout'] - [String] : Defaults to 1440 minutes - * @optional requestParameters['charge_order_id'] - [String] : Custom Order ID provided - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function charge($requestParameters = array()) { - - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - $requestParameters= $this->trimArray($requestParameters); - - $setParameters = $authorizeParameters = $confirmParameters = $requestParameters; - - $chargeType = ''; - - if (!empty($requestParameters['amazon_order_reference_id'])) - { - $chargeType = 'OrderReference'; - - } elseif(!empty($requestParameters['amazon_billing_agreement_id'])) { - $chargeType = 'BillingAgreement'; - - } elseif (!empty($requestParameters['amazon_reference_id'])) { - switch (substr(strtoupper($requestParameters['amazon_reference_id']), 0, 1)) { - case 'P': - case 'S': - $chargeType = 'OrderReference'; - $setParameters['amazon_order_reference_id'] = $requestParameters['amazon_reference_id']; - $authorizeParameters['amazon_order_reference_id'] = $requestParameters['amazon_reference_id']; - $confirmParameters['amazon_order_reference_id'] = $requestParameters['amazon_reference_id']; - break; - case 'B': - case 'C': - $chargeType = 'BillingAgreement'; - $setParameters['amazon_billing_agreement_id'] = $requestParameters['amazon_reference_id']; - $authorizeParameters['amazon_billing_agreement_id'] = $requestParameters['amazon_reference_id']; - $confirmParameters['amazon_billing_agreement_id'] = $requestParameters['amazon_reference_id']; - break; - default: - throw new \Exception('Invalid Amazon Reference ID'); - } - } else { - throw new \Exception('key amazon_order_reference_id or amazon_billing_agreement_id is null and is a required parameter'); - } - - // Set the other parameters if the values are present - $setParameters['amount'] = !empty($requestParameters['charge_amount']) ? $requestParameters['charge_amount'] : ''; - $authorizeParameters['authorization_amount'] = !empty($requestParameters['charge_amount']) ? $requestParameters['charge_amount'] : ''; - - $setParameters['seller_note'] = !empty($requestParameters['charge_note']) ? $requestParameters['charge_note'] : ''; - $authorizeParameters['seller_authorization_note'] = !empty($requestParameters['charge_note']) ? $requestParameters['charge_note'] : ''; - $authorizeParameters['seller_note'] = !empty($requestParameters['charge_note']) ? $requestParameters['charge_note'] : ''; - - $setParameters['seller_order_id'] = !empty($requestParameters['charge_order_id']) ? $requestParameters['charge_order_id'] : ''; - $setParameters['seller_billing_agreement_id'] = !empty($requestParameters['charge_order_id']) ? $requestParameters['charge_order_id'] : ''; - $authorizeParameters['seller_order_id'] = !empty($requestParameters['charge_order_id']) ? $requestParameters['charge_order_id'] : ''; - - $authorizeParameters['capture_now'] = 'true'; - - $response = $this->makeChargeCalls($chargeType, $setParameters, $confirmParameters, $authorizeParameters); - return $response; - } - - /* makeChargeCalls - makes API calls based off the charge type (OrderReference or BillingAgreement) */ - - private function makeChargeCalls($chargeType, $setParameters, $confirmParameters, $authorizeParameters) - { - switch ($chargeType) { - case 'OrderReference': - $response = $this->setOrderReferenceDetails($setParameters); - if ($this->success) { - $this->confirmOrderReference($confirmParameters); - } - if ($this->success) { - $response = $this->Authorize($authorizeParameters); - } - return $response; - case 'BillingAgreement': - // Get the Billing Agreement details and feed the response object to the ResponseParser - $responseObj = $this->getBillingAgreementDetails($setParameters); - // Call the function GetBillingAgreementDetailsStatus in ResponseParser.php providing it the XML response - // $baStatus is an aray containing the State of the Billing Agreement - $baStatus = $responseObj->getBillingAgreementDetailsStatus($responseObj->toXml()); - if ($baStatus['State'] != 'Open') { - $response = $this->SetBillingAgreementDetails($setParameters); - if ($this->success) { - $response = $this->ConfirmBillingAgreement($confirmParameters); - } - } - // Check the Billing Agreement status again before making the Authorization. - $responseObj = $this->getBillingAgreementDetails($setParameters); - $baStatus = $responseObj->GetBillingAgreementDetailsStatus($responseObj->toXml()); - if ($this->success && $baStatus['State'] === 'Open') { - $response = $this->AuthorizeOnBillingAgreement($authorizeParameters); - } - return $response; - } - } - - /* GetProviderCreditDetails API Call - Get the details of the Provider Credit. - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_provider_credit_id'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function getProviderCreditDetails($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'GetProviderCreditDetails'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_provider_credit_id' => 'AmazonProviderCreditId', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* GetProviderCreditReversalDetails API Call - Get details of the Provider Credit Reversal. - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_provider_credit_reversal_id'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function getProviderCreditReversalDetails($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'GetProviderCreditReversalDetails'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_provider_credit_reversal_id' => 'AmazonProviderCreditReversalId', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* ReverseProviderCredit API Call - Reverse the Provider Credit. - * - * @param requestParameters['merchant_id'] - [String] - * @param requestParameters['amazon_provider_credit_id'] - [String] - * @optional requestParameters['credit_reversal_reference_id'] - [String] - * @param requestParameters['credit_reversal_amount'] - [String] - * @optional requestParameters['currency_code'] - [String] - * @optional requestParameters['credit_reversal_note'] - [String] - * @optional requestParameters['mws_auth_token'] - [String] - */ - - public function reverseProviderCredit($requestParameters = array()) - { - $parameters = array(); - $parameters['Action'] = 'ReverseProviderCredit'; - $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); - - $fieldMappings = array( - 'merchant_id' => 'SellerId', - 'amazon_provider_credit_id' => 'AmazonProviderCreditId', - 'credit_reversal_reference_id' => 'CreditReversalReferenceId', - 'credit_reversal_amount' => 'CreditReversalAmount.Amount', - 'currency_code' => 'CreditReversalAmount.CurrencyCode', - 'credit_reversal_note' => 'CreditReversalNote', - 'mws_auth_token' => 'MWSAuthToken' - ); - - $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); - - return ($responseObject); - } - - /* Create an Array of required parameters, sort them - * Calculate signature and invoke the POST to the MWS Service URL - * - * @param AWSAccessKeyId [String] - * @param Version [String] - * @param SignatureMethod [String] - * @param Timestamp [String] - * @param Signature [String] - */ - - private function calculateSignatureAndParametersToString($parameters = array()) - { - $parameters['AWSAccessKeyId'] = $this->config['access_key']; - $parameters['Version'] = self::SERVICE_VERSION; - $parameters['SignatureMethod'] = 'HmacSHA256'; - $parameters['SignatureVersion'] = 2; - $parameters['Timestamp'] = $this->getFormattedTimestamp(); - uksort($parameters, 'strcmp'); - - $this->createServiceUrl(); - - $parameters['Signature'] = $this->signParameters($parameters); - $parameters = $this->getParametersAsString($parameters); - - // Save these parameters in the parameters variable so that it can be returned for unit testing. - $this->parameters = $parameters; - return $parameters; - } - - /* Computes RFC 2104-compliant HMAC signature for request parameters - * Implements AWS Signature, as per following spec: - * - * If Signature Version is 0, it signs concatenated Action and Timestamp - * - * If Signature Version is 1, it performs the following: - * - * Sorts all parameters (including SignatureVersion and excluding Signature, - * the value of which is being created), ignoring case. - * - * Iterate over the sorted list and append the parameter name (in original case) - * and then its value. It will not URL-encode the parameter values before - * constructing this string. There are no separators. - * - * If Signature Version is 2, string to sign is based on following: - * - * 1. The HTTP Request Method followed by an ASCII newline (%0A) - * 2. The HTTP Host header in the form of lowercase host, followed by an ASCII newline. - * 3. The URL encoded HTTP absolute path component of the URI - * (up to but not including the query string parameters); - * if this is empty use a forward '/'. This parameter is followed by an ASCII newline. - * 4. The concatenation of all query string components (names and values) - * as UTF-8 characters which are URL encoded as per RFC 3986 - * (hex characters MUST be uppercase), sorted using lexicographic byte ordering. - * Parameter names are separated from their values by the '=' character - * (ASCII character 61), even if the value is empty. - * Pairs of parameter and values are separated by the '&' character (ASCII code 38). - * - */ - - private function signParameters(array $parameters) - { - $signatureVersion = $parameters['SignatureVersion']; - $algorithm = "HmacSHA1"; - $stringToSign = null; - if (2 === $signatureVersion) { - $algorithm = "HmacSHA256"; - $parameters['SignatureMethod'] = $algorithm; - $stringToSign = $this->calculateStringToSignV2($parameters); - } else { - throw new \Exception("Invalid Signature Version specified"); - } - - return $this->sign($stringToSign, $algorithm); - } - - /* Calculate String to Sign for SignatureVersion 2 - * @param array $parameters request parameters - * @return String to Sign - */ - - private function calculateStringToSignV2(array $parameters) - { - $data = 'POST'; - $data .= "\n"; - $data .= $this->mwsEndpointUrl; - $data .= "\n"; - $data .= $this->mwsEndpointPath; - $data .= "\n"; - $data .= $this->getParametersAsString($parameters); - return $data; - } - - /* Convert paremeters to Url encoded query string */ - - private function getParametersAsString(array $parameters) - { - $queryParameters = array(); - foreach ($parameters as $key => $value) { - $queryParameters[] = $key . '=' . $this->urlEncode($value); - } - - return implode('&', $queryParameters); - } - - private function urlEncode($value) - { - return str_replace('%7E', '~', rawurlencode($value)); - } - - /* Computes RFC 2104-compliant HMAC signature */ - - private function sign($data, $algorithm) - { - if ($algorithm === 'HmacSHA1') { - $hash = 'sha1'; - } else if ($algorithm === 'HmacSHA256') { - $hash = 'sha256'; - } else { - throw new \Exception("Non-supported signing method specified"); - } - - return base64_encode(hash_hmac($hash, $data, $this->config['secret_key'], true)); - } - - /* Formats date as ISO 8601 timestamp */ - - private function getFormattedTimestamp() - { - return gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time()); - } - - /* invokePost takes the parameters and invokes the httpPost function to POST the parameters - * Exponential retries on error 500 and 503 - * The response from the POST is an XML which is converted to Array - */ - - private function invokePost($parameters) - { - $response = array(); - $statusCode = 200; - $this->success = false; - - // Submit the request and read response body - try { - $shouldRetry = true; - $retries = 0; - do { - try { - $this->constructUserAgentHeader(); - - $httpCurlRequest = new HttpCurl($this->config); - $response = $httpCurlRequest->httpPost($this->mwsServiceUrl, $this->userAgent, $parameters); - - // Split the API response into Response Body and the other parts of the response into other - list($other, $responseBody) = explode("\r\n\r\n", $response, 2); - $other = preg_split("/\r\n|\n|\r/", $other); - - list($protocol, $code, $text) = explode(' ', trim(array_shift($other)), 3); - $response = array( - 'Status' => (int) $code, - 'ResponseBody' => $responseBody - ); - - $statusCode = $response['Status']; - - if ($statusCode == 200) { - $shouldRetry = false; - $this->success = true; - } elseif ($statusCode == 500 || $statusCode == 503) { - - $shouldRetry = true; - if ($shouldRetry && strtolower($this->config['handle_throttle'])) { - $this->pauseOnRetry(++$retries, $statusCode); - } - } else { - $shouldRetry = false; - } - } catch (\Exception $e) { - throw $e; - } - } while ($shouldRetry); - } catch (\Exception $se) { - throw $se; - } - - return $response; - } - - /* Exponential sleep on failed request - * @param retries current retry - * @throws Exception if maximum number of retries has been reached - */ - - private function pauseOnRetry($retries, $status) - { - if ($retries <= self::MAX_ERROR_RETRY) { - $delay = (int) (pow(4, $retries) * 100000); - usleep($delay); - } else { - throw new \Exception('Error Code: '. $status.PHP_EOL.'Maximum number of retry attempts - '. $retries .' reached'); - } - } - - /* Create MWS service URL and the Endpoint path */ - - private function createServiceUrl() - { - $this->modePath = strtolower($this->config['sandbox']) ? 'OffAmazonPayments_Sandbox' : 'OffAmazonPayments'; - - if (!empty($this->config['region'])) { - $region = strtolower($this->config['region']); - if (array_key_exists($region, $this->regionMappings)) { - $this->mwsEndpointUrl = $this->mwsServiceUrls[$this->regionMappings[$region]]; - $this->mwsServiceUrl = 'https://' . $this->mwsEndpointUrl . '/' . $this->modePath . '/' . self::SERVICE_VERSION; - $this->mwsEndpointPath = '/' . $this->modePath . '/' . self::SERVICE_VERSION; - } else { - throw new \Exception($region . ' is not a valid region'); - } - } else { - throw new \Exception("config['region'] is a required parameter and is not set"); - } - } - - /* Based on the config['region'] and config['sandbox'] values get the user profile URL */ - - private function profileEndpointUrl() - { - if (!empty($this->config['region'])) { - $region = strtolower($this->config['region']); - - if (array_key_exists($region, $this->sandboxProfileEndpoint) && $this->config['sandbox'] ) { - $this->profileEndpoint = $this->sandboxProfileEndpoint[$region]; - } elseif (array_key_exists($region, $this->liveProfileEndpoint)) { - $this->profileEndpoint = $this->liveProfileEndpoint[$region]; - } else{ - throw new \Exception($region . ' is not a valid region'); - } - } else { - throw new \Exception("config['region'] is a required parameter and is not set"); - } - } - - /* Create the User Agent Header sent with the POST request */ - - private function constructUserAgentHeader() - { - $this->userAgent = $this->quoteApplicationName($this->config['application_name']) . '/' . $this->quoteApplicationVersion($this->config['application_version']); - $this->userAgent .= ' ('; - $this->userAgent .= 'Language=PHP/' . phpversion(); - $this->userAgent .= '; '; - $this->userAgent .= 'Platform=' . php_uname('s') . '/' . php_uname('m') . '/' . php_uname('r'); - $this->userAgent .= '; '; - $this->userAgent .= 'MWSClientVersion=' . self::MWS_CLIENT_VERSION; - $this->userAgent .= ')'; - } - - /* Collapse multiple whitespace characters into a single ' ' and backslash escape '\', - * and '/' characters from a string. - * @param $s - * @return string - */ - - private function quoteApplicationName($s) - { - $quotedString = preg_replace('/ {2,}|\s/', ' ', $s); - $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString); - $quotedString = preg_replace('/\//', '\\/', $quotedString); - return $quotedString; - } - - /* Collapse multiple whitespace characters into a single ' ' and backslash escape '\', - * and '(' characters from a string. - * - * @param $s - * @return string - */ - - private function quoteApplicationVersion($s) - { - $quotedString = preg_replace('/ {2,}|\s/', ' ', $s); - $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString); - $quotedString = preg_replace('/\\(/', '\\(', $quotedString); - return $quotedString; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/HttpCurl.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/HttpCurl.php deleted file mode 100644 index 937329a0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/HttpCurl.php +++ /dev/null @@ -1,129 +0,0 @@ -config = $config; - } - - /* Setter for boolean header to get the user info */ - - public function setHttpHeader() - { - $this->header = true; - } - - /* Setter for Access token to get the user info */ - - public function setAccessToken($accesstoken) - { - $this->accessToken = $accesstoken; - } - - /* Add the common Curl Parameters to the curl handler $ch - * Also checks for optional parameters if provided in the config - * config['cabundle_file'] - * config['proxy_port'] - * config['proxy_host'] - * config['proxy_username'] - * config['proxy_password'] - */ - - private function commonCurlParams($url,$userAgent) - { - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_PORT, 443); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - if (!is_null($this->config['cabundle_file'])) { - curl_setopt($ch, CURLOPT_CAINFO, $this->config['cabundle_file']); - } - - if (!empty($userAgent)) - curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); - - if ($this->config['proxy_host'] != null && $this->config['proxy_port'] != -1) { - curl_setopt($ch, CURLOPT_PROXY, $this->config['proxy_host'] . ':' . $this->config['proxy_port']); - } - - if ($this->config['proxy_username'] != null && $this->config['proxy_password'] != null) { - curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->config['proxy_username'] . ':' . $this->config['proxy_password']); - } - - return $ch; - } - - /* POST using curl for the following situations - * 1. API calls - * 2. IPN certificate retrieval - * 3. Get User Info - */ - - public function httpPost($url, $userAgent = null, $parameters = null) - { - $ch = $this->commonCurlParams($url,$userAgent); - - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); - curl_setopt($ch, CURLOPT_HEADER, true); - - $response = $this->execute($ch); - return $response; - } - - /* GET using curl for the following situations - * 1. IPN certificate retrieval - * 2. Get User Info - */ - - public function httpGet($url, $userAgent = null) - { - $ch = $this->commonCurlParams($url,$userAgent); - - // Setting the HTTP header with the Access Token only for Getting user info - if ($this->header) { - curl_setopt($ch, CURLOPT_HTTPHEADER, array( - 'Authorization: bearer ' . $this->accessToken - )); - } - - $response = $this->execute($ch); - return $response; - } - - /* Execute Curl request */ - - private function execute($ch) - { - $response = ''; - if (!$response = curl_exec($ch)) { - $error_msg = "Unable to post request, underlying exception of " . curl_error($ch); - curl_close($ch); - throw new \Exception($error_msg); - } - curl_close($ch); - return $response; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/Interface.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/Interface.php deleted file mode 100644 index 65a6bd63..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/Interface.php +++ /dev/null @@ -1,482 +0,0 @@ -_response [XML] - */ - - public function toArray(); - - /* Get the status of the BillingAgreement */ - - public function getBillingAgreementDetailsStatus($response); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/IpnHandler.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/IpnHandler.php deleted file mode 100644 index 7de7f5c7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/IpnHandler.php +++ /dev/null @@ -1,421 +0,0 @@ - null, - 'proxy_host' => null, - 'proxy_port' => -1, - 'proxy_username' => null, - 'proxy_password' => null); - - - public function __construct($headers, $body, $ipnConfig = null) - { - $this->headers = array_change_key_case($headers, CASE_LOWER); - $this->body = $body; - - if ($ipnConfig != null) { - $this->checkConfigKeys($ipnConfig); - } - - // Get the list of fields that we are interested in - $this->fields = array( - "Timestamp" => true, - "Message" => true, - "MessageId" => true, - "Subject" => false, - "TopicArn" => true, - "Type" => true - ); - - // Validate the IPN message header [x-amz-sns-message-type] - $this->validateHeaders(); - - // Converts the IPN [Message] to Notification object - $this->getMessage(); - - // Checks if the notification [Type] is Notification and constructs the signature fields - $this->checkForCorrectMessageType(); - - // Verifies the signature against the provided pem file in the IPN - $this->constructAndVerifySignature(); - } - - private function checkConfigKeys($ipnConfig) - { - $ipnConfig = array_change_key_case($ipnConfig, CASE_LOWER); - $ipnConfig = trimArray($ipnConfig); - - foreach ($ipnConfig as $key => $value) { - if (array_key_exists($key, $this->ipnConfig)) { - $this->ipnConfig[$key] = $value; - } else { - throw new \Exception('Key ' . $key . ' is either not part of the configuration or has incorrect Key name. - check the ipnConfig array key names to match your key names of your config array ', 1); - } - } - } - - /* Setter function - * Sets the value for the key if the key exists in ipnConfig - */ - - public function __set($name, $value) - { - if (array_key_exists(strtolower($name), $this->ipnConfig)) { - $this->ipnConfig[$name] = $value; - } else { - throw new \Exception("Key " . $name . " is not part of the configuration", 1); - } - } - - /* Getter function - * Returns the value for the key if the key exists in ipnConfig - */ - - public function __get($name) - { - if (array_key_exists(strtolower($name), $this->ipnConfig)) { - return $this->ipnConfig[$name]; - } else { - throw new \Exception("Key " . $name . " was not found in the configuration", 1); - } - } - - /* Trim the input Array key values */ - - private function trimArray($array) - { - foreach ($array as $key => $value) - { - $array[$key] = trim($value); - } - return $array; - } - - private function validateHeaders() - { - // Quickly check that this is a sns message - if (!array_key_exists('x-amz-sns-message-type', $this->headers)) { - throw new \Exception("Error with message - header " . "does not contain x-amz-sns-message-type header"); - } - - if ($this->headers['x-amz-sns-message-type'] !== 'Notification') { - throw new \Exception("Error with message - header x-amz-sns-message-type is not " . "Notification, is " . $this->headers['x-amz-sns-message-type']); - } - } - - private function getMessage() - { - $this->snsMessage = json_decode($this->body, true); - - $json_error = json_last_error(); - - if ($json_error != 0) { - $errorMsg = "Error with message - content is not in json format" . $this->getErrorMessageForJsonError($json_error) . " " . $this->snsMessage; - throw new \Exception($errorMsg); - } - } - - /* Convert a json error code to a descriptive error message - * - * @param int $json_error message code - * - * @return string error message - */ - - private function getErrorMessageForJsonError($json_error) - { - switch ($json_error) { - case JSON_ERROR_DEPTH: - return " - maximum stack depth exceeded."; - break; - case JSON_ERROR_STATE_MISMATCH: - return " - invalid or malformed JSON."; - break; - case JSON_ERROR_CTRL_CHAR: - return " - control character error."; - break; - case JSON_ERROR_SYNTAX: - return " - syntax error."; - break; - default: - return "."; - break; - } - } - - /* checkForCorrectMessageType() - * - * Checks if the Field [Type] is set to ['Notification'] - * Gets the value for the fields marked true in the fields array - * Constructs the signature string - */ - - private function checkForCorrectMessageType() - { - $type = $this->getMandatoryField("Type"); - if (strcasecmp($type, "Notification") != 0) { - throw new \Exception("Error with SNS Notification - unexpected message with Type of " . $type); - } - - if (strcmp($this->getMandatoryField("Type"), "Notification") != 0) { - throw new \Exception("Error with signature verification - unable to verify " . $this->getMandatoryField("Type") . " message"); - } else { - - // Sort the fields into byte order based on the key name(A-Za-z) - ksort($this->fields); - - // Extract the key value pairs and sort in byte order - $signatureFields = array(); - foreach ($this->fields as $fieldName => $mandatoryField) { - if ($mandatoryField) { - $value = $this->getMandatoryField($fieldName); - } else { - $value = $this->getField($fieldName); - } - - if (!is_null($value)) { - array_push($signatureFields, $fieldName); - array_push($signatureFields, $value); - } - } - - /* Create the signature string - key / value in byte order - * delimited by newline character + ending with a new line character - */ - $this->signatureFields = implode("\n", $signatureFields) . "\n"; - - } - } - - /* Verify that the signature is correct for the given data and - * public key - * - * @param string $data data to validate - * @param string $signature decoded signature to compare against - * @param string $certificatePath path to certificate, can be file or url - * - * @throws Exception if there is an error with the call - * - * @return bool true if valid - */ - - private function constructAndVerifySignature() - { - $signature = base64_decode($this->getMandatoryField("Signature")); - $certificatePath = $this->getMandatoryField("SigningCertURL"); - - $this->certificate = $this->getCertificate($certificatePath); - - $result = $this->verifySignatureIsCorrectFromCertificate($signature); - if (!$result) { - throw new \Exception("Unable to match signature from remote server: signature of " . $this->getCertificate($certificatePath) . " , SigningCertURL of " . $this->getMandatoryField("SigningCertURL") . " , SignatureOf " . $this->getMandatoryField("Signature")); - } - } - - /* getCertificate($certificatePath) - * - * gets the certificate from the $certificatePath using Curl - */ - - private function getCertificate($certificatePath) - { - $httpCurlRequest = new HttpCurl($this->ipnConfig); - - $response = $httpCurlRequest->httpGet($certificatePath); - - return $response; - } - - /* Verify that the signature is correct for the given data and public key - * - * @param string $data data to validate - * @param string $signature decoded signature to compare against - * @param string $certificate certificate object defined in Certificate.php - */ - - public function verifySignatureIsCorrectFromCertificate($signature) - { - $certKey = openssl_get_publickey($this->certificate); - - if ($certKey === False) { - throw new \Exception("Unable to extract public key from cert"); - } - - try { - $certInfo = openssl_x509_parse($this->certificate, true); - $certSubject = $certInfo["subject"]; - - if (is_null($certSubject)) { - throw new \Exception("Error with certificate - subject cannot be found"); - } - } catch (\Exception $ex) { - throw new \Exception("Unable to verify certificate - error with the certificate subject", null, $ex); - } - - if (strcmp($certSubject["CN"], $this->expectedCnName)) { - throw new \Exception("Unable to verify certificate issued by Amazon - error with certificate subject"); - } - - $result = -1; - try { - $result = openssl_verify($this->signatureFields, $signature, $certKey, OPENSSL_ALGO_SHA1); - } catch (\Exception $ex) { - throw new \Exception("Unable to verify signature - error with the verification algorithm", null, $ex); - } - - return ($result > 0); - } - - - /* Extract the mandatory field from the message and return the contents - * - * @param string $fieldName name of the field to extract - * - * @throws Exception if not found - * - * @return string field contents if found - */ - - private function getMandatoryField($fieldName) - { - $value = $this->getField($fieldName); - if (is_null($value)) { - throw new \Exception("Error with json message - mandatory field " . $fieldName . " cannot be found"); - } - return $value; - } - - /* Extract the field if present, return null if not defined - * - * @param string $fieldName name of the field to extract - * - * @return string field contents if found, null otherwise - */ - - private function getField($fieldName) - { - if (array_key_exists($fieldName, $this->snsMessage)) { - return $this->snsMessage[$fieldName]; - } else { - return null; - } - } - - /* returnMessage() - JSON decode the raw [Message] portion of the IPN */ - - public function returnMessage() - { - return json_decode($this->snsMessage['Message'], true); - } - - /* toJson() - Converts IPN [Message] field to JSON - * - * Has child elements - * ['NotificationData'] [XML] - API call XML notification data - * @param remainingFields - consists of remaining IPN array fields that are merged - * Type - Notification - * MessageId - ID of the Notification - * Topic ARN - Topic of the IPN - * @return response in JSON format - */ - - public function toJson() - { - $response = $this->simpleXmlObject(); - - // Merging the remaining fields with the response - $remainingFields = $this->getRemainingIpnFields(); - $responseArray = array_merge($remainingFields,(array)$response); - - // Converting to JSON format - $response = json_encode($responseArray); - - return $response; - } - - /* toArray() - Converts IPN [Message] field to associative array - * @return response in array format - */ - - public function toArray() - { - $response = $this->simpleXmlObject(); - - // Converting the SimpleXMLElement Object to array() - $response = json_encode($response); - $response = json_decode($response, true); - - // Merging the remaining fields with the response array - $remainingFields = $this->getRemainingIpnFields(); - $response = array_merge($remainingFields,$response); - - return $response; - } - - /* addRemainingFields() - Add remaining fields to the datatype - * - * Has child elements - * ['NotificationData'] [XML] - API call XML response data - * Convert to SimpleXML element object - * Type - Notification - * MessageId - ID of the Notification - * Topic ARN - Topic of the IPN - * @return response in array format - */ - - private function simpleXmlObject() - { - $ipnMessage = $this->returnMessage(); - - // Getting the Simple XML element object of the IPN XML Response Body - $response = simplexml_load_string((string) $ipnMessage['NotificationData']); - - // Adding the Type, MessageId, TopicArn details of the IPN to the Simple XML element Object - $response->addChild('Type', $this->snsMessage['Type']); - $response->addChild('MessageId', $this->snsMessage['MessageId']); - $response->addChild('TopicArn', $this->snsMessage['TopicArn']); - - return $response; - } - - /* getRemainingIpnFields() - * Gets the remaining fields of the IPN to be later appended to the return message - */ - - private function getRemainingIpnFields() - { - $ipnMessage = $this->returnMessage(); - - $remainingFields = array( - 'NotificationReferenceId' =>$ipnMessage['NotificationReferenceId'], - 'NotificationType' =>$ipnMessage['NotificationType'], - 'IsSample' =>$ipnMessage['IsSample'], - 'SellerId' =>$ipnMessage['SellerId'], - 'ReleaseEnvironment' =>$ipnMessage['ReleaseEnvironment'], - 'Version' =>$ipnMessage['Version']); - - return $remainingFields; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/ResponseParser.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/ResponseParser.php deleted file mode 100644 index 92a2e15a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/libs/amazon/ResponseParser.php +++ /dev/null @@ -1,86 +0,0 @@ -response = $response; - } - - /* Returns the XML portion of the response */ - - public function toXml() - { - return $this->response['ResponseBody']; - } - - /* toJson - converts XML into Json - * @param $response [XML] - */ - - public function toJson() - { - $response = $this->simpleXmlObject(); - - return (json_encode($response)); - } - - /* toArray - converts XML into associative array - * @param $this->response [XML] - */ - - public function toArray() - { - $response = $this->simpleXmlObject(); - - // Converting the SimpleXMLElement Object to array() - $response = json_encode($response); - - return (json_decode($response, true)); - } - - private function simpleXmlObject() - { - $response = $this->response; - - // Getting the HttpResponse Status code to the output as a string - $status = strval($response['Status']); - - // Getting the Simple XML element object of the XML Response Body - $response = simplexml_load_string((string) $response['ResponseBody']); - - // Adding the HttpResponse Status code to the output as a string - $response->addChild('ResponseStatus', $status); - - return $response; - } - - /* Get the status of the BillingAgreement */ - - public function getBillingAgreementDetailsStatus($response) - { - $data= new \SimpleXMLElement($response); - $namespaces = $data->getNamespaces(true); - foreach($namespaces as $key=>$value){ - $namespace = $value; - } - $data->registerXPathNamespace('GetBA', $namespace); - foreach ($data->xpath('//GetBA:BillingAgreementStatus') as $value) { - $baStatus = json_decode(json_encode((array)$value), TRUE); - } - - return $baStatus ; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/manual.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/manual.php deleted file mode 100644 index fcaa023e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/manual.php +++ /dev/null @@ -1,78 +0,0 @@ - 403 ) ); - } - - /* - * Purchase data comes in like this - * - $purchase_data = array( - 'downloads' => array of download IDs, - 'price' => total price of cart contents, - 'purchase_key' => // Random key - 'user_email' => $user_email, - 'date' => date('Y-m-d H:i:s'), - 'user_id' => $user_id, - 'post_data' => $_POST, - 'user_info' => array of user's information and used discount code - 'cart_details' => array of cart details, - ); - */ - - $payment_data = array( - 'price' => $purchase_data['price'], - 'date' => $purchase_data['date'], - 'user_email' => $purchase_data['user_email'], - 'purchase_key' => $purchase_data['purchase_key'], - 'currency' => edd_get_currency(), - 'downloads' => $purchase_data['downloads'], - 'user_info' => $purchase_data['user_info'], - 'cart_details' => $purchase_data['cart_details'], - 'status' => 'pending', - ); - - // Record the pending payment - $payment = edd_insert_payment( $payment_data ); - - if ( $payment ) { - edd_update_payment_status( $payment, 'complete' ); - // Empty the shopping cart - edd_empty_cart(); - edd_send_to_success_page(); - } else { - edd_record_gateway_error( __( 'Payment Error', 'easy-digital-downloads' ), sprintf( __( 'Payment creation failed while processing a manual (free or test) purchase. Payment data: %s', 'easy-digital-downloads' ), json_encode( $payment_data ) ), $payment ); - // If errors are present, send the user back to the purchase page so they can be corrected - edd_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['edd-gateway'] ); - } -} -add_action( 'edd_gateway_manual', 'edd_manual_payment' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal-standard.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal-standard.php deleted file mode 100644 index aefe248b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal-standard.php +++ /dev/null @@ -1,1380 +0,0 @@ - array( - 'id' => 'paypal_email', - 'name' => __( 'PayPal Email', 'easy-digital-downloads' ), - 'desc' => __( 'Enter your PayPal account\'s email', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - ), - 'paypal_image_url' => array( - 'id' => 'paypal_image_url', - 'name' => __( 'PayPal Image', 'easy-digital-downloads' ), - 'desc' => __( 'Upload an image to display on the PayPal checkout page.', 'easy-digital-downloads' ), - 'type' => 'upload', - 'size' => 'regular', - ), - ); - - $pdt_desc = sprintf( - __( 'Enter your PayPal Identity Token in order to enable Payment Data Transfer (PDT). This allows payments to be verified without relying on the PayPal IPN. See our documentation for further information.', 'easy-digital-downloads' ), - 'https://easydigitaldownloads.com/docs/paypal-legacy-gateways-standard-express-pro-advanced/' - ); - - $paypal_settings['paypal_identify_token'] = array( - 'id' => 'paypal_identity_token', - 'name' => __( 'PayPal Identity Token', 'easy-digital-downloads' ), - 'type' => 'text', - 'desc' => $pdt_desc, - 'size' => 'regular', - ); - - $desc = sprintf( - __( 'If you are unable to use Payment Data Transfer and payments are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying purchases. See our FAQ for further information.', 'easy-digital-downloads' ), - 'https://easydigitaldownloads.com/docs/paypal-payments-not-marked-as-complete/' - ); - - $paypal_settings['disable_paypal_verification'] = array( - 'id' => 'disable_paypal_verification', - 'name' => __( 'Disable PayPal IPN Verification', 'easy-digital-downloads' ), - 'check' => __( 'Disabled', 'easy-digital-downloads' ), - 'desc' => $desc, - 'type' => 'checkbox_description', - ); - - $api_key_settings = array( - 'paypal_api_keys_desc' => array( - 'id' => 'paypal_api_keys_desc', - 'name' => __( 'API Credentials', 'easy-digital-downloads' ), - 'type' => 'descriptive_text', - 'desc' => sprintf( - __( 'API credentials are necessary to process PayPal refunds from inside WordPress. These can be obtained from your PayPal account.', 'easy-digital-downloads' ), - 'https://developer.paypal.com/docs/classic/api/apiCredentials/#creating-an-api-signature' - ) - ), - 'paypal_live_api_username' => array( - 'id' => 'paypal_live_api_username', - 'name' => __( 'Live API Username', 'easy-digital-downloads' ), - 'desc' => __( 'Your PayPal live API username. ', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular' - ), - 'paypal_live_api_password' => array( - 'id' => 'paypal_live_api_password', - 'name' => __( 'Live API Password', 'easy-digital-downloads' ), - 'desc' => __( 'Your PayPal live API password.', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular' - ), - 'paypal_live_api_signature' => array( - 'id' => 'paypal_live_api_signature', - 'name' => __( 'Live API Signature', 'easy-digital-downloads' ), - 'desc' => __( 'Your PayPal live API signature.', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular' - ), - 'paypal_test_api_username' => array( - 'id' => 'paypal_test_api_username', - 'name' => __( 'Test API Username', 'easy-digital-downloads' ), - 'desc' => __( 'Your PayPal test API username.', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular' - ), - 'paypal_test_api_password' => array( - 'id' => 'paypal_test_api_password', - 'name' => __( 'Test API Password', 'easy-digital-downloads' ), - 'desc' => __( 'Your PayPal test API password.', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular' - ), - 'paypal_test_api_signature' => array( - 'id' => 'paypal_test_api_signature', - 'name' => __( 'Test API Signature', 'easy-digital-downloads' ), - 'desc' => __( 'Your PayPal test API signature.', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular' - ) - ); - - $paypal_settings = array_merge( $paypal_settings, $api_key_settings ); - - $paypal_settings = apply_filters( 'edd_paypal_settings', $paypal_settings ); - $gateway_settings['paypal'] = $paypal_settings; - - return $gateway_settings; -} -add_filter( 'edd_settings_gateways', 'edd_register_paypal_gateway_settings', 1, 1 ); - -/** - * Process PayPal Purchase - * - * @since 1.0 - * @param array $purchase_data Purchase Data - * @return void - */ -function edd_process_paypal_purchase( $purchase_data ) { - if ( ! wp_verify_nonce( $purchase_data['gateway_nonce'], 'edd-gateway' ) ) { - wp_die( __( 'Nonce verification has failed', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - // Collect payment data - $payment_data = array( - 'price' => $purchase_data['price'], - 'date' => $purchase_data['date'], - 'user_email' => $purchase_data['user_email'], - 'purchase_key' => $purchase_data['purchase_key'], - 'currency' => edd_get_currency(), - 'downloads' => $purchase_data['downloads'], - 'user_info' => $purchase_data['user_info'], - 'cart_details' => $purchase_data['cart_details'], - 'gateway' => 'paypal', - 'status' => ! empty( $purchase_data['buy_now'] ) ? 'private' : 'pending' - ); - - // Record the pending payment - $payment = edd_insert_payment( $payment_data ); - - // Check payment - if ( ! $payment ) { - // Record the error - edd_record_gateway_error( __( 'Payment Error', 'easy-digital-downloads' ), sprintf( __( 'Payment creation failed before sending buyer to PayPal. Payment data: %s', 'easy-digital-downloads' ), json_encode( $payment_data ) ), $payment ); - // Problems? send back - edd_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['edd-gateway'] ); - } else { - // Only send to PayPal if the pending payment is created successfully - $listener_url = add_query_arg( 'edd-listener', 'IPN', home_url( 'index.php' ) ); - - // Set the session data to recover this payment in the event of abandonment or error. - EDD()->session->set( 'edd_resume_payment', $payment ); - - // Get the success url - $return_url = add_query_arg( - array( - 'payment-confirmation' => 'paypal', - 'payment-id' => urlencode( $payment ), - ), - get_permalink( edd_get_option( 'success_page', false ) ) - ); - - // Get the PayPal redirect uri - $paypal_redirect = trailingslashit( edd_get_paypal_redirect() ) . '?'; - - // Setup PayPal arguments - $paypal_args = array( - 'business' => edd_get_option( 'paypal_email', false ), - 'email' => $purchase_data['user_email'], - 'first_name' => $purchase_data['user_info']['first_name'], - 'last_name' => $purchase_data['user_info']['last_name'], - 'invoice' => $purchase_data['purchase_key'], - 'no_shipping' => '1', - 'shipping' => '0', - 'no_note' => '1', - 'currency_code' => edd_get_currency(), - 'charset' => get_bloginfo( 'charset' ), - 'custom' => $payment, - 'rm' => '2', - 'return' => esc_url_raw( $return_url ), - 'cancel_return' => esc_url_raw( edd_get_failed_transaction_uri( '?payment-id=' . sanitize_key( $payment ) ) ), - 'notify_url' => esc_url_raw( $listener_url ), - 'image_url' => esc_url_raw( edd_get_paypal_image_url() ), - 'cbt' => get_bloginfo( 'name' ), - 'bn' => 'EasyDigitalDownloads_SP' - ); - - if ( ! empty( $purchase_data['user_info']['address'] ) ) { - $paypal_args['address1'] = $purchase_data['user_info']['address']['line1']; - $paypal_args['address2'] = $purchase_data['user_info']['address']['line2']; - $paypal_args['city'] = $purchase_data['user_info']['address']['city']; - $paypal_args['country'] = $purchase_data['user_info']['address']['country']; - } - - $paypal_extra_args = array( - 'cmd' => '_cart', - 'upload' => '1' - ); - - $paypal_args = array_merge( $paypal_extra_args, $paypal_args ); - - // Add cart items - $i = 1; - $paypal_sum = 0; - if ( is_array( $purchase_data['cart_details'] ) && ! empty( $purchase_data['cart_details'] ) ) { - foreach ( $purchase_data['cart_details'] as $item ) { - - $item_amount = round( ( $item['subtotal'] / $item['quantity'] ) - ( $item['discount'] / $item['quantity'] ), 2 ); - - if ( $item_amount <= 0 ) { - $item_amount = 0; - } - - $paypal_args['item_name_' . $i ] = stripslashes_deep( html_entity_decode( edd_get_cart_item_name( $item ), ENT_COMPAT, 'UTF-8' ) ); - $paypal_args['quantity_' . $i ] = $item['quantity']; - $paypal_args['amount_' . $i ] = $item_amount; - - if ( edd_use_skus() ) { - $paypal_args['item_number_' . $i ] = edd_get_download_sku( $item['id'] ); - } - - $paypal_sum += ( $item_amount * $item['quantity'] ); - - $i++; - - } - } - - // Calculate discount - $discounted_amount = 0.00; - if ( ! empty( $purchase_data['fees'] ) ) { - $i = empty( $i ) ? 1 : $i; - foreach ( $purchase_data['fees'] as $fee ) { - if ( empty( $fee['download_id'] ) && floatval( $fee['amount'] ) > '0' ) { - // this is a positive fee - $paypal_args['item_name_' . $i ] = stripslashes_deep( html_entity_decode( wp_strip_all_tags( $fee['label'] ), ENT_COMPAT, 'UTF-8' ) ); - $paypal_args['quantity_' . $i ] = '1'; - $paypal_args['amount_' . $i ] = edd_sanitize_amount( $fee['amount'] ); - $i++; - } else if ( empty( $fee['download_id'] ) ) { - - // This is a negative fee (discount) not assigned to a specific Download - $discounted_amount += abs( $fee['amount'] ); - } - } - } - - $price_before_discount = $purchase_data['price']; - if ( $discounted_amount > '0' ) { - $paypal_args['discount_amount_cart'] = edd_sanitize_amount( $discounted_amount ); - - /* - * Add the discounted amount back onto the price to get the "price before discount". We do this - * to avoid double applying any discounts below. - * @link https://github.com/easydigitaldownloads/easy-digital-downloads/issues/6837 - */ - $price_before_discount += $paypal_args['discount_amount_cart']; - } - - // Check if there are any additional discounts we need to add that we haven't already accounted for. - if( $paypal_sum > $price_before_discount ) { - $difference = round( $paypal_sum - $price_before_discount, 2 ); - if ( ! isset( $paypal_args['discount_amount_cart'] ) ) { - $paypal_args['discount_amount_cart'] = 0; - } - $paypal_args['discount_amount_cart'] += $difference; - } - - // Add taxes to the cart - if ( edd_use_taxes() ) { - - $paypal_args['tax_cart'] = edd_sanitize_amount( $purchase_data['tax'] ); - - } - - $paypal_args = apply_filters( 'edd_paypal_redirect_args', $paypal_args, $purchase_data ); - - edd_debug_log( 'PayPal arguments: ' . print_r( $paypal_args, true ) ); - - // Build query - $paypal_redirect .= http_build_query( $paypal_args ); - - // Fix for some sites that encode the entities - $paypal_redirect = str_replace( '&', '&', $paypal_redirect ); - - // Allow paypal as a redirect destination. - add_filter( 'allowed_redirect_hosts', 'edd_allow_redirect_to_paypal', 10 ); - - // Redirect to PayPal. - edd_redirect( $paypal_redirect ); - } -} -add_action( 'edd_gateway_paypal', 'edd_process_paypal_purchase' ); - -/** - * Add paypal.com to the list of allowed hosts that wp_safe_redirect can redirect to. - * - * @since 3.0 - * @param array $redirects - The list of urls that wp_safe_redirect can redirect to. - * @return array - */ -function edd_allow_redirect_to_paypal( $redirects ) { - $redirects[] = 'www.sandbox.paypal.com'; - $redirects[] = 'sandbox.paypal.com'; - $redirects[] = 'www.paypal.com'; - $redirects[] = 'paypal.com'; - return $redirects; -} - -/** - * Listens for a PayPal IPN requests and then sends to the processing function - * - * @since 1.0 - * @return void - */ -function edd_listen_for_paypal_ipn() { - // Regular PayPal IPN - if ( isset( $_GET['edd-listener'] ) && 'ipn' === strtolower( $_GET['edd-listener'] ) ) { - - edd_debug_log( 'PayPal IPN endpoint loaded' ); - - /** - * This is necessary to delay execution of PayPal PDT and to avoid a race condition causing the order status - * updates to be triggered twice. - * - * @since 2.9.4 - * @see https://github.com/easydigitaldownloads/easy-digital-downloads/issues/6605 - */ - $token = edd_get_option( 'paypal_identity_token' ); - if ( $token ) { - sleep( 5 ); - } - - do_action( 'edd_verify_paypal_ipn' ); - } -} -add_action( 'init', 'edd_listen_for_paypal_ipn' ); - -/** - * Process PayPal IPN - * - * @since 1.0 - * @return void - */ -function edd_process_paypal_ipn() { - // Check the request method is POST - if ( isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD'] != 'POST' ) { - return; - } - - edd_debug_log( 'edd_process_paypal_ipn() running during PayPal IPN processing' ); - - // Set initial post data to empty string - $post_data = ''; - - // Fallback just in case post_max_size is lower than needed - if ( ini_get( 'allow_url_fopen' ) ) { - $post_data = file_get_contents( 'php://input' ); - } else { - // If allow_url_fopen is not enabled, then make sure that post_max_size is large enough - ini_set( 'post_max_size', '12M' ); - } - // Start the encoded data collection with notification command - $encoded_data = 'cmd=_notify-validate'; - - // Get current arg separator - $arg_separator = edd_get_php_arg_separator_output(); - - // Verify there is a post_data - if ( $post_data || strlen( $post_data ) > 0 ) { - // Append the data - $encoded_data .= $arg_separator . $post_data; - } else { - // Check if POST is empty - if ( empty( $_POST ) ) { - // Nothing to do - return; - } else { - // Loop through each POST - foreach ( $_POST as $key => $value ) { - // Encode the value and append the data - $encoded_data .= $arg_separator . "$key=" . urlencode( $value ); - } - } - } - - // Convert collected post data to an array - parse_str( $encoded_data, $encoded_data_array ); - - foreach ( $encoded_data_array as $key => $value ) { - - if ( false !== strpos( $key, 'amp;' ) ) { - $new_key = str_replace( '&', '&', $key ); - $new_key = str_replace( 'amp;', '&', $new_key ); - - unset( $encoded_data_array[ $key ] ); - $encoded_data_array[ $new_key ] = $value; - } - - } - - /** - * PayPal Web IPN Verification - * - * Allows filtering the IPN Verification data that PayPal passes back in via IPN with PayPal Standard - * - * @since 2.8.13 - * - * @param array $data The PayPal Web Accept Data - */ - $encoded_data_array = apply_filters( 'edd_process_paypal_ipn_data', $encoded_data_array ); - - edd_debug_log( 'encoded_data_array data array: ' . print_r( $encoded_data_array, true ) ); - - if ( ! edd_get_option( 'disable_paypal_verification' ) ) { - - // Validate the IPN - - $remote_post_vars = array( - 'method' => 'POST', - 'timeout' => 45, - 'redirection' => 5, - 'httpversion' => '1.1', - 'blocking' => true, - 'headers' => array( - 'host' => 'www.paypal.com', - 'connection' => 'close', - 'content-type' => 'application/x-www-form-urlencoded', - 'post' => '/cgi-bin/webscr HTTP/1.1', - 'user-agent' => 'EDD IPN Verification/' . EDD_VERSION . '; ' . get_bloginfo( 'url' ) - - ), - 'sslverify' => false, - 'body' => $encoded_data_array - ); - - edd_debug_log( 'Attempting to verify PayPal IPN. Data sent for verification: ' . print_r( $remote_post_vars, true ) ); - - // Get response - $api_response = wp_remote_post( edd_get_paypal_redirect( true, true ), $remote_post_vars ); - - if ( is_wp_error( $api_response ) ) { - edd_record_gateway_error( __( 'IPN Error', 'easy-digital-downloads' ), sprintf( __( 'Invalid IPN verification response. IPN data: %s', 'easy-digital-downloads' ), json_encode( $api_response ) ) ); - edd_debug_log( 'Invalid IPN verification response. IPN data: ' . print_r( $api_response, true ) ); - - return; // Something went wrong - } - - if ( wp_remote_retrieve_body( $api_response ) !== 'VERIFIED' && edd_get_option( 'disable_paypal_verification', false ) ) { - edd_record_gateway_error( __( 'IPN Error', 'easy-digital-downloads' ), sprintf( __( 'Invalid IPN verification response. IPN data: %s', 'easy-digital-downloads' ), json_encode( $api_response ) ) ); - edd_debug_log( 'Invalid IPN verification response. IPN data: ' . print_r( $api_response, true ) ); - - return; // Response not okay - } - - edd_debug_log( 'IPN verified successfully' ); - } - - // Check if $post_data_array has been populated - if ( ! is_array( $encoded_data_array ) && ! empty( $encoded_data_array ) ) { - return; - } - - $defaults = array( - 'txn_type' => '', - 'payment_status' => '' - ); - - $encoded_data_array = wp_parse_args( $encoded_data_array, $defaults ); - - $payment_id = 0; - - if ( ! empty( $encoded_data_array[ 'parent_txn_id' ] ) ) { - $payment_id = edd_get_purchase_id_by_transaction_id( $encoded_data_array[ 'parent_txn_id' ] ); - } elseif ( ! empty( $encoded_data_array[ 'txn_id' ] ) ) { - $payment_id = edd_get_purchase_id_by_transaction_id( $encoded_data_array[ 'txn_id' ] ); - } - - if ( empty( $payment_id ) ) { - $payment_id = ! empty( $encoded_data_array[ 'custom' ] ) ? absint( $encoded_data_array[ 'custom' ] ) : 0; - } - - if ( has_action( 'edd_paypal_' . $encoded_data_array['txn_type'] ) ) { - // Allow PayPal IPN types to be processed separately - do_action( 'edd_paypal_' . $encoded_data_array['txn_type'], $encoded_data_array, $payment_id ); - } else { - // Fallback to web accept just in case the txn_type isn't present - do_action( 'edd_paypal_web_accept', $encoded_data_array, $payment_id ); - } - exit; -} -add_action( 'edd_verify_paypal_ipn', 'edd_process_paypal_ipn' ); - -/** - * Process web accept (one time) payment IPNs - * - * @since 1.3.4 - * @param array $data IPN Data - * @param int $payment_id Payment ID - * @return void - */ -function edd_process_paypal_web_accept_and_cart( $data, $payment_id ) { - - /** - * PayPal Web Accept Data - * - * Allows filtering the Web Accept data that PayPal passes back in via IPN with PayPal Standard - * - * @since 2.8.13 - * - * @param array $data The PayPal Web Accept Data - * @param int $payment_id The Payment ID associated with this IPN request - */ - $data = apply_filters( 'edd_paypal_web_accept_and_cart_data', $data, $payment_id ); - - if ( $data['txn_type'] != 'web_accept' && $data['txn_type'] != 'cart' && $data['payment_status'] != 'Refunded' ) { - return; - } - - if ( empty( $payment_id ) ) { - return; - } - - $payment = new EDD_Payment( $payment_id ); - - // Collect payment details - $purchase_key = isset( $data['invoice'] ) ? $data['invoice'] : false; - if ( ! $purchase_key && ! empty( $data['item_number'] ) ) { - $purchase_key = $data['item_number']; - } - $paypal_amount = $data['mc_gross']; - $payment_status = strtolower( $data['payment_status'] ); - $currency_code = strtolower( $data['mc_currency'] ); - $business_email = isset( $data['business'] ) && is_email( $data['business'] ) ? trim( $data['business'] ) : trim( $data['receiver_email'] ); - - - if ( $payment->gateway != 'paypal' ) { - return; // this isn't a PayPal standard IPN - } - - // Verify payment recipient - if ( strcasecmp( $business_email, trim( edd_get_option( 'paypal_email', false ) ) ) != 0 ) { - edd_record_gateway_error( __( 'IPN Error', 'easy-digital-downloads' ), sprintf( __( 'Invalid business email in IPN response. IPN data: %s', 'easy-digital-downloads' ), json_encode( $data ) ), $payment_id ); - edd_debug_log( 'Invalid business email in IPN response. IPN data: ' . print_r( $data, true ) ); - edd_update_payment_status( $payment_id, 'failed' ); - edd_insert_payment_note( $payment_id, __( 'Payment failed due to invalid PayPal business email.', 'easy-digital-downloads' ) ); - return; - } - - // Verify payment currency - if ( $currency_code != strtolower( $payment->currency ) ) { - - edd_record_gateway_error( __( 'IPN Error', 'easy-digital-downloads' ), sprintf( __( 'Invalid currency in IPN response. IPN data: %s', 'easy-digital-downloads' ), json_encode( $data ) ), $payment_id ); - edd_debug_log( 'Invalid currency in IPN response. IPN data: ' . print_r( $data, true ) ); - edd_update_payment_status( $payment_id, 'failed' ); - edd_insert_payment_note( $payment_id, __( 'Payment failed due to invalid currency in PayPal IPN.', 'easy-digital-downloads' ) ); - return; - } - - if ( empty( $payment->email ) ) { - - // This runs when a Buy Now purchase was made. It bypasses checkout so no personal info is collected until PayPal - - // Setup and store the customers's details - $address = array(); - $address['line1'] = ! empty( $data['address_street'] ) ? sanitize_text_field( $data['address_street'] ) : false; - $address['city'] = ! empty( $data['address_city'] ) ? sanitize_text_field( $data['address_city'] ) : false; - $address['state'] = ! empty( $data['address_state'] ) ? sanitize_text_field( $data['address_state'] ) : false; - $address['country'] = ! empty( $data['address_country_code'] ) ? sanitize_text_field( $data['address_country_code'] ) : false; - $address['zip'] = ! empty( $data['address_zip'] ) ? sanitize_text_field( $data['address_zip'] ) : false; - - $payment->email = sanitize_text_field( $data['payer_email'] ); - $payment->first_name = sanitize_text_field( $data['first_name'] ); - $payment->last_name = sanitize_text_field( $data['last_name'] ); - $payment->address = $address; - - if ( empty( $payment->customer_id ) ) { - - $customer = new EDD_Customer( $payment->email ); - if ( ! $customer || $customer->id < 1 ) { - - $customer->create( array( - 'email' => $payment->email, - 'name' => $payment->first_name . ' ' . $payment->last_name, - 'user_id' => $payment->user_id - ) ); - - } - - $payment->customer_id = $customer->id; - } - - $payment->save(); - - } - - if( empty( $customer ) ) { - - $customer = new EDD_Customer( $payment->customer_id ); - - } - - // Record the payer email on the EDD_Customer record if it is different than the email entered on checkout - if( ! empty( $data['payer_email'] ) && ! in_array( strtolower( $data['payer_email'] ), array_map( 'strtolower', $customer->emails ) ) ) { - - $customer->add_email( strtolower( $data['payer_email'] ) ); - - } - - if ( $payment_status == 'refunded' || $payment_status == 'reversed' ) { - - // Process a refund - edd_process_paypal_refund( $data, $payment_id ); - - } else { - - if ( edd_get_payment_status( $payment_id ) == 'complete' ) { - return; // Only complete payments once - } - - // Retrieve the total purchase amount (before PayPal) - $payment_amount = edd_get_payment_amount( $payment_id ); - - if ( number_format( (float) $paypal_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) { - // The prices don't match - edd_record_gateway_error( __( 'IPN Error', 'easy-digital-downloads' ), sprintf( __( 'Invalid payment amount in IPN response. IPN data: %s', 'easy-digital-downloads' ), json_encode( $data ) ), $payment_id ); - edd_debug_log( 'Invalid payment amount in IPN response. IPN data: ' . printf( $data, true ) ); - edd_update_payment_status( $payment_id, 'failed' ); - edd_insert_payment_note( $payment_id, __( 'Payment failed due to invalid amount in PayPal IPN.', 'easy-digital-downloads' ) ); - return; - } - if ( $purchase_key != edd_get_payment_key( $payment_id ) ) { - // Purchase keys don't match - edd_debug_log( 'Invalid purchase key in IPN response. IPN data: ' . printf( $data, true ) ); - edd_record_gateway_error( __( 'IPN Error', 'easy-digital-downloads' ), sprintf( __( 'Invalid purchase key in IPN response. IPN data: %s', 'easy-digital-downloads' ), json_encode( $data ) ), $payment_id ); - edd_update_payment_status( $payment_id, 'failed' ); - edd_insert_payment_note( $payment_id, __( 'Payment failed due to invalid purchase key in PayPal IPN.', 'easy-digital-downloads' ) ); - return; - } - - if ( 'completed' == $payment_status || edd_is_test_mode() ) { - - edd_insert_payment_note( $payment_id, sprintf( __( 'PayPal Transaction ID: %s', 'easy-digital-downloads' ) , $data['txn_id'] ) ); - edd_set_payment_transaction_id( $payment_id, $data['txn_id'], number_format( (float) $paypal_amount, 2 ) ); - edd_update_payment_status( $payment_id, 'complete' ); - - } else if ( 'pending' == $payment_status && isset( $data['pending_reason'] ) ) { - - // Look for possible pending reasons, such as an echeck - - $note = ''; - - switch( strtolower( $data['pending_reason'] ) ) { - - case 'echeck' : - - $note = __( 'Payment made via eCheck and will clear automatically in 5-8 days', 'easy-digital-downloads' ); - $payment->status = 'processing'; - $payment->save(); - break; - - case 'address' : - - $note = __( 'Payment requires a confirmed customer address and must be accepted manually through PayPal', 'easy-digital-downloads' ); - - break; - - case 'intl' : - - $note = __( 'Payment must be accepted manually through PayPal due to international account regulations', 'easy-digital-downloads' ); - - break; - - case 'multi-currency' : - - $note = __( 'Payment received in non-shop currency and must be accepted manually through PayPal', 'easy-digital-downloads' ); - - break; - - case 'paymentreview' : - case 'regulatory_review' : - - $note = __( 'Payment is being reviewed by PayPal staff as high-risk or in possible violation of government regulations', 'easy-digital-downloads' ); - - break; - - case 'unilateral' : - - $note = __( 'Payment was sent to non-confirmed or non-registered email address.', 'easy-digital-downloads' ); - - break; - - case 'upgrade' : - - $note = __( 'PayPal account must be upgraded before this payment can be accepted', 'easy-digital-downloads' ); - - break; - - case 'verify' : - - $note = __( 'PayPal account is not verified. Verify account in order to accept this payment', 'easy-digital-downloads' ); - - break; - - case 'other' : - - $note = __( 'Payment is pending for unknown reasons. Contact PayPal support for assistance', 'easy-digital-downloads' ); - - break; - - } - - if ( ! empty( $note ) ) { - - edd_debug_log( 'Payment not marked as completed because: ' . $note ); - edd_insert_payment_note( $payment_id, $note ); - - } - - } - } -} -add_action( 'edd_paypal_web_accept', 'edd_process_paypal_web_accept_and_cart', 10, 2 ); - -/** - * Process PayPal IPN Refunds - * - * @since 1.3.4 - * @param array $data IPN Data - * @return void - */ -function edd_process_paypal_refund( $data, $payment_id = 0 ) { - - /** - * PayPal Process Refund Data - * - * Allows filtering the Refund data that PayPal passes back in via IPN with PayPal Standard - * - * @since 2.8.13 - * - * @param array $data The PayPal Refund data - * @param int $payment_id The Payment ID associated with this IPN request - */ - $data = apply_filters( 'edd_process_paypal_refund_data', $data, $payment_id ); - - // Collect payment details - if ( empty( $payment_id ) ) { - return; - } - - if ( get_post_status( $payment_id ) == 'refunded' ) { - return; // Only refund payments once - } - - $payment_amount = edd_get_payment_amount( $payment_id ); - $refund_amount = $data['mc_gross'] * -1; - - if ( number_format( (float) $refund_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) { - - edd_insert_payment_note( $payment_id, sprintf( __( 'Partial PayPal refund processed: %s', 'easy-digital-downloads' ), $data['parent_txn_id'] ) ); - return; // This is a partial refund - - } - - edd_insert_payment_note( $payment_id, sprintf( __( 'PayPal Payment #%s Refunded for reason: %s', 'easy-digital-downloads' ), $data['parent_txn_id'], $data['reason_code'] ) ); - edd_insert_payment_note( $payment_id, sprintf( __( 'PayPal Refund Transaction ID: %s', 'easy-digital-downloads' ), $data['txn_id'] ) ); - edd_update_payment_status( $payment_id, 'refunded' ); -} - -/** - * Get PayPal Redirect - * - * @since 1.0.8.2 - * @param bool $ssl_check Is SSL? - * @param bool $ipn Is this an IPN verification check? - * @return string - */ -function edd_get_paypal_redirect( $ssl_check = false, $ipn = false ) { - - $protocol = 'http://'; - if ( is_ssl() || ! $ssl_check ) { - $protocol = 'https://'; - } - - // Check the current payment mode - if ( edd_is_test_mode() ) { - - // Test mode - - if ( $ipn ) { - - $paypal_uri = 'https://ipnpb.sandbox.paypal.com/cgi-bin/webscr'; - - } else { - - $paypal_uri = $protocol . 'www.sandbox.paypal.com/cgi-bin/webscr'; - - } - - } else { - - // Live mode - - if ( $ipn ) { - - $paypal_uri = 'https://ipnpb.paypal.com/cgi-bin/webscr'; - - } else { - - $paypal_uri = $protocol . 'www.paypal.com/cgi-bin/webscr'; - - } - - } - - return apply_filters( 'edd_paypal_uri', $paypal_uri, $ssl_check, $ipn ); -} - -/** - * Get the image for the PayPal purchase page. - * - * @since 2.8 - * @return string - */ -function edd_get_paypal_image_url() { - $image_url = trim( edd_get_option( 'paypal_image_url', '' ) ); - return apply_filters( 'edd_paypal_image_url', $image_url ); -} - -/** - * Shows "Purchase Processing" message for PayPal payments are still pending on site return. - * - * This helps address the Race Condition, as detailed in issue #1839 - * - * @since 1.9 - * @return string - */ -function edd_paypal_success_page_content( $content ) { - - if ( ! isset( $_GET['payment-id'] ) && ! edd_get_purchase_session() ) { - return $content; - } - - edd_empty_cart(); - - $payment_id = isset( $_GET['payment-id'] ) ? absint( $_GET['payment-id'] ) : false; - - if ( ! $payment_id ) { - $session = edd_get_purchase_session(); - $payment_id = edd_get_purchase_id_by_key( $session['purchase_key'] ); - } - - $payment = new EDD_Payment( $payment_id ); - - if ( $payment->ID > 0 && 'pending' == $payment->status ) { - - // Payment is still pending so show processing indicator to fix the Race Condition, issue # - ob_start(); - - edd_get_template_part( 'payment', 'processing' ); - - $content = ob_get_clean(); - - } - - return $content; - -} -add_filter( 'edd_payment_confirm_paypal', 'edd_paypal_success_page_content' ); - -/** - * Mark payment as complete on return from PayPal if a PayPal Identity Token is present. - * - * See https://github.com/easydigitaldownloads/easy-digital-downloads/issues/6197 - * - * @since 2.8.13 - * @return void - */ -function edd_paypal_process_pdt_on_return() { - - if ( ! isset( $_GET['payment-id'] ) || ! isset( $_GET['tx'] ) ) { - return; - } - - $token = edd_get_option( 'paypal_identity_token' ); - - if ( ! edd_is_success_page() || ! $token || ! edd_is_gateway_active( 'paypal' ) ) { - return; - } - - $payment_id = isset( $_GET['payment-id'] ) ? absint( $_GET['payment-id'] ) : false; - - if ( empty( $payment_id ) ) { - return; - } - - $purchase_session = edd_get_purchase_session(); - $payment = new EDD_Payment( $payment_id ); - - // If there is no purchase session, don't try and fire PDT. - if ( empty( $purchase_session ) ) { - return; - } - - // Do not fire a PDT verification if the purchase session does not match the payment-id PDT is asking to verify. - if ( ! empty( $purchase_session['purchase_key'] ) && $payment->key !== $purchase_session['purchase_key'] ) { - return; - } - - if ( $token && ! empty( $_GET['tx'] ) && $payment->ID > 0 ) { - - // An identity token has been provided in settings so let's immediately verify the purchase - - $remote_post_vars = array( - 'method' => 'POST', - 'timeout' => 45, - 'redirection' => 5, - 'httpversion' => '1.1', - 'blocking' => true, - 'headers' => array( - 'host' => 'www.paypal.com', - 'connection' => 'close', - 'content-type' => 'application/x-www-form-urlencoded', - 'post' => '/cgi-bin/webscr HTTP/1.1', - 'user-agent' => 'EDD PDT Verification/' . EDD_VERSION . '; ' . get_bloginfo( 'url' ) - - ), - 'sslverify' => false, - 'body' => array( - 'tx' => sanitize_text_field( $_GET['tx'] ), - 'at' => $token, - 'cmd' => '_notify-synch', - ) - ); - - // Sanitize the data for debug logging. - $debug_args = $remote_post_vars; - $debug_args['body']['at'] = str_pad( substr( $debug_args['body']['at'], -6 ), strlen( $debug_args['body']['at'] ), '*', STR_PAD_LEFT ); - edd_debug_log( 'Attempting to verify PayPal payment with PDT. Args: ' . print_r( $debug_args, true ) ); - - edd_debug_log( 'Sending PDT Verification request to ' . edd_get_paypal_redirect() ); - - $request = wp_remote_post( edd_get_paypal_redirect(), $remote_post_vars ); - - if ( ! is_wp_error( $request ) ) { - - $body = wp_remote_retrieve_body( $request ); - - // parse the data - $lines = explode( "\n", trim( $body ) ); - $data = array(); - if ( strcmp ( $lines[0], "SUCCESS" ) == 0 ) { - - for ( $i = 1; $i < count( $lines ); $i++ ) { - $parsed_line = explode( "=", $lines[ $i ],2 ); - $data[ urldecode( $parsed_line[0] ) ] = urldecode( $parsed_line[1] ); - } - - if ( isset( $data['mc_gross'] ) ) { - - $total = $data['mc_gross']; - - } else if ( isset( $data['payment_gross'] ) ) { - - $total = $data['payment_gross']; - - } else if ( isset( $_REQUEST['amt'] ) ) { - - $total = $_REQUEST['amt']; - - } else { - - $total = null; - - } - - if ( is_null( $total ) ) { - - edd_debug_log( 'Attempt to verify PayPal payment with PDT failed due to payment total missing' ); - $payment->add_note( __( 'Payment could not be verified while validating PayPal PDT. Missing payment total fields.', 'easy-digital-downloads' ) ); - $payment->status = 'pending'; - - } elseif ( (float) $total < (float) $payment->total ) { - - /** - * Here we account for payments that are less than the expected results only. There are times that - * PayPal will sometimes round and have $0.01 more than the amount. The goal here is to protect store owners - * from getting paid less than expected. - */ - edd_debug_log( 'Attempt to verify PayPal payment with PDT failed due to payment total discrepancy' ); - $payment->add_note( sprintf( __( 'Payment failed while validating PayPal PDT. Amount expected: %f. Amount Received: %f', 'easy-digital-downloads' ), $payment->total, $data['payment_gross'] ) ); - $payment->status = 'failed'; - - } else { - - // Verify the status - switch( strtolower( $data['payment_status'] ) ) { - - case 'completed': - $payment->status = 'complete'; - break; - - case 'failed': - $payment->status = 'failed'; - break; - - default: - $payment->status = 'pending'; - break; - - } - - } - - $payment->transaction_id = sanitize_text_field( $_GET['tx'] ); - $payment->save(); - - } elseif ( strcmp ( $lines[0], "FAIL" ) == 0 ) { - - edd_debug_log( 'Attempt to verify PayPal payment with PDT failed due to PDT failure response: ' . print_r( $body, true ) ); - $payment->add_note( __( 'Payment failed while validating PayPal PDT.', 'easy-digital-downloads' ) ); - $payment->status = 'failed'; - $payment->save(); - - } else { - - edd_debug_log( 'Attempt to verify PayPal payment with PDT met with an unexpected result: ' . print_r( $body, true ) ); - $payment->add_note( __( 'PayPal PDT encountered an unexpected result, payment set to pending', 'easy-digital-downloads' ) ); - $payment->status = 'pending'; - $payment->save(); - - } - - } else { - - edd_debug_log( 'Attempt to verify PayPal payment with PDT failed. Request return: ' . print_r( $request, true ) ); - - } - } - -} -add_action( 'template_redirect', 'edd_paypal_process_pdt_on_return' ); - -/** - * Given a Payment ID, extract the transaction ID - * - * @since 2.1 - * @since 3.0 Updated to use EDD_Note class. - * - * @param string $payment_id Payment ID. - * @return string Transaction ID. - */ -function edd_paypal_get_payment_transaction_id( $payment_id ) { - $transaction_id = ''; - $notes = edd_get_payment_notes( $payment_id ); - - foreach ( $notes as $note ) { - if ( preg_match( '/^PayPal Transaction ID: ([^\s]+)/', $note->content, $match ) ) { - $transaction_id = $match[1]; - continue; - } - } - - return apply_filters( 'edd_paypal_set_payment_transaction_id', $transaction_id, $payment_id ); -} -add_filter( 'edd_get_payment_transaction_id-paypal', 'edd_paypal_get_payment_transaction_id', 10, 1 ); - -/** - * Given a transaction ID, generate a link to the PayPal transaction ID details - * - * @since 2.2 - * @param string $transaction_id The Transaction ID - * @param int $payment_id The payment ID for this transaction - * @return string A link to the PayPal transaction details - */ -function edd_paypal_link_transaction_id( $transaction_id, $payment_id ) { - - $payment = new EDD_Payment( $payment_id ); - $sandbox = 'test' === $payment->mode ? 'sandbox.' : ''; - $paypal_base_url = 'https://' . $sandbox . 'paypal.com/activity/payment/'; - $transaction_url = '' . esc_html( $transaction_id ) . ''; - - return apply_filters( 'edd_paypal_link_payment_details_transaction_id', $transaction_url ); - -} -add_filter( 'edd_payment_details_transaction_id-paypal', 'edd_paypal_link_transaction_id', 10, 2 ); - -/** - * Shows a checkbox to automatically refund payments in PayPal. - * - * @param Order $order - * - * @since 3.0 - * @return void - */ -function edd_paypal_refund_checkbox( Order $order ) { - if ( 'paypal' !== $order->gateway ) { - return; - } - - // If our credentials are not set, return early. - $key = $order->mode; - $username = edd_get_option( 'paypal_' . $key . '_api_username' ); - $password = edd_get_option( 'paypal_' . $key . '_api_password' ); - $signature = edd_get_option( 'paypal_' . $key . '_api_signature' ); - - if ( empty( $username ) || empty( $password ) || empty( $signature ) ) { - return; - } - ?> -
    -
    - - -
    -
    - gateway ) || 'paypal' !== $order->gateway ) { - return; - } - - // Get our data out of the serialized string. - parse_str( $_POST['data'], $form_data ); - - if ( empty( $form_data['edd-paypal-refund'] ) ) { - edd_add_note( array( - 'object_id' => $order_id, - 'object_type' => 'order', - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'content' => __( 'Transaction not refunded in PayPal, as checkbox was not selected.', 'easy-digital-downloads' ) - ) ); - - return; - } - - $refund = edd_get_order( $refund_id ); - if ( empty( $refund->total ) ) { - return; - } - - edd_refund_paypal_purchase( $order, $refund ); -} -add_action( 'edd_refund_order', 'edd_paypal_maybe_refund_transaction', 10, 3 ); - -/** - * Refunds a purchase made via PayPal. - * - * @since 2.6.0 - * - * @param EDD_Payment|Order|int $payment_id_or_object The ID or object of the order to refund. - * @param Order|null $refund_object Optional. The refund object associated with this - * transaction refund. If provided, then the refund - * amount is used as the transaction refund amount (used for - * partial refunds), and an EDD transaction record will be - * inserted. - * - * @return void - */ -function edd_refund_paypal_purchase( $payment_id_or_object, $refund_object = null ) { - /* - * Internally we want to work with an Order object, but we also need - * an EDD_Payment object for backwards compatibility in the hooks. - */ - $order = $payment = false; - if ( $payment_id_or_object instanceof Order ) { - $order = $payment_id_or_object; - $payment = edd_get_payment( $order->id ); - } elseif ( $payment_id_or_object instanceof EDD_Payment ) { - $payment = $payment_id_or_object; - $order = edd_get_order( $payment_id_or_object->ID ); - } elseif ( is_numeric( $payment_id_or_object ) ) { - $order = edd_get_order( $payment_id_or_object ); - $payment = edd_get_payment( $payment_id_or_object ); - } - - if ( empty( $order ) || ! $order instanceof Order ) { - return; - } - - // Set PayPal API key credentials. - $credentials = array( - 'api_endpoint' => 'test' == $order->mode ? 'https://api-3t.sandbox.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp', - 'api_username' => edd_get_option( 'paypal_' . $order->mode . '_api_username' ), - 'api_password' => edd_get_option( 'paypal_' . $order->mode . '_api_password' ), - 'api_signature' => edd_get_option( 'paypal_' . $order->mode . '_api_signature' ) - ); - - $credentials = apply_filters( 'edd_paypal_refund_api_credentials', $credentials, $payment ); - - $body = array( - 'USER' => $credentials['api_username'], - 'PWD' => $credentials['api_password'], - 'SIGNATURE' => $credentials['api_signature'], - 'VERSION' => '124', - 'METHOD' => 'RefundTransaction', - 'TRANSACTIONID' => $order->get_transaction_id(), - 'REFUNDTYPE' => 'Full' - ); - - // If a refund object is supplied, let's check if this should be a partial refund instead. - if ( $refund_object instanceof Order && abs( $refund_object->total ) !== abs( $order->total ) ) { - $body['REFUNDTYPE'] = 'Partial'; - $body['AMT'] = abs( $refund_object->total ); - - /* Translators: %d - order ID number; %s - formatted refund amount */ - edd_debug_log( sprintf( 'Processing partial PayPal refund for order #%d. Amount: %s.', $order->id, edd_currency_filter( $refund_object->total, $refund_object->currency ) ) ); - } else { - /* Translators: %d - order ID number */ - edd_debug_log( sprintf( 'Processing full PayPal refund for order #%d.', $order->id ) ); - } - - $body = apply_filters( 'edd_paypal_refund_body_args', $body, $payment ); - - // Prepare the headers of the refund request. - $headers = array( - 'Content-Type' => 'application/x-www-form-urlencoded', - 'Cache-Control' => 'no-cache' - ); - - $headers = apply_filters( 'edd_paypal_refund_header_args', $headers, $payment ); - - // Prepare args of the refund request. - $args = array( - 'body' => $body, - 'headers' => $headers, - 'httpversion' => '1.1' - ); - - $args = apply_filters( 'edd_paypal_refund_request_args', $args, $payment ); - - $error_msg = ''; - $request = wp_remote_post( $credentials['api_endpoint'], $args ); - - if ( is_wp_error( $request ) ) { - - $success = false; - $error_msg = $request->get_error_message(); - - } else { - - $body = wp_remote_retrieve_body( $request ); - if ( is_string( $body ) ) { - wp_parse_str( $body, $body ); - } - - if ( isset( $body['ACK'] ) && 'success' === strtolower( $body['ACK'] ) ) { - $success = true; - } else { - $success = false; - if ( isset( $body['L_LONGMESSAGE0'] ) ) { - $error_msg = $body['L_LONGMESSAGE0']; - } else { - $error_msg = __( 'PayPal refund failed for unknown reason.', 'easy-digital-downloads' ); - } - } - - } - - if ( $success ) { - - edd_update_order_meta( $order->id, '_edd_paypal_refunded', true ); - - // Add a note to the original order, and, if provided, the new refund object. - if ( isset( $body['GROSSREFUNDAMT'] ) ) { - /* Translators: %1$s - amount refunded; %2$s - transaction ID. */ - $note_message = sprintf( __( '%1$s refunded in PayPal. Transaction ID: %2$s', 'easy-digital-downloads' ), edd_currency_filter( edd_format_amount( $body['GROSSREFUNDAMT'] ) ), esc_html( $body['REFUNDTRANSACTIONID'] ) ); - } else { - /* Translators: %s - transaction ID. */ - $note_message = sprintf( __( 'PayPal refund transaction ID: %s', 'easy-digital-downloads' ), esc_html( $body['REFUNDTRANSACTIONID'] ) ); - } - $note_object_ids = array( $order->id ); - if ( $refund_object instanceof Order ) { - $note_object_ids[] = $refund_object->id; - } - foreach ( $note_object_ids as $note_object_id ) { - edd_add_note( array( - 'object_id' => $note_object_id, - 'object_type' => 'order', - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'content' => $note_message - ) ); - } - - // Add a negative transaction. - if ( $refund_object instanceof Order && isset( $body['REFUNDTRANSACTIONID'] ) && isset( $body['GROSSREFUNDAMT'] ) ) { - edd_add_order_transaction( array( - 'object_id' => $refund_object->id, - 'object_type' => 'order', - 'transaction_id' => sanitize_text_field( $body['REFUNDTRANSACTIONID'] ), - 'gateway' => 'paypal', - 'status' => 'complete', - 'total' => edd_negate_amount( $body['GROSSREFUNDAMT'] ) - ) ); - } - - } else { - edd_add_note( array( - 'object_id' => $order->id, - 'object_type' => 'order', - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'content' => sprintf( __( 'PayPal refund failed: %s', 'easy-digital-downloads' ), $error_msg ) - ) ); - } - - // Run hook letting people know the payment has been refunded successfully. - do_action( 'edd_paypal_refund_purchase', $payment ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/admin/connect.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/admin/connect.php deleted file mode 100644 index ecf12457..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/admin/connect.php +++ /dev/null @@ -1,830 +0,0 @@ -signupLink ) ) { - ?> -
    -

    - tag; %2$s closing tag */ - __( '%1$sPayPal Communication Error:%2$s We are having trouble communicating with PayPal at the moment. Please try again later, and if the issue persists, reach out to our support team.', 'easy-digital-downloads' ), - '', - '' - ), array( 'strong' => array() ) ); - ?> -

    -
    - - - - - -
    - - -
    - - - 403, - 'body' => array( - 'message' => __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), - ), - ); - } - - $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE; - - $existing_connect_details = get_partner_details( $mode ); - - if ( ! empty( $existing_connect_details ) ) { - // Ensure the data we have contains all necessary details. - if ( - ( ! empty( $existing_connect_details->expires ) && $existing_connect_details->expires > time() ) && - ! empty( $existing_connect_details->nonce ) && - ! empty( $existing_connect_details->signupLink ) && // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase - ! empty( $existing_connect_details->product ) - ) { - return array( - 'code' => 200, - 'body' => $existing_connect_details, - ); - } - } - - $response = wp_remote_post( - EDD_PAYPAL_PARTNER_CONNECT_URL . 'signup-link', - array( - 'headers' => array( - 'Content-Type' => 'application/json', - ), - 'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ), - 'body' => wp_json_encode( - array( - 'mode' => $mode, - 'country_code' => edd_get_shop_country(), - 'currency_code' => edd_get_currency(), - 'return_url' => get_settings_url(), - ) - ), - ) - ); - - $code = wp_remote_retrieve_response_code( $response ); - - if ( is_wp_error( $response ) ) { - - return array( - 'code' => $code, - 'body' => $response->get_error_message(), - ); - } - - $body = wp_remote_retrieve_body( $response ); - $body = json_decode( $body ); - - // We're storing an expiration so we can get a new one if it's been a day. - $body->expires = time() + DAY_IN_SECONDS; - - // We need to store this temporarily so we can use the nonce again in the next request. - update_option( 'edd_paypal_commerce_connect_details_' . $mode, wp_json_encode( $body ), false ); - - return array( - 'code' => $code, - 'body' => $body, - ); -} - -/** - * AJAX handler for processing the PayPal Connection. - * - * @since 2.11 - * @deprecated 3.1.2 Instead of doing this via an AJAX request, we now do this on page load. - * - * @return void - */ -function process_connect() { - _edd_deprecated_function( __FUNCTION__, '3.1.2', 'EDD_PayPal_Commerce::get_onboarding_data()' ); - - // This validates the nonce. - check_ajax_referer( 'edd_process_paypal_connect' ); - - $onboarding_data = get_onboarding_data(); - - if ( 200 !== intval( $onboarding_data['code'] ) ) { - wp_send_json_error( sprintf( - /* Translators: %d - HTTP response code; %s - Response from the API */ - __( 'Unexpected response code: %d. Error: %s', 'easy-digital-downloads' ), - $onboarding_data['code'], - wp_json_encode( $onboarding_data['body'] ) - ) ); - } - - if ( empty( $onboarding_data['body']->signupLink ) || empty( $onboarding_data['body']->nonce ) ) { - wp_send_json_error( __( 'An unexpected error occurred.', 'easy-digital-downloads' ) ); - } - - wp_send_json_success( $onboarding_data['body'] ); -} - -/** - * AJAX handler for processing the PayPal Reconnect. - * - * @since 3.1.0.3 - * @return void - */ -function process_reconnect() { - // This validates the nonce. - check_ajax_referer( 'edd_process_paypal_connect' ); - - if ( ! current_user_can( 'manage_options' ) ) { - wp_send_json_error( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) ); - } - - $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE; - - /** - * Make sure we still have connection details from the previously connected site. - */ - $connection_details = get_option( 'edd_paypal_commerce_connect_details_' . $mode ); - - if ( empty( $connection_details ) ) { - // Somehow we ended up here, but now that we're in an invalid state, remove all settings so we can fully reset. - delete_option( 'edd_paypal_commerce_connect_details_' . $mode ); - delete_option( 'edd_paypal_commerce_webhook_id_' . $mode ); - delete_option( 'edd_paypal_' . $mode . '_merchant_details' ); - wp_send_json_error( __( 'Failure reconnecting to PayPal. Please try again', 'easy-digital-downloads' ) ); - } - - try { - PayPal\Webhooks\create_webhook( $mode ); - } catch ( \Exception $e ) { - $message = esc_html__( 'Your account has been successfully reconnected, but an error occurred while creating a webhook.', 'easy-digital-downloads' ); - } - - wp_safe_redirect( esc_url_raw( get_settings_url() ) ); -} -add_action( 'wp_ajax_edd_paypal_commerce_reconnect', __NAMESPACE__ . '\process_reconnect' ); - -/** - * Retrieves partner Connect details for the given mode. - * - * @param string $mode Store mode. If omitted, current mode is used. - * - * @return stdObj|null - */ -function get_partner_details( $mode = '' ) { - if ( ! $mode ) { - $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE; - } - return json_decode( get_option( 'edd_paypal_commerce_connect_details_' . $mode ) ); -} - -/** - * AJAX handler for retrieving a one-time access token, then used to retrieve - * the seller's API credentials. - * - * @since 2.11 - * @return void - */ -function get_and_save_credentials() { - // This validates the nonce. - check_ajax_referer( 'edd_process_paypal_connect' ); - - if ( ! current_user_can( 'manage_options' ) ) { - wp_send_json_error( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) ); - } - - if ( empty( $_POST['auth_code'] ) || empty( $_POST['share_id'] ) ) { - wp_send_json_error( __( 'Missing PayPal authentication information. Please try again.', 'easy-digital-downloads' ) ); - } - - $mode = edd_is_test_mode() ? PayPal\API::MODE_SANDBOX : PayPal\API::MODE_LIVE; - - $partner_details = get_partner_details( $mode ); - if ( empty( $partner_details->nonce ) ) { - wp_send_json_error( __( 'Missing nonce. Please refresh the page and try again.', 'easy-digital-downloads' ) ); - } - - $paypal_subdomain = edd_is_test_mode() ? '.sandbox' : ''; - $api_url = 'https://api-m' . $paypal_subdomain . '.paypal.com/'; - $api_args = array( - 'headers' => array( - 'Content-Type' => 'application/x-www-form-urlencoded', - 'Authorization' => sprintf( 'Basic %s', base64_encode( $_POST['share_id'] ) ), - 'timeout' => 15, - ), - 'body' => array( - 'grant_type' => 'authorization_code', - 'code' => $_POST['auth_code'], - 'code_verifier' => $partner_details->nonce, - ), - 'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ), - ); - - /* - * First get a temporary access token from PayPal. - */ - $response = wp_remote_post( - $api_url . 'v1/oauth2/token', - $api_args - ); - - if ( is_wp_error( $response ) ) { - wp_send_json_error( $response->get_error_message() ); - } - - $code = wp_remote_retrieve_response_code( $response ); - $body = json_decode( wp_remote_retrieve_body( $response ) ); - - if ( empty( $body->access_token ) ) { - wp_send_json_error( - sprintf( - /* Translators: %d - HTTP response code */ - __( 'Unexpected response from PayPal while generating token. Response code: %d. Please try again.', 'easy-digital-downloads' ), - $code - ) - ); - } - - /* - * Now we can use this access token to fetch the seller's credentials for all future - * API requests. - */ - $response = wp_remote_get( $api_url . 'v1/customer/partners/' . urlencode( \EDD\Gateways\PayPal\get_partner_merchant_id( $mode ) ) . '/merchant-integrations/credentials/', array( - 'headers' => array( - 'Authorization' => sprintf( 'Bearer %s', $body->access_token ), - 'Content-Type' => 'application/json', - 'timeout' => 15 - ), - 'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ), - ) ); - - if ( is_wp_error( $response ) ) { - wp_send_json_error( $response->get_error_message() ); - } - - $code = wp_remote_retrieve_response_code( $response ); - $body = json_decode( wp_remote_retrieve_body( $response ) ); - - if ( empty( $body->client_id ) || empty( $body->client_secret ) ) { - wp_send_json_error( sprintf( - /* Translators: %d - HTTP response code */ - __( 'Unexpected response from PayPal. Response code: %d. Please try again.', 'easy-digital-downloads' ), - $code - ) ); - } - - edd_update_option( 'paypal_' . $mode . '_client_id', sanitize_text_field( $body->client_id ) ); - edd_update_option( 'paypal_' . $mode . '_client_secret', sanitize_text_field( $body->client_secret ) ); - - $message = esc_html__( 'Successfully connected.', 'easy-digital-downloads' ); - - try { - PayPal\Webhooks\create_webhook( $mode ); - } catch ( \Exception $e ) { - $message = esc_html__( 'Your account has been successfully connected, but an error occurred while creating a webhook.', 'easy-digital-downloads' ); - } - - /** - * Triggers when an account is successfully connected to PayPal. - * - * @param string $mode The mode that the account was connected in. Either `sandbox` or `live`. - * - * @since 2.11 - */ - do_action( 'edd_paypal_commerce_connected', $mode ); - - wp_send_json_success( $message ); -} - -add_action( 'wp_ajax_edd_paypal_commerce_get_access_token', __NAMESPACE__ . '\get_and_save_credentials' ); - -/** - * Verifies the connected account. - * - * @since 2.11 - * @return void - */ -function get_account_info() { - check_ajax_referer( 'edd_paypal_account_information' ); - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_send_json_error( wpautop( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) ) ); - } - - try { - $status = 'success'; - $account_status = ''; - $actions = array( - 'refresh_merchant' => '', - 'webhook' => '' - ); - - $disconnect_links = array( - 'disconnect' => '' . __( "Disconnect webhooks from PayPal", "easy-digital-downloads" ) . '', - 'delete' => '' . __( "Delete connection with PayPal", "easy-digital-downloads" ) . '', - ); - - $validator = new AccountStatusValidator(); - $validator->check(); - - /* - * 1. Check REST API credentials - */ - $rest_api_message = '' . __( 'API:', 'easy-digital-downloads' ) . '' . ' '; - if ( $validator->errors_for_credentials->errors ) { - $rest_api_dashicon = 'no'; - $status = 'error'; - $rest_api_message .= $validator->errors_for_credentials->get_error_message(); - } else { - $rest_api_dashicon = 'yes'; - $mode_string = edd_is_test_mode() ? __( 'sandbox', 'easy-digital-downloads' ) : __( 'live', 'easy-digital-downloads' ); - - /* Translators: %s - the connected mode, either `sandbox` or `live` */ - $rest_api_message .= sprintf( __( 'Your PayPal account is successfully connected in %s mode.', 'easy-digital-downloads' ), $mode_string ); - } - - ob_start(); - ?> -
  • - - array() ) ); ?> -
  • - ' . __( 'Payment Status:', 'easy-digital-downloads' ) . '' . ' '; - if ( $validator->errors_for_merchant_account->errors ) { - $merchant_dashicon = 'no'; - $status = 'error'; - $merchant_account_message .= __( 'You need to address the following issues before you can start receiving payments:', 'easy-digital-downloads' ); - - // We can only refresh the status if we have a merchant ID. - if ( in_array( 'missing_merchant_details', $validator->errors_for_merchant_account->get_error_codes() ) ) { - unset( $actions['refresh_merchant'] ); - } - } else { - $merchant_dashicon = 'yes'; - $merchant_account_message .= __( 'Ready to accept payments.', 'easy-digital-downloads' ); - } - - ob_start(); - ?> -
  • - - - errors_for_merchant_account->errors ) : ?> -
      - errors_for_merchant_account->get_error_codes() as $code ) : ?> -
    • errors_for_merchant_account->get_error_message( $code ), array( 'strong' => array() ) ); ?>
    • - -
    - -
  • - ' . __( 'Webhook:', 'easy-digital-downloads' ) . '' . ' '; - if ( $validator->errors_for_webhook->errors ) { - $webhook_dashicon = 'no'; - $status = ( 'success' === $status ) ? 'warning' : $status; - $webhook_message .= $validator->errors_for_webhook->get_error_message(); - - if ( in_array( 'webhook_missing', $validator->errors_for_webhook->get_error_codes() ) ) { - unset( $disconnect_links['disconnect'] ); - $actions['webhook'] = ''; - } - } else { - unset( $disconnect_links['delete'] ); - $webhook_dashicon = 'yes'; - $webhook_message .= __( 'Webhook successfully configured for the following events:', 'easy-digital-downloads' ); - } - - ob_start(); - ?> -
  • - - array() ) ); ?> - webhook ) : ?> -
      - -
    • - - -
    • - -
    - -
  • - ', - '', - '
  • ', - '', - '
  • ' - ); - } - - wp_send_json_success( array( - 'status' => $status, - 'account_status' => '', - 'webhook_object' => isset( $validator ) ? $validator->webhook : null, - 'actions' => array_values( $actions ), - 'disconnect_links' => array_values( $disconnect_links ), - ) ); - } catch ( \Exception $e ) { - wp_send_json_error( array( - 'status' => isset( $status ) ? $status : 'error', - 'message' => wpautop( $e->getMessage() ) - ) ); - } -} - -add_action( 'wp_ajax_edd_paypal_commerce_get_account_info', __NAMESPACE__ . '\get_account_info' ); - -/** - * Returns the URL for disconnecting from PayPal Commerce. - * - * @since 2.11 - * @return string - */ -function get_disconnect_url() { - return wp_nonce_url( - add_query_arg( - array( - 'edd_action' => 'disconnect_paypal_commerce' - ), - admin_url() - ), - 'edd_disconnect_paypal_commerce' - ); -} - -/** - * Returns the URL for deleting the app PayPal Commerce. - * - * @since 3.1.0.3 - * @return string - */ -function get_delete_url() { - return wp_nonce_url( - add_query_arg( - array( - 'edd_action' => 'delete_paypal_commerce' - ), - admin_url() - ), - 'edd_delete_paypal_commerce' - ); -} - -/** - * Disconnects from PayPal in the current mode. - * - * @since 2.11 - * @return void - */ -function process_disconnect() { - if ( ! current_user_can( 'manage_options' ) ) { - wp_die( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - if ( empty( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'edd_disconnect_paypal_commerce' ) ) { - wp_die( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $mode = edd_is_test_mode() ? PayPal\API::MODE_SANDBOX : PayPal\API::MODE_LIVE; - - try { - $api = new PayPal\API(); - - try { - // Disconnect the webhook. - // This is in another try/catch because we want to delete the token cache (below) even if this fails. - // This only deletes the webhooks in PayPal, we do not remove the webhook ID in EDD until we delete the connection. - PayPal\Webhooks\delete_webhook( $mode ); - } catch ( \Exception $e ) { - - } - - // Also delete the token cache key, to ensure we fetch a fresh one if they connect to a different account later. - delete_option( $api->token_cache_key ); - } catch ( \Exception $e ) { - - } - - wp_safe_redirect( esc_url_raw( get_settings_url() ) ); - exit; -} - -add_action( 'edd_disconnect_paypal_commerce', __NAMESPACE__ . '\process_disconnect' ); - -/** - * Fully deletes past Merchant Information from PayPal in the current mode. - * - * @since 3.1.0.3 - * @return void - */ -function process_delete() { - if ( ! current_user_can( 'manage_options' ) ) { - wp_die( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - if ( empty( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'edd_delete_paypal_commerce' ) ) { - wp_die( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - $mode = edd_is_test_mode() ? PayPal\API::MODE_SANDBOX : PayPal\API::MODE_LIVE; - - // Delete merchant information. - delete_option( 'edd_paypal_' . $mode . '_merchant_details' ); - - // Delete partner connect information. - delete_option( 'edd_paypal_commerce_connect_details_' . $mode ); - - try { - $api = new PayPal\API(); - - try { - // Disconnect the webhook. - // This is in another try/catch because we want to delete the token cache (below) even if this fails. - // This only deletes the webhooks in PayPal, we do not remove the webhook ID in EDD until we delete the connection. - PayPal\Webhooks\delete_webhook( $mode ); - } catch ( \Exception $e ) { - - } - - // Also delete the token cache key, to ensure we fetch a fresh one if they connect to a different account later. - delete_option( $api->token_cache_key ); - } catch ( \Exception $e ) { - - } - - // Now delete our webhook ID. - delete_option( sanitize_key( 'edd_paypal_commerce_webhook_id_' . $mode ) ); - - // Delete API credentials. - $edd_settings_to_delete = array( - 'paypal_' . $mode . '_client_id', - 'paypal_' . $mode . '_client_secret', - ); - - foreach ( $edd_settings_to_delete as $option_name ) { - edd_delete_option( $option_name ); - } - - // Unset the PayPal Commerce gateway as an enabled gateway. - $enabled_gateways = edd_get_option( 'gateways', array() ); - unset( $enabled_gateways['paypal_commerce'] ); - edd_update_option( 'gateways', $enabled_gateways ); - - wp_safe_redirect( esc_url_raw( get_settings_url() ) ); - exit; -} - -add_action( 'edd_delete_paypal_commerce', __NAMESPACE__ . '\process_delete' ); - -/** - * AJAX callback for refreshing payment status. - * - * @since 2.11 - */ -function refresh_merchant_status() { - check_ajax_referer( 'edd_check_merchant_status' ); - - if ( ! current_user_can( 'manage_options' ) ) { - wp_send_json_error( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) ); - } - - $merchant_details = PayPal\MerchantAccount::retrieve(); - - try { - if ( empty( $merchant_details->merchant_id ) ) { - throw new \Exception( __( 'No merchant ID saved. Please reconnect to PayPal.', 'easy-digital-downloads' ) ); - } - - $partner_details = get_partner_details(); - $nonce = isset( $partner_details->nonce ) ? $partner_details->nonce : null; - - $new_details = get_merchant_status( $merchant_details->merchant_id, $nonce ); - $merchant_account = new PayPal\MerchantAccount( $new_details ); - $merchant_account->save(); - - wp_send_json_success(); - } catch ( \Exception $e ) { - wp_send_json_error( esc_html( $e->getMessage() ) ); - } -} - -add_action( 'wp_ajax_edd_paypal_commerce_check_merchant_status', __NAMESPACE__ . '\refresh_merchant_status' ); - -/** - * AJAX callback for creating a webhook. - * - * @since 2.11 - */ -function create_webhook() { - check_ajax_referer( 'edd_create_paypal_webhook' ); - - if ( ! current_user_can( 'manage_options' ) ) { - wp_send_json_error( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) ); - } - - try { - PayPal\Webhooks\create_webhook(); - - wp_send_json_success(); - } catch ( \Exception $e ) { - wp_send_json_error( esc_html( $e->getMessage() ) ); - } -} - -add_action( 'wp_ajax_edd_paypal_commerce_create_webhook', __NAMESPACE__ . '\create_webhook' ); - -/** - * AJAX callback for syncing a webhook. This is used to fix issues with missing events. - * - * @since 2.11 - */ -function update_webhook() { - check_ajax_referer( 'edd_update_paypal_webhook' ); - - if ( ! current_user_can( 'manage_options' ) ) { - wp_send_json_error( esc_html__( 'You do not have permission to perform this action.', 'easy-digital-downloads' ) ); - } - - try { - PayPal\Webhooks\sync_webhook(); - - wp_send_json_success(); - } catch ( \Exception $e ) { - wp_send_json_error( esc_html( $e->getMessage() ) ); - } -} - -add_action( 'wp_ajax_edd_paypal_commerce_update_webhook', __NAMESPACE__ . '\update_webhook' ); - -/** - * PayPal Redirect Callback - * - * This processes after the merchant is redirected from PayPal. We immediately - * check their seller status via partner connect and save their merchant status. - * The user is then redirected back to the settings page. - * - * @since 2.11 - */ -add_action( 'admin_init', function () { - if ( ! isset( $_GET['merchantIdInPayPal'] ) || ! edd_is_admin_page( 'settings' ) ) { - return; - } - - if ( ! current_user_can( 'manage_options' ) ) { - wp_die( __( 'You do not have permission to perform this action.', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - edd_debug_log( 'PayPal Connect - Checking merchant status.' ); - - $merchant_id = urldecode( $_GET['merchantIdInPayPal'] ); - - try { - $details = get_merchant_status( $merchant_id ); - edd_debug_log( 'PayPal Connect - Successfully retrieved merchant status.' ); - } catch ( \Exception $e ) { - /* - * This won't be enough to actually validate the merchant status, but we want to ensure - * we save the merchant ID no matter what. - */ - $details = array( - 'merchant_id' => $merchant_id - ); - - edd_debug_log( sprintf( 'PayPal Connect - Failed to retrieve merchant status from PayPal. Error: %s', $e->getMessage() ) ); - } - - $merchant_account = new PayPal\MerchantAccount( $details ); - $merchant_account->save(); - - wp_safe_redirect( esc_url_raw( get_settings_url() ) ); - exit; -} ); - -/** - * Retrieves the merchant's status in PayPal. - * - * @param string $merchant_id - * @param string $nonce - * - * @return array - * @throws PayPal\Exceptions\API_Exception - */ -function get_merchant_status( $merchant_id, $nonce = '' ) { - $response = wp_remote_post( EDD_PAYPAL_PARTNER_CONNECT_URL . 'merchant-status', array( - 'headers' => array( - 'Content-Type' => 'application/json', - ), - 'body' => json_encode( array( - 'mode' => edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE, - 'merchant_id' => $merchant_id, - 'nonce' => $nonce - ) ), - 'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ), - ) ); - - $response_code = wp_remote_retrieve_response_code( $response ); - $response_body = json_decode( wp_remote_retrieve_body( $response ), true ); - - if ( 200 !== (int) $response_code ) { - if ( ! empty( $response_body['error'] ) ) { - $error_message = $response_body['error']; - } else { - $error_message = sprintf( - 'Invalid HTTP response code: %d. Response: %s', - $response_code, - wp_remote_retrieve_body( $response ) - ); - } - - throw new PayPal\Exceptions\API_Exception( $error_message, $response_code ); - } - - return $response_body; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/admin/notices.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/admin/notices.php deleted file mode 100644 index 82732ede..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/admin/notices.php +++ /dev/null @@ -1,66 +0,0 @@ - 'dismiss_notices', - 'edd_notice' => 'paypal_commerce' - ) ), 'edd_notice_nonce' ); - - $setup_url = add_query_arg( array( - 'post_type' => 'download', - 'page' => 'edd-settings', - 'tab' => 'gateways', - 'section' => 'paypal_commerce' - ), admin_url( 'edit.php' ) ); - - ?> -
    -

    -

    - ', - '' - ), array( 'a' => array( 'href' => true, 'target' => true ) ) ); - ?> -

    -

    - - -

    -
    - esc_html__( 'An unexpected error occurred. Please refresh the page and try again.', 'easy-digital-downloads' ), - 'isConnected' => PayPal\has_rest_api_connection(), - ) - ); - } -} -add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\enqueue_connect_scripts' ); - -/** - * Forces the Cache-Control header on the PayPal Commerce settings page to send the no-store header - * which prevents the back-forward cache (bfcache) from storing a copy of this page in local - * cache. This helps make sure that page elements modified via AJAX and DOM manipulations aren't - * incorrectly shown as if they never changed. - * - * See: https://github.com/easydigitaldownloads/EDD-Software-Licensing/issues/1346#issuecomment-382159918 - * - * @since 3.6 - * @param array $headers An array of nocache headers. - * - * @return array - */ -function _bfcache_buster( $headers ) { - if ( ! is_admin() ) { - return $headers; - } - - if ( edd_is_admin_page( 'settings' ) && isset( $_GET['section'] ) && 'paypal_commerce' === $_GET['section'] ) { /* phpcs:ignore WordPress.Security.NonceVerification.Recommended */ - $headers['Cache-Control'] = 'no-cache, must-revalidate, max-age=0, no-store'; - } - - return $headers; -} -add_filter( 'nocache_headers', __NAMESPACE__ . '\_bfcache_buster', 10, 1 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/admin/settings.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/admin/settings.php deleted file mode 100644 index c927d30d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/admin/settings.php +++ /dev/null @@ -1,155 +0,0 @@ - array( - 'id' => 'paypal_settings', - 'name' => '

    ' . __( 'PayPal Settings', 'easy-digital-downloads' ) . '

    ', - 'type' => 'header', - ), - 'paypal_connect_button' => array( - 'id' => 'paypal_connect_button', - 'name' => __( 'Connection Status', 'easy-digital-downloads' ), - 'class' => 'edd-paypal-connect-row', - 'type' => 'hook', - ), - 'paypal_sandbox_client_id' => array( - 'id' => 'paypal_sandbox_client_id', - 'name' => __( 'Test Client ID', 'easy-digital-downloads' ), - 'desc' => __( 'Enter your test client ID.', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - 'class' => 'edd-hidden', - ), - 'paypal_sandbox_client_secret' => array( - 'id' => 'paypal_sandbox_client_secret', - 'name' => __( 'Test Client Secret', 'easy-digital-downloads' ), - 'desc' => __( 'Enter your test client secret.', 'easy-digital-downloads' ), - 'type' => 'password', - 'size' => 'regular', - 'class' => 'edd-hidden', - ), - 'paypal_live_client_id' => array( - 'id' => 'paypal_live_client_id', - 'name' => __( 'Live Client ID', 'easy-digital-downloads' ), - 'desc' => __( 'Enter your live client ID.', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - 'class' => 'edd-hidden', - ), - 'paypal_live_client_secret' => array( - 'id' => 'paypal_live_client_secret', - 'name' => __( 'Live Client Secret', 'easy-digital-downloads' ), - 'desc' => __( 'Enter your live client secret.', 'easy-digital-downloads' ), - 'type' => 'password', - 'size' => 'regular', - 'class' => 'edd-hidden', - ), - 'paypal_documentation' => array( - 'id' => 'paypal_documentation', - 'name' => '', - 'type' => 'hook', - ), - ); - - $is_connected = PayPal\has_rest_api_connection(); - if ( ! $is_connected ) { - $paypal_settings['paypal_settings']['tooltip_title'] = __( 'Connect with PayPal', 'easy-digital-downloads' ); - $paypal_settings['paypal_settings']['tooltip_desc'] = __( 'Connecting your store with PayPal allows Easy Digital Downloads to automatically configure your store to securely communicate with PayPal.

    You may see "Sandhills Development, LLC", mentioned during the process—that is the company behind Easy Digital Downloads.', 'easy-digital-downloads' ); - } - - /** - * Filters the PayPal Settings. - * - * @param array $paypal_settings - */ - $paypal_settings = apply_filters( 'edd_paypal_settings', $paypal_settings ); - $gateway_settings['paypal_commerce'] = $paypal_settings; - - return $gateway_settings; -} - -add_filter( 'edd_settings_gateways', __NAMESPACE__ . '\register_gateway_settings', 1, 1 ); - -/** - * Returns the content for the documentation settings. - * - * @since 2.11 - * @return string - */ -function documentation_settings_field() { - ?> -

    - - - - - - - -

    - -
    -

    - SSL setup article.', 'easy-digital-downloads' ), - 'https://easydigitaldownloads.com/docs/do-i-need-an-ssl-certificate/' - ), array( 'a' => array( 'href' => true, 'target' => true ) ) ); - ?> -

    -
    - is_recurring( $args['download_id'] ) ) { - return $args; - } - - // Price ID is recurring. - if ( ! empty( $args['price_id'] ) && edd_recurring()->is_price_recurring( $args['download_id'], $args['price_id'] ) ) { - return $args; - } - } - - if ( ! empty( $args['direct'] ) ) { - $args['class'] .= ' edd-paypal-checkout-buy-now'; - } - - return $args; -} - -add_filter( 'edd_purchase_link_args', __NAMESPACE__ . '\maybe_add_purchase_link_class' ); - -/** - * Registers PayPal Commerce JavaScript if using "direct" buy now links. - * - * @param int $download_id ID of the download. - * @param array $args Purchase link arguments. - * - * @since 2.11 - */ -function maybe_enable_buy_now_js( $download_id, $args ) { - if ( ! empty( $args['direct'] ) && is_buy_now_enabled() ) { - register_js( true ); - $timestamp = time(); - ?> - - - - -
    -
    - - -
    -

    - -

    -
    - 403 ) ); - } - - edd_debug_log( 'PayPal - create_order()' ); - - if ( ! ready_to_accept_payments() ) { - edd_record_gateway_error( - __( 'PayPal Gateway Error', 'easy-digital-downloads' ), - __( 'Account not ready to accept payments.', 'easy-digital-downloads' ) - ); - - $error_message = current_user_can( 'manage_options' ) - ? __( 'Please connect your PayPal account in the gateway settings.', 'easy-digital-downloads' ) - : __( 'Unexpected authentication error. Please contact a site administrator.', 'easy-digital-downloads' ); - - wp_send_json_error( edd_build_errors_html( array( - 'paypal-error' => $error_message - ) ) ); - } - - try { - // Create pending payment in EDD. - $payment_args = array( - 'price' => $purchase_data['price'], - 'date' => $purchase_data['date'], - 'user_email' => $purchase_data['user_email'], - 'purchase_key' => $purchase_data['purchase_key'], - 'currency' => edd_get_currency(), - 'downloads' => $purchase_data['downloads'], - 'cart_details' => $purchase_data['cart_details'], - 'user_info' => $purchase_data['user_info'], - 'status' => 'pending', - 'gateway' => 'paypal_commerce' - ); - - $payment_id = edd_insert_payment( $payment_args ); - - if ( ! $payment_id ) { - throw new Gateway_Exception( - __( 'An unexpected error occurred. Please try again.', 'easy-digital-downloads' ), - 500, - sprintf( - 'Payment creation failed before sending buyer to PayPal. Payment data: %s', - json_encode( $payment_args ) - ) - ); - } - - $order_data = array( - 'intent' => 'CAPTURE', - 'purchase_units' => get_order_purchase_units( $payment_id, $purchase_data, $payment_args ), - 'application_context' => array( - //'locale' => get_locale(), // PayPal doesn't like this. Might be able to replace `_` with `-` - 'shipping_preference' => 'NO_SHIPPING', - 'user_action' => 'PAY_NOW', - 'return_url' => edd_get_checkout_uri(), - 'cancel_url' => edd_get_failed_transaction_uri( '?payment-id=' . urlencode( $payment_id ) ) - ), - 'payment_instructions' => array( - 'disbursement_mode' => 'INSTANT' - ) - ); - - // Add payer data if we have it. We won't have it when using Buy Now buttons. - if ( ! empty( $purchase_data['user_email'] ) ) { - $order_data['payer']['email_address'] = $purchase_data['user_email']; - } - if ( ! empty( $purchase_data['user_info']['first_name'] ) ) { - $order_data['payer']['name']['given_name'] = $purchase_data['user_info']['first_name']; - } - if ( ! empty( $purchase_data['user_info']['last_name'] ) ) { - $order_data['payer']['name']['surname'] = $purchase_data['user_info']['last_name']; - } - - /** - * Filters the arguments sent to PayPal. - * - * @param array $order_data API request arguments. - * @param array $purchase_data Purchase data. - * @param int $payment_id ID of the EDD payment. - * - * @since 2.11 - */ - $order_data = apply_filters( 'edd_paypal_order_arguments', $order_data, $purchase_data, $payment_id ); - - try { - $api = new API(); - $response = $api->make_request( 'v2/checkout/orders', $order_data ); - - if ( ! isset( $response->id ) && _is_item_total_mismatch( $response ) ) { - - edd_record_gateway_error( - __( 'PayPal Gateway Warning', 'easy-digital-downloads' ), - sprintf( - /* Translators: %s - Original order data sent to PayPal. */ - __( 'PayPal could not complete the transaction with the itemized breakdown. Original order data sent: %s', 'easy-digital-downloads' ), - json_encode( $order_data ) - ), - $payment_id - ); - - // Try again without the item breakdown. That way if we have an error in our totals the whole API request won't fail. - $order_data['purchase_units'] = array( - get_order_purchase_units_without_breakdown( $payment_id, $purchase_data, $payment_args ) - ); - - // Re-apply the filter. - $order_data = apply_filters( 'edd_paypal_order_arguments', $order_data, $purchase_data, $payment_id ); - - $response = $api->make_request( 'v2/checkout/orders', $order_data ); - } - - if ( ! isset( $response->id ) ) { - throw new Gateway_Exception( - __( 'An error occurred while communicating with PayPal. Please try again.', 'easy-digital-downloads' ), - $api->last_response_code, - sprintf( - 'Unexpected response when creating order: %s', - json_encode( $response ) - ) - ); - } - - edd_debug_log( sprintf( '-- Successful PayPal response. PayPal order ID: %s; EDD order ID: %d', esc_html( $response->id ), $payment_id ) ); - - edd_update_payment_meta( $payment_id, 'paypal_order_id', sanitize_text_field( $response->id ) ); - - /* - * Send successfully created order ID back. - * We also send back a new nonce, for verification in the next step: `capture_order()`. - * If the user was just logged into a new account, the previously sent nonce may have - * become invalid. - */ - $timestamp = time(); - wp_send_json_success( array( - 'paypal_order_id' => $response->id, - 'edd_order_id' => $payment_id, - 'nonce' => wp_create_nonce( 'edd_process_paypal' ), - 'timestamp' => $timestamp, - 'token' => \EDD\Utils\Tokenizer::tokenize( $timestamp ), - ) ); - } catch ( Authentication_Exception $e ) { - throw new Gateway_Exception( __( 'An authentication error occurred. Please try again.', 'easy-digital-downloads' ), $e->getCode(), $e->getMessage() ); - } catch ( API_Exception $e ) { - throw new Gateway_Exception( __( 'An error occurred while communicating with PayPal. Please try again.', 'easy-digital-downloads' ), $e->getCode(), $e->getMessage() ); - } - } catch ( Gateway_Exception $e ) { - if ( ! isset( $payment_id ) ) { - $payment_id = 0; - } - - $e->record_gateway_error( $payment_id ); - - wp_send_json_error( edd_build_errors_html( array( - 'paypal-error' => $e->getMessage() - ) ) ); - } -} - -add_action( 'edd_gateway_paypal_commerce', __NAMESPACE__ . '\create_order', 9 ); - -/** - * Captures the order in PayPal - * - * @since 2.11 - */ -function capture_order() { - edd_debug_log( 'PayPal - capture_order()' ); - try { - - $token = isset( $_POST['token'] ) ? sanitize_text_field( $_POST['token'] ) : ''; - $timestamp = isset( $_POST['timestamp'] ) ? sanitize_text_field( $_POST['timestamp'] ) : ''; - - if ( ! empty( $timestamp ) && ! empty( $token ) ) { - if ( !\EDD\Utils\Tokenizer::is_token_valid( $token, $timestamp ) ) { - throw new Gateway_Exception( - __('A validation error occurred. Please try again.', 'easy-digital-downloads'), - 403, - 'Token validation failed.' - ); - } - } elseif ( empty( $token ) && ! empty( $_POST['edd_process_paypal_nonce'] ) ) { - if ( ! wp_verify_nonce( $_POST['edd_process_paypal_nonce'], 'edd_process_paypal' ) ) { - throw new Gateway_Exception( - __( 'A validation error occurred. Please try again.', 'easy-digital-downloads' ), - 403, - 'Nonce validation failed.' - ); - } - } else { - throw new Gateway_Exception( - __( 'A validation error occurred. Please try again.', 'easy-digital-downloads' ), - 400, - 'Missing validation fields.' - ); - } - - if ( empty( $_POST['paypal_order_id'] ) ) { - throw new Gateway_Exception( - __( 'An unexpected error occurred. Please try again.', 'easy-digital-downloads' ), - 400, - 'Missing PayPal order ID during capture.' - ); - } - - try { - $api = new API(); - $response = $api->make_request( 'v2/checkout/orders/' . urlencode( $_POST['paypal_order_id'] ) . '/capture' ); - - edd_debug_log( sprintf( '-- PayPal Response code: %d; order ID: %s', $api->last_response_code, esc_html( $_POST['paypal_order_id'] ) ) ); - - if ( ! in_array( $api->last_response_code, array( 200, 201 ) ) ) { - $message = ! empty( $response->message ) ? $response->message : __( 'Failed to process payment. Please try again.', 'easy-digital-downloads' ); - - /* - * If capture failed due to funding source, we want to send a `restart` back to PayPal. - * @link https://developer.paypal.com/docs/checkout/integration-features/funding-failure/ - */ - if ( ! empty( $response->details ) && is_array( $response->details ) ) { - foreach ( $response->details as $detail ) { - if ( isset( $detail->issue ) && 'INSTRUMENT_DECLINED' === $detail->issue ) { - $message = __( 'Unable to complete your order with your chosen payment method. Please choose a new funding source.', 'easy-digital-downloads' ); - $retry = true; - break; - } - } - } - - throw new Gateway_Exception( - $message, - 400, - sprintf( 'Order capture failure. PayPal response: %s', json_encode( $response ) ) - ); - } - - $payment = $transaction_id = false; - if ( isset( $response->purchase_units ) && is_array( $response->purchase_units ) ) { - foreach ( $response->purchase_units as $purchase_unit ) { - if ( ! empty( $purchase_unit->reference_id ) ) { - $payment = edd_get_payment_by( 'key', $purchase_unit->reference_id ); - $transaction_id = isset( $purchase_unit->payments->captures[0]->id ) ? $purchase_unit->payments->captures[0]->id : false; - - if ( ! empty( $payment ) && isset( $purchase_unit->payments->captures[0]->status ) ) { - if ( 'COMPLETED' === strtoupper( $purchase_unit->payments->captures[0]->status ) ) { - $payment->status = 'complete'; - } elseif( 'DECLINED' === strtoupper( $purchase_unit->payments->captures[0]->status ) ) { - $payment->status = 'failed'; - } - } - break; - } - } - } - - if ( ! empty( $payment ) ) { - /** - * Buy Now Button - * - * Fill in missing data when using "Buy Now". This bypasses checkout so not all information - * was collected prior to payment. Instead, we pull it from the PayPal info. - */ - if ( empty( $payment->email ) ) { - if ( ! empty( $response->payer->email_address ) ) { - $payment->email = sanitize_text_field( $response->payer->email_address ); - } - if ( empty( $payment->first_name ) && ! empty( $response->payer->name->given_name ) ) { - $payment->first_name = sanitize_text_field( $response->payer->name->given_name ); - } - if ( empty( $payment->last_name ) && ! empty( $response->payer->name->surname ) ) { - $payment->last_name = sanitize_text_field( $response->payer->name->surname ); - } - - if ( empty( $payment->customer_id ) && ! empty( $payment->email ) ) { - $customer = new \EDD_Customer( $payment->email ); - - if ( $customer->id < 1 ) { - $customer->create( array( - 'email' => $payment->email, - 'name' => trim( sprintf( '%s %s', $payment->first_name, $payment->last_name ) ), - 'user_id' => $payment->user_id - ) ); - } - } - } - - if ( ! empty( $transaction_id ) ) { - $payment->transaction_id = sanitize_text_field( $transaction_id ); - - edd_insert_payment_note( $payment->ID, sprintf( - /* Translators: %s - transaction ID */ - __( 'PayPal Transaction ID: %s', 'easy-digital-downloads' ), - esc_html( $transaction_id ) - ) ); - } - - $payment->save(); - - if ( 'failed' === $payment->status ) { - $retry = true; - throw new Gateway_Exception( - __( 'Your payment was declined. Please try a new payment method.', 'easy-digital-downloads' ), - 400, - sprintf( 'Order capture failure. PayPal response: %s', json_encode( $response ) ) - ); - } - } - - wp_send_json_success( array( 'redirect_url' => edd_get_success_page_uri() ) ); - } catch ( Authentication_Exception $e ) { - throw new Gateway_Exception( __( 'An authentication error occurred. Please try again.', 'easy-digital-downloads' ), $e->getCode(), $e->getMessage() ); - } catch ( API_Exception $e ) { - throw new Gateway_Exception( __( 'An error occurred while communicating with PayPal. Please try again.', 'easy-digital-downloads' ), $e->getCode(), $e->getMessage() ); - } - } catch ( Gateway_Exception $e ) { - if ( ! isset( $payment_id ) ) { - $payment_id = 0; - } - - $e->record_gateway_error( $payment_id ); - - wp_send_json_error( array( - 'message' => edd_build_errors_html( array( - 'paypal_capture_failure' => $e->getMessage() - ) ), - 'retry' => isset( $retry ) ? $retry : false - ) ); - } -} - -add_action( 'wp_ajax_nopriv_edd_capture_paypal_order', __NAMESPACE__ . '\capture_order' ); -add_action( 'wp_ajax_edd_capture_paypal_order', __NAMESPACE__ . '\capture_order' ); - -/** - * Gets a fresh set of gateway options when a PayPal order is cancelled. - * @link https://github.com/awesomemotive/easy-digital-downloads/issues/8883 - * - * @since 2.11.3 - * @return void - */ -function cancel_order() { - $nonces = array(); - $gateways = edd_get_enabled_payment_gateways( true ); - foreach ( $gateways as $gateway_id => $gateway ) { - $nonces[ $gateway_id ] = wp_create_nonce( 'edd-gateway-selected-' . esc_attr( $gateway_id ) ); - } - - wp_send_json_success( - array( - 'nonces' => $nonces, - ) - ); -} -add_action( 'wp_ajax_nopriv_edd_cancel_paypal_order', __NAMESPACE__ . '\cancel_order' ); -add_action( 'wp_ajax_edd_cancel_paypal_order', __NAMESPACE__ . '\cancel_order' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-account-status-validator.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-account-status-validator.php deleted file mode 100644 index f44c3ff3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-account-status-validator.php +++ /dev/null @@ -1,178 +0,0 @@ -mode = $mode; - - // Set up base error objects. - $this->errors_for_credentials = new \WP_Error(); - $this->errors_for_merchant_account = new \WP_Error(); - $this->errors_for_webhook = new \WP_Error(); - } - - /** - * Checks everything. - * - * @since 2.11 - */ - public function check() { - $this->check_rest(); - $this->check_merchant_account(); - $this->check_webhook(); - } - - /** - * Checks for valid REST API credentials. - * - * @since 2.11 - */ - public function check_rest() { - $credentials = array( - 'client_id' => edd_get_option( 'paypal_' . $this->mode . '_client_id' ), - 'client_secret' => edd_get_option( 'paypal_' . $this->mode . '_client_secret' ), - ); - - foreach ( $credentials as $credential ) { - if ( empty( $credential ) ) { - $this->errors_for_credentials->add( 'no_credentials', __( 'Not connected.', 'easy-digital-downloads' ) ); - break; - } - } - } - - /** - * Determines if the merchant account is ready to accept payments. - * It's possible (I think) to have valid API credentials ( @see AccountStatusValidator::check_rest() ) - * but still be unable to start taking payments, such as because your account - * email hasn't been confirmed yet. - * - * @since 2.11 - */ - public function check_merchant_account() { - try { - $this->merchant_details = MerchantAccount::retrieve(); - $this->merchant_details->validate(); - - if ( ! $this->merchant_details->is_account_ready() ) { - foreach ( $this->merchant_details->get_errors()->get_error_codes() as $code ) { - $this->errors_for_merchant_account->add( $code, $this->merchant_details->get_errors()->get_error_message( $code ) ); - } - } - } catch ( Exceptions\MissingMerchantDetails $e ) { - $this->errors_for_merchant_account->add( 'missing_merchant_details', __( 'Missing merchant details from PayPal. Please reconnect and make sure you click the button to be redirected back to your site.', 'easy-digital-downloads' ) ); - } catch ( Exceptions\InvalidMerchantDetails $e ) { - $this->errors_for_merchant_account->add( 'invalid_merchant_details', $e->getMessage() ); - } - } - - /** - * Confirms that the webhook is set up and has all the necessary events registered. - * - * @since 2.11 - */ - public function check_webhook() { - try { - $this->webhook = Webhooks\get_webhook_details( $this->mode ); - if ( empty( $this->webhook->id ) ) { - throw new \Exception( __( 'Webhook not configured. Some actions may not work properly.', 'easy-digital-downloads' ) ); - } - - // Now compare the events to make sure we have them all. - $expected_events = array_keys( Webhooks\get_webhook_events( $this->mode ) ); - - if ( ! empty( $this->webhook->event_types ) && is_array( $this->webhook->event_types ) ) { - foreach ( $this->webhook->event_types as $event_type ) { - if ( ! empty( $event_type->name ) && ! empty( $event_type->status ) && 'ENABLED' === strtoupper( $event_type->status ) ) { - $this->enabled_webhook_events[] = $event_type->name; - } - } - } - - $missing_events = array_diff( $expected_events, $this->enabled_webhook_events ); - $number_missing = count( $missing_events ); - - if ( $number_missing ) { - $this->errors_for_webhook->add( 'missing_events', _n( - 'Webhook is configured but missing an event. Click "Sync Webhook" to correct this.', - 'Webhook is configured but missing events. Click "Sync Webhook" to correct this.', - $number_missing, - 'easy-digital-downloads' - ) ); - } - } catch ( \Exception $e ) { - $this->errors_for_webhook->add( 'webhook_missing', $e->getMessage() ); - } - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-merchant-account.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-merchant-account.php deleted file mode 100644 index 8491e0fd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-merchant-account.php +++ /dev/null @@ -1,193 +0,0 @@ - $value ) { - $this->{$key} = $value; - } - - $this->wp_error = new \WP_Error(); - } - - /** - * Builds a new MerchantAccount object from a JSON object. - * - * @since 2.11 - * - * @param string $json - * - * @return MerchantAccount - */ - public static function from_json( $json ) { - $merchant_details = json_decode( $json, true ); - if ( empty( $merchant_details ) || ! is_array( $merchant_details ) ) { - $merchant_details = array(); - } - - return new MerchantAccount( $merchant_details ); - } - - /** - * Converts the account details to JSON. - * - * @since 2.11 - * - * @return string|false - */ - public function to_json() { - return json_encode( get_object_vars( $this ) ); - } - - /** - * Determines whether or not the details are valid. - * Note: This does NOT determine actual "ready to accept payments" status, it just - * verifies that we have all the information we need to determine that. - * - * @throws MissingMerchantDetails - * @throws InvalidMerchantDetails - */ - public function validate() { - if ( empty( $this->merchant_id ) ) { - throw new MissingMerchantDetails(); - } - - $required_properties = array( - 'merchant_id', - 'payments_receivable', - 'primary_email_confirmed', - 'products', - ); - - $valid_properties = array(); - foreach( $required_properties as $property ) { - if ( property_exists( $this, $property ) && ! is_null( $this->{$property} ) ) { - $valid_properties[] = $property; - } - } - - $difference = array_diff( $required_properties, $valid_properties ); - - if ( $difference ) { - throw new InvalidMerchantDetails( - 'Please click "Re-Check Payment Status" below to confirm your payment status.' - ); - } - } - - /** - * Determines whether or not the account is ready to accept payments. - * - * @since 2.11 - * - * @return bool - */ - public function is_account_ready() { - if ( ! $this->payments_receivable ) { - $this->wp_error->add( 'payments_receivable', __( 'Your account is unable to receive payments. Please contact PayPal customer support.', 'easy-digital-downloads' ) ); - } - - if ( ! $this->primary_email_confirmed ) { - $this->wp_error->add( - 'primary_email_confirmed', - __( 'Your PayPal email address needs to be confirmed.', 'easy-digital-downloads' ) - ); - } - - return empty( $this->wp_error->errors ); - } - - /** - * Retrieves errors preventing the account from being "ready". - * - * @see MerchantAccount::is_account_ready() - * - * @since 2.11 - * - * @return \WP_Error - */ - public function get_errors() { - return $this->wp_error; - } - - /** - * Returns the option name for the current mode. - * - * @since 2.11 - * - * @return string - */ - private static function get_option_name() { - return sprintf( - 'edd_paypal_%s_merchant_details', - edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE - ); - } - - /** - * Saves the merchant details. - * - * @since 2.11 - */ - public function save() { - update_option( self::get_option_name(), $this->to_json() ); - } - - /** - * Retrieves the saved merchant details. - * - * @since 2.11 - * - * @return MerchantAccount - * @throws \InvalidArgumentException - */ - public static function retrieve() { - return self::from_json( get_option( self::get_option_name(), '' ) ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-paypal-api.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-paypal-api.php deleted file mode 100644 index 81696c0c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-paypal-api.php +++ /dev/null @@ -1,271 +0,0 @@ -mode = $mode; - - if ( self::MODE_SANDBOX === $mode ) { - $this->api_url = 'https://api-m.sandbox.paypal.com'; - } else { - $this->api_url = 'https://api-m.paypal.com'; - } - - if ( empty( $credentials ) ) { - $credentials = array( - 'client_id' => edd_get_option( 'paypal_' . $this->mode . '_client_id' ), - 'client_secret' => edd_get_option( 'paypal_' . $this->mode . '_client_secret' ), - ); - } - - $this->set_credentials( $credentials ); - } - - /** - * Magic getter - * - * @param string $property - * - * @since 2.10 - * @return mixed - */ - public function __get( $property ) { - return isset( $this->{$property} ) ? $this->{$property} : null; - } - - /** - * Sets the credentials to use for API requests. - * - * @param array $creds { - * Credentials to set. - * - * @type string $client_id PayPal client ID. - * @type string $client_secret PayPal client secret. - * @type string $cache_key Cache key used for storing the access token until it expires. Should be unique to - * the set of credentials. The mode is automatically appended, so should not be - * included manually. - * } - * - * @since 2.11 - * @throws Authentication_Exception - */ - public function set_credentials( $creds ) { - $creds = wp_parse_args( $creds, array( - 'client_id' => '', - 'client_secret' => '', - 'cache_key' => 'edd_paypal_commerce_access_token' - ) ); - - $required_creds = array( 'client_id', 'client_secret', 'cache_key' ); - - foreach ( $required_creds as $cred_id ) { - if ( empty( $creds[ $cred_id ] ) ) { - throw new Authentication_Exception( sprintf( - /* Translators: %s - The ID of the PayPal credential */ - __( 'Missing PayPal credential: %s', 'easy-digital-downloads' ), - $cred_id - ) ); - } - } - - foreach ( $creds as $cred_id => $cred_value ) { - $this->{$cred_id} = $cred_value; - } - - $this->token_cache_key = sanitize_key( $creds['cache_key'] . '_' . $this->mode ); - } - - /** - * Retrieves the access token. This checks cache first, and if the cached token isn't valid then - * a new one is generated from the API. - * - * @since 2.11 - * @return Token - * @throws API_Exception - */ - public function get_access_token() { - try { - $token = Token::from_json( (string) get_option( $this->token_cache_key ) ); - - return ! $token->is_expired() ? $token : $this->generate_access_token(); - } catch ( \RuntimeException $e ) { - return $this->generate_access_token(); - } - } - - /** - * Generates a new access token and caches it. - * - * @since 2.11 - * @return Token - * @throws API_Exception - */ - private function generate_access_token() { - $response = wp_remote_post( $this->api_url . '/v1/oauth2/token', array( - 'headers' => array( - 'Content-Type' => 'application/x-www-form-urlencoded', - 'Authorization' => sprintf( 'Basic %s', base64_encode( sprintf( '%s:%s', $this->client_id, $this->client_secret ) ) ), - 'timeout' => 15 - ), - 'body' => array( - 'grant_type' => 'client_credentials' - ), - 'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ), - ) ); - - $body = json_decode( wp_remote_retrieve_body( $response ) ); - $code = intval( wp_remote_retrieve_response_code( $response ) ); - - if ( is_wp_error( $response ) ) { - throw new API_Exception( $response->get_error_message(), $code ); - } - - if ( ! empty( $body->error_description ) ) { - throw new API_Exception( $body->error_description, $code ); - } - - if ( 200 !== $code ) { - throw new API_Exception( sprintf( - /* Translators: %d - HTTP response code. */ - __( 'Unexpected response code: %d', 'easy-digital-downloads' ), - $code - ), $code ); - } - - $token = new Token( $body ); - - update_option( $this->token_cache_key, $token->to_json() ); - - return $token; - } - - /** - * Makes an API request. - * - * @param string $endpoint API endpoint. - * @param array $body Array of data to send in the request. - * @param array $headers Array of headers. - * @param string $method HTTP method. - * - * @since 2.11 - * @return mixed - * @throws API_Exception - */ - public function make_request( $endpoint, $body = array(), $headers = array(), $method = 'POST' ) { - $headers = wp_parse_args( $headers, array( - 'Content-Type' => 'application/json', - 'Authorization' => sprintf( 'Bearer %s', $this->get_access_token()->token() ), - 'PayPal-Partner-Attribution-Id' => EDD_PAYPAL_PARTNER_ATTRIBUTION_ID - ) ); - - $request_args = array( - 'method' => $method, - 'timeout' => 15, - 'headers' => $headers, - 'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ), - ); - - if ( ! empty( $body ) ) { - $request_args['body'] = json_encode( $body ); - } - - // In a few rare cases, we may be providing a full URL to `$endpoint` instead of just the path. - $api_url = ( 'https://' === substr( $endpoint, 0, 8 ) ) ? $endpoint : $this->api_url . '/' . $endpoint; - - $response = wp_remote_request( $api_url, $request_args ); - - if ( is_wp_error( $response ) ) { - throw new API_Exception( $response->get_error_message() ); - } - - $this->last_response_code = intval( wp_remote_retrieve_response_code( $response ) ); - - return json_decode( wp_remote_retrieve_body( $response ) ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-token.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-token.php deleted file mode 100644 index 25cc81e3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/class-token.php +++ /dev/null @@ -1,112 +0,0 @@ -created ) ) { - $token_object->created = time(); - } - - if ( ! $this->is_valid( $token_object ) ) { - throw new \RuntimeException( __( 'Invalid token.', 'easy-digital-downloads' ) ); - } - - $this->token_object = $token_object; - } - - /** - * Creates a new token from a JSON string. - * - * @param string $json - * - * @return Token - * @throws \Exception - */ - public static function from_json( $json ) { - return new Token( json_decode( $json ) ); - } - - /** - * Returns the token object as a JSON string. - * - * @since 2.11 - * @return string|false - */ - public function to_json() { - return json_encode( $this->token_object ); - } - - /** - * Determines whether or not the token has expired. - * - * @since 2.11 - * @return bool - */ - public function is_expired() { - // Regenerate tokens 10 minutes early, just in case. - $expires_in = $this->token_object->expires_in - ( 10 * MINUTE_IN_SECONDS ); - - return time() > $this->token_object->created + $expires_in; - } - - /** - * Returns the access token. - * - * @since 2.11 - * @return string - */ - public function token() { - return $this->token_object->access_token; - } - - /** - * Determines whether or not we have a valid token object. - * Note: This does not check the _expiration_ of the token, just validates that the expected - * data is _present_. - * - * @param object $token_object - * - * @since 2.11 - * @return bool - */ - private function is_valid( $token_object ) { - $required_properties = array( - 'created', - 'access_token', - 'expires_in' - ); - - foreach ( $required_properties as $property ) { - if ( ! isset( $token_object->{$property} ) ) { - return false; - } - } - - return true; - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/deprecated.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/deprecated.php deleted file mode 100644 index d2cfe653..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/deprecated.php +++ /dev/null @@ -1,102 +0,0 @@ -gateway ) { - return; - } - - $mode = ( 'live' === $payment->mode ) ? API::MODE_LIVE : API::MODE_SANDBOX; - - try { - $api = new API( $mode ); - } catch ( Exceptions\Authentication_Exception $e ) { - // If we don't have credentials. - return; - } - - $label = __( 'Refund Transaction in PayPal', 'easy-digital-downloads' ); - ?> - - ID ) ) { - return; - } - - if ( 'paypal_commerce' !== $payment->gateway || empty( $_POST['edd-paypal-commerce-refund'] ) ) { - return; - } - - // Payment status should be coming from "publish" or "revoked". - // @todo In 3.0 use `edd_get_refundable_order_statuses()` - if ( ! in_array( $payment->old_status, array( 'publish', 'complete', 'revoked', 'edd_subscription' ) ) ) { - return; - } - - // If the payment has already been refunded, bail. - if ( $payment->get_meta( '_edd_paypal_refunded', true ) ) { - return; - } - - // Process the refund. - try { - refund_transaction( $payment ); - } catch ( \Exception $e ) { - edd_insert_payment_note( $payment->ID, sprintf( - /* Translators: %s - The error message */ - __( 'Failed to refund transaction in PayPal. Error Message: %s', 'easy-digital-downloads' ), - $e->getMessage() - ) ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/exceptions/class-api-exception.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/exceptions/class-api-exception.php deleted file mode 100644 index 781afab4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/exceptions/class-api-exception.php +++ /dev/null @@ -1,17 +0,0 @@ -debug_message = $debug_message; - - parent::__construct( $message, $code ); - } - - /** - * Records a gateway error based off this exception. - * - * @param int $payment_id - * - * @since 2.11 - */ - public function record_gateway_error( $payment_id = 0 ) { - $message = ! empty( $this->debug_message ) ? $this->debug_message : $this->getMessage(); - - edd_record_gateway_error( - __( 'PayPal Gateway Error', 'easy-digital-downloads' ), - sprintf( - /* Translators: %d - HTTP response code; %s - Error message */ - __( 'Response Code: %d; Message: %s', 'easy-digital-downloads' ), - $this->getCode(), - $message - ), - $payment_id - ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/exceptions/class-invalid-merchant-details.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/exceptions/class-invalid-merchant-details.php deleted file mode 100644 index 6d115895..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/exceptions/class-invalid-merchant-details.php +++ /dev/null @@ -1,15 +0,0 @@ -check_merchant_account(); - - return empty( $validator->errors_for_merchant_account->errors ); -} - -/** - * Determines whether or not PayPal Standard should be enabled. - * This returns true if the store owner previously had a PayPal Standard connection but has not yet - * connected to the new REST API implementation. - * - * If PayPal Standard is enabled, then PayPal payments run through the legacy API. - * - * @param string $mode If omitted, current site mode is used. - * - * @since 2.11 - * @return bool - */ -function paypal_standard_enabled( $mode = '' ) { - if ( empty( $mode ) ) { - $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE; - } - - $rest_connection = has_rest_api_connection( $mode ); - $enabled = ! $rest_connection && edd_get_option( 'paypal_email' ); - - /** - * Filters whether or not PayPal Standard is enabled. - * - * @since 2.11 - * - * @param bool $enabled - */ - return apply_filters( 'edd_paypal_standard_enabled', $enabled ); -} - -/** - * Returns the partner merchant ID for a given mode. - * - * @param string $mode If omitted, current site mode is used. - * - * @since 2.11 - * @return string - */ -function get_partner_merchant_id( $mode = '' ) { - if ( empty( $mode ) ) { - $mode = edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE; - } - - if ( API::MODE_LIVE === $mode ) { - return EDD_PAYPAL_MERCHANT_ID; - } else { - return EDD_PAYPAL_SANDBOX_MERCHANT_ID; - } -} - -/** - * Returns the styles used for the PayPal buttons. - * - * @return array - */ -function get_button_styles() { - $styles = array( - 'layout' => 'vertical', - 'size' => 'responsive', - 'shape' => 'rect', - 'color' => 'gold', - 'label' => 'paypal' - ); - - if ( ! edd_is_checkout() ) { - $styles['layout'] = 'horizontal'; - $styles['label'] = 'buynow'; - } - - /** - * Filters the button styles. - * - * @since 2.11 - */ - return apply_filters( 'edd_paypal_smart_button_style', $styles ); -} - -/** - * Gets the PayPal purchase units without the individual item breakdown. - * - * @since 2.11.2 - * - * @param int $payment_id The payment/order ID. - * @param array $purchase_data The array of purchase data. - * @param array $payment_args The array created to insert the payment into the database. - * - * @return array - */ -function get_order_purchase_units_without_breakdown( $payment_id, $purchase_data, $payment_args ) { - $order_amount = array( - 'currency_code' => edd_get_currency(), - 'value' => (string) edd_sanitize_amount( $purchase_data['price'] ), - ); - if ( (float) $purchase_data['tax'] > 0 ) { - $order_amount['breakdown'] = array( - 'item_total' => array( - 'currency_code' => edd_get_currency(), - 'value' => (string) edd_sanitize_amount( $purchase_data['price'] - $purchase_data['tax'] ) - ), - 'tax_total' => array( - 'currency_code' => edd_get_currency(), - 'value' => (string) edd_sanitize_amount( $purchase_data['tax'] ), - ) - ); - } - - return array( - 'reference_id' => $payment_args['purchase_key'], - 'amount' => $order_amount, - 'custom_id' => $payment_id - ); -} - -/** - * Gets the PayPal purchase units. The order breakdown includes the order items, tax, and discount. - * - * @since 2.11.2 - * @param int $payment_id The payment/order ID. - * @param array $purchase_data The array of purchase data. - * @param array $payment_args The array created to insert the payment into the database. - * @return array - */ -function get_order_purchase_units( $payment_id, $purchase_data, $payment_args ) { - - $currency = edd_get_currency(); - $order_subtotal = $purchase_data['subtotal']; - $items = get_order_items( $purchase_data ); - // Adjust the order subtotal if any items are discounted. - foreach ( $items as &$item ) { - // A discount can be negative, so cast it to an absolute value for comparison. - if ( (float) abs( $item['discount'] ) > 0 ) { - $order_subtotal -= $item['discount']; - } - - // The discount amount is not passed to PayPal as part of the $item. - unset( $item['discount'] ); - } - - $discount = 0; - // Fees which are not item specific need to be added to the PayPal data as order items. - if ( ! empty( $purchase_data['fees'] ) ) { - foreach ( $purchase_data['fees'] as $fee ) { - if ( ! empty( $fee['download_id'] ) ) { - continue; - } - // Positive fees. - if ( floatval( $fee['amount'] ) > 0 ) { - $items[] = array( - 'name' => stripslashes_deep( html_entity_decode( wp_strip_all_tags( $fee['label'] ), ENT_COMPAT, 'UTF-8' ) ), - 'unit_amount' => array( - 'currency_code' => $currency, - 'value' => (string) edd_sanitize_amount( $fee['amount'] ), - ), - 'quantity' => 1, - ); - $order_subtotal += abs( $fee['amount'] ); - } else { - // This is a negative fee (discount) not assigned to a specific Download - $discount += abs( $fee['amount'] ); - } - } - } - - $order_amount = array( - 'currency_code' => $currency, - 'value' => (string) edd_sanitize_amount( $purchase_data['price'] ), - 'breakdown' => array( - 'item_total' => array( - 'currency_code' => $currency, - 'value' => (string) edd_sanitize_amount( $order_subtotal ), - ), - ), - ); - - $tax = (float) $purchase_data['tax'] > 0 ? $purchase_data['tax'] : 0; - if ( $tax > 0 ) { - $order_amount['breakdown']['tax_total'] = array( - 'currency_code' => $currency, - 'value' => (string) edd_sanitize_amount( $tax ), - ); - } - - // This is only added by negative global fees. - if ( $discount > 0 ) { - $order_amount['breakdown']['discount'] = array( - 'currency_code' => $currency, - 'value' => (string) edd_sanitize_amount( $discount ), - ); - } - - return array( - wp_parse_args( array( - 'amount' => $order_amount, - 'items' => $items - ), get_order_purchase_units_without_breakdown( $payment_id, $purchase_data, $payment_args ) ) - ); -} - -/** - * Gets an array of order items, formatted for PayPal, from the $purchase_data. - * - * @since 2.11.2 - * @param array $purchase_data - * @return array - */ -function get_order_items( $purchase_data ) { - // Create an array of items for the order. - $items = array(); - if ( ! is_array( $purchase_data['cart_details'] ) || empty( $purchase_data['cart_details'] ) ) { - return $items; - } - $i = 0; - foreach ( $purchase_data['cart_details'] as $item ) { - $item_amount = ( $item['subtotal'] / $item['quantity'] ) - ( $item['discount'] / $item['quantity'] ); - - if ( $item_amount <= 0 ) { - $item_amount = 0; - } - - $substr_func = function_exists( 'mb_substr' ) ? 'mb_substr' : 'substr'; - $name = $substr_func( edd_get_cart_item_name( $item ), 0, 127 ); - - $items[ $i ] = array( - 'name' => stripslashes_deep( html_entity_decode( $name, ENT_COMPAT, 'UTF-8' ) ), - 'quantity' => $item['quantity'], - 'unit_amount' => array( - 'currency_code' => edd_get_currency(), - 'value' => (string) edd_sanitize_amount( $item_amount ), - ), - 'discount' => $item['discount'], // This is unset later and never sent to PayPal. - ); - if ( edd_use_skus() ) { - $sku = edd_get_download_sku( $item['id'] ); - if ( ! empty( $sku ) && '-' !== $sku ) { - $items[ $i ]['sku'] = $sku; - } - } - $i++; - } - - return $items; -} - -/** - * Attempts to detect if there's an item total mismatch. This means the individual item breakdowns don't - * add up to our proposed totals. - * - * @link https://github.com/easydigitaldownloads/easy-digital-downloads/pull/8835#issuecomment-921759101 - * @internal Not intended for public use. - * - * @since 2.11.2 - * - * @param object $response - * - * @return bool - */ -function _is_item_total_mismatch( $response ) { - if ( ! isset( $response->details ) || ! is_array( $response->details ) ) { - return false; - } - - foreach( $response->details as $detail ) { - if ( ! empty( $detail->issue ) && 'ITEM_TOTAL_MISMATCH' === strtoupper( $detail->issue ) ) { - return true; - } - } - - return false; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/gateway-filters.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/gateway-filters.php deleted file mode 100644 index ac25096f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/gateway-filters.php +++ /dev/null @@ -1,74 +0,0 @@ -mode ) ? 'sandbox.' : ''; - $transaction_url = 'https://' . urlencode( $subdomain ) . 'paypal.com/activity/payment/' . urlencode( $transaction_id ); - - return '' . esc_html( $transaction_id ) . ''; -} - -add_filter( 'edd_payment_details_transaction_id-paypal_commerce', __NAMESPACE__ . '\link_transaction_id', 10, 2 ); - -/** - * By default, EDD_Payment converts an empty transaction ID to be the ID of the payment. - * We don't want that to happen... Empty should be empty. - * - * @since 2.11 - */ -add_filter( 'edd_get_payment_transaction_id-paypal_commerce', '__return_false' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/integrations.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/integrations.php deleted file mode 100644 index 36bf64d0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/integrations.php +++ /dev/null @@ -1,25 +0,0 @@ - 0 ) { - - // Append the data. - $encoded_data .= $arg_separator . $post_data; - - } else { - - // Check if POST is empty. - if ( empty( $_POST ) ) { - - // Nothing to do. - ipn_debug_log( 'post data not detected, bailing' ); - return; - - } else { - - // Loop through each POST. - foreach ( $_POST as $key => $value ) { - - // Encode the value and append the data. - $encoded_data .= $arg_separator . "$key=" . urlencode( $value ); - - } - - } - - } - - // Convert collected post data to an array. - parse_str( $encoded_data, $encoded_data_array ); - - // We're always going to validate the IPN here... - if ( ! edd_is_test_mode() ) { - - ipn_debug_log( 'preparing to verify IPN data' ); - - // Validate the IPN. - $remote_post_vars = array( - 'method' => 'POST', - 'timeout' => 45, - 'redirection' => 5, - 'httpversion' => '1.1', - 'blocking' => true, - 'body' => $encoded_data_array, - 'headers' => array( - 'host' => 'www.paypal.com', - 'connection' => 'close', - 'content-type' => 'application/x-www-form-urlencoded', - 'post' => '/cgi-bin/webscr HTTP/1.1', - - ), - 'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ), - ); - - // Get response. - $api_response = wp_remote_post( edd_get_paypal_redirect(), $remote_post_vars ); - $body = wp_remote_retrieve_body( $api_response ); - - if ( is_wp_error( $api_response ) ) { - /* Translators: %s - IPN Verification response */ - edd_record_gateway_error( __( 'IPN Error', 'easy-digital-downloads' ), sprintf( __( 'Invalid PayPal Commerce/Express IPN verification response. IPN data: %s', 'easy-digital-downloads' ), json_encode( $api_response ) ) ); - ipn_debug_log( 'verification failed. Data: ' . var_export( $body, true ) ); - status_header( 401 ); - return; // Something went wrong. - } - - if ( 'VERIFIED' !== $body ) { - /* Translators: %s - IPN Verification response */ - edd_record_gateway_error( __( 'IPN Error', 'easy-digital-downloads' ), sprintf( __( 'Invalid PayPal Commerce/Express IPN verification response. IPN data: %s', 'easy-digital-downloads' ), json_encode( $api_response ) ) ); - ipn_debug_log( 'verification failed. Data: ' . var_export( $body, true ) ); - status_header( 401 ); - return; // Response not okay. - } - - // We've verified that the IPN Check passed, we can proceed with processing the IPN data sent to us. - $verified = true; - - } - - /** - * The processIpn() method returned true if the IPN was "VERIFIED" and false if it was "INVALID". - */ - if ( ( $verified || edd_get_option( 'disable_paypal_verification' ) ) || isset( $_POST['verification_override'] ) || edd_is_test_mode() ) { - - status_header( 200 ); - - /** - * Note: Amounts get more properly sanitized on insert. - * - * @see EDD_Subscription::add_payment() - */ - if ( isset( $posted['amount'] ) ) { - $amount = (float) $posted['amount']; - } elseif ( isset( $posted['mc_gross'] ) ) { - $amount = (float) $posted['mc_gross']; - } else { - $amount = 0; - } - - $txn_type = isset( $posted['txn_type'] ) ? strtolower( $posted['txn_type'] ) : ''; - $payment_status = isset( $posted['payment_status'] ) ? strtolower( $posted['payment_status'] ) : ''; - $currency_code = isset( $posted['mc_currency'] ) ? $posted['mc_currency'] : $posted['currency_code']; - $transaction_id = isset( $posted['txn_id'] ) ? $posted['txn_id'] : ''; - - if ( empty( $txn_type ) && empty( $payment_status ) ) { - ipn_debug_log( 'No txn_type or payment_status in the IPN, bailing' ); - return; - } - - // Process webhooks from recurring first, as that is where most of the missing actions will come from. - if ( class_exists( 'EDD_Recurring' ) && isset( $posted['recurring_payment_id'] ) ) { - $posted = apply_filters( 'edd_recurring_ipn_post', $_POST ); // allow $_POST to be modified. - - $subscription = new \EDD_Subscription( $posted['recurring_payment_id'], true ); - - - // Bail if this is the very first payment. - if ( ! empty( $posted['payment_date'] ) && date( 'Y-n-d', strtotime( $subscription->created ) ) == date( 'Y-n-d', strtotime( $posted['payment_date'] ) ) ) { - ipn_debug_log( 'IPN for subscription ' . $subscription->id . ': processing stopped because this is the initial payment.' ); - return; - } - - $parent_payment = edd_get_payment( $subscription->parent_payment_id ); - if ( 'paypal_commerce' !== $parent_payment->gateway ) { - ipn_debug_log( 'This is not for PayPal Commerce - bailing' ); - return; - } - - if ( empty( $subscription->id ) || $subscription->id < 1 ) { - ipn_debug_log( 'no matching subscription found detected, bailing. Data: ' . var_export( $posted, true ) ); - die( 'No subscription found' ); - } - - ipn_debug_log( 'Processing ' . $txn_type . ' IPN for subscription ' . $subscription->id ); - - // Subscriptions. - switch ( $txn_type ) : - - case 'recurring_payment': - case 'recurring_payment_outstanding_payment': - $transaction_exists = edd_get_order_transaction_by( 'transaction_id', $transaction_id ); - if ( ! empty( $transaction_exists ) ) { - ipn_debug_log( 'Transaction ID ' . $transaction_id . ' arlready processed.' ); - return; - } - - $sub_currency = edd_get_payment_currency_code( $subscription->parent_payment_id ); - - // verify details. - if ( ! empty( $sub_currency ) && strtolower( $currency_code ) != strtolower( $sub_currency ) ) { - - // the currency code is invalid - // @TODO: Does this need a parent_id for better error organization? - /* Translators: %s - The payment data sent via the IPN */ - edd_record_gateway_error( __( 'Invalid Currency Code', 'easy-digital-downloads' ), sprintf( __( 'The currency code in an IPN request did not match the site currency code. Payment data: %s', 'easy-digital-downloads' ), json_encode( $posted ) ) ); - - ipn_debug_log( 'subscription ' . $subscription->id . ': invalid currency code detected in IPN data: ' . var_export( $posted, true ) ); - - die( 'invalid currency code' ); - - } - - if ( 'failed' === $payment_status ) { - if ( 'failing' === $subscription->status ) { - ipn_debug_log( 'Subscription ID ' . $subscription->id . ' arlready failing.' ); - return; - } - - $transaction_link = '' . $transaction_id . ''; - /* Translators: %s - The transaction ID of the failed payment */ - $subscription->add_note( sprintf( __( 'Transaction ID %s failed in PayPal', 'easy-digital-downloads' ), $transaction_link ) ); - $subscription->failing(); - - ipn_debug_log( 'subscription ' . $subscription->id . ': payment failed in PayPal' ); - - die( 'Subscription payment failed' ); - - } - - ipn_debug_log( 'subscription ' . $subscription->id . ': preparing to insert renewal payment' ); - - // Build the array for adding a subscription order. - $subscription_payment_args = array( - 'amount' => $amount, - 'transaction_id' => $transaction_id, - ); - - // Create a DateTime object of the payment_date, so we can adjust as needed. - $subscription_payment_date = new \DateTime( $posted['payment_date'] ); - - // To make sure we don't inadverntatly fail, make sure the date was parsed correctly before working with it. - if ( $subscription_payment_date instanceof \DateTime ) { - /** - * Convert to GMT, as that is what EDD 3.0 expects the times to be in. - */ - $subscription_payment_date->setTimezone( new \DateTimeZone( 'GMT' ) ); - - // Now add the date into the arguments for creating the renewal payment. - $subscription_payment_args['date'] = $subscription_payment_date->format( 'Y-m-d H:i:s' ); - } - - // when a user makes a recurring payment. - $payment_id = $subscription->add_payment( $subscription_payment_args ); - - if ( ! empty( $payment_id ) ) { - ipn_debug_log( 'subscription ' . $subscription->id . ': renewal payment was recorded successfully, preparing to renew subscription' ); - $subscription->renew( $payment_id ); - - if ( 'recurring_payment_outstanding_payment' === $txn_type ) { - /* Translators: %s - The collected outstanding balance of the subscription */ - $subscription->add_note( sprintf( __( 'Outstanding subscription balance of %s collected successfully.', 'easy-digital-downloads' ), $amount ) ); - } - } else { - ipn_debug_log( 'subscription ' . $subscription->id . ': renewal payment creation appeared to fail.' ); - } - - die( 'Subscription payment successful' ); - - break; - - case 'recurring_payment_profile_cancel': - case 'recurring_payment_suspended': - case 'recurring_payment_suspended_due_to_max_failed_payment': - if ( 'cancelled' === $subscription->status ) { - ipn_debug_log( 'Subscription ID ' . $subscription->id . ' arlready cancelled.' ); - return; - } - - $subscription->cancel(); - ipn_debug_log( 'subscription ' . $subscription->id . ': subscription cancelled.' ); - - - die( 'Subscription cancelled' ); - - break; - - case 'recurring_payment_failed': - if ( 'failing' === $subscription->status ) { - ipn_debug_log( 'Subscription ID ' . $subscription->id . ' arlready failing.' ); - return; - } - - $subscription->failing(); - ipn_debug_log( 'subscription ' . $subscription->id . ': subscription failing.' ); - do_action( 'edd_recurring_payment_failed', $subscription ); - - break; - - case 'recurring_payment_expired': - if ( 'completed' === $subscription->status ) { - ipn_debug_log( 'Subscription ID ' . $subscription->id . ' arlready completed.' ); - return; - } - - $subscription->complete(); - ipn_debug_log( 'subscription ' . $subscription->id . ': subscription completed.' ); - - die( 'Subscription completed' ); - break; - - endswitch; - } - - // We've processed recurring, now let's handle non-recurring IPNs. - - // First, if this isn't a refund or reversal, we don't need to process anything. - $statuses_to_process = array( 'refunded', 'reversed' ); - if ( ! in_array( $payment_status, $statuses_to_process, true ) ) { - ipn_debug_log( 'Payment Status was not a status we need to process: ' . $payment_status ); - return; - } - - $order_id = 0; - - if ( ! empty( $posted['parent_txn_id'] ) ) { - $order_id = edd_get_order_id_from_transaction_id( $posted['parent_txn_id'] ); - } - - /** - * This section of the IPN should only affect processing refunds or returns on orders made previous, not new - * orders, so we can just look for the parent_txn_id, and if it's not here, bail as this is a new order that - * should be handeled with webhooks. - */ - if ( empty( $order_id ) ) { - ipn_debug_log( 'IPN Track ID ' . $posted['ipn_track_id'] . ' does not need to be processed as it does not belong to an existing record.' ); - return; - } - - $order = edd_get_order( $order_id ); - if ( 'paypal_commerce' !== $order->gateway ) { - ipn_debug_log( 'Order ' . $order_id . ' was not with PayPal Commerce' ); - return; - } - - if ( 'refunded' === $order->status ) { - ipn_debug_log( 'Order ' . $order_id . ' is already refunded' ); - } - - $transaction_exists = edd_get_order_transaction_by( 'transaction_id', $transaction_id ); - if ( ! empty( $transaction_exists ) ) { - ipn_debug_log( 'Refund transaction for ' . $transaction_id . ' already exists' ); - return; - } - - $order_amount = edd_get_payment_amount( $order->id ); - $refunded_amount = ! empty( $amount ) ? $amount : $order_amount; - $currency = ! empty( $currency_code ) ? $currency_code : $order->currency; - - ipn_debug_log( 'Processing a refund for original transaction ' . $order->get_transaction_id() ); - - /* Translators: %1$s - Amount refunded; %2$s - Original payment ID; %3$s - Refund transaction ID */ - $payment_note = sprintf( - esc_html__( 'Amount: %1$s; Payment transaction ID: %2$s; Refund transaction ID: %3$s', 'easy-digital-downloads' ), - edd_currency_filter( edd_format_amount( $refunded_amount ), $currency ), - esc_html( $order->get_transaction_id() ), - esc_html( $transaction_id ) - ); - - // Partial refund. - if ( (float) $refunded_amount < (float) $order_amount ) { - edd_add_note( - array( - 'object_type' => 'order', - 'object_id' => $order->id, - 'content' => __( 'Partial refund processed in PayPal.', 'easy-digital-downloads' ) . ' ' . $payment_note, - ) - ); - edd_update_order_status( $order->id, 'partially_refunded' ); - } else { - // Full refund. - edd_add_note( - array( - 'object_type' => 'order', - 'object_id' => $order->id, - 'content' => __( 'Full refund processed in PayPal.', 'easy-digital-downloads' ) . ' ' . $payment_note, - ) - ); - edd_update_order_status( $order->id, 'refunded' ); - } - - die( 'Refund processed' ); - } else { - ipn_debug_log( 'verification failed, bailing.' ); - status_header( 400 ); - die( 'invalid IPN' ); - - } -} -add_action( 'init', __NAMESPACE__ . '\listen_for_ipn' ); - -/** - * Helper method to prefix any calls to edd_debug_log - * - * @since 3.1.0.3 - * @uses edd_debug_log - * - * @param string $message The message to send to the debug logging. - */ -function ipn_debug_log( $message ) { - edd_debug_log( 'PayPal Commerce IPN: ' . $message ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/paypal.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/paypal.php deleted file mode 100644 index deed5f12..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/paypal.php +++ /dev/null @@ -1,79 +0,0 @@ -gateway ) { - return; - } - - $mode = ( 'live' === $order->mode ) ? API::MODE_LIVE : API::MODE_SANDBOX; - - try { - new API( $mode ); - } catch ( Exceptions\Authentication_Exception $e ) { - // If we don't have credentials. - return; - } - ?> -
    -
    - - -
    -
    - gateway ) || 'paypal_commerce' !== $order->gateway ) { - return; - } - - // Get our data out of the serialized string. - parse_str( $_POST['data'], $form_data ); - - if ( empty( $form_data['edd-paypal-commerce-refund'] ) ) { - edd_add_note( array( - 'object_id' => $order_id, - 'object_type' => 'order', - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'content' => __( 'Transaction not refunded in PayPal, as checkbox was not selected.', 'easy-digital-downloads' ) - ) ); - - return; - } - - $refund = edd_get_order( $refund_id ); - if ( empty( $refund->total ) ) { - return; - } - - try { - refund_transaction( $order, $refund ); - } catch ( \Exception $e ) { - edd_debug_log( sprintf( - 'Failure when processing refund #%d. Message: %s', - $refund->id, - $e->getMessage() - ), true ); - - edd_add_note( array( - 'object_id' => $order->id, - 'object_type' => 'order', - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'content' => sprintf( - /* Translators: %d - ID of the refund; %s - error message from PayPal */ - __( 'Failure when processing PayPal refund #%d: %s', 'easy-digital-downloads' ), - $refund->id, - $e->getMessage() - ) - ) ); - } -}, 10, 3 ); - -/** - * Refunds a transaction in PayPal. - * - * @link https://developer.paypal.com/docs/api/payments/v2/#captures_refund - * - * @param \EDD_Payment|Order $payment_or_order - * @param Order|null $refund_object - * - * @since 2.11 - * @throws Authentication_Exception - * @throws API_Exception - * @throws \Exception - */ -function refund_transaction( $payment_or_order, Order $refund_object = null ) { - /* - * Internally we want to work with an Order object, but we also need - * an EDD_Payment object for backwards compatibility in the hooks. - */ - $order = $payment = false; - if ( $payment_or_order instanceof Order ) { - $order = $payment_or_order; - $payment = edd_get_payment( $order->id ); - } elseif ( $payment_or_order instanceof \EDD_Payment ) { - $payment = $payment_or_order; - $order = edd_get_order( $payment->ID ); - } - - if ( empty( $order ) || ! $order instanceof Order ) { - return; - } - - $transaction_id = $order->get_transaction_id(); - - if ( empty( $transaction_id ) ) { - throw new \Exception( __( 'Missing transaction ID.', 'easy-digital-downloads' ) ); - } - - $mode = ( 'live' === $order->mode ) ? API::MODE_LIVE : API::MODE_SANDBOX; - - $api = new API( $mode ); - - $args = $refund_object instanceof Order ? array( 'invoice_id' => $refund_object->id ) : array(); - if ( $refund_object instanceof Order && abs( $refund_object->total ) !== abs( $order->total ) ) { - $args['amount'] = array( - 'value' => abs( $refund_object->total ), - 'currency_code' => $refund_object->currency, - ); - } - - $response = $api->make_request( - 'v2/payments/captures/' . urlencode( $transaction_id ) . '/refund', - $args, - array( - 'Prefer' => 'return=representation', - ) - ); - - if ( 201 !== $api->last_response_code ) { - throw new API_Exception( sprintf( - /* Translators: %d - The HTTP response code; %s - Full API response from PayPal */ - __( 'Unexpected response code: %d. Response: %s', 'easy-digital-downloads' ), - $api->last_response_code, - json_encode( $response ) - ), $api->last_response_code ); - } - - if ( empty( $response->status ) || 'COMPLETED' !== strtoupper( $response->status ) ) { - throw new API_Exception( sprintf( - /* Translators: %s - API response from PayPal */ - __( 'Missing or unexpected refund status. Response: %s', 'easy-digital-downloads' ), - json_encode( $response ) - ) ); - } - - // At this point we can assume it was successful. - edd_update_order_meta( $order->id, '_edd_paypal_refunded', true ); - - if ( ! empty( $response->id ) ) { - // Add a note to the original order, and, if provided, the new refund object. - if ( isset( $response->amount->value ) ) { - $note_message = sprintf( - /* Translators: %1$s - amount refunded; %$2$s - transaction ID. */ - __( '%1$s refunded in PayPal. Refund transaction ID: %2$s', 'easy-digital-downloads' ), - edd_currency_filter( edd_format_amount( $response->amount->value ), $order->currency ), - esc_html( $response->id ) - ); - } else { - $note_message = sprintf( - /* Translators: %s - ID of the refund in PayPal */ - __( 'Successfully refunded in PayPal. Refund transaction ID: %s', 'easy-digital-downloads' ), - esc_html( $response->id ) - ); - } - - $note_object_ids = array( $order->id ); - if ( $refund_object instanceof Order ) { - $note_object_ids[] = $refund_object->id; - } - - foreach ( $note_object_ids as $note_object_id ) { - edd_add_note( array( - 'object_id' => $note_object_id, - 'object_type' => 'order', - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'content' => $note_message - ) ); - } - - // Add a negative transaction. - if ( $refund_object instanceof Order && isset( $response->amount->value ) ) { - edd_add_order_transaction( array( - 'object_id' => $refund_object->id, - 'object_type' => 'order', - 'transaction_id' => sanitize_text_field( $response->id ), - 'gateway' => 'paypal_commerce', - 'status' => 'complete', - 'total' => edd_negate_amount( $response->amount->value ), - ) ); - } - } - - /** - * Triggers after a successful refund. - * - * @param \EDD_Payment $payment - */ - do_action( 'edd_paypal_refund_purchase', $payment ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/scripts.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/scripts.php deleted file mode 100644 index 8b046949..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/paypal/scripts.php +++ /dev/null @@ -1,180 +0,0 @@ - urlencode( $api->client_id ), - 'currency' => urlencode( strtoupper( edd_get_currency() ) ), - 'intent' => 'capture', - 'disable-funding' => 'card,credit,bancontact,blik,eps,giropay,ideal,mercadopago,mybank,p24,sepa,sofort,venmo' - ) ); - - wp_register_script( - 'sandhills-paypal-js-sdk', - esc_url_raw( add_query_arg( array_filter( $sdk_query_args ), 'https://www.paypal.com/sdk/js' ) ) - ); - - wp_register_script( - 'edd-paypal', - EDD_PLUGIN_URL . 'assets/js/paypal-checkout.js', - array( - 'sandhills-paypal-js-sdk', - 'jquery', - 'edd-ajax' - ), - EDD_VERSION, - true - ); - - if ( edd_is_checkout() || $force_load ) { - maybe_enqueue_polyfills(); - - wp_enqueue_script( 'sandhills-paypal-js-sdk' ); - wp_enqueue_script( 'edd-paypal' ); - - $paypal_script_vars = array( - /** - * Filters the order approval handler. - * - * @since 2.11 - */ - 'approvalAction' => apply_filters( 'edd_paypal_on_approve_action', 'edd_capture_paypal_order' ), - 'defaultError' => edd_build_errors_html( array( - 'paypal-error' => esc_html__( 'An unexpected error occurred. Please try again.', 'easy-digital-downloads' ) - ) ), - 'intent' => ! empty( $sdk_query_args['intent'] ) ? $sdk_query_args['intent'] : 'capture', - 'style' => get_button_styles(), - ); - - wp_localize_script( 'edd-paypal', 'eddPayPalVars', $paypal_script_vars ); - } -} - -add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\register_js', 100 ); - -/** - * Removes the "?ver=" query arg from the PayPal JS SDK URL, because PayPal will throw an error - * if it's included. - * - * @param string $url - * - * @since 2.11 - * @return string - */ -function remove_ver_query_arg( $url ) { - $sdk_url = 'https://www.paypal.com/sdk/js'; - - if ( false !== strpos( $url, $sdk_url ) ) { - $new_url = preg_split( "/(&ver|\?ver)/", $url ); - - return $new_url[0]; - } - - return $url; -} - -add_filter( 'script_loader_src', __NAMESPACE__ . '\remove_ver_query_arg', 100 ); - -/** - * Adds data attributes to the PayPal JS SDK -

    ' . sprintf( __( 'There was an error connecting your Stripe account. Message: %1$s. Please try again.', 'easy-digital-downloads' ), esc_html( urldecode( $_GET['edd-message'] ) ), esc_url( admin_url( 'edit.php?post_type=download&page=edd-settings&tab=gateways§ion=edd-stripe' ) ) ) . '

    '; - add_filter( 'wp_parse_str', function( $ar ) { - if( isset( $ar['edd_gateway_connect_error'] ) ) { - unset( $ar['edd_gateway_connect_error'] ); - } - - if( isset( $ar['edd-message'] ) ) { - unset( $ar['edd-message'] ); - } - return $ar; - }); - } - - settings_errors( 'edds-notices' ); -} -add_action( 'admin_notices', 'edds_admin_messages' ); - -/** - * Add payment meta item to payments that used an existing card - * - * @since 2.6 - * @param $payment_id - * @return void - */ -function edds_show_existing_card_meta( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - $existing_card = $payment->get_meta( '_edds_used_existing_card' ); - if ( ! empty( $existing_card ) ) { - ?> -
    -

    -   - -

    -
    - 'connect-to-stripe', - ), - $location - ); - } - return $location; - } ); - -} -add_action( 'admin_init', 'edds_stripe_connect_test_mode_toggle_redirect' ); - -/** - * Adds a "Refund Charge in Stripe" checkbox to the refund UI. - * - * @param \EDD\Orders\Order $order - * - * @since 2.8.7 - */ -function edds_show_refund_checkbox( \EDD\Orders\Order $order ) { - if ( 'stripe' !== $order->gateway ) { - return; - } - ?> -
    -
    - - -
    -
    - 'edd-settings', - 'tab' => 'gateways', - 'section' => 'edd-stripe', - ) - ) - ); - - exit; -} -add_action( 'admin_init', 'edds_process_settings_flags', 1 ); \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/admin-filters.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/admin-filters.php deleted file mode 100644 index 20fa2d2b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/admin-filters.php +++ /dev/null @@ -1,115 +0,0 @@ -comment_content, $match ) ) { - $txn_id = $match[1]; - continue; - } - } - - return apply_filters( 'edds_set_payment_transaction_id', $txn_id, $payment_id ); -} -add_filter( 'edd_get_payment_transaction_id-stripe', 'edds_get_payment_transaction_id', 10, 1 ); - -/** - * Given a transaction ID, generate a link to the Stripe transaction ID details - * - * @since 1.9.1 - * @param string $transaction_id The Transaction ID - * @param int $payment_id The payment ID for this transaction - * @return string A link to the Stripe transaction details - */ -function edd_stripe_link_transaction_id( $transaction_id, $payment_id ) { - - $test = edd_get_payment_meta( $payment_id, '_edd_payment_mode' ) === 'test' ? 'test/' : ''; - $status = edd_get_payment_status( $payment_id ); - - if ( 'preapproval' === $status ) { - $url = '' . esc_html( $transaction_id ) . ''; - } else { - $url = '' . esc_html( $transaction_id ) . ''; - } - return apply_filters( 'edd_stripe_link_payment_details_transaction_id', $url ); - -} -add_filter( 'edd_payment_details_transaction_id-stripe', 'edd_stripe_link_transaction_id', 10, 2 ); - -/** - * Show the Process / Cancel buttons for preapproved payments - * - * @since 1.6 - * @return string - */ -function edds_payments_column_data( $value, $payment_id, $column_name ) { - if ( 'status' !== $column_name ) { - return $value; - } - - $status = edd_get_payment_status( $payment_id ); - if ( ! in_array( $status, array( 'preapproval', 'preapproval_pending' ), true ) ) { - return $value; - } - - $customer_id = edd_get_order_meta( $payment_id, '_edds_stripe_customer_id', true ); - - if ( empty( $customer_id ) ) { - return $value; - } - - $nonce = wp_create_nonce( 'edds-process-preapproval' ); - - $base_args = array( - 'post_type' => 'download', - 'page' => 'edd-payment-history', - 'payment_id' => urlencode( $payment_id ), - 'nonce' => urlencode( $nonce ), - ); - $preapproval_args = array( - 'edd-action' => 'charge_stripe_preapproval', - ); - $cancel_args = array( - 'preapproval_key' => urlencode( $customer_id ), - 'edd-action' => 'cancel_stripe_preapproval', - ); - - $actions = array( - sprintf( - '%s', - esc_url( - add_query_arg( - array_merge( $base_args, $preapproval_args ), - admin_url( 'edit.php' ) - ) - ), - esc_html__( 'Process', 'easy-digital-downloads' ) - ), - sprintf( - '%s', - esc_url( - add_query_arg( - array_merge( $base_args, $cancel_args ), - admin_url( 'edit.php' ) - ) - ), - esc_html__( 'Cancel', 'easy-digital-downloads' ) - ), - ); - - $value .= '

    '; - $value .= implode( ' | ', $actions ); - $value .= '

    '; - - return $value; -} -add_filter( 'edd_payments_table_column', 'edds_payments_column_data', 20, 3 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/class-notices-registry.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/class-notices-registry.php deleted file mode 100644 index a971dab1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/class-notices-registry.php +++ /dev/null @@ -1,102 +0,0 @@ - 'success', - 'dismissible' => true, - ); - - $notice_args = array_merge( $defaults, $notice_args ); - - if ( empty( $notice_args['message'] ) ) { - throw new Exception( esc_html__( 'A message must be specified for each notice.', 'easy-digital-downloads' ) ); - } - - if ( ! in_array( $notice_args['type'], array( 'success', 'info', 'warning', 'error' ), true ) ) { - $notice_args['type'] = 'success'; - } - - return $this->add_item( $notice_id, $notice_args ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/class-notices.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/class-notices.php deleted file mode 100644 index b298175f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/class-notices.php +++ /dev/null @@ -1,145 +0,0 @@ -registry = $registry; - } - - /** - * Retrieves the name of the option to manage the status of the notice. - * - * @since 2.6.19 - * - * @param string $notice_id ID of the notice to generate the name with. - * @return string - */ - public function get_dismissed_option_name( $notice_id ) { - // Ensures backwards compatibility for notices dismissed before 2.6.19 - switch ( $notice_id ) { - case 'stripe-connect': - $option_name = 'edds_stripe_connect_intro_notice_dismissed'; - break; - default: - $option_name = sprintf( 'edds_notice_%1$s_dismissed', $notice_id ); - } - - return $option_name; - } - - /** - * Dismisses a notice. - * - * @since 2.6.19 - * - * @param string $notice_id ID of the notice to dismiss. - * @return bool True if notice is successfully dismissed. False on failure. - */ - public function dismiss( $notice_id ) { - return update_option( $this->get_dismissed_option_name( $notice_id ), true ); - } - - /** - * Restores a notice. - * - * @since 2.6.19 - * - * @param string $notice_id ID of the notice to restore. - * @return bool True if notice is successfully restored. False on failure. - */ - public function restore( $notice_id ) { - return delete_option( $this->get_dismissed_option_name( $notice_id ) ); - } - - /** - * Determine if a notice has been permanently dismissed. - * - * @since 2.6.19 - * - * @param int $notice_id Notice ID. - * @return bool True if the notice is dismissed. - */ - public function is_dismissed( $notice_id ) { - return (bool) get_option( $this->get_dismissed_option_name( $notice_id ), false ); - } - - /** - * Builds a given notice's output. - * - * @since 2.6.19 - * - * @param string $notice_id ID of the notice to build. - */ - public function build( $notice_id ) { - $output = ''; - $notice = $this->registry->get_item( $notice_id ); - - if ( empty( $notice ) ) { - return $output; - } - - if ( true === $this->is_dismissed( $notice_id ) ) { - return $output; - } - - if ( is_callable( $notice['message'] ) ) { - $message = call_user_func( $notice['message'] ); - } else { - $message = $notice['message']; - } - - $classes = array( - 'edds-admin-notice', - 'notice', - 'notice-' . $notice['type'], - ); - - if ( $notice['dismissible'] ) { - $classes[] = 'is-dismissible'; - } - - $output = sprintf( - '', - esc_attr( $notice_id ), - esc_attr( implode( ' ', $classes ) ), - wp_create_nonce( "edds-dismiss-{$notice_id}-nonce" ), - $message - ); - - return $output; - } - - /** - * Outputs a given notice. - * - * @since 2.6.19 - */ - public function output( $notice_id ) { - echo $this->build( $notice_id ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices.php deleted file mode 100644 index 44bb0d95..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices.php +++ /dev/null @@ -1,192 +0,0 @@ -add( - 'php-requirement', - array( - 'message' => function() { - ob_start(); - require_once EDDS_PLUGIN_DIR . '/includes/admin/notices/php-requirement.php'; - return ob_get_clean(); - }, - 'type' => 'error', - 'dismissible' => false, - ) - ); - - // EDD 2.11 - $registry->add( - 'edd-requirement', - array( - 'message' => function() { - ob_start(); - require_once EDDS_PLUGIN_DIR . '/includes/admin/notices/edd-requirement.php'; - return ob_get_clean(); - }, - 'type' => 'error', - 'dismissible' => false, - ) - ); - - // Recurring requirement. - $registry->add( - 'edd-recurring-requirement', - array( - 'message' => function() { - ob_start(); - require_once EDDS_PLUGIN_DIR . '/includes/admin/notices/edd-recurring-requirement.php'; - return ob_get_clean(); - }, - 'type' => 'error', - 'dismissible' => false, - ) - ); - - // Enable gateway. - $registry->add( - 'edd-stripe-core', - array( - 'message' => function() { - ob_start(); - require_once EDDS_PLUGIN_DIR . '/includes/admin/notices/edd-stripe-core.php'; - return ob_get_clean(); - }, - 'type' => 'info', - 'dismissible' => true, - ) - ); - } catch ( Exception $e ) { - return new WP_Error( - 'edds-invalid-notices-registration', - esc_html( $e->getMessage() ) - ); - }; - - return true; -} -add_action( 'admin_init', 'edds_admin_notices_register' ); - -/** - * Conditionally prints registered notices. - * - * @since 2.6.19 - */ -function edds_admin_notices_print() { - // Current user needs capability to dismiss notices. - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - $registry = edds_get_registry( 'admin-notices' ); - - if ( ! $registry ) { - return; - } - - $notices = new EDD_Stripe_Admin_Notices( $registry ); - - wp_enqueue_script( 'edds-admin-notices' ); - - try { - // PHP 5.6 requirement. - if ( - false === edds_has_met_requirements( 'php' ) && - true === edds_is_pro() - ) { - $notices->output( 'php-requirement' ); - } - - // EDD 2.9 requirement. - if ( false === edds_has_met_requirements( 'edd' ) ) { - $notices->output( 'edd-requirement' ); - } - - // Recurring 2.10.0 requirement. - if ( false === edds_has_met_requirements( 'recurring' ) ) { - $notices->output( 'edd-recurring-requirement' ); - } - - // Stripe in Core notice. - if ( false === edds_is_pro() && false === edd_is_gateway_active( 'stripe' ) ) { - $notices->output( 'edd-stripe-core' ); - } - } catch( Exception $e ) {} -} -add_action( 'admin_notices', 'edds_admin_notices_print' ); - -/** - * Handles AJAX dismissal of notices. - * - * WordPress automatically removes the notices, so the response here is arbitrary. - * If the notice cannot be dismissed it will simply reappear when the page is refreshed. - * - * @since 2.6.19 - */ -function edds_admin_notices_dismiss_ajax() { - $notice_id = isset( $_REQUEST[ 'id' ] ) ? esc_attr( $_REQUEST['id'] ) : false; - $nonce = isset( $_REQUEST[ 'nonce' ] ) ? esc_attr( $_REQUEST['nonce'] ) : false; - - if ( ! ( $notice_id && $nonce ) ) { - return wp_send_json_error(); - } - - if ( ! wp_verify_nonce( $nonce, "edds-dismiss-{$notice_id}-nonce" ) ) { - return wp_send_json_error(); - } - - $registry = edds_get_registry( 'admin-notices' ); - - if ( ! $registry ) { - return wp_send_json_error(); - } - - $notices = new EDD_Stripe_Admin_Notices( $registry ); - $dismissed = $notices->dismiss( $notice_id ); - - if ( true === $dismissed ) { - return wp_send_json_success(); - } else { - return wp_send_json_error(); - } -} -add_action( 'wp_ajax_edds_admin_notices_dismiss_ajax', 'edds_admin_notices_dismiss_ajax' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/edd-recurring-requirement.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/edd-recurring-requirement.php deleted file mode 100644 index deecd82b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/edd-recurring-requirement.php +++ /dev/null @@ -1,38 +0,0 @@ - - -

    - -

    - -

    - ', - '', - '', - '' - ), - array( - 'code' => true, - 'strong' => true, - ) - ); - ?> -

    diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/edd-requirement.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/edd-requirement.php deleted file mode 100644 index 7f311cb7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/edd-requirement.php +++ /dev/null @@ -1,38 +0,0 @@ - - -

    - -

    - -

    - ', - '', - '', - '' - ), - array( - 'code' => true, - 'strong' => true, - ) - ); - ?> -

    diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/edd-stripe-core.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/edd-stripe-core.php deleted file mode 100644 index cff4fff6..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/edd-stripe-core.php +++ /dev/null @@ -1,49 +0,0 @@ - 'download', - 'page' => 'edd-settings', - 'tab' => 'gateways', - ), - admin_url( 'edit.php' ) -); -?> - -

    - - -
    - ', - '', - '', - '' - ), - array( - 'a' => array( - 'href' => true, - 'rel' => true, - 'target' => true, - ), - ) - ); - ?> -

    diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/php-requirement.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/php-requirement.php deleted file mode 100644 index 389c3de3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/notices/php-requirement.php +++ /dev/null @@ -1,107 +0,0 @@ - - -

    - -

    - -

    - ' . $required_version . '', - '' . $current_version . '', - '', - '', - '', - '' - ), - array( - 'code' => true, - 'strong' => true, - 'a' => array( - 'href' => true, - 'rel' => true, - 'target' => true, - ) - ) - ); - ?> -

    - -

    - - - -

    - -
    - -

    - -

    - -

    - 7.4 if possible to receive the full speed and security benefits provided to more modern and fully supported versions of PHP. However, some plugins may not be fully compatible with PHP 7.4, so more testing may be required.', 'easy-digital-downloads' ), - '' . $required_version . '' - ), - array( - 'code' => true, - ) - ); - ?> -

    - -

    - -

    - -

    - ', - '' - ), - array( - 'a' => array( - 'href' => true, - 'rel' => true, - 'target' => true, - ) - ) - ); - ?> -

    - -
    diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/settings.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/settings.php deleted file mode 100644 index e5a608b3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/settings.php +++ /dev/null @@ -1,471 +0,0 @@ - array( - 'id' => 'stripe_connect_button', - 'name' => __( 'Connection Status', 'easy-digital-downloads' ), - 'desc' => edds_stripe_connect_setting_field(), - 'type' => 'descriptive_text', - 'class' => 'edd-stripe-connect-row', - ), - 'test_publishable_key' => array( - 'id' => 'test_publishable_key', - 'name' => __( 'Test Publishable Key', 'easy-digital-downloads' ), - 'desc' => __( 'Enter your test publishable key, found in your Stripe Account Settings', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - 'class' => 'edd-hidden edds-api-key-row', - ), - 'test_secret_key' => array( - 'id' => 'test_secret_key', - 'name' => __( 'Test Secret Key', 'easy-digital-downloads' ), - 'desc' => __( 'Enter your test secret key, found in your Stripe Account Settings', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - 'class' => 'edd-hidden edds-api-key-row', - ), - 'live_publishable_key' => array( - 'id' => 'live_publishable_key', - 'name' => __( 'Live Publishable Key', 'easy-digital-downloads' ), - 'desc' => __( 'Enter your live publishable key, found in your Stripe Account Settings', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - 'class' => 'edd-hidden edds-api-key-row', - ), - 'live_secret_key' => array( - 'id' => 'live_secret_key', - 'name' => __( 'Live Secret Key', 'easy-digital-downloads' ), - 'desc' => __( 'Enter your live secret key, found in your Stripe Account Settings', 'easy-digital-downloads' ), - 'type' => 'text', - 'size' => 'regular', - 'class' => 'edd-hidden edds-api-key-row', - ), - 'stripe_webhook_description' => array( - 'id' => 'stripe_webhook_description', - 'type' => 'descriptive_text', - 'name' => __( 'Webhooks', 'easy-digital-downloads' ), - 'desc' => - '

    ' . sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ - __( 'In order for Stripe to function completely, you must configure your Stripe webhooks. Visit your %1$saccount dashboard%2$s to configure them. Please add a webhook endpoint for the URL below.', 'easy-digital-downloads' ), - '', - '' - ) . - '

    ' . - '

    ' . - sprintf( - /* translators: %s Webhook URL. Do not translate. */ - __( 'Webhook URL: %s', 'easy-digital-downloads' ), - home_url( 'index.php?edd-listener=stripe' ) - ) . - '

    ' . - '

    ' . - sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ - __( 'See our %1$sdocumentation%2$s for more information.', 'easy-digital-downloads' ), - '', - '' - ) . - '

    ', - ), - 'stripe_billing_fields' => array( - 'id' => 'stripe_billing_fields', - 'name' => __( 'Billing Address Display', 'easy-digital-downloads' ), - 'desc' => __( 'Select how you would like to display the billing address fields on the checkout form.

    Notes:

    If taxes are enabled, this option cannot be changed from "Full address".

    If set to "No address fields", you must disable "zip code verification" in your Stripe account.

    ', 'easy-digital-downloads' ), - 'type' => 'select', - 'std' => 'full', - 'options' => array( - 'full' => __( 'Full address', 'easy-digital-downloads' ), - 'zip_country' => __( 'Zip / Postal Code and Country only', 'easy-digital-downloads' ), - 'none' => __( 'No address fields', 'easy-digital-downloads' ), - ), - ), - 'stripe_statement_descriptor' => array( - 'id' => 'stripe_statement_descriptor', - 'name' => __( 'Statement Descriptor', 'easy-digital-downloads' ), - 'desc' => __( 'Choose how charges will appear on customer\'s credit card statements. Max 22 characters', 'easy-digital-downloads' ), - 'type' => 'text', - ), - 'stripe_restrict_assets' => array( - 'id' => 'stripe_restrict_assets', - 'name' => ( __( 'Restrict Stripe Assets', 'easy-digital-downloads' ) ), - 'check' => ( __( 'Only load Stripe.com hosted assets on pages that specifically utilize Stripe functionality.', 'easy-digital-downloads' ) ), - 'type' => 'checkbox_description', - 'desc' => sprintf( - /* translators: 1. opening link tag; 2. closing link tag */ - __( 'Stripe advises that their Javascript library be loaded on every page to take advantage of their advanced fraud detection rules. If you are not concerned with this, enable this setting to only load the Javascript when necessary. %1$sLearn more about Stripe\'s recommended setup.%2$s', 'easy-digital-downloads' ), - '', - '' - ), - ), - ); - - if ( _edds_legacy_elements_enabled() ) { - $elements_mode = edds_get_elements_mode(); - - if ( ! edds_stripe_connect_can_manage_keys() ) { - $stripe_settings['stripe_elements_mode'] = array( - 'id' => 'stripe_elements_mode', - 'name' => __( 'Elements Mode', 'easy-digital-downloads' ), - 'desc' => __( 'Toggle between using the legacy Card Elements Stripe integration and the new Payment Elements experience.', 'easy-digital-downloads' ), - 'type' => 'select', - 'options' => array( - 'card-elements' => __( 'Card Element', 'easy-digital-downloads' ), - 'payment-elements' => __( 'Payment Element', 'easy-digital-downloads' ), - ), - 'class' => 'stripe-elements-mode', - 'tooltip_title' => __( 'Transitioning to Payment Elements', 'easy-digital-downloads' ), - 'tooltip_desc' => __( 'You are seeing this option because your store has been using Card Elements prior to the EDD Stripe 2.9.0 update.

    To ensure that we do not affect your current checkout experience, you can use this setting to toggle between the Card Elements (legacy) and Payment Elements (updated version) to ensure that any customizations or theming you have done still function properly.

    Please be advised, that in a future version of the Stripe extension, we will deprecate the Card Elements, so take this time to update your store!', 'easy-digital-downloads' ), - ); - } - - $stripe_settings['stripe_allow_prepaid'] = array( - 'id' => 'stripe_allow_prepaid', - 'name' => __( 'Prepaid Cards', 'easy-digital-downloads' ), - 'desc' => __( 'Allow prepaid cards as valid payment method.', 'easy-digital-downloads' ), - 'type' => 'checkbox', - 'class' => 'payment-elements' === $elements_mode ? 'edd-hidden card-elements-feature' : 'card-elements-feature', - ); - - $radar_rules_url = sprintf( - 'https://dashboard.stripe.com%s/settings/radar/rules', - edd_is_test_mode() ? '/test' : '' - ); - - $stripe_settings['stripe_allow_prepaid_elements_note'] = array( - 'id' => 'stripe_allow_prepaid_elements_note', - 'name' => __( 'Prepaid Cards', 'easy-digital-downloads' ), - 'desc' => sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ - __( 'Prepaid card allowance can now be managed in your %1$sStripe Radar Rules%2$s.', 'easy-digital-downloads' ), - '', - '' - ), - 'type' => 'descriptive_text', - 'class' => 'payment-elements' === $elements_mode ? 'payment-elements-feature' : 'edd-hidden payment-elements-feature', - ); - - $stripe_settings['stripe_split_payment_fields'] = array( - 'id' => 'stripe_split_payment_fields', - 'name' => __( 'Split Credit Card Form', 'easy-digital-downloads' ), - 'desc' => __( 'Use separate card number, expiration, and CVC fields in payment forms.', 'easy-digital-downloads' ), - 'type' => 'checkbox', - 'class' => 'payment-elements' === $elements_mode ? 'edd-hidden card-elements-feature' : 'card-elements-feature', - ); - - $stripe_settings['stripe_use_existing_cards'] = array( - 'id' => 'stripe_use_existing_cards', - 'name' => __( 'Show Previously Used Cards', 'easy-digital-downloads' ), - 'desc' => __( 'Provides logged in customers with a list of previous used payment methods for faster checkout.', 'easy-digital-downloads' ), - 'type' => 'checkbox', - 'class' => 'payment-elements' === $elements_mode ? 'edd-hidden card-elements-feature' : 'card-elements-feature', - ); - - $stripe_settings['stripe_use_existing_cards_elements_note'] = array( - 'id' => 'stripe_use_existing_cards_elements_note', - 'name' => __( 'Show Previously Used Cards', 'easy-digital-downloads' ), - 'desc' => sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ - __( 'Previously used cards are now managed by %1$sLink by Stripe%2$s, for even better conversions and security.', 'easy-digital-downloads' ), - '', - '' - ), - 'type' => 'descriptive_text', - 'class' => 'payment-elements' === $elements_mode ? 'payment-elements-feature' : 'edd-hidden payment-elements-feature', - ); - } - - $settings['edd-stripe'] = $stripe_settings; - - // If EDD is in Debug Mode, add some 'hidden' settings to the Stripe settings. - if ( edd_is_debug_mode() ) { - $card_elements_enabled = get_option( '_edds_legacy_elements_enabled', false ); - - $debug_settings = array( - 'stripe_debug' => array( - 'id' => 'stripe_debug', - 'name' => __( 'Debugging Settings', 'easy-digital-downloads' ), - 'desc' => '
    ' . - '

    ' . __( 'The following settings are available while Easy Digital Downloads is in debug mode. They are not designed to be primary settings and should be used only while debugging or when instructed to be used by the Easy Digital Downloads Team.', 'easy-digital-downloads' ) . '

    ' . - '

    ' . __( 'There is no guarantee that these settings will remain available in future versions of Easy Digital Downloads. Easy Digital Downloads Debug Mode should be disabled once changes to these settings have been made.', 'easy-digital-downloads' ) . '

    ' . - '

    ', - 'type' => 'descriptive_text', - ), - ); - - $card_elements_action = $card_elements_enabled ? 'disable-card-elements' : 'enable-card-elements'; - $card_elements_button_label = $card_elements_enabled ? __( 'Disable access to Card Elements', 'easy-digital-downloads' ) : __( 'Enable access to Card Elements', 'easy-digital-downloads' ); - $card_elements_state_label = $card_elements_enabled ? __( 'Access to Legacy Card Elements is Enabled', 'easy-digital-downloads' ) : __( 'Access to Legacy Card Elements is Disabled', 'easy-digital-downloads' ); - - $link_class = $card_elements_enabled ? 'edd-button__toggle--enabled' : 'edd-button__toggle--disabled'; - - $debug_settings['toggle_card_elements'] = array( - 'id' => 'stripe_toggle_card_elements', - 'name' => __( 'Toggle Card Elements', 'easy-digital-downloads' ), - 'type' => 'descriptive_text', - 'desc' => sprintf( - '%1$s' . $card_elements_button_label . '%2$s', - '', - '' - ) .'' . $card_elements_state_label . '
    ' . __( 'Card Elements is the legacy Stripe integration. Easy Digital Downloads has updated to use the more secure and reliable Payment Elements feature of Stripe. This toggle allows sites without access to Card Elements to enable or disable it.', 'easy-digital-downloads' ), - ); - - $settings['edd-stripe'] = array_merge( $settings['edd-stripe'], $debug_settings ); - } - - // Set up the new setting field for the Test Mode toggle notice. - $notice = array( - 'stripe_connect_test_mode_toggle_notice' => array( - 'id' => 'stripe_connect_test_mode_toggle_notice', - 'desc' => '

    ' . __( 'You have disabled the "Test Mode" option. Once you have saved your changes, please verify your Stripe connection, especially if you have not previously connected in with "Test Mode" disabled.', 'easy-digital-downloads' ) . '

    ', - 'type' => 'stripe_connect_notice', - 'field_class' => 'edd-hidden', - ), - ); - - // Insert the new setting after the Test Mode checkbox. - $position = array_search( 'test_mode', array_keys( $settings['main'] ), true ); - $settings = array_merge( - array_slice( $settings['main'], $position, 1, true ), - $notice, - $settings - ); - - return $settings; -} -add_filter( 'edd_settings_gateways', 'edds_add_settings' ); - -/** - * Force full billing address display when taxes are enabled - * - * @access public - * @since 2.5 - * - * @param string $value The value currently set for the Stripe billing fields setting. - * @param string $key The Stripe setting key to detect, stripe_billing_fields. - * - * @return string - */ -function edd_stripe_sanitize_stripe_billing_fields_save( $value, $key ) { - - if ( 'stripe_billing_fields' === $key && edd_use_taxes() ) { - - $value = 'full'; - - } - - return $value; - -} -add_filter( 'edd_settings_sanitize_select', 'edd_stripe_sanitize_stripe_billing_fields_save', 10, 2 ); - -/** - * Filter the output of the statement descriptor option to add a max length to the text string - * - * @since 2.6 - * @param string $html The full html for the setting output. - * @param array $args The original arguments passed in to output the html. - * - * @return string - */ -function edd_stripe_max_length_statement_descriptor( $html, $args ) { - if ( 'stripe_statement_descriptor' !== $args['id'] ) { - return $html; - } - - $html = str_replace( ' -
    - -
    - ' . wpautop( $value ) . ''; - - echo $html; -} - -/** - * Outputs information when Stripe has been activated but application requirements are not met. - * - * @since 2.8.1 - */ -function edd_stripe_requirements_not_met_callback() { - $required_version = 7.1; - $current_version = phpversion(); - - echo '
    '; - echo '

    '; - echo wp_kses( - sprintf( - /* translators: %1$s PHP version requirement. %2$s Current PHP version. %3$s Opening strong tag, do not translate. %4$s Closing strong tag, do not translate. */ - __( - 'Processing credit cards with Stripe requires PHP version %1$s or higher. It looks like you\'re using version %2$s, which means you will need to %3$supgrade your version of PHP before acceping credit card payments%4$s.', - 'easy-digital-downloads' - ), - '' . $required_version . '', - '' . $current_version . '', - '', - '' - ), - array( - 'code' => true, - 'strong' => true, - ) - ); - echo '

    '; - echo '

    '; - - echo ''; - esc_html_e( 'Need help upgrading? Ask your web host!', 'easy-digital-downloads' ); - echo '
    '; - - echo wp_kses( - sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ - __( - 'Many web hosts can give you instructions on how/where to upgrade your version of PHP through their control panel, or may even be able to do it for you. If you need to change hosts, please see %1$sour hosting recommendations%2$s.', - 'easy-digital-downloads' - ), - '', - '' - ), - array( - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, - ), - ) - ); - echo '

    '; - echo '
    '; -} - -/** - * Adds a notice to the "Payment Gateways" selector if Stripe has been activated but does - * not meet application requirements. - * - * @since 2.8.1 - * - * @param string $html Setting HTML. - * @param array $args Setting arguments. - * @return string - */ -function edds_payment_gateways_notice( $html, $args ) { - if ( 'gateways' !== $args['id'] ) { - return $html; - } - - if ( - true === edds_is_pro() || - true === edds_has_met_requirements( 'php' ) - ) { - return $html; - } - - $required_version = 7.1; - $current_version = phpversion(); - - $html .= '

    ' . - wp_kses( - sprintf( - /* translators: %1$s PHP version requirement. %2$s Current PHP version. %3$s Opening strong tag, do not translate. %4$s Closing strong tag, do not translate. */ - __( - 'Processing credit cards with Stripe requires PHP version %1$s or higher. It looks like you\'re using version %2$s, which means you will need to %3$supgrade your version of PHP before acceping credit card payments%4$s.', - 'easy-digital-downloads' - ), - '' . $required_version . '', - '' . $current_version . '', - '', - '' - ), - array( - 'code' => true, - 'strong' => true, - ) - ) . - '

    ' . - esc_html__( 'Need help upgrading? Ask your web host!', 'easy-digital-downloads' ) . - '
    ' . - wp_kses( - sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ - __( - 'Many web hosts can give you instructions on how/where to upgrade your version of PHP through their control panel, or may even be able to do it for you. If you need to change hosts, please see %1$sour hosting recommendations%2$s.', - 'easy-digital-downloads' - ), - '', - '' - ), - array( - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, - ), - ) - ) . '

    '; - - return $html; -} -add_filter( 'edd_after_setting_output', 'edds_payment_gateways_notice', 10, 2 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/settings/stripe-connect.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/settings/stripe-connect.php deleted file mode 100644 index fa1df78b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/settings/stripe-connect.php +++ /dev/null @@ -1,774 +0,0 @@ - 'download', - 'page' => 'edd-settings', - 'tab' => 'gateways', - 'section' => 'edd-stripe', - ), - admin_url( 'edit.php' ) - ); - - /** - * Filters the URL users are returned to after using Stripe Connect oAuth. - * - * @since 2.8.0 - * - * @param $return_url URL to return to. - */ - $return_url = apply_filters( 'edds_stripe_connect_return_url', $return_url ); - - $stripe_connect_url = add_query_arg( - array( - 'live_mode' => (int) ! edd_is_test_mode(), - 'state' => str_pad( wp_rand( wp_rand(), PHP_INT_MAX ), 100, wp_rand(), STR_PAD_BOTH ), - 'customer_site_url' => esc_url_raw( $return_url ), - ), - 'https://easydigitaldownloads.com/?edd_gateway_connect_init=stripe_connect' - ); - - /** - * Filters the URL to start the Stripe Connect oAuth flow. - * - * @since 2.8.0 - * - * @param $stripe_connect_url URL to oAuth proxy. - */ - $stripe_connect_url = apply_filters( 'edds_stripe_connect_url', $stripe_connect_url ); - - return $stripe_connect_url; -} - -/** - * Listens for Stripe Connect completion requests and saves the Stripe API keys. - * - * @since 2.6.14 - */ -function edds_process_gateway_connect_completion() { - - $redirect_screen = ! empty( $_GET['redirect_screen'] ) ? sanitize_text_field( $_GET['redirect_screen'] ) : ''; - - // A cancelled connection doesn't contain the completion or state values, but we do need to listen for the redirect_screen for the wizard. - if ( - isset( $_GET['edd_gateway_connect_error'] ) && - filter_var( $_GET['edd_gateway_connect_error'], FILTER_VALIDATE_BOOLEAN ) && - ! empty( $redirect_screen ) - ) { - $error_redirect = ''; - - switch ( $redirect_screen ) { - case 'onboarding-wizard': - $error_redirect = admin_url( 'edit.php?post_type=download&page=edd-onboarding-wizard¤t_step=payment_methods' ); - break; - } - - if ( ! empty( $error_redirect ) ) { - wp_safe_redirect( esc_url_raw( $error_redirect ) ); - exit; - } - } - - if ( ! isset( $_GET['edd_gateway_connect_completion'] ) || 'stripe_connect' !== $_GET['edd_gateway_connect_completion'] || ! isset( $_GET['state'] ) ) { - return; - } - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return; - } - - if ( headers_sent() ) { - return; - } - - $customer_site_url = admin_url( 'edit.php?post_type=download' ); - if ( ! empty( $redirect_screen ) ) { - $customer_site_url = add_query_arg( 'redirect_screen', $redirect_screen, $customer_site_url ); - } - - $edd_credentials_url = add_query_arg( - array( - 'live_mode' => (int) ! edd_is_test_mode(), - 'state' => sanitize_text_field( $_GET['state'] ), - 'customer_site_url' => urlencode( $customer_site_url ), - ), - 'https://easydigitaldownloads.com/?edd_gateway_connect_credentials=stripe_connect' - ); - - $response = wp_remote_get( esc_url_raw( $edd_credentials_url ) ); - - if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { - $message = '

    ' . sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ - __( 'There was an error getting your Stripe credentials. Please %1$stry again%2$s. If you continue to have this problem, please contact support.', 'easy-digital-downloads' ), - '', - '' - ) . '

    '; - wp_die( $message ); - } - - $data = json_decode( $response['body'], true ); - $data = $data['data']; - - if ( edd_is_test_mode() ) { - edd_update_option( 'test_publishable_key', sanitize_text_field( $data['publishable_key'] ) ); - edd_update_option( 'test_secret_key', sanitize_text_field( $data['secret_key'] ) ); - } else { - edd_update_option( 'live_publishable_key', sanitize_text_field( $data['publishable_key'] ) ); - edd_update_option( 'live_secret_key', sanitize_text_field( $data['secret_key'] ) ); - } - - edd_update_option( 'stripe_connect_account_id', sanitize_text_field( $data['stripe_user_id'] ) ); - - $redirect_url = admin_url( 'edit.php?post_type=download&page=edd-settings&tab=gateways§ion=edd-stripe' ); - - if ( ! empty( $redirect_screen ) && 'onboarding-wizard' === $redirect_screen ) { - $redirect_url = edd_get_admin_url( - array( - 'page' => 'edd-onboarding-wizard', - 'current_step' => 'payment_methods', - ) - ); - $gateways = edd_get_option( 'gateways', array() ); - $gateways['stripe'] = true; - edd_update_option( 'gateways', $gateways ); - } - - wp_safe_redirect( esc_url_raw( $redirect_url ) ); - exit; - -} -add_action( 'admin_init', 'edds_process_gateway_connect_completion' ); - -/** - * Returns a URL to disconnect the current Stripe Connect account ID and keys. - * - * @since 2.8.0 - * - * @return string $stripe_connect_disconnect_url URL to disconnect an account ID and keys. - */ -function edds_stripe_connect_disconnect_url() { - $stripe_connect_disconnect_url = add_query_arg( - array( - 'post_type' => 'download', - 'page' => 'edd-settings', - 'tab' => 'gateways', - 'section' => 'edd-stripe', - 'edds-stripe-disconnect' => true, - ), - admin_url( 'edit.php' ) - ); - - /** - * Filters the URL to "disconnect" the Stripe Account. - * - * @since 2.8.0 - * - * @param $stripe_connect_disconnect_url URL to remove the associated Account ID. - */ - $stripe_connect_disconnect_url = apply_filters( - 'edds_stripe_connect_disconnect_url', - $stripe_connect_disconnect_url - ); - - $stripe_connect_disconnect_url = wp_nonce_url( $stripe_connect_disconnect_url, 'edds-stripe-connect-disconnect' ); - - return $stripe_connect_disconnect_url; -} - -/** - * Removes the associated Stripe Connect Account ID and keys. - * - * This does not revoke application permissions from the Stripe Dashboard, - * it simply allows the "Connect with Stripe" flow to run again for a different account. - * - * @since 2.8.0 - */ -function edds_stripe_connect_process_disconnect() { - // Do not need to handle this request, bail. - if ( - ! ( isset( $_GET['page'] ) && ( 'edd-settings' === $_GET['page'] || 'edd-onboarding-wizard' === $_GET['page'] ) ) || - ! isset( $_GET['edds-stripe-disconnect'] ) - ) { - return; - } - - // Current user cannot handle this request, bail. - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - // No nonce, bail. - if ( ! isset( $_GET['_wpnonce'] ) ) { - return; - } - - // Invalid nonce, bail. - if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'edds-stripe-connect-disconnect' ) ) { - return; - } - - $options = array( - 'stripe_connect_account_id', - 'stripe_connect_account_country', - 'test_publishable_key', - 'test_secret_key', - 'live_publishable_key', - 'live_secret_key', - ); - - foreach ( $options as $option ) { - edd_delete_option( $option ); - } - - // Remove Stripe from the enabled gateways. - $gateways = edd_get_option( 'gateways', array() ); - unset( $gateways['stripe'] ); - edd_update_option( 'gateways', $gateways ); - - $redirect = remove_query_arg( - array( - '_wpnonce', - 'edds-stripe-disconnect', - ) - ); - - return wp_redirect( esc_url_raw( $redirect ) ); -} -add_action( 'admin_init', 'edds_stripe_connect_process_disconnect' ); - -/** - * Updates the `stripe_connect_account_country` setting if using Stripe Connect - * and no country information is available. - * - * @since 2.8.7 - */ -function edds_stripe_connect_maybe_refresh_account_country() { - // Current user cannot modify options, bail. - if ( false === current_user_can( 'manage_options' ) ) { - return; - } - - $account_id = edd_stripe()->connect()->get_connect_id(); - - // Stripe Connect has not been used, bail. - if ( empty( $account_id ) ) { - return; - } - - // Account country is already set, bail. - $account_country = edd_get_option( 'stripe_connect_account_country', '' ); - - if ( ! empty( $account_country ) ) { - return; - } - - try { - $account = edds_api_request( 'Account', 'retrieve', $account_id ); - - if ( isset( $account->country ) ) { - $account_country = sanitize_text_field( - strtolower( $account->country ) - ); - - edd_update_option( - 'stripe_connect_account_country', - $account_country - ); - } - } catch ( \Exception $e ) { - // Do nothing. - } -} -add_action( 'admin_init', 'edds_stripe_connect_maybe_refresh_account_country' ); - -/** - * Renders custom HTML for the "Stripe Connect" setting field in the Stripe Payment Gateway - * settings subtab. - * - * Provides a way to use Stripe Connect and manually manage API keys. - * - * @since 2.8.0 - */ -function edds_stripe_connect_setting_field() { - $stripe_connect_url = edds_stripe_connect_url(); - $stripe_disconnect_url = edds_stripe_connect_disconnect_url(); - - $stripe_connect_account_id = edd_stripe()->connect()->get_connect_id(); - - $api_key = edd_is_test_mode() - ? edd_get_option( 'test_publishable_key' ) - : edd_get_option( 'live_publishable_key' ); - - ob_start(); -?> - - - - - - - -

    - ', - '' - ), - array( - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, - ) - ) - ); - ?> -

    - - - - - -
    > -

    - -

    -
    -
    - - - - - -
    -

    - -

    -
    - -
    -

    - -

    - -
    - -
    -
    - - - - wpautop( esc_html__( 'Unable to retrieve account information.', 'easy-digital-downloads' ) ), - ); - - // Current user can't manage settings. - if ( ! current_user_can( 'manage_shop_settings' ) ) { - return wp_send_json_error( $unknown_error ); - } - - // Nonce validation, show error on fail. - if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'edds-stripe-connect-account-information' ) ) { - return wp_send_json_error( $unknown_error ); - } - - $account_id = isset( $_POST['accountId'] ) - ? sanitize_text_field( $_POST['accountId'] ) - : ''; - - $mode = edd_is_test_mode() - ? _x( 'test', 'Stripe Connect mode', 'easy-digital-downloads' ) - : _x( 'live', 'Stripe Connect mode', 'easy-digital-downloads' ); - - // Provides general reconnect and disconnect action URLs. - $reconnect_disconnect_actions = wp_kses( - sprintf( - /* translators: %1$s Stripe payment mode. %2$s Opening anchor tag for reconnecting to Stripe, do not translate. %3$s Opening anchor tag for disconnecting Stripe, do not translate. %4$s Closing anchor tag, do not translate. */ - __( 'Your Stripe account is connected in %1$s mode. %2$sReconnect in %1$s mode%4$s, or %3$sdisconnect this account%4$s.', 'easy-digital-downloads' ), - '' . $mode . '', - '', - '', - '' - ), - array( - 'strong' => true, - 'a' => array( - 'href' => true, - 'rel' => true, - ) - ) - ); - - // If connecting in Test Mode Stripe gives you the opportunity to create a - // temporary account. Alert the user of the limitations associated with - // this type of account. - $dev_account_error = array( - 'message' => wp_kses( - wpautop( - sprintf( - __( - /* translators: %1$s Opening bold tag, do not translate. %2$s Closing bold tag, do not translate. */ - 'You are currently connected to a %1$stemporary%2$s Stripe test account, which can only be used for testing purposes. You cannot manage this account in Stripe.', - 'easy-digital-downloads' - ), - '', - '' - ) . ' ' . - ( - class_exists( 'EDD_Recurring' ) - ? __( - 'Webhooks cannot be configured for recurring purchases with this account.', - 'easy-digital-downloads' - ) - : '' - ) . ' ' . - sprintf( - __( - /* translators: %1$s Opening link tag, do not translate. %2$s Closing link tag, do not translate. */ - '%1$sRegister a Stripe account%2$s for full access.', - 'easy-digital-downloads' - ), - '', - '' - ) . ' ' . - '

    ' . - sprintf( - /* translators: %1$s Opening anchor tag for disconnecting Stripe, do not translate. %2$s Closing anchor tag, do not translate. */ - __( '%1$sDisconnect this account%2$s.', 'easy-digital-downloads' ), - '', - '' - ) - ), - array( - 'p' => true, - 'strong' => true, - 'a' => array( - 'href' => true, - 'rel' => true, - 'target' => true, - ) - ) - ), - 'status' => 'warning', - ); - - // Attempt to show account information from Stripe Connect account. - if ( ! empty( $account_id ) ) { - try { - $account = edds_api_request( 'Account', 'retrieve', $account_id ); - - // Find the email. - $email = isset( $account->email ) - ? esc_html( $account->email ) - : ''; - - // Find a Display Name. - $display_name = isset( $account->display_name ) - ? esc_html( $account->display_name ) - : ''; - - if ( - empty( $display_name ) && - isset( $account->settings ) && - isset( $account->settings->dashboard ) && - isset( $account->settings->dashboard->display_name ) - ) { - $display_name = esc_html( $account->settings->dashboard->display_name ); - } - - // Unsaved/unactivated accounts do not have an email or display name. - if ( empty( $email ) && empty( $display_name ) ) { - return wp_send_json_success( $dev_account_error ); - } - - if ( ! empty( $display_name ) ) { - $display_name = '' . $display_name . '
    '; - } - - if ( ! empty( $email ) ) { - $email = $email . ' — '; - } - - /** - * Filters if the Stripe Connect fee messaging should show. - * - * @since 2.8.1 - * - * @param bool $show_fee_message Show fee message, or not. - */ - $show_fee_message = apply_filters( 'edds_show_stripe_connect_fee_message', true ); - - $fee_message = true === $show_fee_message - ? wpautop( - esc_html__( - 'Pay as you go pricing: 2% per-transaction fee + Stripe fees.', - 'easy-digital-downloads' - ) - . ' ' . - sprintf( - esc_html__( - /* Translators: Replacements are for the html wrappers for the phrase Upgrade to Pro and should not be translated. */ - '%1$sUpgrade to Pro%2$s and install the Stripe Pro Gateway to remove transaction fees.', 'easy-digital-downloads' - ), - '', - '' - ) - ) - : ''; - - // Return a message with name, email, and reconnect/disconnect actions. - return wp_send_json_success( - array( - 'message' => wpautop( - // $display_name is already escaped - $display_name . esc_html( $email ) . esc_html__( 'Administrator (Owner)', 'easy-digital-downloads' ) . $fee_message - ), - 'actions' => $reconnect_disconnect_actions, - 'status' => 'success', - ) - ); - } catch ( \Stripe\Exception\AuthenticationException $e ) { - // API keys were changed after using Stripe Connect. - return wp_send_json_error( - array( - 'message' => wpautop( - esc_html__( 'The API keys provided do not match the Stripe Connect account associated with this installation. If you have manually modified these values after connecting your account, please reconnect below or update your API keys.', 'easy-digital-downloads' ) . - '

    ' . - $reconnect_disconnect_actions - ), - ) - ); - } catch ( \EDD_Stripe_Utils_Exceptions_Stripe_API_Unmet_Requirements $e ) { - return wp_send_json_error( - array( - 'message' => wpautop( - $e->getMessage() - ), - ) - ); - } catch ( \Exception $e ) { - // General error. - return wp_send_json_error( $unknown_error ); - } - // Manual API key management. - } else { - $connect_button = sprintf( - '%s', - esc_url( edds_stripe_connect_url() ), - esc_html__( 'Connect with Stripe', 'easy-digital-downloads' ) - ); - - $connect = esc_html__( 'It is highly recommended to Connect with Stripe for easier setup and improved security.', 'easy-digital-downloads' ); - - // See if the keys are valid. - try { - // While we could show similar account information, leave it blank to help - // push people towards Stripe Connect. - $account = edds_api_request( 'Account', 'retrieve' ); - - return wp_send_json_success( - array( - 'message' => wpautop( - sprintf( - /* translators: %1$s Stripe payment mode.*/ - __( 'Your manually managed %1$s mode API keys are valid.', 'easy-digital-downloads' ), - '' . $mode . '' - ) . - '

    ' . - $connect . '

    ' . $connect_button - ), - 'status' => 'success', - ) - ); - // Show invalid keys. - } catch ( \Exception $e ) { - return wp_send_json_error( - array( - 'message' => wpautop( - sprintf( - /* translators: %1$s Stripe payment mode.*/ - __( 'Your manually managed %1$s mode API keys are invalid.', 'easy-digital-downloads' ), - '' . $mode . '' - ) . - '

    ' . - $connect . '

    ' . $connect_button - ), - ) - ); - } - } -} -add_action( 'wp_ajax_edds_stripe_connect_account_info', 'edds_stripe_connect_account_info_ajax_response' ); - -/** - * Registers admin notices for Stripe Connect. - * - * @since 2.8.0 - * - * @return true|WP_Error True if all notices are registered, otherwise WP_Error. - */ -function edds_stripe_connect_admin_notices_register() { - $registry = edds_get_registry( 'admin-notices' ); - - if ( ! $registry ) { - return new WP_Error( 'edds-invalid-registry', esc_html__( 'Unable to locate registry', 'easy-digital-downloads' ) ); - } - - $connect_button = sprintf( - '%s', - esc_url( edds_stripe_connect_url() ), - esc_html__( 'Connect with Stripe', 'easy-digital-downloads' ) - ); - - try { - // Stripe Connect. - $registry->add( - 'stripe-connect', - array( - 'message' => sprintf( - '

    %s

    %s

    ', - esc_html__( 'Start accepting payments with Stripe by connecting your account. Stripe Connect helps ensure easier setup and improved security.', 'easy-digital-downloads' ), - $connect_button - ), - 'type' => 'info', - 'dismissible' => true, - ) - ); - - // Stripe Connect reconnect. - /** translators: %s Test mode status. */ - $test_mode_status = edd_is_test_mode() - ? _x( 'enabled', 'gateway test mode status', 'easy-digital-downloads' ) - : _x( 'disabled', 'gateway test mode status', 'easy-digital-downloads' ); - - $registry->add( - 'stripe-connect-reconnect', - array( - 'message' => sprintf( - '

    %s

    %s

    ', - sprintf( - /* translators: %s Test mode status. Enabled or disabled. */ - __( '"Test Mode" has been %s. Please verify your Stripe connection status.', 'easy-digital-downloads' ), - $test_mode_status - ), - $connect_button - ), - 'type' => 'warning', - 'dismissible' => true, - ) - ); - - } catch( Exception $e ) { - return new WP_Error( 'edds-invalid-notices-registration', esc_html__( $e->getMessage() ) ); - }; - - return true; -} -add_action( 'admin_init', 'edds_stripe_connect_admin_notices_register' ); - -/** - * Conditionally prints registered notices. - * - * @since 2.6.19 - */ -function edds_stripe_connect_admin_notices_print() { - // Current user needs capability to dismiss notices. - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - $registry = edds_get_registry( 'admin-notices' ); - - if ( ! $registry ) { - return; - } - - $notices = new EDD_Stripe_Admin_Notices( $registry ); - - wp_enqueue_script( 'edds-admin-notices' ); - - try { - $enabled_gateways = edd_get_enabled_payment_gateways(); - - $api_key = true === edd_is_test_mode() - ? edd_get_option( 'test_secret_key' ) - : edd_get_option( 'live_secret_key' ); - - $mode_toggle = isset( $_GET['edd-message'] ) && 'connect-to-stripe' === $_GET['edd-message']; - - if ( array_key_exists( 'stripe', $enabled_gateways ) && empty( $api_key ) ) { - edd_stripe_connect_admin_style(); - - // Stripe Connect. - if ( false === $mode_toggle ) { - $notices->output( 'stripe-connect' ); - // Stripe Connect reconnect. - } else { - $notices->output( 'stripe-connect-reconnect' ); - } - } - } catch( Exception $e ) {} -} -add_action( 'admin_notices', 'edds_stripe_connect_admin_notices_print' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/site-health.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/site-health.php deleted file mode 100644 index 7d9fb684..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/site-health.php +++ /dev/null @@ -1,144 +0,0 @@ - __( 'Stripe Connect', 'easy-digital-downloads' ), - 'test' => 'edds_get_test_stripe_connect', - ); - } - - return $tests; -} -add_filter( 'site_status_tests', 'edds_stripe_connect_site_health_test' ); - -/** - * Adds the Stripe Connect Site Health test. - * - * @since 2.9.3 - * @return array - */ -function edds_get_test_stripe_connect() { - $result = array( - 'label' => __( 'You are securely connected to Stripe', 'easy-digital-downloads' ), - 'status' => 'good', - 'badge' => array( - 'label' => __( 'Easy Digital Downloads: Stripe', 'easy-digital-downloads' ), - 'color' => 'blue', - ), - 'description' => sprintf( - '

    %s

    ', - __( 'Stripe Connect helps ensure easy setup and security.', 'easy-digital-downloads' ) - ), - 'actions' => '', - 'test' => 'edds_stripe_connect', - ); - - $elements_mode = edds_get_elements_mode(); - if ( edd_stripe()->connect()->is_connected ) { - if ( 'payment-elements' === $elements_mode ) { - return $result; - } - - // User is connected but on the Card Elements, we should give them a recommendation to use the Payment Elements. - $result['label'] = __( 'You are using the legacy Card Elements fields', 'easy-digital-downloads' ); - $result['status'] = 'recommended'; - $result['badge']['color'] = 'orange'; - $result['description'] = sprintf( - '

    %s

    ', - esc_html__( 'Increase conversions, security, and reliability by using the Payment Elements integration for Stripe.', 'easy-digital-downloads' ) - ); - $result['actions'] = sprintf( - '%s', - esc_url( - edd_get_admin_url( - array( - 'page' => 'edd-settings', - 'tab' => 'gateways', - 'section' => 'edd-stripe', - ) - ) - ), - esc_html__( 'Switch to Payment Elements', 'easy-digital-downloads' ) - ); - - } else { - $result['label'] = __( 'You are using manually managed Stripe API keys', 'easy-digital-downloads' ); - $result['status'] = 'critical'; - $result['badge']['color'] = 'red'; - $result['description'] = sprintf( - '

    %s

    ', - esc_html__( 'By securely connecting your Easy Digital Downloads store with Stripe Connect, you\'ll get access to more reliable payments and use managed API keys which are more secure.', 'easy-digital-downloads' ) - ); - $result['actions'] = sprintf( - '%s', - esc_url( edds_stripe_connect_url() ), - esc_html__( 'Connect with Stripe', 'easy-digital-downloads' ) - ); - - } - - edd_stripe_connect_admin_style(); - - return $result; -} - -add_filter( 'edd_debug_information', 'edds_debug_information' ); -/** - * Add Stripe debugging information to the EDD information. - * - * @since 2.9.6 - * @param array $information The EDD debug information. - * @return array - */ -function edds_debug_information( $information ) { - $stripe = array( - 'edd_stripe' => array( - 'label' => __( 'Easy Digital Downloads — Stripe', 'easy-digital-downloads' ), - 'fields' => array( - 'connect' => array( - 'label' => 'Stripe Connect', - 'value' => edd_stripe()->connect()->is_connected ? 'Connected' : 'Not Connected', - ), - 'mode' => array( - 'label' => 'Elements Mode', - 'value' => 'payment-elements' === edds_get_elements_mode() ? 'Payment Elements' : 'Legacy Card Elements', - ), - 'preapproved_payments' => array( - 'label' => 'Preapproved Payments', - 'value' => edds_is_preapprove_enabled() ? 'Enabled' : 'Disabled', - ), - 'assets' => array( - 'label' => 'Stripe Assets', - 'value' => edd_get_option( 'stripe_restrict_assets', false ) ? 'Limited' : 'Global', - ), - ), - ), - ); - - $position = array_search( 'edd_gateways', array_keys( $information ), true ); - - return array_merge( - array_slice( $information, 0, $position + 1 ), - $stripe, - array_slice( $information, $position + 1 ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/upgrade-functions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/upgrade-functions.php deleted file mode 100644 index e8b84355..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/admin/upgrade-functions.php +++ /dev/null @@ -1,184 +0,0 @@ -connect(); - - if ( - ! empty( $connect->get_connect_id() ) || - edds_stripe_connect_can_manage_keys() - ) { - $elements_mode = 'card-elements'; - add_option( '_edds_legacy_elements_enabled', 1, false ); - } - - edd_update_option( 'stripe_elements_mode', $elements_mode ); -} ); - -/** - * Stripe Upgrade Notices - * - * @since 2.6 - * - */ -function edd_stripe_upgrade_notices() { - - global $wpdb; - - // Don't show notices on the upgrades page - if ( isset( $_GET['page'] ) && $_GET['page'] == 'edd-upgrades' ) { - return; - } - - if ( ! edd_has_upgrade_completed( 'stripe_customer_id_migration' ) ) { - - $has_stripe_customers = $wpdb->get_var( "SELECT count(user_id) FROM $wpdb->usermeta WHERE meta_key IN ( '_edd_stripe_customer_id', '_edd_stripe_customer_id_test' ) LIMIT 1" ); - $needs_upgrade = ! empty( $has_stripe_customers ); - - if( ! $needs_upgrade ) { - edd_set_upgrade_complete( 'stripe_customer_id_migration' ); - return; - } - - printf( - '
    ' . - '

    ' . - /* translators: %s Upgrade link. */ - __( 'Easy Digital Downloads - Stripe Gateway needs to upgrade the customers database; click here to start the upgrade. Learn more about this upgrade', 'easy-digital-downloads' ) . - '

    ' . - '

    ' . - __( 'About this upgrade:
    This upgrade will improve the reliability of associating purchase records with your existing customer records in Stripe by changing their Stripe Customer IDs to be stored locally on their EDD customer record, instead of their user record.', 'easy-digital-downloads' ) . - '

    ' . - __( 'Advanced User?
    This upgrade can also be run via WPCLI with the following command:
    wp edd-stripe migrate_customer_ids', 'easy-digital-downloads' ) . - '

    ' . - '
    ', - esc_url( admin_url( 'index.php?page=edd-upgrades&edd-upgrade=stripe_customer_id_migration' ) ) - ); - } - -} -add_action( 'admin_notices', 'edd_stripe_upgrade_notices' ); - -/** - * Migrates Stripe Customer IDs from the usermeta table to the edd_customermeta table. - * - * @since 2.6 - * @return void - */ -function edd_stripe_customer_id_migration() { - global $wpdb; - - if ( ! current_user_can( 'manage_shop_settings' ) ) { - wp_die( __( 'You do not have permission to do shop upgrades', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); - } - - ignore_user_abort( true ); - - $step = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1; - $number = isset( $_GET['number'] ) ? absint( $_GET['number'] ) : 10; - $offset = $step == 1 ? 0 : ( $step - 1 ) * $number; - - $total = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false; - if ( empty( $total ) || $total <= 1 ) { - $total_sql = "SELECT COUNT(user_id) as total_users FROM $wpdb->usermeta WHERE meta_key IN ( '_edd_stripe_customer_id', '_edd_stripe_customer_id_test' )"; - $results = $wpdb->get_row( $total_sql ); - $total = $results->total_users; - } - - $stripe_user_meta = $wpdb->get_results( - $wpdb->prepare( - "SELECT * FROM $wpdb->usermeta WHERE meta_key IN ( '_edd_stripe_customer_id', '_edd_stripe_customer_id_test' ) ORDER BY umeta_id ASC LIMIT %d,%d;", - $offset, - $number - ) - ); - - if ( $stripe_user_meta ) { - - foreach ( $stripe_user_meta as $stripe_user ) { - - $user = get_userdata( $stripe_user->user_id ); - $email = $user->user_email; - - $customer = new EDD_Customer( $email ); - - // If we don't have a customer on this site, just move along. - if ( ! $customer->id > 0 ) { - continue; - } - - $stripe_customer_id = $stripe_user->meta_value; - - // We should try and use a recurring ID if one exists for this user - if ( class_exists( 'EDD_Recurring_Subscriber' ) ) { - $subscriber = new EDD_Recurring_Subscriber( $customer->id ); - $stripe_customer_id = $subscriber->get_recurring_customer_id( 'stripe' ); - } - - $customer->update_meta( $stripe_user->meta_key, $stripe_customer_id ); - - } - - $step ++; - $redirect = add_query_arg( array( - 'page' => 'edd-upgrades', - 'edd-upgrade' => 'stripe_customer_id_migration', - 'step' => absint( $step ), - 'number' => absint( $number ), - 'total' => absint( $total ), - ), admin_url( 'index.php' ) ); - - wp_safe_redirect( $redirect ); - exit; - - } else { - - update_option( 'edds_stripe_version', preg_replace( '/[^0-9.].*/', '', EDD_STRIPE_VERSION ) ); - edd_set_upgrade_complete( 'stripe_customer_id_migration' ); - delete_option( 'edd_doing_upgrade' ); - - wp_redirect( admin_url() ); - exit; - - } - -} -add_action( 'edd_stripe_customer_id_migration', 'edd_stripe_customer_id_migration' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/card-actions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/card-actions.php deleted file mode 100644 index de6a7502..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/card-actions.php +++ /dev/null @@ -1,552 +0,0 @@ - __( 'This feature is not available at this time.', 'easy-digital-downloads' ), - ) - ); - } - - // Source can't be found. - $payment_method = isset( $_POST['payment_method'] ) ? sanitize_text_field( $_POST['payment_method'] ) : ''; - - if ( empty( $payment_method ) ) { - wp_send_json_error( - array( - 'message' => __( 'Error updating card.', 'easy-digital-downloads' ), - ) - ); - } - - // Nonce failed. - if ( ! edds_verify( 'nonce', $payment_method . '_update' ) ) { - wp_send_json_error( - array( - 'message' => __( 'Error updating card.', 'easy-digital-downloads' ), - ) - ); - } - $stripe_customer_id = edds_get_stripe_customer_id( get_current_user_id() ); - if ( empty( $stripe_customer_id ) ) { - wp_send_json_error( - array( - 'message' => __( 'Error updating card.', 'easy-digital-downloads' ), - ) - ); - } - - try { - $card_args = array(); - $card_fields = array( - 'address_city', - 'address_country', - 'address_line1', - 'address_line2', - 'address_zip', - 'address_state', - 'exp_month', - 'exp_year', - ); - - foreach ( $card_fields as $card_field ) { - $card_args[ $card_field ] = ( isset( $_POST[ $card_field ] ) && '' !== $_POST[ $card_field ] ) - ? sanitize_text_field( $_POST[ $card_field ] ) - : null; - } - - // Update a PaymentMethod. - if ( 'pm_' === substr( $payment_method, 0, 3 ) ) { - $address_args = array( - 'city' => $card_args['address_city'], - 'country' => $card_args['address_country'], - 'line1' => $card_args['address_line1'], - 'line2' => $card_args['address_line2'], - 'postal_code' => $card_args['address_zip'], - 'state' => $card_args['address_state'], - ); - - edds_api_request( - 'PaymentMethod', - 'update', - $payment_method, - array( - 'billing_details' => array( - 'address' => $address_args, - ), - 'card' => array( - 'exp_month' => $card_args['exp_month'], - 'exp_year' => $card_args['exp_year'], - ), - ) - ); - - // Update a legacy Card. - } else { - edds_api_request( 'Customer', 'updateSource', $stripe_customer_id, $payment_method, $card_args ); - } - - // Check if customer has default card. - $existing_cards = edd_stripe_get_existing_cards( get_current_user_id() ); - $default_payment_method = edds_customer_get_default_payment_method( get_current_user_id(), $existing_cards ); - // If there is no default card, make updated card default. - if ( null === $default_payment_method ) { - edds_customer_set_default_payment_method( $stripe_customer_id, current( $existing_cards )['source']->id ); - } - - wp_send_json_success( - array( - 'message' => esc_html__( 'Card successfully updated.', 'easy-digital-downloads' ), - ) - ); - } catch ( \Exception $e ) { - wp_send_json_error( - array( - 'message' => esc_html( $e->getMessage() ), - ) - ); - } -} -add_action( 'wp_ajax_edds_update_payment_method', 'edd_stripe_process_card_update' ); - -/** - * Process the set default card action from the manage card form. - * - * @since 2.6 - * @return void - */ -function edd_stripe_process_card_default() { - $enabled = edd_stripe_existing_cards_enabled(); - - // Feature not enabled. - if ( ! $enabled ) { - wp_send_json_error( - array( - 'message' => __( 'This feature is not available at this time.', 'easy-digital-downloads' ), - ) - ); - } - - // Source can't be found. - $payment_method = isset( $_POST['payment_method'] ) ? sanitize_text_field( $_POST['payment_method'] ) : ''; - - if ( empty( $payment_method ) ) { - wp_send_json_error( - array( - 'message' => __( 'Error updating card.', 'easy-digital-downloads' ), - ) - ); - } - - // Nonce failed. - if ( ! edds_verify( 'nonce', $payment_method . '_update' ) ) { - wp_send_json_error( - array( - 'message' => __( 'Error updating card.', 'easy-digital-downloads' ), - ) - ); - } - - // Customer can't be found. - $stripe_customer_id = edds_get_stripe_customer_id( get_current_user_id() ); - - if ( empty( $stripe_customer_id ) ) { - wp_send_json_error( - array( - 'message' => __( 'Error updating card.', 'easy-digital-downloads' ), - ) - ); - } - - try { - edds_customer_set_default_payment_method( $stripe_customer_id, $payment_method ); - - wp_send_json_success( - array( - 'message' => esc_html__( 'Card successfully set as default.', 'easy-digital-downloads' ), - ) - ); - } catch ( \Exception $e ) { - wp_send_json_error( - array( - 'message' => esc_html( $e->getMessage() ), - ) - ); - } -} -add_action( 'wp_ajax_edds_set_payment_method_default', 'edd_stripe_process_card_default' ); - -/** - * Process the delete card action from the manage card form. - * - * @since 2.6 - * @return void - */ -function edd_stripe_process_card_delete() { - $enabled = edd_stripe_existing_cards_enabled(); - - // Feature not enabled. - if ( ! $enabled ) { - wp_send_json_error( - array( - 'message' => __( 'This feature is not available at this time.', 'easy-digital-downloads' ), - ) - ); - } - - // Source can't be found. - $payment_method = isset( $_POST['payment_method'] ) ? sanitize_text_field( $_POST['payment_method'] ) : ''; - - if ( empty( $payment_method ) ) { - wp_send_json_error( - array( - 'message' => __( 'Error updating card.', 'easy-digital-downloads' ), - ) - ); - } - - // Nonce failed. - if ( ! edds_verify( 'nonce', $payment_method . '_update' ) ) { - wp_send_json_error( - array( - 'message' => __( 'Error updating card.', 'easy-digital-downloads' ), - ) - ); - } - - // Customer can't be found. - $stripe_customer_id = edds_get_stripe_customer_id( get_current_user_id() ); - - if ( empty( $stripe_customer_id ) ) { - wp_send_json_error( - array( - 'message' => __( 'Error updating card.', 'easy-digital-downloads' ), - ) - ); - } - - // Removal is disabled for this card. - $should_remove = apply_filters( - 'edd_stripe_should_remove_card', - array( - 'remove' => true, - 'message' => '', - ), - $payment_method, - $stripe_customer_id - ); - - if ( ! $should_remove['remove'] ) { - wp_send_json_error( - array( - 'message' => esc_html__( 'This feature is not available at this time.', 'easy-digital-downloads' ), - ) - ); - } - - try { - // Detach a PaymentMethod. - if ( 'pm_' === substr( $payment_method, 0, 3 ) ) { - $payment_method = edds_api_request( 'PaymentMethod', 'retrieve', $payment_method ); - $payment_method->detach(); - - // Delete a Card. - } else { - edds_api_request( 'Customer', 'deleteSource', $stripe_customer_id, $payment_method ); - } - - // Retrieve saved cards before checking for default. - $existing_cards = edd_stripe_get_existing_cards( get_current_user_id() ); - $default_payment_method = edds_customer_get_default_payment_method( get_current_user_id(), $existing_cards ); - - // If there is no default card, make updated card default. - if ( null === $default_payment_method && ! empty( $existing_cards ) ) { - edds_customer_set_default_payment_method( $stripe_customer_id, current( $existing_cards )['source']->id ); - } - - wp_send_json_success( - array( - 'message' => esc_html__( 'Card successfully removed.', 'easy-digital-downloads' ), - ) - ); - } catch ( \Exception $e ) { - wp_send_json_error( - array( - 'message' => esc_html( $e->getMessage() ), - ) - ); - } -} -add_action( 'wp_ajax_edds_delete_payment_method', 'edd_stripe_process_card_delete' ); - -/** - * Handles adding a new PaymentMethod (via AJAX). - * - * @since 2.6 - * @return void - */ -function edds_add_payment_method() { - $enabled = edd_stripe_existing_cards_enabled(); - - // Feature not enabled. - if ( ! $enabled ) { - wp_send_json_error( - array( - 'message' => __( 'This feature is not available at this time.', 'easy-digital-downloads' ), - ) - ); - } - - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - // Increase the card error count. - edd_stripe()->rate_limiting->increment_card_error_count(); - - wp_send_json_error( - array( - 'message' => __( 'Unable to update your account at this time, please try again later', 'easy-digital-downloads' ), - ) - ); - } - - // PaymentMethod can't be found. - $payment_method_id = isset( $_POST['payment_method_id'] ) ? sanitize_text_field( $_POST['payment_method_id'] ) : false; - - if ( ! $payment_method_id ) { - wp_send_json_error( - array( - 'message' => __( 'Missing card ID.', 'easy-digital-downloads' ), - ) - ); - } - - // Nonce failed. - if ( ! edds_verify( 'nonce', 'edd-stripe-add-card' ) ) { - wp_send_json_error( - array( - 'message' => __( 'Error adding card.', 'easy-digital-downloads' ), - ) - ); - } - - $edd_customer = new \EDD_Customer( get_current_user_id(), true ); - if ( 0 === $edd_customer->id ) { - wp_send_json_error( - array( - 'message' => __( - 'Unable to retrieve customer.', - 'easy-digital-downloads' - ), - ) - ); - } - - $stripe_customer_id = edds_get_stripe_customer_id( get_current_user_id() ); - - $customer_name = ''; - if ( ! empty( $edd_customer->name ) ) { - $customer_name = $edd_customer->name; - } - - $stripe_customer = edds_get_stripe_customer( - $stripe_customer_id, - array( - 'email' => $edd_customer->email, - 'description' => $edd_customer->email, - 'name' => $customer_name, - ) - ); - - if ( false === $stripe_customer ) { - wp_send_json_error( - array( - 'message' => __( - 'Unable to create customer in Stripe.', - 'easy-digital-downloads' - ), - ) - ); - } - - // Ensure the EDD Customer is has a link to the most up to date Stripe Customer ID. - $edd_customer->update_meta( edd_stripe_get_customer_key(), $stripe_customer->id ); - - try { - $payment_method = edds_api_request( 'PaymentMethod', 'retrieve', $payment_method_id ); - $payment_method->attach( - array( - 'customer' => $stripe_customer->id, - ) - ); - // Check if customer has default card. - $existing_cards = edd_stripe_get_existing_cards( get_current_user_id() ); - $default_payment_method = edds_customer_get_default_payment_method( get_current_user_id(), $existing_cards ); - // If there is no default card, make updated card default. - if ( null === $default_payment_method ) { - edds_customer_set_default_payment_method( $stripe_customer->id, current( $existing_cards )['source']->id ); - } - - wp_send_json_success( - array( - 'message' => esc_html__( 'Card successfully added.', 'easy-digital-downloads' ), - ) - ); - } catch ( \Exception $e ) { - // Increase the card error count. - edd_stripe()->rate_limiting->increment_card_error_count(); - - wp_send_json_error( - array( - 'message' => esc_html( $e->getMessage() ), - ) - ); - } -} -add_action( 'wp_ajax_edds_add_payment_method', 'edds_add_payment_method' ); - -/** - * Sets default payment method if none. - * - * @since 2.8 - * @param string $stripe_customer_id Stripe Customer ID. Usually starts with cus_ . - * @param string $payment_method_id Stripe Payment ID. Usually starts with pm_ . - * @return \Stripe\Customer $customer Stripe Customer. - */ -function edds_customer_set_default_payment_method( $stripe_customer_id, $payment_method_id ) { - $customer = edds_api_request( - 'Customer', - 'update', - $stripe_customer_id, - array( - 'invoice_settings' => array( - 'default_payment_method' => $payment_method_id, - ), - ) - ); - return $customer; -} - -/** - * Checks if customer has default payment method. - * - * @since 2.8 - * @param int $user_id WordPress user ID. - * @param array $payment_methods Array of payment methods for user, default = false will fetch payment methods. - * @return null|string Payment Method ID if found, else null - */ -function edds_customer_get_default_payment_method( $user_id, $payment_methods = false ) { - // Retrieve saved cards before checking for default. - if ( false === $payment_methods ) { - $payment_methods = edd_stripe_get_existing_cards( $user_id ); - } - $default_payment_method = null; - if ( count( $payment_methods ) >= 1 ) { - // Loop through existing cards for default. - foreach ( $payment_methods as $card ) { - if ( true === $card['default'] ) { - $default_payment_method = $card['source']->id; - break; - } - } - } - return $default_payment_method; -} - -/** - * Checks if customer Stripe Customer object exists. - * - * @since 2.8 - * @param string $stripe_customer_id Stripe Customer ID. Usually starts with cus_ . - * @param array $customer_args { - * Arguments to create a Stripe Customer. - * - * @link https://stripe.com/docs/api/customers/create - * } - * @return \Stripe\Customer|false $customer Stripe Customer if found or false on error. - */ -function edds_get_stripe_customer( $stripe_customer_id, $customer_args ) { - $customer = false; - if ( ! empty( $stripe_customer_id ) ) { - try { - $customer = edds_api_request( 'Customer', 'retrieve', $stripe_customer_id ); - if ( isset( $customer->deleted ) && $customer->deleted ) { // If customer was deleted in Stripe, try to create a new one. - $customer = edds_create_stripe_customer( $customer_args ); - } - } catch ( \Stripe\Error\Base $e ) { - $error_code = $e->getStripeCode(); - if ( 'resource_missing' === $error_code ) { // If Stripe returns an error of 'resource_missing', try to create a new Stripe Customer. - try { - $customer = edds_create_stripe_customer( $customer_args ); - } catch ( \Exception $e ) { - // No further actions to take if something causes error. - } - } - } - } else { - try { - $customer = edds_create_stripe_customer( $customer_args ); - } catch ( \Exception $e ) { - // No further actions to take if something causes error. - } - } - return $customer; -} - -/** - * Creates a new Stripe Customer - * - * @since 2.8 - * @param array $customer_args { - * Arguments to create a Stripe Customer. - * - * @link https://stripe.com/docs/api/customers/create - * } - * @return \Stripe\Customer|false $customer Stripe Customer if one is created or false on error. - */ -function edds_create_stripe_customer( $customer_args = array() ) { - /** - * Filters the arguments used to create a Customer in Stripe. - * - * @since unknown - * - * @param array $customer_args { - * Arguments to create a Stripe Customer. - * - * @link https://stripe.com/docs/api/customers/create - * } - * @param array $purchase_data { - * Cart purchase data if in the checkout context. Empty otherwise. - * } - */ - $customer_args = apply_filters( 'edds_create_customer_args', $customer_args, array() ); - if ( empty( $customer_args['email'] ) || ! is_email( $customer_args['email'] ) ) { - return false; - } - if ( empty( $customer_args['description'] ) ) { - $customer_args['description'] = $customer_args['email']; - } - - try { - $customer = edds_api_request( 'Customer', 'create', $customer_args ); - } catch ( \Exception $e ) { - $customer = false; - } - - return $customer; - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/class-edd-stripe-rate-limiting.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/class-edd-stripe-rate-limiting.php deleted file mode 100644 index 2559c497..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/class-edd-stripe-rate-limiting.php +++ /dev/null @@ -1,436 +0,0 @@ -actions(); - $this->filters(); - } - - /** - * Register any actions we need to use. - * - * @since 2.6.19 - */ - private function actions() { - - // Setup the log file. - add_action( 'plugins_loaded', array( $this, 'setup_log_file' ), 11 ); - - // Maybe schedule the cron to clean up the log file. - add_action( 'init', array( $this, 'schedule_cleanup' ) ); - - // Hook into the scheduled cleanup. - add_action( 'edds_cleanup_rate_limiting_log', array( $this, 'cleanup_log' ) ); - - // Catch any recurring errors as they don't run through the main Stripe extension. - add_action( 'edd_before_purchase_form', array( $this, 'listen_for_recurring_card_errors' ), 0 ); - - } - - /** - * Register any filters we need to use. - * - * @since 2.6.19 - */ - private function filters() { - - // Hide the purchase button if the visitor has hit the limit of errors. - add_filter( 'edd_checkout_button_purchase', array( $this, 'maybe_hide_purchase_button' ) ); - - } - - /** - * Schedule a cleanup of the card testing log entries. - * - * Runs every hour, and clears any card testing logs that are past expiration. - * - * @since 2.8.13 - */ - public function schedule_cleanup() { - if ( ! wp_next_scheduled( 'edds_cleanup_rate_limiting_log' ) ) { - wp_schedule_event( time(), 'hourly', 'edds_cleanup_rate_limiting_log' ); - } - } - - /** - * Process the card testing logs. - * - * Loops over the card testing logs, and if an entry is past it's expiration, remove it from the list. - * - * @since 2.8.13 - */ - public function cleanup_log() { - $current_logs = $this->get_decoded_file(); - if ( empty( $current_logs ) ) { - return; - } - - foreach ( $current_logs as $blocking_id => $entry ) { - $expiration = ! empty( $entry['timeout'] ) ? $entry['timeout'] : 0; - - if ( $expiration < current_time( 'timestamp' ) ) { // @codingStandardsIgnoreLine - unset( $current_logs[ $blocking_id ] ); - } - } - - $this->write_to_log( $current_logs ); - } - - /** - * Sets up the log file if it is writable - * - * @since 2.6.19 - * @return void - */ - public function setup_log_file() { - - $upload_dir = wp_upload_dir(); - $this->filename = wp_hash( home_url( '/' ) ) . '-edd-stripe-rate-limiting.log'; - $this->file = trailingslashit( $upload_dir['basedir'] ) . $this->filename; - - if ( ! is_writeable( $upload_dir['basedir'] ) ) { - $this->is_writable = false; - } - - } - - /** - * Checks if the current session has hit the card error limit. - * - * @since 2.6.19 - * - * @return bool - */ - public function has_hit_card_error_limit() { - if ( ! $this->card_error_checks_enabled() ) { - return false; - } - - $blocking_id = $this->get_card_error_id(); - $entry = $this->get_rate_limiting_entry( $blocking_id ); - $expiration = ! empty( $entry['timeout'] ) ? $entry['timeout'] : 0; - $card_errors = ! empty( $entry['count'] ) ? $entry['count'] : 0; - - if ( $expiration < current_time( 'timestamp' ) ) { // @codingStandardsIgnoreLine - $this->remove_log_entry( $this->get_card_error_id() ); - return false; - } - - $max_error_count = 5; - - /** - * Filters the number of times checkout errors can occur before blocking future attempts. - * - * @since 2.6.19 - * - * @param bool $max_error_count The maximum failed checkouts before blocking future attempts. Default 5. - */ - $max_error_count = apply_filters( 'edds_max_card_error_count', $max_error_count ); - - return $max_error_count <= $card_errors; - } - - /** - * Remove an entry from the rate limiting log. - * - * @since 2.6.19 - * - * @param string $blocking_id The blocking ID for the rate limiting. - */ - public function remove_log_entry( $blocking_id = '' ) { - $current_logs = $this->get_decoded_file(); - unset( $current_logs[ $blocking_id ] ); - - $this->write_to_log( $current_logs ); - } - - /** - * Get a specific entry from the rate limiting log. - * - * @since 2.6.19 - * - * @param string $blocking_id The blocking ID to get the entry for. - * - * @return array - */ - public function get_rate_limiting_entry( $blocking_id = '' ) { - $current_logs = $this->get_decoded_file(); - $entry = array(); - - if ( array_key_exists( $blocking_id, $current_logs ) ) { - $entry = $current_logs[ $blocking_id ]; - } - - return $entry; - } - - - /** - * Retrieves the number of times an IP address has generated card errors. - * - * @since 2.6.19 - * - * @return int - */ - public function get_card_error_count() { - $blocking_id = $this->get_card_error_id(); - $count = 0; - - $current_blocks = $this->get_decoded_file(); - if ( array_key_exists( $blocking_id, $current_blocks ) ) { - $count = $current_blocks[ $blocking_id ]['count']; - } - - return $count; - } - - /** - * Increments the Stripe card error counter. - * - * @since 2.6.19 - * - * @return int - */ - public function increment_card_error_count() { - $current_count = $this->get_card_error_count(); - $blocking_id = $this->get_card_error_id(); - - if ( empty( $current_count ) ) { - $current_count = 1; - } else { - $current_count++; - } - - $this->update_rate_limiting_count( $blocking_id, $current_count ); - - return absint( $current_count ); - } - - /** - * Update an entry in the rate limiting array. - * - * @since 2.6.19 - * - * @param string $blocking_id The blocking ID. - * @param int $current_count The count to update to. - */ - protected function update_rate_limiting_count( $blocking_id = '', $current_count = 0 ) { - - $expiration_in_seconds = HOUR_IN_SECONDS; - - /** - * Filters the length of time before checkout card error counts are reset. - * - * @since 2.6.19 - * - * @param int $expiration_in_seconds The length in seconds before card error counts are reset. Default 60. - */ - $expiration_in_seconds = apply_filters( 'edds_card_error_timeout', $expiration_in_seconds ); - - $current_log = $this->get_decoded_file(); - - $current_log[ $blocking_id ]['count'] = $current_count; - $current_log[ $blocking_id ]['timeout'] = current_time( 'timestamp' ) + $expiration_in_seconds; // @codingStandardsIgnoreLine - - $this->write_to_log( $current_log ); - - } - - /** - * Determines if we should check for Stripe card errors and track them. - * - * @since 2.6.19 - * - * @return bool - */ - public function card_error_checks_enabled() { - $checks_enabled = true; - - /** - * Filters if card errors should be checked and tracked during checkout. - * - * @since 2.6.19 - * - * @param bool $checks_enabled Enables or disables card error checking on checkout. Default true. - */ - $checks_enabled = apply_filters( 'edds_card_error_checking_enabled', true ); - - return true === $checks_enabled; - } - - /** - * Generates the card error tracking ID. - * - * ID is the IP address of the visitor. Prepends the value with `edds_card_errors_` for use with the transient system. - * Uses IP tracking in an attempt to mitigate the amount of bogus WordPress user accounts being created. - * - * @since 2.6.19 - * @since 2.8.13 Try and use the __stripe_sid cookie before relying on IP. - * - * @return string - */ - public function get_card_error_id() { - return isset( $_COOKIE['__stripe_sid'] ) ? $_COOKIE['__stripe_sid'] : edd_get_ip(); - } - - /** - * Determines if we should hide the purchase button. - * - * When someone has hit the card error limit, the purchase button is hidden. - * - * @since 2.6.19 - * - * @param string $purchase_button_markup The markup for the purchase button. - * - * @return string - */ - public function maybe_hide_purchase_button( $purchase_button_markup = '' ) { - if ( $this->has_hit_card_error_limit() ) { - $purchase_button_markup = ''; - } - - return $purchase_button_markup; - - } - - /** - * When the purchase form errors are displayed, see if any were related to Stripe failures and increase the card error - * counter. - * - * @since 2.6.19 - */ - public function listen_for_recurring_card_errors() { - - // Get all of our EDD errors. - $errors = edd_get_errors(); - - // If any of our errors are Stripe card errors from recurring, increment the card error counter. - if ( isset( $errors['edd_recurring_stripe_error'] ) && ! empty( $errors['edd_recurring_stripe_error'] ) ) { - $this->increment_card_error_count(); - } - - } - - /** - * Retrieve the log data - * - * @since 2.6.19 - * @return string - */ - protected function get_file_contents() { - return $this->get_file(); - } - - /** - * Get the decoded array of rate limiting from the log file. - * - * @since 2.6.19 - * - * @return array - */ - protected function get_decoded_file() { - $decoded_contents = json_decode( $this->get_file_contents(), true ); - if ( is_null( $decoded_contents ) ) { - $decoded_contents = array(); - } - - return (array) $decoded_contents; - } - - /** - * Retrieve the file data is written to - * - * @since 2.6.19 - * @return string - */ - protected function get_file() { - - $file = json_encode( array() ); - - if ( @file_exists( $this->file ) ) { - - if ( ! is_writeable( $this->file ) ) { - $this->is_writable = false; - } - - $file = @file_get_contents( $this->file ); - } else { - @file_put_contents( $this->file, $file ); // @codingStandardsIgnoreLine - @chmod( $this->file, 0664 ); // @codingStandardsIgnoreLine - } - - return $file; - } - - /** - * Write the log message - * - * @since 2.6.19 - * - * @param array $content The content of the rate limiting. - * - * @return void - */ - public function write_to_log( $content = array() ) { - if ( count( $content ) > 200 ) { - // Reduce the max number of identifiers to 200. - $content = array_slice( $content, -200 ); - } - - $content = json_encode( $content ); - - if ( $this->is_writable ) { - @file_put_contents( $this->file, $content ); // @codingStandardsIgnoreLine - } - } - - /** - * Get the error message to display when the card error limit has been hit. - * - * @since 2.9.2.2 - * @return string The error message. - */ - public function get_rate_limit_error_message() { - return esc_html__( - 'We are unable to process your payment at this time, please try again later or contact support.', - 'easy-digital-downloads' - ); - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/class-edd-stripe.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/class-edd-stripe.php deleted file mode 100644 index 0e7082de..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/class-edd-stripe.php +++ /dev/null @@ -1,343 +0,0 @@ -includes(); - self::$instance->setup_classes(); - self::$instance->actions(); - self::$instance->filters(); - } - - return self::$instance; - } - - /** - * Includes files. - * - * @since 2.6.0 - */ - private function includes() { - if ( ! class_exists( 'Stripe\Stripe' ) ) { - require_once EDDS_PLUGIN_DIR . '/vendor/autoload.php'; - } - - require_once EDDS_PLUGIN_DIR . '/includes/functions.php'; - require_once EDDS_PLUGIN_DIR . '/includes/class-stripe-api.php'; - - // We need this one to load early so we can use it in the upcoming includes. - require_once EDDS_PLUGIN_DIR . '/includes/elements/functions.php'; - $elements_mode = edds_get_elements_mode(); - - require_once EDDS_PLUGIN_DIR . '/includes/utils/exceptions/class-stripe-api-unmet-requirements.php'; - require_once EDDS_PLUGIN_DIR . '/includes/utils/exceptions/class-attribute-not-found.php'; - require_once EDDS_PLUGIN_DIR . '/includes/utils/exceptions/class-stripe-object-not-found.php'; - require_once EDDS_PLUGIN_DIR . '/includes/utils/exceptions/class-gateway-exception.php'; - require_once EDDS_PLUGIN_DIR . '/includes/utils/interface-static-registry.php'; - require_once EDDS_PLUGIN_DIR . '/includes/utils/class-registry.php'; - require_once EDDS_PLUGIN_DIR . '/includes/utils/modal.php'; - - require_once EDDS_PLUGIN_DIR . '/includes/deprecated.php'; - require_once EDDS_PLUGIN_DIR . '/includes/compat.php'; - require_once EDDS_PLUGIN_DIR . '/includes/i18n.php'; - require_once EDDS_PLUGIN_DIR . '/includes/emails.php'; - require_once EDDS_PLUGIN_DIR . '/includes/payment-receipt.php'; - require_once EDDS_PLUGIN_DIR . '/includes/card-actions.php'; - require_once EDDS_PLUGIN_DIR . '/includes/gateway-actions.php'; - require_once EDDS_PLUGIN_DIR . '/includes/gateway-filters.php'; - - // Payment Actions, separated by elements type. - require_once EDDS_PLUGIN_DIR . '/includes/payment-actions/functions.php'; - switch ( $elements_mode ) { - case 'card-elements': - require_once EDDS_PLUGIN_DIR . '/includes/payment-actions/card-elements-actions.php'; - break; - - case 'payment-elements': - require_once EDDS_PLUGIN_DIR . '/includes/payment-actions/payment-elements-actions.php'; - break; - } - - require_once EDDS_PLUGIN_DIR . '/includes/webhooks.php'; - require_once EDDS_PLUGIN_DIR . '/includes/scripts.php'; - require_once EDDS_PLUGIN_DIR . '/includes/template-functions.php'; - require_once EDDS_PLUGIN_DIR . '/includes/class-edd-stripe-rate-limiting.php'; - - // Load Apple Pay functions. - require_once EDDS_PLUGIN_DIR . '/includes/payment-methods/apple-pay.php'; - - // Stripe Elements, separated by elements type. - switch ( $elements_mode ) { - case 'card-elements': - require_once EDDS_PLUGIN_DIR . '/includes/elements/card-elements.php'; - require_once EDDS_PLUGIN_DIR . '/includes/payment-methods/payment-request/index.php'; - break; - - case 'payment-elements': - require_once EDDS_PLUGIN_DIR . '/includes/elements/payment-elements.php'; - break; - } - - // Payment Methods. - require_once EDDS_PLUGIN_DIR . '/includes/payment-methods/buy-now/index.php'; - - if ( is_admin() ) { - require_once EDDS_PLUGIN_DIR . '/includes/admin/class-notices-registry.php'; - require_once EDDS_PLUGIN_DIR . '/includes/admin/class-notices.php'; - require_once EDDS_PLUGIN_DIR . '/includes/admin/notices.php'; - - require_once EDDS_PLUGIN_DIR . '/includes/admin/admin-actions.php'; - require_once EDDS_PLUGIN_DIR . '/includes/admin/admin-filters.php'; - require_once EDDS_PLUGIN_DIR . '/includes/admin/settings/stripe-connect.php'; - require_once EDDS_PLUGIN_DIR . '/includes/admin/settings.php'; - require_once EDDS_PLUGIN_DIR . '/includes/admin/upgrade-functions.php'; - require_once EDDS_PLUGIN_DIR . '/includes/admin/site-health.php'; - } - - if ( defined( 'WP_CLI' ) && WP_CLI ) { - require_once EDDS_PLUGIN_DIR . '/includes/integrations/wp-cli.php'; - } - - if ( defined( 'EDD_ALL_ACCESS_VER' ) && EDD_ALL_ACCESS_VER ) { - require_once EDDS_PLUGIN_DIR . '/includes/integrations/edd-all-access.php'; - } - - if ( class_exists( 'EDD_Auto_Register' ) ) { - require_once EDDS_PLUGIN_DIR . '/includes/integrations/edd-auto-register.php'; - } - - // Load Regional Support. - $this->load_regional_support(); - - // Pro. - $pro = EDDS_PLUGIN_DIR . '/includes/pro/index.php'; - - if ( file_exists( $pro ) ) { - require_once $pro; - } - } - - /** - * Applies various hooks. - * - * @since 2.6.0 - */ - private function actions() { - add_action( 'init', array( self::$instance, 'load_textdomain' ) ); - add_action( 'admin_init', array( self::$instance, 'database_upgrades' ) ); - } - - /** - * Applies various filters. - * - * @since 2.6.0 - */ - private function filters() { - add_filter( 'edd_payment_gateways', array( self::$instance, 'register_gateway' ) ); - } - - /** - * Configures core components. - * - * @since 2.6.19 - */ - private function setup_classes() { - $this->rate_limiting = new EDD_Stripe_Rate_Limiting(); - } - - /** - * Gets the Stripe Connect utility class. - * - * @since 2.9.3 - */ - public function connect() { - if ( ! is_null( $this->connect ) ) { - return $this->connect; - } - require_once EDDS_PLUGIN_DIR . '/includes/class-stripe-connect.php'; - $this->connect = new EDD\Stripe\Connect(); - - return $this->connect; - } - - /** - * Performs database upgrades. - * - * @since 2.6.0 - */ - public function database_upgrades() { - $did_upgrade = false; - $version = get_option( 'edds_stripe_version' ); - - if ( ! $version || version_compare( $version, EDD_STRIPE_VERSION, '<' ) ) { - $did_upgrade = true; - - switch ( EDD_STRIPE_VERSION ) { - case '2.5.8' : - edd_update_option( 'stripe_checkout_remember', true ); - break; - case '2.8.0': - edd_update_option( 'stripe_allow_prepaid', true ); - break; - } - - } - - if ( $did_upgrade ) { - update_option( 'edds_stripe_version', EDD_STRIPE_VERSION ); - } - } - - /** - * Loads the plugin text domain. - * - * @since 2.6.0 - */ - public function load_textdomain() { - // Set filter for language directory - $lang_dir = EDDS_PLUGIN_DIR . '/languages/'; - - // Traditional WordPress plugin locale filter - $locale = apply_filters( 'plugin_locale', get_locale(), 'edds' ); - $mofile = sprintf( '%1$s-%2$s.mo', 'edds', $locale ); - - // Setup paths to current locale file - $mofile_local = $lang_dir . $mofile; - $mofile_global = WP_LANG_DIR . '/edd-stripe/' . $mofile; - - // Look in global /wp-content/languages/edd-stripe/ folder - if( file_exists( $mofile_global ) ) { - load_textdomain( 'edds', $mofile_global ); - - // Look in local /wp-content/plugins/edd-stripe/languages/ folder - } elseif( file_exists( $mofile_local ) ) { - load_textdomain( 'edds', $mofile_local ); - - } else { - // Load the default language files - load_plugin_textdomain( 'edds', false, $lang_dir ); - } - } - - /** - * Registers the gateway. - * - * @param array $gateways Payment gateways. - * @return array - */ - public function register_gateway( $gateways ) { - // Format: ID => Name. - $gateways['stripe'] = array( - 'admin_label' => 'Stripe', - 'checkout_label' => __( 'Credit Card', 'easy-digital-downloads' ), - 'supports' => array( - 'buy_now', - ), - 'icons' => array( - 'mastercard', - 'visa', - 'discover', - 'americanexpress', - ), - ); - - return $gateways; - } - - /** - * Loads regional support. - * - * @since 2.9.2.2 - */ - private function load_regional_support() { - - $base_country = edd_get_option( 'base_country', 'US' ); - $regions_needing_support = array( 'IN' ); - if ( ! in_array( $base_country, $regions_needing_support, true ) ) { - return; - } - - $possible_region_file = 'class-edd-stripe-region-' . strtolower( $base_country ) . '.php'; - $possible_region_path = EDDS_PLUGIN_DIR . 'includes/utils/regional-support/' . $possible_region_file; - if ( ! file_exists( $possible_region_path ) ) { - return; - } - - // Regional Support is needed. - require_once EDDS_PLUGIN_DIR . 'includes/utils/regional-support/class-edd-stripe-region-base.php'; - require_once $possible_region_path; - $possible_region_class = 'EDD_Stripe_Region_' . strtoupper( $base_country ); - if ( class_exists( $possible_region_class ) ) { - $this->has_regional_support = true; - require_once EDDS_PLUGIN_DIR . 'includes/utils/regional-support/' . $possible_region_file; - $this->regional_support = new $possible_region_class(); - } - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/class-stripe-api.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/class-stripe-api.php deleted file mode 100644 index 2b72aa4f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/class-stripe-api.php +++ /dev/null @@ -1,139 +0,0 @@ -is_connected = ! empty( $this->get_connect_id() ); - } - - /** - * Gets the connect ID. - * - * @return string|false - */ - public function get_connect_id() { - return edd_get_option( 'stripe_connect_account_id', false ); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/compat.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/compat.php deleted file mode 100644 index 49105228..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/compat.php +++ /dev/null @@ -1,451 +0,0 @@ - $error_message ) { - edd_set_error( $error_id, $error_message ); - } - } -} - -/** - * A rewritten version of `edds_get_purchase_form_user()` that can be run during AJAX. - * - * @since 2.7.0 - * - * @return array - */ -function _edds_get_purchase_form_user( $valid_data = array() ) { - // Initialize user - $user = false; - - if ( is_user_logged_in() ) { - - // Set the valid user as the logged in collected data. - $user = $valid_data['logged_in_user']; - - } elseif ( true === $valid_data['need_new_user'] || true === $valid_data['need_user_login'] ) { - - // Ensure $_COOKIE is available without a new HTTP request. - add_action( 'set_logged_in_cookie', 'edds_set_logged_in_cookie_global' ); - - // New user registration. - if ( true === $valid_data['need_new_user'] ) { - - // Set user. - $user = $valid_data['new_user_data']; - - // Register and login new user. - $user['user_id'] = edd_register_and_login_new_user( $user ); - - } elseif ( true === $valid_data['need_user_login'] ) { // User login. - - /* - * The login form is now processed in the edd_process_purchase_login() function. - * This is still here for backwards compatibility. - * This also allows the old login process to still work if a user removes the - * checkout login submit button. - * - * This also ensures that the customer is logged in correctly if they click "Purchase" - * instead of submitting the login form, meaning the customer is logged in during the purchase process. - */ - - // Set user. - $user = $valid_data['login_user_data']; - - // Login user. - if ( empty( $user ) || -1 === $user['user_id'] ) { - edd_set_error( 'invalid_user', __( 'The user information is invalid', 'easy-digital-downloads' ) ); - return false; - } else { - edd_log_user_in( $user['user_id'], $user['user_login'], $user['user_pass'] ); - } - } - - remove_action( 'set_logged_in_cookie', 'edds_set_logged_in_cookie_global' ); - } - - // Check guest checkout. - if ( false === $user && false === edd_no_guest_checkout() ) { - // Set user. - $user = $valid_data['guest_user_data']; - } - - // Verify we have an user. - if ( false === $user || empty( $user ) ) { - return false; - } - - // Get user first name. - if ( ! isset( $user['user_first'] ) || strlen( trim( $user['user_first'] ) ) < 1 ) { - $user['user_first'] = isset( $_POST["edd_first"] ) ? strip_tags( trim( $_POST["edd_first"] ) ) : ''; - } - - // Get user last name. - if ( ! isset( $user['user_last'] ) || strlen( trim( $user['user_last'] ) ) < 1 ) { - $user['user_last'] = isset( $_POST["edd_last"] ) ? strip_tags( trim( $_POST["edd_last"] ) ) : ''; - } - - // Get the user's billing address details. - $user['address'] = array(); - $user['address']['line1'] = ! empty( $_POST['card_address'] ) ? sanitize_text_field( $_POST['card_address'] ) : ''; - $user['address']['line2'] = ! empty( $_POST['card_address_2'] ) ? sanitize_text_field( $_POST['card_address_2'] ) : ''; - $user['address']['city'] = ! empty( $_POST['card_city'] ) ? sanitize_text_field( $_POST['card_city'] ) : ''; - $user['address']['state'] = ! empty( $_POST['card_state'] ) ? sanitize_text_field( $_POST['card_state'] ) : ''; - $user['address']['country'] = ! empty( $_POST['billing_country'] ) ? sanitize_text_field( $_POST['billing_country'] ) : ''; - $user['address']['zip'] = ! empty( $_POST['card_zip'] ) ? sanitize_text_field( $_POST['card_zip'] ) : ''; - - if ( empty( $user['address']['country'] ) ) { - $user['address'] = false; // Country will always be set if address fields are present. - } - - if ( ! empty( $user['user_id'] ) && $user['user_id'] > 0 && ! empty( $user['address'] ) ) { - $customer = edd_get_customer_by( 'user_id', $user['user_id'] ); - if ( $customer ) { - edd_maybe_add_customer_address( $customer->id, $user['address'] ); - } - } - - // Return valid user. - return $user; -} - -/** - * A rewritten version of `edd_process_purchase_form()` that allows for full AJAX processing. - * - * `edd_process_purchase_form()` is run up until: - * - * if ( $is_ajax ) { - * echo 'success'; - * edd_die(); - * } - * - * Then this function is called which reruns the start of `edd_process_purchase_form()` and - * continues the rest of the processing. - * - * @link https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/process-purchase.php - * - * @since 2.7.0 - */ -function _edds_process_purchase_form() { - // Unset any Errors so they aren't left over form other attempts. - edd_clear_errors(); - - // Catch exceptions at a high level. - try { - // `edd_process_purchase_form()` and subsequent code executions are written - // expecting form processing to happen via a POST request from a client form. - // - // This version is called from an AJAX POST request, so the form data is sent - // in a serialized string to ensure all fields are available. - // - // Map and merge formData to $_POST so it's accessible in other functions. - parse_str( $_POST['form_data'], $form_data ); - $_POST = array_merge( $_POST, $form_data ); - $_REQUEST = array_merge( $_REQUEST, $_POST ); - - /* - * Reset the tax rate so that it will be recalculated correctly. - * This is only needed on EDD 3.0+. - */ - if ( method_exists( EDD()->cart, 'set_tax_rate' ) ) { - EDD()->cart->set_tax_rate( null ); - } - - /** - * @since unknown - * @todo document - */ - do_action( 'edd_pre_process_purchase' ); - - // Make sure the cart isn't empty. - if ( empty( EDD()->cart->contents ) && empty( EDD()->cart->fees) ) { - throw new \Exception( esc_html__( 'Your cart is empty.', 'easy-digital-downloads' ) ); - } - - if ( ! isset( $_POST['edd-process-checkout-nonce'] ) ) { - edd_debug_log( __( 'Missing nonce when processing checkout. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), true ); - } - - // Verify the checkout session only. - if ( false === edds_verify() ) { - throw new \Exception( esc_html__( 'Error processing purchase. Please reload the page and try again.', 'easy-digital-downloads' ) ); - } - - // Validate the form $_POST data. - $valid_data = edd_purchase_form_validate_fields(); - - // Allow themes and plugins to hook to errors. - // - // In the future these should throw exceptions, existing `edd_set_error()` usage will be caught below. - do_action( 'edd_checkout_error_checks', $valid_data, $_POST ); - - // Validate the user. - $user = _edds_get_purchase_form_user( $valid_data ); - - // Let extensions validate fields after user is logged in if user has used login/registration form - do_action( 'edd_checkout_user_error_checks', $user, $valid_data, $_POST ); - - if ( false === $valid_data || edd_get_errors() || ! $user ) { - $errors = edd_get_errors(); - - if ( is_array( $errors ) ) { - throw new \Exception( current( $errors ) ); - } - } - - // Setup user information. - $user_info = array( - 'id' => $user['user_id'], - 'email' => $user['user_email'], - 'first_name' => $user['user_first'], - 'last_name' => $user['user_last'], - 'discount' => $valid_data['discount'], - 'address' => ! empty( $user['address'] ) ? $user['address'] : array(), - ); - - // Update a customer record if they have added/updated information. - $customer = new EDD_Customer( $user_info['email'] ); - - $name = $user_info['first_name'] . ' ' . $user_info['last_name']; - - if ( empty( $customer->name ) || $name != $customer->name ) { - $update_data = array( - 'name' => $name - ); - - // Update the customer's name and update the user record too. - $customer->update( $update_data ); - - wp_update_user( array( - 'ID' => get_current_user_id(), - 'first_name' => $user_info['first_name'], - 'last_name' => $user_info['last_name'] - ) ); - } - - // Update the customer's address if different to what's in the database - $address = wp_parse_args( $user_info['address'], array( - 'line1' => '', - 'line2' => '', - 'city' => '', - 'state' => '', - 'country' => '', - 'zip' => '', - ) ); - - $address = array( - 'address' => $address['line1'], - 'address2' => $address['line2'], - 'city' => $address['city'], - 'region' => $address['state'], - 'country' => $address['country'], - 'postal_code' => $address['zip'], - ); - - if ( ! empty( $user['user_id'] ) && $user['user_id'] > 0 && ! empty( $address ) ) { - $customer = edd_get_customer_by( 'user_id', $user['user_id'] ); - if ( $customer ) { - edd_maybe_add_customer_address( $customer->id, $user['address'] ); - } - } - - $auth_key = defined( 'AUTH_KEY' ) ? AUTH_KEY : ''; - - $card_country = isset( $valid_data['cc_info']['card_country'] ) ? $valid_data['cc_info']['card_country'] : false; - $card_state = isset( $valid_data['cc_info']['card_state'] ) ? $valid_data['cc_info']['card_state'] : false; - $card_zip = isset( $valid_data['cc_info']['card_zip'] ) ? $valid_data['cc_info']['card_zip'] : false; - - // Set up the unique purchase key. If we are resuming a payment, we'll overwrite this with the existing key. - $purchase_key = strtolower( md5( $user['user_email'] . date( 'Y-m-d H:i:s' ) . $auth_key . uniqid( 'edd', true ) ) ); - $existing_payment = EDD()->session->get( 'edd_resume_payment' ); - - if ( ! empty( $existing_payment ) ) { - $payment = new EDD_Payment( $existing_payment ); - - if( $payment->is_recoverable() && ! empty( $payment->key ) ) { - $purchase_key = $payment->key; - } - } - - // Setup purchase information. - $purchase_data = array( - 'downloads' => edd_get_cart_contents(), - 'fees' => edd_get_cart_fees(), // Any arbitrary fees that have been added to the cart - 'subtotal' => edd_get_cart_subtotal(), // Amount before taxes and discounts - 'discount' => edd_get_cart_discounted_amount(), // Discounted amount - 'tax' => edd_get_cart_tax(), // Taxed amount - 'tax_rate' => edd_use_taxes() ? edd_get_cart_tax_rate( $card_country, $card_state, $card_zip ) : 0, // Tax rate - 'price' => edd_get_cart_total(), // Amount after taxes - 'purchase_key' => $purchase_key, - 'user_email' => $user['user_email'], - 'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ), - 'user_info' => stripslashes_deep( $user_info ), - 'post_data' => $_POST, - 'cart_details' => edd_get_cart_content_details(), - 'gateway' => $valid_data['gateway'], - 'card_info' => $valid_data['cc_info'] - ); - - // Add the user data for hooks - $valid_data['user'] = $user; - - // Allow themes and plugins to hook before the gateway - do_action( 'edd_checkout_before_gateway', $_POST, $user_info, $valid_data ); - - // Store payment method data. - $purchase_data['gateway_nonce'] = wp_create_nonce( 'edd-gateway' ); - - // Allow the purchase data to be modified before it is sent to the gateway - $purchase_data = apply_filters( - 'edd_purchase_data_before_gateway', - $purchase_data, - $valid_data - ); - - // Setup the data we're storing in the purchase session - $session_data = $purchase_data; - - // Used for showing download links to non logged-in users after purchase, and for other plugins needing purchase data. - edd_set_purchase_session( $session_data ); - - /** - * Allows further processing... - */ - do_action( 'edd_gateway_' . $purchase_data['gateway'], $purchase_data ); - } catch( \Exception $e ) { - return wp_send_json_error( array( - 'message' => $e->getMessage(), - ) ); - } -} -add_action( 'wp_ajax_edds_process_purchase_form', '_edds_process_purchase_form' ); -add_action( 'wp_ajax_nopriv_edds_process_purchase_form', '_edds_process_purchase_form' ); - - -/** - * WordPress core function polyfill for WordPress 5.4. - * - * @since 2.9.0 - */ -if ( ! function_exists( 'wp_get_environment_type' ) ) { - /** - * Retrieves the current environment type. - * - * The type can be set via the `WP_ENVIRONMENT_TYPE` global system variable, - * or a constant of the same name. - * - * Possible values are 'local', 'development', 'staging', and 'production'. - * If not set, the type defaults to 'production'. - * - * @return string The current environment type. - */ - function wp_get_environment_type() { - static $current_env = ''; - - if ( ! defined( 'WP_RUN_CORE_TESTS' ) && $current_env ) { - return $current_env; - } - - $wp_environments = array( - 'local', - 'development', - 'staging', - 'production', - ); - - // Add a note about the deprecated WP_ENVIRONMENT_TYPES constant. - if ( defined( 'WP_ENVIRONMENT_TYPES' ) && function_exists( '_deprecated_argument' ) ) { - if ( function_exists( '__' ) ) { - /* translators: %s: WP_ENVIRONMENT_TYPES */ - $message = sprintf( __( 'The %s constant is no longer supported.' ), 'WP_ENVIRONMENT_TYPES' ); - } else { - $message = sprintf( 'The %s constant is no longer supported.', 'WP_ENVIRONMENT_TYPES' ); - } - - _deprecated_argument( - 'define()', - '5.5.1', - $message - ); - } - - // Check if the environment variable has been set, if `getenv` is available on the system. - if ( function_exists( 'getenv' ) ) { - $has_env = getenv( 'WP_ENVIRONMENT_TYPE' ); - if ( false !== $has_env ) { - $current_env = $has_env; - } - } - - // Fetch the environment from a constant, this overrides the global system variable. - if ( defined( 'WP_ENVIRONMENT_TYPE' ) && WP_ENVIRONMENT_TYPE ) { - $current_env = WP_ENVIRONMENT_TYPE; - } - - // Make sure the environment is an allowed one, and not accidentally set to an invalid value. - if ( ! in_array( $current_env, $wp_environments, true ) ) { - $current_env = 'production'; - } - - return $current_env; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/deprecated.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/deprecated.php deleted file mode 100644 index 82c34b99..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/deprecated.php +++ /dev/null @@ -1,180 +0,0 @@ -database_upgrades(); -} - -/** - * Internationalization - * - * @since 1.6.6 - * @return void - */ -function edds_textdomain() { - _edd_deprecated_function( - __FUNCTION__, - '2.8.1', - null, - debug_backtrace() - ); - - edd_stripe()->load_textdomain(); -} - -/** - * Register our payment gateway - * - * @since 1.0 - * @return array - */ -function edds_register_gateway( $gateways ) { - _edd_deprecated_function( - __FUNCTION__, - '2.8.1', - null, - debug_backtrace() - ); - - return edd_stripe()->register_gateway( $gateways ); -} - -/** - * Process refund in Stripe, in EDD 2.x - * For EDD 3.0, see `edd_stripe_maybe_refund_charge()` - * @see edd_stripe_maybe_refund_charge() - * - * @access public - * @since 1.8 - * @deprecated 2.9.0 - * @return void - */ -function edd_stripe_process_refund( $payment_id, $new_status, $old_status ) { - _edd_deprecated_function( - __FUNCTION__, - '2.9.0', - 'edd_stripe_maybe_refund_charge', - debug_backtrace() - ); -} - -/** - * Load our admin javascript - * - * @access public - * @since 1.8 - * @deprecated 2.9.0 - Deprecated as 2.9.0 requires EDD 3.1+ - * @return void - */ -function edd_stripe_admin_js( $payment_id = 0 ) { - /** - * Since Stripe 2.9.0 requires EDD 3.1, we no longer need to load this. - */ - _edd_deprecated_function( - __FUNCTION__, - '2.9.0', - null, - debug_backtrace() - ); -} - -/** - * Display the payment status filters - * - * @since 1.6 - * @deprecated 2.9.0 - * @param array $views The array of views for the payments/orders table. - * @return array - */ -function edds_payment_status_filters( $views ) { - _edd_deprecated_function( - __FUNCTION__, - '2.9.0', - null, - debug_backtrace() - ); -} - - -/** - * Renamed Apple Pay functions after we removed "prb" from them. - * - * Most of these were used internally only, and were hooked into display notices. - * No real documetnation is needed here. - */ -function edds_prb_apple_pay_admin_notices_register() { - _edd_deprecated_function( __FUNCTION__, '2.9.1', 'edds_apple_pay_admin_notices_register' ); - return edds_apple_pay_admin_notices_register(); -} - -function edds_prb_apple_pay_get_fileinfo() { - _edd_deprecated_function( __FUNCTION__, '2.9.1', 'edds_apple_pay_get_fileinfo' ); - return edds_apple_pay_get_fileinfo(); -} - -function edds_prb_apple_pay_is_valid() { - _edd_deprecated_function( __FUNCTION__, '2.9.1', 'edds_apple_pay_is_valid' ); - return edds_apple_pay_is_valid(); -} - -function edds_prb_apple_pay_has_domain_verification_file() { - _edd_deprecated_function( __FUNCTION__, '2.9.1', 'edds_apple_pay_has_domain_verification_file' ); - return edds_apple_pay_has_domain_verification_file(); -} - -function edds_prb_apple_pay_has_domain_verification() { - _edd_deprecated_function( __FUNCTION__, '2.9.1', 'edds_apple_pay_has_domain_verification' ); - return edds_apple_pay_has_domain_verification(); -} - -function edds_prb_apple_pay_create_directory_and_move_file() { - _edd_deprecated_function( __FUNCTION__, '2.9.1', 'edds_apple_pay_create_directory_and_move_file' ); - edds_apple_pay_create_directory_and_move_file(); -} - -function edds_prb_apple_pay_check_domain() { - _edd_deprecated_function( __FUNCTION__, '2.9.1', 'edds_apple_pay_check_domain' ); - edds_apple_pay_check_domain(); -} - -function edds_prb_apple_pay_verify_domain() { - _edd_deprecated_function( __FUNCTION__, '2.9.1', 'edds_apple_pay_verify_domain' ); - edds_apple_pay_verify_domain(); -} - -function edds_prb_apple_pay_admin_notices_print() { - _edd_deprecated_function( __FUNCTION__, '2.9.1', 'edds_apple_pay_admin_notices_print' ); - edds_apple_pay_admin_notices_print(); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/elements/card-elements.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/elements/card-elements.php deleted file mode 100644 index 273e7308..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/elements/card-elements.php +++ /dev/null @@ -1,102 +0,0 @@ - true, - 'i18n' => array( - 'errorMessages' => edds_get_localized_error_messages(), - ), - ); - $elements_styles = edds_get_stripe_elements_styles(); - - if ( ! empty( $elements_styles ) ) { - $elements_options['style'] = $elements_styles; - } - - /** - * Filters the options used to create the Stripe Elements card field. - * - * @since 2.7.0 - * - * @link https://stripe.com/docs/stripe-js/reference#element-options - * - * @param array $elements_options Options used to create Stripe Elements card field. - */ - $elements_options = apply_filters( 'edds_stripe_elements_options', $elements_options ); - - // Elements doesn't like an empty array (which won't be converted to an object in JS). - if ( empty( $elements_options ) ) { - return null; - } - - return $elements_options; -} - -/** - * Add the Card Elements values to the Stripe Localized variables. - * - * @since 2.9.0 - * - * @param array $stripe_vars The array of values to localize for Stripe. - * - * @return array Includes any Card Elements values to the array of localized variables. - */ -function edds_card_element_js_vars( $stripe_vars ) { - $stripe_vars['elementsOptions'] = edds_get_stripe_elements_options(); - $stripe_vars['elementsSplitFields'] = '1' === edd_get_option( 'stripe_split_payment_fields', false ) ? 'true' : 'false'; - $stripe_vars['checkoutHasPaymentRequest'] = edds_prb_is_enabled( 'checkout' ) ? 'true' : 'false'; - - return $stripe_vars; -} -add_filter( 'edd_stripe_js_vars', 'edds_card_element_js_vars', 10, 1 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/elements/functions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/elements/functions.php deleted file mode 100644 index 2a7ee69b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/elements/functions.php +++ /dev/null @@ -1,75 +0,0 @@ -connect()->get_connect_id() ); -} - -/** - * Get the current elements mode. - * - * If the user is gated into the legacy mode, set the default to card-elements. - * - * @since 2.9.0 - * @since 2.9.5.1 We're now listening for an elements_mode flag in POST requests. - * - * @return string The elements mode string. - */ -function edds_get_elements_mode() { - $default = _edds_legacy_elements_enabled() ? 'card-elements' : 'payment-elements'; - - /** - * Because we use the deferred payment intents beta, only connected accounts can use Payment Elements - * for now, so we'll force them to be in `card-elements`. - */ - if ( edds_stripe_connect_can_manage_keys() ) { - return 'card-elements'; - } - - /** - * Recurring Subscription payment method updates need to still run card elements for now. - */ - if ( - function_exists( 'edd_recurring' ) && - ( isset( $_GET['action'] ) && 'update' === $_GET['action'] ) && - ( isset( $_GET['subscription_id'] ) && is_numeric( $_GET['subscription_id'] ) ) - ) { - add_filter( 'edd_get_option_stripe_split_payment_fields', '__return_false' ); - return 'card-elements'; - } - - /** - * Card elements does a lot with AJAX requests, which will lose the context of being on the Subscription update form, so - * we are sending in a flag for using card elements with the elements_mode equal to 'card-elements' in those POST requests. - * - * @since 2.9.5.1 - */ - if ( isset( $_POST['elements_mode'] ) && 'card-elements' === $_POST['elements_mode'] ) { - return 'card-elements'; - } - - return edd_get_option( 'stripe_elements_mode', $default ); -} - -/** - * INTERNAL ONLY: Determines if the user is gated into using the legacy card-elements. - * - * This is a transitionary function, intentded to allow us to later remove it. Do not - * use this function in any extending of EDD or Stripe. - * - * @since 2.9.0 - * - * @return bool If the user is gated into using the legacy card-elements. - */ -function _edds_legacy_elements_enabled() { - return get_option( '_edds_legacy_elements_enabled', false ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/elements/payment-elements.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/elements/payment-elements.php deleted file mode 100644 index 6429036d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/elements/payment-elements.php +++ /dev/null @@ -1,359 +0,0 @@ - 'tabs', - 'defaultCollapsed' => false, - ); - - /** - * Filters the layout variables passed to the Stripe Payment Elements. - * - * @since 2.9.0 - * - * @link https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-layout - * - * @see assets/js/src/frontend/payment-elements/index.js::generateElementStyles - * - * @param array $payment_elements_layout Layout values used to create Stripe Elements object. - */ - return apply_filters( 'edds_stripe_payment_elements_layout', $payment_elements_layout ); -} - -/** - * Retreives and allows filtering the wallets sent to the Payment Elements. - * - * @since 2.9.0 - */ -function edds_get_stripe_payment_elements_wallets() { - - $default_wallet_behavior = 'auto'; - - /** - * Allows the ability to completely disable wallets (Google Pay, Apple Pay, etc) with a single filter. - * - * @example - * add_filter( 'edds_stripe_payment_elements_disable_wallets', '__return_true' ); - * - * @since 2.9.0 - * - * @link https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-wallets - * - * @see assets/js/src/frontend/payment-elements/index.js::generateElementStyles - * - * @param bool If wallets should be disabled. - */ - if ( apply_filters( 'edds_stripe_payment_elements_disable_wallets', false ) ) { - $default_wallet_behavior = 'never'; - } - - $enabled_wallets = array( - 'applePay' => $default_wallet_behavior, - 'googlePay' => $default_wallet_behavior, - ); - - /** - * Filters the wallets that the Payment Element will load. - * - * If you want to disable these, set their values to `never` - * - * @example - * array( - * 'applePay' => 'never', - * 'googlePay' => 'auto', - * ) - * - * This uses an array_merge to ensure that if someone supplies a partial array we don't lose the default behavior. - * - * @since 2.9.0 - * - * @link https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-wallets - * - * @see assets/js/src/frontend/payment-elements/index.js::generateElementStyles - * - * @param array $enabled_wallets Allowed wallets payment methods ot use on the Payment Element. - */ - $enabld_wallets = array_merge( $enabled_wallets, apply_filters( 'edds_stripe_payment_elements_wallets', $enabled_wallets ) ); - - return $enabld_wallets; -} - -/** - * Retreives and allows filtering the label style sent to the Payment Elements. - * - * @since 2.9.0 - */ -function edds_get_stripe_payment_elements_label_style() { - $label_style = 'above'; - - /** - * Filters the label appearance option. - * - * This can be set to either 'above' or 'floating' - * - * @since 2.9.0 - * - * @link https://stripe.com/docs/elements/appearance-api?platform=web#others - * - * @see assets/js/src/frontend/payment-elements/index.js::generateElementStyles - * - * @param array $label_style The style to use for the Payment Elements labels. - */ - return apply_filters( 'edds_stripe_payment_elements_label_style', $label_style ); - -} - -/** - * Allows passing custom fonts into the Stripe Payment Elements. - * - * @since 2.9.0 - */ -function edds_get_stripe_payment_elements_fonts() { - $fonts = array(); - - /** - * Allows passing custom font objects into the Stripe Elements. - * - * This either needs to be a CSS font soruce object, or a custom font source object. - * You can see the format and requiremnts for these in the links below. We default to none. - * - * @since 2.9.0 - * - * @link https://stripe.com/docs/js/appendix/css_font_source_object - * @link https://stripe.com/docs/js/appendix/custom_font_source_object - * - * @see assets/js/src/frontend/payment-elements/index.js::generateElementStyles - * - * @param array $fonts The style to use for the Payment Elements labels. - */ - return apply_filters( 'edds_stripe_payment_elements_fonts', $fonts ); - -} - -/** - * Allows passing custom fields into the Stripe Elements. - * - * @since 2.9.2.2 - */ -function edds_get_stripe_payment_elements_fields() { - $default_fields = array( - 'billingDetails' => array( - 'name' => 'auto', - 'email' => 'never', // It is not advised to change this to auto, as it will create duplicate email fields on checkout. - 'phone' => 'never', - 'address' => 'never', - ), - ); - - // By default, if the store has the address fields required, don't include them in the Payment Element. - if ( 'none' !== edd_get_option( 'stripe_billing_fields', 'none' ) ) { - $default_fields['billingDetails']['address'] = 'never'; - } - - /** - * Allows passing custom fields into the Stripe Elements. - * - * This needs to be an array. The default fields hold our values for the billingDetails fields. Fields can have a value of - * either 'auto' or 'never'. If you want to disable a field, set it to 'never'. When set to 'auto', Stripe will attempt to - * determine if the field is necessary based on a combination of currency, country, and account. - * - * @since 2.9.2.2 - * - * @link https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields - * - * @see assets/js/src/frontend/payment-elements/index.js::createAndMountElement - * - * @param array $default_fields The default fields and their values. - */ - return apply_filters( 'edds_stripe_payment_elements_fields', $default_fields ); -} - -/** - * Returns an array of terms for the payment elements. - * - * @since 2.9.4 - * - * @return array The terms array by payment method. - */ -function edds_get_stripe_payment_elements_terms() { - $terms = array( 'card' => 'auto' ); - - /** - * Allows filtering the payment elements terms. - * - * @see https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-terms - * - * @since 2.9.4 - * @param array The terms array by payment method. - */ - - return apply_filters( 'edds_stripe_payment_elements_terms', $terms ); -} - -/** - * Gathers all the possible customizations for the Stripe Payment Elements. - * - * Pulls in the filtered customizations for the theme, variables, rules, and layout items - * for the Payment Elements instantiation. This allows developers to make customizations. - * - * EDD does attempt to match the input styles on the checkout already, in the Javascript. - * - * @since 2.9.0 - * - * @returns array $customizations The array of customizations. - */ -function edds_gather_payment_element_customizations() { - $customizations = array( - 'theme' => edds_get_stripe_payment_elements_theme(), - 'variables' => edds_get_stripe_payment_elements_variables(), - 'rules' => edds_get_stripe_payment_elements_rules(), - 'layout' => edds_get_stripe_payment_elements_layout(), - 'wallets' => edds_get_stripe_payment_elements_wallets(), - 'labels' => edds_get_stripe_payment_elements_label_style(), - 'fonts' => edds_get_stripe_payment_elements_fonts(), - 'paymentMethodTypes' => edds_payment_element_payment_method_types(), - 'fields' => edds_get_stripe_payment_elements_fields(), - 'terms' => edds_get_stripe_payment_elements_terms(), - 'i18n' => array( - 'errorMessages' => edds_get_localized_error_messages(), - ), - ); - - if ( function_exists( 'edd_recurring' ) ) { - $customizations['cartHasSubscription'] = edd_recurring()->cart_contains_recurring() ? 'true' : 'false'; - } - - return $customizations; -} - -/** - * Add the Payment Elements values to the Stripe Localized variables. - * - * @since 2.9.0 - * - * @param array $stripe_vars The array of values to localize for Stripe. - * - * @return array Includes any Payment Elements values to the array of localized variables. - */ -function edds_payment_element_js_vars( $stripe_vars ) { - $stripe_vars['elementsCustomizations'] = edds_gather_payment_element_customizations(); - - return $stripe_vars; -} -add_filter( 'edd_stripe_js_vars', 'edds_payment_element_js_vars', 10, 1 ); - -/** - * Returns an array of payment method types. - * - * By default this is empty to allow the automatic payment methods to take over, but in the event someone - * wants to alter this, they can at their own risk as EDD controls what payment methods are availbale - * at the platform level. - * - * As of 2.9.2.1 - EDD only supports 'card' and 'link' as options. - * - * @since 2.9.2.1 - * - * @return array The allowed payment_method_types - */ -function edds_payment_element_payment_method_types() { - /** - * Allows passing payment_method_types to the elements and intent. - * - * This is by default empty, but you can alter this on an account level if needed. - * - * @since 2.9.2.1 - * - * @example - * add_filter( 'edds_stripe_payment_elements_payment_method_types', function( $payment_method_types ) { - * return array( - * 'card', - * 'link', - * ); - * } ); - * - * @param array The allowed payment elements payment method types. - */ - return apply_filters( 'edds_stripe_payment_elements_payment_method_types', array() ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/emails.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/emails.php deleted file mode 100644 index 5abeb2f3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/emails.php +++ /dev/null @@ -1,51 +0,0 @@ -get_meta( '_edd_payment_meta', true ); - - $from_name = edd_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) ); - $from_name = apply_filters( 'edd_purchase_from_name', $from_name, $payment_id, $payment_data ); - $from_email = edd_get_option( 'from_email', get_bloginfo( 'admin_email' ) ); - $from_email = apply_filters( 'edd_purchase_from_address', $from_email, $payment_id, $payment_data ); - - if ( empty( $to_email ) ) { - $to_email = $payment->email; - } - - $subject = esc_html__( 'Your Preapproved Payment Requires Action', 'easy-digital-downloads' ); - $heading = edd_do_email_tags( esc_html__( 'Payment Requires Action', 'easy-digital-downloads' ), $payment_id ); - - $message = esc_html__( 'Dear {name},', 'easy-digital-downloads' ) . "\n\n"; - $message .= esc_html__( 'Your preapproved payment requires further action before your purchase can be completed. Please click the link below to take finalize your purchase', 'easy-digital-downloads' ) . "\n\n"; - $message .= esc_url( add_query_arg( 'payment_key', $payment->key, edd_get_success_page_uri() ) ); - $message = edd_do_email_tags( $message, $payment_id ); - - /** This filter is documented in easy-digital-downloads/includes/emails/template.php */ - $message = apply_filters( 'edd_email_template_wpautop', true ) ? wpautop( $message ) : $message; - - $emails = EDD()->emails; - - $emails->__set( 'from_name', $from_name ); - $emails->__set( 'from_email', $from_email ); - $emails->__set( 'heading', $heading ); - - $headers = $emails->get_headers(); - $emails->__set( 'headers', $headers ); - - $emails->send( $to_email, $subject, $message ); -} -add_action( 'edds_preapproved_payment_needs_action', 'edds_preapproved_payment_needs_action_notification' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/functions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/functions.php deleted file mode 100644 index 0d263d37..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/functions.php +++ /dev/null @@ -1,781 +0,0 @@ - ( - version_compare( PHP_VERSION, '7.1', '>' ) - ), - 'edd' => ( - defined( 'EDD_VERSION' ) - ? version_compare( EDD_VERSION, '3.1', '>=' ) - : true - ), - 'recurring' => ( - defined( 'EDD_RECURRING_VERSION' ) - ? version_compare( EDD_RECURRING_VERSION, '2.9.99', '>' ) - : true - ), - 'wp' => ( - version_compare( get_bloginfo( 'version' ), '5.4', '>=' ) - ), - ); - - if ( false === $requirement ) { - return false === in_array( false, $requirements, true ); - } else { - return isset( $requirements[ $requirement ] ) - ? $requirements[ $requirement ] - : true; - } -} - -/** - * Allows preconfigured Stripe API requests to be made. - * - * @since 2.7.0 - * - * @throws \EDD_Stripe_Utils_Exceptions_Stripe_Object_Not_Found When attempting to call an object or method that is not available. - * @throws \Stripe\Exception - * - * @param string $object Name of the Stripe object to request. - * @param string $method Name of the API operation to perform during the request. - * @param mixed ...$args Additional arguments to pass to the request. - * @return \Stripe\StripeObject - */ -function edds_api_request( $object, $method, $args = null ) { - $api = new EDD_Stripe_API(); - - return call_user_func_array( array( $api, 'request' ), func_get_args() ); -} - -/** - * Converts a truthy value (e.g. '1', 'yes') to a bool. - * - * @since 2.8.0 - * - * @param mixed $truthy_value Truthy value. - * @return bool - */ -function edds_truthy_to_bool( $truthy_value ) { - $truthy = array( - 'yes', - 1, - '1', - 'true', - ); - - return is_bool( $truthy_value ) - ? $truthy_value - : in_array( strtolower( $truthy_value ), $truthy, true ); -} - -/** - * Retrieve the exsting cards setting. - * @return bool - */ -function edd_stripe_existing_cards_enabled() { - $use_existing_cards = edd_get_option( 'stripe_use_existing_cards', false ); - - // Payment Elements doesn't support existing cards. - if ( 'payment-elements' === edds_get_elements_mode() ) { - $use_existing_cards = false; - } - - return ! empty( $use_existing_cards ); -} - -/** - * Given a user ID, retrieve existing cards within stripe. - * - * @since 2.6 - * @param int $user_id - * - * @return array - */ -function edd_stripe_get_existing_cards( $user_id = 0 ) { - if ( empty( $user_id ) ) { - return array(); - } - - $enabled = edd_stripe_existing_cards_enabled(); - - if ( ! $enabled ) { - return array(); - } - - static $existing_cards; - - if ( ! is_null( $existing_cards ) && array_key_exists( $user_id, $existing_cards ) ) { - return $existing_cards[ $user_id ]; - } - - // Check if the user has existing cards - $customer_cards = array(); - $stripe_customer_id = edds_get_stripe_customer_id( $user_id ); - - if ( ! empty( $stripe_customer_id ) ) { - try { - $stripe_customer = edds_api_request( 'Customer', 'retrieve', $stripe_customer_id ); - - if ( isset( $stripe_customer->deleted ) && $stripe_customer->deleted ) { - return $customer_cards; - } - - $payment_methods = edds_api_request( 'PaymentMethod', 'all', array( - 'type' => 'card', - 'customer' => $stripe_customer->id, - 'limit' => 100, - ) ); - - $cards = edds_api_request( 'Customer', 'allSources', $stripe_customer->id, array( - 'limit' => 100, - ) ); - - $sources = array_merge( $payment_methods->data, $cards->data ); - - foreach ( $sources as $source ) { - if ( ! in_array( $source->object, array( 'payment_method', 'card' ), true ) ) { - continue; - } - - $source_data = new stdClass(); - $source_data->id = $source->id; - - switch( $source->object ) { - case 'payment_method': - $source_data->brand = ucwords( $source->card->brand ); - $source_data->last4 = $source->card->last4; - $source_data->exp_month = $source->card->exp_month; - $source_data->exp_year = $source->card->exp_year; - $source_data->fingerprint = $source->card->fingerprint; - $source_data->address_line1 = $source->billing_details->address->line1; - $source_data->address_line2 = $source->billing_details->address->line2; - $source_data->address_city = $source->billing_details->address->city; - $source_data->address_zip = $source->billing_details->address->postal_code; - $source_data->address_state = $source->billing_details->address->state; - $source_data->address_country = $source->billing_details->address->country; - - $customer_cards[ $source->id ]['default'] = $source->id === $stripe_customer->invoice_settings->default_payment_method; - break; - case 'card': - $source_data->brand = $source->brand; - $source_data->last4 = $source->last4; - $source_data->exp_month = $source->exp_month; - $source_data->exp_year = $source->exp_year; - $source_data->fingerprint = $source->fingerprint; - $source_data->address_line1 = $source->address_line1; - $source_data->address_line2 = $source->address_line2; - $source_data->address_city = $source->address_city; - $source_data->address_zip = $source->address_zip; - $source_data->address_state = $source->address_state; - $source_data->address_country = $source->address_country; - break; - } - - $customer_cards[ $source->id ]['source'] = $source_data; - } - } catch ( Exception $e ) { - return $customer_cards; - } - } - - // Show only the latest version of card for duplicates. - $fingerprints = array(); - foreach ( $customer_cards as $key => $customer_card ) { - $fingerprint = $customer_card['source']->fingerprint; - if ( ! in_array( $fingerprint, $fingerprints ) ) { - $fingerprints[] = $fingerprint; - } else { - unset( $customer_cards[ $key ] ); - } - } - - // Put default card first. - usort( - $customer_cards, - function( $a, $b ) { - return $a['default'] ? 1 : -1; - } - ); - - $existing_cards[ $user_id ] = $customer_cards; - - return $existing_cards[ $user_id ]; -} - -/** - * Look up the stripe customer id in user meta, and look to recurring if not found yet - * - * @since 2.4.4 - * @since 2.6 Added lazy load for moving to customer meta and ability to look up by customer ID. - * @param int $id_or_email The user ID, customer ID or email to look up. - * @param bool $by_user_id If the lookup is by user ID or not. - * - * @return string Stripe customer ID - */ -function edds_get_stripe_customer_id( $id_or_email, $by_user_id = true ) { - $stripe_customer_id = ''; - $meta_key = edd_stripe_get_customer_key(); - - if ( is_email( $id_or_email ) ) { - $by_user_id = false; - } - - $customer = new EDD_Customer( $id_or_email, $by_user_id ); - if ( $customer->id > 0 ) { - $stripe_customer_id = $customer->get_meta( $meta_key ); - } - - if ( empty( $stripe_customer_id ) ) { - $user_id = 0; - if ( ! empty( $customer->user_id ) ) { - $user_id = $customer->user_id; - } else if ( $by_user_id && is_numeric( $id_or_email ) ) { - $user_id = $id_or_email; - } else if ( is_email( $id_or_email ) ) { - $user = get_user_by( 'email', $id_or_email ); - if ( $user ) { - $user_id = $user->ID; - } - } - - if ( ! isset( $user ) ) { - $user = get_user_by( 'id', $user_id ); - } - - if ( $user ) { - - $customer = new EDD_Customer( $user->user_email ); - - if ( ! empty( $user_id ) ) { - $stripe_customer_id = get_user_meta( $user_id, $meta_key, true ); - - // Lazy load migrating data over to the customer meta from Stripe issue #113 - $customer->update_meta( $meta_key, $stripe_customer_id ); - } - - } - - } - - if ( empty( $stripe_customer_id ) && class_exists( 'EDD_Recurring_Subscriber' ) ) { - - $subscriber = new EDD_Recurring_Subscriber( $id_or_email, $by_user_id ); - - if ( $subscriber->id > 0 ) { - - $verified = false; - - if ( ( $by_user_id && $id_or_email == $subscriber->user_id ) ) { - // If the user ID given, matches that of the subscriber - $verified = true; - } else { - // If the email used is the same as the primary email - if ( $subscriber->email == $id_or_email ) { - $verified = true; - } - - // If the email is in the EDD 2.6 Additional Emails - if ( property_exists( $subscriber, 'emails' ) && in_array( $id_or_email, $subscriber->emails ) ) { - $verified = true; - } - } - - if ( $verified ) { - $stripe_customer_id = $subscriber->get_recurring_customer_id( 'stripe' ); - } - - } - - if ( ! empty( $stripe_customer_id ) ) { - $customer->update_meta( $meta_key, $stripe_customer_id ); - } - - } - - return $stripe_customer_id; -} - -/** - * Get the meta key for storing Stripe customer IDs in - * - * @access public - * @since 1.6.7 - * @return string - */ -function edd_stripe_get_customer_key() { - - $key = '_edd_stripe_customer_id'; - if( edd_is_test_mode() ) { - $key .= '_test'; - } - return $key; -} - -/** - * Determines if the provided currency is a zero-decimal currency - * - * @access public - * @since 1.8.4 - * @param string $currency Three-letter ISO currency code or an empty string. If empty, the shop's currency is used. - * @since 2.8.8 $currency parameter added - * @return bool - */ -function edds_is_zero_decimal_currency( $currency = '' ) { - if ( empty( $currency ) ) { - $currency = edd_get_currency(); - } - - $currency = strtolower( $currency ); - - $currencies = array( - 'bif', - 'clp', - 'djf', - 'gnf', - 'jpy', - 'kmf', - 'krw', - 'mga', - 'pyg', - 'rwf', - 'ugx', - 'vnd', - 'vuv', - 'xaf', - 'xof', - 'xpf', - ); - - return in_array( $currency, $currencies, true ); -} - -/** - * Retrieves a sanitized statement descriptor. - * - * @since 2.6.19 - * - * @return string $statement_descriptor Sanitized statement descriptor. - */ -function edds_get_statement_descriptor() { - $statement_descriptor = edd_get_option( 'stripe_statement_descriptor', '' ); - $statement_descriptor = edds_sanitize_statement_descriptor( $statement_descriptor ); - - return $statement_descriptor; -} - -/** - * Retrieves a list of unsupported characters for Stripe statement descriptors. - * - * @since 2.6.19 - * - * @return array $unsupported_characters List of unsupported characters. - */ -function edds_get_statement_descriptor_unsupported_characters() { - $unsupported_characters = array( - '<', - '>', - '"', - '\'', - '\\', - '*', - ); - - /** - * Filters the list of unsupported characters for Stripe statement descriptors. - * - * @since 2.6.19 - * - * @param array $unsupported_characters List of unsupported characters. - */ - $unsupported_characters = apply_filters( 'edds_get_statement_descriptor_unsupported_characters', $unsupported_characters ); - - return $unsupported_characters; -} - -/** - * Sanitizes a string to be used for a statement descriptor. - * - * @since 2.6.19 - * - * @link https://stripe.com/docs/connect/statement-descriptors#requirements - * - * @param string $statement_descriptor Statement descriptor to sanitize. - * @return string $statement_descriptor Sanitized statement descriptor. - */ -function edds_sanitize_statement_descriptor( $statement_descriptor ) { - $unsupported_characters = edds_get_statement_descriptor_unsupported_characters(); - - $statement_descriptor = trim( str_replace( $unsupported_characters, '', $statement_descriptor ) ); - $statement_descriptor = substr( $statement_descriptor, 0, 22 ); - - return $statement_descriptor; -} - -/** - * Retrieves a given registry instance by name. - * - * @since 2.6.19 - * - * @param string $name Registry name. - * @return null|EDD_Stripe_Registry Null if the registry doesn't exist, otherwise the object instance. - */ -function edds_get_registry( $name ) { - switch( $name ) { - case 'admin-notices': - $registry = EDD_Stripe_Admin_Notices_Registry::instance(); - break; - default: - $registry = null; - break; - } - - return $registry; -} - -/** - * Attempts to verify a nonce from various payment forms when the origin - * of the action isn't explicitly known. - * - * This could be coming from the Checkout, Payment Authorization, - * or Update Payment Method (Recurring) form. - * - * @since 2.8.0 - * - * @return bool - */ -function edds_verify_payment_form_nonce() { - if ( false !== edds_verify() ) { - return true; - } - - // Update Payment Method. - $nonce = isset( $_POST['edd_recurring_update_nonce'] ) - ? sanitize_text_field( $_POST['edd_recurring_update_nonce'] ) - : ''; - - if ( ! empty( $nonce ) ) { - return wp_verify_nonce( $nonce, 'update-payment' ); - } - - return false; -} - -/** - * Attempts to verify a given token or nonce. - * - * @since 2.8.12 - * @param string $nonce The nonce to check for (default is checkout). - * @param string $action The nonce action (default is checkout). - * @return bool - */ -function edds_verify( $nonce = 'edd-process-checkout-nonce', $action = 'edd-process-checkout' ) { - // Tokenizer. - $token = isset( $_POST['token'] ) ? sanitize_text_field( $_POST['token'] ) : ''; - $timestamp = isset( $_POST['timestamp'] ) ? sanitize_text_field( $_POST['timestamp'] ) : ''; - if ( ! empty( $timestamp ) && ! empty( $token ) ) { - edd_debug_log( $action . ' verified by tokenizer: ' . $token ); - - return \EDD\Utils\Tokenizer::is_token_valid( $token, $timestamp ); - } - - edd_debug_log( 'Attempted to verify ' . $action . ' session by tokenizer but the data was missing.' ); - - // Checkout. - $nonce = isset( $_POST[ $nonce ] ) - ? sanitize_text_field( $_POST[ $nonce ] ) - : ''; - - if ( empty( $nonce ) ) { - return false; - } - - return wp_verify_nonce( $nonce, $action ); -} - -/** - * Routes user to correct support documentation, depending on whether they are using Standard or Pro version of Stripe - * - * @since 2.8.1 - * @param string $type The type of Stripe documentation. - * @return string - */ -function edds_documentation_route( $type ) { - $base_url = 'https://easydigitaldownloads.com/docs'; - - /** - * Filter to change EDD-Stripe support url. - * - * @since 2.8.1 - * @param string $base_url The url string for EDD-Stripe standard. - */ - $base_url = apply_filters( 'edds_documentation_route_base', $base_url ); - - return trailingslashit( $base_url ) . $type; - -} - -/** - * Determines if the current Stripe account's country supports application fees. - * - * @since 2.8.7 - * - * @return bool True if the Stripe account country (or core "Base Country" setting) - * can use the `application_fee_amount` parameter in API requests. - * True if no country information can be found which will still be - * validated by Stripe when a request is made. - */ -function edds_stripe_connect_account_country_supports_application_fees() { - $edd_country = edd_get_option( 'base_country', '' ); - - $account_country = edd_get_option( - 'stripe_connect_account_country', - $edd_country - ); - - // If we have no country to compare against try to add an application fee. - // If the Stripe account is actually one of the blocked countries an API - // error will be reflected in the Checkout. - if ( empty( $account_country ) ) { - return true; - } - - $account_country = strtolower( $account_country ); - - $blocked_countries = array( - 'br', - 'in', - 'mx', - ); - - return ! in_array( $account_country, $blocked_countries, true ); -} - -/** - * Refunds a charge made via Stripe. - * - * @since 2.8.7 - * - * @param int|Order $order_id_or_object The ID or object (EDD 3.0+ only) of the order to refund. - * @param Order|null $refund_object Optional. The refund object associated with this - * charge refund. If provided, then the refund amount - * is used as the charge refund amount (for partial refunds), and - * an EDD transaction record will be inserted (EDD 3.0+ only). - * - * @throws \EDD_Stripe_Utils_Exceptions_Stripe_Object_Not_Found When attempting to call an object or method that is not available. - * @throws \Exception - */ -function edd_refund_stripe_purchase( $order_id_or_object, $refund_object = null ) { - $order_id = $order_id_or_object instanceof Order ? $order_id_or_object->id : $order_id_or_object; - - edd_debug_log( sprintf( - 'Processing Stripe refund for order #%d', - $order_id - ) ); - - if ( ! is_numeric( $order_id ) ) { - throw new \Exception( __( 'Invalid order ID.', 'easy-digital-downloads' ), 400 ); - } - - $charge_id = edd_get_payment_transaction_id( $order_id ); - - if ( empty( $charge_id ) || $charge_id == $order_id ) { - $notes = edd_get_payment_notes( $order_id ); - - foreach ( $notes as $note ) { - if ( preg_match( '/^Stripe Charge ID: ([^\s]+)/', $note->comment_content, $match ) ) { - $charge_id = $match[1]; - break; - } - } - } - - // Bail if no charge ID was found. - if ( empty( $charge_id ) ) { - edd_debug_log( sprintf( 'Exiting refund of order #%d. No Stripe charge found.', $order_id ) ); - - return; - } - - $args = array( - 'charge' => $charge_id, - ); - - if ( $refund_object instanceof Order && $order_id_or_object instanceof Order && abs( $refund_object->total ) !== abs( $order_id_or_object->total ) ) { - $args['amount'] = abs( $refund_object->total ); - if ( ! edds_is_zero_decimal_currency() ) { - $args['amount'] = round( $args['amount'] * 100, 0 ); - } - - edd_debug_log( sprintf( - 'Processing partial Stripe refund for order #%d. Refund amount: %s; Amount sent to Stripe: %s', - $order_id_or_object->id, - edd_currency_filter( $refund_object->total, $refund_object->currency ), - $args['amount'] - ) ); - } else { - edd_debug_log( sprintf( 'Processing full Stripe refund for order #%d.', $order_id ) ); - } - - /** - * Filters the refund arguments sent to Stripe. - * - * @link https://stripe.com/docs/api/refunds/create - * - * @param array $args - */ - $args = apply_filters( 'edds_create_refund_args', $args ); - - /** - * Filters the secondary refund arguments. - * - * @param array $sec_args - */ - $sec_args = apply_filters( 'edds_create_refund_secondary_args', array() ); - - $refund = edds_api_request( 'Refund', 'create', $args, $sec_args ); - - $amount_refunded = (float) $refund->amount; - if ( ! edds_is_zero_decimal_currency() ) { - $amount_refunded = round( $amount_refunded / 100, edd_currency_decimal_filter( 2, strtoupper( $refund->currency ) ) ); - } - - $order_note = sprintf( - /* translators: %1$s the amount refunded; %2$s Stripe Refund ID */ - __( '%1$s refunded in Stripe. Refund ID %2$s', 'easy-digital-downloads' ), - edd_currency_filter( $amount_refunded, strtoupper( $refund->currency ) ), - $refund->id - ); - - edd_insert_payment_note( $order_id, $order_note ); - - if ( $refund_object instanceof Order ) { - edd_add_order_transaction( array( - 'object_id' => $refund_object->id, - 'object_type' => 'order', - 'transaction_id' => sanitize_text_field( $refund->id ), - 'gateway' => 'stripe', - 'status' => 'complete', - 'total' => edd_negate_amount( $amount_refunded ) - ) ); - - edd_add_note( array( - 'object_id' => $refund_object->id, - 'object_type' => 'order', - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'content' => $order_note - ) ); - } - - /** - * Triggers after a refund has been processed. - * - * @param int $order_id ID of the order that was refunded. - */ - do_action( 'edds_payment_refunded', $order_id ); -} - -/** - * Checks if Stripe preapproval is enabled. Pro must be active. - * - * @since 2.8.9 - * @return bool - */ -function edds_is_preapprove_enabled() { - return edds_is_pro() && edd_get_option( 'stripe_preapprove_only' ); -} - -/** - * Gets the hidden input for adding tokenizer support to Stripe checkout. - * - * @since 2.8.12 - * @param string $custom_id Optional: append a custom string to the ID. - * @return string - */ -function edds_get_tokenizer_input( $custom_id = '' ) { - - $id = 'edd-process-stripe-token'; - if ( $custom_id ) { - $id .= '-' . $custom_id; - } - $timestamp = time(); - - return sprintf( - '', - esc_attr( $id ), - esc_attr( $timestamp ), - esc_attr( \EDD\Utils\Tokenizer::tokenize( $timestamp ) ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/gateway-actions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/gateway-actions.php deleted file mode 100644 index 03199e4c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/gateway-actions.php +++ /dev/null @@ -1,82 +0,0 @@ - _x( 'Preapproval Pending', 'Pending preapproved payment', 'easy-digital-downloads' ), - 'public' => true, - 'exclude_from_search' => false, - 'show_in_admin_all_list' => true, - 'show_in_admin_status_list' => true, - /* translators: %s Payment status count */ - 'label_count' => _n_noop( 'Active (%s)', 'Active (%s)', 'easy-digital-downloads' ) - ) ); - register_post_status( 'preapproval', array( - 'label' => _x( 'Preapproved', 'Preapproved payment', 'easy-digital-downloads' ), - 'public' => true, - 'exclude_from_search' => false, - 'show_in_admin_all_list' => true, - 'show_in_admin_status_list' => true, - /* translators: %s Payment status count */ - 'label_count' => _n_noop( 'Active (%s)', 'Active (%s)', 'easy-digital-downloads' ) - ) ); - register_post_status( 'cancelled', array( - 'label' => _x( 'Cancelled', 'Cancelled payment', 'easy-digital-downloads' ), - 'public' => true, - 'exclude_from_search' => false, - 'show_in_admin_all_list' => true, - 'show_in_admin_status_list' => true, - /* translators: %s Payment status count */ - 'label_count' => _n_noop( 'Active (%s)', 'Active (%s)', 'easy-digital-downloads' ) - ) ); -} -add_action( 'init', 'edds_register_post_statuses', 110 ); - -/** - * Register the statement_descriptor email tag. - * - * @since 2.6 - * @return void - */ -function edd_stripe_register_email_tags() { - $statement_descriptor = edds_get_statement_descriptor(); - if ( ! empty( $statement_descriptor ) ) { - edd_add_email_tag( - 'stripe_statement_descriptor', - __( 'Outputs a line stating what charges will appear as on customer\'s credit card statements.', 'easy-digital-downloads' ), - 'edd_stripe_statement_descriptor_template_tag', - __( 'Statement Descriptor', 'easy-digital-downloads' ) - ); - } -} -add_action( 'edd_add_email_tags', 'edd_stripe_register_email_tags' ); - -/** - * Swap the {statement_descriptor} email tag with the string from the option - * - * @since 2.6 - * @param $payment_id - * - * @return mixed - */ -function edd_stripe_statement_descriptor_template_tag( $payment_id ) { - $payment = new EDD_Payment( $payment_id ); - if ( 'stripe' !== $payment->gateway ) { - return ''; - } - - $statement_descriptor = edds_get_statement_descriptor(); - if ( empty( $statement_descriptor ) ) { - return ''; - } - - // If you want to filter this, use the %s to define where you want the actual statement descriptor to show in your message. - $email_tag_output = __( apply_filters( 'edd_stripe_statement_descriptor_email_tag', 'Charges will appear on your card statement as %s' ), 'easy-digital-downloads' ); - - return sprintf( $email_tag_output, $statement_descriptor ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/gateway-filters.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/gateway-filters.php deleted file mode 100644 index 86dd2950..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/gateway-filters.php +++ /dev/null @@ -1,91 +0,0 @@ - __( 'Payment processing cancelled; your order is not yet complete.', 'easy-digital-downloads' ), - 'invalid_number' => __( 'The card number is not a valid credit card number.', 'easy-digital-downloads' ), - 'invalid_expiry_month' => __( 'The card\'s expiration month is invalid.', 'easy-digital-downloads' ), - 'invalid_expiry_year' => __( 'The card\'s expiration year is invalid.', 'easy-digital-downloads' ), - 'invalid_cvc' => __( 'The card\'s security code is invalid.', 'easy-digital-downloads' ), - 'incorrect_number' => __( 'The card number you provided is incorrect. Please check the number and try again.', 'easy-digital-downloads' ), - 'incomplete_number' => __( 'The card number is incomplete.', 'easy-digital-downloads' ), - 'incomplete_cvc' => __( 'The card\'s security code is incomplete.', 'easy-digital-downloads' ), - 'incomplete_expiry' => __( 'The card\'s expiration date is incomplete.', 'easy-digital-downloads' ), - 'incorrect_cvc' => __( 'The card\'s security code is incorrect.', 'easy-digital-downloads' ), - 'incorrect_zip' => __( 'The card\'s zip code failed validation.', 'easy-digital-downloads' ), - 'invalid_expiry_year_past' => __( 'The card\'s expiration year is in the past.', 'easy-digital-downloads' ), - 'processing_error' => __( 'An error occurred while processing the card. Please try again.', 'easy-digital-downloads' ), - 'email_invalid' => __( 'Invalid email address, please correct and try again.', 'easy-digital-downloads' ), - 'authentication_required' => __( 'Your purchase may require additional authentication. Please try again and confirm any authentication requests.', 'easy-digital-downloads' ), - 'approve_with_id' => __( 'There was an error processing your payment. Please try again, and if you continue to have problems, contact your card issuer.', 'easy-digital-downloads' ), - 'currency_not_supported' => __( 'Your payment method is not authorized to make purchases in this currency. Please contact your card issuer.', 'easy-digital-downloads' ), - 'expired_card' => __( 'The payment method you have provided is expired. Please try a different payment method.', 'easy-digital-downloads' ), - 'try_again_later' => __( 'There was an error processing your payment. Please try again.', 'easy-digital-downloads' ), - 'generic_decline' => $generic_different_payment_method, - 'payment_intent_payment_attempt_failed' => $generic_different_payment_method, - 'invalid_request_error' => $generic_different_payment_method, - 'insufficient_funds' => $generic_different_payment_method, - 'pin_try_exceeded' => $generic_different_payment_method, - 'withdrawal_count_limit_exceeded' => $generic_different_payment_method, - 'call_issuer' => $generic_contact_issuer_message, - 'card_not_supported' => $generic_contact_issuer_message, - 'card_velocity_exceeded' => $generic_contact_issuer_message, - 'do_not_honor' => $generic_contact_issuer_message, - 'do_not_try_again' => $generic_contact_issuer_message, - 'invalid_account' => $generic_contact_issuer_message, - 'invalid_amount' => $generic_contact_issuer_message, - 'issuer_not_available' => $generic_contact_issuer_message, - 'new_account_information_available' => $generic_contact_issuer_message, - 'no_action_taken' => $generic_contact_issuer_message, - 'not_permitted' => $generic_contact_issuer_message, - 'pickup_card' => $generic_contact_issuer_message, - 'restricted_card' => $generic_contact_issuer_message, - 'revocation_of_all_authorizations' => $generic_contact_issuer_message, - 'revocation_of_authorization' => $generic_contact_issuer_message, - 'security_violation' => $generic_contact_issuer_message, - 'service_not_allowed' => $generic_contact_issuer_message, - 'stop_payment_order' => $generic_contact_issuer_message, - 'transaction_not_allowed' => $generic_contact_issuer_message, - 'card_declined' => $generic_contact_issuer_message, - ); - - /** - * Filters the list of available error codes and corresponding error messages. - * - * @since 2.8.0 - * - * @param array $error_list List of error codes and corresponding error messages. - */ - $error_list = apply_filters( 'edds_get_localized_error_list', $error_list ); - - return $error_list; -} - -/** - * Returns a localized error message for a corresponding Stripe - * error code. - * - * @link https://stripe.com/docs/error-codes - * - * @since 2.8.0 - * - * @param string $error_code Error code. - * @param string $error_message Original error message to return if a localized version does not exist. - * @return string $error_message Potentially localized error message. - */ -function edds_get_localized_error_message( $error_code, $error_message, $decline_code = false ) { - $error_list = edds_get_localized_error_messages(); - - if ( - ( 'card_declined' === $error_code || 'payment_intent_payment_attempt_failed' === $error_code || 'payment_intent_payment_attempt_failed' === $error_code ) && - false !== $decline_code && - ! empty( $error_list[ $decline_code ] ) - ) { - $error_message = $error_list[ $decline_code ]; - } elseif ( ! empty( $error_list[ $error_code ] ) ) { - $error_message = $error_list[ $error_code ]; - } - - // To make development and testing easier for store owners, append the error and decline codes. - if ( 'local' === wp_get_environment_type() ) { - $error_message .= ' Error Code: ' . $error_code; - if ( false !== $decline_code ) { - $error_message .= ' Decline Code: ' . $decline_code; - } - } - - return $error_message; -} - -/** - * Returns a translatable string for informing the user that carts can only contain a single subscription and not be 'mixed'. - * - * @since 2.9.1 - * - * @return string The translatable string for the single subscription requirement error. - */ -function edds_get_single_subscription_cart_error() { - return esc_html__( - 'Subscriptions must be purchased individually. Please update your cart to only contain a single subscription.', - 'easy-digital-downloads' - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/integrations/edd-all-access.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/integrations/edd-all-access.php deleted file mode 100644 index 11c125ac..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/integrations/edd-all-access.php +++ /dev/null @@ -1,27 +0,0 @@ - $download_id, - ) - ); - - return false === $all_access['success']; -} -add_filter( 'edds_prb_purchase_link_enabled', 'edds_all_access_prb_purchase_link_enabled', 10, 2 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/integrations/edd-auto-register.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/integrations/edd-auto-register.php deleted file mode 100644 index e2cdc435..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/integrations/edd-auto-register.php +++ /dev/null @@ -1,32 +0,0 @@ -: If the routine should be run even if the upgrade routine has been run already - * - * ## EXAMPLES - * - * wp edd-stripe migrate_customer_ids - * wp edd-stripe migrate_customer_ids --force - */ - public function migrate_customer_ids( $args, $assoc_args ) { - global $wpdb; - $force = isset( $assoc_args['force'] ) ? true : false; - - $upgrade_completed = edd_has_upgrade_completed( 'stripe_customer_id_migration' ); - - if ( ! $force && $upgrade_completed ) { - WP_CLI::error( __( 'The Stripe customer ID migration has already been run. To do this anyway, use the --force argument.', 'easy-digital-downloads' ) ); - } - - $sql = "SELECT user_id, meta_key, meta_value FROM $wpdb->usermeta WHERE meta_key IN ( '_edd_stripe_customer_id', '_edd_stripe_customer_id_test' )"; - $results = $wpdb->get_results( $sql ); - $total = count( $results ); - - if ( ! empty( $total ) ) { - - $progress = new \cli\progress\Bar( 'Processing user meta', $total ); - - foreach ( $results as $result ) { - $user_data = get_userdata( $result->user_id ); - $customer = new EDD_Customer( $user_data->user_email ); - - if ( ! $customer->id > 0 ) { - $customer = new EDD_Customer( $result->user_id, true ); - - if ( ! $customer->id > 0 ) { - continue; - } - } - - $stripe_customer_id = $result->meta_value; - - // We should try and use a recurring ID if one exists for this user - if ( class_exists( 'EDD_Recurring_Subscriber' ) ) { - $subscriber = new EDD_Recurring_Subscriber( $customer->id ); - $stripe_customer_id = $subscriber->get_recurring_customer_id( 'stripe' ); - } - - $customer->update_meta( $result->meta_key, $stripe_customer_id ); - - $progress->tick(); - } - - $progress->finish(); - WP_CLI::line( __( 'Migration complete.', 'easy-digital-downloads' ) ); - } else { - WP_CLI::line( __( 'No user records were found that needed to be migrated.', 'easy-digital-downloads' ) ); - } - - update_option( 'edds_stripe_version', preg_replace( '/[^0-9.].*/', '', EDD_STRIPE_VERSION ) ); - edd_set_upgrade_complete( 'stripe_customer_id_migration' ); - - } -} \ No newline at end of file diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-actions/card-elements-actions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-actions/card-elements-actions.php deleted file mode 100644 index a65c59a4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-actions/card-elements-actions.php +++ /dev/null @@ -1,1191 +0,0 @@ -rate_limiting->has_hit_card_error_limit() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'We are unable to process your payment at this time, please try again later or contact support.', - 'easy-digital-downloads' - ) - ); - } - - /** - * Allows processing before an Intent is created. - * - * @since 2.7.0 - * - * @param array $purchase_data Purchase data. - */ - do_action( 'edds_pre_process_purchase_form', $purchase_data ); - - $payment_method_id = isset( $_POST['payment_method_id'] ) ? sanitize_text_field( $_POST['payment_method_id'] ) : false; - $payment_method_exists = isset( $_POST['payment_method_exists'] ) ? 'true' == $_POST['payment_method_exists'] : false; - - if ( ! $payment_method_id ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Unable to locate payment method. Please try again with a new payment method.', - 'easy-digital-downloads' - ) - ); - } - - // Ensure Payment Method is still valid. - $payment_method = edds_api_request( 'PaymentMethod', 'retrieve', $payment_method_id ); - $card = isset( $payment_method->card ) ? $payment_method->card : null; - - // ...block prepaid cards if option is not enabled. - if ( - $card && - 'prepaid' === $card->funding && - false === (bool) edd_get_option( 'stripe_allow_prepaid' ) - ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Prepaid cards are not a valid payment method. Please try again with a new payment method.', - 'easy-digital-downloads' - ) - ); - } - - if ( edds_is_zero_decimal_currency() ) { - $amount = $purchase_data['price']; - } else { - $amount = round( $purchase_data['price'] * 100, 0 ); - } - - // Retrieves or creates a Stripe Customer. - $customer = edds_checkout_setup_customer( $purchase_data ); - - if ( ! $customer ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Unable to create customer. Please try again.', - 'easy-digital-downloads' - ) - ); - } - - /** - * Allows processing before an Intent is created, but - * after a \Stripe\Customer is available. - * - * @since 2.7.0 - * - * @param array $purchase_data Purchase data. - * @param \Stripe\Customer $customer Stripe Customer object. - */ - do_action( 'edds_process_purchase_form_before_intent', $purchase_data, $customer ); - - // Flag if this is the first card being attached to the Customer. - $existing_payment_methods = edd_stripe_get_existing_cards( $purchase_data['user_info']['id'] ); - $is_first_payment_method = empty( $existing_payment_methods ); - - $address_info = $purchase_data['user_info']['address']; - - // Update PaymentMethod details if necessary. - if ( $payment_method_exists && ! empty( $_POST['edd_stripe_update_billing_address'] ) ) { - $billing_address = array(); - - foreach ( $address_info as $key => $value ) { - // Adjusts address data keys to work with PaymentMethods. - switch( $key ) { - case 'zip': - $key = 'postal_code'; - break; - } - - $billing_address[ $key ] = ! empty( $value ) ? sanitize_text_field( $value ) : ''; - } - - edds_api_request( 'PaymentMethod', 'update', $payment_method_id, array( - 'billing_details' => array( - 'address' => $billing_address, - ), - ) ); - } - - // Create a list of {$download_id}_{$price_id} - $payment_items = array(); - - foreach ( $purchase_data['cart_details'] as $item ) { - $price_id = isset( $item['item_number']['options']['price_id'] ) - ? $item['item_number']['options']['price_id'] - : null; - - $payment_items[] = $item['id'] . ( ! empty( $price_id ) ? ( '_' . $price_id ) : '' ); - } - - // Shared Intent arguments. - $intent_args = array( - 'confirm' => true, - 'payment_method' => $payment_method_id, - 'customer' => $customer->id, - 'metadata' => array( - 'email' => esc_html( $purchase_data['user_info']['email'] ), - 'edd_payment_subtotal' => esc_html( $purchase_data['subtotal'] ), - 'edd_payment_discount' => esc_html( $purchase_data['discount'] ), - 'edd_payment_tax' => esc_html( $purchase_data['tax'] ), - 'edd_payment_tax_rate' => esc_html( $purchase_data['tax_rate'] ), - 'edd_payment_fees' => esc_html( edd_get_cart_fee_total() ), - 'edd_payment_total' => esc_html( $purchase_data['price'] ), - 'edd_payment_items' => esc_html( implode( ', ', $payment_items ) ), - ), - ); - - // Attempt to map existing charge arguments to PaymentIntents. - if ( has_filter( 'edds_create_charge_args' ) ) { - /** - * @deprecated 2.7.0 In favor of `edds_create_payment_intent_args`. - * - * @param array $intent_args - */ - $old_charge_args = apply_filters_deprecated( - 'edds_create_charge_args', - array( - $intent_args, - ), - '2.7.0', - 'edds_create_payment_intent_args' - ); - - // Grab a few compatible arguments from the old charges filter. - $compatible_keys = array( - 'amount', - 'currency', - 'customer', - 'description', - 'metadata', - 'application_fee', - ); - - foreach ( $compatible_keys as $compatible_key ) { - if ( ! isset( $old_charge_args[ $compatible_key ] ) ) { - continue; - } - - $value = $old_charge_args[ $compatible_key ]; - - switch ( $compatible_key ) { - case 'application_fee' : - $intent_args['application_fee_amount'] = $value; - break; - - default: - // If a legacy value is an array merge it with the existing values to avoid overriding completely. - $intent_args[ $compatible_key ] = is_array( $value ) && is_array( $intent_args[ $compatible_key ] ) - ? wp_parse_args( $value, $intent_args[ $compatible_key ] ) - : $value; - } - - edd_debug_log( __( 'Charges are no longer directly created in Stripe. Please read the following for more information: https://easydigitaldownloads.com/development/', 'easy-digital-downloads' ), true ); - } - } - - // Create a SetupIntent for a non-payment carts. - if ( edds_is_preapprove_enabled() || 0 === $amount ) { - $intent_args = array_merge( - array( - 'usage' => 'off_session', - 'description' => edds_get_payment_description( $purchase_data['cart_details'] ), - ), - $intent_args - ); - - /** - * Filters the arguments used to create a SetupIntent. - * - * @since 2.7.0 - * - * @param array $intent_args SetupIntent arguments. - * @param array $purchase_data { - * Purchase form data. - * - * } - */ - $intent_args = apply_filters( 'edds_create_setup_intent_args', $intent_args, $purchase_data ); - - $intent = edds_api_request( 'SetupIntent', 'create', $intent_args ); - - // Manually attach PaymentMethod to the Customer. - if ( ! $payment_method_exists && edd_stripe_existing_cards_enabled() ) { - $payment_method = edds_api_request( 'PaymentMethod', 'retrieve', $payment_method_id ); - $payment_method->attach( array( - 'customer' => $customer->id, - ) ); - } - - // Create a PaymentIntent for an immediate charge. - } else { - $purchase_summary = edds_get_payment_description( $purchase_data['cart_details'] ); - $statement_descriptor = edds_get_statement_descriptor(); - - if ( empty( $statement_descriptor ) ) { - $statement_descriptor = substr( $purchase_summary, 0, 22 ); - } - - $statement_descriptor = apply_filters( 'edds_statement_descriptor', $statement_descriptor, $purchase_data ); - $statement_descriptor = edds_sanitize_statement_descriptor( $statement_descriptor ); - - if ( empty( $statement_descriptor ) ) { - $statement_descriptor = null; - } elseif ( is_numeric( $statement_descriptor ) ) { - $statement_descriptor = edd_get_label_singular() . ' ' . $statement_descriptor; - } - - $intent_args = array_merge( - array( - 'amount' => $amount, - 'currency' => edd_get_currency(), - 'setup_future_usage' => 'off_session', - 'confirmation_method' => 'manual', - 'save_payment_method' => true, - 'description' => $purchase_summary, - 'statement_descriptor' => $statement_descriptor, - ), - $intent_args - ); - - if ( - ! empty( edd_stripe()->connect()->get_connect_id() ) && - true === edds_stripe_connect_account_country_supports_application_fees() - ) { - $intent_args['application_fee_amount'] = round( $amount * 0.02 ); - } - - /** - * Filters the arguments used to create a SetupIntent. - * - * @since 2.7.0 - * - * @param array $intent_args SetupIntent arguments. - * @param array $purchase_data { - * Purchase form data. - * - * } - */ - $intent_args = apply_filters( 'edds_create_payment_intent_args', $intent_args, $purchase_data ); - - $intent = edds_api_request( 'PaymentIntent', 'create', $intent_args ); - } - - // Set the default payment method when attaching the first one. - if ( $is_first_payment_method ) { - edds_api_request( 'Customer', 'update', $customer->id, array( - 'invoice_settings' => array( - 'default_payment_method' => $payment_method_id, - ), - ) ); - } - - /** - * Allows further processing after an Intent is created. - * - * @since 2.7.0 - * - * @param array $purchase_data Purchase data. - * @param \Stripe\PaymentIntent|\Stripe\SetupIntent $intent Created Stripe Intent. - * @param int $payment_id EDD Payment ID. - */ - do_action( 'edds_process_purchase_form', $purchase_data, $intent ); - - return wp_send_json_success( array( - 'intent' => $intent, - // Send back a new nonce because the user might have logged in. - 'nonce' => wp_create_nonce( 'edd-process-checkout' ), - ) ); - - // Catch card-specific errors to handle rate limiting. - } catch ( \Stripe\Exception\CardException $e ) { - // Increase the card error count. - edd_stripe()->rate_limiting->increment_card_error_count(); - - $error = $e->getJsonBody()['error']; - - // Record error in log. - edd_record_gateway_error( - esc_html__( 'Stripe Error', 'easy-digital-downloads' ), - sprintf( - esc_html__( 'There was an error while processing a Stripe payment. Payment data: %s', 'easy-digital-downloads' ), - wp_json_encode( $error ) - ), - 0 - ); - - $decline_code = ! empty( $error['decline_code'] ) ? $error['decline_code'] : false; - - return wp_send_json_error( array( - 'message' => esc_html( - edds_get_localized_error_message( $error['code'], $error['message'], $decline_code ) - ), - ) ); - - // Catch Stripe-specific errors. - } catch ( \Stripe\Exception\ApiErrorException $e ) { - $error = $e->getJsonBody()['error']; - - // Record error in log. - edd_record_gateway_error( - esc_html__( 'Stripe Error', 'easy-digital-downloads' ), - sprintf( - esc_html__( 'There was an error while processing a Stripe payment. Payment data: %s', 'easy-digital-downloads' ), - wp_json_encode( $error ) - ), - 0 - ); - - return wp_send_json_error( array( - 'message' => esc_html( - edds_get_localized_error_message( $error['code'], $error['message'] ) - ), - ) ); - - // Catch gateway processing errors. - } catch ( \EDD_Stripe_Gateway_Exception $e ) { - if ( true === $e->hasLogMessage() ) { - edd_record_gateway_error( - esc_html__( 'Stripe Error', 'easy-digital-downloads' ), - $e->getLogMessage(), - 0 - ); - } - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - - // Catch any remaining error. - } catch( \Exception $e ) { - - // Safety precaution in case the payment form is submitted directly. - // Redirects back to the Checkout. - if ( isset( $_POST['edd_email'] ) && ! isset( $_POST['payment_method_id'] ) ) { - edd_set_error( $e->getCode(), $e->getMessage() ); - edd_send_back_to_checkout( '?payment-mode=' . $purchase_data['gateway'] ); - } - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'edd_gateway_stripe', 'edds_process_purchase_form' ); - -/** - * Retrieves an Intent. - * - * @since 2.7.0 - */ -function edds_get_intent() { - // Map and merge serialized `form_data` to $_POST so it's accessible to other functions. - _edds_map_form_data_to_request( $_POST ); - - $intent_id = isset( $_REQUEST['intent_id'] ) ? sanitize_text_field( $_REQUEST['intent_id'] ) : null; - $intent_type = isset( $_REQUEST['intent_type'] ) ? sanitize_text_field( $_REQUEST['intent_type'] ) : 'payment_intent'; - - try { - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Rate limit reached during Intent retrieval.' - ); - } - - if ( false === edds_verify_payment_form_nonce() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Nonce verification failed during Intent retrieval.' - ); - } - - if ( 'setup_intent' === $intent_type ) { - $intent = edds_api_request( 'SetupIntent', 'retrieve', $intent_id ); - } else { - $intent = edds_api_request( 'PaymentIntent', 'retrieve', $intent_id ); - } - - return wp_send_json_success( array( - 'intent' => $intent, - ) ); - // Catch gateway processing errors. - } catch ( \EDD_Stripe_Gateway_Exception $e ) { - // Increase the rate limit if an exception occurs mid-process. - edd_stripe()->rate_limiting->increment_card_error_count(); - - if ( true === $e->hasLogMessage() ) { - edd_record_gateway_error( - esc_html__( 'Stripe Error', 'easy-digital-downloads' ), - $e->getLogMessage(), - 0 - ); - } - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - - // Catch any remaining error. - } catch( \Exception $e ) { - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'wp_ajax_edds_get_intent', 'edds_get_intent' ); -add_action( 'wp_ajax_nopriv_edds_get_intent', 'edds_get_intent' ); - -/** - * Confirms a PaymentIntent. - * - * @since 2.7.0 - */ -function edds_confirm_intent() { - // Map and merge serialized `form_data` to $_POST so it's accessible to other functions. - _edds_map_form_data_to_request( $_POST ); - - $intent_id = isset( $_REQUEST['intent_id'] ) ? sanitize_text_field( $_REQUEST['intent_id'] ) : null; - $intent_type = isset( $_REQUEST['intent_type'] ) ? sanitize_text_field( $_REQUEST['intent_type'] ) : 'payment_intent'; - - try { - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Rate limit reached during Intent confirmation.' - ); - } - - if ( false === edds_verify_payment_form_nonce() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Nonce verification failed during Intent confirmation.' - ); - } - - // SetupIntent was used if the cart total is $0. - if ( 'setup_intent' === $intent_type ) { - $intent = edds_api_request( 'SetupIntent', 'retrieve', $intent_id ); - } else { - $intent = edds_api_request( 'PaymentIntent', 'retrieve', $intent_id ); - $intent->confirm(); - } - - /** - * Allows further processing after an Intent is confirmed. - * Runs for all calls to confirm(), regardless of action needed. - * - * @since 2.7.0 - * - * @param \Stripe\PaymentIntent|\Stripe\SetupIntent $intent Stripe intent. - */ - do_action( 'edds_confirm_payment_intent', $intent ); - - return wp_send_json_success( array( - 'intent' => $intent, - ) ); - - // Catch gateway processing errors. - } catch ( \EDD_Stripe_Gateway_Exception $e ) { - // Increase the rate limit if an exception occurs mid-process. - edd_stripe()->rate_limiting->increment_card_error_count(); - - if ( true === $e->hasLogMessage() ) { - edd_record_gateway_error( - esc_html__( 'Stripe Error', 'easy-digital-downloads' ), - $e->getLogMessage(), - 0 - ); - } - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - - // Catch any remaining error. - } catch( Exception $e ) { - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'wp_ajax_edds_confirm_intent', 'edds_confirm_intent' ); -add_action( 'wp_ajax_nopriv_edds_confirm_intent', 'edds_confirm_intent' ); - -/** - * Capture a PaymentIntent. - * - * @since 2.7.0 - */ -function edds_capture_intent() { - // Map and merge serialized `form_data` to $_POST so it's accessible to other functions. - _edds_map_form_data_to_request( $_POST ); - - $intent_id = isset( $_REQUEST['intent_id'] ) ? sanitize_text_field( $_REQUEST['intent_id'] ) : null; - - try { - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Rate limit reached during Intent capture.' - ); - } - - // Verify the checkout session only. - if ( false === edds_verify() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Nonce verification failed during Intent capture.' - ); - } - - $intent = edds_api_request( 'PaymentIntent', 'retrieve', $intent_id ); - - /** - * Allows processing before a PaymentIntent is captured. - * - * @since 2.7.0 - * - * @param \Stripe\PaymentIntent $payment_intent Stripe PaymentIntent. - */ - do_action( 'edds_capture_payment_intent', $intent ); - - // Capture capturable amount if nothing else has captured the intent. - if ( 'requires_capture' === $intent->status ) { - $intent->capture( array( - 'amount_to_capture' => $intent->amount_capturable, - ) ); - } - - return wp_send_json_success( array( - 'intent' => $intent, - ) ); - - // Catch gateway processing errors. - } catch ( \EDD_Stripe_Gateway_Exception $e ) { - // Increase the rate limit if an exception occurs mid-process. - edd_stripe()->rate_limiting->increment_card_error_count(); - - if ( true === $e->hasLogMessage() ) { - edd_record_gateway_error( - esc_html__( 'Stripe Error', 'easy-digital-downloads' ), - $e->getLogMessage(), - 0 - ); - } - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - - // Catch any remaining error. - } catch( Exception $e ) { - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'wp_ajax_edds_capture_intent', 'edds_capture_intent' ); -add_action( 'wp_ajax_nopriv_edds_capture_intent', 'edds_capture_intent' ); - -/** - * Update a PaymentIntent. - * - * @since 2.7.0 - */ -function edds_update_intent() { - // Map and merge serialized `form_data` to $_POST so it's accessible to other functions. - _edds_map_form_data_to_request( $_POST ); - - $intent_id = isset( $_REQUEST['intent_id'] ) ? sanitize_text_field( $_REQUEST['intent_id'] ) : null; - - try { - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Rate limit reached during Intent update.' - ); - } - - if ( false === edds_verify_payment_form_nonce() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Nonce verification failed during Intent update.' - ); - } - - $intent = edds_api_request( 'PaymentIntent', 'retrieve', $intent_id ); - - /** - * Allows processing before a PaymentIntent is updated. - * - * @since 2.7.0 - * - * @param string $intent_id Stripe PaymentIntent ID. - */ - do_action( 'edds_update_payment_intent', $intent_id ); - - $intent_args = array(); - $intent_args_whitelist = array( - 'payment_method', - ); - - foreach ( $intent_args_whitelist as $intent_arg ) { - if ( isset( $_POST[ $intent_arg ] ) ) { - $intent_args[ $intent_arg ] = sanitize_text_field( $_POST[ $intent_arg ] ); - } - } - - $intent = edds_api_request( 'PaymentIntent', 'update', $intent_id, $intent_args ); - - return wp_send_json_success( array( - 'intent' => $intent, - ) ); - - // Catch gateway processing errors. - } catch ( \EDD_Stripe_Gateway_Exception $e ) { - // Increase the rate limit if an exception occurs mid-process. - edd_stripe()->rate_limiting->increment_card_error_count(); - - if ( true === $e->hasLogMessage() ) { - edd_record_gateway_error( - esc_html__( 'Stripe Error', 'easy-digital-downloads' ), - $e->getLogMessage(), - 0 - ); - } - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - - // Catch any remaining error. - } catch( Exception $e ) { - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'wp_ajax_edds_update_intent', 'edds_update_intent' ); -add_action( 'wp_ajax_nopriv_edds_update_intent', 'edds_update_intent' ); - -/** - * Create an \EDD_Payment. - * - * @since 2.7.0 - */ -function edds_create_payment() { - // Map and merge serialized `form_data` to $_POST so it's accessible to other functions. - _edds_map_form_data_to_request( $_POST ); - - // Simulate being in an `edd_process_purchase_form()` request. - _edds_fake_process_purchase_step(); - - try { - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Rate limit reached during payment creation.' - ); - } - - // This must happen in the Checkout flow, so validate the Checkout nonce. - if ( false === edds_verify() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Nonce verification failed during payment creation.' - ); - } - - $intent = isset( $_REQUEST['intent'] ) ? $_REQUEST['intent'] : array(); - - if ( ! isset( $intent['id'] ) ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to retrieve Intent data during payment creation.' - ); - } - - $purchase_data = edd_get_purchase_session(); - - if ( false === $purchase_data ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to retrieve purchase data during payment creation.' - ); - } - - // Ensure Intent has transitioned to the correct status. - if ( 'setup_intent' === $intent['object'] ) { - $intent = edds_api_request( 'SetupIntent', 'retrieve', $intent['id'] ); - } else { - $intent = edds_api_request( 'PaymentIntent', 'retrieve', $intent['id'] ); - } - - if ( ! in_array( $intent->status, array( 'succeeded', 'requires_capture' ), true ) ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Invalid Intent status ' . $intent->status . ' during payment creation.' - ); - } - - $payment_data = array( - 'price' => $purchase_data['price'], - 'date' => $purchase_data['date'], - 'user_email' => $purchase_data['user_email'], - 'purchase_key' => $purchase_data['purchase_key'], - 'currency' => edd_get_currency(), - 'downloads' => $purchase_data['downloads'], - 'cart_details' => $purchase_data['cart_details'], - 'user_info' => $purchase_data['user_info'], - 'status' => 'pending', - 'gateway' => 'stripe', - ); - - // Ensure $_COOKIE is available without a new HTTP request. - if ( class_exists( 'EDD_Auto_Register' ) ) { - add_action( 'set_logged_in_cookie', 'edds_set_logged_in_cookie_global' ); - add_filter( 'edd_get_option_edd_auto_register_complete_orders_only', '__return_false' ); - } - - // Record the pending payment. - $payment_id = edd_insert_payment( $payment_data ); - - if ( false === $payment_id ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to insert payment record.' - ); - } - - // Retrieve created payment. - $payment = edd_get_payment( $payment_id ); - - // Retrieve the relevant Intent. - if ( 'setup_intent' === $intent->object ) { - $intent = edds_api_request( 'SetupIntent', 'update', $intent->id, array( - 'metadata' => array( - 'edd_payment_id' => $payment_id, - ), - ) ); - - $payment->add_note( 'Stripe SetupIntent ID: ' . $intent->id ); - $payment->update_meta( '_edds_stripe_setup_intent_id', $intent->id ); - } else { - $intent = edds_api_request( 'PaymentIntent', 'update', $intent->id, array( - 'metadata' => array( - 'edd_payment_id' => $payment_id, - ), - ) ); - - $payment->add_note( 'Stripe PaymentIntent ID: ' . $intent->id ); - $payment->update_meta( '_edds_stripe_payment_intent_id', $intent->id ); - } - - // Use Intent ID for temporary transaction ID. - // It will be updated when a charge is available. - $payment->transaction_id = $intent->id; - - // Retrieves or creates a Stripe Customer. - $payment->update_meta( '_edds_stripe_customer_id', $intent->customer ); - $payment->add_note( 'Stripe Customer ID: ' . $intent->customer ); - - // Attach the \Stripe\Customer ID to the \EDD_Customer meta if one exists. - $edd_customer = new EDD_Customer( $purchase_data['user_email'] ); - - if ( $edd_customer->id > 0 ) { - $edd_customer->update_meta( edd_stripe_get_customer_key(), $intent->customer ); - } - - $saved = $payment->save(); - - if ( class_exists( 'EDD_Auto_Register' ) ) { - remove_action( 'set_logged_in_cookie', 'edds_set_logged_in_cookie_global' ); - } - - if ( true === $saved ) { - /** - * Allows further processing after a payment is created. - * - * @since 2.7.0 - * - * @param \EDD_Payment $payment EDD Payment. - * @param \Stripe\PaymentIntent|\Stripe\SetupIntent $intent Created Stripe Intent. - */ - do_action( 'edds_payment_created', $payment, $intent ); - - return wp_send_json_success( array( - 'intent' => $intent, - 'payment' => $payment, - // Send back a new nonce because the user might have logged in via Auto Register. - 'nonce' => wp_create_nonce( 'edd-process-checkout' ), - ) ); - } else { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Unable to create payment.', - 'easy-digital-downloads' - ), - 'Unable to save payment record.' - ); - } - - // Catch gateway processing errors. - } catch ( \EDD_Stripe_Gateway_Exception $e ) { - // Increase the rate limit count when something goes wrong mid-process. - edd_stripe()->rate_limiting->increment_card_error_count(); - - if ( true === $e->hasLogMessage() ) { - edd_record_gateway_error( - esc_html__( 'Stripe Error', 'easy-digital-downloads' ), - $e->getLogMessage(), - 0 - ); - } - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - - // Catch any remaining error. - } catch( \Exception $e ) { - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'wp_ajax_edds_create_payment', 'edds_create_payment' ); -add_action( 'wp_ajax_nopriv_edds_create_payment', 'edds_create_payment' ); - -/** - * Completes an \EDD_Payment (via AJAX) - * - * @since 2.7.0 - */ -function edds_complete_payment() { - // Map and merge serialized `form_data` to $_POST so it's accessible to other functions. - _edds_map_form_data_to_request( $_POST ); - - $intent = isset( $_REQUEST['intent'] ) ? $_REQUEST['intent'] : array(); - - try { - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Rate limit reached during payment completion.' - ); - } - - // Verify the checkout session only. - if ( false === edds_verify() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Nonce verification failed during payment completion.' - ); - } - - if ( ! isset( $intent['id'] ) ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to retrieve Intent during payment completion.' - ); - } - - // Retrieve the intent from Stripe again to verify linked payment. - if ( 'setup_intent' === $intent['object'] ) { - $intent = edds_api_request( 'SetupIntent', 'retrieve', $intent['id'] ); - } else { - $intent = edds_api_request( 'PaymentIntent', 'retrieve', $intent['id'] ); - } - - $payment = edd_get_payment( $intent->metadata->edd_payment_id ); - - if ( ! $payment ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to retrieve pending payment record.' - ); - } - - if ( 'setup_intent' !== $intent['object'] ) { - $charge_id = sanitize_text_field( current( $intent['charges']['data'] )['id'] ); - - $payment->add_note( 'Stripe Charge ID: ' . $charge_id ); - $payment->transaction_id = sanitize_text_field( $charge_id ); - } - - // Mark payment as Preapproved. - if ( edds_is_preapprove_enabled() ) { - $payment->status = 'preapproval'; - - // Complete payment and transition the Transaction ID to the actual Charge ID. - } else { - $payment->status = 'publish'; - } - - if ( $payment->save() ) { - /** - * Allows further processing after a payment is completed. - * - * Sends back just the Intent ID to avoid needing always retrieve - * the intent in this step, which has been transformed via JSON, - * and is no longer a \Stripe\PaymentIntent - * - * @since 2.7.0 - * - * @param \EDD_Payment $payment EDD Payment. - * @param string $intent_id Stripe Intent ID. - */ - do_action( 'edds_payment_complete', $payment, $intent['id'] ); - - // Empty cart. - edd_empty_cart(); - - return wp_send_json_success( array( - 'payment' => $payment, - 'intent' => $intent, - ) ); - } else { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to update payment record to completion.' - ); - } - - // Catch gateway processing errors. - } catch ( \EDD_Stripe_Gateway_Exception $e ) { - // Increase the rate limit count when something goes wrong mid-process. - edd_stripe()->rate_limiting->increment_card_error_count(); - - if ( true === $e->hasLogMessage() ) { - edd_record_gateway_error( - esc_html__( 'Stripe Error', 'easy-digital-downloads' ), - $e->getLogMessage(), - 0 - ); - } - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - - // Catch any remaining error. - } catch( \Exception $e ) { - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'wp_ajax_edds_complete_payment', 'edds_complete_payment' ); -add_action( 'wp_ajax_nopriv_edds_complete_payment', 'edds_complete_payment' ); - -/** - * Completes a Payment authorization. - * - * @since 2.7.0 - */ -function edds_complete_payment_authorization() { - $intent_id = isset( $_REQUEST['intent_id'] ) ? sanitize_text_field( $_REQUEST['intent_id'] ) : null; - - try { - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Rate limit reached during payment authorization.' - ); - } - - $nonce_verified = edds_verify( 'edds-complete-payment-authorization', 'edds-complete-payment-authorization' ); - if ( false === $nonce_verified ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Nonce verification failed during payment authorization.' - ); - } - - $intent = edds_api_request( 'PaymentIntent', 'retrieve', $intent_id ); - $edd_payment_id = $intent->metadata->edd_payment_id ? $intent->metadata->edd_payment_id : false; - - if ( ! $edd_payment_id ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to retrieve payment record ID from Stripe metadata.' - ); - } - - $payment = edd_get_payment( $edd_payment_id ); - $charge_id = current( $intent->charges->data )->id; - - $payment->add_note( 'Stripe Charge ID: ' . $charge_id ); - $payment->transaction_id = $charge_id; - $payment->status = 'publish'; - - - if ( $payment->save() ) { - - /** - * Allows further processing after a payment authorization is completed. - * - * @since 2.7.0 - * - * @param \Stripe\PaymentIntent $intent Created Stripe Intent. - * @param EDD_Payment $payment EDD Payment. - */ - do_action( 'edds_payment_authorization_complete', $intent, $payment ); - - return wp_send_json_success( array( - 'intent' => $intent, - 'payment' => $payment, - ) ); - } else { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to save payment record during authorization.' - ); - } - } catch( \Exception $e ) { - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'wp_ajax_edds_complete_payment_authorization', 'edds_complete_payment_authorization' ); -add_action( 'wp_ajax_nopriv_edds_complete_payment_authorization', 'edds_complete_payment_authorization' ); - -/** - * Generates a description based on the cart details. - * - * @param array $cart_details { - * - * } - * @return string - */ -function edds_get_payment_description( $cart_details ) { - $purchase_summary = ''; - - if( is_array( $cart_details ) && ! empty( $cart_details ) ) { - foreach( $cart_details as $item ) { - $purchase_summary .= $item['name']; - $price_id = isset( $item['item_number']['options']['price_id'] ) - ? absint( $item['item_number']['options']['price_id'] ) - : false; - - if ( false !== $price_id ) { - $purchase_summary .= ' - ' . edd_get_price_option_name( $item['id'], $item['item_number']['options']['price_id'] ); - } - - $purchase_summary .= ', '; - } - - $purchase_summary = rtrim( $purchase_summary, ', ' ); - } - - // Stripe has a maximum of 999 characters in the charge description - $purchase_summary = substr( $purchase_summary, 0, 1000 ); - - return html_entity_decode( $purchase_summary, ENT_COMPAT, 'UTF-8' ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-actions/functions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-actions/functions.php deleted file mode 100644 index c84a29d5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-actions/functions.php +++ /dev/null @@ -1,242 +0,0 @@ - $purchase_data['user_email'], - 'description' => $purchase_data['user_email'], - 'name' => $customer_name, - ); - - /** - * Filters the arguments used to create a Customer in Stripe. - * - * @since unknown - * - * @param array $customer_args { - * Arguments to create a Stripe Customer. - * - * @link https://stripe.com/docs/api/customers/create - * } - * @param array $purchase_data { - * Cart purchase data if in the checkout context. Empty otherwise. - * } - */ - $customer_args = apply_filters( 'edds_create_customer_args', $customer_args, $purchase_data ); - $customer = edds_get_stripe_customer( $stripe_customer_id, $customer_args ); - - return $customer; -} - - -/** - * Charge a preapproved payment - * - * @since 1.6 - * @return bool - */ -function edds_charge_preapproved( $payment_id = 0 ) { - $retval = false; - - if ( empty( $payment_id ) ) { - return $retval; - } - - $payment = edd_get_payment( $payment_id ); - $customer_id = $payment->get_meta( '_edds_stripe_customer_id' ); - - if ( empty( $customer_id ) ) { - return $retval; - } - - if ( ! in_array( $payment->status, array( 'preapproval', 'preapproval_pending' ), true ) ) { - return $retval; - } - - $setup_intent_id = $payment->get_meta( '_edds_stripe_setup_intent_id' ); - - try { - if ( edds_is_zero_decimal_currency() ) { - $amount = edd_get_payment_amount( $payment->ID ); - } else { - $amount = edd_get_payment_amount( $payment->ID ) * 100; - } - - $cart_details = edd_get_payment_meta_cart_details( $payment->ID ); - $purchase_summary = edds_get_payment_description( $cart_details ); - $statement_descriptor = edds_get_statement_descriptor(); - - if ( empty( $statement_descriptor ) ) { - $statement_descriptor = substr( $purchase_summary, 0, 22 ); - } - - $statement_descriptor = apply_filters( 'edds_preapproved_statement_descriptor', $statement_descriptor, $payment->ID ); - $statement_descriptor = edds_sanitize_statement_descriptor( $statement_descriptor ); - - if ( empty( $statement_descriptor ) ) { - $statement_descriptor = null; - } - - // Create a PaymentIntent using SetupIntent data. - if ( ! empty( $setup_intent_id ) ) { - $setup_intent = edds_api_request( 'SetupIntent', 'retrieve', $setup_intent_id ); - $intent_args = array( - 'amount' => $amount, - 'currency' => edd_get_currency(), - 'payment_method' => $setup_intent->payment_method, - 'customer' => $setup_intent->customer, - 'off_session' => true, - 'confirm' => true, - 'description' => $purchase_summary, - 'metadata' => $setup_intent->metadata->toArray(), - 'statement_descriptor' => $statement_descriptor, - ); - // Process a legacy preapproval. Uses the Customer's default source. - } else { - $customer = \Stripe\Customer::retrieve( $customer_id ); - $intent_args = array( - 'amount' => $amount, - 'currency' => edd_get_currency(), - 'payment_method' => $customer->default_source, - 'customer' => $customer->id, - 'off_session' => true, - 'confirm' => true, - 'description' => $purchase_summary, - 'metadata' => array( - 'email' => edd_get_payment_user_email( $payment->ID ), - 'edd_payment_id' => $payment->ID, - ), - 'statement_descriptor' => $statement_descriptor, - ); - } - - /** This filter is documented in includes/payment-actions.php */ - $intent_args = apply_filters( 'edds_create_payment_intent_args', $intent_args, array() ); - - $payment_intent = edds_api_request( 'PaymentIntent', 'create', $intent_args ); - - if ( 'succeeded' === $payment_intent->status ) { - $charge_id = current( $payment_intent->charges->data )->id; - - $payment->status = 'publish'; - $payment->add_note( 'Stripe Charge ID: ' . $charge_id ); - $payment->add_note( 'Stripe PaymentIntent ID: ' . $payment_intent->id ); - $payment->add_meta( '_edds_stripe_payment_intent_id', $payment_intent->id ); - $payment->transaction_id = $charge_id; - - $retval = $payment->save(); - } - } catch( \Stripe\Exception\ApiErrorException $e ) { - $error = $e->getJsonBody()['error']; - - $payment->status = 'preapproval_pending'; - $payment->add_note( esc_html( - edds_get_localized_error_message( $error['code'], $error['message'] ) - ) ); - $payment->add_note( 'Stripe PaymentIntent ID: ' . $error['payment_intent']['id'] ); - $payment->add_meta( '_edds_stripe_payment_intent_id', $error['payment_intent']['id'] ); - $payment->save(); - - /** - * Allows further processing when a Preapproved payment needs further action. - * - * @since 2.7.0 - * - * @param int $payment_id ID of the payment. - */ - do_action( 'edds_preapproved_payment_needs_action', $payment_id ); - } catch( \Exception $e ) { - $payment->add_note( esc_html( $e->getMessage() ) ); - } - - return $retval; -} - -/** - * If selected, refunds a charge in Stripe when creating a new refund record. - * This handles refunds in EDD 3.0+. For EDD 2.x see `edd_stripe_process_refund()` - * @see edd_stripe_process_refund() - * - * @since 2.8.7 - * - * @param int $order_id ID of the order we're processing a refund for. - * @param int $refund_id ID of the newly created refund record. - * @param bool $all_refunded Whether or not this was a full refund. - */ -function edd_stripe_maybe_refund_charge( $order_id, $refund_id, $all_refunded ) { - if ( ! current_user_can( 'edit_shop_payments', $order_id ) ) { - return; - } - - if ( empty( $_POST['data'] ) ) { - return; - } - - $order = edd_get_order( $order_id ); - if ( empty( $order->gateway ) || 'stripe' !== $order->gateway ) { - return; - } - - edd_debug_log( sprintf( 'Stripe - Maybe processing refund for order #%d.', $order_id ) ); - - // Get our data out of the serialized string. - parse_str( $_POST['data'], $form_data ); - - if ( empty( $form_data['edd-stripe-refund'] ) ) { - edd_debug_log( 'Stripe - Exiting refund process, as checkbox was not selected.' ); - - edd_add_note( array( - 'object_id' => $order_id, - 'object_type' => 'order', - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'content' => __( 'Charge not refunded in Stripe, as checkbox was not selected.', 'easy-digital-downloads' ) - ) ); - - return; - } - - edd_debug_log( 'Stripe - Refund checkbox was selected, proceeding to refund charge.' ); - - $refund = edd_get_order( $refund_id ); - if ( empty( $refund->total ) ) { - edd_debug_log( sprintf( - 'Stripe - Exiting refund for order #%d - refund total is empty.', - $order_id - ) ); - - return; - } - - try { - edd_refund_stripe_purchase( $order, $refund ); - } catch ( \Exception $e ) { - edd_debug_log( sprintf( 'Exception thrown while refunding order #%d. Message: %s', $order_id, $e->getMessage() ) ); - } -} -add_action( 'edd_refund_order', 'edd_stripe_maybe_refund_charge', 10, 3 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-actions/payment-elements-actions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-actions/payment-elements-actions.php deleted file mode 100644 index cff625dd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-actions/payment-elements-actions.php +++ /dev/null @@ -1,776 +0,0 @@ -has_regional_support || false === edd_stripe()->regional_support->requires_card_name ) { - add_filter( - 'edd_purchase_form_required_fields', - function( $required_fields ) { - unset( $required_fields['card_name'] ); - return $required_fields; - } - ); - remove_action( 'edd_checkout_error_checks', 'edds_process_post_data' ); - } -} -add_action( 'edd_pre_process_purchase', 'edds_maybe_disable_card_name' ); - -/** - * Starts the process of completing a purchase with Stripe. - * - * Generates an intent that can require user authorization before proceeding. - * - * @link https://stripe.com/docs/payments/intents - * @since 2.7.0 - * - * @param array $purchase_data { - * Purchase form data. - * - * } - */ -function edds_process_purchase_form( $purchase_data ) { - // Catch a straight to gateway request. - // Remove the error set by the "gateway mismatch" and allow the redirect. - if ( isset( $_REQUEST['edd_action'] ) && 'straight_to_gateway' === $_REQUEST['edd_action'] ) { - foreach ( $purchase_data['downloads'] as $download ) { - $options = isset( $download['options'] ) ? $download['options'] : array(); - $options['quantity'] = isset( $download['quantity'] ) ? $download['quantity'] : 1; - - edd_add_to_cart( $download['id'], $options ); - } - - edd_unset_error( 'edd-straight-to-gateway-error' ); - edd_send_back_to_checkout(); - - return; - } - - try { - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - throw new \EDD_Stripe_Gateway_Exception( edd_stripe()->rate_limiting->get_rate_limit_error_message() ); - } - - /** - * Allows processing before an Intent is created. - * - * @since 2.7.0 - * - * @param array $purchase_data Purchase data. - */ - do_action( 'edds_pre_process_purchase_form', $purchase_data ); - - if ( edds_is_zero_decimal_currency() ) { - $amount = $purchase_data['price']; - } else { - $amount = round( $purchase_data['price'] * 100, 0 ); - } - - /** - * We need to unhook some of the Recurring Payments actions here as we're handling captures ourselves. - * - * We're also going to attempt to restrict this to a single subscription and no mixed carts, for the time being. - */ - $cart_contains_subscription = (bool) ( function_exists( 'edd_recurring' ) && edd_recurring()->cart_contains_recurring() ); - - if ( $cart_contains_subscription ) { - if ( count( edd_get_cart_contents() ) > 1 || edd_recurring()->cart_is_mixed() ) { - throw new \EDD_Stripe_Gateway_Exception( edds_get_single_subscription_cart_error() ); - } - - if ( edd_recurring()->cart_has_free_trial() ) { - $amount = 0; - } - - global $edd_recurring_stripe; - remove_filter( 'edds_create_payment_intent_args', array( $edd_recurring_stripe, 'create_payment_intent_args' ), 10, 2 ); - } - - $existing_intent = false; - $customer = false; - - if ( ! empty( $_REQUEST['intent_id'] ) && ! empty( $_REQUEST['intent_fingerprint'] ) ) { - $intent = edds_api_request( $_REQUEST['intent_type'], 'retrieve', $_REQUEST['intent_id'] ); - if ( ! empty( $intent->customer ) ) { - $existing_intent = true; - $customer = edds_get_stripe_customer( $intent->customer, array() ); - } - } - - // We didn't have a customer on the existing intent. Make a new one. - if ( empty( $customer ) ) { - // Retrieves or creates a Stripe Customer. - $customer = edds_checkout_setup_customer( $purchase_data ); - } - - if ( ! $customer ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Unable to create customer. Please try again.', - 'easy-digital-downloads' - ) - ); - } - - /** - * Allows processing before an Intent is created, but - * after a \Stripe\Customer is available. - * - * @since 2.7.0 - * - * @param array $purchase_data Purchase data. - * @param \Stripe\Customer $customer Stripe Customer object. - */ - do_action( 'edds_process_purchase_form_before_intent', $purchase_data, $customer ); - - // Create a list of {$download_id}_{$price_id}. - $payment_items = array(); - - foreach ( $purchase_data['cart_details'] as $item ) { - $price_id = isset( $item['item_number']['options']['price_id'] ) - ? $item['item_number']['options']['price_id'] - : null; - - $payment_items[] = $item['id'] . ( ! empty( $price_id ) ? ( '_' . $price_id ) : '' ); - } - - // Shared Intent arguments. - $intent_args = array( - 'customer' => $customer->id, - 'metadata' => array( - 'email' => esc_html( $purchase_data['user_info']['email'] ), - 'edd_payment_subtotal' => esc_html( $purchase_data['subtotal'] ), - 'edd_payment_discount' => esc_html( $purchase_data['discount'] ), - 'edd_payment_tax' => esc_html( $purchase_data['tax'] ), - 'edd_payment_tax_rate' => esc_html( $purchase_data['tax_rate'] ), - 'edd_payment_fees' => esc_html( edd_get_cart_fee_total() ), - 'edd_payment_total' => esc_html( $purchase_data['price'] ), - 'edd_payment_items' => esc_html( implode( ', ', $payment_items ) ), - 'zero_decimal_amount' => $amount, - ), - ); - - $payment_method = $_REQUEST['payment_method']; - - // Attach the payment method. - $intent_args['payment_method'] = sanitize_text_field( $payment_method['id'] ); - - // Set to automatic payment methods so any of the supported methods can be used here. - $intent_args['automatic_payment_methods'] = array( 'enabled' => true ); - - // We need the intent type later, so we'll set it here. - $intent_type = ( edds_is_preapprove_enabled() || 0 === $amount ) ? 'SetupIntent' : 'PaymentIntent'; - - // Create a SetupIntent for a non-payment carts. - if ( 'SetupIntent' === $intent_type ) { - $intent_args = array_merge( - array( - 'description' => edds_get_payment_description( $purchase_data['cart_details'] ), - 'usage' => 'off_session', - ), - $intent_args - ); - - /** - * BETA Functionality. - * - * Sending the automatic_payment_methods flag to the SetupIntent is a beta feature that we have to enable via an API version - * - * @link https://stripe.com/docs/payments/defer-intent-creation?type=setup#create-intent - */ - add_action( - 'edds_pre_stripe_api_request', - function() { - \Stripe\Stripe::setApiVersion( '2018-09-24;automatic_payment_methods_beta=v1' ); - }, - 11 - ); - - /** - * Filters the arguments used to create a SetupIntent. - * - * @since 2.7.0 - * - * @param array $intent_args SetupIntent arguments. - * @param array $purchase_data { - * Purchase form data. - * - * } - */ - $intent_args = apply_filters( 'edds_create_setup_intent_args', $intent_args, $purchase_data ); - } else { - $purchase_summary = edds_get_payment_description( $purchase_data['cart_details'] ); - $statement_descriptor = edds_get_statement_descriptor(); - - if ( empty( $statement_descriptor ) ) { - $statement_descriptor = substr( $purchase_summary, 0, 22 ); - } - - $statement_descriptor = apply_filters( 'edds_statement_descriptor', $statement_descriptor, $purchase_data ); - $statement_descriptor = edds_sanitize_statement_descriptor( $statement_descriptor ); - - if ( empty( $statement_descriptor ) ) { - $statement_descriptor = null; - } elseif ( is_numeric( $statement_descriptor ) ) { - $statement_descriptor = edd_get_label_singular() . ' ' . $statement_descriptor; - } - - $intent_args = array_merge( - array( - 'amount' => $amount, - 'currency' => edd_get_currency(), - 'description' => $purchase_summary, - 'statement_descriptor' => $statement_descriptor, - 'setup_future_usage' => 'off_session', - - ), - $intent_args - ); - - $intent_type = 'PaymentIntent'; - - if ( - ! empty( edd_stripe()->connect()->get_connect_id() ) && - true === edds_stripe_connect_account_country_supports_application_fees() - ) { - $intent_args['application_fee_amount'] = round( $amount * 0.02 ); - } - - /** - * Filters the arguments used to create a SetupIntent. - * - * @since 2.7.0 - * - * @param array $intent_args SetupIntent arguments. - * @param array $purchase_data { - * Purchase form data. - * - * } - */ - $intent_args = apply_filters( 'edds_create_payment_intent_args', $intent_args, $purchase_data ); - } - - $new_fingerprint = md5( json_encode( $intent_args ) ); - - // Only update the intent, and process this further if we've made changes to the intent. - if ( ! empty( $_REQUEST['intent_id'] ) && ! empty( $_REQUEST['intent_fingerprint'] ) ) { - if ( hash_equals( $_REQUEST['intent_fingerprint'], $new_fingerprint ) ) { - return wp_send_json_success( array( - 'intent_id' => $intent->id, - 'client_secret' => $intent->client_secret, - 'intent_type' => $intent_type, - 'token' => wp_create_nonce( 'edd-process-checkout' ), - 'intent_fingerprint' => $new_fingerprint, - 'intent_changed' => 0, - ) ); - } - } - - /** - * If purchasing a subscription with a card, we need to add the subscription mandate data. - * - * This will ensure that any cards that require mandates like INR payments or India based cards will correctly add - * the mandates necessary for recurring payments. - * - * We do this after we check for an existing intent ID, because the mandate data will change depending on the 'timestamp'. - */ - if ( 'card' === $payment_method['type'] && true === $cart_contains_subscription ) { - require_once EDDS_PLUGIN_DIR . 'includes/utils/class-edd-stripe-mandates.php'; - $mandates = new EDD_Stripe_Mandates( $purchase_data, $intent_type ); - $mandate_options = $mandates->mandate_options; - - // Add the mandate options to the intent arguments. - $intent_args['payment_method_options']['card']['mandate_options'] = $mandate_options; - } - - if ( ! empty( $existing_intent ) ) { - // Existing intents need to not have the automatic_payment_methods flag set. - if ( ! empty( $intent_args['automatic_payment_methods'] ) ) { - unset( $intent_args['automatic_payment_methods'] ); - } - - edds_api_request( $intent_type, 'update', $intent->id, $intent_args ); - $intent = edds_api_request( $intent_type, 'retrieve', $intent->id ); - } else { - $intent = edds_api_request( $intent_type, 'create', $intent_args ); - } - - /** - * Allows further processing after an Intent is created. - * - * @since 2.7.0 - * - * @param array $purchase_data Purchase data. - * @param \Stripe\PaymentIntent|\Stripe\SetupIntent $intent Created Stripe Intent. - * @param int $payment_id EDD Payment ID. - */ - do_action( 'edds_process_purchase_form', $purchase_data, $intent ); - - return wp_send_json_success( array( - 'intent_id' => $intent->id, - 'client_secret' => $intent->client_secret, - 'intent_type' => $intent_type, - 'token' => wp_create_nonce( 'edd-process-checkout' ), - 'intent_fingerprint' => $new_fingerprint, - 'intent_changed' => 1, - ) ); - - } catch ( \Stripe\Exception\ApiErrorException $e ) { - $error = $e->getJsonBody()['error']; - - // Record error in log. - edd_record_gateway_error( - esc_html__( 'Stripe Error 002', 'easy-digital-downloads' ), - sprintf( - esc_html__( 'There was an error while processing a Stripe payment. Order data: %s', 'easy-digital-downloads' ), - wp_json_encode( $error ) - ), - 0 - ); - - return wp_send_json_error( array( - 'message' => esc_html( - edds_get_localized_error_message( $error['code'], $error['message'] ) - ), - ) ); - - // Catch gateway processing errors. - } catch ( \EDD_Stripe_Gateway_Exception $e ) { - if ( true === $e->hasLogMessage() ) { - edd_record_gateway_error( - esc_html__( 'Stripe Error 003', 'easy-digital-downloads' ), - $e->getLogMessage(), - 0 - ); - } - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - - // Catch any remaining error. - } catch( \Exception $e ) { - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'edd_gateway_stripe', 'edds_process_purchase_form' ); - -/** - * Create an \EDD\Orders\Order. - * - * @since 2.9.0 - */ -function edds_create_and_complete_order() { - // Map and merge serialized `form_data` to $_POST so it's accessible to other functions. - _edds_map_form_data_to_request( $_POST ); - - // Simulate being in an `edd_process_purchase_form()` request. - _edds_fake_process_purchase_step(); - - try { - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Error 1001: An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Rate limit reached during payment creation.' - ); - } - - // This must happen in the Checkout flow, so validate the Checkout nonce. - if ( false === edds_verify() ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Error 1002: An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Nonce verification failed during payment creation.' - ); - } - - $intent_id = isset( $_REQUEST['intent_id'] ) ? $_REQUEST['intent_id'] : ''; - - if ( ! isset( $intent_id ) ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Error 1003: An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to retrieve Intent data during payment creation.' - ); - } - - $purchase_data = edd_get_purchase_session(); - - if ( false === $purchase_data ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Error 1004: An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to retrieve purchase data during payment creation.' - ); - } - - // Ensure Intent has transitioned to the correct status. - if ( 'SetupIntent' === $_REQUEST['intent_type'] ) { - $intent = edds_api_request( 'SetupIntent', 'retrieve', $intent_id ); - } else { - $intent = edds_api_request( 'PaymentIntent', 'retrieve', $intent_id ); - } - - if ( ! in_array( $intent->status, array( 'succeeded', 'requires_capture' ), true ) ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Error 1005: An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Invalid Intent status ' . $intent->status . ' during order creation.' - ); - } - - $order_data = array( - 'price' => $purchase_data['price'], - 'date' => $purchase_data['date'], - 'user_email' => $purchase_data['user_email'], - 'purchase_key' => $purchase_data['purchase_key'], - 'currency' => edd_get_currency(), - 'downloads' => $purchase_data['downloads'], - 'cart_details' => $purchase_data['cart_details'], - 'user_info' => $purchase_data['user_info'], - 'status' => 'pending', - 'gateway' => 'stripe', - ); - - // Ensure $_COOKIE is available without a new HTTP request. - if ( class_exists( 'EDD_Auto_Register' ) ) { - add_action( 'set_logged_in_cookie', 'edds_set_logged_in_cookie_global' ); - add_filter( 'edd_get_option_edd_auto_register_complete_orders_only', '__return_false' ); - } - - // Record the pending order. - $order_id = edd_build_order( $order_data ); - - if ( false === $order_id ) { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Error 1006: An error occurred, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to insert order record.' - ); - } - - // Now get the newly created order. - $order = edd_get_order( $order_id ); - - // Retrieve the relevant Intent. - if ( 'setup_intent' === $intent->object ) { - $order_transaction_id = false; - - $intent = edds_api_request( 'SetupIntent', 'update', $intent->id, array( - 'metadata' => array( - 'edd_payment_id' => $order->id, - ), - ) ); - - edd_add_note( - array( - 'object_id' => $order->id, - 'content' => 'Payment Elements - Stripe SetupIntent ID: ' . $intent->id, - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'object_type' => 'order', - ) - ); - - edd_add_order_meta( - $order->id, - '_edds_stripe_setup_intent_id', - $intent->id - ); - } else { - $intent = edds_api_request( 'PaymentIntent', 'update', $intent->id, array( - 'metadata' => array( - 'edd_payment_id' => $order->id, - ), - ) ); - - edd_add_note( - array( - 'object_id' => $order->id, - 'content' => 'Payment Elements - Stripe PaymentIntent ID: ' . $intent->id, - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'object_type' => 'order', - ) - ); - - edd_add_order_meta( - $order->id, - '_edds_stripe_payment_intent_id', - $intent->id - ); - - // Use Intent ID for temporary transaction ID. - // It will be updated when a charge is available. - $order_transaction_id = edd_add_order_transaction( - array( - 'object_id' => $order->id, - 'object_type' => 'order', - 'transaction_id' => sanitize_text_field( $intent->id ), - 'gateway' => 'stripe', - 'status' => 'pending', - 'total' => $order->total, - ) - ); - } - - // Retrieves or creates a Stripe Customer. - edd_update_order_meta( $order->id, '_edds_stripe_customer_id', $intent->customer ); - - edd_add_note( - array( - 'object_id' => $order->id, - 'content' => 'Stripe Customer ID: ' . $intent->customer, - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'object_type' => 'order', - ) - ); - - // The returned Intent charges might contain a mandate ID, so let's save that and make a note. - if ( ! empty( $intent->charges->data ) ) { - foreach ( $intent->charges->data as $charge ) { - if ( empty( $charge->payment_method_details->card->mandate ) ) { - continue; - } - - $mandate_id = $charge->payment_method_details->card->mandate; - edd_update_order_meta( $order->id, '_edds_stripe_mandate', $mandate_id ); - - edd_add_note( - array( - 'object_id' => $order->id, - 'content' => 'Stripe Mandate ID: ' . $mandate_id, - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'object_type' => 'order', - ) - ); - } - } - - // Attach the \Stripe\Customer ID to the \EDD_Customer meta if one exists. - $edd_customer = new EDD_Customer( $purchase_data['user_email'] ); - - if ( $edd_customer->id > 0 ) { - $edd_customer->update_meta( edd_stripe_get_customer_key(), $intent->customer ); - } - - if ( class_exists( 'EDD_Auto_Register' ) ) { - remove_action( 'set_logged_in_cookie', 'edds_set_logged_in_cookie_global' ); - } - - if ( has_action( 'edds_payment_created' ) ) { - // Load up an EDD Payment record here, in the event there is something hooking into it. - $payment = new EDD_Payment( $order->id ); - - /** - * Allows further processing after a payment is created. - * - * NOTE TO DEVELOPERS: Only hook into one of these complete hooks. Using both will result in - * unexpected double processing. - * - * @since 2.7.0 - * - * @param \EDD_Payment $payment EDD Payment. - * @param \Stripe\PaymentIntent|\Stripe\SetupIntent $intent Created Stripe Intent. - */ - do_action( 'edds_payment_created', $payment, $intent ); - } - - /** - * Allows further processing after a order is created. - * - * Sends back just the Intent ID to avoid needing always retrieve - * the intent in this step, which has been transformed via JSON, - * and is no longer a \Stripe\PaymentIntent - * - * @since 2.9.0 - * - * @param \EDD\Orders\Order $order EDD Order Object. - * @param \Stripe\PaymentIntent|\Stripe\SetupIntent $intent Created Stripe Intent. - */ - do_action( 'edds_order_created', $order, $intent ); - - // Now we need to mark the order as complete. - $final_status = edds_is_preapprove_enabled() ? 'preapproval' : 'complete'; - $updated = edd_update_order_status( $order->id, $final_status ); - - if ( $updated ) { - - if ( 'setup_intent' !== $intent['object'] ) { - $charge_id = sanitize_text_field( current( $intent['charges']['data'] )['id'] ); - - edd_add_note( - array( - 'object_id' => $order->id, - 'content' => 'Stripe Charge ID: ' . $charge_id, - 'user_id' => is_admin() ? get_current_user_id() : 0, - 'object_type' => 'order', - ) - ); - - if ( ! empty( $order_transaction_id ) ) { - edd_update_order_transaction( - $order_transaction_id, - array( - 'transaction_id' => sanitize_text_field( $charge_id ), - ) - ); - } - } - - if ( has_action( 'edds_payment_complete' ) ) { - // Load up an EDD Payment record here, in the event there is something hooking into it. - $payment = new EDD_Payment( $order->id ); - - /** - * Allows further processing after a payment is completed. - * - * Sends back just the Intent ID to avoid needing always retrieve - * the intent in this step, which has been transformed via JSON, - * and is no longer a \Stripe\PaymentIntent - * - * NOTE TO DEVELOPERS: Only hook into one of these complete hooks. Using both will result in - * unexpected double processing. - * - * @since 2.7.0 - * - * @param \EDD_Payment $payment EDD Payment. - * @param string $intent_id Stripe Intent ID. - */ - do_action( 'edds_payment_complete', $payment, $intent['id'] ); - } - - /** - * Allows further processing after a order is completed. - * - * Sends back just the Intent ID to avoid needing always retrieve - * the intent in this step, which has been transformed via JSON, - * and is no longer a \Stripe\PaymentIntent - * - * @since 2.9.0 - * - * @param \EDD\Orders\Order $order The EDD Order object. - * @param string $intent_id Stripe Intent ID. - */ - do_action( 'edds_order_complete', $order, $intent['id'] ); - - // Empty cart. - edd_empty_cart(); - } else { - throw new \EDD_Stripe_Gateway_Exception( - esc_html__( - 'Error 1007: An error occurred completing the order, but your payment may have gone through. Please contact the site administrator.', - 'easy-digital-downloads' - ), - 'Unable to insert order record.' - ); - } - - return wp_send_json_success( array( - 'intent' => $intent, - 'order' => $order, - // Send back a new nonce because the user might have logged in via Auto Register. - 'nonce' => wp_create_nonce( 'edd-process-checkout' ), - ) ); - - // Catch gateway processing errors. - } catch ( \EDD_Stripe_Gateway_Exception $e ) { - // Increase the rate limit count when something goes wrong mid-process. - edd_stripe()->rate_limiting->increment_card_error_count(); - - if ( true === $e->hasLogMessage() ) { - edd_record_gateway_error( - esc_html__( 'Stripe Error', 'easy-digital-downloads' ), - $e->getLogMessage(), - 0 - ); - } - - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - - // Catch any remaining error. - } catch( \Exception $e ) { - return wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'wp_ajax_edds_create_and_complete_order', 'edds_create_and_complete_order' ); -add_action( 'wp_ajax_nopriv_edds_create_and_complete_order', 'edds_create_and_complete_order' ); - -/** - * Uptick the rate limit card error count when a failure happens. - * - * @since 2.9.0 - */ -function edds_payment_elements_rate_limit_tick() { - // Increase the card error count. - edd_stripe()->rate_limiting->increment_card_error_count(); - - wp_send_json_success( - array( - 'is_at_limit' => edd_stripe()->rate_limiting->has_hit_card_error_limit(), - 'message' => edd_stripe()->rate_limiting->get_rate_limit_error_message(), - ) - ); -} -add_action( 'wp_ajax_edds_payment_elements_rate_limit_tick', 'edds_payment_elements_rate_limit_tick' ); -add_action( 'wp_ajax_nopriv_edds_payment_elements_rate_limit_tick', 'edds_payment_elements_rate_limit_tick' ); - -/** - * Generates a description based on the cart details. - * - * @param array $cart_details { - * - * } - * @return string - */ -function edds_get_payment_description( $cart_details ) { - $purchase_summary = ''; - - if ( is_array( $cart_details ) && ! empty( $cart_details ) ) { - foreach( $cart_details as $item ) { - $purchase_summary .= $item['name']; - $price_id = isset( $item['item_number']['options']['price_id'] ) - ? absint( $item['item_number']['options']['price_id'] ) - : false; - - if ( false !== $price_id ) { - $purchase_summary .= ' - ' . edd_get_price_option_name( $item['id'], $item['item_number']['options']['price_id'] ); - } - - $purchase_summary .= ', '; - } - - $purchase_summary = rtrim( $purchase_summary, ', ' ); - } - - // Stripe has a maximum of 999 characters in the charge description. - $purchase_summary = substr( $purchase_summary, 0, 1000 ); - - return html_entity_decode( $purchase_summary, ENT_COMPAT, 'UTF-8' ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/apple-pay.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/apple-pay.php deleted file mode 100644 index 8fae6e68..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/apple-pay.php +++ /dev/null @@ -1,293 +0,0 @@ -' . esc_html__( 'Apple Pay domain verification error.', 'easy-digital-downloads' ) . '
    ' . - edd_get_option( 'stripe_apple_pay_domain_error', '' ) - ); - - $registry->add( - 'apple-pay-' . $_SERVER['HTTP_HOST'], - array( - 'message' => wp_kses( - wpautop( $message ), - array( - 'code' => true, - 'br' => true, - 'strong' => true, - 'p' => true, - 'a' => array( - 'href' => true, - 'rel' => true, - 'target' => true, - ), - ) - ), - 'type' => 'error', - 'dismissible' => true, - ) - ); - } catch( Exception $e ) { - return new WP_Error( 'edds-invalid-notices-registration', esc_html( $e->getMessage() ) ); - }; - - return true; -} -add_action( 'admin_init', 'edds_apple_pay_admin_notices_register', 30 ); - -/** - * Conditionally prints registered notices. - * - * @since 2.8.0 - */ -function edds_apple_pay_admin_notices_print() { - // Current user needs capability to dismiss notices. - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - $registry = edds_get_registry( 'admin-notices' ); - - if ( ! $registry ) { - return; - } - - $notices = new EDD_Stripe_Admin_Notices( $registry ); - - wp_enqueue_script( 'edds-admin-notices' ); - - try { - $error = edd_get_option( 'stripe_apple_pay_domain_error', '' ); - $test_mode = edd_is_test_mode(); - - if ( ! empty( edd_stripe()->connect()->is_connected ) && ! empty( $error ) && false === $test_mode ) { - $notices->output( 'apple-pay-' . $_SERVER['HTTP_HOST'] ); - } - } catch( Exception $e ) {} -} -add_action( 'admin_notices', 'edds_apple_pay_admin_notices_print' ); - -/** - * Returns information associated with the name/location of the domain verification file. - * - * @since 2.8.0 - * - * @return array Domain verification file information. - */ -function edds_apple_pay_get_fileinfo() { - $path = untrailingslashit( $_SERVER['DOCUMENT_ROOT'] ); - $dir = '.well-known'; - $file = 'apple-developer-merchantid-domain-association'; - - return array( - 'path' => $path, - 'dir' => $dir, - 'file' => $file, - 'fullpath' => $path . '/' . $dir . '/' . $file, - ); -} - -/** - * Determines if the current website is setup to use Apple Pay. - * - * @since 2.8.0 - * - * @return bool True if the domain has been verified and the association file exists. - */ -function edds_apple_pay_is_valid() { - return ( - edds_apple_pay_has_domain_verification_file() && - edds_apple_pay_has_domain_verification() - ); -} - -/** - * Determines if the domain verification file already exists. - * - * @since 2.8.0 - * - * @return bool True if the domain verification file exists. - */ -function edds_apple_pay_has_domain_verification_file() { - $fileinfo = edds_apple_pay_get_fileinfo(); - - if ( ! @file_exists( $fileinfo['fullpath'] ) ) { - return false; - } - - return true; -} - -/** - * Determines if the currently verified domain matches the current site. - * - * @since 2.8.0 - * - * @return bool True if the saved verified domain matches the current site. - */ -function edds_apple_pay_has_domain_verification() { - return edd_get_option( 'stripe_prb_apple_pay_domain' ) === $_SERVER['HTTP_HOST']; -} - -/** - * Attempts to create a directory in the server root and copy the domain verification file. - * - * @since 2.8.0 - * - * @throws \Exception If the directory or file cannot be created. - */ -function edds_apple_pay_create_directory_and_move_file() { - $file = edds_apple_pay_has_domain_verification_file(); - - if ( true === $file ) { - return; - } - - $fileinfo = edds_apple_pay_get_fileinfo(); - - // Create directory if it does not exist. - if ( ! file_exists( trailingslashit( $fileinfo['path'] ) . $fileinfo['dir'] ) ) { - if ( ! @mkdir( trailingslashit( $fileinfo['path'] ) . $fileinfo['dir'], 0755 ) ) { // @codingStandardsIgnoreLine - throw new \Exception( __( 'Unable to create domain association folder in domain root.', 'easy-digital-downloads' ) ); - } - } - - // Move file if needed. - if ( ! edds_apple_pay_has_domain_verification_file() ) { - if ( ! @copy( trailingslashit( EDDS_PLUGIN_DIR ) . $fileinfo['file'], $fileinfo['fullpath'] ) ) { // @codingStandardsIgnoreLine - throw new \Exception( __( 'Unable to copy domain association file to domain .well-known directory.', 'easy-digital-downloads' ) ); - } - } -} - -/** - * Checks Apple Pay domain verification if there is an existing error. - * If the domain was added to the Stripe Dashboard clear the error. - * - * @since 2.8.0 - */ -function edds_apple_pay_check_domain() { - if ( empty( edd_stripe()->connect()->is_connected ) ) { - return; - } - - $error = edd_get_option( 'stripe_apple_pay_domain_error', '' ); - - if ( empty( $error ) ) { - return; - } - - try { - $domains = edds_api_request( 'ApplePayDomain', 'all' ); - - foreach ( $domains->autoPagingIterator() as $domain ) { - if ( $domain->domain_name === $_SERVER['HTTP_HOST'] ) { - edd_delete_option( 'stripe_apple_pay_domain_error' ); - edd_update_option( 'stripe_prb_apple_pay_domain', $_SERVER['HTTP_HOST'] ); - break; - } - } - } catch ( \Exception $e ) {} -} -add_action( 'admin_init', 'edds_apple_pay_check_domain', 10 ); - -/** - * Verifies the current domain. - * - * @since 2.8.0 - */ -function edds_apple_pay_verify_domain() { - // If Stripe isn't connected, just return. - if ( empty( edd_stripe()->connect()->is_connected ) ) { - return; - } - - // Payment Request Button is not enabled, and card-elements is used. - $elements_mode = edds_get_elements_mode(); - - if ( 'card-elements' === $elements_mode ) { - if ( function_exists( 'edds_prb_is_enabled' ) && false === edds_prb_is_enabled() ) { - return; - } - } - - // Avoid getting caught in AJAX requests. - if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX ) { - return; - } - - // Must be verified in Live Mode. - if ( true === edd_is_test_mode() ) { - return; - } - - // Current site is a development environment, Apple Pay won't be able to be used, do nothing. - if ( false !== edd_is_dev_environment() ) { - return; - } - - // Current domain matches and the file exists, do nothing. - if ( true === edds_apple_pay_is_valid() ) { - return; - } - - try { - // Create directory and move file if needed. - edds_apple_pay_create_directory_and_move_file(); - - $stripe_connect_account_id = edd_stripe()->connect()->get_connect_id(); - - if ( - empty( $stripe_connect_account_id ) || // If we don't have a stripe connect account ID - ( ! empty( $stripe_connect_account_id ) && empty( edd_get_option( 'stripe_prb_apple_pay_domain') ) ) // Or if we do have a stripe connect account ID, but we haven't registered the domain for Apple Pay - ) { - edds_api_request( - 'ApplePayDomain', - 'create', - array( - 'domain_name' => $_SERVER['HTTP_HOST'], - ) - ); - - edd_update_option( 'stripe_prb_apple_pay_domain', $_SERVER['HTTP_HOST'] ); - - // Set an error that the domain needs to be manually added. - // Using Stripe Connect API keys does not allow this to be done automatically. - } else { - throw new \Exception( - sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ - ( __( 'Please %1$smanually add your domain%2$s %3$s to use Apple Pay.', 'easy-digital-downloads' ) . '
    ' ), - '', - '', - '' . $_SERVER['HTTP_HOST'] . '' - ) - ); - } - } catch ( \Exception $e ) { - // Set error if something went wrong. - edd_update_option( 'stripe_apple_pay_domain_error', $e->getMessage() ); - } -} -add_action( 'admin_init', 'edds_apple_pay_verify_domain', 20 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/buy-now/ajax.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/buy-now/ajax.php deleted file mode 100644 index 1f8366fb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/buy-now/ajax.php +++ /dev/null @@ -1,62 +0,0 @@ - __( 'Unable to add item to cart.', 'easy-digital-downloads' ), - ) ); - } - - $download_id = absint( $data['download_id'] ); - if ( false === edds_verify( 'nonce', 'edd-add-to-cart-' . $download_id ) ) { - return wp_send_json_error( array( - 'message' => __( 'Unable to add item to cart.', 'easy-digital-downloads' ), - ) ); - } - - $args = array( - 'quantity' => absint( $data['quantity'] ), - 'price_id' => null, - ); - - if ( edd_has_variable_prices( $download_id ) ) { - $args['price_id'] = absint( $data['price_id'] ); - } - - // Add individual item. - edd_add_to_cart( $download_id, $args ); - - return wp_send_json_success( array( - 'checkout' => edds_buy_now_checkout(), - ) ); -} -add_action( 'wp_ajax_edds_add_to_cart', 'edds_buy_now_ajax_add_to_cart' ); -add_action( 'wp_ajax_nopriv_edds_add_to_cart', 'edds_buy_now_ajax_add_to_cart' ); - -/** - * Empties the cart on the `edds_buy_now_empty_cart` AJAX action. - * - * @since 2.8.0 - */ -function edds_buy_now_ajax_empty_cart() { - if ( ! empty( EDD()->cart->contents ) ) { - EDD()->cart->empty_cart(); - } - - return wp_send_json_success(); -} -add_action( 'wp_ajax_edds_empty_cart', 'edds_buy_now_ajax_empty_cart' ); -add_action( 'wp_ajax_nopriv_edds_empty_cart', 'edds_buy_now_ajax_empty_cart' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/buy-now/checkout.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/buy-now/checkout.php deleted file mode 100644 index f873c241..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/buy-now/checkout.php +++ /dev/null @@ -1,84 +0,0 @@ - array( - 'error_id' => 'invalid_email', - 'error_message' => __( 'Please enter a valid email address', 'easy-digital-downloads' ) - ), - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/buy-now/functions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/buy-now/functions.php deleted file mode 100644 index c1552331..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/buy-now/functions.php +++ /dev/null @@ -1,59 +0,0 @@ - 'edds-buy-now', - 'title' => __( 'Buy Now', 'easy-digital-downloads' ), - 'class' => array( - 'edds-buy-now-modal', - ), - 'content' => '', - ) ); // WPCS: XSS okay. -} -add_action( 'wp_print_footer_scripts', 'edds_buy_now_modal', 0 ); - -/** - * Outputs a custom "Buy Now"-specific Checkout form. - * - * @since 2.8.0 - */ -function edds_buy_now_checkout() { - $total = (int) edd_get_cart_total(); - - $form_mode = $total > 0 - ? 'payment-mode=stripe' - : 'payment-mode=manual'; - - $form_action = edd_get_checkout_uri( $form_mode ); - $existing_cards = edd_stripe_get_existing_cards( get_current_user_id() ); - - $customer = EDD()->session->get( 'customer' ); - $customer = wp_parse_args( - $customer, - array( - 'email' => '', - ) - ); - - if ( is_user_logged_in() ) { - $user_data = get_userdata( get_current_user_id() ); - - foreach( $customer as $key => $field ) { - if ( 'email' == $key && empty( $field ) ) { - $customer[ $key ] = $user_data->user_email; - } elseif ( empty( $field ) ) { - $customer[ $key ] = $user_data->$key; - } - } - } - - $customer = array_map( 'sanitize_text_field', $customer ); - - remove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 ); - remove_action( 'edd_purchase_form_before_submit', 'edd_checkout_final_total', 999 ); - - // Filter purchase button label. - add_filter( 'edd_get_checkout_button_purchase_label', 'edds_buy_now_checkout_purchase_label' ); - - ob_start(); -?> - -
    -
    - - - -

    - - - - required - - /> -

    - - - 0 ) : ?> - - - - - -
    - style="display: none;" - - > - - -
    - - - - - -
    - - -
    - - - - -
    -
    - - 'stripe_prb_taxes', - 'name' => __( 'Apple Pay/Google Pay', 'easy-digital-downloads' ), - 'type' => 'edds_stripe_prb_taxes', - ), - ); - } else { - $elements_mode = edds_get_elements_mode(); - $prb_settings = array( - array( - 'id' => 'stripe_prb', - 'name' => __( 'Apple Pay/Google Pay', 'easy-digital-downloads' ), - 'desc' => wp_kses( - ( - sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. %3$s Closing anchor tag, do not translate. */ - __( '"Express Checkout" via Apple Pay, Google Pay, or Microsoft Pay digital wallets. By using Apple Pay, you agree to %1$sStripe%3$s and %2$sApple\'s%3$s terms of service.', 'easy-digital-downloads' ), - '', - '', - '' - ) . ( - edd_is_test_mode() - ? '
    ' . __( 'Apple Pay is not available in Test Mode.', 'easy-digital-downloads' ) . ' ' . sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ - __( 'See our %1$sdocumentation%2$s for more information.', 'easy-digital-downloads' ), - '', - '' - ) - : '' - ) - ), - array( - 'br' => true, - 'strong' => true, - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, - ), - ) - ), - 'type' => 'multicheck', - 'options' => array( - 'single' => sprintf( - /* translators: %s Download noun */ - __( 'Single %s', 'easy-digital-downloads' ), - edd_get_label_singular() - ), - 'archive' => sprintf( - /* translators: 1. Download noun; 2. shortcode tag wrapped in span */ - __( '%1$s Archive (includes %2$s shortcode)', 'easy-digital-downloads' ), - edd_get_label_singular(), - '[downloads]' - ), - 'checkout' => __( 'Checkout', 'easy-digital-downloads' ), - ), - 'class' => 'payment-elements' === $elements_mode ? 'edd-hidden card-elements-feature' : 'card-elements-feature', - ), - array( - 'id' => 'stripe_prb_elements_note', - 'name' => __( 'Apple Pay/Google Pay', 'easy-digital-downloads' ), - 'desc' => __( 'Apple Pay and Google Pay support is now provided via the Payment Elements integration.', 'easy-digital-downloads' ), - 'type' => 'descriptive_text', - 'class' => 'payment-elements' === $elements_mode ? 'payment-elements-feature' : 'edd-hidden payment-elements-feature', - ), - - ); - } - - $position = array_search( - 'stripe_use_existing_cards', - array_values( wp_list_pluck( $settings['edd-stripe'], 'id' ) ), - true - ); - - $settings['edd-stripe'] = array_merge( - array_slice( $settings['edd-stripe'], 0, $position + 1 ), - $prb_settings, - array_slice( $settings['edd-stripe'], $position + 1 ) - ); - - return $settings; -} -add_filter( 'edd_settings_gateways', 'edds_prb_add_settings', 20 ); - -/** - * Removes multicheck options and outputs a message about "Express Checkout" incompatibility with taxes. - * - * @since 2.8.7 - */ -function edd_edds_stripe_prb_taxes_callback() { - echo esc_html__( - 'This feature is not available when taxes are enabled.', - 'easy-digital-downloads' - ) . ' '; - - echo wp_kses( - sprintf( - /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ - __( - 'See the %1$sExpress Checkout documentation%2$s for more information.', - 'easy-digital-downloads' - ), - '', - '' - ), - array( - 'a' => array( - 'href' => true, - 'target' => true, - 'rel' => true, - ), - ) - ); -} - -/** - * Force "Payment Request Buttons" to be disabled if taxes are enabled. - * - * @since 2.8.0 - * - * @param mixed $value Setting value. - * @param string $key Setting key. - * @return string Setting value. - */ -function edds_prb_sanitize_setting( $value, $key ) { - if ( 'stripe_prb' === $key && edd_use_taxes() ) { - $value = array(); - } - - return $value; -} -add_filter( 'edd_settings_sanitize_multicheck', 'edds_prb_sanitize_setting', 10, 2 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/ajax.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/ajax.php deleted file mode 100644 index 53c922e7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/ajax.php +++ /dev/null @@ -1,253 +0,0 @@ - $quantity, - 'price_id' => $price_id, - ) ); - - // Refilter guest checkout when the item is added to the cart dynamically. - // This is a duplicate of EDD_Recurring_Gateway::require_login(). - if ( defined( 'EDD_RECURRING_VERSION' ) ) { - $cart_items = edd_get_cart_contents(); - $has_recurring = false; - $auto_register = class_exists( 'EDD_Auto_Register' ); - - if ( ! empty( $cart_items ) ) { - foreach ( $cart_items as $item ) { - if ( ! isset( $item['options']['recurring'] ) ) { - continue; - } - - $has_recurring = true; - } - - if ( $has_recurring && ! $auto_register ) { - add_filter( 'edd_no_guest_checkout', '__return_true' ); - add_filter( 'edd_logged_in_only', '__return_true' ); - } - } - } - } - - try { - $data = array( - // Mark "sub-gateway" for Stripe. This represents the Payment Method - // currently being used. e.g `ideal`, `wepay`, `payment-request`, etc. - // - // This is used to filter field requirements via `edd_pre_process_purchase` hook. - 'edds-gateway' => 'payment-request', - 'edds-prb-context' => $context, - ); - - // Checkout-specific data. - if ( 'checkout' === $context ) { - $form_data = isset( $_POST['form_data'] ) - ? $_POST['form_data'] - : array(); - - // Use the Payment Method's billing details. - $card_name = ( - ! empty( $payment_method['billing_details'] ) && - ! empty( $payment_method['billing_details']['name'] ) - ) - ? $payment_method['billing_details']['name'] - : $name; - - $billing_details = ! empty( $payment_method['billing_details'] ) - ? array( - 'card_name' => $card_name, - 'card_address' => $payment_method['billing_details']['address']['line1'], - 'card_address_2' => $payment_method['billing_details']['address']['line2'], - 'card_city' => $payment_method['billing_details']['address']['city'], - 'card_zip' => $payment_method['billing_details']['address']['postal_code'], - 'billing_country' => $payment_method['billing_details']['address']['country'], - 'card_state' => $payment_method['billing_details']['address']['state'], - ) - : array( - 'card_name' => $card_name, - 'card_address' => '', - 'card_address_2' => '', - 'card_city' => '', - 'card_zip' => '', - 'billing_country' => '', - 'card_state' => '', - ); - - // Add the Payment Request's name as the card name. - $_POST['form_data'] = add_query_arg( - $billing_details, - $form_data - ); - - // Single-download data. - } else { - // Fake checkout form data. - $_POST['form_data'] = http_build_query( - array_merge( - $data, - array( - // Use Email from Payment Request. - 'edd_email' => $email, - - 'edd-user-id' => get_current_user_id(), - 'edd_action' => 'purchase', - 'edd-gateway' => 'stripe', - 'edd_agree_to_terms' => '1', - 'edd_agree_to_privacy_policy' => '1', - 'edd-process-checkout-nonce' => wp_create_nonce( 'edd-process-checkout' ), - ) - ) - ); - } - - $_POST['payment_method_id'] = isset( $payment_method['id'] ) - ? sanitize_text_field( $payment_method['id'] ) - : ''; - - $_POST['payment_method_exists'] = false; - - // Adjust PaymentIntent creation for PRB flow. - add_filter( 'edds_create_payment_intent_args', 'edds_prb_create_payment_intent_args', 20 ); - add_filter( 'edds_create_setup_intent_args', 'edds_prb_create_setup_intent_args', 20 ); - - // This will send a JSON response. - _edds_process_purchase_form(); - } catch ( \Exception $e ) { - wp_send_json_error( array( - 'message' => esc_html( $e->getMessage() ), - ) ); - } -} -add_action( 'wp_ajax_edds_prb_ajax_process_checkout', 'edds_prb_ajax_process_checkout' ); -add_action( 'wp_ajax_nopriv_edds_prb_ajax_process_checkout', 'edds_prb_ajax_process_checkout' ); - -/** - * Filters the arguments used when creating a PaymentIntent while - * using a Payment Request Button. - * - * @since 2.8.0 - * - * @param array $args { - * PaymentIntent arguments. - * - * @link https://stripe.com/docs/api/payment_intents/create - * } - * @return array - */ -function edds_prb_create_payment_intent_args( $args ) { - $args['confirmation_method'] = 'automatic'; - $args['confirm'] = false; - $args['capture_method'] = 'automatic'; - $args['metadata']['edds_prb'] = '1'; - - return $args; -} - -/** - * Filters the arguments used when creating a SetupIntent while - * using a Payment Request Button. - * - * @since 2.8.0 - * - * @param array $args { - * SetupIntent arguments. - * - * @link https://stripe.com/docs/api/setup_intents/create - * } - * @return array - */ -function edds_prb_create_setup_intent_args( $args ) { - $args['confirm'] = false; - $args['metadata']['edds_prb'] = '1'; - - return $args; -} - -/** - * Gathers Payment Request options based on the current context. - * - * @since 2.8.0 - */ -function edds_prb_ajax_get_options() { - $download_id = isset( $_POST['downloadId'] ) - ? intval( $_POST['downloadId'] ) - : 0; - - // Single Download. - if ( ! empty( $download_id ) ) { - $price_id = isset( $_POST['priceId'] ) && 'false' !== $_POST['priceId'] - ? intval( $_POST['priceId'] ) - : false; - - $quantity = isset( $_POST['quantity'] ) - ? intval( $_POST['quantity'] ) - : 1; - - $data = edds_prb_get_download_data( $download_id, $price_id, $quantity ); - - // Handle cart eventually? - } else { - $data = edds_prb_get_cart_data(); - } - - // Country is not valid at this point. - // https://stripe.com/docs/js/payment_request/update - unset( $data['country'] ); - - wp_send_json_success( $data ); -} -add_action( 'wp_ajax_edds_prb_ajax_get_options', 'edds_prb_ajax_get_options' ); -add_action( 'wp_ajax_nopriv_edds_prb_ajax_get_options', 'edds_prb_ajax_get_options' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/checkout.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/checkout.php deleted file mode 100644 index a0b3fd0b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/checkout.php +++ /dev/null @@ -1,377 +0,0 @@ - $gateways[ $default_gateway_id ], - ); - - // Fall back to first gateway in the list. - } else { - if ( function_exists( 'array_key_first' ) ) { - $first_gateway_id = array_key_first( $gateways ); - } else { - $gateway_keys = array_keys( $gateways ); - $first_gateway_id = reset( $gateway_keys ); - } - $default_gateway = array( - $first_gateway_id => $gateways[ $first_gateway_id ], - ); - } - - unset( $gateways[ $default_gateway_id ] ); - - return array_merge( - array( - 'stripe-prb' => array( - 'admin_label' => __( 'Express Checkout (Apple Pay/Google Pay)', 'easy-digital-downloads' ), - 'checkout_label' => __( 'Express Checkout', 'easy-digital-downloads' ), - 'supports' => array(), - ), - ), - $default_gateway, - $gateways - ); -} -add_filter( 'edd_payment_gateways', 'edds_prb_shim_gateways' ); -add_filter( 'edd_enabled_payment_gateways', 'edds_prb_shim_gateways' ); - -/** - * Enables the shimmed `stripe-prb` gateway. - * - * @since 2.8.0 - * - * @param array $gateways Enabled payment gateways. - * @return array - */ -function edds_prb_enable_shim_gateway( $gateways ) { - // Do nothing in admin. - if ( is_admin() ) { - return $gateways; - } - - // Avoid endless loops when checking if the Stripe gateway is active. - remove_filter( 'edd_get_option_gateways', 'edds_prb_enable_shim_gateway' ); - - $enabled = true; - - // Do nothing if Payment Requests are not enabled. - if ( false === edds_prb_is_enabled( 'checkout' ) ) { - $enabled = false; - } - - // Avoid endless loops when checking if the Stripe gateway is active. - add_filter( 'edd_get_option_gateways', 'edds_prb_enable_shim_gateway' ); - - if ( false === $enabled ) { - return $gateways; - } - - $gateways['stripe-prb'] = 1; - - return $gateways; -} -add_filter( 'edd_get_option_gateways', 'edds_prb_enable_shim_gateway' ); - -/** - * Ensures the base `stripe` gateway is used as an ID _only_ when generating - * the hidden `input[name="edd-gateway"]` field. - * - * @since 2.8.0 - */ -function edds_prb_shim_active_gateways() { - add_filter( 'edd_chosen_gateway', 'edds_prb_set_base_gateway' ); - add_filter( 'edd_is_gateway_active', 'edds_prb_is_gateway_active', 10, 2 ); -} -add_action( 'edd_purchase_form_before_submit', 'edds_prb_shim_active_gateways' ); - -/** - * Removes conversion of `stripe-prb` to `stripe` after the `input[name="edd-gateway"]` - * hidden input is generated. - * - * @since 2.8.0 - */ -function edds_prb_unshim_active_gateways() { - remove_filter( 'edd_chosen_gateway', 'edds_prb_set_base_gateway' ); - remove_filter( 'edd_is_gateway_active', 'edds_prb_is_gateway_active', 10, 2 ); -} -add_action( 'edd_purchase_form_after_submit', 'edds_prb_unshim_active_gateways' ); - -/** - * Ensures the "Express Checkout" gateway is considered active if the setting - * is enabled. - * - * @since 2.8.0 - * - * @param bool $active Determines if the gateway is considered active. - * @param string $gateway The gateway ID to check. - * @return bool - */ -function edds_prb_is_gateway_active( $active, $gateway ) { - remove_filter( 'edd_is_gateway_active', 'edds_prb_is_gateway_active', 10, 2 ); - - if ( - 'stripe-prb' === $gateway && - true === edds_prb_is_enabled( 'checkout' ) - ) { - $active = true; - } - - add_filter( 'edd_is_gateway_active', 'edds_prb_is_gateway_active', 10, 2 ); - - return $active; -} - -/** - * Transforms the found active `stripe-prb` Express Checkout gateway back - * to the base `stripe` gateway ID. - * - * @param string $gateway Chosen payment gateway. - * @return string - */ -function edds_prb_set_base_gateway( $gateway ) { - if ( 'stripe-prb' === $gateway ) { - $gateway = 'stripe'; - } - - return $gateway; -} - -/** - * Filters the default gateway. - * - * Sets the Payment Request Button (Express Checkout) as default - * when enabled for the context. - * - * @since 2.8.0 - * - * @param string $default Default gateway. - * @return string - */ -function edds_prb_default_gateway( $default ) { - // Do nothing in admin. - if ( is_admin() ) { - return $default; - } - - // Avoid endless loops when checking if the Stripe gateway is active. - remove_filter( 'edd_default_gateway', 'edds_prb_default_gateway' ); - - $enabled = true; - - // Do nothing if Payment Requests are not enabled. - if ( false === edds_prb_is_enabled( 'checkout' ) ) { - $enabled = false; - } - - // Avoid endless loops when checking if the Stripe gateway is active. - add_filter( 'edd_default_gateway', 'edds_prb_default_gateway' ); - - if ( false === $enabled ) { - return $default; - } - - return 'stripe' === $default - ? 'stripe-prb' - : $default; -} -add_filter( 'edd_default_gateway', 'edds_prb_default_gateway' ); - -/** - * Adds Payment Request-specific overrides when processing a single Download. - * - * Disables all required fields. - * - * @since 2.8.0 - */ -function edds_prb_process_overrides() { - if ( ! isset( $_POST ) ) { - return; - } - - if ( ! isset( $_POST['edds-gateway'] ) ) { - return; - } - - if ( 'payment-request' !== $_POST['edds-gateway'] ) { - return; - } - - if ( 'download' !== $_POST['edds-prb-context'] ) { - return; - } - - // Ensure Billing Address and Name Fields are not required. - add_filter( 'edd_require_billing_address', '__return_false' ); - - // Require email address. - add_filter( 'edd_purchase_form_required_fields', 'edds_prb_purchase_form_required_fields', 9999 ); - - // Remove 3rd party validations. - remove_all_actions( 'edd_checkout_error_checks' ); - remove_all_actions( 'edd_checkout_user_error_checks' ); -} -add_action( 'edd_pre_process_purchase', 'edds_prb_process_overrides' ); - -/** - * Filters the purchase form's required field to only - * require an email address. - * - * @since 2.8.0 - * - * @return array - */ -function edds_prb_purchase_form_required_fields() { - return array( - 'edd_email' => array( - 'error_id' => 'invalid_email', - 'error_message' => __( 'Please enter a valid email address', 'easy-digital-downloads' ) - ), - ); -} - -/** - * Adds a note and metadata to Payments made with a Payment Request Button. - * - * @since 2.8.0 - * - * @param \EDD_Payment $payment EDD Payment. - * @param \Stripe\PaymentIntent|\Stripe\SetupIntent $intent Created Stripe Intent. - */ -function edds_prb_payment_created( $payment, $intent ) { - if ( false === isset( $intent['metadata']['edds_prb'] ) ) { - return; - } - - $payment->update_meta( '_edds_stripe_prb', 1 ); - $payment->add_note( 'Purchase completed with Express Checkout (Apple Pay/Google Pay)' ); -} -add_action( 'edds_payment_created', 'edds_prb_payment_created', 10, 2 ); - -/** - * Creates an empty Credit Card form to ensure core actions are still called. - * - * @since 2.8.0 - */ -function edds_prb_cc_form() { - /* This action is documented in easy-digital-downloads/includes/checkout/template.php */ - do_action( 'edd_before_cc_fields' ); - - /* This action is documented in easy-digital-downloads/includes/checkout/template.php */ - do_action( 'edd_after_cc_fields' ); -} - -/** - * Loads the Payment Request gateway. - * - * This fires before core's callbacks to avoid firing additional - * actions (and therefore creating extra output) when using the Payment Request. - * - * @since 2.8.0 - */ -function edds_prb_load_gateway() { - if ( ! isset( $_POST['nonce'] ) ) { - edd_debug_log( - __( 'Missing nonce when loading the gateway fields. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), - true - ); - } - - if ( isset( $_POST['edd_payment_mode'] ) && isset( $_POST['nonce'] ) ) { - $payment_mode = sanitize_text_field( $_POST['edd_payment_mode'] ); - $nonce = sanitize_text_field( $_POST['nonce'] ); - - $nonce_verified = wp_verify_nonce( $nonce, 'edd-gateway-selected-' . $payment_mode ); - - if ( false !== $nonce_verified ) { - // Load the "Express" gateway. - if ( 'stripe-prb' === $payment_mode ) { - // Remove credit card fields. - remove_action( 'edd_stripe_cc_form', 'edds_credit_card_form' ); - remove_action( 'edd_cc_form', 'edd_get_cc_form' ); - - // Hide "Billing Details" which are populated by the Payment Method. - add_filter( 'edd_require_billing_address', '__return_true' ); - remove_filter( 'edd_purchase_form_required_fields', 'edd_stripe_require_zip_and_country' ); - - remove_action( 'edd_after_cc_fields', 'edd_stripe_zip_and_country', 9 ); - remove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 ); - - // Remove "Update billing address" checkbox. All Payment Requests create - // a new source. - remove_action( 'edd_cc_billing_top', 'edd_stripe_update_billing_address_field', 10 ); - - // Output a Payment Request-specific credit card form (empty). - add_action( 'edd_stripe_cc_form', 'edds_prb_cc_form' ); - - // Swap purchase button with Payment Request button. - add_filter( 'edd_checkout_button_purchase', 'edds_prb_checkout_button_purchase', 10000 ); - - /** - * Allows further adjustments to made before the "Express Checkout" - * gateway is loaded. - * - * @since 2.8.0 - */ - do_action( 'edds_prb_before_purchase_form' ); - } - - /* This action is documented in easy-digital-downloads/includes/checkout/template.php */ - do_action( 'edd_purchase_form' ); - - // Ensure core callbacks are fired. - add_action( 'wp_ajax_edd_load_gateway', 'edd_load_ajax_gateway' ); - add_action( 'wp_ajax_nopriv_edd_load_gateway', 'edd_load_ajax_gateway' ); - } - - exit(); - } -} -add_action( 'wp_ajax_edd_load_gateway', 'edds_prb_load_gateway', 5 ); -add_action( 'wp_ajax_nopriv_edd_load_gateway', 'edds_prb_load_gateway', 5 ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/functions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/functions.php deleted file mode 100644 index df2062bd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/functions.php +++ /dev/null @@ -1,230 +0,0 @@ - 0; - } - - // Passed context is not allowed. Disabled. - if ( 0 === count( array_intersect( $context, $allowed_contexts ) ) ) { - return false; - } - - // Passed context is not enabled in setting. Disabled. - if ( 0 === count( array_intersect( $context, $enabled_contexts ) ) ) { - return false; - } - - // Taxes are enabled. Disabled. - $taxes = edd_use_taxes(); - - if ( true === $taxes ) { - return false; - } - - // Recurring is enabled and a trial is in the cart. Disabled. - // - // Disabling for cart context here to avoid further adjusting the already - // complex filtering of active gateways in checkout.php - if ( - function_exists( 'edd_recurring' ) && - edd_recurring()->cart_has_free_trial() - ) { - return false; - } - - return true; -} - -/** - * Retrieves data for a Payment Request Button for a single Download. - * - * @since 2.8.0 - * - * @param int $download_id Download ID. - * @param false|int $price_id Price ID. Default will be used if not set. Default false. - * @param int $quantity Quantity. Default 1. - * @return array Payment Request Button data. - */ -function edds_prb_get_download_data( $download_id, $price_id = false, $quantity = 1 ) { - $data = array( - 'currency' => strtolower( edd_get_currency() ), - 'country' => strtoupper( edd_get_shop_country() ), - 'total' => array(), - 'display-items' => array(), - ); - - $download = edd_get_download( $download_id ); - - // Return early if no Download can be found. - if ( ! $download ) { - return array(); - } - - // Hacky way to ensure we don't display quantity for Recurring - // downloads. The quantity field is output incorrectly. - // - // https://github.com/easydigitaldownloads/edd-recurring/issues/880 - if ( defined( 'EDD_RECURRING_VERSION' ) ) { - $recurring = false; - - if ( false !== $price_id ) { - $recurring = edd_recurring()->is_price_recurring( $download_id, $price_id ); - } else { - $recurring = edd_recurring()->is_recurring( $download_id ); - } - - if ( true === $recurring ) { - $quantity = 1; - } - } - - // Find price. - $variable_pricing = $download->has_variable_prices(); - $price = 0; - - if ( $variable_pricing ) { - if ( false === $price_id ) { - $price_id = edd_get_default_variable_price( $download_id ); - } - - $prices = $download->prices; - - $price = isset( $prices[ $price_id ] ) - ? $prices[ $price_id ]['amount'] - : false; - - $name = sprintf( - '%1$s - %2$s', - $download->get_name(), - edd_get_price_option_name( $download->ID, $price_id ) - ); - } else { - $price = $download->price; - $name = $download->get_name(); - } - - if ( false === edds_is_zero_decimal_currency() ) { - $price = round( $price * 100 ); - } - - $price = ( $price * $quantity ); - - // Add total. - $data['total'] = array( - 'label' => __( 'Total', 'easy-digital-downloads' ), - 'amount' => $price, - ); - - // Add Display items. - $has_quantity = edd_item_quantities_enabled() && ! edd_download_quantities_disabled( $download_id ); - - $quantity = true === $has_quantity - ? $quantity - : 1; - - $data['display-items'][] = array( - 'label' => sprintf( - '%s%s', - strip_tags( $name ), - /* translators: %d: Quantity.*/ - ( $quantity > 1 ? sprintf( __( ' × %d', 'easy-digital-downloads' ), $quantity ) : '' ) - ), - 'amount' => $price, - ); - - return $data; -} - -/** - * Retrieves data for a Payment Request Button for the cart. - * - * @since 2.8.0 - * - * @return array Payment Request Button data. - */ -function edds_prb_get_cart_data() { - $data = array( - 'currency' => strtolower( edd_get_currency() ), - 'country' => strtoupper( edd_get_shop_country() ), - 'total' => array(), - 'display-items' => array(), - ); - - $total = edd_get_cart_total(); - - if ( false === edds_is_zero_decimal_currency() ) { - $total = round( $total * 100 ); - } - - // Add total. - $data['total'] = array( - 'label' => __( 'Total', 'easy-digital-downloads' ), - 'amount' => $total, - ); - - // Add Display items. - $cart_items = edd_get_cart_contents(); - - foreach ( $cart_items as $key => $item ) { - $has_quantity = edd_item_quantities_enabled() && ! edd_download_quantities_disabled( $item['id'] ); - - $quantity = true === $has_quantity - ? edd_get_cart_item_quantity( $item['id'], $item['options'] ) - : 1; - - $price = edd_get_cart_item_price( $item['id'], $item['options'] ); - - if ( false === edds_is_zero_decimal_currency() ) { - $price = round( $price * 100 ); - } - - $price = ( $price * $quantity ); - - $data['display-items'][] = array( - 'label' => sprintf( - '%s%s', - strip_tags( edd_get_cart_item_name( $item ) ), - ( $quantity > 1 ? sprintf( __( ' × %d', 'easy-digital-downloads' ), $quantity ) : '' ) - ), - 'amount' => $price, - ); - } - - return $data; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/index.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/index.php deleted file mode 100644 index ae121adc..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-methods/payment-request/index.php +++ /dev/null @@ -1,17 +0,0 @@ -has_free_trial( $download_id ) ) { - return; - } - - // ...or if a variable price options has a free trial. - $prices = edd_get_variable_prices( $download_id ); - - if ( ! empty( $prices ) ) { - foreach ( $prices as $price ) { - if ( edd_recurring()->has_free_trial( $download_id, $price['index'] ) ) { - return; - } - } - } - } - - // Don't output if it has been filtered off for any reason. - $enabled = true; - - /** - * Filters the output of Payment Request Button in purchase links. - * - * @since 2.8.0 - * - * @param bool $enabled If the Payment Request Button is enabled. - * @param int $download_id Current Download ID. - * @param array $args Purchase link arguments. - */ - $enabled = apply_filters( 'edds_prb_purchase_link_enabled', $enabled, $download_id, $args ); - - if ( true !== $enabled ) { - return; - } - - static $instance_id = 0; - - echo edds_get_prb_markup( - edds_prb_get_download_data( $download_id ), - array( - 'id' => sprintf( - 'edds-prb-download-%d-%d', - $download_id, - $instance_id - ), - 'classes' => array( - 'edds-prb--download', - ), - ) - ); // WPCS: XSS okay. - - // Shim the Checkout processing nonce. - wp_nonce_field( 'edd-process-checkout', 'edd-process-checkout-nonce', false ); - echo edds_get_tokenizer_input( $download_id ); - - $instance_id++; -} -add_action( 'edd_purchase_link_top', 'edds_prb_purchase_link', 20, 2 ); - -/** - * Outputs a Payment Request Button on the Checkout. - * - * @since 2.8.0 - */ -function edds_prb_checkout_button_purchase( $button ) { - // Do nothing if Payment Requests are not enabled. - if ( false === edds_prb_is_enabled( 'checkout' ) ) { - return $button; - } - - $tokenizer = edds_get_tokenizer_input(); - $errors = '
    '; - - $button = edds_get_prb_markup( - edds_prb_get_cart_data(), - array( - 'id' => 'edds-prb-checkout', - 'classes' => array( - 'edds-prb--checkout', - ), - ) - ); - - return $tokenizer . $errors . $button; -} - -/** - * Retrieves HTML used to mount a Payment Request Button. - * - * @since 2.8.0 - * @see edds_prb_get_download_data() - * @link https://stripe.com/docs/js/appendix/payment_item_object - * - * @param PaymentItem[] $data { - * PaymentItems. - * - * @type int $amount The amount in the currency's subunit. - * @type string $label A name the browser shows the customer in the payment interface. - * } - * @param array $args { - * Mount arguments. - * - * @type string $id HTML ID attribute. - * @type array $classes HTML classes. - * } - * @return string - */ -function edds_get_prb_markup( $data, $args = array() ) { - $defaults = array( - 'id' => '', - 'classes' => array(), - ); - - $args = wp_parse_args( $args, $defaults ); - - // ID/Class - $id = $args['id']; - $class = implode( - ' ', - array_merge( - $args['classes'], - array( - 'edds-prb', - ) - ) - ); - - // Data - $_data = array(); - - foreach ( $data as $key => $value ) { - $_data[] = sprintf( - 'data-%s="%s"', - esc_attr( $key ), - esc_attr( is_array( $value ) ? wp_json_encode( $value ) : $value ) - ); - } - - $_data = implode( ' ', $_data ); - - edd_stripe_js( true ); - edd_stripe_css( true ); - - return sprintf( - '
    -
    -
    %4$s
    -
    ', - esc_attr( $id ), - esc_attr( $class ), - $_data, - esc_html_x( 'or', 'payment request button divider', 'easy-digital-downloads' ) - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-receipt.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-receipt.php deleted file mode 100644 index 1d5203b9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/payment-receipt.php +++ /dev/null @@ -1,85 +0,0 @@ -ID ); - } - - $customer_id = $payment->get_meta( '_edds_stripe_customer_id' ); - $payment_intent_id = $payment->get_meta( '_edds_stripe_payment_intent_id' ); - - if ( empty( $customer_id ) || empty( $payment_intent_id ) ) { - return false; - } - - if ( 'preapproval_pending' !== $payment->status ) { - return false; - } - - $payment_intent = edds_api_request( 'PaymentIntent', 'retrieve', $payment_intent_id ); - - // Enqueue core scripts. - add_filter( 'edd_is_checkout', '__return_true' ); - - edd_load_scripts(); - - remove_filter( 'edd_is_checkout', '__return_true' ); - - edd_stripe_js( true ); - edd_stripe_css( true ); -?> - -
    last_payment_error ) && isset( $payment_intent->last_payment_error->payment_method ) ) : ?> - data-payment-method="last_payment_error->payment_method->id ); ?>" - -> -

    Authorize Payment

    -

    - -
    - - -

    - -

    - -
    - - - -
    -
    - - trim( $publishable_key ), - 'isTestMode' => edd_is_test_mode() ? 'true' : 'false', - 'elementsMode' => $elements_mode, - 'is_ajaxed' => edd_is_ajax_enabled() ? 'true' : 'false', - 'currency' => edd_get_currency(), - // @todo Replace with country code derived from Stripe Account information if available. - // @link https://github.com/easydigitaldownloads/edd-stripe/issues/654 - 'country' => edd_get_option( 'base_country', 'US' ), - 'locale' => edds_get_stripe_checkout_locale(), - 'is_zero_decimal' => edds_is_zero_decimal_currency() ? 'true' : 'false', - 'checkout' => edd_get_option( 'stripe_checkout' ) ? 'true' : 'false', - 'store_name' => ! empty( edd_get_option( 'entity_name' ) ) ? edd_get_option( 'entity_name' ) : get_bloginfo( 'name' ), - 'submit_text' => edd_get_option( 'stripe_checkout_button_text', __( 'Next', 'easy-digital-downloads' ) ), - 'image' => edd_get_option( 'stripe_checkout_image' ), - 'zipcode' => edd_get_option( 'stripe_checkout_zip_code', false ) ? 'true' : 'false', - 'billing_address' => edd_get_option( 'stripe_checkout_billing', false ) ? 'true' : 'false', - 'remember_me' => edd_get_option( 'stripe_checkout_remember', false ) ? 'true' : 'false', - 'no_key_error' => __( 'Stripe publishable key missing. Please enter your publishable key in Settings.', 'easy-digital-downloads' ), - 'checkout_required_fields_error' => __( 'Please fill out all required fields to continue your purchase.', 'easy-digital-downloads' ), - 'checkout_agree_to_terms' => __( 'Please agree to the terms to complete your purchase.', 'easy-digital-downloads' ), - 'checkout_agree_to_privacy' => __( 'Please agree to the privacy policy to complete your purchase.', 'easy-digital-downloads' ), - 'generic_error' => __( 'Unable to complete your request. Please try again.', 'easy-digital-downloads' ), - 'prepaid' => edd_get_option( 'stripe_allow_prepaid', false ) ? 'true' : 'false', - 'successPageUri' => edd_get_success_page_uri(), - 'failurePageUri' => edd_get_failed_transaction_uri(), - 'debuggingEnabled' => defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'true' : 'false', - 'formLoadingText' => __( 'Please wait...', 'easy-digital-downloads' ), - 'cartHasSubscription' => function_exists( 'edd_recurring' ) && edd_recurring()->cart_contains_recurring() ? 'true' : 'false', - ); - - $stripe_vars = apply_filters( - 'edd_stripe_js_vars', - $stripe_localized_vars - ); - - wp_localize_script( 'edd-stripe-js', 'edd_stripe_vars', $stripe_vars ); - - } -} -add_action( 'wp_enqueue_scripts', 'edd_stripe_js', 100 ); - -/** - * Conditionally load the Stripe CSS - * - * @param bool $force_load_scripts If we should forece loading the scripts outside of checkout. - */ -function edd_stripe_css( $force_load_scripts = false ) { - if ( false === edds_is_gateway_active() ) { - return; - } - - if ( edd_is_checkout() || $force_load_scripts ) { - $deps = array( 'edd-styles' ); - - if ( ! wp_script_is( 'edd-styles', 'enqueued' ) ) { - $deps = array(); - } - - // We're going to assume Payment Elements needs to load... - $style_src = EDDSTRIPE_PLUGIN_URL . 'assets/css/build/paymentelements.min.css'; - - // But if the user has Card Elements, we need to load that instead. - $elements_mode = edds_get_elements_mode(); - if ( 'card-elements' === $elements_mode ) { - $style_src = EDDSTRIPE_PLUGIN_URL . 'assets/css/build/cardelements.min.css'; - } - - wp_register_style( - 'edd-stripe', - $style_src, - $deps, - EDD_STRIPE_VERSION . '-' . $elements_mode - ); - - wp_enqueue_style( 'edd-stripe' ); - } -} -add_action( 'wp_enqueue_scripts', 'edd_stripe_css', 100 ); - -/** - * Loads the javascript for the Stripe Connect functionality in the settings page. - * - * @param string $hook The current admin page. - */ -function edd_stripe_connect_admin_script( $hook ) { - - if ( 'download_page_edd-settings' !== $hook ) { - return; - } - - edd_stripe_connect_admin_style(); - - wp_enqueue_script( 'edd-stripe-admin-scripts', EDDSTRIPE_PLUGIN_URL . 'assets/js/build/admin.min.js', array( 'jquery' ), EDD_STRIPE_VERSION ); - - $test_key = edd_get_option( 'test_publishable_key' ); - $live_key = edd_get_option( 'live_publishable_key' ); - - wp_localize_script( - 'edd-stripe-admin-scripts', - 'edd_stripe_admin', - array( - 'stripe_enabled' => array_key_exists( 'stripe', edd_get_enabled_payment_gateways() ), - 'test_mode' => (int) edd_is_test_mode(), - 'test_key_exists' => ! empty( $test_key ) ? 'true' : 'false', - 'live_key_exists' => ! empty( $live_key ) ? 'true' : 'false', - 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), - ) - ); -} -add_action( 'admin_enqueue_scripts', 'edd_stripe_connect_admin_script' ); - -/** - * Enqueues the Stripe admin style. - * - * @since 2.9.3 - * - * @return void - */ -function edd_stripe_connect_admin_style() { - wp_enqueue_style( - 'edd-stripe-admin-styles', - EDDSTRIPE_PLUGIN_URL . 'assets/css/build/admin.min.css', - array(), - EDD_STRIPE_VERSION - ); -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/template-functions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/template-functions.php deleted file mode 100644 index da9402fb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/template-functions.php +++ /dev/null @@ -1,916 +0,0 @@ -'; -} -add_action( 'edd_after_cc_fields', 'edds_add_stripe_errors', 999 ); - -/** - * Stripe uses it's own credit card form because the card details are tokenized. - * - * We don't want the name attributes to be present on the fields in order to prevent them from getting posted to the server - * - * @since 1.7.5 - * @return void - */ -function edds_credit_card_form( $echo = true ) { - - if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { - edd_set_error( 'edd_stripe_error_limit', __( 'We are unable to process your payment at this time, please try again later or contact support.', 'easy-digital-downloads' ) ); - return; - } - - ob_start(); ?> - - - - - - - -
    - - - - - - - -
    - - 'lock', - 'width' => 18, - 'height' => 28, - 'classes' => array( - 'edd-icon', - 'edd-icon-lock', - ), - ) - ); - ?> - - -
    - - - - - - -
    > - - -
    - -
    - rate_limiting->has_hit_card_error_limit() ) { - edd_set_error( 'edd_stripe_error_limit', __( 'Adding new payment methods is currently unavailable.', 'easy-digital-downloads' ) ); - edd_print_errors(); - return; - } - - $elements_mode = edds_get_elements_mode(); - if ( 'payment-elements' === $elements_mode ) { - edds_output_payment_elements_form(); - } else { - edds_output_legacy_new_card_form(); - } -} -add_action( 'edd_stripe_new_card_form', 'edd_stripe_new_card_form' ); - -/** - * Add the element for the Stripe Payment Elements to attach to. - * - * @since 2.9.0 - */ -function edds_output_payment_elements_form() { - // Payment Elements needs to not allow checking out with mixed carts or multiple subscriptions. - if ( function_exists( 'edd_recurring' ) ) { - if ( ( count( edd_get_cart_contents() ) > 1 && edd_recurring()->cart_contains_recurring() ) || edd_recurring()->cart_is_mixed() ) { - add_filter( 'edd_checkout_button_purchase', '__return_empty_string', 999 ); - ?> -
    -

    -
    - - -
    - has_regional_support && edd_stripe()->regional_support->requires_card_name ) : ?> -

    - - -

    - -
    -

    -
    - -

    - - - -

    - -
    - - -
    - - - - -
    -
    - -

    -
    - - - -
    -

    - -
    - - -
    -
    - -
    - - -
    -
    -
    - - - - - - -

    - isset( $default_card->address_line1 ) ? $default_card->address_line1 : null, - 'line2' => isset( $default_card->address_line2 ) ? $default_card->address_line2 : null, - 'city' => isset( $default_card->address_city ) ? $default_card->address_city : null, - 'state' => isset( $default_card->address_state ) ? $default_card->address_state : null, - 'zip' => isset( $default_card->address_zip ) ? $default_card->address_zip : null, - 'country' => isset( $default_card->address_country ) ? $default_card->address_country : null, - ); - - $address_fields = array_filter( $address_fields ); - - echo esc_html( implode( ', ', $address_fields ) ); - endif; - ?> -

    - -

    - - -

    - rate_limiting->has_hit_card_error_limit() ) { - edd_set_error( 'edd_stripe_error_limit', __( 'We are unable to process your payment at this time, please try again later or contacts support.', 'easy-digital-downloads' ) ); - return; - } - - // Can't use just edd_is_checkout() because this could happen in an AJAX request. - $is_checkout = edd_is_checkout() || ( isset( $_REQUEST['action'] ) && 'edd_load_gateway' === $_REQUEST['action'] ); - - edd_stripe_css( true ); - $existing_cards = edd_stripe_get_existing_cards( $user_id ); - if ( ! empty( $existing_cards ) ) : ?> -
    - - -
    - - -
    - -
    - -
    -
    - rate_limiting->has_hit_card_error_limit() ) { - edd_set_error( 'edd_stripe_error_limit', __( 'Payment method management is currently unavailable.', 'easy-digital-downloads' ) ); - edd_print_errors(); - return; - } - - $existing_cards = edd_stripe_get_existing_cards( get_current_user_id() ); - - edd_stripe_css( true ); - edd_stripe_js( true ); - $display = edd_get_option( 'stripe_billing_fields', 'full' ); -?> -
    -
    - - - - - -
    - - ' . esc_html( $source->brand ) . '', - '' . esc_html( $source->last4 ) . '' - ), - array( - 'span' => array( - 'class' => true, - ), - ) - ); - ?> - - - - - - - - - : exp_month; ?>/exp_year; ?> - - isset( $source->address_line1 ) ? $source->address_line1 : '', - 'zip' => isset( $source->address_zip ) ? $source->address_zip : '', - 'country' => isset( $source->address_country ) ? $source->address_country : '', - ); - - echo esc_html( implode( ' ', $address_fields ) ); - ?> - - - - - - - - - - | - - - - - | - - - - - - - - -
    - - -
    -

    - html->text( array( - 'id' => sprintf( 'edds_address_line1_%1$s', $source->id ), - 'value' => sanitize_text_field( isset( $source->address_line1 ) ? $source->address_line1 : '' ), - 'label' => esc_html__( 'Address Line 1', 'easy-digital-downloads' ), - 'name' => 'address_line1', - 'class' => 'card-update-field address_line1 text edd-input', - 'data' => array( - 'key' => 'address_line1', - ) - ) ); - ?> -

    -

    - html->text( array( - 'id' => sprintf( 'edds_address_line2_%1$s', $source->id ), - 'value' => sanitize_text_field( isset( $source->address_line2 ) ? $source->address_line2 : '' ), - 'label' => esc_html__( 'Address Line 2', 'easy-digital-downloads' ), - 'name' => 'address_line2', - 'class' => 'card-update-field address_line2 text edd-input', - 'data' => array( - 'key' => 'address_line2', - ) - ) ); - ?> -

    -

    - html->text( array( - 'id' => sprintf( 'edds_address_city_%1$s', $source->id ), - 'value' => sanitize_text_field( isset( $source->address_city ) ? $source->address_city : '' ), - 'label' => esc_html__( 'City', 'easy-digital-downloads' ), - 'name' => 'address_city', - 'class' => 'card-update-field address_city text edd-input', - 'data' => array( - 'key' => 'address_city', - ) - ) ); - ?> -

    -

    - html->text( array( - 'id' => sprintf( 'edds_address_zip_%1$s', $source->id ), - 'value' => sanitize_text_field( isset( $source->address_zip ) ? $source->address_zip : '' ), - 'label' => esc_html__( 'ZIP Code', 'easy-digital-downloads' ), - 'name' => 'address_zip', - 'class' => 'card-update-field address_zip text edd-input', - 'data' => array( - 'key' => 'address_zip', - ) - ) ); - ?> -

    -

    - - - address_country ) ? $source->address_country : edd_get_shop_country(); - echo EDD()->html->select( array( - 'id' => sprintf( 'edds_address_country_%1$s', $source->id ), - 'name' => 'address_country', - 'label' => esc_html__( 'Country', 'easy-digital-downloads' ), - 'options' => $countries, - 'selected' => $country, - 'class' => 'card-update-field address_country', - 'data' => array( 'key' => 'address_country' ), - 'show_option_all' => false, - 'show_option_none' => false, - ) ); - ?> -

    - -

    - - - address_state ) ? $source->address_state : edd_get_shop_state(); - $states = edd_get_shop_states( $country ); - echo EDD()->html->select( array( - 'id' => sprintf( 'edds_address_state_%1$s', $source->id ), - 'name' => 'address_state', - 'options' => $states, - 'selected' => $selected_state, - 'class' => 'card-update-field address_state card_state', - 'data' => array( 'key' => 'address_state' ), - 'show_option_all' => false, - 'show_option_none' => false, - ) ); - ?> -

    -
    - -

    - - - html->select( array( - 'id' => sprintf( 'edds_card_exp_month_%1$s', $source->id ), - 'name' => 'exp_month', - 'options' => $months, - 'selected' => $source->exp_month, - 'class' => 'card-expiry-month edd-select edd-select-small card-update-field exp_month', - 'data' => array( 'key' => 'exp_month' ), - 'show_option_all' => false, - 'show_option_none' => false, - ) ); - ?> - - / - - html->select( array( - 'id' => sprintf( 'edds_card_exp_year_%1$s', $source->id ), - 'name' => 'exp_year', - 'options' => $years, - 'selected' => $source->exp_year, - 'class' => 'card-expiry-year edd-select edd-select-small card-update-field exp_year', - 'data' => array( 'key' => 'exp_year' ), - 'show_option_all' => false, - 'show_option_none' => false, - ) ); - ?> -

    - -

    - - - - - - id . '_update', 'card_update_nonce_' . $source->id, true ); - echo edds_get_tokenizer_input( $source->id ); - ?> -

    -
    -
    - - -
    - -
    -
    - - - - -
    -
    -
    -
    - #edd_profile_address_fieldset { display: none; }'; -} -add_action( 'edd_profile_editor_after', 'edd_stripe_maybe_hide_profile_editor_billing_address' ); - -/** - * Zip / Postal Code field for when full billing address is disabled - * - * @since 2.5 - * @return void - */ -function edd_stripe_zip_and_country() { - - $logged_in = is_user_logged_in(); - $customer = EDD()->session->get( 'customer' ); - $customer = wp_parse_args( $customer, array( 'address' => array( - 'line1' => '', - 'line2' => '', - 'city' => '', - 'zip' => '', - 'state' => '', - 'country' => '' - ) ) ); - - $customer['address'] = array_map( 'sanitize_text_field', $customer['address'] ); - - if( $logged_in ) { - $existing_cards = edd_stripe_get_existing_cards( get_current_user_id() ); - if ( empty( $existing_cards ) ) { - - $user_address = edd_get_customer_address( get_current_user_id() ); - - foreach( $customer['address'] as $key => $field ) { - - if ( empty( $field ) && ! empty( $user_address[ $key ] ) ) { - $customer['address'][ $key ] = $user_address[ $key ]; - } else { - $customer['address'][ $key ] = ''; - } - - } - } else { - foreach ( $existing_cards as $card ) { - if ( false === $card['default'] ) { - continue; - } - - $source = $card['source']; - $customer['address'] = array( - 'line1' => $source->address_line1, - 'line2' => $source->address_line2, - 'city' => $source->address_city, - 'zip' => $source->address_zip, - 'state' => $source->address_state, - 'country' => $source->address_country, - ); - } - } - - } -?> -
    - -

    - - - -

    -

    - - - autocomplete="billing postal-code" /> -

    -
    - 0 ) { - return; - } - - $hook = 'payment-elements' === edds_get_elements_mode() || apply_filters( 'edds_address_before_payment', false ) ? 'edd_before_cc_fields' : 'edd_after_cc_fields'; - - if ( edd_use_taxes() ) { - remove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields' ); - add_action( $hook, 'edd_default_cc_address_fields' ); - return; - } - - $display = edd_get_option( 'stripe_billing_fields', 'full' ); - - switch ( $display ) { - - case 'full': - // Make address fields required. - add_filter( 'edd_require_billing_address', '__return_true' ); - remove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields' ); - add_action( $hook, 'edd_default_cc_address_fields' ); - - break; - - case 'zip_country': - remove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 ); - add_action( $hook, 'edd_stripe_zip_and_country', 9 ); - - // Make Zip required. - add_filter( 'edd_purchase_form_required_fields', 'edd_stripe_require_zip_and_country' ); - - break; - - case 'none': - remove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 ); - - break; - - } - -} -add_action( 'init', 'edd_stripe_setup_billing_address_fields', 9 ); - -/** - * Force zip code and country to be required when billing address display is zip only - * - * @access public - * @since 2.5 - * @return array $fields The required fields - */ -function edd_stripe_require_zip_and_country( $fields ) { - - $fields['card_zip'] = array( - 'error_id' => 'invalid_zip_code', - 'error_message' => __( 'Please enter your zip / postal code', 'easy-digital-downloads' ) - ); - - $fields['billing_country'] = array( - 'error_id' => 'invalid_country', - 'error_message' => __( 'Please select your billing country', 'easy-digital-downloads' ) - ); - - return $fields; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/class-edd-stripe-mandates.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/class-edd-stripe-mandates.php deleted file mode 100644 index 75b17239..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/class-edd-stripe-mandates.php +++ /dev/null @@ -1,225 +0,0 @@ -purchase_data = $purchase_data; - $this->intent_type = $intent_type; - - $this->amount = $this->format_amount(); - $this->currency = edd_get_currency(); - $this->reference = $purchase_data['purchase_key']; - - // Generate the interval and interval count. - $this->get_interval_and_count( $purchase_data ); - - // Now that all the data has been determined, generate the mandate options. - $this->generate_mandate_arguments(); - } - - /** - * Formats the amount into a Stripe-friendly format. - * - * @since 2.9.2.2 - * - * @return int The formatted amount. - */ - private function format_amount() { - $amount = $this->purchase_data['price']; - - if ( edds_is_zero_decimal_currency() ) { - return $amount; - } - - return round( $amount * 100, 0 ); - } - - /** - * Gets the interval and interval count for the mandate. - * - * @since 2.9.2.2 - */ - private function get_interval_and_count() { - /** - * Setup intervals based on the Recurring Payment periods. - * - * We use a foreach here, but with Payment Elements, it's only a single subscription, we just - * want to properly itterate on them. - */ - $period = false; - foreach ( $this->purchase_data['downloads'] as $download ) { - - // This is a non-recurring download. Move along. - if ( ! isset( $download['options']['recurring'] ) ) { - continue; - } - - $period = $download['options']['recurring']['period']; - break; - } - - // Setup intervals for the mandate based on the Recurring Payment periods. - switch ( $period ) { - case 'day': - $interval = 'day'; - $interval_count = 1; - break; - case 'week': - $interval = 'week'; - $interval_count = 1; - break; - case 'month': - $interval = 'month'; - $interval_count = 1; - break; - case 'quarter': - $interval = 'month'; - $interval_count = 3; - break; - case 'semi-year': - $interval = 'month'; - $interval_count = 6; - break; - case 'year': - $interval = 'year'; - $interval_count = 1; - break; - default: - $interval = 'sporadic'; - $interval_count = false; - break; - } - - $this->interval = $interval; - - if ( false !== $interval_count ) { - $this->interval_count = $interval_count; - } - } - - /** - * Generates the mandate options for use with an intent. - * - * @since 2.9.2.2 - */ - private function generate_mandate_arguments() { - $mandate_options = array( - 'reference' => $this->reference, - 'amount' => $this->amount, - 'start_date' => current_time( 'timestamp' ), - 'amount_type' => 'maximum', - 'supported_types' => array( 'india' ), - 'interval' => $this->interval, - ); - - if ( false !== $this->interval_count ) { - $mandate_options['interval_count'] = $this->interval_count; - } - - // SetupIntent types require the currency to be passed with the mandate_options. - if ( 'SetupIntent' === $this->intent_type ) { - $mandate_options['currency'] = edd_get_currency(); - } - - /** - * Alllows further customization of the mandate options sent with the intent. - * - * @since 2.9.2.2 - * - * @param array $mandate_options The set of mandate options we've generated. - * @param array $purchase_data The purchase data being processed. - * @param string $intent_type The intent type (either SetupIntent or PaymentIntent). - */ - $mandate_options = apply_filters( 'edds_mandate_options', $mandate_options, $this->purchase_data, $this->intent_type ); - - $this->mandate_options = $mandate_options; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/class-registry.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/class-registry.php deleted file mode 100644 index df2c413b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/class-registry.php +++ /dev/null @@ -1,139 +0,0 @@ -offsetSet( $item_id, $attributes ); - - $result = true; - } else { - $message = sprintf( - 'The attributes were missing when attempting to add the \'%1$s\' %2$s.', - $item_id, - static::$item_error_label - ); - - throw new Exception( $message ); - } - - return $result; - } - - /** - * Removes an item from the registry by ID. - * - * @since 2.6.19 - * - * @param string $item_id Item ID. - */ - public function remove_item( $item_id ) { - if ( $this->offsetExists( $item_id ) ) { - $this->offsetUnset( $item_id ); - } - } - - /** - * Retrieves an item and its associated attributes. - * - * @since 2.6.19 - * - * @throws Exception if the item does not exist. - * - * @param string $item_id Item ID. - * @return array Array of attributes for the item if the item is set, - * otherwise an empty array. - */ - public function get_item( $item_id ) { - $item = array(); - - if ( $this->offsetExists( $item_id ) ) { - $item = $this->offsetGet( $item_id ); - } else { - $message = sprintf( - 'The \'%1$s\' %2$s does not exist.', - $item_id, - static::$item_error_label - ); - - throw new Exception( $message ); - } - - return $item; - } - - /** - * Retrieves registered items. - * - * @since 2.6.19 - * - * @return array The list of registered items. - */ - public function get_items() { - return $this->getArrayCopy(); - } - - /** - * Retrieves the value of a given attribute for a given item. - * - * @since 2.6.19 - * - * @throws Exception if the item does not exist. - * @throws EDD_Stripe_Exceptions_Attribute_Not_Found if the attribute and/or item does not exist. - * - * @param string $key Key of the attribute to retrieve. - * @param string $item_id Collection to retrieve the attribute from. - * @return mixed|null The attribute value if set, otherwise null. - */ - public function get_attribute( $key, $item_id ) { - $attribute = null; - $item = $this->get_item( $item_id ); - - if ( ! empty( $item[ $key ] ) ) { - $attribute = $item[ $key ]; - } else { - throw EDD_Stripe_Utils_Exceptions_Attribute_Not_Found::from_attr( $key, $item_id ); - } - - return $attribute; - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/exceptions/class-attribute-not-found.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/exceptions/class-attribute-not-found.php deleted file mode 100644 index 9194e984..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/exceptions/class-attribute-not-found.php +++ /dev/null @@ -1,40 +0,0 @@ -log_message = $log_message; - } - } - - /** - * Determines if an admin-facing message is set. - * - * @since 2.8.1 - * - * @return bool - */ - public function hasLogMessage() { - return ! empty( $this->log_message ); - } - - /** - * Returns the admin-facing log message. - * - * @since 2.8.1 - * - * @return string - */ - public function getLogMessage() { - if ( false === $this->hasLogMessage() ) { - return ''; - } - - return $this->log_message; - } - -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/exceptions/class-stripe-api-unmet-requirements.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/exceptions/class-stripe-api-unmet-requirements.php deleted file mode 100644 index 21fa1d20..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/utils/exceptions/class-stripe-api-unmet-requirements.php +++ /dev/null @@ -1,18 +0,0 @@ - '', - 'class' => array(), - 'title' => '', - 'content' => '' - ); - - $args = wp_parse_args( $args, $defaults ); - - // ID is required for any Javascript interaction - // and accessibility. - if ( empty( $args['id'] ) ) { - return; - } - - $classnames = implode( ' ', array_map( 'trim', (array) $args['class'] ) ); - - ob_start(); -?> - - -setup_filters(); - } - - /** - * Applies various filters. - */ - protected function setup_filters() { - // Possibly add a message above the address fields if they are required. - add_filter( 'edd_settings_gateways', array( $this, 'add_billing_address_message' ), 30 ); - } - - /** - * Inserts a descriptive text setting prior to the address fields setting if a region requires card address. - * - * @since 2.9.2.2 - * - * @param array $settings The current registered settings. - * - * @return array The settings with the new descriptive text, if necessary. - */ - public function add_billing_address_message( $settings ) { - // The current region does not require card address. - if ( ! $this->requires_card_address ) { - return $settings; - } - - $current_billing_fields_option = edd_get_option( 'stripe_billing_fields' ); - // The current region requires card address, but the billing fields option is set to "full" already. - if ( 'full' === $current_billing_fields_option ) { - return $settings; - } - - $setting = array( - 'id' => 'stripe_billing_address_message', - 'name' => '', - 'desc' => $this->get_billing_fields_message_output(), - 'type' => 'descriptive_text', - 'class' => 'edd-stripe-connect-row', - ); - - $position = array_search( - 'stripe_billing_fields', - array_keys( - $settings['edd-stripe'] - ), - true - ); - - array_splice( - $settings['edd-stripe'], - $position, - 0, - array( - 'stripe_billing_address_message' => $setting, - ) - ); - - return $settings; - } - - /** - * Output a message concerning regions that should collect 'full address' information. - * - * @since 2.9.2.2 - */ - protected function get_billing_fields_message_output() { - ob_start(); - ?> -
    -

    - -

    -
    - country_code = 'IN'; - $this->requires_card_name = true; - $this->requires_card_address = true; - - parent::__construct(); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/webhooks.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/webhooks.php deleted file mode 100644 index 6929a022..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/includes/webhooks.php +++ /dev/null @@ -1,181 +0,0 @@ -id ) ) { - $event = edds_api_request( 'Event', 'retrieve', $event->id ); - } else { - throw new \Exception( esc_html__( 'Unable to find Event', 'easy-digital-downloads' ) ); - } - - // Handle events. - // - switch ( $event->type ) { - - // Charge succeeded. Update EDD Payment address. - case 'charge.succeeded' : - $charge = $event->data->object; - $payment_id = edd_get_purchase_id_by_transaction_id( $charge->id ); - $payment = new EDD_Payment( $payment_id ); - - if ( $payment && $payment->ID > 0 ) { - $payment->address = array( - 'line1' => $charge->billing_details->address->line1, - 'line2' => $charge->billing_details->address->line2, - 'state' => $charge->billing_details->address->state, - 'city' => $charge->billing_details->address->city, - 'zip' => $charge->billing_details->address->postal_code, - 'country' => $charge->billing_details->address->country, - ); - - $payment->save(); - } - - break; - - // Charge refunded. Ensure EDD Payment status is correct. - case 'charge.refunded': - $charge = $event->data->object; - $payment_id = edd_get_purchase_id_by_transaction_id( $charge->id ); - $payment = new EDD_Payment( $payment_id ); - - // This is an uncaptured PaymentIntent, not a true refund. - if ( ! $charge->captured ) { - return; - } - - if ( $payment && $payment->ID > 0 ) { - - // If this was completely refunded, set the status to refunded. - if ( $charge->refunded ) { - $payment->status = 'refunded'; - $payment->save(); - // Translators: The charge ID from Stripe that is being refunded. - $payment->add_note( sprintf( __( 'Charge %s has been fully refunded in Stripe.', 'easy-digital-downloads' ), $charge->id ) ); - - // If this was partially refunded, don't change the status. - } else { - // Translators: The charge ID from Stripe that is being partially refunded. - $payment->add_note( sprintf( __( 'Charge %s partially refunded in Stripe.', 'easy-digital-downloads' ), $charge->id ) ); - } - } - - break; - - // Review started. - case 'review.opened' : - $is_live = ! edd_is_test_mode(); - $review = $event->data->object; - - // Make sure the modes match. - if ( $is_live !== $review->livemode ) { - return; - } - - $charge = $review->charge; - - // Get the charge from the PaymentIntent. - if ( ! $charge ) { - $payment_intent = $review->payment_intent; - - if ( ! $payment_intent ) { - return; - } - - $payment_intent = edds_api_request( 'PaymentIntent', 'retrieve', $payment_intent ); - $charge = $payment_intent->charges->data[0]->id; - } - - $payment_id = edd_get_purchase_id_by_transaction_id( $charge ); - $payment = new EDD_Payment( $payment_id ); - - if ( $payment && $payment->ID > 0 ) { - $payment->add_note( - sprintf( - /* translators: %s Stripe Radar review opening reason. */ - __( 'Stripe Radar review opened with a reason of %s.', 'easy-digital-downloads' ), - $review->reason - ) - ); - $payment->save(); - - do_action( 'edd_stripe_review_opened', $review, $payment_id ); - } - - break; - - // Review closed. - case 'review.closed' : - $is_live = ! edd_is_test_mode(); - $review = $event->data->object; - - // Make sure the modes match - if ( $is_live !== $review->livemode ) { - return; - } - - $charge = $review->charge; - - // Get the charge from the PaymentIntent. - if ( ! $charge ) { - $payment_intent = $review->payment_intent; - - if ( ! $payment_intent ) { - return; - } - - $payment_intent = edds_api_request( 'PaymentIntent', 'retrieve', $payment_intent ); - $charge = $payment_intent->charges->data[0]->id; - } - - $payment_id = edd_get_purchase_id_by_transaction_id( $charge ); - $payment = new EDD_Payment( $payment_id ); - - if ( $payment && $payment->ID > 0 ) { - $payment->add_note( - sprintf( - /* translators: %s Stripe Radar review closing reason. */ - __( 'Stripe Radar review closed with a reason of %s.', 'easy-digital-downloads' ), - $review->reason - ) - ); - $payment->save(); - - do_action( 'edd_stripe_review_closed', $review, $payment_id ); - } - - break; - } - - do_action( 'edds_stripe_event_' . $event->type, $event ); - - // Nothing failed, mark complete. - status_header( 200 ); - die( esc_html( 'EDD Stripe: ' . $event->type ) ); - - // Fail, allow a retry. - } catch ( \Exception $e ) { - status_header( 500 ); - die( '-2' ); - } -} -add_action( 'init', 'edds_stripe_event_listener' ); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/autoload.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/autoload.php deleted file mode 100644 index 9cbc7f3f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/autoload.php +++ /dev/null @@ -1,25 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - /** @var \Closure(string):void */ - private static $includeFile; - - /** @var ?string */ - private $vendorDir; - - // PSR-4 - /** - * @var array[] - * @psalm-var array> - */ - private $prefixLengthsPsr4 = array(); - /** - * @var array[] - * @psalm-var array> - */ - private $prefixDirsPsr4 = array(); - /** - * @var array[] - * @psalm-var array - */ - private $fallbackDirsPsr4 = array(); - - // PSR-0 - /** - * @var array[] - * @psalm-var array> - */ - private $prefixesPsr0 = array(); - /** - * @var array[] - * @psalm-var array - */ - private $fallbackDirsPsr0 = array(); - - /** @var bool */ - private $useIncludePath = false; - - /** - * @var string[] - * @psalm-var array - */ - private $classMap = array(); - - /** @var bool */ - private $classMapAuthoritative = false; - - /** - * @var bool[] - * @psalm-var array - */ - private $missingClasses = array(); - - /** @var ?string */ - private $apcuPrefix; - - /** - * @var self[] - */ - private static $registeredLoaders = array(); - - /** - * @param ?string $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); - } - - /** - * @return string[] - */ - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - /** - * @return array[] - * @psalm-return array> - */ - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - /** - * @return array[] - * @psalm-return array - */ - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - /** - * @return array[] - * @psalm-return array - */ - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - /** - * @return string[] Array of classname => path - * @psalm-return array - */ - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - * - * @return void - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - $includeFile = self::$includeFile; - $includeFile($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. - * - * @return self[] - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } - - /** - * @return void - */ - private static function initializeIncludeClosure() - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = \Closure::bind(static function($file) { - include $file; - }, null, null); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/InstalledVersions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/InstalledVersions.php deleted file mode 100644 index c6b54af7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,352 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints($constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - $installed[] = self::$installed; - - return $installed; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/LICENSE b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/LICENSE deleted file mode 100644 index f27399a0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_classmap.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_classmap.php deleted file mode 100644 index 0fb0a2c1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,10 +0,0 @@ - $vendorDir . '/composer/InstalledVersions.php', -); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_namespaces.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 15a2ff3a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - array($vendorDir . '/stripe/stripe-php/lib'), -); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_real.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_real.php deleted file mode 100644 index 79e59f2b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_real.php +++ /dev/null @@ -1,36 +0,0 @@ -register(true); - - return $loader; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_static.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_static.php deleted file mode 100644 index f8e9bb74..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/autoload_static.php +++ /dev/null @@ -1,36 +0,0 @@ - - array ( - 'Stripe\\' => 7, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Stripe\\' => - array ( - 0 => __DIR__ . '/..' . '/stripe/stripe-php/lib', - ), - ); - - public static $classMap = array ( - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit52360df2f3d60779e5a0ff48f14462b7::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit52360df2f3d60779e5a0ff48f14462b7::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit52360df2f3d60779e5a0ff48f14462b7::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/installed.json b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/installed.json deleted file mode 100644 index 40395c2a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/installed.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "packages": [ - { - "name": "stripe/stripe-php", - "version": "v7.128.0", - "version_normalized": "7.128.0.0", - "source": { - "type": "git", - "url": "https://github.com/stripe/stripe-php.git", - "reference": "c704949c49b72985c76cc61063aa26fefbd2724e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/c704949c49b72985c76cc61063aa26fefbd2724e", - "reference": "c704949c49b72985c76cc61063aa26fefbd2724e", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "3.5.0", - "phpstan/phpstan": "^1.2", - "phpunit/phpunit": "^5.7 || ^9.0", - "squizlabs/php_codesniffer": "^3.3" - }, - "time": "2022-05-05T17:18:02+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Stripe\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Stripe and contributors", - "homepage": "https://github.com/stripe/stripe-php/contributors" - } - ], - "description": "Stripe PHP Library", - "homepage": "https://stripe.com/", - "keywords": [ - "api", - "payment processing", - "stripe" - ], - "support": { - "issues": "https://github.com/stripe/stripe-php/issues", - "source": "https://github.com/stripe/stripe-php/tree/v7.128.0" - }, - "install-path": "../stripe/stripe-php" - } - ], - "dev": false, - "dev-package-names": [] -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/installed.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/installed.php deleted file mode 100644 index 87dd81cb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/composer/installed.php +++ /dev/null @@ -1,32 +0,0 @@ - array( - 'name' => 'easy-digital-downloads/edd-stripe', - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'reference' => '53b4520542b33c13127f604da77f09f7cf9cf902', - 'type' => 'wordpress-plugin', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev' => false, - ), - 'versions' => array( - 'easy-digital-downloads/edd-stripe' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'reference' => '53b4520542b33c13127f604da77f09f7cf9cf902', - 'type' => 'wordpress-plugin', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'stripe/stripe-php' => array( - 'pretty_version' => 'v7.128.0', - 'version' => '7.128.0.0', - 'reference' => 'c704949c49b72985c76cc61063aa26fefbd2724e', - 'type' => 'library', - 'install_path' => __DIR__ . '/../stripe/stripe-php', - 'aliases' => array(), - 'dev_requirement' => false, - ), - ), -); diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/CHANGELOG.md b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/CHANGELOG.md deleted file mode 100644 index fd20f5d8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/CHANGELOG.md +++ /dev/null @@ -1,1648 +0,0 @@ -# Changelog - -## 7.128.0 - 2022-05-05 -* [#1282](https://github.com/stripe/stripe-php/pull/1282) API Updates - * Add support for `default_price` on `Product` - * Add support for `instructions_email` on `Refund` - - -## 7.127.0 - 2022-05-05 -* [#1281](https://github.com/stripe/stripe-php/pull/1281) API Updates - * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session` - -* [#1278](https://github.com/stripe/stripe-php/pull/1278) Pin setup-php action version. -* [#1277](https://github.com/stripe/stripe-php/pull/1277) API Updates - * Add support for `registered_address` on `Person` - -## 7.126.0 - 2022-05-03 -* [#1276](https://github.com/stripe/stripe-php/pull/1276) API Updates - * Add support for new resource `CashBalance` - * Change type of `BillingPortal.Configuration.application` from `$Application` to `deletable($Application)` - * Add support for `cash_balance` on `Customer` - * Add support for `application` on `Invoice`, `Quote`, `SubscriptionSchedule`, and `Subscription` - * Add support for new value `eu_oss_vat` on enum `TaxId.type` -* [#1274](https://github.com/stripe/stripe-php/pull/1274) Fix PHPDoc on Discount for nullable properties -* [#1272](https://github.com/stripe/stripe-php/pull/1272) Allow users to pass a custom IPRESOLVE cURL option. - -## 7.125.0 - 2022-04-21 -* [#1270](https://github.com/stripe/stripe-php/pull/1270) API Updates - * Add support for `expire` test helper method on resource `Refund` - -## 7.124.0 - 2022-04-18 -* [#1265](https://github.com/stripe/stripe-php/pull/1265) API Updates - * Add support for new resources `FundingInstructions` and `Terminal.Configuration` - * Add support for `create_funding_instructions` method on resource `Customer` - * Add support for `amount_details` on `PaymentIntent` - * Add support for `customer_balance` on `PaymentMethod` - * Add support for new value `customer_balance` on enum `PaymentMethod.type` - * Add support for `configuration_overrides` on `Terminal.Location` - - -## 7.123.0 - 2022-04-13 -* [#1263](https://github.com/stripe/stripe-php/pull/1263) API Updates - * Add support for `increment_authorization` method on resource `PaymentIntent` -* [#1262](https://github.com/stripe/stripe-php/pull/1262) Add support for updating the version of the repo -* [#1230](https://github.com/stripe/stripe-php/pull/1230) Add PHPDoc return types -* [#1242](https://github.com/stripe/stripe-php/pull/1242) Fix some PHPDoc in tests - -## 7.122.0 - 2022-04-08 -* [#1261](https://github.com/stripe/stripe-php/pull/1261) API Updates - * Add support for `apply_customer_balance` method on resource `PaymentIntent` -* [#1259](https://github.com/stripe/stripe-php/pull/1259) API Updates - - * Add `payment_intent.partially_funded`, `terminal.reader.action_failed`, and `terminal.reader.action_succeeded` events. - -## 7.121.0 - 2022-03-30 -* [#1258](https://github.com/stripe/stripe-php/pull/1258) API Updates - * Add support for `cancel_action`, `process_payment_intent`, `process_setup_intent`, and `set_reader_display` methods on resource `Terminal.Reader` - * Add support for `action` on `Terminal.Reader` - -## 7.120.0 - 2022-03-29 -* [#1257](https://github.com/stripe/stripe-php/pull/1257) API Updates - * Add support for Search API - * Add support for `search` method on resources `Charge`, `Customer`, `Invoice`, `PaymentIntent`, `Price`, `Product`, and `Subscription` - -## 7.119.0 - 2022-03-25 -* [#1256](https://github.com/stripe/stripe-php/pull/1256) API Updates - * Add support for PayNow and US Bank Accounts Debits payments - * Add support for `paynow` and `us_bank_account` on `PaymentMethod` - * Add support for new values `paynow` and `us_bank_account` on enum `PaymentMethod.type` - * Add support for `failure_balance_transaction` on `Charge` - -## 7.118.0 - 2022-03-23 -* [#1255](https://github.com/stripe/stripe-php/pull/1255) API Updates - * Add support for `cancel` method on resource `Refund` - * Add support for new values `bg_uic`, `hu_tin`, and `si_tin` on enum `TaxId.type` - * Add `test_helpers.test_clock.advancing`, `test_helpers.test_clock.created`, `test_helpers.test_clock.deleted`, `test_helpers.test_clock.internal_failure`, and `test_helpers.test_clock.ready` events. - - -## 7.117.0 - 2022-03-18 -* [#1254](https://github.com/stripe/stripe-php/pull/1254) API Updates - * Add support for `status` on `Card` -* [#1251](https://github.com/stripe/stripe-php/pull/1251) Add support for SearchResult objects. -* [#1249](https://github.com/stripe/stripe-php/pull/1249) Add missing constant for payment_behavior - -## 7.116.0 - 2022-03-02 -* [#1248](https://github.com/stripe/stripe-php/pull/1248) API Updates - * Add support for `proration_details` on `InvoiceLineItem` - - -## 7.115.0 - 2022-03-01 -* [#1245](https://github.com/stripe/stripe-php/pull/1245) [#1247](https://github.com/stripe/stripe-php/pull/1247) API Updates - * Add support for new resource `TestHelpers.TestClock` - * Add support for `test_clock` on `Customer`, `Invoice`, `InvoiceItem`, `Quote`, `Subscription`, and `SubscriptionSchedule` - * Add support for `next_action` on `Refund` - * Add support for `konbini` on `PaymentMethod` -* [#1244](https://github.com/stripe/stripe-php/pull/1244) API Updates - * Add support for new values `bbpos_wisepad3` and `stripe_m2` on enum `Terminal.Reader.device_type` - -## 7.114.0 - 2022-02-15 -* [#1243](https://github.com/stripe/stripe-php/pull/1243) Add test -* [#1240](https://github.com/stripe/stripe-php/pull/1240) API Updates - * Add support for `verify_microdeposits` method on resources `PaymentIntent` and `SetupIntent` -* [#1241](https://github.com/stripe/stripe-php/pull/1241) Add generic parameter to \Stripe\Collection usages - -## 7.113.0 - 2022-02-03 -* [#1239](https://github.com/stripe/stripe-php/pull/1239) API Updates - * Add `REASON_EXPIRED_UNCAPTURED_CHARGE` enum value on `Refund`. - -## 7.112.0 - 2022-01-25 -* [#1235](https://github.com/stripe/stripe-php/pull/1235) API Updates - * Add support for `phone_number_collection` on `PaymentLink` - * Add support for new value `is_vat` on enum `TaxId.type` - - -## 7.111.0 - 2022-01-20 -* [#1233](https://github.com/stripe/stripe-php/pull/1233) API Updates - * Add support for new resource `PaymentLink` - * Add support for `payment_link` on `Checkout.Session` - -## 7.110.0 - 2022-01-13 -* [#1232](https://github.com/stripe/stripe-php/pull/1232) API Updates - * Add support for `paid_out_of_band` on `Invoice` - -## 7.109.0 - 2022-01-12 -* [#1231](https://github.com/stripe/stripe-php/pull/1231) API Updates - * Add support for `customer_creation` on `Checkout.Session` -* [#1227](https://github.com/stripe/stripe-php/pull/1227) Update docs URLs - -## 7.108.0 - 2021-12-22 -* [#1226](https://github.com/stripe/stripe-php/pull/1226) Upgrade php-cs-fixer to 3.4.0. -* [#1222](https://github.com/stripe/stripe-php/pull/1222) API Updates - * Add support for `processing` on `PaymentIntent` -* [#1220](https://github.com/stripe/stripe-php/pull/1220) API Updates - -## 7.107.0 - 2021-12-09 -* [#1219](https://github.com/stripe/stripe-php/pull/1219) API Updates - * Add support for `metadata` on `BillingPortal.Configuration` - * Add support for `wallets` on `Issuing.Card` - -## 7.106.0 - 2021-12-09 -* [#1218](https://github.com/stripe/stripe-php/pull/1218) API Updates - * Add support for new values `ge_vat` and `ua_vat` on enum `TaxId.type` -* [#1216](https://github.com/stripe/stripe-php/pull/1216) Fix namespaced classes in @return PHPDoc. -* [#1214](https://github.com/stripe/stripe-php/pull/1214) Announce PHP8 support in CHANGELOG.md - -## 7.105.0 - 2021-12-06 -* [#1213](https://github.com/stripe/stripe-php/pull/1213) PHP 8.1 missing ReturnTypeWillChange annotations. -* As of this version, PHP 8.1 is officially supported. - -## 7.104.0 - 2021-12-01 -* [#1211](https://github.com/stripe/stripe-php/pull/1211) PHPStan compatibility with PHP8.x -* [#1209](https://github.com/stripe/stripe-php/pull/1209) PHPUnit compatibility with PHP 8.x - -## 7.103.0 - 2021-11-19 -* [#1206](https://github.com/stripe/stripe-php/pull/1206) API Updates - * Add support for new value `jct` on enum `TaxRate.tax_type` - -## 7.102.0 - 2021-11-17 -* [#1205](https://github.com/stripe/stripe-php/pull/1205) API Updates - * Add support for `automatic_payment_methods` on `PaymentIntent` - -## 7.101.0 - 2021-11-16 -* [#1203](https://github.com/stripe/stripe-php/pull/1203) API Updates - * Add support for new resource `ShippingRate` - * Add support for `shipping_options` and `shipping_rate` on `Checkout.Session` - * Add support for `expire` method on resource `Checkout.Session` - * Add support for `status` on `Checkout.Session` - -## 7.100.0 - 2021-10-11 -* [#1190](https://github.com/stripe/stripe-php/pull/1190) API Updates - * Add support for `klarna` on `PaymentMethod`. - -## 7.99.0 - 2021-10-11 -* [#1188](https://github.com/stripe/stripe-php/pull/1188) API Updates - * Add support for `list_payment_methods` method on resource `Customer` - -## 7.98.0 - 2021-10-07 -* [#1187](https://github.com/stripe/stripe-php/pull/1187) API Updates - * Add support for `phone_number_collection` on `Checkout.Session` - * Add support for new value `customer_id` on enum `Radar.ValueList.item_type` - * Add support for new value `bbpos_wisepos_e` on enum `Terminal.Reader.device_type` - -## 7.97.0 - 2021-09-16 -* [#1181](https://github.com/stripe/stripe-php/pull/1181) API Updates - * Add support for `full_name_aliases` on `Person` - -## 7.96.0 - 2021-09-15 -* [#1178](https://github.com/stripe/stripe-php/pull/1178) API Updates - * Add support for livemode on Reporting.ReportType - * Add support for new value `rst` on enum `TaxRate.tax_type` - -## 7.95.0 - 2021-09-01 -* [#1177](https://github.com/stripe/stripe-php/pull/1177) API Updates - * Add support for `future_requirements` on `Account`, `Capability`, and `Person` - * Add support for `after_expiration`, `consent`, `consent_collection`, `expires_at`, and `recovered_from` on `Checkout.Session` - -## 7.94.0 - 2021-08-19 -* [#1173](https://github.com/stripe/stripe-php/pull/1173) API Updates - * Add support for new value `fil` on enum `Checkout.Session.locale` - * Add support for new value `au_arn` on enum `TaxId.type` - -## 7.93.0 - 2021-08-11 -* [#1172](https://github.com/stripe/stripe-php/pull/1172) API Updates - * Add support for `locale` on `BillingPortal.Session` - -* [#1171](https://github.com/stripe/stripe-php/pull/1171) Fix typo in docblock `CurlClient::executeStreamingRequestWithRetries` - -## 7.92.0 - 2021-07-28 -* [#1167](https://github.com/stripe/stripe-php/pull/1167) API Updates - * Add support for `account_type` on `BankAccount` - * Add support for new value `redacted` on enum `Review.closed_reason` - -## 7.91.0 - 2021-07-22 -* [#1164](https://github.com/stripe/stripe-php/pull/1164) API Updates - * Add support for new values `hr`, `ko`, and `vi` on enum `Checkout.Session.locale` - * Add support for `payment_settings` on `Subscription` - -## 7.90.0 - 2021-07-20 -* [#1163](https://github.com/stripe/stripe-php/pull/1163) API Updates - * Add support for `wallet` on `Issuing.Transaction` -* [#1160](https://github.com/stripe/stripe-php/pull/1160) Remove unused API error types from docs. - -## 7.89.0 - 2021-07-14 -* [#1158](https://github.com/stripe/stripe-php/pull/1158) API Updates - * Add support for `list_computed_upfront_line_items` method on resource `Quote` -* [#1157](https://github.com/stripe/stripe-php/pull/1157) Improve readme for old PHP versions - -## 7.88.0 - 2021-07-09 -* [#1152](https://github.com/stripe/stripe-php/pull/1152) API Updates - * Add support for new resource `Quote` - * Add support for `quote` on `Invoice` - * Add support for new value `quote_accept` on enum `Invoice.billing_reason` -* [#1155](https://github.com/stripe/stripe-php/pull/1155) Add streaming methods to Service infra - * Add support for `setStreamingHttpClient` and `streamingHttpClient` to `ApiRequestor` - * Add support for `getStreamingClient` and `requestStream` to `AbstractService` - * Add support for `requestStream` to `BaseStripeClient` - * `\Stripe\RequestOptions::parse` now clones its input if it is already a `RequestOptions` object, to prevent accidental mutation. -* [#1151](https://github.com/stripe/stripe-php/pull/1151) Add `mode` constants into Checkout\Session - -## 7.87.0 - 2021-06-30 -* [#1149](https://github.com/stripe/stripe-php/pull/1149) API Updates - * Add support for `wechat_pay` on `PaymentMethod` -* [#1143](https://github.com/stripe/stripe-php/pull/1143) Streaming requests -* [#1138](https://github.com/stripe/stripe-php/pull/1138) Deprecate travis - -## 7.86.0 - 2021-06-25 -* [#1145](https://github.com/stripe/stripe-php/pull/1145) API Updates - * Add support for `boleto` on `PaymentMethod`. - * Add support for `il_vat` as a member of the `TaxID.Type` enum. - -## 7.85.0 - 2021-06-18 -* [#1142](https://github.com/stripe/stripe-php/pull/1142) API Updates - * Add support for new TaxId types: `ca_pst_mb`, `ca_pst_bc`, `ca_gst_hst`, and `ca_pst_sk`. - -## 7.84.0 - 2021-06-16 -* [#1141](https://github.com/stripe/stripe-php/pull/1141) Update PHPDocs - * Add support for `url` on `Checkout\Session` - - -## 7.83.0 - 2021-06-07 -* [#1140](https://github.com/stripe/stripe-php/pull/1140) API Updates - * Added support for `tax_id_collection` on `Checkout\Session` and `Checkout\Session#create` - * Update `Location` to be expandable on `Terminal\Reader` - -## 7.82.0 - 2021-06-04 -* [#1136](https://github.com/stripe/stripe-php/pull/1136) Update PHPDocs - * Add support for `controller` on `Account`. - -## 7.81.0 - 2021-06-04 -* [#1135](https://github.com/stripe/stripe-php/pull/1135) API Updates - * Add support for new resource `TaxCode` - * Add support for `automatic_tax` `Invoice` and`Checkout.Session`. - * Add support for `tax_behavior` on `Price` - * Add support for `tax_code` on `Product` - * Add support for `tax` on `Customer` - * Add support for `tax_type` enum on `TaxRate` - -## 7.80.0 - 2021-05-26 -* [#1130](https://github.com/stripe/stripe-php/pull/1130) Update PHPDocs - -## 7.79.0 - 2021-05-19 -* [#1126](https://github.com/stripe/stripe-php/pull/1126) API Updates - * Added support for new resource `Identity.VerificationReport` - * Added support for new resource `Identity.VerificationSession` - * `File#list.purpose` and `File.purpose` added new enum members: `identity_document_downloadable` and `selfie`. - -## 7.78.0 - 2021-05-05 -* [#1120](https://github.com/stripe/stripe-php/pull/1120) Update PHPDocs - * Add support for `Radar.EarlyFraudWarning.payment_intent` - -## 7.77.0 - 2021-04-12 -* [#1110](https://github.com/stripe/stripe-php/pull/1110) Update PHPDocs - * Add support for `acss_debit` on `PaymentMethod` - * Add support for `payment_method_options` on `Checkout\Session` -* [#1107](https://github.com/stripe/stripe-php/pull/1107) Remove duplicate object phpdoc - -## 7.76.0 - 2021-03-22 -* [#1100](https://github.com/stripe/stripe-php/pull/1100) Update PHPDocs - * Added support for `amount_shipping` on `Checkout.Session.total_details` -* [#1088](https://github.com/stripe/stripe-php/pull/1088) Make possibility to extend CurlClient - -## 7.75.0 - 2021-02-22 -* [#1094](https://github.com/stripe/stripe-php/pull/1094) Add support for Billing Portal Configuration API - -## 7.74.0 - 2021-02-17 -* [#1093](https://github.com/stripe/stripe-php/pull/1093) Update PHPDocs - * Add support for on_behalf_of to Invoice - -## 7.73.0 - 2021-02-16 -* [#1091](https://github.com/stripe/stripe-php/pull/1091) Update PHPDocs - * Add support for `afterpay_clearpay` on `PaymentMethod`. - -## 7.72.0 - 2021-02-08 -* [#1089](https://github.com/stripe/stripe-php/pull/1089) Update PHPDocs - * Add support for `afterpay_clearpay_payments` on `Account.capabilities` - * Add support for `payment_settings` on `Invoice` - -## 7.71.0 - 2021-02-05 -* [#1087](https://github.com/stripe/stripe-php/pull/1087) Update PHPDocs -* [#1086](https://github.com/stripe/stripe-php/pull/1086) Update CA cert bundle URL - -## 7.70.0 - 2021-02-03 -* [#1085](https://github.com/stripe/stripe-php/pull/1085) Update PHPDocs - * Add support for `nationality` on `Person` - * Add member `gb_vat` of `TaxID` enum - - -## 7.69.0 - 2021-01-21 -* [#1079](https://github.com/stripe/stripe-php/pull/1079) Update PHPDocs - -## 7.68.0 - 2021-01-14 -* [#1063](https://github.com/stripe/stripe-php/pull/1063) Multiple API changes -* [#1061](https://github.com/stripe/stripe-php/pull/1061) Bump phpDocumentor to 3.0.0 - -## 7.67.0 - 2020-12-09 -* [#1060](https://github.com/stripe/stripe-php/pull/1060) Improve PHPDocs for `Discount` -* [#1059](https://github.com/stripe/stripe-php/pull/1059) Upgrade PHPStan to 0.12.59 -* [#1057](https://github.com/stripe/stripe-php/pull/1057) Bump PHP-CS-Fixer and update code - -## 7.66.1 - 2020-12-01 -* [#1054](https://github.com/stripe/stripe-php/pull/1054) Improve error message for invalid keys in StripeClient - -## 7.66.0 - 2020-11-24 -* [#1053](https://github.com/stripe/stripe-php/pull/1053) Update PHPDocs - -## 7.65.0 - 2020-11-19 -* [#1050](https://github.com/stripe/stripe-php/pull/1050) Added constants for `proration_behavior` on `Subscription` - -## 7.64.0 - 2020-11-18 -* [#1049](https://github.com/stripe/stripe-php/pull/1049) Update PHPDocs - -## 7.63.0 - 2020-11-17 -* [#1048](https://github.com/stripe/stripe-php/pull/1048) Update PHPDocs -* [#1046](https://github.com/stripe/stripe-php/pull/1046) Force IPv4 resolving - -## 7.62.0 - 2020-11-09 -* [#1041](https://github.com/stripe/stripe-php/pull/1041) Add missing constants on `Event` -* [#1038](https://github.com/stripe/stripe-php/pull/1038) Update PHPDocs - -## 7.61.0 - 2020-10-20 -* [#1030](https://github.com/stripe/stripe-php/pull/1030) Add support for `jp_rn` and `ru_kpp` as a `type` on `TaxId` - -## 7.60.0 - 2020-10-15 -* [#1027](https://github.com/stripe/stripe-php/pull/1027) Warn if opts are in params - -## 7.58.0 - 2020-10-14 -* [#1026](https://github.com/stripe/stripe-php/pull/1026) Add support for the Payout Reverse API - -## 7.57.0 - 2020-09-29 -* [#1020](https://github.com/stripe/stripe-php/pull/1020) Add support for the `SetupAttempt` resource and List API - -## 7.56.0 - 2020-09-25 -* [#1019](https://github.com/stripe/stripe-php/pull/1019) Update PHPDocs - -## 7.55.0 - 2020-09-24 -* [#1018](https://github.com/stripe/stripe-php/pull/1018) Multiple API changes - * Updated PHPDocs - * Added `TYPE_CONTRIBUTION` as a constant on `BalanceTransaction` - -## 7.54.0 - 2020-09-23 -* [#1017](https://github.com/stripe/stripe-php/pull/1017) Updated PHPDoc - -## 7.53.1 - 2020-09-22 -* [#1015](https://github.com/stripe/stripe-php/pull/1015) Bugfix: don't error on systems with php_uname in disablefunctions with whitespace - -## 7.53.0 - 2020-09-21 -* [#1016](https://github.com/stripe/stripe-php/pull/1016) Updated PHPDocs - -## 7.52.0 - 2020-09-08 -* [#1010](https://github.com/stripe/stripe-php/pull/1010) Update PHPDocs - -## 7.51.0 - 2020-09-02 -* [#1007](https://github.com/stripe/stripe-php/pull/1007) Multiple API changes - * Add support for the Issuing Dispute Submit API - * Add constants for `payment_status` on Checkout `Session` -* [#1003](https://github.com/stripe/stripe-php/pull/1003) Add trim to getSignatures to allow for leading whitespace. - -## 7.50.0 - 2020-08-28 -* [#1005](https://github.com/stripe/stripe-php/pull/1005) Updated PHPDocs - -## 7.49.0 - 2020-08-19 -* [#998](https://github.com/stripe/stripe-php/pull/998) PHPDocs updated - -## 7.48.0 - 2020-08-17 -* [#997](https://github.com/stripe/stripe-php/pull/997) PHPDocs updated -* [#996](https://github.com/stripe/stripe-php/pull/996) Fixing telemetry - -## 7.47.0 - 2020-08-13 -* [#994](https://github.com/stripe/stripe-php/pull/994) Nullable balance_transactions on issuing disputes -* [#991](https://github.com/stripe/stripe-php/pull/991) Fix invalid return types in OAuthService - -## 7.46.1 - 2020-08-07 -* [#990](https://github.com/stripe/stripe-php/pull/990) PHPdoc changes - -## 7.46.0 - 2020-08-05 -* [#989](https://github.com/stripe/stripe-php/pull/989) Add support for the `PromotionCode` resource and APIs - -## 7.45.0 - 2020-07-28 -* [#981](https://github.com/stripe/stripe-php/pull/981) PHPdoc updates - -## 7.44.0 - 2020-07-20 -* [#948](https://github.com/stripe/stripe-php/pull/948) Add `first()` and `last()` functions to `Collection` - -## 7.43.0 - 2020-07-17 -* [#975](https://github.com/stripe/stripe-php/pull/975) Add support for `political_exposure` on `Person` - -## 7.42.0 - 2020-07-15 -* [#974](https://github.com/stripe/stripe-php/pull/974) Add new constants for `purpose` on `File` - -## 7.41.1 - 2020-07-15 -* [#973](https://github.com/stripe/stripe-php/pull/973) Multiple PHPDoc fixes - -## 7.41.0 - 2020-07-14 -* [#971](https://github.com/stripe/stripe-php/pull/971) Adds enum values for `billing_address_collection` on Checkout `Session` - -## 7.40.0 - 2020-07-06 -* [#964](https://github.com/stripe/stripe-php/pull/964) Add OAuthService - -## 7.39.0 - 2020-06-25 -* [#960](https://github.com/stripe/stripe-php/pull/960) Add constants for `payment_behavior` on `Subscription` - -## 7.38.0 - 2020-06-24 -* [#959](https://github.com/stripe/stripe-php/pull/959) Add multiple constants missing for `Event` - -## 7.37.2 - 2020-06-23 -* [#957](https://github.com/stripe/stripe-php/pull/957) Updated PHPDocs - -## 7.37.1 - 2020-06-11 -* [#952](https://github.com/stripe/stripe-php/pull/952) Improve PHPDoc - -## 7.37.0 - 2020-06-09 -* [#950](https://github.com/stripe/stripe-php/pull/950) Add support for `id_npwp` and `my_frp` as `type` on `TaxId` - -## 7.36.2 - 2020-06-03 -* [#946](https://github.com/stripe/stripe-php/pull/946) Update PHPDoc - -## 7.36.1 - 2020-05-28 -* [#938](https://github.com/stripe/stripe-php/pull/938) Remove extra array_keys() call. -* [#942](https://github.com/stripe/stripe-php/pull/942) fix autopagination for service methods - -## 7.36.0 - 2020-05-21 -* [#937](https://github.com/stripe/stripe-php/pull/937) Add support for `ae_trn`, `cl_tin` and `sa_vat` as `type` on `TaxId` - -## 7.35.0 - 2020-05-20 -* [#936](https://github.com/stripe/stripe-php/pull/936) Add `anticipation_repayment` as a `type` on `BalanceTransaction` - -## 7.34.0 - 2020-05-18 -* [#934](https://github.com/stripe/stripe-php/pull/934) Add support for `issuing_dispute` as a `type` on `BalanceTransaction` - -## 7.33.1 - 2020-05-15 -* [#933](https://github.com/stripe/stripe-php/pull/933) Services bugfix: convert nested null params to empty strings - -## 7.33.0 - 2020-05-14 -* [#771](https://github.com/stripe/stripe-php/pull/771) Introduce client/services API. The [migration guide](https://github.com/stripe/stripe-php/wiki/Migration-to-StripeClient-and-services-in-7.33.0) contains before & after examples of the backwards-compatible changes. - -## 7.32.1 - 2020-05-13 -* [#932](https://github.com/stripe/stripe-php/pull/932) Fix multiple PHPDoc - -## 7.32.0 - 2020-05-11 -* [#931](https://github.com/stripe/stripe-php/pull/931) Add support for the `LineItem` resource and APIs - -## 7.31.0 - 2020-05-01 -* [#927](https://github.com/stripe/stripe-php/pull/927) Add support for new tax IDs - -## 7.30.0 - 2020-04-29 -* [#924](https://github.com/stripe/stripe-php/pull/924) Add support for the `Price` resource and APIs - -## 7.29.0 - 2020-04-22 -* [#920](https://github.com/stripe/stripe-php/pull/920) Add support for the `Session` resource and APIs on the `BillingPortal` namespace - -## 7.28.1 - 2020-04-10 -* [#915](https://github.com/stripe/stripe-php/pull/915) Improve PHPdocs for many classes - -## 7.28.0 - 2020-04-03 -* [#912](https://github.com/stripe/stripe-php/pull/912) Preserve backwards compatibility for typoed `TYPE_ADJUSTEMENT` enum. -* [#911](https://github.com/stripe/stripe-php/pull/911) Codegenerated PHPDoc for nested resources -* [#902](https://github.com/stripe/stripe-php/pull/902) Update docstrings for nested resources - -## 7.27.3 - 2020-03-18 -* [#899](https://github.com/stripe/stripe-php/pull/899) Convert keys to strings in `StripeObject::toArray()` - -## 7.27.2 - 2020-03-13 -* [#894](https://github.com/stripe/stripe-php/pull/894) Multiple PHPDocs changes - -## 7.27.1 - 2020-03-03 -* [#890](https://github.com/stripe/stripe-php/pull/890) Update PHPdoc - -## 7.27.0 - 2020-02-28 -* [#889](https://github.com/stripe/stripe-php/pull/889) Add new constants for `type` on `TaxId` - -## 7.26.0 - 2020-02-26 -* [#886](https://github.com/stripe/stripe-php/pull/886) Add support for listing Checkout `Session` -* [#883](https://github.com/stripe/stripe-php/pull/883) Add PHPDoc class descriptions - -## 7.25.0 - 2020-02-14 -* [#879](https://github.com/stripe/stripe-php/pull/879) Make `\Stripe\Collection` implement `\Countable` -* [#875](https://github.com/stripe/stripe-php/pull/875) Last set of PHP-CS-Fixer updates -* [#874](https://github.com/stripe/stripe-php/pull/874) Enable php_unit_internal_class rule -* [#873](https://github.com/stripe/stripe-php/pull/873) Add support for phpDocumentor in Makefile -* [#872](https://github.com/stripe/stripe-php/pull/872) Another batch of PHP-CS-Fixer rule updates -* [#871](https://github.com/stripe/stripe-php/pull/871) Fix a few PHPDoc comments -* [#870](https://github.com/stripe/stripe-php/pull/870) More PHP-CS-Fixer tweaks - -## 7.24.0 - 2020-02-10 -* [#862](https://github.com/stripe/stripe-php/pull/862) Better PHPDoc -* [#865](https://github.com/stripe/stripe-php/pull/865) Get closer to `@PhpCsFixer` standard ruleset - -## 7.23.0 - 2020-02-05 -* [#860](https://github.com/stripe/stripe-php/pull/860) Add PHPDoc types for expandable fields -* [#858](https://github.com/stripe/stripe-php/pull/858) Use `native_function_invocation` PHPStan rule -* [#857](https://github.com/stripe/stripe-php/pull/857) Update PHPDoc on nested resources -* [#855](https://github.com/stripe/stripe-php/pull/855) PHPDoc: `StripeObject` -> `ErrorObject` where appropriate -* [#837](https://github.com/stripe/stripe-php/pull/837) Autogen diff -* [#854](https://github.com/stripe/stripe-php/pull/854) Upgrade PHPStan and fix settings -* [#850](https://github.com/stripe/stripe-php/pull/850) Yet more PHPDoc updates - -## 7.22.0 - 2020-01-31 -* [#849](https://github.com/stripe/stripe-php/pull/849) Add new constants for `type` on `TaxId` -* [#843](https://github.com/stripe/stripe-php/pull/843) Even more PHPDoc fixes -* [#841](https://github.com/stripe/stripe-php/pull/841) More PHPDoc fixes - -## 7.21.1 - 2020-01-29 -* [#840](https://github.com/stripe/stripe-php/pull/840) Update phpdocs across multiple resources. - -## 7.21.0 - 2020-01-28 -* [#839](https://github.com/stripe/stripe-php/pull/839) Add support for `TYPE_ES_CIF` on `TaxId` - -## 7.20.0 - 2020-01-23 -* [#836](https://github.com/stripe/stripe-php/pull/836) Add new type values for `TaxId` - -## 7.19.1 - 2020-01-14 -* [#831](https://github.com/stripe/stripe-php/pull/831) Fix incorrect `UnexpectedValueException` instantiation - -## 7.19.0 - 2020-01-14 -* [#830](https://github.com/stripe/stripe-php/pull/830) Add support for `CreditNoteLineItem` - -## 7.18.0 - 2020-01-13 -* [#829](https://github.com/stripe/stripe-php/pull/829) Don't call php_uname function if disabled by php.ini - -## 7.17.0 - 2020-01-08 -* [#821](https://github.com/stripe/stripe-php/pull/821) Improve PHPDoc types for `ApiErrorException.get/setJsonBody()` methods - -## 7.16.0 - 2020-01-06 -* [#826](https://github.com/stripe/stripe-php/pull/826) Rename remaining `$options` to `$opts` -* [#825](https://github.com/stripe/stripe-php/pull/825) Update PHPDoc - -## 7.15.0 - 2020-01-06 -* [#824](https://github.com/stripe/stripe-php/pull/824) Add constant `TYPE_SG_UEN` to `TaxId` - -## 7.14.2 - 2019-12-04 -* [#816](https://github.com/stripe/stripe-php/pull/816) Disable autoloader when checking for `Throwable` - -## 7.14.1 - 2019-11-26 -* [#812](https://github.com/stripe/stripe-php/pull/812) Fix invalid PHPdoc on `Subscription` - -## 7.14.0 - 2019-11-26 -* [#811](https://github.com/stripe/stripe-php/pull/811) Add support for `CreditNote` preview. - -## 7.13.0 - 2019-11-19 -* [#808](https://github.com/stripe/stripe-php/pull/808) Add support for listing lines on an Invoice directly via `Invoice::allLines()` - -## 7.12.0 - 2019-11-08 - -- [#805](https://github.com/stripe/stripe-php/pull/805) Add Source::allSourceTransactions and SubscriptionItem::allUsageRecordSummaries -- [#798](https://github.com/stripe/stripe-php/pull/798) The argument of `array_key_exists` cannot be `null` -- [#803](https://github.com/stripe/stripe-php/pull/803) Removed unwanted got - -## 7.11.0 - 2019-11-06 - -- [#797](https://github.com/stripe/stripe-php/pull/797) Add support for reverse pagination - -## 7.10.0 - 2019-11-05 - -- [#795](https://github.com/stripe/stripe-php/pull/795) Add support for `Mandate` - -## 7.9.0 - 2019-11-05 - -- [#794](https://github.com/stripe/stripe-php/pull/794) Add PHPDoc to `ApiResponse` -- [#792](https://github.com/stripe/stripe-php/pull/792) Use single quotes for `OBJECT_NAME` constants - -## 7.8.0 - 2019-11-05 - -- [#790](https://github.com/stripe/stripe-php/pull/790) Mark nullable fields in PHPDoc -- [#788](https://github.com/stripe/stripe-php/pull/788) Early codegen fixes -- [#787](https://github.com/stripe/stripe-php/pull/787) Use PHPStan in Travis CI - -## 7.7.1 - 2019-10-25 - -- [#781](https://github.com/stripe/stripe-php/pull/781) Fix telemetry header -- [#780](https://github.com/stripe/stripe-php/pull/780) Contributor Convenant - -## 7.7.0 - 2019-10-23 - -- [#776](https://github.com/stripe/stripe-php/pull/776) Add `CAPABILITY_TRANSFERS` to `Account` -- [#778](https://github.com/stripe/stripe-php/pull/778) Add support for `TYPE_MX_RFC` type on `TaxId` - -## 7.6.0 - 2019-10-22 - -- [#770](https://github.com/stripe/stripe-php/pull/770) Add missing constants for Customer's `TaxId` - -## 7.5.0 - 2019-10-18 - -- [#768](https://github.com/stripe/stripe-php/pull/768) Redact API key in `RequestOptions` debug info - -## 7.4.0 - 2019-10-15 - -- [#764](https://github.com/stripe/stripe-php/pull/764) Add support for HTTP request monitoring callback - -## 7.3.1 - 2019-10-07 - -- [#755](https://github.com/stripe/stripe-php/pull/755) Respect Stripe-Should-Retry and Retry-After headers - -## 7.3.0 - 2019-10-02 - -- [#752](https://github.com/stripe/stripe-php/pull/752) Add `payment_intent.canceled` and `setup_intent.canceled` events -- [#749](https://github.com/stripe/stripe-php/pull/749) Call `toArray()` on objects only - -## 7.2.2 - 2019-09-24 - -- [#746](https://github.com/stripe/stripe-php/pull/746) Add missing decline codes - -## 7.2.1 - 2019-09-23 - -- [#744](https://github.com/stripe/stripe-php/pull/744) Added new PHPDoc - -## 7.2.0 - 2019-09-17 - -- [#738](https://github.com/stripe/stripe-php/pull/738) Added missing constants for `SetupIntent` events - -## 7.1.1 - 2019-09-16 - -- [#737](https://github.com/stripe/stripe-php/pull/737) Added new PHPDoc - -## 7.1.0 - 2019-09-13 - -- [#736](https://github.com/stripe/stripe-php/pull/736) Make `CaseInsensitiveArray` countable and traversable - -## 7.0.2 - 2019-09-06 - -- [#729](https://github.com/stripe/stripe-php/pull/729) Fix usage of `SignatureVerificationException` in PHPDoc blocks - -## 7.0.1 - 2019-09-05 - -- [#728](https://github.com/stripe/stripe-php/pull/728) Clean up Collection - -## 7.0.0 - 2019-09-03 - -Major version release. The [migration guide](https://github.com/stripe/stripe-php/wiki/Migration-guide-for-v7) contains a detailed list of backwards-incompatible changes with upgrade instructions. - -Pull requests included in this release (cf. [#552](https://github.com/stripe/stripe-php/pull/552)) (⚠️ = breaking changes): - -- ⚠️ Drop support for PHP 5.4 ([#551](https://github.com/stripe/stripe-php/pull/551)) -- ⚠️ Drop support for PHP 5.5 ([#554](https://github.com/stripe/stripe-php/pull/554)) -- Bump dependencies ([#553](https://github.com/stripe/stripe-php/pull/553)) -- Remove `CURLFile` check ([#555](https://github.com/stripe/stripe-php/pull/555)) -- Update constant definitions for PHP >= 5.6 ([#556](https://github.com/stripe/stripe-php/pull/556)) -- ⚠️ Remove `FileUpload` alias ([#557](https://github.com/stripe/stripe-php/pull/557)) -- Remove `curl_reset` check ([#570](https://github.com/stripe/stripe-php/pull/570)) -- Use `\Stripe\::class` constant instead of strings ([#643](https://github.com/stripe/stripe-php/pull/643)) -- Use `array_column` to flatten params ([#686](https://github.com/stripe/stripe-php/pull/686)) -- ⚠️ Remove deprecated methods ([#692](https://github.com/stripe/stripe-php/pull/692)) -- ⚠️ Remove `IssuerFraudRecord` ([#696](https://github.com/stripe/stripe-php/pull/696)) -- Update constructors of Stripe exception classes ([#559](https://github.com/stripe/stripe-php/pull/559)) -- Fix remaining TODOs ([#700](https://github.com/stripe/stripe-php/pull/700)) -- Use yield for autopagination ([#703](https://github.com/stripe/stripe-php/pull/703)) -- ⚠️ Rename fake magic methods and rewrite array conversion ([#704](https://github.com/stripe/stripe-php/pull/704)) -- Add `ErrorObject` to Stripe exceptions ([#705](https://github.com/stripe/stripe-php/pull/705)) -- Start using PHP CS Fixer ([#706](https://github.com/stripe/stripe-php/pull/706)) -- Update error messages for nested resource operations ([#708](https://github.com/stripe/stripe-php/pull/708)) -- Upgrade retry logic ([#707](https://github.com/stripe/stripe-php/pull/707)) -- ⚠️ `Collection` improvements / fixes ([#715](https://github.com/stripe/stripe-php/pull/715)) -- ⚠️ Modernize exceptions ([#709](https://github.com/stripe/stripe-php/pull/709)) -- Add constants for error codes ([#716](https://github.com/stripe/stripe-php/pull/716)) -- Update certificate bundle ([#717](https://github.com/stripe/stripe-php/pull/717)) -- Retry requests on a 429 that's a lock timeout ([#718](https://github.com/stripe/stripe-php/pull/718)) -- Fix `toArray()` calls ([#719](https://github.com/stripe/stripe-php/pull/719)) -- Couple of fixes for PHP 7.4 ([#725](https://github.com/stripe/stripe-php/pull/725)) - -## 6.43.1 - 2019-08-29 - -- [#722](https://github.com/stripe/stripe-php/pull/722) Make `LoggerInterface::error` compatible with its PSR-3 counterpart -- [#714](https://github.com/stripe/stripe-php/pull/714) Add `pending_setup_intent` property in `Subscription` -- [#713](https://github.com/stripe/stripe-php/pull/713) Add typehint to `ApiResponse` -- [#712](https://github.com/stripe/stripe-php/pull/712) Fix comment -- [#701](https://github.com/stripe/stripe-php/pull/701) Start testing PHP 7.3 - -## 6.43.0 - 2019-08-09 - -- [#694](https://github.com/stripe/stripe-php/pull/694) Add `SubscriptionItem::createUsageRecord` method - -## 6.42.0 - 2019-08-09 - -- [#688](https://github.com/stripe/stripe-php/pull/688) Remove `SubscriptionScheduleRevision` - - Note that this is technically a breaking change, however we've chosen to release it as a minor version in light of the fact that this resource and its API methods were virtually unused. - -## 6.41.0 - 2019-07-31 - -- [#683](https://github.com/stripe/stripe-php/pull/683) Move the List Balance History API to `/v1/balance_transactions` - -## 6.40.0 - 2019-06-27 - -- [#675](https://github.com/stripe/stripe-php/pull/675) Add support for `SetupIntent` resource and APIs - -## 6.39.2 - 2019-06-26 - -- [#676](https://github.com/stripe/stripe-php/pull/676) Fix exception message in `CustomerBalanceTransaction::update()` - -## 6.39.1 - 2019-06-25 - -- [#674](https://github.com/stripe/stripe-php/pull/674) Add new constants for `collection_method` on `Invoice` - -## 6.39.0 - 2019-06-24 - -- [#673](https://github.com/stripe/stripe-php/pull/673) Enable request latency telemetry by default - -## 6.38.0 - 2019-06-17 - -- [#649](https://github.com/stripe/stripe-php/pull/649) Add support for `CustomerBalanceTransaction` resource and APIs - -## 6.37.2 - 2019-06-17 - -- [#671](https://github.com/stripe/stripe-php/pull/671) Add new PHPDoc -- [#672](https://github.com/stripe/stripe-php/pull/672) Add constants for `submit_type` on Checkout `Session` - -## 6.37.1 - 2019-06-14 - -- [#670](https://github.com/stripe/stripe-php/pull/670) Add new PHPDoc - -## 6.37.0 - 2019-05-23 - -- [#663](https://github.com/stripe/stripe-php/pull/663) Add support for `radar.early_fraud_warning` resource - -## 6.36.0 - 2019-05-22 - -- [#661](https://github.com/stripe/stripe-php/pull/661) Add constants for new TaxId types -- [#662](https://github.com/stripe/stripe-php/pull/662) Add constants for BalanceTransaction types - -## 6.35.2 - 2019-05-20 - -- [#655](https://github.com/stripe/stripe-php/pull/655) Add constants for payment intent statuses -- [#659](https://github.com/stripe/stripe-php/pull/659) Fix PHPDoc for various nested Account actions -- [#660](https://github.com/stripe/stripe-php/pull/660) Fix various PHPDoc - -## 6.35.1 - 2019-05-20 - -- [#658](https://github.com/stripe/stripe-php/pull/658) Use absolute value when checking timestamp tolerance - -## 6.35.0 - 2019-05-14 - -- [#651](https://github.com/stripe/stripe-php/pull/651) Add support for the Capability resource and APIs - -## 6.34.6 - 2019-05-13 - -- [#654](https://github.com/stripe/stripe-php/pull/654) Fix typo in definition of `Event::PAYMENT_METHOD_ATTACHED` constant - -## 6.34.5 - 2019-05-06 - -- [#647](https://github.com/stripe/stripe-php/pull/647) Set the return type to static for more operations - -## 6.34.4 - 2019-05-06 - -- [#650](https://github.com/stripe/stripe-php/pull/650) Add missing constants for Event types - -## 6.34.3 - 2019-05-01 - -- [#644](https://github.com/stripe/stripe-php/pull/644) Update return type to `static` to improve static analysis -- [#645](https://github.com/stripe/stripe-php/pull/645) Fix constant for `payment_intent.payment_failed` - -## 6.34.2 - 2019-04-26 - -- [#642](https://github.com/stripe/stripe-php/pull/642) Fix an issue where existing idempotency keys would be overwritten when using automatic retries - -## 6.34.1 - 2019-04-25 - -- [#640](https://github.com/stripe/stripe-php/pull/640) Add missing phpdocs - -## 6.34.0 - 2019-04-24 - -- [#626](https://github.com/stripe/stripe-php/pull/626) Add support for the `TaxRate` resource and APIs -- [#639](https://github.com/stripe/stripe-php/pull/639) Fix multiple phpdoc issues - -## 6.33.0 - 2019-04-22 - -- [#630](https://github.com/stripe/stripe-php/pull/630) Add support for the `TaxId` resource and APIs - -## 6.32.1 - 2019-04-19 - -- [#636](https://github.com/stripe/stripe-php/pull/636) Correct type of `$personId` in PHPDoc - -## 6.32.0 - 2019-04-18 - -- [#621](https://github.com/stripe/stripe-php/pull/621) Add support for `CreditNote` - -## 6.31.5 - 2019-04-12 - -- [#628](https://github.com/stripe/stripe-php/pull/628) Add constants for `person.*` event types -- [#628](https://github.com/stripe/stripe-php/pull/628) Add missing constants for `Account` and `Person` - -## 6.31.4 - 2019-04-05 - -- [#624](https://github.com/stripe/stripe-php/pull/624) Fix encoding of nested parameters in multipart requests - -## 6.31.3 - 2019-04-02 - -- [#623](https://github.com/stripe/stripe-php/pull/623) Only use HTTP/2 with curl >= 7.60.0 - -## 6.31.2 - 2019-03-25 - -- [#619](https://github.com/stripe/stripe-php/pull/619) Fix PHPDoc return types for list methods for nested resources - -## 6.31.1 - 2019-03-22 - -- [#612](https://github.com/stripe/stripe-php/pull/612) Add a lot of constants -- [#614](https://github.com/stripe/stripe-php/pull/614) Add missing subscription status constants - -## 6.31.0 - 2019-03-18 - -- [#600](https://github.com/stripe/stripe-php/pull/600) Add support for the `PaymentMethod` resource and APIs -- [#606](https://github.com/stripe/stripe-php/pull/606) Add support for retrieving a Checkout `Session` -- [#611](https://github.com/stripe/stripe-php/pull/611) Add support for deleting a Terminal `Location` and `Reader` - -## 6.30.5 - 2019-03-11 - -- [#607](https://github.com/stripe/stripe-php/pull/607) Correctly handle case where a metadata key is called `metadata` - -## 6.30.4 - 2019-02-27 - -- [#602](https://github.com/stripe/stripe-php/pull/602) Add `subscription_schedule` to `Subscription` for PHPDoc. - -## 6.30.3 - 2019-02-26 - -- [#603](https://github.com/stripe/stripe-php/pull/603) Improve PHPDoc on the `Source` object to cover all types of Sources currently supported. - -## 6.30.2 - 2019-02-25 - -- [#601](https://github.com/stripe/stripe-php/pull/601) Fix PHPDoc across multiple resources and add support for new events. - -## 6.30.1 - 2019-02-16 - -- [#599](https://github.com/stripe/stripe-php/pull/599) Fix PHPDoc for `SubscriptionSchedule` and `SubscriptionScheduleRevision` - -## 6.30.0 - 2019-02-12 - -- [#590](https://github.com/stripe/stripe-php/pull/590) Add support for `SubscriptionSchedule` and `SubscriptionScheduleRevision` - -## 6.29.3 - 2019-01-31 - -- [#592](https://github.com/stripe/stripe-php/pull/592) Some more PHPDoc fixes - -## 6.29.2 - 2019-01-31 - -- [#591](https://github.com/stripe/stripe-php/pull/591) Fix PHPDoc for nested resources - -## 6.29.1 - 2019-01-25 - -- [#566](https://github.com/stripe/stripe-php/pull/566) Fix dangling message contents -- [#586](https://github.com/stripe/stripe-php/pull/586) Don't overwrite `CURLOPT_HTTP_VERSION` option - -## 6.29.0 - 2019-01-23 - -- [#579](https://github.com/stripe/stripe-php/pull/579) Rename `CheckoutSession` to `Session` and move it under the `Checkout` namespace. This is a breaking change, but we've reached out to affected merchants and all new merchants would use the new approach. - -## 6.28.1 - 2019-01-21 - -- [#580](https://github.com/stripe/stripe-php/pull/580) Properly serialize `individual` on `Account` objects - -## 6.28.0 - 2019-01-03 - -- [#576](https://github.com/stripe/stripe-php/pull/576) Add support for iterating directly over `Collection` instances - -## 6.27.0 - 2018-12-21 - -- [#571](https://github.com/stripe/stripe-php/pull/571) Add support for the `CheckoutSession` resource - -## 6.26.0 - 2018-12-11 - -- [#568](https://github.com/stripe/stripe-php/pull/568) Enable persistent connections - -## 6.25.0 - 2018-12-10 - -- [#567](https://github.com/stripe/stripe-php/pull/567) Add support for account links - -## 6.24.0 - 2018-11-28 - -- [#562](https://github.com/stripe/stripe-php/pull/562) Add support for the Review resource -- [#564](https://github.com/stripe/stripe-php/pull/564) Add event name constants for subscription schedule aborted/expiring - -## 6.23.0 - 2018-11-27 - -- [#542](https://github.com/stripe/stripe-php/pull/542) Add support for `ValueList` and `ValueListItem` for Radar - -## 6.22.1 - 2018-11-20 - -- [#561](https://github.com/stripe/stripe-php/pull/561) Add cast and some docs to telemetry introduced in 6.22.0/549 - -## 6.22.0 - 2018-11-15 - -- [#549](https://github.com/stripe/stripe-php/pull/549) Add support for client telemetry - -## 6.21.1 - 2018-11-12 - -- [#548](https://github.com/stripe/stripe-php/pull/548) Don't mutate `Exception` class properties from `OAuthBase` error - -## 6.21.0 - 2018-11-08 - -- [#537](https://github.com/stripe/stripe-php/pull/537) Add new API endpoints for the `Invoice` resource. - -## 6.20.1 - 2018-11-07 - -- [#546](https://github.com/stripe/stripe-php/pull/546) Drop files from the Composer package that aren't needed in the release - -## 6.20.0 - 2018-10-30 - -- [#536](https://github.com/stripe/stripe-php/pull/536) Add support for the `Person` resource -- [#541](https://github.com/stripe/stripe-php/pull/541) Add support for the `WebhookEndpoint` resource - -## 6.19.5 - 2018-10-17 - -- [#539](https://github.com/stripe/stripe-php/pull/539) Fix methods on `\Stripe\PaymentIntent` to properly pass arguments to the API. - -## 6.19.4 - 2018-10-11 - -- [#534](https://github.com/stripe/stripe-php/pull/534) Fix PSR-4 autoloading for `\Stripe\FileUpload` class alias - -## 6.19.3 - 2018-10-09 - -- [#530](https://github.com/stripe/stripe-php/pull/530) Add constants for `flow` (`FLOW_*`), `status` (`STATUS_*`) and `usage` (`USAGE_*`) on `\Stripe\Source` - -## 6.19.2 - 2018-10-08 - -- [#531](https://github.com/stripe/stripe-php/pull/531) Store HTTP response headers in case-insensitive array - -## 6.19.1 - 2018-09-25 - -- [#526](https://github.com/stripe/stripe-php/pull/526) Ignore null values in request parameters - -## 6.19.0 - 2018-09-24 - -- [#523](https://github.com/stripe/stripe-php/pull/523) Add support for Stripe Terminal - -## 6.18.0 - 2018-09-24 - -- [#520](https://github.com/stripe/stripe-php/pull/520) Rename `\Stripe\FileUpload` to `\Stripe\File` - -## 6.17.2 - 2018-09-18 - -- [#522](https://github.com/stripe/stripe-php/pull/522) Fix warning when adding a new additional owner to an existing array - -## 6.17.1 - 2018-09-14 - -- [#517](https://github.com/stripe/stripe-php/pull/517) Integer-index encode all sequential arrays - -## 6.17.0 - 2018-09-05 - -- [#514](https://github.com/stripe/stripe-php/pull/514) Add support for reporting resources - -## 6.16.0 - 2018-08-23 - -- [#509](https://github.com/stripe/stripe-php/pull/509) Add support for usage record summaries - -## 6.15.0 - 2018-08-03 - -- [#504](https://github.com/stripe/stripe-php/pull/504) Add cancel support for topups - -## 6.14.0 - 2018-08-02 - -- [#505](https://github.com/stripe/stripe-php/pull/505) Add support for file links - -## 6.13.0 - 2018-07-31 - -- [#502](https://github.com/stripe/stripe-php/pull/502) Add `isDeleted()` method to `\Stripe\StripeObject` - -## 6.12.0 - 2018-07-28 - -- [#501](https://github.com/stripe/stripe-php/pull/501) Add support for scheduled query runs (`\Stripe\Sigma\ScheduledQueryRun`) for Sigma - -## 6.11.0 - 2018-07-26 - -- [#500](https://github.com/stripe/stripe-php/pull/500) Add support for Stripe Issuing - -## 6.10.4 - 2018-07-19 - -- [#498](https://github.com/stripe/stripe-php/pull/498) Internal improvements to the `\Stripe\ApiResource.classUrl()` method - -## 6.10.3 - 2018-07-16 - -- [#497](https://github.com/stripe/stripe-php/pull/497) Use HTTP/2 only for HTTPS requests - -## 6.10.2 - 2018-07-11 - -- [#494](https://github.com/stripe/stripe-php/pull/494) Enable HTTP/2 support - -## 6.10.1 - 2018-07-10 - -- [#493](https://github.com/stripe/stripe-php/pull/493) Add PHPDoc for `auto_advance` on `\Stripe\Invoice` - -## 6.10.0 - 2018-06-28 - -- [#488](https://github.com/stripe/stripe-php/pull/488) Add support for `$appPartnerId` to `Stripe::setAppInfo()` - -## 6.9.0 - 2018-06-28 - -- [#487](https://github.com/stripe/stripe-php/pull/487) Add support for payment intents - -## 6.8.2 - 2018-06-24 - -- [#486](https://github.com/stripe/stripe-php/pull/486) Make `Account.deauthorize()` return the `StripeObject` from the API - -## 6.8.1 - 2018-06-13 - -- [#472](https://github.com/stripe/stripe-php/pull/472) Added phpDoc for `ApiRequestor` and others, especially regarding thrown errors - -## 6.8.0 - 2018-06-13 - -- [#481](https://github.com/stripe/stripe-php/pull/481) Add new `\Stripe\Discount` and `\Stripe\OrderItem` classes, add more PHPDoc describing object attributes - -## 6.7.4 - 2018-05-29 - -- [#480](https://github.com/stripe/stripe-php/pull/480) PHPDoc changes for API version 2018-05-21 and the addition of the new `CHARGE_EXPIRED` event type - -## 6.7.3 - 2018-05-28 - -- [#479](https://github.com/stripe/stripe-php/pull/479) Fix unnecessary traits on `\Stripe\InvoiceLineItem` - -## 6.7.2 - 2018-05-28 - -- [#471](https://github.com/stripe/stripe-php/pull/471) Add `OBJECT_NAME` constant to all API resource classes, add `\Stripe\InvoiceLineItem` class - -## 6.7.1 - 2018-05-13 - -- [#468](https://github.com/stripe/stripe-php/pull/468) Update fields in PHP docs for accuracy - -## 6.7.0 - 2018-05-09 - -- [#466](https://github.com/stripe/stripe-php/pull/466) Add support for issuer fraud records - -## 6.6.0 - 2018-04-11 - -- [#460](https://github.com/stripe/stripe-php/pull/460) Add support for flexible billing primitives - -## 6.5.0 - 2018-04-05 - -- [#461](https://github.com/stripe/stripe-php/pull/461) Don't zero keys on non-`metadata` subobjects - -## 6.4.2 - 2018-03-17 - -- [#458](https://github.com/stripe/stripe-php/pull/458) Add PHPDoc for `account` on `\Stripe\Event` - -## 6.4.1 - 2018-03-02 - -- [#455](https://github.com/stripe/stripe-php/pull/455) Fix namespaces in PHPDoc -- [#456](https://github.com/stripe/stripe-php/pull/456) Fix namespaces for some exceptions - -## 6.4.0 - 2018-02-28 - -- [#453](https://github.com/stripe/stripe-php/pull/453) Add constants for `reason` (`REASON_*`) and `status` (`STATUS_*`) on `\Stripe\Dispute` - -## 6.3.2 - 2018-02-27 - -- [#452](https://github.com/stripe/stripe-php/pull/452) Add PHPDoc for `amount_paid` and `amount_remaining` on `\Stripe\Invoice` - -## 6.3.1 - 2018-02-26 - -- [#443](https://github.com/stripe/stripe-php/pull/443) Add event types as constants to `\Stripe\Event` class - -## 6.3.0 - 2018-02-23 - -- [#450](https://github.com/stripe/stripe-php/pull/450) Add support for `code` attribute on all Stripe exceptions - -## 6.2.0 - 2018-02-21 - -- [#440](https://github.com/stripe/stripe-php/pull/440) Add support for topups -- [#442](https://github.com/stripe/stripe-php/pull/442) Fix PHPDoc for `\Stripe\Error\SignatureVerification` - -## 6.1.0 - 2018-02-12 - -- [#435](https://github.com/stripe/stripe-php/pull/435) Fix header persistence on `Collection` objects -- [#436](https://github.com/stripe/stripe-php/pull/436) Introduce new `Idempotency` error class - -## 6.0.0 - 2018-02-07 - -Major version release. List of backwards incompatible changes to watch out for: - -- The minimum PHP version is now 5.4.0. If you're using PHP 5.3 or older, consider upgrading to a more recent version. - -* `\Stripe\AttachedObject` no longer exists. Attributes that used to be instances of `\Stripe\AttachedObject` (such as `metadata`) are now instances of `\Stripe\StripeObject`. - -- Attributes that used to be PHP arrays (such as `legal_entity->additional_owners` on `\Stripe\Account` instances) are now instances of `\Stripe\StripeObject`, except when they are empty. `\Stripe\StripeObject` has array semantics so this should not be an issue unless you are actively checking types. - -* `\Stripe\Collection` now derives from `\Stripe\StripeObject` rather than from `\Stripe\ApiResource`. - -Pull requests included in this release: - -- [#410](https://github.com/stripe/stripe-php/pull/410) Drop support for PHP 5.3 -- [#411](https://github.com/stripe/stripe-php/pull/411) Use traits for common API operations -- [#414](https://github.com/stripe/stripe-php/pull/414) Use short array syntax -- [#404](https://github.com/stripe/stripe-php/pull/404) Fix serialization logic -- [#417](https://github.com/stripe/stripe-php/pull/417) Remove `ExternalAccount` class -- [#418](https://github.com/stripe/stripe-php/pull/418) Increase test coverage -- [#421](https://github.com/stripe/stripe-php/pull/421) Update CA bundle and add script for future updates -- [#422](https://github.com/stripe/stripe-php/pull/422) Use vendored CA bundle for all requests -- [#428](https://github.com/stripe/stripe-php/pull/428) Support for automatic request retries - -## 5.9.2 - 2018-02-07 - -- [#431](https://github.com/stripe/stripe-php/pull/431) Update PHPDoc @property tags for latest API version - -## 5.9.1 - 2018-02-06 - -- [#427](https://github.com/stripe/stripe-php/pull/427) Add and update PHPDoc @property tags on all API resources - -## 5.9.0 - 2018-01-17 - -- [#421](https://github.com/stripe/stripe-php/pull/421) Updated bundled CA certificates -- [#423](https://github.com/stripe/stripe-php/pull/423) Escape unsanitized input in OAuth example - -## 5.8.0 - 2017-12-20 - -- [#403](https://github.com/stripe/stripe-php/pull/403) Add `__debugInfo()` magic method to `StripeObject` - -## 5.7.0 - 2017-11-28 - -- [#390](https://github.com/stripe/stripe-php/pull/390) Remove some unsupported API methods -- [#391](https://github.com/stripe/stripe-php/pull/391) Alphabetize the list of API resources in `Util::convertToStripeObject()` and add missing resources -- [#393](https://github.com/stripe/stripe-php/pull/393) Fix expiry date update for card sources - -## 5.6.0 - 2017-10-31 - -- [#386](https://github.com/stripe/stripe-php/pull/386) Support for exchange rates APIs - -## 5.5.1 - 2017-10-30 - -- [#387](https://github.com/stripe/stripe-php/pull/387) Allow `personal_address_kana` and `personal_address_kanji` to be updated on an account - -## 5.5.0 - 2017-10-27 - -- [#385](https://github.com/stripe/stripe-php/pull/385) Support for listing source transactions - -## 5.4.0 - 2017-10-24 - -- [#383](https://github.com/stripe/stripe-php/pull/383) Add static methods to manipulate resources from parent - - `Account` gains methods for external accounts and login links (e.g. `createExternalAccount`, `createLoginLink`) - - `ApplicationFee` gains methods for refunds - - `Customer` gains methods for sources - - `Transfer` gains methods for reversals - -## 5.3.0 - 2017-10-11 - -- [#378](https://github.com/stripe/stripe-php/pull/378) Rename source `delete` to `detach` (and deprecate the former) - -## 5.2.3 - 2017-09-27 - -- Add PHPDoc for `Card` - -## 5.2.2 - 2017-09-20 - -- Fix deserialization mapping of `FileUpload` objects - -## 5.2.1 - 2017-09-14 - -- Serialized `shipping` nested attribute - -## 5.2.0 - 2017-08-29 - -- Add support for `InvalidClient` OAuth error - -## 5.1.3 - 2017-08-14 - -- Allow `address_kana` and `address_kanji` to be updated for custom accounts - -## 5.1.2 - 2017-08-01 - -- Fix documented return type of `autoPagingIterator()` (was missing namespace) - -## 5.1.1 - 2017-07-03 - -- Fix order returns to use the right URL `/v1/order_returns` - -## 5.1.0 - 2017-06-30 - -- Add support for OAuth - -## 5.0.0 - 2017-06-27 - -- `pay` on invoice now takes params as well as opts - -## 4.13.0 - 2017-06-19 - -- Add support for ephemeral keys - -## 4.12.0 - 2017-06-05 - -- Clients can implement `getUserAgentInfo()` to add additional user agent information - -## 4.11.0 - 2017-06-05 - -- Implement `Countable` for `AttachedObject` (`metadata` and `additional_owners`) - -## 4.10.0 - 2017-05-25 - -- Add support for login links - -## 4.9.1 - 2017-05-10 - -- Fix docs to include arrays on `$id` parameter for retrieve methods - -## 4.9.0 - 2017-04-28 - -- Support for checking webhook signatures - -## 4.8.1 - 2017-04-24 - -- Allow nested field `payout_schedule` to be updated - -## 4.8.0 - 2017-04-20 - -- Add `\Stripe\Stripe::setLogger()` to support an external PSR-3 compatible logger - -## 4.7.0 - 2017-04-10 - -- Add support for payouts and recipient transfers - -## 4.6.0 - 2017-04-06 - -- Please see 4.7.0 instead (no-op release) - -## 4.5.1 - 2017-03-22 - -- Remove hard dependency on cURL - -## 4.5.0 - 2017-03-20 - -- Support for detaching sources from customers - -## 4.4.2 - 2017-02-27 - -- Correct handling of `owner` parameter when updating sources - -## 4.4.1 - 2017-02-24 - -- Correct the error check on a bad JSON decoding - -## 4.4.0 - 2017-01-18 - -- Add support for updating sources - -## 4.3.0 - 2016-11-30 - -- Add support for verifying sources - -## 4.2.0 - 2016-11-21 - -- Add retrieve method for 3-D Secure resources - -## 4.1.1 - 2016-10-21 - -- Add docblock with model properties for `Plan` - -## 4.1.0 - 2016-10-18 - -- Support for 403 status codes (permission denied) - -## 4.0.1 - 2016-10-17 - -- Fix transfer reversal materialization -- Fixes for some property definitions in docblocks - -## 4.0.0 - 2016-09-28 - -- Support for subscription items -- Drop attempt to force TLS 1.2: please note that this could be breaking if you're using old OS distributions or packages and upgraded recently (so please make sure to test your integration!) - -## 3.23.0 - 2016-09-15 - -- Add support for Apple Pay domains - -## 3.22.0 - 2016-09-13 - -- Add `Stripe::setAppInfo` to allow plugins to register user agent information - -## 3.21.0 - 2016-08-25 - -- Add `Source` model for generic payment sources - -## 3.20.0 - 2016-08-08 - -- Add `getDeclineCode` to card errors - -## 3.19.0 - 2016-07-29 - -- Opt requests directly into TLS 1.2 where OpenSSL >= 1.0.1 (see #277 for context) - -## 3.18.0 - 2016-07-28 - -- Add new `STATUS_` constants for subscriptions - -## 3.17.1 - 2016-07-28 - -- Fix auto-paging iterator so that it plays nicely with `iterator_to_array` - -## 3.17.0 - 2016-07-14 - -- Add field annotations to model classes for better editor hinting - -## 3.16.0 - 2016-07-12 - -- Add `ThreeDSecure` model for 3-D secure payments - -## 3.15.0 - 2016-06-29 - -- Add static `update` method to all resources that can be changed. - -## 3.14.3 - 2016-06-20 - -- Make sure that cURL never sends `Expects: 100-continue`, even on large request bodies - -## 3.14.2 - 2016-06-03 - -- Add `inventory` under `SKU` to list of keys that have nested data and can be updated - -## 3.14.1 - 2016-05-27 - -- Fix some inconsistencies in PHPDoc - -## 3.14.0 - 2016-05-25 - -- Add support for returning Relay orders - -## 3.13.0 - 2016-05-04 - -- Add `list`, `create`, `update`, `retrieve`, and `delete` methods to the Subscription class - -## 3.12.1 - 2016-04-07 - -- Additional check on value arrays for some extra safety - -## 3.12.0 - 2016-03-31 - -- Fix bug `refreshFrom` on `StripeObject` would not take an `$opts` array -- Fix bug where `$opts` not passed to parent `save` method in `Account` -- Fix bug where non-existent variable was referenced in `reverse` in `Transfer` -- Update CA cert bundle for compatibility with OpenSSL versions below 1.0.1 - -## 3.11.0 - 2016-03-22 - -- Allow `CurlClient` to be initialized with default `CURLOPT_*` options - -## 3.10.1 - 2016-03-22 - -- Fix bug where request params and options were ignored in `ApplicationFee`'s `refund.` - -## 3.10.0 - 2016-03-15 - -- Add `reject` on `Account` to support the new API feature - -## 3.9.2 - 2016-03-04 - -- Fix error when an object's metadata is set more than once - -## 3.9.1 - 2016-02-24 - -- Fix encoding behavior of nested arrays for requests (see #227) - -## 3.9.0 - 2016-02-09 - -- Add automatic pagination mechanism with `autoPagingIterator()` -- Allow global account ID to be set with `Stripe::setAccountId()` - -## 3.8.0 - 2016-02-08 - -- Add `CountrySpec` model for looking up country payment information - -## 3.7.1 - 2016-02-01 - -- Update bundled CA certs - -## 3.7.0 - 2016-01-27 - -- Support deleting Relay products and SKUs - -## 3.6.0 - 2016-01-05 - -- Allow configuration of HTTP client timeouts - -## 3.5.0 - 2015-12-01 - -- Add a verification routine for external accounts - -## 3.4.0 - 2015-09-14 - -- Products, SKUs, and Orders -- https://stripe.com/relay - -## 3.3.0 - 2015-09-11 - -- Add support for 429 Rate Limit response - -## 3.2.0 - 2015-08-17 - -- Add refund listing and retrieval without an associated charge - -## 3.1.0 - 2015-08-03 - -- Add dispute listing and retrieval -- Add support for manage account deletion - -## 3.0.0 - 2015-07-28 - -- Rename `\Stripe\Object` to `\Stripe\StripeObject` (PHP 7 compatibility) -- Rename `getCode` and `getParam` in exceptions to `getStripeCode` and `getStripeParam` -- Add support for calling `json_encode` on Stripe objects in PHP 5.4+ -- Start supporting/testing PHP 7 - -## 2.3.0 - 2015-07-06 - -- Add request ID to all Stripe exceptions - -## 2.2.0 - 2015-06-01 - -- Add support for Alipay accounts as sources -- Add support for bank accounts as sources (private beta) -- Add support for bank accounts and cards as external_accounts on Account objects - -## 2.1.4 - 2015-05-13 - -- Fix CA certificate file path (thanks @lphilps & @matthewarkin) - -## 2.1.3 - 2015-05-12 - -- Fix to account updating to permit `tos_acceptance` and `personal_address` to be set properly -- Fix to Transfer reversal creation (thanks @neatness!) -- Network requests are now done through a swappable class for easier mocking - -## 2.1.2 - 2015-04-10 - -- Remove SSL cert revokation checking (all pre-Heartbleed certs have expired) -- Bug fixes to account updating - -## 2.1.1 - 2015-02-27 - -- Support transfer reversals - -## 2.1.0 - 2015-02-19 - -- Support new API version (2015-02-18) -- Added Bitcoin Receiever update and delete actions -- Edited tests to prefer "source" over "card" as per new API version - -## 2.0.1 - 2015-02-16 - -- Fix to fetching endpoints that use a non-default baseUrl (`FileUpload`) - -## 2.0.0 - 2015-02-14 - -- Bumped minimum version to 5.3.3 -- Switched to Stripe namespace instead of Stripe\_ class name prefiexes (thanks @chadicus!) -- Switched tests to PHPUnit (thanks @chadicus!) -- Switched style guide to PSR2 (thanks @chadicus!) -- Added \$opts hash to the end of most methods: this permits passing 'idempotency_key', 'stripe_account', or 'stripe_version'. The last 2 will persist across multiple object loads. -- Added support for retrieving Account by ID - -## 1.18.0 - 2015-01-21 - -- Support making bitcoin charges through BitcoinReceiver source object - -## 1.17.5 - 2014-12-23 - -- Adding support for creating file uploads. - -## 1.17.4 - 2014-12-15 - -- Saving objects fetched with a custom key now works (thanks @JustinHook & @jpasilan) -- Added methods for reporting charges as safe or fraudulent and for specifying the reason for refunds - -## 1.17.3 - 2014-11-06 - -- Better handling of HHVM support for SSL certificate blacklist checking. - -## 1.17.2 - 2014-09-23 - -- Coupons now are backed by a `Stripe_Coupon` instead of `Stripe_Object`, and support updating metadata -- Running operations (`create`, `retrieve`, `all`) on upcoming invoice items now works - -## 1.17.1 - 2014-07-31 - -- Requests now send Content-Type header - -## 1.17.0 - 2014-07-29 - -- Application Fee refunds now a list instead of array -- HHVM now works -- Small bug fixes (thanks @bencromwell & @fastest963) -- `__toString` now returns the name of the object in addition to its JSON representation - -## 1.16.0 - 2014-06-17 - -- Add metadata for refunds and disputes - -## 1.15.0 - 2014-05-28 - -- Support canceling transfers - -## 1.14.1 - 2014-05-21 - -- Support cards for recipients. - -## 1.13.1 - 2014-05-15 - -- Fix bug in account resource where `id` wasn't in the result - -## 1.13.0 - 2014-04-10 - -- Add support for certificate blacklisting -- Update ca bundle -- Drop support for HHVM (Temporarily) - -## 1.12.0 - 2014-04-01 - -- Add Stripe_RateLimitError for catching rate limit errors. -- Update to Zend coding style (thanks, @jpiasetz) - -## 1.11.0 - 2014-01-29 - -- Add support for multiple subscriptions per customer - -## 1.10.1 - 2013-12-02 - -- Add new ApplicationFee - -## 1.9.1 - 2013-11-08 - -- Fix a bug where a null nestable object causes warnings to fire. - -## 1.9.0 - 2013-10-16 - -- Add support for metadata API. - -## 1.8.4 - 2013-09-18 - -- Add support for closing disputes. - -## 1.8.3 - 2013-08-13 - -- Add new Balance and BalanceTransaction - -## 1.8.2 - 2013-08-12 - -- Add support for unsetting attributes by updating to NULL. Setting properties to a blank string is now an error. - -## 1.8.1 - 2013-07-12 - -- Add support for multiple cards API (Stripe API version 2013-07-12: https://stripe.com/docs/upgrades#2013-07-05) - -## 1.8.0 - 2013-04-11 - -- Allow Transfers to be creatable -- Add new Recipient resource - -## 1.7.15 - 2013-02-21 - -- Add 'id' to the list of permanent object attributes - -## 1.7.14 - 2013-02-20 - -- Don't re-encode strings that are already encoded in UTF-8. If you were previously using plan or coupon objects with UTF-8 IDs, they may have been treated as ISO-8859-1 (Latin-1) and encoded to UTF-8 a 2nd time. You may now need to pass the IDs to utf8_encode before passing them to Stripe_Plan::retrieve or Stripe_Coupon::retrieve. -- Ensure that all input is encoded in UTF-8 before submitting it to Stripe's servers. (github issue #27) - -## 1.7.13 - 2013-02-01 - -- Add support for passing options when retrieving Stripe objects e.g., Stripe_Charge::retrieve(array("id"=>"foo", "expand" => array("customer"))); Stripe_Charge::retrieve("foo") will continue to work - -## 1.7.12 - 2013-01-15 - -- Add support for setting a Stripe API version override - -## 1.7.11 - 2012-12-30 - -- Version bump to cleanup constants and such (fix issue #26) - -## 1.7.10 - 2012-11-08 - -- Add support for updating charge disputes. -- Fix bug preventing retrieval of null attributes - -## 1.7.9 - 2012-11-08 - -- Fix usage under autoloaders such as the one generated by composer (fix issue #22) - -## 1.7.8 - 2012-10-30 - -- Add support for creating invoices. -- Add support for new invoice lines return format -- Add support for new list objects - -## 1.7.7 - 2012-09-14 - -- Get all of the various version numbers in the repo in sync (no other changes) - -## 1.7.6 - 2012-08-31 - -- Add update and pay methods to Invoice resource - -## 1.7.5 - 2012-08-23 - -- Change internal function names so that Stripe_SingletonApiRequest is E_STRICT-clean (github issue #16) - -## 1.7.4 - 2012-08-21 - -- Bugfix so that Stripe objects (e.g. Customer, Charge objects) used in API calls are transparently converted to their object IDs - -## 1.7.3 - 2012-08-15 - -- Add new Account resource - -## 1.7.2 - 2012-06-26 - -- Make clearer that you should be including lib/Stripe.php, not test/Stripe.php (github issue #14) - -## 1.7.1 - 2012-05-24 - -- Add missing argument to Stripe_InvalidRequestError constructor in Stripe_ApiResource::instanceUrl. Fixes a warning when Stripe_ApiResource::instanceUrl is called on a resource with no ID (fix issue #12) - -## 1.7.0 - 2012-05-17 - -- Support Composer and Packagist (github issue #9) -- Add new deleteDiscount method to Stripe_Customer -- Add new Transfer resource -- Switch from using HTTP Basic auth to Bearer auth. (Note: Stripe will support Basic auth for the indefinite future, but recommends Bearer auth when possible going forward) -- Numerous test suite improvements diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/CODE_OF_CONDUCT.md b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/CODE_OF_CONDUCT.md deleted file mode 100644 index 349f5a0b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,77 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to make participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies within all project spaces, and it also applies when -an individual is representing the project or its community in public spaces. -Examples of representing a project or community include using an official -project e-mail address, posting via an official social media account, or acting -as an appointed representative at an online or offline event. Representation of -a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at conduct@stripe.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq - diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/LICENSE b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/LICENSE deleted file mode 100644 index 847c705a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2010-2019 Stripe, Inc. (https://stripe.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/Makefile b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/Makefile deleted file mode 100644 index 88673387..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -export PHPDOCUMENTOR_VERSION := v3.0.0 - -vendor: composer.json - composer install - -vendor/bin/phpdoc: vendor - curl -sfL https://github.com/phpDocumentor/phpDocumentor/releases/download/$(PHPDOCUMENTOR_VERSION)/phpDocumentor.phar -o vendor/bin/phpdoc - chmod +x vendor/bin/phpdoc - -test: vendor - vendor/bin/phpunit -.PHONY: test - -fmt: vendor - vendor/bin/php-cs-fixer fix -v --using-cache=no . -.PHONY: fmt - -fmtcheck: vendor - vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no . -.PHONY: fmtcheck - -phpdoc: vendor/bin/phpdoc - vendor/bin/phpdoc - -phpstan: vendor - php -d memory_limit=512M vendor/bin/phpstan analyse lib tests -.PHONY: phpstan - -phpstan-baseline: vendor/bin/phpstan - php -d memory_limit=512M vendor/bin/phpstan analyse lib tests --generate-baseline -.PHONY: phpstan-baseline - -update-version: - @echo "$(VERSION)" > VERSION - @perl -pi -e 's|VERSION = '\''[.\d]+'\''|VERSION = '\''$(VERSION)'\''|' lib/Stripe.php -.PHONY: update-version - -codegen-format: fmt -.PHONY: codegen-format diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/README.md b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/README.md deleted file mode 100644 index e9d25ad9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/README.md +++ /dev/null @@ -1,270 +0,0 @@ -# Stripe PHP bindings - -[![Build Status](https://travis-ci.org/stripe/stripe-php.svg?branch=master)](https://travis-ci.org/stripe/stripe-php) -[![Latest Stable Version](https://poser.pugx.org/stripe/stripe-php/v/stable.svg)](https://packagist.org/packages/stripe/stripe-php) -[![Total Downloads](https://poser.pugx.org/stripe/stripe-php/downloads.svg)](https://packagist.org/packages/stripe/stripe-php) -[![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php) - -The Stripe PHP library provides convenient access to the Stripe API from -applications written in the PHP language. It includes a pre-defined set of -classes for API resources that initialize themselves dynamically from API -responses which makes it compatible with a wide range of versions of the Stripe -API. - -## Requirements - -PHP 5.6.0 and later. - -## Composer - -You can install the bindings via [Composer](http://getcomposer.org/). Run the following command: - -```bash -composer require stripe/stripe-php -``` - -To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading): - -```php -require_once('vendor/autoload.php'); -``` - -## Manual Installation - -If you do not wish to use Composer, you can download the [latest release](https://github.com/stripe/stripe-php/releases). Then, to use the bindings, include the `init.php` file. - -```php -require_once('/path/to/stripe-php/init.php'); -``` - -## Dependencies - -The bindings require the following extensions in order to work properly: - -- [`curl`](https://secure.php.net/manual/en/book.curl.php), although you can use your own non-cURL client if you prefer -- [`json`](https://secure.php.net/manual/en/book.json.php) -- [`mbstring`](https://secure.php.net/manual/en/book.mbstring.php) (Multibyte String) - -If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available. - -## Getting Started - -Simple usage looks like: - -```php -$stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); -$customer = $stripe->customers->create([ - 'description' => 'example customer', - 'email' => 'email@example.com', - 'payment_method' => 'pm_card_visa', -]); -echo $customer; -``` - -### Client/service patterns vs legacy patterns - -You can continue to use the legacy integration patterns used prior to version [7.33.0](https://github.com/stripe/stripe-php/blob/master/CHANGELOG.md#7330---2020-05-14). Review the [migration guide](https://github.com/stripe/stripe-php/wiki/Migration-to-StripeClient-and-services-in-7.33.0) for the backwards-compatible client/services pattern changes. - -## Documentation - -See the [PHP API docs](https://stripe.com/docs/api/?lang=php#intro). - -See [video demonstrations][youtube-playlist] covering how to use the library. - -## Legacy Version Support - -### PHP 5.4 & 5.5 - -If you are using PHP 5.4 or 5.5, you should consider upgrading your environment as those versions have been past end of life since September 2015 and July 2016 respectively. -Otherwise, you can still use Stripe by downloading stripe-php v6.43.1 ([zip](https://github.com/stripe/stripe-php/archive/v6.43.1.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/6.43.1.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will work but might not support recent features we added since the version was released and upgrading PHP is the best course of action. - -### PHP 5.3 - -If you are using PHP 5.3, you should upgrade your environment as this version has been past end of life since August 2014. -Otherwise, you can download v5.9.2 ([zip](https://github.com/stripe/stripe-php/archive/v5.9.2.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v5.9.2.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses. - -## Custom Request Timeouts - -_NOTE:_ We do not recommend decreasing the timeout for non-read-only calls (e.g. charge creation), since even if you locally timeout, the request on Stripe's side can still complete. If you are decreasing timeouts on these calls, make sure to use [idempotency tokens](https://stripe.com/docs/api/?lang=php#idempotent_requests) to avoid executing the same transaction twice as a result of timeout retry logic. - -To modify request timeouts (connect or total, in seconds) you'll need to tell the API client to use a CurlClient other than its default. You'll set the timeouts in that CurlClient. - -```php -// set up your tweaked Curl client -$curl = new \Stripe\HttpClient\CurlClient(); -$curl->setTimeout(10); // default is \Stripe\HttpClient\CurlClient::DEFAULT_TIMEOUT -$curl->setConnectTimeout(5); // default is \Stripe\HttpClient\CurlClient::DEFAULT_CONNECT_TIMEOUT - -echo $curl->getTimeout(); // 10 -echo $curl->getConnectTimeout(); // 5 - -// tell Stripe to use the tweaked client -\Stripe\ApiRequestor::setHttpClient($curl); - -// use the Stripe API client as you normally would -``` - -## Custom cURL Options (e.g. proxies) - -Need to set a proxy for your requests? Pass in the requisite `CURLOPT_*` array to the CurlClient constructor, using the same syntax as `curl_stopt_array()`. This will set the default cURL options for each HTTP request made by the SDK, though many more common options (e.g. timeouts; see above on how to set those) will be overridden by the client even if set here. - -```php -// set up your tweaked Curl client -$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_PROXY => 'proxy.local:80']); -// tell Stripe to use the tweaked client -\Stripe\ApiRequestor::setHttpClient($curl); -``` - -Alternately, a callable can be passed to the CurlClient constructor that returns the above array based on request inputs. See `testDefaultOptions()` in `tests/CurlClientTest.php` for an example of this behavior. Note that the callable is called at the beginning of every API request, before the request is sent. - -### Configuring a Logger - -The library does minimal logging, but it can be configured -with a [`PSR-3` compatible logger][psr3] so that messages -end up there instead of `error_log`: - -```php -\Stripe\Stripe::setLogger($logger); -``` - -### Accessing response data - -You can access the data from the last API response on any object via `getLastResponse()`. - -```php -$customer = $stripe->customers->create([ - 'description' => 'example customer', -]); -echo $customer->getLastResponse()->headers['Request-Id']; -``` - -### SSL / TLS compatibility issues - -Stripe's API now requires that [all connections use TLS 1.2](https://stripe.com/blog/upgrading-tls). Some systems (most notably some older CentOS and RHEL versions) are capable of using TLS 1.2 but will use TLS 1.0 or 1.1 by default. In this case, you'd get an `invalid_request_error` with the following error message: "Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at [https://stripe.com/blog/upgrading-tls](https://stripe.com/blog/upgrading-tls).". - -The recommended course of action is to [upgrade your cURL and OpenSSL packages](https://support.stripe.com/questions/how-do-i-upgrade-my-stripe-integration-from-tls-1-0-to-tls-1-2#php) so that TLS 1.2 is used by default, but if that is not possible, you might be able to solve the issue by setting the `CURLOPT_SSLVERSION` option to either `CURL_SSLVERSION_TLSv1` or `CURL_SSLVERSION_TLSv1_2`: - -```php -$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1]); -\Stripe\ApiRequestor::setHttpClient($curl); -``` - -### Per-request Configuration - -For apps that need to use multiple keys during the lifetime of a process, like -one that uses [Stripe Connect][connect], it's also possible to set a -per-request key and/or account: - -```php -$customers = $stripe->customers->all([],[ - 'api_key' => 'sk_test_...', - 'stripe_account' => 'acct_...' -]); - -$stripe->customers->retrieve('cus_123456789', [], [ - 'api_key' => 'sk_test_...', - 'stripe_account' => 'acct_...' -]); -``` - -### Configuring CA Bundles - -By default, the library will use its own internal bundle of known CA -certificates, but it's possible to configure your own: - -```php -\Stripe\Stripe::setCABundlePath("path/to/ca/bundle"); -``` - -### Configuring Automatic Retries - -The library can be configured to automatically retry requests that fail due to -an intermittent network problem: - -```php -\Stripe\Stripe::setMaxNetworkRetries(2); -``` - -[Idempotency keys][idempotency-keys] are added to requests to guarantee that -retries are safe. - -### Request latency telemetry - -By default, the library sends request latency telemetry to Stripe. These -numbers help Stripe improve the overall latency of its API for all users. - -You can disable this behavior if you prefer: - -```php -\Stripe\Stripe::setEnableTelemetry(false); -``` - -## Development - -Get [Composer][composer]. For example, on Mac OS: - -```bash -brew install composer -``` - -Install dependencies: - -```bash -composer install -``` - -The test suite depends on [stripe-mock], so make sure to fetch and run it from a -background terminal ([stripe-mock's README][stripe-mock] also contains -instructions for installing via Homebrew and other methods): - -```bash -go get -u github.com/stripe/stripe-mock -stripe-mock -``` - -Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite: - -```bash -./vendor/bin/phpunit -``` - -Or to run an individual test file: - -```bash -./vendor/bin/phpunit tests/Stripe/UtilTest.php -``` - -Update bundled CA certificates from the [Mozilla cURL release][curl]: - -```bash -./update_certs.php -``` - -The library uses [PHP CS Fixer][php-cs-fixer] for code formatting. Code must be formatted before PRs are submitted, otherwise CI will fail. Run the formatter with: - -```bash -./vendor/bin/php-cs-fixer fix -v . -``` - -## Attention plugin developers - -Are you writing a plugin that integrates Stripe and embeds our library? Then please use the `setAppInfo` function to identify your plugin. For example: - -```php -\Stripe\Stripe::setAppInfo("MyAwesomePlugin", "1.2.34", "https://myawesomeplugin.info"); -``` - -The method should be called once, before any request is sent to the API. The second and third parameters are optional. - -### SSL / TLS configuration option - -See the "SSL / TLS compatibility issues" paragraph above for full context. If you want to ensure that your plugin can be used on all systems, you should add a configuration option to let your users choose between different values for `CURLOPT_SSLVERSION`: none (default), `CURL_SSLVERSION_TLSv1` and `CURL_SSLVERSION_TLSv1_2`. - -[composer]: https://getcomposer.org/ -[connect]: https://stripe.com/connect -[curl]: http://curl.haxx.se/docs/caextract.html -[idempotency-keys]: https://stripe.com/docs/api/?lang=php#idempotent_requests -[php-cs-fixer]: https://github.com/FriendsOfPHP/PHP-CS-Fixer -[psr3]: http://www.php-fig.org/psr/psr-3/ -[stripe-mock]: https://github.com/stripe/stripe-mock -[youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M6cUbiHrfMkXxZ9j9SGBxFE diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/VERSION b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/VERSION deleted file mode 100644 index 5a14c98b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.128.0 diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/build.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/build.php deleted file mode 100644 index 37360ffe..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/build.php +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env php -=5.6.0", - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^9.0", - "squizlabs/php_codesniffer": "^3.3", - "friendsofphp/php-cs-fixer": "3.5.0", - "phpstan/phpstan": "^1.2" - }, - "autoload": { - "psr-4": { - "Stripe\\": "lib/" - } - }, - "autoload-dev": { - "psr-4": { - "Stripe\\": [ - "tests/", - "tests/Stripe/" - ] - } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/data/ca-certificates.crt b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/data/ca-certificates.crt deleted file mode 100644 index 65be2181..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/data/ca-certificates.crt +++ /dev/null @@ -1,3476 +0,0 @@ -## -## Bundle of CA Root Certificates -## -## Certificate data from Mozilla as of: Wed Aug 28 03:12:10 2019 GMT -## -## This is a bundle of X.509 certificates of public Certificate Authorities -## (CA). These were automatically extracted from Mozilla's root certificates -## file (certdata.txt). This file can be found in the mozilla source tree: -## https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt -## -## It contains the certificates in PEM format and therefore -## can be directly used with curl / libcurl / php_curl, or with -## an Apache+mod_ssl webserver for SSL client authentication. -## Just configure this file as the SSLCACertificateFile. -## -## Conversion done with mk-ca-bundle.pl version 1.27. -## SHA256: fffa309937c3be940649293f749b8207fabc6eb224e50e4bb3f2c5e44e0d6a6b -## - - -GlobalSign Root CA -================== ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx -GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds -b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV -BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD -VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa -DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc -THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb -Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP -c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX -gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF -AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj -Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG -j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH -hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC -X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== ------END CERTIFICATE----- - -GlobalSign Root CA - R2 -======================= ------BEGIN CERTIFICATE----- -MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv -YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh -bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT -aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln -bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 -ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp -s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN -S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL -TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C -ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E -FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i -YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN -BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp -9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu -01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 -9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 -TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 -EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc -cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw -EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj -055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f -j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC -/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 -xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa -t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== ------END CERTIFICATE----- - -Entrust.net Premium 2048 Secure Server CA -========================================= ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u -ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp -bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV -BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx -NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 -d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl -MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u -ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL -Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr -hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW -nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi -VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ -KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy -T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf -zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT -J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e -nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= ------END CERTIFICATE----- - -Baltimore CyberTrust Root -========================= ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE -ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li -ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC -SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs -dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME -uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB -UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C -G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 -XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr -l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI -VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB -BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh -cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 -hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa -Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H -RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp ------END CERTIFICATE----- - -AddTrust External Root -====================== ------BEGIN CERTIFICATE----- -MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD -VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw -NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU -cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg -Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 -+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw -Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo -aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy -2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 -7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P -BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL -VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk -VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB -IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl -j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 -6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 -e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u -G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= ------END CERTIFICATE----- - -Entrust Root Certification Authority -==================================== ------BEGIN CERTIFICATE----- -MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV -BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw -b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG -A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 -MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu -MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu -Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v -dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz -A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww -Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 -j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN -rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw -DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 -MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH -hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA -A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM -Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa -v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS -W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 -tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 ------END CERTIFICATE----- - -GeoTrust Global CA -================== ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK -Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw -MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j -LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo -BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet -8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc -T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU -vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD -AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk -DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q -zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 -d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 -mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p -XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm -Mw== ------END CERTIFICATE----- - -GeoTrust Universal CA -===================== ------BEGIN CERTIFICATE----- -MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN -R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 -MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu -Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP -ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t -JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e -RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs -7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d -8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V -qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga -Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB -Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu -KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 -ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 -XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB -hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc -aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 -qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL -oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK -xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF -KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 -DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK -xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU -p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI -P/rmMuGNG2+k5o7Y+SlIis5z/iw= ------END CERTIFICATE----- - -GeoTrust Universal CA 2 -======================= ------BEGIN CERTIFICATE----- -MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN -R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 -MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg -SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 -DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17 -j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q -JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a -QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2 -WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP -20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn -ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC -SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG -8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2 -+/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E -BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z -dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ -4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ -mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq -A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg -Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP -pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d -FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp -gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm -X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS ------END CERTIFICATE----- - -Comodo AAA Services root -======================== ------BEGIN CERTIFICATE----- -MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS -R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg -TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw -MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl -c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV -BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG -C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs -i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW -Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH -Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK -Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f -BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl -cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz -LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm -7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz -Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z -8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C -12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== ------END CERTIFICATE----- - -QuoVadis Root CA -================ ------BEGIN CERTIFICATE----- -MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE -ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz -MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp -cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD -EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk -J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL -F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL -YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen -AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w -PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y -ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 -MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj -YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs -ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh -Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW -Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu -BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw -FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 -tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo -fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul -LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x -gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi -5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi -5nrQNiOKSnQ2+Q== ------END CERTIFICATE----- - -QuoVadis Root CA 2 -================== ------BEGIN CERTIFICATE----- -MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT -EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx -ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM -aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC -DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 -XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk -lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB -lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy -lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt -66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn -wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh -D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy -BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie -J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud -DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU -a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT -ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv -Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 -UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm -VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK -+JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW -IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 -WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X -f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II -4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 -VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u ------END CERTIFICATE----- - -QuoVadis Root CA 3 -================== ------BEGIN CERTIFICATE----- -MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT -EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx -OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM -aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC -DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg -DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij -KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K -DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv -BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp -p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 -nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX -MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM -Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz -uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT -BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj -YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 -aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB -BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD -VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 -ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE -AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV -qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s -hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z -POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 -Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp -8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC -bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu -g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p -vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr -qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= ------END CERTIFICATE----- - -Security Communication Root CA -============================== ------BEGIN CERTIFICATE----- -MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP -U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw -HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP -U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw -8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM -DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX -5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd -DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 -JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw -DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g -0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a -mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ -s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ -6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi -FL39vmwLAw== ------END CERTIFICATE----- - -Sonera Class 2 Root CA -====================== ------BEGIN CERTIFICATE----- -MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG -U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw -NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh -IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 -/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT -dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG -f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P -tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH -nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT -XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt -0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI -cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph -Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx -EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH -llpwrN9M ------END CERTIFICATE----- - -XRamp Global CA Root -==================== ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE -BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj -dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx -HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg -U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu -IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx -foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE -zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs -AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry -xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud -EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap -oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC -AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc -/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt -qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n -nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz -8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= ------END CERTIFICATE----- - -Go Daddy Class 2 CA -=================== ------BEGIN CERTIFICATE----- -MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY -VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG -A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g -RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD -ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv -2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 -qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j -YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY -vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O -BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o -atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu -MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG -A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim -PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt -I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ -HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI -Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b -vZ8= ------END CERTIFICATE----- - -Starfield Class 2 CA -==================== ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc -U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo -MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG -A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG -SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY -bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ -JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm -epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN -F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF -MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f -hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo -bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g -QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs -afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM -PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl -xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD -KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 -QBFGmh95DmK/D5fs4C8fF5Q= ------END CERTIFICATE----- - -Taiwan GRCA -=========== ------BEGIN CERTIFICATE----- -MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG -EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X -DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv -dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN -w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 -BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O -1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO -htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov -J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7 -Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t -B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB -O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8 -lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV -HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2 -09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ -TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj -Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2 -Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU -D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz -DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk -Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk -7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ -CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy -+fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS ------END CERTIFICATE----- - -DigiCert Assured ID Root CA -=========================== ------BEGIN CERTIFICATE----- -MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw -IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx -MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL -ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO -9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy -UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW -/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy -oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf -GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF -66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq -hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc -EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn -SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i -8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe -+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== ------END CERTIFICATE----- - -DigiCert Global Root CA -======================= ------BEGIN CERTIFICATE----- -MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw -HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw -MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 -dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn -TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 -BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H -4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y -7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB -o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm -8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF -BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr -EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt -tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 -UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk -CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= ------END CERTIFICATE----- - -DigiCert High Assurance EV Root CA -================================== ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw -KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw -MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ -MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu -Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t -Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS -OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 -MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ -NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe -h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB -Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY -JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ -V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp -myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK -mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe -vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K ------END CERTIFICATE----- - -Certplus Class 2 Primary CA -=========================== ------BEGIN CERTIFICATE----- -MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE -BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN -OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy -dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR -5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ -Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO -YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e -e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME -CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ -YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t -L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD -P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R -TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+ -7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW -//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 -l7+ijrRU ------END CERTIFICATE----- - -DST Root CA X3 -============== ------BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK -ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X -DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 -cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT -rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 -UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy -xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d -utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T -AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ -MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug -dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE -GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw -RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS -fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ ------END CERTIFICATE----- - -SwissSign Gold CA - G2 -====================== ------BEGIN CERTIFICATE----- -MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw -EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN -MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp -c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq -t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C -jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg -vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF -ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR -AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend -jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO -peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR -7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi -GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 -OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov -L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm -5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr -44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf -Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m -Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp -mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk -vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf -KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br -NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj -viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ ------END CERTIFICATE----- - -SwissSign Silver CA - G2 -======================== ------BEGIN CERTIFICATE----- -MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT -BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X -DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 -aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG -9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 -N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm -+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH -6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu -MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h -qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 -FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs -ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc -celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X -CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ -BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB -tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 -cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P -4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F -kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L -3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx -/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa -DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP -e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu -WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ -DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub -DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u ------END CERTIFICATE----- - -GeoTrust Primary Certification Authority -======================================== ------BEGIN CERTIFICATE----- -MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD -ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx -CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ -cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN -b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 -nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge -RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt -tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD -AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI -hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K -Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN -NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa -Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG -1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= ------END CERTIFICATE----- - -thawte Primary Root CA -====================== ------BEGIN CERTIFICATE----- -MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE -BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 -aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 -MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg -SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv -KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT -FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs -oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ -1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc -q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K -aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p -afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD -VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF -AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE -uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX -xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 -jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH -z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== ------END CERTIFICATE----- - -VeriSign Class 3 Public Primary Certification Authority - G5 -============================================================ ------BEGIN CERTIFICATE----- -MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO -ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk -IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln -biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh -dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz -j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD -Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ -Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r -fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ -BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv -Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy -aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG -SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ -X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE -KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC -Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE -ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq ------END CERTIFICATE----- - -SecureTrust CA -============== ------BEGIN CERTIFICATE----- -MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG -EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy -dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe -BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC -ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX -OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t -DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH -GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b -01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH -ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ -BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj -aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ -KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu -SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf -mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ -nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR -3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= ------END CERTIFICATE----- - -Secure Global CA -================ ------BEGIN CERTIFICATE----- -MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG -EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH -bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg -MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg -Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx -YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ -bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g -8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV -HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi -0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud -EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn -oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA -MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ -OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn -CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 -3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc -f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW ------END CERTIFICATE----- - -COMODO Certification Authority -============================== ------BEGIN CERTIFICATE----- -MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE -BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG -A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb -MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD -T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH -+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww -xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV -4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA -1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI -rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k -b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC -AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP -OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ -RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc -IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN -+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== ------END CERTIFICATE----- - -Network Solutions Certificate Authority -======================================= ------BEGIN CERTIFICATE----- -MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG -EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr -IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx -MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu -MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx -jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT -aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT -crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc -/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB -AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP -BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv -bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA -A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q -4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ -GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv -wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD -ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey ------END CERTIFICATE----- - -COMODO ECC Certification Authority -================================== ------BEGIN CERTIFICATE----- -MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC -R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE -ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix -GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR -Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo -b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X -4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni -wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG -FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA -U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= ------END CERTIFICATE----- - -OISTE WISeKey Global Root GA CA -=============================== ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE -BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG -A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH -bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD -VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw -IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 -IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 -Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg -Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD -d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ -/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R -LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ -KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm -MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 -+vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa -hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY -okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= ------END CERTIFICATE----- - -Certigna -======== ------BEGIN CERTIFICATE----- -MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw -EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 -MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI -Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q -XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH -GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p -ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg -DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf -Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ -tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ -BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J -SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA -hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ -ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu -PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY -1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw -WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== ------END CERTIFICATE----- - -Deutsche Telekom Root CA 2 -========================== ------BEGIN CERTIFICATE----- -MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT -RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG -A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 -MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G -A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS -b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 -bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI -KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY -AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK -Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV -jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV -HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr -E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy -zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 -rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G -dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU -Cm26OWMohpLzGITY+9HPBVZkVw== ------END CERTIFICATE----- - -Cybertrust Global Root -====================== ------BEGIN CERTIFICATE----- -MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li -ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 -MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD -ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA -+Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW -0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL -AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin -89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT -8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP -BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 -MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G -A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO -lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi -5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 -hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T -X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW -WL1WMRJOEcgh4LMRkWXbtKaIOM5V ------END CERTIFICATE----- - -ePKI Root Certification Authority -================================= ------BEGIN CERTIFICATE----- -MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG -EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg -Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx -MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq -MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs -IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi -lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv -qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX -12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O -WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ -ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao -lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ -vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi -Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi -MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH -ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 -1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq -KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV -xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP -NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r -GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE -xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx -gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy -sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD -BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= ------END CERTIFICATE----- - -certSIGN ROOT CA -================ ------BEGIN CERTIFICATE----- -MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD -VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa -Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE -CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I -JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH -rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 -ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD -0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 -AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B -Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB -AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 -SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 -x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt -vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz -TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD ------END CERTIFICATE----- - -GeoTrust Primary Certification Authority - G3 -============================================= ------BEGIN CERTIFICATE----- -MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE -BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 -IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz -NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo -YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT -LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j -K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE -c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C -IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu -dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr -2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 -cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE -Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD -AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s -t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt ------END CERTIFICATE----- - -thawte Primary Root CA - G2 -=========================== ------BEGIN CERTIFICATE----- -MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC -VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu -IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg -Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV -MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG -b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt -IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS -LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 -8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU -mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN -G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K -rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== ------END CERTIFICATE----- - -thawte Primary Root CA - G3 -=========================== ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE -BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 -aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w -ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh -d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD -VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG -A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At -P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC -+BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY -7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW -vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ -KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK -A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu -t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC -8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm -er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= ------END CERTIFICATE----- - -GeoTrust Primary Certification Authority - G2 -============================================= ------BEGIN CERTIFICATE----- -MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC -VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu -Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD -ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 -OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg -MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl -b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG -BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc -KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD -VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ -EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m -ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 -npaqBA+K ------END CERTIFICATE----- - -VeriSign Universal Root Certification Authority -=============================================== ------BEGIN CERTIFICATE----- -MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO -ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk -IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u -IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj -1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP -MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 -9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I -AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR -tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G -CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O -a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud -DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 -Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx -Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx -P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P -wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 -mJO37M2CYfE45k+XmCpajQ== ------END CERTIFICATE----- - -VeriSign Class 3 Public Primary Certification Authority - G4 -============================================================ ------BEGIN CERTIFICATE----- -MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC -VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 -b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz -ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU -cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo -b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 -Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz -rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB -/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw -HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u -Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD -A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx -AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== ------END CERTIFICATE----- - -NetLock Arany (Class Gold) Főtanúsítvány -======================================== ------BEGIN CERTIFICATE----- -MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G -A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 -dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB -cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx -MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO -ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 -c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu -0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw -/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk -H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw -fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 -neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB -BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW -qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta -YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC -bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna -NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu -dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= ------END CERTIFICATE----- - -Staat der Nederlanden Root CA - G2 -================================== ------BEGIN CERTIFICATE----- -MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE -CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g -Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC -TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l -ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ -5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn -vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj -CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil -e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR -OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI -CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 -48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi -trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737 -qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB -AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC -ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV -HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA -A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz -+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj -f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN -kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk -CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF -URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb -CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h -oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV -IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm -66+KAQ== ------END CERTIFICATE----- - -Hongkong Post Root CA 1 -======================= ------BEGIN CERTIFICATE----- -MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT -DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx -NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n -IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 -ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr -auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh -qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY -V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV -HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i -h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio -l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei -IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps -T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT -c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== ------END CERTIFICATE----- - -SecureSign RootCA11 -=================== ------BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi -SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS -b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw -KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 -cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL -TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO -wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq -g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP -O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA -bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX -t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh -OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r -bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ -Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 -y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 -lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= ------END CERTIFICATE----- - -Microsec e-Szigno Root CA 2009 -============================== ------BEGIN CERTIFICATE----- -MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER -MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv -c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o -dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE -BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt -U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA -fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG -0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA -pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm -1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC -AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf -QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE -FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o -lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX -I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 -tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 -yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi -LXpUq3DDfSJlgnCW ------END CERTIFICATE----- - -GlobalSign Root CA - R3 -======================= ------BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv -YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh -bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT -aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln -bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt -iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ -0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 -rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl -OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 -xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE -FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 -lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 -EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E -bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 -YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r -kpeDMdmztcpHWD9f ------END CERTIFICATE----- - -Autoridad de Certificacion Firmaprofesional CIF A62634068 -========================================================= ------BEGIN CERTIFICATE----- -MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA -BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 -MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw -QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB -NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD -Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P -B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY -7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH -ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI -plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX -MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX -LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK -bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU -vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud -EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH -DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp -cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA -bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx -ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx -51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk -R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP -T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f -Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl -osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR -crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR -saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD -KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi -6Et8Vcad+qMUu2WFbm5PEn4KPJ2V ------END CERTIFICATE----- - -Izenpe.com -========== ------BEGIN CERTIFICATE----- -MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG -EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz -MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu -QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ -03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK -ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU -+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC -PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT -OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK -F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK -0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ -0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB -leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID -AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ -SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG -NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx -MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O -BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l -Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga -kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q -hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs -g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 -aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 -nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC -ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo -Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z -WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== ------END CERTIFICATE----- - -Chambers of Commerce Root - 2008 -================================ ------BEGIN CERTIFICATE----- -MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD -MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv -bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu -QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy -Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl -ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF -EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl -cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC -AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA -XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj -h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ -ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk -NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g -D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331 -lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ -0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj -ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2 -EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI -G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ -BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh -bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh -bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC -CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH -AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 -wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH -3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU -RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 -M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 -YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF -9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK -zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG -nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg -OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ ------END CERTIFICATE----- - -Global Chambersign Root - 2008 -============================== ------BEGIN CERTIFICATE----- -MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD -MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv -bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu -QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx -NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg -Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ -QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD -aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf -VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf -XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0 -ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB -/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA -TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M -H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe -Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF -HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh -wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB -AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT -BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE -BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm -aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm -aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp -1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 -dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG -/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 -ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s -dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg -9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH -foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du -qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr -P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq -c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z -09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B ------END CERTIFICATE----- - -Go Daddy Root Certificate Authority - G2 -======================================== ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT -B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu -MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 -MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 -b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G -A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq -9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD -+qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd -fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl -NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 -BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac -vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r -5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV -N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO -LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 ------END CERTIFICATE----- - -Starfield Root Certificate Authority - G2 -========================================= ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT -B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s -b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 -eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw -DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg -VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB -dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv -W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs -bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk -N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf -ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU -JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol -TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx -4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw -F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K -pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ -c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 ------END CERTIFICATE----- - -Starfield Services Root Certificate Authority - G2 -================================================== ------BEGIN CERTIFICATE----- -MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT -B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s -b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl -IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV -BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT -dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg -Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 -h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa -hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP -LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB -rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw -AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG -SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP -E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy -xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd -iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza -YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 ------END CERTIFICATE----- - -AffirmTrust Commercial -====================== ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS -BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw -MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly -bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb -DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV -C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 -BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww -MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV -HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG -hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi -qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv -0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh -sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= ------END CERTIFICATE----- - -AffirmTrust Networking -====================== ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS -BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw -MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly -bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE -Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI -dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 -/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb -h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV -HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu -UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 -12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 -WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 -/ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= ------END CERTIFICATE----- - -AffirmTrust Premium -=================== ------BEGIN CERTIFICATE----- -MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS -BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy -OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy -dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn -BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV -5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs -+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd -GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R -p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI -S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 -6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 -/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo -+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB -/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv -MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg -Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC -6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S -L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK -+4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV -BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg -IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 -g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb -zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== ------END CERTIFICATE----- - -AffirmTrust Premium ECC -======================= ------BEGIN CERTIFICATE----- -MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV -BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx -MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U -cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA -IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ -N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW -BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK -BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X -57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM -eQ== ------END CERTIFICATE----- - -Certum Trusted Network CA -========================= ------BEGIN CERTIFICATE----- -MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK -ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv -biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy -MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU -ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC -l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J -J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 -fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 -cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB -Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw -DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj -jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 -mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj -Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI -03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= ------END CERTIFICATE----- - -TWCA Root Certification Authority -================================= ------BEGIN CERTIFICATE----- -MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ -VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG -EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB -IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK -AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx -QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC -oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP -4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r -y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB -BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG -9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC -mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW -QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY -T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny -Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== ------END CERTIFICATE----- - -Security Communication RootCA2 -============================== ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc -U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh -dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC -SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy -aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ -+T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R -3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV -spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K -EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 -QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB -CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj -u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk -3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q -tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29 -mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 ------END CERTIFICATE----- - -EC-ACC -====== ------BEGIN CERTIFICATE----- -MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE -BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w -ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD -VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UE -CxMsSmVyYXJxdWlhIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMT -BkVDLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQGEwJFUzE7 -MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8gKE5JRiBRLTA4MDExNzYt -SSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZl -Z2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQubmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJh -cnF1aWEgRW50aXRhdHMgZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUND -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R85iK -w5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm4CgPukLjbo73FCeT -ae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaVHMf5NLWUhdWZXqBIoH7nF2W4onW4 -HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNdQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0a -E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw -0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD -VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 -Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l -dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ -lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa -Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe -l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 -E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D -5EI= ------END CERTIFICATE----- - -Hellenic Academic and Research Institutions RootCA 2011 -======================================================= ------BEGIN CERTIFICATE----- -MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT -O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y -aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z -IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT -AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z -IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo -IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI -1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa -71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u -8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH -3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/ -MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8 -MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu -b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt -XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 -TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD -/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N -7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 ------END CERTIFICATE----- - -Actalis Authentication Root CA -============================== ------BEGIN CERTIFICATE----- -MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM -BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE -AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky -MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz -IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 -IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ -wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa -by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 -zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f -YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 -oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l -EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7 -hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4Fv6MGn8i1zeQf1xcGDXqVdFUNaBr8 -EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbnfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5 -jF66CyCU3nuDuP/jVo23Eek7jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLY -iDrIn3hm7YnzezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt -ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI -WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0 -JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx -K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+ -Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC -4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo -2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz -lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem -OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 -vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== ------END CERTIFICATE----- - -Trustis FPS Root CA -=================== ------BEGIN CERTIFICATE----- -MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG -EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 -IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV -BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ -RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk -H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa -cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt -o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA -AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd -BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c -GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC -yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P -8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV -l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl -iB6XzCGcKQENZetX2fNXlrtIzYE= ------END CERTIFICATE----- - -Buypass Class 2 Root CA -======================= ------BEGIN CERTIFICATE----- -MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU -QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X -DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 -eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw -DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1 -g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn -9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b -/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU -CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff -awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI -zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn -Bkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRSP/TizPJhk9H9Z2vX -Uq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN9SG9dKpN6nIDSdvHXx1iY8f93ZHs -M+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxPAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD -VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF -AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s -A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI -osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S -aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd -DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD -LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 -oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC -wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS -CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN -rJgWVqA= ------END CERTIFICATE----- - -Buypass Class 3 Root CA -======================= ------BEGIN CERTIFICATE----- -MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU -QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X -DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 -eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw -DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH -sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR -5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh -7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ -ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH -2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV -/afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ -RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA -Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq -j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD -VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF -AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV -cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G -uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG -Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 -ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 -KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz -6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug -UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe -eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi -Cp/HuZc= ------END CERTIFICATE----- - -T-TeleSec GlobalRoot Class 3 -============================ ------BEGIN CERTIFICATE----- -MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM -IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU -cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx -MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz -dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD -ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK -9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU -NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF -iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W -0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA -MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr -AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb -fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT -ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h -P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml -e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== ------END CERTIFICATE----- - -EE Certification Centre Root CA -=============================== ------BEGIN CERTIFICATE----- -MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG -EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy -dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw -MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB -UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy -ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM -TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2 -rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw -93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN -P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T -AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ -MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF -BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj -xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM -lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u -uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU -3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM -dcGWxZ0= ------END CERTIFICATE----- - -D-TRUST Root Class 3 CA 2 2009 -============================== ------BEGIN CERTIFICATE----- -MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK -DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe -Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE -LVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOAD -ER03UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42tSHKXzlA -BF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9RySPocq60vFYJfxLLHLGv -KZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsMlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7z -p+hnUquVH+BGPtikw8paxTGA6Eian5Rp/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUC -AwEAAaOCARowggEWMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ -4PGEMA4GA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVjdG9y -eS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUyMENBJTIwMiUyMDIw -MDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3QwQ6BBoD+G -PWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3JsL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw -OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm -2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 -o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV -dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph -X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= ------END CERTIFICATE----- - -D-TRUST Root Class 3 CA 2 EV 2009 -================================= ------BEGIN CERTIFICATE----- -MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK -DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw -OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK -DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw -OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS -egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh -zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T -7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 -sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35 -11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv -cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFwOi8v -ZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xhc3MlMjAzJTIwQ0El -MjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1ERT9jZXJ0aWZpY2F0ZXJldm9jYXRp -b25saXN0MEagRKBChkBodHRwOi8vd3d3LmQtdHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xh -c3NfM19jYV8yX2V2XzIwMDkuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+ -PPoeUSbrh/Yp3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 -nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNFCSuGdXzfX2lX -ANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7naxpeG0ILD5EJt/rDiZE4OJudA -NCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqXKVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVv -w9y4AyHqnxbxLFS1 ------END CERTIFICATE----- - -CA Disig Root R2 -================ ------BEGIN CERTIFICATE----- -MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw -EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp -ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sx -EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp -c2lnIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbC -w3OeNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNHPWSb6Wia -xswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3Ix2ymrdMxp7zo5eFm1tL7 -A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbeQTg06ov80egEFGEtQX6sx3dOy1FU+16S -GBsEWmjGycT6txOgmLcRK7fWV8x8nhfRyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqV -g8NTEQxzHQuyRpDRQjrOQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa -5Beny912H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJQfYE -koopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUDi/ZnWejBBhG93c+A -Ak9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORsnLMOPReisjQS1n6yqEm70XooQL6i -Fh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNV -HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5u -Qu0wDQYJKoZIhvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM -tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqfGopTpti72TVV -sRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkblvdhuDvEK7Z4bLQjb/D907Je -dR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W8 -1k/BfDxujRNt+3vrMNDcTa/F1balTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjx -mHHEt38OFdAlab0inSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01 -utI3gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18DrG5gPcFw0 -sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3OszMOl6W8KjptlwlCFtaOg -UxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8xL4ysEr3vQCj8KWefshNPZiTEUxnpHikV -7+ZtsH8tZ/3zbBt1RqPlShfppNcL ------END CERTIFICATE----- - -ACCVRAIZ1 -========= ------BEGIN CERTIFICATE----- -MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UEAwwJQUNDVlJB -SVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQswCQYDVQQGEwJFUzAeFw0xMTA1 -MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQBgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwH -UEtJQUNDVjENMAsGA1UECgwEQUNDVjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4IC -DwAwggIKAoICAQCbqau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gM -jmoYHtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWoG2ioPej0 -RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpAlHPrzg5XPAOBOp0KoVdD -aaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhrIA8wKFSVf+DuzgpmndFALW4ir50awQUZ -0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDG -WuzndN9wrqODJerWx5eHk6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs7 -8yM2x/474KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMOm3WR -5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpacXpkatcnYGMN285J -9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPluUsXQA+xtrn13k/c4LOsOxFwYIRK -Q26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYIKwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRw -Oi8vd3d3LmFjY3YuZXMvZmlsZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEu -Y3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 -VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeTVfZW6oHlNsyM -Hj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIGCCsGAQUFBwICMIIBFB6CARAA -QQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUAcgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBh -AO0AegAgAGQAZQAgAGwAYQAgAEEAQwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUA -YwBuAG8AbABvAGcA7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBj -AHQAcgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAAQwBQAFMA -IABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUAczAwBggrBgEFBQcCARYk -aHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2MuaHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0 -dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRtaW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2 -MV9kZXIuY3JsMA4GA1UdDwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZI -hvcNAQEFBQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdpD70E -R9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gUJyCpZET/LtZ1qmxN -YEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+mAM/EKXMRNt6GGT6d7hmKG9Ww7Y49 -nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepDvV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJ -TS+xJlsndQAJxGJ3KQhfnlmstn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3 -sCPdK6jT2iWH7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h -I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szAh1xA2syVP1Xg -Nce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xFd3+YJ5oyXSrjhO7FmGYvliAd -3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2HpPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3p -EfbRD0tVNEYqi4Y7 ------END CERTIFICATE----- - -TWCA Global Root CA -=================== ------BEGIN CERTIFICATE----- -MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcxEjAQBgNVBAoT -CVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMTVFdDQSBHbG9iYWwgUm9vdCBD -QTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQK -EwlUQUlXQU4tQ0ExEDAOBgNVBAsTB1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3Qg -Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2C -nJfF10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz0ALfUPZV -r2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfChMBwqoJimFb3u/Rk28OKR -Q4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbHzIh1HrtsBv+baz4X7GGqcXzGHaL3SekV -tTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1W -KKD+u4ZqyPpcC1jcxkt2yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99 -sy2sbZCilaLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYPoA/p -yJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQABDzfuBSO6N+pjWxn -kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI -zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC -AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g -cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn -LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M -8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg -/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg -lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP -A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m -i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 -EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 -zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= ------END CERTIFICATE----- - -TeliaSonera Root CA v1 -====================== ------BEGIN CERTIFICATE----- -MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE -CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcNMDcxMDE4 -MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwW -VGVsaWFTb25lcmEgUm9vdCBDQSB2MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+ -6yfwIaPzaSZVfp3FVRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA -3GV17CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+XZ75Ljo1k -B1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+/jXh7VB7qTCNGdMJjmhn -Xb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxH -oLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkmdtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3 -F0fUTPHSiXk+TT2YqGHeOh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJ -oWjiUIMusDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4pgd7 -gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fsslESl1MpWtTwEhDc -TwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQarMCpgKIv7NHfirZ1fpoeDVNAgMB -AAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qW -DNXr+nuqF+gTEjANBgkqhkiG9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNm -zqjMDfz1mgbldxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx -0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW -pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV -G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc -c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT -JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 -qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 -Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems -WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= ------END CERTIFICATE----- - -E-Tugra Certification Authority -=============================== ------BEGIN CERTIFICATE----- -MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w -DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls -ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN -ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw -NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx -QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl -cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD -DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd -hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5K -CKpbknSFQ9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEoq1+g -ElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3Dk14opz8n8Y4e0ypQ -BaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcHfC425lAcP9tDJMW/hkd5s3kc91r0 -E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsutdEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gz -rt48Ue7LE3wBf4QOXVGUnhMMti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAq -jqFGOjGY5RH8zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn -rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUXU8u3Zg5mTPj5 -dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6Jyr+zE7S6E5UMA8GA1UdEwEB -/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG -MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK -kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO -XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 -VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo -a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc -dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV -KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT -Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 -8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G -C7TbO6Orb1wdtn7os4I07QZcJA== ------END CERTIFICATE----- - -T-TeleSec GlobalRoot Class 2 -============================ ------BEGIN CERTIFICATE----- -MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM -IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU -cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx -MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz -dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD -ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ -SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F -vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970 -2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV -WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA -MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy -YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4 -r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf -vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR -3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN -9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== ------END CERTIFICATE----- - -Atos TrustedRoot 2011 -===================== ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU -cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 -MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG -A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV -hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr -54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ -DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 -HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR -z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R -l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ -bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB -CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h -k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kPDpFrdRbhIfzYJsdHt6bPWHJxfrrh -TZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pcmaHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a9 -61qn8FYiqTxlVMYVqL2Gns2Dlmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G -3mB/ufNPRJLvKrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed ------END CERTIFICATE----- - -QuoVadis Root CA 1 G3 -===================== ------BEGIN CERTIFICATE----- -MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQELBQAwSDELMAkG -A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv -b3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJN -MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDEg -RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCgvlAQjunybEC0BJyFuTHK3C3kEakE -PBtVwedYMB0ktMPvhd6MLOHBPd+C5k+tR4ds7FtJwUrVu4/sh6x/gpqG7D0DmVIB0jWerNrwU8lm -PNSsAgHaJNM7qAJGr6Qc4/hzWHa39g6QDbXwz8z6+cZM5cOGMAqNF34168Xfuw6cwI2H44g4hWf6 -Pser4BOcBRiYz5P1sZK0/CPTz9XEJ0ngnjybCKOLXSoh4Pw5qlPafX7PGglTvF0FBM+hSo+LdoIN -ofjSxxR3W5A2B4GbPgb6Ul5jxaYA/qXpUhtStZI5cgMJYr2wYBZupt0lwgNm3fME0UDiTouG9G/l -g6AnhF4EwfWQvTA9xO+oabw4m6SkltFi2mnAAZauy8RRNOoMqv8hjlmPSlzkYZqn0ukqeI1RPToV -7qJZjqlc3sX5kCLliEVx3ZGZbHqfPT2YfF72vhZooF6uCyP8Wg+qInYtyaEQHeTTRCOQiJ/GKubX -9ZqzWB4vMIkIG1SitZgj7Ah3HJVdYdHLiZxfokqRmu8hqkkWCKi9YSgxyXSthfbZxbGL0eUQMk1f -iyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KOTk0k+17kBL5yG6YnLUlamXrXXAkg -t3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOtzCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD -AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZI -hvcNAQELBQADggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC -MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2cDMT/uFPpiN3 -GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUNqXsCHKnQO18LwIE6PWThv6ct -Tr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP -+V04ikkwj+3x6xn0dxoxGE1nVGwvb2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh -3jRJjehZrJ3ydlo28hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fa -wx/kNSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNjZgKAvQU6 -O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhpq1467HxpvMc7hU6eFbm0 -FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFtnh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOV -hMJKzRwuJIczYOXD ------END CERTIFICATE----- - -QuoVadis Root CA 2 G3 -===================== ------BEGIN CERTIFICATE----- -MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAwSDELMAkG -A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv -b3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJN -MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIg -RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFh -ZiFfqq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMWn4rjyduY -NM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ymc5GQYaYDFCDy54ejiK2t -oIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+O7q414AB+6XrW7PFXmAqMaCvN+ggOp+o -MiwMzAkd056OXbxMmO7FGmh77FOm6RQ1o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+l -V0POKa2Mq1W/xPtbAd0jIaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZo -L1NesNKqIcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz8eQQ -sSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43ehvNURG3YBZwjgQQvD -6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l7ZizlWNof/k19N+IxWA1ksB8aRxh -lRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALGcC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTAD -AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZI -hvcNAQELBQADggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66 -AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RCroijQ1h5fq7K -pVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0GaW/ZZGYjeVYg3UQt4XAoeo0L9 -x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4nlv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgz -dWqTHBLmYF5vHX/JHyPLhGGfHoJE+V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6X -U/IyAgkwo1jwDQHVcsaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+Nw -mNtddbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNgKCLjsZWD -zYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeMHVOyToV7BjjHLPj4sHKN -JeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4WSr2Rz0ZiC3oheGe7IUIarFsNMkd7Egr -O3jtZsSOeWmD3n+M ------END CERTIFICATE----- - -QuoVadis Root CA 3 G3 -===================== ------BEGIN CERTIFICATE----- -MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7r0DoM8Sah0wDQYJKoZIhvcNAQELBQAwSDELMAkG -A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv -b3QgQ0EgMyBHMzAeFw0xMjAxMTIyMDI2MzJaFw00MjAxMTIyMDI2MzJaMEgxCzAJBgNVBAYTAkJN -MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDMg -RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCzyw4QZ47qFJenMioKVjZ/aEzHs286 -IxSR/xl/pcqs7rN2nXrpixurazHb+gtTTK/FpRp5PIpM/6zfJd5O2YIyC0TeytuMrKNuFoM7pmRL -Mon7FhY4futD4tN0SsJiCnMK3UmzV9KwCoWdcTzeo8vAMvMBOSBDGzXRU7Ox7sWTaYI+FrUoRqHe -6okJ7UO4BUaKhvVZR74bbwEhELn9qdIoyhA5CcoTNs+cra1AdHkrAj80//ogaX3T7mH1urPnMNA3 -I4ZyYUUpSFlob3emLoG+B01vr87ERRORFHAGjx+f+IdpsQ7vw4kZ6+ocYfx6bIrc1gMLnia6Et3U -VDmrJqMz6nWB2i3ND0/kA9HvFZcba5DFApCTZgIhsUfei5pKgLlVj7WiL8DWM2fafsSntARE60f7 -5li59wzweyuxwHApw0BiLTtIadwjPEjrewl5qW3aqDCYz4ByA4imW0aucnl8CAMhZa634RylsSqi -Md5mBPfAdOhx3v89WcyWJhKLhZVXGqtrdQtEPREoPHtht+KPZ0/l7DxMYIBpVzgeAVuNVejH38DM -dyM0SXV89pgR6y3e7UEuFAUCf+D+IOs15xGsIs5XPd7JMG0QA4XN8f+MFrXBsj6IbGB/kE+V9/Yt -rQE5BwT6dYB9v0lQ7e/JxHwc64B+27bQ3RP+ydOc17KXqQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD -AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZI -hvcNAQELBQADggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px -KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnIFUBhynLWcKzS -t/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5WvvoxXqA/4Ti2Tk08HS6IT7SdEQ -TXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFgu/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9Du -DcpmvJRPpq3t/O5jrFc/ZSXPsoaP0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGib -Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD -hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX -0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW -dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2 -PpxxVJkES/1Y+Zj0 ------END CERTIFICATE----- - -DigiCert Assured ID Root G2 -=========================== ------BEGIN CERTIFICATE----- -MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw -IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw -MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL -ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH -35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq -bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw -VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP -YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn -lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO -w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv -0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz -d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW -hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M -jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo -IhNzbM8m9Yop5w== ------END CERTIFICATE----- - -DigiCert Assured ID Root G3 -=========================== ------BEGIN CERTIFICATE----- -MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV -UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD -VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 -MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ -BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb -RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs -KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF -UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy -YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy -1vUhZscv6pZjamVFkpUBtA== ------END CERTIFICATE----- - -DigiCert Global Root G2 -======================= ------BEGIN CERTIFICATE----- -MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw -HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx -MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 -dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ -kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO -3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV -BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM -UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB -o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu -5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr -F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U -WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH -QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/ -iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl -MrY= ------END CERTIFICATE----- - -DigiCert Global Root G3 -======================= ------BEGIN CERTIFICATE----- -MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQGEwJV -UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYD -VQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAw -MDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5k -aWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0C -AQYFK4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FGfp4tn+6O -YwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPOZ9wj/wMco+I+o0IwQDAP -BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNp -Yim8S8YwCgYIKoZIzj0EAwMDaAAwZQIxAK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y -3maTD/HMsQmP3Wyr+mt/oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34 -VOKa5Vt8sycX ------END CERTIFICATE----- - -DigiCert Trusted Root G4 -======================== ------BEGIN CERTIFICATE----- -MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBiMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEw -HwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 -MTIwMDAwWjBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0G -CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3yithZwuEp -pz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1Ifxp4VpX6+n6lXFllVcq9o -k3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDVySAdYyktzuxeTsiT+CFhmzTrBcZe7Fsa -vOvJz82sNEBfsXpm7nfISKhmV1efVFiODCu3T6cw2Vbuyntd463JT17lNecxy9qTXtyOj4DatpGY -QJB5w3jHtrHEtWoYOAMQjdjUN6QuBX2I9YI+EJFwq1WCQTLX2wRzKm6RAXwhTNS8rhsDdV14Ztk6 -MUSaM0C/CNdaSaTC5qmgZ92kJ7yhTzm1EVgX9yRcRo9k98FpiHaYdj1ZXUJ2h4mXaXpI8OCiEhtm -mnTK3kse5w5jrubU75KSOp493ADkRSWJtppEGSt+wJS00mFt6zPZxd9LBADMfRyVw4/3IbKyEbe7 -f/LVjHAsQWCqsWMYRJUadmJ+9oCw++hkpjPRiQfhvbfmQ6QYuKZ3AeEPlAwhHbJUKSWJbOUOUlFH -dL4mrLZBdd56rF+NP8m800ERElvlEFDrMcXKchYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8 -oR7FwI+isX4KJpn15GkvmB0t9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud -DwEB/wQEAwIBhjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD -ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2SV1EY+CtnJYY -ZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd+SeuMIW59mdNOj6PWTkiU0Tr -yF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWcfFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy -7zBZLq7gcfJW5GqXb5JQbZaNaHqasjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iah -ixTXTBmyUEFxPT9NcCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN -5r5N0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie4u1Ki7wb -/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mIr/OSmbaz5mEP0oUA51Aa -5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tK -G48BtieVU+i2iW1bvGjUI+iLUaJW+fCmgKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP -82Z+ ------END CERTIFICATE----- - -COMODO RSA Certification Authority -================================== ------BEGIN CERTIFICATE----- -MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UE -BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG -A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlv -biBBdXRob3JpdHkwHhcNMTAwMTE5MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMC -R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE -ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR6FSS0gpWsawNJN3Fz0Rn -dJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8Xpz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZ -FGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+ -5eNu/Nio5JIk2kNrYrhV/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pG -x8cgoLEfZd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z+pUX -2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7wqP/0uK3pN/u6uPQL -OvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZahSL0896+1DSJMwBGB7FY79tOi4lu3 -sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVICu9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+C -GCe01a60y1Dma/RMhnEw6abfFobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5 -WdYgGq/yapiqcrxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E -FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w -DQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvlwFTPoCWOAvn9sKIN9SCYPBMt -rFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+ -nq6PK7o9mfjYcwlYRm6mnPTXJ9OV2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSg -tZx8jb8uk2IntznaFxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwW -sRqZCuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiKboHGhfKp -pC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmckejkk9u+UJueBPSZI9FoJA -zMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHq -ZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk52 -7RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I -LaZRfyHBNVOFBkpdn627G190 ------END CERTIFICATE----- - -USERTrust RSA Certification Authority -===================================== ------BEGIN CERTIFICATE----- -MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkGA1UE -BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK -ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UE -BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK -ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCAEmUXNg7D2wiz -0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2j -Y0K2dvKpOyuR+OJv0OwWIJAJPuLodMkYtJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFn -RghRy4YUVD+8M/5+bJz/Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O -+T23LLb2VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT79uq -/nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6c0Plfg6lZrEpfDKE -Y1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmTYo61Zs8liM2EuLE/pDkP2QKe6xJM -lXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97lc6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8 -yexDJtC/QV9AqURE9JnnV4eeUB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+ -eLf8ZxXhyVeEHg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd -BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF -MAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPFUp/L+M+ZBn8b2kMVn54CVVeW -FPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KOVWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ -7l8wXEskEVX/JJpuXior7gtNn3/3ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQ -Eg9zKC7F4iRO/Fjs8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM -8WcRiQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYzeSf7dNXGi -FSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZXHlKYC6SQK5MNyosycdi -yA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9c -J2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRBVXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGw -sAvgnEzDHNb842m1R0aBL6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gx -Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9 ------END CERTIFICATE----- - -USERTrust ECC Certification Authority -===================================== ------BEGIN CERTIFICATE----- -MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDELMAkGA1UEBhMC -VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU -aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv -biBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMC -VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU -aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv -biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqfloI+d61SRvU8Za2EurxtW2 -0eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinngo4N+LZfQYcTxmdwlkWOrfzCjtHDix6Ez -nPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0GA1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNV -HQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBB -HU6+4WMBzzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbWRNZu -9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= ------END CERTIFICATE----- - -GlobalSign ECC Root CA - R4 -=========================== ------BEGIN CERTIFICATE----- -MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEkMCIGA1UECxMb -R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD -EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb -R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD -EwpHbG9iYWxTaWduMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprl -OQcJFspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAwDgYDVR0P -AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61FuOJAf/sKbvu+M8k8o4TV -MAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGXkPoUVy0D7O48027KqGx2vKLeuwIgJ6iF -JzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q= ------END CERTIFICATE----- - -GlobalSign ECC Root CA - R5 -=========================== ------BEGIN CERTIFICATE----- -MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb -R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD -EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb -R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD -EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6 -SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS -h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd -BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx -uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 -yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 ------END CERTIFICATE----- - -Staat der Nederlanden Root CA - G3 -================================== ------BEGIN CERTIFICATE----- -MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE -CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g -Um9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloXDTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMC -TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l -ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4y -olQPcPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WWIkYFsO2t -x1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqXxz8ecAgwoNzFs21v0IJy -EavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFyKJLZWyNtZrVtB0LrpjPOktvA9mxjeM3K -Tj215VKb8b475lRgsGYeCasH/lSJEULR9yS6YHgamPfJEf0WwTUaVHXvQ9Plrk7O53vDxk5hUUur -mkVLoR9BvUhTFXFkC4az5S6+zqQbwSmEorXLCCN2QyIkHxcE1G6cxvx/K2Ya7Irl1s9N9WMJtxU5 -1nus6+N86U78dULI7ViVDAZCopz35HCz33JvWjdAidiFpNfxC95DGdRKWCyMijmev4SH8RY7Ngzp -07TKbBlBUgmhHbBqv4LvcFEhMtwFdozL92TkA1CvjJFnq8Xy7ljY3r735zHPbMk7ccHViLVlvMDo -FxcHErVc0qsgk7TmgoNwNsXNo42ti+yjwUOH5kPiNL6VizXtBznaqB16nzaeErAMZRKQFWDZJkBE -41ZgpRDUajz9QdwOWke275dhdU/Z/seyHdTtXUmzqWrLZoQT1Vyg3N9udwbRcXXIV2+vD3dbAgMB -AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRUrfrHkleu -yjWcLhL75LpdINyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD -U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwpLiniyMMB8jPq -KqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8Ipf3YF3qKS9Ysr1YvY2WTxB1 -v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixpgZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA -8KCWAg8zxXHzniN9lLf9OtMJgwYh/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b -8KKaa8MFSu1BYBQw0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0r -mj1AfsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq4BZ+Extq -1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR1VmiiXTTn74eS9fGbbeI -JG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/QFH1T/U67cjF68IeHRaVesd+QnGTbksV -tzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM94B7IWcnMFk= ------END CERTIFICATE----- - -Staat der Nederlanden EV Root CA -================================ ------BEGIN CERTIFICATE----- -MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE -CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g -RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M -MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl -cmxhbmRlbiBFViBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkk -SzrSM4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nCUiY4iKTW -O0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3dZ//BYY1jTw+bbRcwJu+r -0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46prfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8 -Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13lpJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gV -XJrm0w912fxBmJc+qiXbj5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr -08C+eKxCKFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS/ZbV -0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0XcgOPvZuM5l5Tnrmd -74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH1vI4gnPah1vlPNOePqc7nvQDs/nx -fRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrPpx9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwa -ivsnuL8wbqg7MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI -eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u2dfOWBfoqSmu -c0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHSv4ilf0X8rLiltTMMgsT7B/Zq -5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTCwPTxGfARKbalGAKb12NMcIxHowNDXLldRqAN -b/9Zjr7dn3LDWyvfjFvO5QxGbJKyCqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tN -f1zuacpzEPuKqf2evTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi -5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIaGl6I6lD4 -WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK -DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy -eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg== ------END CERTIFICATE----- - -IdenTrust Commercial Root CA 1 -============================== ------BEGIN CERTIFICATE----- -MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG -EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS -b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES -MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENB -IDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ld -hNlT3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU+ehcCuz/ -mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gpS0l4PJNgiCL8mdo2yMKi -1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1bVoE/c40yiTcdCMbXTMTEl3EASX2MN0C -XZ/g1Ue9tOsbobtJSdifWwLziuQkkORiT0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl -3ZBWzvurpWCdxJ35UrCLvYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzy -NeVJSQjKVsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZKdHzV -WYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHTc+XvvqDtMwt0viAg -xGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hvl7yTmvmcEpB4eoCHFddydJxVdHix -uuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5NiGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMC -AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZI -hvcNAQELBQADggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH -6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwtLRvM7Kqas6pg -ghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93nAbowacYXVKV7cndJZ5t+qnt -ozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmV -YjzlVYA211QC//G5Xc7UI2/YRYRKW2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUX -feu+h1sXIFRRk0pTAwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/ro -kTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG4iZZRHUe -2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZmUlO+KWA2yUPHGNiiskz -Z2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R -cGzM7vRX+Bi6hG6H ------END CERTIFICATE----- - -IdenTrust Public Sector Root CA 1 -================================= ------BEGIN CERTIFICATE----- -MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG -EwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3Rv -ciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcNMzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJV -UzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBS -b290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTy -P4o7ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGyRBb06tD6 -Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlSbdsHyo+1W/CD80/HLaXI -rcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF/YTLNiCBWS2ab21ISGHKTN9T0a9SvESf -qy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoS -mJxZZoY+rfGwyj4GD3vwEUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFn -ol57plzy9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9VGxyh -LrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ2fjXctscvG29ZV/v -iDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsVWaFHVCkugyhfHMKiq3IXAAaOReyL -4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gDW/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8B -Af8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMw -DQYJKoZIhvcNAQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj -t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHVDRDtfULAj+7A -mgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9TaDKQGXSc3z1i9kKlT/YPyNt -GtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8GlwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFt -m6/n6J91eEyrRjuazr8FGF1NFTwWmhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMx -NRF4eKLg6TCMf4DfWN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4 -Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJtshquDDI -ajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhAGaQdp/lLQzfcaFpPz+vC -ZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ -3Wl9af0AVqW3rLatt8o+Ae+c ------END CERTIFICATE----- - -Entrust Root Certification Authority - G2 -========================================= ------BEGIN CERTIFICATE----- -MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAUBgNV -BAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVy -bXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ug -b25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIw -HhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoT -DUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMx -OTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25s -eTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwggEi -MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP -/vaCeb9zYQYKpSfYs1/TRU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXz -HHfV1IWNcCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hWwcKU -s/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1U1+cPvQXLOZprE4y -TGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0jaWvYkxN4FisZDQSA/i2jZRjJKRx -AgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ6 -0B7vfec7aVHUbI2fkBJmqzANBgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5Z -iXMRrEPR9RP/jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ -Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v1fN2D807iDgi -nWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4RnAuknZoh8/CbCzB428Hch0P+ -vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xO -e4pIb4tF9g== ------END CERTIFICATE----- - -Entrust Root Certification Authority - EC1 -========================================== ------BEGIN CERTIFICATE----- -MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx -FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn -YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl -ZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYw -FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2Fs -LXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQg -dXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt -IEVDMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHy -AsWfoPZb1YsGGYZPUxBtByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef -9eNi1KlHBz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE -FLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVCR98crlOZF7ZvHH3h -vxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nXhTcGtXsI/esni0qU+eH6p44mCOh8 -kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G ------END CERTIFICATE----- - -CFCA EV ROOT -============ ------BEGIN CERTIFICATE----- -MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJDTjEwMC4GA1UE -CgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNB -IEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkxMjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEw -MC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQD -DAxDRkNBIEVWIFJPT1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnV -BU03sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpLTIpTUnrD -7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5/ZOkVIBMUtRSqy5J35DN -uF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp7hZZLDRJGqgG16iI0gNyejLi6mhNbiyW -ZXvKWfry4t3uMCz7zEasxGPrb382KzRzEpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7 -xzbh72fROdOXW3NiGUgthxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9f -py25IGvPa931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqotaK8K -gWU6cMGbrU1tVMoqLUuFG7OA5nBFDWteNfB/O7ic5ARwiRIlk9oKmSJgamNgTnYGmE69g60dWIol -hdLHZR4tjsbftsbhf4oEIRUpdPA+nJCdDC7xij5aqgwJHsfVPKPtl8MeNPo4+QgO48BdK4PRVmrJ -tqhUUy54Mmc9gn900PvhtgVguXDbjgv5E1hvcWAQUhC5wUEJ73IfZzF4/5YFjQIDAQABo2MwYTAf -BgNVHSMEGDAWgBTj/i39KNALtbq2osS/BqoFjJP7LzAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB -/wQEAwIBBjAdBgNVHQ4EFgQU4/4t/SjQC7W6tqLEvwaqBYyT+y8wDQYJKoZIhvcNAQELBQADggIB -ACXGumvrh8vegjmWPfBEp2uEcwPenStPuiB/vHiyz5ewG5zz13ku9Ui20vsXiObTej/tUxPQ4i9q -ecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdLjOztUmCypAbqTuv0axn96/Ua -4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBSESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sG -E5uPhnEFtC+NiWYzKXZUmhH4J/qyP5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfX -BDrDMlI1Dlb4pd19xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjn -aH9dCi77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN5mydLIhy -PDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe/v5WOaHIz16eGWRGENoX -kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C -ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su ------END CERTIFICATE----- - -OISTE WISeKey Global Root GB CA -=============================== ------BEGIN CERTIFICATE----- -MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBtMQswCQYDVQQG -EwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl -ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAw -MzJaFw0zOTEyMDExNTEwMzFaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYD -VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEds -b2JhbCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3HEokKtaX -scriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGxWuR51jIjK+FTzJlFXHtP -rby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk -9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNku7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4o -Qnc/nSMbsrY9gBQHTC5P99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvg -GUpuuy9rM2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB -/zAdBgNVHQ4EFgQUNQ/INmNe4qPs+TtmFc5RUuORmj0wEAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZI -hvcNAQELBQADggEBAEBM+4eymYGQfp3FsLAmzYh7KzKNbrghcViXfa43FK8+5/ea4n32cZiZBKpD -dHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0 -VQreUGdNZtGn//3ZwLWoo4rOZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEui -HZeeevJuQHHfaPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic -Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM= ------END CERTIFICATE----- - -SZAFIR ROOT CA2 -=============== ------BEGIN CERTIFICATE----- -MIIDcjCCAlqgAwIBAgIUPopdB+xV0jLVt+O2XwHrLdzk1uQwDQYJKoZIhvcNAQELBQAwUTELMAkG -A1UEBhMCUEwxKDAmBgNVBAoMH0tyYWpvd2EgSXpiYSBSb3psaWN6ZW5pb3dhIFMuQS4xGDAWBgNV -BAMMD1NaQUZJUiBST09UIENBMjAeFw0xNTEwMTkwNzQzMzBaFw0zNTEwMTkwNzQzMzBaMFExCzAJ -BgNVBAYTAlBMMSgwJgYDVQQKDB9LcmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMRgwFgYD -VQQDDA9TWkFGSVIgUk9PVCBDQTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3vD5Q -qEvNQLXOYeeWyrSh2gwisPq1e3YAd4wLz32ohswmUeQgPYUM1ljj5/QqGJ3a0a4m7utT3PSQ1hNK -DJA8w/Ta0o4NkjrcsbH/ON7Dui1fgLkCvUqdGw+0w8LBZwPd3BucPbOw3gAeqDRHu5rr/gsUvTaE -2g0gv/pby6kWIK05YO4vdbbnl5z5Pv1+TW9NL++IDWr63fE9biCloBK0TXC5ztdyO4mTp4CEHCdJ -ckm1/zuVnsHMyAHs6A6KCpbns6aH5db5BSsNl0BwPLqsdVqc1U2dAgrSS5tmS0YHF2Wtn2yIANwi -ieDhZNRnvDF5YTy7ykHNXGoAyDw4jlivAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0P -AQH/BAQDAgEGMB0GA1UdDgQWBBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsFAAOC -AQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw8PRBEew/R40/cof5 -O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOGnXkZ7/e7DDWQw4rtTw/1zBLZpD67 -oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCPoky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul -4+vJhaAlIDf7js4MNIThPIGyd05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6 -+/NNIxuZMzSgLvWpCz/UXeHPhJ/iGcJfitYgHuNztw== ------END CERTIFICATE----- - -Certum Trusted Network CA 2 -=========================== ------BEGIN CERTIFICATE----- -MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCBgDELMAkGA1UE -BhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMuQS4xJzAlBgNVBAsTHkNlcnR1 -bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIGA1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29y -ayBDQSAyMCIYDzIwMTExMDA2MDgzOTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQ -TDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENl -cnRpZmljYXRpb24gQXV0aG9yaXR5MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENB -IDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC9+Xj45tWADGSdhhuWZGc/IjoedQF9 -7/tcZ4zJzFxrqZHmuULlIEub2pt7uZld2ZuAS9eEQCsn0+i6MLs+CRqnSZXvK0AkwpfHp+6bJe+o -CgCXhVqqndwpyeI1B+twTUrWwbNWuKFBOJvR+zF/j+Bf4bE/D44WSWDXBo0Y+aomEKsq09DRZ40b -Rr5HMNUuctHFY9rnY3lEfktjJImGLjQ/KUxSiyqnwOKRKIm5wFv5HdnnJ63/mgKXwcZQkpsCLL2p -uTRZCr+ESv/f/rOf69me4Jgj7KZrdxYq28ytOxykh9xGc14ZYmhFV+SQgkK7QtbwYeDBoz1mo130 -GO6IyY0XRSmZMnUCMe4pJshrAua1YkV/NxVaI2iJ1D7eTiew8EAMvE0Xy02isx7QBlrd9pPPV3WZ -9fqGGmd4s7+W/jTcvedSVuWz5XV710GRBdxdaeOVDUO5/IOWOZV7bIBaTxNyxtd9KXpEulKkKtVB -Rgkg/iKgtlswjbyJDNXXcPiHUv3a76xRLgezTv7QCdpw75j6VuZt27VXS9zlLCUVyJ4ueE742pye -hizKV/Ma5ciSixqClnrDvFASadgOWkaLOusm+iPJtrCBvkIApPjW/jAux9JG9uWOdf3yzLnQh1vM -BhBgu4M1t15n3kfsmUjxpKEV/q2MYo45VU85FrmxY53/twIDAQABo0IwQDAPBgNVHRMBAf8EBTAD -AQH/MB0GA1UdDgQWBBS2oVQ5AsOgP46KvPrU+Bym0ToO/TAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZI -hvcNAQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQF/xlhMcQSZDe28cmk4gmb3DW -Al45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTfCVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuA -L55MYIR4PSFk1vtBHxgP58l1cb29XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMo -clm2q8KMZiYcdywmdjWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tM -pkT/WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jbAoJnwTnb -w3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksqP/ujmv5zMnHCnsZy4Ypo -J/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Kob7a6bINDd82Kkhehnlt4Fj1F4jNy3eFm -ypnTycUm/Q1oBEauttmbjL4ZvrHG8hnjXALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLX -is7VmFxWlgPF7ncGNf/P5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7 -zAYspsbiDrW5viSP ------END CERTIFICATE----- - -Hellenic Academic and Research Institutions RootCA 2015 -======================================================= ------BEGIN CERTIFICATE----- -MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcT -BkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0 -aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNl -YXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAx -MTIxWjCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMg -QWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNV -BAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIw -MTUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDC+Kk/G4n8PDwEXT2QNrCROnk8Zlrv -bTkBSRq0t89/TSNTt5AA4xMqKKYx8ZEA4yjsriFBzh/a/X0SWwGDD7mwX5nh8hKDgE0GPt+sr+eh -iGsxr/CL0BgzuNtFajT0AoAkKAoCFZVedioNmToUW/bLy1O8E00BiDeUJRtCvCLYjqOWXjrZMts+ -6PAQZe104S+nfK8nNLspfZu2zwnI5dMK/IhlZXQK3HMcXM1AsRzUtoSMTFDPaI6oWa7CJ06CojXd -FPQf/7J31Ycvqm59JCfnxssm5uX+Zwdj2EUN3TpZZTlYepKZcj2chF6IIbjV9Cz82XBST3i4vTwr -i5WY9bPRaM8gFH5MXF/ni+X1NYEZN9cRCLdmvtNKzoNXADrDgfgXy5I2XdGj2HUb4Ysn6npIQf1F -GQatJ5lOwXBH3bWfgVMS5bGMSF0xQxfjjMZ6Y5ZLKTBOhE5iGV48zpeQpX8B653g+IuJ3SWYPZK2 -fu/Z8VFRfS0myGlZYeCsargqNhEEelC9MoS+L9xy1dcdFkfkR2YgP/SWxa+OAXqlD3pk9Q0Yh9mu -iNX6hME6wGkoLfINaFGq46V3xqSQDqE3izEjR8EJCOtu93ib14L8hCCZSRm2Ekax+0VVFqmjZayc -Bw/qa9wfLgZy7IaIEuQt218FL+TwA9MmM+eAws1CoRc0CwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD -AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVdctA4GGqd83EkVAswDQYJKoZI -hvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0IXtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg2mF+ -D1hYc2Ryx+hFjtyp8iY/xnmMsVMIM4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrM -d/K4kPFox/la/vot9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+y -d+2VZ5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/eaj8GsGsVn -82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnhX9izjFk0WaSrT2y7Hxjb -davYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQl033DlZdwJVqwjbDG2jJ9SrcR5q+ss7F -Jej6A7na+RZukYT1HCjI/CbM1xyQVqdfbzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVt -J94Cj8rDtSvK6evIIVM4pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGa -JI7ZjnHKe7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0vm9q -p/UsQu0yrbYhnr68 ------END CERTIFICATE----- - -Hellenic Academic and Research Institutions ECC RootCA 2015 -=========================================================== ------BEGIN CERTIFICATE----- -MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0 -aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u -cyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJj -aCBJbnN0aXR1dGlvbnMgRUNDIFJvb3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEw -MzcxMlowgaoxCzAJBgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmlj -IEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUQwQgYD -VQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIEVDQyBSb290 -Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKgQehLgoRc4vgxEZmGZE4JJS+dQS8KrjVP -dJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJajq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoK -Vlp8aQuqgAkkbH7BRqNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O -BBYEFLQiC4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaeplSTA -GiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7SofTUwJCA3sS61kFyjn -dc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR ------END CERTIFICATE----- - -ISRG Root X1 -============ ------BEGIN CERTIFICATE----- -MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAwTzELMAkGA1UE -BhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2VhcmNoIEdyb3VwMRUwEwYDVQQD -EwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQG -EwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMT -DElTUkcgUm9vdCBYMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54r -Vygch77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+0TM8ukj1 -3Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6UA5/TR5d8mUgjU+g4rk8K -b4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sWT8KOEUt+zwvo/7V3LvSye0rgTBIlDHCN -Aymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyHB5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ -4Q7e2RCOFvu396j3x+UCB5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf -1b0SHzUvKBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWnOlFu -hjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTnjh8BCNAw1FtxNrQH -usEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbwqHyGO0aoSCqI3Haadr8faqU9GY/r -OPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CIrU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4G -A1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY -9umbbjANBgkqhkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL -ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ3BebYhtF8GaV -0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KKNFtY2PwByVS5uCbMiogziUwt -hDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJw -TdwJx4nLCgdNbOhdjsnvzqvHu7UrTkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nx -e5AW0wdeRlN8NwdCjNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZA -JzVcoyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq4RgqsahD -YVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPAmRGunUHBcnWEvgJBQl9n -JEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57demyPxgcYxn/eR44/KJ4EBs+lVDR3veyJ -m+kXQ99b21/+jh5Xos1AnX5iItreGCc= ------END CERTIFICATE----- - -AC RAIZ FNMT-RCM -================ ------BEGIN CERTIFICATE----- -MIIFgzCCA2ugAwIBAgIPXZONMGc2yAYdGsdUhGkHMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNVBAYT -AkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTTAeFw0wODEw -MjkxNTU5NTZaFw0zMDAxMDEwMDAwMDBaMDsxCzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJD -TTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC -ggIBALpxgHpMhm5/yBNtwMZ9HACXjywMI7sQmkCpGreHiPibVmr75nuOi5KOpyVdWRHbNi63URcf -qQgfBBckWKo3Shjf5TnUV/3XwSyRAZHiItQDwFj8d0fsjz50Q7qsNI1NOHZnjrDIbzAzWHFctPVr -btQBULgTfmxKo0nRIBnuvMApGGWn3v7v3QqQIecaZ5JCEJhfTzC8PhxFtBDXaEAUwED653cXeuYL -j2VbPNmaUtu1vZ5Gzz3rkQUCwJaydkxNEJY7kvqcfw+Z374jNUUeAlz+taibmSXaXvMiwzn15Cou -08YfxGyqxRxqAQVKL9LFwag0Jl1mpdICIfkYtwb1TplvqKtMUejPUBjFd8g5CSxJkjKZqLsXF3mw -WsXmo8RZZUc1g16p6DULmbvkzSDGm0oGObVo/CK67lWMK07q87Hj/LaZmtVC+nFNCM+HHmpxffnT -tOmlcYF7wk5HlqX2doWjKI/pgG6BU6VtX7hI+cL5NqYuSf+4lsKMB7ObiFj86xsc3i1w4peSMKGJ -47xVqCfWS+2QrYv6YyVZLag13cqXM7zlzced0ezvXg5KkAYmY6252TUtB7p2ZSysV4999AeU14EC -ll2jB0nVetBX+RvnU0Z1qrB5QstocQjpYL05ac70r8NWQMetUqIJ5G+GR4of6ygnXYMgrwTJbFaa -i0b1AgMBAAGjgYMwgYAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE -FPd9xf3E6Jobd2Sn9R2gzL+HYJptMD4GA1UdIAQ3MDUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1o -dHRwOi8vd3d3LmNlcnQuZm5tdC5lcy9kcGNzLzANBgkqhkiG9w0BAQsFAAOCAgEAB5BK3/MjTvDD -nFFlm5wioooMhfNzKWtN/gHiqQxjAb8EZ6WdmF/9ARP67Jpi6Yb+tmLSbkyU+8B1RXxlDPiyN8+s -D8+Nb/kZ94/sHvJwnvDKuO+3/3Y3dlv2bojzr2IyIpMNOmqOFGYMLVN0V2Ue1bLdI4E7pWYjJ2cJ -j+F3qkPNZVEI7VFY/uY5+ctHhKQV8Xa7pO6kO8Rf77IzlhEYt8llvhjho6Tc+hj507wTmzl6NLrT -Qfv6MooqtyuGC2mDOL7Nii4LcK2NJpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71uSANA+iW -+YJF1DngoABd15jmfZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8TxxuBEOb+dY7 -Ixjp6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp1txyM/1d -8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B9kiABdcPUXmsEKvU7ANm -5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wokRqEIr9baRRmW1FMdW4R58MD3R++Lj8UG -rp1MYp3/RgT408m2ECVAdf4WqslKYIYvuu8wd+RU4riEmViAqhOLUTpPSPaLtrM= ------END CERTIFICATE----- - -Amazon Root CA 1 -================ ------BEGIN CERTIFICATE----- -MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsFADA5MQswCQYD -VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAxMB4XDTE1 -MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpv -bjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBALJ4gHHKeNXjca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgH -FzZM9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qwIFAGbHrQ -gLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6VOujw5H5SNz/0egwLX0t -dHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L93FcXmn/6pUCyziKrlA4b9v7LWIbxcce -VOF34GfID5yHI9Y/QCB/IIDEgEw+OyQmjgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB -/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3 -DQEBCwUAA4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDIU5PM -CCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUsN+gDS63pYaACbvXy -8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vvo/ufQJVtMVT8QtPHRh8jrdkPSHCa -2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2 -xJNDd2ZhwLnoQdeXeGADbkpyrqXRfboQnoZsG4q5WTP468SQvvG5 ------END CERTIFICATE----- - -Amazon Root CA 2 -================ ------BEGIN CERTIFICATE----- -MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwFADA5MQswCQYD -VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAyMB4XDTE1 -MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpv -bjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC -ggIBAK2Wny2cSkxKgXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4 -kHbZW0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg1dKmSYXp -N+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eLfq0OQ6PBJTYv9K8nu+NQWpEjTj82R0Yiw9 -AElaKP4yRLuH3WUnAnE72kr3H9rN9yFVkE8P7K6C4Z9r2UXTu/Bfh+08LDmG2j/e7HJV63mjrdvd -fLC6HM783k81ds8P+HgfajZRRidhW+mez/CiVX18JYpvL7TFz4QuK/0NURBs+18bvBt+xa47mAEx -kv8LV/SasrlX6avvDXbR8O70zoan4G7ptGmh32n2M8ZpLpcTnqWHsFcQgTfJU7O7f/aS0ZzQGPSS -btqDT6ZjmUyl+17vIWR6IF9sZIUVyzfpYgwLKhbcAS4y2j5L9Z469hdAlO+ekQiG+r5jqFoz7Mt0 -Q5X5bGlSNscpb/xVA1wf+5+9R+vnSUeVC06JIglJ4PVhHvG/LopyboBZ/1c6+XUyo05f7O0oYtlN -c/LMgRdg7c3r3NunysV+Ar3yVAhU/bQtCSwXVEqY0VThUWcI0u1ufm8/0i2BWSlmy5A5lREedCf+ -3euvAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSw -DPBMMPQFWAJI/TPlUq9LhONmUjANBgkqhkiG9w0BAQwFAAOCAgEAqqiAjw54o+Ci1M3m9Zh6O+oA -A7CXDpO8Wqj2LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY -+gn0oJMsXdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kSk5Nrp+gvU5LE -YFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl7uxMMne0nxrpS10gxdr9HIcW -xkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygmbtmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQ -gj9sAq+uEjonljYE1x2igGOpm/HlurR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbW -aQbLU8uz/mtBzUF+fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoV -Yh63n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE76KlXIx3 -KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H9jVlpNMKVv/1F2Rs76gi -JUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT4PsJYGw= ------END CERTIFICATE----- - -Amazon Root CA 3 -================ ------BEGIN CERTIFICATE----- -MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5MQswCQYDVQQG -EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAzMB4XDTE1MDUy -NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ -MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZB -f8ANm+gBG1bG8lKlui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjr -Zt6jQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSrttvXBp43 -rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkrBqWTrBqYaGFy+uGh0Psc -eGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteMYyRIHN8wfdVoOw== ------END CERTIFICATE----- - -Amazon Root CA 4 -================ ------BEGIN CERTIFICATE----- -MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5MQswCQYDVQQG -EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSA0MB4XDTE1MDUy -NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ -MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN -/sGKe0uoe0ZLY7Bi9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri -83BkM6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV -HQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WBMAoGCCqGSM49BAMDA2gA -MGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlwCkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1 -AE47xDqUEpHJWEadIRNyp4iciuRMStuW1KyLa2tJElMzrdfkviT8tQp21KW8EA== ------END CERTIFICATE----- - -LuxTrust Global Root 2 -====================== ------BEGIN CERTIFICATE----- -MIIFwzCCA6ugAwIBAgIUCn6m30tEntpqJIWe5rgV0xZ/u7EwDQYJKoZIhvcNAQELBQAwRjELMAkG -A1UEBhMCTFUxFjAUBgNVBAoMDUx1eFRydXN0IFMuQS4xHzAdBgNVBAMMFkx1eFRydXN0IEdsb2Jh -bCBSb290IDIwHhcNMTUwMzA1MTMyMTU3WhcNMzUwMzA1MTMyMTU3WjBGMQswCQYDVQQGEwJMVTEW -MBQGA1UECgwNTHV4VHJ1c3QgUy5BLjEfMB0GA1UEAwwWTHV4VHJ1c3QgR2xvYmFsIFJvb3QgMjCC -AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANeFl78RmOnwYoNMPIf5U2o3C/IPPIfOb9wm -Kb3FibrJgz337spbxm1Jc7TJRqMbNBM/wYlFV/TZsfs2ZUv7COJIcRHIbjuend+JZTemhfY7RBi2 -xjcwYkSSl2l9QjAk5A0MiWtj3sXh306pFGxT4GHO9hcvHTy95iJMHZP1EMShduxq3sVs35a0VkBC -wGKSMKEtFZSg0iAGCW5qbeXrt77U8PEVfIvmTroTzEsnXpk8F12PgX8zPU/TPxvsXD/wPEx1bvKm -1Z3aLQdjAsZy6ZS8TEmVT4hSyNvoaYL4zDRbIvCGp4m9SAptZoFtyMhk+wHh9OHe2Z7d21vUKpkm -FRseTJIpgp7VkoGSQXAZ96Tlk0u8d2cx3Rz9MXANF5kM+Qw5GSoXtTBxVdUPrljhPS80m8+f9niF -wpN6cj5mj5wWEWCPnolvZ77gR1o7DJpni89Gxq44o/KnvObWhWszJHAiS8sIm7vI+AIpHb4gDEa/ -a4ebsypmQjVGbKq6rfmYe+lQVRQxv7HaLe2ArWgk+2mr2HETMOZns4dA/Yl+8kPREd8vZS9kzl8U -ubG/Mb2HeFpZZYiq/FkySIbWTLkpS5XTdvN3JW1CHDiDTf2jX5t/Lax5Gw5CMZdjpPuKadUiDTSQ -MC6otOBttpSsvItO13D8xTiOZCXhTTmQzsmHhFhxAgMBAAGjgagwgaUwDwYDVR0TAQH/BAUwAwEB -/zBCBgNVHSAEOzA5MDcGByuBKwEBAQowLDAqBggrBgEFBQcCARYeaHR0cHM6Ly9yZXBvc2l0b3J5 -Lmx1eHRydXN0Lmx1MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBT/GCh2+UgFLKGu8SsbK7JT -+Et8szAdBgNVHQ4EFgQU/xgodvlIBSyhrvErGyuyU/hLfLMwDQYJKoZIhvcNAQELBQADggIBAGoZ -FO1uecEsh9QNcH7X9njJCwROxLHOk3D+sFTAMs2ZMGQXvw/l4jP9BzZAcg4atmpZ1gDlaCDdLnIN -H2pkMSCEfUmmWjfrRcmF9dTHF5kH5ptV5AzoqbTOjFu1EVzPig4N1qx3gf4ynCSecs5U89BvolbW -7MM3LGVYvlcAGvI1+ut7MV3CwRI9loGIlonBWVx65n9wNOeD4rHh4bhY79SV5GCc8JaXcozrhAIu -ZY+kt9J/Z93I055cqqmkoCUUBpvsT34tC38ddfEz2O3OuHVtPlu5mB0xDVbYQw8wkbIEa91WvpWA -VWe+2M2D2RjuLg+GLZKecBPs3lHJQ3gCpU3I+V/EkVhGFndadKpAvAefMLmx9xIX3eP/JEAdemrR -TxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKrezrnK+T+Tb/mjuuqlPpmt -/f97mfVl7vBZKGfXkJWkE4SphMHozs51k2MavDzq1WQfLSoSOcbDWjLtR5EWDrw4wVDej8oqkDQc -7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31I -iyBMz2TWuJdGsE7RKlY6oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr ------END CERTIFICATE----- - -TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 -============================================= ------BEGIN CERTIFICATE----- -MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIxGDAWBgNVBAcT -D0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxpbXNlbCB2ZSBUZWtub2xvamlr -IEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0wKwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24g -TWVya2V6aSAtIEthbXUgU00xNjA0BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRp -ZmlrYXNpIC0gU3VydW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYD -VQQGEwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXllIEJpbGlt -c2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklUQUsxLTArBgNVBAsTJEth -bXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBTTTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11 -IFNNIFNTTCBLb2sgU2VydGlmaWthc2kgLSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAr3UwM6q7a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y8 -6Ij5iySrLqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INrN3wc -wv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2XYacQuFWQfw4tJzh0 -3+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/iSIzL+aFCr2lqBs23tPcLG07xxO9 -WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4fAJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQU -ZT/HiobGPN08VFw1+DrtUgxHV8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJ -KoZIhvcNAQELBQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh -AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPfIPP54+M638yc -lNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4lzwDGrpDxpa5RXI4s6ehlj2R -e37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0j -q5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= ------END CERTIFICATE----- - -GDCA TrustAUTH R5 ROOT -====================== ------BEGIN CERTIFICATE----- -MIIFiDCCA3CgAwIBAgIIfQmX/vBH6nowDQYJKoZIhvcNAQELBQAwYjELMAkGA1UEBhMCQ04xMjAw -BgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZIENPLixMVEQuMR8wHQYDVQQD -DBZHRENBIFRydXN0QVVUSCBSNSBST09UMB4XDTE0MTEyNjA1MTMxNVoXDTQwMTIzMTE1NTk1OVow -YjELMAkGA1UEBhMCQ04xMjAwBgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZ -IENPLixMVEQuMR8wHQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA2aMW8Mh0dHeb7zMNOwZ+Vfy1YI92hhJCfVZmPoiC7XJjDp6L3TQs -AlFRwxn9WVSEyfFrs0yw6ehGXTjGoqcuEVe6ghWinI9tsJlKCvLriXBjTnnEt1u9ol2x8kECK62p -OqPseQrsXzrj/e+APK00mxqriCZ7VqKChh/rNYmDf1+uKU49tm7srsHwJ5uu4/Ts765/94Y9cnrr -pftZTqfrlYwiOXnhLQiPzLyRuEH3FMEjqcOtmkVEs7LXLM3GKeJQEK5cy4KOFxg2fZfmiJqwTTQJ -9Cy5WmYqsBebnh52nUpmMUHfP/vFBu8btn4aRjb3ZGM74zkYI+dndRTVdVeSN72+ahsmUPI2JgaQ -xXABZG12ZuGR224HwGGALrIuL4xwp9E7PLOR5G62xDtw8mySlwnNR30YwPO7ng/Wi64HtloPzgsM -R6flPri9fcebNaBhlzpBdRfMK5Z3KpIhHtmVdiBnaM8Nvd/WHwlqmuLMc3GkL30SgLdTMEZeS1SZ -D2fJpcjyIMGC7J0R38IC+xo70e0gmu9lZJIQDSri3nDxGGeCjGHeuLzRL5z7D9Ar7Rt2ueQ5Vfj4 -oR24qoAATILnsn8JuLwwoC8N9VKejveSswoAHQBUlwbgsQfZxw9cZX08bVlX5O2ljelAU58VS6Bx -9hoh49pwBiFYFIeFd3mqgnkCAwEAAaNCMEAwHQYDVR0OBBYEFOLJQJ9NzuiaoXzPDj9lxSmIahlR -MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQDRSVfg -p8xoWLoBDysZzY2wYUWsEe1jUGn4H3++Fo/9nesLqjJHdtJnJO29fDMylyrHBYZmDRd9FBUb1Ov9 -H5r2XpdptxolpAqzkT9fNqyL7FeoPueBihhXOYV0GkLH6VsTX4/5COmSdI31R9KrO9b7eGZONn35 -6ZLpBN79SWP8bfsUcZNnL0dKt7n/HipzcEYwv1ryL3ml4Y0M2fmyYzeMN2WFcGpcWwlyua1jPLHd -+PwyvzeG5LuOmCd+uh8W4XAR8gPfJWIyJyYYMoSf/wA6E7qaTfRPuBRwIrHKK5DOKcFw9C+df/KQ -HtZa37dG/OaG+svgIHZ6uqbL9XzeYqWxi+7egmaKTjowHz+Ay60nugxe19CxVsp3cbK1daFQqUBD -F8Io2c9Si1vIY9RCPqAzekYu9wogRlR+ak8x8YF+QnQ4ZXMn7sZ8uI7XpTrXmKGcjBBV09tL7ECQ -8s1uV9JiDnxXk7Gnbc2dg7sq5+W2O3FYrf3RRbxake5TFW/TRQl1brqQXR4EzzffHqhmsYzmIGrv -/EhOdJhCrylvLmrH+33RZjEizIYAfmaDDEL0vTSSwxrqT8p+ck0LcIymSLumoRT2+1hEmRSuqguT -aaApJUqlyyvdimYHFngVV3Eb7PVHhPOeMTd61X8kreS8/f3MboPoDKi3QWwH3b08hpcv0g== ------END CERTIFICATE----- - -TrustCor RootCert CA-1 -====================== ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEBCwUAMIGkMQswCQYDVQQGEwJQQTEP -MA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3Ig -U3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3Jp -dHkxHzAdBgNVBAMMFlRydXN0Q29yIFJvb3RDZXJ0IENBLTEwHhcNMTYwMjA0MTIzMjE2WhcNMjkx -MjMxMTcyMzE2WjCBpDELMAkGA1UEBhMCUEExDzANBgNVBAgMBlBhbmFtYTEUMBIGA1UEBwwLUGFu -YW1hIENpdHkxJDAiBgNVBAoMG1RydXN0Q29yIFN5c3RlbXMgUy4gZGUgUi5MLjEnMCUGA1UECwwe -VHJ1c3RDb3IgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYDVQQDDBZUcnVzdENvciBSb290Q2Vy -dCBDQS0xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv463leLCJhJrMxnHQFgKq1mq -jQCj/IDHUHuO1CAmujIS2CNUSSUQIpidRtLByZ5OGy4sDjjzGiVoHKZaBeYei0i/mJZ0PmnK6bV4 -pQa81QBeCQryJ3pS/C3Vseq0iWEk8xoT26nPUu0MJLq5nux+AHT6k61sKZKuUbS701e/s/OojZz0 -JEsq1pme9J7+wH5COucLlVPat2gOkEz7cD+PSiyU8ybdY2mplNgQTsVHCJCZGxdNuWxu72CVEY4h -gLW9oHPY0LJ3xEXqWib7ZnZ2+AYfYW0PVcWDtxBWcgYHpfOxGgMFZA6dWorWhnAbJN7+KIor0Gqw -/Hqi3LJ5DotlDwIDAQABo2MwYTAdBgNVHQ4EFgQU7mtJPHo/DeOxCbeKyKsZn3MzUOcwHwYDVR0j -BBgwFoAU7mtJPHo/DeOxCbeKyKsZn3MzUOcwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AYYwDQYJKoZIhvcNAQELBQADggEBACUY1JGPE+6PHh0RU9otRCkZoB5rMZ5NDp6tPVxBb5UrJKF5 -mDo4Nvu7Zp5I/5CQ7z3UuJu0h3U/IJvOcs+hVcFNZKIZBqEHMwwLKeXx6quj7LUKdJDHfXLy11yf -ke+Ri7fc7Waiz45mO7yfOgLgJ90WmMCV1Aqk5IGadZQ1nJBfiDcGrVmVCrDRZ9MZyonnMlo2HD6C -qFqTvsbQZJG2z9m2GM/bftJlo6bEjhcxwft+dtvTheNYsnd6djtsL1Ac59v2Z3kf9YKVmgenFK+P -3CghZwnS1k1aHBkcjndcw5QkPTJrS37UeJSDvjdNzl/HHk484IkzlQsPpTLWPFp5LBk= ------END CERTIFICATE----- - -TrustCor RootCert CA-2 -====================== ------BEGIN CERTIFICATE----- -MIIGLzCCBBegAwIBAgIIJaHfyjPLWQIwDQYJKoZIhvcNAQELBQAwgaQxCzAJBgNVBAYTAlBBMQ8w -DQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQwIgYDVQQKDBtUcnVzdENvciBT -eXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRydXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0 -eTEfMB0GA1UEAwwWVHJ1c3RDb3IgUm9vdENlcnQgQ0EtMjAeFw0xNjAyMDQxMjMyMjNaFw0zNDEy -MzExNzI2MzlaMIGkMQswCQYDVQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5h -bWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U -cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRydXN0Q29yIFJvb3RDZXJ0 -IENBLTIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnIG7CKqJiJJWQdsg4foDSq8Gb -ZQWU9MEKENUCrO2fk8eHyLAnK0IMPQo+QVqedd2NyuCb7GgypGmSaIwLgQ5WoD4a3SwlFIIvl9Nk -RvRUqdw6VC0xK5mC8tkq1+9xALgxpL56JAfDQiDyitSSBBtlVkxs1Pu2YVpHI7TYabS3OtB0PAx1 -oYxOdqHp2yqlO/rOsP9+aij9JxzIsekp8VduZLTQwRVtDr4uDkbIXvRR/u8OYzo7cbrPb1nKDOOb -XUm4TOJXsZiKQlecdu/vvdFoqNL0Cbt3Nb4lggjEFixEIFapRBF37120Hapeaz6LMvYHL1cEksr1 -/p3C6eizjkxLAjHZ5DxIgif3GIJ2SDpxsROhOdUuxTTCHWKF3wP+TfSvPd9cW436cOGlfifHhi5q -jxLGhF5DUVCcGZt45vz27Ud+ez1m7xMTiF88oWP7+ayHNZ/zgp6kPwqcMWmLmaSISo5uZk3vFsQP -eSghYA2FFn3XVDjxklb9tTNMg9zXEJ9L/cb4Qr26fHMC4P99zVvh1Kxhe1fVSntb1IVYJ12/+Ctg -rKAmrhQhJ8Z3mjOAPF5GP/fDsaOGM8boXg25NSyqRsGFAnWAoOsk+xWq5Gd/bnc/9ASKL3x74xdh -8N0JqSDIvgmk0H5Ew7IwSjiqqewYmgeCK9u4nBit2uBGF6zPXQIDAQABo2MwYTAdBgNVHQ4EFgQU -2f4hQG6UnrybPZx9mCAZ5YwwYrIwHwYDVR0jBBgwFoAU2f4hQG6UnrybPZx9mCAZ5YwwYrIwDwYD -VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBAJ5Fngw7tu/h -Osh80QA9z+LqBrWyOrsGS2h60COXdKcs8AjYeVrXWoSK2BKaG9l9XE1wxaX5q+WjiYndAfrs3fnp -kpfbsEZC89NiqpX+MWcUaViQCqoL7jcjx1BRtPV+nuN79+TMQjItSQzL/0kMmx40/W5ulop5A7Zv -2wnL/V9lFDfhOPXzYRZY5LVtDQsEGz9QLX+zx3oaFoBg+Iof6Rsqxvm6ARppv9JYx1RXCI/hOWB3 -S6xZhBqI8d3LT3jX5+EzLfzuQfogsL7L9ziUwOHQhQ+77Sxzq+3+knYaZH9bDTMJBzN7Bj8RpFxw -PIXAz+OQqIN3+tvmxYxoZxBnpVIt8MSZj3+/0WvitUfW2dCFmU2Umw9Lje4AWkcdEQOsQRivh7dv -DDqPys/cA8GiCcjl/YBeyGBCARsaU1q7N6a3vLqE6R5sGtRk2tRD/pOLS/IseRYQ1JMLiI+h2IYU -RpFHmygk71dSTlxCnKr3Sewn6EAes6aJInKc9Q0ztFijMDvd1GpUk74aTfOTlPf8hAs/hCBcNANE -xdqtvArBAs8e5ZTZ845b2EzwnexhF7sUMlQMAimTHpKG9n/v55IFDlndmQguLvqcAFLTxWYp5KeX -RKQOKIETNcX2b2TmQcTVL8w0RSXPQQCWPUouwpaYT05KnJe32x+SMsj/D1Fu1uwJ ------END CERTIFICATE----- - -TrustCor ECA-1 -============== ------BEGIN CERTIFICATE----- -MIIEIDCCAwigAwIBAgIJAISCLF8cYtBAMA0GCSqGSIb3DQEBCwUAMIGcMQswCQYDVQQGEwJQQTEP -MA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3Ig -U3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3Jp -dHkxFzAVBgNVBAMMDlRydXN0Q29yIEVDQS0xMB4XDTE2MDIwNDEyMzIzM1oXDTI5MTIzMTE3Mjgw -N1owgZwxCzAJBgNVBAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5 -MSQwIgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRydXN0Q29y -IENlcnRpZmljYXRlIEF1dGhvcml0eTEXMBUGA1UEAwwOVHJ1c3RDb3IgRUNBLTEwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPj+ARtZ+odnbb3w9U73NjKYKtR8aja+3+XzP4Q1HpGjOR -MRegdMTUpwHmspI+ap3tDvl0mEDTPwOABoJA6LHip1GnHYMma6ve+heRK9jGrB6xnhkB1Zem6g23 -xFUfJ3zSCNV2HykVh0A53ThFEXXQmqc04L/NyFIduUd+Dbi7xgz2c1cWWn5DkR9VOsZtRASqnKmc -p0yJF4OuowReUoCLHhIlERnXDH19MURB6tuvsBzvgdAsxZohmz3tQjtQJvLsznFhBmIhVE5/wZ0+ -fyCMgMsq2JdiyIMzkX2woloPV+g7zPIlstR8L+xNxqE6FXrntl019fZISjZFZtS6mFjBAgMBAAGj -YzBhMB0GA1UdDgQWBBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAfBgNVHSMEGDAWgBREnkj1zG1I1KBL -f/5ZJC+Dl5mahjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsF -AAOCAQEABT41XBVwm8nHc2FvcivUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u -/ukZMjgDfxT2AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11F -hcCF5yWPldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50soIipX1TH0Xs -J5F95yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BIWJZpTdwHjFGTot+fDz2LYLSC -jaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1WitJ/X5g== ------END CERTIFICATE----- - -SSL.com Root Certification Authority RSA -======================================== ------BEGIN CERTIFICATE----- -MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxDjAM -BgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24x -MTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYw -MjEyMTczOTM5WhcNNDEwMjEyMTczOTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMx -EDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NM -LmNvbSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAPkP3aMrfcvQKv7sZ4Wm5y4bunfh4/WvpOz6Sl2RxFdHaxh3a3by/ZPkPQ/C -Fp4LZsNWlJ4Xg4XOVu/yFv0AYvUiCVToZRdOQbngT0aXqhvIuG5iXmmxX9sqAn78bMrzQdjt0Oj8 -P2FI7bADFB0QDksZ4LtO7IZl/zbzXmcCC52GVWH9ejjt/uIZALdvoVBidXQ8oPrIJZK0bnoix/ge -oeOy3ZExqysdBP+lSgQ36YWkMyv94tZVNHwZpEpox7Ko07fKoZOI68GXvIz5HdkihCR0xwQ9aqkp -k8zruFvh/l8lqjRYyMEjVJ0bmBHDOJx+PYZspQ9AhnwC9FwCTyjLrnGfDzrIM/4RJTXq/LrFYD3Z -fBjVsqnTdXgDciLKOsMf7yzlLqn6niy2UUb9rwPW6mBo6oUWNmuF6R7As93EJNyAKoFBbZQ+yODJ -gUEAnl6/f8UImKIYLEJAs/lvOCdLToD0PYFH4Ih86hzOtXVcUS4cK38acijnALXRdMbX5J+tB5O2 -UzU1/Dfkw/ZdFr4hc96SCvigY2q8lpJqPvi8ZVWb3vUNiSYE/CUapiVpy8JtynziWV+XrOvvLsi8 -1xtZPCvM8hnIk2snYxnP/Okm+Mpxm3+T/jRnhE6Z6/yzeAkzcLpmpnbtG3PrGqUNxCITIJRWCk4s -bE6x/c+cCbqiM+2HAgMBAAGjYzBhMB0GA1UdDgQWBBTdBAkHovV6fVJTEpKV7jiAJQ2mWTAPBgNV -HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFN0ECQei9Xp9UlMSkpXuOIAlDaZZMA4GA1UdDwEB/wQE -AwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAIBgRlCn7Jp0cHh5wYfGVcpNxJK1ok1iOMq8bs3AD/CUr -dIWQPXhq9LmLpZc7tRiRux6n+UBbkflVma8eEdBcHadm47GUBwwyOabqG7B52B2ccETjit3E+ZUf -ijhDPwGFpUenPUayvOUiaPd7nNgsPgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52jvATGGAsl -u1OJD7OAUN5F7kR/q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3oFRuIIhxdRjq -erQ0cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfdSSLBv9jra6x+3uxj -MxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90IH37hVZkLId6Tngr75qNJ -vTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/YK9f1JmzJBjSWFupwWRoyeXkLtoh/D1JI -Pb9s2KJELtFOt3JY04kTlf5Eq/jXixtunLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406y -wKBjYZC6VWg3dGq2ktufoYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NI -WuuA8ShYIc2wBlX7Jz9TkHCpBB5XJ7k= ------END CERTIFICATE----- - -SSL.com Root Certification Authority ECC -======================================== ------BEGIN CERTIFICATE----- -MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMCVVMxDjAMBgNV -BAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xMTAv -BgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEy -MTgxNDAzWhcNNDEwMjEyMTgxNDAzWjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAO -BgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv -bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuBBAAiA2IA -BEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI7Z4INcgn64mMU1jrYor+ -8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPgCemB+vNH06NjMGEwHQYDVR0OBBYEFILR -hXMw5zUE044CkvvlpNHEIejNMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTT -jgKS++Wk0cQh6M0wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCW -e+0F+S8Tkdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+gA0z -5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl ------END CERTIFICATE----- - -SSL.com EV Root Certification Authority RSA R2 -============================================== ------BEGIN CERTIFICATE----- -MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAlVTMQ4w -DAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9u -MTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIy -MB4XDTE3MDUzMTE4MTQzN1oXDTQyMDUzMDE4MTQzN1owgYIxCzAJBgNVBAYTAlVTMQ4wDAYDVQQI -DAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMTcwNQYD -VQQDDC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIyMIICIjAN -BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjzZlQOHWTcDXtOlG2mvqM0fNTPl9fb69LT3w23jh -hqXZuglXaO1XPqDQCEGD5yhBJB/jchXQARr7XnAjssufOePPxU7Gkm0mxnu7s9onnQqG6YE3Bf7w -cXHswxzpY6IXFJ3vG2fThVUCAtZJycxa4bH3bzKfydQ7iEGonL3Lq9ttewkfokxykNorCPzPPFTO -Zw+oz12WGQvE43LrrdF9HSfvkusQv1vrO6/PgN3B0pYEW3p+pKk8OHakYo6gOV7qd89dAFmPZiw+ -B6KjBSYRaZfqhbcPlgtLyEDhULouisv3D5oi53+aNxPN8k0TayHRwMwi8qFG9kRpnMphNQcAb9Zh -CBHqurj26bNg5U257J8UZslXWNvNh2n4ioYSA0e/ZhN2rHd9NCSFg83XqpyQGp8hLH94t2S42Oim -9HizVcuE0jLEeK6jj2HdzghTreyI/BXkmg3mnxp3zkyPuBQVPWKchjgGAGYS5Fl2WlPAApiiECto -RHuOec4zSnaqW4EWG7WK2NAAe15itAnWhmMOpgWVSbooi4iTsjQc2KRVbrcc0N6ZVTsj9CLg+Slm -JuwgUHfbSguPvuUCYHBBXtSuUDkiFCbLsjtzdFVHB3mBOagwE0TlBIqulhMlQg+5U8Sb/M3kHN48 -+qvWBkofZ6aYMBzdLNvcGJVXZsb/XItW9XcCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNV -HSMEGDAWgBT5YLvU49U09rj1BoAlp3PbRmmonjAdBgNVHQ4EFgQU+WC71OPVNPa49QaAJadz20Zp -qJ4wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBWs47LCp1Jjr+kxJG7ZhcFUZh1 -++VQLHqe8RT6q9OKPv+RKY9ji9i0qVQBDb6Thi/5Sm3HXvVX+cpVHBK+Rw82xd9qt9t1wkclf7nx -Y/hoLVUE0fKNsKTPvDxeH3jnpaAgcLAExbf3cqfeIg29MyVGjGSSJuM+LmOW2puMPfgYCdcDzH2G -guDKBAdRUNf/ktUM79qGn5nX67evaOI5JpS6aLe/g9Pqemc9YmeuJeVy6OLk7K4S9ksrPJ/psEDz -OFSz/bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXtll9ldDz7 -CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEmKf7GUmG6sXP/wwyc5Wxq -lD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKKQbNmC1r7fSOl8hqw/96bg5Qu0T/fkreR -rwU7ZcegbLHNYhLDkBvjJc40vG93drEQw/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1 -hlMYegouCRw2n5H9gooiS9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX -9hwJ1C07mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w== ------END CERTIFICATE----- - -SSL.com EV Root Certification Authority ECC -=========================================== ------BEGIN CERTIFICATE----- -MIIClDCCAhqgAwIBAgIILCmcWxbtBZUwCgYIKoZIzj0EAwIwfzELMAkGA1UEBhMCVVMxDjAMBgNV -BAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xNDAy -BgNVBAMMK1NTTC5jb20gRVYgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYw -MjEyMTgxNTIzWhcNNDEwMjEyMTgxNTIzWjB/MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMx -EDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjE0MDIGA1UEAwwrU1NM -LmNvbSBFViBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuB -BAAiA2IABKoSR5CYG/vvw0AHgyBO8TCCogbR8pKGYfL2IWjKAMTH6kMAVIbc/R/fALhBYlzccBYy -3h+Z1MzFB8gIH2EWB1E9fVwHU+M1OIzfzZ/ZLg1KthkuWnBaBu2+8KGwytAJKaNjMGEwHQYDVR0O -BBYEFFvKXuXe0oGqzagtZFG22XKbl+ZPMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUW8pe -5d7SgarNqC1kUbbZcpuX5k8wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2gAMGUCMQCK5kCJ -N+vp1RPZytRrJPOwPYdGWBrssd9v+1a6cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZgh5Mm -m7I1HrrW9zzRHM76JTymGoEVW/MSD2zuZYrJh6j5B+BimoxcSg== ------END CERTIFICATE----- - -GlobalSign Root CA - R6 -======================= ------BEGIN CERTIFICATE----- -MIIFgzCCA2ugAwIBAgIORea7A4Mzw4VlSOb/RVEwDQYJKoZIhvcNAQEMBQAwTDEgMB4GA1UECxMX -R2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkds -b2JhbFNpZ24wHhcNMTQxMjEwMDAwMDAwWhcNMzQxMjEwMDAwMDAwWjBMMSAwHgYDVQQLExdHbG9i -YWxTaWduIFJvb3QgQ0EgLSBSNjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFs -U2lnbjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJUH6HPKZvnsFMp7PPcNCPG0RQss -grRIxutbPK6DuEGSMxSkb3/pKszGsIhrxbaJ0cay/xTOURQh7ErdG1rG1ofuTToVBu1kZguSgMpE -3nOUTvOniX9PeGMIyBJQbUJmL025eShNUhqKGoC3GYEOfsSKvGRMIRxDaNc9PIrFsmbVkJq3MQbF -vuJtMgamHvm566qjuL++gmNQ0PAYid/kD3n16qIfKtJwLnvnvJO7bVPiSHyMEAc4/2ayd2F+4OqM -PKq0pPbzlUoSB239jLKJz9CgYXfIWHSw1CM69106yqLbnQneXUQtkPGBzVeS+n68UARjNN9rkxi+ -azayOeSsJDa38O+2HBNXk7besvjihbdzorg1qkXy4J02oW9UivFyVm4uiMVRQkQVlO6jxTiWm05O -WgtH8wY2SXcwvHE35absIQh1/OZhFj931dmRl4QKbNQCTXTAFO39OfuD8l4UoQSwC+n+7o/hbguy -CLNhZglqsQY6ZZZZwPA1/cnaKI0aEYdwgQqomnUdnjqGBQCe24DWJfncBZ4nWUx2OVvq+aWh2IMP -0f/fMBH5hc8zSPXKbWQULHpYT9NLCEnFlWQaYw55PfWzjMpYrZxCRXluDocZXFSxZba/jJvcE+kN -b7gu3GduyYsRtYQUigAZcIN5kZeR1BonvzceMgfYFGM8KEyvAgMBAAGjYzBhMA4GA1UdDwEB/wQE -AwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSubAWjkxPioufi1xzWx/B/yGdToDAfBgNV -HSMEGDAWgBSubAWjkxPioufi1xzWx/B/yGdToDANBgkqhkiG9w0BAQwFAAOCAgEAgyXt6NH9lVLN -nsAEoJFp5lzQhN7craJP6Ed41mWYqVuoPId8AorRbrcWc+ZfwFSY1XS+wc3iEZGtIxg93eFyRJa0 -lV7Ae46ZeBZDE1ZXs6KzO7V33EByrKPrmzU+sQghoefEQzd5Mr6155wsTLxDKZmOMNOsIeDjHfrY -BzN2VAAiKrlNIC5waNrlU/yDXNOd8v9EDERm8tLjvUYAGm0CuiVdjaExUd1URhxN25mW7xocBFym -Fe944Hn+Xds+qkxV/ZoVqW/hpvvfcDDpw+5CRu3CkwWJ+n1jez/QcYF8AOiYrg54NMMl+68KnyBr -3TsTjxKM4kEaSHpzoHdpx7Zcf4LIHv5YGygrqGytXm3ABdJ7t+uA/iU3/gKbaKxCXcPu9czc8FB1 -0jZpnOZ7BN9uBmm23goJSFmH63sUYHpkqmlD75HHTOwY3WzvUy2MmeFe8nI+z1TIvWfspA9MRf/T -uTAjB0yPEL+GltmZWrSZVxykzLsViVO6LAUP5MSeGbEYNNVMnbrt9x+vJJUEeKgDu+6B5dpffItK -oZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R8k8HWV+LLUNS60YMlOH1Zkd5d9VUWx+t -JDfLRVpOoERIyNiwmcUVhAn21klJwGW45hpxbqCo8YLoRT5s1gLXCmeDBVrJpBA= ------END CERTIFICATE----- - -OISTE WISeKey Global Root GC CA -=============================== ------BEGIN CERTIFICATE----- -MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQswCQYDVQQGEwJD -SDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEo -MCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQyBDQTAeFw0xNzA1MDkwOTQ4MzRa -Fw00MjA1MDkwOTU4MzNaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQL -ExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2Jh -bCBSb290IEdDIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETOlQwMYPchi82PG6s4nieUqjFqdr -VCTbUf/q9Akkwwsin8tqJ4KBDdLArzHkdIJuyiXZjHWd8dvQmqJLIX4Wp2OQ0jnUsYd4XxiWD1Ab -NTcPasbc2RNNpI6QN+a9WzGRo1QwUjAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd -BgNVHQ4EFgQUSIcUrOPDnpBgOtfKie7TrYy0UGYwEAYJKwYBBAGCNxUBBAMCAQAwCgYIKoZIzj0E -AwMDaAAwZQIwJsdpW9zV57LnyAyMjMPdeYwbY9XJUpROTYJKcx6ygISpJcBMWm1JKWB4E+J+SOtk -AjEA2zQgMgj/mkkCtojeFK9dbJlxjRo/i9fgojaGHAeCOnZT/cKi7e97sIBPWA9LUzm9 ------END CERTIFICATE----- - -GTS Root R1 -=========== ------BEGIN CERTIFICATE----- -MIIFWjCCA0KgAwIBAgIQbkepxUtHDA3sM9CJuRz04TANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQG -EwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJv -b3QgUjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAG -A1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIi -MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx -9vaMf/vo27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vXmX7wCl7r -aKb0xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7zUjwTcLCeoiKu7rPWRnW -r4+wB7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0PfyblqAj+lug8aJRT7oM6iCsVlgmy4HqM -LnXWnOunVmSPlk9orj2XwoSPwLxAwAtcvfaHszVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly -4cpk9+aCEI3oncKKiPo4Zor8Y/kB+Xj9e1x3+naH+uzfsQ55lVe0vSbv1gHR6xYKu44LtcXFilWr -06zqkUspzBmkMiVOKvFlRNACzqrOSbTqn3yDsEB750Orp2yjj32JgfpMpf/VjsPOS+C12LOORc92 -wO1AK/1TD7Cn1TsNsYqiA94xrcx36m97PtbfkSIS5r762DL8EGMUUXLeXdYWk70paDPvOmbsB4om -3xPXV2V4J95eSRQAogB/mqghtqmxlbCluQ0WEdrHbEg8QOB+DVrNVjzRlwW5y0vtOUucxD/SVRNu -JLDWcfr0wbrM7Rv1/oFB2ACYPTrIrnqYNxgFlQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD -VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU5K8rJnEaK0gnhS9SZizv8IkTcT4wDQYJKoZIhvcNAQEM -BQADggIBADiWCu49tJYeX++dnAsznyvgyv3SjgofQXSlfKqE1OXyHuY3UjKcC9FhHb8owbZEKTV1 -d5iyfNm9dKyKaOOpMQkpAWBz40d8U6iQSifvS9efk+eCNs6aaAyC58/UEBZvXw6ZXPYfcX3v73sv -fuo21pdwCxXu11xWajOl40k4DLh9+42FpLFZXvRq4d2h9mREruZRgyFmxhE+885H7pwoHyXa/6xm -ld01D1zvICxi/ZG6qcz8WpyTgYMpl0p8WnK0OdC3d8t5/Wk6kjftbjhlRn7pYL15iJdfOBL07q9b -gsiG1eGZbYwE8na6SfZu6W0eX6DvJ4J2QPim01hcDyxC2kLGe4g0x8HYRZvBPsVhHdljUEn2NIVq -4BjFbkerQUIpm/ZgDdIx02OYI5NaAIFItO/Nis3Jz5nu2Z6qNuFoS3FJFDYoOj0dzpqPJeaAcWEr -tXvM+SUWgeExX6GjfhaknBZqlxi9dnKlC54dNuYvoS++cJEPqOba+MSSQGwlfnuzCdyyF62ARPBo -pY+Udf90WuioAnwMCeKpSwughQtiue+hMZL77/ZRBIls6Kl0obsXs7X9SQ98POyDGCBDTtWTurQ0 -sR8WNh8M5mQ5Fkzc4P4dyKliPUDqysU0ArSuiYgzNdwsE3PYJ/HQcu51OyLemGhmW/HGY0dVHLql -CFF1pkgl ------END CERTIFICATE----- - -GTS Root R2 -=========== ------BEGIN CERTIFICATE----- -MIIFWjCCA0KgAwIBAgIQbkepxlqz5yDFMJo/aFLybzANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQG -EwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJv -b3QgUjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAG -A1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwggIi -MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDO3v2m++zsFDQ8BwZabFn3GTXd98GdVarTzTuk -k3LvCvptnfbwhYBboUhSnznFt+4orO/LdmgUud+tAWyZH8QiHZ/+cnfgLFuv5AS/T3KgGjSY6Dlo -7JUle3ah5mm5hRm9iYz+re026nO8/4Piy33B0s5Ks40FnotJk9/BW9BuXvAuMC6C/Pq8tBcKSOWI -m8Wba96wyrQD8Nr0kLhlZPdcTK3ofmZemde4wj7I0BOdre7kRXuJVfeKH2JShBKzwkCX44ofR5Gm -dFrS+LFjKBC4swm4VndAoiaYecb+3yXuPuWgf9RhD1FLPD+M2uFwdNjCaKH5wQzpoeJ/u1U8dgbu -ak7MkogwTZq9TwtImoS1mKPV+3PBV2HdKFZ1E66HjucMUQkQdYhMvI35ezzUIkgfKtzra7tEscsz -cTJGr61K8YzodDqs5xoic4DSMPclQsciOzsSrZYuxsN2B6ogtzVJV+mSSeh2FnIxZyuWfoqjx5RW -Ir9qS34BIbIjMt/kmkRtWVtd9QCgHJvGeJeNkP+byKq0rxFROV7Z+2et1VsRnTKaG73Vululycsl -aVNVJ1zgyjbLiGH7HrfQy+4W+9OmTN6SpdTi3/UGVN4unUu0kzCqgc7dGtxRcw1PcOnlthYhGXmy -5okLdWTK1au8CcEYof/UVKGFPP0UJAOyh9OktwIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD -VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUu//KjiOfT5nK2+JopqUVJxce2Q4wDQYJKoZIhvcNAQEM -BQADggIBALZp8KZ3/p7uC4Gt4cCpx/k1HUCCq+YEtN/L9x0Pg/B+E02NjO7jMyLDOfxA325BS0JT -vhaI8dI4XsRomRyYUpOM52jtG2pzegVATX9lO9ZY8c6DR2Dj/5epnGB3GFW1fgiTz9D2PGcDFWEJ -+YF59exTpJ/JjwGLc8R3dtyDovUMSRqodt6Sm2T4syzFJ9MHwAiApJiS4wGWAqoC7o87xdFtCjMw -c3i5T1QWvwsHoaRc5svJXISPD+AVdyx+Jn7axEvbpxZ3B7DNdehyQtaVhJ2Gg/LkkM0JR9SLA3Da -WsYDQvTtN6LwG1BUSw7YhN4ZKJmBR64JGz9I0cNv4rBgF/XuIwKl2gBbbZCr7qLpGzvpx0QnRY5r -n/WkhLx3+WuXrD5RRaIRpsyF7gpo8j5QOHokYh4XIDdtak23CZvJ/KRY9bb7nE4Yu5UC56Gtmwfu -Nmsk0jmGwZODUNKBRqhfYlcsu2xkiAhu7xNUX90txGdj08+JN7+dIPT7eoOboB6BAFDC5AwiWVIQ -7UNWhwD4FFKnHYuTjKJNRn8nxnGbJN7k2oaLDX5rIMHAnuFl2GqjpuiFizoHCBy69Y9Vmhh1fuXs -gWbRIXOhNUQLgD1bnF5vKheW0YMjiGZt5obicDIvUiLnyOd/xCxgXS/Dr55FBcOEArf9LAhST4Ld -o/DUhgkC ------END CERTIFICATE----- - -GTS Root R3 -=========== ------BEGIN CERTIFICATE----- -MIICDDCCAZGgAwIBAgIQbkepx2ypcyRAiQ8DVd2NHTAKBggqhkjOPQQDAzBHMQswCQYDVQQGEwJV -UzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3Qg -UjMwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UE -ChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjMwdjAQBgcq -hkjOPQIBBgUrgQQAIgNiAAQfTzOHMymKoYTey8chWEGJ6ladK0uFxh1MJ7x/JlFyb+Kf1qPKzEUU -Rout736GjOyxfi//qXGdGIRFBEFVbivqJn+7kAHjSxm65FSWRQmx1WyRRK2EE46ajA2ADDL24Cej -QjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTB8Sa6oC2uhYHP -0/EqEr24Cmf9vDAKBggqhkjOPQQDAwNpADBmAjEAgFukfCPAlaUs3L6JbyO5o91lAFJekazInXJ0 -glMLfalAvWhgxeG4VDvBNhcl2MG9AjEAnjWSdIUlUfUk7GRSJFClH9voy8l27OyCbvWFGFPouOOa -KaqW04MjyaR7YbPMAuhd ------END CERTIFICATE----- - -GTS Root R4 -=========== ------BEGIN CERTIFICATE----- -MIICCjCCAZGgAwIBAgIQbkepyIuUtui7OyrYorLBmTAKBggqhkjOPQQDAzBHMQswCQYDVQQGEwJV -UzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3Qg -UjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UE -ChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcq -hkjOPQIBBgUrgQQAIgNiAATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa -6zzuhXyiQHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/lxKvRHYqj -QjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSATNbrdP9JNqPV -2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNnADBkAjBqUFJ0CMRw3J5QdCHojXohw0+WbhXRIjVhLfoI -N+4Zba3bssx9BzT1YBkstTTZbyACMANxsbqjYAuG7ZoIapVon+Kz4ZNkfF6Tpt95LY2F45TPI11x -zPKwTdb+mciUqXWi4w== ------END CERTIFICATE----- - -UCA Global G2 Root -================== ------BEGIN CERTIFICATE----- -MIIFRjCCAy6gAwIBAgIQXd+x2lqj7V2+WmUgZQOQ7zANBgkqhkiG9w0BAQsFADA9MQswCQYDVQQG -EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxGzAZBgNVBAMMElVDQSBHbG9iYWwgRzIgUm9vdDAeFw0x -NjAzMTEwMDAwMDBaFw00MDEyMzEwMDAwMDBaMD0xCzAJBgNVBAYTAkNOMREwDwYDVQQKDAhVbmlU -cnVzdDEbMBkGA1UEAwwSVUNBIEdsb2JhbCBHMiBSb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEAxeYrb3zvJgUno4Ek2m/LAfmZmqkywiKHYUGRO8vDaBsGxUypK8FnFyIdK+35KYmT -oni9kmugow2ifsqTs6bRjDXVdfkX9s9FxeV67HeToI8jrg4aA3++1NDtLnurRiNb/yzmVHqUwCoV -8MmNsHo7JOHXaOIxPAYzRrZUEaalLyJUKlgNAQLx+hVRZ2zA+te2G3/RVogvGjqNO7uCEeBHANBS -h6v7hn4PJGtAnTRnvI3HLYZveT6OqTwXS3+wmeOwcWDcC/Vkw85DvG1xudLeJ1uK6NjGruFZfc8o -LTW4lVYa8bJYS7cSN8h8s+1LgOGN+jIjtm+3SJUIsUROhYw6AlQgL9+/V087OpAh18EmNVQg7Mc/ -R+zvWr9LesGtOxdQXGLYD0tK3Cv6brxzks3sx1DoQZbXqX5t2Okdj4q1uViSukqSKwxW/YDrCPBe -KW4bHAyvj5OJrdu9o54hyokZ7N+1wxrrFv54NkzWbtA+FxyQF2smuvt6L78RHBgOLXMDj6DlNaBa -4kx1HXHhOThTeEDMg5PXCp6dW4+K5OXgSORIskfNTip1KnvyIvbJvgmRlld6iIis7nCs+dwp4wwc -OxJORNanTrAmyPPZGpeRaOrvjUYG0lZFWJo8DA+DuAUlwznPO6Q0ibd5Ei9Hxeepl2n8pndntd97 -8XplFeRhVmUCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O -BBYEFIHEjMz15DD/pQwIX4wVZyF0Ad/fMA0GCSqGSIb3DQEBCwUAA4ICAQATZSL1jiutROTL/7lo -5sOASD0Ee/ojL3rtNtqyzm325p7lX1iPyzcyochltq44PTUbPrw7tgTQvPlJ9Zv3hcU2tsu8+Mg5 -1eRfB70VVJd0ysrtT7q6ZHafgbiERUlMjW+i67HM0cOU2kTC5uLqGOiiHycFutfl1qnN3e92mI0A -Ds0b+gO3joBYDic/UvuUospeZcnWhNq5NXHzJsBPd+aBJ9J3O5oUb3n09tDh05S60FdRvScFDcH9 -yBIw7m+NESsIndTUv4BFFJqIRNow6rSn4+7vW4LVPtateJLbXDzz2K36uGt/xDYotgIVilQsnLAX -c47QN6MUPJiVAAwpBVueSUmxX8fjy88nZY41F7dXyDDZQVu5FLbowg+UMaeUmMxq67XhJ/UQqAHo -jhJi6IjMtX9Gl8CbEGY4GjZGXyJoPd/JxhMnq1MGrKI8hgZlb7F+sSlEmqO6SWkoaY/X5V+tBIZk -bxqgDMUIYs6Ao9Dz7GjevjPHF1t/gMRMTLGmhIrDO7gJzRSBuhjjVFc2/tsvfEehOjPI+Vg7RE+x -ygKJBJYoaMVLuCaJu9YzL1DV/pqJuhgyklTGW+Cd+V7lDSKb9triyCGyYiGqhkCyLmTTX8jjfhFn -RR8F/uOi77Oos/N9j/gMHyIfLXC0uAE0djAA5SN4p1bXUB+K+wb1whnw0A== ------END CERTIFICATE----- - -UCA Extended Validation Root -============================ ------BEGIN CERTIFICATE----- -MIIFWjCCA0KgAwIBAgIQT9Irj/VkyDOeTzRYZiNwYDANBgkqhkiG9w0BAQsFADBHMQswCQYDVQQG -EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9u -IFJvb3QwHhcNMTUwMzEzMDAwMDAwWhcNMzgxMjMxMDAwMDAwWjBHMQswCQYDVQQGEwJDTjERMA8G -A1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwggIi -MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCpCQcoEwKwmeBkqh5DFnpzsZGgdT6o+uM4AHrs -iWogD4vFsJszA1qGxliG1cGFu0/GnEBNyr7uaZa4rYEwmnySBesFK5pI0Lh2PpbIILvSsPGP2KxF -Rv+qZ2C0d35qHzwaUnoEPQc8hQ2E0B92CvdqFN9y4zR8V05WAT558aopO2z6+I9tTcg1367r3CTu -eUWnhbYFiN6IXSV8l2RnCdm/WhUFhvMJHuxYMjMR83dksHYf5BA1FxvyDrFspCqjc/wJHx4yGVMR -59mzLC52LqGj3n5qiAno8geK+LLNEOfic0CTuwjRP+H8C5SzJe98ptfRr5//lpr1kXuYC3fUfugH -0mK1lTnj8/FtDw5lhIpjVMWAtuCeS31HJqcBCF3RiJ7XwzJE+oJKCmhUfzhTA8ykADNkUVkLo4KR -el7sFsLzKuZi2irbWWIQJUoqgQtHB0MGcIfS+pMRKXpITeuUx3BNr2fVUbGAIAEBtHoIppB/TuDv -B0GHr2qlXov7z1CymlSvw4m6WC31MJixNnI5fkkE/SmnTHnkBVfblLkWU41Gsx2VYVdWf6/wFlth -WG82UBEL2KwrlRYaDh8IzTY0ZRBiZtWAXxQgXy0MoHgKaNYs1+lvK9JKBZP8nm9rZ/+I8U6laUpS -NwXqxhaN0sSZ0YIrO7o1dfdRUVjzyAfd5LQDfwIDAQABo0IwQDAdBgNVHQ4EFgQU2XQ65DA9DfcS -3H5aBZ8eNJr34RQwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQEL -BQADggIBADaNl8xCFWQpN5smLNb7rhVpLGsaGvdftvkHTFnq88nIua7Mui563MD1sC3AO6+fcAUR -ap8lTwEpcOPlDOHqWnzcSbvBHiqB9RZLcpHIojG5qtr8nR/zXUACE/xOHAbKsxSQVBcZEhrxH9cM -aVr2cXj0lH2RC47skFSOvG+hTKv8dGT9cZr4QQehzZHkPJrgmzI5c6sq1WnIeJEmMX3ixzDx/BR4 -dxIOE/TdFpS/S2d7cFOFyrC78zhNLJA5wA3CXWvp4uXViI3WLL+rG761KIcSF3Ru/H38j9CHJrAb -+7lsq+KePRXBOy5nAliRn+/4Qh8st2j1da3Ptfb/EX3C8CSlrdP6oDyp+l3cpaDvRKS+1ujl5BOW -F3sGPjLtx7dCvHaj2GU4Kzg1USEODm8uNBNA4StnDG1KQTAYI1oyVZnJF+A83vbsea0rWBmirSwi -GpWOvpaQXUJXxPkUAzUrHC1RVwinOt4/5Mi0A3PCwSaAuwtCH60NryZy2sy+s6ODWA2CxR9GUeOc -GMyNm43sSet1UNWMKFnKdDTajAshqx7qG+XH/RU+wBeq+yNuJkbL+vmxcmtpzyKEC2IPrNkZAJSi -djzULZrtBJ4tBmIQN1IchXIbJ+XMxjHsN+xjWZsLHXbMfjKaiJUINlK73nZfdklJrX+9ZSCyycEr -dhh2n1ax ------END CERTIFICATE----- - -Certigna Root CA -================ ------BEGIN CERTIFICATE----- -MIIGWzCCBEOgAwIBAgIRAMrpG4nxVQMNo+ZBbcTjpuEwDQYJKoZIhvcNAQELBQAwWjELMAkGA1UE -BhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczEcMBoGA1UECwwTMDAwMiA0ODE0NjMwODEwMDAzNjEZ -MBcGA1UEAwwQQ2VydGlnbmEgUm9vdCBDQTAeFw0xMzEwMDEwODMyMjdaFw0zMzEwMDEwODMyMjda -MFoxCzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxHDAaBgNVBAsMEzAwMDIgNDgxNDYz -MDgxMDAwMzYxGTAXBgNVBAMMEENlcnRpZ25hIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4IC -DwAwggIKAoICAQDNGDllGlmx6mQWDoyUJJV8g9PFOSbcDO8WV43X2KyjQn+Cyu3NW9sOty3tRQgX -stmzy9YXUnIo245Onoq2C/mehJpNdt4iKVzSs9IGPjA5qXSjklYcoW9MCiBtnyN6tMbaLOQdLNyz -KNAT8kxOAkmhVECe5uUFoC2EyP+YbNDrihqECB63aCPuI9Vwzm1RaRDuoXrC0SIxwoKF0vJVdlB8 -JXrJhFwLrN1CTivngqIkicuQstDuI7pmTLtipPlTWmR7fJj6o0ieD5Wupxj0auwuA0Wv8HT4Ks16 -XdG+RCYyKfHx9WzMfgIhC59vpD++nVPiz32pLHxYGpfhPTc3GGYo0kDFUYqMwy3OU4gkWGQwFsWq -4NYKpkDfePb1BHxpE4S80dGnBs8B92jAqFe7OmGtBIyT46388NtEbVncSVmurJqZNjBBe3YzIoej -wpKGbvlw7q6Hh5UbxHq9MfPU0uWZ/75I7HX1eBYdpnDBfzwboZL7z8g81sWTCo/1VTp2lc5ZmIoJ -lXcymoO6LAQ6l73UL77XbJuiyn1tJslV1c/DeVIICZkHJC1kJWumIWmbat10TWuXekG9qxf5kBdI -jzb5LdXF2+6qhUVB+s06RbFo5jZMm5BX7CO5hwjCxAnxl4YqKE3idMDaxIzb3+KhF1nOJFl0Mdp/ -/TBt2dzhauH8XwIDAQABo4IBGjCCARYwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw -HQYDVR0OBBYEFBiHVuBud+4kNTxOc5of1uHieX4rMB8GA1UdIwQYMBaAFBiHVuBud+4kNTxOc5of -1uHieX4rMEQGA1UdIAQ9MDswOQYEVR0gADAxMC8GCCsGAQUFBwIBFiNodHRwczovL3d3d3cuY2Vy -dGlnbmEuZnIvYXV0b3JpdGVzLzBtBgNVHR8EZjBkMC+gLaArhilodHRwOi8vY3JsLmNlcnRpZ25h -LmZyL2NlcnRpZ25hcm9vdGNhLmNybDAxoC+gLYYraHR0cDovL2NybC5kaGlteW90aXMuY29tL2Nl -cnRpZ25hcm9vdGNhLmNybDANBgkqhkiG9w0BAQsFAAOCAgEAlLieT/DjlQgi581oQfccVdV8AOIt -OoldaDgvUSILSo3L6btdPrtcPbEo/uRTVRPPoZAbAh1fZkYJMyjhDSSXcNMQH+pkV5a7XdrnxIxP -TGRGHVyH41neQtGbqH6mid2PHMkwgu07nM3A6RngatgCdTer9zQoKJHyBApPNeNgJgH60BGM+RFq -7q89w1DTj18zeTyGqHNFkIwgtnJzFyO+B2XleJINugHA64wcZr+shncBlA2c5uk5jR+mUYyZDDl3 -4bSb+hxnV29qao6pK0xXeXpXIs/NX2NGjVxZOob4Mkdio2cNGJHc+6Zr9UhhcyNZjgKnvETq9Emd -8VRY+WCv2hikLyhF3HqgiIZd8zvn/yk1gPxkQ5Tm4xxvvq0OKmOZK8l+hfZx6AYDlf7ej0gcWtSS -6Cvu5zHbugRqh5jnxV/vfaci9wHYTfmJ0A6aBVmknpjZbyvKcL5kwlWj9Omvw5Ip3IgWJJk8jSaY -tlu3zM63Nwf9JtmYhST/WSMDmu2dnajkXjjO11INb9I/bbEFa0nOipFGc/T2L/Coc3cOZayhjWZS -aX5LaAzHHjcng6WMxwLkFM1JAbBzs/3GkDpv0mztO+7skb6iQ12LAEpmJURw3kAP+HwV96LOPNde -E4yBFxgX0b3xdxA61GU5wSesVywlVP+i2k+KYTlerj1KjL0= ------END CERTIFICATE----- - -emSign Root CA - G1 -=================== ------BEGIN CERTIFICATE----- -MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYDVQQGEwJJTjET -MBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRl -ZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBHMTAeFw0xODAyMTgxODMwMDBaFw00MzAyMTgx -ODMwMDBaMGcxCzAJBgNVBAYTAklOMRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVk -aHJhIFRlY2hub2xvZ2llcyBMaW1pdGVkMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEcxMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk0u76WaK7p1b1TST0Bsew+eeuGQzf2N4aLTN -LnF115sgxk0pvLZoYIr3IZpWNVrzdr3YzZr/k1ZLpVkGoZM0Kd0WNHVO8oG0x5ZOrRkVUkr+PHB1 -cM2vK6sVmjM8qrOLqs1D/fXqcP/tzxE7lM5OMhbTI0Aqd7OvPAEsbO2ZLIvZTmmYsvePQbAyeGHW -DV/D+qJAkh1cF+ZwPjXnorfCYuKrpDhMtTk1b+oDafo6VGiFbdbyL0NVHpENDtjVaqSW0RM8LHhQ -6DqS0hdW5TUaQBw+jSztOd9C4INBdN+jzcKGYEho42kLVACL5HZpIQ15TjQIXhTCzLG3rdd8cIrH -hQIDAQABo0IwQDAdBgNVHQ4EFgQU++8Nhp6w492pufEhF38+/PB3KxowDgYDVR0PAQH/BAQDAgEG -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAFn/8oz1h31xPaOfG1vR2vjTnGs2 -vZupYeveFix0PZ7mddrXuqe8QhfnPZHr5X3dPpzxz5KsbEjMwiI/aTvFthUvozXGaCocV685743Q -NcMYDHsAVhzNixl03r4PEuDQqqE/AjSxcM6dGNYIAwlG7mDgfrbESQRRfXBgvKqy/3lyeqYdPV8q -+Mri/Tm3R7nrft8EI6/6nAYH6ftjk4BAtcZsCjEozgyfz7MjNYBBjWzEN3uBL4ChQEKF6dk4jeih -U80Bv2noWgbyRQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx -iN66zB+Afko= ------END CERTIFICATE----- - -emSign ECC Root CA - G3 -======================= ------BEGIN CERTIFICATE----- -MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQGEwJJTjETMBEG -A1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEg -MB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4 -MTgzMDAwWjBrMQswCQYDVQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11 -ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g -RzMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0WXTsuwYc -58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xySfvalY8L1X44uT6EYGQIr -MgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuBzhccLikenEhjQjAOBgNVHQ8BAf8EBAMC -AQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+D -CBeQyh+KTOgNG3qxrdWBCUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7 -jHvrZQnD+JbNR6iC8hZVdyR+EhCVBCyj ------END CERTIFICATE----- - -emSign Root CA - C1 -=================== ------BEGIN CERTIFICATE----- -MIIDczCCAlugAwIBAgILAK7PALrEzzL4Q7IwDQYJKoZIhvcNAQELBQAwVjELMAkGA1UEBhMCVVMx -EzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQDExNlbVNp -Z24gUm9vdCBDQSAtIEMxMB4XDTE4MDIxODE4MzAwMFoXDTQzMDIxODE4MzAwMFowVjELMAkGA1UE -BhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQD -ExNlbVNpZ24gUm9vdCBDQSAtIEMxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz+up -ufGZBczYKCFK83M0UYRWEPWgTywS4/oTmifQz/l5GnRfHXk5/Fv4cI7gklL35CX5VIPZHdPIWoU/ -Xse2B+4+wM6ar6xWQio5JXDWv7V7Nq2s9nPczdcdioOl+yuQFTdrHCZH3DspVpNqs8FqOp099cGX -OFgFixwR4+S0uF2FHYP+eF8LRWgYSKVGczQ7/g/IdrvHGPMF0Ybzhe3nudkyrVWIzqa2kbBPrH4V -I5b2P/AgNBbeCsbEBEV5f6f9vtKppa+cxSMq9zwhbL2vj07FOrLzNBL834AaSaTUqZX3noleooms -lMuoaJuvimUnzYnu3Yy1aylwQ6BpC+S5DwIDAQABo0IwQDAdBgNVHQ4EFgQU/qHgcB4qAzlSWkK+ -XJGFehiqTbUwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQAD -ggEBAMJKVvoVIXsoounlHfv4LcQ5lkFMOycsxGwYFYDGrK9HWS8mC+M2sO87/kOXSTKZEhVb3xEp -/6tT+LvBeA+snFOvV71ojD1pM/CjoCNjO2RnIkSt1XHLVip4kqNPEjE2NuLe/gDEo2APJ62gsIq1 -NnpSob0n9CAnYuhNlCQT5AoE6TyrLshDCUrGYQTlSTR+08TI9Q/Aqum6VF7zYytPT1DU/rl7mYw9 -wC68AivTxEDkigcxHpvOJpkT+xHqmiIMERnHXhuBUDDIlhJu58tBf5E7oke3VIAb3ADMmpDqw8NQ -BmIMMMAVSKeoWXzhriKi4gp6D/piq1JM4fHfyr6DDUI= ------END CERTIFICATE----- - -emSign ECC Root CA - C3 -======================= ------BEGIN CERTIFICATE----- -MIICKzCCAbGgAwIBAgIKe3G2gla4EnycqDAKBggqhkjOPQQDAzBaMQswCQYDVQQGEwJVUzETMBEG -A1UECxMKZW1TaWduIFBLSTEUMBIGA1UEChMLZU11ZGhyYSBJbmMxIDAeBgNVBAMTF2VtU2lnbiBF -Q0MgUm9vdCBDQSAtIEMzMB4XDTE4MDIxODE4MzAwMFoXDTQzMDIxODE4MzAwMFowWjELMAkGA1UE -BhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMSAwHgYDVQQD -ExdlbVNpZ24gRUNDIFJvb3QgQ0EgLSBDMzB2MBAGByqGSM49AgEGBSuBBAAiA2IABP2lYa57JhAd -6bciMK4G9IGzsUJxlTm801Ljr6/58pc1kjZGDoeVjbk5Wum739D+yAdBPLtVb4OjavtisIGJAnB9 -SMVK4+kiVCJNk7tCDK93nCOmfddhEc5lx/h//vXyqaNCMEAwHQYDVR0OBBYEFPtaSNCAIEDyqOkA -B2kZd6fmw/TPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMDA2gA -MGUCMQC02C8Cif22TGK6Q04ThHK1rt0c3ta13FaPWEBaLd4gTCKDypOofu4SQMfWh0/434UCMBwU -ZOR8loMRnLDRWmFLpg9J0wD8ofzkpf9/rdcw0Md3f76BB1UwUCAU9Vc4CqgxUQ== ------END CERTIFICATE----- - -Hongkong Post Root CA 3 -======================= ------BEGIN CERTIFICATE----- -MIIFzzCCA7egAwIBAgIUCBZfikyl7ADJk0DfxMauI7gcWqQwDQYJKoZIhvcNAQELBQAwbzELMAkG -A1UEBhMCSEsxEjAQBgNVBAgTCUhvbmcgS29uZzESMBAGA1UEBxMJSG9uZyBLb25nMRYwFAYDVQQK -Ew1Ib25na29uZyBQb3N0MSAwHgYDVQQDExdIb25na29uZyBQb3N0IFJvb3QgQ0EgMzAeFw0xNzA2 -MDMwMjI5NDZaFw00MjA2MDMwMjI5NDZaMG8xCzAJBgNVBAYTAkhLMRIwEAYDVQQIEwlIb25nIEtv -bmcxEjAQBgNVBAcTCUhvbmcgS29uZzEWMBQGA1UEChMNSG9uZ2tvbmcgUG9zdDEgMB4GA1UEAxMX -SG9uZ2tvbmcgUG9zdCBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCz -iNfqzg8gTr7m1gNt7ln8wlffKWihgw4+aMdoWJwcYEuJQwy51BWy7sFOdem1p+/l6TWZ5Mwc50tf -jTMwIDNT2aa71T4Tjukfh0mtUC1Qyhi+AViiE3CWu4mIVoBc+L0sPOFMV4i707mV78vH9toxdCim -5lSJ9UExyuUmGs2C4HDaOym71QP1mbpV9WTRYA6ziUm4ii8F0oRFKHyPaFASePwLtVPLwpgchKOe -sL4jpNrcyCse2m5FHomY2vkALgbpDDtw1VAliJnLzXNg99X/NWfFobxeq81KuEXryGgeDQ0URhLj -0mRiikKYvLTGCAj4/ahMZJx2Ab0vqWwzD9g/KLg8aQFChn5pwckGyuV6RmXpwtZQQS4/t+TtbNe/ -JgERohYpSms0BpDsE9K2+2p20jzt8NYt3eEV7KObLyzJPivkaTv/ciWxNoZbx39ri1UbSsUgYT2u -y1DhCDq+sI9jQVMwCFk8mB13umOResoQUGC/8Ne8lYePl8X+l2oBlKN8W4UdKjk60FSh0Tlxnf0h -+bV78OLgAo9uliQlLKAeLKjEiafv7ZkGL7YKTE/bosw3Gq9HhS2KX8Q0NEwA/RiTZxPRN+ZItIsG -xVd7GYYKecsAyVKvQv83j+GjHno9UKtjBucVtT+2RTeUN7F+8kjDf8V1/peNRY8apxpyKBpADwID -AQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQXnc0e -i9Y5K3DTXNSguB+wAPzFYTAdBgNVHQ4EFgQUF53NHovWOStw01zUoLgfsAD8xWEwDQYJKoZIhvcN -AQELBQADggIBAFbVe27mIgHSQpsY1Q7XZiNc4/6gx5LS6ZStS6LG7BJ8dNVI0lkUmcDrudHr9Egw -W62nV3OZqdPlt9EuWSRY3GguLmLYauRwCy0gUCCkMpXRAJi70/33MvJJrsZ64Ee+bs7Lo3I6LWld -y8joRTnU+kLBEUx3XZL7av9YROXrgZ6voJmtvqkBZss4HTzfQx/0TW60uhdG/H39h4F5ag0zD/ov -+BS5gLNdTaqX4fnkGMX41TiMJjz98iji7lpJiCzfeT2OnpA8vUFKOt1b9pq0zj8lMH8yfaIDlNDc -eqFS3m6TjRgm/VWsvY+b0s+v54Ysyx8Jb6NvqYTUc79NoXQbTiNg8swOqn+knEwlqLJmOzj/2ZQw -9nKEvmhVEA/GcywWaZMH/rFF7buiVWqw2rVKAiUnhde3t4ZEFolsgCs+l6mc1X5VTMbeRRAc6uk7 -nwNT7u56AQIWeNTowr5GdogTPyK7SBIdUgC0An4hGh6cJfTzPV4e0hz5sy229zdcxsshTrD3mUcY -hcErulWuBurQB7Lcq9CClnXO0lD+mefPL5/ndtFhKvshuzHQqp9HpLIiyhY6UFfEW0NnxWViA0kB -60PZ2Pierc+xYw5F9KBaLJstxabArahH9CdMOA0uG0k7UvToiIMrVCjU8jVStDKDYmlkDJGcn5fq -dBb9HxEGmpv0 ------END CERTIFICATE----- diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/init.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/init.php deleted file mode 100644 index e611aa5c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/init.php +++ /dev/null @@ -1,274 +0,0 @@ -create and manage Express or - * Custom accounts. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $business_profile Business information about the account. - * @property null|string $business_type The business type. - * @property \Stripe\StripeObject $capabilities - * @property bool $charges_enabled Whether the account can create live charges. - * @property \Stripe\StripeObject $company - * @property \Stripe\StripeObject $controller - * @property string $country The account's country. - * @property int $created Time at which the account was connected. Measured in seconds since the Unix epoch. - * @property string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that Stripe supports in the account's country. - * @property bool $details_submitted Whether account details have been submitted. Standard accounts cannot receive payouts before this is true. - * @property null|string $email An email address associated with the account. You can treat this as metadata: it is not used for authentication or messaging account holders. - * @property \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> $external_accounts External accounts (bank accounts and debit cards) currently attached to this account - * @property \Stripe\StripeObject $future_requirements - * @property \Stripe\Person $individual

    This is an object representing a person associated with a Stripe account.

    A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. See the Standard onboarding or Express onboarding documentation for information about platform pre-filling and account onboarding steps.

    Related guide: Handling Identity Verification with the API.

    - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property bool $payouts_enabled Whether Stripe can send payouts to this account. - * @property \Stripe\StripeObject $requirements - * @property null|\Stripe\StripeObject $settings Options for customizing how the account functions within Stripe. - * @property \Stripe\StripeObject $tos_acceptance - * @property string $type The Stripe account type. Can be standard, express, or custom. - */ -class Account extends ApiResource -{ - const OBJECT_NAME = 'account'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\NestedResource; - use ApiOperations\Update; - - const BUSINESS_TYPE_COMPANY = 'company'; - const BUSINESS_TYPE_GOVERNMENT_ENTITY = 'government_entity'; - const BUSINESS_TYPE_INDIVIDUAL = 'individual'; - const BUSINESS_TYPE_NON_PROFIT = 'non_profit'; - - const CAPABILITY_CARD_PAYMENTS = 'card_payments'; - const CAPABILITY_LEGACY_PAYMENTS = 'legacy_payments'; - const CAPABILITY_PLATFORM_PAYMENTS = 'platform_payments'; - const CAPABILITY_TRANSFERS = 'transfers'; - - const CAPABILITY_STATUS_ACTIVE = 'active'; - const CAPABILITY_STATUS_INACTIVE = 'inactive'; - const CAPABILITY_STATUS_PENDING = 'pending'; - - const TYPE_CUSTOM = 'custom'; - const TYPE_EXPRESS = 'express'; - const TYPE_STANDARD = 'standard'; - - use ApiOperations\Retrieve { - retrieve as protected _retrieve; - } - - public static function getSavedNestedResources() - { - static $savedNestedResources = null; - if (null === $savedNestedResources) { - $savedNestedResources = new Util\Set([ - 'external_account', - 'bank_account', - ]); - } - - return $savedNestedResources; - } - - public function instanceUrl() - { - if (null === $this['id']) { - return '/v1/account'; - } - - return parent::instanceUrl(); - } - - public function serializeParameters($force = false) - { - $update = parent::serializeParameters($force); - if (isset($this->_values['legal_entity'])) { - $entity = $this['legal_entity']; - if (isset($entity->_values['additional_owners'])) { - $owners = $entity['additional_owners']; - $entityUpdate = isset($update['legal_entity']) ? $update['legal_entity'] : []; - $entityUpdate['additional_owners'] = $this->serializeAdditionalOwners($entity, $owners); - $update['legal_entity'] = $entityUpdate; - } - } - if (isset($this->_values['individual'])) { - $individual = $this['individual']; - if (($individual instanceof Person) && !isset($update['individual'])) { - $update['individual'] = $individual->serializeParameters($force); - } - } - - return $update; - } - - private function serializeAdditionalOwners($legalEntity, $additionalOwners) - { - if (isset($legalEntity->_originalValues['additional_owners'])) { - $originalValue = $legalEntity->_originalValues['additional_owners']; - } else { - $originalValue = []; - } - if (($originalValue) && (\count($originalValue) > \count($additionalOwners))) { - throw new Exception\InvalidArgumentException( - 'You cannot delete an item from an array, you must instead set a new array' - ); - } - - $updateArr = []; - foreach ($additionalOwners as $i => $v) { - $update = ($v instanceof StripeObject) ? $v->serializeParameters() : $v; - - if ([] !== $update) { - if (!$originalValue - || !\array_key_exists($i, $originalValue) - || ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { - $updateArr[$i] = $update; - } - } - } - - return $updateArr; - } - - /** - * @param null|array|string $id the ID of the account to retrieve, or an - * options array containing an `id` key - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public static function retrieve($id = null, $opts = null) - { - if (!$opts && \is_string($id) && 'sk_' === \substr($id, 0, 3)) { - $opts = $id; - $id = null; - } - - return self::_retrieve($id, $opts); - } - - /** - * @param null|array $clientId - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject object containing the response from the API - */ - public function deauthorize($clientId = null, $opts = null) - { - $params = [ - 'client_id' => $clientId, - 'stripe_user_id' => $this->id, - ]; - - return OAuth::deauthorize($params, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Person> the list of persons - */ - public function persons($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/persons'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account the rejected account - */ - public function reject($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/reject'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /* - * Capabilities methods - * We can not add the capabilities() method today as the Account object already has a - * capabilities property which is a hash and not the sub-list of capabilities. - */ - - const PATH_CAPABILITIES = '/capabilities'; - - /** - * @param string $id the ID of the account on which to retrieve the capabilities - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Capability> the list of capabilities - */ - public static function allCapabilities($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_CAPABILITIES, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the capability belongs - * @param string $capabilityId the ID of the capability to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Capability - */ - public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the capability belongs - * @param string $capabilityId the ID of the capability to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Capability - */ - public static function updateCapability($id, $capabilityId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); - } - const PATH_EXTERNAL_ACCOUNTS = '/external_accounts'; - - /** - * @param string $id the ID of the account on which to retrieve the external accounts - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> the list of external accounts (BankAccount or Card) - */ - public static function allExternalAccounts($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts); - } - - /** - * @param string $id the ID of the account on which to create the external account - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public static function createExternalAccount($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the external account belongs - * @param string $externalAccountId the ID of the external account to delete - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public static function deleteExternalAccount($id, $externalAccountId, $params = null, $opts = null) - { - return self::_deleteNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the external account belongs - * @param string $externalAccountId the ID of the external account to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public static function retrieveExternalAccount($id, $externalAccountId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the external account belongs - * @param string $externalAccountId the ID of the external account to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public static function updateExternalAccount($id, $externalAccountId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); - } - const PATH_LOGIN_LINKS = '/login_links'; - - /** - * @param string $id the ID of the account on which to create the login link - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\LoginLink - */ - public static function createLoginLink($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts); - } - const PATH_PERSONS = '/persons'; - - /** - * @param string $id the ID of the account on which to retrieve the persons - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Person> the list of persons - */ - public static function allPersons($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_PERSONS, $params, $opts); - } - - /** - * @param string $id the ID of the account on which to create the person - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public static function createPerson($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_PERSONS, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the person belongs - * @param string $personId the ID of the person to delete - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public static function deletePerson($id, $personId, $params = null, $opts = null) - { - return self::_deleteNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the person belongs - * @param string $personId the ID of the person to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public static function retrievePerson($id, $personId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the person belongs - * @param string $personId the ID of the person to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public static function updatePerson($id, $personId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/AccountLink.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/AccountLink.php deleted file mode 100644 index 24a9e68a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/AccountLink.php +++ /dev/null @@ -1,26 +0,0 @@ -Connect - * Onboarding. - * - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property int $expires_at The timestamp at which this account link will expire. - * @property string $url The URL for the account link. - */ -class AccountLink extends ApiResource -{ - const OBJECT_NAME = 'account_link'; - - use ApiOperations\Create; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/AlipayAccount.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/AlipayAccount.php deleted file mode 100644 index 1d6a5096..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/AlipayAccount.php +++ /dev/null @@ -1,75 +0,0 @@ -json, $opts); - if (!($obj instanceof \Stripe\Collection)) { - throw new \Stripe\Exception\UnexpectedValueException( - 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' - ); - } - $obj->setLastResponse($response); - $obj->setFilters($params); - - return $obj; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Create.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Create.php deleted file mode 100644 index c4351321..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Create.php +++ /dev/null @@ -1,31 +0,0 @@ -json, $opts); - $obj->setLastResponse($response); - - return $obj; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php deleted file mode 100644 index c6082ff9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php +++ /dev/null @@ -1,30 +0,0 @@ -instanceUrl(); - list($response, $opts) = $this->_request('delete', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php deleted file mode 100644 index 180cacd2..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php +++ /dev/null @@ -1,135 +0,0 @@ -json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|string $nestedId - * - * @return string - */ - protected static function _nestedResourceUrl($id, $nestedPath, $nestedId = null) - { - $url = static::resourceUrl($id) . $nestedPath; - if (null !== $nestedId) { - $url .= "/{$nestedId}"; - } - - return $url; - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|array $params - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject - */ - protected static function _createNestedResource($id, $nestedPath, $params = null, $options = null) - { - $url = static::_nestedResourceUrl($id, $nestedPath); - - return self::_nestedResourceOperation('post', $url, $params, $options); - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|string $nestedId - * @param null|array $params - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject - */ - protected static function _retrieveNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) - { - $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); - - return self::_nestedResourceOperation('get', $url, $params, $options); - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|string $nestedId - * @param null|array $params - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject - */ - protected static function _updateNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) - { - $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); - - return self::_nestedResourceOperation('post', $url, $params, $options); - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|string $nestedId - * @param null|array $params - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject - */ - protected static function _deleteNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) - { - $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); - - return self::_nestedResourceOperation('delete', $url, $params, $options); - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|array $params - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject - */ - protected static function _allNestedResources($id, $nestedPath, $params = null, $options = null) - { - $url = static::_nestedResourceUrl($id, $nestedPath); - - return self::_nestedResourceOperation('get', $url, $params, $options); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Request.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Request.php deleted file mode 100644 index a60ca796..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Request.php +++ /dev/null @@ -1,100 +0,0 @@ - 100, " - . "'currency' => 'usd', 'source' => 'tok_1234'])\")"; - - throw new \Stripe\Exception\InvalidArgumentException($message); - } - } - - /** - * @param string $method HTTP method ('get', 'post', etc.) - * @param string $url URL for the request - * @param array $params list of parameters for the request - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return array tuple containing (the JSON response, $options) - */ - protected function _request($method, $url, $params = [], $options = null) - { - $opts = $this->_opts->merge($options); - list($resp, $options) = static::_staticRequest($method, $url, $params, $opts); - $this->setLastResponse($resp); - - return [$resp->json, $options]; - } - - /** - * @param string $method HTTP method ('get', 'post', etc.) - * @param string $url URL for the request - * @param callable $readBodyChunk function that will receive chunks of data from a successful request body - * @param array $params list of parameters for the request - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - */ - protected function _requestStream($method, $url, $readBodyChunk, $params = [], $options = null) - { - $opts = $this->_opts->merge($options); - static::_staticStreamingRequest($method, $url, $readBodyChunk, $params, $opts); - } - - /** - * @param string $method HTTP method ('get', 'post', etc.) - * @param string $url URL for the request - * @param array $params list of parameters for the request - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return array tuple containing (the JSON response, $options) - */ - protected static function _staticRequest($method, $url, $params, $options) - { - $opts = \Stripe\Util\RequestOptions::parse($options); - $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); - $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); - list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers); - $opts->discardNonPersistentHeaders(); - - return [$response, $opts]; - } - - /** - * @param string $method HTTP method ('get', 'post', etc.) - * @param string $url URL for the request - * @param callable $readBodyChunk function that will receive chunks of data from a successful request body - * @param array $params list of parameters for the request - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - */ - protected static function _staticStreamingRequest($method, $url, $readBodyChunk, $params, $options) - { - $opts = \Stripe\Util\RequestOptions::parse($options); - $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); - $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); - $requestor->requestStream($method, $url, $readBodyChunk, $params, $opts->headers); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php deleted file mode 100644 index 5170afb3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php +++ /dev/null @@ -1,30 +0,0 @@ -refresh(); - - return $instance; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Search.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Search.php deleted file mode 100644 index 09472eba..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Search.php +++ /dev/null @@ -1,37 +0,0 @@ -json, $opts); - if (!($obj instanceof \Stripe\SearchResult)) { - throw new \Stripe\Exception\UnexpectedValueException( - 'Expected type ' . \Stripe\SearchResult::class . ', got "' . \get_class($obj) . '" instead.' - ); - } - $obj->setLastResponse($response); - $obj->setFilters($params); - - return $obj; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Update.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Update.php deleted file mode 100644 index 688f0808..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiOperations/Update.php +++ /dev/null @@ -1,52 +0,0 @@ -json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return static the saved resource - */ - public function save($opts = null) - { - $params = $this->serializeParameters(); - if (\count($params) > 0) { - $url = $this->instanceUrl(); - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - } - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php deleted file mode 100644 index b2fa1923..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php +++ /dev/null @@ -1,619 +0,0 @@ -_apiKey = $apiKey; - if (!$apiBase) { - $apiBase = Stripe::$apiBase; - } - $this->_apiBase = $apiBase; - } - - /** - * Creates a telemetry json blob for use in 'X-Stripe-Client-Telemetry' headers. - * - * @static - * - * @param RequestTelemetry $requestTelemetry - * - * @return string - */ - private static function _telemetryJson($requestTelemetry) - { - $payload = [ - 'last_request_metrics' => [ - 'request_id' => $requestTelemetry->requestId, - 'request_duration_ms' => $requestTelemetry->requestDuration, - ], - ]; - - $result = \json_encode($payload); - if (false !== $result) { - return $result; - } - Stripe::getLogger()->error('Serializing telemetry payload failed!'); - - return '{}'; - } - - /** - * @static - * - * @param ApiResource|array|bool|mixed $d - * - * @return ApiResource|array|mixed|string - */ - private static function _encodeObjects($d) - { - if ($d instanceof ApiResource) { - return Util\Util::utf8($d->id); - } - if (true === $d) { - return 'true'; - } - if (false === $d) { - return 'false'; - } - if (\is_array($d)) { - $res = []; - foreach ($d as $k => $v) { - $res[$k] = self::_encodeObjects($v); - } - - return $res; - } - - return Util\Util::utf8($d); - } - - /** - * @param string $method - * @param string $url - * @param null|array $params - * @param null|array $headers - * - * @throws Exception\ApiErrorException - * - * @return array tuple containing (ApiReponse, API key) - */ - public function request($method, $url, $params = null, $headers = null) - { - $params = $params ?: []; - $headers = $headers ?: []; - list($rbody, $rcode, $rheaders, $myApiKey) = - $this->_requestRaw($method, $url, $params, $headers); - $json = $this->_interpretResponse($rbody, $rcode, $rheaders); - $resp = new ApiResponse($rbody, $rcode, $rheaders, $json); - - return [$resp, $myApiKey]; - } - - /** - * @param string $method - * @param string $url - * @param callable $readBodyChunkCallable - * @param null|array $params - * @param null|array $headers - * - * @throws Exception\ApiErrorException - */ - public function requestStream($method, $url, $readBodyChunkCallable, $params = null, $headers = null) - { - $params = $params ?: []; - $headers = $headers ?: []; - list($rbody, $rcode, $rheaders, $myApiKey) = - $this->_requestRawStreaming($method, $url, $params, $headers, $readBodyChunkCallable); - if ($rcode >= 300) { - $this->_interpretResponse($rbody, $rcode, $rheaders); - } - } - - /** - * @param string $rbody a JSON string - * @param int $rcode - * @param array $rheaders - * @param array $resp - * - * @throws Exception\UnexpectedValueException - * @throws Exception\ApiErrorException - */ - public function handleErrorResponse($rbody, $rcode, $rheaders, $resp) - { - if (!\is_array($resp) || !isset($resp['error'])) { - $msg = "Invalid response object from API: {$rbody} " - . "(HTTP response code was {$rcode})"; - - throw new Exception\UnexpectedValueException($msg); - } - - $errorData = $resp['error']; - - $error = null; - if (\is_string($errorData)) { - $error = self::_specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorData); - } - if (!$error) { - $error = self::_specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData); - } - - throw $error; - } - - /** - * @static - * - * @param string $rbody - * @param int $rcode - * @param array $rheaders - * @param array $resp - * @param array $errorData - * - * @return Exception\ApiErrorException - */ - private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData) - { - $msg = isset($errorData['message']) ? $errorData['message'] : null; - $param = isset($errorData['param']) ? $errorData['param'] : null; - $code = isset($errorData['code']) ? $errorData['code'] : null; - $type = isset($errorData['type']) ? $errorData['type'] : null; - $declineCode = isset($errorData['decline_code']) ? $errorData['decline_code'] : null; - - switch ($rcode) { - case 400: - // 'rate_limit' code is deprecated, but left here for backwards compatibility - // for API versions earlier than 2015-09-08 - if ('rate_limit' === $code) { - return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); - } - if ('idempotency_error' === $type) { - return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); - } - - // no break - case 404: - return Exception\InvalidRequestException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); - - case 401: - return Exception\AuthenticationException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); - - case 402: - return Exception\CardException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $declineCode, $param); - - case 403: - return Exception\PermissionException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); - - case 429: - return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); - - default: - return Exception\UnknownApiErrorException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); - } - } - - /** - * @static - * - * @param bool|string $rbody - * @param int $rcode - * @param array $rheaders - * @param array $resp - * @param string $errorCode - * - * @return Exception\OAuth\OAuthErrorException - */ - private static function _specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorCode) - { - $description = isset($resp['error_description']) ? $resp['error_description'] : $errorCode; - - switch ($errorCode) { - case 'invalid_client': - return Exception\OAuth\InvalidClientException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - case 'invalid_grant': - return Exception\OAuth\InvalidGrantException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - case 'invalid_request': - return Exception\OAuth\InvalidRequestException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - case 'invalid_scope': - return Exception\OAuth\InvalidScopeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - case 'unsupported_grant_type': - return Exception\OAuth\UnsupportedGrantTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - case 'unsupported_response_type': - return Exception\OAuth\UnsupportedResponseTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - default: - return Exception\OAuth\UnknownOAuthErrorException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - } - } - - /** - * @static - * - * @param null|array $appInfo - * - * @return null|string - */ - private static function _formatAppInfo($appInfo) - { - if (null !== $appInfo) { - $string = $appInfo['name']; - if (null !== $appInfo['version']) { - $string .= '/' . $appInfo['version']; - } - if (null !== $appInfo['url']) { - $string .= ' (' . $appInfo['url'] . ')'; - } - - return $string; - } - - return null; - } - - /** - * @static - * - * @param string $disabledFunctionsOutput - String value of the 'disable_function' setting, as output by \ini_get('disable_functions') - * @param string $functionName - Name of the function we are interesting in seeing whether or not it is disabled - * @param mixed $disableFunctionsOutput - * - * @return bool - */ - private static function _isDisabled($disableFunctionsOutput, $functionName) - { - $disabledFunctions = \explode(',', $disableFunctionsOutput); - foreach ($disabledFunctions as $disabledFunction) { - if (\trim($disabledFunction) === $functionName) { - return true; - } - } - - return false; - } - - /** - * @static - * - * @param string $apiKey - * @param null $clientInfo - * - * @return array - */ - private static function _defaultHeaders($apiKey, $clientInfo = null) - { - $uaString = 'Stripe/v1 PhpBindings/' . Stripe::VERSION; - - $langVersion = \PHP_VERSION; - $uname_disabled = static::_isDisabled(\ini_get('disable_functions'), 'php_uname'); - $uname = $uname_disabled ? '(disabled)' : \php_uname(); - - $appInfo = Stripe::getAppInfo(); - $ua = [ - 'bindings_version' => Stripe::VERSION, - 'lang' => 'php', - 'lang_version' => $langVersion, - 'publisher' => 'stripe', - 'uname' => $uname, - ]; - if ($clientInfo) { - $ua = \array_merge($clientInfo, $ua); - } - if (null !== $appInfo) { - $uaString .= ' ' . self::_formatAppInfo($appInfo); - $ua['application'] = $appInfo; - } - - return [ - 'X-Stripe-Client-User-Agent' => \json_encode($ua), - 'User-Agent' => $uaString, - 'Authorization' => 'Bearer ' . $apiKey, - ]; - } - - private function _prepareRequest($method, $url, $params, $headers) - { - $myApiKey = $this->_apiKey; - if (!$myApiKey) { - $myApiKey = Stripe::$apiKey; - } - - if (!$myApiKey) { - $msg = 'No API key provided. (HINT: set your API key using ' - . '"Stripe::setApiKey()". You can generate API keys from ' - . 'the Stripe web interface. See https://stripe.com/api for ' - . 'details, or email support@stripe.com if you have any questions.'; - - throw new Exception\AuthenticationException($msg); - } - - // Clients can supply arbitrary additional keys to be included in the - // X-Stripe-Client-User-Agent header via the optional getUserAgentInfo() - // method - $clientUAInfo = null; - if (\method_exists($this->httpClient(), 'getUserAgentInfo')) { - $clientUAInfo = $this->httpClient()->getUserAgentInfo(); - } - - if ($params && \is_array($params)) { - $optionKeysInParams = \array_filter( - static::$OPTIONS_KEYS, - function ($key) use ($params) { - return \array_key_exists($key, $params); - } - ); - if (\count($optionKeysInParams) > 0) { - $message = \sprintf('Options found in $params: %s. Options should ' - . 'be passed in their own array after $params. (HINT: pass an ' - . 'empty array to $params if you do not have any.)', \implode(', ', $optionKeysInParams)); - \trigger_error($message, \E_USER_WARNING); - } - } - - $absUrl = $this->_apiBase . $url; - $params = self::_encodeObjects($params); - $defaultHeaders = $this->_defaultHeaders($myApiKey, $clientUAInfo); - if (Stripe::$apiVersion) { - $defaultHeaders['Stripe-Version'] = Stripe::$apiVersion; - } - - if (Stripe::$accountId) { - $defaultHeaders['Stripe-Account'] = Stripe::$accountId; - } - - if (Stripe::$enableTelemetry && null !== self::$requestTelemetry) { - $defaultHeaders['X-Stripe-Client-Telemetry'] = self::_telemetryJson(self::$requestTelemetry); - } - - $hasFile = false; - foreach ($params as $k => $v) { - if (\is_resource($v)) { - $hasFile = true; - $params[$k] = self::_processResourceParam($v); - } elseif ($v instanceof \CURLFile) { - $hasFile = true; - } - } - - if ($hasFile) { - $defaultHeaders['Content-Type'] = 'multipart/form-data'; - } else { - $defaultHeaders['Content-Type'] = 'application/x-www-form-urlencoded'; - } - - $combinedHeaders = \array_merge($defaultHeaders, $headers); - $rawHeaders = []; - - foreach ($combinedHeaders as $header => $value) { - $rawHeaders[] = $header . ': ' . $value; - } - - return [$absUrl, $rawHeaders, $params, $hasFile, $myApiKey]; - } - - /** - * @param string $method - * @param string $url - * @param array $params - * @param array $headers - * - * @throws Exception\AuthenticationException - * @throws Exception\ApiConnectionException - * - * @return array - */ - private function _requestRaw($method, $url, $params, $headers) - { - list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers); - - $requestStartMs = Util\Util::currentTimeMillis(); - - list($rbody, $rcode, $rheaders) = $this->httpClient()->request( - $method, - $absUrl, - $rawHeaders, - $params, - $hasFile - ); - - if (isset($rheaders['request-id']) - && \is_string($rheaders['request-id']) - && '' !== $rheaders['request-id']) { - self::$requestTelemetry = new RequestTelemetry( - $rheaders['request-id'], - Util\Util::currentTimeMillis() - $requestStartMs - ); - } - - return [$rbody, $rcode, $rheaders, $myApiKey]; - } - - /** - * @param string $method - * @param string $url - * @param array $params - * @param array $headers - * @param callable $readBodyChunk - * @param mixed $readBodyChunkCallable - * - * @throws Exception\AuthenticationException - * @throws Exception\ApiConnectionException - * - * @return array - */ - private function _requestRawStreaming($method, $url, $params, $headers, $readBodyChunkCallable) - { - list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers); - - $requestStartMs = Util\Util::currentTimeMillis(); - - list($rbody, $rcode, $rheaders) = $this->streamingHttpClient()->requestStream( - $method, - $absUrl, - $rawHeaders, - $params, - $hasFile, - $readBodyChunkCallable - ); - - if (isset($rheaders['request-id']) - && \is_string($rheaders['request-id']) - && '' !== $rheaders['request-id']) { - self::$requestTelemetry = new RequestTelemetry( - $rheaders['request-id'], - Util\Util::currentTimeMillis() - $requestStartMs - ); - } - - return [$rbody, $rcode, $rheaders, $myApiKey]; - } - - /** - * @param resource $resource - * - * @throws Exception\InvalidArgumentException - * - * @return \CURLFile|string - */ - private function _processResourceParam($resource) - { - if ('stream' !== \get_resource_type($resource)) { - throw new Exception\InvalidArgumentException( - 'Attempted to upload a resource that is not a stream' - ); - } - - $metaData = \stream_get_meta_data($resource); - if ('plainfile' !== $metaData['wrapper_type']) { - throw new Exception\InvalidArgumentException( - 'Only plainfile resource streams are supported' - ); - } - - // We don't have the filename or mimetype, but the API doesn't care - return new \CURLFile($metaData['uri']); - } - - /** - * @param string $rbody - * @param int $rcode - * @param array $rheaders - * - * @throws Exception\UnexpectedValueException - * @throws Exception\ApiErrorException - * - * @return array - */ - private function _interpretResponse($rbody, $rcode, $rheaders) - { - $resp = \json_decode($rbody, true); - $jsonError = \json_last_error(); - if (null === $resp && \JSON_ERROR_NONE !== $jsonError) { - $msg = "Invalid response body from API: {$rbody} " - . "(HTTP response code was {$rcode}, json_last_error() was {$jsonError})"; - - throw new Exception\UnexpectedValueException($msg, $rcode); - } - - if ($rcode < 200 || $rcode >= 300) { - $this->handleErrorResponse($rbody, $rcode, $rheaders, $resp); - } - - return $resp; - } - - /** - * @static - * - * @param HttpClient\ClientInterface $client - */ - public static function setHttpClient($client) - { - self::$_httpClient = $client; - } - - /** - * @static - * - * @param HttpClient\StreamingClientInterface $client - */ - public static function setStreamingHttpClient($client) - { - self::$_streamingHttpClient = $client; - } - - /** - * @static - * - * Resets any stateful telemetry data - */ - public static function resetTelemetry() - { - self::$requestTelemetry = null; - } - - /** - * @return HttpClient\ClientInterface - */ - private function httpClient() - { - if (!self::$_httpClient) { - self::$_httpClient = HttpClient\CurlClient::instance(); - } - - return self::$_httpClient; - } - - /** - * @return HttpClient\StreamingClientInterface - */ - private function streamingHttpClient() - { - if (!self::$_streamingHttpClient) { - self::$_streamingHttpClient = HttpClient\CurlClient::instance(); - } - - return self::$_streamingHttpClient; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiResource.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiResource.php deleted file mode 100644 index 25c6b84a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiResource.php +++ /dev/null @@ -1,122 +0,0 @@ -{$k}; - if ((static::getSavedNestedResources()->includes($k)) - && ($v instanceof ApiResource)) { - $v->saveWithParent = true; - } - } - - /** - * @throws Exception\ApiErrorException - * - * @return ApiResource the refreshed resource - */ - public function refresh() - { - $requestor = new ApiRequestor($this->_opts->apiKey, static::baseUrl()); - $url = $this->instanceUrl(); - - list($response, $this->_opts->apiKey) = $requestor->request( - 'get', - $url, - $this->_retrieveOptions, - $this->_opts->headers - ); - $this->setLastResponse($response); - $this->refreshFrom($response->json, $this->_opts); - - return $this; - } - - /** - * @return string the base URL for the given class - */ - public static function baseUrl() - { - return Stripe::$apiBase; - } - - /** - * @return string the endpoint URL for the given class - */ - public static function classUrl() - { - // Replace dots with slashes for namespaced resources, e.g. if the object's name is - // "foo.bar", then its URL will be "/v1/foo/bars". - - /** @phpstan-ignore-next-line */ - $base = \str_replace('.', '/', static::OBJECT_NAME); - - return "/v1/{$base}s"; - } - - /** - * @param null|string $id the ID of the resource - * - * @throws Exception\UnexpectedValueException if $id is null - * - * @return string the instance endpoint URL for the given class - */ - public static function resourceUrl($id) - { - if (null === $id) { - $class = static::class; - $message = 'Could not determine which URL to request: ' - . "{$class} instance has invalid ID: {$id}"; - - throw new Exception\UnexpectedValueException($message); - } - $id = Util\Util::utf8($id); - $base = static::classUrl(); - $extn = \urlencode($id); - - return "{$base}/{$extn}"; - } - - /** - * @return string the full API URL for this API resource - */ - public function instanceUrl() - { - return static::resourceUrl($this['id']); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiResponse.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiResponse.php deleted file mode 100644 index e7ee2e9a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApiResponse.php +++ /dev/null @@ -1,45 +0,0 @@ -body = $body; - $this->code = $code; - $this->headers = $headers; - $this->json = $json; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApplePayDomain.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApplePayDomain.php deleted file mode 100644 index 5f9489d4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApplePayDomain.php +++ /dev/null @@ -1,31 +0,0 @@ -true
    if the object exists in live mode or the value false if the object exists in test mode. - */ -class ApplePayDomain extends ApiResource -{ - const OBJECT_NAME = 'apple_pay_domain'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - - /** - * @return string The class URL for this resource. It needs to be special - * cased because it doesn't fit into the standard resource pattern. - */ - public static function classUrl() - { - return '/v1/apple_pay/domains'; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApplicationFee.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApplicationFee.php deleted file mode 100644 index 2a53204a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApplicationFee.php +++ /dev/null @@ -1,90 +0,0 @@ -ISO currency code, in lowercase. Must be a supported currency. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Charge $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the destination parameter. - * @property bool $refunded Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false. - * @property \Stripe\Collection<\Stripe\StripeObject> $refunds A list of refunds that have been applied to the fee. - */ -class ApplicationFee extends ApiResource -{ - const OBJECT_NAME = 'application_fee'; - - use ApiOperations\All; - use ApiOperations\NestedResource; - use ApiOperations\Retrieve; - - const PATH_REFUNDS = '/refunds'; - - /** - * @param string $id the ID of the application fee on which to retrieve the fee refunds - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\ApplicationFeeRefund> the list of fee refunds - */ - public static function allRefunds($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts); - } - - /** - * @param string $id the ID of the application fee on which to create the fee refund - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public static function createRefund($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_REFUNDS, $params, $opts); - } - - /** - * @param string $id the ID of the application fee to which the fee refund belongs - * @param string $refundId the ID of the fee refund to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public static function retrieveRefund($id, $refundId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); - } - - /** - * @param string $id the ID of the application fee to which the fee refund belongs - * @param string $refundId the ID of the fee refund to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public static function updateRefund($id, $refundId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php deleted file mode 100644 index dc7c34ba..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php +++ /dev/null @@ -1,66 +0,0 @@ -Application Fee Refund objects allow you to refund an application - * fee that has previously been created but not yet refunded. Funds will be - * refunded to the Stripe account from which the fee was originally collected. - * - * Related guide: Refunding - * Application Fees. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount, in %s. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - */ -class ApplicationFeeRefund extends ApiResource -{ - const OBJECT_NAME = 'fee_refund'; - - use ApiOperations\Update { - save as protected _save; - } - - /** - * @return string the API URL for this Stripe refund - */ - public function instanceUrl() - { - $id = $this['id']; - $fee = $this['fee']; - if (!$id) { - throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", - null - ); - } - $id = Util\Util::utf8($id); - $fee = Util\Util::utf8($fee); - - $base = ApplicationFee::classUrl(); - $feeExtn = \urlencode($fee); - $extn = \urlencode($id); - - return "{$base}/{$feeExtn}/refunds/{$extn}"; - } - - /** - * @param null|array|string $opts - * - * @return ApplicationFeeRefund the saved refund - */ - public function save($opts = null) - { - return $this->_save($opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Balance.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Balance.php deleted file mode 100644 index 0fdc2850..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Balance.php +++ /dev/null @@ -1,45 +0,0 @@ -transactions - * that contributed to the balance (charges, payouts, and so forth). - * - * The available and pending amounts for each currency are broken down further by - * payment source types. - * - * Related guide: Understanding Connect - * Account Balances. - * - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the Transfers API or Payouts API. The available balance for each currency and payment type can be found in the source_types property. - * @property \Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the source_types property. - * @property \Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts. - * @property \Stripe\StripeObject $issuing - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance, due to the 7-day rolling pay cycle. The pending balance for each currency, and for each payment type, can be found in the source_types property. - */ -class Balance extends SingletonApiResource -{ - const OBJECT_NAME = 'balance'; - - /** - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Balance - */ - public static function retrieve($opts = null) - { - return self::_singletonRetrieve($opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BalanceTransaction.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BalanceTransaction.php deleted file mode 100644 index d7ddea43..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BalanceTransaction.php +++ /dev/null @@ -1,71 +0,0 @@ -Balance - * Transaction Types. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Gross amount of the transaction, in %s. - * @property int $available_on The date the transaction's net funds will become available in the Stripe balance. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|float $exchange_rate The exchange rate used, if applicable, for this transaction. Specifically, if money was converted from currency A to currency B, then the amount in currency A, times exchange_rate, would be the amount in currency B. For example, suppose you charged a customer 10.00 EUR. Then the PaymentIntent's amount would be 1000 and currency would be eur. Suppose this was converted into 12.34 USD in your Stripe account. Then the BalanceTransaction's amount would be 1234, currency would be usd, and exchange_rate would be 1.234. - * @property int $fee Fees (in %s) paid for this transaction. - * @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in %s) paid for this transaction. - * @property int $net Net amount of the transaction, in %s. - * @property string $reporting_category Learn more about how reporting categories can help you understand balance transactions from an accounting perspective. - * @property null|string|\Stripe\StripeObject $source The Stripe object to which this transaction is related. - * @property string $status If the transaction's net funds are available in the Stripe balance yet. Either available or pending. - * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, payment, payment_failure_refund, payment_refund, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider reporting_category instead. - */ -class BalanceTransaction extends ApiResource -{ - const OBJECT_NAME = 'balance_transaction'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - const TYPE_ADJUSTMENT = 'adjustment'; - const TYPE_ADVANCE = 'advance'; - const TYPE_ADVANCE_FUNDING = 'advance_funding'; - const TYPE_ANTICIPATION_REPAYMENT = 'anticipation_repayment'; - const TYPE_APPLICATION_FEE = 'application_fee'; - const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund'; - const TYPE_CHARGE = 'charge'; - const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer'; - const TYPE_CONTRIBUTION = 'contribution'; - const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold'; - const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release'; - const TYPE_ISSUING_DISPUTE = 'issuing_dispute'; - const TYPE_ISSUING_TRANSACTION = 'issuing_transaction'; - const TYPE_PAYMENT = 'payment'; - const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund'; - const TYPE_PAYMENT_REFUND = 'payment_refund'; - const TYPE_PAYOUT = 'payout'; - const TYPE_PAYOUT_CANCEL = 'payout_cancel'; - const TYPE_PAYOUT_FAILURE = 'payout_failure'; - const TYPE_REFUND = 'refund'; - const TYPE_REFUND_FAILURE = 'refund_failure'; - const TYPE_RESERVE_TRANSACTION = 'reserve_transaction'; - const TYPE_RESERVED_FUNDS = 'reserved_funds'; - const TYPE_STRIPE_FEE = 'stripe_fee'; - const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee'; - const TYPE_TAX_FEE = 'tax_fee'; - const TYPE_TOPUP = 'topup'; - const TYPE_TOPUP_REVERSAL = 'topup_reversal'; - const TYPE_TRANSFER = 'transfer'; - const TYPE_TRANSFER_CANCEL = 'transfer_cancel'; - const TYPE_TRANSFER_FAILURE = 'transfer_failure'; - const TYPE_TRANSFER_REFUND = 'transfer_refund'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BankAccount.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BankAccount.php deleted file mode 100644 index 57fd19be..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BankAccount.php +++ /dev/null @@ -1,133 +0,0 @@ -Customer objects. - * - * On the other hand External Accounts are - * transfer destinations on Account objects for Custom accounts. They - * can be bank accounts or debit cards as well, and are documented in the links - * above. - * - * Related guide: Bank Debits and - * Transfers. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\Account $account The ID of the account that the bank account is associated with. - * @property null|string $account_holder_name The name of the person or business that owns the bank account. - * @property null|string $account_holder_type The type of entity that holds the account. This can be either individual or company. - * @property null|string $account_type The bank account type. This can only be checking or savings in most countries. In Japan, this can only be futsu or toza. - * @property null|string[] $available_payout_methods A set of available payout methods for this bank account. Only values from this set should be passed as the method when creating a payout. - * @property null|string $bank_name Name of the bank associated with the routing number (e.g., WELLS FARGO). - * @property string $country Two-letter ISO code representing the country the bank account is located in. - * @property string $currency Three-letter ISO code for the currency paid out to the bank account. - * @property null|string|\Stripe\Customer $customer The ID of the customer that the bank account is associated with. - * @property null|bool $default_for_currency Whether this bank account is the default external account for its currency. - * @property null|string $fingerprint Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. - * @property string $last4 The last four digits of the bank account number. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $routing_number The routing transit number for the bank account. - * @property string $status

    For bank accounts, possible values are new, validated, verified, verification_failed, or errored. A bank account that hasn't had any activity or validation performed is new. If Stripe can determine that the bank account exists, its status will be validated. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be verified. If the verification failed for any reason, such as microdeposit failure, the status will be verification_failed. If a transfer sent to this bank account fails, we'll set the status to errored and will not continue to send transfers until the bank details are updated.

    For external accounts, possible values are new and errored. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to errored and transfers are stopped until account details are updated.

    - */ -class BankAccount extends ApiResource -{ - const OBJECT_NAME = 'bank_account'; - - use ApiOperations\Delete; - use ApiOperations\Update; - - /** - * Possible string representations of the bank verification status. - * - * @see https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status - */ - const STATUS_NEW = 'new'; - const STATUS_VALIDATED = 'validated'; - const STATUS_VERIFIED = 'verified'; - const STATUS_VERIFICATION_FAILED = 'verification_failed'; - const STATUS_ERRORED = 'errored'; - - /** - * @return string The instance URL for this resource. It needs to be special - * cased because it doesn't fit into the standard resource pattern. - */ - public function instanceUrl() - { - if ($this['customer']) { - $base = Customer::classUrl(); - $parent = $this['customer']; - $path = 'sources'; - } elseif ($this['account']) { - $base = Account::classUrl(); - $parent = $this['account']; - $path = 'external_accounts'; - } else { - $msg = 'Bank accounts cannot be accessed without a customer ID or account ID.'; - - throw new Exception\UnexpectedValueException($msg, null); - } - $parentExtn = \urlencode(Util\Util::utf8($parent)); - $extn = \urlencode(Util\Util::utf8($this['id'])); - - return "{$base}/{$parentExtn}/{$path}/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Bank accounts cannot be retrieved without a customer ID or ' . - 'an account ID. Retrieve a bank account using ' . - "`Customer::retrieveSource('customer_id', " . - "'bank_account_id')` or `Account::retrieveExternalAccount(" . - "'account_id', 'bank_account_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Bank accounts cannot be updated without a customer ID or an ' . - 'account ID. Update a bank account using ' . - "`Customer::updateSource('customer_id', 'bank_account_id', " . - '$updateParams)` or `Account::updateExternalAccount(' . - "'account_id', 'bank_account_id', \$updateParams)`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return BankAccount the verified bank account - */ - public function verify($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/verify'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BaseStripeClient.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BaseStripeClient.php deleted file mode 100644 index b0b2e7e5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BaseStripeClient.php +++ /dev/null @@ -1,312 +0,0 @@ - */ - private $config; - - /** @var \Stripe\Util\RequestOptions */ - private $defaultOpts; - - /** - * Initializes a new instance of the {@link BaseStripeClient} class. - * - * The constructor takes a single argument. The argument can be a string, in which case it - * should be the API key. It can also be an array with various configuration settings. - * - * Configuration settings include the following options: - * - * - api_key (null|string): the Stripe API key, to be used in regular API requests. - * - client_id (null|string): the Stripe client ID, to be used in OAuth requests. - * - stripe_account (null|string): a Stripe account ID. If set, all requests sent by the client - * will automatically use the {@code Stripe-Account} header with that account ID. - * - stripe_version (null|string): a Stripe API verion. If set, all requests sent by the client - * will include the {@code Stripe-Version} header with that API version. - * - * The following configuration settings are also available, though setting these should rarely be necessary - * (only useful if you want to send requests to a mock server like stripe-mock): - * - * - api_base (string): the base URL for regular API requests. Defaults to - * {@link DEFAULT_API_BASE}. - * - connect_base (string): the base URL for OAuth requests. Defaults to - * {@link DEFAULT_CONNECT_BASE}. - * - files_base (string): the base URL for file creation requests. Defaults to - * {@link DEFAULT_FILES_BASE}. - * - * @param array|string $config the API key as a string, or an array containing - * the client configuration settings - */ - public function __construct($config = []) - { - if (\is_string($config)) { - $config = ['api_key' => $config]; - } elseif (!\is_array($config)) { - throw new \Stripe\Exception\InvalidArgumentException('$config must be a string or an array'); - } - - $config = \array_merge($this->getDefaultConfig(), $config); - $this->validateConfig($config); - - $this->config = $config; - - $this->defaultOpts = \Stripe\Util\RequestOptions::parse([ - 'stripe_account' => $config['stripe_account'], - 'stripe_version' => $config['stripe_version'], - ]); - } - - /** - * Gets the API key used by the client to send requests. - * - * @return null|string the API key used by the client to send requests - */ - public function getApiKey() - { - return $this->config['api_key']; - } - - /** - * Gets the client ID used by the client in OAuth requests. - * - * @return null|string the client ID used by the client in OAuth requests - */ - public function getClientId() - { - return $this->config['client_id']; - } - - /** - * Gets the base URL for Stripe's API. - * - * @return string the base URL for Stripe's API - */ - public function getApiBase() - { - return $this->config['api_base']; - } - - /** - * Gets the base URL for Stripe's OAuth API. - * - * @return string the base URL for Stripe's OAuth API - */ - public function getConnectBase() - { - return $this->config['connect_base']; - } - - /** - * Gets the base URL for Stripe's Files API. - * - * @return string the base URL for Stripe's Files API - */ - public function getFilesBase() - { - return $this->config['files_base']; - } - - /** - * Sends a request to Stripe's API. - * - * @param string $method the HTTP method - * @param string $path the path of the request - * @param array $params the parameters of the request - * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request - * - * @return \Stripe\StripeObject the object returned by Stripe's API - */ - public function request($method, $path, $params, $opts) - { - $opts = $this->defaultOpts->merge($opts, true); - $baseUrl = $opts->apiBase ?: $this->getApiBase(); - $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); - list($response, $opts->apiKey) = $requestor->request($method, $path, $params, $opts->headers); - $opts->discardNonPersistentHeaders(); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * Sends a request to Stripe's API, passing chunks of the streamed response - * into a user-provided $readBodyChunkCallable callback. - * - * @param string $method the HTTP method - * @param string $path the path of the request - * @param callable $readBodyChunkCallable a function that will be called - * @param array $params the parameters of the request - * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request - * with chunks of bytes from the body if the request is successful - */ - public function requestStream($method, $path, $readBodyChunkCallable, $params, $opts) - { - $opts = $this->defaultOpts->merge($opts, true); - $baseUrl = $opts->apiBase ?: $this->getApiBase(); - $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); - list($response, $opts->apiKey) = $requestor->requestStream($method, $path, $readBodyChunkCallable, $params, $opts->headers); - } - - /** - * Sends a request to Stripe's API. - * - * @param string $method the HTTP method - * @param string $path the path of the request - * @param array $params the parameters of the request - * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request - * - * @return \Stripe\Collection of ApiResources - */ - public function requestCollection($method, $path, $params, $opts) - { - $obj = $this->request($method, $path, $params, $opts); - if (!($obj instanceof \Stripe\Collection)) { - $received_class = \get_class($obj); - $msg = "Expected to receive `Stripe\\Collection` object from Stripe API. Instead received `{$received_class}`."; - - throw new \Stripe\Exception\UnexpectedValueException($msg); - } - $obj->setFilters($params); - - return $obj; - } - - /** - * Sends a request to Stripe's API. - * - * @param string $method the HTTP method - * @param string $path the path of the request - * @param array $params the parameters of the request - * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request - * - * @return \Stripe\SearchResult of ApiResources - */ - public function requestSearchResult($method, $path, $params, $opts) - { - $obj = $this->request($method, $path, $params, $opts); - if (!($obj instanceof \Stripe\SearchResult)) { - $received_class = \get_class($obj); - $msg = "Expected to receive `Stripe\\SearchResult` object from Stripe API. Instead received `{$received_class}`."; - - throw new \Stripe\Exception\UnexpectedValueException($msg); - } - $obj->setFilters($params); - - return $obj; - } - - /** - * @param \Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\AuthenticationException - * - * @return string - */ - private function apiKeyForRequest($opts) - { - $apiKey = $opts->apiKey ?: $this->getApiKey(); - - if (null === $apiKey) { - $msg = 'No API key provided. Set your API key when constructing the ' - . 'StripeClient instance, or provide it on a per-request basis ' - . 'using the `api_key` key in the $opts argument.'; - - throw new \Stripe\Exception\AuthenticationException($msg); - } - - return $apiKey; - } - - /** - * TODO: replace this with a private constant when we drop support for PHP < 5. - * - * @return array - */ - private function getDefaultConfig() - { - return [ - 'api_key' => null, - 'client_id' => null, - 'stripe_account' => null, - 'stripe_version' => null, - 'api_base' => self::DEFAULT_API_BASE, - 'connect_base' => self::DEFAULT_CONNECT_BASE, - 'files_base' => self::DEFAULT_FILES_BASE, - ]; - } - - /** - * @param array $config - * - * @throws \Stripe\Exception\InvalidArgumentException - */ - private function validateConfig($config) - { - // api_key - if (null !== $config['api_key'] && !\is_string($config['api_key'])) { - throw new \Stripe\Exception\InvalidArgumentException('api_key must be null or a string'); - } - - if (null !== $config['api_key'] && ('' === $config['api_key'])) { - $msg = 'api_key cannot be the empty string'; - - throw new \Stripe\Exception\InvalidArgumentException($msg); - } - - if (null !== $config['api_key'] && (\preg_match('/\s/', $config['api_key']))) { - $msg = 'api_key cannot contain whitespace'; - - throw new \Stripe\Exception\InvalidArgumentException($msg); - } - - // client_id - if (null !== $config['client_id'] && !\is_string($config['client_id'])) { - throw new \Stripe\Exception\InvalidArgumentException('client_id must be null or a string'); - } - - // stripe_account - if (null !== $config['stripe_account'] && !\is_string($config['stripe_account'])) { - throw new \Stripe\Exception\InvalidArgumentException('stripe_account must be null or a string'); - } - - // stripe_version - if (null !== $config['stripe_version'] && !\is_string($config['stripe_version'])) { - throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be null or a string'); - } - - // api_base - if (!\is_string($config['api_base'])) { - throw new \Stripe\Exception\InvalidArgumentException('api_base must be a string'); - } - - // connect_base - if (!\is_string($config['connect_base'])) { - throw new \Stripe\Exception\InvalidArgumentException('connect_base must be a string'); - } - - // files_base - if (!\is_string($config['files_base'])) { - throw new \Stripe\Exception\InvalidArgumentException('files_base must be a string'); - } - - // check absence of extra keys - $extraConfigKeys = \array_diff(\array_keys($config), \array_keys($this->getDefaultConfig())); - if (!empty($extraConfigKeys)) { - // Wrap in single quote to more easily catch trailing spaces errors - $invalidKeys = "'" . \implode("', '", $extraConfigKeys) . "'"; - - throw new \Stripe\Exception\InvalidArgumentException('Found unknown key(s) in configuration array: ' . $invalidKeys); - } - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BaseStripeClientInterface.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BaseStripeClientInterface.php deleted file mode 100644 index 6b004573..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BaseStripeClientInterface.php +++ /dev/null @@ -1,44 +0,0 @@ -overriden when creating the session. - * @property \Stripe\StripeObject $features - * @property bool $is_default Whether the configuration is the default. If true, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - */ -class Configuration extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'billing_portal.configuration'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BillingPortal/Session.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BillingPortal/Session.php deleted file mode 100644 index 5cec9a40..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BillingPortal/Session.php +++ /dev/null @@ -1,41 +0,0 @@ -integration - * guide. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string|\Stripe\BillingPortal\Configuration $configuration The configuration used by this session, describing the features available. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $customer The ID of the customer for this session. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $locale The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s preferred_locales or browser’s locale is used. - * @property null|string $on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays. - * @property string $return_url The URL to redirect customers to when they click on the portal's link to return to your website. - * @property string $url The short-lived URL of the session that gives customers access to the customer portal. - */ -class Session extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'billing_portal.session'; - - use \Stripe\ApiOperations\Create; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BitcoinReceiver.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BitcoinReceiver.php deleted file mode 100644 index 1a0353b4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BitcoinReceiver.php +++ /dev/null @@ -1,71 +0,0 @@ -currency that you are collecting as payment. - * @property int $amount_received The amount of currency to which bitcoin_amount_received has been converted. - * @property int $bitcoin_amount The amount of bitcoin that the customer should send to fill the receiver. The bitcoin_amount is denominated in Satoshi: there are 10^8 Satoshi in one bitcoin. - * @property int $bitcoin_amount_received The amount of bitcoin that has been sent by the customer to this receiver. - * @property string $bitcoin_uri This URI can be displayed to the customer as a clickable link (to activate their bitcoin client) or as a QR code (for mobile wallets). - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO code for the currency to which the bitcoin will be converted. - * @property null|string $customer The customer ID of the bitcoin receiver. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string $email The customer's email address, set by the API call that creates the receiver. - * @property bool $filled This flag is initially false and updates to true when the customer sends the bitcoin_amount to this receiver. - * @property string $inbound_address A bitcoin address that is specific to this receiver. The customer can send bitcoin to this address to fill the receiver. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $payment The ID of the payment created from the receiver, if any. Hidden when viewing the receiver with a publishable key. - * @property null|string $refund_address The refund address of this bitcoin receiver. - * @property \Stripe\Collection<\Stripe\BitcoinTransaction> $transactions A list with one entry for each time that the customer sent bitcoin to the receiver. Hidden when viewing the receiver with a publishable key. - * @property bool $uncaptured_funds This receiver contains uncaptured funds that can be used for a payment or refunded. - * @property null|bool $used_for_payment Indicate if this source is used for payment. - */ -class BitcoinReceiver extends ApiResource -{ - const OBJECT_NAME = 'bitcoin_receiver'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - /** - * @return string The class URL for this resource. It needs to be special - * cased because it doesn't fit into the standard resource pattern. - */ - public static function classUrl() - { - return '/v1/bitcoin/receivers'; - } - - /** - * @return string The instance URL for this resource. It needs to be special - * cased because it doesn't fit into the standard resource pattern. - */ - public function instanceUrl() - { - if ($this['customer']) { - $base = Customer::classUrl(); - $parent = $this['customer']; - $path = 'sources'; - $parentExtn = \urlencode(Util\Util::utf8($parent)); - $extn = \urlencode(Util\Util::utf8($this['id'])); - - return "{$base}/{$parentExtn}/{$path}/{$extn}"; - } - - $base = BitcoinReceiver::classUrl(); - $extn = \urlencode(Util\Util::utf8($this['id'])); - - return "{$base}/{$extn}"; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BitcoinTransaction.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BitcoinTransaction.php deleted file mode 100644 index 3aa71185..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/BitcoinTransaction.php +++ /dev/null @@ -1,19 +0,0 @@ -currency that the transaction was converted to in real-time. - * @property int $bitcoin_amount The amount of bitcoin contained in the transaction. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO code for the currency to which this transaction was converted. - * @property string $receiver The receiver to which this transaction was sent. - */ -class BitcoinTransaction extends ApiResource -{ - const OBJECT_NAME = 'bitcoin_transaction'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Capability.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Capability.php deleted file mode 100644 index f675d719..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Capability.php +++ /dev/null @@ -1,88 +0,0 @@ -Account - * capabilities. - * - * @property string $id The identifier for the capability. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string|\Stripe\Account $account The account for which the capability enables functionality. - * @property \Stripe\StripeObject $future_requirements - * @property bool $requested Whether the capability has been requested. - * @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $requirements - * @property string $status The status of the capability. Can be active, inactive, pending, or unrequested. - */ -class Capability extends ApiResource -{ - const OBJECT_NAME = 'capability'; - - use ApiOperations\Update; - - const STATUS_ACTIVE = 'active'; - const STATUS_INACTIVE = 'inactive'; - const STATUS_PENDING = 'pending'; - const STATUS_UNREQUESTED = 'unrequested'; - - /** - * @return string the API URL for this Stripe account reversal - */ - public function instanceUrl() - { - $id = $this['id']; - $account = $this['account']; - if (!$id) { - throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", - null - ); - } - $id = Util\Util::utf8($id); - $account = Util\Util::utf8($account); - - $base = Account::classUrl(); - $accountExtn = \urlencode($account); - $extn = \urlencode($id); - - return "{$base}/{$accountExtn}/capabilities/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Capabilities cannot be retrieved without an account ID. ' . - 'Retrieve a capability using `Account::retrieveCapability(' . - "'account_id', 'capability_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Capabilities cannot be updated without an account ID. ' . - 'Update a capability using `Account::updateCapability(' . - "'account_id', 'capability_id', \$updateParams)`."; - - throw new Exception\BadMethodCallException($msg); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Card.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Card.php deleted file mode 100644 index ba0e6fed..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Card.php +++ /dev/null @@ -1,143 +0,0 @@ -Card Payments - * with Sources. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\Account $account The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. - * @property null|string $address_city City/District/Suburb/Town/Village. - * @property null|string $address_country Billing address country, if provided when creating card. - * @property null|string $address_line1 Address line 1 (Street address/PO Box/Company name). - * @property null|string $address_line1_check If address_line1 was provided, results of the check: pass, fail, unavailable, or unchecked. - * @property null|string $address_line2 Address line 2 (Apartment/Suite/Unit/Building). - * @property null|string $address_state State/County/Province/Region. - * @property null|string $address_zip ZIP or postal code. - * @property null|string $address_zip_check If address_zip was provided, results of the check: pass, fail, unavailable, or unchecked. - * @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the method when creating a payout. - * @property string $brand Card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown. - * @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. - * @property null|string $currency Three-letter ISO code for currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. - * @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead. - * @property null|string $cvc_check If a CVC was provided, results of the check: pass, fail, unavailable, or unchecked. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see Check if a card is valid without a charge. - * @property null|bool $default_for_currency Whether this card is the default external account for its currency. - * @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number. - * @property int $exp_month Two-digit number representing the card's expiration month. - * @property int $exp_year Four-digit number representing the card's expiration year. - * @property null|string $fingerprint

    Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.

    Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.

    - * @property string $funding Card funding type. Can be credit, debit, prepaid, or unknown. - * @property string $last4 The last four digits of the card. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $name Cardholder name. - * @property null|string|\Stripe\Recipient $recipient The recipient that this card belongs to. This attribute will not be in the card object if the card belongs to a customer or account instead. - * @property null|string $status For external accounts, possible values are new and errored. If a transfer fails, the status is set to errored and transfers are stopped until account details are updated. - * @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be android_pay (includes Google Pay), apple_pay, masterpass, visa_checkout, or null. - */ -class Card extends ApiResource -{ - const OBJECT_NAME = 'card'; - - use ApiOperations\Delete; - use ApiOperations\Update; - - /** - * Possible string representations of the CVC check status. - * - * @see https://stripe.com/docs/api/cards/object#card_object-cvc_check - */ - const CVC_CHECK_FAIL = 'fail'; - const CVC_CHECK_PASS = 'pass'; - const CVC_CHECK_UNAVAILABLE = 'unavailable'; - const CVC_CHECK_UNCHECKED = 'unchecked'; - - /** - * Possible string representations of the funding of the card. - * - * @see https://stripe.com/docs/api/cards/object#card_object-funding - */ - const FUNDING_CREDIT = 'credit'; - const FUNDING_DEBIT = 'debit'; - const FUNDING_PREPAID = 'prepaid'; - const FUNDING_UNKNOWN = 'unknown'; - - /** - * Possible string representations of the tokenization method when using Apple Pay or Google Pay. - * - * @see https://stripe.com/docs/api/cards/object#card_object-tokenization_method - */ - const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay'; - const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay'; - - /** - * @return string The instance URL for this resource. It needs to be special - * cased because cards are nested resources that may belong to different - * top-level resources. - */ - public function instanceUrl() - { - if ($this['customer']) { - $base = Customer::classUrl(); - $parent = $this['customer']; - $path = 'sources'; - } elseif ($this['account']) { - $base = Account::classUrl(); - $parent = $this['account']; - $path = 'external_accounts'; - } elseif ($this['recipient']) { - $base = Recipient::classUrl(); - $parent = $this['recipient']; - $path = 'cards'; - } else { - $msg = 'Cards cannot be accessed without a customer ID, account ID or recipient ID.'; - - throw new Exception\UnexpectedValueException($msg); - } - $parentExtn = \urlencode(Util\Util::utf8($parent)); - $extn = \urlencode(Util\Util::utf8($this['id'])); - - return "{$base}/{$parentExtn}/{$path}/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Cards cannot be retrieved without a customer ID or an ' . - 'account ID. Retrieve a card using ' . - "`Customer::retrieveSource('customer_id', 'card_id')` or " . - "`Account::retrieveExternalAccount('account_id', 'card_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Cards cannot be updated without a customer ID or an ' . - 'account ID. Update a card using ' . - "`Customer::updateSource('customer_id', 'card_id', " . - '$updateParams)` or `Account::updateExternalAccount(' . - "'account_id', 'card_id', \$updateParams)`."; - - throw new Exception\BadMethodCallException($msg); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CashBalance.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CashBalance.php deleted file mode 100644 index c63f272f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CashBalance.php +++ /dev/null @@ -1,66 +0,0 @@ -Cash balance represents real funds. Customers can add - * funds to their cash balance by sending a bank transfer. These funds can be used - * for payment and can eventually be paid out to your bank account. - * - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. - * @property string $customer The ID of the customer whose cash balance this object represents. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $settings - */ -class CashBalance extends ApiResource -{ - const OBJECT_NAME = 'cash_balance'; - - /** - * @return string the API URL for this balance transaction - */ - public function instanceUrl() - { - $customer = $this['customer']; - $customer = Util\Util::utf8($customer); - - $base = Customer::classUrl(); - $customerExtn = \urlencode($customer); - - return "{$base}/{$customerExtn}/cash_balance"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Customer Cash Balance cannot be retrieved without a ' . - 'customer ID. Retrieve a Customer Cash Balance using ' . - "`Customer::retrieveCashBalance('customer_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Customer Cash Balance cannot be updated without a ' . - 'customer ID. Retrieve a Customer Cash Balance using ' . - "`Customer::updateCashBalance('customer_id')`."; - - throw new Exception\BadMethodCallException($msg); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Charge.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Charge.php deleted file mode 100644 index e9ac3b4a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Charge.php +++ /dev/null @@ -1,163 +0,0 @@ -Charge object. You - * can retrieve and refund individual charges as well as list all charges. Charges - * are identified by a unique, random ID. - * - * Related guide: Accept a - * payment with the Charges API. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - * @property int $amount_captured Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made). - * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued). - * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge. - * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. See the Connect documentation for details. - * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the charge. See the Connect documentation for details. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). - * @property \Stripe\StripeObject $billing_details - * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. - * @property bool $captured If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer ID of the customer this charge is for if one exists. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\Account $destination ID of an existing, connected Stripe account to transfer funds to if transfer_data was specified in the charge request. - * @property null|string|\Stripe\Dispute $dispute Details about the dispute if the charge has been disputed. - * @property bool $disputed Whether the charge has been disputed. - * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. - * @property null|string $failure_code Error code explaining reason for charge failure if available (see the errors section for a list of codes). - * @property null|string $failure_message Message to user further explaining reason for charge failure if available. - * @property null|\Stripe\StripeObject $fraud_details Information on fraud assessments for the charge. - * @property null|string|\Stripe\Invoice $invoice ID of the invoice this charge is for if one exists. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details. - * @property null|string|\Stripe\Order $order ID of the order this charge is for if one exists. - * @property null|\Stripe\StripeObject $outcome Details about whether the payment was accepted, and why. See understanding declines for details. - * @property bool $paid true if the charge succeeded, or was successfully authorized for later capture. - * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent associated with this charge, if one exists. - * @property null|string $payment_method ID of the payment method used in this charge. - * @property null|\Stripe\StripeObject $payment_method_details Details about the payment method at the time of the transaction. - * @property null|string $receipt_email This is the email address that the receipt for this charge was sent to. - * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent. - * @property null|string $receipt_url This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. - * @property bool $refunded Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. - * @property \Stripe\Collection<\Stripe\Refund> $refunds A list of refunds that have been applied to the charge. - * @property null|string|\Stripe\Review $review ID of the review associated with this charge if one exists. - * @property null|\Stripe\StripeObject $shipping Shipping information for the charge. - * @property null|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead. - * @property null|string|\Stripe\Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details. - * @property null|string $statement_descriptor For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters. - * @property null|string $statement_descriptor_suffix Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - * @property string $status The status of the payment is either succeeded, pending, or failed. - * @property string|\Stripe\Transfer $transfer ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter). - * @property null|\Stripe\StripeObject $transfer_data An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details. - * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. - */ -class Charge extends ApiResource -{ - const OBJECT_NAME = 'charge'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Search; - use ApiOperations\Update; - - const STATUS_FAILED = 'failed'; - const STATUS_PENDING = 'pending'; - const STATUS_SUCCEEDED = 'succeeded'; - - /** - * Possible string representations of decline codes. - * These strings are applicable to the decline_code property of the \Stripe\Exception\CardException exception. - * - * @see https://stripe.com/docs/declines/codes - */ - const DECLINED_AUTHENTICATION_REQUIRED = 'authentication_required'; - const DECLINED_APPROVE_WITH_ID = 'approve_with_id'; - const DECLINED_CALL_ISSUER = 'call_issuer'; - const DECLINED_CARD_NOT_SUPPORTED = 'card_not_supported'; - const DECLINED_CARD_VELOCITY_EXCEEDED = 'card_velocity_exceeded'; - const DECLINED_CURRENCY_NOT_SUPPORTED = 'currency_not_supported'; - const DECLINED_DO_NOT_HONOR = 'do_not_honor'; - const DECLINED_DO_NOT_TRY_AGAIN = 'do_not_try_again'; - const DECLINED_DUPLICATED_TRANSACTION = 'duplicate_transaction'; - const DECLINED_EXPIRED_CARD = 'expired_card'; - const DECLINED_FRAUDULENT = 'fraudulent'; - const DECLINED_GENERIC_DECLINE = 'generic_decline'; - const DECLINED_INCORRECT_NUMBER = 'incorrect_number'; - const DECLINED_INCORRECT_CVC = 'incorrect_cvc'; - const DECLINED_INCORRECT_PIN = 'incorrect_pin'; - const DECLINED_INCORRECT_ZIP = 'incorrect_zip'; - const DECLINED_INSUFFICIENT_FUNDS = 'insufficient_funds'; - const DECLINED_INVALID_ACCOUNT = 'invalid_account'; - const DECLINED_INVALID_AMOUNT = 'invalid_amount'; - const DECLINED_INVALID_CVC = 'invalid_cvc'; - const DECLINED_INVALID_EXPIRY_YEAR = 'invalid_expiry_year'; - const DECLINED_INVALID_NUMBER = 'invalid_number'; - const DECLINED_INVALID_PIN = 'invalid_pin'; - const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available'; - const DECLINED_LOST_CARD = 'lost_card'; - const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist'; - const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available'; - const DECLINED_NO_ACTION_TAKEN = 'no_action_taken'; - const DECLINED_NOT_PERMITTED = 'not_permitted'; - const DECLINED_OFFLINE_PIN_REQUIRED = 'offline_pin_required'; - const DECLINED_ONLINE_OR_OFFLINE_PIN_REQUIRED = 'online_or_offline_pin_required'; - const DECLINED_PICKUP_CARD = 'pickup_card'; - const DECLINED_PIN_TRY_EXCEEDED = 'pin_try_exceeded'; - const DECLINED_PROCESSING_ERROR = 'processing_error'; - const DECLINED_REENTER_TRANSACTION = 'reenter_transaction'; - const DECLINED_RESTRICTED_CARD = 'restricted_card'; - const DECLINED_REVOCATION_OF_ALL_AUTHORIZATIONS = 'revocation_of_all_authorizations'; - const DECLINED_REVOCATION_OF_AUTHORIZATION = 'revocation_of_authorization'; - const DECLINED_SECURITY_VIOLATION = 'security_violation'; - const DECLINED_SERVICE_NOT_ALLOWED = 'service_not_allowed'; - const DECLINED_STOLEN_CARD = 'stolen_card'; - const DECLINED_STOP_PAYMENT_ORDER = 'stop_payment_order'; - const DECLINED_TESTMODE_DECLINE = 'testmode_decline'; - const DECLINED_TRANSACTION_NOT_ALLOWED = 'transaction_not_allowed'; - const DECLINED_TRY_AGAIN_LATER = 'try_again_later'; - const DECLINED_WITHDRAWAL_COUNT_LIMIT_EXCEEDED = 'withdrawal_count_limit_exceeded'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Charge the captured charge - */ - public function capture($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/capture'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult the charge search results - */ - public static function search($params = null, $opts = null) - { - $url = '/v1/charges/search'; - - return self::_searchResource($url, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Checkout/Session.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Checkout/Session.php deleted file mode 100644 index aa8b3401..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Checkout/Session.php +++ /dev/null @@ -1,133 +0,0 @@ -Checkout or Payment Links. We - * recommend creating a new Session each time your customer attempts to pay. - * - * Once payment is successful, the Checkout Session will contain a reference to the - * Customer, and either the - * successful PaymentIntent or an - * active Subscription. - * - * You can create a Checkout Session on your server and pass its ID to the client - * to begin Checkout. - * - * Related guide: Checkout - * Server Quickstart. - * - * @property string $id Unique identifier for the object. Used to pass to redirectToCheckout in Stripe.js. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $after_expiration When set, provides configuration for actions to take if this Checkout Session expires. - * @property null|bool $allow_promotion_codes Enables user redeemable promotion codes. - * @property null|int $amount_subtotal Total of all items before discounts or taxes are applied. - * @property null|int $amount_total Total of all items after discounts and taxes are applied. - * @property \Stripe\StripeObject $automatic_tax - * @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address. - * @property string $cancel_url The URL the customer will be directed to if they decide to cancel payment and return to your website. - * @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. - * @property null|\Stripe\StripeObject $consent Results of consent_collection for this session. - * @property null|\Stripe\StripeObject $consent_collection When set, provides configuration for the Checkout Session to gather active consent from customers. - * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer The ID of the customer for this Session. For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created. - * @property null|string $customer_creation Configure whether a Checkout Session creates a Customer when the Checkout Session completes. - * @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in payment or subscription mode. - * @property null|string $customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the customer attribute. - * @property int $expires_at The timestamp at which the Checkout Session will expire. - * @property \Stripe\Collection<\Stripe\LineItem> $line_items The line items purchased by the customer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $mode The mode of the Checkout Session. - * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in payment mode. - * @property null|string|\Stripe\PaymentLink $payment_link The ID of the Payment Link that created this Session. - * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. - * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. - * @property string $payment_status The payment status of the Checkout Session, one of paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order. - * @property \Stripe\StripeObject $phone_number_collection - * @property null|string $recovered_from The ID of the original expired Checkout Session that triggered the recovery flow. - * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in setup mode. - * @property null|\Stripe\StripeObject $shipping Shipping information for this Checkout Session. - * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer. - * @property \Stripe\StripeObject[] $shipping_options The shipping rate options applied to this Session. - * @property null|string|\Stripe\ShippingRate $shipping_rate The ID of the ShippingRate for Checkout Sessions in payment mode. - * @property null|string $status The status of the Checkout Session, one of open, complete, or expired. - * @property null|string $submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode, but not Checkout Sessions in subscription or setup mode. - * @property null|string|\Stripe\Subscription $subscription The ID of the subscription for Checkout Sessions in subscription mode. - * @property string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. - * @property \Stripe\StripeObject $tax_id_collection - * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. - * @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. - */ -class Session extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'checkout.session'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\NestedResource; - use \Stripe\ApiOperations\Retrieve; - - const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; - const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; - - const CUSTOMER_CREATION_ALWAYS = 'always'; - const CUSTOMER_CREATION_IF_REQUIRED = 'if_required'; - - const MODE_PAYMENT = 'payment'; - const MODE_SETUP = 'setup'; - const MODE_SUBSCRIPTION = 'subscription'; - - const PAYMENT_STATUS_NO_PAYMENT_REQUIRED = 'no_payment_required'; - const PAYMENT_STATUS_PAID = 'paid'; - const PAYMENT_STATUS_UNPAID = 'unpaid'; - - const STATUS_COMPLETE = 'complete'; - const STATUS_EXPIRED = 'expired'; - const STATUS_OPEN = 'open'; - - const SUBMIT_TYPE_AUTO = 'auto'; - const SUBMIT_TYPE_BOOK = 'book'; - const SUBMIT_TYPE_DONATE = 'donate'; - const SUBMIT_TYPE_PAY = 'pay'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Checkout\Session the expired session - */ - public function expire($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/expire'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - const PATH_LINE_ITEMS = '/line_items'; - - /** - * @param string $id the ID of the session on which to retrieve the items - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\LineItem> the list of items - */ - public static function allLineItems($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_LINE_ITEMS, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Collection.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Collection.php deleted file mode 100644 index 4de2f9d7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Collection.php +++ /dev/null @@ -1,312 +0,0 @@ - - * - * @property string $object - * @property string $url - * @property bool $has_more - * @property TStripeObject[] $data - */ -class Collection extends StripeObject implements \Countable, \IteratorAggregate -{ - const OBJECT_NAME = 'list'; - - use ApiOperations\Request; - - /** @var array */ - protected $filters = []; - - /** - * @return string the base URL for the given class - */ - public static function baseUrl() - { - return Stripe::$apiBase; - } - - /** - * Returns the filters. - * - * @return array the filters - */ - public function getFilters() - { - return $this->filters; - } - - /** - * Sets the filters, removing paging options. - * - * @param array $filters the filters - */ - public function setFilters($filters) - { - $this->filters = $filters; - } - - #[\ReturnTypeWillChange] - public function offsetGet($k) - { - if (\is_string($k)) { - return parent::offsetGet($k); - } - $msg = "You tried to access the {$k} index, but Collection " . - 'types only support string keys. (HINT: List calls ' . - 'return an object with a `data` (which is the data ' . - "array). You likely want to call ->data[{$k}])"; - - throw new Exception\InvalidArgumentException($msg); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws Exception\ApiErrorException - * - * @return Collection - */ - public function all($params = null, $opts = null) - { - self::_validateParams($params); - list($url, $params) = $this->extractPathAndUpdateParams($params); - - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = Util\Util::convertToStripeObject($response, $opts); - if (!($obj instanceof \Stripe\Collection)) { - throw new \Stripe\Exception\UnexpectedValueException( - 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' - ); - } - $obj->setFilters($params); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws Exception\ApiErrorException - * - * @return TStripeObject - */ - public function create($params = null, $opts = null) - { - self::_validateParams($params); - list($url, $params) = $this->extractPathAndUpdateParams($params); - - list($response, $opts) = $this->_request('post', $url, $params, $opts); - - return Util\Util::convertToStripeObject($response, $opts); - } - - /** - * @param string $id - * @param null|array $params - * @param null|array|string $opts - * - * @throws Exception\ApiErrorException - * - * @return TStripeObject - */ - public function retrieve($id, $params = null, $opts = null) - { - self::_validateParams($params); - list($url, $params) = $this->extractPathAndUpdateParams($params); - - $id = Util\Util::utf8($id); - $extn = \urlencode($id); - list($response, $opts) = $this->_request( - 'get', - "{$url}/{$extn}", - $params, - $opts - ); - - return Util\Util::convertToStripeObject($response, $opts); - } - - /** - * @return int the number of objects in the current page - */ - #[\ReturnTypeWillChange] - public function count() - { - return \count($this->data); - } - - /** - * @return \ArrayIterator an iterator that can be used to iterate - * across objects in the current page - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - return new \ArrayIterator($this->data); - } - - /** - * @return \ArrayIterator an iterator that can be used to iterate - * backwards across objects in the current page - */ - public function getReverseIterator() - { - return new \ArrayIterator(\array_reverse($this->data)); - } - - /** - * @return \Generator|TStripeObject[] A generator that can be used to - * iterate across all objects across all pages. As page boundaries are - * encountered, the next page will be fetched automatically for - * continued iteration. - */ - public function autoPagingIterator() - { - $page = $this; - - while (true) { - $filters = $this->filters ?: []; - if (\array_key_exists('ending_before', $filters) - && !\array_key_exists('starting_after', $filters)) { - foreach ($page->getReverseIterator() as $item) { - yield $item; - } - $page = $page->previousPage(); - } else { - foreach ($page as $item) { - yield $item; - } - $page = $page->nextPage(); - } - - if ($page->isEmpty()) { - break; - } - } - } - - /** - * Returns an empty collection. This is returned from {@see nextPage()} - * when we know that there isn't a next page in order to replicate the - * behavior of the API when it attempts to return a page beyond the last. - * - * @param null|array|string $opts - * - * @return Collection - */ - public static function emptyCollection($opts = null) - { - return Collection::constructFrom(['data' => []], $opts); - } - - /** - * Returns true if the page object contains no element. - * - * @return bool - */ - public function isEmpty() - { - return empty($this->data); - } - - /** - * Fetches the next page in the resource list (if there is one). - * - * This method will try to respect the limit of the current page. If none - * was given, the default limit will be fetched again. - * - * @param null|array $params - * @param null|array|string $opts - * - * @return Collection - */ - public function nextPage($params = null, $opts = null) - { - if (!$this->has_more) { - return static::emptyCollection($opts); - } - - $lastId = \end($this->data)->id; - - $params = \array_merge( - $this->filters ?: [], - ['starting_after' => $lastId], - $params ?: [] - ); - - return $this->all($params, $opts); - } - - /** - * Fetches the previous page in the resource list (if there is one). - * - * This method will try to respect the limit of the current page. If none - * was given, the default limit will be fetched again. - * - * @param null|array $params - * @param null|array|string $opts - * - * @return Collection - */ - public function previousPage($params = null, $opts = null) - { - if (!$this->has_more) { - return static::emptyCollection($opts); - } - - $firstId = $this->data[0]->id; - - $params = \array_merge( - $this->filters ?: [], - ['ending_before' => $firstId], - $params ?: [] - ); - - return $this->all($params, $opts); - } - - /** - * Gets the first item from the current page. Returns `null` if the current page is empty. - * - * @return null|TStripeObject - */ - public function first() - { - return \count($this->data) > 0 ? $this->data[0] : null; - } - - /** - * Gets the last item from the current page. Returns `null` if the current page is empty. - * - * @return null|TStripeObject - */ - public function last() - { - return \count($this->data) > 0 ? $this->data[\count($this->data) - 1] : null; - } - - private function extractPathAndUpdateParams($params) - { - $url = \parse_url($this->url); - if (!isset($url['path'])) { - throw new Exception\UnexpectedValueException("Could not parse list url into parts: {$url}"); - } - - if (isset($url['query'])) { - // If the URL contains a query param, parse it out into $params so they - // don't interact weirdly with each other. - $query = []; - \parse_str($url['query'], $query); - $params = \array_merge($params ?: [], $query); - } - - return [$url['path'], $params]; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CountrySpec.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CountrySpec.php deleted file mode 100644 index 223afb31..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CountrySpec.php +++ /dev/null @@ -1,30 +0,0 @@ -an online guide. - * - * @property string $id Unique identifier for the object. Represented as the ISO country code for this country. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $default_currency The default currency for this country. This applies to both payment methods and bank accounts. - * @property \Stripe\StripeObject $supported_bank_account_currencies Currencies that can be accepted in the specific country (for transfers). - * @property string[] $supported_payment_currencies Currencies that can be accepted in the specified country (for payments). - * @property string[] $supported_payment_methods Payment methods available in the specified country. You may need to enable some payment methods (e.g., ACH) on your account before they appear in this list. The stripe payment method refers to charging through your platform. - * @property string[] $supported_transfer_countries Countries that can accept transfers from the specified country. - * @property \Stripe\StripeObject $verification_fields - */ -class CountrySpec extends ApiResource -{ - const OBJECT_NAME = 'country_spec'; - - use ApiOperations\All; - use ApiOperations\Retrieve; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Coupon.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Coupon.php deleted file mode 100644 index 0d84bd4b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Coupon.php +++ /dev/null @@ -1,41 +0,0 @@ -invoices or orders. - * Coupons do not work with conventional one-off charges. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|int $amount_off Amount (in the currency specified) that will be taken off the subtotal of any invoices for this customer. - * @property \Stripe\StripeObject $applies_to - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $currency If amount_off has been set, the three-letter ISO code for the currency of the amount to take off. - * @property string $duration One of forever, once, and repeating. Describes how long a customer who applies this coupon will get the discount. - * @property null|int $duration_in_months If duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|int $max_redemptions Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $name Name of the coupon displayed to customers on for instance invoices or receipts. - * @property null|float $percent_off Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a %s100 invoice %s50 instead. - * @property null|int $redeem_by Date after which the coupon can no longer be redeemed. - * @property int $times_redeemed Number of times this coupon has been applied to a customer. - * @property bool $valid Taking account of the above properties, whether this coupon can still be applied to a customer. - */ -class Coupon extends ApiResource -{ - const OBJECT_NAME = 'coupon'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CreditNote.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CreditNote.php deleted file mode 100644 index 4ee660aa..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CreditNote.php +++ /dev/null @@ -1,111 +0,0 @@ -Credit Notes. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount The integer amount in %s representing the total amount of the credit note, including tax. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Customer $customer ID of the customer. - * @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note. - * @property int $discount_amount The integer amount in %s representing the total amount of discount that was credited. - * @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items. - * @property string|\Stripe\Invoice $invoice ID of the invoice. - * @property \Stripe\Collection<\Stripe\CreditNoteLineItem> $lines Line items that make up the credit note - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $memo Customer-facing text that appears on the credit note PDF. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. - * @property null|int $out_of_band_amount Amount that was credited outside of Stripe. - * @property string $pdf The link to download the PDF of the credit note. - * @property null|string $reason Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory - * @property null|string|\Stripe\Refund $refund Refund related to this credit note. - * @property string $status Status of this credit note, one of issued or void. Learn more about voiding credit notes. - * @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts. - * @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items. - * @property int $total The integer amount in %s representing the total amount of the credit note, including tax and all discount. - * @property string $type Type of this credit note, one of pre_payment or post_payment. A pre_payment credit note means it was issued when the invoice was open. A post_payment credit note means it was issued when the invoice was paid. - * @property null|int $voided_at The time that the credit note was voided. - */ -class CreditNote extends ApiResource -{ - const OBJECT_NAME = 'credit_note'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\NestedResource; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const REASON_DUPLICATE = 'duplicate'; - const REASON_FRAUDULENT = 'fraudulent'; - const REASON_ORDER_CHANGE = 'order_change'; - const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory'; - - const STATUS_ISSUED = 'issued'; - const STATUS_VOID = 'void'; - - const TYPE_POST_PAYMENT = 'post_payment'; - const TYPE_PRE_PAYMENT = 'pre_payment'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote the previewed credit note - */ - public static function preview($params = null, $opts = null) - { - $url = static::classUrl() . '/preview'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote the voided credit note - */ - public function voidCreditNote($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/void'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - const PATH_LINES = '/lines'; - - /** - * @param string $id the ID of the credit note on which to retrieve the credit note line items - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> the list of credit note line items - */ - public static function allLines($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CreditNoteLineItem.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CreditNoteLineItem.php deleted file mode 100644 index 254886b7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CreditNoteLineItem.php +++ /dev/null @@ -1,26 +0,0 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|int $quantity The number of units of product being credited. - * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item - * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. - * @property string $type The type of the credit note line item, one of invoice_line_item or custom_line_item. When the type is invoice_line_item there is an additional invoice_line_item property on the resource the value of which is the id of the credited line item on the invoice. - * @property null|int $unit_amount The cost of each unit of product being credited. - * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. - */ -class CreditNoteLineItem extends ApiResource -{ - const OBJECT_NAME = 'credit_note_line_item'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Customer.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Customer.php deleted file mode 100644 index 813ede33..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Customer.php +++ /dev/null @@ -1,343 +0,0 @@ -Save a card during - * payment. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $address The customer's address. - * @property int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. - * @property null|\Stripe\CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. These funds can be applied towards payment intents with source "cash_balance".The settings[reconciliation_mode] field describes whether these funds are applied to such payment intents manually or automatically. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $currency Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source

    ID of the default payment source for the customer.

    If you are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

    - * @property null|bool $delinquent

    When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

    If an invoice is marked uncollectible by dunning, delinquent doesn't get reset to false.

    - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one. - * @property null|string $email The customer's email address. - * @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers. - * @property \Stripe\StripeObject $invoice_settings - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $name The customer's full name or business name. - * @property int $next_invoice_sequence The suffix of the customer's next invoice number, e.g., 0001. - * @property null|string $phone The customer's phone number. - * @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference. - * @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. - * @property \Stripe\Collection<\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source> $sources The customer's payment sources, if any. - * @property \Stripe\Collection<\Stripe\Subscription> $subscriptions The customer's current subscriptions, if any. - * @property \Stripe\StripeObject $tax - * @property null|string $tax_exempt Describes the customer's tax exemption status. One of none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the text "Reverse charge". - * @property \Stripe\Collection<\Stripe\TaxId> $tax_ids The customer's tax IDs. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this customer belongs to. - */ -class Customer extends ApiResource -{ - const OBJECT_NAME = 'customer'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\NestedResource; - use ApiOperations\Retrieve; - use ApiOperations\Search; - use ApiOperations\Update; - - const TAX_EXEMPT_EXEMPT = 'exempt'; - const TAX_EXEMPT_NONE = 'none'; - const TAX_EXEMPT_REVERSE = 'reverse'; - - public static function getSavedNestedResources() - { - static $savedNestedResources = null; - if (null === $savedNestedResources) { - $savedNestedResources = new Util\Set([ - 'source', - ]); - } - - return $savedNestedResources; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @return \Stripe\Customer the updated customer - */ - public function deleteDiscount($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/discount'; - list($response, $opts) = $this->_request('delete', $url, $params, $opts); - $this->refreshFrom(['discount' => null], $opts, true); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * @param mixed $id - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Customer> list of PaymentMethods - */ - public static function allPaymentMethods($id, $params = null, $opts = null) - { - $url = static::resourceUrl($id) . '/payment_methods'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult the customer search results - */ - public static function search($params = null, $opts = null) - { - $url = '/v1/customers/search'; - - return self::_searchResource($url, $params, $opts); - } - - const PATH_CASH_BALANCE = '/cash_balance'; - - /** - * @param string $id the ID of the customer to which the cash balance belongs - * @param null|array $params - * @param null|array|string $opts - * @param mixed $cashBalanceId - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\cash_balance - */ - public static function retrieveCashBalance($id, $cashBalanceId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the cash balance belongs - * @param null|array $params - * @param null|array|string $opts - * @param mixed $cashBalanceId - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\cash_balance - */ - public static function updateCashBalance($id, $cashBalanceId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts); - } - const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; - - /** - * @param string $id the ID of the customer on which to retrieve the customer balance transactions - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\CustomerBalanceTransaction> the list of customer balance transactions - */ - public static function allBalanceTransactions($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); - } - - /** - * @param string $id the ID of the customer on which to create the customer balance transaction - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public static function createBalanceTransaction($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the customer balance transaction belongs - * @param string $balanceTransactionId the ID of the customer balance transaction to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the customer balance transaction belongs - * @param string $balanceTransactionId the ID of the customer balance transaction to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); - } - const PATH_SOURCES = '/sources'; - - /** - * @param string $id the ID of the customer on which to retrieve the payment sources - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source> the list of payment sources (AlipayAccount, BankAccount, BitcoinReceiver, Card or Source) - */ - public static function allSources($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts); - } - - /** - * @param string $id the ID of the customer on which to create the payment source - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public static function createSource($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the payment source belongs - * @param string $sourceId the ID of the payment source to delete - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public static function deleteSource($id, $sourceId, $params = null, $opts = null) - { - return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the payment source belongs - * @param string $sourceId the ID of the payment source to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public static function retrieveSource($id, $sourceId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the payment source belongs - * @param string $sourceId the ID of the payment source to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public static function updateSource($id, $sourceId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); - } - const PATH_TAX_IDS = '/tax_ids'; - - /** - * @param string $id the ID of the customer on which to retrieve the tax ids - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\TaxId> the list of tax ids - */ - public static function allTaxIds($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_TAX_IDS, $params, $opts); - } - - /** - * @param string $id the ID of the customer on which to create the tax id - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public static function createTaxId($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_TAX_IDS, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the tax id belongs - * @param string $taxIdId the ID of the tax id to delete - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null) - { - return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the tax id belongs - * @param string $taxIdId the ID of the tax id to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php deleted file mode 100644 index 8c306760..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php +++ /dev/null @@ -1,103 +0,0 @@ -balance - * value, which denotes a debit or credit that's automatically applied to their - * next invoice upon finalization. You may modify the value directly by using the - * update customer API, - * or by creating a Customer Balance Transaction, which increments or decrements - * the customer's balance by the specified amount. - * - * Related guide: Customer Balance to - * learn more. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's balance. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\CreditNote $credit_note The ID of the credit note (if any) related to the transaction. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Customer $customer The ID of the customer the transaction belongs to. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property int $ending_balance The customer's balance after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. - * @property null|string|\Stripe\Invoice $invoice The ID of the invoice (if any) related to the transaction. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $type Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_too_large, invoice_too_small, unspent_receiver_credit, or unapplied_from_invoice. See the Customer Balance page to learn more about transaction types. - */ -class CustomerBalanceTransaction extends ApiResource -{ - const OBJECT_NAME = 'customer_balance_transaction'; - - const TYPE_ADJUSTMENT = 'adjustment'; - const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice'; - const TYPE_CREDIT_NOTE = 'credit_note'; - const TYPE_INITIAL = 'initial'; - const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large'; - const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small'; - const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit'; - - const TYPE_ADJUSTEMENT = 'adjustment'; - - /** - * @return string the API URL for this balance transaction - */ - public function instanceUrl() - { - $id = $this['id']; - $customer = $this['customer']; - if (!$id) { - throw new Exception\UnexpectedValueException( - "Could not determine which URL to request: class instance has invalid ID: {$id}", - null - ); - } - $id = Util\Util::utf8($id); - $customer = Util\Util::utf8($customer); - - $base = Customer::classUrl(); - $customerExtn = \urlencode($customer); - $extn = \urlencode($id); - - return "{$base}/{$customerExtn}/balance_transactions/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Customer Balance Transactions cannot be retrieved without a ' . - 'customer ID. Retrieve a Customer Balance Transaction using ' . - "`Customer::retrieveBalanceTransaction('customer_id', " . - "'balance_transaction_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Customer Balance Transactions cannot be updated without a ' . - 'customer ID. Update a Customer Balance Transaction using ' . - "`Customer::updateBalanceTransaction('customer_id', " . - "'balance_transaction_id', \$updateParams)`."; - - throw new Exception\BadMethodCallException($msg); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Discount.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Discount.php deleted file mode 100644 index dbc5d4bb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Discount.php +++ /dev/null @@ -1,23 +0,0 @@ -Disputes and Fraud - * documentation. - * - * Related guide: Disputes and - * Fraud. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Disputed amount. Usually the amount of the charge, but can differ (usually because of currency fluctuation or because only part of the order is disputed). - * @property \Stripe\BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. - * @property string|\Stripe\Charge $charge ID of the charge that was disputed. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property \Stripe\StripeObject $evidence - * @property \Stripe\StripeObject $evidence_details - * @property bool $is_charge_refundable If true, it is still possible to refund the disputed payment. Once the payment has been fully refunded, no further funds will be withdrawn from your Stripe account as a result of this dispute. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $network_reason_code Network-dependent reason code for the dispute. - * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was disputed. - * @property string $reason Reason given by cardholder for dispute. Possible values are bank_cannot_process, check_returned, credit_not_processed, customer_initiated, debit_not_authorized, duplicate, fraudulent, general, incorrect_account_details, insufficient_funds, product_not_received, product_unacceptable, subscription_canceled, or unrecognized. Read more about dispute reasons. - * @property string $status Current status of dispute. Possible values are warning_needs_response, warning_under_review, warning_closed, needs_response, under_review, charge_refunded, won, or lost. - */ -class Dispute extends ApiResource -{ - const OBJECT_NAME = 'dispute'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process'; - const REASON_CHECK_RETURNED = 'check_returned'; - const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed'; - const REASON_CUSTOMER_INITIATED = 'customer_initiated'; - const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; - const REASON_DUPLICATE = 'duplicate'; - const REASON_FRAUDULENT = 'fraudulent'; - const REASON_GENERAL = 'general'; - const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details'; - const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds'; - const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received'; - const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable'; - const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled'; - const REASON_UNRECOGNIZED = 'unrecognized'; - - const STATUS_CHARGE_REFUNDED = 'charge_refunded'; - const STATUS_LOST = 'lost'; - const STATUS_NEEDS_RESPONSE = 'needs_response'; - const STATUS_UNDER_REVIEW = 'under_review'; - const STATUS_WARNING_CLOSED = 'warning_closed'; - const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response'; - const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review'; - const STATUS_WON = 'won'; - - /** - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Dispute the closed dispute - */ - // TODO: add $params to standardize signature - public function close($opts = null) - { - $url = $this->instanceUrl() . '/close'; - list($response, $opts) = $this->_request('post', $url, null, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/EphemeralKey.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/EphemeralKey.php deleted file mode 100644 index 253256cf..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/EphemeralKey.php +++ /dev/null @@ -1,43 +0,0 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $secret The key's secret. You can use this value to make authorized requests to the Stripe API. - * @property array $associated_objects - */ -class EphemeralKey extends ApiResource -{ - const OBJECT_NAME = 'ephemeral_key'; - - use ApiOperations\Create { - create as protected _create; - } - - use ApiOperations\Delete; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\EphemeralKey the created key - */ - public static function create($params = null, $opts = null) - { - if (!$opts || !isset($opts['stripe_version'])) { - throw new Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); - } - - return self::_create($params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ErrorObject.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ErrorObject.php deleted file mode 100644 index ae836280..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ErrorObject.php +++ /dev/null @@ -1,162 +0,0 @@ - null, - 'code' => null, - 'decline_code' => null, - 'doc_url' => null, - 'message' => null, - 'param' => null, - 'payment_intent' => null, - 'payment_method' => null, - 'setup_intent' => null, - 'source' => null, - 'type' => null, - ], $values); - parent::refreshFrom($values, $opts, $partial); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Event.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Event.php deleted file mode 100644 index 9bc59eee..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Event.php +++ /dev/null @@ -1,255 +0,0 @@ -Event object. For example, when a charge succeeds, we create a - * charge.succeeded event; and when an invoice payment attempt fails, - * we create an invoice.payment_failed event. Note that many API - * requests may cause multiple events to be created. For example, if you create a - * new subscription for a customer, you will receive both a - * customer.subscription.created event and a - * charge.succeeded event. - * - * Events occur when the state of another API resource changes. The state of that - * resource at the time of the change is embedded in the event's data field. For - * example, a charge.succeeded event will contain a charge, and an - * invoice.payment_failed event will contain an invoice. - * - * As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. - * We also have a separate webhooks system for sending the - * Event objects directly to an endpoint on your server. Webhooks are - * managed in your account - * settings, and our Using - * Webhooks guide will help you get set up. - * - * When using Connect, you can also - * receive notifications of events that occur in connected accounts. For these - * events, there will be an additional account attribute in the - * received Event object. - * - * NOTE: Right now, access to events through the Retrieve Event API is - * guaranteed only for 30 days. - * - * This class includes constants for the possible string representations of - * event types. See https://stripe.com/docs/api#event_types for more details. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $account The connected account that originated the event. - * @property null|string $api_version The Stripe API version used to render data. Note: This property is populated only for events on or after October 31, 2014. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $data - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $pending_webhooks Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified. - * @property null|\Stripe\StripeObject $request Information on the API request that instigated the event. - * @property string $type Description of the event (e.g., invoice.created or charge.refunded). - */ -class Event extends ApiResource -{ - const OBJECT_NAME = 'event'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized'; - const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized'; - const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created'; - const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted'; - const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated'; - const ACCOUNT_UPDATED = 'account.updated'; - const APPLICATION_FEE_CREATED = 'application_fee.created'; - const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; - const APPLICATION_FEE_REFUNDED = 'application_fee.refunded'; - const BALANCE_AVAILABLE = 'balance.available'; - const BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created'; - const BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated'; - const CAPABILITY_UPDATED = 'capability.updated'; - const CASH_BALANCE_FUNDS_AVAILABLE = 'cash_balance.funds_available'; - const CHARGE_CAPTURED = 'charge.captured'; - const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed'; - const CHARGE_DISPUTE_CREATED = 'charge.dispute.created'; - const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated'; - const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn'; - const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated'; - const CHARGE_EXPIRED = 'charge.expired'; - const CHARGE_FAILED = 'charge.failed'; - const CHARGE_PENDING = 'charge.pending'; - const CHARGE_REFUND_UPDATED = 'charge.refund.updated'; - const CHARGE_REFUNDED = 'charge.refunded'; - const CHARGE_SUCCEEDED = 'charge.succeeded'; - const CHARGE_UPDATED = 'charge.updated'; - const CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED = 'checkout.session.async_payment_failed'; - const CHECKOUT_SESSION_ASYNC_PAYMENT_SUCCEEDED = 'checkout.session.async_payment_succeeded'; - const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed'; - const CHECKOUT_SESSION_EXPIRED = 'checkout.session.expired'; - const COUPON_CREATED = 'coupon.created'; - const COUPON_DELETED = 'coupon.deleted'; - const COUPON_UPDATED = 'coupon.updated'; - const CREDIT_NOTE_CREATED = 'credit_note.created'; - const CREDIT_NOTE_UPDATED = 'credit_note.updated'; - const CREDIT_NOTE_VOIDED = 'credit_note.voided'; - const CUSTOMER_CREATED = 'customer.created'; - const CUSTOMER_DELETED = 'customer.deleted'; - const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created'; - const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted'; - const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated'; - const CUSTOMER_SOURCE_CREATED = 'customer.source.created'; - const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted'; - const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring'; - const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated'; - const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created'; - const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted'; - const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied'; - const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired'; - const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end'; - const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated'; - const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created'; - const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted'; - const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated'; - const CUSTOMER_UPDATED = 'customer.updated'; - const FILE_CREATED = 'file.created'; - const IDENTITY_VERIFICATION_SESSION_CANCELED = 'identity.verification_session.canceled'; - const IDENTITY_VERIFICATION_SESSION_CREATED = 'identity.verification_session.created'; - const IDENTITY_VERIFICATION_SESSION_PROCESSING = 'identity.verification_session.processing'; - const IDENTITY_VERIFICATION_SESSION_REDACTED = 'identity.verification_session.redacted'; - const IDENTITY_VERIFICATION_SESSION_REQUIRES_INPUT = 'identity.verification_session.requires_input'; - const IDENTITY_VERIFICATION_SESSION_VERIFIED = 'identity.verification_session.verified'; - const INVOICE_CREATED = 'invoice.created'; - const INVOICE_DELETED = 'invoice.deleted'; - const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed'; - const INVOICE_FINALIZED = 'invoice.finalized'; - const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible'; - const INVOICE_PAID = 'invoice.paid'; - const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required'; - const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; - const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded'; - const INVOICE_SENT = 'invoice.sent'; - const INVOICE_UPCOMING = 'invoice.upcoming'; - const INVOICE_UPDATED = 'invoice.updated'; - const INVOICE_VOIDED = 'invoice.voided'; - const INVOICEITEM_CREATED = 'invoiceitem.created'; - const INVOICEITEM_DELETED = 'invoiceitem.deleted'; - const INVOICEITEM_UPDATED = 'invoiceitem.updated'; - const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created'; - const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created'; - const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request'; - const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated'; - const ISSUING_CARD_CREATED = 'issuing_card.created'; - const ISSUING_CARD_UPDATED = 'issuing_card.updated'; - const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created'; - const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated'; - const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed'; - const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created'; - const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated'; - const ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted'; - const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated'; - const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created'; - const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated'; - const MANDATE_UPDATED = 'mandate.updated'; - const ORDER_CREATED = 'order.created'; - const ORDER_PAYMENT_FAILED = 'order.payment_failed'; - const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded'; - const ORDER_UPDATED = 'order.updated'; - const ORDER_RETURN_CREATED = 'order_return.created'; - const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated'; - const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled'; - const PAYMENT_INTENT_CREATED = 'payment_intent.created'; - const PAYMENT_INTENT_PARTIALLY_FUNDED = 'payment_intent.partially_funded'; - const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed'; - const PAYMENT_INTENT_PROCESSING = 'payment_intent.processing'; - const PAYMENT_INTENT_REQUIRES_ACTION = 'payment_intent.requires_action'; - const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded'; - const PAYMENT_LINK_CREATED = 'payment_link.created'; - const PAYMENT_LINK_UPDATED = 'payment_link.updated'; - const PAYMENT_METHOD_ATTACHED = 'payment_method.attached'; - const PAYMENT_METHOD_AUTOMATICALLY_UPDATED = 'payment_method.automatically_updated'; - const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated'; - const PAYMENT_METHOD_DETACHED = 'payment_method.detached'; - const PAYMENT_METHOD_UPDATED = 'payment_method.updated'; - const PAYOUT_CANCELED = 'payout.canceled'; - const PAYOUT_CREATED = 'payout.created'; - const PAYOUT_FAILED = 'payout.failed'; - const PAYOUT_PAID = 'payout.paid'; - const PAYOUT_UPDATED = 'payout.updated'; - const PERSON_CREATED = 'person.created'; - const PERSON_DELETED = 'person.deleted'; - const PERSON_UPDATED = 'person.updated'; - const PING = 'ping'; - const PLAN_CREATED = 'plan.created'; - const PLAN_DELETED = 'plan.deleted'; - const PLAN_UPDATED = 'plan.updated'; - const PRICE_CREATED = 'price.created'; - const PRICE_DELETED = 'price.deleted'; - const PRICE_UPDATED = 'price.updated'; - const PRODUCT_CREATED = 'product.created'; - const PRODUCT_DELETED = 'product.deleted'; - const PRODUCT_UPDATED = 'product.updated'; - const PROMOTION_CODE_CREATED = 'promotion_code.created'; - const PROMOTION_CODE_DELETED = 'promotion_code.deleted'; - const PROMOTION_CODE_UPDATED = 'promotion_code.updated'; - const QUOTE_ACCEPTED = 'quote.accepted'; - const QUOTE_CANCELED = 'quote.canceled'; - const QUOTE_CREATED = 'quote.created'; - const QUOTE_FINALIZED = 'quote.finalized'; - const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created'; - const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated'; - const RECIPIENT_CREATED = 'recipient.created'; - const RECIPIENT_DELETED = 'recipient.deleted'; - const RECIPIENT_UPDATED = 'recipient.updated'; - const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed'; - const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded'; - const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated'; - const REVIEW_CLOSED = 'review.closed'; - const REVIEW_OPENED = 'review.opened'; - const SETUP_INTENT_CANCELED = 'setup_intent.canceled'; - const SETUP_INTENT_CREATED = 'setup_intent.created'; - const SETUP_INTENT_REQUIRES_ACTION = 'setup_intent.requires_action'; - const SETUP_INTENT_SETUP_FAILED = 'setup_intent.setup_failed'; - const SETUP_INTENT_SUCCEEDED = 'setup_intent.succeeded'; - const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created'; - const SKU_CREATED = 'sku.created'; - const SKU_DELETED = 'sku.deleted'; - const SKU_UPDATED = 'sku.updated'; - const SOURCE_CANCELED = 'source.canceled'; - const SOURCE_CHARGEABLE = 'source.chargeable'; - const SOURCE_FAILED = 'source.failed'; - const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification'; - const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required'; - const SOURCE_TRANSACTION_CREATED = 'source.transaction.created'; - const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated'; - const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted'; - const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled'; - const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed'; - const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created'; - const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring'; - const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released'; - const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated'; - const TAX_RATE_CREATED = 'tax_rate.created'; - const TAX_RATE_UPDATED = 'tax_rate.updated'; - const TERMINAL_READER_ACTION_FAILED = 'terminal.reader.action_failed'; - const TERMINAL_READER_ACTION_SUCCEEDED = 'terminal.reader.action_succeeded'; - const TEST_HELPERS_TEST_CLOCK_ADVANCING = 'test_helpers.test_clock.advancing'; - const TEST_HELPERS_TEST_CLOCK_CREATED = 'test_helpers.test_clock.created'; - const TEST_HELPERS_TEST_CLOCK_DELETED = 'test_helpers.test_clock.deleted'; - const TEST_HELPERS_TEST_CLOCK_INTERNAL_FAILURE = 'test_helpers.test_clock.internal_failure'; - const TEST_HELPERS_TEST_CLOCK_READY = 'test_helpers.test_clock.ready'; - const TOPUP_CANCELED = 'topup.canceled'; - const TOPUP_CREATED = 'topup.created'; - const TOPUP_FAILED = 'topup.failed'; - const TOPUP_REVERSED = 'topup.reversed'; - const TOPUP_SUCCEEDED = 'topup.succeeded'; - const TRANSFER_CREATED = 'transfer.created'; - const TRANSFER_FAILED = 'transfer.failed'; - const TRANSFER_PAID = 'transfer.paid'; - const TRANSFER_REVERSED = 'transfer.reversed'; - const TRANSFER_UPDATED = 'transfer.updated'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php deleted file mode 100644 index 33f2ede9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php +++ /dev/null @@ -1,12 +0,0 @@ -setHttpStatus($httpStatus); - $instance->setHttpBody($httpBody); - $instance->setJsonBody($jsonBody); - $instance->setHttpHeaders($httpHeaders); - $instance->setStripeCode($stripeCode); - - $instance->setRequestId(null); - if ($httpHeaders && isset($httpHeaders['Request-Id'])) { - $instance->setRequestId($httpHeaders['Request-Id']); - } - - $instance->setError($instance->constructErrorObject()); - - return $instance; - } - - /** - * Gets the Stripe error object. - * - * @return null|\Stripe\ErrorObject - */ - public function getError() - { - return $this->error; - } - - /** - * Sets the Stripe error object. - * - * @param null|\Stripe\ErrorObject $error - */ - public function setError($error) - { - $this->error = $error; - } - - /** - * Gets the HTTP body as a string. - * - * @return null|string - */ - public function getHttpBody() - { - return $this->httpBody; - } - - /** - * Sets the HTTP body as a string. - * - * @param null|string $httpBody - */ - public function setHttpBody($httpBody) - { - $this->httpBody = $httpBody; - } - - /** - * Gets the HTTP headers array. - * - * @return null|array|\Stripe\Util\CaseInsensitiveArray - */ - public function getHttpHeaders() - { - return $this->httpHeaders; - } - - /** - * Sets the HTTP headers array. - * - * @param null|array|\Stripe\Util\CaseInsensitiveArray $httpHeaders - */ - public function setHttpHeaders($httpHeaders) - { - $this->httpHeaders = $httpHeaders; - } - - /** - * Gets the HTTP status code. - * - * @return null|int - */ - public function getHttpStatus() - { - return $this->httpStatus; - } - - /** - * Sets the HTTP status code. - * - * @param null|int $httpStatus - */ - public function setHttpStatus($httpStatus) - { - $this->httpStatus = $httpStatus; - } - - /** - * Gets the JSON deserialized body. - * - * @return null|array - */ - public function getJsonBody() - { - return $this->jsonBody; - } - - /** - * Sets the JSON deserialized body. - * - * @param null|array $jsonBody - */ - public function setJsonBody($jsonBody) - { - $this->jsonBody = $jsonBody; - } - - /** - * Gets the Stripe request ID. - * - * @return null|string - */ - public function getRequestId() - { - return $this->requestId; - } - - /** - * Sets the Stripe request ID. - * - * @param null|string $requestId - */ - public function setRequestId($requestId) - { - $this->requestId = $requestId; - } - - /** - * Gets the Stripe error code. - * - * Cf. the `CODE_*` constants on {@see \Stripe\ErrorObject} for possible - * values. - * - * @return null|string - */ - public function getStripeCode() - { - return $this->stripeCode; - } - - /** - * Sets the Stripe error code. - * - * @param null|string $stripeCode - */ - public function setStripeCode($stripeCode) - { - $this->stripeCode = $stripeCode; - } - - /** - * Returns the string representation of the exception. - * - * @return string - */ - public function __toString() - { - $statusStr = (null === $this->getHttpStatus()) ? '' : "(Status {$this->getHttpStatus()}) "; - $idStr = (null === $this->getRequestId()) ? '' : "(Request {$this->getRequestId()}) "; - - return "{$statusStr}{$idStr}{$this->getMessage()}"; - } - - protected function constructErrorObject() - { - if (null === $this->jsonBody || !\array_key_exists('error', $this->jsonBody)) { - return null; - } - - return \Stripe\ErrorObject::constructFrom($this->jsonBody['error']); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php deleted file mode 100644 index 9e5c718b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php +++ /dev/null @@ -1,11 +0,0 @@ -setDeclineCode($declineCode); - $instance->setStripeParam($stripeParam); - - return $instance; - } - - /** - * Gets the decline code. - * - * @return null|string - */ - public function getDeclineCode() - { - return $this->declineCode; - } - - /** - * Sets the decline code. - * - * @param null|string $declineCode - */ - public function setDeclineCode($declineCode) - { - $this->declineCode = $declineCode; - } - - /** - * Gets the parameter related to the error. - * - * @return null|string - */ - public function getStripeParam() - { - return $this->stripeParam; - } - - /** - * Sets the parameter related to the error. - * - * @param null|string $stripeParam - */ - public function setStripeParam($stripeParam) - { - $this->stripeParam = $stripeParam; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php deleted file mode 100644 index c84f37de..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -setStripeParam($stripeParam); - - return $instance; - } - - /** - * Gets the parameter related to the error. - * - * @return null|string - */ - public function getStripeParam() - { - return $this->stripeParam; - } - - /** - * Sets the parameter related to the error. - * - * @param null|string $stripeParam - */ - public function setStripeParam($stripeParam) - { - $this->stripeParam = $stripeParam; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php deleted file mode 100644 index dd426620..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php +++ /dev/null @@ -1,10 +0,0 @@ -jsonBody) { - return null; - } - - return \Stripe\OAuthErrorObject::constructFrom($this->jsonBody); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php deleted file mode 100644 index c8dba29b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php +++ /dev/null @@ -1,12 +0,0 @@ -setHttpBody($httpBody); - $instance->setSigHeader($sigHeader); - - return $instance; - } - - /** - * Gets the HTTP body as a string. - * - * @return null|string - */ - public function getHttpBody() - { - return $this->httpBody; - } - - /** - * Sets the HTTP body as a string. - * - * @param null|string $httpBody - */ - public function setHttpBody($httpBody) - { - $this->httpBody = $httpBody; - } - - /** - * Gets the `Stripe-Signature` HTTP header. - * - * @return null|string - */ - public function getSigHeader() - { - return $this->sigHeader; - } - - /** - * Sets the `Stripe-Signature` HTTP header. - * - * @param null|string $sigHeader - */ - public function setSigHeader($sigHeader) - { - $this->sigHeader = $sigHeader; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php deleted file mode 100644 index 0a629edf..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php +++ /dev/null @@ -1,7 +0,0 @@ -Exchange Rate objects allow you to determine the rates that Stripe - * is currently using to convert from one currency to another. Since this number is - * variable throughout the day, there are various reasons why you might want to - * know the current rate (for example, to dynamically price an item for a user with - * a default payment in a foreign currency). - * - * If you want a guarantee that the charge is made with a certain exchange rate you - * expect is current, you can pass in exchange_rate to charges - * endpoints. If the value is no longer up to date, the charge won't go through. - * Please refer to our Exchange - * Rates API guide for more details. - * - * @property string $id Unique identifier for the object. Represented as the three-letter ISO currency code in lowercase. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $rates Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. - */ -class ExchangeRate extends ApiResource -{ - const OBJECT_NAME = 'exchange_rate'; - - use ApiOperations\All; - use ApiOperations\Retrieve; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/File.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/File.php deleted file mode 100644 index 04646d30..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/File.php +++ /dev/null @@ -1,87 +0,0 @@ -create file request (for - * example, when uploading dispute evidence) or it may have been created by Stripe - * (for example, the results of a Sigma scheduled - * query). - * - * Related guide: File Upload - * Guide. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|int $expires_at The time at which the file expires and is no longer available in epoch seconds. - * @property null|string $filename A filename for the file, suitable for saving to a filesystem. - * @property null|\Stripe\Collection<\Stripe\FileLink> $links A list of file links that point at this file. - * @property string $purpose The purpose of the uploaded file. - * @property int $size The size in bytes of the file object. - * @property null|string $title A user friendly title for the document. - * @property null|string $type The type of the file returned (e.g., csv, pdf, jpg, or png). - * @property null|string $url The URL from which the file can be downloaded using your live secret API key. - */ -class File extends ApiResource -{ - const OBJECT_NAME = 'file'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - const PURPOSE_ACCOUNT_REQUIREMENT = 'account_requirement'; - const PURPOSE_ADDITIONAL_VERIFICATION = 'additional_verification'; - const PURPOSE_BUSINESS_ICON = 'business_icon'; - const PURPOSE_BUSINESS_LOGO = 'business_logo'; - const PURPOSE_CUSTOMER_SIGNATURE = 'customer_signature'; - const PURPOSE_DISPUTE_EVIDENCE = 'dispute_evidence'; - const PURPOSE_DOCUMENT_PROVIDER_IDENTITY_DOCUMENT = 'document_provider_identity_document'; - const PURPOSE_FINANCE_REPORT_RUN = 'finance_report_run'; - const PURPOSE_IDENTITY_DOCUMENT = 'identity_document'; - const PURPOSE_IDENTITY_DOCUMENT_DOWNLOADABLE = 'identity_document_downloadable'; - const PURPOSE_PCI_DOCUMENT = 'pci_document'; - const PURPOSE_SELFIE = 'selfie'; - const PURPOSE_SIGMA_SCHEDULED_QUERY = 'sigma_scheduled_query'; - const PURPOSE_TAX_DOCUMENT_USER_UPLOAD = 'tax_document_user_upload'; - - // This resource can have two different object names. In latter API - // versions, only `file` is used, but since stripe-php may be used with - // any API version, we need to support deserializing the older - // `file_upload` object into the same class. - const OBJECT_NAME_ALT = 'file_upload'; - - use ApiOperations\Create { - create as protected _create; - } - - public static function classUrl() - { - return '/v1/files'; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\File the created file - */ - public static function create($params = null, $opts = null) - { - $opts = \Stripe\Util\RequestOptions::parse($opts); - if (null === $opts->apiBase) { - $opts->apiBase = Stripe::$apiUploadBase; - } - // Manually flatten params, otherwise curl's multipart encoder will - // choke on nested arrays. - $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); - - return static::_create($flatParams, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FileLink.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FileLink.php deleted file mode 100644 index ce3b10bd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FileLink.php +++ /dev/null @@ -1,30 +0,0 @@ -File object with non-Stripe users, you - * can create a FileLink. FileLinks contain a URL that - * can be used to retrieve the contents of the file without authentication. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property bool $expired Whether this link is already expired. - * @property null|int $expires_at Time at which the link expires. - * @property string|\Stripe\File $file The file object this link points to. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $url The publicly accessible URL to download the file. - */ -class FileLink extends ApiResource -{ - const OBJECT_NAME = 'file_link'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FinancialConnections/Account.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FinancialConnections/Account.php deleted file mode 100644 index f24ef43d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FinancialConnections/Account.php +++ /dev/null @@ -1,84 +0,0 @@ -subcategory. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $display_name A human-readable name that has been assigned to this account, either by the account holder or by the institution. - * @property string $institution_name The name of the institution that holds this account. - * @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\FinancialConnections\AccountOwnership $ownership The most recent information about the account's owners. - * @property null|\Stripe\StripeObject $ownership_refresh The state of the most recent attempt to refresh the account owners. - * @property null|string[] $permissions The list of permissions granted by this account. - * @property string $status The status of the link to the account. - * @property string $subcategory

    If category is cash, one of:

    - checking - savings - other

    If category is credit, one of:

    - mortgage - line_of_credit - credit_card - other

    If category is investment or other, this will be other.

    - * @property string[] $supported_payment_method_types The PaymentMethod type(s) that can be created from this account. - */ -class Account extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'financial_connections.account'; - - use \Stripe\ApiOperations\Retrieve; - - const CATEGORY_CASH = 'cash'; - const CATEGORY_CREDIT = 'credit'; - const CATEGORY_INVESTMENT = 'investment'; - const CATEGORY_OTHER = 'other'; - - const STATUS_ACTIVE = 'active'; - const STATUS_DISCONNECTED = 'disconnected'; - const STATUS_INACTIVE = 'inactive'; - - const SUBCATEGORY_CHECKING = 'checking'; - const SUBCATEGORY_CREDIT_CARD = 'credit_card'; - const SUBCATEGORY_LINE_OF_CREDIT = 'line_of_credit'; - const SUBCATEGORY_MORTGAGE = 'mortgage'; - const SUBCATEGORY_OTHER = 'other'; - const SUBCATEGORY_SAVINGS = 'savings'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FinancialConnections\Account the disconnected account - */ - public function disconnect($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/disconnect'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FinancialConnections\Account the refreshed account - */ - public function refresh($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/refresh'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php deleted file mode 100644 index 53a7f1a4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php +++ /dev/null @@ -1,20 +0,0 @@ - $owners A paginated list of owners for this account. - */ -class AccountOwnership extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'financial_connections.account_ownership'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FinancialConnections/Session.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FinancialConnections/Session.php deleted file mode 100644 index 8d55cd06..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FinancialConnections/Session.php +++ /dev/null @@ -1,27 +0,0 @@ - $accounts The accounts that were collected as part of this Session. - * @property string $client_secret A value that will be passed to the client to launch the authentication flow. - * @property \Stripe\StripeObject $filters - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string[] $permissions Permissions requested for accounts collected during this session. - * @property string $return_url For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - */ -class Session extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'financial_connections.session'; - - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FundingInstructions.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FundingInstructions.php deleted file mode 100644 index af799914..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/FundingInstructions.php +++ /dev/null @@ -1,28 +0,0 @@ -balance - * that is automatically applied to future invoices and payments using the - * customer_balance payment method. Customers can fund this balance by - * initiating a bank transfer to any account in the - * financial_addresses field. Related guide: Customer - * Balance - Funding Instructions to learn more. - * - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $bank_transfer - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string $funding_type The funding_type of the returned instructions - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - */ -class FundingInstructions extends ApiResource -{ - const OBJECT_NAME = 'funding_instructions'; - - const FUNDING_TYPE_BANK_TRANSFER = 'bank_transfer'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php deleted file mode 100644 index 3c7861e5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -defaultOptions = $defaultOptions; - $this->randomGenerator = $randomGenerator ?: new Util\RandomGenerator(); - $this->initUserAgentInfo(); - - $this->enableHttp2 = $this->canSafelyUseHttp2(); - } - - public function __destruct() - { - $this->closeCurlHandle(); - } - - public function initUserAgentInfo() - { - $curlVersion = \curl_version(); - $this->userAgentInfo = [ - 'httplib' => 'curl ' . $curlVersion['version'], - 'ssllib' => $curlVersion['ssl_version'], - ]; - } - - public function getDefaultOptions() - { - return $this->defaultOptions; - } - - public function getUserAgentInfo() - { - return $this->userAgentInfo; - } - - /** - * @return bool - */ - public function getEnablePersistentConnections() - { - return $this->enablePersistentConnections; - } - - /** - * @param bool $enable - */ - public function setEnablePersistentConnections($enable) - { - $this->enablePersistentConnections = $enable; - } - - /** - * @return bool - */ - public function getEnableHttp2() - { - return $this->enableHttp2; - } - - /** - * @param bool $enable - */ - public function setEnableHttp2($enable) - { - $this->enableHttp2 = $enable; - } - - /** - * @return null|callable - */ - public function getRequestStatusCallback() - { - return $this->requestStatusCallback; - } - - /** - * Sets a callback that is called after each request. The callback will - * receive the following parameters: - *
      - *
    1. string $rbody The response body
    2. - *
    3. integer $rcode The response status code
    4. - *
    5. \Stripe\Util\CaseInsensitiveArray $rheaders The response headers
    6. - *
    7. integer $errno The curl error number
    8. - *
    9. string|null $message The curl error message
    10. - *
    11. boolean $shouldRetry Whether the request will be retried
    12. - *
    13. integer $numRetries The number of the retry attempt
    14. - *
    . - * - * @param null|callable $requestStatusCallback - */ - public function setRequestStatusCallback($requestStatusCallback) - { - $this->requestStatusCallback = $requestStatusCallback; - } - - // USER DEFINED TIMEOUTS - - const DEFAULT_TIMEOUT = 80; - const DEFAULT_CONNECT_TIMEOUT = 30; - - private $timeout = self::DEFAULT_TIMEOUT; - private $connectTimeout = self::DEFAULT_CONNECT_TIMEOUT; - - public function setTimeout($seconds) - { - $this->timeout = (int) \max($seconds, 0); - - return $this; - } - - public function setConnectTimeout($seconds) - { - $this->connectTimeout = (int) \max($seconds, 0); - - return $this; - } - - public function getTimeout() - { - return $this->timeout; - } - - public function getConnectTimeout() - { - return $this->connectTimeout; - } - - // END OF USER DEFINED TIMEOUTS - - private function constructRequest($method, $absUrl, $headers, $params, $hasFile) - { - $method = \strtolower($method); - - $opts = []; - if (\is_callable($this->defaultOptions)) { // call defaultOptions callback, set options to return value - $opts = \call_user_func_array($this->defaultOptions, \func_get_args()); - if (!\is_array($opts)) { - throw new Exception\UnexpectedValueException('Non-array value returned by defaultOptions CurlClient callback'); - } - } elseif (\is_array($this->defaultOptions)) { // set default curlopts from array - $opts = $this->defaultOptions; - } - - $params = Util\Util::objectsToIds($params); - - if ('get' === $method) { - if ($hasFile) { - throw new Exception\UnexpectedValueException( - 'Issuing a GET request with a file parameter' - ); - } - $opts[\CURLOPT_HTTPGET] = 1; - if (\count($params) > 0) { - $encoded = Util\Util::encodeParameters($params); - $absUrl = "{$absUrl}?{$encoded}"; - } - } elseif ('post' === $method) { - $opts[\CURLOPT_POST] = 1; - $opts[\CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::encodeParameters($params); - } elseif ('delete' === $method) { - $opts[\CURLOPT_CUSTOMREQUEST] = 'DELETE'; - if (\count($params) > 0) { - $encoded = Util\Util::encodeParameters($params); - $absUrl = "{$absUrl}?{$encoded}"; - } - } else { - throw new Exception\UnexpectedValueException("Unrecognized method {$method}"); - } - - // It is only safe to retry network failures on POST requests if we - // add an Idempotency-Key header - if (('post' === $method) && (Stripe::$maxNetworkRetries > 0)) { - if (!$this->hasHeader($headers, 'Idempotency-Key')) { - $headers[] = 'Idempotency-Key: ' . $this->randomGenerator->uuid(); - } - } - - // By default for large request body sizes (> 1024 bytes), cURL will - // send a request without a body and with a `Expect: 100-continue` - // header, which gives the server a chance to respond with an error - // status code in cases where one can be determined right away (say - // on an authentication problem for example), and saves the "large" - // request body from being ever sent. - // - // Unfortunately, the bindings don't currently correctly handle the - // success case (in which the server sends back a 100 CONTINUE), so - // we'll error under that condition. To compensate for that problem - // for the time being, override cURL's behavior by simply always - // sending an empty `Expect:` header. - $headers[] = 'Expect: '; - - $absUrl = Util\Util::utf8($absUrl); - $opts[\CURLOPT_URL] = $absUrl; - $opts[\CURLOPT_RETURNTRANSFER] = true; - $opts[\CURLOPT_CONNECTTIMEOUT] = $this->connectTimeout; - $opts[\CURLOPT_TIMEOUT] = $this->timeout; - $opts[\CURLOPT_HTTPHEADER] = $headers; - $opts[\CURLOPT_CAINFO] = Stripe::getCABundlePath(); - if (!Stripe::getVerifySslCerts()) { - $opts[\CURLOPT_SSL_VERIFYPEER] = false; - } - - if (!isset($opts[\CURLOPT_HTTP_VERSION]) && $this->getEnableHttp2()) { - // For HTTPS requests, enable HTTP/2, if supported - $opts[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2TLS; - } - - // If the user didn't explicitly specify a CURLOPT_IPRESOLVE option, we - // force IPv4 resolving as Stripe's API servers are only accessible over - // IPv4 (see. https://github.com/stripe/stripe-php/issues/1045). - // We let users specify a custom option in case they need to say proxy - // through an IPv6 proxy. - if (!isset($opts[\CURLOPT_IPRESOLVE])) { - $opts[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; - } - - return [$opts, $absUrl]; - } - - public function request($method, $absUrl, $headers, $params, $hasFile) - { - list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile); - - list($rbody, $rcode, $rheaders) = $this->executeRequestWithRetries($opts, $absUrl); - - return [$rbody, $rcode, $rheaders]; - } - - public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunk) - { - list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile); - - $opts[\CURLOPT_RETURNTRANSFER] = false; - list($rbody, $rcode, $rheaders) = $this->executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk); - - return [$rbody, $rcode, $rheaders]; - } - - /** - * Curl permits sending \CURLOPT_HEADERFUNCTION, which is called with lines - * from the header and \CURLOPT_WRITEFUNCTION, which is called with bytes - * from the body. You usually want to handle the body differently depending - * on what was in the header. - * - * This function makes it easier to specify different callbacks depending - * on the contents of the heeder. After the header has been completely read - * and the body begins to stream, it will call $determineWriteCallback with - * the array of headers. $determineWriteCallback should, based on the - * headers it receives, return a "writeCallback" that describes what to do - * with the incoming HTTP response body. - * - * @param array $opts - * @param callable $determineWriteCallback - * - * @return array - */ - private function useHeadersToDetermineWriteCallback($opts, $determineWriteCallback) - { - $rheaders = new Util\CaseInsensitiveArray(); - $headerCallback = function ($curl, $header_line) use (&$rheaders) { - return self::parseLineIntoHeaderArray($header_line, $rheaders); - }; - - $writeCallback = null; - $writeCallbackWrapper = function ($curl, $data) use (&$writeCallback, &$rheaders, &$determineWriteCallback) { - if (null === $writeCallback) { - $writeCallback = \call_user_func_array($determineWriteCallback, [$rheaders]); - } - - return \call_user_func_array($writeCallback, [$curl, $data]); - }; - - return [$headerCallback, $writeCallbackWrapper]; - } - - private static function parseLineIntoHeaderArray($line, &$headers) - { - if (false === \strpos($line, ':')) { - return \strlen($line); - } - list($key, $value) = \explode(':', \trim($line), 2); - $headers[\trim($key)] = \trim($value); - - return \strlen($line); - } - - /** - * Like `executeRequestWithRetries` except: - * 1. Does not buffer the body of a successful (status code < 300) - * response into memory -- instead, calls the caller-provided - * $readBodyChunk with each chunk of incoming data. - * 2. Does not retry if a network error occurs while streaming the - * body of a successful response. - * - * @param array $opts cURL options - * @param string $absUrl - * @param callable $readBodyChunk - * - * @return array - */ - public function executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk) - { - /** @var bool */ - $shouldRetry = false; - /** @var int */ - $numRetries = 0; - - // Will contain the bytes of the body of the last request - // if it was not successful and should not be retries - /** @var null|string */ - $rbody = null; - - // Status code of the last request - /** @var null|bool */ - $rcode = null; - - // Array of headers from the last request - /** @var null|array */ - $lastRHeaders = null; - - $errno = null; - $message = null; - - $determineWriteCallback = function ($rheaders) use ( - &$readBodyChunk, - &$shouldRetry, - &$rbody, - &$numRetries, - &$rcode, - &$lastRHeaders, - &$errno - ) { - $lastRHeaders = $rheaders; - $errno = \curl_errno($this->curlHandle); - - $rcode = \curl_getinfo($this->curlHandle, \CURLINFO_HTTP_CODE); - - // Send the bytes from the body of a successful request to the caller-provided $readBodyChunk. - if ($rcode < 300) { - $rbody = null; - - return function ($curl, $data) use (&$readBodyChunk) { - // Don't expose the $curl handle to the user, and don't require them to - // return the length of $data. - \call_user_func_array($readBodyChunk, [$data]); - - return \strlen($data); - }; - } - - $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); - - // Discard the body from an unsuccessful request that should be retried. - if ($shouldRetry) { - return function ($curl, $data) { - return \strlen($data); - }; - } else { - // Otherwise, buffer the body into $rbody. It will need to be parsed to determine - // which exception to throw to the user. - $rbody = ''; - - return function ($curl, $data) use (&$rbody) { - $rbody .= $data; - - return \strlen($data); - }; - } - }; - - while (true) { - list($headerCallback, $writeCallback) = $this->useHeadersToDetermineWriteCallback($opts, $determineWriteCallback); - $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; - $opts[\CURLOPT_WRITEFUNCTION] = $writeCallback; - - $shouldRetry = false; - $rbody = null; - $this->resetCurlHandle(); - \curl_setopt_array($this->curlHandle, $opts); - $result = \curl_exec($this->curlHandle); - $errno = \curl_errno($this->curlHandle); - if (0 !== $errno) { - $message = \curl_error($this->curlHandle); - } - if (!$this->getEnablePersistentConnections()) { - $this->closeCurlHandle(); - } - - if (\is_callable($this->getRequestStatusCallback())) { - \call_user_func_array( - $this->getRequestStatusCallback(), - [$rbody, $rcode, $lastRHeaders, $errno, $message, $shouldRetry, $numRetries] - ); - } - - if ($shouldRetry) { - ++$numRetries; - $sleepSeconds = $this->sleepTime($numRetries, $lastRHeaders); - \usleep((int) ($sleepSeconds * 1000000)); - } else { - break; - } - } - - if (0 !== $errno) { - $this->handleCurlError($absUrl, $errno, $message, $numRetries); - } - - return [$rbody, $rcode, $lastRHeaders]; - } - - /** - * @param array $opts cURL options - * @param string $absUrl - */ - public function executeRequestWithRetries($opts, $absUrl) - { - $numRetries = 0; - - while (true) { - $rcode = 0; - $errno = 0; - $message = null; - - // Create a callback to capture HTTP headers for the response - $rheaders = new Util\CaseInsensitiveArray(); - $headerCallback = function ($curl, $header_line) use (&$rheaders) { - return CurlClient::parseLineIntoHeaderArray($header_line, $rheaders); - }; - $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; - - $this->resetCurlHandle(); - \curl_setopt_array($this->curlHandle, $opts); - $rbody = \curl_exec($this->curlHandle); - - if (false === $rbody) { - $errno = \curl_errno($this->curlHandle); - $message = \curl_error($this->curlHandle); - } else { - $rcode = \curl_getinfo($this->curlHandle, \CURLINFO_HTTP_CODE); - } - if (!$this->getEnablePersistentConnections()) { - $this->closeCurlHandle(); - } - - $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); - - if (\is_callable($this->getRequestStatusCallback())) { - \call_user_func_array( - $this->getRequestStatusCallback(), - [$rbody, $rcode, $rheaders, $errno, $message, $shouldRetry, $numRetries] - ); - } - - if ($shouldRetry) { - ++$numRetries; - $sleepSeconds = $this->sleepTime($numRetries, $rheaders); - \usleep((int) ($sleepSeconds * 1000000)); - } else { - break; - } - } - - if (false === $rbody) { - $this->handleCurlError($absUrl, $errno, $message, $numRetries); - } - - return [$rbody, $rcode, $rheaders]; - } - - /** - * @param string $url - * @param int $errno - * @param string $message - * @param int $numRetries - * - * @throws Exception\ApiConnectionException - */ - private function handleCurlError($url, $errno, $message, $numRetries) - { - switch ($errno) { - case \CURLE_COULDNT_CONNECT: - case \CURLE_COULDNT_RESOLVE_HOST: - case \CURLE_OPERATION_TIMEOUTED: - $msg = "Could not connect to Stripe ({$url}). Please check your " - . 'internet connection and try again. If this problem persists, ' - . "you should check Stripe's service status at " - . 'https://twitter.com/stripestatus, or'; - - break; - - case \CURLE_SSL_CACERT: - case \CURLE_SSL_PEER_CERTIFICATE: - $msg = "Could not verify Stripe's SSL certificate. Please make sure " - . 'that your network is not intercepting certificates. ' - . "(Try going to {$url} in your browser.) " - . 'If this problem persists,'; - - break; - - default: - $msg = 'Unexpected error communicating with Stripe. ' - . 'If this problem persists,'; - } - $msg .= ' let us know at support@stripe.com.'; - - $msg .= "\n\n(Network error [errno {$errno}]: {$message})"; - - if ($numRetries > 0) { - $msg .= "\n\nRequest was retried {$numRetries} times."; - } - - throw new Exception\ApiConnectionException($msg); - } - - /** - * Checks if an error is a problem that we should retry on. This includes both - * socket errors that may represent an intermittent problem and some special - * HTTP statuses. - * - * @param int $errno - * @param int $rcode - * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders - * @param int $numRetries - * - * @return bool - */ - private function shouldRetry($errno, $rcode, $rheaders, $numRetries) - { - if ($numRetries >= Stripe::getMaxNetworkRetries()) { - return false; - } - - // Retry on timeout-related problems (either on open or read). - if (\CURLE_OPERATION_TIMEOUTED === $errno) { - return true; - } - - // Destination refused the connection, the connection was reset, or a - // variety of other connection failures. This could occur from a single - // saturated server, so retry in case it's intermittent. - if (\CURLE_COULDNT_CONNECT === $errno) { - return true; - } - - // The API may ask us not to retry (eg; if doing so would be a no-op) - // or advise us to retry (eg; in cases of lock timeouts); we defer to that. - if (isset($rheaders['stripe-should-retry'])) { - if ('false' === $rheaders['stripe-should-retry']) { - return false; - } - if ('true' === $rheaders['stripe-should-retry']) { - return true; - } - } - - // 409 Conflict - if (409 === $rcode) { - return true; - } - - // Retry on 500, 503, and other internal errors. - // - // Note that we expect the stripe-should-retry header to be false - // in most cases when a 500 is returned, since our idempotency framework - // would typically replay it anyway. - if ($rcode >= 500) { - return true; - } - - return false; - } - - /** - * Provides the number of seconds to wait before retrying a request. - * - * @param int $numRetries - * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders - * - * @return int - */ - private function sleepTime($numRetries, $rheaders) - { - // Apply exponential backoff with $initialNetworkRetryDelay on the - // number of $numRetries so far as inputs. Do not allow the number to exceed - // $maxNetworkRetryDelay. - $sleepSeconds = \min( - Stripe::getInitialNetworkRetryDelay() * 1.0 * 2 ** ($numRetries - 1), - Stripe::getMaxNetworkRetryDelay() - ); - - // Apply some jitter by randomizing the value in the range of - // ($sleepSeconds / 2) to ($sleepSeconds). - $sleepSeconds *= 0.5 * (1 + $this->randomGenerator->randFloat()); - - // But never sleep less than the base sleep seconds. - $sleepSeconds = \max(Stripe::getInitialNetworkRetryDelay(), $sleepSeconds); - - // And never sleep less than the time the API asks us to wait, assuming it's a reasonable ask. - $retryAfter = isset($rheaders['retry-after']) ? (float) ($rheaders['retry-after']) : 0.0; - if (\floor($retryAfter) === $retryAfter && $retryAfter <= Stripe::getMaxRetryAfter()) { - $sleepSeconds = \max($sleepSeconds, $retryAfter); - } - - return $sleepSeconds; - } - - /** - * Initializes the curl handle. If already initialized, the handle is closed first. - */ - private function initCurlHandle() - { - $this->closeCurlHandle(); - $this->curlHandle = \curl_init(); - } - - /** - * Closes the curl handle if initialized. Do nothing if already closed. - */ - private function closeCurlHandle() - { - if (null !== $this->curlHandle) { - \curl_close($this->curlHandle); - $this->curlHandle = null; - } - } - - /** - * Resets the curl handle. If the handle is not already initialized, or if persistent - * connections are disabled, the handle is reinitialized instead. - */ - private function resetCurlHandle() - { - if (null !== $this->curlHandle && $this->getEnablePersistentConnections()) { - \curl_reset($this->curlHandle); - } else { - $this->initCurlHandle(); - } - } - - /** - * Indicates whether it is safe to use HTTP/2 or not. - * - * @return bool - */ - private function canSafelyUseHttp2() - { - // Versions of curl older than 7.60.0 don't respect GOAWAY frames - // (cf. https://github.com/curl/curl/issues/2416), which Stripe use. - $curlVersion = \curl_version()['version']; - - return \version_compare($curlVersion, '7.60.0') >= 0; - } - - /** - * Checks if a list of headers contains a specific header name. - * - * @param string[] $headers - * @param string $name - * - * @return bool - */ - private function hasHeader($headers, $name) - { - foreach ($headers as $header) { - if (0 === \strncasecmp($header, "{$name}: ", \strlen($name) + 2)) { - return true; - } - } - - return false; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php deleted file mode 100644 index 482f9a11..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -type and options parameters used. You can find the - * result of each verification check performed in the appropriate sub-resource: - * document, id_number, selfie. - * - * Each VerificationReport contains a copy of any data collected by the user as - * well as reference IDs which can be used to access collected images through the - * FileUpload API. To configure and - * create VerificationReports, use the VerificationSession - * API. - * - * Related guides: Accessing - * verification results. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $document Result from a document check - * @property \Stripe\StripeObject $id_number Result from an id_number check - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $options - * @property \Stripe\StripeObject $selfie Result from a selfie check - * @property string $type Type of report. - * @property null|string $verification_session ID of the VerificationSession that created this report. - */ -class VerificationReport extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'identity.verification_report'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; - - const TYPE_DOCUMENT = 'document'; - const TYPE_ID_NUMBER = 'id_number'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Identity/VerificationSession.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Identity/VerificationSession.php deleted file mode 100644 index 50193997..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Identity/VerificationSession.php +++ /dev/null @@ -1,88 +0,0 @@ -verification check to perform. - * Only create one VerificationSession for each verification in your system. - * - * A VerificationSession transitions through multiple statuses throughout its - * lifetime as it progresses through the verification flow. The VerificationSession - * contains the user’s verified data after verification checks are complete. - * - * Related guide: The Verification - * Sessions API - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string $client_secret The short-lived client secret used by Stripe.js to show a verification modal inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on passing the client secret to the frontend to learn more. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $last_error If present, this property tells you the last error encountered when processing the verification. - * @property null|string|\Stripe\Identity\VerificationReport $last_verification_report ID of the most recent VerificationReport. Learn more about accessing detailed verification results. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $options - * @property null|\Stripe\StripeObject $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. - * @property string $status Status of this VerificationSession. Learn more about the lifecycle of sessions. - * @property string $type The type of verification check to be performed. - * @property null|string $url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on verifying identity documents to learn how to redirect users to Stripe. - * @property null|\Stripe\StripeObject $verified_outputs The user’s verified data. - */ -class VerificationSession extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'identity.verification_session'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; - - const STATUS_CANCELED = 'canceled'; - const STATUS_PROCESSING = 'processing'; - const STATUS_REQUIRES_INPUT = 'requires_input'; - const STATUS_VERIFIED = 'verified'; - - const TYPE_DOCUMENT = 'document'; - const TYPE_ID_NUMBER = 'id_number'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession the canceled verification session - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession the redacted verification session - */ - public function redact($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/redact'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Invoice.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Invoice.php deleted file mode 100644 index a6732362..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Invoice.php +++ /dev/null @@ -1,283 +0,0 @@ -invoice - * items, and proration adjustments that may be caused by subscription - * upgrades/downgrades (if necessary). - * - * If your invoice is configured to be billed through automatic charges, Stripe - * automatically finalizes your invoice and attempts payment. Note that finalizing - * the invoice, when - * automatic, does not happen immediately as the invoice is created. Stripe - * waits until one hour after the last webhook was successfully sent (or the last - * webhook timed out after failing). If you (and the platforms you may have - * connected to) have no webhooks configured, Stripe waits one hour after creation - * to finalize the invoice. - * - * If your invoice is configured to be billed by sending an email, then based on - * your email - * settings, Stripe will email the invoice to your customer and await payment. - * These emails can contain a link to a hosted page to pay the invoice. - * - * Stripe applies any customer credit on the account before determining the amount - * due for the invoice (i.e., the amount that will be actually charged). If the - * amount due for the invoice is less than Stripe's minimum allowed - * charge per currency, the invoice is automatically marked paid, and we add - * the amount due to the customer's credit balance which is applied to the next - * invoice. - * - * More details on the customer's credit balance are here. - * - * Related guide: Send - * Invoices to Customers. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string $account_country The country of the business associated with this invoice, most often the business creating the invoice. - * @property null|string $account_name The public name of the business associated with this invoice, most often the business creating the invoice. - * @property null|(string|\Stripe\TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft. - * @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due. - * @property int $amount_paid The amount, in %s, that was paid. - * @property int $amount_remaining The amount remaining, in %s, that is due. - * @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the invoice. - * @property null|int $application_fee_amount The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. - * @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. - * @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users. - * @property bool $auto_advance Controls whether Stripe will perform automatic collection of the invoice. When false, the invoice's state will not automatically advance without an explicit action. - * @property \Stripe\StripeObject $automatic_tax - * @property null|string $billing_reason Indicates the reason why the invoice was created. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold indicates an invoice created due to a billing threshold being reached. - * @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any. - * @property string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|\Stripe\StripeObject[] $custom_fields Custom fields displayed on the invoice. - * @property null|string|\Stripe\Customer $customer The ID of the customer who will be billed. - * @property null|\Stripe\StripeObject $customer_address The customer's address. Until the invoice is finalized, this field will equal customer.address. Once the invoice is finalized, this field will no longer be updated. - * @property null|string $customer_email The customer's email. Until the invoice is finalized, this field will equal customer.email. Once the invoice is finalized, this field will no longer be updated. - * @property null|string $customer_name The customer's name. Until the invoice is finalized, this field will equal customer.name. Once the invoice is finalized, this field will no longer be updated. - * @property null|string $customer_phone The customer's phone number. Until the invoice is finalized, this field will equal customer.phone. Once the invoice is finalized, this field will no longer be updated. - * @property null|\Stripe\StripeObject $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal customer.shipping. Once the invoice is finalized, this field will no longer be updated. - * @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt. Once the invoice is finalized, this field will no longer be updated. - * @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated. - * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. - * @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. - * @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. - * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. - * @property null|int $due_date The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically. - * @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. - * @property null|string $footer Footer displayed on the invoice. - * @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null. - * @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. - * @property null|\Stripe\ErrorObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. - * @property \Stripe\Collection<\Stripe\InvoiceLineItem> $lines The individual line items that make up the invoice. lines is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|int $next_payment_attempt The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice. - * @property null|string $number A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. - * @property bool $paid Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. - * @property bool $paid_out_of_band Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. - * @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. - * @property \Stripe\StripeObject $payment_settings - * @property int $period_end End of the usage period during which invoice items were added to this invoice. - * @property int $period_start Start of the usage period during which invoice items were added to this invoice. - * @property int $post_payment_credit_notes_amount Total amount of all post-payment credit notes issued for this invoice. - * @property int $pre_payment_credit_notes_amount Total amount of all pre-payment credit notes issued for this invoice. - * @property null|string|\Stripe\Quote $quote The quote this invoice was generated from. - * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice. - * @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. - * @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement. - * @property null|string $status The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more - * @property \Stripe\StripeObject $status_transitions - * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any. - * @property int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations. - * @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated - * @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice belongs to. - * @property \Stripe\StripeObject $threshold_reason - * @property int $total Total after discounts and taxes. - * @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items. - * @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items. - * @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. - */ -class Invoice extends ApiResource -{ - const OBJECT_NAME = 'invoice'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Search; - use ApiOperations\Update; - - const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically'; - const BILLING_SEND_INVOICE = 'send_invoice'; - - const BILLING_REASON_MANUAL = 'manual'; - const BILLING_REASON_QUOTE_ACCEPT = 'quote_accept'; - const BILLING_REASON_SUBSCRIPTION = 'subscription'; - const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create'; - const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle'; - const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold'; - const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update'; - const BILLING_REASON_UPCOMING = 'upcoming'; - - const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically'; - const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice'; - - const STATUS_DELETED = 'deleted'; - const STATUS_DRAFT = 'draft'; - const STATUS_OPEN = 'open'; - const STATUS_PAID = 'paid'; - const STATUS_UNCOLLECTIBLE = 'uncollectible'; - const STATUS_VOID = 'void'; - - use ApiOperations\NestedResource; - - const PATH_LINES = '/lines'; - - /** - * @param string $id the ID of the invoice on which to retrieve the lines - * @param null|array $params - * @param null|array|string $opts - * - * @throws StripeExceptionApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\InvoiceLineItem> the list of lines (InvoiceLineItem) - */ - public static function allLines($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the finalized invoice - */ - public function finalizeInvoice($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/finalize'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the uncollectible invoice - */ - public function markUncollectible($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/mark_uncollectible'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the paid invoice - */ - public function pay($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/pay'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the sent invoice - */ - public function sendInvoice($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/send'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the upcoming invoice - */ - public static function upcoming($params = null, $opts = null) - { - $url = static::classUrl() . '/upcoming'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the voided invoice - */ - public function voidInvoice($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/void'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult the invoice search results - */ - public static function search($params = null, $opts = null) - { - $url = '/v1/invoices/search'; - - return self::_searchResource($url, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/InvoiceItem.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/InvoiceItem.php deleted file mode 100644 index 76eae069..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/InvoiceItem.php +++ /dev/null @@ -1,50 +0,0 @@ -Subscription - * Invoices. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount (in the currency specified) of the invoice item. This should always be equal to unit_amount * quantity. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Customer $customer The ID of the customer who will be billed when this invoice item is billed. - * @property int $date Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property bool $discountable If true, discounts will apply to this invoice item. Always false for prorations. - * @property null|(string|\Stripe\Discount)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. - * @property null|string|\Stripe\Invoice $invoice The ID of the invoice this invoice item belongs to. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $period - * @property null|\Stripe\Plan $plan If the invoice item is a proration, the plan of the subscription that the proration was computed for. - * @property null|\Stripe\Price $price The price of the invoice item. - * @property bool $proration Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. - * @property int $quantity Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. - * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice item has been created for, if any. - * @property string $subscription_item The subscription item that this invoice item has been created for, if any. - * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice item belongs to. - * @property null|int $unit_amount Unit amount (in the currency specified) of the invoice item. - * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. - */ -class InvoiceItem extends ApiResource -{ - const OBJECT_NAME = 'invoiceitem'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/InvoiceLineItem.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/InvoiceLineItem.php deleted file mode 100644 index 0a5331e6..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/InvoiceLineItem.php +++ /dev/null @@ -1,34 +0,0 @@ -ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item. - * @property bool $discountable If true, discounts will apply to this line item. Always false for prorations. - * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. - * @property string $invoice_item The ID of the invoice item associated with this line item if any. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with type=subscription this will reflect the metadata of the subscription that caused the line item to be created. - * @property \Stripe\StripeObject $period - * @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration. - * @property null|\Stripe\Price $price The price of the line item. - * @property bool $proration Whether this is a proration. - * @property null|\Stripe\StripeObject $proration_details Additional details for proration line items - * @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration. - * @property null|string $subscription The subscription that the invoice item pertains to, if any. - * @property string $subscription_item The subscription item that generated this invoice item. Left empty if the line item is not an explicit result of a subscription. - * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item - * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. - * @property string $type A string identifying the type of the source of this line item, either an invoiceitem or a subscription. - */ -class InvoiceLineItem extends ApiResource -{ - const OBJECT_NAME = 'line_item'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Authorization.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Authorization.php deleted file mode 100644 index 7e597df5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Authorization.php +++ /dev/null @@ -1,81 +0,0 @@ -issued card is used to - * make a purchase, an Issuing Authorization object is created. Authorizations - * must be approved for the purchase to be completed successfully. - * - * Related guide: Issued Card - * Authorizations. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount The total amount that was authorized or rejected. This amount is in the card's currency and in the smallest currency unit. - * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. - * @property bool $approved Whether the authorization has been approved. - * @property string $authorization_method How the card details were provided. - * @property \Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with this authorization. - * @property \Stripe\Issuing\Card $card You can create physical or virtual cards that are issued to cardholders. - * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this authorization belongs. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $merchant_amount The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit. - * @property string $merchant_currency The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property \Stripe\StripeObject $merchant_data - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $pending_request The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook. - * @property \Stripe\StripeObject[] $request_history History of every time pending_request was approved/denied, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. - * @property string $status The current status of the authorization in its lifecycle. - * @property \Stripe\Issuing\Transaction[] $transactions List of transactions associated with this authorization. - * @property \Stripe\StripeObject $verification_data - * @property null|string $wallet The digital wallet used for this authorization. One of apple_pay, google_pay, or samsung_pay. - */ -class Authorization extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'issuing.authorization'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Authorization the approved authorization - */ - public function approve($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/approve'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Authorization the declined authorization - */ - public function decline($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/decline'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Card.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Card.php deleted file mode 100644 index 31deaf3f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Card.php +++ /dev/null @@ -1,60 +0,0 @@ -create physical or - * virtual cards that are issued to cardholders. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $brand The brand of the card. - * @property null|string $cancellation_reason The reason why the card was canceled. - * @property \Stripe\Issuing\Cardholder $cardholder

    An Issuing Cardholder object represents an individual or business entity who is issued cards.

    Related guide: How to create a Cardholder

    - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string $cvc The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. - * @property int $exp_month The expiration month of the card. - * @property int $exp_year The expiration year of the card. - * @property string $last4 The last 4 digits of the card number. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. - * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any. - * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any. - * @property null|string $replacement_reason The reason why the previous card needed to be replaced. - * @property null|\Stripe\StripeObject $shipping Where and how the card will be shipped. - * @property \Stripe\StripeObject $spending_controls - * @property string $status Whether authorizations can be approved on this card. - * @property string $type The type of the card. - * @property null|\Stripe\StripeObject $wallets Information relating to digital wallets (like Apple Pay and Google Pay). - */ -class Card extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'issuing.card'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\CardDetails the card details associated with that issuing card - */ - public function details($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/details'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php deleted file mode 100644 index 98f4e0b8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php +++ /dev/null @@ -1,19 +0,0 @@ -Cardholder object represents an individual or business - * entity who is issued cards. - * - * Related guide: How to create a - * Cardholder - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $billing - * @property null|\Stripe\StripeObject $company Additional information about a company cardholder. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $email The cardholder's email address. - * @property null|\Stripe\StripeObject $individual Additional information about an individual cardholder. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $name The cardholder's name. This will be printed on cards issued to them. - * @property null|string $phone_number The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the 3D Secure documentation for more details. - * @property \Stripe\StripeObject $requirements - * @property null|\Stripe\StripeObject $spending_controls Rules that control spending across this cardholder's cards. Refer to our documentation for more details. - * @property string $status Specifies whether to permit authorizations on this cardholder's cards. - * @property string $type One of individual or company. - */ -class Cardholder extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'issuing.cardholder'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Dispute.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Dispute.php deleted file mode 100644 index 1eeb17ee..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Dispute.php +++ /dev/null @@ -1,53 +0,0 @@ -card issuer, you can dispute - * transactions that the cardholder does not recognize, suspects to be fraudulent, - * or has other issues with. - * - * Related guide: Disputing - * Transactions - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Disputed amount. Usually the amount of the transaction, but can differ (usually because of currency fluctuation). - * @property null|\Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with the dispute. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency The currency the transaction was made in. - * @property \Stripe\StripeObject $evidence - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $status Current status of the dispute. - * @property string|\Stripe\Issuing\Transaction $transaction The transaction being disputed. - */ -class Dispute extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'issuing.dispute'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Dispute the submited dispute - */ - public function submit($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/submit'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Transaction.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Transaction.php deleted file mode 100644 index 90a38edd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Issuing/Transaction.php +++ /dev/null @@ -1,44 +0,0 @@ -issued card that - * results in funds entering or leaving your Stripe account, such as a completed - * purchase or refund, is represented by an Issuing Transaction - * object. - * - * Related guide: Issued Card - * Transactions. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount The transaction amount, which will be reflected in your balance. This amount is in your currency and in the smallest currency unit. - * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. - * @property null|string|\Stripe\Issuing\Authorization $authorization The Authorization object that led to this transaction. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction associated with this transaction. - * @property string|\Stripe\Issuing\Card $card The card used to make this transaction. - * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this transaction belongs. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Issuing\Dispute $dispute If you've disputed the transaction, the ID of the dispute. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $merchant_amount The amount that the merchant will receive, denominated in merchant_currency and in the smallest currency unit. It will be different from amount if the merchant is taking payment in a different currency. - * @property string $merchant_currency The currency with which the merchant is taking payment. - * @property \Stripe\StripeObject $merchant_data - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $purchase_details Additional purchase information that is optionally provided by the merchant. - * @property string $type The nature of the transaction. - * @property null|string $wallet The digital wallet used for this transaction. One of apple_pay, google_pay, or samsung_pay. - */ -class Transaction extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'issuing.transaction'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/LineItem.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/LineItem.php deleted file mode 100644 index 0a413461..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/LineItem.php +++ /dev/null @@ -1,26 +0,0 @@ -ISO currency code, in lowercase. Must be a supported currency. - * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. - * @property \Stripe\StripeObject[] $discounts The discounts applied to the line item. - * @property null|\Stripe\Price $price The price used to generate the line item. - * @property null|int $quantity The quantity of products being purchased. - * @property \Stripe\StripeObject[] $taxes The taxes applied to the line item. - */ -class LineItem extends ApiResource -{ - const OBJECT_NAME = 'item'; - - use ApiOperations\All; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/LoginLink.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/LoginLink.php deleted file mode 100644 index 3351356b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/LoginLink.php +++ /dev/null @@ -1,15 +0,0 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $multi_use - * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method associated with this mandate. - * @property \Stripe\StripeObject $payment_method_details - * @property \Stripe\StripeObject $single_use - * @property string $status The status of the mandate, which indicates whether it can be used to initiate a payment. - * @property string $type The type of the mandate. - */ -class Mandate extends ApiResource -{ - const OBJECT_NAME = 'mandate'; - - use ApiOperations\Retrieve; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/OAuth.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/OAuth.php deleted file mode 100644 index 7b0886e3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/OAuth.php +++ /dev/null @@ -1,101 +0,0 @@ -request( - 'post', - '/oauth/token', - $params, - null - ); - - return Util\Util::convertToStripeObject($response->json, $opts); - } - - /** - * Disconnects an account from your platform. - * - * @param null|array $params - * @param null|array $opts - * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * - * @return StripeObject object containing the response from the API - */ - public static function deauthorize($params = null, $opts = null) - { - $params = $params ?: []; - $base = ($opts && \array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase; - $requestor = new ApiRequestor(null, $base); - $params['client_id'] = self::_getClientId($params); - list($response, $apiKey) = $requestor->request( - 'post', - '/oauth/deauthorize', - $params, - null - ); - - return Util\Util::convertToStripeObject($response->json, $opts); - } - - private static function _getClientId($params = null) - { - $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; - if (null === $clientId) { - $clientId = Stripe::getClientId(); - } - if (null === $clientId) { - $msg = 'No client_id provided. (HINT: set your client_id using ' - . '"Stripe::setClientId()". You can find your client_ids ' - . 'in your Stripe dashboard at ' - . 'https://dashboard.stripe.com/account/applications/settings, ' - . 'after registering your account as a platform. See ' - . 'https://stripe.com/docs/connect/standard-accounts for details, ' - . 'or email support@stripe.com if you have any questions.'; - - throw new Exception\AuthenticationException($msg); - } - - return $clientId; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/OAuthErrorObject.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/OAuthErrorObject.php deleted file mode 100644 index 620c5bb2..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/OAuthErrorObject.php +++ /dev/null @@ -1,31 +0,0 @@ - null, - 'error_description' => null, - ], $values); - parent::refreshFrom($values, $opts, $partial); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Order.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Order.php deleted file mode 100644 index 9b840050..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Order.php +++ /dev/null @@ -1,81 +0,0 @@ -products. You can - * create, retrieve, and pay individual orders, as well as list all orders. Orders - * are identified by a unique, random ID. - * - * Related guide: Tax, Shipping, - * and Inventory. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. - * @property null|int $amount_returned The total amount that was returned to the customer. - * @property null|string $application ID of the Connect Application that created the order. - * @property null|int $application_fee A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. - * @property null|string|\Stripe\Charge $charge The ID of the payment used to pay for the order. Present if the order status is paid, fulfilled, or refunded. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer The customer used for the order. - * @property null|string $email The email address of the customer placing the order. - * @property string $external_coupon_code External coupon code to load for this order. - * @property \Stripe\OrderItem[] $items List of items constituting the order. An order can have up to 25 items. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\Collection<\Stripe\OrderReturn> $returns A list of returns that have taken place for this order. - * @property null|string $selected_shipping_method The shipping method that is currently selected for this order, if any. If present, it is equal to one of the ids of shipping methods in the shipping_methods array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method. - * @property null|\Stripe\StripeObject $shipping The shipping address for the order. Present if the order is for goods to be shipped. - * @property null|\Stripe\StripeObject[] $shipping_methods A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it. - * @property string $status Current order status. One of created, paid, canceled, fulfilled, or returned. More details in the Orders Guide. - * @property null|\Stripe\StripeObject $status_transitions The timestamps at which the order status was updated. - * @property null|int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - * @property string $upstream_id The user's order ID if it is different from the Stripe order ID. - */ -class Order extends ApiResource -{ - const OBJECT_NAME = 'order'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\OrderReturn the newly created return - */ - public function returnOrder($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/returns'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - - return Util\Util::convertToStripeObject($response, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order the paid order - */ - public function pay($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/pay'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/OrderItem.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/OrderItem.php deleted file mode 100644 index e2e6e39a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/OrderItem.php +++ /dev/null @@ -1,19 +0,0 @@ -order items. Returns always - * belong to an order, and may optionally contain a refund. - * - * Related guide: Handling - * Returns. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the returned line item. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property \Stripe\OrderItem[] $items The items included in this order return. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Order $order The order that this return includes items from. - * @property null|string|\Stripe\Refund $refund The ID of the refund issued for this return. - */ -class OrderReturn extends ApiResource -{ - const OBJECT_NAME = 'order_return'; - - use ApiOperations\All; - use ApiOperations\Retrieve; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PaymentIntent.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PaymentIntent.php deleted file mode 100644 index b7d777ab..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PaymentIntent.php +++ /dev/null @@ -1,195 +0,0 @@ -multiple - * statuses throughout its lifetime as it interfaces with Stripe.js to perform - * authentication flows and ultimately creates at most one successful charge. - * - * Related guide: Payment Intents API. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - * @property int $amount_capturable Amount that can be captured from this PaymentIntent. - * @property \Stripe\StripeObject $amount_details - * @property int $amount_received Amount that was collected by this PaymentIntent. - * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the PaymentIntent. - * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts. - * @property null|\Stripe\StripeObject $automatic_payment_methods Settings to configure compatible payment methods from the Stripe Dashboard - * @property null|int $canceled_at Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. - * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic). - * @property string $capture_method Controls when the funds will be captured from the customer's account. - * @property \Stripe\Collection<\Stripe\Charge> $charges Charges that were created by this PaymentIntent, if any. - * @property null|string $client_secret

    The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.

    The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

    Refer to our docs to accept a payment and learn about how client_secret should be handled.

    - * @property string $confirmation_method - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer

    ID of the Customer this PaymentIntent belongs to, if one exists.

    Payment methods attached to other Customers cannot be used with this PaymentIntent.

    If present in combination with setup_future_usage, this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.

    - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\Invoice $invoice ID of the invoice that created this PaymentIntent, if it exists. - * @property null|\Stripe\ErrorObject $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. For more information, see the documentation. - * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details. - * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used in this PaymentIntent. - * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this PaymentIntent. - * @property string[] $payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. - * @property null|\Stripe\StripeObject $processing If present, this property tells you about the processing state of the payment. - * @property null|string $receipt_email Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings. - * @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any. - * @property null|string $setup_future_usage

    Indicates that you intend to make future payments with this PaymentIntent's payment method.

    Providing this parameter will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes.

    When processing card payments, Stripe also uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.

    - * @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. - * @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. - * @property null|string $statement_descriptor_suffix Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - * @property string $status Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. Read more about each PaymentIntent status. - * @property null|\Stripe\StripeObject $transfer_data The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents use case for connected accounts for details. - * @property null|string $transfer_group A string that identifies the resulting payment as part of a group. See the PaymentIntents use case for connected accounts for details. - */ -class PaymentIntent extends ApiResource -{ - const OBJECT_NAME = 'payment_intent'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Search; - use ApiOperations\Update; - - const STATUS_CANCELED = 'canceled'; - const STATUS_PROCESSING = 'processing'; - const STATUS_REQUIRES_ACTION = 'requires_action'; - const STATUS_REQUIRES_CAPTURE = 'requires_capture'; - const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; - const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; - const STATUS_SUCCEEDED = 'succeeded'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent the applied payment intent - */ - public function applyCustomerBalance($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/apply_customer_balance'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent the canceled payment intent - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent the captured payment intent - */ - public function capture($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/capture'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent the confirmed payment intent - */ - public function confirm($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/confirm'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent the incremented payment intent - */ - public function incrementAuthorization($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/increment_authorization'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent the verified payment intent - */ - public function verifyMicrodeposits($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/verify_microdeposits'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult the payment intent search results - */ - public static function search($params = null, $opts = null) - { - $url = '/v1/payment_intents/search'; - - return self::_searchResource($url, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PaymentLink.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PaymentLink.php deleted file mode 100644 index 8062c537..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PaymentLink.php +++ /dev/null @@ -1,70 +0,0 @@ -checkout session to - * render the payment page. You can use checkout - * session events to track payments through payment links. - * - * Related guide: Payment Links API - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $active Whether the payment link's url is active. If false, customers visiting the URL will be shown a page saying that the link has been deactivated. - * @property \Stripe\StripeObject $after_completion - * @property bool $allow_promotion_codes Whether user redeemable promotion codes are enabled. - * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - * @property null|float $application_fee_percent This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. - * @property \Stripe\StripeObject $automatic_tax - * @property string $billing_address_collection Configuration for collecting the customer's billing address. - * @property \Stripe\Collection<\Stripe\LineItem> $line_items The line items representing what is being sold. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. - * @property null|string[] $payment_method_types The list of payment method types that customers can use. When null, Stripe will dynamically show relevant payment methods you've enabled in your payment method settings. - * @property \Stripe\StripeObject $phone_number_collection - * @property null|\Stripe\StripeObject $shipping_address_collection Configuration for collecting the customer's shipping address. - * @property null|\Stripe\StripeObject $subscription_data When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use subscription_data. - * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. - * @property string $url The public URL that can be shared with customers. - */ -class PaymentLink extends ApiResource -{ - const OBJECT_NAME = 'payment_link'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; - const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; - - /** - * @param null|array $params - * @param null|array|string $opts - * @param mixed $id - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\PaymentLink> list of LineItems - */ - public static function allLineItems($id, $params = null, $opts = null) - { - $url = static::resourceUrl($id) . '/line_items'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PaymentMethod.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PaymentMethod.php deleted file mode 100644 index e14e474e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PaymentMethod.php +++ /dev/null @@ -1,95 +0,0 @@ -PaymentIntents to - * collect payments or save them to Customer objects to store instrument details - * for future payments. - * - * Related guides: Payment Methods and - * More Payment - * Scenarios. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $acss_debit - * @property \Stripe\StripeObject $afterpay_clearpay - * @property \Stripe\StripeObject $alipay - * @property \Stripe\StripeObject $au_becs_debit - * @property \Stripe\StripeObject $bacs_debit - * @property \Stripe\StripeObject $bancontact - * @property \Stripe\StripeObject $billing_details - * @property \Stripe\StripeObject $boleto - * @property \Stripe\StripeObject $card - * @property \Stripe\StripeObject $card_present - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. - * @property \Stripe\StripeObject $customer_balance - * @property \Stripe\StripeObject $eps - * @property \Stripe\StripeObject $fpx - * @property \Stripe\StripeObject $giropay - * @property \Stripe\StripeObject $grabpay - * @property \Stripe\StripeObject $ideal - * @property \Stripe\StripeObject $interac_present - * @property \Stripe\StripeObject $klarna - * @property \Stripe\StripeObject $konbini - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $oxxo - * @property \Stripe\StripeObject $p24 - * @property \Stripe\StripeObject $paynow - * @property \Stripe\StripeObject $sepa_debit - * @property \Stripe\StripeObject $sofort - * @property string $type The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - * @property \Stripe\StripeObject $us_bank_account - * @property \Stripe\StripeObject $wechat_pay - */ -class PaymentMethod extends ApiResource -{ - const OBJECT_NAME = 'payment_method'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod the attached payment method - */ - public function attach($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/attach'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod the detached payment method - */ - public function detach($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/detach'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Payout.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Payout.php deleted file mode 100644 index edbe4920..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Payout.php +++ /dev/null @@ -1,108 +0,0 @@ -Payout object is created when you receive funds from Stripe, or - * when you initiate a payout to either a bank account or debit card of a connected Stripe account. You - * can retrieve individual payouts, as well as list all payouts. Payouts are made - * on varying schedules, - * depending on your country and industry. - * - * Related guide: Receiving Payouts. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount (in %s) to be transferred to your bank account or debit card. - * @property int $arrival_date Date the payout is expected to arrive in the bank. This factors in delays like weekends or bank holidays. - * @property bool $automatic Returns true if the payout was created by an automated payout schedule, and false if it was requested manually. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this payout on your account balance. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\BankAccount|\Stripe\Card $destination ID of the bank account or card the payout was sent to. - * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance. - * @property null|string $failure_code Error code explaining reason for payout failure if available. See Types of payout failures for a list of failure codes. - * @property null|string $failure_message Message to user further explaining reason for payout failure if available. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $method The method used to send this payout, which can be standard or instant. instant is only supported for payouts to debit cards. (See Instant payouts for marketplaces for more information.) - * @property null|string|\Stripe\Payout $original_payout If the payout reverses another, this is the ID of the original payout. - * @property null|string|\Stripe\Payout $reversed_by If the payout was reversed, this is the ID of the payout that reverses this payout. - * @property string $source_type The source balance this payout came from. One of card, fpx, or bank_account. - * @property null|string $statement_descriptor Extra information about a payout to be displayed on the user's bank statement. - * @property string $status Current status of the payout: paid, pending, in_transit, canceled or failed. A payout is pending until it is submitted to the bank, when it becomes in_transit. The status then changes to paid if the transaction goes through, or to failed or canceled (within 5 business days). Some failed payouts may initially show as paid but then change to failed. - * @property string $type Can be bank_account or card. - */ -class Payout extends ApiResource -{ - const OBJECT_NAME = 'payout'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const FAILURE_ACCOUNT_CLOSED = 'account_closed'; - const FAILURE_ACCOUNT_FROZEN = 'account_frozen'; - const FAILURE_BANK_ACCOUNT_RESTRICTED = 'bank_account_restricted'; - const FAILURE_BANK_OWNERSHIP_CHANGED = 'bank_ownership_changed'; - const FAILURE_COULD_NOT_PROCESS = 'could_not_process'; - const FAILURE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; - const FAILURE_DECLINED = 'declined'; - const FAILURE_INCORRECT_ACCOUNT_HOLDER_NAME = 'incorrect_account_holder_name'; - const FAILURE_INSUFFICIENT_FUNDS = 'insufficient_funds'; - const FAILURE_INVALID_ACCOUNT_NUMBER = 'invalid_account_number'; - const FAILURE_INVALID_CURRENCY = 'invalid_currency'; - const FAILURE_NO_ACCOUNT = 'no_account'; - const FAILURE_UNSUPPORTED_CARD = 'unsupported_card'; - - const METHOD_INSTANT = 'instant'; - const METHOD_STANDARD = 'standard'; - - const STATUS_CANCELED = 'canceled'; - const STATUS_FAILED = 'failed'; - const STATUS_IN_TRANSIT = 'in_transit'; - const STATUS_PAID = 'paid'; - const STATUS_PENDING = 'pending'; - - const TYPE_BANK_ACCOUNT = 'bank_account'; - const TYPE_CARD = 'card'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout the canceled payout - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout the reversed payout - */ - public function reverse($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/reverse'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Person.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Person.php deleted file mode 100644 index b1398c4e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Person.php +++ /dev/null @@ -1,123 +0,0 @@ -Standard onboarding - * or Express onboarding - * documentation for information about platform pre-filling and account - * onboarding steps. - * - * Related guide: Handling - * Identity Verification with the API. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $account The account the person is associated with. - * @property \Stripe\StripeObject $address - * @property null|\Stripe\StripeObject $address_kana The Kana variation of the person's address (Japan only). - * @property null|\Stripe\StripeObject $address_kanji The Kanji variation of the person's address (Japan only). - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $dob - * @property null|string $email The person's email address. - * @property null|string $first_name The person's first name. - * @property null|string $first_name_kana The Kana variation of the person's first name (Japan only). - * @property null|string $first_name_kanji The Kanji variation of the person's first name (Japan only). - * @property string[] $full_name_aliases A list of alternate names or aliases that the person is known by. - * @property null|\Stripe\StripeObject $future_requirements Information about the upcoming new requirements for this person, including what information needs to be collected, and by when. - * @property null|string $gender The person's gender (International regulations require either "male" or "female"). - * @property bool $id_number_provided Whether the person's id_number was provided. - * @property null|string $last_name The person's last name. - * @property null|string $last_name_kana The Kana variation of the person's last name (Japan only). - * @property null|string $last_name_kanji The Kanji variation of the person's last name (Japan only). - * @property null|string $maiden_name The person's maiden name. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $nationality The country where the person is a national. - * @property null|string $phone The person's phone number. - * @property string $political_exposure Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - * @property \Stripe\StripeObject $registered_address - * @property \Stripe\StripeObject $relationship - * @property null|\Stripe\StripeObject $requirements Information about the requirements for this person, including what information needs to be collected, and by when. - * @property bool $ssn_last_4_provided Whether the last four digits of the person's Social Security number have been provided (U.S. only). - * @property \Stripe\StripeObject $verification - */ -class Person extends ApiResource -{ - const OBJECT_NAME = 'person'; - - use ApiOperations\Delete; - use ApiOperations\Update; - - const GENDER_FEMALE = 'female'; - const GENDER_MALE = 'male'; - - const POLITICAL_EXPOSURE_EXISTING = 'existing'; - const POLITICAL_EXPOSURE_NONE = 'none'; - - const VERIFICATION_STATUS_PENDING = 'pending'; - const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; - const VERIFICATION_STATUS_VERIFIED = 'verified'; - - /** - * @return string the API URL for this Stripe account reversal - */ - public function instanceUrl() - { - $id = $this['id']; - $account = $this['account']; - if (!$id) { - throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", - null - ); - } - $id = Util\Util::utf8($id); - $account = Util\Util::utf8($account); - - $base = Account::classUrl(); - $accountExtn = \urlencode($account); - $extn = \urlencode($id); - - return "{$base}/{$accountExtn}/persons/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Persons cannot be retrieved without an account ID. Retrieve ' . - "a person using `Account::retrievePerson('account_id', " . - "'person_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Persons cannot be updated without an account ID. Update ' . - "a person using `Account::updatePerson('account_id', " . - "'person_id', \$updateParams)`."; - - throw new Exception\BadMethodCallException($msg); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Plan.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Plan.php deleted file mode 100644 index c3621fa6..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Plan.php +++ /dev/null @@ -1,57 +0,0 @@ -Prices API. It replaces the Plans - * API and is backwards compatible to simplify your migration. - * - * Plans define the base price, currency, and billing cycle for recurring purchases - * of products. Products help - * you track inventory or provisioning, and plans help you track pricing. Different - * physical goods or levels of service should be represented by products, and - * pricing options should be represented by plans. This approach lets you change - * prices without having to change your provisioning scheme. - * - * For example, you might have a single "gold" product that has plans for - * $10/month, $100/year, €9/month, and €90/year. - * - * Related guides: Set up - * a subscription and more about products and prices. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $active Whether the plan can be used for new purchases. - * @property null|string $aggregate_usage Specifies a usage aggregation strategy for plans of usage_type=metered. Allowed values are sum for summing up all usage during a period, last_during_period for using the last usage record reported within a period, last_ever for using the last usage record ever (across period bounds) or max which uses the usage record with the maximum reported usage during a period. Defaults to sum. - * @property null|int $amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. - * @property null|string $amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. - * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in amount) will be charged per unit in quantity (for plans with usage_type=licensed), or per unit of total usage (for plans with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string $interval The frequency at which a subscription is billed. One of day, week, month or year. - * @property int $interval_count The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $nickname A brief description of the plan, hidden from customers. - * @property null|string|\Stripe\Product $product The product whose pricing this plan determines. - * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. - * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. - * @property null|\Stripe\StripeObject $transform_usage Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. - * @property null|int $trial_period_days Default number of trial days when subscribing a customer to this plan using trial_from_plan=true. - * @property string $usage_type Configures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed. - */ -class Plan extends ApiResource -{ - const OBJECT_NAME = 'plan'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Price.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Price.php deleted file mode 100644 index 3d2e147d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Price.php +++ /dev/null @@ -1,83 +0,0 @@ -Products help you track - * inventory or provisioning, and prices help you track payment terms. Different - * physical goods or levels of service should be represented by products, and - * pricing options should be represented by prices. This approach lets you change - * prices without having to change your provisioning scheme. - * - * For example, you might have a single "gold" product that has prices - * for $10/month, $100/year, and €9 once. - * - * Related guides: Set up - * a subscription, create an invoice, - * and more about products and prices. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $active Whether the price can be used for new purchases. - * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity (for prices with usage_type=licensed), or per unit of total usage (for prices with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $lookup_key A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $nickname A brief description of the price, hidden from customers. - * @property string|\Stripe\Product $product The ID of the product this price is associated with. - * @property null|\Stripe\StripeObject $recurring The recurring components of a price such as interval and usage_type. - * @property null|string $tax_behavior Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. Once specified as either inclusive or exclusive, it cannot be changed. - * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. - * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. - * @property null|\Stripe\StripeObject $transform_quantity Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. - * @property string $type One of one_time or recurring depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. - * @property null|int $unit_amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. - * @property null|string $unit_amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. - */ -class Price extends ApiResource -{ - const OBJECT_NAME = 'price'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Search; - use ApiOperations\Update; - - const BILLING_SCHEME_PER_UNIT = 'per_unit'; - const BILLING_SCHEME_TIERED = 'tiered'; - - const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive'; - const TAX_BEHAVIOR_INCLUSIVE = 'inclusive'; - const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified'; - - const TIERS_MODE_GRADUATED = 'graduated'; - const TIERS_MODE_VOLUME = 'volume'; - - const TYPE_ONE_TIME = 'one_time'; - const TYPE_RECURRING = 'recurring'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult the price search results - */ - public static function search($params = null, $opts = null) - { - $url = '/v1/prices/search'; - - return self::_searchResource($url, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Product.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Product.php deleted file mode 100644 index d3d21634..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Product.php +++ /dev/null @@ -1,73 +0,0 @@ -Prices to - * configure pricing in Payment Links, Checkout, and Subscriptions. - * - * Related guides: Set up - * a subscription, share a Payment - * Link, accept - * payments with Checkout, and more about Products and Prices - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $active Whether the product is currently available for purchase. - * @property null|string[] $attributes A list of up to 5 attributes that each SKU can provide values for (e.g., ["color", "size"]). - * @property null|string $caption A short one-line description of the product, meant to be displayable to the customer. Only applicable to products of type=good. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string[] $deactivate_on An array of connect application identifiers that cannot purchase this product. Only applicable to products of type=good. - * @property null|string|\Stripe\Price $default_price The ID of the Price object that is the default price for this product. - * @property null|string $description The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - * @property string[] $images A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $name The product's name, meant to be displayable to the customer. - * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this product for shipping purposes. - * @property null|bool $shippable Whether this product is shipped (i.e., physical goods). - * @property null|string $statement_descriptor Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. - * @property null|string|\Stripe\TaxCode $tax_code A tax code ID. - * @property string $type The type of the product. The product is either of type good, which is eligible for use with Orders and SKUs, or service, which is eligible for use with Subscriptions and Plans. - * @property null|string $unit_label A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions. - * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - * @property null|string $url A URL of a publicly-accessible webpage for this product. - */ -class Product extends ApiResource -{ - const OBJECT_NAME = 'product'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Search; - use ApiOperations\Update; - - const TYPE_GOOD = 'good'; - const TYPE_SERVICE = 'service'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult the product search results - */ - public static function search($params = null, $opts = null) - { - $url = '/v1/products/search'; - - return self::_searchResource($url, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PromotionCode.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PromotionCode.php deleted file mode 100644 index 2457add4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/PromotionCode.php +++ /dev/null @@ -1,33 +0,0 @@ -invoices or orders. Coupons do not work with conventional one-off charges. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer The customer that this promotion code can be used by. - * @property null|int $expires_at Date at which the promotion code can no longer be redeemed. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|int $max_redemptions Maximum number of times this promotion code can be redeemed. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $restrictions - * @property int $times_redeemed Number of times this promotion code has been used. - */ -class PromotionCode extends ApiResource -{ - const OBJECT_NAME = 'promotion_code'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Quote.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Quote.php deleted file mode 100644 index b3fcb349..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Quote.php +++ /dev/null @@ -1,171 +0,0 @@ -charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. Defaults to charge_automatically. - * @property \Stripe\StripeObject $computed - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. - * @property (string|\Stripe\TaxRate)[] $default_tax_rates The tax rates applied to this quote. - * @property null|string $description A description that will be displayed on the quote PDF. - * @property (string|\Stripe\Discount)[] $discounts The discounts applied to this quote. - * @property int $expires_at The date on which the quote will be canceled if in open or draft status. Measured in seconds since the Unix epoch. - * @property null|string $footer A footer that will be displayed on the quote PDF. - * @property null|\Stripe\StripeObject $from_quote Details of the quote that was cloned. See the cloning documentation for more details. - * @property null|string $header A header that will be displayed on the quote PDF. - * @property null|string|\Stripe\Invoice $invoice The invoice that was created from this quote. - * @property null|\Stripe\StripeObject $invoice_settings All invoices will be billed using the specified settings. - * @property \Stripe\Collection<\Stripe\LineItem> $line_items A list of items the customer is being quoted for. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $number A unique number that identifies this particular quote. This number is assigned once the quote is finalized. - * @property null|string|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. - * @property string $status The status of the quote. - * @property \Stripe\StripeObject $status_transitions - * @property null|string|\Stripe\Subscription $subscription The subscription that was created or updated from this quote. - * @property \Stripe\StripeObject $subscription_data - * @property null|string|\Stripe\SubscriptionSchedule $subscription_schedule The subscription schedule that was created or updated from this quote. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this quote belongs to. - * @property \Stripe\StripeObject $total_details - * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. - */ -class Quote extends ApiResource -{ - const OBJECT_NAME = 'quote'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically'; - const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice'; - - const STATUS_ACCEPTED = 'accepted'; - const STATUS_CANCELED = 'canceled'; - const STATUS_DRAFT = 'draft'; - const STATUS_OPEN = 'open'; - - /** - * @param callable $readBodyChunkCallable - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - */ - public function pdf($readBodyChunkCallable, $params = null, $opts = null) - { - $opts = \Stripe\Util\RequestOptions::parse($opts); - if (null === $opts->apiBase) { - $opts->apiBase = Stripe::$apiUploadBase; - } - - $url = $this->instanceUrl() . '/pdf'; - $this->_requestStream('get', $url, $readBodyChunkCallable, $params, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Quote the accepted quote - */ - public function accept($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/accept'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Quote the canceled quote - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Quote the finalized quote - */ - public function finalizeQuote($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/finalize'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * @param mixed $id - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Quote> list of LineItems - */ - public static function allComputedUpfrontLineItems($id, $params = null, $opts = null) - { - $url = static::resourceUrl($id) . '/computed_upfront_line_items'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * @param mixed $id - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Quote> list of LineItems - */ - public static function allLineItems($id, $params = null, $opts = null) - { - $url = static::resourceUrl($id) . '/line_items'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php deleted file mode 100644 index 2dfd2aca..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php +++ /dev/null @@ -1,38 +0,0 @@ -Early - * Fraud Warnings. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $actionable An EFW is actionable if it has not received a dispute and has not been fully refunded. You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. - * @property string|\Stripe\Charge $charge ID of the charge this early fraud warning is for, optionally expanded. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $fraud_type The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string|\Stripe\PaymentIntent $payment_intent ID of the Payment Intent this early fraud warning is for, optionally expanded. - */ -class EarlyFraudWarning extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'radar.early_fraud_warning'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; - - const FRAUD_TYPE_CARD_NEVER_RECEIVED = 'card_never_received'; - const FRAUD_TYPE_FRAUDULENT_CARD_APPLICATION = 'fraudulent_card_application'; - const FRAUD_TYPE_MADE_WITH_COUNTERFEIT_CARD = 'made_with_counterfeit_card'; - const FRAUD_TYPE_MADE_WITH_LOST_CARD = 'made_with_lost_card'; - const FRAUD_TYPE_MADE_WITH_STOLEN_CARD = 'made_with_stolen_card'; - const FRAUD_TYPE_MISC = 'misc'; - const FRAUD_TYPE_UNAUTHORIZED_USE_OF_CARD = 'unauthorized_use_of_card'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Radar/ValueList.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Radar/ValueList.php deleted file mode 100644 index 8cd62236..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Radar/ValueList.php +++ /dev/null @@ -1,35 +0,0 @@ -Default Stripe - * Lists. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $alias The name of the value list for use in rules. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $created_by The name or email address of the user who created this value list. - * @property string $item_type The type of items in the value list. One of card_fingerprint, card_bin, email, ip_address, country, string, case_sensitive_string, or customer_id. - * @property \Stripe\Collection<\Stripe\Radar\ValueListItem> $list_items List of items contained within this value list. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $name The name of the value list. - */ -class ValueList extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'radar.value_list'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Delete; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php deleted file mode 100644 index c4ab2819..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php +++ /dev/null @@ -1,31 +0,0 @@ -Managing List - * Items. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $created_by The name or email address of the user who added this item to the value list. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $value The value of the item. - * @property string $value_list The identifier of the value list this item belongs to. - */ -class ValueListItem extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'radar.value_list_item'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Delete; - use \Stripe\ApiOperations\Retrieve; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Recipient.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Recipient.php deleted file mode 100644 index 75155b53..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Recipient.php +++ /dev/null @@ -1,44 +0,0 @@ -Recipient objects, you can transfer money from your Stripe - * account to a third-party bank account or debit card. The API allows you to - * create, delete, and update your recipients. You can retrieve individual - * recipients as well as a list of all your recipients. - * - * Recipient objects have been deprecated in favor of Connect, specifically Connect's much - * more powerful Account objects. - * Stripe accounts that don't already use recipients can no longer begin doing so. - * Please use Account objects instead. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\BankAccount $active_account Hash describing the current account on the recipient, if there is one. - * @property null|\Stripe\Collection<\Stripe\Card> $cards - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Card $default_card The default card to use for creating transfers to this recipient. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string $email - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string|\Stripe\Account $migrated_to The ID of the Custom account this recipient was migrated to. If set, the recipient can no longer be updated, nor can transfers be made to it: use the Custom account instead. - * @property null|string $name Full, legal name of the recipient. - * @property string|\Stripe\Account $rolled_back_from - * @property string $type Type of the recipient, one of individual or corporation. - * @property bool $verified Whether the recipient has been verified. This field is non-standard, and maybe removed in the future - */ -class Recipient extends ApiResource -{ - const OBJECT_NAME = 'recipient'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/RecipientTransfer.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/RecipientTransfer.php deleted file mode 100644 index 5e2d4365..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/RecipientTransfer.php +++ /dev/null @@ -1,36 +0,0 @@ -Refund objects allow you to refund a charge that has previously - * been created but not yet refunded. Funds will be refunded to the credit or debit - * card that was originally charged. - * - * Related guide: Refunds. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount, in %s. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. - * @property null|string|\Stripe\Charge $charge ID of the charge that was refunded. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only) - * @property string|\Stripe\BalanceTransaction $failure_balance_transaction If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. - * @property string $failure_reason If the refund failed, the reason for refund failure if known. Possible values are lost_or_stolen_card, expired_or_canceled_card, or unknown. - * @property string $instructions_email Email to which refund instructions, if required, are sent to. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $next_action - * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was refunded. - * @property null|string $reason Reason for the refund, either user-provided (duplicate, fraudulent, or requested_by_customer) or generated by Stripe internally (expired_uncaptured_charge). - * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this refund. - * @property null|string|\Stripe\TransferReversal $source_transfer_reversal The transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details. - * @property null|string $status Status of the refund. For credit card refunds, this can be pending, succeeded, or failed. For other types of refunds, it can be pending, succeeded, failed, or canceled. Refer to our refunds documentation for more details. - * @property null|string|\Stripe\TransferReversal $transfer_reversal If the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter. - */ -class Refund extends ApiResource -{ - const OBJECT_NAME = 'refund'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const FAILURE_REASON_EXPIRED_OR_CANCELED_CARD = 'expired_or_canceled_card'; - const FAILURE_REASON_LOST_OR_STOLEN_CARD = 'lost_or_stolen_card'; - const FAILURE_REASON_UNKNOWN = 'unknown'; - - const REASON_DUPLICATE = 'duplicate'; - const REASON_EXPIRED_UNCAPTURED_CHARGE = 'expired_uncaptured_charge'; - const REASON_FRAUDULENT = 'fraudulent'; - const REASON_REQUESTED_BY_CUSTOMER = 'requested_by_customer'; - - const STATUS_CANCELED = 'canceled'; - const STATUS_FAILED = 'failed'; - const STATUS_PENDING = 'pending'; - const STATUS_SUCCEEDED = 'succeeded'; - - /** - * @deprecated use FAILURE_REASON_EXPIRED_OR_CANCELED_CARD instead - */ - const FAILURE_REASON = 'expired_or_canceled_card'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Refund the canceled refund - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php deleted file mode 100644 index 7c3d2a99..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php +++ /dev/null @@ -1,37 +0,0 @@ -API Access to - * Reports. - * - * Note that certain report types can only be run based on your live-mode data (not - * test-mode data), and will error when queried without a live-mode API key. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $error If something should go wrong during the run, a message about the failure (populated when status=failed). - * @property bool $livemode true if the report is run on live mode data and false if it is run on test mode data. - * @property \Stripe\StripeObject $parameters - * @property string $report_type The ID of the report type to run, such as "balance.summary.1". - * @property null|\Stripe\File $result The file object representing the result of the report run (populated when status=succeeded). - * @property string $status Status of this report run. This will be pending when the run is initially created. When the run finishes, this will be set to succeeded and the result field will be populated. Rarely, we may encounter an error, at which point this will be set to failed and the error field will be populated. - * @property null|int $succeeded_at Timestamp at which this run successfully finished (populated when status=succeeded). Measured in seconds since the Unix epoch. - */ -class ReportRun extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'reporting.report_run'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Reporting/ReportType.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Reporting/ReportType.php deleted file mode 100644 index 4725656e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Reporting/ReportType.php +++ /dev/null @@ -1,35 +0,0 @@ -API Access to Reports - * documentation for those Report Type IDs, along with required and optional - * parameters. - * - * Note that certain report types can only be run based on your live-mode data (not - * test-mode data), and will error when queried without a live-mode API key. - * - * @property string $id The ID of the Report Type, such as balance.summary.1. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $data_available_end Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. - * @property int $data_available_start Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. - * @property null|string[] $default_columns List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the columns parameter, this will be null.) - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $name Human-readable name of the Report Type - * @property int $updated When this Report Type was latest updated. Measured in seconds since the Unix epoch. - * @property int $version Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. - */ -class ReportType extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'reporting.report_type'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/RequestTelemetry.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/RequestTelemetry.php deleted file mode 100644 index bf9074ac..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/RequestTelemetry.php +++ /dev/null @@ -1,26 +0,0 @@ -requestId = $requestId; - $this->requestDuration = $requestDuration; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Review.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Review.php deleted file mode 100644 index af8f3985..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Review.php +++ /dev/null @@ -1,66 +0,0 @@ -Radar and reviewing payments here. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string $billing_zip The ZIP or postal code of the card used, if applicable. - * @property null|string|\Stripe\Charge $charge The charge associated with this review. - * @property null|string $closed_reason The reason the review was closed, or null if it has not yet been closed. One of approved, refunded, refunded_as_fraud, disputed, or redacted. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $ip_address The IP address where the payment originated. - * @property null|\Stripe\StripeObject $ip_address_location Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property bool $open If true, the review needs action. - * @property string $opened_reason The reason the review was opened. One of rule or manual. - * @property string|\Stripe\PaymentIntent $payment_intent The PaymentIntent ID associated with this review, if one exists. - * @property string $reason The reason the review is currently open or closed. One of rule, manual, approved, refunded, refunded_as_fraud, disputed, or redacted. - * @property null|\Stripe\StripeObject $session Information related to the browsing session of the user who initiated the payment. - */ -class Review extends ApiResource -{ - const OBJECT_NAME = 'review'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - /** - * Possible string representations of the current, the opening or the closure reason of the review. - * Not all of these enumeration apply to all of the ´reason´ fields. Please consult the Review object to - * determine where these are apply. - * - * @see https://stripe.com/docs/api/radar/reviews/object - */ - const REASON_APPROVED = 'approved'; - const REASON_DISPUTED = 'disputed'; - const REASON_MANUAL = 'manual'; - const REASON_REFUNDED = 'refunded'; - const REASON_REFUNDED_AS_FRAUD = 'refunded_as_fraud'; - const REASON_RULE = 'rule'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Review the approved review - */ - public function approve($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/approve'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SKU.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SKU.php deleted file mode 100644 index 09d6c85e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SKU.php +++ /dev/null @@ -1,41 +0,0 @@ -stock keeping units. - * SKUs describe specific product variations, taking into account any combination - * of: attributes, currency, and cost. For example, a product may be a T-shirt, - * whereas a specific SKU represents the size: large, color: - * red version of that shirt. - * - * Can also be used to manage inventory. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $active Whether the SKU is available for purchase. - * @property \Stripe\StripeObject $attributes A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are ["size", "gender"], a valid SKU has the following dictionary of attributes: {"size": "Medium", "gender": "Unisex"}. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $image The URL of an image for this SKU, meant to be displayable to the customer. - * @property \Stripe\StripeObject $inventory - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this SKU for shipping purposes. - * @property int $price The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). - * @property string|\Stripe\Product $product The ID of the product this SKU is associated with. The product must be currently active. - * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - */ -class SKU extends ApiResource -{ - const OBJECT_NAME = 'sku'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SearchResult.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SearchResult.php deleted file mode 100644 index f42769d9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SearchResult.php +++ /dev/null @@ -1,234 +0,0 @@ -Collection in that they both wrap - * around a list of objects and provide pagination. However the - * SearchResult object paginates by relying on a - * next_page token included in the response rather than using - * object IDs and a starting_before/ending_after - * parameter. Thus, SearchResult only supports forwards pagination. - * - * The {@see $total_count} property is only available when - * the `expand` parameter contains `total_count`. - * - * @template TStripeObject of StripeObject - * @template-implements \IteratorAggregate - * - * @property string $object - * @property string $url - * @property string $next_page - * @property int $total_count - * @property bool $has_more - * @property TStripeObject[] $data - */ -class SearchResult extends StripeObject implements \Countable, \IteratorAggregate -{ - const OBJECT_NAME = 'search_result'; - - use ApiOperations\Request; - - /** @var array */ - protected $filters = []; - - /** - * @return string the base URL for the given class - */ - public static function baseUrl() - { - return Stripe::$apiBase; - } - - /** - * Returns the filters. - * - * @return array the filters - */ - public function getFilters() - { - return $this->filters; - } - - /** - * Sets the filters, removing paging options. - * - * @param array $filters the filters - */ - public function setFilters($filters) - { - $this->filters = $filters; - } - - #[\ReturnTypeWillChange] - public function offsetGet($k) - { - if (\is_string($k)) { - return parent::offsetGet($k); - } - $msg = "You tried to access the {$k} index, but SearchResult " . - 'types only support string keys. (HINT: Search calls ' . - 'return an object with a `data` (which is the data ' . - "array). You likely want to call ->data[{$k}])"; - - throw new Exception\InvalidArgumentException($msg); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws Exception\ApiErrorException - * - * @return SearchResult - */ - public function all($params = null, $opts = null) - { - self::_validateParams($params); - list($url, $params) = $this->extractPathAndUpdateParams($params); - - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = Util\Util::convertToStripeObject($response, $opts); - if (!($obj instanceof \Stripe\SearchResult)) { - throw new \Stripe\Exception\UnexpectedValueException( - 'Expected type ' . \Stripe\SearchResult::class . ', got "' . \get_class($obj) . '" instead.' - ); - } - $obj->setFilters($params); - - return $obj; - } - - /** - * @return int the number of objects in the current page - */ - #[\ReturnTypeWillChange] - public function count() - { - return \count($this->data); - } - - /** - * @return \ArrayIterator an iterator that can be used to iterate - * across objects in the current page - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - return new \ArrayIterator($this->data); - } - - /** - * @return \Generator|TStripeObject[] A generator that can be used to - * iterate across all objects across all pages. As page boundaries are - * encountered, the next page will be fetched automatically for - * continued iteration. - */ - public function autoPagingIterator() - { - $page = $this; - - while (true) { - foreach ($page as $item) { - yield $item; - } - $page = $page->nextPage(); - - if ($page->isEmpty()) { - break; - } - } - } - - /** - * Returns an empty set of search results. This is returned from - * {@see nextPage()} when we know that there isn't a next page in order to - * replicate the behavior of the API when it attempts to return a page - * beyond the last. - * - * @param null|array|string $opts - * - * @return SearchResult - */ - public static function emptySearchResult($opts = null) - { - return SearchResult::constructFrom(['data' => []], $opts); - } - - /** - * Returns true if the page object contains no element. - * - * @return bool - */ - public function isEmpty() - { - return empty($this->data); - } - - /** - * Fetches the next page in the resource list (if there is one). - * - * This method will try to respect the limit of the current page. If none - * was given, the default limit will be fetched again. - * - * @param null|array $params - * @param null|array|string $opts - * - * @return SearchResult - */ - public function nextPage($params = null, $opts = null) - { - if (!$this->has_more) { - return static::emptySearchResult($opts); - } - - $params = \array_merge( - $this->filters ?: [], - ['page' => $this->next_page], - $params ?: [] - ); - - return $this->all($params, $opts); - } - - /** - * Gets the first item from the current page. Returns `null` if the current page is empty. - * - * @return null|TStripeObject - */ - public function first() - { - return \count($this->data) > 0 ? $this->data[0] : null; - } - - /** - * Gets the last item from the current page. Returns `null` if the current page is empty. - * - * @return null|TStripeObject - */ - public function last() - { - return \count($this->data) > 0 ? $this->data[\count($this->data) - 1] : null; - } - - private function extractPathAndUpdateParams($params) - { - $url = \parse_url($this->url); - - if (!isset($url['path'])) { - throw new Exception\UnexpectedValueException("Could not parse list url into parts: {$url}"); - } - - if (isset($url['query'])) { - // If the URL contains a query param, parse it out into $params so they - // don't interact weirdly with each other. - $query = []; - \parse_str($url['query'], $query); - $params = \array_merge($params ?: [], $query); - } - - return [$url['path'], $params]; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AbstractService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AbstractService.php deleted file mode 100644 index 145af675..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AbstractService.php +++ /dev/null @@ -1,105 +0,0 @@ -client = $client; - $this->streamingClient = $client; - } - - /** - * Gets the client used by this service to send requests. - * - * @return \Stripe\StripeClientInterface - */ - public function getClient() - { - return $this->client; - } - - /** - * Gets the client used by this service to send requests. - * - * @return \Stripe\StripeStreamingClientInterface - */ - public function getStreamingClient() - { - return $this->streamingClient; - } - - /** - * Translate null values to empty strings. For service methods, - * we interpret null as a request to unset the field, which - * corresponds to sending an empty string for the field to the - * API. - * - * @param null|array $params - */ - private static function formatParams($params) - { - if (null === $params) { - return null; - } - \array_walk_recursive($params, function (&$value, $key) { - if (null === $value) { - $value = ''; - } - }); - - return $params; - } - - protected function request($method, $path, $params, $opts) - { - return $this->getClient()->request($method, $path, static::formatParams($params), $opts); - } - - protected function requestStream($method, $path, $readBodyChunkCallable, $params, $opts) - { - return $this->getStreamingClient()->requestStream($method, $path, $readBodyChunkCallable, static::formatParams($params), $opts); - } - - protected function requestCollection($method, $path, $params, $opts) - { - return $this->getClient()->requestCollection($method, $path, static::formatParams($params), $opts); - } - - protected function requestSearchResult($method, $path, $params, $opts) - { - return $this->getClient()->requestSearchResult($method, $path, static::formatParams($params), $opts); - } - - protected function buildPath($basePath, ...$ids) - { - foreach ($ids as $id) { - if (null === $id || '' === \trim($id)) { - $msg = 'The resource ID cannot be null or whitespace.'; - - throw new \Stripe\Exception\InvalidArgumentException($msg); - } - } - - return \sprintf($basePath, ...\array_map('\urlencode', $ids)); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php deleted file mode 100644 index 4aca6868..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php +++ /dev/null @@ -1,59 +0,0 @@ - */ - private $services; - - /** - * @param \Stripe\StripeClientInterface $client - */ - public function __construct($client) - { - $this->client = $client; - $this->services = []; - } - - /** - * @param string $name - * - * @return null|string - */ - abstract protected function getServiceClass($name); - - /** - * @param string $name - * - * @return null|AbstractService|AbstractServiceFactory - */ - public function __get($name) - { - $serviceClass = $this->getServiceClass($name); - if (null !== $serviceClass) { - if (!\array_key_exists($name, $this->services)) { - $this->services[$name] = new $serviceClass($this->client); - } - - return $this->services[$name]; - } - - \trigger_error('Undefined property: ' . static::class . '::$' . $name); - - return null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AccountLinkService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AccountLinkService.php deleted file mode 100644 index 2e904923..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AccountLinkService.php +++ /dev/null @@ -1,25 +0,0 @@ -request('post', '/v1/account_links', $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AccountService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AccountService.php deleted file mode 100644 index 4ef217d5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/AccountService.php +++ /dev/null @@ -1,382 +0,0 @@ -Connect. If you’re not a platform, the list is empty. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Account> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/accounts', $params, $opts); - } - - /** - * Returns a list of capabilities associated with the account. The capabilities are - * returned sorted by creation date, with the most recent capability appearing - * first. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Capability> - */ - public function allCapabilities($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/capabilities', $parentId), $params, $opts); - } - - /** - * List external accounts for an account. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> - */ - public function allExternalAccounts($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/external_accounts', $parentId), $params, $opts); - } - - /** - * Returns a list of people associated with the account’s legal entity. The people - * are returned sorted by creation date, with the most recent people appearing - * first. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Person> - */ - public function allPersons($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/persons', $parentId), $params, $opts); - } - - /** - * With Connect, you can create Stripe accounts for - * your users. To do this, you’ll first need to register your - * platform. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/accounts', $params, $opts); - } - - /** - * Create an external account for a given account. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public function createExternalAccount($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/external_accounts', $parentId), $params, $opts); - } - - /** - * Creates a single-use login link for an Express account to access their Stripe - * dashboard. - * - * You may only create login links for Express accounts connected to your - * platform. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\LoginLink - */ - public function createLoginLink($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/login_links', $parentId), $params, $opts); - } - - /** - * Creates a new person. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public function createPerson($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/persons', $parentId), $params, $opts); - } - - /** - * With Connect, you can delete accounts you manage. - * - * Accounts created using test-mode keys can be deleted at any time. Standard - * accounts created using live-mode keys cannot be deleted. Custom or Express - * accounts created using live-mode keys can only be deleted once all balances are - * zero. - * - * If you want to delete your own account, use the account information tab in your - * account settings instead. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); - } - - /** - * Delete a specified external account for a given account. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public function deleteExternalAccount($parentId, $id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); - } - - /** - * Deletes an existing person’s relationship to the account’s legal entity. Any - * person with a relationship for an account can be deleted through the API, except - * if the person is the account_opener. If your integration is using - * the executive parameter, you cannot delete the only verified - * executive on file. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public function deletePerson($parentId, $id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); - } - - /** - * With Connect, you may flag accounts as suspicious. - * - * Test-mode Custom and Express accounts can be rejected at any time. Accounts - * created using live-mode keys may only be rejected once all balances are zero. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public function reject($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/reject', $id), $params, $opts); - } - - /** - * Retrieves information about the specified Account Capability. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Capability - */ - public function retrieveCapability($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/accounts/%s/capabilities/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieve a specified external account for a given account. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public function retrieveExternalAccount($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves an existing person. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public function retrievePerson($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates a connected account by setting the - * values of the parameters passed. Any parameters not provided are left unchanged. - * Most parameters can be changed only for Custom accounts. (These are marked - * Custom Only below.) Parameters marked Custom and - * Express are not supported for Standard accounts. - * - * To update your own account, use the Dashboard. Refer to our Connect documentation to learn more - * about updating accounts. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); - } - - /** - * Updates an existing Account Capability. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Capability - */ - public function updateCapability($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/capabilities/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates the metadata, account holder name, account holder type of a bank account - * belonging to a Custom account, and - * optionally sets it as the default for its currency. Other bank account details - * are not editable by design. - * - * You can re-enable a disabled bank account by performing an update call without - * providing any arguments or changes. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public function updateExternalAccount($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates an existing person. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public function updatePerson($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves the details of an account. - * - * @param null|string $id - * @param null|array $params - * @param null|array|StripeUtilRequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public function retrieve($id = null, $params = null, $opts = null) - { - if (null === $id) { - return $this->request('get', '/v1/account', $params, $opts); - } - - return $this->request('get', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php deleted file mode 100644 index 3a076f47..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php +++ /dev/null @@ -1,70 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/apple_pay/domains', $params, $opts); - } - - /** - * Create an apple pay domain. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplePayDomain - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/apple_pay/domains', $params, $opts); - } - - /** - * Delete an apple pay domain. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplePayDomain - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); - } - - /** - * Retrieve an apple pay domain. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplePayDomain - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php deleted file mode 100644 index 138c3794..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php +++ /dev/null @@ -1,125 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/application_fees', $params, $opts); - } - - /** - * You can see a list of the refunds belonging to a specific application fee. Note - * that the 10 most recent refunds are always available by default on the - * application fee object. If you need more than those 10, you can use this API - * method and the limit and starting_after parameters to - * page through additional refunds. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\ApplicationFeeRefund> - */ - public function allRefunds($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/application_fees/%s/refunds', $parentId), $params, $opts); - } - - /** - * Refunds an application fee that has previously been collected but not yet - * refunded. Funds will be refunded to the Stripe account from which the fee was - * originally collected. - * - * You can optionally refund only part of an application fee. You can do so - * multiple times, until the entire fee has been refunded. - * - * Once entirely refunded, an application fee can’t be refunded again. This method - * will raise an error when called on an already-refunded application fee, or when - * trying to refund more money than is left on an application fee. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public function createRefund($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/application_fees/%s/refunds', $parentId), $params, $opts); - } - - /** - * Retrieves the details of an application fee that your account has collected. The - * same information is returned when refunding the application fee. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFee - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/application_fees/%s', $id), $params, $opts); - } - - /** - * By default, you can see the 10 most recent refunds stored directly on the - * application fee object, but you can also retrieve details about a specific - * refund stored on the application fee. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public function retrieveRefund($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates the specified application fee refund by setting the values of the - * parameters passed. Any parameters not provided will be left unchanged. - * - * This request only accepts metadata as an argument. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public function updateRefund($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BalanceService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BalanceService.php deleted file mode 100644 index 0f55385f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BalanceService.php +++ /dev/null @@ -1,26 +0,0 @@ -Accounting - * for negative balances. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Balance - */ - public function retrieve($params = null, $opts = null) - { - return $this->request('get', '/v1/balance', $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php deleted file mode 100644 index 9e6d37c0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php +++ /dev/null @@ -1,47 +0,0 @@ -/v1/balance/history. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\BalanceTransaction> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/balance_transactions', $params, $opts); - } - - /** - * Retrieves the balance transaction with the given ID. - * - * Note that this endpoint previously used the path - * /v1/balance/history/:id. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BalanceTransaction - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/balance_transactions/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php deleted file mode 100644 index 23a4d30b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - private static $classMap = [ - 'configurations' => ConfigurationService::class, - 'sessions' => SessionService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php deleted file mode 100644 index 11d1a5a3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/billing_portal/configurations', $params, $opts); - } - - /** - * Creates a configuration that describes the functionality and behavior of a - * PortalSession. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BillingPortal\Configuration - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/billing_portal/configurations', $params, $opts); - } - - /** - * Retrieves a configuration that describes the functionality of the customer - * portal. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BillingPortal\Configuration - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); - } - - /** - * Updates a configuration that describes the functionality of the customer portal. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BillingPortal\Configuration - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php deleted file mode 100644 index 6b3e6026..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php +++ /dev/null @@ -1,23 +0,0 @@ -request('post', '/v1/billing_portal/sessions', $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ChargeService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ChargeService.php deleted file mode 100644 index 0bde0279..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ChargeService.php +++ /dev/null @@ -1,122 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/charges', $params, $opts); - } - - /** - * Capture the payment of an existing, uncaptured, charge. This is the second half - * of the two-step payment flow, where first you created a - * charge with the capture option set to false. - * - * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not captured - * by that point in time, they will be marked as refunded and will no longer be - * capturable. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Charge - */ - public function capture($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/charges/%s/capture', $id), $params, $opts); - } - - /** - * To charge a credit card or other payment source, you create a - * Charge object. If your API key is in test mode, the supplied - * payment source (e.g., card) won’t actually be charged, although everything else - * will occur as if in live mode. (Stripe assumes that the charge would have - * completed successfully). - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Charge - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/charges', $params, $opts); - } - - /** - * Retrieves the details of a charge that has previously been created. Supply the - * unique charge ID that was returned from your previous request, and Stripe will - * return the corresponding charge information. The same information is returned - * when creating or refunding the charge. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Charge - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/charges/%s', $id), $params, $opts); - } - - /** - * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t use - * search in read-after-write flows where strict consistency is necessary. Under - * normal operating conditions, data is searchable in less than a minute. - * Occasionally, propagation of new or updated data can be up to an hour behind - * during outages. Search functionality is not available to merchants in India. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult<\Stripe\Charge> - */ - public function search($params = null, $opts = null) - { - return $this->requestSearchResult('get', '/v1/charges/search', $params, $opts); - } - - /** - * Updates the specified charge by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Charge - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/charges/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php deleted file mode 100644 index bb26a837..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ - private static $classMap = [ - 'sessions' => SessionService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php deleted file mode 100644 index a2938d0a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php +++ /dev/null @@ -1,92 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/checkout/sessions', $params, $opts); - } - - /** - * When retrieving a Checkout Session, there is an includable - * line_items property containing the first handful of those - * items. There is also a URL where you can retrieve the full (paginated) list of - * line items. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\LineItem> - */ - public function allLineItems($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/checkout/sessions/%s/line_items', $parentId), $params, $opts); - } - - /** - * Creates a Session object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Checkout\Session - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/checkout/sessions', $params, $opts); - } - - /** - * A Session can be expired when it is in one of these statuses: open. - * - * After it expires, a customer can’t complete a Session and customers loading the - * Session see a message saying the Session is expired. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Checkout\Session - */ - public function expire($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/checkout/sessions/%s/expire', $id), $params, $opts); - } - - /** - * Retrieves a Session object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Checkout\Session - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/checkout/sessions/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php deleted file mode 100644 index 76f82c3c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php +++ /dev/null @@ -1,139 +0,0 @@ - - */ - private static $classMap = [ - 'accountLinks' => AccountLinkService::class, - 'accounts' => AccountService::class, - 'applePayDomains' => ApplePayDomainService::class, - 'applicationFees' => ApplicationFeeService::class, - 'balance' => BalanceService::class, - 'balanceTransactions' => BalanceTransactionService::class, - 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class, - 'charges' => ChargeService::class, - 'checkout' => Checkout\CheckoutServiceFactory::class, - 'countrySpecs' => CountrySpecService::class, - 'coupons' => CouponService::class, - 'creditNotes' => CreditNoteService::class, - 'customers' => CustomerService::class, - 'disputes' => DisputeService::class, - 'ephemeralKeys' => EphemeralKeyService::class, - 'events' => EventService::class, - 'exchangeRates' => ExchangeRateService::class, - 'fileLinks' => FileLinkService::class, - 'files' => FileService::class, - 'financialConnections' => FinancialConnections\FinancialConnectionsServiceFactory::class, - 'identity' => Identity\IdentityServiceFactory::class, - 'invoiceItems' => InvoiceItemService::class, - 'invoices' => InvoiceService::class, - 'issuing' => Issuing\IssuingServiceFactory::class, - 'mandates' => MandateService::class, - 'oauth' => OAuthService::class, - 'orderReturns' => OrderReturnService::class, - 'orders' => OrderService::class, - 'paymentIntents' => PaymentIntentService::class, - 'paymentLinks' => PaymentLinkService::class, - 'paymentMethods' => PaymentMethodService::class, - 'payouts' => PayoutService::class, - 'plans' => PlanService::class, - 'prices' => PriceService::class, - 'products' => ProductService::class, - 'promotionCodes' => PromotionCodeService::class, - 'quotes' => QuoteService::class, - 'radar' => Radar\RadarServiceFactory::class, - 'refunds' => RefundService::class, - 'reporting' => Reporting\ReportingServiceFactory::class, - 'reviews' => ReviewService::class, - 'setupAttempts' => SetupAttemptService::class, - 'setupIntents' => SetupIntentService::class, - 'shippingRates' => ShippingRateService::class, - 'sigma' => Sigma\SigmaServiceFactory::class, - 'skus' => SkuService::class, - 'sources' => SourceService::class, - 'subscriptionItems' => SubscriptionItemService::class, - 'subscriptions' => SubscriptionService::class, - 'subscriptionSchedules' => SubscriptionScheduleService::class, - 'taxCodes' => TaxCodeService::class, - 'taxRates' => TaxRateService::class, - 'terminal' => Terminal\TerminalServiceFactory::class, - 'testHelpers' => TestHelpers\TestHelpersServiceFactory::class, - 'tokens' => TokenService::class, - 'topups' => TopupService::class, - 'transfers' => TransferService::class, - 'webhookEndpoints' => WebhookEndpointService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CountrySpecService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CountrySpecService.php deleted file mode 100644 index 8f3869fe..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CountrySpecService.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/country_specs', $params, $opts); - } - - /** - * Returns a Country Spec for a given Country code. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CountrySpec - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/country_specs/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CouponService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CouponService.php deleted file mode 100644 index 89eb2c7d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CouponService.php +++ /dev/null @@ -1,104 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/coupons', $params, $opts); - } - - /** - * You can create coupons easily via the coupon management page of the - * Stripe dashboard. Coupon creation is also accessible via the API if you need to - * create coupons on the fly. - * - * A coupon has either a percent_off or an amount_off and - * currency. If you set an amount_off, that amount will - * be subtracted from any invoice’s subtotal. For example, an invoice with a - * subtotal of 100 will have a final total of - * 0 if a coupon with an amount_off of - * 200 is applied to it and an invoice with a subtotal of - * 300 will have a final total of 100 if - * a coupon with an amount_off of 200 is applied to - * it. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/coupons', $params, $opts); - } - - /** - * You can delete coupons via the coupon management page of the - * Stripe dashboard. However, deleting a coupon does not affect any customers who - * have already applied the coupon; it means that new customers can’t redeem the - * coupon. You can also delete coupons via the API. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); - } - - /** - * Retrieves the coupon with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); - } - - /** - * Updates the metadata of a coupon. Other coupon details (currency, duration, - * amount_off) are, by design, not editable. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CreditNoteService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CreditNoteService.php deleted file mode 100644 index 5c631328..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CreditNoteService.php +++ /dev/null @@ -1,156 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/credit_notes', $params, $opts); - } - - /** - * When retrieving a credit note, you’ll get a lines property - * containing the the first handful of those items. There is also a URL where you - * can retrieve the full (paginated) list of line items. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> - */ - public function allLines($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/credit_notes/%s/lines', $parentId), $params, $opts); - } - - /** - * Issue a credit note to adjust the amount of a finalized invoice. For a - * status=open invoice, a credit note reduces its - * amount_due. For a status=paid invoice, a credit note - * does not affect its amount_due. Instead, it can result in any - * combination of the following:. - * - *
    • Refund: create a new refund (using refund_amount) or link - * an existing refund (using refund).
    • Customer balance - * credit: credit the customer’s balance (using credit_amount) which - * will be automatically applied to their next invoice when it’s finalized.
    • - *
    • Outside of Stripe credit: record the amount that is or will be credited - * outside of Stripe (using out_of_band_amount).
    - * - * For post-payment credit notes the sum of the refund, credit and outside of - * Stripe amounts must equal the credit note total. - * - * You may issue multiple credit notes for an invoice. Each credit note will - * increment the invoice’s pre_payment_credit_notes_amount or - * post_payment_credit_notes_amount depending on its - * status at the time of credit note creation. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/credit_notes', $params, $opts); - } - - /** - * Get a preview of a credit note without creating it. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function preview($params = null, $opts = null) - { - return $this->request('get', '/v1/credit_notes/preview', $params, $opts); - } - - /** - * When retrieving a credit note preview, you’ll get a lines - * property containing the first handful of those items. This URL you can retrieve - * the full (paginated) list of line items. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\CreditNote> - */ - public function previewLines($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/credit_notes/preview/lines', $params, $opts); - } - - /** - * Retrieves the credit note object with the given identifier. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts); - } - - /** - * Updates an existing credit note. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts); - } - - /** - * Marks a credit note as void. Learn more about voiding credit notes. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function voidCreditNote($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/credit_notes/%s/void', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CustomerService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CustomerService.php deleted file mode 100644 index fe4163b8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/CustomerService.php +++ /dev/null @@ -1,440 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/customers', $params, $opts); - } - - /** - * Returns a list of transactions that updated the customer’s balances. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\CustomerBalanceTransaction> - */ - public function allBalanceTransactions($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); - } - - /** - * Returns a list of PaymentMethods for a given Customer. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Customer> - */ - public function allPaymentMethods($id, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/payment_methods', $id), $params, $opts); - } - - /** - * List sources for a specified customer. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source> - */ - public function allSources($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/sources', $parentId), $params, $opts); - } - - /** - * Returns a list of tax IDs for a customer. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\TaxId> - */ - public function allTaxIds($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/tax_ids', $parentId), $params, $opts); - } - - /** - * Creates a new customer object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/customers', $params, $opts); - } - - /** - * Creates an immutable transaction that updates the customer’s credit balance. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public function createBalanceTransaction($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); - } - - /** - * Retrieve funding instructions for a customer cash balance. If funding - * instructions do not yet exist for the customer, new funding instructions will be - * created. If funding instructions have already been created for a given customer, - * the same funding instructions will be retrieved. In other words, we will return - * the same funding instructions each time. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function createFundingInstructions($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/funding_instructions', $id), $params, $opts); - } - - /** - * When you create a new credit card, you must specify a customer or recipient on - * which to create it. - * - * If the card’s owner has no default card, then the new card will become the - * default. However, if the owner already has a default, then it will not change. - * To change the default, you should update the - * customer to have a new default_source. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public function createSource($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/sources', $parentId), $params, $opts); - } - - /** - * Creates a new TaxID object for a customer. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public function createTaxId($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/tax_ids', $parentId), $params, $opts); - } - - /** - * Permanently deletes a customer. It cannot be undone. Also immediately cancels - * any active subscriptions on the customer. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/customers/%s', $id), $params, $opts); - } - - /** - * Removes the currently applied discount on a customer. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function deleteDiscount($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/customers/%s/discount', $id), $params, $opts); - } - - /** - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public function deleteSource($parentId, $id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); - } - - /** - * Deletes an existing TaxID object. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public function deleteTaxId($parentId, $id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves a Customer object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/customers/%s', $id), $params, $opts); - } - - /** - * Retrieves a specific customer balance transaction that updated the customer’s balances. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public function retrieveBalanceTransaction($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves a customer’s cash balance. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\cash_balance - */ - public function retrieveCashBalance($parentId, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/customers/%s/cash_balance', $parentId), $params, $opts); - } - - /** - * Retrieve a specified source for a given customer. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public function retrieveSource($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves the TaxID object with the given identifier. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public function retrieveTaxId($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); - } - - /** - * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t use - * search in read-after-write flows where strict consistency is necessary. Under - * normal operating conditions, data is searchable in less than a minute. - * Occasionally, propagation of new or updated data can be up to an hour behind - * during outages. Search functionality is not available to merchants in India. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult<\Stripe\Customer> - */ - public function search($params = null, $opts = null) - { - return $this->requestSearchResult('get', '/v1/customers/search', $params, $opts); - } - - /** - * Updates the specified customer by setting the values of the parameters passed. - * Any parameters not provided will be left unchanged. For example, if you pass the - * source parameter, that becomes the customer’s active source - * (e.g., a card) to be used for all charges in the future. When you update a - * customer to a new valid card source by passing the source - * parameter: for each of the customer’s current subscriptions, if the subscription - * bills automatically and is in the past_due state, then the latest - * open invoice for the subscription with automatic collection enabled will be - * retried. This retry will not count as an automatic retry, and will not affect - * the next regularly scheduled payment for the invoice. Changing the - * default_source for a customer will not trigger this behavior. - * - * This request accepts mostly the same arguments as the customer creation call. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s', $id), $params, $opts); - } - - /** - * Most credit balance transaction fields are immutable, but you may update its - * description and metadata. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public function updateBalanceTransaction($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates a customer’s cash balance. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\cash_balance - */ - public function updateCashBalance($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/cash_balance', $parentId), $params, $opts); - } - - /** - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public function updateSource($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); - } - - /** - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public function verifySource($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/sources/%s/verify', $parentId, $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/DisputeService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/DisputeService.php deleted file mode 100644 index 86d3584a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/DisputeService.php +++ /dev/null @@ -1,83 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/disputes', $params, $opts); - } - - /** - * Closing the dispute for a charge indicates that you do not have any evidence to - * submit and are essentially dismissing the dispute, acknowledging it as lost. - * - * The status of the dispute will change from needs_response to - * lost. Closing a dispute is irreversible. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Dispute - */ - public function close($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/disputes/%s/close', $id), $params, $opts); - } - - /** - * Retrieves the dispute with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Dispute - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/disputes/%s', $id), $params, $opts); - } - - /** - * When you get a dispute, contacting your customer is always the best first step. - * If that doesn’t work, you can submit evidence to help us resolve the dispute in - * your favor. You can do this in your dashboard, but if you prefer, - * you can use the API to submit evidence programmatically. - * - * Depending on your dispute type, different evidence fields will give you a better - * chance of winning your dispute. To figure out which evidence fields to provide, - * see our guide to dispute types. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Dispute - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/disputes/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php deleted file mode 100644 index 3ca14c90..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php +++ /dev/null @@ -1,43 +0,0 @@ -request('delete', $this->buildPath('/v1/ephemeral_keys/%s', $id), $params, $opts); - } - - /** - * Creates a short-lived API key for a given resource. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\EphemeralKey - */ - public function create($params = null, $opts = null) - { - if (!$opts || !isset($opts['stripe_version'])) { - throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); - } - - return $this->request('post', '/v1/ephemeral_keys', $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/EventService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/EventService.php deleted file mode 100644 index 9e779dd9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/EventService.php +++ /dev/null @@ -1,44 +0,0 @@ -event object api_version - * attribute (not according to your current Stripe API version or - * Stripe-Version header). - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Event> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/events', $params, $opts); - } - - /** - * Retrieves the details of an event. Supply the unique identifier of the event, - * which you might have received in a webhook. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Event - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/events/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php deleted file mode 100644 index fe010b00..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/exchange_rates', $params, $opts); - } - - /** - * Retrieves the exchange rates from the given currency to every supported - * currency. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ExchangeRate - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/exchange_rates/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FileLinkService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FileLinkService.php deleted file mode 100644 index 06929a9c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FileLinkService.php +++ /dev/null @@ -1,70 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/file_links', $params, $opts); - } - - /** - * Creates a new file link object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FileLink - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/file_links', $params, $opts); - } - - /** - * Retrieves the file link with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FileLink - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/file_links/%s', $id), $params, $opts); - } - - /** - * Updates an existing file link object. Expired links can no longer be updated. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FileLink - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/file_links/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FileService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FileService.php deleted file mode 100644 index 82ef0e50..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FileService.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/files', $params, $opts); - } - - /** - * Retrieves the details of an existing file object. Supply the unique file ID from - * a file, and Stripe will return the corresponding file object. To access file - * contents, see the File Upload - * Guide. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\File - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/files/%s', $id), $params, $opts); - } - - /** - * Create a file. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @return \Stripe\File - */ - public function create($params = null, $opts = null) - { - $opts = \Stripe\Util\RequestOptions::parse($opts); - if (!isset($opts->apiBase)) { - $opts->apiBase = $this->getClient()->getFilesBase(); - } - - // Manually flatten params, otherwise curl's multipart encoder will - // choke on nested null|arrays. - $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); - - return $this->request('post', '/v1/files', $flatParams, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php deleted file mode 100644 index 1c96b124..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php +++ /dev/null @@ -1,58 +0,0 @@ -Account. You will - * no longer be able to access data associated with the account (e.g. balances, - * transactions). - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FinancialConnections\Account - */ - public function disconnect($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/financial_connections/accounts/%s/disconnect', $id), $params, $opts); - } - - /** - * Refreshes the data associated with a Financial Connections Account. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FinancialConnections\Account - */ - public function refresh($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/financial_connections/accounts/%s/refresh', $id), $params, $opts); - } - - /** - * Retrieves the details of an Financial Connections Account. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FinancialConnections\Account - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/financial_connections/accounts/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php deleted file mode 100644 index 7dd82634..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - private static $classMap = [ - 'accounts' => AccountService::class, - 'sessions' => SessionService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php deleted file mode 100644 index eab589cd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php +++ /dev/null @@ -1,41 +0,0 @@ -Session. The session’s client_secret can be used to - * launch the flow using Stripe.js. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FinancialConnections\Session - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/financial_connections/sessions', $params, $opts); - } - - /** - * Retrieves the details of a Financial Connections Session. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FinancialConnections\Session - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/financial_connections/sessions/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php deleted file mode 100644 index cf631462..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - private static $classMap = [ - 'verificationReports' => VerificationReportService::class, - 'verificationSessions' => VerificationSessionService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php deleted file mode 100644 index 9289d9df..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/identity/verification_reports', $params, $opts); - } - - /** - * Retrieves an existing VerificationReport. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationReport - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/identity/verification_reports/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php deleted file mode 100644 index 24bb4e06..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php +++ /dev/null @@ -1,146 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/identity/verification_sessions', $params, $opts); - } - - /** - * A VerificationSession object can be canceled when it is in - * requires_input status. - * - * Once canceled, future submission attempts are disabled. This cannot be undone. - * Learn more. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/cancel', $id), $params, $opts); - } - - /** - * Creates a VerificationSession object. - * - * After the VerificationSession is created, display a verification modal using the - * session client_secret or send your users to the session’s - * url. - * - * If your API key is in test mode, verification checks won’t actually process, - * though everything else will occur as if in live mode. - * - * Related guide: Verify your - * users’ identity documents. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/identity/verification_sessions', $params, $opts); - } - - /** - * Redact a VerificationSession to remove all collected information from Stripe. - * This will redact the VerificationSession and all objects related to it, - * including VerificationReports, Events, request logs, etc. - * - * A VerificationSession object can be redacted when it is in - * requires_input or verified status. Redacting a - * VerificationSession in requires_action state will automatically - * cancel it. - * - * The redaction process may take up to four days. When the redaction process is in - * progress, the VerificationSession’s redaction.status field will be - * set to processing; when the process is finished, it will change to - * redacted and an identity.verification_session.redacted - * event will be emitted. - * - * Redaction is irreversible. Redacted objects are still accessible in the Stripe - * API, but all the fields that contain personal data will be replaced by the - * string [redacted] or a similar placeholder. The - * metadata field will also be erased. Redacted objects cannot be - * updated or used for any purpose. - * - * Learn more. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession - */ - public function redact($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/redact', $id), $params, $opts); - } - - /** - * Retrieves the details of a VerificationSession that was previously created. - * - * When the session status is requires_input, you can use this method - * to retrieve a valid client_secret or url to allow - * re-submission. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); - } - - /** - * Updates a VerificationSession object. - * - * When the session status is requires_input, you can use this method - * to update the verification check and options. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php deleted file mode 100644 index 45e20721..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php +++ /dev/null @@ -1,93 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/invoiceitems', $params, $opts); - } - - /** - * Creates an item to be added to a draft invoice (up to 250 items per invoice). If - * no invoice is specified, the item will be on the next invoice created for the - * customer specified. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\InvoiceItem - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/invoiceitems', $params, $opts); - } - - /** - * Deletes an invoice item, removing it from an invoice. Deleting invoice items is - * only possible when they’re not attached to invoices, or if it’s attached to a - * draft invoice. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\InvoiceItem - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); - } - - /** - * Retrieves the invoice item with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\InvoiceItem - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); - } - - /** - * Updates the amount or description of an invoice item on an upcoming invoice. - * Updating an invoice item is only possible before the invoice it’s attached to is - * closed. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\InvoiceItem - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/InvoiceService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/InvoiceService.php deleted file mode 100644 index 5cb9091d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/InvoiceService.php +++ /dev/null @@ -1,292 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/invoices', $params, $opts); - } - - /** - * When retrieving an invoice, you’ll get a lines property - * containing the total count of line items and the first handful of those items. - * There is also a URL where you can retrieve the full (paginated) list of line - * items. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\LineItem> - */ - public function allLines($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/invoices/%s/lines', $parentId), $params, $opts); - } - - /** - * This endpoint creates a draft invoice for a given customer. The draft invoice - * created pulls in all pending invoice items on that customer, including - * prorations. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to - * your customers. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/invoices', $params, $opts); - } - - /** - * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to - * delete invoices that are no longer in a draft state will fail; once an invoice - * has been finalized or if an invoice is for a subscription, it must be voided. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); - } - - /** - * Stripe automatically finalizes drafts before sending and attempting payment on - * invoices. However, if you’d like to finalize a draft invoice manually, you can - * do so using this method. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function finalizeInvoice($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s/finalize', $id), $params, $opts); - } - - /** - * Marking an invoice as uncollectible is useful for keeping track of bad debts - * that can be written off for accounting purposes. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function markUncollectible($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s/mark_uncollectible', $id), $params, $opts); - } - - /** - * Stripe automatically creates and then attempts to collect payment on invoices - * for customers on subscriptions according to your subscriptions - * settings. However, if you’d like to attempt payment on an invoice out of the - * normal collection schedule or for some other reason, you can do so. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function pay($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s/pay', $id), $params, $opts); - } - - /** - * Retrieves the invoice with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); - } - - /** - * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t use - * search in read-after-write flows where strict consistency is necessary. Under - * normal operating conditions, data is searchable in less than a minute. - * Occasionally, propagation of new or updated data can be up to an hour behind - * during outages. Search functionality is not available to merchants in India. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult<\Stripe\Invoice> - */ - public function search($params = null, $opts = null) - { - return $this->requestSearchResult('get', '/v1/invoices/search', $params, $opts); - } - - /** - * Stripe will automatically send invoices to customers according to your subscriptions - * settings. However, if you’d like to manually send an invoice to your - * customer out of the normal schedule, you can do so. When sending invoices that - * have already been paid, there will be no reference to the payment in the email. - * - * Requests made in test-mode result in no emails being sent, despite sending an - * invoice.sent event. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function sendInvoice($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s/send', $id), $params, $opts); - } - - /** - * At any time, you can preview the upcoming invoice for a customer. This will show - * you all the charges that are pending, including subscription renewal charges, - * invoice item charges, etc. It will also show you any discounts that are - * applicable to the invoice. - * - * Note that when you are viewing an upcoming invoice, you are simply viewing a - * preview – the invoice has not yet been created. As such, the upcoming invoice - * will not show up in invoice listing calls, and you cannot use the API to pay or - * edit the invoice. If you want to change the amount that your customer will be - * billed, you can add, remove, or update pending invoice items, or update the - * customer’s discount. - * - * You can preview the effects of updating a subscription, including a preview of - * what proration will take place. To ensure that the actual proration is - * calculated exactly the same as the previewed proration, you should pass a - * proration_date parameter when doing the actual subscription update. - * The value passed in should be the same as the - * subscription_proration_date returned on the upcoming invoice - * resource. The recommended way to get only the prorations being previewed is to - * consider only proration line items where period[start] is equal to - * the subscription_proration_date on the upcoming invoice resource. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function upcoming($params = null, $opts = null) - { - return $this->request('get', '/v1/invoices/upcoming', $params, $opts); - } - - /** - * When retrieving an upcoming invoice, you’ll get a lines - * property containing the total count of line items and the first handful of those - * items. There is also a URL where you can retrieve the full (paginated) list of - * line items. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Invoice> - */ - public function upcomingLines($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/invoices/upcoming/lines', $params, $opts); - } - - /** - * Draft invoices are fully editable. Once an invoice is finalized, monetary values, - * as well as collection_method, become uneditable. - * - * If you would like to stop the Stripe Billing engine from automatically - * finalizing, reattempting payments on, sending reminders for, or automatically reconciling - * invoices, pass auto_advance=false. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); - } - - /** - * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is - * similar to deletion, however it only applies to - * finalized invoices and maintains a papertrail where the invoice can still be - * found. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function voidInvoice($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s/void', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php deleted file mode 100644 index 6517688f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php +++ /dev/null @@ -1,97 +0,0 @@ -Authorization objects. The objects are - * sorted in descending order by creation date, with the most recently created - * object appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Issuing\Authorization> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/issuing/authorizations', $params, $opts); - } - - /** - * Approves a pending Issuing Authorization object. This request - * should be made within the timeout window of the real-time - * authorization flow. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Authorization - */ - public function approve($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/approve', $id), $params, $opts); - } - - /** - * Declines a pending Issuing Authorization object. This request - * should be made within the timeout window of the real time - * authorization flow. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Authorization - */ - public function decline($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/decline', $id), $params, $opts); - } - - /** - * Retrieves an Issuing Authorization object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Authorization - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts); - } - - /** - * Updates the specified Issuing Authorization object by setting the - * values of the parameters passed. Any parameters not provided will be left - * unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Authorization - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php deleted file mode 100644 index 22b7e541..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php +++ /dev/null @@ -1,73 +0,0 @@ -Card objects. The objects are sorted in - * descending order by creation date, with the most recently created object - * appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Issuing\Card> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/issuing/cards', $params, $opts); - } - - /** - * Creates an Issuing Card object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Card - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/issuing/cards', $params, $opts); - } - - /** - * Retrieves an Issuing Card object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Card - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts); - } - - /** - * Updates the specified Issuing Card object by setting the values of - * the parameters passed. Any parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Card - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php deleted file mode 100644 index 65e675b3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php +++ /dev/null @@ -1,74 +0,0 @@ -Cardholder objects. The objects are - * sorted in descending order by creation date, with the most recently created - * object appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Issuing\Cardholder> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/issuing/cardholders', $params, $opts); - } - - /** - * Creates a new Issuing Cardholder object that can be issued cards. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Cardholder - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/issuing/cardholders', $params, $opts); - } - - /** - * Retrieves an Issuing Cardholder object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Cardholder - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts); - } - - /** - * Updates the specified Issuing Cardholder object by setting the - * values of the parameters passed. Any parameters not provided will be left - * unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Cardholder - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php deleted file mode 100644 index 45c25288..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php +++ /dev/null @@ -1,99 +0,0 @@ -Dispute objects. The objects are sorted - * in descending order by creation date, with the most recently created object - * appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Issuing\Dispute> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/issuing/disputes', $params, $opts); - } - - /** - * Creates an Issuing Dispute object. Individual pieces of evidence - * within the evidence object are optional at this point. Stripe only - * validates that required evidence is present during submission. Refer to Dispute - * reasons and evidence for more details about evidence requirements. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Dispute - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/issuing/disputes', $params, $opts); - } - - /** - * Retrieves an Issuing Dispute object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Dispute - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts); - } - - /** - * Submits an Issuing Dispute to the card network. Stripe validates - * that all evidence fields required for the dispute’s reason are present. For more - * details, see Dispute - * reasons and evidence. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Dispute - */ - public function submit($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s/submit', $id), $params, $opts); - } - - /** - * Updates the specified Issuing Dispute object by setting the values - * of the parameters passed. Any parameters not provided will be left unchanged. - * Properties on the evidence object can be unset by passing in an - * empty string. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Dispute - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php deleted file mode 100644 index a8d5d0f8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ - private static $classMap = [ - 'authorizations' => AuthorizationService::class, - 'cardholders' => CardholderService::class, - 'cards' => CardService::class, - 'disputes' => DisputeService::class, - 'transactions' => TransactionService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php deleted file mode 100644 index dd83b182..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php +++ /dev/null @@ -1,59 +0,0 @@ -Transaction objects. The objects are - * sorted in descending order by creation date, with the most recently created - * object appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Issuing\Transaction> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/issuing/transactions', $params, $opts); - } - - /** - * Retrieves an Issuing Transaction object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Transaction - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); - } - - /** - * Updates the specified Issuing Transaction object by setting the - * values of the parameters passed. Any parameters not provided will be left - * unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Transaction - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/MandateService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/MandateService.php deleted file mode 100644 index 156bff0a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/MandateService.php +++ /dev/null @@ -1,24 +0,0 @@ -request('get', $this->buildPath('/v1/mandates/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/OAuthService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/OAuthService.php deleted file mode 100644 index b745ad98..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/OAuthService.php +++ /dev/null @@ -1,150 +0,0 @@ -_parseOpts($opts); - $opts->apiBase = $this->_getBase($opts); - - return $this->request($method, $path, $params, $opts); - } - - /** - * Generates a URL to Stripe's OAuth form. - * - * @param null|array $params - * @param null|array $opts - * - * @return string the URL to Stripe's OAuth form - */ - public function authorizeUrl($params = null, $opts = null) - { - $params = $params ?: []; - - $opts = $this->_parseOpts($opts); - $base = $this->_getBase($opts); - - $params['client_id'] = $this->_getClientId($params); - if (!\array_key_exists('response_type', $params)) { - $params['response_type'] = 'code'; - } - $query = \Stripe\Util\Util::encodeParameters($params); - - return $base . '/oauth/authorize?' . $query; - } - - /** - * Use an authoriztion code to connect an account to your platform and - * fetch the user's credentials. - * - * @param null|array $params - * @param null|array $opts - * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * - * @return \Stripe\StripeObject object containing the response from the API - */ - public function token($params = null, $opts = null) - { - $params = $params ?: []; - $params['client_secret'] = $this->_getClientSecret($params); - - return $this->requestConnect('post', '/oauth/token', $params, $opts); - } - - /** - * Disconnects an account from your platform. - * - * @param null|array $params - * @param null|array $opts - * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * - * @return \Stripe\StripeObject object containing the response from the API - */ - public function deauthorize($params = null, $opts = null) - { - $params = $params ?: []; - $params['client_id'] = $this->_getClientId($params); - - return $this->requestConnect('post', '/oauth/deauthorize', $params, $opts); - } - - private function _getClientId($params = null) - { - $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; - - if (null === $clientId) { - $clientId = $this->client->getClientId(); - } - if (null === $clientId) { - $msg = 'No client_id provided. (HINT: set your client_id using ' - . '`new \Stripe\StripeClient([clientId => - ])`)". You can find your client_ids ' - . 'in your Stripe dashboard at ' - . 'https://dashboard.stripe.com/account/applications/settings, ' - . 'after registering your account as a platform. See ' - . 'https://stripe.com/docs/connect/standard-accounts for details, ' - . 'or email support@stripe.com if you have any questions.'; - - throw new \Stripe\Exception\AuthenticationException($msg); - } - - return $clientId; - } - - private function _getClientSecret($params = null) - { - if (\array_key_exists('client_secret', $params)) { - return $params['client_secret']; - } - - return $this->client->getApiKey(); - } - - /** - * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request - * - * @throws \Stripe\Exception\InvalidArgumentException - * - * @return \Stripe\Util\RequestOptions - */ - private function _parseOpts($opts) - { - if (\is_array($opts)) { - if (\array_key_exists('connect_base', $opts)) { - // Throw an exception for the convenience of anybody migrating to - // \Stripe\Service\OAuthService from \Stripe\OAuth, where `connect_base` - // was the name of the parameter that behaves as `api_base` does here. - throw new \Stripe\Exception\InvalidArgumentException('Use `api_base`, not `connect_base`'); - } - } - - return \Stripe\Util\RequestOptions::parse($opts); - } - - /** - * @param \Stripe\Util\RequestOptions $opts - * - * @return string - */ - private function _getBase($opts) - { - return isset($opts->apiBase) ? - $opts->apiBase : - $this->client->getConnectBase(); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/OrderReturnService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/OrderReturnService.php deleted file mode 100644 index b98af5f3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/OrderReturnService.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/order_returns', $params, $opts); - } - - /** - * Retrieves the details of an existing order return. Supply the unique order ID - * from either an order return creation request or the order return list, and - * Stripe will return the corresponding order information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\OrderReturn - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/order_returns/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/OrderService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/OrderService.php deleted file mode 100644 index 9da8a3db..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/OrderService.php +++ /dev/null @@ -1,109 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/orders', $params, $opts); - } - - /** - * Creates a new order object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/orders', $params, $opts); - } - - /** - * Pay an order by providing a source to create a payment. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function pay($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s/pay', $id), $params, $opts); - } - - /** - * Retrieves the details of an existing order. Supply the unique order ID from - * either an order creation request or the order list, and Stripe will return the - * corresponding order information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/orders/%s', $id), $params, $opts); - } - - /** - * Return all or part of an order. The order must have a status of - * paid or fulfilled before it can be returned. Once all - * items have been returned, the order will become canceled or - * returned depending on which status the order started in. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function returnOrder($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s/returns', $id), $params, $opts); - } - - /** - * Updates the specific order by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php deleted file mode 100644 index ab8d3a81..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php +++ /dev/null @@ -1,283 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/payment_intents', $params, $opts); - } - - /** - * Manually reconcile the remaining amount for a customer_balance PaymentIntent. - * - * This can be used when the cash balance for a - * customer in manual reconciliation mode received funds. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function applyCustomerBalance($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s/apply_customer_balance', $id), $params, $opts); - } - - /** - * A PaymentIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_capture, - * requires_confirmation, requires_action, or - * processing. - * - * Once canceled, no additional charges will be made by the PaymentIntent and any - * operations on the PaymentIntent will fail with an error. For PaymentIntents with - * status=’requires_capture’, the remaining - * amount_capturable will automatically be refunded. - * - * You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session - * instead - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s/cancel', $id), $params, $opts); - } - - /** - * Capture the funds of an existing uncaptured PaymentIntent when its status is - * requires_capture. - * - * Uncaptured PaymentIntents will be canceled a set number of days after they are - * created (7 by default). - * - * Learn more about separate authorization - * and capture. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function capture($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s/capture', $id), $params, $opts); - } - - /** - * Confirm that your customer intends to pay with current or provided payment - * method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. - * - * If the selected payment method requires additional authentication steps, the - * PaymentIntent will transition to the requires_action status and - * suggest additional actions via next_action. If payment fails, the - * PaymentIntent will transition to the requires_payment_method - * status. If payment succeeds, the PaymentIntent will transition to the - * succeeded status (or requires_capture, if - * capture_method is set to manual). - * - * If the confirmation_method is automatic, payment may - * be attempted using our client SDKs and - * the PaymentIntent’s client_secret. After - * next_actions are handled by the client, no additional confirmation - * is required to complete the payment. - * - * If the confirmation_method is manual, all payment - * attempts must be initiated using a secret key. If any actions are required for - * the payment, the PaymentIntent will return to the - * requires_confirmation state after those actions are completed. Your - * server needs to then explicitly re-confirm the PaymentIntent to initiate the - * next payment attempt. Read the expanded documentation to - * learn more about manual confirmation. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function confirm($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s/confirm', $id), $params, $opts); - } - - /** - * Creates a PaymentIntent object. - * - * After the PaymentIntent is created, attach a payment method and confirm to continue the payment. - * You can read more about the different payment flows available via the Payment - * Intents API here. - * - * When confirm=true is used during creation, it is equivalent to - * creating and confirming the PaymentIntent in the same call. You may use any - * parameters available in the confirm - * API when confirm=true is supplied. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/payment_intents', $params, $opts); - } - - /** - * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, the - * PaymentIntent’s status must be requires_capture and incremental_authorization_supported - * must be true. - * - * Incremental authorizations attempt to increase the authorized amount on your - * customer’s card to the new, higher amount provided. As with the - * initial authorization, incremental authorizations may be declined. A single - * PaymentIntent can call this endpoint multiple times to further increase the - * authorized amount. - * - * If the incremental authorization succeeds, the PaymentIntent object is returned - * with the updated amount. - * If the incremental authorization fails, a card_declined error is returned, and - * no fields on the PaymentIntent or Charge are updated. The PaymentIntent object - * remains capturable for the previously authorized amount. - * - * Each PaymentIntent can have a maximum of 10 incremental authorization attempts, - * including declines. Once captured, a PaymentIntent can no longer be incremented. - * - * Learn more about incremental - * authorizations. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function incrementAuthorization($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s/increment_authorization', $id), $params, $opts); - } - - /** - * Retrieves the details of a PaymentIntent that has previously been created. - * - * Client-side retrieval using a publishable key is allowed when the - * client_secret is provided in the query string. - * - * When retrieved with a publishable key, only a subset of properties will be - * returned. Please refer to the payment - * intent object reference for more details. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); - } - - /** - * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t use - * search in read-after-write flows where strict consistency is necessary. Under - * normal operating conditions, data is searchable in less than a minute. - * Occasionally, propagation of new or updated data can be up to an hour behind - * during outages. Search functionality is not available to merchants in India. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult<\Stripe\PaymentIntent> - */ - public function search($params = null, $opts = null) - { - return $this->requestSearchResult('get', '/v1/payment_intents/search', $params, $opts); - } - - /** - * Updates properties on a PaymentIntent object without confirming. - * - * Depending on which properties you update, you may need to confirm the - * PaymentIntent again. For example, updating the payment_method will - * always require you to confirm the PaymentIntent again. If you prefer to update - * and confirm at the same time, we recommend updating properties via the confirm API instead. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); - } - - /** - * Verifies microdeposits on a PaymentIntent object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function verifyMicrodeposits($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s/verify_microdeposits', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PaymentLinkService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PaymentLinkService.php deleted file mode 100644 index 902cee09..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PaymentLinkService.php +++ /dev/null @@ -1,89 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/payment_links', $params, $opts); - } - - /** - * When retrieving a payment link, there is an includable - * line_items property containing the first handful of those - * items. There is also a URL where you can retrieve the full (paginated) list of - * line items. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\PaymentLink> - */ - public function allLineItems($id, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/payment_links/%s/line_items', $id), $params, $opts); - } - - /** - * Creates a payment link. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentLink - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/payment_links', $params, $opts); - } - - /** - * Retrieve a payment link. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentLink - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/payment_links/%s', $id), $params, $opts); - } - - /** - * Updates a payment link. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentLink - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_links/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php deleted file mode 100644 index 1ddd282b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php +++ /dev/null @@ -1,130 +0,0 @@ -List a Customer’s - * PaymentMethods. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\PaymentMethod> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/payment_methods', $params, $opts); - } - - /** - * Attaches a PaymentMethod object to a Customer. - * - * To attach a new PaymentMethod to a customer for future payments, we recommend - * you use a SetupIntent or a PaymentIntent - * with setup_future_usage. - * These approaches will perform any necessary steps to ensure that the - * PaymentMethod can be used in a future payment. Using the - * /v1/payment_methods/:id/attach endpoint does not ensure that future - * payments can be made with the attached PaymentMethod. See Optimizing cards for future - * payments for more information about setting up future payments. - * - * To use this PaymentMethod as the default for invoice or subscription payments, - * set invoice_settings.default_payment_method, - * on the Customer to the PaymentMethod’s ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod - */ - public function attach($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_methods/%s/attach', $id), $params, $opts); - } - - /** - * Creates a PaymentMethod object. Read the Stripe.js - * reference to learn how to create PaymentMethods via Stripe.js. - * - * Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a - * payment immediately or the SetupIntent API to collect payment - * method details ahead of a future payment. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/payment_methods', $params, $opts); - } - - /** - * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is - * detached, it can no longer be used for a payment or re-attached to a Customer. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod - */ - public function detach($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_methods/%s/detach', $id), $params, $opts); - } - - /** - * Retrieves a PaymentMethod object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts); - } - - /** - * Updates a PaymentMethod object. A PaymentMethod must be attached a customer to - * be updated. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PayoutService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PayoutService.php deleted file mode 100644 index 4ca3561c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PayoutService.php +++ /dev/null @@ -1,127 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/payouts', $params, $opts); - } - - /** - * A previously created payout can be canceled if it has not yet been paid out. - * Funds will be refunded to your available balance. You may not cancel automatic - * Stripe payouts. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payouts/%s/cancel', $id), $params, $opts); - } - - /** - * To send funds to your own bank account, you create a new payout object. Your Stripe balance must be able to cover the payout amount, or - * you’ll receive an “Insufficient Funds” error. - * - * If your API key is in test mode, money won’t actually be sent, though everything - * else will occur as if in live mode. - * - * If you are creating a manual payout on a Stripe account that uses multiple - * payment source types, you’ll need to specify the source type balance that the - * payout should draw from. The balance object - * details available and pending amounts by source type. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/payouts', $params, $opts); - } - - /** - * Retrieves the details of an existing payout. Supply the unique payout ID from - * either a payout creation request or the payout list, and Stripe will return the - * corresponding payout information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/payouts/%s', $id), $params, $opts); - } - - /** - * Reverses a payout by debiting the destination bank account. Only payouts for - * connected accounts to US bank accounts may be reversed at this time. If the - * payout is in the pending status, - * /v1/payouts/:id/cancel should be used instead. - * - * By requesting a reversal via /v1/payouts/:id/reverse, you confirm - * that the authorized signatory of the selected bank account has authorized the - * debit on the bank account and that no other authorization is required. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout - */ - public function reverse($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payouts/%s/reverse', $id), $params, $opts); - } - - /** - * Updates the specified payout by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. This request accepts only the - * metadata as arguments. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payouts/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PlanService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PlanService.php deleted file mode 100644 index 6c0a8d47..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PlanService.php +++ /dev/null @@ -1,91 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/plans', $params, $opts); - } - - /** - * You can now model subscriptions more flexibly using the Prices - * API. It replaces the Plans API and is backwards compatible to simplify your - * migration. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Plan - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/plans', $params, $opts); - } - - /** - * Deleting plans means new subscribers can’t be added. Existing subscribers aren’t - * affected. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Plan - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/plans/%s', $id), $params, $opts); - } - - /** - * Retrieves the plan with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Plan - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/plans/%s', $id), $params, $opts); - } - - /** - * Updates the specified plan by setting the values of the parameters passed. Any - * parameters not provided are left unchanged. By design, you cannot change a - * plan’s ID, amount, currency, or billing cycle. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Plan - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/plans/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PriceService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PriceService.php deleted file mode 100644 index ef2b938d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PriceService.php +++ /dev/null @@ -1,92 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/prices', $params, $opts); - } - - /** - * Creates a new price for an existing product. The price can be recurring or - * one-time. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Price - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/prices', $params, $opts); - } - - /** - * Retrieves the price with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Price - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/prices/%s', $id), $params, $opts); - } - - /** - * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t use - * search in read-after-write flows where strict consistency is necessary. Under - * normal operating conditions, data is searchable in less than a minute. - * Occasionally, propagation of new or updated data can be up to an hour behind - * during outages. Search functionality is not available to merchants in India. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult<\Stripe\Price> - */ - public function search($params = null, $opts = null) - { - return $this->requestSearchResult('get', '/v1/prices/search', $params, $opts); - } - - /** - * Updates the specified price by setting the values of the parameters passed. Any - * parameters not provided are left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Price - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/prices/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ProductService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ProductService.php deleted file mode 100644 index 5eb6d82c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ProductService.php +++ /dev/null @@ -1,112 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/products', $params, $opts); - } - - /** - * Creates a new product object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Product - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/products', $params, $opts); - } - - /** - * Delete a product. Deleting a product is only possible if it has no prices - * associated with it. Additionally, deleting a product with type=good - * is only possible if it has no SKUs associated with it. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Product - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/products/%s', $id), $params, $opts); - } - - /** - * Retrieves the details of an existing product. Supply the unique product ID from - * either a product creation request or the product list, and Stripe will return - * the corresponding product information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Product - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/products/%s', $id), $params, $opts); - } - - /** - * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t use - * search in read-after-write flows where strict consistency is necessary. Under - * normal operating conditions, data is searchable in less than a minute. - * Occasionally, propagation of new or updated data can be up to an hour behind - * during outages. Search functionality is not available to merchants in India. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult<\Stripe\Product> - */ - public function search($params = null, $opts = null) - { - return $this->requestSearchResult('get', '/v1/products/search', $params, $opts); - } - - /** - * Updates the specific product by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Product - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/products/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php deleted file mode 100644 index 17461b4b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/promotion_codes', $params, $opts); - } - - /** - * A promotion code points to a coupon. You can optionally restrict the code to a - * specific customer, redemption limit, and expiration date. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PromotionCode - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/promotion_codes', $params, $opts); - } - - /** - * Retrieves the promotion code with the given ID. In order to retrieve a promotion - * code by the customer-facing code use list with the desired - * code. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PromotionCode - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts); - } - - /** - * Updates the specified promotion code by setting the values of the parameters - * passed. Most fields are, by design, not editable. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PromotionCode - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/QuoteService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/QuoteService.php deleted file mode 100644 index d6d20c0b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/QuoteService.php +++ /dev/null @@ -1,177 +0,0 @@ -request('post', $this->buildPath('/v1/quotes/%s/accept', $id), $params, $opts); - } - - /** - * Returns a list of your quotes. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Quote> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/quotes', $params, $opts); - } - - /** - * When retrieving a quote, there is an includable computed.upfront.line_items - * property containing the first handful of those items. There is also a URL where - * you can retrieve the full (paginated) list of upfront line items. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Quote> - */ - public function allComputedUpfrontLineItems($id, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/computed_upfront_line_items', $id), $params, $opts); - } - - /** - * When retrieving a quote, there is an includable line_items - * property containing the first handful of those items. There is also a URL where - * you can retrieve the full (paginated) list of line items. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Quote> - */ - public function allLineItems($id, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/line_items', $id), $params, $opts); - } - - /** - * Cancels the quote. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Quote - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/quotes/%s/cancel', $id), $params, $opts); - } - - /** - * A quote models prices and services for a customer. Default options for - * header, description, footer, and - * expires_at can be set in the dashboard via the quote template. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Quote - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/quotes', $params, $opts); - } - - /** - * Finalizes the quote. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Quote - */ - public function finalizeQuote($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts); - } - - /** - * Retrieves the quote with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Quote - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/quotes/%s', $id), $params, $opts); - } - - /** - * A quote models prices and services for a customer. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Quote - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/quotes/%s', $id), $params, $opts); - } - - /** - * Download the PDF for a finalized quote. - * - * @param string $id - * @param callable $readBodyChunkCallable - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - */ - public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null) - { - $opts = \Stripe\Util\RequestOptions::parse($opts); - if (!isset($opts->apiBase)) { - $opts->apiBase = $this->getClient()->getFilesBase(); - } - $this->requestStream('get', $this->buildPath('/v1/quotes/%s/pdf', $id), $readBodyChunkCallable, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php deleted file mode 100644 index be119b4c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/radar/early_fraud_warnings', $params, $opts); - } - - /** - * Retrieves the details of an early fraud warning that has previously been - * created. - * - * Please refer to the early fraud - * warning object reference for more details. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\EarlyFraudWarning - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/radar/early_fraud_warnings/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php deleted file mode 100644 index b093c671..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ - private static $classMap = [ - 'earlyFraudWarnings' => EarlyFraudWarningService::class, - 'valueListItems' => ValueListItemService::class, - 'valueLists' => ValueListService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php deleted file mode 100644 index b9da3dd8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php +++ /dev/null @@ -1,74 +0,0 @@ -ValueListItem objects. The objects are sorted in - * descending order by creation date, with the most recently created object - * appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Radar\ValueListItem> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/radar/value_list_items', $params, $opts); - } - - /** - * Creates a new ValueListItem object, which is added to the specified - * parent value list. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueListItem - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/radar/value_list_items', $params, $opts); - } - - /** - * Deletes a ValueListItem object, removing it from its parent value - * list. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueListItem - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts); - } - - /** - * Retrieves a ValueListItem object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueListItem - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php deleted file mode 100644 index 70d9b486..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php +++ /dev/null @@ -1,93 +0,0 @@ -ValueList objects. The objects are sorted in - * descending order by creation date, with the most recently created object - * appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Radar\ValueList> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/radar/value_lists', $params, $opts); - } - - /** - * Creates a new ValueList object, which can then be referenced in - * rules. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueList - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/radar/value_lists', $params, $opts); - } - - /** - * Deletes a ValueList object, also deleting any items contained - * within the value list. To be deleted, a value list must not be referenced in any - * rules. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueList - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); - } - - /** - * Retrieves a ValueList object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueList - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); - } - - /** - * Updates a ValueList object by setting the values of the parameters - * passed. Any parameters not provided will be left unchanged. Note that - * item_type is immutable. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueList - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/RefundService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/RefundService.php deleted file mode 100644 index 772c0f6e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/RefundService.php +++ /dev/null @@ -1,95 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/refunds', $params, $opts); - } - - /** - * Cancels a refund with a status of requires_action. - * - * Refunds in other states cannot be canceled, and only refunds for payment methods - * that require customer action will enter the requires_action state. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Refund - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/refunds/%s/cancel', $id), $params, $opts); - } - - /** - * Create a refund. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Refund - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/refunds', $params, $opts); - } - - /** - * Retrieves the details of an existing refund. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Refund - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/refunds/%s', $id), $params, $opts); - } - - /** - * Updates the specified refund by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * This request only accepts metadata as an argument. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Refund - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/refunds/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php deleted file mode 100644 index b62898fd..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/reporting/report_runs', $params, $opts); - } - - /** - * Creates a new object and begin running the report. (Certain report types require - * a live-mode API key.). - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Reporting\ReportRun - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/reporting/report_runs', $params, $opts); - } - - /** - * Retrieves the details of an existing Report Run. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Reporting\ReportRun - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/reporting/report_runs/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php deleted file mode 100644 index 7fa50382..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/reporting/report_types', $params, $opts); - } - - /** - * Retrieves the details of a Report Type. (Certain report types require a live-mode API key.). - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Reporting\ReportType - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/reporting/report_types/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php deleted file mode 100644 index 7832e917..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - private static $classMap = [ - 'reportRuns' => ReportRunService::class, - 'reportTypes' => ReportTypeService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ReviewService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ReviewService.php deleted file mode 100644 index 3bcd325b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ReviewService.php +++ /dev/null @@ -1,58 +0,0 @@ -Review objects that have open set to - * true. The objects are sorted in descending order by creation date, - * with the most recently created object appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Review> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/reviews', $params, $opts); - } - - /** - * Approves a Review object, closing it and removing it from the list - * of reviews. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Review - */ - public function approve($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/reviews/%s/approve', $id), $params, $opts); - } - - /** - * Retrieves a Review object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Review - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/reviews/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php deleted file mode 100644 index 8657441e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/setup_attempts', $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php deleted file mode 100644 index 3dea24cb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php +++ /dev/null @@ -1,143 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/setup_intents', $params, $opts); - } - - /** - * A SetupIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_confirmation, or - * requires_action. - * - * Once canceled, setup is abandoned and any operations on the SetupIntent will - * fail with an error. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/setup_intents/%s/cancel', $id), $params, $opts); - } - - /** - * Confirm that your customer intends to set up the current or provided payment - * method. For example, you would confirm a SetupIntent when a customer hits the - * “Save” button on a payment method management page on your website. - * - * If the selected payment method does not require any additional steps from the - * customer, the SetupIntent will transition to the succeeded status. - * - * Otherwise, it will transition to the requires_action status and - * suggest additional actions via next_action. If setup fails, the - * SetupIntent will transition to the requires_payment_method status. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function confirm($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/setup_intents/%s/confirm', $id), $params, $opts); - } - - /** - * Creates a SetupIntent object. - * - * After the SetupIntent is created, attach a payment method and confirm to collect any required - * permissions to charge the payment method later. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/setup_intents', $params, $opts); - } - - /** - * Retrieves the details of a SetupIntent that has previously been created. - * - * Client-side retrieval using a publishable key is allowed when the - * client_secret is provided in the query string. - * - * When retrieved with a publishable key, only a subset of properties will be - * returned. Please refer to the SetupIntent - * object reference for more details. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); - } - - /** - * Updates a SetupIntent object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); - } - - /** - * Verifies microdeposits on a SetupIntent object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function verifyMicrodeposits($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/setup_intents/%s/verify_microdeposits', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ShippingRateService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ShippingRateService.php deleted file mode 100644 index d141e484..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/ShippingRateService.php +++ /dev/null @@ -1,70 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/shipping_rates', $params, $opts); - } - - /** - * Creates a new shipping rate object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ShippingRate - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/shipping_rates', $params, $opts); - } - - /** - * Returns the shipping rate object with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ShippingRate - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/shipping_rates/%s', $id), $params, $opts); - } - - /** - * Updates an existing shipping rate object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ShippingRate - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/shipping_rates/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php deleted file mode 100644 index 0fa8cd9c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/sigma/scheduled_query_runs', $params, $opts); - } - - /** - * Retrieves the details of an scheduled query run. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Sigma\ScheduledQueryRun - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/sigma/scheduled_query_runs/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php deleted file mode 100644 index 356750f4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ - private static $classMap = [ - 'scheduledQueryRuns' => ScheduledQueryRunService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SkuService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SkuService.php deleted file mode 100644 index c00194ea..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SkuService.php +++ /dev/null @@ -1,95 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/skus', $params, $opts); - } - - /** - * Creates a new SKU associated with a product. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SKU - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/skus', $params, $opts); - } - - /** - * Delete a SKU. Deleting a SKU is only possible until it has been used in an - * order. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SKU - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/skus/%s', $id), $params, $opts); - } - - /** - * Retrieves the details of an existing SKU. Supply the unique SKU identifier from - * either a SKU creation request or from the product, and Stripe will return the - * corresponding SKU information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SKU - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/skus/%s', $id), $params, $opts); - } - - /** - * Updates the specific SKU by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * Note that a SKU’s attributes are not editable. Instead, you would - * need to deactivate the existing SKU and create a new one with the new attribute - * values. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SKU - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/skus/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SourceService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SourceService.php deleted file mode 100644 index c6cc0596..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SourceService.php +++ /dev/null @@ -1,110 +0,0 @@ -request('get', $this->buildPath('/v1/sources/%s/source_transactions', $id), $params, $opts); - } - - /** - * Creates a new source object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/sources', $params, $opts); - } - - /** - * Delete a specified source for a given customer. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source - */ - public function detach($parentId, $id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves an existing source object. Supply the unique source ID from a source - * creation request and Stripe will return the corresponding up-to-date source - * object information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/sources/%s', $id), $params, $opts); - } - - /** - * Updates the specified source by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * This request accepts the metadata and owner as - * arguments. It is also possible to update type specific information for selected - * payment methods. Please refer to our payment method - * guides for more detail. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/sources/%s', $id), $params, $opts); - } - - /** - * Verify a given source. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source - */ - public function verify($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/sources/%s/verify', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php deleted file mode 100644 index e18c8de4..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php +++ /dev/null @@ -1,151 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/subscription_items', $params, $opts); - } - - /** - * For the specified subscription item, returns a list of summary objects. Each - * object in the list provides usage information that’s been summarized from - * multiple usage records and over a subscription billing period (e.g., 15 usage - * records in the month of September). - * - * The list is sorted in reverse-chronological order (newest first). The first list - * item represents the most current usage period that hasn’t ended yet. Since new - * usage records can still be added, the returned summary information for the - * subscription item’s ID should be seen as unstable until the subscription billing - * period ends. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\UsageRecordSummary> - */ - public function allUsageRecordSummaries($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/subscription_items/%s/usage_record_summaries', $parentId), $params, $opts); - } - - /** - * Adds a new item to an existing subscription. No existing items will be changed - * or replaced. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionItem - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/subscription_items', $params, $opts); - } - - /** - * Creates a usage record for a specified subscription item and date, and fills it - * with a quantity. - * - * Usage records provide quantity information that Stripe uses to - * track how much a customer is using your service. With usage information and the - * pricing model set up by the metered - * billing plan, Stripe helps you send accurate invoices to your customers. - * - * The default calculation for usage is to add up all the quantity - * values of the usage records within a billing period. You can change this default - * behavior with the billing plan’s aggregate_usage parameter. When - * there is more than one usage record with the same timestamp, Stripe adds the - * quantity values together. In most cases, this is the desired - * resolution, however, you can change this behavior with the action - * parameter. - * - * The default pricing model for metered billing is per-unit pricing. - * For finer granularity, you can configure metered billing to have a tiered pricing - * model. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\UsageRecord - */ - public function createUsageRecord($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_items/%s/usage_records', $parentId), $params, $opts); - } - - /** - * Deletes an item from the subscription. Removing a subscription item from a - * subscription will not cancel the subscription. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionItem - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); - } - - /** - * Retrieves the subscription item with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionItem - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); - } - - /** - * Updates the plan or quantity of an item on a current subscription. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionItem - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php deleted file mode 100644 index 42aaf6bb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php +++ /dev/null @@ -1,113 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/subscription_schedules', $params, $opts); - } - - /** - * Cancels a subscription schedule and its associated subscription immediately (if - * the subscription schedule has an active subscription). A subscription schedule - * can only be canceled if its status is not_started or - * active. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s/cancel', $id), $params, $opts); - } - - /** - * Creates a new subscription schedule object. Each customer can have up to 500 - * active or scheduled subscriptions. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/subscription_schedules', $params, $opts); - } - - /** - * Releases the subscription schedule immediately, which will stop scheduling of - * its phases, but leave any existing subscription in place. A schedule can only be - * released if its status is not_started or active. If - * the subscription schedule is currently associated with a subscription, releasing - * it will remove its subscription property and set the subscription’s - * ID to the released_subscription property. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule - */ - public function release($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s/release', $id), $params, $opts); - } - - /** - * Retrieves the details of an existing subscription schedule. You only need to - * supply the unique subscription schedule identifier that was returned upon - * subscription schedule creation. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts); - } - - /** - * Updates an existing subscription schedule. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SubscriptionService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SubscriptionService.php deleted file mode 100644 index f81310c1..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/SubscriptionService.php +++ /dev/null @@ -1,155 +0,0 @@ -status=canceled. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Subscription> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/subscriptions', $params, $opts); - } - - /** - * Cancels a customer’s subscription immediately. The customer will not be charged - * again for the subscription. - * - * Note, however, that any pending invoice items that you’ve created will still be - * charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel - * at the end of the period, any pending prorations will also be left in place and - * collected at the end of the period. But if the subscription is set to cancel - * immediately, pending prorations will be removed. - * - * By default, upon subscription cancellation, Stripe will stop automatic - * collection of all finalized invoices for the customer. This is intended to - * prevent unexpected payment attempts after the customer has canceled a - * subscription. However, you can resume automatic collection of the invoices - * manually after subscription cancellation to have us proceed. Or, you could check - * for unpaid invoices before allowing the customer to cancel the subscription at - * all. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); - } - - /** - * Creates a new subscription on an existing customer. Each customer can have up to - * 500 active or scheduled subscriptions. - * - * When you create a subscription with - * collection_method=charge_automatically, the first invoice is - * finalized as part of the request. The payment_behavior parameter - * determines the exact behavior of the initial payment. - * - * To start subscriptions where the first invoice always begins in a - * draft status, use subscription - * schedules instead. Schedules provide the flexibility to model more complex - * billing configurations that change over time. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/subscriptions', $params, $opts); - } - - /** - * Removes the currently applied discount on a subscription. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription - */ - public function deleteDiscount($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/subscriptions/%s/discount', $id), $params, $opts); - } - - /** - * Retrieves the subscription with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); - } - - /** - * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t use - * search in read-after-write flows where strict consistency is necessary. Under - * normal operating conditions, data is searchable in less than a minute. - * Occasionally, propagation of new or updated data can be up to an hour behind - * during outages. Search functionality is not available to merchants in India. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult<\Stripe\Subscription> - */ - public function search($params = null, $opts = null) - { - return $this->requestSearchResult('get', '/v1/subscriptions/search', $params, $opts); - } - - /** - * Updates an existing subscription on a customer to match the specified - * parameters. When changing plans or quantities, we will optionally prorate the - * price we charge next month to make up for any price changes. To preview how the - * proration will be calculated, use the upcoming - * invoice endpoint. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php deleted file mode 100644 index fd167a10..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php +++ /dev/null @@ -1,41 +0,0 @@ -all tax codes - * available to add to Products in order to allow specific tax calculations. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\TaxCode> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/tax_codes', $params, $opts); - } - - /** - * Retrieves the details of an existing tax code. Supply the unique tax code ID and - * Stripe will return the corresponding tax code information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxCode - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/tax_codes/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TaxRateService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TaxRateService.php deleted file mode 100644 index 0d67eec3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TaxRateService.php +++ /dev/null @@ -1,71 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/tax_rates', $params, $opts); - } - - /** - * Creates a new tax rate. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxRate - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/tax_rates', $params, $opts); - } - - /** - * Retrieves a tax rate with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxRate - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts); - } - - /** - * Updates an existing tax rate. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxRate - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/ConfigurationService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/ConfigurationService.php deleted file mode 100644 index 97c7c275..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/ConfigurationService.php +++ /dev/null @@ -1,86 +0,0 @@ -Configuration objects. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Terminal\Configuration> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/terminal/configurations', $params, $opts); - } - - /** - * Creates a new Configuration object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Configuration - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/terminal/configurations', $params, $opts); - } - - /** - * Deletes a Configuration object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Configuration - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts); - } - - /** - * Retrieves a Configuration object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Configuration - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts); - } - - /** - * Updates a new Configuration object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Configuration - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php deleted file mode 100644 index 7b25b231..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php +++ /dev/null @@ -1,25 +0,0 @@ -request('post', '/v1/terminal/connection_tokens', $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php deleted file mode 100644 index 74a776eb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php +++ /dev/null @@ -1,89 +0,0 @@ -Location objects. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Terminal\Location> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/terminal/locations', $params, $opts); - } - - /** - * Creates a new Location object. For further details, including which - * address fields are required in each country, see the Manage locations guide. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Location - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/terminal/locations', $params, $opts); - } - - /** - * Deletes a Location object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Location - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); - } - - /** - * Retrieves a Location object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Location - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); - } - - /** - * Updates a Location object by setting the values of the parameters - * passed. Any parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Location - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php deleted file mode 100644 index ae855595..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php +++ /dev/null @@ -1,151 +0,0 @@ -Reader objects. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\Terminal\Reader> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/terminal/readers', $params, $opts); - } - - /** - * Cancels the current reader action. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function cancelAction($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/cancel_action', $id), $params, $opts); - } - - /** - * Creates a new Reader object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/terminal/readers', $params, $opts); - } - - /** - * Deletes a Reader object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); - } - - /** - * Initiates a payment flow on a Reader. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function processPaymentIntent($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/process_payment_intent', $id), $params, $opts); - } - - /** - * Initiates a setup intent flow on a Reader. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function processSetupIntent($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/process_setup_intent', $id), $params, $opts); - } - - /** - * Retrieves a Reader object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); - } - - /** - * Sets reader display to show cart details. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function setReaderDisplay($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/set_reader_display', $id), $params, $opts); - } - - /** - * Updates a Reader object by setting the values of the parameters - * passed. Any parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php deleted file mode 100644 index f095124c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ - private static $classMap = [ - 'configurations' => ConfigurationService::class, - 'connectionTokens' => ConnectionTokenService::class, - 'locations' => LocationService::class, - 'readers' => ReaderService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php deleted file mode 100644 index de0e4d10..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php +++ /dev/null @@ -1,24 +0,0 @@ -requires_action. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Refund - */ - public function expire($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/test_helpers/refunds/%s/expire', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php deleted file mode 100644 index 2eb4de49..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php +++ /dev/null @@ -1,25 +0,0 @@ -request('post', $this->buildPath('/v1/test_helpers/terminal/readers/%s/present_payment_method', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php deleted file mode 100644 index 153ebe0d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ - private static $classMap = [ - 'readers' => ReaderService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php deleted file mode 100644 index a4eee8c3..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php +++ /dev/null @@ -1,87 +0,0 @@ -Ready. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TestHelpers\TestClock - */ - public function advance($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/test_helpers/test_clocks/%s/advance', $id), $params, $opts); - } - - /** - * Returns a list of your test clocks. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\TestHelpers\TestClock> - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/test_helpers/test_clocks', $params, $opts); - } - - /** - * Creates a new test clock that can be attached to new customers and quotes. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TestHelpers\TestClock - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/test_helpers/test_clocks', $params, $opts); - } - - /** - * Deletes a test clock. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TestHelpers\TestClock - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/test_helpers/test_clocks/%s', $id), $params, $opts); - } - - /** - * Retrieves a test clock. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TestHelpers\TestClock - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/test_helpers/test_clocks/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php deleted file mode 100644 index aaf82751..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ - private static $classMap = [ - 'refunds' => RefundService::class, - 'terminal' => Terminal\TerminalServiceFactory::class, - 'testClocks' => TestClockService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TokenService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TokenService.php deleted file mode 100644 index 1c72759f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TokenService.php +++ /dev/null @@ -1,42 +0,0 @@ -Custom - * account. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Token - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/tokens', $params, $opts); - } - - /** - * Retrieves the token with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Token - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/tokens/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TopupService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TopupService.php deleted file mode 100644 index bd486b9e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TopupService.php +++ /dev/null @@ -1,89 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/topups', $params, $opts); - } - - /** - * Cancels a top-up. Only pending top-ups can be canceled. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Topup - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/topups/%s/cancel', $id), $params, $opts); - } - - /** - * Top up the balance of an account. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Topup - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/topups', $params, $opts); - } - - /** - * Retrieves the details of a top-up that has previously been created. Supply the - * unique top-up ID that was returned from your previous request, and Stripe will - * return the corresponding top-up information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Topup - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/topups/%s', $id), $params, $opts); - } - - /** - * Updates the metadata of a top-up. Other top-up details are not editable by - * design. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Topup - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/topups/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TransferService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TransferService.php deleted file mode 100644 index 4a78545e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/TransferService.php +++ /dev/null @@ -1,175 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/transfers', $params, $opts); - } - - /** - * You can see a list of the reversals belonging to a specific transfer. Note that - * the 10 most recent reversals are always available by default on the transfer - * object. If you need more than those 10, you can use this API method and the - * limit and starting_after parameters to page through - * additional reversals. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\TransferReversal> - */ - public function allReversals($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); - } - - /** - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/transfers/%s/cancel', $id), $params, $opts); - } - - /** - * To send funds from your Stripe account to a connected account, you create a new - * transfer object. Your Stripe balance must be able to - * cover the transfer amount, or you’ll receive an “Insufficient Funds” error. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/transfers', $params, $opts); - } - - /** - * When you create a new reversal, you must specify a transfer to create it on. - * - * When reversing transfers, you can optionally reverse part of the transfer. You - * can do so as many times as you wish until the entire transfer has been reversed. - * - * Once entirely reversed, a transfer can’t be reversed again. This method will - * return an error when called on an already-reversed transfer, or when trying to - * reverse more money than is left on a transfer. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public function createReversal($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); - } - - /** - * Retrieves the details of an existing transfer. Supply the unique transfer ID - * from either a transfer creation request or the transfer list, and Stripe will - * return the corresponding transfer information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/transfers/%s', $id), $params, $opts); - } - - /** - * By default, you can see the 10 most recent reversals stored directly on the - * transfer object, but you can also retrieve details about a specific reversal - * stored on the transfer. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public function retrieveReversal($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates the specified transfer by setting the values of the parameters passed. - * Any parameters not provided will be left unchanged. - * - * This request accepts only metadata as an argument. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/transfers/%s', $id), $params, $opts); - } - - /** - * Updates the specified reversal by setting the values of the parameters passed. - * Any parameters not provided will be left unchanged. - * - * This request only accepts metadata and description as arguments. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public function updateReversal($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php deleted file mode 100644 index baa15bd2..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php +++ /dev/null @@ -1,97 +0,0 @@ - - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/webhook_endpoints', $params, $opts); - } - - /** - * A webhook endpoint must have a url and a list of - * enabled_events. You may optionally specify the Boolean - * connect parameter. If set to true, then a Connect webhook endpoint - * that notifies the specified url about events from all connected - * accounts is created; otherwise an account webhook endpoint that notifies the - * specified url only about events from your account is created. You - * can also create webhook endpoints in the webhooks settings - * section of the Dashboard. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\WebhookEndpoint - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/webhook_endpoints', $params, $opts); - } - - /** - * You can also delete webhook endpoints via the webhook endpoint - * management page of the Stripe dashboard. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\WebhookEndpoint - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); - } - - /** - * Retrieves the webhook endpoint with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\WebhookEndpoint - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); - } - - /** - * Updates the webhook endpoint. You may edit the url, the list of - * enabled_events, and the status of your endpoint. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\WebhookEndpoint - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SetupAttempt.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SetupAttempt.php deleted file mode 100644 index 6c83b686..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SetupAttempt.php +++ /dev/null @@ -1,32 +0,0 @@ -application on the SetupIntent at the time of this confirmation. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer The value of customer on the SetupIntent at the time of this confirmation. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Account $on_behalf_of The value of on_behalf_of on the SetupIntent at the time of this confirmation. - * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupAttempt. - * @property \Stripe\StripeObject $payment_method_details - * @property null|\Stripe\ErrorObject $setup_error The error encountered during this attempt to confirm the SetupIntent, if any. - * @property string|\Stripe\SetupIntent $setup_intent ID of the SetupIntent that this attempt belongs to. - * @property string $status Status of this SetupAttempt, one of requires_confirmation, requires_action, processing, succeeded, failed, or abandoned. - * @property string $usage The value of usage on the SetupIntent at the time of this confirmation, one of off_session or on_session. - */ -class SetupAttempt extends ApiResource -{ - const OBJECT_NAME = 'setup_attempt'; - - use ApiOperations\All; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SetupIntent.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SetupIntent.php deleted file mode 100644 index 9a47a1fa..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SetupIntent.php +++ /dev/null @@ -1,131 +0,0 @@ -PaymentIntents to drive - * the payment flow. - * - * Create a SetupIntent as soon as you're ready to collect your customer's payment - * credentials. Do not maintain long-lived, unconfirmed SetupIntents as they may no - * longer be valid. The SetupIntent then transitions through multiple statuses as - * it guides you through the setup process. - * - * Successful SetupIntents result in payment credentials that are optimized for - * future payments. For example, cardholders in certain regions may need to be - * run through Strong Customer - * Authentication at the time of payment method collection in order to - * streamline later off-session payments. - * If the SetupIntent is used with a Customer, - * upon success, it will automatically attach the resulting payment method to that - * Customer. We recommend using SetupIntents or setup_future_usage - * on PaymentIntents to save payment methods in order to prevent saving invalid or - * unoptimized payment methods. - * - * By using SetupIntents, you ensure that your customers experience the minimum set - * of required friction, even as regulations change over time. - * - * Related guide: Setup - * Intents API. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the SetupIntent. - * @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate. - * @property null|string $client_secret

    The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.

    The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

    - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer

    ID of the Customer this SetupIntent belongs to, if one exists.

    If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

    - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\ErrorObject $last_setup_error The error encountered in the previous SetupIntent confirmation. - * @property null|string|\Stripe\SetupAttempt $latest_attempt The most recent SetupAttempt for this SetupIntent. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Mandate $mandate ID of the multi use Mandate generated by the SetupIntent. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended. - * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent. - * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this SetupIntent. - * @property string[] $payment_method_types The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. - * @property null|string|\Stripe\Mandate $single_use_mandate ID of the single_use Mandate generated by the SetupIntent. - * @property string $status Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded. - * @property string $usage

    Indicates how the payment method is intended to be used in the future.

    Use on_session if you intend to only reuse the payment method when the customer is in your checkout flow. Use off_session if your customer may or may not be in your checkout flow. If not provided, this value defaults to off_session.

    - */ -class SetupIntent extends ApiResource -{ - const OBJECT_NAME = 'setup_intent'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const STATUS_CANCELED = 'canceled'; - const STATUS_PROCESSING = 'processing'; - const STATUS_REQUIRES_ACTION = 'requires_action'; - const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; - const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; - const STATUS_SUCCEEDED = 'succeeded'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent the canceled setup intent - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent the confirmed setup intent - */ - public function confirm($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/confirm'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent the verified setup intent - */ - public function verifyMicrodeposits($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/verify_microdeposits'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ShippingRate.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ShippingRate.php deleted file mode 100644 index e63daf1a..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ShippingRate.php +++ /dev/null @@ -1,40 +0,0 @@ -Checkout Sessions - * to collect shipping costs. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $active Whether the shipping rate can be used for new purchases. Defaults to true. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $delivery_estimate The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. - * @property null|string $display_name The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. - * @property \Stripe\StripeObject $fixed_amount - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $tax_behavior Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. - * @property null|string|\Stripe\TaxCode $tax_code A tax code ID. The Shipping tax code is txcd_92010001. - * @property string $type The type of calculation to use on the shipping rate. Can only be fixed_amount for now. - */ -class ShippingRate extends ApiResource -{ - const OBJECT_NAME = 'shipping_rate'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive'; - const TAX_BEHAVIOR_INCLUSIVE = 'inclusive'; - const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified'; - - const TYPE_FIXED_AMOUNT = 'fixed_amount'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php deleted file mode 100644 index b109dde7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php +++ /dev/null @@ -1,37 +0,0 @@ -scheduled - * a Sigma query, you'll receive a - * sigma.scheduled_query_run.created webhook each time the query runs. - * The webhook contains a ScheduledQueryRun object, which you can use - * to retrieve the query results. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property int $data_load_time When the query was run, Sigma contained a snapshot of your Stripe data at this time. - * @property \Stripe\StripeObject $error - * @property null|\Stripe\File $file The file object representing the results of the query. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $result_available_until Time at which the result expires and is no longer available for download. - * @property string $sql SQL for the query. - * @property string $status The query's execution status, which will be completed for successful runs, and canceled, failed, or timed_out otherwise. - * @property string $title Title of the query. - */ -class ScheduledQueryRun extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'scheduled_query_run'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; - - public static function classUrl() - { - return '/v1/sigma/scheduled_query_runs'; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SingletonApiResource.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SingletonApiResource.php deleted file mode 100644 index a182ca95..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SingletonApiResource.php +++ /dev/null @@ -1,40 +0,0 @@ -refresh(); - - return $instance; - } - - /** - * @return string the endpoint associated with this singleton class - */ - public static function classUrl() - { - // Replace dots with slashes for namespaced resources, e.g. if the object's name is - // "foo.bar", then its URL will be "/v1/foo/bar". - - /** @phpstan-ignore-next-line */ - $base = \str_replace('.', '/', static::OBJECT_NAME); - - return "/v1/{$base}"; - } - - /** - * @return string the endpoint associated with this singleton API resource - */ - public function instanceUrl() - { - return static::classUrl(); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Source.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Source.php deleted file mode 100644 index 75e75941..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Source.php +++ /dev/null @@ -1,168 +0,0 @@ -Source objects allow you to accept a variety of payment methods. - * They represent a customer's payment instrument, and can be used with the Stripe - * API just like a Card object: once chargeable, they can be charged, - * or can be attached to customers. - * - * Related guides: Sources API and Sources & Customers. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $ach_credit_transfer - * @property \Stripe\StripeObject $ach_debit - * @property \Stripe\StripeObject $acss_debit - * @property \Stripe\StripeObject $alipay - * @property null|int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. - * @property \Stripe\StripeObject $au_becs_debit - * @property \Stripe\StripeObject $bancontact - * @property \Stripe\StripeObject $card - * @property \Stripe\StripeObject $card_present - * @property string $client_secret The client secret of the source. Used for client-side retrieval using a publishable key. - * @property \Stripe\StripeObject $code_verification - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $currency Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources. - * @property string $customer The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. - * @property \Stripe\StripeObject $eps - * @property string $flow The authentication flow of the source. flow is one of redirect, receiver, code_verification, none. - * @property \Stripe\StripeObject $giropay - * @property \Stripe\StripeObject $ideal - * @property \Stripe\StripeObject $klarna - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $multibanco - * @property null|\Stripe\StripeObject $owner Information about the owner of the payment instrument that may be used or required by particular source types. - * @property \Stripe\StripeObject $p24 - * @property \Stripe\StripeObject $receiver - * @property \Stripe\StripeObject $redirect - * @property \Stripe\StripeObject $sepa_credit_transfer - * @property \Stripe\StripeObject $sepa_debit - * @property \Stripe\StripeObject $sofort - * @property \Stripe\StripeObject $source_order - * @property null|string $statement_descriptor Extra information about a source. This will appear on your customer's statement every time you charge the source. - * @property string $status The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge. - * @property \Stripe\StripeObject $three_d_secure - * @property string $type The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used. - * @property null|string $usage Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. - * @property \Stripe\StripeObject $wechat - */ -class Source extends ApiResource -{ - const OBJECT_NAME = 'source'; - - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const FLOW_CODE_VERIFICATION = 'code_verification'; - const FLOW_NONE = 'none'; - const FLOW_RECEIVER = 'receiver'; - const FLOW_REDIRECT = 'redirect'; - - const STATUS_CANCELED = 'canceled'; - const STATUS_CHARGEABLE = 'chargeable'; - const STATUS_CONSUMED = 'consumed'; - const STATUS_FAILED = 'failed'; - const STATUS_PENDING = 'pending'; - - const USAGE_REUSABLE = 'reusable'; - const USAGE_SINGLE_USE = 'single_use'; - - use ApiOperations\NestedResource; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\UnexpectedValueException if the source is not attached to a customer - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source the detached source - */ - public function detach($params = null, $opts = null) - { - self::_validateParams($params); - - $id = $this['id']; - if (!$id) { - $class = static::class; - $msg = "Could not determine which URL to request: {$class} instance " - . "has invalid ID: {$id}"; - - throw new Exception\UnexpectedValueException($msg, null); - } - - if ($this['customer']) { - $base = Customer::classUrl(); - $parentExtn = \urlencode(Util\Util::utf8($this['customer'])); - $extn = \urlencode(Util\Util::utf8($id)); - $url = "{$base}/{$parentExtn}/sources/{$extn}"; - - list($response, $opts) = $this->_request('delete', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - $message = 'This source object does not appear to be currently attached ' - . 'to a customer object.'; - - throw new Exception\UnexpectedValueException($message); - } - - /** - * @deprecated sourceTransactions is deprecated. Please use Source::allSourceTransactions instead. - * - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of source transactions - */ - public function sourceTransactions($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/source_transactions'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param string $id - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of source transactions - */ - public static function allSourceTransactions($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, '/source_transactions', $params, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source the verified source - */ - public function verify($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/verify'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SourceTransaction.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SourceTransaction.php deleted file mode 100644 index 281f2a71..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SourceTransaction.php +++ /dev/null @@ -1,20 +0,0 @@ -coreServiceFactory) { - $this->coreServiceFactory = new \Stripe\Service\CoreServiceFactory($this); - } - - return $this->coreServiceFactory->__get($name); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/StripeClientInterface.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/StripeClientInterface.php deleted file mode 100644 index d5a8806f..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/StripeClientInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - "old_value"] - * - * If we update the object with `metadata[new]=new_value`, the server side - * object now has *both* fields: - * - * metadata = ["old" => "old_value", "new" => "new_value"] - * - * This is okay in itself because usually users will want to treat it as - * additive: - * - * $obj->metadata["new"] = "new_value"; - * $obj->save(); - * - * However, in other cases, they may want to replace the entire existing - * contents: - * - * $obj->metadata = ["new" => "new_value"]; - * $obj->save(); - * - * This is where things get a little bit tricky because in order to clear - * any old keys that may have existed, we actually have to send an explicit - * empty string to the server. So the operation above would have to send - * this form to get the intended behavior: - * - * metadata[old]=&metadata[new]=new_value - * - * This method allows us to track which parameters are considered additive, - * and lets us behave correctly where appropriate when serializing - * parameters to be sent. - * - * @return Util\Set Set of additive parameters - */ - public static function getAdditiveParams() - { - static $additiveParams = null; - if (null === $additiveParams) { - // Set `metadata` as additive so that when it's set directly we remember - // to clear keys that may have been previously set by sending empty - // values for them. - // - // It's possible that not every object has `metadata`, but having this - // option set when there is no `metadata` field is not harmful. - $additiveParams = new Util\Set([ - 'metadata', - ]); - } - - return $additiveParams; - } - - public function __construct($id = null, $opts = null) - { - list($id, $this->_retrieveOptions) = Util\Util::normalizeId($id); - $this->_opts = Util\RequestOptions::parse($opts); - $this->_originalValues = []; - $this->_values = []; - $this->_unsavedValues = new Util\Set(); - $this->_transientValues = new Util\Set(); - if (null !== $id) { - $this->_values['id'] = $id; - } - } - - // Standard accessor magic methods - public function __set($k, $v) - { - if (static::getPermanentAttributes()->includes($k)) { - throw new Exception\InvalidArgumentException( - "Cannot set {$k} on this object. HINT: you can't set: " . - \implode(', ', static::getPermanentAttributes()->toArray()) - ); - } - - if ('' === $v) { - throw new Exception\InvalidArgumentException( - 'You cannot set \'' . $k . '\'to an empty string. ' - . 'We interpret empty strings as NULL in requests. ' - . 'You may set obj->' . $k . ' = NULL to delete the property' - ); - } - - $this->_values[$k] = Util\Util::convertToStripeObject($v, $this->_opts); - $this->dirtyValue($this->_values[$k]); - $this->_unsavedValues->add($k); - } - - public function __isset($k) - { - return isset($this->_values[$k]); - } - - public function __unset($k) - { - unset($this->_values[$k]); - $this->_transientValues->add($k); - $this->_unsavedValues->discard($k); - } - - public function &__get($k) - { - // function should return a reference, using $nullval to return a reference to null - $nullval = null; - if (!empty($this->_values) && \array_key_exists($k, $this->_values)) { - return $this->_values[$k]; - } - if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) { - $class = static::class; - $attrs = \implode(', ', \array_keys($this->_values)); - $message = "Stripe Notice: Undefined property of {$class} instance: {$k}. " - . "HINT: The {$k} attribute was set in the past, however. " - . 'It was then wiped when refreshing the object ' - . "with the result returned by Stripe's API, " - . 'probably as a result of a save(). The attributes currently ' - . "available on this object are: {$attrs}"; - Stripe::getLogger()->error($message); - - return $nullval; - } - $class = static::class; - Stripe::getLogger()->error("Stripe Notice: Undefined property of {$class} instance: {$k}"); - - return $nullval; - } - - // Magic method for var_dump output. Only works with PHP >= 5.6 - public function __debugInfo() - { - return $this->_values; - } - - // ArrayAccess methods - #[\ReturnTypeWillChange] - public function offsetSet($k, $v) - { - $this->{$k} = $v; - } - - #[\ReturnTypeWillChange] - public function offsetExists($k) - { - return \array_key_exists($k, $this->_values); - } - - #[\ReturnTypeWillChange] - public function offsetUnset($k) - { - unset($this->{$k}); - } - - #[\ReturnTypeWillChange] - public function offsetGet($k) - { - return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null; - } - - /** - * @return int - */ - #[\ReturnTypeWillChange] - public function count() - { - return \count($this->_values); - } - - public function keys() - { - return \array_keys($this->_values); - } - - public function values() - { - return \array_values($this->_values); - } - - /** - * This unfortunately needs to be public to be used in Util\Util. - * - * @param array $values - * @param null|array|string|Util\RequestOptions $opts - * - * @return static the object constructed from the given values - */ - public static function constructFrom($values, $opts = null) - { - $obj = new static(isset($values['id']) ? $values['id'] : null); - $obj->refreshFrom($values, $opts); - - return $obj; - } - - /** - * Refreshes this object using the provided values. - * - * @param array $values - * @param null|array|string|Util\RequestOptions $opts - * @param bool $partial defaults to false - */ - public function refreshFrom($values, $opts, $partial = false) - { - $this->_opts = Util\RequestOptions::parse($opts); - - $this->_originalValues = self::deepCopy($values); - - if ($values instanceof StripeObject) { - $values = $values->toArray(); - } - - // Wipe old state before setting new. This is useful for e.g. updating a - // customer, where there is no persistent card parameter. Mark those values - // which don't persist as transient - if ($partial) { - $removed = new Util\Set(); - } else { - $removed = new Util\Set(\array_diff(\array_keys($this->_values), \array_keys($values))); - } - - foreach ($removed->toArray() as $k) { - unset($this->{$k}); - } - - $this->updateAttributes($values, $opts, false); - foreach ($values as $k => $v) { - $this->_transientValues->discard($k); - $this->_unsavedValues->discard($k); - } - } - - /** - * Mass assigns attributes on the model. - * - * @param array $values - * @param null|array|string|Util\RequestOptions $opts - * @param bool $dirty defaults to true - */ - public function updateAttributes($values, $opts = null, $dirty = true) - { - foreach ($values as $k => $v) { - // Special-case metadata to always be cast as a StripeObject - // This is necessary in case metadata is empty, as PHP arrays do - // not differentiate between lists and hashes, and we consider - // empty arrays to be lists. - if (('metadata' === $k) && (\is_array($v))) { - $this->_values[$k] = StripeObject::constructFrom($v, $opts); - } else { - $this->_values[$k] = Util\Util::convertToStripeObject($v, $opts); - } - if ($dirty) { - $this->dirtyValue($this->_values[$k]); - } - $this->_unsavedValues->add($k); - } - } - - /** - * @param bool $force defaults to false - * - * @return array a recursive mapping of attributes to values for this object, - * including the proper value for deleted attributes - */ - public function serializeParameters($force = false) - { - $updateParams = []; - - foreach ($this->_values as $k => $v) { - // There are a few reasons that we may want to add in a parameter for - // update: - // - // 1. The `$force` option has been set. - // 2. We know that it was modified. - // 3. Its value is a StripeObject. A StripeObject may contain modified - // values within in that its parent StripeObject doesn't know about. - // - $original = \array_key_exists($k, $this->_originalValues) ? $this->_originalValues[$k] : null; - $unsaved = $this->_unsavedValues->includes($k); - if ($force || $unsaved || $v instanceof StripeObject) { - $updateParams[$k] = $this->serializeParamsValue( - $this->_values[$k], - $original, - $unsaved, - $force, - $k - ); - } - } - - // a `null` that makes it out of `serializeParamsValue` signals an empty - // value that we shouldn't appear in the serialized form of the object - return \array_filter( - $updateParams, - function ($v) { - return null !== $v; - } - ); - } - - public function serializeParamsValue($value, $original, $unsaved, $force, $key = null) - { - // The logic here is that essentially any object embedded in another - // object that had a `type` is actually an API resource of a different - // type that's been included in the response. These other resources must - // be updated from their proper endpoints, and therefore they are not - // included when serializing even if they've been modified. - // - // There are _some_ known exceptions though. - // - // For example, if the value is unsaved (meaning the user has set it), and - // it looks like the API resource is persisted with an ID, then we include - // the object so that parameters are serialized with a reference to its - // ID. - // - // Another example is that on save API calls it's sometimes desirable to - // update a customer's default source by setting a new card (or other) - // object with `->source=` and then saving the customer. The - // `saveWithParent` flag to override the default behavior allows us to - // handle these exceptions. - // - // We throw an error if a property was set explicitly but we can't do - // anything with it because the integration is probably not working as the - // user intended it to. - if (null === $value) { - return ''; - } - if (($value instanceof ApiResource) && (!$value->saveWithParent)) { - if (!$unsaved) { - return null; - } - if (isset($value->id)) { - return $value; - } - - throw new Exception\InvalidArgumentException( - "Cannot save property `{$key}` containing an API resource of type " . - \get_class($value) . ". It doesn't appear to be persisted and is " . - 'not marked as `saveWithParent`.' - ); - } - if (\is_array($value)) { - if (Util\Util::isList($value)) { - // Sequential array, i.e. a list - $update = []; - foreach ($value as $v) { - $update[] = $this->serializeParamsValue($v, null, true, $force); - } - // This prevents an array that's unchanged from being resent. - if ($update !== $this->serializeParamsValue($original, null, true, $force, $key)) { - return $update; - } - } else { - // Associative array, i.e. a map - return Util\Util::convertToStripeObject($value, $this->_opts)->serializeParameters(); - } - } elseif ($value instanceof StripeObject) { - $update = $value->serializeParameters($force); - if ($original && $unsaved && $key && static::getAdditiveParams()->includes($key)) { - $update = \array_merge(self::emptyValues($original), $update); - } - - return $update; - } else { - return $value; - } - } - - /** - * @return mixed - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return $this->toArray(); - } - - /** - * Returns an associative array with the key and values composing the - * Stripe object. - * - * @return array the associative array - */ - public function toArray() - { - $maybeToArray = function ($value) { - if (null === $value) { - return null; - } - - return \is_object($value) && \method_exists($value, 'toArray') ? $value->toArray() : $value; - }; - - return \array_reduce(\array_keys($this->_values), function ($acc, $k) use ($maybeToArray) { - if ('_' === \substr((string) $k, 0, 1)) { - return $acc; - } - $v = $this->_values[$k]; - if (Util\Util::isList($v)) { - $acc[$k] = \array_map($maybeToArray, $v); - } else { - $acc[$k] = $maybeToArray($v); - } - - return $acc; - }, []); - } - - /** - * Returns a pretty JSON representation of the Stripe object. - * - * @return string the JSON representation of the Stripe object - */ - public function toJSON() - { - return \json_encode($this->toArray(), \JSON_PRETTY_PRINT); - } - - public function __toString() - { - $class = static::class; - - return $class . ' JSON: ' . $this->toJSON(); - } - - /** - * Sets all keys within the StripeObject as unsaved so that they will be - * included with an update when `serializeParameters` is called. This - * method is also recursive, so any StripeObjects contained as values or - * which are values in a tenant array are also marked as dirty. - */ - public function dirty() - { - $this->_unsavedValues = new Util\Set(\array_keys($this->_values)); - foreach ($this->_values as $k => $v) { - $this->dirtyValue($v); - } - } - - protected function dirtyValue($value) - { - if (\is_array($value)) { - foreach ($value as $v) { - $this->dirtyValue($v); - } - } elseif ($value instanceof StripeObject) { - $value->dirty(); - } - } - - /** - * Produces a deep copy of the given object including support for arrays - * and StripeObjects. - * - * @param mixed $obj - */ - protected static function deepCopy($obj) - { - if (\is_array($obj)) { - $copy = []; - foreach ($obj as $k => $v) { - $copy[$k] = self::deepCopy($v); - } - - return $copy; - } - if ($obj instanceof StripeObject) { - return $obj::constructFrom( - self::deepCopy($obj->_values), - clone $obj->_opts - ); - } - - return $obj; - } - - /** - * Returns a hash of empty values for all the values that are in the given - * StripeObject. - * - * @param mixed $obj - */ - public static function emptyValues($obj) - { - if (\is_array($obj)) { - $values = $obj; - } elseif ($obj instanceof StripeObject) { - $values = $obj->_values; - } else { - throw new Exception\InvalidArgumentException( - 'empty_values got unexpected object type: ' . \get_class($obj) - ); - } - - return \array_fill_keys(\array_keys($values), ''); - } - - /** - * @return null|ApiResponse The last response from the Stripe API - */ - public function getLastResponse() - { - return $this->_lastResponse; - } - - /** - * Sets the last response from the Stripe API. - * - * @param ApiResponse $resp - */ - public function setLastResponse($resp) - { - $this->_lastResponse = $resp; - } - - /** - * Indicates whether or not the resource has been deleted on the server. - * Note that some, but not all, resources can indicate whether they have - * been deleted. - * - * @return bool whether the resource is deleted - */ - public function isDeleted() - { - return isset($this->_values['deleted']) ? $this->_values['deleted'] : false; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/StripeStreamingClientInterface.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/StripeStreamingClientInterface.php deleted file mode 100644 index e5e34c18..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/StripeStreamingClientInterface.php +++ /dev/null @@ -1,11 +0,0 @@ -Creating - * Subscriptions. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the subscription. - * @property null|float $application_fee_percent A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. - * @property \Stripe\StripeObject $automatic_tax - * @property int $billing_cycle_anchor Determines the date of the first full invoice, and, for plans with month or year intervals, the day of the month for subsequent invoices. - * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period - * @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled - * @property bool $cancel_at_period_end If the subscription has been canceled with the at_period_end flag set to true, cancel_at_period_end on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. - * @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end, canceled_at will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. - * @property string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property int $current_period_end End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. - * @property int $current_period_start Start of the current period that the subscription has been invoiced for. - * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription. - * @property null|int $days_until_due Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically. - * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If default_payment_method is also set, default_payment_method will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. - * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have tax_rates set. Invoices created will have their default_tax_rates populated from the subscription. - * @property null|\Stripe\Discount $discount Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. - * @property null|int $ended_at If the subscription has ended, the date the subscription ended. - * @property \Stripe\Collection<\Stripe\SubscriptionItem> $items List of subscription items, each with an attached price. - * @property null|string|\Stripe\Invoice $latest_invoice The most recent invoice this subscription has generated. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|int $next_pending_invoice_item_invoice Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at pending_invoice_item_interval. - * @property null|\Stripe\StripeObject $pause_collection If specified, payment collection for this subscription will be paused. - * @property null|\Stripe\StripeObject $payment_settings Payment settings passed on to invoices created by the subscription. - * @property null|\Stripe\StripeObject $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. - * @property null|string|\Stripe\SetupIntent $pending_setup_intent You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide. - * @property null|\Stripe\StripeObject $pending_update If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid. - * @property null|string|\Stripe\SubscriptionSchedule $schedule The schedule attached to the subscription - * @property int $start_date Date when the subscription was first created. The date might differ from the created date due to backdating. - * @property string $status

    Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, or unpaid.

    For collection_method=charge_automatically a subscription moves into incomplete if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an active state. If the first invoice is not paid within 23 hours, the subscription transitions to incomplete_expired. This is a terminal state, the open invoice will be voided and no further invoices will be generated.

    A subscription that is currently in a trial period is trialing and moves to active when the trial period is over.

    If subscription collection_method=charge_automatically it becomes past_due when payment to renew it fails and canceled or unpaid (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts.

    If subscription collection_method=send_invoice it becomes past_due when its invoice is not paid by the due date, and canceled or unpaid if it is still not paid by an additional deadline after that. Note that when a subscription has a status of unpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.

    - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this subscription belongs to. - * @property null|int $trial_end If the subscription has a trial, the end of that trial. - * @property null|int $trial_start If the subscription has a trial, the beginning of that trial. - */ -class Subscription extends ApiResource -{ - const OBJECT_NAME = 'subscription'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Search; - use ApiOperations\Update; - - const PAYMENT_BEHAVIOR_ALLOW_INCOMPLETE = 'allow_incomplete'; - const PAYMENT_BEHAVIOR_DEFAULT_INCOMPLETE = 'default_incomplete'; - const PAYMENT_BEHAVIOR_ERROR_IF_INCOMPLETE = 'error_if_incomplete'; - const PAYMENT_BEHAVIOR_PENDING_IF_INCOMPLETE = 'pending_if_incomplete'; - - const PRORATION_BEHAVIOR_ALWAYS_INVOICE = 'always_invoice'; - const PRORATION_BEHAVIOR_CREATE_PRORATIONS = 'create_prorations'; - const PRORATION_BEHAVIOR_NONE = 'none'; - - const STATUS_ACTIVE = 'active'; - const STATUS_CANCELED = 'canceled'; - const STATUS_INCOMPLETE = 'incomplete'; - const STATUS_INCOMPLETE_EXPIRED = 'incomplete_expired'; - const STATUS_PAST_DUE = 'past_due'; - const STATUS_TRIALING = 'trialing'; - const STATUS_UNPAID = 'unpaid'; - - use ApiOperations\Delete { - delete as protected _delete; - } - - public static function getSavedNestedResources() - { - static $savedNestedResources = null; - if (null === $savedNestedResources) { - $savedNestedResources = new Util\Set([ - 'source', - ]); - } - - return $savedNestedResources; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription the deleted subscription - */ - public function cancel($params = null, $opts = null) - { - return $this->_delete($params, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription the updated subscription - */ - public function deleteDiscount($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/discount'; - list($response, $opts) = $this->_request('delete', $url, $params, $opts); - $this->refreshFrom(['discount' => null], $opts, true); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SearchResult the subscription search results - */ - public static function search($params = null, $opts = null) - { - $url = '/v1/subscriptions/search'; - - return self::_searchResource($url, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SubscriptionItem.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SubscriptionItem.php deleted file mode 100644 index 36afdf83..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SubscriptionItem.php +++ /dev/null @@ -1,84 +0,0 @@ -key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Plan $plan

    You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.

    Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.

    For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.

    Related guides: Set up a subscription and more about products and prices.

    - * @property \Stripe\Price $price

    Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.

    For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.

    Related guides: Set up a subscription, create an invoice, and more about products and prices.

    - * @property int $quantity The quantity of the plan to which the customer should be subscribed. - * @property string $subscription The subscription this subscription_item belongs to. - * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to this subscription_item. When set, the default_tax_rates on the subscription do not apply to this subscription_item. - */ -class SubscriptionItem extends ApiResource -{ - const OBJECT_NAME = 'subscription_item'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\NestedResource; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const PATH_USAGE_RECORDS = '/usage_records'; - - /** - * @param null|string $id the ID of the subscription item on which to create the usage record - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\UsageRecord - */ - public static function createUsageRecord($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_USAGE_RECORDS, $params, $opts); - } - - /** - * @deprecated usageRecordSummaries is deprecated. Please use SubscriptionItem::allUsageRecordSummaries instead. - * - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of usage record summaries - */ - public function usageRecordSummaries($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/usage_record_summaries'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - const PATH_USAGE_RECORD_SUMMARIES = '/usage_record_summaries'; - - /** - * @param string $id the ID of the subscription item on which to retrieve the usage record summaries - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\UsageRecordSummary> the list of usage record summaries - */ - public static function allUsageRecordSummaries($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_USAGE_RECORD_SUMMARIES, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php deleted file mode 100644 index c1d4ce02..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php +++ /dev/null @@ -1,76 +0,0 @@ -Subscription - * Schedules. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the schedule. - * @property null|int $canceled_at Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. - * @property null|int $completed_at Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $current_phase Object representing the start and end dates for the current phase of the subscription schedule, if it is active. - * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription schedule. - * @property \Stripe\StripeObject $default_settings - * @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release and cancel. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject[] $phases Configuration for the subscription schedule's phases. - * @property null|int $released_at Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. - * @property null|string $released_subscription ID of the subscription once managed by the subscription schedule (if it is released). - * @property string $status The present status of the subscription schedule. Possible values are not_started, active, completed, released, and canceled. You can read more about the different states in our behavior guide. - * @property null|string|\Stripe\Subscription $subscription ID of the subscription managed by the subscription schedule. - * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this subscription schedule belongs to. - */ -class SubscriptionSchedule extends ApiResource -{ - const OBJECT_NAME = 'subscription_schedule'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule the canceled subscription schedule - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule the released subscription schedule - */ - public function release($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/release'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TaxCode.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TaxCode.php deleted file mode 100644 index 0dfc49e8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TaxCode.php +++ /dev/null @@ -1,22 +0,0 @@ -Tax codes classify - * goods and services for tax purposes. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $description A detailed description of which types of products the tax code represents. - * @property string $name A short name for the tax code. - */ -class TaxCode extends ApiResource -{ - const OBJECT_NAME = 'tax_code'; - - use ApiOperations\All; - use ApiOperations\Retrieve; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TaxId.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TaxId.php deleted file mode 100644 index f8e86933..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TaxId.php +++ /dev/null @@ -1,120 +0,0 @@ -customer. A customer's tax IDs - * are displayed on invoices and credit notes issued for the customer. - * - * Related guide: Customer - * Tax Identification Numbers. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string $country Two-letter ISO code representing the country of the tax ID. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer ID of the customer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $type Type of the tax ID, one of ae_trn, au_abn, au_arn, bg_uic, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_vat, cl_tin, es_cif, eu_oss_vat, eu_vat, gb_vat, ge_vat, hk_br, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, kr_brn, li_uid, mx_rfc, my_frp, my_itn, my_sst, no_vat, nz_gst, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, th_vat, tw_vat, ua_vat, us_ein, or za_vat. Note that some legacy tax IDs have type unknown - * @property string $value Value of the tax ID. - * @property null|\Stripe\StripeObject $verification Tax ID verification information. - */ -class TaxId extends ApiResource -{ - const OBJECT_NAME = 'tax_id'; - - use ApiOperations\Delete; - - const TYPE_AE_TRN = 'ae_trn'; - const TYPE_AU_ABN = 'au_abn'; - const TYPE_AU_ARN = 'au_arn'; - const TYPE_BG_UIC = 'bg_uic'; - const TYPE_BR_CNPJ = 'br_cnpj'; - const TYPE_BR_CPF = 'br_cpf'; - const TYPE_CA_BN = 'ca_bn'; - const TYPE_CA_GST_HST = 'ca_gst_hst'; - const TYPE_CA_PST_BC = 'ca_pst_bc'; - const TYPE_CA_PST_MB = 'ca_pst_mb'; - const TYPE_CA_PST_SK = 'ca_pst_sk'; - const TYPE_CA_QST = 'ca_qst'; - const TYPE_CH_VAT = 'ch_vat'; - const TYPE_CL_TIN = 'cl_tin'; - const TYPE_ES_CIF = 'es_cif'; - const TYPE_EU_OSS_VAT = 'eu_oss_vat'; - const TYPE_EU_VAT = 'eu_vat'; - const TYPE_GB_VAT = 'gb_vat'; - const TYPE_GE_VAT = 'ge_vat'; - const TYPE_HK_BR = 'hk_br'; - const TYPE_HU_TIN = 'hu_tin'; - const TYPE_ID_NPWP = 'id_npwp'; - const TYPE_IL_VAT = 'il_vat'; - const TYPE_IN_GST = 'in_gst'; - const TYPE_IS_VAT = 'is_vat'; - const TYPE_JP_CN = 'jp_cn'; - const TYPE_JP_RN = 'jp_rn'; - const TYPE_KR_BRN = 'kr_brn'; - const TYPE_LI_UID = 'li_uid'; - const TYPE_MX_RFC = 'mx_rfc'; - const TYPE_MY_FRP = 'my_frp'; - const TYPE_MY_ITN = 'my_itn'; - const TYPE_MY_SST = 'my_sst'; - const TYPE_NO_VAT = 'no_vat'; - const TYPE_NZ_GST = 'nz_gst'; - const TYPE_RU_INN = 'ru_inn'; - const TYPE_RU_KPP = 'ru_kpp'; - const TYPE_SA_VAT = 'sa_vat'; - const TYPE_SG_GST = 'sg_gst'; - const TYPE_SG_UEN = 'sg_uen'; - const TYPE_SI_TIN = 'si_tin'; - const TYPE_TH_VAT = 'th_vat'; - const TYPE_TW_VAT = 'tw_vat'; - const TYPE_UA_VAT = 'ua_vat'; - const TYPE_UNKNOWN = 'unknown'; - const TYPE_US_EIN = 'us_ein'; - const TYPE_ZA_VAT = 'za_vat'; - - const VERIFICATION_STATUS_PENDING = 'pending'; - const VERIFICATION_STATUS_UNAVAILABLE = 'unavailable'; - const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; - const VERIFICATION_STATUS_VERIFIED = 'verified'; - - /** - * @return string the API URL for this tax id - */ - public function instanceUrl() - { - $id = $this['id']; - $customer = $this['customer']; - if (!$id) { - throw new Exception\UnexpectedValueException( - "Could not determine which URL to request: class instance has invalid ID: {$id}" - ); - } - $id = Util\Util::utf8($id); - $customer = Util\Util::utf8($customer); - - $base = Customer::classUrl(); - $customerExtn = \urlencode($customer); - $extn = \urlencode($id); - - return "{$base}/{$customerExtn}/tax_ids/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Tax IDs cannot be retrieved without a customer ID. Retrieve ' . - "a tax ID using `Customer::retrieveTaxId('customer_id', " . - "'tax_id_id')`."; - - throw new Exception\BadMethodCallException($msg); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TaxRate.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TaxRate.php deleted file mode 100644 index 5a456378..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TaxRate.php +++ /dev/null @@ -1,50 +0,0 @@ -invoices, subscriptions and - * Checkout - * Sessions to collect tax. - * - * Related guide: Tax - * Rates. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $active Defaults to true. When set to false, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. - * @property null|string $country Two-letter country code (ISO 3166-1 alpha-2). - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $description An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. - * @property string $display_name The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. - * @property bool $inclusive This specifies if the tax rate is inclusive or exclusive. - * @property null|string $jurisdiction The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property float $percentage This represents the tax rate percent out of 100. - * @property null|string $state ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. - * @property null|string $tax_type The high-level tax type, such as vat or sales_tax. - */ -class TaxRate extends ApiResource -{ - const OBJECT_NAME = 'tax_rate'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const TAX_TYPE_GST = 'gst'; - const TAX_TYPE_HST = 'hst'; - const TAX_TYPE_JCT = 'jct'; - const TAX_TYPE_PST = 'pst'; - const TAX_TYPE_QST = 'qst'; - const TAX_TYPE_RST = 'rst'; - const TAX_TYPE_SALES_TAX = 'sales_tax'; - const TAX_TYPE_VAT = 'vat'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/Configuration.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/Configuration.php deleted file mode 100644 index f34831f7..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/Configuration.php +++ /dev/null @@ -1,28 +0,0 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $tipping - * @property \Stripe\StripeObject $verifone_p400 - */ -class Configuration extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'terminal.configuration'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Delete; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php deleted file mode 100644 index e49a0b0e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php +++ /dev/null @@ -1,22 +0,0 @@ -Fleet - * Management. - * - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $location The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see the docs on scoping connection tokens. - * @property string $secret Your application should pass this token to the Stripe Terminal SDK. - */ -class ConnectionToken extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'terminal.connection_token'; - - use \Stripe\ApiOperations\Create; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/Location.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/Location.php deleted file mode 100644 index 11c625d8..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/Location.php +++ /dev/null @@ -1,30 +0,0 @@ -Fleet - * Management. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $address - * @property string $configuration_overrides The ID of a configuration that will be used to customize all readers in this location. - * @property string $display_name The display name of the location. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - */ -class Location extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'terminal.location'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Delete; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/Reader.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/Reader.php deleted file mode 100644 index d7a3d36e..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Terminal/Reader.php +++ /dev/null @@ -1,104 +0,0 @@ -Connecting to a - * Reader. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\StripeObject $action The most recent action performed by the reader. - * @property null|string $device_sw_version The current software version of the reader. - * @property string $device_type Type of reader, one of bbpos_wisepad3, stripe_m2, bbpos_chipper2x, bbpos_wisepos_e, or verifone_P400. - * @property null|string $ip_address The local IP address of the reader. - * @property string $label Custom label given to the reader for easier identification. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Terminal\Location $location The location identifier of the reader. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $serial_number Serial number of the reader. - * @property null|string $status The networking status of the reader. - */ -class Reader extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'terminal.reader'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Delete; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader the canceled reader - */ - public function cancelAction($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel_action'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader the processed reader - */ - public function processPaymentIntent($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/process_payment_intent'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader the processed reader - */ - public function processSetupIntent($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/process_setup_intent'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader the seted reader - */ - public function setReaderDisplay($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/set_reader_display'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TestHelpers/TestClock.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TestHelpers/TestClock.php deleted file mode 100644 index 01d36ea0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TestHelpers/TestClock.php +++ /dev/null @@ -1,53 +0,0 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $name The custom name supplied at creation. - * @property string $status The status of the Test Clock. - */ -class TestClock extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'test_helpers.test_clock'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Delete; - use \Stripe\ApiOperations\Retrieve; - - const STATUS_ADVANCING = 'advancing'; - const STATUS_INTERNAL_FAILURE = 'internal_failure'; - const STATUS_READY = 'ready'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TestHelpers\TestClock the advanced test clock - */ - public function advance($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/advance'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ThreeDSecure.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ThreeDSecure.php deleted file mode 100644 index 51b5691d..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/ThreeDSecure.php +++ /dev/null @@ -1,37 +0,0 @@ -3D - * Secure object. Once the object has been created, you can use it to - * authenticate the cardholder and create a charge. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount of the charge that you will create when authentication completes. - * @property bool $authenticated True if the cardholder went through the authentication flow and their bank indicated that authentication succeeded. - * @property \Stripe\Card $card

    You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

    Related guide: Card Payments with Sources.

    - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $redirect_url If present, this is the URL that you should send the cardholder to for authentication. If you are going to use Stripe.js to display the authentication page in an iframe, you should use the value "_callback". - * @property string $status Possible values are redirect_pending, succeeded, or failed. When the cardholder can be authenticated, the object starts with status redirect_pending. When liability will be shifted to the cardholder's bank (either because the cardholder was successfully authenticated, or because the bank has not implemented 3D Secure, the object wlil be in status succeeded. failed indicates that authentication was attempted unsuccessfully. - */ -class ThreeDSecure extends ApiResource -{ - const OBJECT_NAME = 'three_d_secure'; - - use ApiOperations\Create; - use ApiOperations\Retrieve; - - /** - * @return string the endpoint URL for the given class - */ - public static function classUrl() - { - return '/v1/3d_secure'; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Token.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Token.php deleted file mode 100644 index 18b33e86..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Token.php +++ /dev/null @@ -1,57 +0,0 @@ -recommended payments integrations to - * perform this process client-side. This ensures that no sensitive card data - * touches your server, and allows your integration to operate in a PCI-compliant - * way. - * - * If you cannot use client-side tokenization, you can also create tokens using the - * API with either your publishable or secret API key. Keep in mind that if your - * integration uses this method, you are responsible for any PCI compliance that - * may be required, and you must keep your secret API key safe. Unlike with - * client-side tokenization, your customer's information is not sent directly to - * Stripe, so we cannot determine how it is handled or stored. - * - * Tokens cannot be stored or used more than once. To store card or bank account - * information for later use, you can create Customer objects or Custom accounts. Note - * that Radar, our integrated solution - * for automatic fraud protection, performs best with integrations that use - * client-side tokenization. - * - * Related guide: Accept - * a payment - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\BankAccount $bank_account

    These bank accounts are payment methods on Customer objects.

    On the other hand External Accounts are transfer destinations on Account objects for Custom accounts. They can be bank accounts or debit cards as well, and are documented in the links above.

    Related guide: Bank Debits and Transfers.

    - * @property \Stripe\Card $card

    You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

    Related guide: Card Payments with Sources.

    - * @property null|string $client_ip IP address of the client that generated the token. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $type Type of the token: account, bank_account, card, or pii. - * @property bool $used Whether this token has already been used (tokens can be used only once). - */ -class Token extends ApiResource -{ - const OBJECT_NAME = 'token'; - - use ApiOperations\Create; - use ApiOperations\Retrieve; - - const TYPE_ACCOUNT = 'account'; - const TYPE_BANK_ACCOUNT = 'bank_account'; - const TYPE_CARD = 'card'; - const TYPE_PII = 'pii'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Topup.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Topup.php deleted file mode 100644 index 69cdd689..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Topup.php +++ /dev/null @@ -1,63 +0,0 @@ -Topping Up your - * Platform Account. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount transferred. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|int $expected_availability_date Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up. - * @property null|string $failure_code Error code explaining reason for top-up failure if available (see the errors section for a list of codes). - * @property null|string $failure_message Message to user further explaining reason for top-up failure if available. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Source $source

    Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

    Related guides: Sources API and Sources & Customers.

    - * @property null|string $statement_descriptor Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. - * @property string $status The status of the top-up is either canceled, failed, pending, reversed, or succeeded. - * @property null|string $transfer_group A string that identifies this top-up as part of a group. - */ -class Topup extends ApiResource -{ - const OBJECT_NAME = 'topup'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const STATUS_CANCELED = 'canceled'; - const STATUS_FAILED = 'failed'; - const STATUS_PENDING = 'pending'; - const STATUS_REVERSED = 'reversed'; - const STATUS_SUCCEEDED = 'succeeded'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Topup the canceled topup - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Transfer.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Transfer.php deleted file mode 100644 index fed09bb9..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Transfer.php +++ /dev/null @@ -1,130 +0,0 @@ -Transfer object is created when you move funds between Stripe - * accounts as part of Connect. - * - * Before April 6, 2017, transfers also represented movement of funds from a Stripe - * account to a card or bank account. This behavior has since been split out into a - * Payout object, with - * corresponding payout endpoints. For more information, read about the transfer/payout split. - * - * Related guide: Creating Separate - * Charges and Transfers. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount in %s to be transferred. - * @property int $amount_reversed Amount in %s reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact of this transfer on your account balance. - * @property int $created Time that this record of the transfer was first created. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\Account $destination ID of the Stripe account the transfer was sent to. - * @property string|\Stripe\Charge $destination_payment If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Collection<\Stripe\TransferReversal> $reversals A list of reversals that have been applied to the transfer. - * @property bool $reversed Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. - * @property null|string|\Stripe\Charge $source_transaction ID of the charge or payment that was used to fund the transfer. If null, the transfer was funded from the available balance. - * @property null|string $source_type The source balance this transfer came from. One of card, fpx, or bank_account. - * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. - */ -class Transfer extends ApiResource -{ - const OBJECT_NAME = 'transfer'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\NestedResource; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const SOURCE_TYPE_ALIPAY_ACCOUNT = 'alipay_account'; - const SOURCE_TYPE_BANK_ACCOUNT = 'bank_account'; - const SOURCE_TYPE_CARD = 'card'; - const SOURCE_TYPE_FINANCING = 'financing'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer the canceled transfer - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - const PATH_REVERSALS = '/reversals'; - - /** - * @param string $id the ID of the transfer on which to retrieve the transfer reversals - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection<\Stripe\TransferReversal> the list of transfer reversals - */ - public static function allReversals($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_REVERSALS, $params, $opts); - } - - /** - * @param string $id the ID of the transfer on which to create the transfer reversal - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public static function createReversal($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_REVERSALS, $params, $opts); - } - - /** - * @param string $id the ID of the transfer to which the transfer reversal belongs - * @param string $reversalId the ID of the transfer reversal to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public static function retrieveReversal($id, $reversalId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_REVERSALS, $reversalId, $params, $opts); - } - - /** - * @param string $id the ID of the transfer to which the transfer reversal belongs - * @param string $reversalId the ID of the transfer reversal to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public static function updateReversal($id, $reversalId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_REVERSALS, $reversalId, $params, $opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TransferReversal.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TransferReversal.php deleted file mode 100644 index b6167dbb..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/TransferReversal.php +++ /dev/null @@ -1,79 +0,0 @@ -Stripe Connect platforms can - * reverse transfers made to a connected account, either entirely or partially, and - * can also specify whether to refund any related application fees. Transfer - * reversals add to the platform's balance and subtract from the destination - * account's balance. - * - * Reversing a transfer that was made for a destination charge is allowed only - * up to the amount of the charge. It is possible to reverse a transfer_group - * transfer only if the destination account has enough balance to cover the - * reversal. - * - * Related guide: Reversing - * Transfers. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount, in %s. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Refund $destination_payment_refund Linked payment refund for the transfer reversal. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string|\Stripe\Refund $source_refund ID of the refund responsible for the transfer reversal. - * @property string|\Stripe\Transfer $transfer ID of the transfer that was reversed. - */ -class TransferReversal extends ApiResource -{ - const OBJECT_NAME = 'transfer_reversal'; - - use ApiOperations\Update { - save as protected _save; - } - - /** - * @return string the API URL for this Stripe transfer reversal - */ - public function instanceUrl() - { - $id = $this['id']; - $transfer = $this['transfer']; - if (!$id) { - throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", - null - ); - } - $id = Util\Util::utf8($id); - $transfer = Util\Util::utf8($transfer); - - $base = Transfer::classUrl(); - $transferExtn = \urlencode($transfer); - $extn = \urlencode($id); - - return "{$base}/{$transferExtn}/reversals/{$extn}"; - } - - /** - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return TransferReversal the saved reversal - */ - public function save($opts = null) - { - return $this->_save($opts); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/UsageRecord.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/UsageRecord.php deleted file mode 100644 index 55229827..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/UsageRecord.php +++ /dev/null @@ -1,25 +0,0 @@ -Metered - * Billing. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $quantity The usage quantity for the specified date. - * @property string $subscription_item The ID of the subscription item this usage record contains data for. - * @property int $timestamp The timestamp when this usage occurred. - */ -class UsageRecord extends ApiResource -{ - const OBJECT_NAME = 'usage_record'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/UsageRecordSummary.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/UsageRecordSummary.php deleted file mode 100644 index 174e14e0..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/UsageRecordSummary.php +++ /dev/null @@ -1,19 +0,0 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $period - * @property string $subscription_item The ID of the subscription item this summary is describing. - * @property int $total_usage The total usage within this usage period. - */ -class UsageRecordSummary extends ApiResource -{ - const OBJECT_NAME = 'usage_record_summary'; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php deleted file mode 100644 index b6696cd2..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php +++ /dev/null @@ -1,93 +0,0 @@ -container = \array_change_key_case($initial_array, \CASE_LOWER); - } - - #[\ReturnTypeWillChange] - public function count() - { - return \count($this->container); - } - - /** - * @return \ArrayIterator - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - return new \ArrayIterator($this->container); - } - - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - $offset = static::maybeLowercase($offset); - if (null === $offset) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * @return bool - */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) - { - $offset = static::maybeLowercase($offset); - - return isset($this->container[$offset]); - } - - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) - { - $offset = static::maybeLowercase($offset); - unset($this->container[$offset]); - } - - /** - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - $offset = static::maybeLowercase($offset); - - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - private static function maybeLowercase($v) - { - if (\is_string($v)) { - return \strtolower($v); - } - - return $v; - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php deleted file mode 100644 index 016cbe85..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php +++ /dev/null @@ -1,29 +0,0 @@ - 0) { - throw new \Stripe\Exception\BadMethodCallException('DefaultLogger does not currently implement context. Please implement if you need it.'); - } - - if (null === $this->destination) { - \error_log($message, $this->messageType); - } else { - \error_log($message, $this->messageType, $this->destination); - } - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php deleted file mode 100644 index 5603c81b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - \Stripe\Account::class, - \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, - \Stripe\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class, - \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class, - \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class, - \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class, - \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class, - \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class, - \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class, - \Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class, - \Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class, - \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class, - \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class, - \Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class, - \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, - \Stripe\CashBalance::OBJECT_NAME => \Stripe\CashBalance::class, - \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, - \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, - \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, - \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, - \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, - \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, - \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class, - \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, - \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class, - \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class, - \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class, - \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class, - \Stripe\Event::OBJECT_NAME => \Stripe\Event::class, - \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class, - \Stripe\File::OBJECT_NAME => \Stripe\File::class, - \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, - \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, - \Stripe\FinancialConnections\Account::OBJECT_NAME => \Stripe\FinancialConnections\Account::class, - \Stripe\FinancialConnections\AccountOwner::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwner::class, - \Stripe\FinancialConnections\AccountOwnership::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwnership::class, - \Stripe\FinancialConnections\Session::OBJECT_NAME => \Stripe\FinancialConnections\Session::class, - \Stripe\FundingInstructions::OBJECT_NAME => \Stripe\FundingInstructions::class, - \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class, - \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class, - \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, - \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, - \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, - \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, - \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, - \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, - \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, - \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, - \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, - \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, - \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, - \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, - \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, - \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class, - \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class, - \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, - \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class, - \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, - \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, - \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, - \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, - \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, - \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, - \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, - \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class, - \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class, - \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class, - \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class, - \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class, - \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class, - \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class, - \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class, - \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class, - \Stripe\Review::OBJECT_NAME => \Stripe\Review::class, - \Stripe\SearchResult::OBJECT_NAME => \Stripe\SearchResult::class, - \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class, - \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class, - \Stripe\ShippingRate::OBJECT_NAME => \Stripe\ShippingRate::class, - \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class, - \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class, - \Stripe\Source::OBJECT_NAME => \Stripe\Source::class, - \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class, - \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class, - \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class, - \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class, - \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class, - \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, - \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, - \Stripe\Terminal\Configuration::OBJECT_NAME => \Stripe\Terminal\Configuration::class, - \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, - \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, - \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, - \Stripe\TestHelpers\TestClock::OBJECT_NAME => \Stripe\TestHelpers\TestClock::class, - \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class, - \Stripe\Token::OBJECT_NAME => \Stripe\Token::class, - \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class, - \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class, - \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class, - \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class, - \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class, - \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class, - ]; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php deleted file mode 100644 index ccf023ac..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php +++ /dev/null @@ -1,36 +0,0 @@ - a list of headers that should be persisted across requests - */ - public static $HEADERS_TO_PERSIST = [ - 'Stripe-Account', - 'Stripe-Version', - ]; - - /** @var array */ - public $headers; - - /** @var null|string */ - public $apiKey; - - /** @var null|string */ - public $apiBase; - - /** - * @param null|string $key - * @param array $headers - * @param null|string $base - */ - public function __construct($key = null, $headers = [], $base = null) - { - $this->apiKey = $key; - $this->headers = $headers; - $this->apiBase = $base; - } - - /** - * @return array - */ - public function __debugInfo() - { - return [ - 'apiKey' => $this->redactedApiKey(), - 'headers' => $this->headers, - 'apiBase' => $this->apiBase, - ]; - } - - /** - * Unpacks an options array and merges it into the existing RequestOptions - * object. - * - * @param null|array|RequestOptions|string $options a key => value array - * @param bool $strict when true, forbid string form and arbitrary keys in array form - * - * @return RequestOptions - */ - public function merge($options, $strict = false) - { - $other_options = self::parse($options, $strict); - if (null === $other_options->apiKey) { - $other_options->apiKey = $this->apiKey; - } - if (null === $other_options->apiBase) { - $other_options->apiBase = $this->apiBase; - } - $other_options->headers = \array_merge($this->headers, $other_options->headers); - - return $other_options; - } - - /** - * Discards all headers that we don't want to persist across requests. - */ - public function discardNonPersistentHeaders() - { - foreach ($this->headers as $k => $v) { - if (!\in_array($k, self::$HEADERS_TO_PERSIST, true)) { - unset($this->headers[$k]); - } - } - } - - /** - * Unpacks an options array into an RequestOptions object. - * - * @param null|array|RequestOptions|string $options a key => value array - * @param bool $strict when true, forbid string form and arbitrary keys in array form - * - * @throws \Stripe\Exception\InvalidArgumentException - * - * @return RequestOptions - */ - public static function parse($options, $strict = false) - { - if ($options instanceof self) { - return clone $options; - } - - if (null === $options) { - return new RequestOptions(null, [], null); - } - - if (\is_string($options)) { - if ($strict) { - $message = 'Do not pass a string for request options. If you want to set the ' - . 'API key, pass an array like ["api_key" => ] instead.'; - - throw new \Stripe\Exception\InvalidArgumentException($message); - } - - return new RequestOptions($options, [], null); - } - - if (\is_array($options)) { - $headers = []; - $key = null; - $base = null; - - if (\array_key_exists('api_key', $options)) { - $key = $options['api_key']; - unset($options['api_key']); - } - if (\array_key_exists('idempotency_key', $options)) { - $headers['Idempotency-Key'] = $options['idempotency_key']; - unset($options['idempotency_key']); - } - if (\array_key_exists('stripe_account', $options)) { - $headers['Stripe-Account'] = $options['stripe_account']; - unset($options['stripe_account']); - } - if (\array_key_exists('stripe_version', $options)) { - $headers['Stripe-Version'] = $options['stripe_version']; - unset($options['stripe_version']); - } - if (\array_key_exists('api_base', $options)) { - $base = $options['api_base']; - unset($options['api_base']); - } - - if ($strict && !empty($options)) { - $message = 'Got unexpected keys in options array: ' . \implode(', ', \array_keys($options)); - - throw new \Stripe\Exception\InvalidArgumentException($message); - } - - return new RequestOptions($key, $headers, $base); - } - - $message = 'The second argument to Stripe API method calls is an ' - . 'optional per-request apiKey, which must be a string, or ' - . 'per-request options, which must be an array. (HINT: you can set ' - . 'a global apiKey by "Stripe::setApiKey()")'; - - throw new \Stripe\Exception\InvalidArgumentException($message); - } - - private function redactedApiKey() - { - $pieces = \explode('_', $this->apiKey, 3); - $last = \array_pop($pieces); - $redactedLast = \strlen($last) > 4 - ? (\str_repeat('*', \strlen($last) - 4) . \substr($last, -4)) - : $last; - $pieces[] = $redactedLast; - - return \implode('_', $pieces); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/Set.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/Set.php deleted file mode 100644 index aaa811d5..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/Set.php +++ /dev/null @@ -1,48 +0,0 @@ -_elts = []; - foreach ($members as $item) { - $this->_elts[$item] = true; - } - } - - public function includes($elt) - { - return isset($this->_elts[$elt]); - } - - public function add($elt) - { - $this->_elts[$elt] = true; - } - - public function discard($elt) - { - unset($this->_elts[$elt]); - } - - public function toArray() - { - return \array_keys($this->_elts); - } - - /** - * @return ArrayIterator - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - return new ArrayIterator($this->toArray()); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/Util.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/Util.php deleted file mode 100644 index 4f390500..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Util/Util.php +++ /dev/null @@ -1,265 +0,0 @@ -id; - } - if (static::isList($h)) { - $results = []; - foreach ($h as $v) { - $results[] = static::objectsToIds($v); - } - - return $results; - } - if (\is_array($h)) { - $results = []; - foreach ($h as $k => $v) { - if (null === $v) { - continue; - } - $results[$k] = static::objectsToIds($v); - } - - return $results; - } - - return $h; - } - - /** - * @param array $params - * - * @return string - */ - public static function encodeParameters($params) - { - $flattenedParams = self::flattenParams($params); - $pieces = []; - foreach ($flattenedParams as $param) { - list($k, $v) = $param; - $pieces[] = self::urlEncode($k) . '=' . self::urlEncode($v); - } - - return \implode('&', $pieces); - } - - /** - * @param array $params - * @param null|string $parentKey - * - * @return array - */ - public static function flattenParams($params, $parentKey = null) - { - $result = []; - - foreach ($params as $key => $value) { - $calculatedKey = $parentKey ? "{$parentKey}[{$key}]" : $key; - - if (self::isList($value)) { - $result = \array_merge($result, self::flattenParamsList($value, $calculatedKey)); - } elseif (\is_array($value)) { - $result = \array_merge($result, self::flattenParams($value, $calculatedKey)); - } else { - \array_push($result, [$calculatedKey, $value]); - } - } - - return $result; - } - - /** - * @param array $value - * @param string $calculatedKey - * - * @return array - */ - public static function flattenParamsList($value, $calculatedKey) - { - $result = []; - - foreach ($value as $i => $elem) { - if (self::isList($elem)) { - $result = \array_merge($result, self::flattenParamsList($elem, $calculatedKey)); - } elseif (\is_array($elem)) { - $result = \array_merge($result, self::flattenParams($elem, "{$calculatedKey}[{$i}]")); - } else { - \array_push($result, ["{$calculatedKey}[{$i}]", $elem]); - } - } - - return $result; - } - - /** - * @param string $key a string to URL-encode - * - * @return string the URL-encoded string - */ - public static function urlEncode($key) - { - $s = \urlencode((string) $key); - - // Don't use strict form encoding by changing the square bracket control - // characters back to their literals. This is fine by the server, and - // makes these parameter strings easier to read. - $s = \str_replace('%5B', '[', $s); - - return \str_replace('%5D', ']', $s); - } - - public static function normalizeId($id) - { - if (\is_array($id)) { - $params = $id; - $id = $params['id']; - unset($params['id']); - } else { - $params = []; - } - - return [$id, $params]; - } - - /** - * Returns UNIX timestamp in milliseconds. - * - * @return int current time in millis - */ - public static function currentTimeMillis() - { - return (int) \round(\microtime(true) * 1000); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Webhook.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Webhook.php deleted file mode 100644 index b9db2d6c..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/Webhook.php +++ /dev/null @@ -1,42 +0,0 @@ -webhook - * endpoints via the API to be notified about events that happen in your Stripe - * account or connected accounts. - * - * Most users configure webhooks from the dashboard, which provides a - * user interface for registering and testing your webhook endpoints. - * - * Related guide: Setting up - * Webhooks. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|string $api_version The API version events are rendered as for this webhook endpoint. - * @property null|string $application The ID of the associated Connect application. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $description An optional description of what the webhook is used for. - * @property string[] $enabled_events The list of events to enable for this endpoint. ['*'] indicates that all events are enabled, except those that require explicit selection. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $secret The endpoint's secret, used to generate webhook signatures. Only returned at creation. - * @property string $status The status of the webhook. It can be enabled or disabled. - * @property string $url The URL of the webhook endpoint. - */ -class WebhookEndpoint extends ApiResource -{ - const OBJECT_NAME = 'webhook_endpoint'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/WebhookSignature.php b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/WebhookSignature.php deleted file mode 100644 index 46cbb28b..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/lib/WebhookSignature.php +++ /dev/null @@ -1,140 +0,0 @@ - 0) && (\abs(\time() - $timestamp) > $tolerance)) { - throw Exception\SignatureVerificationException::factory( - 'Timestamp outside the tolerance zone', - $payload, - $header - ); - } - - return true; - } - - /** - * Extracts the timestamp in a signature header. - * - * @param string $header the signature header - * - * @return int the timestamp contained in the header, or -1 if no valid - * timestamp is found - */ - private static function getTimestamp($header) - { - $items = \explode(',', $header); - - foreach ($items as $item) { - $itemParts = \explode('=', $item, 2); - if ('t' === $itemParts[0]) { - if (!\is_numeric($itemParts[1])) { - return -1; - } - - return (int) ($itemParts[1]); - } - } - - return -1; - } - - /** - * Extracts the signatures matching a given scheme in a signature header. - * - * @param string $header the signature header - * @param string $scheme the signature scheme to look for - * - * @return array the list of signatures matching the provided scheme - */ - private static function getSignatures($header, $scheme) - { - $signatures = []; - $items = \explode(',', $header); - - foreach ($items as $item) { - $itemParts = \explode('=', $item, 2); - if (\trim($itemParts[0]) === $scheme) { - $signatures[] = $itemParts[1]; - } - } - - return $signatures; - } - - /** - * Computes the signature for a given payload and secret. - * - * The current scheme used by Stripe ("v1") is HMAC/SHA-256. - * - * @param string $payload the payload to sign - * @param string $secret the secret used to generate the signature - * - * @return string the signature as a string - */ - private static function computeSignature($payload, $secret) - { - return \hash_hmac('sha256', $payload, $secret); - } -} diff --git a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/phpdoc.dist.xml b/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/phpdoc.dist.xml deleted file mode 100644 index b1ea92fa..00000000 --- a/wp-content/plugins/easy-digital-downloads/includes/gateways/stripe/vendor/stripe/stripe-php/phpdoc.dist.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - build/phpdoc - - - latest - - - lib - - api - - - php - - stripe-php - - -