Version Description
- Fixed - Error when changing WCS payment method to new ACH payment method
- Fixed - Error when payment_intent status 'success' and order cancelled status applied
- Added - Recipient email for payment_intent
- Added - Translations for credit card decline errors
- Added - Option to force 3D secure for all transactions
- Added - Option to show generic credit card decline error
- Added - SEPA mandate message on checkout page
- Updated - Google Pay documentation
Download this release
Release Info
Developer | mr.clayton |
Plugin | Payment Plugins for Stripe WooCommerce |
Version | 3.1.1 |
Comparing to | |
See all releases |
Code changes from version 3.1.0 to 3.1.1
- assets/css/stripe.css +20 -1
- assets/js/frontend/credit-card.js +3 -3
- assets/js/frontend/wc-stripe.js +13 -1
- assets/js/frontend/wc-stripe.min.js +1 -1
- i18n/languages/woo-stripe-payment.pot +590 -300
- includes/abstract/abstract-wc-payment-gateway-stripe-charge.php +0 -239
- includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php +11 -4
- includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php +0 -361
- includes/abstract/abstract-wc-payment-gateway-stripe.php +45 -10
- includes/abstract/abstract-wc-payment-token-stripe.php +2 -3
- includes/abstract/abstract-wc-stripe-payment.php +16 -7
- includes/abstract/abstract-wc-stripe-rest-controller.php +5 -3
- includes/abstract/abstract-wc-stripe-settings.php +4 -2
- includes/admin/class-wc-stripe-admin-assets.php +5 -2
- includes/admin/class-wc-stripe-admin-menus.php +3 -1
- includes/admin/class-wc-stripe-admin-settings.php +4 -1
- includes/admin/class-wc-stripe-admin-user-edit.php +4 -1
- includes/admin/meta-boxes/class-wc-stripe-admin-order-metaboxes.php +7 -2
- includes/admin/settings/class-wc-stripe-api-settings.php +5 -2
- includes/admin/views/html-user-profile.php +2 -2
- includes/class-stripe.php +8 -2
- includes/class-wc-stripe-constants.php +14 -1
- includes/class-wc-stripe-customer-manager.php +4 -1
- includes/class-wc-stripe-field-manager.php +6 -3
- includes/class-wc-stripe-frontend-notices.php +3 -1
- includes/class-wc-stripe-frontend-scripts.php +6 -1
- includes/class-wc-stripe-gateway-ach.php +4 -1
- includes/class-wc-stripe-gateway-conversions.php +4 -1
- includes/class-wc-stripe-gateway.php +74 -69
- includes/class-wc-stripe-install.php +4 -1
- includes/class-wc-stripe-payment-charge-local.php +71 -0
- includes/class-wc-stripe-payment-charge.php +20 -8
- includes/class-wc-stripe-payment-factory.php +42 -0
- includes/class-wc-stripe-payment-intent.php +48 -8
- includes/class-wc-stripe-redirect-handler.php +35 -45
- includes/class-wc-stripe-rest-api.php +7 -5
- includes/class-wc-stripe-update.php +10 -1
- includes/controllers/class-wc-stripe-controller-cart.php +4 -1
- includes/controllers/class-wc-stripe-controller-checkout.php +2 -0
- includes/controllers/class-wc-stripe-controller-gateway-settings.php +4 -1
- includes/controllers/class-wc-stripe-controller-googlepay.php +2 -0
- includes/controllers/class-wc-stripe-controller-order-actions.php +8 -0
- includes/controllers/class-wc-stripe-controller-payment-intent.php +7 -8
- includes/controllers/class-wc-stripe-controller-payment-method.php +4 -1
- includes/controllers/class-wc-stripe-controller-webhook.php +4 -2
- includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php +2 -0
- includes/gateways/class-wc-payment-gateway-stripe-ach.php +28 -0
- includes/gateways/class-wc-payment-gateway-stripe-alipay.php +2 -0
- includes/gateways/class-wc-payment-gateway-stripe-applepay.php +2 -0
- includes/gateways/class-wc-payment-gateway-stripe-bancontact.php +4 -2
- includes/gateways/class-wc-payment-gateway-stripe-cc.php +20 -4
- includes/gateways/class-wc-payment-gateway-stripe-eps.php +4 -2
- includes/gateways/class-wc-payment-gateway-stripe-fpx.php +2 -0
- includes/gateways/class-wc-payment-gateway-stripe-giropay.php +6 -3
- includes/gateways/class-wc-payment-gateway-stripe-googlepay.php +2 -0
- includes/gateways/class-wc-payment-gateway-stripe-ideal.php +2 -0
- includes/gateways/class-wc-payment-gateway-stripe-klarna.php +7 -5
- includes/gateways/class-wc-payment-gateway-stripe-multibanco.php +4 -2
- includes/gateways/class-wc-payment-gateway-stripe-p24.php +4 -2
- includes/gateways/class-wc-payment-gateway-stripe-payment-request.php +2 -0
- includes/gateways/class-wc-payment-gateway-stripe-sepa.php +25 -2
- includes/gateways/class-wc-payment-gateway-stripe-sofort.php +4 -2
- includes/gateways/class-wc-payment-gateway-stripe-wechat.php +3 -1
- includes/gateways/settings/cc-settings.php +12 -0
- includes/gateways/settings/googlepay-settings.php +1 -1
- includes/tokens/class-wc-payment-token-stripe-ach.php +4 -1
- includes/tokens/class-wc-payment-token-stripe-applepay.php +2 -0
- includes/tokens/class-wc-payment-token-stripe-cc.php +2 -0
- includes/tokens/class-wc-payment-token-stripe-googlepay.php +2 -0
- includes/tokens/class-wc-payment-token-stripe-local-payment.php +4 -1
- includes/traits/wc-stripe-controller-cart-trait.php +4 -1
- includes/traits/wc-stripe-payment-traits.php +7 -41
- includes/traits/wc-stripe-settings-trait.php +4 -2
- includes/updates/update-3.0.7.php +2 -0
- includes/updates/update-3.1.0.php +2 -0
- includes/updates/update-3.1.1.php +7 -0
- includes/wc-stripe-functions.php +91 -11
- includes/wc-stripe-hooks.php +3 -0
- includes/wc-stripe-webhook-functions.php +69 -35
- readme.txt +10 -1
- stripe-payments.php +3 -2
- templates/cc-forms/bootstrap.php +1 -1
- templates/checkout/local-payment.php +6 -3
- templates/product/payment-methods.php +1 -0
assets/css/stripe.css
CHANGED
@@ -101,6 +101,7 @@ input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:be
|
|
101 |
}
|
102 |
label.wc-stripe-label-payment-type:after{
|
103 |
content: none !important;
|
|
|
104 |
}
|
105 |
.select2-container .select2-selection--single .wc-stripe-select2-container,
|
106 |
.select2-results__options li.wc-stripe-select2-container{
|
@@ -163,6 +164,9 @@ label.wc-stripe-label-payment-type:after{
|
|
163 |
.select2-results__options li.wc-stripe-select2-container.jcb:before,
|
164 |
.select2-results__options li.wc-stripe-select2-container.jcb:before{
|
165 |
background-image: url(../img/cards/jcb.svg);
|
|
|
|
|
|
|
166 |
}
|
167 |
#wc-stripe-card-element{
|
168 |
margin-bottom: 1em;
|
@@ -531,7 +535,9 @@ ul.payment_methods li[class*=payment_method] input[name=payment_method]{
|
|
531 |
float: none;
|
532 |
}
|
533 |
ul.payment_methods li[class*=payment_method] > input[name=payment_method] + label{
|
534 |
-
padding:
|
|
|
|
|
535 |
}
|
536 |
ul.payment_methods li[class*=payment_method] .payment_box{
|
537 |
margin-top: 10px;
|
@@ -560,4 +566,17 @@ div[id*=wc_stripe_local_payment_stripe_].StripeElement{
|
|
560 |
}
|
561 |
.qrcode-message{
|
562 |
margin: 10px 0 0 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
563 |
}
|
101 |
}
|
102 |
label.wc-stripe-label-payment-type:after{
|
103 |
content: none !important;
|
104 |
+
display: none !important;
|
105 |
}
|
106 |
.select2-container .select2-selection--single .wc-stripe-select2-container,
|
107 |
.select2-results__options li.wc-stripe-select2-container{
|
164 |
.select2-results__options li.wc-stripe-select2-container.jcb:before,
|
165 |
.select2-results__options li.wc-stripe-select2-container.jcb:before{
|
166 |
background-image: url(../img/cards/jcb.svg);
|
167 |
+
}
|
168 |
+
.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{
|
169 |
+
display: none;
|
170 |
}
|
171 |
#wc-stripe-card-element{
|
172 |
margin-bottom: 1em;
|
535 |
float: none;
|
536 |
}
|
537 |
ul.payment_methods li[class*=payment_method] > input[name=payment_method] + label{
|
538 |
+
padding-top: 0;
|
539 |
+
padding-right: 0;
|
540 |
+
padding-bottom: 0;
|
541 |
}
|
542 |
ul.payment_methods li[class*=payment_method] .payment_box{
|
543 |
margin-top: 10px;
|
566 |
}
|
567 |
.qrcode-message{
|
568 |
margin: 10px 0 0 0;
|
569 |
+
}
|
570 |
+
|
571 |
+
#wc_stripe_local_payment_stripe_sepa{
|
572 |
+
padding: 10px 12px;
|
573 |
+
box-shadow: 0 1px 3px 0 #e6ebf1;
|
574 |
+
}
|
575 |
+
.wc-stripe-local-desc.stripe_sepa{
|
576 |
+
margin: 10px 0;
|
577 |
+
}
|
578 |
+
.wc-stripe-clear{
|
579 |
+
clear: both;
|
580 |
+
height: 0;
|
581 |
+
visibility: hidden;
|
582 |
}
|
assets/js/frontend/credit-card.js
CHANGED
@@ -184,7 +184,7 @@
|
|
184 |
this.stripe.handleCardAction(obj.client_secret).then(function(result) {
|
185 |
if (result.error) {
|
186 |
this.payment_token_received = false;
|
187 |
-
this.submit_error(result.error
|
188 |
this.sync_payment_intent(obj.order_id, obj.client_secret).catch(function(response) {
|
189 |
this.submit_error(response.message);
|
190 |
}.bind(this));
|
@@ -217,7 +217,7 @@
|
|
217 |
}
|
218 |
}).then(function(result) {
|
219 |
if (result.error) {
|
220 |
-
this.submit_error(result.error
|
221 |
return;
|
222 |
}
|
223 |
this.on_setup_intent_received(result.setupIntent.payment_method);
|
@@ -231,7 +231,7 @@
|
|
231 |
billing_details: this.get_billing_details()
|
232 |
}).then(function(result) {
|
233 |
if (result.error) {
|
234 |
-
this.submit_error(result.error
|
235 |
return;
|
236 |
}
|
237 |
this.on_token_received(result.paymentMethod);
|
184 |
this.stripe.handleCardAction(obj.client_secret).then(function(result) {
|
185 |
if (result.error) {
|
186 |
this.payment_token_received = false;
|
187 |
+
this.submit_error(result.error);
|
188 |
this.sync_payment_intent(obj.order_id, obj.client_secret).catch(function(response) {
|
189 |
this.submit_error(response.message);
|
190 |
}.bind(this));
|
217 |
}
|
218 |
}).then(function(result) {
|
219 |
if (result.error) {
|
220 |
+
this.submit_error(result.error);
|
221 |
return;
|
222 |
}
|
223 |
this.on_setup_intent_received(result.setupIntent.payment_method);
|
231 |
billing_details: this.get_billing_details()
|
232 |
}).then(function(result) {
|
233 |
if (result.error) {
|
234 |
+
this.submit_error(result.error);
|
235 |
return;
|
236 |
}
|
237 |
this.on_token_received(result.paymentMethod);
|
assets/js/frontend/wc-stripe.js
CHANGED
@@ -80,6 +80,7 @@
|
|
80 |
* @return {[type]}
|
81 |
*/
|
82 |
wc_stripe.BaseGateway.prototype.submit_error = function(message) {
|
|
|
83 |
if (message.indexOf('</ul>') == -1) {
|
84 |
message = '<div class="woocommerce-error">' + message + '</div>';
|
85 |
}
|
@@ -90,6 +91,17 @@
|
|
90 |
|
91 |
}
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
/**
|
94 |
* @param {[type]}
|
95 |
* @return {[type]}
|
@@ -1148,7 +1160,7 @@
|
|
1148 |
* @return {[type]}
|
1149 |
*/
|
1150 |
wc_stripe.CartGateway.prototype.submit_error = function(message) {
|
1151 |
-
this.submit_message(message);
|
1152 |
}
|
1153 |
|
1154 |
/**
|
80 |
* @return {[type]}
|
81 |
*/
|
82 |
wc_stripe.BaseGateway.prototype.submit_error = function(message) {
|
83 |
+
message = this.get_error_message(message);
|
84 |
if (message.indexOf('</ul>') == -1) {
|
85 |
message = '<div class="woocommerce-error">' + message + '</div>';
|
86 |
}
|
91 |
|
92 |
}
|
93 |
|
94 |
+
wc_stripe.BaseGateway.prototype.get_error_message = function(message) {
|
95 |
+
if (typeof message == 'object' && message.code) {
|
96 |
+
if (wc_stripe_messages[message.code]) {
|
97 |
+
message = wc_stripe_messages[message.code];
|
98 |
+
} else {
|
99 |
+
message = message.message;
|
100 |
+
}
|
101 |
+
}
|
102 |
+
return message;
|
103 |
+
}
|
104 |
+
|
105 |
/**
|
106 |
* @param {[type]}
|
107 |
* @return {[type]}
|
1160 |
* @return {[type]}
|
1161 |
*/
|
1162 |
wc_stripe.CartGateway.prototype.submit_error = function(message) {
|
1163 |
+
this.submit_message(this.get_error_message(message));
|
1164 |
}
|
1165 |
|
1166 |
/**
|
assets/js/frontend/wc-stripe.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t,e){t.wc_stripe={};try{var i=Stripe(wc_stripe_params_v3.api_key)}catch(e){return t.alert(e),void console.log(e)}wc_stripe.BaseGateway=function(t){this.params=t,this.gateway_id=this.params.gateway_id,this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_intent_selector=this.params.payment_intent_selector,this.payment_token_received=!1,this.stripe=i,this.elements=i.elements(e.extend({},{locale:"auto"},this.get_element_options())),this.initialize()},wc_stripe.BaseGateway.prototype.get_page=function(){return wc_stripe_params_v3.page},wc_stripe.BaseGateway.prototype.set_nonce=function(t){e(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return e('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===e('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return e("#wc_stripe_checkout_error").length>0&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t){-1==t.indexOf("</ul>")&&(t='<div class="woocommerce-error">'+t+"</div>"),this.submit_message(t)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){},wc_stripe.BaseGateway.prototype.submit_message=function(t){e(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove();var i=e(this.message_container);i.closest("form").length&&(i=i.closest("form")),i.prepend(t),i.removeClass("processing").unblock(),i.find(".input-text, select, input:checkbox").blur(),e("html, body").animate({scrollTop:i.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_first_name=function(t){return e("#"+t+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(t){return e("#"+t+"_last_name").val()},wc_stripe.BaseGateway.prototype.should_save_method=function(){return e("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return e(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return e(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return"1"===this.params.needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return e("#wc_stripe_currency").val()},wc_stripe.BaseGateway.prototype.get_country=function(){return e("#wc_stripe_country").val()},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return e(t+"_first_name").val()+" "+e(t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return e("#billing_email").val()},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var i=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],a="",n=0;n<i.length;n++)a+=e(t+i[n]).val()+"_";return a},wc_stripe.BaseGateway.prototype.block=function(){e.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){e.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return e(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return e("#wc_stripe_order_total").data("amount")},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return e("#wc_stripe_order_total_cents").data("amount")},wc_stripe.BaseGateway.prototype.set_total_price=function(t){e("#wc_stripe_order_total").data("amount",t)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){e("#wc_stripe_order_total_cents").data("amount",t)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){e('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(t&&e('[name^="shipping_method"]').length)for(var i in t){var a=t[i];e('[name="shipping_method['+i+']"][value="'+a+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,e(this.token_selector).val(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){this.paymentRequest=i.paymentRequest(this.get_payment_request_options()),this.needs_shipping()&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:this.needs_shipping()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),this.needs_shipping()&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var i={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},a=this.get_display_items(),n=this.get_shipping_options();return a&&(i.displayItems=a),this.needs_shipping()&&n&&(i.shippingOptions=n),t&&(i=e.extend(!0,{},i,t)),i},wc_stripe.BaseGateway.prototype.get_display_items=function(){return e("#wc_stripe_display_items").data("items")},wc_stripe.BaseGateway.prototype.set_display_items=function(t){e("#wc_stripe_display_items").data("items",t)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return e("#wc_stripe_shipping_options").data("items")},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){e("#wc_stripe_shipping_options").data("items",t)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(e){try{this.payment_response=e,this.populate_checkout_fields(e),e.complete("success"),this.on_token_received(e.paymentMethod)}catch(e){t.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){e(this.token_selector).val(t.paymentMethod.id),this.populate_address_fields(t)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t){var i=this.address_mappings();if(t.payerName&&i.payerName.set(t.payerName),t.payerEmail&&i.payerEmail.set(t.payerEmail),t.payerPhone&&i.payerPhone.set(t.payerPhone),t.shippingAddress){var a=t.shippingAddress;for(var n in a)i[n]&&i[n].set.call(this,a[n],"#shipping")}if(t.paymentMethod.billing_details.address){a=t.paymentMethod.billing_details.address;for(var n in a)i[n]&&i[n].set.call(this,a[n],"#billing")}this.maybe_set_ship_to_different(),e('[name="billing_country"]').trigger("change")},wc_stripe.BaseGateway.prototype.address_mappings=function(){return{payerName:{set:function(t,i){var a=t.split(" ");a.length>0&&e("#billing_first_name").val(a[0]),a.length>1&&e("#billing_last_name").val(a[1])},get:function(t){return e("#billing_first_name").val()+" "+e("#billing_last_name").val()}},payerEmail:{set:function(t){e("#billing_email").val(t)},get:function(){return e("#billing_email").val()}},payerPhone:{set:function(t){e("#billing_phone").val(t)},get:function(){return e("#billing_phone").val()}},recipient:{set:function(t,i){var a=t.split(" ");a.length>0&&e(i+"_first_name").val(a[0]),a.length>1&&e(i+"_last_name").val(a[1])},get:function(t){return e(t+"_first_name").val()+" "+e(t+"_last_name").val()}},country:{set:function(t,i){e(i+"_country").val(t)},get:function(t){return e(t+"_country").val()}},addressLine:{set:function(t,i){t.length>0&&e(i+"_address_1").val(t[0]),t.length>1&&e(i+"_address_2").val(t[1])},get:function(t){return[e(t+"_address_1").val(),e(t+"_address_2").val()]}},line1:{set:function(t,i){e(i+"_address_1").val(t)},get:function(t){return e(t+"_address_1").val()}},line2:{set:function(t,i){e(i+"_address_2").val(t)},get:function(t){return e(t+"_address_2").val()}},region:{set:function(t,i){e(i+"_state").val(t)},get:function(t){e(t+"_state").val()}},state:{set:function(t,i){e(i+"_state").val(t)},get:function(t){e(t+"_state").val()}},city:{set:function(t,i){e(i+"_city").val(t)},get:function(t){e(t+"_city").val()}},postalCode:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){e(t+"_postcode").val()}},postal_code:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){e(t+"_postcode").val()}}}},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(i,a){this.block(),e.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:e.extend({},this.serialize_form(this.get_form()),{payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.reload?t.location.reload():"success"===e.result?t.location=e.redirect:(e.messages&&this.submit_error(e.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var i=t.find("input").filter(function(t,i){return!e(i).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),a={};for(var n in i){var s=i[n];a[s.name]=s.value}return a.payment_method=this.gateway_id,a},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};if("default"!==t){var i=t.match(/^(\d):(.+)$/);i.length>1&&(e[i[1]]=i[2])}return e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){e('[name="ship_to_different_address"]').length&&e('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("#billing")!==this.get_address_field_hash("#shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(t){return new Promise(function(i,a){e.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(t.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.code?(t.updateWith(e.data.newData),a(e.data)):(t.updateWith(e.data.newData),i(e.data))}.bind(this)).fail(function(t,e,i){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(t){return new Promise(function(i,a){e.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_methods:this.map_shipping_methods(t.shippingOption.id),payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.code?(t.updateWith(e.data.newData),a(e.data)):(this.set_selected_shipping_methods(e.data.shipping_methods),t.updateWith(e.data.newData),i(e.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.container=this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,e(document.body).on("update_checkout",this.update_checkout.bind(this)),e(document.body).on("updated_checkout",this.updated_checkout.bind(this)),e(document.body).on("checkout_error",this.checkout_error.bind(this)),e(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),e(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),e(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),e(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&e(".woocommerce-billing-fields").length&&e(".wc-stripe-banner-checkout").css("max-width",e(".woocommerce-billing-fields").outerWidth(!0)),this.order_review()},wc_stripe.CheckoutGateway.prototype.order_review=function(){var e=t.location.href.match(/order_review.+payment_method=([\w]+).+payment_nonce=(.+)/);if(e&&e.length>1){var i=e[1],a=e[2];this.gateway_id===i&&(this.payment_token_received=!0,this.set_nonce(a),this.set_use_new_option(!0))}},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(e('[name="terms"]').length&&!e('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return e('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){e("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,e(this.token_selector).val(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){e("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){e("form.checkout").unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){e("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){e("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,e('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if("undefined"==typeof wc_stripe_checkout_fields)return!0;var t=Object.keys(wc_stripe_checkout_fields.billing),i=Object.keys(wc_stripe_checkout_fields.shipping);function a(t,i){for(var a=0;a<t.length;a++){if(i[t[a]].required){var n=e("#"+t[a]).val();if(void 0===n||0==n.length)return void(valid=!1)}}}return valid=!0,a(t,wc_stripe_checkout_fields.billing),this.needs_shipping()&&e("#ship-to-different-address-checkbox").is(":checked")&&a(i,wc_stripe_checkout_fields.shipping),valid=this.is_valid_checkout(),valid},wc_stripe.ProductGateway=function(){this.container="li.payment_method_"+this.gateway_id,this.message_container="div.product",e(document.body).on("wc_stripe_updated_rest_nonce",this.set_rest_nonce.bind(this)),e("form.cart").on("found_variation",this.found_variation.bind(this)),e("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=e("div.quantity").outerWidth(!0)+e(".single_add_to_cart_button").outerWidth(),e(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(e('[name="quantity"]').val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_product_data();i.price=e.display_price,i.needs_shipping=!e.is_virtual,i.variation=e,this.set_product_data(i),this.enable_payment_button()},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return e('[name="variation_id"]').length>0},wc_stripe.ProductGateway.prototype.needs_shipping=function(){return this.get_product_data().needs_shipping},wc_stripe.ProductGateway.prototype.get_product_data=function(){return e("#wc_stripe_product_data").data("product")},wc_stripe.ProductGateway.prototype.set_product_data=function(t){e("#wc_stripe_product_data").data("product",t)},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(t,i){this.block(),e.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:{product_id:e("#product_id").val(),variation_id:this.is_variable_product()?e('[name="variation_id"]').val():0,qty:e('[name="quantity"]').val(),payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(a,n,s){this.unblock(),e(document.body).triggerHandler("wc_stripe_updated_rest_nonce",s.getResponseHeader("X-WP-Nonce")),a.code?(this.submit_error(a.message),i(a)):(this.set_total_price(a.data.total),this.set_total_price_cents(a.data.totalCents),this.set_display_items(a.data.displayItems),t(a.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(t){return new Promise(function(i,a){e.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:{product_id:e("#product_id").val(),variation_id:this.is_variable_product()&&t?t:0,qty:e('[name="quantity"]').val(),payment_method:this.gateway_id},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(t,a,n){e(document.body).triggerHandler("wc_stripe_updated_rest_nonce",n.getResponseHeader("X-WP-Nonce")),t.code?this.cart_calculation_error=!0:(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),i(t.data))}.bind(this)).fail(function(t,e,i){}.bind(this))}.bind(this))},wc_stripe.CartGateway=function(){this.container="li.payment_method_"+this.gateway_id,this.message_container="div.woocommerce",e(document.body).on("updated_wc_div",this.updated_html.bind(this)),e(document.body).on("updated_cart_totals",this.updated_html.bind(this))},wc_stripe.CartGateway.prototype.needs_shipping=function(){return 1===e("#wc_stripe_needs_shipping").data("value")},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(t)},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){e(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){};const a={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};wc_stripe.GooglePay.prototype.address_mappings=function(t){return{name:{set:function(t,i){var a=t.split(" ");e(i+"_first_name").val(a[0]),e(i+"_last_name").val(a[1])},get:function(t){return e(t+"_first_name").val()+e(t+"_last_name").val()}},postalCode:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){return e(t+"_postcode").val()}},countryCode:{set:function(t,i){e(i+"_country").val(t)},get:function(t){return e(t+"_country").val()}},phoneNumber:{set:function(t,i){e("#billing_phone").val(t)},get:function(){return"#billing_phone".val()}},address1:{set:function(t,i){e(i+"_address_1").val(t)},get:function(t){return e(t+"_address_1").val()}},address2:{set:function(t,i){e(i+"_address_2").val(t)},get:function(t){return e(t+"_address_2").val()}},locality:{set:function(t,i){e(i+"_city").val(t)},get:function(t){return e(t+"_city").val()}},administrativeArea:{set:function(t,i){e(i+"_state").val(t)},get:function(t){return e(t+"_state").val()}}}},wc_stripe.GooglePay.prototype.serialize_form=function(t){return e.extend({},wc_stripe.BaseGateway.prototype.serialize_form.apply(this,arguments),{order_review:!this.dynamic_price_enabled()})},wc_stripe.GooglePay.prototype.populate_address_fields=function(t){var i=t.paymentMethodData.info.billingAddress,a=this.address_mappings();for(var n in i)a[n]&&a[n].set.call(this,i[n],"#billing");if(t.shippingAddress)for(var n in t.shippingAddress)a[n]&&a[n].set.call(this,t.shippingAddress[n],"#shipping");t.email&&e("#billing_email").val(t.email),this.maybe_set_ship_to_different(),e('[name="billing_country"]').trigger("change")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(t){return new Promise(function(i,a){e.when(e.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{shipping_address:this.map_address(t.shippingAddress),shipping_methods:this.map_shipping_methods(t.shippingOptionData.id),shipping_method_id:t.shippingOptionData.id,page_id:this.get_page()},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)})).done(function(t){t.code?a(t.data.data):i(t.data)}.bind(this)).fail(function(){a()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(t){return new Promise(function(e,i){this.update_payment_data(t).then(function(i){e(i.paymentRequestUpdate),this.set_selected_shipping_methods(i.shipping_methods),this.payment_data_updated(i,t)}.bind(this)).catch(function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_googlepay_display_items=function(){return e("#googlepay_display_items").data("items")},wc_stripe.GooglePay.prototype.set_googlepay_display_items=function(t){e("#googlepay_display_items").data("items",t)},wc_stripe.GooglePay.prototype.get_shipping_options=function(){return e("#googlepay_shipping_options").data("items")},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.dynamic_price_enabled=function(){return"1"===this.params.dynamic_price},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t={environment:this.params.environment,merchantInfo:this.get_merchant_info()};return this.dynamic_price_enabled()&&(this.needs_shipping()&&this.get_total_price_cents()>0?t.paymentDataCallbacks={onPaymentDataChanged:this.on_payment_data_changed.bind(this),onPaymentAuthorized:function(t){return new Promise(function(t,e){t({transactionState:"SUCCESS"})}.bind(this))}.bind(this)}:t.paymentDataCallbacks={onPaymentAuthorized:function(t){return new Promise(function(t,e){t({transactionState:"SUCCESS"})}.bind(this))}}),t},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=e.extend({},a,{emailRequired:!0,merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[e.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:this.needs_shipping()&&this.get_total_price_cents()>0,transactionInfo:{currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_googlepay_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:e("#billing_phone").length>0},this.dynamic_price_enabled()&&(this.needs_shipping()&&this.get_total_price_cents()>0?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"]),t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var i=e.extend({},a);i.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(i).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this)).catch(function(t){this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=e(this.paymentsClient.createButton({onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.populate_address_fields(t),this.on_token_received(e)}.bind(this)).catch(function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&t.statusMessage.indexOf("paymentDataRequest.callbackIntent")>-1?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.initialize=function(){e(document.body).on("click",".apple-pay-button",this.start.bind(this)),this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=e(this.params.button),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(t,i){this.paymentRequest.canMakePayment().then(function(i){i&&i.applePay&&(this.can_pay=!0,this.create_button(),e(this.container).show(),t(i))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment(),this.paymentRequestButton=this.createPaymentRequestButton(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){return this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(t,i){this.paymentRequest.canMakePayment().then(function(i){i&&!i.applePay&&(this.can_pay=!0,this.create_button(),e(this.container).show(),t(i))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")}}(window,jQuery);
|
1 |
+
!function(t,e){t.wc_stripe={};try{var i=Stripe(wc_stripe_params_v3.api_key)}catch(e){return t.alert(e),void console.log(e)}wc_stripe.BaseGateway=function(t){this.params=t,this.gateway_id=this.params.gateway_id,this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_intent_selector=this.params.payment_intent_selector,this.payment_token_received=!1,this.stripe=i,this.elements=i.elements(e.extend({},{locale:"auto"},this.get_element_options())),this.initialize()},wc_stripe.BaseGateway.prototype.get_page=function(){return wc_stripe_params_v3.page},wc_stripe.BaseGateway.prototype.set_nonce=function(t){e(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return e('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===e('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return e("#wc_stripe_checkout_error").length>0&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t){-1==(t=this.get_error_message(t)).indexOf("</ul>")&&(t='<div class="woocommerce-error">'+t+"</div>"),this.submit_message(t)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){},wc_stripe.BaseGateway.prototype.get_error_message=function(t){return"object"==typeof t&&t.code&&(t=wc_stripe_messages[t.code]?wc_stripe_messages[t.code]:t.message),t},wc_stripe.BaseGateway.prototype.submit_message=function(t){e(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove();var i=e(this.message_container);i.closest("form").length&&(i=i.closest("form")),i.prepend(t),i.removeClass("processing").unblock(),i.find(".input-text, select, input:checkbox").blur(),e("html, body").animate({scrollTop:i.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_first_name=function(t){return e("#"+t+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(t){return e("#"+t+"_last_name").val()},wc_stripe.BaseGateway.prototype.should_save_method=function(){return e("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return e(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return e(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return"1"===this.params.needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return e("#wc_stripe_currency").val()},wc_stripe.BaseGateway.prototype.get_country=function(){return e("#wc_stripe_country").val()},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return e(t+"_first_name").val()+" "+e(t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return e("#billing_email").val()},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var i=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],a="",n=0;n<i.length;n++)a+=e(t+i[n]).val()+"_";return a},wc_stripe.BaseGateway.prototype.block=function(){e.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){e.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return e(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return e("#wc_stripe_order_total").data("amount")},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return e("#wc_stripe_order_total_cents").data("amount")},wc_stripe.BaseGateway.prototype.set_total_price=function(t){e("#wc_stripe_order_total").data("amount",t)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){e("#wc_stripe_order_total_cents").data("amount",t)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){e('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(t&&e('[name^="shipping_method"]').length)for(var i in t){var a=t[i];e('[name="shipping_method['+i+']"][value="'+a+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,e(this.token_selector).val(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){this.paymentRequest=i.paymentRequest(this.get_payment_request_options()),this.needs_shipping()&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:this.needs_shipping()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),this.needs_shipping()&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var i={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},a=this.get_display_items(),n=this.get_shipping_options();return a&&(i.displayItems=a),this.needs_shipping()&&n&&(i.shippingOptions=n),t&&(i=e.extend(!0,{},i,t)),i},wc_stripe.BaseGateway.prototype.get_display_items=function(){return e("#wc_stripe_display_items").data("items")},wc_stripe.BaseGateway.prototype.set_display_items=function(t){e("#wc_stripe_display_items").data("items",t)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return e("#wc_stripe_shipping_options").data("items")},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){e("#wc_stripe_shipping_options").data("items",t)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(e){try{this.payment_response=e,this.populate_checkout_fields(e),e.complete("success"),this.on_token_received(e.paymentMethod)}catch(e){t.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){e(this.token_selector).val(t.paymentMethod.id),this.populate_address_fields(t)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t){var i=this.address_mappings();if(t.payerName&&i.payerName.set(t.payerName),t.payerEmail&&i.payerEmail.set(t.payerEmail),t.payerPhone&&i.payerPhone.set(t.payerPhone),t.shippingAddress){var a=t.shippingAddress;for(var n in a)i[n]&&i[n].set.call(this,a[n],"#shipping")}if(t.paymentMethod.billing_details.address){a=t.paymentMethod.billing_details.address;for(var n in a)i[n]&&i[n].set.call(this,a[n],"#billing")}this.maybe_set_ship_to_different(),e('[name="billing_country"]').trigger("change")},wc_stripe.BaseGateway.prototype.address_mappings=function(){return{payerName:{set:function(t,i){var a=t.split(" ");a.length>0&&e("#billing_first_name").val(a[0]),a.length>1&&e("#billing_last_name").val(a[1])},get:function(t){return e("#billing_first_name").val()+" "+e("#billing_last_name").val()}},payerEmail:{set:function(t){e("#billing_email").val(t)},get:function(){return e("#billing_email").val()}},payerPhone:{set:function(t){e("#billing_phone").val(t)},get:function(){return e("#billing_phone").val()}},recipient:{set:function(t,i){var a=t.split(" ");a.length>0&&e(i+"_first_name").val(a[0]),a.length>1&&e(i+"_last_name").val(a[1])},get:function(t){return e(t+"_first_name").val()+" "+e(t+"_last_name").val()}},country:{set:function(t,i){e(i+"_country").val(t)},get:function(t){return e(t+"_country").val()}},addressLine:{set:function(t,i){t.length>0&&e(i+"_address_1").val(t[0]),t.length>1&&e(i+"_address_2").val(t[1])},get:function(t){return[e(t+"_address_1").val(),e(t+"_address_2").val()]}},line1:{set:function(t,i){e(i+"_address_1").val(t)},get:function(t){return e(t+"_address_1").val()}},line2:{set:function(t,i){e(i+"_address_2").val(t)},get:function(t){return e(t+"_address_2").val()}},region:{set:function(t,i){e(i+"_state").val(t)},get:function(t){e(t+"_state").val()}},state:{set:function(t,i){e(i+"_state").val(t)},get:function(t){e(t+"_state").val()}},city:{set:function(t,i){e(i+"_city").val(t)},get:function(t){e(t+"_city").val()}},postalCode:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){e(t+"_postcode").val()}},postal_code:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){e(t+"_postcode").val()}}}},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(i,a){this.block(),e.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:e.extend({},this.serialize_form(this.get_form()),{payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.reload?t.location.reload():"success"===e.result?t.location=e.redirect:(e.messages&&this.submit_error(e.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var i=t.find("input").filter(function(t,i){return!e(i).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),a={};for(var n in i){var s=i[n];a[s.name]=s.value}return a.payment_method=this.gateway_id,a},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};if("default"!==t){var i=t.match(/^(\d):(.+)$/);i.length>1&&(e[i[1]]=i[2])}return e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){e('[name="ship_to_different_address"]').length&&e('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("#billing")!==this.get_address_field_hash("#shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(t){return new Promise(function(i,a){e.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(t.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.code?(t.updateWith(e.data.newData),a(e.data)):(t.updateWith(e.data.newData),i(e.data))}.bind(this)).fail(function(t,e,i){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(t){return new Promise(function(i,a){e.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_methods:this.map_shipping_methods(t.shippingOption.id),payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.code?(t.updateWith(e.data.newData),a(e.data)):(this.set_selected_shipping_methods(e.data.shipping_methods),t.updateWith(e.data.newData),i(e.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.container=this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,e(document.body).on("update_checkout",this.update_checkout.bind(this)),e(document.body).on("updated_checkout",this.updated_checkout.bind(this)),e(document.body).on("checkout_error",this.checkout_error.bind(this)),e(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),e(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),e(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),e(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&e(".woocommerce-billing-fields").length&&e(".wc-stripe-banner-checkout").css("max-width",e(".woocommerce-billing-fields").outerWidth(!0)),this.order_review()},wc_stripe.CheckoutGateway.prototype.order_review=function(){var e=t.location.href.match(/order_review.+payment_method=([\w]+).+payment_nonce=(.+)/);if(e&&e.length>1){var i=e[1],a=e[2];this.gateway_id===i&&(this.payment_token_received=!0,this.set_nonce(a),this.set_use_new_option(!0))}},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(e('[name="terms"]').length&&!e('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return e('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){e("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,e(this.token_selector).val(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){e("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){e("form.checkout").unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){e("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){e("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,e('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if("undefined"==typeof wc_stripe_checkout_fields)return!0;var t=Object.keys(wc_stripe_checkout_fields.billing),i=Object.keys(wc_stripe_checkout_fields.shipping);function a(t,i){for(var a=0;a<t.length;a++){if(i[t[a]].required){var n=e("#"+t[a]).val();if(void 0===n||0==n.length)return void(valid=!1)}}}return valid=!0,a(t,wc_stripe_checkout_fields.billing),this.needs_shipping()&&e("#ship-to-different-address-checkbox").is(":checked")&&a(i,wc_stripe_checkout_fields.shipping),valid=this.is_valid_checkout(),valid},wc_stripe.ProductGateway=function(){this.container="li.payment_method_"+this.gateway_id,this.message_container="div.product",e(document.body).on("wc_stripe_updated_rest_nonce",this.set_rest_nonce.bind(this)),e("form.cart").on("found_variation",this.found_variation.bind(this)),e("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=e("div.quantity").outerWidth(!0)+e(".single_add_to_cart_button").outerWidth(),e(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(e('[name="quantity"]').val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_product_data();i.price=e.display_price,i.needs_shipping=!e.is_virtual,i.variation=e,this.set_product_data(i),this.enable_payment_button()},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return e('[name="variation_id"]').length>0},wc_stripe.ProductGateway.prototype.needs_shipping=function(){return this.get_product_data().needs_shipping},wc_stripe.ProductGateway.prototype.get_product_data=function(){return e("#wc_stripe_product_data").data("product")},wc_stripe.ProductGateway.prototype.set_product_data=function(t){e("#wc_stripe_product_data").data("product",t)},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(t,i){this.block(),e.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:{product_id:e("#product_id").val(),variation_id:this.is_variable_product()?e('[name="variation_id"]').val():0,qty:e('[name="quantity"]').val(),payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(a,n,s){this.unblock(),e(document.body).triggerHandler("wc_stripe_updated_rest_nonce",s.getResponseHeader("X-WP-Nonce")),a.code?(this.submit_error(a.message),i(a)):(this.set_total_price(a.data.total),this.set_total_price_cents(a.data.totalCents),this.set_display_items(a.data.displayItems),t(a.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(t){return new Promise(function(i,a){e.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:{product_id:e("#product_id").val(),variation_id:this.is_variable_product()&&t?t:0,qty:e('[name="quantity"]').val(),payment_method:this.gateway_id},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(t,a,n){e(document.body).triggerHandler("wc_stripe_updated_rest_nonce",n.getResponseHeader("X-WP-Nonce")),t.code?this.cart_calculation_error=!0:(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),i(t.data))}.bind(this)).fail(function(t,e,i){}.bind(this))}.bind(this))},wc_stripe.CartGateway=function(){this.container="li.payment_method_"+this.gateway_id,this.message_container="div.woocommerce",e(document.body).on("updated_wc_div",this.updated_html.bind(this)),e(document.body).on("updated_cart_totals",this.updated_html.bind(this))},wc_stripe.CartGateway.prototype.needs_shipping=function(){return 1===e("#wc_stripe_needs_shipping").data("value")},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(this.get_error_message(t))},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){e(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){};const a={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};wc_stripe.GooglePay.prototype.address_mappings=function(t){return{name:{set:function(t,i){var a=t.split(" ");e(i+"_first_name").val(a[0]),e(i+"_last_name").val(a[1])},get:function(t){return e(t+"_first_name").val()+e(t+"_last_name").val()}},postalCode:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){return e(t+"_postcode").val()}},countryCode:{set:function(t,i){e(i+"_country").val(t)},get:function(t){return e(t+"_country").val()}},phoneNumber:{set:function(t,i){e("#billing_phone").val(t)},get:function(){return"#billing_phone".val()}},address1:{set:function(t,i){e(i+"_address_1").val(t)},get:function(t){return e(t+"_address_1").val()}},address2:{set:function(t,i){e(i+"_address_2").val(t)},get:function(t){return e(t+"_address_2").val()}},locality:{set:function(t,i){e(i+"_city").val(t)},get:function(t){return e(t+"_city").val()}},administrativeArea:{set:function(t,i){e(i+"_state").val(t)},get:function(t){return e(t+"_state").val()}}}},wc_stripe.GooglePay.prototype.serialize_form=function(t){return e.extend({},wc_stripe.BaseGateway.prototype.serialize_form.apply(this,arguments),{order_review:!this.dynamic_price_enabled()})},wc_stripe.GooglePay.prototype.populate_address_fields=function(t){var i=t.paymentMethodData.info.billingAddress,a=this.address_mappings();for(var n in i)a[n]&&a[n].set.call(this,i[n],"#billing");if(t.shippingAddress)for(var n in t.shippingAddress)a[n]&&a[n].set.call(this,t.shippingAddress[n],"#shipping");t.email&&e("#billing_email").val(t.email),this.maybe_set_ship_to_different(),e('[name="billing_country"]').trigger("change")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(t){return new Promise(function(i,a){e.when(e.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{shipping_address:this.map_address(t.shippingAddress),shipping_methods:this.map_shipping_methods(t.shippingOptionData.id),shipping_method_id:t.shippingOptionData.id,page_id:this.get_page()},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)})).done(function(t){t.code?a(t.data.data):i(t.data)}.bind(this)).fail(function(){a()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(t){return new Promise(function(e,i){this.update_payment_data(t).then(function(i){e(i.paymentRequestUpdate),this.set_selected_shipping_methods(i.shipping_methods),this.payment_data_updated(i,t)}.bind(this)).catch(function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_googlepay_display_items=function(){return e("#googlepay_display_items").data("items")},wc_stripe.GooglePay.prototype.set_googlepay_display_items=function(t){e("#googlepay_display_items").data("items",t)},wc_stripe.GooglePay.prototype.get_shipping_options=function(){return e("#googlepay_shipping_options").data("items")},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.dynamic_price_enabled=function(){return"1"===this.params.dynamic_price},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t={environment:this.params.environment,merchantInfo:this.get_merchant_info()};return this.dynamic_price_enabled()&&(this.needs_shipping()&&this.get_total_price_cents()>0?t.paymentDataCallbacks={onPaymentDataChanged:this.on_payment_data_changed.bind(this),onPaymentAuthorized:function(t){return new Promise(function(t,e){t({transactionState:"SUCCESS"})}.bind(this))}.bind(this)}:t.paymentDataCallbacks={onPaymentAuthorized:function(t){return new Promise(function(t,e){t({transactionState:"SUCCESS"})}.bind(this))}}),t},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=e.extend({},a,{emailRequired:!0,merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[e.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:this.needs_shipping()&&this.get_total_price_cents()>0,transactionInfo:{currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_googlepay_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:e("#billing_phone").length>0},this.dynamic_price_enabled()&&(this.needs_shipping()&&this.get_total_price_cents()>0?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"]),t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var i=e.extend({},a);i.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(i).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this)).catch(function(t){this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=e(this.paymentsClient.createButton({onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.populate_address_fields(t),this.on_token_received(e)}.bind(this)).catch(function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&t.statusMessage.indexOf("paymentDataRequest.callbackIntent")>-1?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.initialize=function(){e(document.body).on("click",".apple-pay-button",this.start.bind(this)),this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=e(this.params.button),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(t,i){this.paymentRequest.canMakePayment().then(function(i){i&&i.applePay&&(this.can_pay=!0,this.create_button(),e(this.container).show(),t(i))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment(),this.paymentRequestButton=this.createPaymentRequestButton(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){return this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(t,i){this.paymentRequest.canMakePayment().then(function(i){i&&!i.applePay&&(this.can_pay=!0,this.create_button(),e(this.container).show(),t(i))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")}}(window,jQuery);
|
i18n/languages/woo-stripe-payment.pot
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: woo-stripe-payment\n"
|
5 |
-
"POT-Creation-Date: 2020-
|
6 |
"PO-Revision-Date: 2019-08-16 14:27-0700\n"
|
7 |
"Last-Translator: \n"
|
8 |
"Language-Team: \n"
|
@@ -18,7 +18,7 @@ msgstr ""
|
|
18 |
"X-Poedit-SearchPath-1: templates\n"
|
19 |
"X-Poedit-SearchPath-2: stripe-payments.php\n"
|
20 |
|
21 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
22 |
#: includes/gateways/settings/ach-settings-v2.php:7
|
23 |
#: includes/gateways/settings/ach-settings.php:7
|
24 |
#: includes/gateways/settings/applepay-settings.php:7
|
@@ -28,12 +28,12 @@ msgstr ""
|
|
28 |
msgid "Enabled"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
32 |
#, php-format
|
33 |
msgid "If enabled, your site can accept %s payments through Stripe."
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
37 |
#: includes/gateways/settings/ach-settings-v2.php:58
|
38 |
#: includes/gateways/settings/ach-settings.php:59
|
39 |
#: includes/gateways/settings/applepay-settings.php:13
|
@@ -43,7 +43,7 @@ msgstr ""
|
|
43 |
msgid "General Settings"
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
47 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
|
48 |
#: includes/gateways/settings/ach-settings-v2.php:61
|
49 |
#: includes/gateways/settings/ach-settings.php:62
|
@@ -54,12 +54,12 @@ msgstr ""
|
|
54 |
msgid "Title"
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
58 |
#, php-format
|
59 |
msgid "Title of the %s gateway"
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
63 |
#: includes/gateways/settings/ach-settings-v2.php:67
|
64 |
#: includes/gateways/settings/ach-settings.php:68
|
65 |
#: includes/gateways/settings/applepay-settings.php:22
|
@@ -69,7 +69,7 @@ msgstr ""
|
|
69 |
msgid "Description"
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
73 |
#: includes/gateways/settings/ach-settings-v2.php:69
|
74 |
#: includes/gateways/settings/ach-settings.php:70
|
75 |
#: includes/gateways/settings/applepay-settings.php:24
|
@@ -79,212 +79,216 @@ msgstr ""
|
|
79 |
msgid "Leave blank if you don't want a description to show for the gateway."
|
80 |
msgstr ""
|
81 |
|
82 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
83 |
#, php-format
|
84 |
msgid "Order %s"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
88 |
#, php-format
|
89 |
msgid "Gateway will appear when store currency is <strong>%s</strong>"
|
90 |
msgstr ""
|
91 |
|
92 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
93 |
#, php-format
|
94 |
msgid " & billing country is <strong>%s</strong>"
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
98 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
99 |
#, php-format
|
100 |
msgid "Error processing payment. Reason: %s"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
104 |
#, php-format
|
105 |
msgid ""
|
106 |
"Charge %s is pending. Payment Method: %s. Payment will be completed once "
|
107 |
"charge.succeeded webhook received from Stripe."
|
108 |
msgstr ""
|
109 |
|
110 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
111 |
#, php-format
|
112 |
msgid "Order %s successful in Stripe. Charge: %s. Payment Method: %s"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
116 |
msgid "charge"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
120 |
msgid "authorization"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
124 |
msgid ""
|
125 |
"Please read and accept the terms and conditions to proceed with your order."
|
126 |
msgstr ""
|
127 |
|
128 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
129 |
-
#: includes/controllers/class-wc-stripe-controller-cart.php:
|
130 |
-
#: includes/controllers/class-wc-stripe-controller-cart.php:
|
131 |
-
#: includes/controllers/class-wc-stripe-controller-googlepay.php:
|
132 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
133 |
msgid "Total"
|
134 |
msgstr ""
|
135 |
|
136 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
137 |
msgid "User must be logged in."
|
138 |
msgstr ""
|
139 |
|
140 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
141 |
#, php-format
|
142 |
msgid "Error saving your payment method. Reason: %s"
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
146 |
#, php-format
|
147 |
msgid "Error saving payment method. Reason: %s"
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
151 |
#, php-format
|
152 |
msgid "Order refunded in Stripe. Amount: %s"
|
153 |
msgstr ""
|
154 |
|
155 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
156 |
#, php-format
|
157 |
msgid "Order amount captured in Stripe. Amount: %s"
|
158 |
msgstr ""
|
159 |
|
160 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
161 |
#, php-format
|
162 |
msgid "Error capturing charge in Stripe. Reason: %s"
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
166 |
#, php-format
|
167 |
msgid "Error voiding charge. Reason: %s"
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
171 |
msgid "Charge voided in Stripe."
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
175 |
msgid "n/a"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
179 |
#: includes/admin/meta-boxes/views/html-order-pay.php:42
|
180 |
msgid "New Card"
|
181 |
msgstr ""
|
182 |
|
183 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
184 |
#: includes/admin/meta-boxes/views/html-order-pay.php:30
|
185 |
msgid "Saved Cards"
|
186 |
msgstr ""
|
187 |
|
188 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
189 |
#, php-format
|
190 |
msgid "Attemp to save payment method failed. Reason: %s"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
194 |
msgid ""
|
195 |
"We were not able to save your payment method. To prevent billing issues with "
|
196 |
"your subscription, please add a payment method to the subscription."
|
197 |
msgstr ""
|
198 |
|
199 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
200 |
#, php-format
|
201 |
msgid "We were not able to save your payment method. Reason: %s"
|
202 |
msgstr ""
|
203 |
|
204 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
205 |
msgid "Payment Method Token"
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
209 |
#, php-format
|
210 |
msgid "Recurring payment for order failed. Reason: %s"
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
214 |
#, php-format
|
215 |
msgid "Recurring payment captured in Stripe. Payment method: %s"
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
219 |
#, php-format
|
220 |
msgid "Recurring payment authorized in Stripe. Payment method: %s"
|
221 |
msgstr ""
|
222 |
|
223 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
224 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
225 |
#, php-format
|
226 |
msgid "Customer must manually complete payment for payment method %s"
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
230 |
#, php-format
|
231 |
msgid "Error saving payment method for subscription. Reason: %s"
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
235 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
236 |
#, php-format
|
237 |
msgid "Order %s from %s"
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
241 |
#, php-format
|
242 |
msgid "Pre-order payment for order failed. Reason: %s"
|
243 |
msgstr ""
|
244 |
|
245 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
246 |
#, php-format
|
247 |
msgid "Pre-order payment captured in Stripe. Payment method: %s"
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
251 |
#, php-format
|
252 |
msgid "Pre-order payment authorized in Stripe. Payment method: %s"
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: includes/abstract/abstract-wc-payment-
|
256 |
-
|
|
|
|
|
|
|
|
|
257 |
#, php-format
|
258 |
msgid "Error deleting Stripe card. Token Id: %s"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
262 |
msgid "Transaction Id cannot be empty."
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: includes/abstract/abstract-wc-stripe-rest-controller.php:
|
266 |
msgid "You do not have permissions to access this resource."
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: includes/admin/class-wc-stripe-admin-menus.php:
|
270 |
msgid "Stripe Gateway"
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: includes/admin/class-wc-stripe-admin-menus.php:
|
274 |
msgid "Settings"
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: includes/admin/class-wc-stripe-admin-menus.php:
|
278 |
msgid "Logs"
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: includes/admin/class-wc-stripe-admin-menus.php:
|
282 |
#: includes/admin/views/html-settings-nav.php:17
|
283 |
-
#: includes/class-wc-stripe-install.php:
|
284 |
msgid "Documentation"
|
285 |
msgstr ""
|
286 |
|
287 |
-
#: includes/admin/class-wc-stripe-admin-notices.php:
|
288 |
#, php-format
|
289 |
msgid ""
|
290 |
"At Stripe's request we have updated how the Stripe for WooCommerce\n"
|
@@ -294,7 +298,7 @@ msgid ""
|
|
294 |
"Integration%s"
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: includes/admin/class-wc-stripe-admin-settings.php:
|
298 |
msgid "Local Gateways"
|
299 |
msgstr ""
|
300 |
|
@@ -326,19 +330,19 @@ msgid "Charge Data"
|
|
326 |
msgstr ""
|
327 |
|
328 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:24
|
329 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
330 |
msgid "Mode"
|
331 |
msgstr ""
|
332 |
|
333 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
|
334 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
335 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
336 |
msgid "Live"
|
337 |
msgstr ""
|
338 |
|
339 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
|
340 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
341 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
342 |
msgid "Test"
|
343 |
msgstr ""
|
344 |
|
@@ -440,56 +444,56 @@ msgstr ""
|
|
440 |
msgid "Authorize"
|
441 |
msgstr ""
|
442 |
|
443 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
444 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
445 |
msgid "API Settings"
|
446 |
msgstr ""
|
447 |
|
448 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
449 |
msgid ""
|
450 |
"The mode determines if you are processing test transactions or live "
|
451 |
"transactions on your site. Test mode allows you to simulate payments so you "
|
452 |
"can test your integration."
|
453 |
msgstr ""
|
454 |
|
455 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
456 |
msgid "Account ID"
|
457 |
msgstr ""
|
458 |
|
459 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
460 |
msgid "This is your Stripe Connect ID and serves as a unique identifier."
|
461 |
msgstr ""
|
462 |
|
463 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
464 |
msgid "Connect Stripe Account"
|
465 |
msgstr ""
|
466 |
|
467 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
468 |
msgid "Click to Connect"
|
469 |
msgstr ""
|
470 |
|
471 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
472 |
msgid ""
|
473 |
"We make it easy to connect Stripe to your site. Click the Connect button to "
|
474 |
"go through our connect flow."
|
475 |
msgstr ""
|
476 |
|
477 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
478 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
479 |
msgid "Connection Test"
|
480 |
msgstr ""
|
481 |
|
482 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
483 |
msgid ""
|
484 |
"Click this button to perform a connection test. If successful, your site is "
|
485 |
"connected to Stripe."
|
486 |
msgstr ""
|
487 |
|
488 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
489 |
msgid "Webhook url"
|
490 |
msgstr ""
|
491 |
|
492 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
493 |
#, php-format
|
494 |
msgid ""
|
495 |
"<strong>Important:</strong> the webhook url is called by Stripe when events "
|
@@ -498,12 +502,12 @@ msgid ""
|
|
498 |
"%sWebhook guide%s"
|
499 |
msgstr ""
|
500 |
|
501 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
502 |
msgid "Live Webhook Secret"
|
503 |
msgstr ""
|
504 |
|
505 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
506 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
507 |
#, php-format
|
508 |
msgid ""
|
509 |
"The webhook secret is used to authenticate webhooks sent from Stripe. It "
|
@@ -511,21 +515,21 @@ msgid ""
|
|
511 |
"guide%s"
|
512 |
msgstr ""
|
513 |
|
514 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
515 |
msgid "Test Webhook Secret"
|
516 |
msgstr ""
|
517 |
|
518 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
519 |
msgid "Debug Log"
|
520 |
msgstr ""
|
521 |
|
522 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
523 |
msgid ""
|
524 |
"When enabled, the plugin logs important errors and info that can help you "
|
525 |
"troubleshoot potential issues."
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
529 |
#, php-format
|
530 |
msgid ""
|
531 |
"%s Your Stripe account has been connected. You can now accept Live and Test "
|
@@ -533,20 +537,20 @@ msgid ""
|
|
533 |
"security."
|
534 |
msgstr ""
|
535 |
|
536 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
537 |
msgid "Click To Re-Connect"
|
538 |
msgstr ""
|
539 |
|
540 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
541 |
msgid "Please try again."
|
542 |
msgstr ""
|
543 |
|
544 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
545 |
#, php-format
|
546 |
msgid "We were not able to connect your Stripe account. Reason: %s"
|
547 |
msgstr ""
|
548 |
|
549 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
550 |
msgid ""
|
551 |
"Your Stripe account has been connected to your WooCommerce store. You may "
|
552 |
"now accept payments in Live and Test mode."
|
@@ -632,462 +636,482 @@ msgid ""
|
|
632 |
"action."
|
633 |
msgstr ""
|
634 |
|
635 |
-
#: includes/class-wc-stripe-customer-manager.php:
|
636 |
-
#: includes/class-wc-stripe-customer-manager.php:
|
637 |
#, php-format
|
638 |
msgid "Error saving customer. Reason: %s"
|
639 |
msgstr ""
|
640 |
|
641 |
-
#: includes/class-wc-stripe-frontend-notices.php:
|
642 |
msgid ""
|
643 |
"Your payment is being processed and your order status will be updated once "
|
644 |
"the funds are received."
|
645 |
msgstr ""
|
646 |
|
647 |
-
#: includes/class-wc-stripe-frontend-scripts.php:
|
648 |
msgid "No matches found"
|
649 |
msgstr ""
|
650 |
|
651 |
-
#: includes/class-wc-stripe-gateway-ach.php:
|
652 |
msgid ""
|
653 |
"Please update your ACH environment to Production to match your Stripe API "
|
654 |
"Mode."
|
655 |
msgstr ""
|
656 |
|
657 |
-
#: includes/class-wc-stripe-
|
658 |
-
#, php-format
|
659 |
-
msgid "Error capturing charge. Reason: %s"
|
660 |
-
msgstr ""
|
661 |
-
|
662 |
-
#: includes/class-wc-stripe-redirect-handler.php:52
|
663 |
#, php-format
|
664 |
msgid "Error retrieving payment source. Reason: %s"
|
665 |
msgstr ""
|
666 |
|
667 |
-
#: includes/class-wc-stripe-redirect-handler.php:
|
668 |
msgid "Payment authorization failed. Please select another payment method."
|
669 |
msgstr ""
|
670 |
|
671 |
-
#: includes/class-wc-stripe-redirect-handler.php:
|
672 |
msgid "Payment authorization failed."
|
673 |
msgstr ""
|
674 |
|
675 |
-
#: includes/class-wc-stripe-rest-api.php:
|
676 |
#, php-format
|
677 |
msgid "%1$s is an invalid controller name."
|
678 |
msgstr ""
|
679 |
|
680 |
-
#: includes/class-wc-stripe-update.php:
|
681 |
#, php-format
|
682 |
msgid "Thank you for updating Stripe for WooCommerce to version %1$s."
|
683 |
msgstr ""
|
684 |
|
685 |
-
#: includes/controllers/class-wc-stripe-controller-cart.php:
|
686 |
msgid "Quantity must be greater than zero."
|
687 |
msgstr ""
|
688 |
|
689 |
-
#: includes/controllers/class-wc-stripe-controller-checkout.php:
|
690 |
#, php-format
|
691 |
msgid ""
|
692 |
"Some required fields were missing. Please click %shere%s to complete your "
|
693 |
"payment."
|
694 |
msgstr ""
|
695 |
|
696 |
-
#: includes/controllers/class-wc-stripe-controller-checkout.php:
|
697 |
msgid "Please review your order details then click Place Order."
|
698 |
msgstr ""
|
699 |
|
700 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
701 |
msgid ""
|
702 |
"You cannot register your domain until you have configured your Live API keys."
|
703 |
msgstr ""
|
704 |
|
705 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
706 |
msgid ""
|
707 |
"Domain registered successfully. You can confirm in your Stripe Dashboard at "
|
708 |
"https://dashboard.stripe.com/account/apple_pay."
|
709 |
msgstr ""
|
710 |
|
711 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
712 |
msgid "You must configure your secret key before creating webhooks."
|
713 |
msgstr ""
|
714 |
|
715 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
716 |
msgid ""
|
717 |
"There is already a webhook configured for this site. If you want to delete "
|
718 |
"the webhook, login to your Stripe Dashboard."
|
719 |
msgstr ""
|
720 |
|
721 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
722 |
#, php-format
|
723 |
msgid ""
|
724 |
"Webhook created in Stripe for %s environment. You can test your webhook by "
|
725 |
"logging in to the Stripe dashboard"
|
726 |
msgstr ""
|
727 |
|
728 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
729 |
#, php-format
|
730 |
msgid "Mode: %s. Invalid secret key. Please check your entry."
|
731 |
msgstr ""
|
732 |
|
733 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:177
|
734 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:180
|
|
|
735 |
#, php-format
|
736 |
msgid "Mode: %s. Invalid publishable key. Please check your entry."
|
737 |
msgstr ""
|
738 |
|
739 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
740 |
#, php-format
|
741 |
msgid "Connection test to Stripe was successful. Mode: %s."
|
742 |
msgstr ""
|
743 |
|
744 |
-
#: includes/controllers/class-wc-stripe-controller-googlepay.php:
|
745 |
msgid "Your shipping address is not serviceable."
|
746 |
msgstr ""
|
747 |
|
748 |
-
#: includes/controllers/class-wc-stripe-controller-order-actions.php:
|
749 |
msgid "Invalid amount entered."
|
750 |
msgstr ""
|
751 |
|
752 |
-
#: includes/controllers/class-wc-stripe-controller-order-actions.php:
|
753 |
-
#: includes/controllers/class-wc-stripe-controller-order-actions.php:
|
754 |
msgid "Order total must be greater than zero."
|
755 |
msgstr ""
|
756 |
|
757 |
-
#: includes/controllers/class-wc-stripe-controller-order-actions.php:
|
758 |
#, php-format
|
759 |
msgid ""
|
760 |
"This order has already been processed. Transaction ID: %s. Payment method: %s"
|
761 |
msgstr ""
|
762 |
|
763 |
-
#: includes/controllers/class-wc-stripe-controller-order-actions.php:
|
764 |
msgid "Order customer Id and payment method customer Id do not match."
|
765 |
msgstr ""
|
766 |
|
767 |
-
#: includes/controllers/class-wc-stripe-controller-payment-intent.php:
|
768 |
#, php-format
|
769 |
msgid "Error creating payment intent. Reason: %s"
|
770 |
msgstr ""
|
771 |
|
772 |
-
#: includes/controllers/class-wc-stripe-controller-payment-intent.php:
|
773 |
msgid "Invalid order id provided"
|
774 |
msgstr ""
|
775 |
|
776 |
-
#: includes/controllers/class-wc-stripe-controller-payment-intent.php:
|
777 |
msgid "You are not authorized to update this order."
|
778 |
msgstr ""
|
779 |
|
780 |
-
#: includes/controllers/class-wc-stripe-controller-webhook.php:
|
781 |
-
#: includes/controllers/class-wc-stripe-controller-webhook.php:
|
782 |
msgid "Invalid signature received. Verify that your webhook secret is correct."
|
783 |
msgstr ""
|
784 |
|
785 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:
|
786 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
787 |
msgid "ACH"
|
788 |
msgstr ""
|
789 |
|
790 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:
|
791 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
792 |
msgid "Stripe ACH"
|
793 |
msgstr ""
|
794 |
|
795 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:
|
796 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
797 |
msgid "ACH gateway that integrates with your Stripe account."
|
798 |
msgstr ""
|
799 |
|
800 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:
|
801 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
802 |
msgid "Bank Payment"
|
803 |
msgstr ""
|
804 |
|
805 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:
|
806 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
807 |
msgid "Saved Banks"
|
808 |
msgstr ""
|
809 |
|
810 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:
|
811 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
812 |
msgid "New Bank"
|
813 |
msgstr ""
|
814 |
|
815 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:
|
816 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
817 |
msgid ""
|
818 |
"You must set the API mode to live in order to enable the Plaid development "
|
819 |
"environment."
|
820 |
msgstr ""
|
821 |
|
822 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:
|
823 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:
|
824 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
825 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
826 |
#: includes/gateways/settings/ach-settings-v2.php:88
|
827 |
#: includes/gateways/settings/ach-settings.php:89
|
828 |
msgid "ACH Fee"
|
829 |
msgstr ""
|
830 |
|
831 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:
|
832 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:
|
833 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:
|
834 |
msgid "Alipay"
|
835 |
msgstr ""
|
836 |
|
837 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:
|
838 |
msgid "Alipay gateway that integrates with your Stripe account."
|
839 |
msgstr ""
|
840 |
|
841 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:
|
842 |
#: includes/gateways/settings/applepay-settings.php:17
|
843 |
msgid "Apple Pay"
|
844 |
msgstr ""
|
845 |
|
846 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:
|
847 |
msgid "Stripe Apple Pay"
|
848 |
msgstr ""
|
849 |
|
850 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:
|
851 |
msgid "Apple Pay gateway that integrates with your Stripe account."
|
852 |
msgstr ""
|
853 |
|
854 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:
|
855 |
msgid "Please update you product quantity before using Apple Pay."
|
856 |
msgstr ""
|
857 |
|
858 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:
|
859 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:
|
860 |
msgid "Please select a product option before updating quantity."
|
861 |
msgstr ""
|
862 |
|
863 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-bancontact.php:
|
864 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-bancontact.php:
|
865 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-bancontact.php:
|
866 |
msgid "Bancontact"
|
867 |
msgstr ""
|
868 |
|
869 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-bancontact.php:
|
870 |
msgid "Bancontact gateway that integrates with your Stripe account."
|
871 |
msgstr ""
|
872 |
|
873 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:
|
874 |
#: includes/gateways/settings/cc-settings.php:17
|
875 |
msgid "Credit Cards"
|
876 |
msgstr ""
|
877 |
|
878 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:
|
879 |
msgid "Stripe Credit Cards"
|
880 |
msgstr ""
|
881 |
|
882 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:
|
883 |
msgid "Credit card gateway that integrates with your Stripe account."
|
884 |
msgstr ""
|
885 |
|
886 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-eps.php:
|
887 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-eps.php:
|
888 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-eps.php:
|
889 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:
|
890 |
msgid "EPS"
|
891 |
msgstr ""
|
892 |
|
893 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-eps.php:
|
894 |
msgid "EPS gateway that integrates with your Stripe account."
|
895 |
msgstr ""
|
896 |
|
897 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-fpx.php:
|
898 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-fpx.php:
|
899 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-fpx.php:
|
900 |
msgid "FPX"
|
901 |
msgstr ""
|
902 |
|
903 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-fpx.php:
|
904 |
msgid "FPX gateway that integrates with your Stripe account."
|
905 |
msgstr ""
|
906 |
|
907 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-giropay.php:21
|
908 |
#: includes/gateways/class-wc-payment-gateway-stripe-giropay.php:24
|
909 |
#: includes/gateways/class-wc-payment-gateway-stripe-giropay.php:27
|
|
|
910 |
msgid "Giropay"
|
911 |
msgstr ""
|
912 |
|
913 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-giropay.php:
|
914 |
msgid "Giropay gateway that integrates with your Stripe account."
|
915 |
msgstr ""
|
916 |
|
917 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
918 |
#: includes/gateways/settings/googlepay-settings.php:31
|
919 |
msgid "Google Pay"
|
920 |
msgstr ""
|
921 |
|
922 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
923 |
msgid "Stripe Google Pay"
|
924 |
msgstr ""
|
925 |
|
926 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
927 |
msgid "Google Pay gateway that integrates with your Stripe account."
|
928 |
msgstr ""
|
929 |
|
930 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
931 |
msgid "Please update you product quantity before using Google Pay."
|
932 |
msgstr ""
|
933 |
|
934 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
935 |
msgid "Subscription"
|
936 |
msgstr ""
|
937 |
|
938 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
939 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
940 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
941 |
-
#: includes/wc-stripe-functions.php:
|
942 |
msgid "Shipping"
|
943 |
msgstr ""
|
944 |
|
945 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
946 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
947 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
948 |
-
#: includes/wc-stripe-functions.php:
|
949 |
msgid "Discount"
|
950 |
msgstr ""
|
951 |
|
952 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
953 |
-
#: includes/wc-stripe-functions.php:
|
954 |
msgid "Fees"
|
955 |
msgstr ""
|
956 |
|
957 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
958 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
959 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
960 |
-
#: includes/wc-stripe-functions.php:
|
961 |
msgid "Tax"
|
962 |
msgstr ""
|
963 |
|
964 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
965 |
-
#: includes/wc-stripe-functions.php:
|
966 |
msgid "Waiting..."
|
967 |
msgstr ""
|
968 |
|
969 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
970 |
-
#: includes/wc-stripe-functions.php:
|
971 |
msgid "loading shipping methods..."
|
972 |
msgstr ""
|
973 |
|
974 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ideal.php:
|
975 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ideal.php:
|
976 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ideal.php:
|
977 |
msgid "iDEAL"
|
978 |
msgstr ""
|
979 |
|
980 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ideal.php:
|
981 |
msgid "Ideal gateway that integrates with your Stripe account."
|
982 |
msgstr ""
|
983 |
|
984 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
985 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
986 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
987 |
msgid "Klarna"
|
988 |
msgstr ""
|
989 |
|
990 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
991 |
msgid "Klarna gateway that integrates with your Stripe account."
|
992 |
msgstr ""
|
993 |
|
994 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
995 |
msgid "Fee"
|
996 |
msgstr ""
|
997 |
|
998 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
999 |
msgid "Pay Now"
|
1000 |
msgstr ""
|
1001 |
|
1002 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1003 |
msgid "Pay Later"
|
1004 |
msgstr ""
|
1005 |
|
1006 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1007 |
msgid "Pay Over Time"
|
1008 |
msgstr ""
|
1009 |
|
1010 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:
|
1011 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:
|
1012 |
msgid "Multibanco"
|
1013 |
msgstr ""
|
1014 |
|
1015 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:
|
1016 |
msgid "Multibanco gateway that integrates with your Stripe account."
|
1017 |
msgstr ""
|
1018 |
|
1019 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-p24.php:
|
1020 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-p24.php:
|
1021 |
msgid "Przelewy24"
|
1022 |
msgstr ""
|
1023 |
|
1024 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-p24.php:
|
1025 |
msgid "P24 gateway that integrates with your Stripe account."
|
1026 |
msgstr ""
|
1027 |
|
1028 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-p24.php:
|
1029 |
msgid "P24"
|
1030 |
msgstr ""
|
1031 |
|
1032 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:
|
1033 |
msgid "PaymentRequest Gateway"
|
1034 |
msgstr ""
|
1035 |
|
1036 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:
|
1037 |
msgid "Stripe Payment Request"
|
1038 |
msgstr ""
|
1039 |
|
1040 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:
|
1041 |
msgid ""
|
1042 |
"Gateway that renders based on the user's browser. Chrome payment methods, "
|
1043 |
"Microsoft pay, etc."
|
1044 |
msgstr ""
|
1045 |
|
1046 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:
|
1047 |
msgid "Please update you product quantity before paying."
|
1048 |
msgstr ""
|
1049 |
|
1050 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:
|
1051 |
msgid "Adding to cart..."
|
1052 |
msgstr ""
|
1053 |
|
1054 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:
|
1055 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:
|
1056 |
msgid "SEPA"
|
1057 |
msgstr ""
|
1058 |
|
1059 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:
|
1060 |
msgid "Sepa"
|
1061 |
msgstr ""
|
1062 |
|
1063 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:
|
1064 |
msgid "Sepa gateway that integrates with your Stripe account."
|
1065 |
msgstr ""
|
1066 |
|
1067 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-
|
1068 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1069 |
msgid "Sofort"
|
1070 |
msgstr ""
|
1071 |
|
1072 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:
|
1073 |
msgid "Sofort gateway that integrates with your Stripe account."
|
1074 |
msgstr ""
|
1075 |
|
1076 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:
|
1077 |
msgid "SOFORT"
|
1078 |
msgstr ""
|
1079 |
|
1080 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:
|
1081 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:
|
1082 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:
|
1083 |
msgid "WeChat"
|
1084 |
msgstr ""
|
1085 |
|
1086 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:
|
1087 |
msgid "WeChat gateway that integrates with your Stripe account."
|
1088 |
msgstr ""
|
1089 |
|
1090 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:
|
1091 |
msgid ""
|
1092 |
"Scan the QR code using your WeChat app. Once scanned click the Place Order "
|
1093 |
"button."
|
@@ -1431,83 +1455,107 @@ msgid ""
|
|
1431 |
msgstr ""
|
1432 |
|
1433 |
#: includes/gateways/settings/cc-settings.php:63
|
1434 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1435 |
msgstr ""
|
1436 |
|
1437 |
#: includes/gateways/settings/cc-settings.php:69
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1438 |
msgid "Visa"
|
1439 |
msgstr ""
|
1440 |
|
1441 |
-
#: includes/gateways/settings/cc-settings.php:
|
1442 |
-
#: includes/wc-stripe-functions.php:
|
1443 |
msgid "Amex"
|
1444 |
msgstr ""
|
1445 |
|
1446 |
-
#: includes/gateways/settings/cc-settings.php:
|
1447 |
msgid "Discover"
|
1448 |
msgstr ""
|
1449 |
|
1450 |
-
#: includes/gateways/settings/cc-settings.php:
|
1451 |
msgid "MasterCard"
|
1452 |
msgstr ""
|
1453 |
|
1454 |
-
#: includes/gateways/settings/cc-settings.php:
|
1455 |
msgid "JCB"
|
1456 |
msgstr ""
|
1457 |
|
1458 |
-
#: includes/gateways/settings/cc-settings.php:
|
1459 |
msgid "Maestro"
|
1460 |
msgstr ""
|
1461 |
|
1462 |
-
#: includes/gateways/settings/cc-settings.php:
|
1463 |
msgid "Diners Club"
|
1464 |
msgstr ""
|
1465 |
|
1466 |
-
#: includes/gateways/settings/cc-settings.php:
|
1467 |
msgid "Union Pay"
|
1468 |
msgstr ""
|
1469 |
|
1470 |
-
#: includes/gateways/settings/cc-settings.php:
|
1471 |
msgid ""
|
1472 |
"The selected icons will show customers which credit card brands you accept."
|
1473 |
msgstr ""
|
1474 |
|
1475 |
-
#: includes/gateways/settings/cc-settings.php:
|
1476 |
msgid "Credit Card Form"
|
1477 |
msgstr ""
|
1478 |
|
1479 |
-
#: includes/gateways/settings/cc-settings.php:
|
1480 |
msgid "Card Form"
|
1481 |
msgstr ""
|
1482 |
|
1483 |
-
#: includes/gateways/settings/cc-settings.php:
|
1484 |
msgid "Stripe form"
|
1485 |
msgstr ""
|
1486 |
|
1487 |
-
#: includes/gateways/settings/cc-settings.php:
|
1488 |
msgid "Custom form"
|
1489 |
msgstr ""
|
1490 |
|
1491 |
-
#: includes/gateways/settings/cc-settings.php:
|
1492 |
msgid ""
|
1493 |
"The Stripe form option displays a CC form rendered by Stripe. It works well "
|
1494 |
"with most themes. The custom card forms are offered if you want more options "
|
1495 |
"on the CC form design."
|
1496 |
msgstr ""
|
1497 |
|
1498 |
-
#: includes/gateways/settings/cc-settings.php:
|
1499 |
msgid "Custom Form"
|
1500 |
msgstr ""
|
1501 |
|
1502 |
-
#: includes/gateways/settings/cc-settings.php:
|
1503 |
msgid "The design of the credit card form."
|
1504 |
msgstr ""
|
1505 |
|
1506 |
-
#: includes/gateways/settings/cc-settings.php:
|
1507 |
msgid "Postal Code"
|
1508 |
msgstr ""
|
1509 |
|
1510 |
-
#: includes/gateways/settings/cc-settings.php:
|
1511 |
msgid ""
|
1512 |
"If enabled, the CC form will show the postal code on the checkout page. If "
|
1513 |
"disabled, the billing field's postal code will be used. The postal code will "
|
@@ -1515,22 +1563,14 @@ msgid ""
|
|
1515 |
msgstr ""
|
1516 |
|
1517 |
#: includes/gateways/settings/googlepay-settings.php:4
|
1518 |
-
msgid "
|
1519 |
-
msgstr ""
|
1520 |
-
|
1521 |
-
#: includes/gateways/settings/googlepay-settings.php:4
|
1522 |
-
msgid ""
|
1523 |
-
"When you submit your request for Google Pay, request to be whitelisted for "
|
1524 |
-
"callbackintents. This ensures that the order items are displayed on the "
|
1525 |
-
"Google Payment sheet."
|
1526 |
msgstr ""
|
1527 |
|
1528 |
#: includes/gateways/settings/googlepay-settings.php:4
|
1529 |
msgid ""
|
1530 |
-
"
|
1531 |
-
"mode and Google Pay. When test mode is enabled, Google Pay will work, "
|
1532 |
"allowing you to capture the necessary screenshots the Google API team needs "
|
1533 |
-
"to approve your
|
1534 |
msgstr ""
|
1535 |
|
1536 |
#: includes/gateways/settings/googlepay-settings.php:7
|
@@ -1700,121 +1740,371 @@ msgstr ""
|
|
1700 |
msgid "The height of the button. Max height is 64"
|
1701 |
msgstr ""
|
1702 |
|
1703 |
-
#: includes/tokens/class-wc-payment-token-stripe-ach.php:61
|
1704 |
#: includes/tokens/class-wc-payment-token-stripe-ach.php:66
|
1705 |
-
#: includes/tokens/class-wc-payment-token-stripe-
|
|
|
1706 |
msgid "Type Ending In"
|
1707 |
msgstr ""
|
1708 |
|
1709 |
-
#: includes/tokens/class-wc-payment-token-stripe-ach.php:
|
1710 |
msgid "{bank_name} ending in {last4}"
|
1711 |
msgstr ""
|
1712 |
|
1713 |
-
#: includes/tokens/class-wc-payment-token-stripe-ach.php:
|
1714 |
msgid "{bank_name} **** {last4}"
|
1715 |
msgstr ""
|
1716 |
|
1717 |
-
#: includes/tokens/class-wc-payment-token-stripe-cc.php:
|
1718 |
msgid "{brand} ending in {last4}"
|
1719 |
msgstr ""
|
1720 |
|
1721 |
-
#: includes/tokens/class-wc-payment-token-stripe-cc.php:
|
1722 |
msgid "Type Masked Number"
|
1723 |
msgstr ""
|
1724 |
|
1725 |
-
#: includes/tokens/class-wc-payment-token-stripe-cc.php:
|
1726 |
msgid "Type Dash Masked Number"
|
1727 |
msgstr ""
|
1728 |
|
1729 |
-
#: includes/tokens/class-wc-payment-token-stripe-cc.php:
|
1730 |
msgid "Type Last 4"
|
1731 |
msgstr ""
|
1732 |
|
1733 |
-
#: includes/tokens/class-wc-payment-token-stripe-cc.php:
|
1734 |
msgid "Type Dash & Last 4"
|
1735 |
msgstr ""
|
1736 |
|
1737 |
-
#: includes/tokens/class-wc-payment-token-stripe-cc.php:
|
1738 |
msgid "Last Four"
|
1739 |
msgstr ""
|
1740 |
|
1741 |
-
#: includes/tokens/class-wc-payment-token-stripe-cc.php:
|
1742 |
msgid "Card Type"
|
1743 |
msgstr ""
|
1744 |
|
1745 |
-
#: includes/tokens/class-wc-payment-token-stripe-local-payment.php:
|
1746 |
msgid "Gateway Title"
|
1747 |
msgstr ""
|
1748 |
|
1749 |
-
#: includes/
|
1750 |
-
#: includes/traits/wc-stripe-payment-traits.php:84
|
1751 |
-
#, php-format
|
1752 |
-
msgid "Error creating payment source. Reason: %s"
|
1753 |
-
msgstr ""
|
1754 |
-
|
1755 |
-
#: includes/updates/update-3.1.0.php:29 includes/updates/update-3.1.0.php:52
|
1756 |
msgid "Stripe For WooCommerce Update"
|
1757 |
msgstr ""
|
1758 |
|
1759 |
-
#: includes/updates/update-3.1.0.php:
|
1760 |
msgid "Greetings from Payment Plugins,"
|
1761 |
msgstr ""
|
1762 |
|
1763 |
-
#: includes/updates/update-3.1.0.php:
|
1764 |
msgid ""
|
1765 |
"At Stripe's request, we have updated Stripe for WooCommerce to use the new "
|
1766 |
-
"Stripe Connect integration. This new integration offers even more security "
|
1767 |
-
"
|
1768 |
msgstr ""
|
1769 |
|
1770 |
-
#: includes/updates/update-3.1.0.php:
|
1771 |
#, php-format
|
1772 |
msgid ""
|
1773 |
-
"Click %shere%s to be redirected to your Stripe API settings page
|
1774 |
-
"
|
1775 |
msgstr ""
|
1776 |
|
1777 |
-
#: includes/updates/update-3.1.0.php:
|
1778 |
msgid "Kind Regards,"
|
1779 |
msgstr ""
|
1780 |
|
1781 |
-
#: includes/updates/update-3.1.0.php:
|
1782 |
msgid "Payment Plugins"
|
1783 |
msgstr ""
|
1784 |
|
1785 |
-
#: includes/wc-stripe-functions.php:
|
1786 |
msgid "Please enter a valid postcode / ZIP."
|
1787 |
msgstr ""
|
1788 |
|
1789 |
-
#: includes/wc-stripe-functions.php:
|
1790 |
msgid "Bootstrap form"
|
1791 |
msgstr ""
|
1792 |
|
1793 |
-
#: includes/wc-stripe-functions.php:
|
1794 |
msgid "Simple form"
|
1795 |
msgstr ""
|
1796 |
|
1797 |
-
#: includes/wc-stripe-functions.php:
|
1798 |
msgid "Minimalist form"
|
1799 |
msgstr ""
|
1800 |
|
1801 |
-
#: includes/wc-stripe-functions.php:
|
1802 |
msgid "Inline Form"
|
1803 |
msgstr ""
|
1804 |
|
1805 |
-
#: includes/wc-stripe-functions.php:
|
1806 |
msgid "Rounded Form"
|
1807 |
msgstr ""
|
1808 |
|
1809 |
-
#: includes/wc-stripe-
|
1810 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1811 |
msgstr ""
|
1812 |
|
1813 |
-
#: includes/wc-stripe-webhook-functions.php:
|
1814 |
msgid "payment_intent.succeeded webhook recieved. Payment has been completed."
|
1815 |
msgstr ""
|
1816 |
|
1817 |
-
#: stripe-payments.php:
|
1818 |
#, php-format
|
1819 |
msgid "Your PHP version is %s but Stripe requires version 5.4+."
|
1820 |
msgstr ""
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: woo-stripe-payment\n"
|
5 |
+
"POT-Creation-Date: 2020-04-14 10:28-0700\n"
|
6 |
"PO-Revision-Date: 2019-08-16 14:27-0700\n"
|
7 |
"Last-Translator: \n"
|
8 |
"Language-Team: \n"
|
18 |
"X-Poedit-SearchPath-1: templates\n"
|
19 |
"X-Poedit-SearchPath-2: stripe-payments.php\n"
|
20 |
|
21 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:97
|
22 |
#: includes/gateways/settings/ach-settings-v2.php:7
|
23 |
#: includes/gateways/settings/ach-settings.php:7
|
24 |
#: includes/gateways/settings/applepay-settings.php:7
|
28 |
msgid "Enabled"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:101
|
32 |
#, php-format
|
33 |
msgid "If enabled, your site can accept %s payments through Stripe."
|
34 |
msgstr ""
|
35 |
|
36 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:105
|
37 |
#: includes/gateways/settings/ach-settings-v2.php:58
|
38 |
#: includes/gateways/settings/ach-settings.php:59
|
39 |
#: includes/gateways/settings/applepay-settings.php:13
|
43 |
msgid "General Settings"
|
44 |
msgstr ""
|
45 |
|
46 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:108
|
47 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
|
48 |
#: includes/gateways/settings/ach-settings-v2.php:61
|
49 |
#: includes/gateways/settings/ach-settings.php:62
|
54 |
msgid "Title"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:111
|
58 |
#, php-format
|
59 |
msgid "Title of the %s gateway"
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:114
|
63 |
#: includes/gateways/settings/ach-settings-v2.php:67
|
64 |
#: includes/gateways/settings/ach-settings.php:68
|
65 |
#: includes/gateways/settings/applepay-settings.php:22
|
69 |
msgid "Description"
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:116
|
73 |
#: includes/gateways/settings/ach-settings-v2.php:69
|
74 |
#: includes/gateways/settings/ach-settings.php:70
|
75 |
#: includes/gateways/settings/applepay-settings.php:24
|
79 |
msgid "Leave blank if you don't want a description to show for the gateway."
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:161
|
83 |
#, php-format
|
84 |
msgid "Order %s"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:206
|
88 |
#, php-format
|
89 |
msgid "Gateway will appear when store currency is <strong>%s</strong>"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:209
|
93 |
#, php-format
|
94 |
msgid " & billing country is <strong>%s</strong>"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:337
|
98 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:114
|
99 |
#, php-format
|
100 |
msgid "Error processing payment. Reason: %s"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:344
|
104 |
#, php-format
|
105 |
msgid ""
|
106 |
"Charge %s is pending. Payment Method: %s. Payment will be completed once "
|
107 |
"charge.succeeded webhook received from Stripe."
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:352
|
111 |
#, php-format
|
112 |
msgid "Order %s successful in Stripe. Charge: %s. Payment Method: %s"
|
113 |
msgstr ""
|
114 |
|
115 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:352
|
116 |
msgid "charge"
|
117 |
msgstr ""
|
118 |
|
119 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:352
|
120 |
msgid "authorization"
|
121 |
msgstr ""
|
122 |
|
123 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:378
|
124 |
msgid ""
|
125 |
"Please read and accept the terms and conditions to proceed with your order."
|
126 |
msgstr ""
|
127 |
|
128 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:393
|
129 |
+
#: includes/controllers/class-wc-stripe-controller-cart.php:135
|
130 |
+
#: includes/controllers/class-wc-stripe-controller-cart.php:184
|
131 |
+
#: includes/controllers/class-wc-stripe-controller-googlepay.php:129
|
132 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:74
|
133 |
msgid "Total"
|
134 |
msgstr ""
|
135 |
|
136 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:451
|
137 |
msgid "User must be logged in."
|
138 |
msgstr ""
|
139 |
|
140 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:463
|
141 |
#, php-format
|
142 |
msgid "Error saving your payment method. Reason: %s"
|
143 |
msgstr ""
|
144 |
|
145 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:477
|
146 |
#, php-format
|
147 |
msgid "Error saving payment method. Reason: %s"
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:494
|
151 |
#, php-format
|
152 |
msgid "Order refunded in Stripe. Amount: %s"
|
153 |
msgstr ""
|
154 |
|
155 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:523
|
156 |
#, php-format
|
157 |
msgid "Order amount captured in Stripe. Amount: %s"
|
158 |
msgstr ""
|
159 |
|
160 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:527
|
161 |
#, php-format
|
162 |
msgid "Error capturing charge in Stripe. Reason: %s"
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:547
|
166 |
#, php-format
|
167 |
msgid "Error voiding charge. Reason: %s"
|
168 |
msgstr ""
|
169 |
|
170 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:549
|
171 |
msgid "Charge voided in Stripe."
|
172 |
msgstr ""
|
173 |
|
174 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:709
|
175 |
msgid "n/a"
|
176 |
msgstr ""
|
177 |
|
178 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:732
|
179 |
#: includes/admin/meta-boxes/views/html-order-pay.php:42
|
180 |
msgid "New Card"
|
181 |
msgstr ""
|
182 |
|
183 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:736
|
184 |
#: includes/admin/meta-boxes/views/html-order-pay.php:30
|
185 |
msgid "Saved Cards"
|
186 |
msgstr ""
|
187 |
|
188 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:893
|
189 |
#, php-format
|
190 |
msgid "Attemp to save payment method failed. Reason: %s"
|
191 |
msgstr ""
|
192 |
|
193 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:913
|
194 |
msgid ""
|
195 |
"We were not able to save your payment method. To prevent billing issues with "
|
196 |
"your subscription, please add a payment method to the subscription."
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:915
|
200 |
#, php-format
|
201 |
msgid "We were not able to save your payment method. Reason: %s"
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:947
|
205 |
msgid "Payment Method Token"
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:966
|
209 |
#, php-format
|
210 |
msgid "Recurring payment for order failed. Reason: %s"
|
211 |
msgstr ""
|
212 |
|
213 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:975
|
214 |
#, php-format
|
215 |
msgid "Recurring payment captured in Stripe. Payment method: %s"
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:977
|
219 |
#, php-format
|
220 |
msgid "Recurring payment authorized in Stripe. Payment method: %s"
|
221 |
msgstr ""
|
222 |
|
223 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:980
|
224 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1226
|
225 |
#, php-format
|
226 |
msgid "Customer must manually complete payment for payment method %s"
|
227 |
msgstr ""
|
228 |
|
229 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:996
|
230 |
#, php-format
|
231 |
msgid "Error saving payment method for subscription. Reason: %s"
|
232 |
msgstr ""
|
233 |
|
234 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1052
|
235 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:175
|
236 |
#, php-format
|
237 |
msgid "Order %s from %s"
|
238 |
msgstr ""
|
239 |
|
240 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1213
|
241 |
#, php-format
|
242 |
msgid "Pre-order payment for order failed. Reason: %s"
|
243 |
msgstr ""
|
244 |
|
245 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1221
|
246 |
#, php-format
|
247 |
msgid "Pre-order payment captured in Stripe. Payment method: %s"
|
248 |
msgstr ""
|
249 |
|
250 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1223
|
251 |
#, php-format
|
252 |
msgid "Pre-order payment authorized in Stripe. Payment method: %s"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1297
|
256 |
+
msgid "Cannot process payment"
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: includes/abstract/abstract-wc-payment-token-stripe.php:167
|
260 |
+
#: includes/abstract/abstract-wc-payment-token-stripe.php:173
|
261 |
#, php-format
|
262 |
msgid "Error deleting Stripe card. Token Id: %s"
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:103
|
266 |
msgid "Transaction Id cannot be empty."
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: includes/abstract/abstract-wc-stripe-rest-controller.php:58
|
270 |
msgid "You do not have permissions to access this resource."
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: includes/admin/class-wc-stripe-admin-menus.php:25
|
274 |
msgid "Stripe Gateway"
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: includes/admin/class-wc-stripe-admin-menus.php:29
|
278 |
msgid "Settings"
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: includes/admin/class-wc-stripe-admin-menus.php:30
|
282 |
msgid "Logs"
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: includes/admin/class-wc-stripe-admin-menus.php:36
|
286 |
#: includes/admin/views/html-settings-nav.php:17
|
287 |
+
#: includes/class-wc-stripe-install.php:31
|
288 |
msgid "Documentation"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: includes/admin/class-wc-stripe-admin-notices.php:51
|
292 |
#, php-format
|
293 |
msgid ""
|
294 |
"At Stripe's request we have updated how the Stripe for WooCommerce\n"
|
298 |
"Integration%s"
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: includes/admin/class-wc-stripe-admin-settings.php:76
|
302 |
msgid "Local Gateways"
|
303 |
msgstr ""
|
304 |
|
330 |
msgstr ""
|
331 |
|
332 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:24
|
333 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:38
|
334 |
msgid "Mode"
|
335 |
msgstr ""
|
336 |
|
337 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
|
338 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:42
|
339 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:147
|
340 |
msgid "Live"
|
341 |
msgstr ""
|
342 |
|
343 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
|
344 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:41
|
345 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:147
|
346 |
msgid "Test"
|
347 |
msgstr ""
|
348 |
|
444 |
msgid "Authorize"
|
445 |
msgstr ""
|
446 |
|
447 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:15
|
448 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:35
|
449 |
msgid "API Settings"
|
450 |
msgstr ""
|
451 |
|
452 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:45
|
453 |
msgid ""
|
454 |
"The mode determines if you are processing test transactions or live "
|
455 |
"transactions on your site. Test mode allows you to simulate payments so you "
|
456 |
"can test your integration."
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:49
|
460 |
msgid "Account ID"
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:52
|
464 |
msgid "This is your Stripe Connect ID and serves as a unique identifier."
|
465 |
msgstr ""
|
466 |
|
467 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:56
|
468 |
msgid "Connect Stripe Account"
|
469 |
msgstr ""
|
470 |
|
471 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:57
|
472 |
msgid "Click to Connect"
|
473 |
msgstr ""
|
474 |
|
475 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:59
|
476 |
msgid ""
|
477 |
"We make it easy to connect Stripe to your site. Click the Connect button to "
|
478 |
"go through our connect flow."
|
479 |
msgstr ""
|
480 |
|
481 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:63
|
482 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:64
|
483 |
msgid "Connection Test"
|
484 |
msgstr ""
|
485 |
|
486 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:66
|
487 |
msgid ""
|
488 |
"Click this button to perform a connection test. If successful, your site is "
|
489 |
"connected to Stripe."
|
490 |
msgstr ""
|
491 |
|
492 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:70
|
493 |
msgid "Webhook url"
|
494 |
msgstr ""
|
495 |
|
496 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:73
|
497 |
#, php-format
|
498 |
msgid ""
|
499 |
"<strong>Important:</strong> the webhook url is called by Stripe when events "
|
502 |
"%sWebhook guide%s"
|
503 |
msgstr ""
|
504 |
|
505 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:77
|
506 |
msgid "Live Webhook Secret"
|
507 |
msgstr ""
|
508 |
|
509 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:78
|
510 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:88
|
511 |
#, php-format
|
512 |
msgid ""
|
513 |
"The webhook secret is used to authenticate webhooks sent from Stripe. It "
|
515 |
"guide%s"
|
516 |
msgstr ""
|
517 |
|
518 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:87
|
519 |
msgid "Test Webhook Secret"
|
520 |
msgstr ""
|
521 |
|
522 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:96
|
523 |
msgid "Debug Log"
|
524 |
msgstr ""
|
525 |
|
526 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:100
|
527 |
msgid ""
|
528 |
"When enabled, the plugin logs important errors and info that can help you "
|
529 |
"troubleshoot potential issues."
|
530 |
msgstr ""
|
531 |
|
532 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:105
|
533 |
#, php-format
|
534 |
msgid ""
|
535 |
"%s Your Stripe account has been connected. You can now accept Live and Test "
|
537 |
"security."
|
538 |
msgstr ""
|
539 |
|
540 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:121
|
541 |
msgid "Click To Re-Connect"
|
542 |
msgstr ""
|
543 |
|
544 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:138
|
545 |
msgid "Please try again."
|
546 |
msgstr ""
|
547 |
|
548 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:141
|
549 |
#, php-format
|
550 |
msgid "We were not able to connect your Stripe account. Reason: %s"
|
551 |
msgstr ""
|
552 |
|
553 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:161
|
554 |
msgid ""
|
555 |
"Your Stripe account has been connected to your WooCommerce store. You may "
|
556 |
"now accept payments in Live and Test mode."
|
636 |
"action."
|
637 |
msgstr ""
|
638 |
|
639 |
+
#: includes/class-wc-stripe-customer-manager.php:33
|
640 |
+
#: includes/class-wc-stripe-customer-manager.php:42
|
641 |
#, php-format
|
642 |
msgid "Error saving customer. Reason: %s"
|
643 |
msgstr ""
|
644 |
|
645 |
+
#: includes/class-wc-stripe-frontend-notices.php:37
|
646 |
msgid ""
|
647 |
"Your payment is being processed and your order status will be updated once "
|
648 |
"the funds are received."
|
649 |
msgstr ""
|
650 |
|
651 |
+
#: includes/class-wc-stripe-frontend-scripts.php:60
|
652 |
msgid "No matches found"
|
653 |
msgstr ""
|
654 |
|
655 |
+
#: includes/class-wc-stripe-gateway-ach.php:51
|
656 |
msgid ""
|
657 |
"Please update your ACH environment to Production to match your Stripe API "
|
658 |
"Mode."
|
659 |
msgstr ""
|
660 |
|
661 |
+
#: includes/class-wc-stripe-redirect-handler.php:39
|
|
|
|
|
|
|
|
|
|
|
662 |
#, php-format
|
663 |
msgid "Error retrieving payment source. Reason: %s"
|
664 |
msgstr ""
|
665 |
|
666 |
+
#: includes/class-wc-stripe-redirect-handler.php:53
|
667 |
msgid "Payment authorization failed. Please select another payment method."
|
668 |
msgstr ""
|
669 |
|
670 |
+
#: includes/class-wc-stripe-redirect-handler.php:54
|
671 |
msgid "Payment authorization failed."
|
672 |
msgstr ""
|
673 |
|
674 |
+
#: includes/class-wc-stripe-rest-api.php:44
|
675 |
#, php-format
|
676 |
msgid "%1$s is an invalid controller name."
|
677 |
msgstr ""
|
678 |
|
679 |
+
#: includes/class-wc-stripe-update.php:44
|
680 |
#, php-format
|
681 |
msgid "Thank you for updating Stripe for WooCommerce to version %1$s."
|
682 |
msgstr ""
|
683 |
|
684 |
+
#: includes/controllers/class-wc-stripe-controller-cart.php:98
|
685 |
msgid "Quantity must be greater than zero."
|
686 |
msgstr ""
|
687 |
|
688 |
+
#: includes/controllers/class-wc-stripe-controller-checkout.php:152
|
689 |
#, php-format
|
690 |
msgid ""
|
691 |
"Some required fields were missing. Please click %shere%s to complete your "
|
692 |
"payment."
|
693 |
msgstr ""
|
694 |
|
695 |
+
#: includes/controllers/class-wc-stripe-controller-checkout.php:185
|
696 |
msgid "Please review your order details then click Place Order."
|
697 |
msgstr ""
|
698 |
|
699 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:83
|
700 |
msgid ""
|
701 |
"You cannot register your domain until you have configured your Live API keys."
|
702 |
msgstr ""
|
703 |
|
704 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:99
|
705 |
msgid ""
|
706 |
"Domain registered successfully. You can confirm in your Stripe Dashboard at "
|
707 |
"https://dashboard.stripe.com/account/apple_pay."
|
708 |
msgstr ""
|
709 |
|
710 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:116
|
711 |
msgid "You must configure your secret key before creating webhooks."
|
712 |
msgstr ""
|
713 |
|
714 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:125
|
715 |
msgid ""
|
716 |
"There is already a webhook configured for this site. If you want to delete "
|
717 |
"the webhook, login to your Stripe Dashboard."
|
718 |
msgstr ""
|
719 |
|
720 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:147
|
721 |
#, php-format
|
722 |
msgid ""
|
723 |
"Webhook created in Stripe for %s environment. You can test your webhook by "
|
724 |
"logging in to the Stripe dashboard"
|
725 |
msgstr ""
|
726 |
|
727 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:167
|
728 |
#, php-format
|
729 |
msgid "Mode: %s. Invalid secret key. Please check your entry."
|
730 |
msgstr ""
|
731 |
|
|
|
732 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:180
|
733 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:183
|
734 |
#, php-format
|
735 |
msgid "Mode: %s. Invalid publishable key. Please check your entry."
|
736 |
msgstr ""
|
737 |
|
738 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:191
|
739 |
#, php-format
|
740 |
msgid "Connection test to Stripe was successful. Mode: %s."
|
741 |
msgstr ""
|
742 |
|
743 |
+
#: includes/controllers/class-wc-stripe-controller-googlepay.php:92
|
744 |
msgid "Your shipping address is not serviceable."
|
745 |
msgstr ""
|
746 |
|
747 |
+
#: includes/controllers/class-wc-stripe-controller-order-actions.php:123
|
748 |
msgid "Invalid amount entered."
|
749 |
msgstr ""
|
750 |
|
751 |
+
#: includes/controllers/class-wc-stripe-controller-order-actions.php:174
|
752 |
+
#: includes/controllers/class-wc-stripe-controller-order-actions.php:177
|
753 |
msgid "Order total must be greater than zero."
|
754 |
msgstr ""
|
755 |
|
756 |
+
#: includes/controllers/class-wc-stripe-controller-order-actions.php:187
|
757 |
#, php-format
|
758 |
msgid ""
|
759 |
"This order has already been processed. Transaction ID: %s. Payment method: %s"
|
760 |
msgstr ""
|
761 |
|
762 |
+
#: includes/controllers/class-wc-stripe-controller-order-actions.php:196
|
763 |
msgid "Order customer Id and payment method customer Id do not match."
|
764 |
msgstr ""
|
765 |
|
766 |
+
#: includes/controllers/class-wc-stripe-controller-payment-intent.php:56
|
767 |
#, php-format
|
768 |
msgid "Error creating payment intent. Reason: %s"
|
769 |
msgstr ""
|
770 |
|
771 |
+
#: includes/controllers/class-wc-stripe-controller-payment-intent.php:70
|
772 |
msgid "Invalid order id provided"
|
773 |
msgstr ""
|
774 |
|
775 |
+
#: includes/controllers/class-wc-stripe-controller-payment-intent.php:76
|
776 |
msgid "You are not authorized to update this order."
|
777 |
msgstr ""
|
778 |
|
779 |
+
#: includes/controllers/class-wc-stripe-controller-webhook.php:46
|
780 |
+
#: includes/controllers/class-wc-stripe-controller-webhook.php:47
|
781 |
msgid "Invalid signature received. Verify that your webhook secret is correct."
|
782 |
msgstr ""
|
783 |
|
784 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:26
|
785 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:26
|
786 |
msgid "ACH"
|
787 |
msgstr ""
|
788 |
|
789 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:29
|
790 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:29
|
791 |
msgid "Stripe ACH"
|
792 |
msgstr ""
|
793 |
|
794 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:30
|
795 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:30
|
796 |
msgid "ACH gateway that integrates with your Stripe account."
|
797 |
msgstr ""
|
798 |
|
799 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:32
|
800 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:32
|
801 |
msgid "Bank Payment"
|
802 |
msgstr ""
|
803 |
|
804 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:126
|
805 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:202
|
806 |
msgid "Saved Banks"
|
807 |
msgstr ""
|
808 |
|
809 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:130
|
810 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:206
|
811 |
msgid "New Bank"
|
812 |
msgstr ""
|
813 |
|
814 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:171
|
815 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:262
|
816 |
msgid ""
|
817 |
"You must set the API mode to live in order to enable the Plaid development "
|
818 |
"environment."
|
819 |
msgstr ""
|
820 |
|
821 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:212
|
822 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php:215
|
823 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:303
|
824 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:306
|
825 |
#: includes/gateways/settings/ach-settings-v2.php:88
|
826 |
#: includes/gateways/settings/ach-settings.php:89
|
827 |
msgid "ACH Fee"
|
828 |
msgstr ""
|
829 |
|
830 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:25
|
831 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:28
|
832 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:31
|
833 |
msgid "Alipay"
|
834 |
msgstr ""
|
835 |
|
836 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:29
|
837 |
msgid "Alipay gateway that integrates with your Stripe account."
|
838 |
msgstr ""
|
839 |
|
840 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:21
|
841 |
#: includes/gateways/settings/applepay-settings.php:17
|
842 |
msgid "Apple Pay"
|
843 |
msgstr ""
|
844 |
|
845 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:24
|
846 |
msgid "Stripe Apple Pay"
|
847 |
msgstr ""
|
848 |
|
849 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:25
|
850 |
msgid "Apple Pay gateway that integrates with your Stripe account."
|
851 |
msgstr ""
|
852 |
|
853 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:64
|
854 |
msgid "Please update you product quantity before using Apple Pay."
|
855 |
msgstr ""
|
856 |
|
857 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:65
|
858 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:71
|
859 |
msgid "Please select a product option before updating quantity."
|
860 |
msgstr ""
|
861 |
|
862 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-bancontact.php:25
|
863 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-bancontact.php:28
|
864 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-bancontact.php:31
|
865 |
msgid "Bancontact"
|
866 |
msgstr ""
|
867 |
|
868 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-bancontact.php:29
|
869 |
msgid "Bancontact gateway that integrates with your Stripe account."
|
870 |
msgstr ""
|
871 |
|
872 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:19
|
873 |
#: includes/gateways/settings/cc-settings.php:17
|
874 |
msgid "Credit Cards"
|
875 |
msgstr ""
|
876 |
|
877 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:22
|
878 |
msgid "Stripe Credit Cards"
|
879 |
msgstr ""
|
880 |
|
881 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:23
|
882 |
msgid "Credit card gateway that integrates with your Stripe account."
|
883 |
msgstr ""
|
884 |
|
885 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-eps.php:24
|
886 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-eps.php:27
|
887 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-eps.php:30
|
888 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:27
|
889 |
msgid "EPS"
|
890 |
msgstr ""
|
891 |
|
892 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-eps.php:28
|
893 |
msgid "EPS gateway that integrates with your Stripe account."
|
894 |
msgstr ""
|
895 |
|
896 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-fpx.php:26
|
897 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-fpx.php:27
|
898 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-fpx.php:30
|
899 |
msgid "FPX"
|
900 |
msgstr ""
|
901 |
|
902 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-fpx.php:28
|
903 |
msgid "FPX gateway that integrates with your Stripe account."
|
904 |
msgstr ""
|
905 |
|
|
|
906 |
#: includes/gateways/class-wc-payment-gateway-stripe-giropay.php:24
|
907 |
#: includes/gateways/class-wc-payment-gateway-stripe-giropay.php:27
|
908 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-giropay.php:30
|
909 |
msgid "Giropay"
|
910 |
msgstr ""
|
911 |
|
912 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-giropay.php:28
|
913 |
msgid "Giropay gateway that integrates with your Stripe account."
|
914 |
msgstr ""
|
915 |
|
916 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:20
|
917 |
#: includes/gateways/settings/googlepay-settings.php:31
|
918 |
msgid "Google Pay"
|
919 |
msgstr ""
|
920 |
|
921 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:23
|
922 |
msgid "Stripe Google Pay"
|
923 |
msgstr ""
|
924 |
|
925 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:24
|
926 |
msgid "Google Pay gateway that integrates with your Stripe account."
|
927 |
msgstr ""
|
928 |
|
929 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:79
|
930 |
msgid "Please update you product quantity before using Google Pay."
|
931 |
msgstr ""
|
932 |
|
933 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:92
|
934 |
msgid "Subscription"
|
935 |
msgstr ""
|
936 |
|
937 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:122
|
938 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:170
|
939 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:152
|
940 |
+
#: includes/wc-stripe-functions.php:357 includes/wc-stripe-functions.php:404
|
941 |
msgid "Shipping"
|
942 |
msgstr ""
|
943 |
|
944 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:130
|
945 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:191
|
946 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:162
|
947 |
+
#: includes/wc-stripe-functions.php:373 includes/wc-stripe-functions.php:412
|
948 |
msgid "Discount"
|
949 |
msgstr ""
|
950 |
|
951 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:141
|
952 |
+
#: includes/wc-stripe-functions.php:423
|
953 |
msgid "Fees"
|
954 |
msgstr ""
|
955 |
|
956 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:149
|
957 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:199
|
958 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:183
|
959 |
+
#: includes/wc-stripe-functions.php:381 includes/wc-stripe-functions.php:431
|
960 |
msgid "Tax"
|
961 |
msgstr ""
|
962 |
|
963 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:230
|
964 |
+
#: includes/wc-stripe-functions.php:483
|
965 |
msgid "Waiting..."
|
966 |
msgstr ""
|
967 |
|
968 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:231
|
969 |
+
#: includes/wc-stripe-functions.php:484
|
970 |
msgid "loading shipping methods..."
|
971 |
msgstr ""
|
972 |
|
973 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ideal.php:28
|
974 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ideal.php:29
|
975 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ideal.php:32
|
976 |
msgid "iDEAL"
|
977 |
msgstr ""
|
978 |
|
979 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ideal.php:30
|
980 |
msgid "Ideal gateway that integrates with your Stripe account."
|
981 |
msgstr ""
|
982 |
|
983 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:23
|
984 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:26
|
985 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:29
|
986 |
msgid "Klarna"
|
987 |
msgstr ""
|
988 |
|
989 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:27
|
990 |
msgid "Klarna gateway that integrates with your Stripe account."
|
991 |
msgstr ""
|
992 |
|
993 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:175
|
994 |
msgid "Fee"
|
995 |
msgstr ""
|
996 |
|
997 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:211
|
998 |
msgid "Pay Now"
|
999 |
msgstr ""
|
1000 |
|
1001 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:212
|
1002 |
msgid "Pay Later"
|
1003 |
msgstr ""
|
1004 |
|
1005 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:213
|
1006 |
msgid "Pay Over Time"
|
1007 |
msgstr ""
|
1008 |
|
1009 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:24
|
1010 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:30
|
1011 |
msgid "Multibanco"
|
1012 |
msgstr ""
|
1013 |
|
1014 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:28
|
1015 |
msgid "Multibanco gateway that integrates with your Stripe account."
|
1016 |
msgstr ""
|
1017 |
|
1018 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-p24.php:24
|
1019 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-p24.php:27
|
1020 |
msgid "Przelewy24"
|
1021 |
msgstr ""
|
1022 |
|
1023 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-p24.php:28
|
1024 |
msgid "P24 gateway that integrates with your Stripe account."
|
1025 |
msgstr ""
|
1026 |
|
1027 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-p24.php:30
|
1028 |
msgid "P24"
|
1029 |
msgstr ""
|
1030 |
|
1031 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:22
|
1032 |
msgid "PaymentRequest Gateway"
|
1033 |
msgstr ""
|
1034 |
|
1035 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:25
|
1036 |
msgid "Stripe Payment Request"
|
1037 |
msgstr ""
|
1038 |
|
1039 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:26
|
1040 |
msgid ""
|
1041 |
"Gateway that renders based on the user's browser. Chrome payment methods, "
|
1042 |
"Microsoft pay, etc."
|
1043 |
msgstr ""
|
1044 |
|
1045 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:69
|
1046 |
msgid "Please update you product quantity before paying."
|
1047 |
msgstr ""
|
1048 |
|
1049 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-payment-request.php:70
|
1050 |
msgid "Adding to cart..."
|
1051 |
msgstr ""
|
1052 |
|
1053 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:23
|
1054 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:29
|
1055 |
msgid "SEPA"
|
1056 |
msgstr ""
|
1057 |
|
1058 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:26
|
1059 |
msgid "Sepa"
|
1060 |
msgstr ""
|
1061 |
|
1062 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:27
|
1063 |
msgid "Sepa gateway that integrates with your Stripe account."
|
1064 |
msgstr ""
|
1065 |
|
1066 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:32
|
1067 |
+
#, php-format
|
1068 |
+
msgid ""
|
1069 |
+
"By providing your IBAN and confirming this payment, you are\n"
|
1070 |
+
"\t\t\tauthorizing %s and Stripe, our payment service provider, to send "
|
1071 |
+
"instructions to your bank to debit your account\n"
|
1072 |
+
"\t\t\tand your bank to debit your account in accordance with those "
|
1073 |
+
"instructions. You are entitled to a refund from your bank under the\n"
|
1074 |
+
"\t\t\tterms and conditions of your agreement with your bank. A refund must "
|
1075 |
+
"be claimed within 8 weeks starting from the date on which your account was "
|
1076 |
+
"debited."
|
1077 |
+
msgstr ""
|
1078 |
+
|
1079 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:48
|
1080 |
+
msgid "Company Name"
|
1081 |
+
msgstr ""
|
1082 |
+
|
1083 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:52
|
1084 |
+
msgid "The name of your company that will appear in the SEPA mandate."
|
1085 |
+
msgstr ""
|
1086 |
+
|
1087 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:58
|
1088 |
+
msgid "SEPA Test Accounts"
|
1089 |
+
msgstr ""
|
1090 |
+
|
1091 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:26
|
1092 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:29
|
1093 |
msgid "Sofort"
|
1094 |
msgstr ""
|
1095 |
|
1096 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:30
|
1097 |
msgid "Sofort gateway that integrates with your Stripe account."
|
1098 |
msgstr ""
|
1099 |
|
1100 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:32
|
1101 |
msgid "SOFORT"
|
1102 |
msgstr ""
|
1103 |
|
1104 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:25
|
1105 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:28
|
1106 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:31
|
1107 |
msgid "WeChat"
|
1108 |
msgstr ""
|
1109 |
|
1110 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:29
|
1111 |
msgid "WeChat gateway that integrates with your Stripe account."
|
1112 |
msgstr ""
|
1113 |
|
1114 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:64
|
1115 |
msgid ""
|
1116 |
"Scan the QR code using your WeChat app. Once scanned click the Place Order "
|
1117 |
"button."
|
1455 |
msgstr ""
|
1456 |
|
1457 |
#: includes/gateways/settings/cc-settings.php:63
|
1458 |
+
msgid "Force 3D Secure"
|
1459 |
+
msgstr ""
|
1460 |
+
|
1461 |
+
#: includes/gateways/settings/cc-settings.php:66
|
1462 |
+
#, php-format
|
1463 |
+
msgid ""
|
1464 |
+
"Stripe internally determines when 3D secure should be presented based on "
|
1465 |
+
"their SCA engine. If <strong>Force 3D Secure</strong> is enabled, 3D Secure "
|
1466 |
+
"will be forced for ALL credit card transactions. In test mode 3D secure only "
|
1467 |
+
"shows for %s3DS Test Cards%s regardless of this setting."
|
1468 |
msgstr ""
|
1469 |
|
1470 |
#: includes/gateways/settings/cc-settings.php:69
|
1471 |
+
msgid "Generic Errors"
|
1472 |
+
msgstr ""
|
1473 |
+
|
1474 |
+
#: includes/gateways/settings/cc-settings.php:72
|
1475 |
+
msgid ""
|
1476 |
+
"If enabled, credit card errors will be generic when presented to the "
|
1477 |
+
"customer. Merchants may prefer to not provide details on why a card was not "
|
1478 |
+
"accepted for security purposes."
|
1479 |
+
msgstr ""
|
1480 |
+
|
1481 |
+
#: includes/gateways/settings/cc-settings.php:75
|
1482 |
+
msgid "Accepted Payment Methods"
|
1483 |
+
msgstr ""
|
1484 |
+
|
1485 |
+
#: includes/gateways/settings/cc-settings.php:81
|
1486 |
msgid "Visa"
|
1487 |
msgstr ""
|
1488 |
|
1489 |
+
#: includes/gateways/settings/cc-settings.php:82
|
1490 |
+
#: includes/wc-stripe-functions.php:1039
|
1491 |
msgid "Amex"
|
1492 |
msgstr ""
|
1493 |
|
1494 |
+
#: includes/gateways/settings/cc-settings.php:83
|
1495 |
msgid "Discover"
|
1496 |
msgstr ""
|
1497 |
|
1498 |
+
#: includes/gateways/settings/cc-settings.php:84
|
1499 |
msgid "MasterCard"
|
1500 |
msgstr ""
|
1501 |
|
1502 |
+
#: includes/gateways/settings/cc-settings.php:85
|
1503 |
msgid "JCB"
|
1504 |
msgstr ""
|
1505 |
|
1506 |
+
#: includes/gateways/settings/cc-settings.php:86
|
1507 |
msgid "Maestro"
|
1508 |
msgstr ""
|
1509 |
|
1510 |
+
#: includes/gateways/settings/cc-settings.php:87
|
1511 |
msgid "Diners Club"
|
1512 |
msgstr ""
|
1513 |
|
1514 |
+
#: includes/gateways/settings/cc-settings.php:88
|
1515 |
msgid "Union Pay"
|
1516 |
msgstr ""
|
1517 |
|
1518 |
+
#: includes/gateways/settings/cc-settings.php:90
|
1519 |
msgid ""
|
1520 |
"The selected icons will show customers which credit card brands you accept."
|
1521 |
msgstr ""
|
1522 |
|
1523 |
+
#: includes/gateways/settings/cc-settings.php:93
|
1524 |
msgid "Credit Card Form"
|
1525 |
msgstr ""
|
1526 |
|
1527 |
+
#: includes/gateways/settings/cc-settings.php:96
|
1528 |
msgid "Card Form"
|
1529 |
msgstr ""
|
1530 |
|
1531 |
+
#: includes/gateways/settings/cc-settings.php:99
|
1532 |
msgid "Stripe form"
|
1533 |
msgstr ""
|
1534 |
|
1535 |
+
#: includes/gateways/settings/cc-settings.php:100
|
1536 |
msgid "Custom form"
|
1537 |
msgstr ""
|
1538 |
|
1539 |
+
#: includes/gateways/settings/cc-settings.php:102
|
1540 |
msgid ""
|
1541 |
"The Stripe form option displays a CC form rendered by Stripe. It works well "
|
1542 |
"with most themes. The custom card forms are offered if you want more options "
|
1543 |
"on the CC form design."
|
1544 |
msgstr ""
|
1545 |
|
1546 |
+
#: includes/gateways/settings/cc-settings.php:105
|
1547 |
msgid "Custom Form"
|
1548 |
msgstr ""
|
1549 |
|
1550 |
+
#: includes/gateways/settings/cc-settings.php:109
|
1551 |
msgid "The design of the credit card form."
|
1552 |
msgstr ""
|
1553 |
|
1554 |
+
#: includes/gateways/settings/cc-settings.php:118
|
1555 |
msgid "Postal Code"
|
1556 |
msgstr ""
|
1557 |
|
1558 |
+
#: includes/gateways/settings/cc-settings.php:120
|
1559 |
msgid ""
|
1560 |
"If enabled, the CC form will show the postal code on the checkout page. If "
|
1561 |
"disabled, the billing field's postal code will be used. The postal code will "
|
1563 |
msgstr ""
|
1564 |
|
1565 |
#: includes/gateways/settings/googlepay-settings.php:4
|
1566 |
+
msgid "GPay Business Console"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1567 |
msgstr ""
|
1568 |
|
1569 |
#: includes/gateways/settings/googlepay-settings.php:4
|
1570 |
msgid ""
|
1571 |
+
"When test mode is enabled, Google Pay will work without a merchant ID, "
|
|
|
1572 |
"allowing you to capture the necessary screenshots the Google API team needs "
|
1573 |
+
"to approve your integration request."
|
1574 |
msgstr ""
|
1575 |
|
1576 |
#: includes/gateways/settings/googlepay-settings.php:7
|
1740 |
msgid "The height of the button. Max height is 64"
|
1741 |
msgstr ""
|
1742 |
|
|
|
1743 |
#: includes/tokens/class-wc-payment-token-stripe-ach.php:66
|
1744 |
+
#: includes/tokens/class-wc-payment-token-stripe-ach.php:71
|
1745 |
+
#: includes/tokens/class-wc-payment-token-stripe-cc.php:84
|
1746 |
msgid "Type Ending In"
|
1747 |
msgstr ""
|
1748 |
|
1749 |
+
#: includes/tokens/class-wc-payment-token-stripe-ach.php:68
|
1750 |
msgid "{bank_name} ending in {last4}"
|
1751 |
msgstr ""
|
1752 |
|
1753 |
+
#: includes/tokens/class-wc-payment-token-stripe-ach.php:73
|
1754 |
msgid "{bank_name} **** {last4}"
|
1755 |
msgstr ""
|
1756 |
|
1757 |
+
#: includes/tokens/class-wc-payment-token-stripe-cc.php:86
|
1758 |
msgid "{brand} ending in {last4}"
|
1759 |
msgstr ""
|
1760 |
|
1761 |
+
#: includes/tokens/class-wc-payment-token-stripe-cc.php:89
|
1762 |
msgid "Type Masked Number"
|
1763 |
msgstr ""
|
1764 |
|
1765 |
+
#: includes/tokens/class-wc-payment-token-stripe-cc.php:94
|
1766 |
msgid "Type Dash Masked Number"
|
1767 |
msgstr ""
|
1768 |
|
1769 |
+
#: includes/tokens/class-wc-payment-token-stripe-cc.php:99
|
1770 |
msgid "Type Last 4"
|
1771 |
msgstr ""
|
1772 |
|
1773 |
+
#: includes/tokens/class-wc-payment-token-stripe-cc.php:104
|
1774 |
msgid "Type Dash & Last 4"
|
1775 |
msgstr ""
|
1776 |
|
1777 |
+
#: includes/tokens/class-wc-payment-token-stripe-cc.php:109
|
1778 |
msgid "Last Four"
|
1779 |
msgstr ""
|
1780 |
|
1781 |
+
#: includes/tokens/class-wc-payment-token-stripe-cc.php:114
|
1782 |
msgid "Card Type"
|
1783 |
msgstr ""
|
1784 |
|
1785 |
+
#: includes/tokens/class-wc-payment-token-stripe-local-payment.php:31
|
1786 |
msgid "Gateway Title"
|
1787 |
msgstr ""
|
1788 |
|
1789 |
+
#: includes/updates/update-3.1.0.php:31 includes/updates/update-3.1.0.php:60
|
|
|
|
|
|
|
|
|
|
|
|
|
1790 |
msgid "Stripe For WooCommerce Update"
|
1791 |
msgstr ""
|
1792 |
|
1793 |
+
#: includes/updates/update-3.1.0.php:33
|
1794 |
msgid "Greetings from Payment Plugins,"
|
1795 |
msgstr ""
|
1796 |
|
1797 |
+
#: includes/updates/update-3.1.0.php:34
|
1798 |
msgid ""
|
1799 |
"At Stripe's request, we have updated Stripe for WooCommerce to use the new "
|
1800 |
+
"Stripe Connect integration. This new integration offers even more security. "
|
1801 |
+
"Stripe is requesting that all merchants switch."
|
1802 |
msgstr ""
|
1803 |
|
1804 |
+
#: includes/updates/update-3.1.0.php:35
|
1805 |
#, php-format
|
1806 |
msgid ""
|
1807 |
+
"Click %shere%s to be redirected to your Stripe API settings page then click "
|
1808 |
+
"the <strong>Click to Connect</strong> button."
|
1809 |
msgstr ""
|
1810 |
|
1811 |
+
#: includes/updates/update-3.1.0.php:44
|
1812 |
msgid "Kind Regards,"
|
1813 |
msgstr ""
|
1814 |
|
1815 |
+
#: includes/updates/update-3.1.0.php:45
|
1816 |
msgid "Payment Plugins"
|
1817 |
msgstr ""
|
1818 |
|
1819 |
+
#: includes/wc-stripe-functions.php:264
|
1820 |
msgid "Please enter a valid postcode / ZIP."
|
1821 |
msgstr ""
|
1822 |
|
1823 |
+
#: includes/wc-stripe-functions.php:703
|
1824 |
msgid "Bootstrap form"
|
1825 |
msgstr ""
|
1826 |
|
1827 |
+
#: includes/wc-stripe-functions.php:737
|
1828 |
msgid "Simple form"
|
1829 |
msgstr ""
|
1830 |
|
1831 |
+
#: includes/wc-stripe-functions.php:770
|
1832 |
msgid "Minimalist form"
|
1833 |
msgstr ""
|
1834 |
|
1835 |
+
#: includes/wc-stripe-functions.php:804
|
1836 |
msgid "Inline Form"
|
1837 |
msgstr ""
|
1838 |
|
1839 |
+
#: includes/wc-stripe-functions.php:840
|
1840 |
msgid "Rounded Form"
|
1841 |
msgstr ""
|
1842 |
|
1843 |
+
#: includes/wc-stripe-functions.php:1051
|
1844 |
+
msgid "There was an error processing your credit card."
|
1845 |
+
msgstr ""
|
1846 |
+
|
1847 |
+
#: includes/wc-stripe-functions.php:1052
|
1848 |
+
msgid ""
|
1849 |
+
"The card number is incorrect. Check the card's number or use a different "
|
1850 |
+
"card."
|
1851 |
+
msgstr ""
|
1852 |
+
|
1853 |
+
#: includes/wc-stripe-functions.php:1053
|
1854 |
+
msgid ""
|
1855 |
+
"The card's security code is incorrect. Check the card's security code or use "
|
1856 |
+
"a different card."
|
1857 |
+
msgstr ""
|
1858 |
+
|
1859 |
+
#: includes/wc-stripe-functions.php:1054
|
1860 |
+
msgid ""
|
1861 |
+
"The card's ZIP code is incorrect. Check the card's ZIP code or use a "
|
1862 |
+
"different card."
|
1863 |
+
msgstr ""
|
1864 |
+
|
1865 |
+
#: includes/wc-stripe-functions.php:1055 includes/wc-stripe-functions.php:1060
|
1866 |
+
msgid ""
|
1867 |
+
"The card number is invalid. Check the card details or use a different card."
|
1868 |
+
msgstr ""
|
1869 |
+
|
1870 |
+
#: includes/wc-stripe-functions.php:1056
|
1871 |
+
msgid ""
|
1872 |
+
"This value provided to the field contains characters that are unsupported by "
|
1873 |
+
"the field."
|
1874 |
+
msgstr ""
|
1875 |
+
|
1876 |
+
#: includes/wc-stripe-functions.php:1057
|
1877 |
+
msgid ""
|
1878 |
+
"The card's security code is invalid. Check the card's security code or use a "
|
1879 |
+
"different card."
|
1880 |
+
msgstr ""
|
1881 |
+
|
1882 |
+
#: includes/wc-stripe-functions.php:1058
|
1883 |
+
msgid ""
|
1884 |
+
"The card's expiration month is incorrect. Check the expiration date or use a "
|
1885 |
+
"different card."
|
1886 |
+
msgstr ""
|
1887 |
+
|
1888 |
+
#: includes/wc-stripe-functions.php:1059
|
1889 |
+
msgid ""
|
1890 |
+
"The card's expiration year is incorrect. Check the expiration date or use a "
|
1891 |
+
"different card."
|
1892 |
+
msgstr ""
|
1893 |
+
|
1894 |
+
#: includes/wc-stripe-functions.php:1061
|
1895 |
+
msgid ""
|
1896 |
+
"The card's address is incorrect. Check the card's address or use a different "
|
1897 |
+
"card."
|
1898 |
+
msgstr ""
|
1899 |
+
|
1900 |
+
#: includes/wc-stripe-functions.php:1062
|
1901 |
+
msgid ""
|
1902 |
+
"The card has expired. Check the expiration date or use a different card."
|
1903 |
+
msgstr ""
|
1904 |
+
|
1905 |
+
#: includes/wc-stripe-functions.php:1063
|
1906 |
+
msgid "The card has been declined."
|
1907 |
+
msgstr ""
|
1908 |
+
|
1909 |
+
#: includes/wc-stripe-functions.php:1064
|
1910 |
+
msgid "Your card's expiration year is in the past."
|
1911 |
+
msgstr ""
|
1912 |
+
|
1913 |
+
#: includes/wc-stripe-functions.php:1065
|
1914 |
+
msgid ""
|
1915 |
+
"The bank account number provided is invalid (e.g., missing digits). Bank "
|
1916 |
+
"account information varies from country to country. We recommend creating "
|
1917 |
+
"validations in your entry forms based on the bank account formats we provide."
|
1918 |
+
msgstr ""
|
1919 |
+
|
1920 |
+
#: includes/wc-stripe-functions.php:1066
|
1921 |
+
msgid ""
|
1922 |
+
"The specified amount is greater than the maximum amount allowed. Use a lower "
|
1923 |
+
"amount and try again."
|
1924 |
+
msgstr ""
|
1925 |
+
|
1926 |
+
#: includes/wc-stripe-functions.php:1067
|
1927 |
+
msgid ""
|
1928 |
+
"The specified amount is less than the minimum amount allowed. Use a higher "
|
1929 |
+
"amount and try again."
|
1930 |
+
msgstr ""
|
1931 |
+
|
1932 |
+
#: includes/wc-stripe-functions.php:1068
|
1933 |
+
msgid ""
|
1934 |
+
"The payment requires authentication to proceed. If your customer is off "
|
1935 |
+
"session, notify your customer to return to your application and complete the "
|
1936 |
+
"payment. If you provided the error_on_requires_action parameter, then your "
|
1937 |
+
"customer should try another card that does not require authentication."
|
1938 |
+
msgstr ""
|
1939 |
+
|
1940 |
+
#: includes/wc-stripe-functions.php:1069
|
1941 |
+
msgid ""
|
1942 |
+
"The transfer or payout could not be completed because the associated account "
|
1943 |
+
"does not have a sufficient balance available. Create a new transfer or "
|
1944 |
+
"payout using an amount less than or equal to the account's available balance."
|
1945 |
+
msgstr ""
|
1946 |
+
|
1947 |
+
#: includes/wc-stripe-functions.php:1070
|
1948 |
+
msgid ""
|
1949 |
+
"The bank account provided can not be used to charge, either because it is "
|
1950 |
+
"not verified yet or it is not supported."
|
1951 |
+
msgstr ""
|
1952 |
+
|
1953 |
+
#: includes/wc-stripe-functions.php:1071
|
1954 |
+
msgid ""
|
1955 |
+
"The bank account provided already exists on the specified Customer object. "
|
1956 |
+
"If the bank account should also be attached to a different customer, include "
|
1957 |
+
"the correct customer ID when making the request again."
|
1958 |
+
msgstr ""
|
1959 |
+
|
1960 |
+
#: includes/wc-stripe-functions.php:1072
|
1961 |
+
msgid ""
|
1962 |
+
"The bank account provided cannot be used for payouts. A different bank "
|
1963 |
+
"account must be used."
|
1964 |
+
msgstr ""
|
1965 |
+
|
1966 |
+
#: includes/wc-stripe-functions.php:1073
|
1967 |
+
msgid ""
|
1968 |
+
"Your Connect platform is attempting to share an unverified bank account with "
|
1969 |
+
"a connected account."
|
1970 |
+
msgstr ""
|
1971 |
+
|
1972 |
+
#: includes/wc-stripe-functions.php:1074
|
1973 |
+
msgid ""
|
1974 |
+
"The bank account cannot be verified, either because the microdeposit amounts "
|
1975 |
+
"provided do not match the actual amounts, or because verification has failed "
|
1976 |
+
"too many times."
|
1977 |
+
msgstr ""
|
1978 |
+
|
1979 |
+
#: includes/wc-stripe-functions.php:1075
|
1980 |
+
msgid ""
|
1981 |
+
"This card has been declined too many times. You can try to charge this card "
|
1982 |
+
"again after 24 hours. We suggest reaching out to your customer to make sure "
|
1983 |
+
"they have entered all of their information correctly and that there are no "
|
1984 |
+
"issues with their card."
|
1985 |
+
msgstr ""
|
1986 |
+
|
1987 |
+
#: includes/wc-stripe-functions.php:1076
|
1988 |
+
msgid ""
|
1989 |
+
"The charge you're attempting to capture has already been captured. Update "
|
1990 |
+
"the request with an uncaptured charge ID."
|
1991 |
+
msgstr ""
|
1992 |
+
|
1993 |
+
#: includes/wc-stripe-functions.php:1077
|
1994 |
+
msgid ""
|
1995 |
+
"The charge you're attempting to refund has already been refunded. Update the "
|
1996 |
+
"request to use the ID of a charge that has not been refunded."
|
1997 |
+
msgstr ""
|
1998 |
+
|
1999 |
+
#: includes/wc-stripe-functions.php:1078
|
2000 |
+
msgid ""
|
2001 |
+
"The charge you're attempting to refund has been charged back. Check the "
|
2002 |
+
"disputes documentation to learn how to respond to the dispute."
|
2003 |
+
msgstr ""
|
2004 |
+
|
2005 |
+
#: includes/wc-stripe-functions.php:1079
|
2006 |
+
msgid ""
|
2007 |
+
"This charge would cause you to exceed your rolling-window processing limit "
|
2008 |
+
"for this source type. Please retry the charge later, or contact us to "
|
2009 |
+
"request a higher processing limit."
|
2010 |
+
msgstr ""
|
2011 |
+
|
2012 |
+
#: includes/wc-stripe-functions.php:1080
|
2013 |
+
msgid ""
|
2014 |
+
"The charge cannot be captured as the authorization has expired. Auth and "
|
2015 |
+
"capture charges must be captured within seven days."
|
2016 |
+
msgstr ""
|
2017 |
+
|
2018 |
+
#: includes/wc-stripe-functions.php:1081
|
2019 |
+
msgid ""
|
2020 |
+
"One or more provided parameters was not allowed for the given operation on "
|
2021 |
+
"the Charge. Check our API reference or the returned error message to see "
|
2022 |
+
"which values were not correct for that Charge."
|
2023 |
+
msgstr ""
|
2024 |
+
|
2025 |
+
#: includes/wc-stripe-functions.php:1082
|
2026 |
+
msgid ""
|
2027 |
+
"The email address is invalid (e.g., not properly formatted). Check that the "
|
2028 |
+
"email address is properly formatted and only includes allowed characters."
|
2029 |
+
msgstr ""
|
2030 |
+
|
2031 |
+
#: includes/wc-stripe-functions.php:1083
|
2032 |
+
msgid ""
|
2033 |
+
"The idempotency key provided is currently being used in another request. "
|
2034 |
+
"This occurs if your integration is making duplicate requests simultaneously."
|
2035 |
+
msgstr ""
|
2036 |
+
|
2037 |
+
#: includes/wc-stripe-functions.php:1084
|
2038 |
+
msgid ""
|
2039 |
+
"The specified amount is invalid. The charge amount must be a positive "
|
2040 |
+
"integer in the smallest currency unit, and not exceed the minimum or maximum "
|
2041 |
+
"amount."
|
2042 |
+
msgstr ""
|
2043 |
+
|
2044 |
+
#: includes/wc-stripe-functions.php:1085
|
2045 |
+
msgid ""
|
2046 |
+
"The source cannot be used because it is not in the correct state (e.g., a "
|
2047 |
+
"charge request is trying to use a source with a pending, failed, or consumed "
|
2048 |
+
"source). Check the status of the source you are attempting to use."
|
2049 |
+
msgstr ""
|
2050 |
+
|
2051 |
+
#: includes/wc-stripe-functions.php:1086
|
2052 |
+
msgid ""
|
2053 |
+
"Both a customer and source ID have been provided, but the source has not "
|
2054 |
+
"been saved to the customer. To create a charge for a customer with a "
|
2055 |
+
"specified source, you must first save the card details."
|
2056 |
+
msgstr ""
|
2057 |
+
|
2058 |
+
#: includes/wc-stripe-functions.php:1087
|
2059 |
+
msgid "The ZIP code provided was incorrect."
|
2060 |
+
msgstr ""
|
2061 |
+
|
2062 |
+
#: includes/wc-stripe-functions.php:1088
|
2063 |
+
msgid ""
|
2064 |
+
"An error occurred while processing the card. Try again later or with a "
|
2065 |
+
"different payment method."
|
2066 |
+
msgstr ""
|
2067 |
+
|
2068 |
+
#: includes/wc-stripe-functions.php:1089
|
2069 |
+
msgid "The card does not support this type of purchase."
|
2070 |
+
msgstr ""
|
2071 |
+
|
2072 |
+
#: includes/wc-stripe-functions.php:1090 includes/wc-stripe-functions.php:1093
|
2073 |
+
#: includes/wc-stripe-functions.php:1095
|
2074 |
+
msgid "The card has been declined for an unknown reason."
|
2075 |
+
msgstr ""
|
2076 |
+
|
2077 |
+
#: includes/wc-stripe-functions.php:1091
|
2078 |
+
msgid ""
|
2079 |
+
"The customer has exceeded the balance or credit limit available on their "
|
2080 |
+
"card."
|
2081 |
+
msgstr ""
|
2082 |
+
|
2083 |
+
#: includes/wc-stripe-functions.php:1092
|
2084 |
+
msgid "The card does not support the specified currency."
|
2085 |
+
msgstr ""
|
2086 |
+
|
2087 |
+
#: includes/wc-stripe-functions.php:1094
|
2088 |
+
msgid "The payment has been declined as Stripe suspects it is fraudulent."
|
2089 |
+
msgstr ""
|
2090 |
+
|
2091 |
+
#: includes/wc-stripe-functions.php:1096
|
2092 |
+
msgid "The PIN entered is incorrect. "
|
2093 |
+
msgstr ""
|
2094 |
+
|
2095 |
+
#: includes/wc-stripe-functions.php:1097
|
2096 |
+
msgid "The card has insufficient funds to complete the purchase."
|
2097 |
+
msgstr ""
|
2098 |
+
|
2099 |
+
#: includes/wc-stripe-webhook-functions.php:80
|
2100 |
+
msgid "Charge.succeeded webhook received. Payment has been completed."
|
2101 |
msgstr ""
|
2102 |
|
2103 |
+
#: includes/wc-stripe-webhook-functions.php:117
|
2104 |
msgid "payment_intent.succeeded webhook recieved. Payment has been completed."
|
2105 |
msgstr ""
|
2106 |
|
2107 |
+
#: stripe-payments.php:17
|
2108 |
#, php-format
|
2109 |
msgid "Your PHP version is %s but Stripe requires version 5.4+."
|
2110 |
msgstr ""
|
includes/abstract/abstract-wc-payment-gateway-stripe-charge.php
DELETED
@@ -1,239 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (! class_exists ( 'WC_Payment_Gateway_Stripe' )) {
|
3 |
-
return;
|
4 |
-
}
|
5 |
-
/**
|
6 |
-
* Gateways that use Charge API should extend this abstract class.
|
7 |
-
*
|
8 |
-
* @package Stripe/Abstract
|
9 |
-
* @since 3.0.0
|
10 |
-
* @author User
|
11 |
-
*
|
12 |
-
*/
|
13 |
-
abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Stripe {
|
14 |
-
|
15 |
-
public function process_payment($order_id) {
|
16 |
-
$order = wc_get_order ( $order_id );
|
17 |
-
|
18 |
-
if ($this->is_change_payment_method_request ()) {
|
19 |
-
return [ 'result' => 'success',
|
20 |
-
'redirect' => $order->get_view_order_url ()
|
21 |
-
];
|
22 |
-
}
|
23 |
-
|
24 |
-
do_action ( 'wc_stripe_before_process_payment', $order, $this->id );
|
25 |
-
|
26 |
-
if (wc_notice_count ( 'error' ) > 0) {
|
27 |
-
return $this->order_error ();
|
28 |
-
}
|
29 |
-
$this->processing_payment = true;
|
30 |
-
|
31 |
-
if ($this->order_contains_pre_order ( $order ) && $this->pre_order_requires_tokenization ( $order )) {
|
32 |
-
return $this->process_pre_order ( $order );
|
33 |
-
}
|
34 |
-
|
35 |
-
// if order total is zero, then save meta but don't process payment.
|
36 |
-
if ($order->get_total () == 0) {
|
37 |
-
return $this->process_zero_total_order ( $order );
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Try to save the payment token.
|
42 |
-
* A failure should not affect the order processing. Tokens have to be saved before a charge since they
|
43 |
-
* can only be used once. Save the token then it can be used.
|
44 |
-
*/
|
45 |
-
if ($this->should_save_payment_method ( $order )) {
|
46 |
-
if (is_wp_error ( $this->save_payment_method ( $this->get_new_source_token (), $order ) )) {
|
47 |
-
$this->set_payment_save_error ( $order, $this->wp_error );
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Set a lock on the order so webhooks don't cause issues with payment processing.
|
53 |
-
*/
|
54 |
-
$this->set_order_lock ( $order );
|
55 |
-
|
56 |
-
$args = $this->get_order_charge_args ( $order );
|
57 |
-
|
58 |
-
$customer_id = wc_stripe_get_customer_id ( $order->get_user_id () );
|
59 |
-
|
60 |
-
// only add customer ID if user is paying with a saved payment method
|
61 |
-
if ($customer_id && $this->use_saved_source ()) {
|
62 |
-
$args[ 'customer' ] = $customer_id;
|
63 |
-
}
|
64 |
-
|
65 |
-
$charge = $this->gateway->charge ( $args, wc_stripe_order_mode ( $order ) );
|
66 |
-
|
67 |
-
wc_stripe_log_info ( 'Stripe charge: ' . print_r ( $charge, true ) );
|
68 |
-
if (is_wp_error ( $charge )) {
|
69 |
-
wc_add_notice ( sprintf ( __ ( 'Error processing payment. Reason: %s', 'woo-stripe-payment' ), $charge->get_error_message () ), 'error' );
|
70 |
-
$order->update_status ( 'failed' );
|
71 |
-
$order->add_order_note ( sprintf ( __ ( 'Error processing payment. Reason: %s. Code: %s', 'woo-stripe-payment' ), $charge->get_error_message (), $charge->get_error_code () ) );
|
72 |
-
return $this->order_error ();
|
73 |
-
}
|
74 |
-
|
75 |
-
$this->save_order_meta ( $order, $charge );
|
76 |
-
|
77 |
-
// pending status is for asynchronous payment methods
|
78 |
-
if ('pending' === $charge->status) {
|
79 |
-
$order->update_status ( apply_filters ( 'wc_stripe_pending_charge_status', 'on-hold', $order, $this ), sprintf ( __ ( 'Charge %s is pending. Payment Method: %s. Payment will be completed once charge.succeeded webhook received from Stripe.', 'woo-stripe-payment' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
|
80 |
-
} else {
|
81 |
-
if ($charge->captured) {
|
82 |
-
$order->payment_complete ( $charge->id );
|
83 |
-
} else {
|
84 |
-
$order_status = $this->get_option ( 'order_status' );
|
85 |
-
$order->update_status ( apply_filters ( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'processing' : $order_status, $order, $this ) );
|
86 |
-
}
|
87 |
-
$order->add_order_note ( sprintf ( __ ( 'Order charge successful in Stripe. Charge: %s. Payment Method: %s', 'woo-stripe-payment' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
|
88 |
-
}
|
89 |
-
|
90 |
-
$this->trigger_post_payment_processes ( $order, $this );
|
91 |
-
|
92 |
-
return array( 'result' => 'success',
|
93 |
-
'redirect' => $order->get_checkout_order_received_url ()
|
94 |
-
);
|
95 |
-
}
|
96 |
-
|
97 |
-
private function get_order_charge_args($order, $args = []) {
|
98 |
-
$args = array_merge ( [
|
99 |
-
'metadata' => $this->get_order_meta_data ( $order ),
|
100 |
-
'currency' => $order->get_currency (),
|
101 |
-
'amount' => wc_stripe_add_number_precision ( $order->get_total () ),
|
102 |
-
'shipping' => array(
|
103 |
-
'address' => array(
|
104 |
-
'city' => $order->get_shipping_city (),
|
105 |
-
'country' => $order->get_shipping_country (),
|
106 |
-
'line1' => $order->get_shipping_address_1 (),
|
107 |
-
'line2' => $order->get_shipping_address_2 (),
|
108 |
-
'postal_code' => $order->get_shipping_postcode (),
|
109 |
-
'state' => $order->get_shipping_state ()
|
110 |
-
),
|
111 |
-
'name' => $this->get_name_from_order ( $order, 'shipping' )
|
112 |
-
),
|
113 |
-
'capture' => $this->get_option ( 'charge_type' ) === 'capture',
|
114 |
-
'source' => $this->get_payment_source (),
|
115 |
-
'receipt_email' => $order->get_billing_email ()
|
116 |
-
], $args );
|
117 |
-
return apply_filters ( 'wc_stripe_charge_order_args', $args, $order, $this->id );
|
118 |
-
}
|
119 |
-
|
120 |
-
/**
|
121 |
-
*
|
122 |
-
* @param float $amount
|
123 |
-
* @param WC_Order $order
|
124 |
-
*/
|
125 |
-
public function capture_charge($amount, $order) {
|
126 |
-
$amount_in_cents = wc_stripe_add_number_precision ( $amount );
|
127 |
-
$result = $this->gateway->capture ( $order->get_transaction_id (), array(
|
128 |
-
'amount' => $amount_in_cents
|
129 |
-
), wc_stripe_order_mode ( $order ) );
|
130 |
-
if (! is_wp_error ( $result )) {
|
131 |
-
$order->payment_complete ();
|
132 |
-
$this->save_order_meta ( $order, $result );
|
133 |
-
$order->add_order_note ( sprintf ( __ ( 'Order amount captured in Stripe. Amount: %s', 'woo-stripe-payment' ), wc_price ( $amount, array(
|
134 |
-
'currency' => $order->get_currency ()
|
135 |
-
) ) ) );
|
136 |
-
} else {
|
137 |
-
$order->add_order_note ( sprintf ( __ ( 'Error capturing charge in Stripe. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ) );
|
138 |
-
}
|
139 |
-
return $result;
|
140 |
-
}
|
141 |
-
|
142 |
-
public function void_charge($order) {
|
143 |
-
$result = $this->gateway->refund ( array(
|
144 |
-
'charge' => $order->get_transaction_id ()
|
145 |
-
), wc_stripe_order_mode ( $order ) );
|
146 |
-
if (is_wp_error ( $result )) {
|
147 |
-
$order->add_order_note ( sprintf ( __ ( 'Error voiding charge. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ) );
|
148 |
-
} else {
|
149 |
-
$order->add_order_note ( __ ( 'Charge voided in Stripe.', 'woo-stripe-payment' ) );
|
150 |
-
}
|
151 |
-
return $result;
|
152 |
-
}
|
153 |
-
|
154 |
-
public function create_payment_method($id, $customer_id) {
|
155 |
-
$result = $this->gateway->create_customer_source ( $customer_id, $id );
|
156 |
-
|
157 |
-
if (is_wp_error ( $result )) {
|
158 |
-
return $result;
|
159 |
-
}
|
160 |
-
|
161 |
-
return $this->get_payment_token ( $result->id, $result );
|
162 |
-
}
|
163 |
-
|
164 |
-
public function scheduled_subscription_payment($amount, $order) {
|
165 |
-
$this->processing_payment = true;
|
166 |
-
|
167 |
-
$args = $this->get_order_charge_args ( $order, [
|
168 |
-
'customer' => $order->get_meta ( '_wc_stripe_customer', true ),
|
169 |
-
'source' => $order->get_meta ( '_payment_method_token', true ),
|
170 |
-
'amount' => wc_stripe_add_number_precision ( $amount )
|
171 |
-
] );
|
172 |
-
if (empty ( $args[ 'customer' ] )) {
|
173 |
-
unset ( $args[ 'customer' ] );
|
174 |
-
}
|
175 |
-
$charge = $this->gateway->charge ( $args, wc_stripe_order_mode ( $order ) );
|
176 |
-
|
177 |
-
if (is_wp_error ( $charge )) {
|
178 |
-
$order->update_status ( 'failed', sprintf ( __ ( 'Recurring payment for subscription failed. Reason: %s. Payment method: %s', 'woo-stripe-payment' ), $charge->get_error_message (), $order->get_payment_method_title () ) );
|
179 |
-
} else {
|
180 |
-
if ($charge->captured) {
|
181 |
-
$order->payment_complete ( $charge->id );
|
182 |
-
$order->add_order_note ( sprintf ( __ ( 'Recurring payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
|
183 |
-
} else {
|
184 |
-
$order->update_status ( apply_filters ( 'wc_stripe_authorized_renewal_order_status', 'processing', $order, $this ), sprintf ( __ ( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
|
185 |
-
}
|
186 |
-
$this->save_order_meta ( $order, $charge );
|
187 |
-
}
|
188 |
-
}
|
189 |
-
|
190 |
-
public function delete_payment_method($token_id, $token) {
|
191 |
-
$mode = $token->get_environment ();
|
192 |
-
try {
|
193 |
-
$customer_id = wc_stripe_get_customer_id ( $token->get_user_id (), $mode );
|
194 |
-
$this->gateway->delete_card ( $token->get_token (), $customer_id, $mode );
|
195 |
-
} catch ( \Stripe\Error\Base $e ) {
|
196 |
-
wc_stripe_log_error ( sprintf ( __ ( 'Error deleting Stripe card. Token Id: %s', 'woo-stripe-payment' ), $token->get_token () ) );
|
197 |
-
}
|
198 |
-
}
|
199 |
-
|
200 |
-
/**
|
201 |
-
*
|
202 |
-
* @param WC_Order $order
|
203 |
-
*/
|
204 |
-
public function process_pre_order_payment($order) {
|
205 |
-
$this->processing_payment = true;
|
206 |
-
|
207 |
-
$args = $this->get_order_charge_args ( $order, [
|
208 |
-
'customer' => wc_stripe_get_customer_id ( $order->get_customer_id (), wc_stripe_order_mode ( $order ) ),
|
209 |
-
'source' => $order->get_meta ( '_payment_method_token', true ),
|
210 |
-
'amount' => wc_stripe_add_number_precision ( $order->get_total () )
|
211 |
-
] );
|
212 |
-
if (empty ( $args[ 'customer' ] )) {
|
213 |
-
unset ( $args[ 'customer' ] );
|
214 |
-
}
|
215 |
-
$charge = $this->gateway->charge ( $args, wc_stripe_order_mode ( $order ) );
|
216 |
-
|
217 |
-
if (is_wp_error ( $charge )) {
|
218 |
-
$order->update_status ( 'failed', sprintf ( __ ( 'Pre-order payment for subscription failed. Reason: %s. Payment method: %s', 'woo-stripe-payment' ), $charge->get_error_message (), $order->get_payment_method_title () ) );
|
219 |
-
} else {
|
220 |
-
if ($charge->captured) {
|
221 |
-
$order->payment_complete ( $charge->id );
|
222 |
-
$order->add_order_note ( sprintf ( __ ( 'Pre-order payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
|
223 |
-
} else {
|
224 |
-
$order->update_status ( apply_filters ( 'wc_stripe_authorized_renewal_order_status', 'processing', $order, $this ), sprintf ( __ ( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
|
225 |
-
}
|
226 |
-
$this->save_order_meta ( $order, $charge );
|
227 |
-
}
|
228 |
-
}
|
229 |
-
|
230 |
-
/**
|
231 |
-
*
|
232 |
-
* {@inheritDoc}
|
233 |
-
*
|
234 |
-
* @see WC_Payment_Gateway_Stripe::get_payment_method_from_charge()
|
235 |
-
*/
|
236 |
-
public function get_payment_method_from_charge($charge) {
|
237 |
-
return $charge->source->id;
|
238 |
-
}
|
239 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe' )) {
|
3 |
return;
|
4 |
}
|
@@ -24,6 +26,8 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
24 |
|
25 |
public $countries = [];
|
26 |
|
|
|
|
|
27 |
public function __construct() {
|
28 |
$this->token_type = 'Stripe_Local';
|
29 |
$this->template_name = 'local-payment.php';
|
@@ -60,7 +64,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
60 |
* @param \Stripe\Source $source
|
61 |
* @param WC_Order $order
|
62 |
*/
|
63 |
-
|
64 |
return $source->redirect->url;
|
65 |
}
|
66 |
|
@@ -152,7 +156,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
152 |
*/
|
153 |
public function get_source_args($order) {
|
154 |
return [ 'type' => $this->local_payment_type,
|
155 |
-
'amount' => wc_stripe_add_number_precision ( $order->get_total () ),
|
156 |
'currency' => $order->get_currency (),
|
157 |
'statement_descriptor' => sprintf ( __ ( 'Order %s', 'woo-stripe-payment' ), $order->get_order_number () ),
|
158 |
'owner' => [
|
@@ -172,8 +176,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
172 |
*/
|
173 |
protected function get_local_payment_return_url($order) {
|
174 |
return add_query_arg ( [
|
175 |
-
'_payment_nonce' => wp_create_nonce ( 'local-payment
|
176 |
-
'order_id' => $order->get_id (),
|
177 |
'wc-stripe-local-gateway' => $this->id
|
178 |
], wc_get_checkout_url () );
|
179 |
}
|
@@ -207,4 +210,8 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
207 |
}
|
208 |
return $desc;
|
209 |
}
|
|
|
|
|
|
|
|
|
210 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe' )) {
|
5 |
return;
|
6 |
}
|
26 |
|
27 |
public $countries = [];
|
28 |
|
29 |
+
protected $local_payment_description = '';
|
30 |
+
|
31 |
public function __construct() {
|
32 |
$this->token_type = 'Stripe_Local';
|
33 |
$this->template_name = 'local-payment.php';
|
64 |
* @param \Stripe\Source $source
|
65 |
* @param WC_Order $order
|
66 |
*/
|
67 |
+
public function get_source_redirect_url($source, $order) {
|
68 |
return $source->redirect->url;
|
69 |
}
|
70 |
|
156 |
*/
|
157 |
public function get_source_args($order) {
|
158 |
return [ 'type' => $this->local_payment_type,
|
159 |
+
'amount' => wc_stripe_add_number_precision ( $order->get_total (), $order->get_currency () ),
|
160 |
'currency' => $order->get_currency (),
|
161 |
'statement_descriptor' => sprintf ( __ ( 'Order %s', 'woo-stripe-payment' ), $order->get_order_number () ),
|
162 |
'owner' => [
|
176 |
*/
|
177 |
protected function get_local_payment_return_url($order) {
|
178 |
return add_query_arg ( [
|
179 |
+
'_payment_nonce' => wp_create_nonce ( 'local-payment' ),
|
|
|
180 |
'wc-stripe-local-gateway' => $this->id
|
181 |
], wc_get_checkout_url () );
|
182 |
}
|
210 |
}
|
211 |
return $desc;
|
212 |
}
|
213 |
+
|
214 |
+
public function get_local_payment_description() {
|
215 |
+
return apply_filters ( 'wc_stripe_local_payment_description', $this->local_payment_description );
|
216 |
+
}
|
217 |
}
|
includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php
DELETED
@@ -1,361 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (! class_exists ( 'WC_Payment_Gateway_Stripe' )) {
|
3 |
-
return;
|
4 |
-
}
|
5 |
-
/**
|
6 |
-
* Gateways that use PaymentIntent API should extend this abstract class.
|
7 |
-
*
|
8 |
-
* @since 3.0.0
|
9 |
-
* @package Stripe/Abstract
|
10 |
-
* @author PaymentPlugins
|
11 |
-
*
|
12 |
-
*/
|
13 |
-
abstract class WC_Payment_Gateway_Stripe_Payment_Intent extends WC_Payment_Gateway_Stripe {
|
14 |
-
|
15 |
-
public function process_payment($order_id) {
|
16 |
-
$order = wc_get_order ( $order_id );
|
17 |
-
|
18 |
-
if ($this->is_change_payment_method_request ()) {
|
19 |
-
return [ 'result' => 'success',
|
20 |
-
'redirect' => $order->get_view_order_url ()
|
21 |
-
];
|
22 |
-
}
|
23 |
-
|
24 |
-
do_action ( 'wc_stripe_before_process_payment', $order, $this->id );
|
25 |
-
|
26 |
-
if (wc_notice_count ( 'error' ) > 0) {
|
27 |
-
return $this->order_error ();
|
28 |
-
}
|
29 |
-
$this->processing_payment = true;
|
30 |
-
|
31 |
-
if ($this->order_contains_pre_order ( $order ) && $this->pre_order_requires_tokenization ( $order )) {
|
32 |
-
return $this->process_pre_order ( $order );
|
33 |
-
}
|
34 |
-
|
35 |
-
// if order total is zero, then save meta but don't process payment.
|
36 |
-
if ($order->get_total () == 0) {
|
37 |
-
return $this->process_zero_total_order ( $order );
|
38 |
-
}
|
39 |
-
|
40 |
-
// first check to see if a payment intent already exists
|
41 |
-
if (( $intent_id = $order->get_meta ( '_payment_intent_id', true ) )) {
|
42 |
-
if ($this->can_update_payment_intent ( $order )) {
|
43 |
-
$intent = $this->gateway->update_payment_intent ( $intent_id, $this->get_payment_intent_args ( $order, false ) );
|
44 |
-
} else {
|
45 |
-
$intent = $this->gateway->fetch_payment_intent ( $intent_id );
|
46 |
-
}
|
47 |
-
} else {
|
48 |
-
$intent = $this->gateway->create_payment_intent ( $this->get_payment_intent_args ( $order ) );
|
49 |
-
}
|
50 |
-
|
51 |
-
if (is_wp_error ( $intent )) {
|
52 |
-
wc_add_notice ( $intent->get_error_message (), 'error' );
|
53 |
-
$order->update_status ( 'failed', sprintf ( __ ( 'Error processing payment. Reason: %s', 'woo-stripe-payment' ), $intent->get_error_message () ) );
|
54 |
-
return $this->order_error ();
|
55 |
-
}
|
56 |
-
|
57 |
-
// always update the order with the payment intent.
|
58 |
-
$order->update_meta_data ( '_payment_intent_id', $intent->id );
|
59 |
-
$order->update_meta_data ( '_payment_method_token', $intent->payment_method );
|
60 |
-
// serialize the the intent and save to the order. The intent will be used to analyze if anything
|
61 |
-
// has changed.
|
62 |
-
$order->update_meta_data ( '_payment_intent', $intent->jsonSerialize () );
|
63 |
-
$order->save ();
|
64 |
-
|
65 |
-
if ($intent->status === 'requires_confirmation') {
|
66 |
-
$intent = $this->gateway->confirm_payment_intent ( $intent );
|
67 |
-
if (is_wp_error ( $intent )) {
|
68 |
-
wc_add_notice ( $intent->get_error_message (), 'error' );
|
69 |
-
$order->update_status ( 'failed' );
|
70 |
-
// manually add note because if status is already failed then the note won't get included
|
71 |
-
$order->add_order_note ( sprintf ( __ ( 'Error processing payment. Reason: %s', 'woo-stripe-payment' ), $intent->get_error_message () ) );
|
72 |
-
return $this->order_error ();
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
// the intent was processed.
|
77 |
-
if ($intent->status === 'succeeded' || $intent->status === 'requires_capture') {
|
78 |
-
// payment has been processed.
|
79 |
-
$charges = $intent->charges;
|
80 |
-
if (count ( $charges->data ) > 0) {
|
81 |
-
$charge = $charges->data[ 0 ];
|
82 |
-
if ($charge->captured) {
|
83 |
-
$order->payment_complete ( $charge->id );
|
84 |
-
} else {
|
85 |
-
// update the order status since the intent has not been captured.
|
86 |
-
$order_status = $this->get_option ( 'order_status' );
|
87 |
-
$order->update_status ( apply_filters ( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'processing' : $order_status, $order, $this ) );
|
88 |
-
}
|
89 |
-
$this->save_order_meta ( $order, $charge );
|
90 |
-
$order->add_order_note ( sprintf ( __ ( 'Order %s successful in Stripe. Charge: %s. Payment Method: %s', 'woo-stripe-payment' ), $charge->captured ? __ ( 'charge', 'woo-stripe-payment' ) : __ ( 'authorization', 'woo-stripe-payment' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Save the payment method if appropriate.
|
95 |
-
* We wait until the end of order processing because a failed payment method save
|
96 |
-
* should not halt the order process. Customer's can always take action after a failed save,
|
97 |
-
* like going to the Add Payment method page.
|
98 |
-
*/
|
99 |
-
if ($this->should_save_payment_method ( $order )) {
|
100 |
-
if (is_wp_error ( $this->save_payment_method ( $intent->payment_method, $order ) )) {
|
101 |
-
$this->set_payment_save_error ( $order, $this->wp_error );
|
102 |
-
}
|
103 |
-
}
|
104 |
-
$this->trigger_post_payment_processes ( $order, $this );
|
105 |
-
|
106 |
-
return array( 'result' => 'success',
|
107 |
-
'redirect' => $order->get_checkout_order_received_url ()
|
108 |
-
);
|
109 |
-
}
|
110 |
-
if ($intent->status === 'requires_source_action' || $intent->status === 'requires_action') {
|
111 |
-
// 3DS actions are required. Need to have customer complete action.
|
112 |
-
$url = $this->get_payment_intent_checkout_url ( $intent->client_secret );
|
113 |
-
return array( 'result' => 'success',
|
114 |
-
'redirect' => $url
|
115 |
-
);
|
116 |
-
}
|
117 |
-
if ($intent->status === 'requires_source' || $intent->status === 'requires_payment_method') {
|
118 |
-
wc_add_notice ( __ ( 'A new payment method is required.', 'woo-stripe-payment' ), 'error' );
|
119 |
-
return $this->order_error ();
|
120 |
-
}
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
*
|
125 |
-
* @param WC_Order $order
|
126 |
-
*/
|
127 |
-
public function get_payment_intent_args($order, $new = true) {
|
128 |
-
$args = [
|
129 |
-
'amount' => wc_stripe_add_number_precision ( $order->get_total () ),
|
130 |
-
'currency' => $order->get_currency (),
|
131 |
-
'metadata' => $this->get_order_meta_data ( $order ),
|
132 |
-
'description' => $this->get_order_description ( $order ),
|
133 |
-
'shipping' => wc_stripe_order_has_shipping_address ( $order ) ? [
|
134 |
-
'address' => [
|
135 |
-
'city' => $order->get_shipping_city (),
|
136 |
-
'country' => $order->get_shipping_country (),
|
137 |
-
'line1' => $order->get_shipping_address_1 (),
|
138 |
-
'line2' => $order->get_shipping_address_2 (),
|
139 |
-
'postal_code' => $order->get_shipping_postcode (),
|
140 |
-
'state' => $order->get_shipping_state ()
|
141 |
-
],
|
142 |
-
'name' => $this->get_name_from_order ( $order, 'shipping' )
|
143 |
-
] : []
|
144 |
-
];
|
145 |
-
if ($new) {
|
146 |
-
$args = array_merge ( $args, [
|
147 |
-
'confirmation_method' => 'manual',
|
148 |
-
'capture_method' => $this->get_option ( 'charge_type' ) === 'capture' ? 'automatic' : 'manual',
|
149 |
-
'confirm' => false
|
150 |
-
] );
|
151 |
-
}
|
152 |
-
if ($order->get_meta ( '_payment_method_token', true ) !== $this->get_payment_method_from_request ()) {
|
153 |
-
$args[ 'payment_method' ] = $this->get_payment_method_from_request ();
|
154 |
-
}
|
155 |
-
if (( $customer_id = wc_stripe_get_customer_id ( $order->get_customer_id () ) )) {
|
156 |
-
$args[ 'customer' ] = $customer_id;
|
157 |
-
}
|
158 |
-
if ($this->should_save_payment_method ( $order )) {
|
159 |
-
$args[ 'setup_future_usage' ] = 'off_session';
|
160 |
-
}
|
161 |
-
return apply_filters ( 'wc_stripe_payment_intent_args', $args, $order, $this );
|
162 |
-
}
|
163 |
-
|
164 |
-
protected function get_payment_intent_checkout_url($secret) {
|
165 |
-
// rand is used to generate some random entropy so that window hash events are triggered.
|
166 |
-
return sprintf ( '#payment-intent=%s:%s', $secret, rand ( 0, 999999 ) );
|
167 |
-
}
|
168 |
-
|
169 |
-
public function create_payment_method($id, $customer_id) {
|
170 |
-
// fetch the payment method from Stripe.
|
171 |
-
$payment_method = $this->gateway->fetch_payment_method ( $id );
|
172 |
-
|
173 |
-
if (is_wp_error ( $payment_method )) {
|
174 |
-
return $payment_method;
|
175 |
-
}
|
176 |
-
|
177 |
-
$payment_method = $this->gateway->attach_payment_method ( $payment_method, [
|
178 |
-
'customer' => $customer_id
|
179 |
-
] );
|
180 |
-
|
181 |
-
if (is_wp_error ( $payment_method )) {
|
182 |
-
return $payment_method;
|
183 |
-
}
|
184 |
-
|
185 |
-
return $this->get_payment_token ( $id, $payment_method );
|
186 |
-
}
|
187 |
-
|
188 |
-
public function capture_charge($amount, $order) {
|
189 |
-
$amount_in_cents = wc_stripe_add_number_precision ( $amount );
|
190 |
-
$payment_intent = $order->get_meta ( '_payment_intent_id', true );
|
191 |
-
// if the intent was not saved before, then fetch it from the charge and save it to the order.
|
192 |
-
if (empty ( $payment_intent )) {
|
193 |
-
$charge = $this->retrieve_charge ( $order->get_transaction_id (), wc_stripe_order_mode ( $order ) );
|
194 |
-
$payment_intent = $charge->payment_intent;
|
195 |
-
$order->update_meta_data ( '_payment_intent_id', $payment_intent );
|
196 |
-
$order->save ();
|
197 |
-
}
|
198 |
-
$result = $this->gateway->capture_payment_intent ( $payment_intent, array(
|
199 |
-
'amount_to_capture' => $amount_in_cents
|
200 |
-
), wc_stripe_order_mode ( $order ) );
|
201 |
-
if (! is_wp_error ( $result )) {
|
202 |
-
$order->payment_complete ();
|
203 |
-
$order->add_order_note ( sprintf ( __ ( 'Order amount captured in Stripe. Amount: %s', 'woo-stripe-payment' ), wc_price ( $amount, array(
|
204 |
-
'currency' => $order->get_currency ()
|
205 |
-
) ) ) );
|
206 |
-
} else {
|
207 |
-
$order->add_order_note ( sprintf ( __ ( 'Error capturing charge in Stripe. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ) );
|
208 |
-
}
|
209 |
-
return $result;
|
210 |
-
}
|
211 |
-
|
212 |
-
public function void_charge($order) {
|
213 |
-
// fetch the intent and check its status
|
214 |
-
$payment_intent = $this->gateway->fetch_payment_intent ( $order->get_meta ( '_payment_intent_id', true ), wc_stripe_order_mode ( $order ) );
|
215 |
-
if (is_wp_error ( $payment_intent )) {
|
216 |
-
return;
|
217 |
-
}
|
218 |
-
$statuses = array( 'requires_payment_method',
|
219 |
-
'requires_capture', 'requires_confirmation',
|
220 |
-
'requires_action'
|
221 |
-
);
|
222 |
-
if ('canceled' !== $payment_intent->status) {
|
223 |
-
if (in_array ( $payment_intent->status, $statuses )) {
|
224 |
-
$result = $this->gateway->cancel_payment_intent ( $payment_intent, wc_stripe_order_mode ( $order ) );
|
225 |
-
if (is_wp_error ( $result )) {
|
226 |
-
$order->add_order_note ( sprintf ( __ ( 'Error voiding charge. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ) );
|
227 |
-
} else {
|
228 |
-
$order->add_order_note ( __ ( 'Charge voided in Stripe.', 'woo-stripe-payment' ) );
|
229 |
-
}
|
230 |
-
} elseif ('succeeded' === $payment_intent->status) {
|
231 |
-
$this->process_refund ( $order->get_id (), $order->get_total () );
|
232 |
-
}
|
233 |
-
}
|
234 |
-
}
|
235 |
-
|
236 |
-
/**
|
237 |
-
*
|
238 |
-
* {@inheritDoc}
|
239 |
-
*
|
240 |
-
* @see WC_Payment_Gateway_Stripe::scheduled_subscription_payment()
|
241 |
-
*/
|
242 |
-
public function scheduled_subscription_payment($amount, $order) {
|
243 |
-
$this->processing_payment = true;
|
244 |
-
|
245 |
-
$args = array_merge ( $this->get_payment_intent_args ( $order ), [
|
246 |
-
'amount' => wc_stripe_add_number_precision ( $amount ),
|
247 |
-
'payment_method' => $order->get_meta ( '_payment_method_token', true ),
|
248 |
-
'customer' => $order->get_meta ( '_wc_stripe_customer', true ),
|
249 |
-
'confirm' => true, 'off_session' => true
|
250 |
-
] );
|
251 |
-
if (empty ( $args[ 'customer' ] )) {
|
252 |
-
unset ( $args[ 'customer' ] );
|
253 |
-
}
|
254 |
-
$intent = $this->gateway->create_payment_intent ( $args, wc_stripe_order_mode ( $order ) );
|
255 |
-
|
256 |
-
if (is_wp_error ( $intent )) {
|
257 |
-
// payment intent failed
|
258 |
-
$order->update_status ( 'failed', sprintf ( __ ( 'Recurring payment for order failed. Reason: %s', 'woo-stripe-payment' ), $intent->get_error_message () ) );
|
259 |
-
} else {
|
260 |
-
if ($intent->status === 'succeeded' || $intent->status === 'requires_capture') {
|
261 |
-
$charges = $intent->charges->data;
|
262 |
-
if (isset ( $charges[ 0 ] )) {
|
263 |
-
$charge = $charges[ 0 ];
|
264 |
-
|
265 |
-
$order->update_meta_data ( '_payment_intent_id', $intent->id );
|
266 |
-
$order->save ();
|
267 |
-
$this->save_order_meta ( $order, $charge );
|
268 |
-
|
269 |
-
if ($charge->captured) {
|
270 |
-
$order->payment_complete ( $charge->id );
|
271 |
-
$order->add_order_note ( sprintf ( __ ( 'Recurring payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
|
272 |
-
} else {
|
273 |
-
$order->update_status ( apply_filters ( 'wc_stripe_authorized_renewal_order_status', 'processing', $order, $this ), sprintf ( __ ( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
|
274 |
-
}
|
275 |
-
}
|
276 |
-
} else {
|
277 |
-
$order->update_status ( 'pending', sprintf ( __ ( 'Customer must manually complete payment for payment method %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
|
278 |
-
}
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
-
/**
|
283 |
-
* Compares the order's saved intent to the order's updates attributes.
|
284 |
-
* If there is a delta, then the payment intent can be updated.
|
285 |
-
*
|
286 |
-
* @param WC_Order $order
|
287 |
-
*/
|
288 |
-
public function can_update_payment_intent($order) {
|
289 |
-
$intent = $order->get_meta ( '_payment_intent', true );
|
290 |
-
if ($intent) {
|
291 |
-
$order_hash = sprintf ( '%s_%s_%s', wc_stripe_add_number_precision ( $order->get_total () ), wc_stripe_get_customer_id ( $order->get_user_id () ), $this->get_payment_method_from_request () );
|
292 |
-
$intent_hash = sprintf ( '%s_%s_%s', $intent[ 'amount' ], $intent[ 'customer' ], $intent[ 'payment_method' ] );
|
293 |
-
return $order_hash !== $intent_hash;
|
294 |
-
}
|
295 |
-
return false;
|
296 |
-
}
|
297 |
-
|
298 |
-
public function delete_payment_method($token_id, $token) {
|
299 |
-
$mode = $token->get_environment ();
|
300 |
-
try {
|
301 |
-
$customer_id = wc_stripe_get_customer_id ( $token->get_user_id (), $mode );
|
302 |
-
$payment_method = $this->gateway->fetch_payment_method ( $token->get_token () );
|
303 |
-
$this->gateway->delete_payment_method ( $payment_method );
|
304 |
-
} catch ( \Stripe\Error\Base $e ) {
|
305 |
-
wc_stripe_log_error ( sprintf ( __ ( 'Error deleting Stripe card. Token Id: %s', 'woo-stripe-payment' ), $token->get_token () ) );
|
306 |
-
}
|
307 |
-
}
|
308 |
-
|
309 |
-
/**
|
310 |
-
*
|
311 |
-
* @param WC_Order $order
|
312 |
-
*/
|
313 |
-
public function process_pre_order_payment($order) {
|
314 |
-
$this->processing_payment = true;
|
315 |
-
|
316 |
-
$args = array_merge ( $this->get_payment_intent_args ( $order ), [
|
317 |
-
'amount' => wc_stripe_add_number_precision ( $order->get_total () ),
|
318 |
-
'payment_method' => $order->get_meta ( '_payment_method_token', true ),
|
319 |
-
'confirm' => true, 'off_session' => true
|
320 |
-
] );
|
321 |
-
if (empty ( $args[ 'customer' ] )) {
|
322 |
-
unset ( $args[ 'customer' ] );
|
323 |
-
}
|
324 |
-
$intent = $this->gateway->create_payment_intent ( $args, wc_stripe_order_mode ( $order ) );
|
325 |
-
|
326 |
-
if (is_wp_error ( $intent )) {
|
327 |
-
// payment intent failed
|
328 |
-
$order->update_status ( 'failed', sprintf ( __ ( 'Pre-order payment for order failed. Reason: %s', 'woo-stripe-payment' ), $intent->get_error_message () ) );
|
329 |
-
} else {
|
330 |
-
if ($intent->status === 'succeeded' || $intent->status === 'requires_capture') {
|
331 |
-
$charges = $intent->charges->data;
|
332 |
-
if (isset ( $charges[ 0 ] )) {
|
333 |
-
$charge = $charges[ 0 ];
|
334 |
-
|
335 |
-
$order->update_meta_data ( '_payment_intent_id', $intent->id );
|
336 |
-
$order->save ();
|
337 |
-
$this->save_order_meta ( $order, $charge );
|
338 |
-
|
339 |
-
if ($charge->captured) {
|
340 |
-
$order->payment_complete ( $charge->id );
|
341 |
-
$order->add_order_note ( sprintf ( __ ( 'Pre-order payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
|
342 |
-
} else {
|
343 |
-
$order->update_status ( apply_filters ( 'wc_stripe_authorized_renewal_order_status', 'processing', $order, $this ), sprintf ( __ ( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
|
344 |
-
}
|
345 |
-
}
|
346 |
-
} else {
|
347 |
-
$order->update_status ( 'pending', sprintf ( __ ( 'Customer must manually complete payment for payment method %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
|
348 |
-
}
|
349 |
-
}
|
350 |
-
}
|
351 |
-
|
352 |
-
/**
|
353 |
-
*
|
354 |
-
* {@inheritDoc}
|
355 |
-
*
|
356 |
-
* @see WC_Payment_Gateway_Stripe::get_payment_method_from_charge()
|
357 |
-
*/
|
358 |
-
public function get_payment_method_from_charge($charge) {
|
359 |
-
return $charge->payment_method;
|
360 |
-
}
|
361 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/abstract/abstract-wc-payment-gateway-stripe.php
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway' )) {
|
3 |
return;
|
4 |
}
|
5 |
|
6 |
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-payment-intent.php' );
|
7 |
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-payment-charge.php' );
|
|
|
8 |
|
9 |
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/traits/wc-stripe-payment-traits.php' );
|
10 |
|
@@ -330,7 +333,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
330 |
$result = $this->payment_object->process_payment ( $order, $this );
|
331 |
|
332 |
if (is_wp_error ( $result )) {
|
333 |
-
wc_add_notice ( $result->get_error_message (), 'error' );
|
334 |
$order->update_status ( 'failed', sprintf ( __ ( 'Error processing payment. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ) );
|
335 |
return $this->get_order_error ();
|
336 |
}
|
@@ -485,7 +488,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
485 |
*/
|
486 |
public function process_refund($order_id, $amount = null, $reason = '') {
|
487 |
$order = wc_get_order ( $order_id );
|
488 |
-
$result = $this->payment_object->process_refund ( $order, $amount
|
489 |
|
490 |
if (! is_wp_error ( $result )) {
|
491 |
$order->add_order_note ( sprintf ( __ ( 'Order refunded in Stripe. Amount: %s', 'woo-stripe-payment' ), wc_price ( $amount, array(
|
@@ -534,6 +537,10 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
534 |
* @param WC_Order $order
|
535 |
*/
|
536 |
public function void_charge($order) {
|
|
|
|
|
|
|
|
|
537 |
$result = $this->payment_object->void_charge ( $order );
|
538 |
|
539 |
if (is_wp_error ( $result )) {
|
@@ -585,7 +592,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
585 |
*/
|
586 |
public function get_order_error() {
|
587 |
wc_stripe_set_checkout_error ();
|
588 |
-
return array(
|
|
|
589 |
);
|
590 |
}
|
591 |
|
@@ -988,6 +996,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
988 |
wc_add_notice ( sprintf ( __ ( 'Error saving payment method for subscription. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ), 'error' );
|
989 |
// redirect to change payment method page.
|
990 |
wp_safe_redirect ( $subscription->get_view_order_url () );
|
|
|
991 |
}
|
992 |
} else {
|
993 |
// set the payment method token so it can be used downstream.
|
@@ -1143,7 +1152,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1143 |
* @param WC_Order|int $order
|
1144 |
*/
|
1145 |
public function set_order_lock($order) {
|
1146 |
-
|
|
|
1147 |
}
|
1148 |
|
1149 |
/**
|
@@ -1152,7 +1162,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1152 |
* @param WC_Order|int $order
|
1153 |
*/
|
1154 |
public function release_order_lock($order) {
|
1155 |
-
delete_transient ( '
|
1156 |
}
|
1157 |
|
1158 |
/**
|
@@ -1163,8 +1173,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1163 |
* @param WC_Order|int $order
|
1164 |
*/
|
1165 |
public function has_order_lock($order) {
|
1166 |
-
$lock = get_transient ( '
|
1167 |
-
return $lock
|
1168 |
}
|
1169 |
|
1170 |
public function set_post_payment_process($callback) {
|
@@ -1235,15 +1245,18 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1235 |
$keys = [];
|
1236 |
switch ($meta_key) {
|
1237 |
case WC_Stripe_Constants::PAYMENT_METHOD_TOKEN :
|
1238 |
-
$keys = [
|
|
|
1239 |
];
|
1240 |
break;
|
1241 |
case WC_Stripe_Constants::CUSTOMER_ID :
|
1242 |
-
$keys = [
|
|
|
1243 |
];
|
1244 |
break;
|
1245 |
case WC_Stripe_Constants::PAYMENT_INTENT_ID :
|
1246 |
-
$keys = [
|
|
|
1247 |
];
|
1248 |
}
|
1249 |
if ($keys) {
|
@@ -1261,4 +1274,26 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1261 |
|
1262 |
return $value;
|
1263 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1264 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway' )) {
|
5 |
return;
|
6 |
}
|
7 |
|
8 |
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-payment-intent.php' );
|
9 |
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-payment-charge.php' );
|
10 |
+
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-payment-charge-local.php' );
|
11 |
|
12 |
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/traits/wc-stripe-payment-traits.php' );
|
13 |
|
333 |
$result = $this->payment_object->process_payment ( $order, $this );
|
334 |
|
335 |
if (is_wp_error ( $result )) {
|
336 |
+
wc_add_notice ( $this->is_active ( 'generic_error' ) ? $this->get_generic_error ( $result ) : $result->get_error_message (), 'error' );
|
337 |
$order->update_status ( 'failed', sprintf ( __ ( 'Error processing payment. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ) );
|
338 |
return $this->get_order_error ();
|
339 |
}
|
488 |
*/
|
489 |
public function process_refund($order_id, $amount = null, $reason = '') {
|
490 |
$order = wc_get_order ( $order_id );
|
491 |
+
$result = $this->payment_object->process_refund ( $order, $amount );
|
492 |
|
493 |
if (! is_wp_error ( $result )) {
|
494 |
$order->add_order_note ( sprintf ( __ ( 'Order refunded in Stripe. Amount: %s', 'woo-stripe-payment' ), wc_price ( $amount, array(
|
537 |
* @param WC_Order $order
|
538 |
*/
|
539 |
public function void_charge($order) {
|
540 |
+
// @3.1.1 - check added so errors aren't encountered if the order can't be voided
|
541 |
+
if (! $this->payment_object->can_void_order ( $order )) {
|
542 |
+
return;
|
543 |
+
}
|
544 |
$result = $this->payment_object->void_charge ( $order );
|
545 |
|
546 |
if (is_wp_error ( $result )) {
|
592 |
*/
|
593 |
public function get_order_error() {
|
594 |
wc_stripe_set_checkout_error ();
|
595 |
+
return array(
|
596 |
+
'result' => WC_Stripe_Constants::FAILURE
|
597 |
);
|
598 |
}
|
599 |
|
996 |
wc_add_notice ( sprintf ( __ ( 'Error saving payment method for subscription. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ), 'error' );
|
997 |
// redirect to change payment method page.
|
998 |
wp_safe_redirect ( $subscription->get_view_order_url () );
|
999 |
+
exit ();
|
1000 |
}
|
1001 |
} else {
|
1002 |
// set the payment method token so it can be used downstream.
|
1152 |
* @param WC_Order|int $order
|
1153 |
*/
|
1154 |
public function set_order_lock($order) {
|
1155 |
+
$order_id = ( is_object ( $order ) ? $order->get_id () : $order );
|
1156 |
+
set_transient ( 'stripe_lock_order_' . $order_id, $order_id, apply_filters ( 'wc_stripe_set_order_lock', 2 * MINUTE_IN_SECONDS ) );
|
1157 |
}
|
1158 |
|
1159 |
/**
|
1162 |
* @param WC_Order|int $order
|
1163 |
*/
|
1164 |
public function release_order_lock($order) {
|
1165 |
+
delete_transient ( 'stripe_lock_order_' . ( is_object ( $order ) ? $order->get_id () : $order ) );
|
1166 |
}
|
1167 |
|
1168 |
/**
|
1173 |
* @param WC_Order|int $order
|
1174 |
*/
|
1175 |
public function has_order_lock($order) {
|
1176 |
+
$lock = get_transient ( 'stripe_lock_order_' . ( is_object ( $order ) ? $order->get_id () : $order ) );
|
1177 |
+
return $lock !== false;
|
1178 |
}
|
1179 |
|
1180 |
public function set_post_payment_process($callback) {
|
1245 |
$keys = [];
|
1246 |
switch ($meta_key) {
|
1247 |
case WC_Stripe_Constants::PAYMENT_METHOD_TOKEN :
|
1248 |
+
$keys = [
|
1249 |
+
WC_Stripe_Constants::SOURCE_ID
|
1250 |
];
|
1251 |
break;
|
1252 |
case WC_Stripe_Constants::CUSTOMER_ID :
|
1253 |
+
$keys = [
|
1254 |
+
WC_Stripe_Constants::STRIPE_CUSTOMER_ID
|
1255 |
];
|
1256 |
break;
|
1257 |
case WC_Stripe_Constants::PAYMENT_INTENT_ID :
|
1258 |
+
$keys = [
|
1259 |
+
WC_Stripe_Constants::STRIPE_INTENT_ID
|
1260 |
];
|
1261 |
}
|
1262 |
if ($keys) {
|
1274 |
|
1275 |
return $value;
|
1276 |
}
|
1277 |
+
|
1278 |
+
/**
|
1279 |
+
* Gateways can override this method to add attributes to the Stripe object before it's
|
1280 |
+
* sent to Stripe.
|
1281 |
+
*
|
1282 |
+
* @param array $args
|
1283 |
+
* @param WC_Order $order
|
1284 |
+
*/
|
1285 |
+
public function add_stripe_order_args(&$args, $order) {}
|
1286 |
+
|
1287 |
+
/**
|
1288 |
+
*
|
1289 |
+
* @since 3.1.1
|
1290 |
+
* @param WP_Error $result
|
1291 |
+
*/
|
1292 |
+
public function get_generic_error($result = null) {
|
1293 |
+
$messages = wc_stripe_get_error_messages ();
|
1294 |
+
if (isset ( $messages[ "{$this->id}_generic" ] )) {
|
1295 |
+
return $messages[ "{$this->id}_generic" ];
|
1296 |
+
}
|
1297 |
+
return null != $result ? $result->get_error_message () : __ ( 'Cannot process payment', 'woo-stripe-payment' );
|
1298 |
+
}
|
1299 |
}
|
includes/abstract/abstract-wc-payment-token-stripe.php
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
}
|
5 |
/**
|
6 |
*
|
7 |
* @since 3.0.0
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
|
|
4 |
/**
|
5 |
*
|
6 |
* @since 3.0.0
|
includes/abstract/abstract-wc-stripe-payment.php
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
* @author PaymentPlugins
|
5 |
* @since 3.1.0
|
6 |
-
*
|
7 |
*/
|
8 |
abstract class WC_Stripe_Payment {
|
9 |
|
@@ -80,15 +82,21 @@ abstract class WC_Stripe_Payment {
|
|
80 |
*/
|
81 |
public abstract function process_pre_order_payment($order);
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
/**
|
84 |
*
|
85 |
* @param WC_Order $order
|
86 |
* @param float $amount
|
87 |
-
* @param string $reason
|
88 |
* @throws Exception
|
89 |
*/
|
90 |
-
public function process_refund($order, $amount = null
|
91 |
-
$amount_in_cents = wc_stripe_add_number_precision ( $amount );
|
92 |
$charge = $order->get_transaction_id ();
|
93 |
try {
|
94 |
if (empty ( $charge )) {
|
@@ -145,7 +153,8 @@ abstract class WC_Stripe_Payment {
|
|
145 |
'customer_id' => wc_stripe_get_customer_id ( $order->get_user_id () ),
|
146 |
'ip_address' => $order->get_customer_ip_address (),
|
147 |
'user_agent' => isset ( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? $_SERVER[ 'HTTP_USER_AGENT' ] : 'unavailable',
|
148 |
-
'partner' => 'PaymentPlugins'
|
|
|
149 |
];
|
150 |
foreach ( $order->get_items ( 'line_item' ) as $item ) {
|
151 |
/**
|
@@ -173,7 +182,7 @@ abstract class WC_Stripe_Payment {
|
|
173 |
* @param float $amount
|
174 |
*/
|
175 |
public function add_order_amount(&$args, $order, $amount = null) {
|
176 |
-
$args[ 'amount' ] = wc_stripe_add_number_precision ( $amount ? $amount : $order->get_total () );
|
177 |
}
|
178 |
|
179 |
/**
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @author PaymentPlugins
|
7 |
* @since 3.1.0
|
8 |
+
*
|
9 |
*/
|
10 |
abstract class WC_Stripe_Payment {
|
11 |
|
82 |
*/
|
83 |
public abstract function process_pre_order_payment($order);
|
84 |
|
85 |
+
/**
|
86 |
+
* Return true if the charge can be voided.
|
87 |
+
*
|
88 |
+
* @param WC_Order $order
|
89 |
+
*/
|
90 |
+
public abstract function can_void_order($order);
|
91 |
+
|
92 |
/**
|
93 |
*
|
94 |
* @param WC_Order $order
|
95 |
* @param float $amount
|
|
|
96 |
* @throws Exception
|
97 |
*/
|
98 |
+
public function process_refund($order, $amount = null) {
|
99 |
+
$amount_in_cents = wc_stripe_add_number_precision ( $amount, $order->get_currency () );
|
100 |
$charge = $order->get_transaction_id ();
|
101 |
try {
|
102 |
if (empty ( $charge )) {
|
153 |
'customer_id' => wc_stripe_get_customer_id ( $order->get_user_id () ),
|
154 |
'ip_address' => $order->get_customer_ip_address (),
|
155 |
'user_agent' => isset ( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? $_SERVER[ 'HTTP_USER_AGENT' ] : 'unavailable',
|
156 |
+
'partner' => 'PaymentPlugins',
|
157 |
+
'created' => time ()
|
158 |
];
|
159 |
foreach ( $order->get_items ( 'line_item' ) as $item ) {
|
160 |
/**
|
182 |
* @param float $amount
|
183 |
*/
|
184 |
public function add_order_amount(&$args, $order, $amount = null) {
|
185 |
+
$args[ 'amount' ] = wc_stripe_add_number_precision ( $amount ? $amount : $order->get_total (), $order->get_currency () );
|
186 |
}
|
187 |
|
188 |
/**
|
includes/abstract/abstract-wc-stripe-rest-controller.php
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
* @author PaymentPlugins
|
5 |
* @package Stripe/Abstract
|
6 |
-
*
|
7 |
*/
|
8 |
abstract class WC_Stripe_Rest_Controller {
|
9 |
|
@@ -83,7 +85,7 @@ abstract class WC_Stripe_Rest_Controller {
|
|
83 |
|
84 |
/**
|
85 |
* Allows a status code of 200 to be returned even if there is a validation error.
|
86 |
-
*
|
87 |
* @param WP_Error $error
|
88 |
*/
|
89 |
protected function add_validation_error($error) {
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @author PaymentPlugins
|
7 |
* @package Stripe/Abstract
|
8 |
+
*
|
9 |
*/
|
10 |
abstract class WC_Stripe_Rest_Controller {
|
11 |
|
85 |
|
86 |
/**
|
87 |
* Allows a status code of 200 to be returned even if there is a validation error.
|
88 |
+
*
|
89 |
* @param WP_Error $error
|
90 |
*/
|
91 |
protected function add_validation_error($error) {
|
includes/abstract/abstract-wc-stripe-settings.php
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
* @author PaymentPlugins
|
5 |
* @package Stripe/Abstract
|
6 |
-
*
|
7 |
*/
|
8 |
abstract class WC_Stripe_Settings_API extends WC_Settings_API {
|
9 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @author PaymentPlugins
|
7 |
* @package Stripe/Abstract
|
8 |
+
*
|
9 |
*/
|
10 |
abstract class WC_Stripe_Settings_API extends WC_Settings_API {
|
11 |
|
includes/admin/class-wc-stripe-admin-assets.php
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
|
|
4 |
*/
|
5 |
class WC_Stripe_Admin_Assets {
|
6 |
|
@@ -63,7 +66,7 @@ class WC_Stripe_Admin_Assets {
|
|
63 |
public static function localize_scripts() {
|
64 |
global $current_section, $wc_stripe_subsection;
|
65 |
if (! empty ( $current_section )) {
|
66 |
-
$wc_stripe_subsection = isset ( $_GET[ 'sub_section' ] ) ? sanitize_title ( $_GET[ 'sub_section' ] ) : '
|
67 |
do_action ( 'wc_stripe_localize_' . $current_section . '_settings' );
|
68 |
// added for WC 3.0.0 compatability.
|
69 |
remove_action ( 'admin_footer', array(
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
+
* @package Stripe/Admin
|
7 |
*/
|
8 |
class WC_Stripe_Admin_Assets {
|
9 |
|
66 |
public static function localize_scripts() {
|
67 |
global $current_section, $wc_stripe_subsection;
|
68 |
if (! empty ( $current_section )) {
|
69 |
+
$wc_stripe_subsection = isset ( $_GET[ 'sub_section' ] ) ? sanitize_title ( $_GET[ 'sub_section' ] ) : '';
|
70 |
do_action ( 'wc_stripe_localize_' . $current_section . '_settings' );
|
71 |
// added for WC 3.0.0 compatability.
|
72 |
remove_action ( 'admin_footer', array(
|
includes/admin/class-wc-stripe-admin-menus.php
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
*
|
4 |
* @since 3.0.0
|
5 |
* @package Stripe/Admin
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Stripe_Admin_Menus {
|
9 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
*
|
6 |
* @since 3.0.0
|
7 |
* @package Stripe/Admin
|
8 |
+
*
|
9 |
*/
|
10 |
class WC_Stripe_Admin_Menus {
|
11 |
|
includes/admin/class-wc-stripe-admin-settings.php
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @package Stripe/Admin
|
4 |
* @author User
|
5 |
-
*
|
6 |
*/
|
7 |
class WC_Stripe_Admin_Settings {
|
8 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @package Stripe/Admin
|
7 |
* @author User
|
8 |
+
*
|
9 |
*/
|
10 |
class WC_Stripe_Admin_Settings {
|
11 |
|
includes/admin/class-wc-stripe-admin-user-edit.php
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @since 3.0.0
|
4 |
* @package Stripe/Admin
|
5 |
* @author PaymentPlugins
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Stripe_Admin_User_Edit {
|
9 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @since 3.0.0
|
7 |
* @package Stripe/Admin
|
8 |
* @author PaymentPlugins
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Stripe_Admin_User_Edit {
|
12 |
|
includes/admin/meta-boxes/class-wc-stripe-admin-order-metaboxes.php
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @package Stripe/Admin
|
4 |
* @author PaymentPlugins
|
5 |
-
*
|
6 |
*/
|
7 |
class WC_Stripe_Admin_Order_Metaboxes {
|
8 |
|
@@ -58,7 +61,9 @@ class WC_Stripe_Admin_Order_Metaboxes {
|
|
58 |
* @param WC_Order $order
|
59 |
*/
|
60 |
public static function pay_order_section($order) {
|
61 |
-
if ($order->get_type () === 'shop_order' && $order->has_status ( [
|
|
|
|
|
62 |
include 'views/html-order-pay.php';
|
63 |
$payment_methods = array();
|
64 |
foreach ( WC ()->payment_gateways ()->payment_gateways () as $gateway ) {
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @package Stripe/Admin
|
7 |
* @author PaymentPlugins
|
8 |
+
*
|
9 |
*/
|
10 |
class WC_Stripe_Admin_Order_Metaboxes {
|
11 |
|
61 |
* @param WC_Order $order
|
62 |
*/
|
63 |
public static function pay_order_section($order) {
|
64 |
+
if ($order->get_type () === 'shop_order' && $order->has_status ( [
|
65 |
+
'pending', 'auto-draft'
|
66 |
+
] )) {
|
67 |
include 'views/html-order-pay.php';
|
68 |
$payment_methods = array();
|
69 |
foreach ( WC ()->payment_gateways ()->payment_gateways () as $gateway ) {
|
includes/admin/settings/class-wc-stripe-api-settings.php
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
* @author Payment Plugins
|
5 |
* @since 3.0.0
|
6 |
-
*
|
|
|
7 |
*/
|
8 |
class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
9 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @author Payment Plugins
|
7 |
* @since 3.0.0
|
8 |
+
* @package Stripe/Classes
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
12 |
|
includes/admin/views/html-user-profile.php
CHANGED
@@ -12,13 +12,13 @@
|
|
12 |
<tr>
|
13 |
<th><?php _e('Live ID', 'woo-stripe-payment')?></th>
|
14 |
<td>
|
15 |
-
<input type="text" id="wc_stripe_live_id" name="wc_stripe_live_id" value="<?php echo wc_stripe_get_customer_id($user->ID, 'live')?>"
|
16 |
</td>
|
17 |
</tr>
|
18 |
<tr>
|
19 |
<th><?php _e('Test ID', 'woo-stripe-payment')?></th>
|
20 |
<td>
|
21 |
-
<input type="text" id="wc_stripe_test_id" name="wc_stripe_test_id" value="<?php echo wc_stripe_get_customer_id($user->ID, 'test')?>"
|
22 |
</td>
|
23 |
</tr>
|
24 |
</tbody>
|
12 |
<tr>
|
13 |
<th><?php _e('Live ID', 'woo-stripe-payment')?></th>
|
14 |
<td>
|
15 |
+
<input type="text" id="wc_stripe_live_id" name="wc_stripe_live_id" value="<?php echo wc_stripe_get_customer_id($user->ID, 'live')?>"/>
|
16 |
</td>
|
17 |
</tr>
|
18 |
<tr>
|
19 |
<th><?php _e('Test ID', 'woo-stripe-payment')?></th>
|
20 |
<td>
|
21 |
+
<input type="text" id="wc_stripe_test_id" name="wc_stripe_test_id" value="<?php echo wc_stripe_get_customer_id($user->ID, 'test')?>"/>
|
22 |
</td>
|
23 |
</tr>
|
24 |
</tbody>
|
includes/class-stripe.php
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
* Singleton class that handles plugin functionality like class loading.
|
|
|
4 |
* @since 3.0.0
|
5 |
* @author PaymentPlugins
|
6 |
* @package Stripe/Classes
|
7 |
-
*
|
8 |
*/
|
9 |
class WC_Stripe_Manager {
|
10 |
|
@@ -21,7 +24,7 @@ class WC_Stripe_Manager {
|
|
21 |
*
|
22 |
* @var string
|
23 |
*/
|
24 |
-
public $version = '3.1.
|
25 |
|
26 |
/**
|
27 |
*
|
@@ -149,6 +152,9 @@ class WC_Stripe_Manager {
|
|
149 |
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/traits/wc-stripe-settings-trait.php';
|
150 |
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/traits/wc-stripe-controller-cart-trait.php';
|
151 |
|
|
|
|
|
|
|
152 |
// load gateways
|
153 |
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-payment-gateway-stripe.php';
|
154 |
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php';
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
* Singleton class that handles plugin functionality like class loading.
|
6 |
+
*
|
7 |
* @since 3.0.0
|
8 |
* @author PaymentPlugins
|
9 |
* @package Stripe/Classes
|
10 |
+
*
|
11 |
*/
|
12 |
class WC_Stripe_Manager {
|
13 |
|
24 |
*
|
25 |
* @var string
|
26 |
*/
|
27 |
+
public $version = '3.1.1';
|
28 |
|
29 |
/**
|
30 |
*
|
152 |
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/traits/wc-stripe-settings-trait.php';
|
153 |
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/traits/wc-stripe-controller-cart-trait.php';
|
154 |
|
155 |
+
// load factories
|
156 |
+
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-payment-factory.php';
|
157 |
+
|
158 |
// load gateways
|
159 |
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-payment-gateway-stripe.php';
|
160 |
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php';
|
includes/class-wc-stripe-constants.php
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @since 3.1.0
|
4 |
* @author Payment Plugins
|
5 |
-
*
|
6 |
*/
|
7 |
class WC_Stripe_Constants {
|
8 |
|
@@ -17,4 +20,14 @@ class WC_Stripe_Constants {
|
|
17 |
const MODE = '_wc_stripe_mode';
|
18 |
|
19 |
const CHARGE_STATUS = '_wc_stripe_charge_status';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @since 3.1.0
|
7 |
* @author Payment Plugins
|
8 |
+
*
|
9 |
*/
|
10 |
class WC_Stripe_Constants {
|
11 |
|
20 |
const MODE = '_wc_stripe_mode';
|
21 |
|
22 |
const CHARGE_STATUS = '_wc_stripe_charge_status';
|
23 |
+
|
24 |
+
const SOURCE_ID = '_stripe_source_id';
|
25 |
+
|
26 |
+
const STRIPE_INTENT_ID = '_stripe_intent_id';
|
27 |
+
|
28 |
+
const STRIPE_CUSTOMER_ID = '_stripe_customer_id';
|
29 |
+
|
30 |
+
const SUCCESS = 'success';
|
31 |
+
|
32 |
+
const FAILURE = 'failure';
|
33 |
}
|
includes/class-wc-stripe-customer-manager.php
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
* Class that manages customer creation and custom updates.
|
|
|
4 |
* @since 3.0.0
|
5 |
* @package Stripe/Classes
|
6 |
* @author PaymentPlugins
|
7 |
-
*
|
8 |
*/
|
9 |
class WC_Stripe_Customer_Manager {
|
10 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
* Class that manages customer creation and custom updates.
|
6 |
+
*
|
7 |
* @since 3.0.0
|
8 |
* @package Stripe/Classes
|
9 |
* @author PaymentPlugins
|
10 |
+
*
|
11 |
*/
|
12 |
class WC_Stripe_Customer_Manager {
|
13 |
|
includes/class-wc-stripe-field-manager.php
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @since 3.0.0
|
4 |
* @package Stripe/Classes
|
5 |
* @author Payment Plugins
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Stripe_Field_Manager {
|
9 |
|
@@ -172,12 +175,12 @@ class WC_Stripe_Field_Manager {
|
|
172 |
* @param WC_Order $order
|
173 |
*/
|
174 |
public static function output_required_fields($order = null) {
|
175 |
-
printf ( '<input type="hidden" id="%1$s" value="%2$s"/>', 'wc_stripe_currency', get_woocommerce_currency () );
|
176 |
printf ( '<input type="hidden" id="%1$s" data-amount="%2$s"/>', 'wc_stripe_order_total', $order ? $order->get_total () : WC ()->cart->total );
|
177 |
if (is_cart () || is_checkout ()) {
|
178 |
printf ( '<input type="hidden" id="wc_stripe_display_items" data-items="%s"/>', wc_stripe_get_display_items ( true, $order ) );
|
179 |
printf ( '<input type="hidden" id="wc_stripe_shipping_options" data-items="%s"/>', wc_stripe_get_shipping_options ( true, $order ) );
|
180 |
-
printf ( '<input type="hidden" id="wc_stripe_order_total_cents" data-amount="%s"/>', wc_stripe_add_number_precision ( $order ? $order->get_total () : WC ()->cart->total ) );
|
181 |
}
|
182 |
}
|
183 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @since 3.0.0
|
7 |
* @package Stripe/Classes
|
8 |
* @author Payment Plugins
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Stripe_Field_Manager {
|
12 |
|
175 |
* @param WC_Order $order
|
176 |
*/
|
177 |
public static function output_required_fields($order = null) {
|
178 |
+
printf ( '<input type="hidden" id="%1$s" value="%2$s"/>', 'wc_stripe_currency', $order ? $order->get_currency () : get_woocommerce_currency () );
|
179 |
printf ( '<input type="hidden" id="%1$s" data-amount="%2$s"/>', 'wc_stripe_order_total', $order ? $order->get_total () : WC ()->cart->total );
|
180 |
if (is_cart () || is_checkout ()) {
|
181 |
printf ( '<input type="hidden" id="wc_stripe_display_items" data-items="%s"/>', wc_stripe_get_display_items ( true, $order ) );
|
182 |
printf ( '<input type="hidden" id="wc_stripe_shipping_options" data-items="%s"/>', wc_stripe_get_shipping_options ( true, $order ) );
|
183 |
+
printf ( '<input type="hidden" id="wc_stripe_order_total_cents" data-amount="%s"/>', wc_stripe_add_number_precision ( ( $order ? $order->get_total () : WC ()->cart->total ), ( $order ? $order->get_currency () : '' ) ) );
|
184 |
}
|
185 |
}
|
186 |
|
includes/class-wc-stripe-frontend-notices.php
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Class that manages frontend notices for customers.
|
|
|
4 |
* @author PaymentPlugins
|
5 |
* @package Stripe/Classes
|
6 |
* @since 3.0.0
|
7 |
-
*
|
8 |
*/
|
9 |
class WC_Stripe_Frontend_Notices {
|
10 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
/**
|
4 |
* Class that manages frontend notices for customers.
|
5 |
+
*
|
6 |
* @author PaymentPlugins
|
7 |
* @package Stripe/Classes
|
8 |
* @since 3.0.0
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Stripe_Frontend_Notices {
|
12 |
|
includes/class-wc-stripe-frontend-scripts.php
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
* Handles scrip enqueuement and output of params needed by the plugin.
|
|
|
4 |
* @package Stripe/Classes
|
5 |
* @author PaymentPlugins
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Stripe_Frontend_Scripts {
|
9 |
|
@@ -56,6 +59,8 @@ class WC_Stripe_Frontend_Scripts {
|
|
56 |
wp_localize_script ( $this->get_handle ( 'form-handler' ), 'wc_stripe_form_handler_params', [
|
57 |
'no_results' => __ ( 'No matches found', 'woo-stripe-payment' )
|
58 |
] );
|
|
|
|
|
59 |
}
|
60 |
|
61 |
public function enqueue_checkout_scripts() {
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
* Handles scrip enqueuement and output of params needed by the plugin.
|
6 |
+
*
|
7 |
* @package Stripe/Classes
|
8 |
* @author PaymentPlugins
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Stripe_Frontend_Scripts {
|
12 |
|
59 |
wp_localize_script ( $this->get_handle ( 'form-handler' ), 'wc_stripe_form_handler_params', [
|
60 |
'no_results' => __ ( 'No matches found', 'woo-stripe-payment' )
|
61 |
] );
|
62 |
+
|
63 |
+
wp_localize_script ( $this->get_handle ( 'wc-stripe' ), 'wc_stripe_messages', wc_stripe_get_error_messages () );
|
64 |
}
|
65 |
|
66 |
public function enqueue_checkout_scripts() {
|
includes/class-wc-stripe-gateway-ach.php
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @since 3.1.0
|
4 |
* @author Payment Plugins
|
5 |
-
*
|
6 |
*/
|
7 |
class WC_Stripe_Gateway_ACH extends WC_Stripe_Gateway {
|
8 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @since 3.1.0
|
7 |
* @author Payment Plugins
|
8 |
+
*
|
9 |
*/
|
10 |
class WC_Stripe_Gateway_ACH extends WC_Stripe_Gateway {
|
11 |
|
includes/class-wc-stripe-gateway-conversions.php
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @since 3.1.0
|
4 |
* @author Payment Plugins
|
5 |
-
*
|
6 |
*/
|
7 |
class WC_Stripe_Gateway_Conversion {
|
8 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @since 3.1.0
|
7 |
* @author Payment Plugins
|
8 |
+
*
|
9 |
*/
|
10 |
class WC_Stripe_Gateway_Conversion {
|
11 |
|
includes/class-wc-stripe-gateway.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
use Stripe\ApiOperations\Create;
|
3 |
use Stripe\ApiOperations\Retrieve;
|
4 |
use Stripe\ApiOperations\Update;
|
@@ -20,6 +22,8 @@ class WC_Stripe_Gateway {
|
|
20 |
*/
|
21 |
private $mode = null;
|
22 |
|
|
|
|
|
23 |
/**
|
24 |
*
|
25 |
* @since 3.0.8
|
@@ -34,6 +38,8 @@ class WC_Stripe_Gateway {
|
|
34 |
if (null != $secret_key) {
|
35 |
$this->secret_key = $secret_key;
|
36 |
}
|
|
|
|
|
37 |
}
|
38 |
|
39 |
public static function init() {
|
@@ -46,6 +52,7 @@ class WC_Stripe_Gateway {
|
|
46 |
* @since 3.1.0
|
47 |
* @param string $mode
|
48 |
* @param string $secret_key
|
|
|
49 |
*/
|
50 |
public static function load($mode = null, $secret_key = null) {
|
51 |
$class = apply_filters ( 'wc_stripe_gateway_class', 'WC_Stripe_Gateway' );
|
@@ -72,8 +79,7 @@ class WC_Stripe_Gateway {
|
|
72 |
$customer = \Stripe\Customer::create ( apply_filters ( 'wc_stripe_create_customer_args', $args ), $this->get_api_options () );
|
73 |
return $customer->id;
|
74 |
} catch ( \Stripe\Error\Base $e ) {
|
75 |
-
$
|
76 |
-
return new WP_Error ( 'customer-error', $err[ 'message' ] );
|
77 |
}
|
78 |
}
|
79 |
|
@@ -81,8 +87,7 @@ class WC_Stripe_Gateway {
|
|
81 |
try {
|
82 |
return \Stripe\Customer::update ( $id, $args, $this->get_api_options ( $mode ) );
|
83 |
} catch ( \Stripe\Error\Base $e ) {
|
84 |
-
$
|
85 |
-
return new WP_Error ( 'customer-error', $err[ 'message' ] );
|
86 |
}
|
87 |
}
|
88 |
|
@@ -90,8 +95,7 @@ class WC_Stripe_Gateway {
|
|
90 |
try {
|
91 |
return \Stripe\Charge::create ( $args, $this->get_api_options ( $mode ) );
|
92 |
} catch ( \Stripe\Error\Base $e ) {
|
93 |
-
$
|
94 |
-
return new WP_Error ( 'charge-error', $err[ 'message' ] );
|
95 |
}
|
96 |
}
|
97 |
|
@@ -105,8 +109,7 @@ class WC_Stripe_Gateway {
|
|
105 |
try {
|
106 |
return \Stripe\PaymentIntent::create ( $args, $this->get_api_options ( $mode ) );
|
107 |
} catch ( \Stripe\Error\Base $e ) {
|
108 |
-
$
|
109 |
-
return new WP_Error ( 'payment-intent-error', $err[ 'message' ] );
|
110 |
}
|
111 |
}
|
112 |
|
@@ -114,8 +117,7 @@ class WC_Stripe_Gateway {
|
|
114 |
try {
|
115 |
return \Stripe\SetupIntent::create ( $args, $this->get_api_options ( $mode ) );
|
116 |
} catch ( \Stripe\Error\Base $e ) {
|
117 |
-
$
|
118 |
-
return new WP_Error ( 'setup-intent-error', $err[ 'message' ] );
|
119 |
}
|
120 |
}
|
121 |
|
@@ -129,8 +131,7 @@ class WC_Stripe_Gateway {
|
|
129 |
try {
|
130 |
return \Stripe\PaymentIntent::update ( $id, $args, $this->get_api_options ( $mode ) );
|
131 |
} catch ( \Stripe\Error\Base $e ) {
|
132 |
-
$
|
133 |
-
return new WP_Error ( 'payment-intent-error', $err[ 'message' ] );
|
134 |
}
|
135 |
}
|
136 |
|
@@ -142,16 +143,9 @@ class WC_Stripe_Gateway {
|
|
142 |
*/
|
143 |
public function confirm_payment_intent($intent, $args = [], $mode = '') {
|
144 |
try {
|
145 |
-
/*
|
146 |
-
* $intent = $this->fetch_payment_intent ( $id, $mode );
|
147 |
-
* if (is_wp_error ( $intent )) {
|
148 |
-
* return $intent;
|
149 |
-
* }
|
150 |
-
*/
|
151 |
return $intent->confirm ( $args, $this->get_api_options ( $mode ) );
|
152 |
} catch ( \Stripe\Error\Base $e ) {
|
153 |
-
$
|
154 |
-
return new WP_Error ( 'payment-intent-error', $err[ 'message' ] );
|
155 |
}
|
156 |
}
|
157 |
|
@@ -165,8 +159,7 @@ class WC_Stripe_Gateway {
|
|
165 |
try {
|
166 |
return \Stripe\PaymentIntent::retrieve ( $id, $this->get_api_options ( $mode ) );
|
167 |
} catch ( \Stripe\Error\Base $e ) {
|
168 |
-
$
|
169 |
-
return new WP_Error ( 'payment-intent-error', $err[ 'message' ] );
|
170 |
}
|
171 |
}
|
172 |
|
@@ -175,8 +168,7 @@ class WC_Stripe_Gateway {
|
|
175 |
$payment_intent = $this->fetch_payment_intent ( $id, $mode );
|
176 |
return $payment_intent->capture ( $args, $this->get_api_options ( $mode ) );
|
177 |
} catch ( \Stripe\Error\Base $e ) {
|
178 |
-
$
|
179 |
-
return new WP_Error ( 'payment-intent-error', $err[ 'message' ] );
|
180 |
}
|
181 |
}
|
182 |
|
@@ -194,8 +186,7 @@ class WC_Stripe_Gateway {
|
|
194 |
}
|
195 |
return $payment_intent->cancel ( [], $this->get_api_options ( $mode ) );
|
196 |
} catch ( \Stripe\Error\Base $e ) {
|
197 |
-
$
|
198 |
-
return new WP_Error ( 'payment-intent-error', $err[ 'message' ] );
|
199 |
}
|
200 |
}
|
201 |
|
@@ -209,8 +200,7 @@ class WC_Stripe_Gateway {
|
|
209 |
try {
|
210 |
return \Stripe\SetupIntent::retrieve ( $id, $this->get_api_options ( $mode ) );
|
211 |
} catch ( \Stripe\Error\Base $e ) {
|
212 |
-
$
|
213 |
-
return new WP_Error ( $err[ 'code' ], $err[ 'message' ] );
|
214 |
}
|
215 |
}
|
216 |
|
@@ -220,7 +210,7 @@ class WC_Stripe_Gateway {
|
|
220 |
try {
|
221 |
return $charge->capture ( $args, $this->get_api_options ( $mode ) );
|
222 |
} catch ( \Stripe\Error\Base $e ) {
|
223 |
-
return
|
224 |
}
|
225 |
} else {
|
226 |
return $charge;
|
@@ -237,8 +227,7 @@ class WC_Stripe_Gateway {
|
|
237 |
try {
|
238 |
return \Stripe\Charge::retrieve ( $charge_id, $this->get_api_options ( $mode ) );
|
239 |
} catch ( \Stripe\Error\Base $e ) {
|
240 |
-
$
|
241 |
-
return new WP_Error ( 'payment-intent-error', $err[ 'message' ] );
|
242 |
}
|
243 |
}
|
244 |
|
@@ -246,8 +235,7 @@ class WC_Stripe_Gateway {
|
|
246 |
try {
|
247 |
return \Stripe\Refund::create ( $args, $this->get_api_options ( $mode ) );
|
248 |
} catch ( \Stripe\Error\Base $e ) {
|
249 |
-
$
|
250 |
-
return new WP_Error ( 'refund', $err[ 'message' ] );
|
251 |
}
|
252 |
}
|
253 |
|
@@ -255,8 +243,7 @@ class WC_Stripe_Gateway {
|
|
255 |
try {
|
256 |
return \Stripe\PaymentMethod::retrieve ( $id, $this->get_api_options ( $mode ) );
|
257 |
} catch ( \Stripe\Error\Base $e ) {
|
258 |
-
$
|
259 |
-
return new WP_Error ( 'payment-method', $err[ 'message' ] );
|
260 |
}
|
261 |
}
|
262 |
|
@@ -270,8 +257,7 @@ class WC_Stripe_Gateway {
|
|
270 |
try {
|
271 |
return $payment_method->attach ( $args, $this->get_api_options ( $mode ) );
|
272 |
} catch ( \Stripe\Error\Base $e ) {
|
273 |
-
$
|
274 |
-
return new WP_Error ( 'attach-payment-error', $err[ 'message' ] );
|
275 |
}
|
276 |
}
|
277 |
|
@@ -279,8 +265,7 @@ class WC_Stripe_Gateway {
|
|
279 |
try {
|
280 |
return \Stripe\PaymentMethod::retrieve ( $id, $this->get_api_options ( $mode ) );
|
281 |
} catch ( \Stripe\Error\Base $e ) {
|
282 |
-
$
|
283 |
-
return new WP_Error ( 'fetch-payment-error', $err[ 'message' ] );
|
284 |
}
|
285 |
}
|
286 |
|
@@ -293,8 +278,7 @@ class WC_Stripe_Gateway {
|
|
293 |
try {
|
294 |
return $payment_method->detach ( [], $this->get_api_options ( $mode ) );
|
295 |
} catch ( \Stripe\Error\Base $e ) {
|
296 |
-
$
|
297 |
-
return new WP_Error ( 'delete-source-error', $err[ 'message' ] );
|
298 |
}
|
299 |
}
|
300 |
|
@@ -308,8 +292,7 @@ class WC_Stripe_Gateway {
|
|
308 |
try {
|
309 |
\Stripe\Customer::deleteSource ( $customer, $id, null, $this->get_api_options ( $mode ) );
|
310 |
} catch ( \Stripe\Error\Base $e ) {
|
311 |
-
$
|
312 |
-
return new WP_Error ( 'delete-source-error', $err[ 'message' ] );
|
313 |
}
|
314 |
}
|
315 |
|
@@ -323,8 +306,7 @@ class WC_Stripe_Gateway {
|
|
323 |
try {
|
324 |
return \Stripe\PaymentMethod::create ( $args, $this->get_api_options ( $mode ) );
|
325 |
} catch ( \Stripe\Error\Base $e ) {
|
326 |
-
$
|
327 |
-
return new WP_Error ( 'delete-source-error', $err[ 'message' ] );
|
328 |
}
|
329 |
}
|
330 |
|
@@ -339,8 +321,7 @@ class WC_Stripe_Gateway {
|
|
339 |
try {
|
340 |
return \Stripe\Source::retrieve ( $id, $this->get_api_options ( $mode ) );
|
341 |
} catch ( \Stripe\Error\Base $e ) {
|
342 |
-
$
|
343 |
-
return new WP_Error ( 'source-error', $err[ 'message' ] );
|
344 |
}
|
345 |
}
|
346 |
|
@@ -357,8 +338,7 @@ class WC_Stripe_Gateway {
|
|
357 |
'source' => $id
|
358 |
], $this->get_api_options ( $mode ) );
|
359 |
} catch ( \Stripe\Error\Base $e ) {
|
360 |
-
$
|
361 |
-
return new WP_Error ( 'source-error', $err[ 'message' ] );
|
362 |
}
|
363 |
}
|
364 |
|
@@ -372,8 +352,7 @@ class WC_Stripe_Gateway {
|
|
372 |
try {
|
373 |
return \Stripe\Source::create ( $args, $this->get_api_options ( $mode ) );
|
374 |
} catch ( \Stripe\Error\Base $e ) {
|
375 |
-
$
|
376 |
-
return new WP_Error ( 'source-error', $err[ 'message' ] );
|
377 |
}
|
378 |
}
|
379 |
|
@@ -388,8 +367,7 @@ class WC_Stripe_Gateway {
|
|
388 |
try {
|
389 |
return \Stripe\Source::update ( $source_id, $args, $this->get_api_options ( $mode ) );
|
390 |
} catch ( \Stripe\Error\Base $e ) {
|
391 |
-
$
|
392 |
-
return new WP_Error ( 'source-error', $err[ 'message' ] );
|
393 |
}
|
394 |
}
|
395 |
|
@@ -397,8 +375,7 @@ class WC_Stripe_Gateway {
|
|
397 |
try {
|
398 |
return \Stripe\Customer::retrieve ( $customer_id, $this->get_api_options ( $mode ) );
|
399 |
} catch ( \Stripe\Error\Base $e ) {
|
400 |
-
$
|
401 |
-
return new WP_Error ( 'customer-error', $err[ 'message' ] );
|
402 |
}
|
403 |
}
|
404 |
|
@@ -408,8 +385,7 @@ class WC_Stripe_Gateway {
|
|
408 |
'limit' => 1
|
409 |
], $this->get_api_options ( $mode ) );
|
410 |
} catch ( \Stripe\Error\Base $e ) {
|
411 |
-
$
|
412 |
-
return new WP_Error ( 'customer-error', $err[ 'message' ] );
|
413 |
}
|
414 |
}
|
415 |
|
@@ -420,8 +396,7 @@ class WC_Stripe_Gateway {
|
|
420 |
'type' => $type
|
421 |
], $this->get_api_options ( $mode ) );
|
422 |
} catch ( \Stripe\Error\Base $e ) {
|
423 |
-
$
|
424 |
-
return new WP_Error ( 'source-error', $err[ 'message' ] );
|
425 |
}
|
426 |
}
|
427 |
|
@@ -431,8 +406,7 @@ class WC_Stripe_Gateway {
|
|
431 |
'domain_name' => $domain
|
432 |
], $this->get_api_options ( $mode ) );
|
433 |
} catch ( \Stripe\Error\Base $e ) {
|
434 |
-
$
|
435 |
-
return new WP_Error ( 'domain-error', $err[ 'message' ] );
|
436 |
}
|
437 |
}
|
438 |
|
@@ -442,8 +416,7 @@ class WC_Stripe_Gateway {
|
|
442 |
'limit' => 100
|
443 |
], $this->get_api_options ( $mode ) );
|
444 |
} catch ( \Stripe\Error\Base $e ) {
|
445 |
-
$
|
446 |
-
return new WP_Error ( 'webhook-error', $err[ 'message' ] );
|
447 |
}
|
448 |
}
|
449 |
|
@@ -454,8 +427,7 @@ class WC_Stripe_Gateway {
|
|
454 |
'enabled_events' => $events
|
455 |
], $this->get_api_options ( $mode ) );
|
456 |
} catch ( \Stripe\Error\Base $e ) {
|
457 |
-
$
|
458 |
-
return new WP_Error ( 'webhook-error', $err[ 'message' ] );
|
459 |
}
|
460 |
}
|
461 |
|
@@ -463,8 +435,7 @@ class WC_Stripe_Gateway {
|
|
463 |
try {
|
464 |
return \Stripe\WebhookEndpoint::update ( $id, $params, $this->get_api_options ( $mode ) );
|
465 |
} catch ( \Stripe\Error\Base $e ) {
|
466 |
-
$
|
467 |
-
return new WP_Error ( 'webhook-error', $err[ 'message' ] );
|
468 |
}
|
469 |
}
|
470 |
|
@@ -472,8 +443,7 @@ class WC_Stripe_Gateway {
|
|
472 |
try {
|
473 |
return \Stripe\WebhookEndpoint::retrieve ( $id, $this->get_api_options ( $mode ) );
|
474 |
} catch ( \Stripe\Error\Base $e ) {
|
475 |
-
$
|
476 |
-
return new WP_Error ( 'webhook-error', $err[ 'message' ] );
|
477 |
}
|
478 |
}
|
479 |
|
@@ -486,5 +456,40 @@ class WC_Stripe_Gateway {
|
|
486 |
];
|
487 |
return apply_filters ( 'wc_stripe_api_options', $args );
|
488 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
}
|
490 |
WC_Stripe_Gateway::init ();
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
use Stripe\ApiOperations\Create;
|
5 |
use Stripe\ApiOperations\Retrieve;
|
6 |
use Stripe\ApiOperations\Update;
|
22 |
*/
|
23 |
private $mode = null;
|
24 |
|
25 |
+
private $messages = [];
|
26 |
+
|
27 |
/**
|
28 |
*
|
29 |
* @since 3.0.8
|
38 |
if (null != $secret_key) {
|
39 |
$this->secret_key = $secret_key;
|
40 |
}
|
41 |
+
|
42 |
+
$this->messages = wc_stripe_get_error_messages ();
|
43 |
}
|
44 |
|
45 |
public static function init() {
|
52 |
* @since 3.1.0
|
53 |
* @param string $mode
|
54 |
* @param string $secret_key
|
55 |
+
* @return WC_Stripe_Gateway
|
56 |
*/
|
57 |
public static function load($mode = null, $secret_key = null) {
|
58 |
$class = apply_filters ( 'wc_stripe_gateway_class', 'WC_Stripe_Gateway' );
|
79 |
$customer = \Stripe\Customer::create ( apply_filters ( 'wc_stripe_create_customer_args', $args ), $this->get_api_options () );
|
80 |
return $customer->id;
|
81 |
} catch ( \Stripe\Error\Base $e ) {
|
82 |
+
return $this->get_wp_error ( $e, 'customer-error' );
|
|
|
83 |
}
|
84 |
}
|
85 |
|
87 |
try {
|
88 |
return \Stripe\Customer::update ( $id, $args, $this->get_api_options ( $mode ) );
|
89 |
} catch ( \Stripe\Error\Base $e ) {
|
90 |
+
return $this->get_wp_error ( $e, 'customer-error' );
|
|
|
91 |
}
|
92 |
}
|
93 |
|
95 |
try {
|
96 |
return \Stripe\Charge::create ( $args, $this->get_api_options ( $mode ) );
|
97 |
} catch ( \Stripe\Error\Base $e ) {
|
98 |
+
return $this->get_wp_error ( $e, 'charge-error' );
|
|
|
99 |
}
|
100 |
}
|
101 |
|
109 |
try {
|
110 |
return \Stripe\PaymentIntent::create ( $args, $this->get_api_options ( $mode ) );
|
111 |
} catch ( \Stripe\Error\Base $e ) {
|
112 |
+
return $this->get_wp_error ( $e, 'payment-intent-error' );
|
|
|
113 |
}
|
114 |
}
|
115 |
|
117 |
try {
|
118 |
return \Stripe\SetupIntent::create ( $args, $this->get_api_options ( $mode ) );
|
119 |
} catch ( \Stripe\Error\Base $e ) {
|
120 |
+
return $this->get_wp_error ( $e, 'setup-intent-error' );
|
|
|
121 |
}
|
122 |
}
|
123 |
|
131 |
try {
|
132 |
return \Stripe\PaymentIntent::update ( $id, $args, $this->get_api_options ( $mode ) );
|
133 |
} catch ( \Stripe\Error\Base $e ) {
|
134 |
+
return $this->get_wp_error ( $e, 'payment-intent-error' );
|
|
|
135 |
}
|
136 |
}
|
137 |
|
143 |
*/
|
144 |
public function confirm_payment_intent($intent, $args = [], $mode = '') {
|
145 |
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
return $intent->confirm ( $args, $this->get_api_options ( $mode ) );
|
147 |
} catch ( \Stripe\Error\Base $e ) {
|
148 |
+
return $this->get_wp_error ( $e, 'payment-intent-error' );
|
|
|
149 |
}
|
150 |
}
|
151 |
|
159 |
try {
|
160 |
return \Stripe\PaymentIntent::retrieve ( $id, $this->get_api_options ( $mode ) );
|
161 |
} catch ( \Stripe\Error\Base $e ) {
|
162 |
+
return $this->get_wp_error ( $e, 'payment-intent-error' );
|
|
|
163 |
}
|
164 |
}
|
165 |
|
168 |
$payment_intent = $this->fetch_payment_intent ( $id, $mode );
|
169 |
return $payment_intent->capture ( $args, $this->get_api_options ( $mode ) );
|
170 |
} catch ( \Stripe\Error\Base $e ) {
|
171 |
+
return $this->get_wp_error ( $e, 'payment-intent-error' );
|
|
|
172 |
}
|
173 |
}
|
174 |
|
186 |
}
|
187 |
return $payment_intent->cancel ( [], $this->get_api_options ( $mode ) );
|
188 |
} catch ( \Stripe\Error\Base $e ) {
|
189 |
+
return $this->get_wp_error ( $e, 'payment-intent-error' );
|
|
|
190 |
}
|
191 |
}
|
192 |
|
200 |
try {
|
201 |
return \Stripe\SetupIntent::retrieve ( $id, $this->get_api_options ( $mode ) );
|
202 |
} catch ( \Stripe\Error\Base $e ) {
|
203 |
+
return $this->get_wp_error ( $e, 'setup-intent-error' );
|
|
|
204 |
}
|
205 |
}
|
206 |
|
210 |
try {
|
211 |
return $charge->capture ( $args, $this->get_api_options ( $mode ) );
|
212 |
} catch ( \Stripe\Error\Base $e ) {
|
213 |
+
return $this->get_wp_error ( $e, 'catpure-error' );
|
214 |
}
|
215 |
} else {
|
216 |
return $charge;
|
227 |
try {
|
228 |
return \Stripe\Charge::retrieve ( $charge_id, $this->get_api_options ( $mode ) );
|
229 |
} catch ( \Stripe\Error\Base $e ) {
|
230 |
+
return $this->get_wp_error ( $e, 'charge-error' );
|
|
|
231 |
}
|
232 |
}
|
233 |
|
235 |
try {
|
236 |
return \Stripe\Refund::create ( $args, $this->get_api_options ( $mode ) );
|
237 |
} catch ( \Stripe\Error\Base $e ) {
|
238 |
+
return $this->get_wp_error ( $e, 'refund-error' );
|
|
|
239 |
}
|
240 |
}
|
241 |
|
243 |
try {
|
244 |
return \Stripe\PaymentMethod::retrieve ( $id, $this->get_api_options ( $mode ) );
|
245 |
} catch ( \Stripe\Error\Base $e ) {
|
246 |
+
return $this->get_wp_error ( $e, 'payment-method' );
|
|
|
247 |
}
|
248 |
}
|
249 |
|
257 |
try {
|
258 |
return $payment_method->attach ( $args, $this->get_api_options ( $mode ) );
|
259 |
} catch ( \Stripe\Error\Base $e ) {
|
260 |
+
return $this->get_wp_error ( $e, 'attach-payment-error' );
|
|
|
261 |
}
|
262 |
}
|
263 |
|
265 |
try {
|
266 |
return \Stripe\PaymentMethod::retrieve ( $id, $this->get_api_options ( $mode ) );
|
267 |
} catch ( \Stripe\Error\Base $e ) {
|
268 |
+
return $this->get_wp_error ( $e, 'fetch-payment-error' );
|
|
|
269 |
}
|
270 |
}
|
271 |
|
278 |
try {
|
279 |
return $payment_method->detach ( [], $this->get_api_options ( $mode ) );
|
280 |
} catch ( \Stripe\Error\Base $e ) {
|
281 |
+
return $this->get_wp_error ( $e, 'delete-source-error' );
|
|
|
282 |
}
|
283 |
}
|
284 |
|
292 |
try {
|
293 |
\Stripe\Customer::deleteSource ( $customer, $id, null, $this->get_api_options ( $mode ) );
|
294 |
} catch ( \Stripe\Error\Base $e ) {
|
295 |
+
return $this->get_wp_error ( $e, 'delete-source-error' );
|
|
|
296 |
}
|
297 |
}
|
298 |
|
306 |
try {
|
307 |
return \Stripe\PaymentMethod::create ( $args, $this->get_api_options ( $mode ) );
|
308 |
} catch ( \Stripe\Error\Base $e ) {
|
309 |
+
return $this->get_wp_error ( $e, 'payment-method-error' );
|
|
|
310 |
}
|
311 |
}
|
312 |
|
321 |
try {
|
322 |
return \Stripe\Source::retrieve ( $id, $this->get_api_options ( $mode ) );
|
323 |
} catch ( \Stripe\Error\Base $e ) {
|
324 |
+
return $this->get_wp_error ( $e, 'source-error' );
|
|
|
325 |
}
|
326 |
}
|
327 |
|
338 |
'source' => $id
|
339 |
], $this->get_api_options ( $mode ) );
|
340 |
} catch ( \Stripe\Error\Base $e ) {
|
341 |
+
return $this->get_wp_error ( $e, 'source-error' );
|
|
|
342 |
}
|
343 |
}
|
344 |
|
352 |
try {
|
353 |
return \Stripe\Source::create ( $args, $this->get_api_options ( $mode ) );
|
354 |
} catch ( \Stripe\Error\Base $e ) {
|
355 |
+
return $this->get_wp_error ( $e, 'source-error' );
|
|
|
356 |
}
|
357 |
}
|
358 |
|
367 |
try {
|
368 |
return \Stripe\Source::update ( $source_id, $args, $this->get_api_options ( $mode ) );
|
369 |
} catch ( \Stripe\Error\Base $e ) {
|
370 |
+
return $this->get_wp_error ( $e, 'source-error' );
|
|
|
371 |
}
|
372 |
}
|
373 |
|
375 |
try {
|
376 |
return \Stripe\Customer::retrieve ( $customer_id, $this->get_api_options ( $mode ) );
|
377 |
} catch ( \Stripe\Error\Base $e ) {
|
378 |
+
return $this->get_wp_error ( $e, 'customer-error' );
|
|
|
379 |
}
|
380 |
}
|
381 |
|
385 |
'limit' => 1
|
386 |
], $this->get_api_options ( $mode ) );
|
387 |
} catch ( \Stripe\Error\Base $e ) {
|
388 |
+
return $this->get_wp_error ( $e, 'customer-error' );
|
|
|
389 |
}
|
390 |
}
|
391 |
|
396 |
'type' => $type
|
397 |
], $this->get_api_options ( $mode ) );
|
398 |
} catch ( \Stripe\Error\Base $e ) {
|
399 |
+
return $this->get_wp_error ( $e, 'source-error' );
|
|
|
400 |
}
|
401 |
}
|
402 |
|
406 |
'domain_name' => $domain
|
407 |
], $this->get_api_options ( $mode ) );
|
408 |
} catch ( \Stripe\Error\Base $e ) {
|
409 |
+
return $this->get_wp_error ( $e, 'domain-error' );
|
|
|
410 |
}
|
411 |
}
|
412 |
|
416 |
'limit' => 100
|
417 |
], $this->get_api_options ( $mode ) );
|
418 |
} catch ( \Stripe\Error\Base $e ) {
|
419 |
+
return $this->get_wp_error ( $e, 'webhook-error' );
|
|
|
420 |
}
|
421 |
}
|
422 |
|
427 |
'enabled_events' => $events
|
428 |
], $this->get_api_options ( $mode ) );
|
429 |
} catch ( \Stripe\Error\Base $e ) {
|
430 |
+
return $this->get_wp_error ( $e, 'webhook-error' );
|
|
|
431 |
}
|
432 |
}
|
433 |
|
435 |
try {
|
436 |
return \Stripe\WebhookEndpoint::update ( $id, $params, $this->get_api_options ( $mode ) );
|
437 |
} catch ( \Stripe\Error\Base $e ) {
|
438 |
+
return $this->get_wp_error ( $e, 'webhook-error' );
|
|
|
439 |
}
|
440 |
}
|
441 |
|
443 |
try {
|
444 |
return \Stripe\WebhookEndpoint::retrieve ( $id, $this->get_api_options ( $mode ) );
|
445 |
} catch ( \Stripe\Error\Base $e ) {
|
446 |
+
return $this->get_wp_error ( $e, 'webhook-error' );
|
|
|
447 |
}
|
448 |
}
|
449 |
|
456 |
];
|
457 |
return apply_filters ( 'wc_stripe_api_options', $args );
|
458 |
}
|
459 |
+
|
460 |
+
/**
|
461 |
+
*
|
462 |
+
* @param mixed $err
|
463 |
+
*/
|
464 |
+
private function get_error_message($err) {
|
465 |
+
if (is_a ( $err, '\Stripe\Error\Base' )) {
|
466 |
+
$err = $err->getJsonBody ()[ 'error' ];
|
467 |
+
}
|
468 |
+
if (is_array ( $err )) {
|
469 |
+
if (isset ( $err[ 'decline_code' ] ) && isset ( $this->messages[ $err[ 'decline_code' ] ] )) {
|
470 |
+
return $this->messages[ $err[ 'decline_code' ] ];
|
471 |
+
}
|
472 |
+
if (isset ( $err[ 'code' ] ) && isset ( $this->messages[ $err[ 'code' ] ] )) {
|
473 |
+
return $this->messages[ $err[ 'code' ] ];
|
474 |
+
}
|
475 |
+
if (isset ( $err[ 'message' ] )) {
|
476 |
+
return $err[ 'message' ];
|
477 |
+
}
|
478 |
+
}
|
479 |
+
if (is_string ( $err )) {
|
480 |
+
return $err;
|
481 |
+
}
|
482 |
+
}
|
483 |
+
|
484 |
+
/**
|
485 |
+
*
|
486 |
+
* @todo use in future version to replace manual returns of WP_Error in each method
|
487 |
+
* @since 3.1.1
|
488 |
+
* @param \Stripe\Error\Base $e
|
489 |
+
*/
|
490 |
+
private function get_wp_error($e, $code = 'stripe-error') {
|
491 |
+
$err = $e->getJsonBody ()[ 'error' ];
|
492 |
+
return new WP_Error ( $code, $this->get_error_message ( $err ), $err );
|
493 |
+
}
|
494 |
}
|
495 |
WC_Stripe_Gateway::init ();
|
includes/class-wc-stripe-install.php
CHANGED
@@ -1,7 +1,10 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*@package Stripe/Classes
|
4 |
*
|
|
|
|
|
5 |
*/
|
6 |
class WC_Stripe_Install {
|
7 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
|
|
5 |
*
|
6 |
+
* @package Stripe/Classes
|
7 |
+
*
|
8 |
*/
|
9 |
class WC_Stripe_Install {
|
10 |
|
includes/class-wc-stripe-payment-charge-local.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
+
/**
|
5 |
+
*
|
6 |
+
* @author PaymentPlugins
|
7 |
+
* @since 3.1.1
|
8 |
+
* @package Stripe/Classes
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
class WC_Stripe_Payment_Charge_Local extends WC_Stripe_Payment_Charge {
|
12 |
+
|
13 |
+
/**
|
14 |
+
*
|
15 |
+
* @param WC_Order $order
|
16 |
+
*/
|
17 |
+
public function process_payment($order) {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* If there is no order lock, then this is not being processed via a webhook
|
21 |
+
*/
|
22 |
+
if (! $this->payment_method->has_order_lock ( $order )) {
|
23 |
+
try {
|
24 |
+
$source_id = $this->payment_method->get_new_source_token ();
|
25 |
+
if (! empty ( $source_id )) {
|
26 |
+
// source was created client side.
|
27 |
+
$source = $this->gateway->fetch_payment_source ( $source_id );
|
28 |
+
|
29 |
+
if (is_wp_error ( $source )) {
|
30 |
+
throw new Exception ( $source->get_error_message () );
|
31 |
+
}
|
32 |
+
|
33 |
+
// update the source's metadata with the order id
|
34 |
+
$this->gateway->update_source ( $source_id, [
|
35 |
+
'metadata' => [
|
36 |
+
'order_id' => $order->get_id (),
|
37 |
+
'created' => time ()
|
38 |
+
]
|
39 |
+
], wc_stripe_order_mode ( $order ) );
|
40 |
+
} else {
|
41 |
+
// create the source
|
42 |
+
$args = $this->payment_method->get_source_args ( $order );
|
43 |
+
$args[ 'metadata' ][ 'order_id' ] = $order->get_id ();
|
44 |
+
$args[ 'metadata' ][ 'created' ] = time ();
|
45 |
+
$source = $this->gateway->create_source ( $args, wc_stripe_order_mode ( $order ) );
|
46 |
+
}
|
47 |
+
|
48 |
+
if (is_wp_error ( $source )) {
|
49 |
+
throw new Exception ( $source->get_error_message () );
|
50 |
+
}
|
51 |
+
|
52 |
+
$order->update_meta_data ( WC_Stripe_Constants::SOURCE_ID, $source->id );
|
53 |
+
$order->update_meta_data ( WC_Stripe_Constants::MODE, wc_stripe_mode () );
|
54 |
+
|
55 |
+
$order->save ();
|
56 |
+
|
57 |
+
return ( object ) [
|
58 |
+
'complete_payment' => false,
|
59 |
+
'redirect' => $this->payment_method->get_source_redirect_url ( $source, $order )
|
60 |
+
];
|
61 |
+
} catch ( Exception $e ) {
|
62 |
+
return new WP_Error ( 'source-error', $e->getMessage () );
|
63 |
+
}
|
64 |
+
} else {
|
65 |
+
/**
|
66 |
+
* There is an order lock so this order is ready to be processed.
|
67 |
+
*/
|
68 |
+
return parent::process_payment ( $order );
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
includes/class-wc-stripe-payment-charge.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-stripe-payment.php' );
|
3 |
|
4 |
/**
|
@@ -16,11 +18,6 @@ class WC_Stripe_Payment_Charge extends WC_Stripe_Payment {
|
|
16 |
* @see WC_Stripe_Payment::process_payment()
|
17 |
*/
|
18 |
public function process_payment($order) {
|
19 |
-
/**
|
20 |
-
* Set a lock on the order so webhooks don't cause issues with payment processing.
|
21 |
-
*/
|
22 |
-
$this->payment_method->set_order_lock ( $order );
|
23 |
-
|
24 |
if ($this->payment_method->should_save_payment_method ( $order )) {
|
25 |
$result = $this->payment_method->save_payment_method ( $this->payment_method->get_new_source_token (), $order );
|
26 |
if (is_wp_error ( $result )) {
|
@@ -51,7 +48,7 @@ class WC_Stripe_Payment_Charge extends WC_Stripe_Payment {
|
|
51 |
*/
|
52 |
public function capture_charge($amount, $order) {
|
53 |
return $this->gateway->capture ( $order->get_transaction_id (), array(
|
54 |
-
'amount' => wc_stripe_add_number_precision ( $amount )
|
55 |
), wc_stripe_order_mode ( $order ) );
|
56 |
}
|
57 |
|
@@ -74,6 +71,8 @@ class WC_Stripe_Payment_Charge extends WC_Stripe_Payment {
|
|
74 |
|
75 |
if (( $customer_id = $order->get_meta ( WC_Stripe_Constants::CUSTOMER_ID ) )) {
|
76 |
$args[ 'customer' ] = $customer_id;
|
|
|
|
|
77 |
}
|
78 |
|
79 |
$charge = $this->gateway->charge ( $args, wc_stripe_order_mode ( $order ) );
|
@@ -99,7 +98,9 @@ class WC_Stripe_Payment_Charge extends WC_Stripe_Payment {
|
|
99 |
|
100 |
$args[ 'source' ] = $order->get_meta ( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN );
|
101 |
|
102 |
-
if (( $customer_id =
|
|
|
|
|
103 |
$args[ 'customer' ] = $customer_id;
|
104 |
}
|
105 |
|
@@ -122,7 +123,6 @@ class WC_Stripe_Payment_Charge extends WC_Stripe_Payment {
|
|
122 |
*/
|
123 |
public function get_order_charge_args(&$args, $order) {
|
124 |
$this->add_general_order_args ( $args, $order );
|
125 |
-
$this->add_order_payment_method ( $args, $order );
|
126 |
|
127 |
$args[ 'receipt_email' ] = $order->get_billing_email ();
|
128 |
$args[ 'capture' ] = $this->payment_method->get_option ( 'charge_type' ) === 'capture';
|
@@ -134,6 +134,8 @@ class WC_Stripe_Payment_Charge extends WC_Stripe_Payment {
|
|
134 |
$args[ 'customer' ] = $customer_id;
|
135 |
}
|
136 |
|
|
|
|
|
137 |
return apply_filters ( 'wc_stripe_charge_order_args', $args, $order, $this->payment_method->id );
|
138 |
}
|
139 |
|
@@ -156,4 +158,14 @@ class WC_Stripe_Payment_Charge extends WC_Stripe_Payment {
|
|
156 |
public function add_order_payment_method(&$args, $order) {
|
157 |
$args[ 'source' ] = $this->payment_method->get_payment_method_from_request ();
|
158 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-stripe-payment.php' );
|
5 |
|
6 |
/**
|
18 |
* @see WC_Stripe_Payment::process_payment()
|
19 |
*/
|
20 |
public function process_payment($order) {
|
|
|
|
|
|
|
|
|
|
|
21 |
if ($this->payment_method->should_save_payment_method ( $order )) {
|
22 |
$result = $this->payment_method->save_payment_method ( $this->payment_method->get_new_source_token (), $order );
|
23 |
if (is_wp_error ( $result )) {
|
48 |
*/
|
49 |
public function capture_charge($amount, $order) {
|
50 |
return $this->gateway->capture ( $order->get_transaction_id (), array(
|
51 |
+
'amount' => wc_stripe_add_number_precision ( $amount, $order->get_currency () )
|
52 |
), wc_stripe_order_mode ( $order ) );
|
53 |
}
|
54 |
|
71 |
|
72 |
if (( $customer_id = $order->get_meta ( WC_Stripe_Constants::CUSTOMER_ID ) )) {
|
73 |
$args[ 'customer' ] = $customer_id;
|
74 |
+
} elseif (( $customer_id = wc_stripe_get_customer_id ( $order->get_customer_id (), wc_stripe_order_mode ( $order ) ) )) {
|
75 |
+
$args[ 'customer' ] = $customer_id;
|
76 |
}
|
77 |
|
78 |
$charge = $this->gateway->charge ( $args, wc_stripe_order_mode ( $order ) );
|
98 |
|
99 |
$args[ 'source' ] = $order->get_meta ( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN );
|
100 |
|
101 |
+
if (( $customer_id = $order->get_meta ( WC_Stripe_Constants::CUSTOMER_ID ) )) {
|
102 |
+
$args[ 'customer' ] = $customer_id;
|
103 |
+
} elseif (( $customer_id = wc_stripe_get_customer_id ( $order->get_customer_id (), wc_stripe_order_mode ( $order ) ) )) {
|
104 |
$args[ 'customer' ] = $customer_id;
|
105 |
}
|
106 |
|
123 |
*/
|
124 |
public function get_order_charge_args(&$args, $order) {
|
125 |
$this->add_general_order_args ( $args, $order );
|
|
|
126 |
|
127 |
$args[ 'receipt_email' ] = $order->get_billing_email ();
|
128 |
$args[ 'capture' ] = $this->payment_method->get_option ( 'charge_type' ) === 'capture';
|
134 |
$args[ 'customer' ] = $customer_id;
|
135 |
}
|
136 |
|
137 |
+
$this->payment_method->add_stripe_order_args ( $args, $order );
|
138 |
+
|
139 |
return apply_filters ( 'wc_stripe_charge_order_args', $args, $order, $this->payment_method->id );
|
140 |
}
|
141 |
|
158 |
public function add_order_payment_method(&$args, $order) {
|
159 |
$args[ 'source' ] = $this->payment_method->get_payment_method_from_request ();
|
160 |
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
*
|
164 |
+
* {@inheritDoc}
|
165 |
+
*
|
166 |
+
* @see WC_Stripe_Payment::can_void_charge()
|
167 |
+
*/
|
168 |
+
public function can_void_order($order) {
|
169 |
+
return $order->get_transaction_id ();
|
170 |
+
}
|
171 |
}
|
includes/class-wc-stripe-payment-factory.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
+
/**
|
5 |
+
*
|
6 |
+
* @author PaymentPlugins
|
7 |
+
* @since 3.1.1
|
8 |
+
* @package Stripe/Classes
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
class WC_Stripe_Payment_Factory {
|
12 |
+
|
13 |
+
private static $classes = [
|
14 |
+
'charge' => 'WC_Stripe_Payment_Charge',
|
15 |
+
'payment_intent' => 'WC_Stripe_Payment_Intent',
|
16 |
+
'local_charge' => 'WC_Stripe_Payment_Charge_Local'
|
17 |
+
];
|
18 |
+
|
19 |
+
/**
|
20 |
+
*
|
21 |
+
* @param string $type
|
22 |
+
* @param WC_Payment_Gateway_Stripe $payment_method
|
23 |
+
* @param WC_Stripe_Gateway $gateway
|
24 |
+
*/
|
25 |
+
public static function load($type, $payment_method, $gateway) {
|
26 |
+
$classes = apply_filters ( 'wc_stripe_payment_classes', self::$classes );
|
27 |
+
if (! isset ( $classes[ $type ] )) {
|
28 |
+
throw Exception ( 'No class defined for type ' . $type );
|
29 |
+
}
|
30 |
+
$classname = $classes[ $type ];
|
31 |
+
|
32 |
+
$args = func_get_args ();
|
33 |
+
|
34 |
+
if (count ( $args ) > 3) {
|
35 |
+
$args = array_slice ( $args, 3 );
|
36 |
+
$instance = new $classname ( $payment_method, $gateway, ...$args );
|
37 |
+
} else {
|
38 |
+
$instance = new $classname ( $payment_method, $gateway );
|
39 |
+
}
|
40 |
+
return $instance;
|
41 |
+
}
|
42 |
+
}
|
includes/class-wc-stripe-payment-intent.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-stripe-payment.php' );
|
3 |
|
4 |
/**
|
@@ -16,8 +18,8 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
16 |
* @see WC_Stripe_Payment::process_payment()
|
17 |
*/
|
18 |
public function process_payment($order) {
|
19 |
-
// first check to see if a payment intent
|
20 |
-
if (( $intent = $
|
21 |
$intent_id = $intent[ 'id' ];
|
22 |
if ($this->can_update_payment_intent ( $order )) {
|
23 |
$intent = $this->gateway->update_payment_intent ( $intent_id, $this->get_payment_intent_args ( $order, false ) );
|
@@ -35,6 +37,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
35 |
// always update the order with the payment intent.
|
36 |
$order->update_meta_data ( WC_Stripe_Constants::PAYMENT_INTENT_ID, $intent->id );
|
37 |
$order->update_meta_data ( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, $intent->payment_method );
|
|
|
38 |
// serialize the the intent and save to the order. The intent will be used to analyze if anything
|
39 |
// has changed.
|
40 |
$order->update_meta_data ( WC_Stripe_Constants::PAYMENT_INTENT, $intent->jsonSerialize () );
|
@@ -131,7 +134,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
131 |
$args[ 'off_session' ] = true;
|
132 |
$args[ 'payment_method' ] = $this->payment_method->get_order_meta_data ( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, $order );
|
133 |
|
134 |
-
if (( $customer =
|
135 |
$args[ 'customer' ] = $customer;
|
136 |
}
|
137 |
|
@@ -168,7 +171,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
168 |
$intent = $order->get_meta ( WC_Stripe_Constants::PAYMENT_INTENT );
|
169 |
if ($intent) {
|
170 |
$order_hash = implode ( '_', [
|
171 |
-
wc_stripe_add_number_precision ( $order->get_total () ),
|
172 |
wc_stripe_get_customer_id ( $order->get_user_id () ),
|
173 |
$this->payment_method->get_payment_method_from_request (),
|
174 |
$this->payment_method->get_payment_method_type ()
|
@@ -196,15 +199,23 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
196 |
$args[ 'capture_method' ] = $this->payment_method->get_option ( 'charge_type' ) === 'capture' ? 'automatic' : 'manual';
|
197 |
$args[ 'confirm' ] = false;
|
198 |
}
|
|
|
|
|
|
|
|
|
|
|
199 |
if (( $customer_id = wc_stripe_get_customer_id ( $order->get_customer_id () ) )) {
|
200 |
$args[ 'customer' ] = $customer_id;
|
201 |
}
|
|
|
202 |
if ($this->payment_method->should_save_payment_method ( $order )) {
|
203 |
$args[ 'setup_future_usage' ] = 'off_session';
|
204 |
}
|
205 |
|
206 |
$args[ 'payment_method_types' ][] = $this->payment_method->get_payment_method_type ();
|
207 |
|
|
|
|
|
208 |
return apply_filters ( 'wc_stripe_payment_intent_args', $args, $order, $this );
|
209 |
}
|
210 |
|
@@ -223,7 +234,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
223 |
$order->save ();
|
224 |
}
|
225 |
return $this->gateway->capture_payment_intent ( $payment_intent, array(
|
226 |
-
'amount_to_capture' => wc_stripe_add_number_precision ( $amount )
|
227 |
), wc_stripe_order_mode ( $order ) );
|
228 |
}
|
229 |
|
@@ -235,7 +246,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
235 |
*/
|
236 |
public function void_charge($order) {
|
237 |
// fetch the intent and check its status
|
238 |
-
$payment_intent = $this->gateway->fetch_payment_intent ( $order->get_meta (
|
239 |
if (is_wp_error ( $payment_intent )) {
|
240 |
return $payment_intent;
|
241 |
}
|
@@ -269,11 +280,40 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
269 |
* @see WC_Stripe_Payment::add_order_payment_method()
|
270 |
*/
|
271 |
public function add_order_payment_method(&$args, $order) {
|
272 |
-
// if ($order->get_meta ( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, true ) !== $this->payment_method->get_payment_method_from_request ()) {
|
273 |
$args[ 'payment_method' ] = $this->payment_method->get_payment_method_from_request ();
|
274 |
if (empty ( $args[ 'payment_method' ] )) {
|
275 |
unset ( $args[ 'payment_method' ] );
|
276 |
}
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
}
|
279 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
require_once ( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-stripe-payment.php' );
|
5 |
|
6 |
/**
|
18 |
* @see WC_Stripe_Payment::process_payment()
|
19 |
*/
|
20 |
public function process_payment($order) {
|
21 |
+
// first check to see if a payment intent can be used
|
22 |
+
if (( $intent = $this->can_use_payment_intent ( $order ) )) {
|
23 |
$intent_id = $intent[ 'id' ];
|
24 |
if ($this->can_update_payment_intent ( $order )) {
|
25 |
$intent = $this->gateway->update_payment_intent ( $intent_id, $this->get_payment_intent_args ( $order, false ) );
|
37 |
// always update the order with the payment intent.
|
38 |
$order->update_meta_data ( WC_Stripe_Constants::PAYMENT_INTENT_ID, $intent->id );
|
39 |
$order->update_meta_data ( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, $intent->payment_method );
|
40 |
+
$order->update_meta_data ( WC_Stripe_Constants::MODE, wc_stripe_mode () );
|
41 |
// serialize the the intent and save to the order. The intent will be used to analyze if anything
|
42 |
// has changed.
|
43 |
$order->update_meta_data ( WC_Stripe_Constants::PAYMENT_INTENT, $intent->jsonSerialize () );
|
134 |
$args[ 'off_session' ] = true;
|
135 |
$args[ 'payment_method' ] = $this->payment_method->get_order_meta_data ( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, $order );
|
136 |
|
137 |
+
if (( $customer = $this->payment_method->get_order_meta_data ( WC_Stripe_Constants::CUSTOMER_ID, $order ) )) {
|
138 |
$args[ 'customer' ] = $customer;
|
139 |
}
|
140 |
|
171 |
$intent = $order->get_meta ( WC_Stripe_Constants::PAYMENT_INTENT );
|
172 |
if ($intent) {
|
173 |
$order_hash = implode ( '_', [
|
174 |
+
wc_stripe_add_number_precision ( $order->get_total (), $order->get_currency () ),
|
175 |
wc_stripe_get_customer_id ( $order->get_user_id () ),
|
176 |
$this->payment_method->get_payment_method_from_request (),
|
177 |
$this->payment_method->get_payment_method_type ()
|
199 |
$args[ 'capture_method' ] = $this->payment_method->get_option ( 'charge_type' ) === 'capture' ? 'automatic' : 'manual';
|
200 |
$args[ 'confirm' ] = false;
|
201 |
}
|
202 |
+
|
203 |
+
if (( $email = $order->get_billing_email () )) {
|
204 |
+
$args[ 'receipt_email' ] = $email;
|
205 |
+
}
|
206 |
+
|
207 |
if (( $customer_id = wc_stripe_get_customer_id ( $order->get_customer_id () ) )) {
|
208 |
$args[ 'customer' ] = $customer_id;
|
209 |
}
|
210 |
+
|
211 |
if ($this->payment_method->should_save_payment_method ( $order )) {
|
212 |
$args[ 'setup_future_usage' ] = 'off_session';
|
213 |
}
|
214 |
|
215 |
$args[ 'payment_method_types' ][] = $this->payment_method->get_payment_method_type ();
|
216 |
|
217 |
+
$this->payment_method->add_stripe_order_args ( $args, $order );
|
218 |
+
|
219 |
return apply_filters ( 'wc_stripe_payment_intent_args', $args, $order, $this );
|
220 |
}
|
221 |
|
234 |
$order->save ();
|
235 |
}
|
236 |
return $this->gateway->capture_payment_intent ( $payment_intent, array(
|
237 |
+
'amount_to_capture' => wc_stripe_add_number_precision ( $amount, $order->get_currency () )
|
238 |
), wc_stripe_order_mode ( $order ) );
|
239 |
}
|
240 |
|
246 |
*/
|
247 |
public function void_charge($order) {
|
248 |
// fetch the intent and check its status
|
249 |
+
$payment_intent = $this->gateway->fetch_payment_intent ( $order->get_meta ( WC_Stripe_Constants::PAYMENT_INTENT_ID ), wc_stripe_order_mode ( $order ) );
|
250 |
if (is_wp_error ( $payment_intent )) {
|
251 |
return $payment_intent;
|
252 |
}
|
280 |
* @see WC_Stripe_Payment::add_order_payment_method()
|
281 |
*/
|
282 |
public function add_order_payment_method(&$args, $order) {
|
|
|
283 |
$args[ 'payment_method' ] = $this->payment_method->get_payment_method_from_request ();
|
284 |
if (empty ( $args[ 'payment_method' ] )) {
|
285 |
unset ( $args[ 'payment_method' ] );
|
286 |
}
|
287 |
+
}
|
288 |
+
|
289 |
+
/**
|
290 |
+
*
|
291 |
+
* @param WC_Order $order
|
292 |
+
*/
|
293 |
+
public function can_use_payment_intent($order) {
|
294 |
+
$intent = $order->get_meta ( WC_Stripe_Constants::PAYMENT_INTENT );
|
295 |
+
|
296 |
+
if ($intent) {
|
297 |
+
if ($intent[ 'confirmation_method' ] != $this->payment_method->get_confirmation_method ( $order )) {
|
298 |
+
return false;
|
299 |
+
}
|
300 |
+
|
301 |
+
// compare the active environment to the order's environment
|
302 |
+
if (wc_stripe_order_mode ( $order ) != wc_stripe_mode ()) {
|
303 |
+
return false;
|
304 |
+
}
|
305 |
+
return $intent;
|
306 |
+
}
|
307 |
+
return false;
|
308 |
+
}
|
309 |
+
|
310 |
+
/**
|
311 |
+
*
|
312 |
+
* {@inheritDoc}
|
313 |
+
*
|
314 |
+
* @see WC_Stripe_Payment::can_void_charge()
|
315 |
+
*/
|
316 |
+
public function can_void_order($order) {
|
317 |
+
return $order->get_meta ( WC_Stripe_Constants::PAYMENT_INTENT_ID );
|
318 |
}
|
319 |
}
|
includes/class-wc-stripe-redirect-handler.php
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
* @author PaymentPlugins
|
5 |
* @package Stripe/Classes
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Stripe_Redirect_Handler {
|
9 |
|
@@ -20,38 +22,33 @@ class WC_Stripe_Redirect_Handler {
|
|
20 |
* Check if this request is for a local payment redirect.
|
21 |
*/
|
22 |
public static function local_payment_redirect() {
|
23 |
-
// resource created server side.
|
24 |
-
if (isset ( $_GET[ 'wc-stripe-local-gateway' ], $_GET[ '_payment_nonce' ], $_GET[ 'order_id' ] ) && wp_verify_nonce ( $_GET[ '_payment_nonce' ], 'local-payment-' . $_GET[ 'order_id' ] )) {
|
25 |
-
self::process_redirect ( wc_clean ( absint ( $_GET[ 'order_id' ] ) ) );
|
26 |
-
}
|
27 |
-
// resource created client side.
|
28 |
if (isset ( $_GET[ 'wc-stripe-local-gateway' ], $_GET[ '_payment_nonce' ] ) && wp_verify_nonce ( $_GET[ '_payment_nonce' ], 'local-payment' )) {
|
29 |
-
self::process_redirect (
|
30 |
}
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
*/
|
35 |
-
public static function process_redirect(
|
36 |
-
$order = wc_get_order ( $order_id );
|
37 |
-
/**
|
38 |
-
*
|
39 |
-
* @var WC_Payment_Gateway_Stripe_Local_Payment $payment_method
|
40 |
-
*/
|
41 |
-
$payment_method = WC ()->payment_gateways ()->payment_gateways ()[ $order->get_payment_method () ];
|
42 |
-
|
43 |
-
// first do some validations on the source
|
44 |
-
$stripe_gateway = WC_Stripe_Gateway::load ();
|
45 |
-
|
46 |
if (isset ( $_GET[ 'source' ] )) {
|
47 |
-
$result =
|
48 |
} else {
|
49 |
-
$result =
|
50 |
}
|
51 |
if (is_wp_error ( $result )) {
|
52 |
wc_add_notice ( sprintf ( __ ( 'Error retrieving payment source. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ), 'error' );
|
53 |
return;
|
54 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
if ('failed' === $result->status || 'requires_payment_method' == $result->status) {
|
56 |
wc_add_notice ( __ ( 'Payment authorization failed. Please select another payment method.', 'woo-stripe-payment' ), 'error' );
|
57 |
$order->update_status ( 'failed', __ ( 'Payment authorization failed.', 'woo-stripe-payment' ) );
|
@@ -60,35 +57,28 @@ class WC_Stripe_Redirect_Handler {
|
|
60 |
}
|
61 |
return;
|
62 |
} elseif ('chargeable' === $result->status) {
|
63 |
-
if ($payment_method->has_order_lock ( $order )) {
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
$result = $payment_method->process_payment ( $order_id );
|
73 |
-
if ($result[ 'result' ] === 'success') {
|
74 |
-
wp_safe_redirect ( $result[ 'redirect' ] );
|
75 |
-
die ();
|
76 |
}
|
77 |
} elseif ('succeeded' == $result->status) {
|
78 |
-
if ($payment_method->has_order_lock ( $order )) {
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
if ($result[ 'result' ] === 'success') {
|
85 |
-
wp_safe_redirect ( $result[ 'redirect' ] );
|
86 |
-
die ();
|
87 |
}
|
88 |
}
|
|
|
|
|
89 |
}
|
90 |
-
wp_safe_redirect ( $order->get_checkout_order_received_url () );
|
91 |
-
exit ();
|
92 |
}
|
93 |
|
94 |
public static function maybe_restore_cart() {
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @author PaymentPlugins
|
7 |
* @package Stripe/Classes
|
8 |
+
*
|
9 |
*/
|
10 |
class WC_Stripe_Redirect_Handler {
|
11 |
|
22 |
* Check if this request is for a local payment redirect.
|
23 |
*/
|
24 |
public static function local_payment_redirect() {
|
|
|
|
|
|
|
|
|
|
|
25 |
if (isset ( $_GET[ 'wc-stripe-local-gateway' ], $_GET[ '_payment_nonce' ] ) && wp_verify_nonce ( $_GET[ '_payment_nonce' ], 'local-payment' )) {
|
26 |
+
self::process_redirect ();
|
27 |
}
|
28 |
}
|
29 |
|
30 |
/**
|
31 |
*/
|
32 |
+
public static function process_redirect() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
if (isset ( $_GET[ 'source' ] )) {
|
34 |
+
$result = WC_Stripe_Gateway::load ()->fetch_payment_source ( wc_clean ( $_GET[ 'source' ] ) );
|
35 |
} else {
|
36 |
+
$result = WC_Stripe_Gateway::load ()->fetch_payment_intent ( wc_clean ( $_GET[ 'payment_intent' ] ) );
|
37 |
}
|
38 |
if (is_wp_error ( $result )) {
|
39 |
wc_add_notice ( sprintf ( __ ( 'Error retrieving payment source. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ), 'error' );
|
40 |
return;
|
41 |
} else {
|
42 |
+
$order_id = $result->metadata[ 'order_id' ];
|
43 |
+
$order = wc_get_order ( $order_id );
|
44 |
+
|
45 |
+
/**
|
46 |
+
*
|
47 |
+
* @var WC_Payment_Gateway_Stripe_Local_Payment $payment_method
|
48 |
+
*/
|
49 |
+
$payment_method = WC ()->payment_gateways ()->payment_gateways ()[ $order->get_payment_method () ];
|
50 |
+
$redirect = $order->get_checkout_order_received_url ();
|
51 |
+
|
52 |
if ('failed' === $result->status || 'requires_payment_method' == $result->status) {
|
53 |
wc_add_notice ( __ ( 'Payment authorization failed. Please select another payment method.', 'woo-stripe-payment' ), 'error' );
|
54 |
$order->update_status ( 'failed', __ ( 'Payment authorization failed.', 'woo-stripe-payment' ) );
|
57 |
}
|
58 |
return;
|
59 |
} elseif ('chargeable' === $result->status) {
|
60 |
+
if (! $payment_method->has_order_lock ( $order ) && ! $order->get_transaction_id ()) {
|
61 |
+
$payment_method->set_order_lock ( $order );
|
62 |
+
$payment_method->set_new_source_token ( $result->id );
|
63 |
+
wc_stripe_log_info ( 'processing from redirect handler.' );
|
64 |
+
$result = $payment_method->process_payment ( $order_id );
|
65 |
+
// we don't release the order lock so there aren't conflicts with the source.chargeable webhook
|
66 |
+
if ($result[ 'result' ] === 'success') {
|
67 |
+
$redirect = $result[ 'redirect' ];
|
68 |
+
}
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
} elseif ('succeeded' == $result->status) {
|
71 |
+
if (! $payment_method->has_order_lock ( $order )) {
|
72 |
+
$payment_method->set_order_lock ( $order );
|
73 |
+
$result = $payment_method->process_payment ( $order_id );
|
74 |
+
if ($result[ 'result' ] === 'success') {
|
75 |
+
$redirect = $result[ 'redirect' ];
|
76 |
+
}
|
|
|
|
|
|
|
77 |
}
|
78 |
}
|
79 |
+
wp_safe_redirect ( $redirect );
|
80 |
+
exit ();
|
81 |
}
|
|
|
|
|
82 |
}
|
83 |
|
84 |
public static function maybe_restore_cart() {
|
includes/class-wc-stripe-rest-api.php
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
* @author PaymentPlugins
|
5 |
* @package Stripe/Classes
|
6 |
-
* @
|
7 |
* @property WC_Stripe_Rest_Controller $cart
|
8 |
* @property WC_Stripe_Rest_Controller $checkout
|
9 |
-
* @
|
10 |
* @property WC_Stripe_Rest_Controller $googlepay
|
11 |
* @property WC_Stripe_Rest_Controller $settings
|
12 |
* @property WC_Stripe_Rest_Controller $webhook
|
@@ -34,7 +36,7 @@ class WC_Stripe_Rest_API {
|
|
34 |
|
35 |
/**
|
36 |
*
|
37 |
-
* @param
|
38 |
*/
|
39 |
public function __get($key) {
|
40 |
$controller = isset ( $this->controllers[ $key ] ) ? $this->controllers[ $key ] : '';
|
@@ -105,7 +107,7 @@ class WC_Stripe_Rest_API {
|
|
105 |
* @param bool $bool
|
106 |
*/
|
107 |
public static function is_rest_api_request($bool) {
|
108 |
-
if (! empty ( $_SERVER[ 'REQUEST_URI' ] ) && strpos ( $_SERVER[ 'REQUEST_URI' ], wc_stripe ()->rest_uri () ) !==
|
109 |
$bool = false;
|
110 |
}
|
111 |
return $bool;
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @author PaymentPlugins
|
7 |
* @package Stripe/Classes
|
8 |
+
* @property WC_Stripe_Rest_Controller $order_actions
|
9 |
* @property WC_Stripe_Rest_Controller $cart
|
10 |
* @property WC_Stripe_Rest_Controller $checkout
|
11 |
+
* @property WC_Stripe_Rest_Controller $payment_intent
|
12 |
* @property WC_Stripe_Rest_Controller $googlepay
|
13 |
* @property WC_Stripe_Rest_Controller $settings
|
14 |
* @property WC_Stripe_Rest_Controller $webhook
|
36 |
|
37 |
/**
|
38 |
*
|
39 |
+
* @param WC_Stripe_Rest_Controller $key
|
40 |
*/
|
41 |
public function __get($key) {
|
42 |
$controller = isset ( $this->controllers[ $key ] ) ? $this->controllers[ $key ] : '';
|
107 |
* @param bool $bool
|
108 |
*/
|
109 |
public static function is_rest_api_request($bool) {
|
110 |
+
if (! empty ( $_SERVER[ 'REQUEST_URI' ] ) && strpos ( $_SERVER[ 'REQUEST_URI' ], wc_stripe ()->rest_uri () ) !== false) {
|
111 |
$bool = false;
|
112 |
}
|
113 |
return $bool;
|
includes/class-wc-stripe-update.php
CHANGED
@@ -1,9 +1,18 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class WC_Stripe_Update {
|
3 |
|
4 |
private static $updates = [
|
5 |
'3.0.7' => 'update-3.0.7.php',
|
6 |
-
'3.1.0' => 'update-3.1.0.php'
|
|
|
7 |
];
|
8 |
|
9 |
public static function init() {
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
+
/**
|
5 |
+
*
|
6 |
+
* @author PaymentPlugins
|
7 |
+
* @package Stripe/Classes
|
8 |
+
*
|
9 |
+
*/
|
10 |
class WC_Stripe_Update {
|
11 |
|
12 |
private static $updates = [
|
13 |
'3.0.7' => 'update-3.0.7.php',
|
14 |
+
'3.1.0' => 'update-3.1.0.php',
|
15 |
+
'3.1.1' => 'update-3.1.1.php'
|
16 |
];
|
17 |
|
18 |
public static function init() {
|
includes/controllers/class-wc-stripe-controller-cart.php
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
* Controller class that perfors cart operations for client side requests.
|
|
|
4 |
* @author PaymentPlugins
|
5 |
* @package Stripe/Controllers
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Stripe_Controller_Cart extends WC_Stripe_Rest_Controller {
|
9 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
* Controller class that perfors cart operations for client side requests.
|
6 |
+
*
|
7 |
* @author PaymentPlugins
|
8 |
* @package Stripe/Controllers
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Stripe_Controller_Cart extends WC_Stripe_Rest_Controller {
|
12 |
|
includes/controllers/class-wc-stripe-controller-checkout.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Stripe_Rest_Controller' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Stripe_Rest_Controller' )) {
|
5 |
return;
|
6 |
}
|
includes/controllers/class-wc-stripe-controller-gateway-settings.php
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @package Stripe/Controllers
|
4 |
* @author PaymentPlugins
|
5 |
-
*
|
6 |
*/
|
7 |
class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
8 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @package Stripe/Controllers
|
7 |
* @author PaymentPlugins
|
8 |
+
*
|
9 |
*/
|
10 |
class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
11 |
|
includes/controllers/class-wc-stripe-controller-googlepay.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Stripe_Rest_Controller' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Stripe_Rest_Controller' )) {
|
5 |
return;
|
6 |
}
|
includes/controllers/class-wc-stripe-controller-order-actions.php
CHANGED
@@ -1,4 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class WC_Stripe_Controller_Order_Actions extends WC_Stripe_Rest_Controller {
|
3 |
|
4 |
protected $namespace = 'order~action/';
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
+
/**
|
5 |
+
*
|
6 |
+
* @author PaymentPlugins
|
7 |
+
* @package Stripe/Controllers
|
8 |
+
*
|
9 |
+
*/
|
10 |
class WC_Stripe_Controller_Order_Actions extends WC_Stripe_Rest_Controller {
|
11 |
|
12 |
protected $namespace = 'order~action/';
|
includes/controllers/class-wc-stripe-controller-payment-intent.php
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
* Controller which handles Payment Intent related actions such as creation.
|
|
|
4 |
* @author PaymentPlugins
|
5 |
-
* @package Stripe/
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Stripe_Controller_Payment_Intent extends WC_Stripe_Rest_Controller {
|
9 |
|
@@ -66,12 +69,8 @@ class WC_Stripe_Controller_Payment_Intent extends WC_Stripe_Rest_Controller {
|
|
66 |
if (! $order) {
|
67 |
throw new Exception ( __ ( 'Invalid order id provided', 'woo-stripe-payment' ) );
|
68 |
}
|
69 |
-
|
70 |
-
|
71 |
-
* @var WC_Payment_Gateway_Stripe $payment_method
|
72 |
-
*/
|
73 |
-
$payment_method = WC ()->payment_gateways ()->payment_gateways ()[ $order->get_payment_method () ];
|
74 |
-
$intent = $payment_method->payment_object->get_gateway ()->fetch_payment_intent ( $order->get_meta ( '_payment_intent_id' ) );
|
75 |
|
76 |
if ($intent->client_secret != $request->get_param ( 'client_secret' )) {
|
77 |
throw new Exception ( __ ( 'You are not authorized to update this order.', 'woo-stripe-payment' ) );
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
* Controller which handles Payment Intent related actions such as creation.
|
6 |
+
*
|
7 |
* @author PaymentPlugins
|
8 |
+
* @package Stripe/Controllers
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Stripe_Controller_Payment_Intent extends WC_Stripe_Rest_Controller {
|
12 |
|
69 |
if (! $order) {
|
70 |
throw new Exception ( __ ( 'Invalid order id provided', 'woo-stripe-payment' ) );
|
71 |
}
|
72 |
+
|
73 |
+
$intent = WC_Stripe_Gateway::load ()->fetch_payment_intent ( $order->get_meta ( WC_Stripe_Constants::PAYMENT_INTENT_ID ) );
|
|
|
|
|
|
|
|
|
74 |
|
75 |
if ($intent->client_secret != $request->get_param ( 'client_secret' )) {
|
76 |
throw new Exception ( __ ( 'You are not authorized to update this order.', 'woo-stripe-payment' ) );
|
includes/controllers/class-wc-stripe-controller-payment-method.php
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @package Stripe/Controllers
|
4 |
* @author PaymentPlugins
|
5 |
* @since 3.0.0
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Stripe_Controller_Payment_Method extends WC_Stripe_Rest_Controller {
|
9 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @package Stripe/Controllers
|
7 |
* @author PaymentPlugins
|
8 |
* @since 3.0.0
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Stripe_Controller_Payment_Method extends WC_Stripe_Rest_Controller {
|
12 |
|
includes/controllers/class-wc-stripe-controller-webhook.php
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
* @author PaymentPlugins
|
5 |
* @package Stripe/Controllers
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Stripe_Controller_Webhook extends WC_Stripe_Rest_Controller {
|
9 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @author PaymentPlugins
|
7 |
* @package Stripe/Controllers
|
8 |
+
*
|
9 |
*/
|
10 |
class WC_Stripe_Controller_Webhook extends WC_Stripe_Rest_Controller {
|
11 |
|
includes/gateways/class-wc-payment-gateway-stripe-ach-v2.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
* Gateway that processes ACH payments.
|
4 |
* Only available for U.S. based merchants at this time.
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
* Gateway that processes ACH payments.
|
6 |
* Only available for U.S. based merchants at this time.
|
includes/gateways/class-wc-payment-gateway-stripe-ach.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
* Gateway that processes ACH payments.
|
4 |
* Only available for U.S. based merchants at this time.
|
@@ -318,5 +320,31 @@ class WC_Payment_Gateway_Stripe_ACH extends WC_Payment_Gateway_Stripe {
|
|
318 |
}
|
319 |
}
|
320 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
}
|
322 |
WC_Payment_Gateway_Stripe_ACH::init ();
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
* Gateway that processes ACH payments.
|
6 |
* Only available for U.S. based merchants at this time.
|
320 |
}
|
321 |
}
|
322 |
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Override so Plaid token can be converted to a Stripe bank token.
|
326 |
+
*
|
327 |
+
* {@inheritDoc}
|
328 |
+
*
|
329 |
+
* @see WC_Payment_Gateway_Stripe::create_payment_method()
|
330 |
+
*/
|
331 |
+
public function create_payment_method($id, $customer_id) {
|
332 |
+
if ($this->is_change_payment_method_request ()) {
|
333 |
+
$result = $this->fetch_access_token ( $this->get_public_token () );
|
334 |
+
|
335 |
+
if (is_wp_error ( $result )) {
|
336 |
+
return $result;
|
337 |
+
}
|
338 |
+
|
339 |
+
$result = $this->fetch_bank_token ( $result->access_token );
|
340 |
+
|
341 |
+
if (is_wp_error ( $result )) {
|
342 |
+
return $result;
|
343 |
+
}
|
344 |
+
|
345 |
+
$id = $result->stripe_bank_account_token;
|
346 |
+
}
|
347 |
+
return parent::create_payment_method ( $id, $customer_id );
|
348 |
+
}
|
349 |
}
|
350 |
WC_Payment_Gateway_Stripe_ACH::init ();
|
includes/gateways/class-wc-payment-gateway-stripe-alipay.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
includes/gateways/class-wc-payment-gateway-stripe-applepay.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe' )) {
|
5 |
return;
|
6 |
}
|
includes/gateways/class-wc-payment-gateway-stripe-bancontact.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
@@ -9,9 +11,9 @@ if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
|
9 |
*
|
10 |
*/
|
11 |
class WC_Payment_Gateway_Stripe_Bancontact extends WC_Payment_Gateway_Stripe_Local_Payment {
|
12 |
-
|
13 |
-
use WC_Stripe_Local_Payment_Charge_Trait;
|
14 |
|
|
|
|
|
15 |
public function __construct() {
|
16 |
$this->synchronous = false;
|
17 |
$this->local_payment_type = 'bancontact';
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
11 |
*
|
12 |
*/
|
13 |
class WC_Payment_Gateway_Stripe_Bancontact extends WC_Payment_Gateway_Stripe_Local_Payment {
|
|
|
|
|
14 |
|
15 |
+
use WC_Stripe_Local_Payment_Charge_Trait;
|
16 |
+
|
17 |
public function __construct() {
|
18 |
$this->synchronous = false;
|
19 |
$this->local_payment_type = 'bancontact';
|
includes/gateways/class-wc-payment-gateway-stripe-cc.php
CHANGED
@@ -1,16 +1,19 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @since 3.0.0
|
4 |
* @package Stripe/Gateways
|
5 |
* @author User
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
|
9 |
-
|
10 |
-
use WC_Stripe_Payment_Intent_Trait;
|
11 |
|
|
|
|
|
12 |
protected $payment_method_type = 'card';
|
13 |
-
|
14 |
public function __construct() {
|
15 |
$this->id = 'stripe_cc';
|
16 |
$this->tab_title = __ ( 'Credit Cards', 'woo-stripe-payment' );
|
@@ -145,4 +148,17 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
|
|
145 |
'NL' => '^([1-9][0-9]{3})(\s?)(?!SA|SD|SS)[A-Z]{2}$'
|
146 |
];
|
147 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @since 3.0.0
|
7 |
* @package Stripe/Gateways
|
8 |
* @author User
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
|
|
|
|
|
12 |
|
13 |
+
use WC_Stripe_Payment_Intent_Trait;
|
14 |
+
|
15 |
protected $payment_method_type = 'card';
|
16 |
+
|
17 |
public function __construct() {
|
18 |
$this->id = 'stripe_cc';
|
19 |
$this->tab_title = __ ( 'Credit Cards', 'woo-stripe-payment' );
|
148 |
'NL' => '^([1-9][0-9]{3})(\s?)(?!SA|SD|SS)[A-Z]{2}$'
|
149 |
];
|
150 |
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
*
|
154 |
+
* {@inheritDoc}
|
155 |
+
*
|
156 |
+
* @see WC_Payment_Gateway_Stripe::add_stripe_order_args()
|
157 |
+
*/
|
158 |
+
public function add_stripe_order_args(&$args, $order) {
|
159 |
+
// if the merchant is forcing 3D secure for all intents then add the required args.
|
160 |
+
if ($this->is_active ( 'force_3d_secure' ) && ! doing_action ( 'woocommerce_scheduled_subscription_payment_' . $this->id )) {
|
161 |
+
$args[ 'payment_method_options' ][ 'card' ][ 'request_three_d_secure' ] = 'any';
|
162 |
+
}
|
163 |
+
}
|
164 |
}
|
includes/gateways/class-wc-payment-gateway-stripe-eps.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
@@ -9,9 +11,9 @@ if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
|
9 |
*
|
10 |
*/
|
11 |
class WC_Payment_Gateway_Stripe_EPS extends WC_Payment_Gateway_Stripe_Local_Payment {
|
12 |
-
|
13 |
-
use WC_Stripe_Local_Payment_Charge_Trait;
|
14 |
|
|
|
|
|
15 |
public function __construct() {
|
16 |
$this->local_payment_type = 'eps';
|
17 |
$this->currencies = [ 'EUR'
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
11 |
*
|
12 |
*/
|
13 |
class WC_Payment_Gateway_Stripe_EPS extends WC_Payment_Gateway_Stripe_Local_Payment {
|
|
|
|
|
14 |
|
15 |
+
use WC_Stripe_Local_Payment_Charge_Trait;
|
16 |
+
|
17 |
public function __construct() {
|
18 |
$this->local_payment_type = 'eps';
|
19 |
$this->currencies = [ 'EUR'
|
includes/gateways/class-wc-payment-gateway-stripe-fpx.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
includes/gateways/class-wc-payment-gateway-stripe-giropay.php
CHANGED
@@ -1,16 +1,19 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
5 |
/**
|
|
|
6 |
* @package Stripe/Gateways
|
7 |
* @author PaymentPlugins
|
8 |
-
*
|
9 |
*/
|
10 |
class WC_Payment_Gateway_Stripe_Giropay extends WC_Payment_Gateway_Stripe_Local_Payment {
|
11 |
-
|
12 |
-
use WC_Stripe_Local_Payment_Charge_Trait;
|
13 |
|
|
|
|
|
14 |
public function __construct() {
|
15 |
$this->local_payment_type = 'giropay';
|
16 |
$this->currencies = [ 'EUR'
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
7 |
/**
|
8 |
+
*
|
9 |
* @package Stripe/Gateways
|
10 |
* @author PaymentPlugins
|
11 |
+
*
|
12 |
*/
|
13 |
class WC_Payment_Gateway_Stripe_Giropay extends WC_Payment_Gateway_Stripe_Local_Payment {
|
|
|
|
|
14 |
|
15 |
+
use WC_Stripe_Local_Payment_Charge_Trait;
|
16 |
+
|
17 |
public function __construct() {
|
18 |
$this->local_payment_type = 'giropay';
|
19 |
$this->currencies = [ 'EUR'
|
includes/gateways/class-wc-payment-gateway-stripe-googlepay.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe' )) {
|
5 |
return;
|
6 |
}
|
includes/gateways/class-wc-payment-gateway-stripe-ideal.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
includes/gateways/class-wc-payment-gateway-stripe-klarna.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
@@ -134,7 +136,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
134 |
*/
|
135 |
$args[ 'source_order' ][ 'items' ][] = [
|
136 |
'type' => 'sku',
|
137 |
-
'amount' => wc_stripe_add_number_precision ( $item->get_subtotal () ),
|
138 |
'currency' => $order->get_currency (),
|
139 |
'quantity' => $item->get_quantity (),
|
140 |
'description' => $item->get_name ()
|
@@ -144,7 +146,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
144 |
if ($order->get_shipping_total ()) {
|
145 |
$args[ 'source_order' ][ 'items' ][] = [
|
146 |
'type' => 'shipping',
|
147 |
-
'amount' => wc_stripe_add_number_precision ( $order->get_shipping_total () ),
|
148 |
'currency' => $order->get_currency (),
|
149 |
'quantity' => 1,
|
150 |
'description' => __ ( 'Shipping', 'woo-stripe-payment' )
|
@@ -154,7 +156,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
154 |
if ($order->get_discount_total ()) {
|
155 |
$args[ 'source_order' ][ 'items' ][] = [
|
156 |
'type' => 'discount',
|
157 |
-
'amount' => - 1 * wc_stripe_add_number_precision ( $order->get_discount_total () ),
|
158 |
'currency' => $order->get_currency (),
|
159 |
'quantity' => 1,
|
160 |
'description' => __ ( 'Discount', 'woo-stripe-payment' )
|
@@ -164,7 +166,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
164 |
if ($order->get_fees ()) {
|
165 |
$fee_total = 0;
|
166 |
foreach ( $order->get_fees () as $fee ) {
|
167 |
-
$fee_total += wc_stripe_add_number_precision ( $fee->get_total () );
|
168 |
}
|
169 |
$args[ 'source_order' ][ 'items' ][] = [
|
170 |
'type' => 'sku', 'amount' => $fee_total,
|
@@ -192,7 +194,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
192 |
*
|
193 |
* @see WC_Payment_Gateway_Stripe_Local_Payment::get_source_redirect_url()
|
194 |
*/
|
195 |
-
|
196 |
return '#local_payment=klarna&redirect=' . $this->get_local_payment_return_url ( $order ) . '&encoded_source=' . base64_encode ( wp_json_encode ( $source ) );
|
197 |
}
|
198 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
136 |
*/
|
137 |
$args[ 'source_order' ][ 'items' ][] = [
|
138 |
'type' => 'sku',
|
139 |
+
'amount' => wc_stripe_add_number_precision ( $item->get_subtotal (), $order->get_currency () ),
|
140 |
'currency' => $order->get_currency (),
|
141 |
'quantity' => $item->get_quantity (),
|
142 |
'description' => $item->get_name ()
|
146 |
if ($order->get_shipping_total ()) {
|
147 |
$args[ 'source_order' ][ 'items' ][] = [
|
148 |
'type' => 'shipping',
|
149 |
+
'amount' => wc_stripe_add_number_precision ( $order->get_shipping_total (), $order->get_currency () ),
|
150 |
'currency' => $order->get_currency (),
|
151 |
'quantity' => 1,
|
152 |
'description' => __ ( 'Shipping', 'woo-stripe-payment' )
|
156 |
if ($order->get_discount_total ()) {
|
157 |
$args[ 'source_order' ][ 'items' ][] = [
|
158 |
'type' => 'discount',
|
159 |
+
'amount' => - 1 * wc_stripe_add_number_precision ( $order->get_discount_total (), $order->get_currency () ),
|
160 |
'currency' => $order->get_currency (),
|
161 |
'quantity' => 1,
|
162 |
'description' => __ ( 'Discount', 'woo-stripe-payment' )
|
166 |
if ($order->get_fees ()) {
|
167 |
$fee_total = 0;
|
168 |
foreach ( $order->get_fees () as $fee ) {
|
169 |
+
$fee_total += wc_stripe_add_number_precision ( $fee->get_total (), $order->get_currency () );
|
170 |
}
|
171 |
$args[ 'source_order' ][ 'items' ][] = [
|
172 |
'type' => 'sku', 'amount' => $fee_total,
|
194 |
*
|
195 |
* @see WC_Payment_Gateway_Stripe_Local_Payment::get_source_redirect_url()
|
196 |
*/
|
197 |
+
public function get_source_redirect_url($source, $order) {
|
198 |
return '#local_payment=klarna&redirect=' . $this->get_local_payment_return_url ( $order ) . '&encoded_source=' . base64_encode ( wp_json_encode ( $source ) );
|
199 |
}
|
200 |
|
includes/gateways/class-wc-payment-gateway-stripe-multibanco.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
@@ -9,9 +11,9 @@ if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
|
9 |
*
|
10 |
*/
|
11 |
class WC_Payment_Gateway_Stripe_Multibanco extends WC_Payment_Gateway_Stripe_Local_Payment {
|
12 |
-
|
13 |
-
use WC_Stripe_Local_Payment_Charge_Trait;
|
14 |
|
|
|
|
|
15 |
public function __construct() {
|
16 |
$this->local_payment_type = 'multibanco';
|
17 |
$this->currencies = [ 'EUR'
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
11 |
*
|
12 |
*/
|
13 |
class WC_Payment_Gateway_Stripe_Multibanco extends WC_Payment_Gateway_Stripe_Local_Payment {
|
|
|
|
|
14 |
|
15 |
+
use WC_Stripe_Local_Payment_Charge_Trait;
|
16 |
+
|
17 |
public function __construct() {
|
18 |
$this->local_payment_type = 'multibanco';
|
19 |
$this->currencies = [ 'EUR'
|
includes/gateways/class-wc-payment-gateway-stripe-p24.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
@@ -9,9 +11,9 @@ if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
|
9 |
*
|
10 |
*/
|
11 |
class WC_Payment_Gateway_Stripe_P24 extends WC_Payment_Gateway_Stripe_Local_Payment {
|
12 |
-
|
13 |
-
use WC_Stripe_Local_Payment_Charge_Trait;
|
14 |
|
|
|
|
|
15 |
public function __construct() {
|
16 |
$this->local_payment_type = 'p24';
|
17 |
$this->currencies = [ 'EUR', 'PLN'
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
11 |
*
|
12 |
*/
|
13 |
class WC_Payment_Gateway_Stripe_P24 extends WC_Payment_Gateway_Stripe_Local_Payment {
|
|
|
|
|
14 |
|
15 |
+
use WC_Stripe_Local_Payment_Charge_Trait;
|
16 |
+
|
17 |
public function __construct() {
|
18 |
$this->local_payment_type = 'p24';
|
19 |
$this->currencies = [ 'EUR', 'PLN'
|
includes/gateways/class-wc-payment-gateway-stripe-payment-request.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe' )) {
|
5 |
return;
|
6 |
}
|
includes/gateways/class-wc-payment-gateway-stripe-sepa.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
@@ -9,9 +11,9 @@ if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
|
9 |
*
|
10 |
*/
|
11 |
class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Payment {
|
12 |
-
|
13 |
-
use WC_Stripe_Local_Payment_Charge_Trait;
|
14 |
|
|
|
|
|
15 |
public function __construct() {
|
16 |
$this->synchronous = false;
|
17 |
$this->local_payment_type = 'sepa_debit';
|
@@ -26,6 +28,11 @@ class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Pay
|
|
26 |
$this->icon = wc_stripe ()->assets_url ( 'img/sepa.svg' );
|
27 |
$this->order_button_text = __ ( 'SEPA', 'woo-stripe-payment' );
|
28 |
parent::__construct ();
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
|
31 |
public function get_element_params() {
|
@@ -34,4 +41,20 @@ class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Pay
|
|
34 |
]
|
35 |
] );
|
36 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
11 |
*
|
12 |
*/
|
13 |
class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Payment {
|
|
|
|
|
14 |
|
15 |
+
use WC_Stripe_Local_Payment_Charge_Trait;
|
16 |
+
|
17 |
public function __construct() {
|
18 |
$this->synchronous = false;
|
19 |
$this->local_payment_type = 'sepa_debit';
|
28 |
$this->icon = wc_stripe ()->assets_url ( 'img/sepa.svg' );
|
29 |
$this->order_button_text = __ ( 'SEPA', 'woo-stripe-payment' );
|
30 |
parent::__construct ();
|
31 |
+
|
32 |
+
$this->local_payment_description = sprintf ( __ ( 'By providing your IBAN and confirming this payment, you are
|
33 |
+
authorizing %s and Stripe, our payment service provider, to send instructions to your bank to debit your account
|
34 |
+
and your bank to debit your account in accordance with those instructions. You are entitled to a refund from your bank under the
|
35 |
+
terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited.', 'woo-stripe-payment' ), $this->get_option ( 'company_name' ) );
|
36 |
}
|
37 |
|
38 |
public function get_element_params() {
|
41 |
]
|
42 |
] );
|
43 |
}
|
44 |
+
|
45 |
+
public function get_local_payment_settings() {
|
46 |
+
return parent::get_local_payment_settings () + [
|
47 |
+
'company_name' => array(
|
48 |
+
'title' => __ ( 'Company Name', 'woo-stripe-payment' ),
|
49 |
+
'type' => 'text',
|
50 |
+
'default' => get_bloginfo ( 'name' ),
|
51 |
+
'desc_tip' => true,
|
52 |
+
'description' => __ ( 'The name of your company that will appear in the SEPA mandate.', 'woo-stripe-payment' )
|
53 |
+
)
|
54 |
+
];
|
55 |
+
}
|
56 |
+
|
57 |
+
public function get_payment_description() {
|
58 |
+
return parent::get_payment_description () . sprintf ( '<p><a target="_blank" href="https://stripe.com/docs/sources/sepa-debit#testing">%s</a></p>', __ ( 'SEPA Test Accounts', 'woo-stripe-payment' ) );
|
59 |
+
}
|
60 |
}
|
includes/gateways/class-wc-payment-gateway-stripe-sofort.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
@@ -9,9 +11,9 @@ if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
|
9 |
*
|
10 |
*/
|
11 |
class WC_Payment_Gateway_Stripe_Sofort extends WC_Payment_Gateway_Stripe_Local_Payment {
|
12 |
-
|
13 |
-
use WC_Stripe_Local_Payment_Charge_Trait;
|
14 |
|
|
|
|
|
15 |
public function __construct() {
|
16 |
$this->synchronous = false;
|
17 |
$this->local_payment_type = 'sofort';
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
11 |
*
|
12 |
*/
|
13 |
class WC_Payment_Gateway_Stripe_Sofort extends WC_Payment_Gateway_Stripe_Local_Payment {
|
|
|
|
|
14 |
|
15 |
+
use WC_Stripe_Local_Payment_Charge_Trait;
|
16 |
+
|
17 |
public function __construct() {
|
18 |
$this->synchronous = false;
|
19 |
$this->local_payment_type = 'sofort';
|
includes/gateways/class-wc-payment-gateway-stripe-wechat.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
3 |
return;
|
4 |
}
|
@@ -36,7 +38,7 @@ class WC_Payment_Gateway_Stripe_WeChat extends WC_Payment_Gateway_Stripe_Local_P
|
|
36 |
*
|
37 |
* @see WC_Payment_Gateway_Stripe_Local_Payment::get_source_redirect_url()
|
38 |
*/
|
39 |
-
|
40 |
if (wc_stripe_mode () == 'live') {
|
41 |
return sprintf ( '#qrcode=%s', base64_encode ( wp_json_encode ( [
|
42 |
'code' => $source->wechat->qr_code_url,
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Gateway_Stripe_Local_Payment' )) {
|
5 |
return;
|
6 |
}
|
38 |
*
|
39 |
* @see WC_Payment_Gateway_Stripe_Local_Payment::get_source_redirect_url()
|
40 |
*/
|
41 |
+
public function get_source_redirect_url($source, $order) {
|
42 |
if (wc_stripe_mode () == 'live') {
|
43 |
return sprintf ( '#qrcode=%s', base64_encode ( wp_json_encode ( [
|
44 |
'code' => $source->wechat->qr_code_url,
|
includes/gateways/settings/cc-settings.php
CHANGED
@@ -59,6 +59,18 @@ return array(
|
|
59 |
'desc_tip' => false,
|
60 |
'description' => __ ( 'If enabled, a checkbox will be available on the checkout page allowing your customer\'s to save their credit card. The payment methods are stored securely in Stripe\'s vault and never touch your server. Note: if the cart contains a subscription, there will be no checkbox because the payment method will be saved automatically. There will also be no checkbox for guest checkout as a user must be logged in to save a payment method.', 'woo-stripe-payment' )
|
61 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
'cards' => array( 'type' => 'multiselect',
|
63 |
'title' => __ ( 'Accepted Payment Methods', 'wwoo-stripe' ),
|
64 |
'class' => 'wc-enhanced-select stripe-accepted-cards',
|
59 |
'desc_tip' => false,
|
60 |
'description' => __ ( 'If enabled, a checkbox will be available on the checkout page allowing your customer\'s to save their credit card. The payment methods are stored securely in Stripe\'s vault and never touch your server. Note: if the cart contains a subscription, there will be no checkbox because the payment method will be saved automatically. There will also be no checkbox for guest checkout as a user must be logged in to save a payment method.', 'woo-stripe-payment' )
|
61 |
),
|
62 |
+
'force_3d_secure' => array(
|
63 |
+
'title' => __ ( 'Force 3D Secure', 'woo-stripe-payment' ),
|
64 |
+
'type' => 'checkbox', 'value' => 'yes',
|
65 |
+
'default' => 'no', 'desc_tip' => false,
|
66 |
+
'description' => sprintf ( __ ( 'Stripe internally determines when 3D secure should be presented based on their SCA engine. If <strong>Force 3D Secure</strong> is enabled, 3D Secure will be forced for ALL credit card transactions. In test mode 3D secure only shows for %s3DS Test Cards%s regardless of this setting.', 'woo-stripe-payment' ), '<a target="_blank" href="https://stripe.com/docs/testing#regulatory-cards">', '</a>' )
|
67 |
+
),
|
68 |
+
'generic_error' => array(
|
69 |
+
'title' => __ ( 'Generic Errors', 'woo-stripe-payment' ),
|
70 |
+
'type' => 'checkbox', 'default' => 'no',
|
71 |
+
'value' => 'yes', 'desc_tip' => true,
|
72 |
+
'description' => __ ( 'If enabled, credit card errors will be generic when presented to the customer. Merchants may prefer to not provide details on why a card was not accepted for security purposes.', 'woo-stripe-payment' )
|
73 |
+
),
|
74 |
'cards' => array( 'type' => 'multiselect',
|
75 |
'title' => __ ( 'Accepted Payment Methods', 'wwoo-stripe' ),
|
76 |
'class' => 'wc-enhanced-select stripe-accepted-cards',
|
includes/gateways/settings/googlepay-settings.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
return array(
|
3 |
'desc1' => array( 'type' => 'description',
|
4 |
-
'description' => '<p><a target="_blank" href="https://
|
5 |
),
|
6 |
'desc2' => array( 'type' => 'description',
|
7 |
'description' => sprintf ( '<p>%s</p>', sprintf ( __ ( 'If you don\'t want to request a Google Merchant ID, you can use the %sPayment Request Gateway%s which has a Google Pay integration through Stripe via the Chrome browser.', 'woo-stripe-payment' ), '<a target="_blank" href="' . admin_url ( 'admin.php?page=wc-settings&tab=checkout§ion=stripe_payment_request' ) . '">', '</a>' ) )
|
1 |
<?php
|
2 |
return array(
|
3 |
'desc1' => array( 'type' => 'description',
|
4 |
+
'description' => '<p><a target="_blank" href="https://pay.google.com/business/console">' . __ ( 'GPay Business Console', 'woo-stripe-payment' ) . '</a></p>' . __ ( 'When test mode is enabled, Google Pay will work without a merchant ID, allowing you to capture the necessary screenshots the Google API team needs to approve your integration request.', 'woo-stripe-payment' )
|
5 |
),
|
6 |
'desc2' => array( 'type' => 'description',
|
7 |
'description' => sprintf ( '<p>%s</p>', sprintf ( __ ( 'If you don\'t want to request a Google Merchant ID, you can use the %sPayment Request Gateway%s which has a Google Pay integration through Stripe via the Chrome browser.', 'woo-stripe-payment' ), '<a target="_blank" href="' . admin_url ( 'admin.php?page=wc-settings&tab=checkout§ion=stripe_payment_request' ) . '">', '</a>' ) )
|
includes/tokens/class-wc-payment-token-stripe-ach.php
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @since 3.0.5
|
4 |
* @package Stripe/Tokens
|
5 |
* @author Payment Plugins
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Payment_Token_Stripe_ACH extends WC_Payment_Token_Stripe {
|
9 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @since 3.0.5
|
7 |
* @package Stripe/Tokens
|
8 |
* @author Payment Plugins
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Payment_Token_Stripe_ACH extends WC_Payment_Token_Stripe {
|
12 |
|
includes/tokens/class-wc-payment-token-stripe-applepay.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Token_Stripe_CC' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Token_Stripe_CC' )) {
|
5 |
return;
|
6 |
}
|
includes/tokens/class-wc-payment-token-stripe-cc.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Token_Stripe' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Token_Stripe' )) {
|
5 |
return;
|
6 |
}
|
includes/tokens/class-wc-payment-token-stripe-googlepay.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
if (! class_exists ( 'WC_Payment_Token_Stripe_CC' )) {
|
3 |
return;
|
4 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
if (! class_exists ( 'WC_Payment_Token_Stripe_CC' )) {
|
5 |
return;
|
6 |
}
|
includes/tokens/class-wc-payment-token-stripe-local-payment.php
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @since 3.0.0
|
4 |
* @package Stripe/Tokens
|
5 |
* @author PaymentPlugins
|
6 |
-
*
|
7 |
*/
|
8 |
class WC_Payment_Token_Stripe_Local extends WC_Payment_Token_Stripe {
|
9 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @since 3.0.0
|
7 |
* @package Stripe/Tokens
|
8 |
* @author PaymentPlugins
|
9 |
+
*
|
10 |
*/
|
11 |
class WC_Payment_Token_Stripe_Local extends WC_Payment_Token_Stripe {
|
12 |
|
includes/traits/wc-stripe-controller-cart-trait.php
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
|
|
3 |
* @since 3.1.0
|
4 |
* @author Payment Plugins
|
5 |
-
*
|
6 |
*/
|
7 |
trait WC_Stripe_Controller_Cart_Trait{
|
8 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @since 3.1.0
|
7 |
* @author Payment Plugins
|
8 |
+
*
|
9 |
*/
|
10 |
trait WC_Stripe_Controller_Cart_Trait{
|
11 |
|
includes/traits/wc-stripe-payment-traits.php
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
* @author Payment Plugins
|
5 |
* @since 3.1.0
|
6 |
* @package Stripe/Trait
|
@@ -8,7 +10,7 @@
|
|
8 |
trait WC_Stripe_Payment_Intent_Trait{
|
9 |
|
10 |
public function get_payment_object() {
|
11 |
-
return
|
12 |
}
|
13 |
|
14 |
public function get_payment_method_type() {
|
@@ -46,7 +48,7 @@ trait WC_Stripe_Payment_Intent_Trait{
|
|
46 |
trait WC_Stripe_Payment_Charge_Trait{
|
47 |
|
48 |
public function get_payment_object() {
|
49 |
-
return
|
50 |
}
|
51 |
}
|
52 |
|
@@ -57,45 +59,9 @@ trait WC_Stripe_Payment_Charge_Trait{
|
|
57 |
* @package Stripe/Trait
|
58 |
*/
|
59 |
trait WC_Stripe_Local_Payment_Charge_Trait{
|
60 |
-
use WC_Stripe_Payment_Charge_Trait;
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
* @param int $order_id
|
65 |
-
*/
|
66 |
-
public function process_payment($order_id) {
|
67 |
-
$order = wc_get_order ( $order_id );
|
68 |
-
if (! $this->processing_payment) {
|
69 |
-
$source_id = $this->get_new_source_token ();
|
70 |
-
if (! empty ( $source_id )) {
|
71 |
-
// source was created client side.
|
72 |
-
$source = $this->gateway->fetch_payment_source ( $source_id );
|
73 |
-
|
74 |
-
// save the order ID to the session. Stripe doesn't allow the source object's
|
75 |
-
// redirect url to be updated so we can't pass order_id in url params.
|
76 |
-
WC ()->session->set ( 'wc_stripe_order_id', $order_id );
|
77 |
-
} else {
|
78 |
-
// create the source
|
79 |
-
$source = $this->gateway->create_source ( $this->get_source_args ( $order ) );
|
80 |
-
}
|
81 |
-
|
82 |
-
if (is_wp_error ( $source )) {
|
83 |
-
wc_add_notice ( sprintf ( __ ( 'Error creating payment source. Reason: %s', 'woo-stripe-payment' ), $source->get_error_message () ), 'error' );
|
84 |
-
$order->update_status ( 'failed', sprintf ( __ ( 'Error creating payment source. Reason: %s', 'woo-stripe-payment' ), $source->get_error_message () ) );
|
85 |
-
return $this->get_order_error ();
|
86 |
-
}
|
87 |
-
|
88 |
-
$order->update_meta_data ( '_stripe_source_id', $source->id );
|
89 |
-
$order->update_meta_data ( WC_Stripe_Constants::MODE, wc_stripe_mode () );
|
90 |
-
|
91 |
-
$order->save ();
|
92 |
-
|
93 |
-
return [ 'result' => 'success',
|
94 |
-
'redirect' => $this->get_source_redirect_url ( $source, $order )
|
95 |
-
];
|
96 |
-
} else {
|
97 |
-
return parent::process_payment ( $order_id );
|
98 |
-
}
|
99 |
}
|
100 |
}
|
101 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @author Payment Plugins
|
7 |
* @since 3.1.0
|
8 |
* @package Stripe/Trait
|
10 |
trait WC_Stripe_Payment_Intent_Trait{
|
11 |
|
12 |
public function get_payment_object() {
|
13 |
+
return WC_Stripe_Payment_Factory::load ( 'payment_intent', $this, WC_Stripe_Gateway::load () );
|
14 |
}
|
15 |
|
16 |
public function get_payment_method_type() {
|
48 |
trait WC_Stripe_Payment_Charge_Trait{
|
49 |
|
50 |
public function get_payment_object() {
|
51 |
+
return WC_Stripe_Payment_Factory::load ( 'charge', $this, WC_Stripe_Gateway::load () );
|
52 |
}
|
53 |
}
|
54 |
|
59 |
* @package Stripe/Trait
|
60 |
*/
|
61 |
trait WC_Stripe_Local_Payment_Charge_Trait{
|
|
|
62 |
|
63 |
+
public function get_payment_object() {
|
64 |
+
return WC_Stripe_Payment_Factory::load ( 'local_charge', $this, WC_Stripe_Gateway::load () );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
}
|
67 |
|
includes/traits/wc-stripe-settings-trait.php
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
4 |
* @author Payment Plugins
|
5 |
* @since 3.1.0
|
6 |
-
*
|
7 |
*/
|
8 |
trait WC_Stripe_Settings_Trait{
|
9 |
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
+
*
|
6 |
* @author Payment Plugins
|
7 |
* @since 3.1.0
|
8 |
+
*
|
9 |
*/
|
10 |
trait WC_Stripe_Settings_Trait{
|
11 |
|
includes/updates/update-3.0.7.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
use Stripe\Webhook;
|
3 |
use Stripe\WebhookEndpoint;
|
4 |
use Stripe\ApiOperations\Delete;
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
use Stripe\Webhook;
|
5 |
use Stripe\WebhookEndpoint;
|
6 |
use Stripe\ApiOperations\Delete;
|
includes/updates/update-3.1.0.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
// update webhooks to include payment_intent.succeeded
|
3 |
$environments = [ 'live', 'test'
|
4 |
];
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
// update webhooks to include payment_intent.succeeded
|
5 |
$environments = [ 'live', 'test'
|
6 |
];
|
includes/updates/update-3.1.1.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
+
global $wpdb;
|
5 |
+
|
6 |
+
// delete transients that have incorrect timeouts
|
7 |
+
$wpdb->query ( $wpdb->prepare ( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", '%_transient_timeout__stripe_lock_order_%', '%_transient__stripe_lock_order_%' ) );
|
includes/wc-stripe-functions.php
CHANGED
@@ -1,11 +1,13 @@
|
|
1 |
<?php
|
|
|
2 |
|
3 |
/**
|
|
|
4 |
* @since 3.0.0
|
5 |
* @package Stripe/Functions
|
6 |
-
*
|
7 |
-
* @param string $template_name
|
8 |
-
* @param array $args
|
9 |
*/
|
10 |
function wc_stripe_get_template($template_name, $args = array()) {
|
11 |
wc_get_template ( $template_name, $args, wc_stripe ()->template_path (), wc_stripe ()->default_template_path () );
|
@@ -382,6 +384,7 @@ function wc_stripe_get_display_items($encode = false, $order = null) {
|
|
382 |
];
|
383 |
}
|
384 |
} else {
|
|
|
385 |
// add all order items
|
386 |
foreach ( $order->get_items () as $item ) {
|
387 |
/**
|
@@ -393,7 +396,7 @@ function wc_stripe_get_display_items($encode = false, $order = null) {
|
|
393 |
$items[] = [
|
394 |
'label' => $qty > 1 ? sprintf ( '%s X %s', $item->get_name (), $qty ) : $item->get_name (),
|
395 |
'pending' => false,
|
396 |
-
'amount' => wc_stripe_add_number_precision ( $item->get_subtotal () )
|
397 |
];
|
398 |
}
|
399 |
// shipping total
|
@@ -401,7 +404,7 @@ function wc_stripe_get_display_items($encode = false, $order = null) {
|
|
401 |
$items[] = [
|
402 |
'label' => __ ( 'Shipping', 'woo-stripe-payment' ),
|
403 |
'pending' => false,
|
404 |
-
'amount' => wc_stripe_add_number_precision ( $order->get_shipping_total () )
|
405 |
];
|
406 |
}
|
407 |
// discount total
|
@@ -409,7 +412,7 @@ function wc_stripe_get_display_items($encode = false, $order = null) {
|
|
409 |
$items[] = [
|
410 |
'label' => __ ( 'Discount', 'woo-stripe-payment' ),
|
411 |
'pending' => false,
|
412 |
-
'amount' => wc_stripe_add_number_precision ( $order->get_total_discount () )
|
413 |
];
|
414 |
}
|
415 |
if ($order->get_fees ()) {
|
@@ -420,7 +423,7 @@ function wc_stripe_get_display_items($encode = false, $order = null) {
|
|
420 |
$items[] = [
|
421 |
'label' => __ ( 'Fees', 'woo-stripe-payment' ),
|
422 |
'pending' => false,
|
423 |
-
'amount' => wc_stripe_add_number_precision ( $fee_total )
|
424 |
];
|
425 |
}
|
426 |
// tax total
|
@@ -428,7 +431,7 @@ function wc_stripe_get_display_items($encode = false, $order = null) {
|
|
428 |
$items[] = [
|
429 |
'label' => __ ( 'Tax', 'woocommerce' ),
|
430 |
'pending' => false,
|
431 |
-
'amount' => wc_stripe_add_number_precision ( $order->get_total_tax () )
|
432 |
];
|
433 |
}
|
434 |
}
|
@@ -506,7 +509,7 @@ function wc_stripe_set_checkout_error() {
|
|
506 |
function wc_stripe_output_checkout_error($template_name) {
|
507 |
if ($template_name === 'notices/error.php' && is_ajax ()) {
|
508 |
echo '<input type="hidden" id="wc_stripe_checkout_error" value="true"/>';
|
509 |
-
remove_action ( 'woocommerce_after_template_part', '
|
510 |
add_filter ( 'wp_kses_allowed_html', 'wc_stripe_add_allowed_html', 10, 2 );
|
511 |
}
|
512 |
}
|
@@ -675,8 +678,11 @@ function wc_stripe_payment_complete_order_status($order_status, $order_id, $orde
|
|
675 |
* @param string $round
|
676 |
* @return number
|
677 |
*/
|
678 |
-
function wc_stripe_add_number_precision($value, $round = true) {
|
679 |
-
$
|
|
|
|
|
|
|
680 |
$value = $value * $cent_precision;
|
681 |
$value = $round ? round ( $value, wc_get_rounding_precision () - wc_get_price_decimals () ) : $value;
|
682 |
|
@@ -1037,4 +1043,78 @@ function wc_stripe_credit_card_labels($labels) {
|
|
1037 |
$labels[ 'amex' ] = __ ( 'Amex', 'woocommerce' );
|
1038 |
}
|
1039 |
return $labels;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1040 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
|
4 |
/**
|
5 |
+
*
|
6 |
* @since 3.0.0
|
7 |
* @package Stripe/Functions
|
8 |
+
* Wrapper for wc_get_template that returns Stripe specfic templates.
|
9 |
+
* @param string $template_name
|
10 |
+
* @param array $args
|
11 |
*/
|
12 |
function wc_stripe_get_template($template_name, $args = array()) {
|
13 |
wc_get_template ( $template_name, $args, wc_stripe ()->template_path (), wc_stripe ()->default_template_path () );
|
384 |
];
|
385 |
}
|
386 |
} else {
|
387 |
+
$currency = $order->get_currency ();
|
388 |
// add all order items
|
389 |
foreach ( $order->get_items () as $item ) {
|
390 |
/**
|
396 |
$items[] = [
|
397 |
'label' => $qty > 1 ? sprintf ( '%s X %s', $item->get_name (), $qty ) : $item->get_name (),
|
398 |
'pending' => false,
|
399 |
+
'amount' => wc_stripe_add_number_precision ( $item->get_subtotal (), $currency )
|
400 |
];
|
401 |
}
|
402 |
// shipping total
|
404 |
$items[] = [
|
405 |
'label' => __ ( 'Shipping', 'woo-stripe-payment' ),
|
406 |
'pending' => false,
|
407 |
+
'amount' => wc_stripe_add_number_precision ( $order->get_shipping_total (), $currency )
|
408 |
];
|
409 |
}
|
410 |
// discount total
|
412 |
$items[] = [
|
413 |
'label' => __ ( 'Discount', 'woo-stripe-payment' ),
|
414 |
'pending' => false,
|
415 |
+
'amount' => wc_stripe_add_number_precision ( $order->get_total_discount (), $currency )
|
416 |
];
|
417 |
}
|
418 |
if ($order->get_fees ()) {
|
423 |
$items[] = [
|
424 |
'label' => __ ( 'Fees', 'woo-stripe-payment' ),
|
425 |
'pending' => false,
|
426 |
+
'amount' => wc_stripe_add_number_precision ( $fee_total, $currency )
|
427 |
];
|
428 |
}
|
429 |
// tax total
|
431 |
$items[] = [
|
432 |
'label' => __ ( 'Tax', 'woocommerce' ),
|
433 |
'pending' => false,
|
434 |
+
'amount' => wc_stripe_add_number_precision ( $order->get_total_tax (), $currency )
|
435 |
];
|
436 |
}
|
437 |
}
|
509 |
function wc_stripe_output_checkout_error($template_name) {
|
510 |
if ($template_name === 'notices/error.php' && is_ajax ()) {
|
511 |
echo '<input type="hidden" id="wc_stripe_checkout_error" value="true"/>';
|
512 |
+
remove_action ( 'woocommerce_after_template_part', 'wc_stripe_output_checkout_error' );
|
513 |
add_filter ( 'wp_kses_allowed_html', 'wc_stripe_add_allowed_html', 10, 2 );
|
514 |
}
|
515 |
}
|
678 |
* @param string $round
|
679 |
* @return number
|
680 |
*/
|
681 |
+
function wc_stripe_add_number_precision($value, $currency = '', $round = true) {
|
682 |
+
$currency = empty ( $currency ) ? get_woocommerce_currency () : $currency;
|
683 |
+
$currencies = wc_stripe_get_currencies ();
|
684 |
+
$exp = isset ( $currencies[ $currency ] ) ? $currencies[ $currency ] : 2;
|
685 |
+
$cent_precision = pow ( 10, $exp );
|
686 |
$value = $value * $cent_precision;
|
687 |
$value = $round ? round ( $value, wc_get_rounding_precision () - wc_get_price_decimals () ) : $value;
|
688 |
|
1043 |
$labels[ 'amex' ] = __ ( 'Amex', 'woocommerce' );
|
1044 |
}
|
1045 |
return $labels;
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
/**
|
1049 |
+
* Return an array of Stripe error messages.
|
1050 |
+
*
|
1051 |
+
* @since 3.1.1
|
1052 |
+
*/
|
1053 |
+
function wc_stripe_get_error_messages() {
|
1054 |
+
return apply_filters ( 'wc_stripe_get_error_messages', [
|
1055 |
+
'stripe_cc_generic' => __ ( 'There was an error processing your credit card.', 'woo-stripe-payment' ),
|
1056 |
+
'incorrect_number' => __ ( 'The card number is incorrect. Check the card\'s number or use a different card.', 'woo-stripe-payment' ),
|
1057 |
+
'incorrect_cvc' => __ ( 'The card\'s security code is incorrect. Check the card\'s security code or use a different card.', 'woo-stripe-payment' ),
|
1058 |
+
'incorrect_zip' => __ ( 'The card\'s ZIP code is incorrect. Check the card\'s ZIP code or use a different card.', 'woo-stripe-payment' ),
|
1059 |
+
'invalid_number' => __ ( 'The card number is invalid. Check the card details or use a different card.', 'woo-stripe-payment' ),
|
1060 |
+
'invalid_characters' => __ ( 'This value provided to the field contains characters that are unsupported by the field.', 'woo-stripe-payment' ),
|
1061 |
+
'invalid_cvc' => __ ( 'The card\'s security code is invalid. Check the card\'s security code or use a different card.', 'woo-stripe-payment' ),
|
1062 |
+
'invalid_expiry_month' => __ ( 'The card\'s expiration month is incorrect. Check the expiration date or use a different card.', 'woo-stripe-payment' ),
|
1063 |
+
'invalid_expiry_year' => __ ( 'The card\'s expiration year is incorrect. Check the expiration date or use a different card.', 'woo-stripe-payment' ),
|
1064 |
+
'invalid_number' => __ ( 'The card number is invalid. Check the card details or use a different card.', 'woo-stripe-payment' ),
|
1065 |
+
'incorrect_address' => __ ( 'The card\'s address is incorrect. Check the card\'s address or use a different card.', 'woo-stripe-payment' ),
|
1066 |
+
'expired_card' => __ ( 'The card has expired. Check the expiration date or use a different card.', 'woo-stripe-payment' ),
|
1067 |
+
'card_declined' => __ ( 'The card has been declined.', 'woo-stripe-payment' ),
|
1068 |
+
'invalid_expiry_year_past' => __ ( 'Your card\'s expiration year is in the past.', 'woo-stripe-payment' ),
|
1069 |
+
'account_number_invalid' => __ ( 'The bank account number provided is invalid (e.g., missing digits). Bank account information varies from country to country. We recommend creating validations in your entry forms based on the bank account formats we provide.', 'woo-stripe-payment' ),
|
1070 |
+
'amount_too_large' => __ ( 'The specified amount is greater than the maximum amount allowed. Use a lower amount and try again.', 'woo-stripe-payment' ),
|
1071 |
+
'amount_too_small' => __ ( 'The specified amount is less than the minimum amount allowed. Use a higher amount and try again.', 'woo-stripe-payment' ),
|
1072 |
+
'authentication_required' => __ ( 'The payment requires authentication to proceed. If your customer is off session, notify your customer to return to your application and complete the payment. If you provided the error_on_requires_action parameter, then your customer should try another card that does not require authentication.', 'woo-stripe-payment' ),
|
1073 |
+
'balance_insufficient' => __ ( 'The transfer or payout could not be completed because the associated account does not have a sufficient balance available. Create a new transfer or payout using an amount less than or equal to the account\'s available balance.', 'woo-stripe-payment' ),
|
1074 |
+
'bank_account_declined' => __ ( 'The bank account provided can not be used to charge, either because it is not verified yet or it is not supported.', 'woo-stripe-payment' ),
|
1075 |
+
'bank_account_exists' => __ ( 'The bank account provided already exists on the specified Customer object. If the bank account should also be attached to a different customer, include the correct customer ID when making the request again.', 'woo-stripe-payment' ),
|
1076 |
+
'bank_account_unusable' => __ ( 'The bank account provided cannot be used for payouts. A different bank account must be used.', 'woo-stripe-payment' ),
|
1077 |
+
'bank_account_unverified' => __ ( 'Your Connect platform is attempting to share an unverified bank account with a connected account.', 'woo-stripe-payment' ),
|
1078 |
+
'bank_account_verification_failed' => __ ( 'The bank account cannot be verified, either because the microdeposit amounts provided do not match the actual amounts, or because verification has failed too many times.', 'woo-stripe-payment' ),
|
1079 |
+
'card_decline_rate_limit_exceeded' => __ ( 'This card has been declined too many times. You can try to charge this card again after 24 hours. We suggest reaching out to your customer to make sure they have entered all of their information correctly and that there are no issues with their card.', 'woo-stripe-payment' ),
|
1080 |
+
'charge_already_captured' => __ ( 'The charge you\'re attempting to capture has already been captured. Update the request with an uncaptured charge ID.', 'woo-stripe-payment' ),
|
1081 |
+
'charge_already_refunded' => __ ( 'The charge you\'re attempting to refund has already been refunded. Update the request to use the ID of a charge that has not been refunded.', 'woo-stripe-payment' ),
|
1082 |
+
'charge_disputed' => __ ( 'The charge you\'re attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute.', 'woo-stripe-payment' ),
|
1083 |
+
'charge_exceeds_source_limit' => __ ( 'This charge would cause you to exceed your rolling-window processing limit for this source type. Please retry the charge later, or contact us to request a higher processing limit.', 'woo-stripe-payment' ),
|
1084 |
+
'charge_expired_for_capture' => __ ( 'The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days.', 'woo-stripe-payment' ),
|
1085 |
+
'charge_invalid_parameter' => __ ( 'One or more provided parameters was not allowed for the given operation on the Charge. Check our API reference or the returned error message to see which values were not correct for that Charge.', 'woo-stripe-payment' ),
|
1086 |
+
'email_invalid' => __ ( 'The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters.', 'woo-stripe-payment' ),
|
1087 |
+
'idempotency_key_in_use' => __ ( 'The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously.', 'woo-stripe-payment' ),
|
1088 |
+
'invalid_charge_amount' => __ ( 'The specified amount is invalid. The charge amount must be a positive integer in the smallest currency unit, and not exceed the minimum or maximum amount.', 'woo-stripe-payment' ),
|
1089 |
+
'invalid_source_usage' => __ ( 'The source cannot be used because it is not in the correct state (e.g., a charge request is trying to use a source with a pending, failed, or consumed source). Check the status of the source you are attempting to use.', 'woo-stripe-payment' ),
|
1090 |
+
'missing' => __ ( 'Both a customer and source ID have been provided, but the source has not been saved to the customer. To create a charge for a customer with a specified source, you must first save the card details.', 'woo-stripe-payment' ),
|
1091 |
+
'postal_code_invalid' => __ ( 'The ZIP code provided was incorrect.', 'woo-stripe-payment' ),
|
1092 |
+
'processing_error' => __ ( 'An error occurred while processing the card. Try again later or with a different payment method.', 'woo-stripe-payment' ),
|
1093 |
+
'card_not_supported' => __ ( 'The card does not support this type of purchase.', 'woo-stripe-payment' ),
|
1094 |
+
'call_issuer' => __ ( 'The card has been declined for an unknown reason.', 'woo-stripe-payment' ),
|
1095 |
+
'card_velocity_exceeded' => __ ( 'The customer has exceeded the balance or credit limit available on their card.', 'woo-stripe-payment' ),
|
1096 |
+
'currency_not_supported' => __ ( 'The card does not support the specified currency.', 'woo-stripe-payment' ),
|
1097 |
+
'do_not_honor' => __ ( 'The card has been declined for an unknown reason.', 'woo-stripe-payment' ),
|
1098 |
+
'fraudulent' => __ ( 'The payment has been declined as Stripe suspects it is fraudulent.', 'woo-stripe-payment' ),
|
1099 |
+
'generic_decline' => __ ( 'The card has been declined for an unknown reason.', 'woo-stripe-payment' ),
|
1100 |
+
'incorrect_pin' => __ ( 'The PIN entered is incorrect. ', 'woo-stripe-payment' ),
|
1101 |
+
'insufficient_funds' => __ ( 'The card has insufficient funds to complete the purchase.', 'woo-stripe-payment' )
|
1102 |
+
] );
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
/**
|
1106 |
+
* Return an array of Stripe currencies where the value of each
|
1107 |
+
* currency is the curency multiplier.
|
1108 |
+
*
|
1109 |
+
* @since 3.1.2
|
1110 |
+
* @package Stripe/Functions
|
1111 |
+
* @return mixed
|
1112 |
+
*/
|
1113 |
+
function wc_stripe_get_currencies() {
|
1114 |
+
return apply_filters ( 'wc_stripe_get_currencies', [
|
1115 |
+
'BIF' => 0, 'CLP' => 0, 'DJF' => 0, 'GNF' => 0,
|
1116 |
+
'JPY' => 0, 'KMF' => 0, 'KRW' => 0, 'MGA' => 0,
|
1117 |
+
'PYG' => 0, 'RWF' => 0, 'UGX' => 0, 'VND' => 0,
|
1118 |
+
'VUV' => 0, 'XAF' => 0, 'XOF' => 0, 'XPF' => 0
|
1119 |
+
] );
|
1120 |
}
|
includes/wc-stripe-hooks.php
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
* Actions
|
4 |
*/
|
@@ -10,6 +12,7 @@ add_action ( 'woocommerce_order_status_completed', 'wc_stripe_order_status_compl
|
|
10 |
*/
|
11 |
add_action ( 'wc_stripe_webhook_source_chargeable', 'wc_stripe_process_source_chargeable', 10, 2 );
|
12 |
add_action ( 'wc_stripe_webhook_charge_succeeded', 'wc_stripe_process_charge_succeeded', 10, 2 );
|
|
|
13 |
add_action ( 'wc_stripe_webhook_payment_intent_succeeded', 'wc_stripe_process_payment_intent_succeeded', 10, 2 );
|
14 |
|
15 |
/**
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
+
|
4 |
/**
|
5 |
* Actions
|
6 |
*/
|
12 |
*/
|
13 |
add_action ( 'wc_stripe_webhook_source_chargeable', 'wc_stripe_process_source_chargeable', 10, 2 );
|
14 |
add_action ( 'wc_stripe_webhook_charge_succeeded', 'wc_stripe_process_charge_succeeded', 10, 2 );
|
15 |
+
add_action ( 'wc_stripe_webhook_charge_failed', 'wc_stripe_process_charge_failed', 10, 2 );
|
16 |
add_action ( 'wc_stripe_webhook_payment_intent_succeeded', 'wc_stripe_process_payment_intent_succeeded', 10, 2 );
|
17 |
|
18 |
/**
|
includes/wc-stripe-webhook-functions.php
CHANGED
@@ -1,18 +1,17 @@
|
|
1 |
<?php
|
|
|
2 |
|
3 |
/**
|
4 |
* Processes the charge via webhooks for local payment methods like iDEAL, EPS, etc.
|
|
|
5 |
* @since 3.0.0
|
6 |
* @package Stripe/Functions
|
7 |
-
*
|
8 |
-
* @param \Stripe\Source $source
|
9 |
-
* @param WP_REST_Request $request
|
10 |
*/
|
11 |
function wc_stripe_process_source_chargeable($source, $request) {
|
12 |
-
|
13 |
-
global $wpdb;
|
14 |
-
|
15 |
-
$order = wc_stripe_get_order_from_source_id ( $source->id );
|
16 |
if (! $order) {
|
17 |
wc_stripe_log_error ( sprintf ( 'Could not create a charge for source %s. No order ID was found in your Wordpress database.', $source->id ) );
|
18 |
return;
|
@@ -31,11 +30,11 @@ function wc_stripe_process_source_chargeable($source, $request) {
|
|
31 |
wc_stripe_log_info ( sprintf ( 'source.chargeable event received. Charge has already been created for order %s. Event exited.', $order->get_id () ) );
|
32 |
return;
|
33 |
}
|
34 |
-
$gateway->set_new_source_token ( $source->id );
|
35 |
-
$gateway->processing_payment = true;
|
36 |
$gateway->set_order_lock ( $order );
|
37 |
-
|
38 |
$gateway->process_payment ( $order->get_id () );
|
|
|
|
|
39 |
}
|
40 |
|
41 |
/**
|
@@ -44,34 +43,45 @@ function wc_stripe_process_source_chargeable($source, $request) {
|
|
44 |
* @since 3.0.5
|
45 |
* @package Stripe/Functions
|
46 |
*
|
47 |
-
* @param \Stripe\Charge $
|
48 |
* @param WP_REST_Request $request
|
49 |
*/
|
50 |
function wc_stripe_process_charge_succeeded($charge, $request) {
|
51 |
-
$order =
|
52 |
if (! $order) {
|
53 |
wc_stripe_log_error ( sprintf ( 'Could not complete payment for charge %s. No order ID was found in your Wordpress database.', $charge->id ) );
|
54 |
return;
|
55 |
}
|
56 |
-
$payment_method = WC ()->payment_gateways ()->payment_gateways ()[ $order->get_payment_method () ];
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
59 |
if (! $payment_method->synchronous) {
|
60 |
-
//
|
61 |
-
|
62 |
-
//
|
63 |
-
$
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
}
|
|
|
|
|
75 |
}
|
76 |
|
77 |
/**
|
@@ -85,7 +95,7 @@ function wc_stripe_process_charge_succeeded($charge, $request) {
|
|
85 |
function wc_stripe_process_payment_intent_succeeded($intent, $request) {
|
86 |
$order = wc_get_order ( $intent->metadata[ 'order_id' ] );
|
87 |
if (! $order) {
|
88 |
-
wc_stripe_log_error ( sprintf ( 'Could not complete payment for
|
89 |
return;
|
90 |
}
|
91 |
$payment_method = WC ()->payment_gateways ()->payment_gateways ()[ $order->get_payment_method () ];
|
@@ -102,14 +112,38 @@ function wc_stripe_process_payment_intent_succeeded($intent, $request) {
|
|
102 |
|
103 |
$payment_method->set_order_lock ( $order );
|
104 |
|
105 |
-
|
106 |
-
remove_action ( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed' );
|
107 |
-
|
108 |
-
$payment_method->save_order_meta ( $order, $intent->charges->data[ 0 ] );
|
109 |
-
|
110 |
-
// call payment complete so shipping, emails, etc are triggered.
|
111 |
-
$order->payment_complete ( $intent->charges->data[ 0 ]->id );
|
112 |
|
113 |
$order->add_order_note ( __ ( 'payment_intent.succeeded webhook recieved. Payment has been completed.', 'woo-stripe-payment' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
}
|
115 |
}
|
1 |
<?php
|
2 |
+
defined ( 'ABSPATH' ) || exit ();
|
3 |
|
4 |
/**
|
5 |
* Processes the charge via webhooks for local payment methods like iDEAL, EPS, etc.
|
6 |
+
*
|
7 |
* @since 3.0.0
|
8 |
* @package Stripe/Functions
|
9 |
+
*
|
10 |
+
* @param \Stripe\Source $source
|
11 |
+
* @param WP_REST_Request $request
|
12 |
*/
|
13 |
function wc_stripe_process_source_chargeable($source, $request) {
|
14 |
+
$order = wc_get_order ( $source->metadata[ 'order_id' ] );
|
|
|
|
|
|
|
15 |
if (! $order) {
|
16 |
wc_stripe_log_error ( sprintf ( 'Could not create a charge for source %s. No order ID was found in your Wordpress database.', $source->id ) );
|
17 |
return;
|
30 |
wc_stripe_log_info ( sprintf ( 'source.chargeable event received. Charge has already been created for order %s. Event exited.', $order->get_id () ) );
|
31 |
return;
|
32 |
}
|
|
|
|
|
33 |
$gateway->set_order_lock ( $order );
|
34 |
+
$gateway->set_new_source_token ( $source->id );
|
35 |
$gateway->process_payment ( $order->get_id () );
|
36 |
+
|
37 |
+
// we don't release the order lock so there aren't conflicts with the redirect handler
|
38 |
}
|
39 |
|
40 |
/**
|
43 |
* @since 3.0.5
|
44 |
* @package Stripe/Functions
|
45 |
*
|
46 |
+
* @param \Stripe\Charge $charge
|
47 |
* @param WP_REST_Request $request
|
48 |
*/
|
49 |
function wc_stripe_process_charge_succeeded($charge, $request) {
|
50 |
+
$order = wc_get_order ( $charge->metadata[ 'order_id' ] );
|
51 |
if (! $order) {
|
52 |
wc_stripe_log_error ( sprintf ( 'Could not complete payment for charge %s. No order ID was found in your Wordpress database.', $charge->id ) );
|
53 |
return;
|
54 |
}
|
|
|
55 |
|
56 |
+
/**
|
57 |
+
*
|
58 |
+
* @var WC_Payment_Gateway_Stripe $payment_method
|
59 |
+
*/
|
60 |
+
$payment_method = WC ()->payment_gateways ()->payment_gateways ()[ $order->get_payment_method () ];
|
61 |
+
// Only process for asynchronous payment methods.
|
62 |
if (! $payment_method->synchronous) {
|
63 |
+
// the order has a lock which means code could still be running for the checkout process.
|
64 |
+
// sleep for 1 second to allow other code to finish running.
|
65 |
+
// @todo in future version, action scheduler will be used to trigger the event after it is received.
|
66 |
+
if ($payment_method->has_order_lock ( $order )) {
|
67 |
+
sleep ( 1 );
|
68 |
+
// for the roder to read it's metadata from the db as it may have changed
|
69 |
+
// during the sleep operation.
|
70 |
+
$order->read_meta_data ( true );
|
71 |
+
}
|
72 |
+
// If the order's charge status is not equal to charge status from Stripe, then complete_payment.
|
73 |
+
if ($order->get_meta ( WC_Stripe_Constants::CHARGE_STATUS ) != $charge->status) {
|
74 |
+
// want to prevent plugin from processing capture_charge since charge has already been captured.
|
75 |
+
remove_action ( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed' );
|
76 |
+
|
77 |
+
// call payment complete so shipping, emails, etc are triggered.
|
78 |
+
$payment_method->save_order_meta ( $order, $charge );
|
79 |
+
$order->payment_complete ();
|
80 |
+
$order->add_order_note ( __ ( 'Charge.succeeded webhook received. Payment has been completed.', 'woo-stripe-payment' ) );
|
81 |
}
|
82 |
}
|
83 |
+
// release any existing locks on the order so the db is cleared of the transient.
|
84 |
+
$payment_method->release_order_lock ( $order );
|
85 |
}
|
86 |
|
87 |
/**
|
95 |
function wc_stripe_process_payment_intent_succeeded($intent, $request) {
|
96 |
$order = wc_get_order ( $intent->metadata[ 'order_id' ] );
|
97 |
if (! $order) {
|
98 |
+
wc_stripe_log_error ( sprintf ( 'Could not complete payment for payment_intent %s. No order ID was found in your Wordpress database.', $intent->id ) );
|
99 |
return;
|
100 |
}
|
101 |
$payment_method = WC ()->payment_gateways ()->payment_gateways ()[ $order->get_payment_method () ];
|
112 |
|
113 |
$payment_method->set_order_lock ( $order );
|
114 |
|
115 |
+
$payment_method->process_payment ( $order->get_id () );
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
$order->add_order_note ( __ ( 'payment_intent.succeeded webhook recieved. Payment has been completed.', 'woo-stripe-payment' ) );
|
118 |
+
|
119 |
+
$payment_method->release_order_lock ( $order );
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
*
|
125 |
+
* @since 3.1.1
|
126 |
+
* @package Stripe/Functions
|
127 |
+
* @param \Stripe\Charge $charge
|
128 |
+
* @param WP_REST_Request $request
|
129 |
+
*/
|
130 |
+
function wc_stripe_process_charge_failed($charge, $request) {
|
131 |
+
$order = wc_get_order ( $charge->metadata[ 'order_id' ] );
|
132 |
+
|
133 |
+
if ($order) {
|
134 |
+
$payment_methods = WC ()->payment_gateways ()->payment_gateways ();
|
135 |
+
if (isset ( $payment_methods[ $order->get_payment_method () ] )) {
|
136 |
+
/**
|
137 |
+
*
|
138 |
+
* @var WC_Payment_Gateway_Stripe $payment_method
|
139 |
+
*/
|
140 |
+
$payment_method = $payment_methods[ $order->get_payment_method () ];
|
141 |
+
// only update order status if this is an asynchronous payment method, doesn't have a lock,
|
142 |
+
// and there is no completed date on the order. If there is a complete date it means payment_complete
|
143 |
+
// was called on the order at some point
|
144 |
+
if (! $payment_method->synchronous && ! $payment_method->has_order_lock ( $order ) && ! $order->get_date_completed ()) {
|
145 |
+
$order->update_status ( 'failed', $charge->failure_message );
|
146 |
+
}
|
147 |
+
}
|
148 |
}
|
149 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: stripe, ach, klarna, credit card, apple pay, google pay, ideal, sepa, sofo
|
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 5.4
|
6 |
Requires PHP: 5.4
|
7 |
-
Stable tag: 3.1.
|
8 |
Copyright: Payment Plugins
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -56,6 +56,15 @@ If you're site is not loading over https, then Stripe won't render the Payment R
|
|
56 |
7. Payment options at top of checkout page for easy one click checkout
|
57 |
|
58 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
= 3.1.0 =
|
60 |
* Added - FPX payment method
|
61 |
* Added - Alipay payment method
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 5.4
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 3.1.1
|
8 |
Copyright: Payment Plugins
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
56 |
7. Payment options at top of checkout page for easy one click checkout
|
57 |
|
58 |
== Changelog ==
|
59 |
+
= 3.1.1 =
|
60 |
+
* Fixed - Error when changing WCS payment method to new ACH payment method
|
61 |
+
* Fixed - Error when payment_intent status 'success' and order cancelled status applied
|
62 |
+
* Added - Recipient email for payment_intent
|
63 |
+
* Added - Translations for credit card decline errors
|
64 |
+
* Added - Option to force 3D secure for all transactions
|
65 |
+
* Added - Option to show generic credit card decline error
|
66 |
+
* Added - SEPA mandate message on checkout page
|
67 |
+
* Updated - Google Pay documentation
|
68 |
= 3.1.0 =
|
69 |
* Added - FPX payment method
|
70 |
* Added - Alipay payment method
|
stripe-payments.php
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* Plugin Name: Stripe For WooCommerce
|
5 |
* Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
|
6 |
* Description: Accept credit cards, Google Pay, & Apple Pay, ACH, Klarna and more using Stripe.
|
7 |
-
* Version: 3.1.
|
8 |
* Author: Payment Plugins, support@paymentplugins.com
|
9 |
* Text Domain: woo-stripe-payment
|
10 |
* Domain Path: /i18n/languages/
|
@@ -12,6 +11,8 @@
|
|
12 |
* WC requires at least: 3.0.0
|
13 |
* WC tested up to: 4.0.1
|
14 |
*/
|
|
|
|
|
15 |
function wc_stripe_php_version_notice() {
|
16 |
$message = sprintf ( __ ( 'Your PHP version is %s but Stripe requires version 5.4+.', 'woo-stripe-payment' ), PHP_VERSION );
|
17 |
echo '<div class="notice notice-error"><p style="font-size: 16px">' . $message . '</p></div>';
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Plugin Name: Stripe For WooCommerce
|
4 |
* Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
|
5 |
* Description: Accept credit cards, Google Pay, & Apple Pay, ACH, Klarna and more using Stripe.
|
6 |
+
* Version: 3.1.1
|
7 |
* Author: Payment Plugins, support@paymentplugins.com
|
8 |
* Text Domain: woo-stripe-payment
|
9 |
* Domain Path: /i18n/languages/
|
11 |
* WC requires at least: 3.0.0
|
12 |
* WC tested up to: 4.0.1
|
13 |
*/
|
14 |
+
defined ( 'ABSPATH' ) || exit ();
|
15 |
+
|
16 |
function wc_stripe_php_version_notice() {
|
17 |
$message = sprintf ( __ ( 'Your PHP version is %s but Stripe requires version 5.4+.', 'woo-stripe-payment' ), PHP_VERSION );
|
18 |
echo '<div class="notice notice-error"><p style="font-size: 16px">' . $message . '</p></div>';
|
templates/cc-forms/bootstrap.php
CHANGED
@@ -124,7 +124,7 @@ li.payment_method_stripe_cc .payment_box{
|
|
124 |
-webkit-transform: translateY(-50%);
|
125 |
-ms-transform: translateY(-50%);
|
126 |
-moz-transform: translateY(-50%);
|
127 |
-
padding-left: 12px
|
128 |
-webkit-transition: .3s ease-out;
|
129 |
-o-transition: .3s ease-out;
|
130 |
transition: .3s ease-out;
|
124 |
-webkit-transform: translateY(-50%);
|
125 |
-ms-transform: translateY(-50%);
|
126 |
-moz-transform: translateY(-50%);
|
127 |
+
padding-left: 12px;
|
128 |
-webkit-transition: .3s ease-out;
|
129 |
-o-transition: .3s ease-out;
|
130 |
transition: .3s ease-out;
|
templates/checkout/local-payment.php
CHANGED
@@ -2,9 +2,12 @@
|
|
2 |
/**
|
3 |
* @version 3.0.0
|
4 |
*
|
5 |
-
* @var
|
6 |
*/
|
7 |
?>
|
8 |
<div id="wc_stripe_local_payment_<?php echo $gateway->id?>">
|
9 |
-
|
10 |
-
</div>
|
|
|
|
|
|
2 |
/**
|
3 |
* @version 3.0.0
|
4 |
*
|
5 |
+
* @var WC_Payment_Gateway_Stripe_Local_Payment $gateway
|
6 |
*/
|
7 |
?>
|
8 |
<div id="wc_stripe_local_payment_<?php echo $gateway->id?>">
|
9 |
+
|
10 |
+
</div>
|
11 |
+
<?php if(($desc = $gateway->get_local_payment_description())):?>
|
12 |
+
<p class="wc-stripe-local-desc <?php echo $gateway->id?>"><?php echo $desc?></p>
|
13 |
+
<?php endif;?>
|
templates/product/payment-methods.php
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
* @version 3.0.0
|
4 |
*/
|
5 |
?>
|
|
|
6 |
<div class="wc-stripe-product-checkout-container">
|
7 |
<ul class="wc_stripe_product_payment_methods">
|
8 |
<?php foreach($gateways as $gateway):?>
|
3 |
* @version 3.0.0
|
4 |
*/
|
5 |
?>
|
6 |
+
<div class="wc-stripe-clear"></div>
|
7 |
<div class="wc-stripe-product-checkout-container">
|
8 |
<ul class="wc_stripe_product_payment_methods">
|
9 |
<?php foreach($gateways as $gateway):?>
|