Plugin Directory

Changeset 2534245


Ignore:
Timestamp:
05/19/2021 12:31:18 PM (5 years ago)
Author:
woothemes
Message:

Add latest version of Stripe to trunk

Location:
woocommerce-gateway-stripe/trunk
Files:
5 added
23 edited

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}
    415
    516.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}
    722
    823.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}
    1028
    1129.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}
    1333
    1434.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}
    1638
    1739.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}
    1943
    2044.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}
    2248
    2349.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}
    2553
    2654.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}
    2858
    2959.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}
    3163
    3264.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}
    3468
    3569.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}
    3780
    3881.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}
    4092
    4193.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}
    43104
    44105.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}
    46116
    47117.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}
    49128
    50129.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}
    52140
    53141.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}
    55152
    56153.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}
    58164
    59165.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}
    65181
    66182.gpay-button {
     
    69185    background-repeat: no-repeat;
    70186    background-size: contain;
    71     border: 0px;
     187    border: 0;
    72188    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;
    74189    cursor: pointer;
    75190    height: 40px;
     
    82197        width: calc( 100% - 3px );
    83198        background-color: #fff;
     199
     200        // Add vertical margin to make box-shadow visible in blocks.
     201        margin: 2px 0 3px 0;
     202
    84203        &:active {
    85204            background-color: #fff;
     
    94213    }
    95214
     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
    96239    &.dark {
    97240        background-color: #000;
    98         box-shadow: none;
    99241        padding: 12px 24px 10px;
    100242        &:active {
    101243            background-color: #5f6368;
    102244        }
    103         &:hover{
     245        &:hover {
    104246            background-color: #3c4043;
    105247        }
     
    111253
    112254    &.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 );
    115258        }
    116259        &.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  
    130130            var timeDifference = Date.now() / 1000 - wc_stripe_settings_params.time;
    131131            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            }
    148136        }
    149137    };
  • 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()});
     1jQuery(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  
    33    'use strict';
    44
    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    } ),
    68        paymentRequestType;
    79
     
    543545
    544546        createGooglePayButton: function () {
    545             var allowedThemes = [ 'dark', 'light' ];
     547            var allowedThemes = [ 'dark', 'light', 'light-outline' ];
    546548            var allowedTypes = [ 'short', 'long' ];
    547549
     
    551553            var height = wc_stripe_payment_request_params.button.height;
    552554            theme = allowedThemes.includes( theme ) ? theme : 'light';
     555            var gpaySvgTheme = 'dark' === theme ? 'dark' : 'light';
    553556            type = allowedTypes.includes( type ) ? type : 'long';
    554557
     
    557560            button.addClass( theme + ' ' + type );
    558561            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';
    561564                // Check if locale GPay button exists, default to en if not
    562565                setBackgroundImageWithFallback( button, url, fallbackUrl );
     
    611614            });
    612615
     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
    613628            $( 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' );
    615630
    616631                $.when( wc_stripe_payment_request.getSelectedProductData() ).then( function ( response ) {
     
    621636                        } )
    622637                    ).then( function () {
    623                         wc_stripe_payment_request.unblockPaymentRequestButton( prButton );
     638                        $( document.body ).trigger( 'wc_stripe_unblock_payment_request_button' );
    624639                    } );
    625640                });
     
    629644            // when the customer clicks on the button before the debounced event is processed.
    630645            $( '.quantity' ).on( 'input', '.qty', function() {
    631                 wc_stripe_payment_request.blockPaymentRequestButton( prButton );
     646                $( document.body ).trigger( 'wc_stripe_block_payment_request_button' );
    632647            } );
    633648
    634649            $( '.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' );
    636651                paymentRequestError = [];
    637652
     
    639654                    if ( response.error ) {
    640655                        paymentRequestError = [ response.error ];
    641                         wc_stripe_payment_request.unblockPaymentRequestButton( prButton );
     656                        $( document.body ).trigger( 'wc_stripe_unblock_payment_request_button' );
    642657                    } else {
    643658                        $.when(
     
    647662                            } )
    648663                        ).then( function () {
    649                             wc_stripe_payment_request.unblockPaymentRequestButton( prButton );
     664                            $( document.body ).trigger( 'wc_stripe_unblock_payment_request_button' );
    650665                        });
    651666                    }
     
    679694        },
    680695
    681         blockPaymentRequestButton: function( prButton ) {
     696        blockPaymentRequestButton: function( cssClassname ) {
    682697            // check if element isn't already blocked before calling block() to avoid blinking overlay issues
    683698            // blockUI.isBlocked is either undefined or 0 when element is not blocked
     
    686701            }
    687702
    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();
    699712        },
    700713
  • 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()})});
     1jQuery(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  
    55
    66    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        } );
    810    } catch( error ) {
    911        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()});
     1jQuery(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  
    11*** 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
    218= 5.1.0 - 2021-04-07 =
    319* 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  
    119119            $error &&
    120120            'invalid_request_error' === $error->type &&
    121             preg_match( '/No such source/i', $error->message )
     121            preg_match( '/No such (source|PaymentMethod)/i', $error->message )
    122122        );
    123123    }
     
    187187
    188188        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' ] );
    189195    }
    190196
     
    636642             */
    637643            if ( ( $user_id && $this->saved_cards && $maybe_saved_card && 'reusable' === $source_object->usage ) || $force_save_source ) {
    638                 $response = $customer->add_source( $source_object->id );
     644                $response = $customer->attach_source( $source_object->id );
    639645
    640646                if ( ! empty( $response->error ) ) {
     
    666672            // This is true if the user wants to store the card to their account.
    667673            if ( ( $user_id && $this->saved_cards && $maybe_saved_card ) || $force_save_source ) {
    668                 $response = $customer->add_source( $stripe_token );
     674                $response = $customer->attach_source( $stripe_token );
    669675
    670676                if ( ! empty( $response->error ) ) {
     
    674680                    throw new WC_Stripe_Exception( $response->get_error_message(), $response->get_error_message() );
    675681                }
    676                 $source_id = $response;
     682                $source_id = $response->id;
    677683            } else {
    678684                $source_id = $stripe_token;
     
    913919            WC_Stripe_Logger::log( 'Error: ' . $response->error->message );
    914920
    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            );
    916929
    917930        } elseif ( ! empty( $response->id ) ) {
     
    10801093            ],
    10811094        ];
     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        }
    10821102
    10831103        if ( $prepared_source->customer ) {
  • woocommerce-gateway-stripe/trunk/includes/admin/class-wc-stripe-inbox-notes.php

    r2497960 r2534245  
    11<?php
     2
    23if ( ! defined( 'ABSPATH' ) ) {
    34    exit;
    45}
    5 
    6 use Automattic\WooCommerce\Admin\Notes\WC_Admin_Note;
    7 use Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes;
    86
    97/**
     
    5048     */
    5149    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' ) ) {
    5752            return;
    5853        }
     
    6459            while ( ! empty( $failure_note_ids ) ) {
    6560                $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 );
    6762                $note->delete();
    6863            }
     
    122117
    123118        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();
    125121            $note->set_title( self::get_success_title() );
    126122            $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 );
    128124            $note->set_name( self::SUCCESS_NOTE_NAME );
    129125            $note->set_source( 'woocommerce-gateway-stripe' );
     
    142138    public static function create_failure_note() {
    143139        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();
    145142            $note->set_title( __( 'Apple Pay domain verification needed', 'woocommerce-gateway-stripe' ) );
    146143            $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 );
    148145            $note->set_name( self::FAILURE_NOTE_NAME );
    149146            $note->set_source( 'woocommerce-gateway-stripe' );
     
    163160     */
    164161    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' ) ) {
    170164            return;
    171165        }
     
    185179        $deleted_an_unactioned_note = false;
    186180
     181        $admin_note_class = WC_Stripe_Woo_Compat_Utils::get_note_class();
    187182        foreach ( (array) $note_ids as $note_id ) {
    188183            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() ) {
    191186                    $note->delete();
    192187                    $deleted_an_unactioned_note = true;
  • woocommerce-gateway-stripe/trunk/includes/admin/stripe-settings.php

    r2497960 r2534245  
    22if ( ! defined( 'ABSPATH' ) ) {
    33    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&section=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     }
    374}
    385
     
    6330        'api_credentials'                     => [
    6431            'title'       => __( 'Stripe Account Keys', 'woocommerce-gateway-stripe' ),
    65             'type'        => 'title',
    66             'description' => $api_credentials_text,
     32            'type'        => 'stripe_account_keys',
    6733        ],
    6834        'testmode'                            => [
  • woocommerce-gateway-stripe/trunk/includes/class-wc-gateway-stripe.php

    r2497960 r2534245  
    443443        );
    444444
     445        $stripe_params['stripe_locale']             = WC_Stripe_Helper::convert_wc_locale_to_stripe_locale( get_locale() );
    445446        $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' );
    446447        $stripe_params['no_sepa_owner_msg']         = __( 'Please enter your IBAN account name.', 'woocommerce-gateway-stripe' );
     
    628629            }
    629630
     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
    630637            if ( ! empty( $intent->error ) ) {
    631638                $this->maybe_remove_non_existent_customer( $intent->error, $order );
     
    701708                'redirect' => '',
    702709            ];
     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            }
    703732        }
    704733    }
     
    10141043
    10151044        // 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' ) );
    10241058
    10251059        if ( isset( $result['payment_intent_secret'] ) ) {
     
    12331267        return $settings;
    12341268    }
     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&section=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    }
    12351313}
  • woocommerce-gateway-stripe/trunk/includes/class-wc-stripe-api.php

    r2511074 r2534245  
    5858    public static function get_user_agent() {
    5959        $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',
    6364        ];
    6465
     
    8283        $app_info   = $user_agent['application'];
    8384
    84         return apply_filters(
     85        $headers = apply_filters(
    8586            'woocommerce_stripe_request_headers',
    8687            [
    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,
    9190            ]
    9291        );
     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;
    9398    }
    9499
  • woocommerce-gateway-stripe/trunk/includes/class-wc-stripe-customer.php

    r2497960 r2534245  
    157157        }
    158158
    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 );
    161162
    162163        return wp_parse_args( $args, $defaults );
     
    266267     */
    267268    public function add_source( $source_id ) {
    268         $response = $this->attach_source( $source_id );
     269        $response = WC_Stripe_API::retrieve( 'sources/' . $source_id );
    269270
    270271        if ( ! empty( $response->error ) || is_wp_error( $response ) ) {
     
    485486        return $this->create_customer();
    486487    }
     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    }
    487542}
  • woocommerce-gateway-stripe/trunk/includes/class-wc-stripe-helper.php

    r2497960 r2534245  
    511511        return $statement_descriptor;
    512512    }
     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    }
    513600}
  • woocommerce-gateway-stripe/trunk/includes/class-wc-stripe-intent-controller.php

    r2497960 r2534245  
    102102        try {
    103103            $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            }
    104121
    105122            if ( ! isset( $_GET['is_ajax'] ) ) {
  • woocommerce-gateway-stripe/trunk/includes/compat/class-wc-stripe-sepa-subs-compat.php

    r2497960 r2534245  
    468468
    469469        // 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() ) {
    471471            $stripe_customer_id = get_post_meta( $subscription->get_parent_id(), '_stripe_customer_id', true );
    472472            $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  
    580580
    581581        // 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() ) {
    583583            $stripe_customer_id = get_post_meta( $subscription->get_parent_id(), '_stripe_customer_id', true );
    584584            $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  
    166166     *
    167167     * @since  4.0.0
     168     * @version 5.2.0
    168169     * @return void
    169170     */
    170171    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() ) ) {
    172173            return;
    173174        }
     
    205206
    206207        add_filter( 'woocommerce_gateway_title', [ $this, 'filter_gateway_title' ], 10, 2 );
    207         add_filter( 'woocommerce_validate_postcode', [ $this, 'postal_code_validation' ], 10, 3 );
    208 
    209208        add_action( 'woocommerce_checkout_order_processed', [ $this, 'add_order_meta' ], 10, 2 );
    210209    }
     
    299298
    300299    /**
     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    /**
    301318     * Gets the product data for the currently viewed page
    302319     *
    303320     * @since   4.0.0
    304      * @version 4.0.0
     321     * @version 5.2.0
    305322     * @return  mixed Returns false if not on a product page, the product information otherwise.
    306323     */
    307324    public function get_product_data() {
    308         if ( ! is_product() ) {
     325        if ( ! $this->is_product() ) {
    309326            return false;
    310327        }
    311328
    312         global $post;
    313 
    314         $product = wc_get_product( $post->ID );
     329        $product = $this->get_product();
    315330
    316331        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            }
    318343
    319344            $data_store   = WC_Data_Store::load( 'product' );
     
    330355        $items[] = [
    331356            '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 ) ),
    333358        ];
    334359
     
    359384        $data['total']        = [
    360385            '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 ) ),
    362387            'pending' => true,
    363388        ];
     
    383408        $method_title = is_object( $order ) ? $order->get_payment_method_title() : '';
    384409
    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            }
    391425        }
    392426
     
    395429
    396430    /**
    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 ) {
    415439        /**
    416          * Currently Apple Pay truncates postal codes from UK and Canada to first 3 characters
     440         * Currently, Apple Pay truncates the UK and Canadian postal codes to the first 4 and 3 characters respectively
    417441         * 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.
    420443         */
    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;
    426454    }
    427455
     
    448476            $order->set_payment_method_title( 'Apple Pay (Stripe)' );
    449477            $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)' );
    454483            $order->save();
    455484        }
     
    515544
    516545    /**
     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    /**
    517591     * Load public scripts and styles.
    518592     *
    519593     * @since   3.1.0
    520      * @version 4.0.0
     594     * @version 5.2.0
    521595     */
    522596    public function scripts() {
     
    533607        }
    534608
    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'] ) ) {
    536611            return;
    537612        }
    538613
    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() ) {
    540617            return;
    541618        }
     
    582659                'branded_type' => $this->get_button_branded_type(),
    583660            ],
    584             'is_product_page' => is_product(),
     661            'is_product_page' => $this->is_product(),
    585662            'product'         => $this->get_product_data(),
    586663        ];
     
    603680     *
    604681     * @since   4.0.0
    605      * @version 4.0.0
     682     * @version 5.2.0
    606683     */
    607684    public function display_payment_request_button_html() {
     
    614691        }
    615692
    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'] ) ) {
    617694            return;
    618695        }
    619696
    620697        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() ) {
    627698            return;
    628699        }
     
    648719     *
    649720     * @since   4.0.0
    650      * @version 4.0.0
     721     * @version 5.2.0
    651722     */
    652723    public function display_payment_request_button_separator_html() {
     
    659730        }
    660731
    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'] ) ) {
    662733            return;
    663734        }
    664735
    665736        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() ) {
    672737            return;
    673738        }
     
    704769     *
    705770     * @since  4.3.2
     771     * @version 5.2.0
    706772     * @return boolean
    707773     */
     
    709775        global $post;
    710776
    711         $product = wc_get_product( $post->ID );
    712 
    713777        if ( apply_filters( 'wc_stripe_hide_payment_request_on_product_page', false, $post ) ) {
    714778            return false;
    715779        }
     780
     781        $product = $this->get_product();
    716782
    717783        if ( ! is_object( $product ) || ! in_array( $product->get_type(), $this->supported_product_types() ) ) {
     
    10021068            }
    10031069
    1004             $total = $qty * $product->get_price() + $addon_value;
     1070            $total = $qty * $this->get_product_price( $product ) + $addon_value;
    10051071
    10061072            $quantity_label = 1 < $qty ? ' (x' . $qty . ')' : '';
     
    13231389        // Normalizes state to calculate shipping zones.
    13241390        $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 );
    13251394
    13261395        WC()->shipping->reset_shipping();
  • woocommerce-gateway-stripe/trunk/languages/woocommerce-gateway-stripe.pot

    r2511074 r2534245  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WooCommerce Stripe Gateway 5.1.0\n"
     5"Project-Id-Version: WooCommerce Stripe Gateway 5.2.0\n"
    66"Report-Msgid-Bugs-To: "
    77"https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
    8 "POT-Creation-Date: 2021-04-07 19:43:23+00:00\n"
     8"POT-Creation-Date: 2021-05-19 12:15:27+00:00\n"
    99"MIME-Version: 1.0\n"
    1010"Content-Type: text/plain; charset=utf-8\n"
     
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    1414"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"
    1616
    1717#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:25
     
    3030msgstr ""
    3131
    32 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:251
     32#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:257
    3333#: includes/compat/class-wc-stripe-sepa-subs-compat.php:230
    3434#: includes/compat/class-wc-stripe-subs-compat.php:243
     
    3838msgstr ""
    3939
    40 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:344
     40#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:350
    4141#. translators: 1) blog name 2) order number
    4242msgid "%1$s - Order %2$s"
    4343msgstr ""
    4444
    45 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:385
     45#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:391
    4646msgid "customer_name"
    4747msgstr ""
    4848
    49 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:386
     49#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:392
    5050msgid "customer_email"
    5151msgstr ""
    5252
    53 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:449
     53#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:455
    5454#. translators: transaction id
    5555msgid "Stripe charge awaiting payment: %s."
    5656msgstr ""
    5757
    58 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:456
     58#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:462
    5959#: includes/class-wc-stripe-order-handler.php:299
    6060#: includes/class-wc-stripe-webhook-handler.php:415
     
    6464msgstr ""
    6565
    66 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:461
    67 #: includes/class-wc-gateway-stripe.php:503
     66#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:467
     67#: includes/class-wc-gateway-stripe.php:504
    6868#: includes/compat/class-wc-stripe-sepa-subs-compat.php:187
    6969msgid "Payment processing failed. Please retry."
    7070msgstr ""
    7171
    72 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:473
     72#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:479
    7373#. translators: transaction id
    7474msgid ""
     
    7878msgstr ""
    7979
    80 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:654
     80#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:660
    8181msgid "Invalid payment method. Please input a new card number."
    8282msgstr ""
    8383
    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
     86msgid "There was a problem initiating a refund: %1$s"
     87msgstr ""
     88
     89#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:939
    8590#. translators: amount (including currency symbol)
    8691msgid "Pre-Authorization for %s voided."
    8792msgstr ""
    8893
    89 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:931
     94#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:944
    9095msgid ""
    9196"The authorization was voided and the order cancelled. Click okay to "
     
    9398msgstr ""
    9499
    95 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:945
     100#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:958
    96101#. translators: 1) amount (including currency symbol) 2) transaction id 3)
    97102#. refund message
     
    99104msgstr ""
    100105
    101 #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:963
     106#: includes/abstracts/abstract-wc-stripe-payment-gateway.php:976
    102107msgid "There was a problem adding the payment method."
    103108msgstr ""
     
    200205msgstr ""
    201206
    202 #: includes/admin/class-wc-stripe-inbox-notes.php:42
     207#: includes/admin/class-wc-stripe-inbox-notes.php:40
    203208msgid "Boost sales this holiday season with Apple Pay!"
    204209msgstr ""
    205210
    206 #: includes/admin/class-wc-stripe-inbox-notes.php:45
     211#: includes/admin/class-wc-stripe-inbox-notes.php:43
    207212msgid "Boost sales with Apple Pay!"
    208213msgstr ""
    209214
    210 #: includes/admin/class-wc-stripe-inbox-notes.php:126
     215#: includes/admin/class-wc-stripe-inbox-notes.php:122
    211216msgid ""
    212217"Now that you accept Apple Pay® with Stripe, you can increase conversion "
     
    215220msgstr ""
    216221
    217 #: includes/admin/class-wc-stripe-inbox-notes.php:132
     222#: includes/admin/class-wc-stripe-inbox-notes.php:128
    218223msgid "See marketing guide"
    219224msgstr ""
    220225
    221 #: includes/admin/class-wc-stripe-inbox-notes.php:145
     226#: includes/admin/class-wc-stripe-inbox-notes.php:142
    222227msgid "Apple Pay domain verification needed"
    223228msgstr ""
    224229
    225 #: includes/admin/class-wc-stripe-inbox-notes.php:146
     230#: includes/admin/class-wc-stripe-inbox-notes.php:143
    226231msgid ""
    227232"The WooCommerce Stripe Gateway extension attempted to perform domain "
     
    230235msgstr ""
    231236
    232 #: includes/admin/class-wc-stripe-inbox-notes.php:152
     237#: includes/admin/class-wc-stripe-inbox-notes.php:149
    233238msgid "Learn more"
    234239msgstr ""
     
    364369#: includes/admin/stripe-p24-settings.php:18
    365370#: includes/admin/stripe-sepa-settings.php:22
    366 #: includes/admin/stripe-settings.php:43
     371#: includes/admin/stripe-settings.php:10
    367372#: includes/admin/stripe-sofort-settings.php:22
    368373msgid "Enable/Disable"
     
    381386#: includes/admin/stripe-p24-settings.php:25
    382387#: includes/admin/stripe-sepa-settings.php:29
    383 #: includes/admin/stripe-settings.php:50
     388#: includes/admin/stripe-settings.php:17
    384389#: includes/admin/stripe-sofort-settings.php:29
    385390msgid "Title"
     
    394399#: includes/admin/stripe-p24-settings.php:27
    395400#: includes/admin/stripe-sepa-settings.php:31
    396 #: includes/admin/stripe-settings.php:52
     401#: includes/admin/stripe-settings.php:19
    397402#: includes/admin/stripe-sofort-settings.php:31
    398403msgid "This controls the title which the user sees during checkout."
     
    411416#: includes/admin/stripe-p24-settings.php:32
    412417#: includes/admin/stripe-sepa-settings.php:36
    413 #: includes/admin/stripe-settings.php:57
     418#: includes/admin/stripe-settings.php:24
    414419#: includes/admin/stripe-sofort-settings.php:36
    415420msgid "Description"
     
    424429#: includes/admin/stripe-p24-settings.php:34
    425430#: includes/admin/stripe-sepa-settings.php:38
    426 #: includes/admin/stripe-settings.php:59
     431#: includes/admin/stripe-settings.php:26
    427432#: includes/admin/stripe-sofort-settings.php:38
    428433msgid "This controls the description which the user sees during checkout."
     
    441446#: includes/admin/stripe-p24-settings.php:39
    442447#: includes/admin/stripe-sepa-settings.php:43
    443 #: includes/admin/stripe-settings.php:105
     448#: includes/admin/stripe-settings.php:71
    444449#: includes/admin/stripe-sofort-settings.php:43
    445450msgid "Webhook Endpoints"
     
    585590msgstr ""
    586591
    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
     593msgid "Enable Stripe"
     594msgstr ""
     595
     596#: includes/admin/stripe-settings.php:20
     597msgid "Credit Card (Stripe)"
     598msgstr ""
     599
     600#: includes/admin/stripe-settings.php:27
     601msgid "Pay with your credit card via Stripe."
     602msgstr ""
     603
     604#: includes/admin/stripe-settings.php:31
     605msgid "Stripe Account Keys"
    600606msgstr ""
    601607
    602608#: includes/admin/stripe-settings.php:35
    603 msgid "Manually enter Stripe keys below."
    604 msgstr ""
    605 
    606 #: includes/admin/stripe-settings.php:44
    607 msgid "Enable Stripe"
    608 msgstr ""
    609 
    610 #: includes/admin/stripe-settings.php:53
    611 msgid "Credit Card (Stripe)"
    612 msgstr ""
    613 
    614 #: includes/admin/stripe-settings.php:60
    615 msgid "Pay with your credit card via Stripe."
    616 msgstr ""
    617 
    618 #: includes/admin/stripe-settings.php:64
    619 msgid "Stripe Account Keys"
    620 msgstr ""
    621 
    622 #: includes/admin/stripe-settings.php:69
    623609msgid "Test mode"
    624610msgstr ""
    625611
    626 #: includes/admin/stripe-settings.php:70
     612#: includes/admin/stripe-settings.php:36
    627613msgid "Enable Test Mode"
    628614msgstr ""
    629615
    630 #: includes/admin/stripe-settings.php:72
     616#: includes/admin/stripe-settings.php:38
    631617msgid "Place the payment gateway in test mode using test API keys."
    632618msgstr ""
    633619
    634 #: includes/admin/stripe-settings.php:77
     620#: includes/admin/stripe-settings.php:43
    635621msgid "Test Publishable Key"
    636622msgstr ""
    637623
    638 #: includes/admin/stripe-settings.php:79
     624#: includes/admin/stripe-settings.php:45
    639625msgid ""
    640626"Get your API keys from your stripe account. Invalid values will be "
     
    642628msgstr ""
    643629
    644 #: includes/admin/stripe-settings.php:84
     630#: includes/admin/stripe-settings.php:50
    645631msgid "Test Secret Key"
    646632msgstr ""
    647633
    648 #: includes/admin/stripe-settings.php:86
     634#: includes/admin/stripe-settings.php:52
    649635msgid ""
    650636"Get your API keys from your stripe account. Invalid values will be "
     
    653639msgstr ""
    654640
    655 #: includes/admin/stripe-settings.php:91
     641#: includes/admin/stripe-settings.php:57
    656642msgid "Live Publishable Key"
    657643msgstr ""
    658644
    659 #: includes/admin/stripe-settings.php:93
     645#: includes/admin/stripe-settings.php:59
    660646msgid ""
    661647"Get your API keys from your stripe account. Invalid values will be "
     
    663649msgstr ""
    664650
    665 #: includes/admin/stripe-settings.php:98
     651#: includes/admin/stripe-settings.php:64
    666652msgid "Live Secret Key"
    667653msgstr ""
    668654
    669 #: includes/admin/stripe-settings.php:100
     655#: includes/admin/stripe-settings.php:66
    670656msgid ""
    671657"Get your API keys from your stripe account. Invalid values will be "
     
    674660msgstr ""
    675661
    676 #: includes/admin/stripe-settings.php:110
     662#: includes/admin/stripe-settings.php:76
    677663msgid "Test Webhook Secret"
    678664msgstr ""
    679665
    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
    682667msgid ""
    683668"Get your webhook signing secret from the webhooks section in your stripe "
     
    685670msgstr ""
    686671
    687 #: includes/admin/stripe-settings.php:117
     672#: includes/admin/stripe-settings.php:83
    688673msgid "Webhook Secret"
    689674msgstr ""
    690675
    691 #: includes/admin/stripe-settings.php:124
     676#: includes/admin/stripe-settings.php:90
    692677msgid "Inline Credit Card Form"
    693678msgstr ""
    694679
    695 #: includes/admin/stripe-settings.php:126
     680#: includes/admin/stripe-settings.php:92
    696681msgid ""
    697682"Choose the style you want to show for your credit card form. When "
     
    700685msgstr ""
    701686
    702 #: includes/admin/stripe-settings.php:131
     687#: includes/admin/stripe-settings.php:97
    703688msgid "Statement Descriptor"
    704689msgstr ""
    705690
    706 #: includes/admin/stripe-settings.php:133
     691#: includes/admin/stripe-settings.php:99
    707692msgid ""
    708693"Statement descriptors are limited to 22 characters, cannot use the special "
     
    712697msgstr ""
    713698
    714 #: includes/admin/stripe-settings.php:138
     699#: includes/admin/stripe-settings.php:104
    715700msgid "Capture"
    716701msgstr ""
    717702
    718 #: includes/admin/stripe-settings.php:139
     703#: includes/admin/stripe-settings.php:105
    719704msgid "Capture charge immediately"
    720705msgstr ""
    721706
    722 #: includes/admin/stripe-settings.php:141
     707#: includes/admin/stripe-settings.php:107
    723708msgid ""
    724709"Whether or not to immediately capture the charge. When unchecked, the "
     
    727712msgstr ""
    728713
    729 #: includes/admin/stripe-settings.php:146
     714#: includes/admin/stripe-settings.php:112
    730715msgid "Payment Request Buttons"
    731716msgstr ""
    732717
    733 #: includes/admin/stripe-settings.php:149
     718#: includes/admin/stripe-settings.php:115
    734719#. translators: 1) br tag 2) Stripe anchor tag 3) Apple anchor tag 4) Stripe
    735720#. dashboard opening anchor tag 5) Stripe dashboard closing anchor tag
     
    741726msgstr ""
    742727
    743 #: includes/admin/stripe-settings.php:157
     728#: includes/admin/stripe-settings.php:123
    744729msgid ""
    745730"If enabled, users will be able to pay using Apple Pay or Chrome Payment "
     
    747732msgstr ""
    748733
    749 #: includes/admin/stripe-settings.php:162
     734#: includes/admin/stripe-settings.php:128
    750735msgid "Payment Request Button Type"
    751736msgstr ""
    752737
    753 #: includes/admin/stripe-settings.php:163
     738#: includes/admin/stripe-settings.php:129
    754739msgid "Button Type"
    755740msgstr ""
    756741
    757 #: includes/admin/stripe-settings.php:165
     742#: includes/admin/stripe-settings.php:131
    758743msgid "Select the button type you would like to show."
    759744msgstr ""
    760745
    761 #: includes/admin/stripe-settings.php:169
     746#: includes/admin/stripe-settings.php:135
    762747msgid "Default"
    763748msgstr ""
    764749
    765 #: includes/admin/stripe-settings.php:170
     750#: includes/admin/stripe-settings.php:136
    766751msgid "Buy"
    767752msgstr ""
    768753
    769 #: includes/admin/stripe-settings.php:171
     754#: includes/admin/stripe-settings.php:137
    770755msgid "Donate"
    771756msgstr ""
    772757
    773 #: includes/admin/stripe-settings.php:172
     758#: includes/admin/stripe-settings.php:138
    774759msgid "Branded"
    775760msgstr ""
    776761
    777 #: includes/admin/stripe-settings.php:173
     762#: includes/admin/stripe-settings.php:139
    778763msgid "Custom"
    779764msgstr ""
    780765
    781 #: includes/admin/stripe-settings.php:177
     766#: includes/admin/stripe-settings.php:143
    782767msgid "Payment Request Button Theme"
    783768msgstr ""
    784769
    785 #: includes/admin/stripe-settings.php:178
     770#: includes/admin/stripe-settings.php:144
    786771msgid "Button Theme"
    787772msgstr ""
    788773
    789 #: includes/admin/stripe-settings.php:180
     774#: includes/admin/stripe-settings.php:146
    790775msgid "Select the button theme you would like to show."
    791776msgstr ""
    792777
    793 #: includes/admin/stripe-settings.php:184
     778#: includes/admin/stripe-settings.php:150
    794779msgid "Dark"
    795780msgstr ""
    796781
    797 #: includes/admin/stripe-settings.php:185
     782#: includes/admin/stripe-settings.php:151
    798783msgid "Light"
    799784msgstr ""
    800785
    801 #: includes/admin/stripe-settings.php:186
     786#: includes/admin/stripe-settings.php:152
    802787msgid "Light-Outline"
    803788msgstr ""
    804789
    805 #: includes/admin/stripe-settings.php:190
     790#: includes/admin/stripe-settings.php:156
    806791msgid "Payment Request Button Height"
    807792msgstr ""
    808793
    809 #: includes/admin/stripe-settings.php:191
     794#: includes/admin/stripe-settings.php:157
    810795msgid "Button Height"
    811796msgstr ""
    812797
    813 #: includes/admin/stripe-settings.php:193
     798#: includes/admin/stripe-settings.php:159
    814799msgid ""
    815800"Enter the height you would like the button to be in pixels. Width will "
     
    817802msgstr ""
    818803
    819 #: includes/admin/stripe-settings.php:198
     804#: includes/admin/stripe-settings.php:164
    820805msgid "Payment Request Button Label"
    821806msgstr ""
    822807
    823 #: includes/admin/stripe-settings.php:199
     808#: includes/admin/stripe-settings.php:165
    824809msgid "Button Label"
    825810msgstr ""
    826811
    827 #: includes/admin/stripe-settings.php:201
     812#: includes/admin/stripe-settings.php:167
    828813msgid "Enter the custom text you would like the button to have."
    829814msgstr ""
    830815
    831 #: includes/admin/stripe-settings.php:202
     816#: includes/admin/stripe-settings.php:168
    832817msgid "Buy now"
    833818msgstr ""
    834819
    835 #: includes/admin/stripe-settings.php:206
     820#: includes/admin/stripe-settings.php:172
    836821msgid "Payment Request Branded Button Label Format"
    837822msgstr ""
    838823
    839 #: includes/admin/stripe-settings.php:207
     824#: includes/admin/stripe-settings.php:173
    840825msgid "Branded Button Label Format"
    841826msgstr ""
    842827
    843 #: includes/admin/stripe-settings.php:209
     828#: includes/admin/stripe-settings.php:175
    844829msgid "Select the branded button label format."
    845830msgstr ""
    846831
    847 #: includes/admin/stripe-settings.php:213
     832#: includes/admin/stripe-settings.php:179
    848833msgid "Logo only"
    849834msgstr ""
    850835
    851 #: includes/admin/stripe-settings.php:214
     836#: includes/admin/stripe-settings.php:180
    852837msgid "Text and logo"
    853838msgstr ""
    854839
    855 #: includes/admin/stripe-settings.php:218
     840#: includes/admin/stripe-settings.php:184
    856841msgid "Saved Cards"
    857842msgstr ""
    858843
    859 #: includes/admin/stripe-settings.php:219
     844#: includes/admin/stripe-settings.php:185
    860845msgid "Enable Payment via Saved Cards"
    861846msgstr ""
    862847
    863 #: includes/admin/stripe-settings.php:221
     848#: includes/admin/stripe-settings.php:187
    864849msgid ""
    865850"If enabled, users will be able to pay with a saved card during checkout. "
     
    867852msgstr ""
    868853
    869 #: includes/admin/stripe-settings.php:226
     854#: includes/admin/stripe-settings.php:192
    870855msgid "Logging"
    871856msgstr ""
    872857
    873 #: includes/admin/stripe-settings.php:227
     858#: includes/admin/stripe-settings.php:193
    874859msgid "Log debug messages"
    875860msgstr ""
    876861
    877 #: includes/admin/stripe-settings.php:229
     862#: includes/admin/stripe-settings.php:195
    878863msgid "Save debug messages to the WooCommerce System Status log."
    879864msgstr ""
     
    958943msgstr ""
    959944
    960 #: includes/class-wc-gateway-stripe.php:445
    961 #: includes/class-wc-gateway-stripe.php:490
     945#: includes/class-wc-gateway-stripe.php:446
     946#: includes/class-wc-gateway-stripe.php:491
    962947msgid ""
    963948"Sorry, we're not accepting prepaid cards at this time. Your credit card has "
     
    965950msgstr ""
    966951
    967 #: includes/class-wc-gateway-stripe.php:446
     952#: includes/class-wc-gateway-stripe.php:447
    968953msgid "Please enter your IBAN account name."
    969954msgstr ""
    970955
    971 #: includes/class-wc-gateway-stripe.php:447
     956#: includes/class-wc-gateway-stripe.php:448
    972957msgid "Please enter your IBAN account number."
    973958msgstr ""
    974959
    975 #: includes/class-wc-gateway-stripe.php:448
     960#: includes/class-wc-gateway-stripe.php:449
    976961msgid "We couldn't initiate the payment. Please try again."
    977962msgstr ""
    978963
    979 #: includes/class-wc-gateway-stripe.php:459
     964#: includes/class-wc-gateway-stripe.php:460
    980965msgid "Billing First Name and Last Name are required."
    981966msgstr ""
    982967
    983 #: includes/class-wc-gateway-stripe.php:731
     968#: includes/class-wc-gateway-stripe.php:760
    984969#. translators: error message
    985970msgid "This represents the fee Stripe collects for the transaction."
    986971msgstr ""
    987972
    988 #: includes/class-wc-gateway-stripe.php:732
     973#: includes/class-wc-gateway-stripe.php:761
    989974msgid "Stripe Fee:"
    990975msgstr ""
    991976
    992 #: includes/class-wc-gateway-stripe.php:768
     977#: includes/class-wc-gateway-stripe.php:797
    993978msgid ""
    994979"This represents the net total that will be credited to your Stripe bank "
     
    996981msgstr ""
    997982
    998 #: includes/class-wc-gateway-stripe.php:769
     983#: includes/class-wc-gateway-stripe.php:798
    999984msgid "Stripe Payout:"
    1000985msgstr ""
    1001986
    1002 #: includes/class-wc-gateway-stripe.php:832
     987#: includes/class-wc-gateway-stripe.php:861
    1003988#: includes/class-wc-stripe-order-handler.php:159
    1004989#: includes/class-wc-stripe-webhook-handler.php:264
     
    1011996msgstr ""
    1012997
    1013 #: includes/class-wc-gateway-stripe.php:885
     998#: includes/class-wc-gateway-stripe.php:914
    1014999msgid ""
    10151000"Almost there!\n"
     
    10191004msgstr ""
    10201005
    1021 #: includes/class-wc-gateway-stripe.php:907
     1006#: includes/class-wc-gateway-stripe.php:936
    10221007#. translators: %s is the order Id
    10231008msgid "Payment Intent not found for order #%s"
    10241009msgstr ""
    10251010
    1026 #: includes/class-wc-gateway-stripe.php:1133
     1011#: includes/class-wc-gateway-stripe.php:1167
    10271012#: includes/class-wc-stripe-webhook-handler.php:768
    10281013#: includes/class-wc-stripe-webhook-handler.php:813
     
    10311016msgstr ""
    10321017
    1033 #: includes/class-wc-gateway-stripe.php:1134
     1018#: includes/class-wc-gateway-stripe.php:1168
    10341019msgid "Stripe SCA authentication failed."
    10351020msgstr ""
    10361021
    1037 #: includes/class-wc-gateway-stripe.php:1191
     1022#: includes/class-wc-gateway-stripe.php:1225
    10381023msgid ""
    10391024"The \"Live Publishable Key\" should start with \"pk_live\", enter the "
     
    10411026msgstr ""
    10421027
    1043 #: includes/class-wc-gateway-stripe.php:1199
     1028#: includes/class-wc-gateway-stripe.php:1233
    10441029msgid ""
    10451030"The \"Live Secret Key\" should start with \"sk_live\" or \"rk_live\", enter "
     
    10471032msgstr ""
    10481033
    1049 #: includes/class-wc-gateway-stripe.php:1207
     1034#: includes/class-wc-gateway-stripe.php:1241
    10501035msgid ""
    10511036"The \"Test Publishable Key\" should start with \"pk_test\", enter the "
     
    10531038msgstr ""
    10541039
    1055 #: includes/class-wc-gateway-stripe.php:1215
     1040#: includes/class-wc-gateway-stripe.php:1249
    10561041msgid ""
    10571042"The \"Test Secret Key\" should start with \"sk_test\" or \"rk_test\", enter "
     
    10591044msgstr ""
    10601045
    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
     1048msgid ""
     1049"%1$sClear all Stripe account keys.%2$s %3$sThis will disable any connection "
     1050"to Stripe.%4$s"
     1051msgstr ""
     1052
     1053#: includes/class-wc-gateway-stripe.php:1301
     1054#. translators: %1, %2 and %3 are all HTML markup tags
     1055msgid ""
     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."
     1059msgstr ""
     1060
     1061#: includes/class-wc-gateway-stripe.php:1307
     1062msgid "Manually enter Stripe keys below."
     1063msgstr ""
     1064
     1065#: includes/class-wc-stripe-api.php:148 includes/class-wc-stripe-api.php:182
    10621066msgid "There was a problem connecting to the Stripe API endpoint."
    10631067msgstr ""
     
    11051109msgstr ""
    11061110
     1111#: includes/class-wc-stripe-blocks-support.php:164
     1112msgid "Credit / Debit Card"
     1113msgstr ""
     1114
     1115#: includes/class-wc-stripe-blocks-support.php:221
     1116msgid "Visa"
     1117msgstr ""
     1118
     1119#: includes/class-wc-stripe-blocks-support.php:225
     1120msgid "American Express"
     1121msgstr ""
     1122
     1123#: includes/class-wc-stripe-blocks-support.php:229
     1124msgid "Mastercard"
     1125msgstr ""
     1126
     1127#: includes/class-wc-stripe-blocks-support.php:236
     1128msgid "Discover"
     1129msgstr ""
     1130
     1131#: includes/class-wc-stripe-blocks-support.php:240
     1132msgid "JCB"
     1133msgstr ""
     1134
     1135#: includes/class-wc-stripe-blocks-support.php:244
     1136msgid "Diners"
     1137msgstr ""
     1138
    11071139#: includes/class-wc-stripe-customer.php:130
    11081140#. translators: %1$s First name, %2$s Second name, %3$s Username.
     
    11151147msgstr ""
    11161148
    1117 #: includes/class-wc-stripe-customer.php:204
     1149#: includes/class-wc-stripe-customer.php:205
    11181150msgid "Attempting to update a Stripe customer without a customer ID."
    11191151msgstr ""
    11201152
    1121 #: includes/class-wc-stripe-customer.php:353
     1153#: includes/class-wc-stripe-customer.php:354
    11221154msgid "Unable to add payment source."
    11231155msgstr ""
     
    12151247msgstr ""
    12161248
    1217 #: includes/class-wc-stripe-intent-controller.php:160
     1249#: includes/class-wc-stripe-intent-controller.php:177
    12181250msgid "Unable to verify your request. Please reload the page and try again."
    12191251msgstr ""
    12201252
    1221 #: includes/class-wc-stripe-intent-controller.php:200
     1253#: includes/class-wc-stripe-intent-controller.php:217
    12221254msgid "Your card could not be set up for future usage."
    12231255msgstr ""
    12241256
    1225 #: includes/class-wc-stripe-intent-controller.php:217
     1257#: includes/class-wc-stripe-intent-controller.php:234
    12261258msgid "Failed to save payment method."
    12271259msgstr ""
     
    15951627
    15961628#: includes/payment-methods/class-wc-gateway-stripe-alipay.php:61
    1597 #: woocommerce-gateway-stripe.php:305
     1629#: woocommerce-gateway-stripe.php:307
    15981630msgid "Stripe Alipay"
    15991631msgstr ""
     
    16241656
    16251657#: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:61
    1626 #: woocommerce-gateway-stripe.php:299
     1658#: woocommerce-gateway-stripe.php:301
    16271659msgid "Stripe Bancontact"
    16281660msgstr ""
    16291661
    16301662#: includes/payment-methods/class-wc-gateway-stripe-eps.php:61
    1631 #: woocommerce-gateway-stripe.php:302
     1663#: woocommerce-gateway-stripe.php:304
    16321664msgid "Stripe EPS"
    16331665msgstr ""
    16341666
    16351667#: includes/payment-methods/class-wc-gateway-stripe-giropay.php:61
    1636 #: woocommerce-gateway-stripe.php:301
     1668#: woocommerce-gateway-stripe.php:303
    16371669msgid "Stripe Giropay"
    16381670msgstr ""
    16391671
    16401672#: includes/payment-methods/class-wc-gateway-stripe-ideal.php:61
    1641 #: woocommerce-gateway-stripe.php:303
     1673#: woocommerce-gateway-stripe.php:305
    16421674msgid "Stripe iDeal"
    16431675msgstr ""
    16441676
    16451677#: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:61
    1646 #: woocommerce-gateway-stripe.php:307
     1678#: woocommerce-gateway-stripe.php:309
    16471679msgid "Stripe Multibanco"
    16481680msgstr ""
     
    16731705
    16741706#: includes/payment-methods/class-wc-gateway-stripe-p24.php:61
    1675 #: woocommerce-gateway-stripe.php:304
     1707#: woocommerce-gateway-stripe.php:306
    16761708msgid "Stripe P24"
    16771709msgstr ""
    16781710
    16791711#: includes/payment-methods/class-wc-gateway-stripe-sepa.php:76
    1680 #: woocommerce-gateway-stripe.php:306
     1712#: woocommerce-gateway-stripe.php:308
    16811713msgid "Stripe SEPA Direct Debit"
    16821714msgstr ""
     
    17051737
    17061738#: includes/payment-methods/class-wc-gateway-stripe-sofort.php:61
    1707 #: woocommerce-gateway-stripe.php:300
     1739#: woocommerce-gateway-stripe.php:302
    17081740msgid "Stripe SOFORT"
    17091741msgstr ""
    17101742
    1711 #: includes/payment-methods/class-wc-stripe-payment-request.php:337
    1712 #: includes/payment-methods/class-wc-stripe-payment-request.php:1018
    1713 #: includes/payment-methods/class-wc-stripe-payment-request.php:1445
     1743#: 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
    17141746msgid "Tax"
    17151747msgstr ""
    17161748
    1717 #: includes/payment-methods/class-wc-stripe-payment-request.php:345
    1718 #: includes/payment-methods/class-wc-stripe-payment-request.php:1026
    1719 #: includes/payment-methods/class-wc-stripe-payment-request.php:1452
     1749#: 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
    17201752msgid "Shipping"
    17211753msgstr ""
    17221754
    1723 #: includes/payment-methods/class-wc-stripe-payment-request.php:352
    1724 #: includes/payment-methods/class-wc-stripe-payment-request.php:1033
     1755#: includes/payment-methods/class-wc-stripe-payment-request.php:377
     1756#: includes/payment-methods/class-wc-stripe-payment-request.php:1099
    17251757msgid "Pending"
    17261758msgstr ""
    17271759
    1728 #: includes/payment-methods/class-wc-stripe-payment-request.php:562
     1760#: includes/payment-methods/class-wc-stripe-payment-request.php:639
    17291761msgid "Sorry, we're not accepting prepaid cards at this time."
    17301762msgstr ""
    17311763
    1732 #: includes/payment-methods/class-wc-stripe-payment-request.php:564
     1764#: includes/payment-methods/class-wc-stripe-payment-request.php:641
    17331765#. translators: Do not translate the [option] placeholder
    17341766msgid "Unknown shipping option \"[option]\"."
    17351767msgstr ""
    17361768
    1737 #: includes/payment-methods/class-wc-stripe-payment-request.php:675
     1769#: includes/payment-methods/class-wc-stripe-payment-request.php:740
    17381770msgid "OR"
    17391771msgstr ""
    17401772
    1741 #: includes/payment-methods/class-wc-stripe-payment-request.php:867
    1742 #: includes/payment-methods/class-wc-stripe-payment-request.php:880
     1773#: includes/payment-methods/class-wc-stripe-payment-request.php:933
     1774#: includes/payment-methods/class-wc-stripe-payment-request.php:946
    17431775msgid "Unable to find shipping method for address."
    17441776msgstr ""
    17451777
    1746 #: includes/payment-methods/class-wc-stripe-payment-request.php:980
     1778#: includes/payment-methods/class-wc-stripe-payment-request.php:1046
    17471779#. translators: %d is the product Id
    17481780msgid "Product with the ID (%d) cannot be found."
    17491781msgstr ""
    17501782
    1751 #: includes/payment-methods/class-wc-stripe-payment-request.php:1001
     1783#: includes/payment-methods/class-wc-stripe-payment-request.php:1067
    17521784#. translators: 1: product name 2: quantity in stock
    17531785msgid ""
     
    17561788msgstr ""
    17571789
    1758 #: includes/payment-methods/class-wc-stripe-payment-request.php:1273
     1790#: includes/payment-methods/class-wc-stripe-payment-request.php:1339
    17591791#. translators: %s: country.
    17601792msgid ""
     
    17641796msgstr ""
    17651797
    1766 #: includes/payment-methods/class-wc-stripe-payment-request.php:1289
     1798#: includes/payment-methods/class-wc-stripe-payment-request.php:1355
    17671799msgid "Empty cart"
    17681800msgstr ""
    17691801
    1770 #: includes/payment-methods/class-wc-stripe-payment-request.php:1459
     1802#: includes/payment-methods/class-wc-stripe-payment-request.php:1528
    17711803msgid "Discount"
    17721804msgstr ""
     
    18111843msgstr ""
    18121844
    1813 #: woocommerce-gateway-stripe.php:229
     1845#: woocommerce-gateway-stripe.php:231
    18141846msgid "Settings"
    18151847msgstr ""
    18161848
    1817 #: woocommerce-gateway-stripe.php:245
     1849#: woocommerce-gateway-stripe.php:247
    18181850msgid "View Documentation"
    18191851msgstr ""
    18201852
    1821 #: woocommerce-gateway-stripe.php:245
     1853#: woocommerce-gateway-stripe.php:247
    18221854msgid "Docs"
    18231855msgstr ""
    18241856
    1825 #: woocommerce-gateway-stripe.php:246
     1857#: woocommerce-gateway-stripe.php:248
    18261858msgid "Open a support request at WooCommerce.com"
    18271859msgstr ""
    18281860
    1829 #: woocommerce-gateway-stripe.php:246
     1861#: woocommerce-gateway-stripe.php:248
    18301862msgid "Support"
    18311863msgstr ""
  • woocommerce-gateway-stripe/trunk/readme.txt

    r2511074 r2534245  
    55Tested up to: 5.6
    66Requires PHP: 5.6
    7 Stable tag: 5.1.0
     7Stable tag: 5.2.0
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    127127== Changelog ==
    128128
     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
    129145= 5.1.0 - 2021-04-07 =
    130146
    131147* 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.
    132149* Fix - Hide Payment Request Buttons when guest checkout is disabled.
    133150* Fix - Match Payment Request states with WooCommerce states.
  • woocommerce-gateway-stripe/trunk/woocommerce-gateway-stripe.php

    r2511074 r2534245  
    66 * Author: WooCommerce
    77 * Author URI: https://woocommerce.com/
    8  * Version: 5.1.0
     8 * Version: 5.2.0
    99 * Requires at least: 4.4
    1010 * Tested up to: 5.6
     
    2222 * Required minimums and constants
    2323 */
    24 define( 'WC_STRIPE_VERSION', '5.1.0' ); // WRCS: DEFINED_VERSION.
     24define( 'WC_STRIPE_VERSION', '5.2.0' ); // WRCS: DEFINED_VERSION.
    2525define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
    2626define( 'WC_STRIPE_MIN_WC_VER', '3.0' );
     
    157157                require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-stripe-payment-request.php';
    158158                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';
    159160                require_once dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-sepa-subs-compat.php';
    160161                require_once dirname( __FILE__ ) . '/includes/connect/class-wc-stripe-connect.php';
     
    215216                    }
    216217
     218                    add_woocommerce_inbox_variant();
    217219                    $this->update_plugin_version();
    218220                }
     
    391393    woocommerce_gateway_stripe();
    392394}
     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 */
     401if ( ! 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}
     409register_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.
     413add_action( 'woocommerce_blocks_loaded', 'woocommerce_gateway_stripe_woocommerce_block_support' );
     414
     415function 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.