Changeset 2534245
- Timestamp:
- 05/19/2021 12:31:18 PM (5 years ago)
- Location:
- woocommerce-gateway-stripe/trunk
- Files:
-
- 5 added
- 23 edited
-
assets/css/stripe-styles.css (modified) (1 diff)
-
assets/css/stripe-styles.scss (modified) (5 diffs)
-
assets/js/stripe-admin.js (modified) (1 diff)
-
assets/js/stripe-admin.min.js (modified) (1 diff)
-
assets/js/stripe-payment-request.js (modified) (11 diffs)
-
assets/js/stripe-payment-request.min.js (modified) (1 diff)
-
assets/js/stripe.js (modified) (1 diff)
-
assets/js/stripe.min.js (modified) (1 diff)
-
build (added)
-
build/index.asset.php (added)
-
build/index.js (added)
-
changelog.txt (modified) (1 diff)
-
includes/abstracts/abstract-wc-stripe-payment-gateway.php (modified) (7 diffs)
-
includes/admin/class-wc-stripe-inbox-notes.php (modified) (7 diffs)
-
includes/admin/stripe-settings.php (modified) (2 diffs)
-
includes/class-wc-gateway-stripe.php (modified) (5 diffs)
-
includes/class-wc-stripe-api.php (modified) (2 diffs)
-
includes/class-wc-stripe-blocks-support.php (added)
-
includes/class-wc-stripe-customer.php (modified) (3 diffs)
-
includes/class-wc-stripe-helper.php (modified) (1 diff)
-
includes/class-wc-stripe-intent-controller.php (modified) (1 diff)
-
includes/compat/class-wc-stripe-sepa-subs-compat.php (modified) (1 diff)
-
includes/compat/class-wc-stripe-subs-compat.php (modified) (1 diff)
-
includes/compat/class-wc-stripe-woo-compat-utils.php (added)
-
includes/payment-methods/class-wc-stripe-payment-request.php (modified) (19 diffs)
-
languages/woocommerce-gateway-stripe.pot (modified) (50 diffs)
-
readme.txt (modified) (2 diffs)
-
woocommerce-gateway-stripe.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-gateway-stripe/trunk/assets/css/stripe-styles.css
r2309509 r2534245 1 .wc-stripe-elements-field,.wc-stripe-iban-element-field{border:1px solid #ddd;margin:5px 0;padding:5px;background-color:#fff;outline:0}#payment .methods li.woocommerce-SavedPaymentMethods-token label{display:inline}#payment .methods li.woocommerce-SavedPaymentMethods-new label{display:inline}#add_payment_method #payment ul.payment_methods li img.stripe-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-icon{max-width:40px;padding-left:3px;margin:0}#add_payment_method #payment ul.payment_methods li img.stripe-bancontact-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-bancontact-icon{max-height:65px;max-width:45px}#add_payment_method #payment ul.payment_methods li img.stripe-ideal-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-ideal-icon{max-height:35px}#add_payment_method #payment ul.payment_methods li img.stripe-p24-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-p24-icon{max-width:65px}#add_payment_method #payment ul.payment_methods li img.stripe-alipay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-alipay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-sofort-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sofort-icon{max-width:55px}#add_payment_method #payment ul.payment_methods li img.stripe-sepa-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sepa-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-multibanco-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-multibanco-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-eps-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-eps-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-giropay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-credit-card-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/credit-card.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-visa-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-visa-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/visa.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-amex-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-amex-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/amex.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-diners-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-diners-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/diners.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-discover-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-discover-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/discover.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-jcb-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-jcb-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/jcb.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-maestro-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-maestro-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/maestro.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/mastercard.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods .stripe-card-group,.woocommerce-checkout #payment ul.payment_methods .stripe-card-group{position:relative}.woocommerce-SavedPaymentMethods-token .stripe-source-errors .woocommerce-error{margin-top:1em;margin-bottom:2em}#wc-stripe-custom-button{display:block;width:100%}.gpay-button{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain;border:0;border-radius:4px; box-shadow:rgba(60,64,67,.3) 0 1px 1px 0,rgba(60,64,67,.15) 0 1px 3px 1px;cursor:pointer;height:40px;min-height:40px;padding:11px 24px;width:100%}.gpay-button.light{width:calc(100% - 3px);background-color:#fff}.gpay-button.light:active{background-color:#fff}.gpay-button.light:hover{background-color:#f8f8f8}.gpay-button.light:focus{box-shadow:#e8e8e8 0 1px 1px 0,#e8e8e8 0 1px 3px;outline:0}.gpay-button.dark{background-color:#000;box-shadow:none;padding:12px 24px 10px}.gpay-button.dark:active{background-color:#5f6368}.gpay-button.dark:hover{background-color:#3c4043}.gpay-button.dark:focus{box-shadow:#5f6368 0 1px 1px 0,#5f6368 0 1px 3px;outline:0}.gpay-button.short.light{background-image:url(https://www.gstatic.com/instantbuy/svg/light_gpay.svg)}.gpay-button.short.dark{background-image:url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)}1 .wc-stripe-elements-field,.wc-stripe-iban-element-field{border:1px solid #ddd;margin:5px 0;padding:5px;background-color:#fff;outline:0}#payment .methods li.woocommerce-SavedPaymentMethods-token label{display:inline}#payment .methods li.woocommerce-SavedPaymentMethods-new label{display:inline}#add_payment_method #payment ul.payment_methods li img.stripe-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-icon{max-width:40px;padding-left:3px;margin:0}#add_payment_method #payment ul.payment_methods li img.stripe-bancontact-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-bancontact-icon{max-height:65px;max-width:45px}#add_payment_method #payment ul.payment_methods li img.stripe-ideal-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-ideal-icon{max-height:35px}#add_payment_method #payment ul.payment_methods li img.stripe-p24-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-p24-icon{max-width:65px}#add_payment_method #payment ul.payment_methods li img.stripe-alipay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-alipay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-sofort-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sofort-icon{max-width:55px}#add_payment_method #payment ul.payment_methods li img.stripe-sepa-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sepa-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-multibanco-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-multibanco-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-eps-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-eps-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-giropay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-credit-card-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/credit-card.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-visa-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-visa-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/visa.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-amex-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-amex-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/amex.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-diners-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-diners-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/diners.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-discover-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-discover-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/discover.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-jcb-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-jcb-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/jcb.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-maestro-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-maestro-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/maestro.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/mastercard.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods .stripe-card-group,.woocommerce-checkout #payment ul.payment_methods .stripe-card-group{position:relative}.woocommerce-SavedPaymentMethods-token .stripe-source-errors .woocommerce-error{margin-top:1em;margin-bottom:2em}#wc-stripe-custom-button{display:block;width:100%}.gpay-button{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain;border:0;border-radius:4px;cursor:pointer;height:40px;min-height:40px;padding:11px 24px;width:100%}.gpay-button.light{width:calc(100% - 3px);background-color:#fff;margin:2px 0 3px 0}.gpay-button.light:active{background-color:#fff}.gpay-button.light:hover{background-color:#f8f8f8}.gpay-button.light:focus{box-shadow:#e8e8e8 0 1px 1px 0,#e8e8e8 0 1px 3px;outline:0}.gpay-button.light-outline{width:calc(100% - 3px);background-color:#fff;box-shadow:rgba(60,64,67,.3) 0 1px 1px 0,rgba(60,64,67,.15) 0 1px 3px 1px;margin:2px 0 3px 0}.gpay-button.light-outline:active{background-color:#fff}.gpay-button.light-outline:hover{background-color:#f8f8f8}.gpay-button.light-outline:focus{box-shadow:#e8e8e8 0 1px 1px 0,#e8e8e8 0 1px 3px;outline:0}.gpay-button.dark{background-color:#000;padding:12px 24px 10px}.gpay-button.dark:active{background-color:#5f6368}.gpay-button.dark:hover{background-color:#3c4043}.gpay-button.dark:focus{box-shadow:#5f6368 0 1px 1px 0,#5f6368 0 1px 3px;outline:0}.gpay-button.short.light,.gpay-button.short.light-outline{background-image:url(https://www.gstatic.com/instantbuy/svg/light_gpay.svg)}.gpay-button.short.dark{background-image:url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)} -
woocommerce-gateway-stripe/trunk/assets/css/stripe-styles.scss
r2395718 r2534245 1 .wc-stripe-elements-field, .wc-stripe-iban-element-field { border:1px solid #ddd; margin:5px 0; padding:5px; background-color:#fff; outline:0; } 2 #payment .methods li.woocommerce-SavedPaymentMethods-token label { display: inline; } 3 #payment .methods li.woocommerce-SavedPaymentMethods-new label { display: inline; } 1 .wc-stripe-elements-field, 2 .wc-stripe-iban-element-field { 3 border: 1px solid #ddd; 4 margin: 5px 0; 5 padding: 5px; 6 background-color: #fff; 7 outline: 0; 8 } 9 #payment .methods li.woocommerce-SavedPaymentMethods-token label { 10 display: inline; 11 } 12 #payment .methods li.woocommerce-SavedPaymentMethods-new label { 13 display: inline; 14 } 4 15 5 16 .woocommerce-checkout #payment ul.payment_methods li img.stripe-icon, 6 #add_payment_method #payment ul.payment_methods li img.stripe-icon { max-width: 40px; padding-left: 3px; margin: 0; } 17 #add_payment_method #payment ul.payment_methods li img.stripe-icon { 18 max-width: 40px; 19 padding-left: 3px; 20 margin: 0; 21 } 7 22 8 23 .woocommerce-checkout #payment ul.payment_methods li img.stripe-bancontact-icon, 9 #add_payment_method #payment ul.payment_methods li img.stripe-bancontact-icon { max-height: 65px; max-width: 45px; } 24 #add_payment_method #payment ul.payment_methods li img.stripe-bancontact-icon { 25 max-height: 65px; 26 max-width: 45px; 27 } 10 28 11 29 .woocommerce-checkout #payment ul.payment_methods li img.stripe-ideal-icon, 12 #add_payment_method #payment ul.payment_methods li img.stripe-ideal-icon { max-height: 35px; } 30 #add_payment_method #payment ul.payment_methods li img.stripe-ideal-icon { 31 max-height: 35px; 32 } 13 33 14 34 .woocommerce-checkout #payment ul.payment_methods li img.stripe-p24-icon, 15 #add_payment_method #payment ul.payment_methods li img.stripe-p24-icon { max-width: 65px; } 35 #add_payment_method #payment ul.payment_methods li img.stripe-p24-icon { 36 max-width: 65px; 37 } 16 38 17 39 .woocommerce-checkout #payment ul.payment_methods li img.stripe-alipay-icon, 18 #add_payment_method #payment ul.payment_methods li img.stripe-alipay-icon { max-width: 50px; } 40 #add_payment_method #payment ul.payment_methods li img.stripe-alipay-icon { 41 max-width: 50px; 42 } 19 43 20 44 .woocommerce-checkout #payment ul.payment_methods li img.stripe-sofort-icon, 21 #add_payment_method #payment ul.payment_methods li img.stripe-sofort-icon { max-width: 55px; } 45 #add_payment_method #payment ul.payment_methods li img.stripe-sofort-icon { 46 max-width: 55px; 47 } 22 48 23 49 .woocommerce-checkout #payment ul.payment_methods li img.stripe-sepa-icon, 24 #add_payment_method #payment ul.payment_methods li img.stripe-sepa-icon { max-width: 50px; } 50 #add_payment_method #payment ul.payment_methods li img.stripe-sepa-icon { 51 max-width: 50px; 52 } 25 53 26 54 .woocommerce-checkout #payment ul.payment_methods li img.stripe-multibanco-icon, 27 #add_payment_method #payment ul.payment_methods li img.stripe-multibanco-icon { max-height: 30px; } 55 #add_payment_method #payment ul.payment_methods li img.stripe-multibanco-icon { 56 max-height: 30px; 57 } 28 58 29 59 .woocommerce-checkout #payment ul.payment_methods li img.stripe-eps-icon, 30 #add_payment_method #payment ul.payment_methods li img.stripe-eps-icon { max-height: 30px; } 60 #add_payment_method #payment ul.payment_methods li img.stripe-eps-icon { 61 max-height: 30px; 62 } 31 63 32 64 .woocommerce-checkout #payment ul.payment_methods li img.stripe-giropay-icon, 33 #add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon { max-width: 50px; } 65 #add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon { 66 max-width: 50px; 67 } 34 68 35 69 .woocommerce-checkout #payment ul.payment_methods li .stripe-credit-card-brand, 36 #add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/credit-card.svg' ); display: block; width: 30px; height: 24px; } 70 #add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand { 71 position: absolute; 72 top: 50%; 73 margin-top: -10px; 74 right: 10px; 75 background: no-repeat url( '../images/credit-card.svg' ); 76 display: block; 77 width: 30px; 78 height: 24px; 79 } 37 80 38 81 .woocommerce-checkout #payment ul.payment_methods li .stripe-visa-brand, 39 #add_payment_method #payment ul.payment_methods li .stripe-visa-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/visa.svg' ); display: block; width: 30px; height: 24px; } 82 #add_payment_method #payment ul.payment_methods li .stripe-visa-brand { 83 position: absolute; 84 top: 50%; 85 margin-top: -10px; 86 right: 10px; 87 background: no-repeat url( '../images/visa.svg' ); 88 display: block; 89 width: 30px; 90 height: 24px; 91 } 40 92 41 93 .woocommerce-checkout #payment ul.payment_methods li .stripe-amex-brand, 42 #add_payment_method #payment ul.payment_methods li .stripe-amex-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/amex.svg' ); display: block; width: 30px; height: 24px; } 94 #add_payment_method #payment ul.payment_methods li .stripe-amex-brand { 95 position: absolute; 96 top: 50%; 97 margin-top: -10px; 98 right: 10px; 99 background: no-repeat url( '../images/amex.svg' ); 100 display: block; 101 width: 30px; 102 height: 24px; 103 } 43 104 44 105 .woocommerce-checkout #payment ul.payment_methods li .stripe-diners-brand, 45 #add_payment_method #payment ul.payment_methods li .stripe-diners-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/diners.svg' ); display: block; width: 30px; height: 24px; } 106 #add_payment_method #payment ul.payment_methods li .stripe-diners-brand { 107 position: absolute; 108 top: 50%; 109 margin-top: -10px; 110 right: 10px; 111 background: no-repeat url( '../images/diners.svg' ); 112 display: block; 113 width: 30px; 114 height: 24px; 115 } 46 116 47 117 .woocommerce-checkout #payment ul.payment_methods li .stripe-discover-brand, 48 #add_payment_method #payment ul.payment_methods li .stripe-discover-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/discover.svg' ); display: block; width: 30px; height: 24px; } 118 #add_payment_method #payment ul.payment_methods li .stripe-discover-brand { 119 position: absolute; 120 top: 50%; 121 margin-top: -10px; 122 right: 10px; 123 background: no-repeat url( '../images/discover.svg' ); 124 display: block; 125 width: 30px; 126 height: 24px; 127 } 49 128 50 129 .woocommerce-checkout #payment ul.payment_methods li .stripe-jcb-brand, 51 #add_payment_method #payment ul.payment_methods li .stripe-jcb-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/jcb.svg' ); display: block; width: 30px; height: 24px; } 130 #add_payment_method #payment ul.payment_methods li .stripe-jcb-brand { 131 position: absolute; 132 top: 50%; 133 margin-top: -10px; 134 right: 10px; 135 background: no-repeat url( '../images/jcb.svg' ); 136 display: block; 137 width: 30px; 138 height: 24px; 139 } 52 140 53 141 .woocommerce-checkout #payment ul.payment_methods li .stripe-maestro-brand, 54 #add_payment_method #payment ul.payment_methods li .stripe-maestro-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/maestro.svg' ); display: block; width: 30px; height: 24px; } 142 #add_payment_method #payment ul.payment_methods li .stripe-maestro-brand { 143 position: absolute; 144 top: 50%; 145 margin-top: -10px; 146 right: 10px; 147 background: no-repeat url( '../images/maestro.svg' ); 148 display: block; 149 width: 30px; 150 height: 24px; 151 } 55 152 56 153 .woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand, 57 #add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/mastercard.svg' ); display: block; width: 30px; height: 24px; } 154 #add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand { 155 position: absolute; 156 top: 50%; 157 margin-top: -10px; 158 right: 10px; 159 background: no-repeat url( '../images/mastercard.svg' ); 160 display: block; 161 width: 30px; 162 height: 24px; 163 } 58 164 59 165 .woocommerce-checkout #payment ul.payment_methods .stripe-card-group, 60 #add_payment_method #payment ul.payment_methods .stripe-card-group { position: relative; } 61 62 .woocommerce-SavedPaymentMethods-token .stripe-source-errors .woocommerce-error { margin-top: 1em; margin-bottom: 2em; } 63 64 #wc-stripe-custom-button { display: block; width: 100%; } 166 #add_payment_method #payment ul.payment_methods .stripe-card-group { 167 position: relative; 168 } 169 170 .woocommerce-SavedPaymentMethods-token 171 .stripe-source-errors 172 .woocommerce-error { 173 margin-top: 1em; 174 margin-bottom: 2em; 175 } 176 177 #wc-stripe-custom-button { 178 display: block; 179 width: 100%; 180 } 65 181 66 182 .gpay-button { … … 69 185 background-repeat: no-repeat; 70 186 background-size: contain; 71 border: 0 px;187 border: 0; 72 188 border-radius: 4px; 73 box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 1px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;74 189 cursor: pointer; 75 190 height: 40px; … … 82 197 width: calc( 100% - 3px ); 83 198 background-color: #fff; 199 200 // Add vertical margin to make box-shadow visible in blocks. 201 margin: 2px 0 3px 0; 202 84 203 &:active { 85 204 background-color: #fff; … … 94 213 } 95 214 215 &.light-outline { 216 // account for button box-shadow when setting width 217 width: calc( 100% - 3px ); 218 background-color: #fff; 219 220 // The box-shadow forms the outline and as such is always on. 221 box-shadow: rgba( 60, 64, 67, 0.3 ) 0px 1px 1px 0, 222 rgba( 60, 64, 67, 0.15 ) 0 1px 3px 1px; 223 224 // Add vertical margin to make box-shadow visible in blocks. 225 margin: 2px 0 3px 0; 226 227 &:active { 228 background-color: #fff; 229 } 230 &:hover { 231 background-color: #f8f8f8; 232 } 233 &:focus { 234 box-shadow: #e8e8e8 0 1px 1px 0, #e8e8e8 0 1px 3px; 235 outline: 0; 236 } 237 } 238 96 239 &.dark { 97 240 background-color: #000; 98 box-shadow: none;99 241 padding: 12px 24px 10px; 100 242 &:active { 101 243 background-color: #5f6368; 102 244 } 103 &:hover {245 &:hover { 104 246 background-color: #3c4043; 105 247 } … … 111 253 112 254 &.short { 113 &.light { 114 background-image: url(https://www.gstatic.com/instantbuy/svg/light_gpay.svg); 255 &.light, 256 &.light-outline { 257 background-image: url( https://www.gstatic.com/instantbuy/svg/light_gpay.svg ); 115 258 } 116 259 &.dark { 117 background-image: url( https://www.gstatic.com/instantbuy/svg/dark_gpay.svg);118 } 119 } 120 } 260 background-image: url( https://www.gstatic.com/instantbuy/svg/dark_gpay.svg ); 261 } 262 } 263 } -
woocommerce-gateway-stripe/trunk/assets/js/stripe-admin.js
r2464493 r2534245 130 130 var timeDifference = Date.now() / 1000 - wc_stripe_settings_params.time; 131 131 var isTimeOutOfSync = Math.abs( timeDifference ) > 4 * 60; 132 $( '#woocommerce_stripe_test_webhook_secret, #woocommerce_stripe_webhook_secret' ) 133 .on( 'change input', function() { 134 var $td = $( this ).closest( 'td' ); 135 var $warning = $td.find( '.webhook_secret_time_sync_warning' ); 136 var hasWebhookSecretValue = $( this ).val().length > 0; 137 138 if ( hasWebhookSecretValue ){ 139 var isWarningShown = $warning.length > 0; 140 if ( isTimeOutOfSync && ! isWarningShown ) { 141 $td.append( '<p class="webhook_secret_time_sync_warning">' + wc_stripe_settings_params.i18n_out_of_sync + '</p>' ); 142 } 143 } else { 144 $warning.remove(); 145 } 146 } ) 147 .change(); 132 if ( isTimeOutOfSync ) { 133 var $td = $( '#woocommerce_stripe_test_webhook_secret, #woocommerce_stripe_webhook_secret' ).closest( 'td' ); 134 $td.append( '<p>' + wc_stripe_settings_params.i18n_out_of_sync + '</p>' ); 135 } 148 136 } 149 137 }; -
woocommerce-gateway-stripe/trunk/assets/js/stripe-admin.min.js
r2464493 r2534245 1 jQuery(function(i){"use strict";var e={isTestMode:function(){return i("#woocommerce_stripe_testmode").is(":checked")},getSecretKey:function(){return e.isTestMode()?i("#woocommerce_stripe_test_secret_key").val():i("#woocommerce_stripe_secret_key").val()},init:function(){i(document.body).on("change","#woocommerce_stripe_testmode",function(){var e=i("#woocommerce_stripe_test_secret_key").parents("tr").eq(0),t=i("#woocommerce_stripe_test_publishable_key").parents("tr").eq(0),o=i("#woocommerce_stripe_test_webhook_secret").parents("tr").eq(0),s=i("#woocommerce_stripe_secret_key").parents("tr").eq(0),r=i("#woocommerce_stripe_publishable_key").parents("tr").eq(0),c=i("#woocommerce_stripe_webhook_secret").parents("tr").eq(0);i(this).is(":checked")?(e.show(),t.show(),o.show(),s.hide(),r.hide(),c.hide()):(e.hide(),t.hide(),o.hide(),s.show(),r.show(),c.show())}),i("#woocommerce_stripe_testmode").trigger("change"),i("#woocommerce_stripe_payment_request").on("change",function(){i(this).is(":checked")?i("#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_height").closest("tr").show():i("#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_height").closest("tr").hide()}).trigger("change"),i("#woocommerce_stripe_payment_request_button_type").on("change",function(){"custom"===i(this).val()?i("#woocommerce_stripe_payment_request_button_label").closest("tr").show():i("#woocommerce_stripe_payment_request_button_label").closest("tr").hide()}).trigger("change"),i("#woocommerce_stripe_payment_request_button_type").on("change",function(){"branded"===i(this).val()?i("#woocommerce_stripe_payment_request_button_branded_type").closest("tr").show():i("#woocommerce_stripe_payment_request_button_branded_type").closest("tr").hide()}).trigger("change"),i(".wc-stripe-3ds-missing").each(function(){var e=i(this);e.find(".notice-dismiss").on("click.wc-stripe-dismiss-notice",function(){i.ajax({type:"head",url:window.location.href+"&stripe_dismiss_3ds="+e.data("nonce")})})}),i("#woocommerce_stripe_test_secret_key, #woocommerce_stripe_secret_key, #woocommerce_stripe_test_webhook_secret, #woocommerce_stripe_webhook_secret").after('<button class="wc-stripe-toggle-secret" style="height: 30px; margin-left: 2px; cursor: pointer"><span class="dashicons dashicons-visibility"></span></button>'),i(".wc-stripe-toggle-secret").on("click",function(e){e.preventDefault();var t=i(this).closest("button").find(".dashicons"),o=i(this).closest("tr").find(".input-text");"text"==o.attr("type")?(o.attr("type","password"),t.removeClass("dashicons-hidden"),t.addClass("dashicons-visibility")):(o.attr("type","text"),t.removeClass("dashicons-visibility"),t.addClass("dashicons-hidden"))}),i("form").find("input, select").on("change input",function e(){i("#wc_stripe_connect_button").addClass("disabled"),i("#wc_stripe_connect_button").on("click",function(){return!1}),i("#woocommerce_stripe_api_credentials").next("p").append(" (Please save changes before selecting this button.)"),i("form").find("input, select").off("change input",e)});var e=Date.now()/1e3-wc_stripe_settings_params.time,s=240<Math.abs(e);i("#woocommerce_stripe_test_webhook_secret, #woocommerce_stripe_webhook_secret").on("change input",function(){var e=i(this).closest("td"),t=e.find(".webhook_secret_time_sync_warning");if(0<i(this).val().length){var o=0<t.length;s&&!o&&e.append('<p class="webhook_secret_time_sync_warning">'+wc_stripe_settings_params.i18n_out_of_sync+"</p>")}else t.remove()}).change()}};e.init()});1 jQuery(function(i){"use strict";var e={isTestMode:function(){return i("#woocommerce_stripe_testmode").is(":checked")},getSecretKey:function(){return(e.isTestMode()?i("#woocommerce_stripe_test_secret_key"):i("#woocommerce_stripe_secret_key")).val()},init:function(){i(document.body).on("change","#woocommerce_stripe_testmode",function(){var e=i("#woocommerce_stripe_test_secret_key").parents("tr").eq(0),t=i("#woocommerce_stripe_test_publishable_key").parents("tr").eq(0),o=i("#woocommerce_stripe_test_webhook_secret").parents("tr").eq(0),s=i("#woocommerce_stripe_secret_key").parents("tr").eq(0),r=i("#woocommerce_stripe_publishable_key").parents("tr").eq(0),c=i("#woocommerce_stripe_webhook_secret").parents("tr").eq(0);i(this).is(":checked")?(e.show(),t.show(),o.show(),s.hide(),r.hide(),c.hide()):(e.hide(),t.hide(),o.hide(),s.show(),r.show(),c.show())}),i("#woocommerce_stripe_testmode").trigger("change"),i("#woocommerce_stripe_payment_request").on("change",function(){i(this).is(":checked")?i("#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_height").closest("tr").show():i("#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_height").closest("tr").hide()}).trigger("change"),i("#woocommerce_stripe_payment_request_button_type").on("change",function(){"custom"===i(this).val()?i("#woocommerce_stripe_payment_request_button_label").closest("tr").show():i("#woocommerce_stripe_payment_request_button_label").closest("tr").hide()}).trigger("change"),i("#woocommerce_stripe_payment_request_button_type").on("change",function(){"branded"===i(this).val()?i("#woocommerce_stripe_payment_request_button_branded_type").closest("tr").show():i("#woocommerce_stripe_payment_request_button_branded_type").closest("tr").hide()}).trigger("change"),i(".wc-stripe-3ds-missing").each(function(){var e=i(this);e.find(".notice-dismiss").on("click.wc-stripe-dismiss-notice",function(){i.ajax({type:"head",url:window.location.href+"&stripe_dismiss_3ds="+e.data("nonce")})})}),i("#woocommerce_stripe_test_secret_key, #woocommerce_stripe_secret_key, #woocommerce_stripe_test_webhook_secret, #woocommerce_stripe_webhook_secret").after('<button class="wc-stripe-toggle-secret" style="height: 30px; margin-left: 2px; cursor: pointer"><span class="dashicons dashicons-visibility"></span></button>'),i(".wc-stripe-toggle-secret").on("click",function(e){e.preventDefault();var t=i(this).closest("button").find(".dashicons"),e=i(this).closest("tr").find(".input-text");"text"==e.attr("type")?(e.attr("type","password"),t.removeClass("dashicons-hidden"),t.addClass("dashicons-visibility")):(e.attr("type","text"),t.removeClass("dashicons-visibility"),t.addClass("dashicons-hidden"))}),i("form").find("input, select").on("change input",function e(){i("#wc_stripe_connect_button").addClass("disabled"),i("#wc_stripe_connect_button").on("click",function(){return!1}),i("#woocommerce_stripe_api_credentials").next("p").append(" (Please save changes before selecting this button.)"),i("form").find("input, select").off("change input",e)});var e=Date.now()/1e3-wc_stripe_settings_params.time;240<Math.abs(e)&&i("#woocommerce_stripe_test_webhook_secret, #woocommerce_stripe_webhook_secret").closest("td").append("<p>"+wc_stripe_settings_params.i18n_out_of_sync+"</p>")}};e.init()}); -
woocommerce-gateway-stripe/trunk/assets/js/stripe-payment-request.js
r2464493 r2534245 3 3 'use strict'; 4 4 5 var stripe = Stripe( wc_stripe_payment_request_params.stripe.key ), 5 var stripe = Stripe( wc_stripe_payment_request_params.stripe.key, { 6 locale: typeof wc_stripe_params !== 'undefined' ? wc_stripe_params.stripe_locale : 'auto', 7 } ), 6 8 paymentRequestType; 7 9 … … 543 545 544 546 createGooglePayButton: function () { 545 var allowedThemes = [ 'dark', 'light' ];547 var allowedThemes = [ 'dark', 'light', 'light-outline' ]; 546 548 var allowedTypes = [ 'short', 'long' ]; 547 549 … … 551 553 var height = wc_stripe_payment_request_params.button.height; 552 554 theme = allowedThemes.includes( theme ) ? theme : 'light'; 555 var gpaySvgTheme = 'dark' === theme ? 'dark' : 'light'; 553 556 type = allowedTypes.includes( type ) ? type : 'long'; 554 557 … … 557 560 button.addClass( theme + ' ' + type ); 558 561 if ( 'long' === type ) { 559 var url = 'https://www.gstatic.com/instantbuy/svg/' + theme + '/' + locale + '.svg';560 var fallbackUrl = 'https://www.gstatic.com/instantbuy/svg/' + theme + '/en.svg';562 var url = 'https://www.gstatic.com/instantbuy/svg/' + gpaySvgTheme + '/' + locale + '.svg'; 563 var fallbackUrl = 'https://www.gstatic.com/instantbuy/svg/' + gpaySvgTheme + '/en.svg'; 561 564 // Check if locale GPay button exists, default to en if not 562 565 setBackgroundImageWithFallback( button, url, fallbackUrl ); … … 611 614 }); 612 615 616 $( document.body ).on( 'wc_stripe_unblock_payment_request_button wc_stripe_enable_payment_request_button', function () { 617 wc_stripe_payment_request.unblockPaymentRequestButton(); 618 } ); 619 620 $( document.body ).on( 'wc_stripe_block_payment_request_button', function () { 621 wc_stripe_payment_request.blockPaymentRequestButton( 'wc_request_button_is_blocked' ); 622 } ); 623 624 $( document.body ).on( 'wc_stripe_disable_payment_request_button', function () { 625 wc_stripe_payment_request.blockPaymentRequestButton( 'wc_request_button_is_disabled' ); 626 } ); 627 613 628 $( document.body ).on( 'woocommerce_variation_has_changed', function () { 614 wc_stripe_payment_request.blockPaymentRequestButton( prButton);629 $( document.body ).trigger( 'wc_stripe_block_payment_request_button' ); 615 630 616 631 $.when( wc_stripe_payment_request.getSelectedProductData() ).then( function ( response ) { … … 621 636 } ) 622 637 ).then( function () { 623 wc_stripe_payment_request.unblockPaymentRequestButton( prButton);638 $( document.body ).trigger( 'wc_stripe_unblock_payment_request_button' ); 624 639 } ); 625 640 }); … … 629 644 // when the customer clicks on the button before the debounced event is processed. 630 645 $( '.quantity' ).on( 'input', '.qty', function() { 631 wc_stripe_payment_request.blockPaymentRequestButton( prButton);646 $( document.body ).trigger( 'wc_stripe_block_payment_request_button' ); 632 647 } ); 633 648 634 649 $( '.quantity' ).on( 'input', '.qty', wc_stripe_payment_request.debounce( 250, function() { 635 wc_stripe_payment_request.blockPaymentRequestButton( prButton);650 $( document.body ).trigger( 'wc_stripe_block_payment_request_button' ); 636 651 paymentRequestError = []; 637 652 … … 639 654 if ( response.error ) { 640 655 paymentRequestError = [ response.error ]; 641 wc_stripe_payment_request.unblockPaymentRequestButton( prButton);656 $( document.body ).trigger( 'wc_stripe_unblock_payment_request_button' ); 642 657 } else { 643 658 $.when( … … 647 662 } ) 648 663 ).then( function () { 649 wc_stripe_payment_request.unblockPaymentRequestButton( prButton);664 $( document.body ).trigger( 'wc_stripe_unblock_payment_request_button' ); 650 665 }); 651 666 } … … 679 694 }, 680 695 681 blockPaymentRequestButton: function( prButton) {696 blockPaymentRequestButton: function( cssClassname ) { 682 697 // check if element isn't already blocked before calling block() to avoid blinking overlay issues 683 698 // blockUI.isBlocked is either undefined or 0 when element is not blocked … … 686 701 } 687 702 688 $( '#wc-stripe-payment-request-button' ).block( { message: null } ); 689 if ( wc_stripe_payment_request.isCustomPaymentRequestButton( prButton ) ) { 690 prButton.addClass( 'is-blocked' ); 691 } 692 }, 693 694 unblockPaymentRequestButton: function( prButton ) { 695 $( '#wc-stripe-payment-request-button' ).unblock(); 696 if ( wc_stripe_payment_request.isCustomPaymentRequestButton( prButton ) ) { 697 prButton.removeClass( 'is-blocked' ); 698 } 703 $( '#wc-stripe-payment-request-button' ) 704 .addClass( cssClassname ) 705 .block( { message: null } ); 706 }, 707 708 unblockPaymentRequestButton: function() { 709 $( '#wc-stripe-payment-request-button' ) 710 .removeClass( ['wc_request_button_is_blocked', 'wc_request_button_is_disabled'] ) 711 .unblock(); 699 712 }, 700 713 -
woocommerce-gateway-stripe/trunk/assets/js/stripe-payment-request.min.js
r2464493 r2534245 1 jQuery(function(i){"use strict";var o,u=Stripe(wc_stripe_payment_request_params.stripe.key ),p={getAjaxURL:function(t){return wc_stripe_payment_request_params.ajax_url.toString().replace("%%endpoint%%","wc_stripe_"+t)},getCartDetails:function(){var t={security:wc_stripe_payment_request_params.nonce.payment};i.ajax({type:"POST",data:t,url:p.getAjaxURL("get_cart_details"),success:function(t){p.startPaymentRequest(t)}})},getAttributes:function(){var t=i(".variations_form").find(".variations select"),a={},n=0,r=0;return t.each(function(){var t=i(this).data("attribute_name")||i(this).attr("name"),e=i(this).val()||"";0<e.length&&r++,n++,a[t]=e}),{count:n,chosenCount:r,data:a}},processSource:function(t,e){var a=p.getOrderData(t,e);return i.ajax({type:"POST",data:a,dataType:"json",url:p.getAjaxURL("create_order")})},getOrderData:function(t,e){var a=t.source,n=a.owner.email,r=a.owner.phone,s=a.owner.address,i=a.owner.name,o=t.shippingAddress,u={_wpnonce:wc_stripe_payment_request_params.nonce.checkout,billing_first_name:null!==i?i.split(" ").slice(0,1).join(" "):"",billing_last_name:null!==i?i.split(" ").slice(1).join(" "):"",billing_company:"",billing_email:null!==n?n:t.payerEmail,billing_phone:null!==r?r:t.payerPhone&&t.payerPhone.replace("/[() -]/g",""),billing_country:null!==s?s.country:"",billing_address_1:null!==s?s.line1:"",billing_address_2:null!==s?s.line2:"",billing_city:null!==s?s.city:"",billing_state:null!==s?s.state:"",billing_postcode:null!==s?s.postal_code:"",shipping_first_name:"",shipping_last_name:"",shipping_company:"",shipping_country:"",shipping_address_1:"",shipping_address_2:"",shipping_city:"",shipping_state:"",shipping_postcode:"",shipping_method:[null===t.shippingOption?null:t.shippingOption.id],order_comments:"",payment_method:"stripe",ship_to_different_address:1,terms:1,stripe_source:a.id,payment_request_type:e};return o&&(u.shipping_first_name=o.recipient.split(" ").slice(0,1).join(" "),u.shipping_last_name=o.recipient.split(" ").slice(1).join(" "),u.shipping_company=o.organization,u.shipping_country=o.country,u.shipping_address_1=void 0===o.addressLine[0]?"":o.addressLine[0],u.shipping_address_2=void 0===o.addressLine[1]?"":o.addressLine[1],u.shipping_city=o.city,u.shipping_state=o.region,u.shipping_postcode=o.postalCode),u},getErrorMessageHTML:function(t){return i('<div class="woocommerce-error" />').text(t)},displayErrorMessage:function(t){if(i(".woocommerce-error").remove(),wc_stripe_payment_request_params.is_product_page){var e=i(".product").first();e.before(t),i("html, body").animate({scrollTop:e.prev(".woocommerce-error").offset().top},600)}else{var a=i(".shop_table.cart").closest("form");a.before(t),i("html, body").animate({scrollTop:a.prev(".woocommerce-error").offset().top},600)}},abortPayment:function(t,e){t.complete("fail"),p.displayErrorMessage(e)},completePayment:function(t,e){p.block(),t.complete("success"),window.location=e},block:function(){i.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},updateShippingOptions:function(t,e){var a={security:wc_stripe_payment_request_params.nonce.shipping,country:e.country,state:e.region,postcode:e.postalCode,city:e.city,address:void 0===e.addressLine[0]?"":e.addressLine[0],address_2:void 0===e.addressLine[1]?"":e.addressLine[1],payment_request_type:o,is_product_page:wc_stripe_payment_request_params.is_product_page};return i.ajax({type:"POST",data:a,url:p.getAjaxURL("get_shipping_options")})},updateShippingDetails:function(t,e){var a={security:wc_stripe_payment_request_params.nonce.update_shipping,shipping_method:[e.id],payment_request_type:o,is_product_page:wc_stripe_payment_request_params.is_product_page};return i.ajax({type:"POST",data:a,url:p.getAjaxURL("update_shipping_method")})},addToCart:function(){var t=i(".single_add_to_cart_button").val();i(".single_variation_wrap").length&&(t=i(".single_variation_wrap").find('input[name="product_id"]').val());var n={security:wc_stripe_payment_request_params.nonce.add_to_cart,product_id:t,qty:i(".quantity .qty").val(),attributes:i(".variations_form").length?p.getAttributes().data:[]},e=i("form.cart").serializeArray();return i.each(e,function(t,e){if(/^addon-/.test(e.name))if(/\[\]$/.test(e.name)){var a=e.name.substring(0,e.name.length-2);n[a]?n[a].push(e.value):n[a]=[e.value]}else n[e.name]=e.value}),i.ajax({type:"POST",data:n,url:p.getAjaxURL("add_to_cart")})},clearCart:function(){var t={security:wc_stripe_payment_request_params.nonce.clear_cart};return i.ajax({type:"POST",data:t,url:p.getAjaxURL("clear_cart"),success:function(t){}})},getRequestOptionsFromLocal:function(){return{total:wc_stripe_payment_request_params.product.total,currency:wc_stripe_payment_request_params.checkout.currency_code,country:wc_stripe_payment_request_params.checkout.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:wc_stripe_payment_request_params.checkout.needs_payer_phone,requestShipping:wc_stripe_payment_request_params.product.requestShipping,displayItems:wc_stripe_payment_request_params.product.displayItems}},startPaymentRequest:function(t){var a,e;a=wc_stripe_payment_request_params.is_product_page?e=p.getRequestOptionsFromLocal():(e={total:t.order_data.total,currency:t.order_data.currency,country:t.order_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:wc_stripe_payment_request_params.checkout.needs_payer_phone,requestShipping:!!t.shipping_required,displayItems:t.order_data.displayItems},t.order_data),"PR"===e.country&&(e.country="US");try{var n=u.paymentRequest(e),r=u.elements({locale:wc_stripe_payment_request_params.button.locale}),s=p.createPaymentRequestButton(r,n);n.canMakePayment().then(function(t){t&&(o=t.applePay?"apple_pay":"payment_request_api",p.attachPaymentRequestButtonEventListeners(s,n),p.showPaymentRequestButton(s))}),n.on("shippingaddresschange",function(e){i.when(p.updateShippingOptions(a,e.shippingAddress)).then(function(t){e.updateWith({status:t.result,shippingOptions:t.shipping_options,total:t.total,displayItems:t.displayItems})})}),n.on("shippingoptionchange",function(e){i.when(p.updateShippingDetails(a,e.shippingOption)).then(function(t){"success"===t.result&&e.updateWith({status:"success",total:t.total,displayItems:t.displayItems}),"fail"===t.result&&e.updateWith({status:"fail"})})}),n.on("source",function(e){"no"===wc_stripe_payment_request_params.stripe.allow_prepaid_card&&"prepaid"===e.source.card.funding?p.abortPayment(e,p.getErrorMessageHTML(wc_stripe_payment_request_params.i18n.no_prepaid_card)):i.when(p.processSource(e,o)).then(function(t){"success"===t.result?p.completePayment(e,t.redirect):p.abortPayment(e,t.messages)})})}catch(t){console.error(t)}},getSelectedProductData:function(){var t=i(".single_add_to_cart_button").val();i(".single_variation_wrap").length&&(t=i(".single_variation_wrap").find('input[name="product_id"]').val());var e=(i("#product-addons-total").data("price_data")||[]).reduce(function(t,e){return t+e.cost},0),a={security:wc_stripe_payment_request_params.nonce.get_selected_product_data,product_id:t,qty:i(".quantity .qty").val(),attributes:i(".variations_form").length?p.getAttributes().data:[],addon_value:e};return i.ajax({type:"POST",data:a,url:p.getAjaxURL("get_selected_product_data")})},debounce:function(n,r,s){var i;return function(){var t=this,e=arguments,a=s&&!i;clearTimeout(i),i=setTimeout(function(){i=null,s||r.apply(t,e)},n),a&&r.apply(t,e)}},createPaymentRequestButton:function(t,e){var a;if(wc_stripe_payment_request_params.button.is_custom&&(a=i(wc_stripe_payment_request_params.button.css_selector)).length)return a.data("isCustom",!0),a;if(wc_stripe_payment_request_params.button.is_branded){if(p.shouldUseGooglePayBrand())return(a=p.createGooglePayButton()).data("isBranded",!0),a;wc_stripe_payment_request_params.button.type="long"===wc_stripe_payment_request_params.button.branded_type?"buy":"default"}return t.create("paymentRequestButton",{paymentRequest:e,style:{paymentRequestButton:{type:wc_stripe_payment_request_params.button.type,theme:wc_stripe_payment_request_params.button.theme,height:wc_stripe_payment_request_params.button.height+"px"}}})},isCustomPaymentRequestButton:function(t){return t&&"function"==typeof t.data&&t.data("isCustom")},isBrandedPaymentRequestButton:function(t){return t&&"function"==typeof t.data&&t.data("isBranded")},shouldUseGooglePayBrand:function(){var t=window.navigator.userAgent.toLowerCase(),e=/chrome/.test(t)&&!/edge|edg|opr|brave\//.test(t)&&"Google Inc."===window.navigator.vendor,a=e&&window.navigator.brave;return e&&!a},createGooglePayButton:function(){var t=wc_stripe_payment_request_params.button.theme,e=wc_stripe_payment_request_params.button.branded_type,a=wc_stripe_payment_request_params.button.locale,n=wc_stripe_payment_request_params.button.height;t=["dark","light"].includes(t)?t:"light",e=["short","long"].includes(e)?e:"long";var r=i('<button type="button" id="wc-stripe-branded-button" aria-label="Google Pay" class="gpay-button"></button>');r.css("height",n+"px"),r.addClass(t+" "+e),"long"===e&&function(t,e,a){t.css("background-image","url("+e+")");var n=document.createElement("img");n.onerror=function(){t.css("background-image","url("+a+")")},n.src=e}(r,"https://www.gstatic.com/instantbuy/svg/"+t+"/"+a+".svg","https://www.gstatic.com/instantbuy/svg/"+t+"/en.svg");return r},attachPaymentRequestButtonEventListeners:function(t,e){t.on("click",function(t){i("body").addClass("woocommerce-stripe-prb-clicked")}),wc_stripe_payment_request_params.is_product_page?p.attachProductPageEventListeners(t,e):p.attachCartPageEventListeners(t,e)},attachProductPageEventListeners:function(e,a){var n=[],r=i(".single_add_to_cart_button");e.on("click",function(t){return r.is(".disabled")?(t.preventDefault(),void(r.is(".wc-variation-is-unavailable")?window.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):r.is(".wc-variation-selection-needed")&&window.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text))):0<n.length?(t.preventDefault(),void window.alert(n)):(p.addToCart(),void((p.isCustomPaymentRequestButton(e)||p.isBrandedPaymentRequestButton(e))&&(t.preventDefault(),a.show())))}),i(document.body).on("woocommerce_variation_has_changed",function(){p.blockPaymentRequestButton(e),i.when(p.getSelectedProductData()).then(function(t){i.when(a.update({total:t.total,displayItems:t.displayItems})).then(function(){p.unblockPaymentRequestButton(e)})})}),i(".quantity").on("input",".qty",function(){p.blockPaymentRequestButton(e)}),i(".quantity").on("input",".qty",p.debounce(250,function(){p.blockPaymentRequestButton(e),n=[],i.when(p.getSelectedProductData()).then(function(t){t.error?(n=[t.error],p.unblockPaymentRequestButton(e)):i.when(a.update({total:t.total,displayItems:t.displayItems})).then(function(){p.unblockPaymentRequestButton(e)})})}))},attachCartPageEventListeners:function(t,e){(wc_stripe_payment_request_params.button.is_custom&&p.isCustomPaymentRequestButton(t)||wc_stripe_payment_request_params.button.is_branded&&p.isBrandedPaymentRequestButton(t))&&t.on("click",function(t){t.preventDefault(),e.show()})},showPaymentRequestButton:function(t){p.isCustomPaymentRequestButton(t)?(t.addClass("is-active"),i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show()):p.isBrandedPaymentRequestButton(t)?(i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show(),i("#wc-stripe-payment-request-button").html(t)):i("#wc-stripe-payment-request-button").length&&(i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show(),t.mount("#wc-stripe-payment-request-button"))},blockPaymentRequestButton:function(t){i("#wc-stripe-payment-request-button").data("blockUI.isBlocked")||(i("#wc-stripe-payment-request-button").block({message:null}),p.isCustomPaymentRequestButton(t)&&t.addClass("is-blocked"))},unblockPaymentRequestButton:function(t){i("#wc-stripe-payment-request-button").unblock(),p.isCustomPaymentRequestButton(t)&&t.removeClass("is-blocked")},init:function(){wc_stripe_payment_request_params.is_product_page?p.startPaymentRequest(""):p.getCartDetails()}};p.init(),i(document.body).on("updated_cart_totals",function(){p.init()}),i(document.body).on("updated_checkout",function(){p.init()})});1 jQuery(function(i){"use strict";var o,u=Stripe(wc_stripe_payment_request_params.stripe.key,{locale:"undefined"!=typeof wc_stripe_params?wc_stripe_params.stripe_locale:"auto"}),p={getAjaxURL:function(t){return wc_stripe_payment_request_params.ajax_url.toString().replace("%%endpoint%%","wc_stripe_"+t)},getCartDetails:function(){var t={security:wc_stripe_payment_request_params.nonce.payment};i.ajax({type:"POST",data:t,url:p.getAjaxURL("get_cart_details"),success:function(t){p.startPaymentRequest(t)}})},getAttributes:function(){var t=i(".variations_form").find(".variations select"),a={},n=0,r=0;return t.each(function(){var t=i(this).data("attribute_name")||i(this).attr("name"),e=i(this).val()||"";0<e.length&&r++,n++,a[t]=e}),{count:n,chosenCount:r,data:a}},processSource:function(t,e){e=p.getOrderData(t,e);return i.ajax({type:"POST",data:e,dataType:"json",url:p.getAjaxURL("create_order")})},getOrderData:function(t,e){var a=t.source,n=a.owner.email,r=a.owner.phone,s=a.owner.address,i=a.owner.name,o=t.shippingAddress,e={_wpnonce:wc_stripe_payment_request_params.nonce.checkout,billing_first_name:null!==i?i.split(" ").slice(0,1).join(" "):"",billing_last_name:null!==i?i.split(" ").slice(1).join(" "):"",billing_company:"",billing_email:null!==n?n:t.payerEmail,billing_phone:null!==r?r:t.payerPhone&&t.payerPhone.replace("/[() -]/g",""),billing_country:null!==s?s.country:"",billing_address_1:null!==s?s.line1:"",billing_address_2:null!==s?s.line2:"",billing_city:null!==s?s.city:"",billing_state:null!==s?s.state:"",billing_postcode:null!==s?s.postal_code:"",shipping_first_name:"",shipping_last_name:"",shipping_company:"",shipping_country:"",shipping_address_1:"",shipping_address_2:"",shipping_city:"",shipping_state:"",shipping_postcode:"",shipping_method:[null===t.shippingOption?null:t.shippingOption.id],order_comments:"",payment_method:"stripe",ship_to_different_address:1,terms:1,stripe_source:a.id,payment_request_type:e};return o&&(e.shipping_first_name=o.recipient.split(" ").slice(0,1).join(" "),e.shipping_last_name=o.recipient.split(" ").slice(1).join(" "),e.shipping_company=o.organization,e.shipping_country=o.country,e.shipping_address_1=void 0===o.addressLine[0]?"":o.addressLine[0],e.shipping_address_2=void 0===o.addressLine[1]?"":o.addressLine[1],e.shipping_city=o.city,e.shipping_state=o.region,e.shipping_postcode=o.postalCode),e},getErrorMessageHTML:function(t){return i('<div class="woocommerce-error" />').text(t)},displayErrorMessage:function(t){var e;i(".woocommerce-error").remove(),wc_stripe_payment_request_params.is_product_page?((e=i(".product").first()).before(t),i("html, body").animate({scrollTop:e.prev(".woocommerce-error").offset().top},600)):((e=i(".shop_table.cart").closest("form")).before(t),i("html, body").animate({scrollTop:e.prev(".woocommerce-error").offset().top},600))},abortPayment:function(t,e){t.complete("fail"),p.displayErrorMessage(e)},completePayment:function(t,e){p.block(),t.complete("success"),window.location=e},block:function(){i.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},updateShippingOptions:function(t,e){e={security:wc_stripe_payment_request_params.nonce.shipping,country:e.country,state:e.region,postcode:e.postalCode,city:e.city,address:void 0===e.addressLine[0]?"":e.addressLine[0],address_2:void 0===e.addressLine[1]?"":e.addressLine[1],payment_request_type:o,is_product_page:wc_stripe_payment_request_params.is_product_page};return i.ajax({type:"POST",data:e,url:p.getAjaxURL("get_shipping_options")})},updateShippingDetails:function(t,e){e={security:wc_stripe_payment_request_params.nonce.update_shipping,shipping_method:[e.id],payment_request_type:o,is_product_page:wc_stripe_payment_request_params.is_product_page};return i.ajax({type:"POST",data:e,url:p.getAjaxURL("update_shipping_method")})},addToCart:function(){var t=i(".single_add_to_cart_button").val();i(".single_variation_wrap").length&&(t=i(".single_variation_wrap").find('input[name="product_id"]').val());var n={security:wc_stripe_payment_request_params.nonce.add_to_cart,product_id:t,qty:i(".quantity .qty").val(),attributes:i(".variations_form").length?p.getAttributes().data:[]},t=i("form.cart").serializeArray();return i.each(t,function(t,e){var a;/^addon-/.test(e.name)&&(/\[\]$/.test(e.name)?(a=e.name.substring(0,e.name.length-2),n[a]?n[a].push(e.value):n[a]=[e.value]):n[e.name]=e.value)}),i.ajax({type:"POST",data:n,url:p.getAjaxURL("add_to_cart")})},clearCart:function(){var t={security:wc_stripe_payment_request_params.nonce.clear_cart};return i.ajax({type:"POST",data:t,url:p.getAjaxURL("clear_cart"),success:function(t){}})},getRequestOptionsFromLocal:function(){return{total:wc_stripe_payment_request_params.product.total,currency:wc_stripe_payment_request_params.checkout.currency_code,country:wc_stripe_payment_request_params.checkout.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:wc_stripe_payment_request_params.checkout.needs_payer_phone,requestShipping:wc_stripe_payment_request_params.product.requestShipping,displayItems:wc_stripe_payment_request_params.product.displayItems}},startPaymentRequest:function(t){var e,a=wc_stripe_payment_request_params.is_product_page?e=p.getRequestOptionsFromLocal():(e={total:t.order_data.total,currency:t.order_data.currency,country:t.order_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:wc_stripe_payment_request_params.checkout.needs_payer_phone,requestShipping:!!t.shipping_required,displayItems:t.order_data.displayItems},t.order_data);"PR"===e.country&&(e.country="US");try{var n=u.paymentRequest(e),r=u.elements({locale:wc_stripe_payment_request_params.button.locale}),s=p.createPaymentRequestButton(r,n);n.canMakePayment().then(function(t){t&&(o=t.applePay?"apple_pay":"payment_request_api",p.attachPaymentRequestButtonEventListeners(s,n),p.showPaymentRequestButton(s))}),n.on("shippingaddresschange",function(e){i.when(p.updateShippingOptions(a,e.shippingAddress)).then(function(t){e.updateWith({status:t.result,shippingOptions:t.shipping_options,total:t.total,displayItems:t.displayItems})})}),n.on("shippingoptionchange",function(e){i.when(p.updateShippingDetails(a,e.shippingOption)).then(function(t){"success"===t.result&&e.updateWith({status:"success",total:t.total,displayItems:t.displayItems}),"fail"===t.result&&e.updateWith({status:"fail"})})}),n.on("source",function(e){"no"===wc_stripe_payment_request_params.stripe.allow_prepaid_card&&"prepaid"===e.source.card.funding?p.abortPayment(e,p.getErrorMessageHTML(wc_stripe_payment_request_params.i18n.no_prepaid_card)):i.when(p.processSource(e,o)).then(function(t){"success"===t.result?p.completePayment(e,t.redirect):p.abortPayment(e,t.messages)})})}catch(t){console.error(t)}},getSelectedProductData:function(){var t=i(".single_add_to_cart_button").val();i(".single_variation_wrap").length&&(t=i(".single_variation_wrap").find('input[name="product_id"]').val());var e=(i("#product-addons-total").data("price_data")||[]).reduce(function(t,e){return t+e.cost},0),e={security:wc_stripe_payment_request_params.nonce.get_selected_product_data,product_id:t,qty:i(".quantity .qty").val(),attributes:i(".variations_form").length?p.getAttributes().data:[],addon_value:e};return i.ajax({type:"POST",data:e,url:p.getAjaxURL("get_selected_product_data")})},debounce:function(n,r,s){var i;return function(){var t=this,e=arguments,a=s&&!i;clearTimeout(i),i=setTimeout(function(){i=null,s||r.apply(t,e)},n),a&&r.apply(t,e)}},createPaymentRequestButton:function(t,e){var a;if(wc_stripe_payment_request_params.button.is_custom&&(a=i(wc_stripe_payment_request_params.button.css_selector)).length)return a.data("isCustom",!0),a;if(wc_stripe_payment_request_params.button.is_branded){if(p.shouldUseGooglePayBrand())return(a=p.createGooglePayButton()).data("isBranded",!0),a;wc_stripe_payment_request_params.button.type="long"===wc_stripe_payment_request_params.button.branded_type?"buy":"default"}return t.create("paymentRequestButton",{paymentRequest:e,style:{paymentRequestButton:{type:wc_stripe_payment_request_params.button.type,theme:wc_stripe_payment_request_params.button.theme,height:wc_stripe_payment_request_params.button.height+"px"}}})},isCustomPaymentRequestButton:function(t){return t&&"function"==typeof t.data&&t.data("isCustom")},isBrandedPaymentRequestButton:function(t){return t&&"function"==typeof t.data&&t.data("isBranded")},shouldUseGooglePayBrand:function(){var t=window.navigator.userAgent.toLowerCase(),e=/chrome/.test(t)&&!/edge|edg|opr|brave\//.test(t)&&"Google Inc."===window.navigator.vendor,t=e&&window.navigator.brave;return e&&!t},createGooglePayButton:function(){var t=wc_stripe_payment_request_params.button.theme,e=wc_stripe_payment_request_params.button.branded_type,a=wc_stripe_payment_request_params.button.locale,n=wc_stripe_payment_request_params.button.height,r="dark"===(t=["dark","light","light-outline"].includes(t)?t:"light")?"dark":"light",e=["short","long"].includes(e)?e:"long",s=i('<button type="button" id="wc-stripe-branded-button" aria-label="Google Pay" class="gpay-button"></button>');return s.css("height",n+"px"),s.addClass(t+" "+e),"long"===e&&function(t,e,a){t.css("background-image","url("+e+")");var n=document.createElement("img");n.onerror=function(){t.css("background-image","url("+a+")")},n.src=e}(s,"https://www.gstatic.com/instantbuy/svg/"+r+"/"+a+".svg","https://www.gstatic.com/instantbuy/svg/"+r+"/en.svg"),s},attachPaymentRequestButtonEventListeners:function(t,e){t.on("click",function(t){i("body").addClass("woocommerce-stripe-prb-clicked")}),wc_stripe_payment_request_params.is_product_page?p.attachProductPageEventListeners(t,e):p.attachCartPageEventListeners(t,e)},attachProductPageEventListeners:function(e,a){var n=[],r=i(".single_add_to_cart_button");e.on("click",function(t){return r.is(".disabled")?(t.preventDefault(),void(r.is(".wc-variation-is-unavailable")?window.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):r.is(".wc-variation-selection-needed")&&window.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text))):0<n.length?(t.preventDefault(),void window.alert(n)):(p.addToCart(),void((p.isCustomPaymentRequestButton(e)||p.isBrandedPaymentRequestButton(e))&&(t.preventDefault(),a.show())))}),i(document.body).on("wc_stripe_unblock_payment_request_button wc_stripe_enable_payment_request_button",function(){p.unblockPaymentRequestButton()}),i(document.body).on("wc_stripe_block_payment_request_button",function(){p.blockPaymentRequestButton("wc_request_button_is_blocked")}),i(document.body).on("wc_stripe_disable_payment_request_button",function(){p.blockPaymentRequestButton("wc_request_button_is_disabled")}),i(document.body).on("woocommerce_variation_has_changed",function(){i(document.body).trigger("wc_stripe_block_payment_request_button"),i.when(p.getSelectedProductData()).then(function(t){i.when(a.update({total:t.total,displayItems:t.displayItems})).then(function(){i(document.body).trigger("wc_stripe_unblock_payment_request_button")})})}),i(".quantity").on("input",".qty",function(){i(document.body).trigger("wc_stripe_block_payment_request_button")}),i(".quantity").on("input",".qty",p.debounce(250,function(){i(document.body).trigger("wc_stripe_block_payment_request_button"),n=[],i.when(p.getSelectedProductData()).then(function(t){t.error?(n=[t.error],i(document.body).trigger("wc_stripe_unblock_payment_request_button")):i.when(a.update({total:t.total,displayItems:t.displayItems})).then(function(){i(document.body).trigger("wc_stripe_unblock_payment_request_button")})})}))},attachCartPageEventListeners:function(t,e){(wc_stripe_payment_request_params.button.is_custom&&p.isCustomPaymentRequestButton(t)||wc_stripe_payment_request_params.button.is_branded&&p.isBrandedPaymentRequestButton(t))&&t.on("click",function(t){t.preventDefault(),e.show()})},showPaymentRequestButton:function(t){p.isCustomPaymentRequestButton(t)?(t.addClass("is-active"),i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show()):p.isBrandedPaymentRequestButton(t)?(i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show(),i("#wc-stripe-payment-request-button").html(t)):i("#wc-stripe-payment-request-button").length&&(i("#wc-stripe-payment-request-wrapper, #wc-stripe-payment-request-button-separator").show(),t.mount("#wc-stripe-payment-request-button"))},blockPaymentRequestButton:function(t){i("#wc-stripe-payment-request-button").data("blockUI.isBlocked")||i("#wc-stripe-payment-request-button").addClass(t).block({message:null})},unblockPaymentRequestButton:function(){i("#wc-stripe-payment-request-button").removeClass(["wc_request_button_is_blocked","wc_request_button_is_disabled"]).unblock()},init:function(){wc_stripe_payment_request_params.is_product_page?p.startPaymentRequest(""):p.getCartDetails()}};p.init(),i(document.body).on("updated_cart_totals",function(){p.init()}),i(document.body).on("updated_checkout",function(){p.init()})}); -
woocommerce-gateway-stripe/trunk/assets/js/stripe.js
r2444507 r2534245 5 5 6 6 try { 7 var stripe = Stripe( wc_stripe_params.key ); 7 var stripe = Stripe( wc_stripe_params.key, { 8 locale: wc_stripe_params.stripe_locale || 'auto', 9 } ); 8 10 } catch( error ) { 9 11 console.log( error ); -
woocommerce-gateway-stripe/trunk/assets/js/stripe.min.js
r2444507 r2534245 1 jQuery(function( c){"use strict";try{var n=Stripe(wc_stripe_params.key)}catch(e){return void console.log(e)}var t,o,i,e=Object.keys(wc_stripe_params.elements_options).length?wc_stripe_params.elements_options:{},r=Object.keys(wc_stripe_params.sepa_elements_options).length?wc_stripe_params.sepa_elements_options:{},s=n.elements(e),a=s.create("iban",r),m={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?t.unmount("#stripe-card-element"):(t.unmount("#stripe-card-element"),o.unmount("#stripe-exp-element"),i.unmount("#stripe-cvc-element"))},mountElements:function(){c("#stripe-card-element").length&&("yes"!==wc_stripe_params.inline_cc_form?(t.mount("#stripe-card-element"),o.mount("#stripe-exp-element"),i.mount("#stripe-cvc-element")):t.mount("#stripe-card-element"))},createElements:function(){var e={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},r={focus:"focused",empty:"empty",invalid:"invalid"};e=wc_stripe_params.elements_styling?wc_stripe_params.elements_styling:e,r=wc_stripe_params.elements_classes?wc_stripe_params.elements_classes:r,"yes"===wc_stripe_params.inline_cc_form?(t=s.create("card",{style:e,hidePostalCode:!0})).addEventListener("change",function(e){m.onCCFormChange(),e.error&&c(document.body).trigger("stripeError",e)}):(t=s.create("cardNumber",{style:e,classes:r}),o=s.create("cardExpiry",{style:e,classes:r}),i=s.create("cardCvc",{style:e,classes:r}),t.addEventListener("change",function(e){m.onCCFormChange(),m.updateCardBrand(e.brand),e.error&&c(document.body).trigger("stripeError",e)}),o.addEventListener("change",function(e){m.onCCFormChange(),e.error&&c(document.body).trigger("stripeError",e)}),i.addEventListener("change",function(e){m.onCCFormChange(),e.error&&c(document.body).trigger("stripeError",e)})),"yes"===wc_stripe_params.is_checkout?c(document.body).on("updated_checkout",function(){c("#stripe-card-element").children().length||(t&&m.unmountElements(),m.mountElements(),c("#stripe-iban-element").length&&a.mount("#stripe-iban-element"))}):(c("form#add_payment_method").length||c("form#order_review").length)&&(m.mountElements(),c("#stripe-iban-element").length&&a.mount("#stripe-iban-element"))},updateCardBrand:function(e){var r={visa:"stripe-visa-brand",mastercard:"stripe-mastercard-brand",amex:"stripe-amex-brand",discover:"stripe-discover-brand",diners:"stripe-diners-brand",jcb:"stripe-jcb-brand",unknown:"stripe-credit-card-brand"},t=c(".stripe-card-brand"),o="stripe-credit-card-brand";e in r&&(o=r[e]),c.each(r,function(e,r){t.removeClass(r)}),t.addClass(o)},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||c(document.body).trigger("wc-credit-card-form-init"),c("form.woocommerce-checkout").length&&(this.form=c("form.woocommerce-checkout")),c("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa",this.onSubmit),c("form#order_review").length&&(this.form=c("form#order_review")),c("form#order_review, form#add_payment_method").on("submit",this.onSubmit),c("form#add_payment_method").length&&(this.form=c("form#add_payment_method")),c("form.woocommerce-checkout").on("change",this.reset),c(document).on("stripeError",this.onError).on("checkout_error",this.reset),a.on("change",this.onSepaError),c("#early_renewal_modal_submit").on("click",this.onEarlyRenewalSubmit),m.createElements(),window.addEventListener("hashchange",m.onHashChange),m.maybeConfirmIntent()},isStripeChosen:function(){return c("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_eps, #payment_method_stripe_multibanco").is(":checked")||c("#payment_method_stripe").is(":checked")&&"new"===c('input[name="wc-stripe-payment-token"]:checked').val()||c("#payment_method_stripe_sepa").is(":checked")&&"new"===c('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return c("#payment_method_stripe").is(":checked")&&c('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==c('input[name="wc-stripe-payment-token"]:checked').val()||c("#payment_method_stripe_sepa").is(":checked")&&c('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==c('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return c("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return c("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return c("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return c("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return c("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return c("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return c("#payment_method_stripe_sepa").is(":checked")},isP24Chosen:function(){return c("#payment_method_stripe_p24").is(":checked")},isEpsChosen:function(){return c("#payment_method_stripe_eps").is(":checked")},isMultibancoChosen:function(){return c("#payment_method_stripe_multibanco").is(":checked")},hasSource:function(){return 0<c("input.stripe-source").length},isMobile:function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},block:function(){m.isMobile()||m.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){m.form&&m.form.unblock()},getSelectedPaymentElement:function(){return c('.payment_methods input[name="payment_method"]:checked')},getOwnerDetails:function(){var e=c("#billing_first_name").length?c("#billing_first_name").val():wc_stripe_params.billing_first_name,r=c("#billing_last_name").length?c("#billing_last_name").val():wc_stripe_params.billing_last_name,t={name:"",address:{},email:"",phone:""};return t.name=e,t.name=e&&r?e+" "+r:c("#stripe-payment-data").data("full-name"),t.email=c("#billing_email").val(),t.phone=c("#billing_phone").val(),(void 0===t.phone||t.phone.length<=0)&&delete t.phone,(void 0===t.email||t.email.length<=0)&&(c("#stripe-payment-data").data("email").length?t.email=c("#stripe-payment-data").data("email"):delete t.email),(void 0===t.name||t.name.length<=0)&&delete t.name,t.address.line1=c("#billing_address_1").val()||wc_stripe_params.billing_address_1,t.address.line2=c("#billing_address_2").val()||wc_stripe_params.billing_address_2,t.address.state=c("#billing_state").val()||wc_stripe_params.billing_state,t.address.city=c("#billing_city").val()||wc_stripe_params.billing_city,t.address.postal_code=c("#billing_postcode").val()||wc_stripe_params.billing_postcode,t.address.country=c("#billing_country").val()||wc_stripe_params.billing_country,{owner:t}},createSource:function(){var e=m.getOwnerDetails();return m.isSepaChosen()?(e.currency=c("#stripe-sepa_debit-payment-data").data("currency"),e.mandate={notification_method:wc_stripe_params.sepa_mandate_notification},e.type="sepa_debit",n.createSource(a,e).then(m.sourceResponse)):n.createSource(t,e).then(m.sourceResponse)},sourceResponse:function(e){e.error?c(document.body).trigger("stripeError",e):(m.reset(),m.form.append(c('<input type="hidden" />').addClass("stripe-source").attr("name","stripe_source").val(e.source.id)),c("form#add_payment_method").length||c("#wc-stripe-change-payment-method").length?m.sourceSetup(e):m.form.trigger("submit"))},sourceSetup:function(r){var e={error:{type:"api_connection_error"}};c.post({url:m.getAjaxURL("create_setup_intent"),dataType:"json",data:{stripe_source_id:r.source.id,nonce:wc_stripe_params.add_card_nonce},error:function(){c(document.body).trigger("stripeError",e)}}).done(function(e){if("success"===e.status)return c("form#add_payment_method").length&&c(m.form).off("submit",m.form.onSubmit),void m.form.trigger("submit");"requires_action"===e.status?n.confirmCardSetup(e.client_secret,{payment_method:r.source.id}).then(function(e){e.error?c(document.body).trigger("stripeError",e):(c("form#add_payment_method").length&&c(m.form).off("submit",m.form.onSubmit),m.form.trigger("submit"))}).catch(function(e){console.log(e),c(document.body).trigger("stripeError",{error:e})}):c(document.body).trigger("stripeError",e)})},onSubmit:function(){return!m.isStripeChosen()||(!(!m.isStripeSaveCardChosen()&&!m.hasSource())||(!!(m.isBancontactChosen()||m.isGiropayChosen()||m.isIdealChosen()||m.isAlipayChosen()||m.isSofortChosen()||m.isP24Chosen()||m.isEpsChosen()||m.isMultibancoChosen())||(m.block(),m.createSource(),!1)))},onCCFormChange:function(){m.reset()},reset:function(){c(".wc-stripe-error, .stripe-source").remove()},onSepaError:function(e){var r=m.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");e.error?(console.log(e.error.message),c(r).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),c(r).find("li").text(e.error.message)):c(r).html("")},onError:function(e,r){var t,o=r.error.message,n=m.getSelectedPaymentElement().closest("li"),i=n.find(".woocommerce-SavedPaymentMethods-tokenInput");if(c("body").hasClass("woocommerce-stripe-prb-clicked"))c("body").removeClass("woocommerce-stripe-prb-clicked"),t=c("div.woocommerce-notices-wrapper").first();else if(i.length){var s=i.filter(":checked");t=s.closest(".woocommerce-SavedPaymentMethods-new").length?c("#wc-stripe-cc-form .stripe-source-errors"):s.closest("li").find(".stripe-source-errors")}else t=n.find(".stripe-source-errors");if(m.isSepaChosen()&&"invalid_owner_name"===r.error.code&&wc_stripe_params.hasOwnProperty(r.error.code)){var a=c('<div><ul class="woocommerce-error"><li /></ul></div>');return a.find("li").text(wc_stripe_params[r.error.code]),void m.submitError(a.html())}"email_invalid"===r.error.code?o=wc_stripe_params.email_invalid:"invalid_request_error"!==r.error.type&&"api_connection_error"!==r.error.type&&"api_error"!==r.error.type&&"authentication_error"!==r.error.type&&"rate_limit_error"!==r.error.type||(o=wc_stripe_params.invalid_request_error),"card_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(o=wc_stripe_params[r.error.code]),"validation_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(o=wc_stripe_params[r.error.code]),m.reset(),c(".woocommerce-NoticeGroup-checkout").remove(),console.log(r.error.message),c(t).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),c(t).find("li").text(o),c(".wc-stripe-error").length&&c("html, body").animate({scrollTop:c(".wc-stripe-error").offset().top-200},200),m.unblock(),c.unblockUI()},submitError:function(e){c(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),m.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),m.form.removeClass("processing").unblock(),m.form.find(".input-text, select, input:checkbox").trigger("blur");var r="";c("#add_payment_method").length&&(r=c("#add_payment_method")),c("#order_review").length&&(r=c("#order_review")),c("form.checkout").length&&(r=c("form.checkout")),r.length&&c("html, body").animate({scrollTop:r.offset().top-100},500),c(document.body).trigger("checkout_error"),m.unblock()},onHashChange:function(){var e=window.location.hash.match(/^#?confirm-(pi|si)-([^:]+):(.+)$/);if(e&&!(e.length<4)){var r=e[1],t=e[2],o=decodeURIComponent(e[3]);window.location.hash="",m.openIntentModal(t,o,!1,"si"===r)}},maybeConfirmIntent:function(){if(c("#stripe-intent-id").length&&c("#stripe-intent-return").length){var e=c("#stripe-intent-id").val(),r=c("#stripe-intent-return").val();m.openIntentModal(e,r,!0,!1)}},openIntentModal:function(e,t,r,o){n[o?"handleCardSetup":"handleCardPayment"](e).then(function(e){if(e.error)throw e.error;var r=e[o?"setupIntent":"paymentIntent"];"requires_capture"!==r.status&&"succeeded"!==r.status||(window.location=t)}).catch(function(e){r?window.location=t:(c(document.body).trigger("stripeError",{error:e}),m.form&&m.form.removeClass("processing"),c.get(t+"&is_ajax"))})},onEarlyRenewalSubmit:function(e){return e.preventDefault(),c.ajax({url:c("#early_renewal_modal_submit").attr("href"),method:"get",success:function(e){var r=JSON.parse(e);r.stripe_sca_required?m.openIntentModal(r.intent_secret,r.redirect_url,!0,!1):window.location=r.redirect_url}}),!1}};m.init()});1 jQuery(function(a){"use strict";try{var n=Stripe(wc_stripe_params.key,{locale:wc_stripe_params.stripe_locale||"auto"})}catch(e){return void console.log(e)}var t,o,i,e=Object.keys(wc_stripe_params.elements_options).length?wc_stripe_params.elements_options:{},r=Object.keys(wc_stripe_params.sepa_elements_options).length?wc_stripe_params.sepa_elements_options:{},s=n.elements(e),c=s.create("iban",r),m={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?t.unmount("#stripe-card-element"):(t.unmount("#stripe-card-element"),o.unmount("#stripe-exp-element"),i.unmount("#stripe-cvc-element"))},mountElements:function(){a("#stripe-card-element").length&&("yes"!==wc_stripe_params.inline_cc_form?(t.mount("#stripe-card-element"),o.mount("#stripe-exp-element"),i.mount("#stripe-cvc-element")):t.mount("#stripe-card-element"))},createElements:function(){var e={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},r={focus:"focused",empty:"empty",invalid:"invalid"},e=wc_stripe_params.elements_styling||e,r=wc_stripe_params.elements_classes||r;"yes"===wc_stripe_params.inline_cc_form?(t=s.create("card",{style:e,hidePostalCode:!0})).addEventListener("change",function(e){m.onCCFormChange(),e.error&&a(document.body).trigger("stripeError",e)}):(t=s.create("cardNumber",{style:e,classes:r}),o=s.create("cardExpiry",{style:e,classes:r}),i=s.create("cardCvc",{style:e,classes:r}),t.addEventListener("change",function(e){m.onCCFormChange(),m.updateCardBrand(e.brand),e.error&&a(document.body).trigger("stripeError",e)}),o.addEventListener("change",function(e){m.onCCFormChange(),e.error&&a(document.body).trigger("stripeError",e)}),i.addEventListener("change",function(e){m.onCCFormChange(),e.error&&a(document.body).trigger("stripeError",e)})),"yes"===wc_stripe_params.is_checkout?a(document.body).on("updated_checkout",function(){a("#stripe-card-element").children().length||(t&&m.unmountElements(),m.mountElements(),a("#stripe-iban-element").length&&c.mount("#stripe-iban-element"))}):(a("form#add_payment_method").length||a("form#order_review").length)&&(m.mountElements(),a("#stripe-iban-element").length&&c.mount("#stripe-iban-element"))},updateCardBrand:function(e){var r={visa:"stripe-visa-brand",mastercard:"stripe-mastercard-brand",amex:"stripe-amex-brand",discover:"stripe-discover-brand",diners:"stripe-diners-brand",jcb:"stripe-jcb-brand",unknown:"stripe-credit-card-brand"},t=a(".stripe-card-brand"),e=e in r?r[e]:"stripe-credit-card-brand";a.each(r,function(e,r){t.removeClass(r)}),t.addClass(e)},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||a(document.body).trigger("wc-credit-card-form-init"),a("form.woocommerce-checkout").length&&(this.form=a("form.woocommerce-checkout")),a("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa",this.onSubmit),a("form#order_review").length&&(this.form=a("form#order_review")),a("form#order_review, form#add_payment_method").on("submit",this.onSubmit),a("form#add_payment_method").length&&(this.form=a("form#add_payment_method")),a("form.woocommerce-checkout").on("change",this.reset),a(document).on("stripeError",this.onError).on("checkout_error",this.reset),c.on("change",this.onSepaError),a("#early_renewal_modal_submit").on("click",this.onEarlyRenewalSubmit),m.createElements(),window.addEventListener("hashchange",m.onHashChange),m.maybeConfirmIntent()},isStripeChosen:function(){return a("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_eps, #payment_method_stripe_multibanco").is(":checked")||a("#payment_method_stripe").is(":checked")&&"new"===a('input[name="wc-stripe-payment-token"]:checked').val()||a("#payment_method_stripe_sepa").is(":checked")&&"new"===a('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return a("#payment_method_stripe").is(":checked")&&a('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==a('input[name="wc-stripe-payment-token"]:checked').val()||a("#payment_method_stripe_sepa").is(":checked")&&a('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==a('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return a("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return a("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return a("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return a("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return a("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return a("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return a("#payment_method_stripe_sepa").is(":checked")},isP24Chosen:function(){return a("#payment_method_stripe_p24").is(":checked")},isEpsChosen:function(){return a("#payment_method_stripe_eps").is(":checked")},isMultibancoChosen:function(){return a("#payment_method_stripe_multibanco").is(":checked")},hasSource:function(){return 0<a("input.stripe-source").length},isMobile:function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},block:function(){m.isMobile()||m.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){m.form&&m.form.unblock()},getSelectedPaymentElement:function(){return a('.payment_methods input[name="payment_method"]:checked')},getOwnerDetails:function(){var e=a("#billing_first_name").length?a("#billing_first_name").val():wc_stripe_params.billing_first_name,r=a("#billing_last_name").length?a("#billing_last_name").val():wc_stripe_params.billing_last_name,t={name:"",address:{},email:"",phone:""};return t.name=e,t.name=e&&r?e+" "+r:a("#stripe-payment-data").data("full-name"),t.email=a("#billing_email").val(),t.phone=a("#billing_phone").val(),(void 0===t.phone||t.phone.length<=0)&&delete t.phone,(void 0===t.email||t.email.length<=0)&&(a("#stripe-payment-data").data("email").length?t.email=a("#stripe-payment-data").data("email"):delete t.email),(void 0===t.name||t.name.length<=0)&&delete t.name,t.address.line1=a("#billing_address_1").val()||wc_stripe_params.billing_address_1,t.address.line2=a("#billing_address_2").val()||wc_stripe_params.billing_address_2,t.address.state=a("#billing_state").val()||wc_stripe_params.billing_state,t.address.city=a("#billing_city").val()||wc_stripe_params.billing_city,t.address.postal_code=a("#billing_postcode").val()||wc_stripe_params.billing_postcode,t.address.country=a("#billing_country").val()||wc_stripe_params.billing_country,{owner:t}},createSource:function(){var e=m.getOwnerDetails();return m.isSepaChosen()?(e.currency=a("#stripe-sepa_debit-payment-data").data("currency"),e.mandate={notification_method:wc_stripe_params.sepa_mandate_notification},e.type="sepa_debit",n.createSource(c,e).then(m.sourceResponse)):n.createSource(t,e).then(m.sourceResponse)},sourceResponse:function(e){e.error?a(document.body).trigger("stripeError",e):(m.reset(),m.form.append(a('<input type="hidden" />').addClass("stripe-source").attr("name","stripe_source").val(e.source.id)),a("form#add_payment_method").length||a("#wc-stripe-change-payment-method").length?m.sourceSetup(e):m.form.trigger("submit"))},sourceSetup:function(r){var e={error:{type:"api_connection_error"}};a.post({url:m.getAjaxURL("create_setup_intent"),dataType:"json",data:{stripe_source_id:r.source.id,nonce:wc_stripe_params.add_card_nonce},error:function(){a(document.body).trigger("stripeError",e)}}).done(function(e){return"success"===e.status?(a("form#add_payment_method").length&&a(m.form).off("submit",m.form.onSubmit),void m.form.trigger("submit")):void("requires_action"===e.status?n.confirmCardSetup(e.client_secret,{payment_method:r.source.id}).then(function(e){e.error?a(document.body).trigger("stripeError",e):(a("form#add_payment_method").length&&a(m.form).off("submit",m.form.onSubmit),m.form.trigger("submit"))}).catch(function(e){console.log(e),a(document.body).trigger("stripeError",{error:e})}):a(document.body).trigger("stripeError",e))})},onSubmit:function(){return!m.isStripeChosen()||(!(!m.isStripeSaveCardChosen()&&!m.hasSource())||(!!(m.isBancontactChosen()||m.isGiropayChosen()||m.isIdealChosen()||m.isAlipayChosen()||m.isSofortChosen()||m.isP24Chosen()||m.isEpsChosen()||m.isMultibancoChosen())||(m.block(),m.createSource(),!1)))},onCCFormChange:function(){m.reset()},reset:function(){a(".wc-stripe-error, .stripe-source").remove()},onSepaError:function(e){var r=m.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");e.error?(console.log(e.error.message),a(r).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),a(r).find("li").text(e.error.message)):a(r).html("")},onError:function(e,r){var t,o=r.error.message,n=m.getSelectedPaymentElement().closest("li"),i=n.find(".woocommerce-SavedPaymentMethods-tokenInput"),s=a("body").hasClass("woocommerce-stripe-prb-clicked");if(t=s?(a("body").removeClass("woocommerce-stripe-prb-clicked"),a("div.woocommerce-notices-wrapper").first()):i.length?(t=i.filter(":checked")).closest(".woocommerce-SavedPaymentMethods-new").length?a("#wc-stripe-cc-form .stripe-source-errors"):t.closest("li").find(".stripe-source-errors"):n.find(".stripe-source-errors"),m.isSepaChosen()&&"invalid_owner_name"===r.error.code&&wc_stripe_params.hasOwnProperty(r.error.code)){n=a('<div><ul class="woocommerce-error"><li /></ul></div>');return n.find("li").text(wc_stripe_params[r.error.code]),void m.submitError(n.html())}"email_invalid"===r.error.code?o=wc_stripe_params.email_invalid:"invalid_request_error"!==r.error.type&&"api_connection_error"!==r.error.type&&"api_error"!==r.error.type&&"authentication_error"!==r.error.type&&"rate_limit_error"!==r.error.type||(o=wc_stripe_params.invalid_request_error),"card_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(o=wc_stripe_params[r.error.code]),"validation_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(o=wc_stripe_params[r.error.code]),m.reset(),a(".woocommerce-NoticeGroup-checkout").remove(),console.log(r.error.message),a(t).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li /></ul>'),a(t).find("li").text(o),a(".wc-stripe-error").length&&a("html, body").animate({scrollTop:a(".wc-stripe-error").offset().top-200},200),m.unblock(),a.unblockUI()},submitError:function(e){a(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),m.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),m.form.removeClass("processing").unblock(),m.form.find(".input-text, select, input:checkbox").trigger("blur");e="";a("#add_payment_method").length&&(e=a("#add_payment_method")),a("#order_review").length&&(e=a("#order_review")),(e=a("form.checkout").length?a("form.checkout"):e).length&&a("html, body").animate({scrollTop:e.offset().top-100},500),a(document.body).trigger("checkout_error"),m.unblock()},onHashChange:function(){var e,r,t=window.location.hash.match(/^#?confirm-(pi|si)-([^:]+):(.+)$/);!t||t.length<4||(e=t[1],r=t[2],t=decodeURIComponent(t[3]),window.location.hash="",m.openIntentModal(r,t,!1,"si"===e))},maybeConfirmIntent:function(){var e,r;a("#stripe-intent-id").length&&a("#stripe-intent-return").length&&(e=a("#stripe-intent-id").val(),r=a("#stripe-intent-return").val(),m.openIntentModal(e,r,!0,!1))},openIntentModal:function(e,r,t,o){n[o?"handleCardSetup":"handleCardPayment"](e).then(function(e){if(e.error)throw e.error;e=e[o?"setupIntent":"paymentIntent"];"requires_capture"!==e.status&&"succeeded"!==e.status||(window.location=r)}).catch(function(e){t?window.location=r:(a(document.body).trigger("stripeError",{error:e}),m.form&&m.form.removeClass("processing"),a.get(r+"&is_ajax"))})},onEarlyRenewalSubmit:function(e){return e.preventDefault(),a.ajax({url:a("#early_renewal_modal_submit").attr("href"),method:"get",success:function(e){e=JSON.parse(e);e.stripe_sca_required?m.openIntentModal(e.intent_secret,e.redirect_url,!0,!1):window.location=e.redirect_url}}),!1}};m.init()}); -
woocommerce-gateway-stripe/trunk/changelog.txt
r2511074 r2534245 1 1 *** Changelog *** 2 3 = 5.2.0 - 2021-05-19 = 4 * Fix - Use `get_parent` method to avoid accessing `order` subscription property directly. 5 * Fix - Orders won't transition to 'Refunded' state if refund can't be created. 6 * Fix - Normalize United Kingdom and Canada postal codes for Apple Pay. 7 * Fix - Subscription sign-up fees not included in total for Payment Request Button. 8 * Fix - Reduce requests sent to server from stripe settings page. 9 * Fix - Choose the appropriate version of the WooCommerce Admin Notes API based on which API is available. 10 * Fix - Customer information is now correctly displayed in the Stripe Payments Dashboard when a new customer checks out through the WooCommerce Checkout Block. 11 * Fix - Pass customer language/locale to Stripe upon creation or modification. 12 * Fix - Initial price for Variable Products is now correctly shown when a Payment Request is started. 13 * Add - Support for Credit Card payments (incl. 3DS payments) via WooCommerce Blocks; limited to WooCommerce Core product types. 14 * Add - Support for payments (incl. 3DS payments) paid via Payment Request Buttons in WooCommerce Blocks; limited to WooCommerce Core product types. 15 * Add - Support for custom and branded Payment Request Buttons when using the Cart and Checkout blocks. 16 * Tweak - Should customer opt to save their card, the card is now saved after a payment has been confirmed. 17 2 18 = 5.1.0 - 2021-04-07 = 3 19 * Fix - Don't attempt to submit level 3 data for non-US merchants. -
woocommerce-gateway-stripe/trunk/includes/abstracts/abstract-wc-stripe-payment-gateway.php
r2497960 r2534245 119 119 $error && 120 120 'invalid_request_error' === $error->type && 121 preg_match( '/No such source/i', $error->message )121 preg_match( '/No such (source|PaymentMethod)/i', $error->message ) 122 122 ); 123 123 } … … 187 187 188 188 return parent::is_available(); 189 } 190 191 public function save_payment_method_requested() { 192 $payment_method = isset( $_POST['payment_method'] ) ? wc_clean( wp_unslash( $_POST['payment_method'] ) ) : 'stripe'; 193 194 return isset( $_POST[ 'wc-' . $payment_method . '-new-payment-method' ] ) && ! empty( $_POST[ 'wc-' . $payment_method . '-new-payment-method' ] ); 189 195 } 190 196 … … 636 642 */ 637 643 if ( ( $user_id && $this->saved_cards && $maybe_saved_card && 'reusable' === $source_object->usage ) || $force_save_source ) { 638 $response = $customer->a dd_source( $source_object->id );644 $response = $customer->attach_source( $source_object->id ); 639 645 640 646 if ( ! empty( $response->error ) ) { … … 666 672 // This is true if the user wants to store the card to their account. 667 673 if ( ( $user_id && $this->saved_cards && $maybe_saved_card ) || $force_save_source ) { 668 $response = $customer->a dd_source( $stripe_token );674 $response = $customer->attach_source( $stripe_token ); 669 675 670 676 if ( ! empty( $response->error ) ) { … … 674 680 throw new WC_Stripe_Exception( $response->get_error_message(), $response->get_error_message() ); 675 681 } 676 $source_id = $response ;682 $source_id = $response->id; 677 683 } else { 678 684 $source_id = $stripe_token; … … 913 919 WC_Stripe_Logger::log( 'Error: ' . $response->error->message ); 914 920 915 return $response; 921 return new WP_Error( 922 'stripe_error', 923 sprintf( 924 /* translators: %1$s is a stripe error message */ 925 __( 'There was a problem initiating a refund: %1$s', 'woocommerce-gateway-stripe' ), 926 $response->error->message 927 ) 928 ); 916 929 917 930 } elseif ( ! empty( $response->id ) ) { … … 1080 1093 ], 1081 1094 ]; 1095 1096 $force_save_source = apply_filters( 'wc_stripe_force_save_source', false, $prepared_source->source ); 1097 1098 if ( $this->save_payment_method_requested() || $force_save_source ) { 1099 $request['setup_future_usage'] = 'off_session'; 1100 $request['metadata']['save_payment_method'] = 'true'; 1101 } 1082 1102 1083 1103 if ( $prepared_source->customer ) { -
woocommerce-gateway-stripe/trunk/includes/admin/class-wc-stripe-inbox-notes.php
r2497960 r2534245 1 1 <?php 2 2 3 if ( ! defined( 'ABSPATH' ) ) { 3 4 exit; 4 5 } 5 6 use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;7 use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;8 6 9 7 /** … … 50 48 */ 51 49 public static function notify_on_apple_pay_domain_verification( $verification_complete ) { 52 if ( ! class_exists( 'Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes' ) ) { 53 return; 54 } 55 56 if ( ! class_exists( 'WC_Data_Store' ) ) { 50 $admin_notes_class = WC_Stripe_Woo_Compat_Utils::get_notes_class(); 51 if ( ! class_exists( $admin_notes_class ) || ! class_exists( 'WC_Data_Store' ) ) { 57 52 return; 58 53 } … … 64 59 while ( ! empty( $failure_note_ids ) ) { 65 60 $note_id = array_pop( $failure_note_ids ); 66 $note = WC_Admin_Notes::get_note( $note_id );61 $note = $admin_notes_class::get_note( $note_id ); 67 62 $note->delete(); 68 63 } … … 122 117 123 118 try { 124 $note = new WC_Admin_Note(); 119 $admin_note_class = WC_Stripe_Woo_Compat_Utils::get_note_class(); 120 $note = new $admin_note_class(); 125 121 $note->set_title( self::get_success_title() ); 126 122 $note->set_content( __( 'Now that you accept Apple Pay® with Stripe, you can increase conversion rates by letting your customers know that Apple Pay is available. Here’s a marketing guide to help you get started.', 'woocommerce-gateway-stripe' ) ); 127 $note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_MARKETING );123 $note->set_type( $admin_note_class::E_WC_ADMIN_NOTE_MARKETING ); 128 124 $note->set_name( self::SUCCESS_NOTE_NAME ); 129 125 $note->set_source( 'woocommerce-gateway-stripe' ); … … 142 138 public static function create_failure_note() { 143 139 try { 144 $note = new WC_Admin_Note(); 140 $admin_note_class = WC_Stripe_Woo_Compat_Utils::get_note_class(); 141 $note = new $admin_note_class(); 145 142 $note->set_title( __( 'Apple Pay domain verification needed', 'woocommerce-gateway-stripe' ) ); 146 143 $note->set_content( __( 'The WooCommerce Stripe Gateway extension attempted to perform domain verification on behalf of your store, but was unable to do so. This must be resolved before Apple Pay can be offered to your customers.', 'woocommerce-gateway-stripe' ) ); 147 $note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL );144 $note->set_type( $admin_note_class::E_WC_ADMIN_NOTE_INFORMATIONAL ); 148 145 $note->set_name( self::FAILURE_NOTE_NAME ); 149 146 $note->set_source( 'woocommerce-gateway-stripe' ); … … 163 160 */ 164 161 public static function cleanup_campaign_2020() { 165 if ( ! class_exists( 'Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes' ) ) { 166 return; 167 } 168 169 if ( ! class_exists( 'WC_Data_Store' ) ) { 162 $admin_notes_class = WC_Stripe_Woo_Compat_Utils::get_notes_class(); 163 if ( ! class_exists( $admin_notes_class ) || ! class_exists( 'WC_Data_Store' ) ) { 170 164 return; 171 165 } … … 185 179 $deleted_an_unactioned_note = false; 186 180 181 $admin_note_class = WC_Stripe_Woo_Compat_Utils::get_note_class(); 187 182 foreach ( (array) $note_ids as $note_id ) { 188 183 try { 189 $note = new WC_Admin_Note( $note_id );190 if ( WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED == $note->get_status() ) {184 $note = new $admin_note_class( $note_id ); 185 if ( $admin_note_class::E_WC_ADMIN_NOTE_UNACTIONED == $note->get_status() ) { 191 186 $note->delete(); 192 187 $deleted_an_unactioned_note = true; -
woocommerce-gateway-stripe/trunk/includes/admin/stripe-settings.php
r2497960 r2534245 2 2 if ( ! defined( 'ABSPATH' ) ) { 3 3 exit; 4 }5 6 if ( woocommerce_gateway_stripe()->connect->is_connected() ) {7 $reset_link = add_query_arg(8 [9 '_wpnonce' => wp_create_nonce( 'reset_stripe_api_credentials' ),10 'reset_stripe_api_credentials' => true,11 ],12 admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=stripe' )13 );14 15 $api_credentials_text = sprintf(16 /* translators: %1, %2, %3, and %4 are all HTML markup tags */17 __( '%1$sClear all Stripe account keys.%2$s %3$sThis will disable any connection to Stripe.%4$s', 'woocommerce-gateway-stripe' ),18 '<a id="wc_stripe_connect_button" href="' . $reset_link . '" class="button button-secondary">',19 '</a>',20 '<span style="color:red;">',21 '</span>'22 );23 } else {24 $oauth_url = woocommerce_gateway_stripe()->connect->get_oauth_url();25 26 if ( ! is_wp_error( $oauth_url ) ) {27 $api_credentials_text = sprintf(28 /* translators: %1, %2 and %3 are all HTML markup tags */29 __( '%1$sSetup or link an existing Stripe account.%2$s By clicking this button you agree to the %3$sTerms of Service%2$s. Or, manually enter Stripe account keys below.', 'woocommerce-gateway-stripe' ),30 '<a id="wc_stripe_connect_button" href="' . $oauth_url . '" class="button button-primary">',31 '</a>',32 '<a href="https://wordpress.com/tos">'33 );34 } else {35 $api_credentials_text = __( 'Manually enter Stripe keys below.', 'woocommerce-gateway-stripe' );36 }37 4 } 38 5 … … 63 30 'api_credentials' => [ 64 31 'title' => __( 'Stripe Account Keys', 'woocommerce-gateway-stripe' ), 65 'type' => 'title', 66 'description' => $api_credentials_text, 32 'type' => 'stripe_account_keys', 67 33 ], 68 34 'testmode' => [ -
woocommerce-gateway-stripe/trunk/includes/class-wc-gateway-stripe.php
r2497960 r2534245 443 443 ); 444 444 445 $stripe_params['stripe_locale'] = WC_Stripe_Helper::convert_wc_locale_to_stripe_locale( get_locale() ); 445 446 $stripe_params['no_prepaid_card_msg'] = __( 'Sorry, we\'re not accepting prepaid cards at this time. Your credit card has not been charged. Please try with alternative payment method.', 'woocommerce-gateway-stripe' ); 446 447 $stripe_params['no_sepa_owner_msg'] = __( 'Please enter your IBAN account name.', 'woocommerce-gateway-stripe' ); … … 628 629 } 629 630 631 $force_save_source_value = apply_filters( 'wc_stripe_force_save_source', $force_save_source, $prepared_source->source ); 632 633 if ( 'succeeded' === $intent->status && ! $this->is_using_saved_payment_method() && ( $this->save_payment_method_requested() || $force_save_source_value ) ) { 634 $this->save_payment_method( $prepared_source->source_object ); 635 } 636 630 637 if ( ! empty( $intent->error ) ) { 631 638 $this->maybe_remove_non_existent_customer( $intent->error, $order ); … … 701 708 'redirect' => '', 702 709 ]; 710 } 711 } 712 713 /** 714 * Saves payment method 715 * 716 * @param object $source_object 717 * @throws WC_Stripe_Exception 718 */ 719 public function save_payment_method( $source_object ) { 720 $user_id = get_current_user_id(); 721 $customer = new WC_Stripe_Customer( $user_id ); 722 723 if ( ( $user_id && 'reusable' === $source_object->usage ) ) { 724 $response = $customer->add_source( $source_object->id ); 725 726 if ( ! empty( $response->error ) ) { 727 throw new WC_Stripe_Exception( print_r( $response, true ), $this->get_localized_error_message_from_response( $response ) ); 728 } 729 if ( is_wp_error( $response ) ) { 730 throw new WC_Stripe_Exception( $response->get_error_message(), $response->get_error_message() ); 731 } 703 732 } 704 733 } … … 1014 1043 1015 1044 // Put the final thank you page redirect into the verification URL. 1016 $verification_url = add_query_arg( 1017 [ 1018 'order' => $order_id, 1019 'nonce' => wp_create_nonce( 'wc_stripe_confirm_pi' ), 1020 'redirect_to' => rawurlencode( $result['redirect'] ), 1021 ], 1022 WC_AJAX::get_endpoint( 'wc_stripe_verify_intent' ) 1023 ); 1045 $query_params = [ 1046 'order' => $order_id, 1047 'nonce' => wp_create_nonce( 'wc_stripe_confirm_pi' ), 1048 'redirect_to' => rawurlencode( $result['redirect'] ), 1049 ]; 1050 1051 $force_save_source_value = apply_filters( 'wc_stripe_force_save_source', false ); 1052 1053 if ( $this->save_payment_method_requested() || $force_save_source_value ) { 1054 $query_params['save_payment_method'] = true; 1055 } 1056 1057 $verification_url = add_query_arg( $query_params, WC_AJAX::get_endpoint( 'wc_stripe_verify_intent' ) ); 1024 1058 1025 1059 if ( isset( $result['payment_intent_secret'] ) ) { … … 1233 1267 return $settings; 1234 1268 } 1269 1270 /** 1271 * This is overloading the title type so the oauth url is only fetched if we are on the settings page. 1272 * 1273 * @param string $key Field key. 1274 * @param array $data Field data. 1275 * @return string 1276 */ 1277 public function generate_stripe_account_keys_html( $key, $data ) { 1278 if ( woocommerce_gateway_stripe()->connect->is_connected() ) { 1279 $reset_link = add_query_arg( 1280 [ 1281 '_wpnonce' => wp_create_nonce( 'reset_stripe_api_credentials' ), 1282 'reset_stripe_api_credentials' => true, 1283 ], 1284 admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=stripe' ) 1285 ); 1286 1287 $api_credentials_text = sprintf( 1288 /* translators: %1, %2, %3, and %4 are all HTML markup tags */ 1289 __( '%1$sClear all Stripe account keys.%2$s %3$sThis will disable any connection to Stripe.%4$s', 'woocommerce-gateway-stripe' ), 1290 '<a id="wc_stripe_connect_button" href="' . $reset_link . '" class="button button-secondary">', 1291 '</a>', 1292 '<span style="color:red;">', 1293 '</span>' 1294 ); 1295 } else { 1296 $oauth_url = woocommerce_gateway_stripe()->connect->get_oauth_url(); 1297 1298 if ( ! is_wp_error( $oauth_url ) ) { 1299 $api_credentials_text = sprintf( 1300 /* translators: %1, %2 and %3 are all HTML markup tags */ 1301 __( '%1$sSetup or link an existing Stripe account.%2$s By clicking this button you agree to the %3$sTerms of Service%2$s. Or, manually enter Stripe account keys below.', 'woocommerce-gateway-stripe' ), 1302 '<a id="wc_stripe_connect_button" href="' . $oauth_url . '" class="button button-primary">', 1303 '</a>', 1304 '<a href="https://wordpress.com/tos">' 1305 ); 1306 } else { 1307 $api_credentials_text = __( 'Manually enter Stripe keys below.', 'woocommerce-gateway-stripe' ); 1308 } 1309 } 1310 $data['description'] = $api_credentials_text; 1311 return $this->generate_title_html( $key, $data ); 1312 } 1235 1313 } -
woocommerce-gateway-stripe/trunk/includes/class-wc-stripe-api.php
r2511074 r2534245 58 58 public static function get_user_agent() { 59 59 $app_info = [ 60 'name' => 'WooCommerce Stripe Gateway', 61 'version' => WC_STRIPE_VERSION, 62 'url' => 'https://woocommerce.com/products/stripe/', 60 'name' => 'WooCommerce Stripe Gateway', 61 'version' => WC_STRIPE_VERSION, 62 'url' => 'https://woocommerce.com/products/stripe/', 63 'partner_id' => 'pp_partner_EYuSt9peR0WTMg', 63 64 ]; 64 65 … … 82 83 $app_info = $user_agent['application']; 83 84 84 returnapply_filters(85 $headers = apply_filters( 85 86 'woocommerce_stripe_request_headers', 86 87 [ 87 'Authorization' => 'Basic ' . base64_encode( self::get_secret_key() . ':' ), 88 'Stripe-Version' => self::STRIPE_API_VERSION, 89 'User-Agent' => $app_info['name'] . '/' . $app_info['version'] . ' (' . $app_info['url'] . ')', 90 'X-Stripe-Client-User-Agent' => wp_json_encode( $user_agent ), 88 'Authorization' => 'Basic ' . base64_encode( self::get_secret_key() . ':' ), 89 'Stripe-Version' => self::STRIPE_API_VERSION, 91 90 ] 92 91 ); 92 93 // These headers should not be overridden for this gateway. 94 $headers['User-Agent'] = $app_info['name'] . '/' . $app_info['version'] . ' (' . $app_info['url'] . ')'; 95 $headers['X-Stripe-Client-User-Agent'] = wp_json_encode( $user_agent ); 96 97 return $headers; 93 98 } 94 99 -
woocommerce-gateway-stripe/trunk/includes/class-wc-stripe-customer.php
r2497960 r2534245 157 157 } 158 158 159 $metadata = []; 160 $defaults['metadata'] = apply_filters( 'wc_stripe_customer_metadata', $metadata, $user ); 159 $metadata = []; 160 $defaults['metadata'] = apply_filters( 'wc_stripe_customer_metadata', $metadata, $user ); 161 $defaults['preferred_locales'] = $this->get_customer_preferred_locale( $user ); 161 162 162 163 return wp_parse_args( $args, $defaults ); … … 266 267 */ 267 268 public function add_source( $source_id ) { 268 $response = $this->attach_source($source_id );269 $response = WC_Stripe_API::retrieve( 'sources/' . $source_id ); 269 270 270 271 if ( ! empty( $response->error ) || is_wp_error( $response ) ) { … … 485 486 return $this->create_customer(); 486 487 } 488 489 /** 490 * Get the customer's preferred locale based on the user or site setting. 491 * 492 * @param object $user The user being created/modified. 493 * @return array The matched locale string wrapped in an array, or empty default. 494 */ 495 public function get_customer_preferred_locale( $user ) { 496 $locale = $this->get_customer_locale( $user ); 497 498 // Options based on Stripe locales. 499 // https://support.stripe.com/questions/language-options-for-customer-emails 500 $stripe_locales = [ 501 'ar' => 'ar-AR', 502 'da_DK' => 'da-DK', 503 'de_DE' => 'de-DE', 504 'en' => 'en-US', 505 'es_ES' => 'es-ES', 506 'es_CL' => 'es-419', 507 'es_AR' => 'es-419', 508 'es_CO' => 'es-419', 509 'es_PE' => 'es-419', 510 'es_UY' => 'es-419', 511 'es_PR' => 'es-419', 512 'es_GT' => 'es-419', 513 'es_EC' => 'es-419', 514 'es_MX' => 'es-419', 515 'es_VE' => 'es-419', 516 'es_CR' => 'es-419', 517 'fi' => 'fi-FI', 518 'fr_FR' => 'fr-FR', 519 'he_IL' => 'he-IL', 520 'it_IT' => 'it-IT', 521 'ja' => 'ja-JP', 522 'nl_NL' => 'nl-NL', 523 'nn_NO' => 'no-NO', 524 'pt_BR' => 'pt-BR', 525 'sv_SE' => 'sv-SE', 526 ]; 527 528 $preferred = isset( $stripe_locales[ $locale ] ) ? $stripe_locales[ $locale ] : 'en-US'; 529 return [ $preferred ]; 530 } 531 532 /** 533 * Gets the customer's locale/language based on their setting or the site settings. 534 * 535 * @param object $user The user we're wanting to get the locale for. 536 * @return string The locale/language set in the user profile or the site itself. 537 */ 538 public function get_customer_locale( $user ) { 539 // If we have a user, get their locale with a site fallback. 540 return ( $user ) ? get_user_locale( $user->ID ) : get_locale(); 541 } 487 542 } -
woocommerce-gateway-stripe/trunk/includes/class-wc-stripe-helper.php
r2497960 r2534245 511 511 return $statement_descriptor; 512 512 } 513 514 /** 515 * Converts a WooCommerce locale to the closest supported by Stripe.js. 516 * 517 * Stripe.js supports only a subset of IETF language tags, if a country specific locale is not supported we use 518 * the default for that language (https://stripe.com/docs/js/appendix/supported_locales). 519 * If no match is found we return 'auto' so Stripe.js uses the browser locale. 520 * 521 * @param string $wc_locale The locale to convert. 522 * 523 * @return string Closest locale supported by Stripe ('auto' if NONE). 524 */ 525 public static function convert_wc_locale_to_stripe_locale( $wc_locale ) { 526 // List copied from: https://stripe.com/docs/js/appendix/supported_locales. 527 $supported = [ 528 'ar', // Arabic. 529 'bg', // Bulgarian (Bulgaria). 530 'cs', // Czech (Czech Republic). 531 'da', // Danish. 532 'de', // German (Germany). 533 'el', // Greek (Greece). 534 'en', // English. 535 'en-GB', // English (United Kingdom). 536 'es', // Spanish (Spain). 537 'es-419', // Spanish (Latin America). 538 'et', // Estonian (Estonia). 539 'fi', // Finnish (Finland). 540 'fr', // French (France). 541 'fr-CA', // French (Canada). 542 'he', // Hebrew (Israel). 543 'hu', // Hungarian (Hungary). 544 'id', // Indonesian (Indonesia). 545 'it', // Italian (Italy). 546 'ja', // Japanese. 547 'lt', // Lithuanian (Lithuania). 548 'lv', // Latvian (Latvia). 549 'ms', // Malay (Malaysia). 550 'mt', // Maltese (Malta). 551 'nb', // Norwegian Bokmål. 552 'nl', // Dutch (Netherlands). 553 'pl', // Polish (Poland). 554 'pt-BR', // Portuguese (Brazil). 555 'pt', // Portuguese (Brazil). 556 'ro', // Romanian (Romania). 557 'ru', // Russian (Russia). 558 'sk', // Slovak (Slovakia). 559 'sl', // Slovenian (Slovenia). 560 'sv', // Swedish (Sweden). 561 'th', // Thai. 562 'tr', // Turkish (Turkey). 563 'zh', // Chinese Simplified (China). 564 'zh-HK', // Chinese Traditional (Hong Kong). 565 'zh-TW', // Chinese Traditional (Taiwan). 566 ]; 567 568 // Stripe uses '-' instead of '_' (used in WordPress). 569 $locale = str_replace( '_', '-', $wc_locale ); 570 571 if ( in_array( $locale, $supported, true ) ) { 572 return $locale; 573 } 574 575 // The plugin has been fully translated for Spanish (Ecuador), Spanish (Mexico), and 576 // Spanish(Venezuela), and partially (88% at 2021-05-14) for Spanish (Colombia). 577 // We need to map these locales to Stripe's Spanish (Latin America) 'es-419' locale. 578 // This list should be updated if more localized versions of Latin American Spanish are 579 // made available. 580 $lowercase_locale = strtolower( $wc_locale ); 581 $translated_latin_american_locales = [ 582 'es_co', // Spanish (Colombia). 583 'es_ec', // Spanish (Ecuador). 584 'es_mx', // Spanish (Mexico). 585 'es_ve', // Spanish (Venezuela). 586 ]; 587 if ( in_array( $lowercase_locale, $translated_latin_american_locales, true ) ) { 588 return 'es-419'; 589 } 590 591 // Finally, we check if the "base locale" is available. 592 $base_locale = substr( $wc_locale, 0, 2 ); 593 if ( in_array( $base_locale, $supported, true ) ) { 594 return $base_locale; 595 } 596 597 // Default to 'auto' so Stripe.js uses the browser locale. 598 return 'auto'; 599 } 513 600 } -
woocommerce-gateway-stripe/trunk/includes/class-wc-stripe-intent-controller.php
r2497960 r2534245 102 102 try { 103 103 $gateway->verify_intent_after_checkout( $order ); 104 105 if ( isset( $_GET['save_payment_method'] ) && ! empty( $_GET['save_payment_method'] ) ) { 106 $intent = $gateway->get_intent_from_order( $order ); 107 if ( isset( $intent->last_payment_error ) ) { 108 // Currently, Stripe saves the payment method even if the authentication fails for 3DS cards. 109 // Although, the card is not stored in DB we need to remove the source from the customer on Stripe 110 // in order to keep the sources in sync with the data in DB. 111 $customer = new WC_Stripe_Customer( wp_get_current_user()->ID ); 112 $customer->delete_source( $intent->last_payment_error->source->id ); 113 } else { 114 $metadata = $intent->metadata; 115 if ( isset( $metadata->save_payment_method ) && 'true' === $metadata->save_payment_method ) { 116 $source_object = WC_Stripe_API::retrieve( 'sources/' . $intent->source ); 117 $gateway->save_payment_method( $source_object ); 118 } 119 } 120 } 104 121 105 122 if ( ! isset( $_GET['is_ajax'] ) ) { -
woocommerce-gateway-stripe/trunk/includes/compat/class-wc-stripe-sepa-subs-compat.php
r2497960 r2534245 468 468 469 469 // If we couldn't find a Stripe customer linked to the account, fallback to the order meta data. 470 if ( ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) && false !== $subscription-> order) {470 if ( ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) && false !== $subscription->get_parent() ) { 471 471 $stripe_customer_id = get_post_meta( $subscription->get_parent_id(), '_stripe_customer_id', true ); 472 472 $stripe_source_id = get_post_meta( $subscription->get_parent_id(), '_stripe_source_id', true ); -
woocommerce-gateway-stripe/trunk/includes/compat/class-wc-stripe-subs-compat.php
r2497960 r2534245 580 580 581 581 // If we couldn't find a Stripe customer linked to the account, fallback to the order meta data. 582 if ( ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) && false !== $subscription-> order) {582 if ( ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) && false !== $subscription->get_parent() ) { 583 583 $stripe_customer_id = get_post_meta( $subscription->get_parent_id(), '_stripe_customer_id', true ); 584 584 $stripe_source_id = get_post_meta( $subscription->get_parent_id(), '_stripe_source_id', true ); -
woocommerce-gateway-stripe/trunk/includes/payment-methods/class-wc-stripe-payment-request.php
r2511074 r2534245 166 166 * 167 167 * @since 4.0.0 168 * @version 5.2.0 168 169 * @return void 169 170 */ 170 171 public function set_session() { 171 if ( ! is_product() || ( isset( WC()->session ) && WC()->session->has_session() ) ) {172 if ( ! $this->is_product() || ( isset( WC()->session ) && WC()->session->has_session() ) ) { 172 173 return; 173 174 } … … 205 206 206 207 add_filter( 'woocommerce_gateway_title', [ $this, 'filter_gateway_title' ], 10, 2 ); 207 add_filter( 'woocommerce_validate_postcode', [ $this, 'postal_code_validation' ], 10, 3 );208 209 208 add_action( 'woocommerce_checkout_order_processed', [ $this, 'add_order_meta' ], 10, 2 ); 210 209 } … … 299 298 300 299 /** 300 * Gets the product total price. 301 * 302 * @since 5.2.0 303 * 304 * @param object $product WC_Product_* object. 305 * @return integer Total price. 306 */ 307 public function get_product_price( $product ) { 308 $product_price = $product->get_price(); 309 // Add subscription sign-up fees to product price. 310 if ( 'subscription' === $product->get_type() && class_exists( 'WC_Subscriptions_Product' ) ) { 311 $product_price = $product->get_price() + WC_Subscriptions_Product::get_sign_up_fee( $product ); 312 } 313 314 return $product_price; 315 } 316 317 /** 301 318 * Gets the product data for the currently viewed page 302 319 * 303 320 * @since 4.0.0 304 * @version 4.0.0321 * @version 5.2.0 305 322 * @return mixed Returns false if not on a product page, the product information otherwise. 306 323 */ 307 324 public function get_product_data() { 308 if ( ! is_product() ) {325 if ( ! $this->is_product() ) { 309 326 return false; 310 327 } 311 328 312 global $post; 313 314 $product = wc_get_product( $post->ID ); 329 $product = $this->get_product(); 315 330 316 331 if ( 'variable' === $product->get_type() ) { 317 $attributes = wc_clean( wp_unslash( $_GET ) ); 332 $variation_attributes = $product->get_variation_attributes(); 333 $attributes = []; 334 335 foreach ( $variation_attributes as $attribute_name => $attribute_values ) { 336 $attribute_key = 'attribute_' . sanitize_title( $attribute_name ); 337 338 // Passed value via GET takes precedence. Otherwise get the default value for given attribute 339 $attributes[ $attribute_key ] = isset( $_GET[ $attribute_key ] ) 340 ? wc_clean( wp_unslash( $_GET[ $attribute_key ] ) ) 341 : $product->get_variation_default_attribute( $attribute_name ); 342 } 318 343 319 344 $data_store = WC_Data_Store::load( 'product' ); … … 330 355 $items[] = [ 331 356 'label' => $product->get_name(), 332 'amount' => WC_Stripe_Helper::get_stripe_amount( $ product->get_price() ),357 'amount' => WC_Stripe_Helper::get_stripe_amount( $this->get_product_price( $product ) ), 333 358 ]; 334 359 … … 359 384 $data['total'] = [ 360 385 'label' => apply_filters( 'wc_stripe_payment_request_total_label', $this->total_label ), 361 'amount' => WC_Stripe_Helper::get_stripe_amount( $ product->get_price() ),386 'amount' => WC_Stripe_Helper::get_stripe_amount( $this->get_product_price( $product ) ), 362 387 'pending' => true, 363 388 ]; … … 383 408 $method_title = is_object( $order ) ? $order->get_payment_method_title() : ''; 384 409 385 if ( 'stripe' === $id && ! empty( $method_title ) && 'Apple Pay (Stripe)' === $method_title ) { 386 return $method_title; 387 } 388 389 if ( 'stripe' === $id && ! empty( $method_title ) && 'Chrome Payment Request (Stripe)' === $method_title ) { 390 return $method_title; 410 if ( 'stripe' === $id && ! empty( $method_title ) ) { 411 if ( 'Apple Pay (Stripe)' === $method_title 412 || 'Google Pay (Stripe)' === $method_title 413 || 'Payment Request (Stripe)' === $method_title 414 ) { 415 return $method_title; 416 } 417 418 // We renamed 'Chrome Payment Request' to just 'Payment Request' since Payment Requests 419 // are supported by other browsers besides Chrome. As such, we need to check for the 420 // old title to make sure older orders still reflect that they were paid via Payment 421 // Request Buttons. 422 if ( 'Chrome Payment Request (Stripe)' === $method_title ) { 423 return 'Payment Request (Stripe)'; 424 } 391 425 } 392 426 … … 395 429 396 430 /** 397 * Removes postal code validation from WC. 398 * 399 * @since 3.1.4 400 * @version 4.0.0 401 */ 402 public function postal_code_validation( $valid, $postcode, $country ) { 403 $gateways = WC()->payment_gateways->get_available_payment_gateways(); 404 405 if ( ! isset( $gateways['stripe'] ) ) { 406 return $valid; 407 } 408 409 $payment_request_type = isset( $_POST['payment_request_type'] ) ? wc_clean( wp_unslash( $_POST['payment_request_type'] ) ) : ''; 410 411 if ( 'apple_pay' !== $payment_request_type ) { 412 return $valid; 413 } 414 431 * Normalizes postal code in case of redacted data from Apple Pay. 432 * 433 * @since 5.2.0 434 * 435 * @param string $postcode Postal code. 436 * @param string $country Country. 437 */ 438 public function get_normalized_postal_code( $postcode, $country ) { 415 439 /** 416 * Currently Apple Pay truncates postal codes from UK and Canada to first 3 characters440 * Currently, Apple Pay truncates the UK and Canadian postal codes to the first 4 and 3 characters respectively 417 441 * when passing it back from the shippingcontactselected object. This causes WC to invalidate 418 * the order and not let it go through. The remedy for now is just to remove this validation. 419 * Note that this only works with shipping providers that don't validate full postal codes. 442 * the postal code and not calculate shipping zones correctly. 420 443 */ 421 if ( 'GB' === $country || 'CA' === $country ) { 422 return true; 423 } 424 425 return $valid; 444 if ( 'GB' === $country ) { 445 // Replaces a redacted string with something like LN10***. 446 return str_pad( preg_replace( '/\s+/', '', $postcode ), 7, '*' ); 447 } 448 if ( 'CA' === $country ) { 449 // Replaces a redacted string with something like L4Y***. 450 return str_pad( preg_replace( '/\s+/', '', $postcode ), 6, '*' ); 451 } 452 453 return $postcode; 426 454 } 427 455 … … 448 476 $order->set_payment_method_title( 'Apple Pay (Stripe)' ); 449 477 $order->save(); 450 } 451 452 if ( 'payment_request_api' === $payment_request_type ) { 453 $order->set_payment_method_title( 'Chrome Payment Request (Stripe)' ); 478 } elseif ( 'google_pay' === $payment_request_type ) { 479 $order->set_payment_method_title( 'Google Pay (Stripe)' ); 480 $order->save(); 481 } elseif ( 'payment_request_api' === $payment_request_type ) { 482 $order->set_payment_method_title( 'Payment Request (Stripe)' ); 454 483 $order->save(); 455 484 } … … 515 544 516 545 /** 546 * Checks if this page contains a cart or checkout block. 547 * 548 * @since 5.2.0 549 * @return boolean 550 */ 551 public function is_block() { 552 return has_block( 'woocommerce/cart' ) || has_block( 'woocommerce/checkout' ); 553 } 554 555 /** 556 * Checks if this is a product page or content contains a product_page shortcode. 557 * 558 * @since 5.2.0 559 * @return boolean 560 */ 561 public function is_product() { 562 return is_product() || wc_post_content_has_shortcode( 'product_page' ); 563 } 564 565 /** 566 * Get product from product page or product_page shortcode. 567 * 568 * @since 5.2.0 569 * @return WC_Product Product object. 570 */ 571 public function get_product() { 572 global $post; 573 574 if ( is_product() ) { 575 return wc_get_product( $post->ID ); 576 } elseif ( wc_post_content_has_shortcode( 'product_page' ) ) { 577 // Get id from product_page shortcode. 578 preg_match( '/\[product_page id="(?<id>\d+)"\]/', $post->post_content, $shortcode_match ); 579 580 if ( ! isset( $shortcode_match['id'] ) ) { 581 return false; 582 } 583 584 return wc_get_product( $shortcode_match['id'] ); 585 } 586 587 return false; 588 } 589 590 /** 517 591 * Load public scripts and styles. 518 592 * 519 593 * @since 3.1.0 520 * @version 4.0.0594 * @version 5.2.0 521 595 */ 522 596 public function scripts() { … … 533 607 } 534 608 535 if ( ! is_product() && ! is_cart() && ! is_checkout() && ! isset( $_GET['pay_for_order'] ) ) { 609 // If page is not supported, bail. 610 if ( ! $this->is_block() && ! $this->is_product() && ! is_cart() && ! is_checkout() && ! isset( $_GET['pay_for_order'] ) ) { 536 611 return; 537 612 } 538 613 539 if ( is_product() && ! $this->should_show_payment_button_on_product_page() ) { 614 if ( $this->is_product() && ! $this->should_show_payment_button_on_product_page() ) { 615 return; 616 } elseif ( ! $this->should_show_payment_button_on_cart() ) { 540 617 return; 541 618 } … … 582 659 'branded_type' => $this->get_button_branded_type(), 583 660 ], 584 'is_product_page' => is_product(),661 'is_product_page' => $this->is_product(), 585 662 'product' => $this->get_product_data(), 586 663 ]; … … 603 680 * 604 681 * @since 4.0.0 605 * @version 4.0.0682 * @version 5.2.0 606 683 */ 607 684 public function display_payment_request_button_html() { … … 614 691 } 615 692 616 if ( ! is_cart() && ! is_checkout() && ! is_product() && ! isset( $_GET['pay_for_order'] ) ) {693 if ( ! is_cart() && ! is_checkout() && ! $this->is_product() && ! isset( $_GET['pay_for_order'] ) ) { 617 694 return; 618 695 } 619 696 620 697 if ( is_checkout() && ! apply_filters( 'wc_stripe_show_payment_request_on_checkout', false, $post ) ) { 621 return;622 }623 624 if ( is_product() && ! $this->should_show_payment_button_on_product_page() ) {625 return;626 } elseif ( ! $this->should_show_payment_button_on_cart() ) {627 698 return; 628 699 } … … 648 719 * 649 720 * @since 4.0.0 650 * @version 4.0.0721 * @version 5.2.0 651 722 */ 652 723 public function display_payment_request_button_separator_html() { … … 659 730 } 660 731 661 if ( ! is_cart() && ! is_checkout() && ! is_product() && ! isset( $_GET['pay_for_order'] ) ) {732 if ( ! is_cart() && ! is_checkout() && ! $this->is_product() && ! isset( $_GET['pay_for_order'] ) ) { 662 733 return; 663 734 } 664 735 665 736 if ( is_checkout() && ! apply_filters( 'wc_stripe_show_payment_request_on_checkout', false, $post ) ) { 666 return;667 }668 669 if ( is_product() && ! $this->should_show_payment_button_on_product_page() ) {670 return;671 } elseif ( ! $this->should_show_payment_button_on_cart() ) {672 737 return; 673 738 } … … 704 769 * 705 770 * @since 4.3.2 771 * @version 5.2.0 706 772 * @return boolean 707 773 */ … … 709 775 global $post; 710 776 711 $product = wc_get_product( $post->ID );712 713 777 if ( apply_filters( 'wc_stripe_hide_payment_request_on_product_page', false, $post ) ) { 714 778 return false; 715 779 } 780 781 $product = $this->get_product(); 716 782 717 783 if ( ! is_object( $product ) || ! in_array( $product->get_type(), $this->supported_product_types() ) ) { … … 1002 1068 } 1003 1069 1004 $total = $qty * $ product->get_price() + $addon_value;1070 $total = $qty * $this->get_product_price( $product ) + $addon_value; 1005 1071 1006 1072 $quantity_label = 1 < $qty ? ' (x' . $qty . ')' : ''; … … 1323 1389 // Normalizes state to calculate shipping zones. 1324 1390 $state = $this->get_normalized_state( $state, $country ); 1391 1392 // Normalizes postal code in case of redacted data from Apple Pay. 1393 $postcode = $this->get_normalized_postal_code( $postcode, $country ); 1325 1394 1326 1395 WC()->shipping->reset_shipping(); -
woocommerce-gateway-stripe/trunk/languages/woocommerce-gateway-stripe.pot
r2511074 r2534245 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WooCommerce Stripe Gateway 5. 1.0\n"5 "Project-Id-Version: WooCommerce Stripe Gateway 5.2.0\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n" 8 "POT-Creation-Date: 2021-0 4-07 19:43:23+00:00\n"8 "POT-Creation-Date: 2021-05-19 12:15:27+00:00\n" 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Type: text/plain; charset=utf-8\n" … … 13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 14 "Language-Team: LANGUAGE <[email protected]>\n" 15 "X-Generator: node-wp-i18n 1.2. 3\n"15 "X-Generator: node-wp-i18n 1.2.5\n" 16 16 17 17 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:25 … … 30 30 msgstr "" 31 31 32 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:25 132 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:257 33 33 #: includes/compat/class-wc-stripe-sepa-subs-compat.php:230 34 34 #: includes/compat/class-wc-stripe-subs-compat.php:243 … … 38 38 msgstr "" 39 39 40 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:3 4440 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:350 41 41 #. translators: 1) blog name 2) order number 42 42 msgid "%1$s - Order %2$s" 43 43 msgstr "" 44 44 45 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:3 8545 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:391 46 46 msgid "customer_name" 47 47 msgstr "" 48 48 49 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:3 8649 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:392 50 50 msgid "customer_email" 51 51 msgstr "" 52 52 53 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:4 4953 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:455 54 54 #. translators: transaction id 55 55 msgid "Stripe charge awaiting payment: %s." 56 56 msgstr "" 57 57 58 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:4 5658 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:462 59 59 #: includes/class-wc-stripe-order-handler.php:299 60 60 #: includes/class-wc-stripe-webhook-handler.php:415 … … 64 64 msgstr "" 65 65 66 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:46 167 #: includes/class-wc-gateway-stripe.php:50 366 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:467 67 #: includes/class-wc-gateway-stripe.php:504 68 68 #: includes/compat/class-wc-stripe-sepa-subs-compat.php:187 69 69 msgid "Payment processing failed. Please retry." 70 70 msgstr "" 71 71 72 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:47 372 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:479 73 73 #. translators: transaction id 74 74 msgid "" … … 78 78 msgstr "" 79 79 80 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:6 5480 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:660 81 81 msgid "Invalid payment method. Please input a new card number." 82 82 msgstr "" 83 83 84 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:926 84 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:925 85 #. translators: %1$s is a stripe error message 86 msgid "There was a problem initiating a refund: %1$s" 87 msgstr "" 88 89 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:939 85 90 #. translators: amount (including currency symbol) 86 91 msgid "Pre-Authorization for %s voided." 87 92 msgstr "" 88 93 89 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:9 3194 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:944 90 95 msgid "" 91 96 "The authorization was voided and the order cancelled. Click okay to " … … 93 98 msgstr "" 94 99 95 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:9 45100 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:958 96 101 #. translators: 1) amount (including currency symbol) 2) transaction id 3) 97 102 #. refund message … … 99 104 msgstr "" 100 105 101 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:9 63106 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:976 102 107 msgid "There was a problem adding the payment method." 103 108 msgstr "" … … 200 205 msgstr "" 201 206 202 #: includes/admin/class-wc-stripe-inbox-notes.php:4 2207 #: includes/admin/class-wc-stripe-inbox-notes.php:40 203 208 msgid "Boost sales this holiday season with Apple Pay!" 204 209 msgstr "" 205 210 206 #: includes/admin/class-wc-stripe-inbox-notes.php:4 5211 #: includes/admin/class-wc-stripe-inbox-notes.php:43 207 212 msgid "Boost sales with Apple Pay!" 208 213 msgstr "" 209 214 210 #: includes/admin/class-wc-stripe-inbox-notes.php:12 6215 #: includes/admin/class-wc-stripe-inbox-notes.php:122 211 216 msgid "" 212 217 "Now that you accept Apple Pay® with Stripe, you can increase conversion " … … 215 220 msgstr "" 216 221 217 #: includes/admin/class-wc-stripe-inbox-notes.php:1 32222 #: includes/admin/class-wc-stripe-inbox-notes.php:128 218 223 msgid "See marketing guide" 219 224 msgstr "" 220 225 221 #: includes/admin/class-wc-stripe-inbox-notes.php:14 5226 #: includes/admin/class-wc-stripe-inbox-notes.php:142 222 227 msgid "Apple Pay domain verification needed" 223 228 msgstr "" 224 229 225 #: includes/admin/class-wc-stripe-inbox-notes.php:14 6230 #: includes/admin/class-wc-stripe-inbox-notes.php:143 226 231 msgid "" 227 232 "The WooCommerce Stripe Gateway extension attempted to perform domain " … … 230 235 msgstr "" 231 236 232 #: includes/admin/class-wc-stripe-inbox-notes.php:1 52237 #: includes/admin/class-wc-stripe-inbox-notes.php:149 233 238 msgid "Learn more" 234 239 msgstr "" … … 364 369 #: includes/admin/stripe-p24-settings.php:18 365 370 #: includes/admin/stripe-sepa-settings.php:22 366 #: includes/admin/stripe-settings.php: 43371 #: includes/admin/stripe-settings.php:10 367 372 #: includes/admin/stripe-sofort-settings.php:22 368 373 msgid "Enable/Disable" … … 381 386 #: includes/admin/stripe-p24-settings.php:25 382 387 #: includes/admin/stripe-sepa-settings.php:29 383 #: includes/admin/stripe-settings.php: 50388 #: includes/admin/stripe-settings.php:17 384 389 #: includes/admin/stripe-sofort-settings.php:29 385 390 msgid "Title" … … 394 399 #: includes/admin/stripe-p24-settings.php:27 395 400 #: includes/admin/stripe-sepa-settings.php:31 396 #: includes/admin/stripe-settings.php: 52401 #: includes/admin/stripe-settings.php:19 397 402 #: includes/admin/stripe-sofort-settings.php:31 398 403 msgid "This controls the title which the user sees during checkout." … … 411 416 #: includes/admin/stripe-p24-settings.php:32 412 417 #: includes/admin/stripe-sepa-settings.php:36 413 #: includes/admin/stripe-settings.php: 57418 #: includes/admin/stripe-settings.php:24 414 419 #: includes/admin/stripe-sofort-settings.php:36 415 420 msgid "Description" … … 424 429 #: includes/admin/stripe-p24-settings.php:34 425 430 #: includes/admin/stripe-sepa-settings.php:38 426 #: includes/admin/stripe-settings.php: 59431 #: includes/admin/stripe-settings.php:26 427 432 #: includes/admin/stripe-sofort-settings.php:38 428 433 msgid "This controls the description which the user sees during checkout." … … 441 446 #: includes/admin/stripe-p24-settings.php:39 442 447 #: includes/admin/stripe-sepa-settings.php:43 443 #: includes/admin/stripe-settings.php: 105448 #: includes/admin/stripe-settings.php:71 444 449 #: includes/admin/stripe-sofort-settings.php:43 445 450 msgid "Webhook Endpoints" … … 585 590 msgstr "" 586 591 587 #: includes/admin/stripe-settings.php:17 588 #. translators: %1, %2, %3, and %4 are all HTML markup tags 589 msgid "" 590 "%1$sClear all Stripe account keys.%2$s %3$sThis will disable any connection " 591 "to Stripe.%4$s" 592 msgstr "" 593 594 #: includes/admin/stripe-settings.php:29 595 #. translators: %1, %2 and %3 are all HTML markup tags 596 msgid "" 597 "%1$sSetup or link an existing Stripe account.%2$s By clicking this button " 598 "you agree to the %3$sTerms of Service%2$s. Or, manually enter Stripe " 599 "account keys below." 592 #: includes/admin/stripe-settings.php:11 593 msgid "Enable Stripe" 594 msgstr "" 595 596 #: includes/admin/stripe-settings.php:20 597 msgid "Credit Card (Stripe)" 598 msgstr "" 599 600 #: includes/admin/stripe-settings.php:27 601 msgid "Pay with your credit card via Stripe." 602 msgstr "" 603 604 #: includes/admin/stripe-settings.php:31 605 msgid "Stripe Account Keys" 600 606 msgstr "" 601 607 602 608 #: includes/admin/stripe-settings.php:35 603 msgid "Manually enter Stripe keys below."604 msgstr ""605 606 #: includes/admin/stripe-settings.php:44607 msgid "Enable Stripe"608 msgstr ""609 610 #: includes/admin/stripe-settings.php:53611 msgid "Credit Card (Stripe)"612 msgstr ""613 614 #: includes/admin/stripe-settings.php:60615 msgid "Pay with your credit card via Stripe."616 msgstr ""617 618 #: includes/admin/stripe-settings.php:64619 msgid "Stripe Account Keys"620 msgstr ""621 622 #: includes/admin/stripe-settings.php:69623 609 msgid "Test mode" 624 610 msgstr "" 625 611 626 #: includes/admin/stripe-settings.php: 70612 #: includes/admin/stripe-settings.php:36 627 613 msgid "Enable Test Mode" 628 614 msgstr "" 629 615 630 #: includes/admin/stripe-settings.php: 72616 #: includes/admin/stripe-settings.php:38 631 617 msgid "Place the payment gateway in test mode using test API keys." 632 618 msgstr "" 633 619 634 #: includes/admin/stripe-settings.php: 77620 #: includes/admin/stripe-settings.php:43 635 621 msgid "Test Publishable Key" 636 622 msgstr "" 637 623 638 #: includes/admin/stripe-settings.php: 79624 #: includes/admin/stripe-settings.php:45 639 625 msgid "" 640 626 "Get your API keys from your stripe account. Invalid values will be " … … 642 628 msgstr "" 643 629 644 #: includes/admin/stripe-settings.php: 84630 #: includes/admin/stripe-settings.php:50 645 631 msgid "Test Secret Key" 646 632 msgstr "" 647 633 648 #: includes/admin/stripe-settings.php: 86634 #: includes/admin/stripe-settings.php:52 649 635 msgid "" 650 636 "Get your API keys from your stripe account. Invalid values will be " … … 653 639 msgstr "" 654 640 655 #: includes/admin/stripe-settings.php: 91641 #: includes/admin/stripe-settings.php:57 656 642 msgid "Live Publishable Key" 657 643 msgstr "" 658 644 659 #: includes/admin/stripe-settings.php: 93645 #: includes/admin/stripe-settings.php:59 660 646 msgid "" 661 647 "Get your API keys from your stripe account. Invalid values will be " … … 663 649 msgstr "" 664 650 665 #: includes/admin/stripe-settings.php: 98651 #: includes/admin/stripe-settings.php:64 666 652 msgid "Live Secret Key" 667 653 msgstr "" 668 654 669 #: includes/admin/stripe-settings.php: 100655 #: includes/admin/stripe-settings.php:66 670 656 msgid "" 671 657 "Get your API keys from your stripe account. Invalid values will be " … … 674 660 msgstr "" 675 661 676 #: includes/admin/stripe-settings.php: 110662 #: includes/admin/stripe-settings.php:76 677 663 msgid "Test Webhook Secret" 678 664 msgstr "" 679 665 680 #: includes/admin/stripe-settings.php:112 681 #: includes/admin/stripe-settings.php:119 666 #: includes/admin/stripe-settings.php:78 includes/admin/stripe-settings.php:85 682 667 msgid "" 683 668 "Get your webhook signing secret from the webhooks section in your stripe " … … 685 670 msgstr "" 686 671 687 #: includes/admin/stripe-settings.php: 117672 #: includes/admin/stripe-settings.php:83 688 673 msgid "Webhook Secret" 689 674 msgstr "" 690 675 691 #: includes/admin/stripe-settings.php: 124676 #: includes/admin/stripe-settings.php:90 692 677 msgid "Inline Credit Card Form" 693 678 msgstr "" 694 679 695 #: includes/admin/stripe-settings.php: 126680 #: includes/admin/stripe-settings.php:92 696 681 msgid "" 697 682 "Choose the style you want to show for your credit card form. When " … … 700 685 msgstr "" 701 686 702 #: includes/admin/stripe-settings.php: 131687 #: includes/admin/stripe-settings.php:97 703 688 msgid "Statement Descriptor" 704 689 msgstr "" 705 690 706 #: includes/admin/stripe-settings.php: 133691 #: includes/admin/stripe-settings.php:99 707 692 msgid "" 708 693 "Statement descriptors are limited to 22 characters, cannot use the special " … … 712 697 msgstr "" 713 698 714 #: includes/admin/stripe-settings.php:1 38699 #: includes/admin/stripe-settings.php:104 715 700 msgid "Capture" 716 701 msgstr "" 717 702 718 #: includes/admin/stripe-settings.php:1 39703 #: includes/admin/stripe-settings.php:105 719 704 msgid "Capture charge immediately" 720 705 msgstr "" 721 706 722 #: includes/admin/stripe-settings.php:1 41707 #: includes/admin/stripe-settings.php:107 723 708 msgid "" 724 709 "Whether or not to immediately capture the charge. When unchecked, the " … … 727 712 msgstr "" 728 713 729 #: includes/admin/stripe-settings.php:1 46714 #: includes/admin/stripe-settings.php:112 730 715 msgid "Payment Request Buttons" 731 716 msgstr "" 732 717 733 #: includes/admin/stripe-settings.php:1 49718 #: includes/admin/stripe-settings.php:115 734 719 #. translators: 1) br tag 2) Stripe anchor tag 3) Apple anchor tag 4) Stripe 735 720 #. dashboard opening anchor tag 5) Stripe dashboard closing anchor tag … … 741 726 msgstr "" 742 727 743 #: includes/admin/stripe-settings.php:1 57728 #: includes/admin/stripe-settings.php:123 744 729 msgid "" 745 730 "If enabled, users will be able to pay using Apple Pay or Chrome Payment " … … 747 732 msgstr "" 748 733 749 #: includes/admin/stripe-settings.php:1 62734 #: includes/admin/stripe-settings.php:128 750 735 msgid "Payment Request Button Type" 751 736 msgstr "" 752 737 753 #: includes/admin/stripe-settings.php:1 63738 #: includes/admin/stripe-settings.php:129 754 739 msgid "Button Type" 755 740 msgstr "" 756 741 757 #: includes/admin/stripe-settings.php:1 65742 #: includes/admin/stripe-settings.php:131 758 743 msgid "Select the button type you would like to show." 759 744 msgstr "" 760 745 761 #: includes/admin/stripe-settings.php:1 69746 #: includes/admin/stripe-settings.php:135 762 747 msgid "Default" 763 748 msgstr "" 764 749 765 #: includes/admin/stripe-settings.php:1 70750 #: includes/admin/stripe-settings.php:136 766 751 msgid "Buy" 767 752 msgstr "" 768 753 769 #: includes/admin/stripe-settings.php:1 71754 #: includes/admin/stripe-settings.php:137 770 755 msgid "Donate" 771 756 msgstr "" 772 757 773 #: includes/admin/stripe-settings.php:1 72758 #: includes/admin/stripe-settings.php:138 774 759 msgid "Branded" 775 760 msgstr "" 776 761 777 #: includes/admin/stripe-settings.php:1 73762 #: includes/admin/stripe-settings.php:139 778 763 msgid "Custom" 779 764 msgstr "" 780 765 781 #: includes/admin/stripe-settings.php:1 77766 #: includes/admin/stripe-settings.php:143 782 767 msgid "Payment Request Button Theme" 783 768 msgstr "" 784 769 785 #: includes/admin/stripe-settings.php:1 78770 #: includes/admin/stripe-settings.php:144 786 771 msgid "Button Theme" 787 772 msgstr "" 788 773 789 #: includes/admin/stripe-settings.php:1 80774 #: includes/admin/stripe-settings.php:146 790 775 msgid "Select the button theme you would like to show." 791 776 msgstr "" 792 777 793 #: includes/admin/stripe-settings.php:1 84778 #: includes/admin/stripe-settings.php:150 794 779 msgid "Dark" 795 780 msgstr "" 796 781 797 #: includes/admin/stripe-settings.php:1 85782 #: includes/admin/stripe-settings.php:151 798 783 msgid "Light" 799 784 msgstr "" 800 785 801 #: includes/admin/stripe-settings.php:1 86786 #: includes/admin/stripe-settings.php:152 802 787 msgid "Light-Outline" 803 788 msgstr "" 804 789 805 #: includes/admin/stripe-settings.php:1 90790 #: includes/admin/stripe-settings.php:156 806 791 msgid "Payment Request Button Height" 807 792 msgstr "" 808 793 809 #: includes/admin/stripe-settings.php:1 91794 #: includes/admin/stripe-settings.php:157 810 795 msgid "Button Height" 811 796 msgstr "" 812 797 813 #: includes/admin/stripe-settings.php:1 93798 #: includes/admin/stripe-settings.php:159 814 799 msgid "" 815 800 "Enter the height you would like the button to be in pixels. Width will " … … 817 802 msgstr "" 818 803 819 #: includes/admin/stripe-settings.php:1 98804 #: includes/admin/stripe-settings.php:164 820 805 msgid "Payment Request Button Label" 821 806 msgstr "" 822 807 823 #: includes/admin/stripe-settings.php:1 99808 #: includes/admin/stripe-settings.php:165 824 809 msgid "Button Label" 825 810 msgstr "" 826 811 827 #: includes/admin/stripe-settings.php: 201812 #: includes/admin/stripe-settings.php:167 828 813 msgid "Enter the custom text you would like the button to have." 829 814 msgstr "" 830 815 831 #: includes/admin/stripe-settings.php: 202816 #: includes/admin/stripe-settings.php:168 832 817 msgid "Buy now" 833 818 msgstr "" 834 819 835 #: includes/admin/stripe-settings.php: 206820 #: includes/admin/stripe-settings.php:172 836 821 msgid "Payment Request Branded Button Label Format" 837 822 msgstr "" 838 823 839 #: includes/admin/stripe-settings.php: 207824 #: includes/admin/stripe-settings.php:173 840 825 msgid "Branded Button Label Format" 841 826 msgstr "" 842 827 843 #: includes/admin/stripe-settings.php: 209828 #: includes/admin/stripe-settings.php:175 844 829 msgid "Select the branded button label format." 845 830 msgstr "" 846 831 847 #: includes/admin/stripe-settings.php: 213832 #: includes/admin/stripe-settings.php:179 848 833 msgid "Logo only" 849 834 msgstr "" 850 835 851 #: includes/admin/stripe-settings.php: 214836 #: includes/admin/stripe-settings.php:180 852 837 msgid "Text and logo" 853 838 msgstr "" 854 839 855 #: includes/admin/stripe-settings.php: 218840 #: includes/admin/stripe-settings.php:184 856 841 msgid "Saved Cards" 857 842 msgstr "" 858 843 859 #: includes/admin/stripe-settings.php: 219844 #: includes/admin/stripe-settings.php:185 860 845 msgid "Enable Payment via Saved Cards" 861 846 msgstr "" 862 847 863 #: includes/admin/stripe-settings.php: 221848 #: includes/admin/stripe-settings.php:187 864 849 msgid "" 865 850 "If enabled, users will be able to pay with a saved card during checkout. " … … 867 852 msgstr "" 868 853 869 #: includes/admin/stripe-settings.php: 226854 #: includes/admin/stripe-settings.php:192 870 855 msgid "Logging" 871 856 msgstr "" 872 857 873 #: includes/admin/stripe-settings.php: 227858 #: includes/admin/stripe-settings.php:193 874 859 msgid "Log debug messages" 875 860 msgstr "" 876 861 877 #: includes/admin/stripe-settings.php: 229862 #: includes/admin/stripe-settings.php:195 878 863 msgid "Save debug messages to the WooCommerce System Status log." 879 864 msgstr "" … … 958 943 msgstr "" 959 944 960 #: includes/class-wc-gateway-stripe.php:44 5961 #: includes/class-wc-gateway-stripe.php:49 0945 #: includes/class-wc-gateway-stripe.php:446 946 #: includes/class-wc-gateway-stripe.php:491 962 947 msgid "" 963 948 "Sorry, we're not accepting prepaid cards at this time. Your credit card has " … … 965 950 msgstr "" 966 951 967 #: includes/class-wc-gateway-stripe.php:44 6952 #: includes/class-wc-gateway-stripe.php:447 968 953 msgid "Please enter your IBAN account name." 969 954 msgstr "" 970 955 971 #: includes/class-wc-gateway-stripe.php:44 7956 #: includes/class-wc-gateway-stripe.php:448 972 957 msgid "Please enter your IBAN account number." 973 958 msgstr "" 974 959 975 #: includes/class-wc-gateway-stripe.php:44 8960 #: includes/class-wc-gateway-stripe.php:449 976 961 msgid "We couldn't initiate the payment. Please try again." 977 962 msgstr "" 978 963 979 #: includes/class-wc-gateway-stripe.php:4 59964 #: includes/class-wc-gateway-stripe.php:460 980 965 msgid "Billing First Name and Last Name are required." 981 966 msgstr "" 982 967 983 #: includes/class-wc-gateway-stripe.php:7 31968 #: includes/class-wc-gateway-stripe.php:760 984 969 #. translators: error message 985 970 msgid "This represents the fee Stripe collects for the transaction." 986 971 msgstr "" 987 972 988 #: includes/class-wc-gateway-stripe.php:7 32973 #: includes/class-wc-gateway-stripe.php:761 989 974 msgid "Stripe Fee:" 990 975 msgstr "" 991 976 992 #: includes/class-wc-gateway-stripe.php:7 68977 #: includes/class-wc-gateway-stripe.php:797 993 978 msgid "" 994 979 "This represents the net total that will be credited to your Stripe bank " … … 996 981 msgstr "" 997 982 998 #: includes/class-wc-gateway-stripe.php:7 69983 #: includes/class-wc-gateway-stripe.php:798 999 984 msgid "Stripe Payout:" 1000 985 msgstr "" 1001 986 1002 #: includes/class-wc-gateway-stripe.php:8 32987 #: includes/class-wc-gateway-stripe.php:861 1003 988 #: includes/class-wc-stripe-order-handler.php:159 1004 989 #: includes/class-wc-stripe-webhook-handler.php:264 … … 1011 996 msgstr "" 1012 997 1013 #: includes/class-wc-gateway-stripe.php: 885998 #: includes/class-wc-gateway-stripe.php:914 1014 999 msgid "" 1015 1000 "Almost there!\n" … … 1019 1004 msgstr "" 1020 1005 1021 #: includes/class-wc-gateway-stripe.php:9 071006 #: includes/class-wc-gateway-stripe.php:936 1022 1007 #. translators: %s is the order Id 1023 1008 msgid "Payment Intent not found for order #%s" 1024 1009 msgstr "" 1025 1010 1026 #: includes/class-wc-gateway-stripe.php:11 331011 #: includes/class-wc-gateway-stripe.php:1167 1027 1012 #: includes/class-wc-stripe-webhook-handler.php:768 1028 1013 #: includes/class-wc-stripe-webhook-handler.php:813 … … 1031 1016 msgstr "" 1032 1017 1033 #: includes/class-wc-gateway-stripe.php:11 341018 #: includes/class-wc-gateway-stripe.php:1168 1034 1019 msgid "Stripe SCA authentication failed." 1035 1020 msgstr "" 1036 1021 1037 #: includes/class-wc-gateway-stripe.php:1 1911022 #: includes/class-wc-gateway-stripe.php:1225 1038 1023 msgid "" 1039 1024 "The \"Live Publishable Key\" should start with \"pk_live\", enter the " … … 1041 1026 msgstr "" 1042 1027 1043 #: includes/class-wc-gateway-stripe.php:1 1991028 #: includes/class-wc-gateway-stripe.php:1233 1044 1029 msgid "" 1045 1030 "The \"Live Secret Key\" should start with \"sk_live\" or \"rk_live\", enter " … … 1047 1032 msgstr "" 1048 1033 1049 #: includes/class-wc-gateway-stripe.php:12 071034 #: includes/class-wc-gateway-stripe.php:1241 1050 1035 msgid "" 1051 1036 "The \"Test Publishable Key\" should start with \"pk_test\", enter the " … … 1053 1038 msgstr "" 1054 1039 1055 #: includes/class-wc-gateway-stripe.php:12 151040 #: includes/class-wc-gateway-stripe.php:1249 1056 1041 msgid "" 1057 1042 "The \"Test Secret Key\" should start with \"sk_test\" or \"rk_test\", enter " … … 1059 1044 msgstr "" 1060 1045 1061 #: includes/class-wc-stripe-api.php:143 includes/class-wc-stripe-api.php:177 1046 #: includes/class-wc-gateway-stripe.php:1289 1047 #. translators: %1, %2, %3, and %4 are all HTML markup tags 1048 msgid "" 1049 "%1$sClear all Stripe account keys.%2$s %3$sThis will disable any connection " 1050 "to Stripe.%4$s" 1051 msgstr "" 1052 1053 #: includes/class-wc-gateway-stripe.php:1301 1054 #. translators: %1, %2 and %3 are all HTML markup tags 1055 msgid "" 1056 "%1$sSetup or link an existing Stripe account.%2$s By clicking this button " 1057 "you agree to the %3$sTerms of Service%2$s. Or, manually enter Stripe " 1058 "account keys below." 1059 msgstr "" 1060 1061 #: includes/class-wc-gateway-stripe.php:1307 1062 msgid "Manually enter Stripe keys below." 1063 msgstr "" 1064 1065 #: includes/class-wc-stripe-api.php:148 includes/class-wc-stripe-api.php:182 1062 1066 msgid "There was a problem connecting to the Stripe API endpoint." 1063 1067 msgstr "" … … 1105 1109 msgstr "" 1106 1110 1111 #: includes/class-wc-stripe-blocks-support.php:164 1112 msgid "Credit / Debit Card" 1113 msgstr "" 1114 1115 #: includes/class-wc-stripe-blocks-support.php:221 1116 msgid "Visa" 1117 msgstr "" 1118 1119 #: includes/class-wc-stripe-blocks-support.php:225 1120 msgid "American Express" 1121 msgstr "" 1122 1123 #: includes/class-wc-stripe-blocks-support.php:229 1124 msgid "Mastercard" 1125 msgstr "" 1126 1127 #: includes/class-wc-stripe-blocks-support.php:236 1128 msgid "Discover" 1129 msgstr "" 1130 1131 #: includes/class-wc-stripe-blocks-support.php:240 1132 msgid "JCB" 1133 msgstr "" 1134 1135 #: includes/class-wc-stripe-blocks-support.php:244 1136 msgid "Diners" 1137 msgstr "" 1138 1107 1139 #: includes/class-wc-stripe-customer.php:130 1108 1140 #. translators: %1$s First name, %2$s Second name, %3$s Username. … … 1115 1147 msgstr "" 1116 1148 1117 #: includes/class-wc-stripe-customer.php:20 41149 #: includes/class-wc-stripe-customer.php:205 1118 1150 msgid "Attempting to update a Stripe customer without a customer ID." 1119 1151 msgstr "" 1120 1152 1121 #: includes/class-wc-stripe-customer.php:35 31153 #: includes/class-wc-stripe-customer.php:354 1122 1154 msgid "Unable to add payment source." 1123 1155 msgstr "" … … 1215 1247 msgstr "" 1216 1248 1217 #: includes/class-wc-stripe-intent-controller.php:1 601249 #: includes/class-wc-stripe-intent-controller.php:177 1218 1250 msgid "Unable to verify your request. Please reload the page and try again." 1219 1251 msgstr "" 1220 1252 1221 #: includes/class-wc-stripe-intent-controller.php:2 001253 #: includes/class-wc-stripe-intent-controller.php:217 1222 1254 msgid "Your card could not be set up for future usage." 1223 1255 msgstr "" 1224 1256 1225 #: includes/class-wc-stripe-intent-controller.php:2 171257 #: includes/class-wc-stripe-intent-controller.php:234 1226 1258 msgid "Failed to save payment method." 1227 1259 msgstr "" … … 1595 1627 1596 1628 #: includes/payment-methods/class-wc-gateway-stripe-alipay.php:61 1597 #: woocommerce-gateway-stripe.php:30 51629 #: woocommerce-gateway-stripe.php:307 1598 1630 msgid "Stripe Alipay" 1599 1631 msgstr "" … … 1624 1656 1625 1657 #: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:61 1626 #: woocommerce-gateway-stripe.php: 2991658 #: woocommerce-gateway-stripe.php:301 1627 1659 msgid "Stripe Bancontact" 1628 1660 msgstr "" 1629 1661 1630 1662 #: includes/payment-methods/class-wc-gateway-stripe-eps.php:61 1631 #: woocommerce-gateway-stripe.php:30 21663 #: woocommerce-gateway-stripe.php:304 1632 1664 msgid "Stripe EPS" 1633 1665 msgstr "" 1634 1666 1635 1667 #: includes/payment-methods/class-wc-gateway-stripe-giropay.php:61 1636 #: woocommerce-gateway-stripe.php:30 11668 #: woocommerce-gateway-stripe.php:303 1637 1669 msgid "Stripe Giropay" 1638 1670 msgstr "" 1639 1671 1640 1672 #: includes/payment-methods/class-wc-gateway-stripe-ideal.php:61 1641 #: woocommerce-gateway-stripe.php:30 31673 #: woocommerce-gateway-stripe.php:305 1642 1674 msgid "Stripe iDeal" 1643 1675 msgstr "" 1644 1676 1645 1677 #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:61 1646 #: woocommerce-gateway-stripe.php:30 71678 #: woocommerce-gateway-stripe.php:309 1647 1679 msgid "Stripe Multibanco" 1648 1680 msgstr "" … … 1673 1705 1674 1706 #: includes/payment-methods/class-wc-gateway-stripe-p24.php:61 1675 #: woocommerce-gateway-stripe.php:30 41707 #: woocommerce-gateway-stripe.php:306 1676 1708 msgid "Stripe P24" 1677 1709 msgstr "" 1678 1710 1679 1711 #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:76 1680 #: woocommerce-gateway-stripe.php:30 61712 #: woocommerce-gateway-stripe.php:308 1681 1713 msgid "Stripe SEPA Direct Debit" 1682 1714 msgstr "" … … 1705 1737 1706 1738 #: includes/payment-methods/class-wc-gateway-stripe-sofort.php:61 1707 #: woocommerce-gateway-stripe.php:30 01739 #: woocommerce-gateway-stripe.php:302 1708 1740 msgid "Stripe SOFORT" 1709 1741 msgstr "" 1710 1742 1711 #: includes/payment-methods/class-wc-stripe-payment-request.php:3 371712 #: includes/payment-methods/class-wc-stripe-payment-request.php:10 181713 #: includes/payment-methods/class-wc-stripe-payment-request.php:1 4451743 #: includes/payment-methods/class-wc-stripe-payment-request.php:362 1744 #: includes/payment-methods/class-wc-stripe-payment-request.php:1084 1745 #: includes/payment-methods/class-wc-stripe-payment-request.php:1514 1714 1746 msgid "Tax" 1715 1747 msgstr "" 1716 1748 1717 #: includes/payment-methods/class-wc-stripe-payment-request.php:3 451718 #: includes/payment-methods/class-wc-stripe-payment-request.php:10 261719 #: includes/payment-methods/class-wc-stripe-payment-request.php:1 4521749 #: includes/payment-methods/class-wc-stripe-payment-request.php:370 1750 #: includes/payment-methods/class-wc-stripe-payment-request.php:1092 1751 #: includes/payment-methods/class-wc-stripe-payment-request.php:1521 1720 1752 msgid "Shipping" 1721 1753 msgstr "" 1722 1754 1723 #: includes/payment-methods/class-wc-stripe-payment-request.php:3 521724 #: includes/payment-methods/class-wc-stripe-payment-request.php:10 331755 #: includes/payment-methods/class-wc-stripe-payment-request.php:377 1756 #: includes/payment-methods/class-wc-stripe-payment-request.php:1099 1725 1757 msgid "Pending" 1726 1758 msgstr "" 1727 1759 1728 #: includes/payment-methods/class-wc-stripe-payment-request.php: 5621760 #: includes/payment-methods/class-wc-stripe-payment-request.php:639 1729 1761 msgid "Sorry, we're not accepting prepaid cards at this time." 1730 1762 msgstr "" 1731 1763 1732 #: includes/payment-methods/class-wc-stripe-payment-request.php: 5641764 #: includes/payment-methods/class-wc-stripe-payment-request.php:641 1733 1765 #. translators: Do not translate the [option] placeholder 1734 1766 msgid "Unknown shipping option \"[option]\"." 1735 1767 msgstr "" 1736 1768 1737 #: includes/payment-methods/class-wc-stripe-payment-request.php: 6751769 #: includes/payment-methods/class-wc-stripe-payment-request.php:740 1738 1770 msgid "OR" 1739 1771 msgstr "" 1740 1772 1741 #: includes/payment-methods/class-wc-stripe-payment-request.php: 8671742 #: includes/payment-methods/class-wc-stripe-payment-request.php: 8801773 #: includes/payment-methods/class-wc-stripe-payment-request.php:933 1774 #: includes/payment-methods/class-wc-stripe-payment-request.php:946 1743 1775 msgid "Unable to find shipping method for address." 1744 1776 msgstr "" 1745 1777 1746 #: includes/payment-methods/class-wc-stripe-payment-request.php: 9801778 #: includes/payment-methods/class-wc-stripe-payment-request.php:1046 1747 1779 #. translators: %d is the product Id 1748 1780 msgid "Product with the ID (%d) cannot be found." 1749 1781 msgstr "" 1750 1782 1751 #: includes/payment-methods/class-wc-stripe-payment-request.php:10 011783 #: includes/payment-methods/class-wc-stripe-payment-request.php:1067 1752 1784 #. translators: 1: product name 2: quantity in stock 1753 1785 msgid "" … … 1756 1788 msgstr "" 1757 1789 1758 #: includes/payment-methods/class-wc-stripe-payment-request.php:1 2731790 #: includes/payment-methods/class-wc-stripe-payment-request.php:1339 1759 1791 #. translators: %s: country. 1760 1792 msgid "" … … 1764 1796 msgstr "" 1765 1797 1766 #: includes/payment-methods/class-wc-stripe-payment-request.php:1 2891798 #: includes/payment-methods/class-wc-stripe-payment-request.php:1355 1767 1799 msgid "Empty cart" 1768 1800 msgstr "" 1769 1801 1770 #: includes/payment-methods/class-wc-stripe-payment-request.php:1 4591802 #: includes/payment-methods/class-wc-stripe-payment-request.php:1528 1771 1803 msgid "Discount" 1772 1804 msgstr "" … … 1811 1843 msgstr "" 1812 1844 1813 #: woocommerce-gateway-stripe.php:2 291845 #: woocommerce-gateway-stripe.php:231 1814 1846 msgid "Settings" 1815 1847 msgstr "" 1816 1848 1817 #: woocommerce-gateway-stripe.php:24 51849 #: woocommerce-gateway-stripe.php:247 1818 1850 msgid "View Documentation" 1819 1851 msgstr "" 1820 1852 1821 #: woocommerce-gateway-stripe.php:24 51853 #: woocommerce-gateway-stripe.php:247 1822 1854 msgid "Docs" 1823 1855 msgstr "" 1824 1856 1825 #: woocommerce-gateway-stripe.php:24 61857 #: woocommerce-gateway-stripe.php:248 1826 1858 msgid "Open a support request at WooCommerce.com" 1827 1859 msgstr "" 1828 1860 1829 #: woocommerce-gateway-stripe.php:24 61861 #: woocommerce-gateway-stripe.php:248 1830 1862 msgid "Support" 1831 1863 msgstr "" -
woocommerce-gateway-stripe/trunk/readme.txt
r2511074 r2534245 5 5 Tested up to: 5.6 6 6 Requires PHP: 5.6 7 Stable tag: 5. 1.07 Stable tag: 5.2.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 127 127 == Changelog == 128 128 129 = 5.2.0 - 2021-05-19 = 130 131 * Fix - Use `get_parent` method to avoid accessing `order` subscription property directly. 132 * Fix - Orders won't transition to 'Refunded' state if refund can't be created. 133 * Fix - Normalize United Kingdom and Canada postal codes for Apple Pay. 134 * Fix - Subscription sign-up fees not included in total for Payment Request Button. 135 * Fix - Reduce requests sent to server from stripe settings page. 136 * Fix - Choose the appropriate version of the WooCommerce Admin Notes API based on which API is available. 137 * Fix - Customer information is now correctly displayed in the Stripe Payments Dashboard when a new customer checks out through the WooCommerce Checkout Block. 138 * Fix - Pass customer language/locale to Stripe upon creation or modification. 139 * Fix - Initial price for Variable Products is now correctly shown when a Payment Request is started. 140 * Add - Support for Credit Card payments (incl. 3DS payments) via WooCommerce Blocks; limited to WooCommerce Core product types. 141 * Add - Support for payments (incl. 3DS payments) paid via Payment Request Buttons in WooCommerce Blocks; limited to WooCommerce Core product types. 142 * Add - Support for custom and branded Payment Request Buttons when using the Cart and Checkout blocks. 143 * Tweak - Should customer opt to save their card, the card is now saved after a payment has been confirmed. 144 129 145 = 5.1.0 - 2021-04-07 = 130 146 131 147 * Fix - Don't attempt to submit level 3 data for non-US merchants. 148 * Fix - Pass customer language/locale to Stripe upon creation or modification. 132 149 * Fix - Hide Payment Request Buttons when guest checkout is disabled. 133 150 * Fix - Match Payment Request states with WooCommerce states. -
woocommerce-gateway-stripe/trunk/woocommerce-gateway-stripe.php
r2511074 r2534245 6 6 * Author: WooCommerce 7 7 * Author URI: https://woocommerce.com/ 8 * Version: 5. 1.08 * Version: 5.2.0 9 9 * Requires at least: 4.4 10 10 * Tested up to: 5.6 … … 22 22 * Required minimums and constants 23 23 */ 24 define( 'WC_STRIPE_VERSION', '5. 1.0' ); // WRCS: DEFINED_VERSION.24 define( 'WC_STRIPE_VERSION', '5.2.0' ); // WRCS: DEFINED_VERSION. 25 25 define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' ); 26 26 define( 'WC_STRIPE_MIN_WC_VER', '3.0' ); … … 157 157 require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-stripe-payment-request.php'; 158 158 require_once dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-subs-compat.php'; 159 require_once dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-woo-compat-utils.php'; 159 160 require_once dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-sepa-subs-compat.php'; 160 161 require_once dirname( __FILE__ ) . '/includes/connect/class-wc-stripe-connect.php'; … … 215 216 } 216 217 218 add_woocommerce_inbox_variant(); 217 219 $this->update_plugin_version(); 218 220 } … … 391 393 woocommerce_gateway_stripe(); 392 394 } 395 396 /** 397 * Add woocommerce_inbox_variant for the Remote Inbox Notification. 398 * 399 * P2 post can be found at https://wp.me/paJDYF-1uJ. 400 */ 401 if ( ! function_exists( 'add_woocommerce_inbox_variant' ) ) { 402 function add_woocommerce_inbox_variant() { 403 $config_name = 'woocommerce_inbox_variant_assignment'; 404 if ( false === get_option( $config_name, false ) ) { 405 update_option( $config_name, wp_rand( 1, 12 ) ); 406 } 407 } 408 } 409 register_activation_hook( __FILE__, 'add_woocommerce_inbox_variant' ); 410 411 // Hook in Blocks integration. This action is called in a callback on plugins loaded, so current Stripe plugin class 412 // implementation is too late. 413 add_action( 'woocommerce_blocks_loaded', 'woocommerce_gateway_stripe_woocommerce_block_support' ); 414 415 function woocommerce_gateway_stripe_woocommerce_block_support() { 416 if ( class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) { 417 require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-blocks-support.php'; 418 // priority is important here because this ensures this integration is 419 // registered before the WooCommerce Blocks built-in Stripe registration. 420 // Blocks code has a check in place to only register if 'stripe' is not 421 // already registered. 422 add_action( 423 'woocommerce_blocks_payment_method_type_registration', 424 function( Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { 425 $container = Automattic\WooCommerce\Blocks\Package::container(); 426 // registers as shared instance. 427 $container->register( 428 WC_Stripe_Blocks_Support::class, 429 function() { 430 return new WC_Stripe_Blocks_Support(); 431 } 432 ); 433 $payment_method_registry->register( 434 $container->get( WC_Stripe_Blocks_Support::class ) 435 ); 436 }, 437 5 438 ); 439 } 440 }
Note: See TracChangeset
for help on using the changeset viewer.