Version Description
- Feature - Upgrade to the latest Braintree JavaScript SDK for improved customer experience, reliability, and error handling
- Tweak - Add placeholder text for credit card inputs
- Tweak - Add responsive sizing to the PayPal buttons and update to the recommended styling for the Cart and Checkout pages
- Tweak - Add setting and filter to disable PayPal on the cart page
- Tweak - Update all translatable strings to the same text domain
- Tweak - Hide Kount as a fraud tool option for US-based stores as it's not currently supported
- Tweak - Only load the Braintree scripts when required on payment pages
- Fix - Ensure that new customers have their billing address stored in the vault on their first transaction
- Fix - Prevent linked PayPal accounts from being cleared if there are address errors at checkout
- Fix - Fix some deprecated function notices
Download this release
Release Info
Developer | bor0 |
Plugin | WooCommerce PayPal Powered by Braintree Payment Gateway |
Version | 2.1.0 |
Comparing to | |
See all releases |
Code changes from version 2.0.4 to 2.1.0
- assets/css/frontend/wc-braintree.min.css +40 -2
- assets/js/frontend/wc-braintree.min.js +1 -1
- class-wc-braintree.php +46 -2
- i18n/languages/woocommerce-gateway-paypal-powered-by-braintree.pot +1338 -104
- includes/api/class-wc-braintree-api-response-message-helper.php +1 -1
- includes/api/class-wc-braintree-api.php +1 -20
- includes/api/requests/abstract-wc-braintree-api-request.php +1 -1
- includes/api/requests/abstract-wc-braintree-api-vault-request.php +1 -1
- includes/api/requests/class-wc-braintree-api-client-token-request.php +1 -1
- includes/api/requests/class-wc-braintree-api-customer-request.php +1 -1
- includes/api/requests/class-wc-braintree-api-payment-method-nonce-request.php +1 -1
- includes/api/requests/class-wc-braintree-api-payment-method-request.php +1 -1
- includes/api/requests/class-wc-braintree-api-transaction-request.php +6 -2
- includes/api/responses/abstract-wc-braintree-api-response.php +1 -1
- includes/api/responses/abstract-wc-braintree-api-transaction-response.php +1 -1
- includes/api/responses/abstract-wc-braintree-api-vault-response.php +1 -1
- includes/api/responses/class-wc-braintree-api-client-token-response.php +1 -1
- includes/api/responses/class-wc-braintree-api-credit-card-transaction-response.php +1 -1
- includes/api/responses/class-wc-braintree-api-customer-response.php +1 -1
- includes/api/responses/class-wc-braintree-api-payment-method-nonce-response.php +1 -1
- includes/api/responses/class-wc-braintree-api-payment-method-response.php +2 -2
- includes/api/responses/class-wc-braintree-api-paypal-transaction-response.php +1 -1
- includes/class-wc-braintree-frontend.php +3 -3
- includes/class-wc-braintree-payment-method-handler.php +1 -1
- includes/class-wc-braintree-payment-method.php +1 -1
- includes/class-wc-braintree-paypal-cart.php +30 -7
- includes/class-wc-gateway-braintree-credit-card.php +35 -13
- includes/class-wc-gateway-braintree-paypal.php +86 -30
- includes/class-wc-gateway-braintree.php +120 -16
- includes/payment-forms/abstract-wc-braintree-payment-form.php +6 -5
- includes/payment-forms/class-wc-braintree-hosted-fields-payment-form.php +29 -2
- includes/payment-forms/class-wc-braintree-paypal-payment-form.php +28 -2
- includes/views/admin-html-braintree-auth.php +1 -1
- lib/Braintree.php +9 -9
- lib/Braintree/AccountUpdaterDailyReport.php +43 -0
- lib/Braintree/AchMandate.php +57 -0
- lib/Braintree/Address.php +0 -1
- lib/Braintree/AddressGateway.php +10 -6
- lib/Braintree/AmexExpressCheckoutCard.php +0 -2
- lib/Braintree/AndroidPayCard.php +0 -1
- lib/Braintree/ApplePayCard.php +0 -1
- lib/Braintree/ApplePayGateway.php +65 -0
- lib/Braintree/ApplePayOptions.php +28 -0
- lib/Braintree/AuthorizationAdjustment.php +35 -0
- lib/Braintree/Base.php +0 -2
- lib/Braintree/ClientToken.php +1 -1
- lib/Braintree/ClientTokenGateway.php +1 -1
- lib/Braintree/CoinbaseAccount.php +0 -2
- lib/Braintree/Collection.php +0 -1
- lib/Braintree/Configuration.php +128 -1
- lib/Braintree/ConnectedMerchantPayPalStatusChanged.php +36 -0
- lib/Braintree/ConnectedMerchantStatusTransitioned.php +36 -0
- lib/Braintree/CredentialsParser.php +0 -1
- lib/Braintree/CreditCard.php +4 -3
- lib/Braintree/CreditCardGateway.php +16 -15
- lib/Braintree/Customer.php +31 -3
- lib/Braintree/CustomerGateway.php +19 -5
- lib/Braintree/Digest.php +0 -2
- lib/Braintree/Disbursement.php +1 -1
- lib/Braintree/DisbursementDetails.php +0 -1
- lib/Braintree/Dispute.php +98 -3
- lib/Braintree/Dispute/EvidenceDetails.php +21 -0
- lib/Braintree/Dispute/StatusHistoryDetails.php +19 -0
- lib/Braintree/Dispute/TransactionDetails.php +0 -2
- lib/Braintree/DisputeGateway.php +244 -0
- lib/Braintree/DisputeSearch.php +75 -0
- lib/Braintree/DocumentUpload.php +45 -0
- lib/Braintree/DocumentUploadGateway.php +81 -0
- lib/Braintree/Error/Codes.php +100 -63
- lib/Braintree/Error/ErrorCollection.php +11 -2
- lib/Braintree/Error/Validation.php +0 -1
- lib/Braintree/Error/ValidationErrorCollection.php +0 -1
- lib/Braintree/EuropeBankAccount.php +0 -1
- lib/Braintree/Exception.php +0 -1
- lib/Braintree/Exception/Authentication.php +0 -1
- lib/Braintree/Exception/Authorization.php +0 -1
- lib/Braintree/Exception/Connection.php +17 -0
- lib/Braintree/Exception/DownForMaintenance.php +0 -1
- lib/Braintree/Exception/ForgedQueryString.php +0 -1
- lib/Braintree/Exception/NotFound.php +0 -1
- lib/Braintree/Exception/SSLCaFileNotFound.php +0 -1
- lib/Braintree/Exception/SSLCertificate.php +0 -1
- lib/Braintree/Exception/ServerError.php +0 -1
- lib/Braintree/Exception/TestOperationPerformedInProduction.php +0 -1
- lib/Braintree/Exception/Timeout.php +16 -0
- lib/Braintree/Exception/TooManyRequests.php +16 -0
- lib/Braintree/Exception/Unexpected.php +0 -1
- lib/Braintree/Exception/UpgradeRequired.php +0 -1
- lib/Braintree/Exception/ValidationsFailed.php +0 -1
- lib/Braintree/FacilitatedDetails.php +29 -0
- lib/Braintree/FacilitatorDetails.php +1 -1
- lib/Braintree/Gateway.php +54 -1
- lib/Braintree/Http.php +100 -19
- lib/Braintree/IbanBankAccount.php +57 -0
- lib/Braintree/IdealPayment.php +92 -0
- lib/Braintree/IdealPaymentGateway.php +104 -0
- lib/Braintree/Instance.php +0 -1
- lib/Braintree/MasterpassCard.php +141 -0
- lib/Braintree/Merchant.php +9 -1
- lib/Braintree/MerchantAccount.php +1 -1
- lib/Braintree/MerchantAccount/AddressDetails.php +1 -1
- lib/Braintree/MerchantAccount/BusinessDetails.php +1 -1
- lib/Braintree/MerchantAccount/FundingDetails.php +1 -1
- lib/Braintree/MerchantAccount/IndividualDetails.php +1 -1
- lib/Braintree/MerchantAccountGateway.php +29 -1
- lib/Braintree/MerchantGateway.php +1 -1
- lib/Braintree/OAuthCredentials.php +0 -2
- lib/Braintree/OAuthGateway.php +18 -1
- lib/Braintree/OAuthResult.php +34 -0
- lib/Braintree/PaginatedCollection.php +120 -0
- lib/Braintree/PaginatedResult.php +32 -0
- lib/Braintree/PartnerMerchant.php +0 -1
- lib/Braintree/PayPalAccount.php +0 -2
- lib/Braintree/PayPalAccountGateway.php +0 -2
- lib/Braintree/PaymentInstrumentType.php +6 -1
- lib/Braintree/PaymentMethod.php +2 -5
- lib/Braintree/PaymentMethodGateway.php +63 -13
- lib/Braintree/PaymentMethodNonce.php +0 -3
- lib/Braintree/PaymentMethodNonceGateway.php +0 -3
- lib/Braintree/ResourceCollection.php +12 -2
- lib/Braintree/Result/CreditCardVerification.php +2 -1
- lib/Braintree/Result/Error.php +2 -3
- lib/Braintree/Result/Successful.php +0 -1
- lib/Braintree/Subscription.php +2 -3
- lib/Braintree/Subscription/StatusDetails.php +2 -1
- lib/Braintree/SubscriptionGateway.php +4 -2
- lib/Braintree/SubscriptionSearch.php +5 -0
- lib/Braintree/Test/CreditCardNumbers.php +4 -1
- lib/Braintree/Test/MerchantAccount.php +0 -1
- lib/Braintree/Test/Nonces.php +8 -2
- lib/Braintree/Test/Transaction.php +1 -3
- lib/Braintree/Test/TransactionAmounts.php +0 -1
- lib/Braintree/Test/VenmoSdk.php +0 -1
- lib/Braintree/TestingGateway.php +1 -1
- lib/Braintree/Transaction.php +60 -8
- lib/Braintree/Transaction/AddressDetails.php +0 -1
- lib/Braintree/Transaction/AmexExpressCheckoutCardDetails.php +0 -2
- lib/Braintree/Transaction/AndroidPayCardDetails.php +0 -2
- lib/Braintree/Transaction/ApplePayCardDetails.php +0 -2
- lib/Braintree/Transaction/CoinbaseDetails.php +0 -2
- lib/Braintree/Transaction/CreditCardDetails.php +0 -1
- lib/Braintree/Transaction/CustomerDetails.php +0 -1
- lib/Braintree/Transaction/EuropeBankAccountDetails.php +0 -1
- lib/Braintree/Transaction/IdealPaymentDetails.php +23 -0
- lib/Braintree/Transaction/MasterpassCardDetails.php +51 -0
- lib/Braintree/Transaction/PayPalDetails.php +0 -2
- lib/Braintree/Transaction/StatusDetails.php +0 -1
- lib/Braintree/Transaction/SubscriptionDetails.php +0 -1
- lib/Braintree/Transaction/UsBankAccountDetails.php +40 -0
- lib/Braintree/Transaction/VenmoAccountDetails.php +0 -2
- lib/Braintree/Transaction/VisaCheckoutCardDetails.php +52 -0
- lib/Braintree/TransactionGateway.php +62 -12
- lib/Braintree/TransactionSearch.php +1 -0
- lib/Braintree/TransparentRedirect.php +0 -1
- lib/Braintree/TransparentRedirectGateway.php +0 -1
- lib/Braintree/UnknownPaymentMethod.php +0 -2
- lib/Braintree/UsBankAccount.php +95 -0
- lib/Braintree/UsBankAccountGateway.php +106 -0
- lib/Braintree/Util.php +13 -2
- lib/Braintree/VenmoAccount.php +0 -1
- lib/Braintree/Version.php +2 -4
- lib/Braintree/VisaCheckoutCard.php +154 -0
- lib/Braintree/WebhookNotification.php +28 -54
- lib/Braintree/WebhookNotificationGateway.php +69 -0
- lib/Braintree/WebhookTesting.php +132 -0
- lib/Braintree/Xml.php +1 -3
- lib/Braintree/Xml/Generator.php +4 -6
- lib/Braintree/Xml/Parser.php +0 -2
- lib/skyverge/woocommerce/changelog.txt +37 -1
- lib/skyverge/woocommerce/class-sv-wc-admin-notice-handler.php +1 -1
- lib/skyverge/woocommerce/class-sv-wc-helper.php +12 -11
- lib/skyverge/woocommerce/class-sv-wc-plugin-compatibility.php +46 -5
- lib/skyverge/woocommerce/class-sv-wc-plugin.php +9 -9
- lib/skyverge/woocommerce/class-sv-wp-admin-message-handler.php +2 -2
- lib/skyverge/woocommerce/compatibility/class-sv-wc-order-compatibility.php +138 -0
- lib/skyverge/woocommerce/compatibility/class-sv-wc-product-compatibility.php +3 -3
- lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php +17 -17
- lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php +3 -3
- lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php +11 -11
- lib/skyverge/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor-token.php +1 -1
- lib/skyverge/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor.php +1 -1
- lib/skyverge/woocommerce/payment-gateway/admin/views/html-user-profile-field-customer-id.php +1 -1
- lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php +25 -25
- lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php +32 -32
- lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php +15 -15
- lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php +20 -20
- lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php +19 -19
- lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php +11 -9
- lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php +106 -95
- lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php +9 -9
- lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php +18 -18
- lib/skyverge/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php +7 -7
- readme.txt +17 -2
- woocommerce-gateway-paypal-powered-by-braintree.php +5 -2
assets/css/frontend/wc-braintree.min.css
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
WooCommerce Braintree SCSS
|
3 |
Version 2.0.0
|
4 |
|
5 |
-
Copyright (c) 2016-
|
6 |
Licensed under the GNU General Public License v3.0
|
7 |
http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
*/
|
@@ -17,6 +17,19 @@ http://www.gnu.org/licenses/gpl-3.0.html
|
|
17 |
float: none !important;
|
18 |
max-height: 100% !important; }
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
.woocommerce #payment div.payment_method_braintree_credit_card label.sv-wc-payment-gateway-payment-form-saved-payment-method,
|
21 |
.woocommerce #payment div.payment_method_braintree_credit_card label[for="wc-braintree-credit-card-use-new-payment-method"],
|
22 |
.woocommerce #payment div.payment_method_braintree_credit_card label[for="wc-braintree-paypal-use-new-payment-method"],
|
@@ -52,13 +65,15 @@ http://www.gnu.org/licenses/gpl-3.0.html
|
|
52 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-american-express {
|
53 |
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-amex.svg"); }
|
54 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-diners-club {
|
55 |
-
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-
|
56 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-maestro {
|
57 |
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-maestro.svg"); }
|
58 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-jcb {
|
59 |
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-jcb.svg"); }
|
60 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-discover {
|
61 |
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-discover.svg"); }
|
|
|
|
|
62 |
@media only screen and (max-width: 320px) {
|
63 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number {
|
64 |
background-image: none; } }
|
@@ -76,6 +91,29 @@ http://www.gnu.org/licenses/gpl-3.0.html
|
|
76 |
.woocommerce #payment div.payment_method_braintree_credit_card .braintree-hosted-fields-invalid {
|
77 |
border-color: #a00; }
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
#add_payment_method ul.payment_methods li {
|
80 |
list-style-type: none; }
|
81 |
#add_payment_method ul.payment_methods li label[for="payment_method_braintree_credit_card"],
|
2 |
WooCommerce Braintree SCSS
|
3 |
Version 2.0.0
|
4 |
|
5 |
+
Copyright (c) 2016-2018, Automattic, Inc.
|
6 |
Licensed under the GNU General Public License v3.0
|
7 |
http://www.gnu.org/licenses/gpl-3.0.html
|
8 |
*/
|
17 |
float: none !important;
|
18 |
max-height: 100% !important; }
|
19 |
|
20 |
+
.woocommerce #wc_braintree_paypal_container .wc-braintree-paypal-account {
|
21 |
+
padding: 1em 0;
|
22 |
+
border-top: 1px solid #bbb;
|
23 |
+
border-bottom: 1px solid #bbb; }
|
24 |
+
.woocommerce #wc_braintree_paypal_container .wc-braintree-paypal-account .name {
|
25 |
+
display: inline-block;
|
26 |
+
margin-right: 0.5em;
|
27 |
+
font-weight: bold; }
|
28 |
+
.woocommerce #wc_braintree_paypal_container .wc-braintree-paypal-account .email {
|
29 |
+
opacity: 0.5; }
|
30 |
+
.woocommerce #wc_braintree_paypal_container .wc-braintree-paypal-account .cancel {
|
31 |
+
float: right; }
|
32 |
+
|
33 |
.woocommerce #payment div.payment_method_braintree_credit_card label.sv-wc-payment-gateway-payment-form-saved-payment-method,
|
34 |
.woocommerce #payment div.payment_method_braintree_credit_card label[for="wc-braintree-credit-card-use-new-payment-method"],
|
35 |
.woocommerce #payment div.payment_method_braintree_credit_card label[for="wc-braintree-paypal-use-new-payment-method"],
|
65 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-american-express {
|
66 |
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-amex.svg"); }
|
67 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-diners-club {
|
68 |
+
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-dinersclub.svg"); }
|
69 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-maestro {
|
70 |
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-maestro.svg"); }
|
71 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-jcb {
|
72 |
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-jcb.svg"); }
|
73 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-discover {
|
74 |
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-discover.svg"); }
|
75 |
+
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number.card-type-invalid {
|
76 |
+
background-image: url("../../../lib/skyverge/woocommerce/payment-gateway/assets/images/card-cc-invalid.svg"); }
|
77 |
@media only screen and (max-width: 320px) {
|
78 |
.woocommerce #payment div.payment_method_braintree_credit_card .wc-braintree-hosted-field-card-number {
|
79 |
background-image: none; } }
|
91 |
.woocommerce #payment div.payment_method_braintree_credit_card .braintree-hosted-fields-invalid {
|
92 |
border-color: #a00; }
|
93 |
|
94 |
+
#wc-braintree-credit-card-3dsecure-container {
|
95 |
+
display: none;
|
96 |
+
position: fixed;
|
97 |
+
top: 0;
|
98 |
+
left: 0;
|
99 |
+
bottom: 0;
|
100 |
+
right: 0;
|
101 |
+
background: rgba(0, 0, 0, 0.7);
|
102 |
+
z-index: 3000;
|
103 |
+
cursor: pointer; }
|
104 |
+
#wc-braintree-credit-card-3dsecure-container iframe {
|
105 |
+
overflow: auto;
|
106 |
+
margin: auto;
|
107 |
+
position: absolute;
|
108 |
+
top: 0;
|
109 |
+
left: 0;
|
110 |
+
bottom: 0;
|
111 |
+
right: 0;
|
112 |
+
background: white;
|
113 |
+
padding: 1em;
|
114 |
+
box-sizing: content-box;
|
115 |
+
border-radius: 5px; }
|
116 |
+
|
117 |
#add_payment_method ul.payment_methods li {
|
118 |
list-style-type: none; }
|
119 |
#add_payment_method ul.payment_methods li label[for="payment_method_braintree_credit_card"],
|
assets/js/frontend/wc-braintree.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(){var a=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a},b={}.hasOwnProperty;jQuery(document).ready(function(b){"use strict";return window.WC_Braintree_Payment_Form_Handler=function(){function a(a){this.id=a.id,this.id_dasherized=a.id_dasherized,this.type=a.type,this.debug=a.debug,this.params=window.wc_braintree_params,"undefined"!=typeof braintree&&null!==braintree&&(b("form.checkout").length?this.handle_checkout_page():b("form#order_review").length?this.handle_pay_page():b("form#add_payment_method").length&&this.handle_add_payment_method_page())}return a.prototype.handle_checkout_page=function(){return this.form=b("form.checkout"),this.form_ui_selector=".woocommerce-checkout-payment",b(document.body).on("updated_checkout",function(a){return function(){return a.setup_braintree()}}(this)),b(document.body).on("updated_checkout",function(a){return function(){return a.handle_saved_payment_methods()}}(this)),b(document.body).on("checkout_error",function(a){return function(){return a.unblock_ui(),b("input[name=wc_"+a.id+"_payment_nonce]").val("")}}(this)),this.form.on("checkout_place_order_"+this.id,function(a){return function(){return a.block_ui(),a.verify_form()}}(this))},a.prototype.handle_pay_page=function(){return this.form=b("form#order_review"),this.form_ui_selector="#payment",this.handle_saved_payment_methods(),this.setup_braintree(),this.form.submit(function(a){return function(){if(a.block_ui(),!1!==a.verify_form())return HTMLFormElement.prototype.submit.call(a.form[0])}}(this))},a.prototype.handle_add_payment_method_page=function(){return this.form=b("form#add_payment_method"),this.form_ui_selector="#payment",this.setup_braintree(),this.form.submit(function(a){return function(){return!(a.is_braintree_selected()&&!a.has_payment_nonce())&&HTMLFormElement.prototype.submit.call(a.form[0])}}(this))},a.prototype.verify_form=function(){return!this.is_braintree_selected()||(!!this.using_payment_token()||!!this.has_payment_nonce()&&void 0)},a.prototype.submit_form=function(a){return b("input[name=wc_"+this.id+"_payment_nonce]").val(a),this.form.submit()},a.prototype.handle_saved_payment_methods=function(){var a;return a=b("div.js-wc-"+this.id_dasherized+"-new-payment-method-form"),b("input.js-wc-"+this.id_dasherized+"-payment-token").change(function(c){return function(){var d;return d=b("input.js-wc-"+c.id_dasherized+"-payment-token:checked").val(),d?a.slideUp(200):a.slideDown(200)}}(this)).change(),b("input#createaccount").change(function(a){return function(c){var d;return d=b("input.js-wc-"+a.id_dasherized+"-tokenize-payment-method").closest("p.form-row"),b(c.target).is(":checked")?(d.slideDown(),d.next().show()):(d.hide(),d.next().hide())}}(this)).change()},a.prototype.setup_braintree=function(){},a.prototype.refresh_braintree=function(){if(null!=this.integration)return this.block_ui(),this.integration.teardown(function(a){return function(){return a.integration=null,a.setup_braintree()}}(this))},a.prototype.teardown_braintree=function(){if(null!=this.integration)return this.block_ui(),this.integration.teardown(function(a){return function(){return a.integration=null,a.unblock_ui()}}(this))},a.prototype.on_payment_method_received=function(a){},a.prototype.on_error=function(a){if("VALIDATION"===a.type){if(!this.is_braintree_selected())return;if(this.id!==this.get_selected_gateway_id())return;this.render_error(this.get_error_message(a))}else this.log("configuration error",a.message);return this.unblock_ui()},a.prototype.get_error_message=function(a){},a.prototype.on_ready=function(a){return this.unblock_ui(),this.integration=a},a.prototype.block_ui=function(){return b(this.form_ui_selector).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},a.prototype.unblock_ui=function(){return b(this.form_ui_selector).unblock()},a.prototype.render_error=function(a){return b(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<div class="woocommerce-error">'+a+"</div>").removeClass("processing").unblock(),b("html, body").animate({scrollTop:this.form.offset().top-100},1e3),b("input[name=wc_"+this.id+"_payment_nonce]").val(""),this.form.trigger("wc_"+this.id+"_rendered_error"),this.unblock_ui()},a.prototype.has_payment_nonce=function(){return this.form.find("input[name=wc_"+this.get_selected_gateway_id()+"_payment_nonce]").val()},a.prototype.using_payment_token=function(){return this.form.find("input.js-wc-"+this.get_selected_gateway_id_dasherized()+"-payment-token:checked").val()},a.prototype.get_selected_gateway_id=function(){return this.form.find("input[name=payment_method]:checked").val()},a.prototype.get_selected_gateway_id_dasherized=function(){return this.get_selected_gateway_id().replace(/_/g,"-")},a.prototype.is_braintree_selected=function(){var a;return"braintree_credit_card"===(a=this.form.find("input[name=payment_method]:checked").val())||"braintree_paypal"===a},a.prototype.is_credit_card_selected=function(){return"braintree_credit_card"===this.get_selected_gateway_id()},a.prototype.is_paypal_selected=function(){return"braintree_paypal"===this.get_selected_gateway_id()},a.prototype.log=function(a,b){if(this.debug)return console.log(a),console.log(b)},a}(),window.WC_Braintree_Credit_Card_Payment_Form_Handler=function(c){function d(a){this.csc_required=a.csc_required,this.hosted_fields_styles=a.hosted_fields_styles,this.threeds=a.threeds,d.__super__.constructor.call(this,a),this.is_3d_secure_enabled()&&this.setup_3d_secure()}return a(d,c),d.prototype.verify_form=function(){var a,c;return!this.is_braintree_selected()||(c=d.__super__.verify_form.call(this),!(this.csc_required&&!this.has_payment_nonce())&&(a=b("input.js-wc-braintree-credit-card-payment-token:checked"),this.should_verify_3d_secure_token(a)&&(this.verify_3d_secure(a.data("nonce"),a),c=!1),c))},d.prototype.setup_braintree=function(){var a;return this.integration?this.refresh_braintree():(this.block_ui(),a={number:{selector:"#wc-braintree-credit-card-account-number-hosted"},cvv:{selector:"#wc-braintree-credit-card-csc-hosted"},expirationDate:{selector:"#wc-braintree-credit-card-expiry-hosted"},styles:this.hosted_fields_styles,onFieldEvent:function(a){return function(b){return a.on_hosted_field_event(b)}}(this)},this.csc_required&&this.form.find("input.js-wc-"+this.id_dasherized+"-payment-token:checked").val()&&(delete a.number,delete a.expirationDate),this.csc_required||delete a.cvv,braintree.setup(this.params.client_token,"custom",{id:this.form[0],hostedFields:a,onPaymentMethodReceived:function(a){return function(b){return a.on_payment_method_received(b)}}(this),onError:function(a){return function(b){return a.on_error(b)}}(this),onReady:function(a){return function(b){return a.on_ready(b)}}(this)}))},d.prototype.on_ready=function(a){if(d.__super__.on_ready.call(this,a),!this.csc_required&&b("input.js-wc-braintree-credit-card-payment-token:checked").val())return this.teardown_braintree()},d.prototype.handle_saved_payment_methods=function(){var a,c;return d.__super__.handle_saved_payment_methods.call(this),c=b("div.js-wc-braintree-credit-card-new-payment-method-form"),a=b("div.wc-braintree-hosted-field-card-csc-parent"),b("input.js-wc-braintree-credit-card-payment-token").change(function(d){return function(){var e;return e=b("input.js-wc-braintree-credit-card-payment-token:checked").val(),e?d.csc_required&&a.hasClass("form-row-last")?(a.removeClass("form-row-last").addClass("form-row-first"),c.after(a),d.refresh_braintree()):void 0:d.csc_required&&a.hasClass("form-row-first")?(a.removeClass("form-row-first").addClass("form-row-last"),c.find("div.wc-braintree-hosted-field-card-expiry-parent").after(a),d.refresh_braintree()):d.setup_braintree()}}(this)).change()},d.prototype.get_error_message=function(a){var b,c,d,e;if(d=[],null!=a.details)for(e=a.details.invalidFieldKeys,b=0,c=e.length;b<c;b++)switch(e[b]){case"number":d.push(this.params.card_number_invalid);break;case"cvv":d.push(this.params.cvv_length_invalid);break;case"expirationDate":d.push(this.params.card_exp_date_invalid)}else switch(a.message){case"User did not enter a payment method":this.csc_required?this.using_payment_token()?d.push(this.params.cvv_missing):d.push(this.params.card_number_missing,this.params.card_exp_date_invalid,this.params.cvv_missing):d.push(this.params.card_number_missing,this.params.card_exp_date_invalid)}return d.length||d.push(a.message),d.join("<br/>")},d.prototype.on_payment_method_received=function(a){if(this.log("payment method received",a),null!=a.nonce)return this.should_verify_3d_secure(a)?this.verify_3d_secure(a.nonce):this.submit_form(a.nonce)},d.prototype.on_hosted_field_event=function(a){var c;if(c=b(".wc-braintree-hosted-field-card-number"),c.attr("class",function(a,b){return b.replace(/(^|\s)card-type-\S+/g,"")}),null!=a.card)return c.addClass("card-type-"+a.card.type)},d.prototype.is_3d_secure_enabled=function(){return this.threeds.enabled},d.prototype.setup_3d_secure=function(){return this.client=new braintree.api.Client({clientToken:this.params.client_token})},d.prototype.should_verify_3d_secure=function(a){var b;return b=a.details.cardType,this.is_3d_secure_enabled()&&"CreditCard"===a.type&&("Visa"===b||"MasterCard"===b)},d.prototype.should_verify_3d_secure_token=function(a){if(a.val()&&a.data("nonce")&&!a.data("verified"))return!0},d.prototype.verify_3d_secure=function(a,c){var d;return null==c&&(c=null),d=b("input[name=wc_braintree_credit_card_3d_secure_order_total]").val(),this.client.verify3DS({amount:d,creditCard:a},function(a){return function(d,e){return d?(a.render_error(d.message),a.log("3DS error",d)):(a.log("3DS response",e),a.threeds.liability_shift_always_required&&!e.verificationDetails.liabilityShifted&&a.render_error(a.threeds.failure_message),e.verificationDetails.liabilityShiftPossible&&!e.verificationDetails.liabilityShifted&&a.render_error(a.threeds.failure_message),null!=c&&c.data("verified",!0),b("input[name=wc_braintree_credit_card_3d_secure_verified]").val(1),a.submit_form(e.nonce))}}(this))},d}(WC_Braintree_Payment_Form_Handler),window.WC_Braintree_PayPal_Payment_Form_Handler=function(c){function d(a){this.must_login_message=a.must_login_message,this.must_login_add_method_message=a.must_login_add_method_message,d.__super__.constructor.call(this,a),b("input[name=wc_"+this.id+"_payment_nonce]").val(this.params.cart_payment_nonce),b(document.body).on("click",'input[name="payment_method"], input.js-wc-braintree-paypal-payment-token',function(a){return function(){return!a.is_paypal_selected()||a.has_payment_nonce()||a.using_payment_token()?b("#place_order").show():b("#place_order").hide()}}(this))}return a(d,c),d.prototype.handle_checkout_page=function(){return d.__super__.handle_checkout_page.call(this),b(document.body).on("checkout_error",function(a){return function(){return a.params.cart_payment_nonce=!1,a.setup_braintree()}}(this))},d.prototype.verify_form=function(){var a;return!this.is_braintree_selected()||(a=d.__super__.verify_form.call(this),this.has_payment_nonce()||this.using_payment_token()||this.render_error(this.must_login_message),a)},d.prototype.handle_add_payment_method_page=function(){return this.form=b("form#add_payment_method"),this.form_ui_selector="#payment",this.setup_braintree(),this.form.submit(function(a){return function(){return a.is_paypal_selected()&&(a.has_payment_nonce()||a.render_error(a.must_login_add_method_message)),!(a.is_braintree_selected()&&!a.has_payment_nonce())&&HTMLFormElement.prototype.submit.call(a.form[0])}}(this))},d.prototype.setup_braintree=function(){if(!this.params.cart_payment_nonce&&b("#wc_braintree_paypal_container").length)return b(".payment_method_braintree_paypal fieldset").show(),b("input[name=wc_braintree_paypal_payment_nonce]").val(""),this.integration?this.refresh_braintree():(this.block_ui(),braintree.setup(this.params.client_token,"paypal",{container:"wc_braintree_paypal_container",singleUse:this.is_single_use(),amount:this.get_order_amount(),currency:this.get_store_currency(),locale:this.get_store_locale(),onPaymentMethodReceived:function(a){return function(b){return a.on_payment_method_received(b)}}(this),onError:function(a){return function(b){return a.on_error(b)}}(this),onReady:function(a){return function(b){return a.on_ready(b)}}(this),onCancelled:function(a){return function(){return a.on_cancelled()}}(this),onUnsupported:function(a){return function(b){return a.on_unsupported(b)}}(this)}))},d.prototype.on_cancelled=function(){if(b("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!1),b("input[name=wc_braintree_paypal_payment_nonce]").val(""),this.is_paypal_selected())return b("#place_order").hide()},d.prototype.on_unsupported=function(a){return this.log("PayPal error",a),this.render_error(this.params.generic_error_message)},d.prototype.handle_saved_payment_methods=function(){return d.__super__.handle_saved_payment_methods.call(this),b("input.js-wc-braintree-paypal-tokenize-payment-method").change(function(a){return function(c){if(b(c.target).is(":visible"))return a.refresh_braintree()}}(this)).change()},d.prototype.on_payment_method_received=function(a){if(this.log("payment method received",a),null!=a.nonce)return this.is_single_use()&&b("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!0),b("input[name=wc_braintree_paypal_payment_nonce]").val(a.nonce),b("#place_order").show()},d.prototype.is_single_use=function(){var a;return a=b("input[name=wc-braintree-paypal-tokenize-payment-method]"),0===a.length||("checkbox"===a.attr("type")?!a.is(":checked"):!a.val())},d.prototype.get_order_amount=function(){return b("input[name=wc_braintree_paypal_amount]").val()},d.prototype.get_store_currency=function(){return b("input[name=wc_braintree_paypal_currency]").val()},d.prototype.get_store_locale=function(){return b("input[name=wc_braintree_paypal_locale]").val()},d}(WC_Braintree_Payment_Form_Handler),window.WC_Braintree_PayPal_Cart_Handler=function(c){function d(a){d.__super__.constructor.call(this,a),this.form=b("form.woocommerce-cart-form"),this.form_ui_selector=".cart_totals",this.setup_braintree(),b(document.body).on("updated_cart_totals",function(a){return function(){return a.setup_braintree()}}(this))}return a(d,c),d.prototype.on_payment_method_received=function(a){if(this.log("payment method received",a),null!=a.nonce)return a.wp_nonce=this.params.cart_nonce,b.ajax({type:"POST",url:this.params.cart_handler_url,data:a,dataType:"json"}).done(function(a){return window.location=a.redirect_url})},d.prototype.on_error=function(a){return this.log("PayPal error",a.message),this.unblock_ui()},d.prototype.on_unsupported=function(a){return console.log(a),this.unblock_ui()},d.prototype.is_single_use=function(){return"1"===b("input[name=wc_braintree_paypal_single_use]").val()},d.prototype.has_payment_nonce=function(){return!1},d}(WC_Braintree_PayPal_Payment_Form_Handler)})}).call(this);
|
1 |
+
(function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},c={}.hasOwnProperty,d=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};jQuery(document).ready(function(c){"use strict";return window.WC_Braintree_Payment_Form_Handler=function(){function b(b){if(this.hide_integration_ui=a(this.hide_integration_ui,this),this.show_integration_ui=a(this.show_integration_ui,this),this.id=b.id,this.id_dasherized=b.id_dasherized,this.type=b.type,this.debug=b.debug,this.client_token_nonce=b.client_token_nonce,this.params=window.wc_braintree_params,!this.is_sdk_ready())return console.error("Braintree SDK is missing.");this.init()}return b.prototype.init=function(){return c("form.checkout").length?this.handle_checkout_page():c("form#order_review").length?this.handle_pay_page():c("form#add_payment_method").length?this.handle_add_payment_method_page():void 0},b.prototype.handle_checkout_page=function(){return this.form=c("form.checkout"),this.form_ui_selector=".woocommerce-checkout-payment",c(document.body).on("updated_checkout",function(a){return function(){return a.setup_braintree()}}(this)),c(document.body).on("updated_checkout",function(a){return function(){return a.handle_saved_payment_methods()}}(this)),c(document.body).on("checkout_error",function(a){return function(){return a.handle_checkout_error()}}(this)),this.form.on("checkout_place_order_"+this.id,function(a){return function(){if(a.is_selected())return a.block_ui(),a.verify_form()}}(this))},b.prototype.handle_checkout_error=function(){return this.unblock_ui()},b.prototype.handle_pay_page=function(){return this.form=c("form#order_review"),this.form_ui_selector="#payment",this.handle_saved_payment_methods(),this.setup_braintree(),this.form.submit(function(a){return function(){if(a.is_selected())return a.block_ui(),a.verify_form()}}(this))},b.prototype.handle_add_payment_method_page=function(){return this.form=c("form#add_payment_method"),this.form_ui_selector="#payment",this.setup_braintree(),this.form.submit(function(a){return function(){if(a.is_selected())return a.block_ui(),a.verify_form()}}(this))},b.prototype.verify_form=function(){return!!this.using_payment_token()||!!this.has_payment_nonce()&&void 0},b.prototype.submit_form=function(a){return c("input[name=wc_"+this.id+"_payment_nonce]").val(a),this.form.submit()},b.prototype.handle_saved_payment_methods=function(){var a;return a=c("div.js-wc-"+this.id_dasherized+"-new-payment-method-form"),c("input.js-wc-"+this.id_dasherized+"-payment-token").change(function(b){return function(){var d;return d=c("input.js-wc-"+b.id_dasherized+"-payment-token:checked").val(),d?a.slideUp(200):a.slideDown(200)}}(this)).change(),c("input#createaccount").change(function(a){return function(b){var d;return d=c("input.js-wc-"+a.id_dasherized+"-tokenize-payment-method").closest("p.form-row"),c(b.target).is(":checked")?(d.slideDown(),d.next().show()):(d.hide(),d.next().hide())}}(this)).change()},b.prototype.setup_braintree=function(){return this.block_ui(),c("input[name=wc_"+this.id+"_payment_nonce]").val(""),null!=this.client?this.setup_integration():this.create_client()},b.prototype.create_client=function(){return this.get_client_token().then(function(a){return function(b){return braintree.client.create({authorization:b}).then(function(b){return a.client=b,a.setup_integration()})}}(this)).catch(function(a){return function(b){return a.handle_integration_error(b),a.unblock_ui()}}(this))},b.prototype.get_client_token=function(){return new Promise(function(a){return function(b,d){var e;return a.id+"_client_token_nonce",e={action:"wc_"+a.id+"_get_client_token",nonce:a.client_token_nonce},c.post(a.params.ajax_url,e).done(function(a){return a.success?b(a.data):d(a.data)}).fail(function(a,b,c){return d({message:"Could not retrieve the client token via AJAX"})})}}(this))},b.prototype.setup_integration=function(){return this.get_integration_class().create(this.get_integration_options()).then(function(a){return function(b){return a.integration=b,a.show_integration_ui(),a.do_integration_ready(),c(document).trigger("wc_"+a.id+"_integration_ready",a.integration)}}(this),function(a){return function(b){return a.handle_integration_error(b),a.unblock_ui()}}(this))},b.prototype.refresh_braintree=function(){if(null!=this.integration)return this.block_ui(),this.integration.teardown(function(a){return function(){return a.integration=null,a.setup_braintree()}}(this))},b.prototype.teardown_braintree=function(){if(null!=this.integration)return this.block_ui(),this.integration.teardown(function(a){return function(){return a.integration=null,a.unblock_ui()}}(this))},b.prototype.do_integration_ready=function(){},b.prototype.get_integration_options=function(){return{client:this.client}},b.prototype.get_integration_class=function(){},b.prototype.handle_integration_error=function(a){return this.log("Integration error: "+a.message,a),this.hide_integration_ui(),this.unblock_ui()},b.prototype.handle_payment_error=function(a){return this.log("Payment error: "+a.message,a),this.render_error(this.get_user_message(a)),this.unblock_ui()},b.prototype.render_error=function(a){return c(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<div class="woocommerce-error">'+a+"</div>").removeClass("processing").unblock(),c("html, body").animate({scrollTop:this.form.offset().top-100},1e3),c("input[name=wc_"+this.id+"_payment_nonce]").val(""),this.form.trigger("wc_"+this.id+"_rendered_error"),this.unblock_ui()},b.prototype.get_user_message=function(a){return this.params.payment_error_message},b.prototype.show_integration_ui=function(){if(c("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".woocommerce-error").remove(),c("input#createaccount").length&&c("input#createaccount").is(":checked"))return c("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".form-row").show()},b.prototype.hide_integration_ui=function(){return c("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").prepend('<div class="woocommerce-error">'+this.params.integration_error_message+"</div>"),c("div.js-wc-"+this.id_dasherized+"-new-payment-method-form").find(".form-row").hide()},b.prototype.block_ui=function(){return c(this.form_ui_selector).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},b.prototype.unblock_ui=function(){return c(this.form_ui_selector).unblock()},b.prototype.is_selected=function(){return this.get_selected_gateway_id()===this.id},b.prototype.is_sdk_ready=function(){return"undefined"!=typeof braintree&&null!==braintree&&null!=braintree.client&&null!=this.get_integration_class()},b.prototype.has_payment_nonce=function(){return this.form.find("input[name=wc_"+this.id+"_payment_nonce]").val()},b.prototype.using_payment_token=function(){return this.form.find("input.js-wc-"+this.id_dasherized+"-payment-token:checked").val()},b.prototype.get_selected_gateway_id=function(){return this.form.find("input[name=payment_method]:checked").val()},b.prototype.log=function(a,b){if(this.debug)return console.log("[Braintree] "+a),console.log(b)},b}(),window.WC_Braintree_Credit_Card_Payment_Form_Handler=function(e){function f(b){this.hide_integration_ui=a(this.hide_integration_ui,this),this.show_integration_ui=a(this.show_integration_ui,this),this.remove_3ds_ui=a(this.remove_3ds_ui,this),this.add_3ds_ui=a(this.add_3ds_ui,this),this.csc_required=b.csc_required,this.hosted_fields_styles=b.hosted_fields_styles,this.threeds=b.threeds,this.enabled_card_types=b.enabled_card_types,f.__super__.constructor.call(this,b)}return b(f,e),f.prototype.handle_checkout_error=function(){return f.__super__.handle_checkout_error.call(this),c("input[name=wc_"+this.id+"_payment_nonce]").val("")},f.prototype.verify_form=function(){var a;return this.has_payment_nonce()||!this.csc_required&&this.using_payment_token()?(a=c("input.js-wc-braintree-credit-card-payment-token:checked"),this.should_verify_3d_secure_token(a)?(this.verify_3d_secure(a.data("nonce"),a),!1):f.__super__.verify_form.call(this)):(this.tokenize_payment(),!1)},f.prototype.tokenize_payment=function(){return this.integration.tokenize().then(function(a){return function(b){if(a.log("payment method received",b),null!=b.nonce)return a.should_verify_3d_secure(b)?a.verify_3d_secure(b.nonce):a.submit_form(b.nonce)}}(this)).catch(function(a){return function(b){return a.handle_payment_error(b)}}(this))},f.prototype.get_integration_options=function(){var a;return a={client:this.client,fields:{number:{selector:"#wc-braintree-credit-card-account-number-hosted",placeholder:c("#wc-braintree-credit-card-account-number-hosted").data("placeholder")},cvv:{selector:"#wc-braintree-credit-card-csc-hosted",placeholder:c("#wc-braintree-credit-card-csc-hosted").data("placeholder")},expirationDate:{selector:"#wc-braintree-credit-card-expiry-hosted",placeholder:c("#wc-braintree-credit-card-expiry-hosted").data("placeholder")}},styles:this.hosted_fields_styles},this.csc_required&&this.using_payment_token()&&(delete a.fields.number,delete a.fields.expirationDate),this.csc_required||delete a.fields.cvv,a},f.prototype.get_integration_class=function(){return braintree.hostedFields},f.prototype.do_integration_ready=function(){return this.integration.on("cardTypeChange",function(a){return function(b){return a.on_card_type_change(b)}}(this)),!this.csc_required&&c("input.js-wc-braintree-credit-card-payment-token:checked").val()&&this.teardown_braintree(),this.unblock_ui()},f.prototype.handle_saved_payment_methods=function(){var a,b;return f.__super__.handle_saved_payment_methods.call(this),b=c("div.js-wc-braintree-credit-card-new-payment-method-form"),a=c("div.wc-braintree-hosted-field-card-csc-parent"),c("input.js-wc-braintree-credit-card-payment-token").change(function(d){return function(){var e;return e=c("input.js-wc-braintree-credit-card-payment-token:checked").val(),e?d.csc_required&&a.hasClass("form-row-last")?(a.removeClass("form-row-last").addClass("form-row-first"),b.after(a),d.refresh_braintree()):void 0:(d.csc_required&&a.hasClass("form-row-first")&&(a.removeClass("form-row-first").addClass("form-row-last"),b.find("div.wc-braintree-hosted-field-card-expiry-parent").after(a)),d.refresh_braintree())}}(this)).change()},f.prototype.get_user_message=function(a){var b,c,d,e;if(d=[],"CUSTOMER"===a.type)switch(a.code){case"HOSTED_FIELDS_FIELDS_EMPTY":this.csc_required&&d.push(this.params.cvv_missing),this.using_payment_token()||(d.push(this.params.card_number_missing),d.push(this.params.card_exp_date_invalid));break;case"HOSTED_FIELDS_FIELDS_INVALID":if(null!=a.details)for(e=a.details.invalidFieldKeys,b=0,c=e.length;b<c;b++)switch(e[b]){case"number":d.push(this.params.card_number_invalid);break;case"cvv":d.push(this.params.cvv_length_invalid);break;case"expirationDate":d.push(this.params.card_exp_date_invalid)}}return d.length?d.join("<br/>"):f.__super__.get_user_message.call(this)},f.prototype.on_card_type_change=function(a){var b,e,f;if(null!=a.cards)return b=c("#wc-braintree-credit-card-account-number-hosted"),b.attr("class",function(a,b){return b.replace(/(^|\s)card-type-\S+/g,"")}),a.cards.length?1===a.cards.length?(e=a.cards[0],null!=e.type&&(f=e.type,d.call(this.enabled_card_types,f)>=0)?b.addClass("card-type-"+e.type):b.addClass("card-type-invalid")):void 0:b.addClass("card-type-invalid")},f.prototype.is_3d_secure_enabled=function(){return this.threeds.enabled&&null!=braintree.threeDSecure},f.prototype.setup_integration=function(){return this.is_3d_secure_enabled()?braintree.threeDSecure.create({client:this.client}).then(function(a){return function(b){return a.threeDSecure=b,c(document.body).on("click","#wc-braintree-credit-card-3dsecure-container",function(b){return c(b.currentTarget).fadeOut(200),a.threeDSecure.cancelVerifyCard(),a.unblock_ui()}),f.__super__.setup_integration.call(a)}}(this)).catch(function(a){return function(b){return a.handle_integration_error(b)}}(this)):f.__super__.setup_integration.call(this)},f.prototype.should_verify_3d_secure=function(a){var b;return b=a.details.cardType,this.is_3d_secure_enabled()&&"CreditCard"===a.type&&("Visa"===b||"MasterCard"===b)},f.prototype.should_verify_3d_secure_token=function(a){if(a.val()&&a.data("nonce")&&!a.data("verified"))return!0},f.prototype.verify_3d_secure=function(a,b){return null==b&&(b=null),this.threeDSecure.verifyCard({nonce:a,amount:c("input[name=wc_braintree_credit_card_3d_secure_order_total]").val(),addFrame:function(a){return function(b,c){return a.add_3ds_ui(b,c)}}(this),removeFrame:function(a){return function(){return a.remove_3ds_ui()}}(this)}).then(function(a){return function(d){return a.log("3DS response",d),a.threeds.liability_shift_always_required&&!d.liabilityShifted&&a.render_error(a.threeds.failure_message),d.liabilityShiftPossible&&!d.liabilityShifted&&a.render_error(a.threeds.failure_message),null!=b&&b.data("verified",!0),c("input[name=wc_braintree_credit_card_3d_secure_verified]").val(1),a.submit_form(d.nonce)}}(this)).catch(function(a){return function(b){return a.handle_payment_error(b)}}(this))},f.prototype.add_3ds_ui=function(a,b){var d;return a?this.handle_payment_error(a):(d=c("<div>",{id:"wc-"+this.id_dasherized+"-3dsecure-container"}),d.html(b),c(document.body).append(d),d.fadeIn(400))},f.prototype.remove_3ds_ui=function(){return c("#wc-"+this.id_dasherized+"-3dsecure-container").fadeOut(400,function(a){return c(this).remove()})},f.prototype.show_integration_ui=function(){return f.__super__.show_integration_ui.call(this),c(".wc-braintree-hosted-field-parent").show()},f.prototype.hide_integration_ui=function(){return f.__super__.hide_integration_ui.call(this),c(".wc-braintree-hosted-field-parent").hide()},f}(WC_Braintree_Payment_Form_Handler),window.WC_Braintree_PayPal_Payment_Form_Handler=function(d){function e(b){this.get_linked_account_html=a(this.get_linked_account_html,this),this.on_authorize=a(this.on_authorize,this),this.do_integration_ready=a(this.do_integration_ready,this),this.is_test_environment=b.is_test_environment,this.must_login_message=b.must_login_message,this.must_login_add_method_message=b.must_login_add_method_message,this.button_styles=b.button_styles,e.__super__.constructor.call(this,b)}return b(e,d),e.prototype.init=function(){return e.__super__.init.call(this),c("input[name=wc_"+this.id+"_payment_nonce]").val(this.params.cart_payment_nonce),c(document.body).on("click",'input[name="payment_method"], input.js-wc-braintree-paypal-payment-token',function(a){return function(){return!a.is_selected()||a.has_payment_nonce()||a.using_payment_token()?c("#place_order").show():c("#place_order").hide()}}(this)),c(document.body).on("click",".wc-braintree-paypal-account .cancel",function(a){return function(b){return b.preventDefault(),c(b.currentTarget).parent().remove(),a.setup_braintree()}}(this))},e.prototype.verify_form=function(){var a;return a=e.__super__.verify_form.call(this),this.has_payment_nonce()||this.using_payment_token()||this.render_error(this.must_login_message),a},e.prototype.handle_payment_error=function(a){return e.__super__.handle_payment_error.call(this,a),this.params.cart_payment_nonce=!1,this.setup_braintree()},e.prototype.get_integration_class=function(){return braintree.paypalCheckout},e.prototype.setup_braintree=function(){return this.params.cart_payment_nonce?this.unblock_ui():(e.__super__.setup_braintree.call(this),c("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!1),this.is_selected()?c("#place_order").hide():void 0)},e.prototype.do_integration_ready=function(){var a;return this.params.cart_payment_nonce?this.unblock_ui():(c("#wc_braintree_paypal_container").html(""),a=this.is_single_use()?"checkout":"vault",this.integration.createPayment({flow:a,amount:this.get_order_amount(),currency:this.get_store_currency(),locale:this.get_store_locale()}).then(function(a){return function(b){return a.render_button(b)}}(this)).then(function(a){return function(){return c("#wc_braintree_paypal_container").css({width:"100%"}),a.unblock_ui()}}(this)).catch(function(a){return function(b){return a.handle_integration_error(b),a.unblock_ui()}}(this)))},e.prototype.render_button=function(a){var b;return b={env:this.is_test_environment?"sandbox":"production",commit:this.button_is_pay_now(),style:this.get_button_styles(),payment:function(b){return function(){return a}}(),onAuthorize:function(a){return function(b,c){return a.on_authorize(b,c)}}(this),onCancel:function(a){return function(b){return a.on_cancelled(b)}}(this),onError:function(a){return function(b){return a.handle_integration_error(b)}}(this)},paypal.Button.render(b,"#wc_braintree_paypal_container")},e.prototype.button_is_pay_now=function(){return!c("form#add_payment_method").length},e.prototype.get_button_styles=function(){return this.button_styles},e.prototype.on_authorize=function(a,b){return this.block_ui(),this.integration.tokenizePayment(a).then(function(a){return function(b){return a.log("PayPal method tokenized.",b),a.set_payment_method(b)}}(this)).catch(function(a){return function(b){return a.handle_payment_error(b),a.unblock_ui()}}(this))},e.prototype.set_payment_method=function(a){return c("input[name=wc_"+this.id+"_payment_nonce]").val(a.nonce),c("#wc_braintree_paypal_container").html(this.get_linked_account_html(a.details)),this.is_single_use()&&c("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!0),c("#place_order").show(),this.form.submit()},e.prototype.on_cancelled=function(a){if(c("input.js-wc-braintree-paypal-tokenize-payment-method").prop("disabled",!1),c("input[name=wc_braintree_paypal_payment_nonce]").val(""),this.is_selected())return c("#place_order").hide()},e.prototype.handle_saved_payment_methods=function(){return e.__super__.handle_saved_payment_methods.call(this),c("input.js-wc-braintree-paypal-tokenize-payment-method").change(function(a){return function(b){if(null!=a.integration&&c(b.target).is(":visible"))return a.block_ui(),a.do_integration_ready()}}(this)).change()},e.prototype.get_linked_account_html=function(a){var b;return b=c("<div class='wc-"+this.id_dasherized+"-account'></div>"),null!=a.firstName&&null!=a.lastName&&b.append("<span class='name'>"+a.firstName+" "+a.lastName+"</span>"),b.append("<span class='email'>"+a.email+"</span>"),b.append("<a href='#' class='cancel'>Cancel</a>"),b},e.prototype.is_single_use=function(){var a;return a=c("input[name=wc-braintree-paypal-tokenize-payment-method]"),0===a.length||("checkbox"===a.attr("type")?!a.is(":checked"):!a.val())},e.prototype.get_order_amount=function(){return c("input[name=wc_braintree_paypal_amount]").val()},e.prototype.get_store_currency=function(){return c("input[name=wc_braintree_paypal_currency]").val()},e.prototype.get_store_locale=function(){return c("input[name=wc_braintree_paypal_locale]").val()},e.prototype.is_sdk_ready=function(){return e.__super__.is_sdk_ready.call(this)&&"undefined"!=typeof paypal&&null!==paypal},e}(WC_Braintree_Payment_Form_Handler),window.WC_Braintree_PayPal_Cart_Handler=function(a){function d(a){d.__super__.constructor.call(this,a),this.form=c("form.woocommerce-cart-form"),this.form_ui_selector="",this.setup_braintree(),c(document.body).on("updated_cart_totals",function(a){return function(){return a.setup_braintree()}}(this))}return b(d,a),d.prototype.button_is_pay_now=function(){return!1},d.prototype.set_payment_method=function(a){if(null!=a.nonce)return a.wp_nonce=this.params.cart_nonce,c.ajax({type:"POST",url:this.params.cart_handler_url,data:a,dataType:"json"}).done(function(a){return function(b){if(a.log("PayPal Cart response",b),null!=b.redirect_url)return window.location=b.redirect_url}}(this)).fail(function(a){return function(b){return a.log("Error setting the PayPal cart data.",b)}}(this)).always(function(a){return function(){return a.unblock_ui()}}(this))},d.prototype.is_single_use=function(){return"1"===c("input[name=wc_braintree_paypal_single_use]").val()},d.prototype.has_payment_nonce=function(){return!1},d}(WC_Braintree_PayPal_Payment_Form_Handler)})}).call(this);
|
class-wc-braintree.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -88,7 +88,7 @@ class WC_Braintree extends WC_Braintree_Framework\SV_WC_Payment_Gateway_Plugin {
|
|
88 |
|
89 |
|
90 |
/** plugin version number */
|
91 |
-
const VERSION = '2.0
|
92 |
|
93 |
/** @var WC_Braintree single instance of this plugin */
|
94 |
protected static $instance;
|
@@ -440,6 +440,50 @@ class WC_Braintree extends WC_Braintree_Framework\SV_WC_Payment_Gateway_Plugin {
|
|
440 |
}
|
441 |
|
442 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
/** Helper methods ******************************************************/
|
444 |
|
445 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
88 |
|
89 |
|
90 |
/** plugin version number */
|
91 |
+
const VERSION = '2.1.0';
|
92 |
|
93 |
/** @var WC_Braintree single instance of this plugin */
|
94 |
protected static $instance;
|
440 |
}
|
441 |
|
442 |
|
443 |
+
/**
|
444 |
+
* Adds delayed admin notices for invalid Dynamic Descriptor Name values.
|
445 |
+
*
|
446 |
+
* @since 2.1.0
|
447 |
+
*/
|
448 |
+
public function add_delayed_admin_notices() {
|
449 |
+
|
450 |
+
parent::add_delayed_admin_notices();
|
451 |
+
|
452 |
+
if ( $this->is_plugin_settings() ) {
|
453 |
+
|
454 |
+
foreach ( $this->get_gateways() as $gateway ) {
|
455 |
+
|
456 |
+
$settings = $this->get_gateway_settings( $gateway->get_id() );
|
457 |
+
|
458 |
+
if ( ! empty( $settings['inherit_settings'] ) && 'yes' === $settings['inherit_settings'] ) {
|
459 |
+
continue;
|
460 |
+
}
|
461 |
+
|
462 |
+
foreach ( array( 'name', 'phone', 'url' ) as $type ) {
|
463 |
+
|
464 |
+
$validation_method = "is_{$type}_dynamic_descriptor_valid";
|
465 |
+
$settings_key = "{$type}_dynamic_descriptor";
|
466 |
+
|
467 |
+
if ( ! empty( $settings[ $settings_key ] ) && is_callable( array( $gateway, $validation_method ) ) && ! $gateway->$validation_method( $settings[ $settings_key ] ) ) {
|
468 |
+
|
469 |
+
$this->get_admin_notice_handler()->add_admin_notice(
|
470 |
+
/* translators: Placeholders: %1$s - payment gateway name tag, %2$s - <a> tag, %3$s - </a> tag */
|
471 |
+
sprintf( __( '%1$s: Heads up! Your %2$s dynamic descriptor is invalid and will not be used. Need help? See the %3$sdocumentation%4$s.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
472 |
+
'<strong>' . esc_html( $gateway->get_method_title() ) . '</strong>',
|
473 |
+
'<strong>' . esc_html( $type ) . '</strong>',
|
474 |
+
'<a target="_blank" href="https://docs.woocommerce.com/document/woocommerce-gateway-paypal-powered-by-braintree/#section-21">',
|
475 |
+
'</a>'
|
476 |
+
), $gateway->get_id() . '-' . $type . '-dynamic-descriptor-notice', array( 'notice_class' => 'error' )
|
477 |
+
);
|
478 |
+
|
479 |
+
break;
|
480 |
+
}
|
481 |
+
}
|
482 |
+
}
|
483 |
+
}
|
484 |
+
}
|
485 |
+
|
486 |
+
|
487 |
/** Helper methods ******************************************************/
|
488 |
|
489 |
|
i18n/languages/woocommerce-gateway-paypal-powered-by-braintree.pot
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the WooCommerce PayPal Powered by Braintree Gateway package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: WooCommerce PayPal Powered by Braintree Gateway 2.0
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://wordpress.org/support/plugin/woocommerce-gateway-paypal-powered-by-"
|
8 |
"braintree/\n"
|
@@ -10,7 +10,7 @@ msgstr ""
|
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=utf-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
-
"PO-Revision-Date:
|
14 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
15 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
16 |
|
@@ -65,15 +65,23 @@ msgid ""
|
|
65 |
"requires that checkout to be forced over SSL."
|
66 |
msgstr ""
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
#. Plugin Name of the plugin/theme
|
69 |
msgid "WooCommerce PayPal Powered by Braintree Gateway"
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: class-wc-braintree.php:
|
73 |
msgid "Configure Credit Card"
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: class-wc-braintree.php:
|
77 |
msgid "Configure PayPal"
|
78 |
msgstr ""
|
79 |
|
@@ -84,41 +92,41 @@ msgid ""
|
|
84 |
"method."
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: includes/api/class-wc-braintree-api.php:
|
88 |
msgid "The billing address for this transaction does not match the cardholders."
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: includes/api/class-wc-braintree-api.php:
|
92 |
msgid "The CSC for the transaction was invalid or incorrect."
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: includes/api/class-wc-braintree-api.php:
|
96 |
msgid ""
|
97 |
"Invalid Credentials, please double-check your API credentials (Merchant ID, "
|
98 |
"Public Key, Private Key, and Merchant Account ID) and try again."
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: includes/api/class-wc-braintree-api.php:
|
102 |
msgid ""
|
103 |
"Authorization Failed, please verify the user for the API credentials "
|
104 |
"provided can perform transactions and that the request data is correct."
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: includes/api/class-wc-braintree-api.php:
|
108 |
msgid "Braintree is currently down for maintenance, please try again later."
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: includes/api/class-wc-braintree-api.php:
|
112 |
msgid "The record cannot be found, please contact support."
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: includes/api/class-wc-braintree-api.php:
|
116 |
msgid ""
|
117 |
"Braintree encountered an error when processing your request, please try "
|
118 |
"again later or contact support."
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: includes/api/class-wc-braintree-api.php:
|
122 |
msgid ""
|
123 |
"Braintree cannot verify your server's SSL certificate. Please contact your "
|
124 |
"hosting provider or try again later."
|
@@ -133,11 +141,16 @@ msgid "Required PayPal token is missing or empty!"
|
|
133 |
msgstr ""
|
134 |
|
135 |
#: includes/class-wc-braintree-frontend.php:113
|
|
|
|
|
|
|
136 |
#. translators: %s - last four digits of a card/account
|
|
|
137 |
msgid "ending in %s"
|
138 |
msgstr ""
|
139 |
|
140 |
#: includes/class-wc-braintree-frontend.php:119
|
|
|
141 |
msgid "(default)"
|
142 |
msgstr ""
|
143 |
|
@@ -147,7 +160,7 @@ msgstr ""
|
|
147 |
msgid "%1$s Account Saved: %2$s"
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: includes/class-wc-braintree-paypal-cart.php:
|
151 |
msgid "Cancel"
|
152 |
msgstr ""
|
153 |
|
@@ -159,27 +172,27 @@ msgstr ""
|
|
159 |
msgid "Allow customers to securely pay using their credit card via Braintree."
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
163 |
msgid "Basic"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
167 |
msgid "Advanced"
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
171 |
msgid "Kount Direct"
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
175 |
msgid "Fraud Settings"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
179 |
msgid "Fraud Tool"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
183 |
msgid ""
|
184 |
"Select the fraud tool you want to use. Basic is enabled by default and "
|
185 |
"requires no additional configuration. Advanced requires you to enable "
|
@@ -187,194 +200,216 @@ msgid ""
|
|
187 |
"you must contact Braintree support."
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
191 |
msgid "Kount merchant ID"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
195 |
msgid "Speak with your account management team at Braintree to get this."
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
199 |
msgid "3D Secure (Verified by Visa, MasterCard SecureCode)"
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
203 |
msgid ""
|
204 |
"3D Secure benefits cardholders and merchants by providing an additional "
|
205 |
"layer of verification. %1$sLearn more about 3D Secure%2$s."
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
209 |
msgid "3D Secure"
|
210 |
msgstr ""
|
211 |
|
212 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
213 |
msgid "Enable 3D Secure (Visa and MasterCard cards only)"
|
214 |
msgstr ""
|
215 |
|
216 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
217 |
msgid ""
|
218 |
"You must contact Braintree support to add this feature to your Braintree "
|
219 |
"account before enabling this option."
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
|
|
223 |
msgid "Card Verification (CSC)"
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
227 |
msgid "Display and Require the Card Security Code (CVV/CID) field on checkout"
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
231 |
#: includes/payment-forms/class-wc-braintree-hosted-fields-payment-form.php:124
|
232 |
msgid ""
|
233 |
"We cannot process your order with the payment information that you "
|
234 |
"provided. Please use an alternate payment method."
|
235 |
msgstr ""
|
236 |
|
237 |
-
#: includes/class-wc-gateway-braintree-credit-card.php:
|
238 |
-
#: includes/class-wc-gateway-braintree.php:
|
239 |
msgid ""
|
240 |
"Oops, there was a temporary payment error. Please try another payment "
|
241 |
"method or contact us to complete your transaction."
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
245 |
msgid "Braintree (PayPal)"
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
249 |
msgid "Allow customers to securely pay using their PayPal account via Braintree."
|
250 |
msgstr ""
|
251 |
|
252 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
|
|
|
|
253 |
msgid "Token ID"
|
254 |
msgstr ""
|
255 |
|
256 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
257 |
msgid "Email"
|
258 |
msgstr ""
|
259 |
|
260 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
261 |
msgid "Use a new PayPal account"
|
262 |
msgstr ""
|
263 |
|
264 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
265 |
msgid "PayPal Accounts"
|
266 |
msgstr ""
|
267 |
|
268 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
269 |
msgid "Unlink"
|
270 |
msgstr ""
|
271 |
|
272 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
#. translators: Placeholders: %1$s - payment method title (e.g. PayPal), %2$s -
|
274 |
#. transaction environment (either Sandbox or blank string), %3$s - type of
|
275 |
#. transaction (either Authorization or Payment)
|
276 |
msgid "%1$s %2$s %3$s Approved"
|
277 |
msgstr ""
|
278 |
|
279 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
280 |
-
#: includes/class-wc-gateway-braintree.php:
|
281 |
msgid "Sandbox"
|
282 |
msgstr ""
|
283 |
|
284 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
285 |
msgid "Authorization"
|
286 |
msgstr ""
|
287 |
|
288 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
289 |
msgid "Payment"
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
#. translators: Placeholders: %s - transaction ID
|
294 |
msgid "(Transaction ID %s)"
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
298 |
msgid "PayPal Account Saved: %s"
|
299 |
msgstr ""
|
300 |
|
301 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
|
|
302 |
msgid "PayPal"
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: includes/class-wc-gateway-braintree-paypal.php:
|
306 |
msgid ""
|
307 |
"Click the PayPal icon below to sign into your PayPal account and pay "
|
308 |
"securely."
|
309 |
msgstr ""
|
310 |
|
311 |
#: includes/class-wc-gateway-braintree.php:127
|
|
|
|
|
|
|
|
|
312 |
msgid "Oops, something went wrong. Please try a different payment method."
|
313 |
msgstr ""
|
314 |
|
315 |
-
#: includes/class-wc-gateway-braintree.php:
|
316 |
msgid "Public Key"
|
317 |
msgstr ""
|
318 |
|
319 |
-
#: includes/class-wc-gateway-braintree.php:
|
320 |
msgid "The Public Key for your Braintree account."
|
321 |
msgstr ""
|
322 |
|
323 |
-
#: includes/class-wc-gateway-braintree.php:
|
324 |
msgid "Private Key"
|
325 |
msgstr ""
|
326 |
|
327 |
-
#: includes/class-wc-gateway-braintree.php:
|
328 |
msgid "The Private Key for your Braintree account."
|
329 |
msgstr ""
|
330 |
|
331 |
-
#: includes/class-wc-gateway-braintree.php:
|
332 |
msgid "Merchant ID"
|
333 |
msgstr ""
|
334 |
|
335 |
-
#: includes/class-wc-gateway-braintree.php:
|
336 |
msgid "The Merchant ID for your Braintree account."
|
337 |
msgstr ""
|
338 |
|
339 |
-
#: includes/class-wc-gateway-braintree.php:
|
340 |
msgid "Sandbox Public Key"
|
341 |
msgstr ""
|
342 |
|
343 |
-
#: includes/class-wc-gateway-braintree.php:
|
344 |
msgid "The Public Key for your Braintree sandbox account."
|
345 |
msgstr ""
|
346 |
|
347 |
-
#: includes/class-wc-gateway-braintree.php:
|
348 |
msgid "Sandbox Private Key"
|
349 |
msgstr ""
|
350 |
|
351 |
-
#: includes/class-wc-gateway-braintree.php:
|
352 |
msgid "The Private Key for your Braintree sandbox account."
|
353 |
msgstr ""
|
354 |
|
355 |
-
#: includes/class-wc-gateway-braintree.php:
|
356 |
msgid "Sandbox Merchant ID"
|
357 |
msgstr ""
|
358 |
|
359 |
-
#: includes/class-wc-gateway-braintree.php:
|
360 |
msgid "The Merchant ID for your Braintree sandbox account."
|
361 |
msgstr ""
|
362 |
|
363 |
-
#: includes/class-wc-gateway-braintree.php:
|
364 |
msgid "Merchant Account IDs"
|
365 |
msgstr ""
|
366 |
|
367 |
-
#: includes/class-wc-gateway-braintree.php:
|
368 |
msgid ""
|
369 |
"Enter additional merchant account IDs if you do not want to use your "
|
370 |
"Braintree account default. %1$sLearn more about merchant account IDs%2$s"
|
371 |
msgstr ""
|
372 |
|
373 |
-
#: includes/class-wc-gateway-braintree.php:
|
374 |
msgid "Dynamic Descriptors"
|
375 |
msgstr ""
|
376 |
|
377 |
-
#: includes/class-wc-gateway-braintree.php:
|
378 |
#. translators: Placeholders: %1$s - <p> tag, %2$s - </p> tag, %3$s - <a> tag,
|
379 |
#. %4$s - </a> tag
|
380 |
msgid ""
|
@@ -384,11 +419,11 @@ msgid ""
|
|
384 |
"dynamic descriptors%4$s and are using an accepted format.%2$s"
|
385 |
msgstr ""
|
386 |
|
387 |
-
#: includes/class-wc-gateway-braintree.php:
|
388 |
msgid "Name"
|
389 |
msgstr ""
|
390 |
|
391 |
-
#: includes/class-wc-gateway-braintree.php:
|
392 |
msgid ""
|
393 |
"The value in the business name field of a customer's statement. Company "
|
394 |
"name/DBA section must be either 3, 7 or 12 characters and the product "
|
@@ -396,77 +431,77 @@ msgid ""
|
|
396 |
"between for a total descriptor name of 22 characters)."
|
397 |
msgstr ""
|
398 |
|
399 |
-
#: includes/class-wc-gateway-braintree.php:
|
400 |
msgid "Phone"
|
401 |
msgstr ""
|
402 |
|
403 |
-
#: includes/class-wc-gateway-braintree.php:
|
404 |
msgid ""
|
405 |
"The value in the phone number field of a customer's statement. Phone must "
|
406 |
"be exactly 10 characters and can only contain numbers, dashes, parentheses "
|
407 |
"and periods."
|
408 |
msgstr ""
|
409 |
|
410 |
-
#: includes/class-wc-gateway-braintree.php:
|
411 |
msgid "URL"
|
412 |
msgstr ""
|
413 |
|
414 |
-
#: includes/class-wc-gateway-braintree.php:
|
415 |
msgid ""
|
416 |
"The value in the URL/web address field of a customer's statement. The URL "
|
417 |
"must be 13 characters or less."
|
418 |
msgstr ""
|
419 |
|
420 |
-
#: includes/class-wc-gateway-braintree.php:
|
421 |
msgid "Enter connection credentials manually"
|
422 |
msgstr ""
|
423 |
|
424 |
-
#: includes/class-wc-gateway-braintree.php:
|
425 |
msgid "Disabled because the other gateway is not connected manually."
|
426 |
msgstr ""
|
427 |
|
428 |
-
#: includes/class-wc-gateway-braintree.php:
|
429 |
msgid ""
|
430 |
"You just connected your Braintree account to WooCommerce. You can start "
|
431 |
"taking payments now."
|
432 |
msgstr ""
|
433 |
|
434 |
-
#: includes/class-wc-gateway-braintree.php:
|
435 |
msgid ""
|
436 |
"Once you have processed a payment, PayPal will review your application for "
|
437 |
"final approval. Before you ship any goods make sure you have received a "
|
438 |
"final approval for your Braintree account."
|
439 |
msgstr ""
|
440 |
|
441 |
-
#: includes/class-wc-gateway-braintree.php:
|
442 |
msgid "Questions? We are a phone call away: 1-855-489-0345."
|
443 |
msgstr ""
|
444 |
|
445 |
-
#: includes/class-wc-gateway-braintree.php:
|
446 |
msgid "Click button to create an account with Braintree and start transacting."
|
447 |
msgstr ""
|
448 |
|
449 |
-
#: includes/class-wc-gateway-braintree.php:
|
450 |
msgid "Add merchant account ID for %s"
|
451 |
msgstr ""
|
452 |
|
453 |
-
#: includes/class-wc-gateway-braintree.php:
|
454 |
msgid "Add merchant account ID for "
|
455 |
msgstr ""
|
456 |
|
457 |
-
#: includes/class-wc-gateway-braintree.php:
|
458 |
msgid "Merchant Account ID (%s)"
|
459 |
msgstr ""
|
460 |
|
461 |
-
#: includes/class-wc-gateway-braintree.php:
|
462 |
msgid "Enter merchant account ID"
|
463 |
msgstr ""
|
464 |
|
465 |
-
#: includes/class-wc-gateway-braintree.php:
|
466 |
msgid "Remove this merchant account ID"
|
467 |
msgstr ""
|
468 |
|
469 |
-
#: includes/class-wc-gateway-braintree.php:
|
470 |
msgid "Production"
|
471 |
msgstr ""
|
472 |
|
@@ -474,13 +509,13 @@ msgstr ""
|
|
474 |
msgid "Expiration (MMYY)"
|
475 |
msgstr ""
|
476 |
|
477 |
-
#: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:
|
478 |
msgid ""
|
479 |
"Please click the blue \"PayPal\" button below to log into your PayPal "
|
480 |
"account before placing your order."
|
481 |
msgstr ""
|
482 |
|
483 |
-
#: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:
|
484 |
msgid ""
|
485 |
"Please click the blue \"PayPal\" button below to log into your PayPal "
|
486 |
"account before adding your payment method."
|
@@ -498,40 +533,1239 @@ msgstr ""
|
|
498 |
msgid "Not ready to accept live payments? Click here to connect using sandbox mode."
|
499 |
msgstr ""
|
500 |
|
501 |
-
#: woocommerce-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
502 |
msgid ""
|
503 |
-
"
|
504 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
msgstr ""
|
506 |
|
507 |
-
#: woocommerce-
|
508 |
msgid ""
|
509 |
-
"
|
510 |
-
"
|
511 |
msgstr ""
|
512 |
|
513 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
514 |
msgid ""
|
515 |
-
"
|
516 |
-
"
|
|
|
517 |
msgstr ""
|
518 |
|
519 |
-
|
520 |
msgid ""
|
521 |
-
"
|
522 |
-
"
|
523 |
-
"(for security reasons) for this gateway to function. Requires PHP 5.4+"
|
524 |
msgstr ""
|
525 |
|
526 |
-
|
527 |
-
msgid "
|
|
|
|
|
528 |
msgstr ""
|
529 |
|
530 |
-
|
531 |
-
msgid "
|
532 |
msgstr ""
|
533 |
|
534 |
-
#:
|
535 |
-
|
536 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
msgstr ""
|
1 |
+
# Copyright (C) 2018 WooCommerce
|
2 |
# This file is distributed under the same license as the WooCommerce PayPal Powered by Braintree Gateway package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: WooCommerce PayPal Powered by Braintree Gateway 2.1.0\n"
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://wordpress.org/support/plugin/woocommerce-gateway-paypal-powered-by-"
|
8 |
"braintree/\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=utf-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
|
14 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
15 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
16 |
|
65 |
"requires that checkout to be forced over SSL."
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: class-wc-braintree.php:471
|
69 |
+
#. translators: Placeholders: %1$s - payment gateway name tag, %2$s - <a> tag,
|
70 |
+
#. %3$s - </a> tag
|
71 |
+
msgid ""
|
72 |
+
"%1$s: Heads up! Your %2$s dynamic descriptor is invalid and will not be "
|
73 |
+
"used. Need help? See the %3$sdocumentation%4$s."
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
#. Plugin Name of the plugin/theme
|
77 |
msgid "WooCommerce PayPal Powered by Braintree Gateway"
|
78 |
msgstr ""
|
79 |
|
80 |
+
#: class-wc-braintree.php:577
|
81 |
msgid "Configure Credit Card"
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: class-wc-braintree.php:577
|
85 |
msgid "Configure PayPal"
|
86 |
msgstr ""
|
87 |
|
92 |
"method."
|
93 |
msgstr ""
|
94 |
|
95 |
+
#: includes/api/class-wc-braintree-api.php:175
|
96 |
msgid "The billing address for this transaction does not match the cardholders."
|
97 |
msgstr ""
|
98 |
|
99 |
+
#: includes/api/class-wc-braintree-api.php:179
|
100 |
msgid "The CSC for the transaction was invalid or incorrect."
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: includes/api/class-wc-braintree-api.php:508
|
104 |
msgid ""
|
105 |
"Invalid Credentials, please double-check your API credentials (Merchant ID, "
|
106 |
"Public Key, Private Key, and Merchant Account ID) and try again."
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: includes/api/class-wc-braintree-api.php:512
|
110 |
msgid ""
|
111 |
"Authorization Failed, please verify the user for the API credentials "
|
112 |
"provided can perform transactions and that the request data is correct."
|
113 |
msgstr ""
|
114 |
|
115 |
+
#: includes/api/class-wc-braintree-api.php:516
|
116 |
msgid "Braintree is currently down for maintenance, please try again later."
|
117 |
msgstr ""
|
118 |
|
119 |
+
#: includes/api/class-wc-braintree-api.php:520
|
120 |
msgid "The record cannot be found, please contact support."
|
121 |
msgstr ""
|
122 |
|
123 |
+
#: includes/api/class-wc-braintree-api.php:524
|
124 |
msgid ""
|
125 |
"Braintree encountered an error when processing your request, please try "
|
126 |
"again later or contact support."
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: includes/api/class-wc-braintree-api.php:528
|
130 |
msgid ""
|
131 |
"Braintree cannot verify your server's SSL certificate. Please contact your "
|
132 |
"hosting provider or try again later."
|
141 |
msgstr ""
|
142 |
|
143 |
#: includes/class-wc-braintree-frontend.php:113
|
144 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:657
|
145 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:654
|
146 |
+
#. translators: %s - last four digits of a card/account
|
147 |
#. translators: %s - last four digits of a card/account
|
148 |
+
#. translators: Placeholders: %s - last four digits of card/account
|
149 |
msgid "ending in %s"
|
150 |
msgstr ""
|
151 |
|
152 |
#: includes/class-wc-braintree-frontend.php:119
|
153 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:663
|
154 |
msgid "(default)"
|
155 |
msgstr ""
|
156 |
|
160 |
msgid "%1$s Account Saved: %2$s"
|
161 |
msgstr ""
|
162 |
|
163 |
+
#: includes/class-wc-braintree-paypal-cart.php:393
|
164 |
msgid "Cancel"
|
165 |
msgstr ""
|
166 |
|
172 |
msgid "Allow customers to securely pay using their credit card via Braintree."
|
173 |
msgstr ""
|
174 |
|
175 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:164
|
176 |
msgid "Basic"
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:165
|
180 |
msgid "Advanced"
|
181 |
msgstr ""
|
182 |
|
183 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:170
|
184 |
msgid "Kount Direct"
|
185 |
msgstr ""
|
186 |
|
187 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:177
|
188 |
msgid "Fraud Settings"
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:181
|
192 |
msgid "Fraud Tool"
|
193 |
msgstr ""
|
194 |
|
195 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:184
|
196 |
msgid ""
|
197 |
"Select the fraud tool you want to use. Basic is enabled by default and "
|
198 |
"requires no additional configuration. Advanced requires you to enable "
|
200 |
"you must contact Braintree support."
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:188
|
204 |
msgid "Kount merchant ID"
|
205 |
msgstr ""
|
206 |
|
207 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:191
|
208 |
msgid "Speak with your account management team at Braintree to get this."
|
209 |
msgstr ""
|
210 |
|
211 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:196
|
212 |
msgid "3D Secure (Verified by Visa, MasterCard SecureCode)"
|
213 |
msgstr ""
|
214 |
|
215 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:198
|
216 |
msgid ""
|
217 |
"3D Secure benefits cardholders and merchants by providing an additional "
|
218 |
"layer of verification. %1$sLearn more about 3D Secure%2$s."
|
219 |
msgstr ""
|
220 |
|
221 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:201
|
222 |
msgid "3D Secure"
|
223 |
msgstr ""
|
224 |
|
225 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:203
|
226 |
msgid "Enable 3D Secure (Visa and MasterCard cards only)"
|
227 |
msgstr ""
|
228 |
|
229 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:204
|
230 |
msgid ""
|
231 |
"You must contact Braintree support to add this feature to your Braintree "
|
232 |
"account before enabling this option."
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:225
|
236 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:977
|
237 |
msgid "Card Verification (CSC)"
|
238 |
msgstr ""
|
239 |
|
240 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:226
|
241 |
msgid "Display and Require the Card Security Code (CVV/CID) field on checkout"
|
242 |
msgstr ""
|
243 |
|
244 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:705
|
245 |
#: includes/payment-forms/class-wc-braintree-hosted-fields-payment-form.php:124
|
246 |
msgid ""
|
247 |
"We cannot process your order with the payment information that you "
|
248 |
"provided. Please use an alternate payment method."
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: includes/class-wc-gateway-braintree-credit-card.php:712
|
252 |
+
#: includes/class-wc-gateway-braintree.php:182
|
253 |
msgid ""
|
254 |
"Oops, there was a temporary payment error. Please try another payment "
|
255 |
"method or contact us to complete your transaction."
|
256 |
msgstr ""
|
257 |
|
258 |
+
#: includes/class-wc-gateway-braintree-paypal.php:56
|
259 |
msgid "Braintree (PayPal)"
|
260 |
msgstr ""
|
261 |
|
262 |
+
#: includes/class-wc-gateway-braintree-paypal.php:57
|
263 |
msgid "Allow customers to securely pay using their PayPal account via Braintree."
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: includes/class-wc-gateway-braintree-paypal.php:157
|
267 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:479
|
268 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:512
|
269 |
msgid "Token ID"
|
270 |
msgstr ""
|
271 |
|
272 |
+
#: includes/class-wc-gateway-braintree-paypal.php:162
|
273 |
msgid "Email"
|
274 |
msgstr ""
|
275 |
|
276 |
+
#: includes/class-wc-gateway-braintree-paypal.php:201
|
277 |
msgid "Use a new PayPal account"
|
278 |
msgstr ""
|
279 |
|
280 |
+
#: includes/class-wc-gateway-braintree-paypal.php:205
|
281 |
msgid "PayPal Accounts"
|
282 |
msgstr ""
|
283 |
|
284 |
+
#: includes/class-wc-gateway-braintree-paypal.php:226
|
285 |
msgid "Unlink"
|
286 |
msgstr ""
|
287 |
|
288 |
+
#: includes/class-wc-gateway-braintree-paypal.php:247
|
289 |
+
msgid "Enable Cart Checkout"
|
290 |
+
msgstr ""
|
291 |
+
|
292 |
+
#: includes/class-wc-gateway-braintree-paypal.php:249
|
293 |
+
msgid "Allow customers to check out with PayPal from the Cart page"
|
294 |
+
msgstr ""
|
295 |
+
|
296 |
+
#: includes/class-wc-gateway-braintree-paypal.php:369
|
297 |
#. translators: Placeholders: %1$s - payment method title (e.g. PayPal), %2$s -
|
298 |
#. transaction environment (either Sandbox or blank string), %3$s - type of
|
299 |
#. transaction (either Authorization or Payment)
|
300 |
msgid "%1$s %2$s %3$s Approved"
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: includes/class-wc-gateway-braintree-paypal.php:371
|
304 |
+
#: includes/class-wc-gateway-braintree.php:1389
|
305 |
msgid "Sandbox"
|
306 |
msgstr ""
|
307 |
|
308 |
+
#: includes/class-wc-gateway-braintree-paypal.php:372
|
309 |
msgid "Authorization"
|
310 |
msgstr ""
|
311 |
|
312 |
+
#: includes/class-wc-gateway-braintree-paypal.php:372
|
313 |
msgid "Payment"
|
314 |
msgstr ""
|
315 |
|
316 |
+
#: includes/class-wc-gateway-braintree-paypal.php:378
|
317 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:615
|
318 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:690
|
319 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1330
|
320 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1640
|
321 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1861
|
322 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:318
|
323 |
#. translators: Placeholders: %s - transaction ID
|
324 |
msgid "(Transaction ID %s)"
|
325 |
msgstr ""
|
326 |
|
327 |
+
#: includes/class-wc-gateway-braintree-paypal.php:399
|
328 |
msgid "PayPal Account Saved: %s"
|
329 |
msgstr ""
|
330 |
|
331 |
+
#: includes/class-wc-gateway-braintree-paypal.php:478
|
332 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:186
|
333 |
msgid "PayPal"
|
334 |
msgstr ""
|
335 |
|
336 |
+
#: includes/class-wc-gateway-braintree-paypal.php:492
|
337 |
msgid ""
|
338 |
"Click the PayPal icon below to sign into your PayPal account and pay "
|
339 |
"securely."
|
340 |
msgstr ""
|
341 |
|
342 |
#: includes/class-wc-gateway-braintree.php:127
|
343 |
+
msgid "Currently unavailable. Please try a different payment method."
|
344 |
+
msgstr ""
|
345 |
+
|
346 |
+
#: includes/class-wc-gateway-braintree.php:128
|
347 |
msgid "Oops, something went wrong. Please try a different payment method."
|
348 |
msgstr ""
|
349 |
|
350 |
+
#: includes/class-wc-gateway-braintree.php:381
|
351 |
msgid "Public Key"
|
352 |
msgstr ""
|
353 |
|
354 |
+
#: includes/class-wc-gateway-braintree.php:384
|
355 |
msgid "The Public Key for your Braintree account."
|
356 |
msgstr ""
|
357 |
|
358 |
+
#: includes/class-wc-gateway-braintree.php:388
|
359 |
msgid "Private Key"
|
360 |
msgstr ""
|
361 |
|
362 |
+
#: includes/class-wc-gateway-braintree.php:391
|
363 |
msgid "The Private Key for your Braintree account."
|
364 |
msgstr ""
|
365 |
|
366 |
+
#: includes/class-wc-gateway-braintree.php:395
|
367 |
msgid "Merchant ID"
|
368 |
msgstr ""
|
369 |
|
370 |
+
#: includes/class-wc-gateway-braintree.php:398
|
371 |
msgid "The Merchant ID for your Braintree account."
|
372 |
msgstr ""
|
373 |
|
374 |
+
#: includes/class-wc-gateway-braintree.php:403
|
375 |
msgid "Sandbox Public Key"
|
376 |
msgstr ""
|
377 |
|
378 |
+
#: includes/class-wc-gateway-braintree.php:406
|
379 |
msgid "The Public Key for your Braintree sandbox account."
|
380 |
msgstr ""
|
381 |
|
382 |
+
#: includes/class-wc-gateway-braintree.php:410
|
383 |
msgid "Sandbox Private Key"
|
384 |
msgstr ""
|
385 |
|
386 |
+
#: includes/class-wc-gateway-braintree.php:413
|
387 |
msgid "The Private Key for your Braintree sandbox account."
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: includes/class-wc-gateway-braintree.php:417
|
391 |
msgid "Sandbox Merchant ID"
|
392 |
msgstr ""
|
393 |
|
394 |
+
#: includes/class-wc-gateway-braintree.php:420
|
395 |
msgid "The Merchant ID for your Braintree sandbox account."
|
396 |
msgstr ""
|
397 |
|
398 |
+
#: includes/class-wc-gateway-braintree.php:425
|
399 |
msgid "Merchant Account IDs"
|
400 |
msgstr ""
|
401 |
|
402 |
+
#: includes/class-wc-gateway-braintree.php:428
|
403 |
msgid ""
|
404 |
"Enter additional merchant account IDs if you do not want to use your "
|
405 |
"Braintree account default. %1$sLearn more about merchant account IDs%2$s"
|
406 |
msgstr ""
|
407 |
|
408 |
+
#: includes/class-wc-gateway-braintree.php:437
|
409 |
msgid "Dynamic Descriptors"
|
410 |
msgstr ""
|
411 |
|
412 |
+
#: includes/class-wc-gateway-braintree.php:440
|
413 |
#. translators: Placeholders: %1$s - <p> tag, %2$s - </p> tag, %3$s - <a> tag,
|
414 |
#. %4$s - </a> tag
|
415 |
msgid ""
|
419 |
"dynamic descriptors%4$s and are using an accepted format.%2$s"
|
420 |
msgstr ""
|
421 |
|
422 |
+
#: includes/class-wc-gateway-braintree.php:444
|
423 |
msgid "Name"
|
424 |
msgstr ""
|
425 |
|
426 |
+
#: includes/class-wc-gateway-braintree.php:447
|
427 |
msgid ""
|
428 |
"The value in the business name field of a customer's statement. Company "
|
429 |
"name/DBA section must be either 3, 7 or 12 characters and the product "
|
431 |
"between for a total descriptor name of 22 characters)."
|
432 |
msgstr ""
|
433 |
|
434 |
+
#: includes/class-wc-gateway-braintree.php:452
|
435 |
msgid "Phone"
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: includes/class-wc-gateway-braintree.php:455
|
439 |
msgid ""
|
440 |
"The value in the phone number field of a customer's statement. Phone must "
|
441 |
"be exactly 10 characters and can only contain numbers, dashes, parentheses "
|
442 |
"and periods."
|
443 |
msgstr ""
|
444 |
|
445 |
+
#: includes/class-wc-gateway-braintree.php:460
|
446 |
msgid "URL"
|
447 |
msgstr ""
|
448 |
|
449 |
+
#: includes/class-wc-gateway-braintree.php:463
|
450 |
msgid ""
|
451 |
"The value in the URL/web address field of a customer's statement. The URL "
|
452 |
"must be 13 characters or less."
|
453 |
msgstr ""
|
454 |
|
455 |
+
#: includes/class-wc-gateway-braintree.php:496
|
456 |
msgid "Enter connection credentials manually"
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: includes/class-wc-gateway-braintree.php:520
|
460 |
msgid "Disabled because the other gateway is not connected manually."
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: includes/class-wc-gateway-braintree.php:539
|
464 |
msgid ""
|
465 |
"You just connected your Braintree account to WooCommerce. You can start "
|
466 |
"taking payments now."
|
467 |
msgstr ""
|
468 |
|
469 |
+
#: includes/class-wc-gateway-braintree.php:540
|
470 |
msgid ""
|
471 |
"Once you have processed a payment, PayPal will review your application for "
|
472 |
"final approval. Before you ship any goods make sure you have received a "
|
473 |
"final approval for your Braintree account."
|
474 |
msgstr ""
|
475 |
|
476 |
+
#: includes/class-wc-gateway-braintree.php:541
|
477 |
msgid "Questions? We are a phone call away: 1-855-489-0345."
|
478 |
msgstr ""
|
479 |
|
480 |
+
#: includes/class-wc-gateway-braintree.php:546
|
481 |
msgid "Click button to create an account with Braintree and start transacting."
|
482 |
msgstr ""
|
483 |
|
484 |
+
#: includes/class-wc-gateway-braintree.php:661
|
485 |
msgid "Add merchant account ID for %s"
|
486 |
msgstr ""
|
487 |
|
488 |
+
#: includes/class-wc-gateway-braintree.php:766
|
489 |
msgid "Add merchant account ID for "
|
490 |
msgstr ""
|
491 |
|
492 |
+
#: includes/class-wc-gateway-braintree.php:864
|
493 |
msgid "Merchant Account ID (%s)"
|
494 |
msgstr ""
|
495 |
|
496 |
+
#: includes/class-wc-gateway-braintree.php:875
|
497 |
msgid "Enter merchant account ID"
|
498 |
msgstr ""
|
499 |
|
500 |
+
#: includes/class-wc-gateway-braintree.php:876
|
501 |
msgid "Remove this merchant account ID"
|
502 |
msgstr ""
|
503 |
|
504 |
+
#: includes/class-wc-gateway-braintree.php:1389
|
505 |
msgid "Production"
|
506 |
msgstr ""
|
507 |
|
509 |
msgid "Expiration (MMYY)"
|
510 |
msgstr ""
|
511 |
|
512 |
+
#: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:72
|
513 |
msgid ""
|
514 |
"Please click the blue \"PayPal\" button below to log into your PayPal "
|
515 |
"account before placing your order."
|
516 |
msgstr ""
|
517 |
|
518 |
+
#: includes/payment-forms/class-wc-braintree-paypal-payment-form.php:73
|
519 |
msgid ""
|
520 |
"Please click the blue \"PayPal\" button below to log into your PayPal "
|
521 |
"account before adding your payment method."
|
533 |
msgid "Not ready to accept live payments? Click here to connect using sandbox mode."
|
534 |
msgstr ""
|
535 |
|
536 |
+
#: lib/skyverge/woocommerce/class-sv-wc-admin-notice-handler.php:238
|
537 |
+
#. translators: this is an action that dismisses a message
|
538 |
+
msgid "Dismiss"
|
539 |
+
msgstr ""
|
540 |
+
|
541 |
+
#. Author of the plugin/theme
|
542 |
+
msgid "WooCommerce"
|
543 |
+
msgstr ""
|
544 |
+
|
545 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:171
|
546 |
+
#. translators: Placeholders: %s - plugin name
|
547 |
+
msgid "You cannot clone instances of %s."
|
548 |
+
msgstr ""
|
549 |
+
|
550 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:181
|
551 |
+
#. translators: Placeholders: %s - plugin name
|
552 |
+
msgid "You cannot unserialize instances of %s."
|
553 |
+
msgstr ""
|
554 |
+
|
555 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:380
|
556 |
+
#. translators: Placeholders: %1$s - plugin name, %2$s - a PHP
|
557 |
+
#. extension/comma-separated list of PHP extensions
|
558 |
msgid ""
|
559 |
+
"%1$s requires the %2$s PHP extension to function. Contact your host or "
|
560 |
+
"server administrator to configure and install the missing extension."
|
561 |
+
msgid_plural ""
|
562 |
+
"%1$s requires the following PHP extensions to function: %2$s. Contact your "
|
563 |
+
"host or server administrator to configure and install the missing "
|
564 |
+
"extensions."
|
565 |
+
msgstr[0] ""
|
566 |
+
msgstr[1] ""
|
567 |
+
|
568 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:403
|
569 |
+
#. translators: Placeholders: %1$s - plugin name, %2$s - a PHP
|
570 |
+
#. function/comma-separated list of PHP functions
|
571 |
+
msgid ""
|
572 |
+
"%1$s requires the %2$s PHP function to exist. Contact your host or server "
|
573 |
+
"administrator to configure and install the missing function."
|
574 |
+
msgid_plural ""
|
575 |
+
"%1$s requires the following PHP functions to exist: %2$s. Contact your "
|
576 |
+
"host or server administrator to configure and install the missing functions."
|
577 |
+
msgstr[0] ""
|
578 |
+
msgstr[1] ""
|
579 |
+
|
580 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:428
|
581 |
+
#. translators: Placeholders: %s - plugin name
|
582 |
+
msgid ""
|
583 |
+
"%s may behave unexpectedly because the following PHP configuration settings "
|
584 |
+
"are required:"
|
585 |
+
msgstr ""
|
586 |
+
|
587 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:442
|
588 |
+
msgid "%s or higher"
|
589 |
msgstr ""
|
590 |
|
591 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:452
|
592 |
msgid ""
|
593 |
+
"Please contact your hosting provider or server administrator to configure "
|
594 |
+
"these settings."
|
595 |
msgstr ""
|
596 |
|
597 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:482
|
598 |
+
#. translators: Docs as in Documentation
|
599 |
+
msgid "Docs"
|
600 |
+
msgstr ""
|
601 |
+
|
602 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:675
|
603 |
+
msgid "%1$s - A minimum of %2$s is required."
|
604 |
+
msgstr ""
|
605 |
+
|
606 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:684
|
607 |
+
msgid "Set as %1$s - %2$s is required."
|
608 |
+
msgstr ""
|
609 |
+
|
610 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:921
|
611 |
+
msgid "Configure"
|
612 |
+
msgstr ""
|
613 |
+
|
614 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:87
|
615 |
+
msgid "Are you sure you want to remove this token?"
|
616 |
+
msgstr ""
|
617 |
+
|
618 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:97
|
619 |
+
msgid "Invalid token data"
|
620 |
+
msgstr ""
|
621 |
+
|
622 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:415
|
623 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:292
|
624 |
+
msgid "(%s)"
|
625 |
+
msgstr ""
|
626 |
+
|
627 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:444
|
628 |
+
msgid "Default"
|
629 |
+
msgstr ""
|
630 |
+
|
631 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:484
|
632 |
+
msgid "Card Type"
|
633 |
+
msgstr ""
|
634 |
+
|
635 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:489
|
636 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:525
|
637 |
+
msgid "Last Four"
|
638 |
+
msgstr ""
|
639 |
+
|
640 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:496
|
641 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:313
|
642 |
+
msgid "Expiration (MM/YY)"
|
643 |
+
msgstr ""
|
644 |
+
|
645 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:517
|
646 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:419
|
647 |
+
#. translators: e-check account type, HTML form field label
|
648 |
+
msgid "Account Type"
|
649 |
+
msgstr ""
|
650 |
+
|
651 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:520
|
652 |
+
msgid "Checking"
|
653 |
+
msgstr ""
|
654 |
+
|
655 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:521
|
656 |
+
msgid "Savings"
|
657 |
+
msgstr ""
|
658 |
+
|
659 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:621
|
660 |
+
msgid "Refresh"
|
661 |
+
msgstr ""
|
662 |
+
|
663 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:623
|
664 |
+
msgid "Add New"
|
665 |
+
msgstr ""
|
666 |
+
|
667 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:626
|
668 |
+
msgid "Save"
|
669 |
+
msgstr ""
|
670 |
+
|
671 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php:648
|
672 |
+
msgid "Remove"
|
673 |
+
msgstr ""
|
674 |
+
|
675 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:211
|
676 |
+
msgid "%s Payment Tokens"
|
677 |
+
msgstr ""
|
678 |
+
|
679 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php:289
|
680 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:675
|
681 |
+
msgid "Customer ID"
|
682 |
+
msgstr ""
|
683 |
+
|
684 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:32
|
685 |
+
msgid "This section contains configuration settings for this gateway."
|
686 |
+
msgstr ""
|
687 |
+
|
688 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:52
|
689 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:898
|
690 |
+
#. translators: environment as in a software environment (test/production)
|
691 |
+
msgid "Environment"
|
692 |
+
msgstr ""
|
693 |
+
|
694 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:53
|
695 |
+
msgid "The transaction environment for this gateway."
|
696 |
+
msgstr ""
|
697 |
+
|
698 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:60
|
699 |
+
msgid "Tokenization Enabled"
|
700 |
+
msgstr ""
|
701 |
+
|
702 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:61
|
703 |
+
msgid "Displays whether or not tokenization is enabled for this gateway."
|
704 |
+
msgstr ""
|
705 |
+
|
706 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:74
|
707 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:828
|
708 |
+
msgid "Debug Mode"
|
709 |
+
msgstr ""
|
710 |
+
|
711 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:75
|
712 |
+
msgid "Displays whether or not debug logging is enabled for this gateway."
|
713 |
+
msgstr ""
|
714 |
+
|
715 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:78
|
716 |
+
msgid "Display at Checkout & Log"
|
717 |
+
msgstr ""
|
718 |
+
|
719 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:80
|
720 |
+
msgid "Display at Checkout"
|
721 |
+
msgstr ""
|
722 |
+
|
723 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:82
|
724 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:836
|
725 |
+
msgid "Save to Log"
|
726 |
+
msgstr ""
|
727 |
+
|
728 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php:84
|
729 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:834
|
730 |
+
msgid "Off"
|
731 |
+
msgstr ""
|
732 |
+
|
733 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor-token.php:43
|
734 |
+
msgid "-- Select an option --"
|
735 |
+
msgstr ""
|
736 |
+
|
737 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor.php:59
|
738 |
+
msgid "No saved payment tokens"
|
739 |
+
msgstr ""
|
740 |
+
|
741 |
+
#: lib/skyverge/woocommerce/payment-gateway/admin/views/html-user-profile-field-customer-id.php:30
|
742 |
+
msgid "The gateway customer ID for the user. Only edit this if necessary."
|
743 |
+
msgstr ""
|
744 |
+
|
745 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:97
|
746 |
+
msgid "An error occurred, please try again or try an alternate form of payment"
|
747 |
+
msgstr ""
|
748 |
+
|
749 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:98
|
750 |
msgid ""
|
751 |
+
"We cannot process your order with the payment information that you "
|
752 |
+
"provided. Please use a different payment account or an alternate payment "
|
753 |
+
"method."
|
754 |
msgstr ""
|
755 |
|
756 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:99
|
757 |
msgid ""
|
758 |
+
"This order is being placed on hold for review. Please contact us to "
|
759 |
+
"complete the transaction."
|
|
|
760 |
msgstr ""
|
761 |
|
762 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:104
|
763 |
+
msgid ""
|
764 |
+
"This order is being placed on hold for review due to an incorrect card "
|
765 |
+
"verification number. You may contact the store to complete the transaction."
|
766 |
msgstr ""
|
767 |
|
768 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:105
|
769 |
+
msgid "The card verification number is invalid, please try again."
|
770 |
msgstr ""
|
771 |
|
772 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:106
|
773 |
+
msgid "Please enter your card verification number and try again."
|
774 |
+
msgstr ""
|
775 |
+
|
776 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:109
|
777 |
+
msgid ""
|
778 |
+
"That card type is not accepted, please use an alternate card or other form "
|
779 |
+
"of payment."
|
780 |
+
msgstr ""
|
781 |
+
|
782 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:110
|
783 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:114
|
784 |
+
msgid ""
|
785 |
+
"The card type is invalid or does not correlate with the credit card number. "
|
786 |
+
" Please try again or use an alternate card or other form of payment."
|
787 |
+
msgstr ""
|
788 |
+
|
789 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:111
|
790 |
+
msgid "Please select the card type and try again."
|
791 |
+
msgstr ""
|
792 |
+
|
793 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:115
|
794 |
+
msgid "The card number is invalid, please re-enter and try again."
|
795 |
+
msgstr ""
|
796 |
+
|
797 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:116
|
798 |
+
msgid "Please enter your card number and try again."
|
799 |
+
msgstr ""
|
800 |
+
|
801 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:119
|
802 |
+
msgid "The card expiration date is invalid, please re-enter and try again."
|
803 |
+
msgstr ""
|
804 |
+
|
805 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:120
|
806 |
+
msgid "The card expiration month is invalid, please re-enter and try again."
|
807 |
+
msgstr ""
|
808 |
+
|
809 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:121
|
810 |
+
msgid "The card expiration year is invalid, please re-enter and try again."
|
811 |
+
msgstr ""
|
812 |
+
|
813 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:122
|
814 |
+
msgid "Please enter your card expiration date and try again."
|
815 |
+
msgstr ""
|
816 |
+
|
817 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:125
|
818 |
+
msgid "The bank routing number is invalid, please re-enter and try again."
|
819 |
+
msgstr ""
|
820 |
+
|
821 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:126
|
822 |
+
msgid "The bank account number is invalid, please re-enter and try again."
|
823 |
+
msgstr ""
|
824 |
+
|
825 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:129
|
826 |
+
msgid ""
|
827 |
+
"The provided card is expired, please use an alternate card or other form of "
|
828 |
+
"payment."
|
829 |
+
msgstr ""
|
830 |
+
|
831 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:130
|
832 |
+
msgid ""
|
833 |
+
"The provided card was declined, please use an alternate card or other form "
|
834 |
+
"of payment."
|
835 |
+
msgstr ""
|
836 |
+
|
837 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:131
|
838 |
+
msgid ""
|
839 |
+
"Insufficient funds in account, please use an alternate card or other form "
|
840 |
+
"of payment."
|
841 |
+
msgstr ""
|
842 |
+
|
843 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:132
|
844 |
+
msgid ""
|
845 |
+
"The card is inactivate or not authorized for card-not-present transactions, "
|
846 |
+
"please use an alternate card or other form of payment."
|
847 |
+
msgstr ""
|
848 |
+
|
849 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:133
|
850 |
+
msgid ""
|
851 |
+
"The credit limit for the card has been reached, please use an alternate "
|
852 |
+
"card or other form of payment."
|
853 |
+
msgstr ""
|
854 |
+
|
855 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:134
|
856 |
+
msgid "The card verification number does not match. Please re-enter and try again."
|
857 |
+
msgstr ""
|
858 |
+
|
859 |
+
#: lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php:135
|
860 |
+
msgid ""
|
861 |
+
"The provided address does not match the billing address for cardholder. "
|
862 |
+
"Please verify the address and try again."
|
863 |
+
msgstr ""
|
864 |
+
|
865 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:101
|
866 |
+
msgid ""
|
867 |
+
"Payment error, please try another payment method or contact us to complete "
|
868 |
+
"your transaction."
|
869 |
+
msgstr ""
|
870 |
+
|
871 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:201
|
872 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:412
|
873 |
+
msgid "Card expiration date is invalid"
|
874 |
+
msgstr ""
|
875 |
+
|
876 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:225
|
877 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:405
|
878 |
+
msgid "Card number is missing"
|
879 |
+
msgstr ""
|
880 |
+
|
881 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:231
|
882 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:408
|
883 |
+
msgid "Card number is invalid (wrong length)"
|
884 |
+
msgstr ""
|
885 |
+
|
886 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:236
|
887 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:407
|
888 |
+
msgid "Card number is invalid (only digits allowed)"
|
889 |
+
msgstr ""
|
890 |
+
|
891 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:241
|
892 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:406
|
893 |
+
msgid "Card number is invalid"
|
894 |
+
msgstr ""
|
895 |
+
|
896 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:268
|
897 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:410
|
898 |
+
msgid "Card security code is invalid (only digits are allowed)"
|
899 |
+
msgstr ""
|
900 |
+
|
901 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:274
|
902 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:411
|
903 |
+
msgid "Card security code is invalid (must be 3 or 4 digits)"
|
904 |
+
msgstr ""
|
905 |
+
|
906 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:280
|
907 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:409
|
908 |
+
msgid "Card security code is missing"
|
909 |
+
msgstr ""
|
910 |
+
|
911 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:307
|
912 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:421
|
913 |
+
msgid "Routing Number is missing"
|
914 |
+
msgstr ""
|
915 |
+
|
916 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:314
|
917 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:422
|
918 |
+
msgid "Routing Number is invalid (only digits are allowed)"
|
919 |
+
msgstr ""
|
920 |
+
|
921 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:320
|
922 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:423
|
923 |
+
msgid "Routing number is invalid (must be 9 digits)"
|
924 |
+
msgstr ""
|
925 |
+
|
926 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:329
|
927 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:418
|
928 |
+
msgid "Account Number is missing"
|
929 |
+
msgstr ""
|
930 |
+
|
931 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:336
|
932 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:419
|
933 |
+
msgid "Account Number is invalid (only digits are allowed)"
|
934 |
+
msgstr ""
|
935 |
+
|
936 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:342
|
937 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:420
|
938 |
+
msgid "Account number is invalid (must be between 5 and 17 digits)"
|
939 |
+
msgstr ""
|
940 |
+
|
941 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:349
|
942 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:417
|
943 |
+
msgid "Drivers license number is invalid"
|
944 |
+
msgstr ""
|
945 |
+
|
946 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:355
|
947 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:413
|
948 |
+
msgid "Check Number is invalid (only digits are allowed)"
|
949 |
+
msgstr ""
|
950 |
+
|
951 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:605
|
952 |
+
#. translators: Placeholders: %1$s - payment method title, %2$s - payment
|
953 |
+
#. account type (savings/checking) (may or may not be available), %3$s - last
|
954 |
+
#. four digits of the account
|
955 |
+
msgid "%1$s Check Transaction Approved: %2$s account ending in %3$s"
|
956 |
+
msgstr ""
|
957 |
+
|
958 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:610
|
959 |
+
#. translators: Placeholders: %s - check number
|
960 |
+
msgid "Check number %s"
|
961 |
+
msgstr ""
|
962 |
+
|
963 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:678
|
964 |
+
#. translators: Placeholders: %1$s - payment method title, %2$s - environment
|
965 |
+
#. ("Test"), %3$s - transaction type (authorization/charge), %4$s - card type
|
966 |
+
#. (mastercard, visa, ...), %5$s - last four digits of the card, %6$s - expiry
|
967 |
+
#. date
|
968 |
+
msgid "%1$s %2$s %3$s Approved: %4$s ending in %5$s (expires %6$s)"
|
969 |
+
msgstr ""
|
970 |
+
|
971 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:752
|
972 |
+
#. translators: Placeholders: %s - failure message
|
973 |
+
msgid "Tokenization Request Failed: %s"
|
974 |
+
msgstr ""
|
975 |
+
|
976 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:763
|
977 |
+
#. translators: Placeholders: %1$s - payment method title, %2$s - failure
|
978 |
+
#. message
|
979 |
+
msgid "%1$s Tokenization Request Failed: %2$s"
|
980 |
+
msgstr ""
|
981 |
+
|
982 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:784
|
983 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:335
|
984 |
+
#. translators: This is a message describing that the transaction in question
|
985 |
+
#. only performed a credit card authorization and did not capture any funds.
|
986 |
+
msgid "Authorization only transaction"
|
987 |
+
msgstr ""
|
988 |
+
|
989 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:1143
|
990 |
+
#. translators: Placeholders: %s - failure message. Payment method as in a
|
991 |
+
#. specific credit card, e-check or bank account
|
992 |
+
msgid "Oops, adding your new payment method failed: %s"
|
993 |
+
msgstr ""
|
994 |
+
|
995 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:1195
|
996 |
+
#. translators: Payment method as in a specific credit card. Placeholders: %1$s
|
997 |
+
#. - card type (visa, mastercard, ...), %2$s - last four digits of the card,
|
998 |
+
#. %3$s - card expiry date
|
999 |
+
msgid "Nice! New payment method added: %1$s ending in %2$s (expires %3$s)"
|
1000 |
+
msgstr ""
|
1001 |
+
|
1002 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:1205
|
1003 |
+
#. translators: Payment method as in a specific e-check account. Placeholders:
|
1004 |
+
#. %1$s - account type (checking/savings), %2$s - last four digits of the
|
1005 |
+
#. account
|
1006 |
+
msgid "Nice! New payment method added: %1$s account ending in %2$s"
|
1007 |
+
msgstr ""
|
1008 |
+
|
1009 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:1212
|
1010 |
+
#. translators: Payment method as in a specific credit card, e-check or bank
|
1011 |
+
#. account
|
1012 |
+
msgid "Nice! New payment method added."
|
1013 |
+
msgstr ""
|
1014 |
+
|
1015 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:1319
|
1016 |
+
#. translators: Placeholders: %1$s - site title, %2$s - customer email. Payment
|
1017 |
+
#. method as in a specific credit card, e-check or bank account
|
1018 |
+
msgid "%1$s - Add Payment Method for %2$s"
|
1019 |
+
msgstr ""
|
1020 |
+
|
1021 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:187
|
1022 |
+
msgid "Checking Account"
|
1023 |
+
msgstr ""
|
1024 |
+
|
1025 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:188
|
1026 |
+
msgid "Savings Account"
|
1027 |
+
msgstr ""
|
1028 |
+
|
1029 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:189
|
1030 |
+
msgid "Credit / Debit Card"
|
1031 |
+
msgstr ""
|
1032 |
+
|
1033 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:190
|
1034 |
+
msgid "Bank Account"
|
1035 |
+
msgstr ""
|
1036 |
+
|
1037 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:121
|
1038 |
+
#. translators: Payment method as in a specific credit card, e-check or bank
|
1039 |
+
#. account
|
1040 |
+
msgid "Are you sure you want to delete this payment method?"
|
1041 |
+
msgstr ""
|
1042 |
+
|
1043 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:256
|
1044 |
+
#. translators: Payment method as in a specific credit card, eCheck or bank
|
1045 |
+
#. account
|
1046 |
+
msgid "You do not have any saved payment methods."
|
1047 |
+
msgstr ""
|
1048 |
+
|
1049 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:293
|
1050 |
+
#. translators: Payment method as in a specific credit card, eCheck or bank
|
1051 |
+
#. account
|
1052 |
+
msgid "My Payment Methods"
|
1053 |
+
msgstr ""
|
1054 |
+
|
1055 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:301
|
1056 |
+
#. translators: Payment method as in a specific credit card, e-check or bank
|
1057 |
+
#. account
|
1058 |
+
msgid "Add New Payment Method"
|
1059 |
+
msgstr ""
|
1060 |
+
|
1061 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:387
|
1062 |
+
msgid "Method"
|
1063 |
+
msgstr ""
|
1064 |
+
|
1065 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:388
|
1066 |
+
msgid "Expires"
|
1067 |
+
msgstr ""
|
1068 |
+
|
1069 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:422
|
1070 |
+
msgid "Credit/Debit Cards"
|
1071 |
+
msgstr ""
|
1072 |
+
|
1073 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:428
|
1074 |
+
msgid "Bank Accounts"
|
1075 |
+
msgstr ""
|
1076 |
+
|
1077 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:475
|
1078 |
+
msgid "N/A"
|
1079 |
+
msgstr ""
|
1080 |
+
|
1081 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:595
|
1082 |
+
#. translators: Set a payment method as the default option
|
1083 |
+
msgid "Make Default"
|
1084 |
+
msgstr ""
|
1085 |
+
|
1086 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:606
|
1087 |
+
msgid "Delete"
|
1088 |
+
msgstr ""
|
1089 |
+
|
1090 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:704
|
1091 |
+
msgid "Oops, you took too long, please try again."
|
1092 |
+
msgstr ""
|
1093 |
+
|
1094 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:717
|
1095 |
+
msgid "There was an error with your request, please try again."
|
1096 |
+
msgstr ""
|
1097 |
+
|
1098 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:730
|
1099 |
+
#. translators: Payment method as in a specific credit card, e-check or bank
|
1100 |
+
#. account
|
1101 |
+
msgid "Error removing payment method"
|
1102 |
+
msgstr ""
|
1103 |
+
|
1104 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:735
|
1105 |
+
#. translators: Payment method as in a specific credit card, e-check or bank
|
1106 |
+
#. account
|
1107 |
+
msgid "Payment method deleted."
|
1108 |
+
msgstr ""
|
1109 |
+
|
1110 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php:745
|
1111 |
+
#. translators: Payment method as in a specific credit card, e-check or bank
|
1112 |
+
#. account
|
1113 |
+
msgid "Default payment method updated."
|
1114 |
+
msgstr ""
|
1115 |
+
|
1116 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:295
|
1117 |
+
msgid "Card Number"
|
1118 |
+
msgstr ""
|
1119 |
+
|
1120 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:316
|
1121 |
+
msgid "MM / YY"
|
1122 |
+
msgstr ""
|
1123 |
+
|
1124 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:334
|
1125 |
+
msgid "Card Security Code"
|
1126 |
+
msgstr ""
|
1127 |
+
|
1128 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:337
|
1129 |
+
msgid "CSC"
|
1130 |
+
msgstr ""
|
1131 |
+
|
1132 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:376
|
1133 |
+
msgid "Where do I find this?"
|
1134 |
+
msgstr ""
|
1135 |
+
|
1136 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:382
|
1137 |
+
#. translators: e-check routing number, HTML form field label,
|
1138 |
+
#. https:en.wikipedia.org/wiki/Routing_transit_number
|
1139 |
+
msgid "Routing Number"
|
1140 |
+
msgstr ""
|
1141 |
+
|
1142 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:401
|
1143 |
+
#. translators: e-check account number, HTML form field label
|
1144 |
+
msgid "Account Number"
|
1145 |
+
msgstr ""
|
1146 |
+
|
1147 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:466
|
1148 |
+
#. translators: Test mode refers to the current software environment
|
1149 |
+
msgid "TEST MODE ENABLED"
|
1150 |
+
msgstr ""
|
1151 |
+
|
1152 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:569
|
1153 |
+
#. translators: Payment method as in a specific credit card, eCheck or bank
|
1154 |
+
#. account
|
1155 |
+
msgid "Manage Payment Methods"
|
1156 |
+
msgstr ""
|
1157 |
+
|
1158 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:661
|
1159 |
+
#. translators: Placeholders: %s - expiry date
|
1160 |
+
msgid "(expires %s)"
|
1161 |
+
msgstr ""
|
1162 |
+
|
1163 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:697
|
1164 |
+
msgid "Use a new card"
|
1165 |
+
msgstr ""
|
1166 |
+
|
1167 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:697
|
1168 |
+
msgid "Use a new bank account"
|
1169 |
+
msgstr ""
|
1170 |
+
|
1171 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:759
|
1172 |
+
#. translators: account as in customer's account on the eCommerce site
|
1173 |
+
msgid "Securely Save to Account"
|
1174 |
+
msgstr ""
|
1175 |
+
|
1176 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php:423
|
1177 |
+
#. translators: Placeholders: %s - plugin name
|
1178 |
+
msgid ""
|
1179 |
+
"%s: WooCommerce is not being forced over SSL; your customer's payment data "
|
1180 |
+
"may be at risk."
|
1181 |
+
msgstr ""
|
1182 |
+
|
1183 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php:480
|
1184 |
+
#. translators: Placeholders: %1$s - plugin name, %2$s - a
|
1185 |
+
#. currency/comma-separated list of currencies, %3$s - <a> tag, %4$s - </a> tag
|
1186 |
+
msgid ""
|
1187 |
+
"%1$s accepts payment in %2$s only. %3$sConfigure%4$s WooCommerce to accept "
|
1188 |
+
"%2$s to enable this gateway for checkout."
|
1189 |
+
msgid_plural ""
|
1190 |
+
"%1$s accepts payment in one of %2$s only. %3$sConfigure%4$s WooCommerce to "
|
1191 |
+
"accept one of %2$s to enable this gateway for checkout."
|
1192 |
+
msgstr[0] ""
|
1193 |
+
msgstr[1] ""
|
1194 |
+
|
1195 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php:524
|
1196 |
+
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1197 |
+
#. Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag
|
1198 |
+
msgid ""
|
1199 |
+
"%1$s is inactive for subscription transactions. Please %2$senable "
|
1200 |
+
"tokenization%3$s to activate %1$s for Subscriptions."
|
1201 |
+
msgstr ""
|
1202 |
+
|
1203 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php:542
|
1204 |
+
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1205 |
+
#. Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag
|
1206 |
+
msgid ""
|
1207 |
+
"%1$s is inactive for pre-order transactions. Please %2$senable "
|
1208 |
+
"tokenization%3$s to activate %1$s for Pre-Orders."
|
1209 |
+
msgstr ""
|
1210 |
+
|
1211 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php:578
|
1212 |
+
msgid ""
|
1213 |
+
"You must enable tokenization for this gateway in order to support automatic "
|
1214 |
+
"renewal payments with the WooCommerce Subscriptions extension."
|
1215 |
+
msgstr ""
|
1216 |
+
|
1217 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php:579
|
1218 |
+
msgid "Inactive"
|
1219 |
+
msgstr ""
|
1220 |
+
|
1221 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php:723
|
1222 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php:792
|
1223 |
+
#. translators: verb, as in "Capture credit card charge". Used when an
|
1224 |
+
#. amount has been pre-authorized before, but funds have not yet been captured
|
1225 |
+
#. (taken) from the card. Capturing the charge will take the money from the
|
1226 |
+
#. credit card and put it in the merchant's pockets.
|
1227 |
+
msgid "Capture Charge"
|
1228 |
+
msgstr ""
|
1229 |
+
|
1230 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:414
|
1231 |
+
msgid "Check Number is missing"
|
1232 |
+
msgstr ""
|
1233 |
+
|
1234 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:415
|
1235 |
+
msgid "Drivers license state is missing"
|
1236 |
+
msgstr ""
|
1237 |
+
|
1238 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:416
|
1239 |
+
msgid "Drivers license number is missing"
|
1240 |
+
msgstr ""
|
1241 |
+
|
1242 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:592
|
1243 |
+
msgid "Continue"
|
1244 |
+
msgstr ""
|
1245 |
+
|
1246 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:624
|
1247 |
+
msgid "Thank you for your order."
|
1248 |
+
msgstr ""
|
1249 |
+
|
1250 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:733
|
1251 |
+
msgid "Credit Card"
|
1252 |
+
msgstr ""
|
1253 |
+
|
1254 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:735
|
1255 |
+
msgid "eCheck"
|
1256 |
+
msgstr ""
|
1257 |
+
|
1258 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:753
|
1259 |
+
msgid "Pay securely using your credit card."
|
1260 |
+
msgstr ""
|
1261 |
+
|
1262 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:755
|
1263 |
+
msgid "Pay securely using your checking account."
|
1264 |
+
msgstr ""
|
1265 |
+
|
1266 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:774
|
1267 |
+
msgid "Enable / Disable"
|
1268 |
+
msgstr ""
|
1269 |
+
|
1270 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:775
|
1271 |
+
msgid "Enable this gateway"
|
1272 |
+
msgstr ""
|
1273 |
+
|
1274 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:781
|
1275 |
+
msgid "Title"
|
1276 |
+
msgstr ""
|
1277 |
+
|
1278 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:783
|
1279 |
+
msgid "Payment method title that the customer will see during checkout."
|
1280 |
+
msgstr ""
|
1281 |
+
|
1282 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:788
|
1283 |
+
msgid "Description"
|
1284 |
+
msgstr ""
|
1285 |
+
|
1286 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:790
|
1287 |
+
msgid "Payment method description that the customer will see during checkout."
|
1288 |
+
msgstr ""
|
1289 |
+
|
1290 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:819
|
1291 |
+
msgid "Detailed Decline Messages"
|
1292 |
+
msgstr ""
|
1293 |
+
|
1294 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:821
|
1295 |
+
msgid ""
|
1296 |
+
"Check to enable detailed decline messages to the customer during checkout "
|
1297 |
+
"when possible, rather than a generic decline message."
|
1298 |
+
msgstr ""
|
1299 |
+
|
1300 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:831
|
1301 |
+
#. translators: Placeholders: %1$s - <a> tag, %2$s - </a> tag
|
1302 |
+
msgid ""
|
1303 |
+
"Show Detailed Error Messages and API requests/responses on the checkout "
|
1304 |
+
"page and/or save them to the %1$sdebug log%2$s"
|
1305 |
+
msgstr ""
|
1306 |
+
|
1307 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:835
|
1308 |
+
msgid "Show on Checkout Page"
|
1309 |
+
msgstr ""
|
1310 |
+
|
1311 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:838
|
1312 |
+
#. translators: show debugging information on both checkout page and in the log
|
1313 |
+
msgid "Both"
|
1314 |
+
msgstr ""
|
1315 |
+
|
1316 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:901
|
1317 |
+
msgid "Select the gateway environment to use for transactions."
|
1318 |
+
msgstr ""
|
1319 |
+
|
1320 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:949
|
1321 |
+
msgid "Connection Settings"
|
1322 |
+
msgstr ""
|
1323 |
+
|
1324 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:955
|
1325 |
+
msgid "Share connection settings"
|
1326 |
+
msgstr ""
|
1327 |
+
|
1328 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:957
|
1329 |
+
msgid "Use connection/authentication settings from other gateway"
|
1330 |
+
msgstr ""
|
1331 |
+
|
1332 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:960
|
1333 |
+
msgid "Disabled because the other gateway is using these settings"
|
1334 |
+
msgstr ""
|
1335 |
+
|
1336 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:978
|
1337 |
+
msgid "Display the Card Security Code (CV2) field on checkout"
|
1338 |
+
msgstr ""
|
1339 |
+
|
1340 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1283
|
1341 |
+
#. translators: Placeholders: %1$s - site title, %2$s - order number
|
1342 |
+
msgid "%1$s - Order %2$s"
|
1343 |
+
msgstr ""
|
1344 |
+
|
1345 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1323
|
1346 |
+
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1347 |
+
#. Authorize.net, Braintree, etc), %2$s - transaction amount. Definitions:
|
1348 |
+
#. Capture, as in capture funds from a credit card.
|
1349 |
+
msgid "%1$s Capture of %2$s Approved"
|
1350 |
+
msgstr ""
|
1351 |
+
|
1352 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1351
|
1353 |
+
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1354 |
+
#. Authorize.net, Braintree, etc), %2$s - transaction amount, %3$s -
|
1355 |
+
#. transaction status message. Definitions: Capture, as in capture funds from a
|
1356 |
+
#. credit card.
|
1357 |
+
msgid "%1$s Capture Failed: %2$s - %3$s"
|
1358 |
+
msgstr ""
|
1359 |
+
|
1360 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1367
|
1361 |
+
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1362 |
+
#. Authorize.net, Braintree, etc), %2$s - failure message. Definitions:
|
1363 |
+
#. "capture" as in capturing funds from a credit card.
|
1364 |
+
msgid "%1$s Capture Failed: %2$s"
|
1365 |
+
msgstr ""
|
1366 |
+
|
1367 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1406
|
1368 |
+
#. translators: Placeholders: %1$s - site title, %2$s - order number.
|
1369 |
+
#. Definitions: Capture as in capture funds from a credit card.
|
1370 |
+
msgid "%1$s - Capture for Order %2$s"
|
1371 |
+
msgstr ""
|
1372 |
+
|
1373 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1570
|
1374 |
+
#. translators: Placeholders: %1$s - site title, %2$s - order number
|
1375 |
+
msgid "%1$s - Refund for Order %2$s"
|
1376 |
+
msgstr ""
|
1377 |
+
|
1378 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1633
|
1379 |
+
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1380 |
+
#. Authorize.net, Braintree, etc), %2$s - a monetary amount
|
1381 |
+
msgid "%1$s Refund in the amount of %2$s approved."
|
1382 |
+
msgstr ""
|
1383 |
+
|
1384 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1660
|
1385 |
+
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1386 |
+
#. Authorize.net, Braintree, etc), %2$s - error code, %3$s - error message
|
1387 |
+
msgid "%1$s Refund Failed: %2$s - %3$s"
|
1388 |
+
msgstr ""
|
1389 |
+
|
1390 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1668
|
1391 |
+
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1392 |
+
#. Authorize.net, Braintree, etc), %2$s - error message
|
1393 |
+
msgid "%1$s Refund Failed: %2$s"
|
1394 |
+
msgstr ""
|
1395 |
+
|
1396 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1688
|
1397 |
+
#. translators: Placeholders: %s - payment gateway title (such as
|
1398 |
+
#. Authorize.net, Braintree, etc)
|
1399 |
+
msgid "%s Order completely refunded."
|
1400 |
+
msgstr ""
|
1401 |
+
|
1402 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1741
|
1403 |
+
msgid ""
|
1404 |
+
"Oops, you cannot partially void this order. Please use the full order "
|
1405 |
+
"amount."
|
1406 |
+
msgstr ""
|
1407 |
+
|
1408 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1825
|
1409 |
+
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error code,
|
1410 |
+
#. %3$s - error message. Void as in to void an order.
|
1411 |
+
msgid "%1$s Void Failed: %2$s - %3$s"
|
1412 |
+
msgstr ""
|
1413 |
+
|
1414 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1833
|
1415 |
+
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1416 |
+
#. message. Void as in to void an order.
|
1417 |
+
msgid "%1$s Void Failed: %2$s"
|
1418 |
+
msgstr ""
|
1419 |
+
|
1420 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1854
|
1421 |
+
#. translators: Placeholders: %1$s - payment gateway title, %2$s - a monetary
|
1422 |
+
#. amount. Void as in to void an order.
|
1423 |
+
msgid "%1$s Void in the amount of %2$s approved."
|
1424 |
+
msgstr ""
|
1425 |
+
|
1426 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1949
|
1427 |
+
#: lib/skyverge/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:146
|
1428 |
+
#. translators: Placeholders: %1$s - status code, %2$s - status message
|
1429 |
+
#. translators: Placeholders: %1$s - payment request response status code, %2$s
|
1430 |
+
#. - payment request response status message
|
1431 |
+
msgid "Status code %1$s: %2$s"
|
1432 |
+
msgstr ""
|
1433 |
+
|
1434 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1952
|
1435 |
+
#: lib/skyverge/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:149
|
1436 |
+
#. translators: Placeholders: %s - status code
|
1437 |
+
#. translators: Placeholders: %s - payment request response status code
|
1438 |
+
msgid "Status code: %s"
|
1439 |
+
msgstr ""
|
1440 |
+
|
1441 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1955
|
1442 |
+
#: lib/skyverge/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:152
|
1443 |
+
#. translators: Placeholders; %s - status message
|
1444 |
+
#. translators: Placeholders: %s - payment request response status message
|
1445 |
+
msgid "Status message: %s"
|
1446 |
+
msgstr ""
|
1447 |
+
|
1448 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1960
|
1449 |
+
#: lib/skyverge/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:159
|
1450 |
+
msgid "Transaction ID %s"
|
1451 |
+
msgstr ""
|
1452 |
+
|
1453 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2071
|
1454 |
+
#. translators: Placeholders: %1$s - payment gateway title, %2$s - message
|
1455 |
+
#. (probably reason for the transaction being held for review)
|
1456 |
+
msgid "%1$s Transaction Held for Review (%2$s)"
|
1457 |
+
msgstr ""
|
1458 |
+
|
1459 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2102
|
1460 |
+
msgid ""
|
1461 |
+
"Your order has been received and is being reviewed. Thank you for your "
|
1462 |
+
"business."
|
1463 |
+
msgstr ""
|
1464 |
+
|
1465 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2147
|
1466 |
+
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1467 |
+
#. message; e.g. Order Note: [Payment method] Payment failed [error]
|
1468 |
+
msgid "%1$s Payment Failed (%2$s)"
|
1469 |
+
msgstr ""
|
1470 |
+
|
1471 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2164
|
1472 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:384
|
1473 |
+
msgid "An error occurred, please try again or try an alternate form of payment."
|
1474 |
+
msgstr ""
|
1475 |
+
|
1476 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2181
|
1477 |
+
#. translators: Placeholders: %1$s - payment gateway title, %2$s -
|
1478 |
+
#. message/error
|
1479 |
+
msgid "%1$s Transaction Cancelled (%2$s)"
|
1480 |
+
msgstr ""
|
1481 |
+
|
1482 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2413
|
1483 |
+
msgid "Transaction Type"
|
1484 |
+
msgstr ""
|
1485 |
+
|
1486 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2415
|
1487 |
+
msgid ""
|
1488 |
+
"Select how transactions should be processed. Charge submits all "
|
1489 |
+
"transactions for settlement, Authorization simply authorizes the order "
|
1490 |
+
"total for capture later."
|
1491 |
+
msgstr ""
|
1492 |
+
|
1493 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2426
|
1494 |
+
msgid "Charge Virtual-Only Orders"
|
1495 |
+
msgstr ""
|
1496 |
+
|
1497 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2428
|
1498 |
+
msgid ""
|
1499 |
+
"If the order contains exclusively virtual items, enable this to immediately "
|
1500 |
+
"charge, rather than authorize, the transaction."
|
1501 |
+
msgstr ""
|
1502 |
+
|
1503 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2598
|
1504 |
+
msgid "Accepted Card Types"
|
1505 |
+
msgstr ""
|
1506 |
+
|
1507 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2600
|
1508 |
+
msgid "Select which card types you accept."
|
1509 |
+
msgstr ""
|
1510 |
+
|
1511 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2688
|
1512 |
+
#. translators:
|
1513 |
+
#. http:www.cybersource.com/products/payment_security/payment_tokenization/ and
|
1514 |
+
#. https:en.wikipedia.org/wiki/Tokenization_(data_security)
|
1515 |
+
msgid "Tokenization"
|
1516 |
+
msgstr ""
|
1517 |
+
|
1518 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2689
|
1519 |
+
msgid "Allow customers to securely save their payment details for future checkout."
|
1520 |
+
msgstr ""
|
1521 |
+
|
1522 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:242
|
1523 |
+
msgid "Pre-Order Tokenization attempt failed (%s)"
|
1524 |
+
msgstr ""
|
1525 |
+
|
1526 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:269
|
1527 |
+
msgid "%s - Pre-Order Release Payment for Order %s"
|
1528 |
+
msgstr ""
|
1529 |
+
|
1530 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:273
|
1531 |
+
msgid "Payment token missing/invalid."
|
1532 |
+
msgstr ""
|
1533 |
+
|
1534 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:298
|
1535 |
+
msgid "%s %s Pre-Order Release Payment Approved: %s ending in %s (expires %s)"
|
1536 |
+
msgstr ""
|
1537 |
+
|
1538 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:309
|
1539 |
+
msgid "%s eCheck Pre-Order Release Payment Approved: %s ending in %s"
|
1540 |
+
msgstr ""
|
1541 |
+
|
1542 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:313
|
1543 |
+
msgid "%s Pre-Order Release Payment Approved"
|
1544 |
+
msgstr ""
|
1545 |
+
|
1546 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php:354
|
1547 |
+
msgid "Pre-Order Release Payment Failed: %s"
|
1548 |
+
msgstr ""
|
1549 |
+
|
1550 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:221
|
1551 |
+
msgid "Subscription Renewal: payment token is missing/invalid."
|
1552 |
+
msgstr ""
|
1553 |
+
|
1554 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:247
|
1555 |
+
msgid "%1$s - Subscription Renewal Order %2$s"
|
1556 |
+
msgstr ""
|
1557 |
+
|
1558 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:379
|
1559 |
+
#. translators: Placeholders: %1$s - payment gateway title, %2$s - error
|
1560 |
+
#. message; e.g. Order Note: [Payment method] Payment Change failed [error]
|
1561 |
+
msgid "%1$s Payment Change Failed (%2$s)"
|
1562 |
+
msgstr ""
|
1563 |
+
|
1564 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:510
|
1565 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:1030
|
1566 |
+
msgid "Via %s ending in %s"
|
1567 |
+
msgstr ""
|
1568 |
+
|
1569 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:537
|
1570 |
+
msgid "Subscriptions"
|
1571 |
+
msgstr ""
|
1572 |
+
|
1573 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:607
|
1574 |
+
msgid ""
|
1575 |
+
"This payment method is tied to a subscription and cannot be deleted. Please "
|
1576 |
+
"switch the subscription to another method first."
|
1577 |
+
msgstr ""
|
1578 |
+
|
1579 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:617
|
1580 |
+
msgid "View Subscription"
|
1581 |
+
msgstr ""
|
1582 |
+
|
1583 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:671
|
1584 |
+
msgid "Payment Token"
|
1585 |
+
msgstr ""
|
1586 |
+
|
1587 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:699
|
1588 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:704
|
1589 |
+
msgid "%s is required."
|
1590 |
+
msgstr ""
|
1591 |
+
|
1592 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:859
|
1593 |
+
msgid "%s0 Subscription Renewal Approved"
|
1594 |
+
msgstr ""
|
1595 |
+
|
1596 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:907
|
1597 |
+
msgid "%s Check Subscription Renewal Payment Approved: %s account ending in %s"
|
1598 |
+
msgstr ""
|
1599 |
+
|
1600 |
+
#: lib/skyverge/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:154
|
1601 |
+
msgid "Unknown Error"
|
1602 |
+
msgstr ""
|
1603 |
+
|
1604 |
+
#: lib/skyverge/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:748
|
1605 |
+
#. translators: Placeholders: %1$s - payment gateway title (such as
|
1606 |
+
#. Authorize.net, Braintree, etc), %2$s - payment method name (mastercard, bank
|
1607 |
+
#. account, etc), %3$s - last four digits of the card/account, %4$s -
|
1608 |
+
#. card/account expiry date
|
1609 |
+
msgid "%1$s Payment Method Saved: %2$s ending in %3$s (expires %4$s)"
|
1610 |
+
msgstr ""
|
1611 |
+
|
1612 |
+
#: lib/skyverge/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php:759
|
1613 |
+
#. translators: Placeholders: %1$s - payment gateway title (such as CyberSouce,
|
1614 |
+
#. NETbilling, etc), %2$s - account type (checking/savings - may or may not be
|
1615 |
+
#. available), %3$s - last four digits of the account
|
1616 |
+
msgid "%1$s eCheck Payment Method Saved: %2$s account ending in %3$s"
|
1617 |
+
msgstr ""
|
1618 |
+
|
1619 |
+
#: woocommerce-gateway-paypal-powered-by-braintree.php:113
|
1620 |
+
msgid ""
|
1621 |
+
"WooCommerce PayPal powered by Braintree is inactive. Please deactivate the "
|
1622 |
+
"retired WooCommerce Braintree plugin."
|
1623 |
+
msgstr ""
|
1624 |
+
|
1625 |
+
#: woocommerce-gateway-paypal-powered-by-braintree.php:201
|
1626 |
+
msgid ""
|
1627 |
+
"The minimum PHP version required for this plugin is %1$s. You are running "
|
1628 |
+
"%2$s."
|
1629 |
+
msgstr ""
|
1630 |
+
|
1631 |
+
#. Plugin URI of the plugin/theme
|
1632 |
+
msgid ""
|
1633 |
+
"https://docs.woocommerce.com/document/woocommerce-gateway-paypal-powered-by-"
|
1634 |
+
"braintree/"
|
1635 |
+
msgstr ""
|
1636 |
+
|
1637 |
+
#. Description of the plugin/theme
|
1638 |
+
msgid ""
|
1639 |
+
"Receive credit card or PayPal payments using Paypal Powered by Braintree. "
|
1640 |
+
"A server with cURL, SSL support, and a valid SSL certificate is required "
|
1641 |
+
"(for security reasons) for this gateway to function. Requires PHP 5.4+"
|
1642 |
+
msgstr ""
|
1643 |
+
|
1644 |
+
#. Author URI of the plugin/theme
|
1645 |
+
msgid "http://woocommerce.com/"
|
1646 |
+
msgstr ""
|
1647 |
+
|
1648 |
+
#: includes/class-wc-braintree-frontend.php:66
|
1649 |
+
msgctxt "Payment Method Type"
|
1650 |
+
msgid "Type"
|
1651 |
+
msgstr ""
|
1652 |
+
|
1653 |
+
#: lib/skyverge/woocommerce/class-sv-wc-plugin.php:487
|
1654 |
+
msgctxt "noun"
|
1655 |
+
msgid "Support"
|
1656 |
+
msgstr ""
|
1657 |
+
|
1658 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:680
|
1659 |
+
msgctxt "noun, software environment"
|
1660 |
+
msgid "Test"
|
1661 |
+
msgstr ""
|
1662 |
+
|
1663 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:681
|
1664 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2419
|
1665 |
+
msgctxt "credit card transaction type"
|
1666 |
+
msgid "Authorization"
|
1667 |
+
msgstr ""
|
1668 |
+
|
1669 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php:681
|
1670 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2418
|
1671 |
+
msgctxt "noun, credit card transaction type"
|
1672 |
+
msgid "Charge"
|
1673 |
+
msgstr ""
|
1674 |
+
|
1675 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:199
|
1676 |
+
msgctxt "payment method type"
|
1677 |
+
msgid "Account"
|
1678 |
+
msgstr ""
|
1679 |
+
|
1680 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:234
|
1681 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2625
|
1682 |
+
msgctxt "credit card type"
|
1683 |
+
msgid "Visa"
|
1684 |
+
msgstr ""
|
1685 |
+
|
1686 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:238
|
1687 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2626
|
1688 |
+
msgctxt "credit card type"
|
1689 |
+
msgid "MasterCard"
|
1690 |
+
msgstr ""
|
1691 |
+
|
1692 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:242
|
1693 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2627
|
1694 |
+
msgctxt "credit card type"
|
1695 |
+
msgid "American Express"
|
1696 |
+
msgstr ""
|
1697 |
+
|
1698 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:246
|
1699 |
+
msgctxt "credit card type"
|
1700 |
+
msgid "Diners Club"
|
1701 |
+
msgstr ""
|
1702 |
+
|
1703 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:250
|
1704 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2628
|
1705 |
+
msgctxt "credit card type"
|
1706 |
+
msgid "Discover"
|
1707 |
+
msgstr ""
|
1708 |
+
|
1709 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:254
|
1710 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2630
|
1711 |
+
msgctxt "credit card type"
|
1712 |
+
msgid "JCB"
|
1713 |
+
msgstr ""
|
1714 |
+
|
1715 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:258
|
1716 |
+
msgctxt "credit card type"
|
1717 |
+
msgid "CarteBleue"
|
1718 |
+
msgstr ""
|
1719 |
+
|
1720 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:262
|
1721 |
+
msgctxt "credit card type"
|
1722 |
+
msgid "Maestro"
|
1723 |
+
msgstr ""
|
1724 |
+
|
1725 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php:266
|
1726 |
+
msgctxt "credit card type"
|
1727 |
+
msgid "Laser"
|
1728 |
+
msgstr ""
|
1729 |
+
|
1730 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:2629
|
1731 |
+
msgctxt "credit card type"
|
1732 |
+
msgid "Diners"
|
1733 |
+
msgstr ""
|
1734 |
+
|
1735 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:427
|
1736 |
+
#. translators: http:www.investopedia.com/terms/c/checkingaccount.asp
|
1737 |
+
msgctxt "account type"
|
1738 |
+
msgid "Checking"
|
1739 |
+
msgstr ""
|
1740 |
+
|
1741 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php:429
|
1742 |
+
#. translators: http:www.investopedia.com/terms/s/savingsaccount.asp
|
1743 |
+
msgctxt "account type"
|
1744 |
+
msgid "Savings"
|
1745 |
+
msgstr ""
|
1746 |
+
|
1747 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:1928
|
1748 |
+
msgctxt "hash before order number"
|
1749 |
+
msgid "#"
|
1750 |
+
msgstr ""
|
1751 |
+
|
1752 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:567
|
1753 |
+
msgctxt "hash before order number"
|
1754 |
+
msgid "#%s"
|
1755 |
+
msgstr ""
|
1756 |
+
|
1757 |
+
#: lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php:3215
|
1758 |
+
#. translators: https:www.skyverge.com/for-translators-environments/
|
1759 |
+
msgctxt "software environment"
|
1760 |
+
msgid "Production"
|
1761 |
+
msgstr ""
|
1762 |
+
|
1763 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:897
|
1764 |
+
msgctxt "woocommerce-gateway-paypal-powered-by-braintree"
|
1765 |
+
msgid "%s %s Subscription Renewal Payment Approved: %s ending in %s (expires %s)"
|
1766 |
+
msgstr ""
|
1767 |
+
|
1768 |
+
#: lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php:930
|
1769 |
+
msgctxt "woocommerce-gateway-paypal-powered-by-braintree"
|
1770 |
+
msgid "%s Renewal Payment Failed (%s)"
|
1771 |
msgstr ""
|
includes/api/class-wc-braintree-api-response-message-helper.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Response-Message-Helper
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Response-Message-Helper
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/class-wc-braintree-api.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -62,25 +62,6 @@ class WC_Braintree_API extends WC_Braintree_Framework\SV_WC_API_Base implements
|
|
62 |
public function __construct( $gateway ) {
|
63 |
|
64 |
$this->gateway = $gateway;
|
65 |
-
|
66 |
-
$this->init_sdk();
|
67 |
-
}
|
68 |
-
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Load and configure the Braintree SDK
|
72 |
-
*
|
73 |
-
* @since 3.0.0
|
74 |
-
*/
|
75 |
-
protected function init_sdk() {
|
76 |
-
|
77 |
-
// if SDK is already loaded, bail
|
78 |
-
if ( class_exists( 'Braintree\Configuration', false ) ) {
|
79 |
-
return;
|
80 |
-
}
|
81 |
-
|
82 |
-
// load Braintree PHP SDK
|
83 |
-
require_once( $this->get_gateway()->get_plugin()->get_plugin_path() . '/lib/Braintree.php' );
|
84 |
}
|
85 |
|
86 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
62 |
public function __construct( $gateway ) {
|
63 |
|
64 |
$this->gateway = $gateway;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
|
67 |
|
includes/api/requests/abstract-wc-braintree-api-request.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Request
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Request
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/requests/abstract-wc-braintree-api-vault-request.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Vault
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Vault
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/requests/class-wc-braintree-api-client-token-request.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Client-Token
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Client-Token
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/requests/class-wc-braintree-api-customer-request.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Customer
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Customer
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/requests/class-wc-braintree-api-payment-method-nonce-request.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Payment-Nonce
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Payment-Nonce
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/requests/class-wc-braintree-api-payment-method-request.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Payment-Method
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Payment-Method
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/requests/class-wc-braintree-api-transaction-request.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Transaction
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -297,7 +297,7 @@ class WC_Braintree_API_Transaction_Request extends WC_Braintree_API_Request {
|
|
297 |
}
|
298 |
}
|
299 |
|
300 |
-
// add recurring flag to
|
301 |
if ( ! empty( $this->get_order()->payment->recurring ) ) {
|
302 |
$this->request_data['recurring'] = true;
|
303 |
}
|
@@ -345,6 +345,10 @@ class WC_Braintree_API_Transaction_Request extends WC_Braintree_API_Request {
|
|
345 |
'storeInVaultOnSuccess' => $this->get_order()->payment->tokenize,
|
346 |
);
|
347 |
|
|
|
|
|
|
|
|
|
348 |
if ( ! empty( $this->get_order()->payment->is_3ds_required ) ) {
|
349 |
$options['three_d_secure'] = array( 'required' => true );
|
350 |
}
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Requests/Transaction
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
297 |
}
|
298 |
}
|
299 |
|
300 |
+
// add recurring flag to transactions that are subscription renewals
|
301 |
if ( ! empty( $this->get_order()->payment->recurring ) ) {
|
302 |
$this->request_data['recurring'] = true;
|
303 |
}
|
345 |
'storeInVaultOnSuccess' => $this->get_order()->payment->tokenize,
|
346 |
);
|
347 |
|
348 |
+
if ( $this->get_order()->payment->tokenize ) {
|
349 |
+
$options['addBillingAddressToPaymentMethod'] = true;
|
350 |
+
}
|
351 |
+
|
352 |
if ( ! empty( $this->get_order()->payment->is_3ds_required ) ) {
|
353 |
$options['three_d_secure'] = array( 'required' => true );
|
354 |
}
|
includes/api/responses/abstract-wc-braintree-api-response.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Response
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Response
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/responses/abstract-wc-braintree-api-transaction-response.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Transaction
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Transaction
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/responses/abstract-wc-braintree-api-vault-response.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Vault
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Vault
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/responses/class-wc-braintree-api-client-token-response.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Client-Token
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Client-Token
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/responses/class-wc-braintree-api-credit-card-transaction-response.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Credit-Card-Transaction
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Credit-Card-Transaction
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/responses/class-wc-braintree-api-customer-response.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Customer
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Customer
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/responses/class-wc-braintree-api-payment-method-nonce-response.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Payment-Nonce
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Payment-Nonce
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/api/responses/class-wc-braintree-api-payment-method-response.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Payment-Method
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -45,7 +45,7 @@ class WC_Braintree_API_Payment_Method_Response extends WC_Braintree_API_Vault_Re
|
|
45 |
*/
|
46 |
public function get_transaction_id() {
|
47 |
|
48 |
-
return $this->is_credit_card_response() && isset( $this->response->paymentMethod->verification ) ? $this->response->paymentMethod->verification->id : null;
|
49 |
}
|
50 |
|
51 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/Payment-Method
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
45 |
*/
|
46 |
public function get_transaction_id() {
|
47 |
|
48 |
+
return $this->is_credit_card_response() && isset( $this->response->paymentMethod, $this->response->paymentMethod->verification ) ? $this->response->paymentMethod->verification->id : null;
|
49 |
}
|
50 |
|
51 |
|
includes/api/responses/class-wc-braintree-api-paypal-transaction-response.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/PayPal-Transaction
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/API/Responses/PayPal-Transaction
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/class-wc-braintree-frontend.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Method
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -110,13 +110,13 @@ class WC_Braintree_Frontend {
|
|
110 |
if ( $last_four ) {
|
111 |
|
112 |
/* translators: %s - last four digits of a card/account */
|
113 |
-
$title .= ' ' . sprintf( esc_html__( 'ending in %s', 'woocommerce-
|
114 |
}
|
115 |
|
116 |
// add "(default)" if token is set as default
|
117 |
if ( $token->is_default() ) {
|
118 |
|
119 |
-
$title .= ' ' . esc_html__( '(default)', 'woocommerce-
|
120 |
}
|
121 |
|
122 |
return $title;
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Method
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
110 |
if ( $last_four ) {
|
111 |
|
112 |
/* translators: %s - last four digits of a card/account */
|
113 |
+
$title .= ' ' . sprintf( esc_html__( 'ending in %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $last_four );
|
114 |
}
|
115 |
|
116 |
// add "(default)" if token is set as default
|
117 |
if ( $token->is_default() ) {
|
118 |
|
119 |
+
$title .= ' ' . esc_html__( '(default)', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
120 |
}
|
121 |
|
122 |
return $title;
|
includes/class-wc-braintree-payment-method-handler.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Method-Handler
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Method-Handler
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/class-wc-braintree-payment-method.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Method
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Method
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
includes/class-wc-braintree-paypal-cart.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -50,7 +50,9 @@ class WC_Braintree_PayPal_Cart {
|
|
50 |
|
51 |
$this->gateway = $gateway;
|
52 |
|
53 |
-
$
|
|
|
|
|
54 |
}
|
55 |
|
56 |
|
@@ -138,10 +140,31 @@ class WC_Braintree_PayPal_Cart {
|
|
138 |
*/
|
139 |
public function render_js() {
|
140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
$params = array(
|
142 |
-
'id'
|
143 |
-
'id_dasherized'
|
144 |
-
'debug'
|
|
|
|
|
|
|
145 |
);
|
146 |
|
147 |
wc_enqueue_js( sprintf( 'window.wc_%1$s_handler = new WC_Braintree_PayPal_Cart_Handler( %2$s );', esc_js( $this->get_gateway()->get_id() ), json_encode( $params ) ) );
|
@@ -166,7 +189,7 @@ class WC_Braintree_PayPal_Cart {
|
|
166 |
}
|
167 |
|
168 |
wp_send_json( array(
|
169 |
-
'redirect_url' =>
|
170 |
) );
|
171 |
}
|
172 |
|
@@ -366,7 +389,7 @@ class WC_Braintree_PayPal_Cart {
|
|
366 |
|
367 |
printf(
|
368 |
'<a href="%1$s" class="wc-' . sanitize_html_class( $this->get_gateway()->get_id_dasherized() ) . '-cancel">%2$s</a>',
|
369 |
-
esc_url( add_query_arg( array( 'wc_' . $this->get_gateway()->get_id() . '_clear_session' => true ),
|
370 |
esc_html__( 'Cancel', 'woocommerce-gateway-paypal-powered-by-braintree' )
|
371 |
);
|
372 |
}
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
50 |
|
51 |
$this->gateway = $gateway;
|
52 |
|
53 |
+
if ( $gateway->cart_checkout_enabled() ) {
|
54 |
+
$this->add_hooks();
|
55 |
+
}
|
56 |
}
|
57 |
|
58 |
|
140 |
*/
|
141 |
public function render_js() {
|
142 |
|
143 |
+
$default_button_styles = array(
|
144 |
+
'label' => 'checkout',
|
145 |
+
'size' => 'responsive',
|
146 |
+
'shape' => 'pill',
|
147 |
+
'color' => 'gold',
|
148 |
+
);
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Filters the PayPal cart button style parameters.
|
152 |
+
*
|
153 |
+
* See https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/customize-button/
|
154 |
+
*
|
155 |
+
* @since 2.1.0
|
156 |
+
*
|
157 |
+
* @param array $styles style parameters
|
158 |
+
*/
|
159 |
+
$button_styles = apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_cart_button_styles', $default_button_styles );
|
160 |
+
|
161 |
$params = array(
|
162 |
+
'id' => $this->get_gateway()->get_id(),
|
163 |
+
'id_dasherized' => $this->get_gateway()->get_id_dasherized(),
|
164 |
+
'debug' => $this->get_gateway()->debug_log(),
|
165 |
+
'is_test_environment' => $this->get_gateway()->is_test_environment(),
|
166 |
+
'client_token_nonce' => wp_create_nonce( 'wc_' . $this->get_gateway()->get_id() . '_get_client_token' ),
|
167 |
+
'button_styles' => wp_parse_args( $button_styles, $default_button_styles ), // ensure all expected parameters are present after filtering to avoid JS errors
|
168 |
);
|
169 |
|
170 |
wc_enqueue_js( sprintf( 'window.wc_%1$s_handler = new WC_Braintree_PayPal_Cart_Handler( %2$s );', esc_js( $this->get_gateway()->get_id() ), json_encode( $params ) ) );
|
189 |
}
|
190 |
|
191 |
wp_send_json( array(
|
192 |
+
'redirect_url' => wc_get_checkout_url(),
|
193 |
) );
|
194 |
}
|
195 |
|
389 |
|
390 |
printf(
|
391 |
'<a href="%1$s" class="wc-' . sanitize_html_class( $this->get_gateway()->get_id_dasherized() ) . '-cancel">%2$s</a>',
|
392 |
+
esc_url( add_query_arg( array( 'wc_' . $this->get_gateway()->get_id() . '_clear_session' => true ), wc_get_cart_url() ) ),
|
393 |
esc_html__( 'Cancel', 'woocommerce-gateway-paypal-powered-by-braintree' )
|
394 |
);
|
395 |
}
|
includes/class-wc-gateway-braintree-credit-card.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Credit-Card
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -93,6 +93,10 @@ class WC_Gateway_Braintree_Credit_Card extends WC_Gateway_Braintree {
|
|
93 |
|
94 |
// sanitize admin options before saving
|
95 |
add_filter( 'woocommerce_settings_api_sanitized_fields_braintree_credit_card', array( $this, 'filter_admin_options' ) );
|
|
|
|
|
|
|
|
|
96 |
}
|
97 |
|
98 |
|
@@ -107,19 +111,11 @@ class WC_Gateway_Braintree_Credit_Card extends WC_Gateway_Braintree {
|
|
107 |
*/
|
108 |
public function enqueue_gateway_assets() {
|
109 |
|
110 |
-
// never enqueue the Credit Card assets on the Cart page
|
111 |
-
// this prevents them from overwriting the PayPal assets
|
112 |
-
if ( is_cart() ) {
|
113 |
-
return;
|
114 |
-
}
|
115 |
-
|
116 |
-
parent::enqueue_gateway_assets();
|
117 |
-
|
118 |
// advanced/kount fraud tool
|
119 |
-
if ( $this->
|
120 |
|
121 |
// enqueue braintree-data.js library
|
122 |
-
wp_enqueue_script( 'braintree-data', 'https://js.braintreegateway.com/v1/braintree-data.js', array( 'braintree-js' ), WC_Braintree::VERSION, true );
|
123 |
|
124 |
// adjust the script tag to add async attribute
|
125 |
add_filter( 'clean_url', array( $this, 'adjust_fraud_script_tag' ) );
|
@@ -127,6 +123,17 @@ class WC_Gateway_Braintree_Credit_Card extends WC_Gateway_Braintree {
|
|
127 |
// this script must be rendered to the page before the braintree-data.js library, hence priority 1
|
128 |
add_action( 'wp_print_footer_scripts', array( $this, 'render_fraud_js' ), 1 );
|
129 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
}
|
131 |
|
132 |
|
@@ -159,7 +166,7 @@ class WC_Gateway_Braintree_Credit_Card extends WC_Gateway_Braintree {
|
|
159 |
);
|
160 |
|
161 |
// Kount is only available for manual API connections
|
162 |
-
if ( $this->
|
163 |
$fraud_tool_options['kount_direct'] = __( 'Kount Direct', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
164 |
}
|
165 |
|
@@ -566,7 +573,7 @@ class WC_Gateway_Braintree_Credit_Card extends WC_Gateway_Braintree {
|
|
566 |
*/
|
567 |
public function is_kount_direct_enabled() {
|
568 |
|
569 |
-
return 'kount_direct' === $this->get_fraud_tool();
|
570 |
}
|
571 |
|
572 |
|
@@ -583,6 +590,21 @@ class WC_Gateway_Braintree_Credit_Card extends WC_Gateway_Braintree {
|
|
583 |
}
|
584 |
|
585 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
586 |
/** 3D Secure feature *****************************************************/
|
587 |
|
588 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Credit-Card
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
93 |
|
94 |
// sanitize admin options before saving
|
95 |
add_filter( 'woocommerce_settings_api_sanitized_fields_braintree_credit_card', array( $this, 'filter_admin_options' ) );
|
96 |
+
|
97 |
+
// get the client token via AJAX
|
98 |
+
add_filter( 'wp_ajax_wc_' . $this->get_id() . '_get_client_token', array( $this, 'ajax_get_client_token' ) );
|
99 |
+
add_filter( 'wp_ajax_nopriv_wc_' . $this->get_id() . '_get_client_token', array( $this, 'ajax_get_client_token' ) );
|
100 |
}
|
101 |
|
102 |
|
111 |
*/
|
112 |
public function enqueue_gateway_assets() {
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
// advanced/kount fraud tool
|
115 |
+
if ( $this->is_advanced_fraud_tool_enabled() ) {
|
116 |
|
117 |
// enqueue braintree-data.js library
|
118 |
+
wp_enqueue_script( 'braintree-data', 'https://js.braintreegateway.com/v1/braintree-data.js', array( 'braintree-js-client' ), WC_Braintree::VERSION, true );
|
119 |
|
120 |
// adjust the script tag to add async attribute
|
121 |
add_filter( 'clean_url', array( $this, 'adjust_fraud_script_tag' ) );
|
123 |
// this script must be rendered to the page before the braintree-data.js library, hence priority 1
|
124 |
add_action( 'wp_print_footer_scripts', array( $this, 'render_fraud_js' ), 1 );
|
125 |
}
|
126 |
+
|
127 |
+
if ( $this->is_available() && $this->is_payment_form_page() ) {
|
128 |
+
|
129 |
+
parent::enqueue_gateway_assets();
|
130 |
+
|
131 |
+
wp_enqueue_script( 'braintree-js-hosted-fields', 'https://js.braintreegateway.com/web/3.26.0/js/hosted-fields.min.js', array(), WC_Braintree::VERSION, true );
|
132 |
+
|
133 |
+
if ( $this->is_3d_secure_enabled() ) {
|
134 |
+
wp_enqueue_script( 'braintree-js-3d-secure', 'https://js.braintreegateway.com/web/3.26.0/js/three-d-secure.min.js', array(), WC_Braintree::VERSION, true );
|
135 |
+
}
|
136 |
+
}
|
137 |
}
|
138 |
|
139 |
|
166 |
);
|
167 |
|
168 |
// Kount is only available for manual API connections
|
169 |
+
if ( $this->is_kount_supported() ) {
|
170 |
$fraud_tool_options['kount_direct'] = __( 'Kount Direct', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
171 |
}
|
172 |
|
573 |
*/
|
574 |
public function is_kount_direct_enabled() {
|
575 |
|
576 |
+
return $this->is_kount_supported() && 'kount_direct' === $this->get_fraud_tool();
|
577 |
}
|
578 |
|
579 |
|
590 |
}
|
591 |
|
592 |
|
593 |
+
/**
|
594 |
+
* Determines if Kount is supported.
|
595 |
+
*
|
596 |
+
* Currently limited to non-US shops who are not using Braintree Auth.
|
597 |
+
*
|
598 |
+
* @since 2.1.0
|
599 |
+
*
|
600 |
+
* @return bool
|
601 |
+
*/
|
602 |
+
public function is_kount_supported() {
|
603 |
+
|
604 |
+
return $this->is_connected_manually() && 'US' !== WC()->countries->get_base_country();
|
605 |
+
}
|
606 |
+
|
607 |
+
|
608 |
/** 3D Secure feature *****************************************************/
|
609 |
|
610 |
|
includes/class-wc-gateway-braintree-paypal.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/PayPal
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -38,6 +38,10 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
38 |
const PAYMENT_TYPE_PAYPAL = 'paypal';
|
39 |
|
40 |
|
|
|
|
|
|
|
|
|
41 |
/**
|
42 |
* Initialize the gateway
|
43 |
*
|
@@ -84,6 +88,28 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
84 |
|
85 |
// sanitize admin options before saving
|
86 |
add_filter( 'woocommerce_settings_api_sanitized_fields_braintree_paypal', array( $this, 'filter_admin_options' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
}
|
88 |
|
89 |
|
@@ -98,7 +124,6 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
98 |
$params = parent::get_gateway_js_localized_script_params();
|
99 |
|
100 |
if ( is_cart() ) {
|
101 |
-
$params['client_token'] = $this->generate_client_token();
|
102 |
$params['cart_nonce'] = wp_create_nonce( 'wc_' . $this->get_id() . '_cart_set_payment_method' );
|
103 |
$params['cart_handler_url'] = add_query_arg( 'wc-api', get_class( $this ), home_url() );
|
104 |
}
|
@@ -107,6 +132,18 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
107 |
}
|
108 |
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
/**
|
111 |
* Add PayPal-specific fields to the admin payment token editor
|
112 |
*
|
@@ -117,7 +154,7 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
117 |
|
118 |
$fields = array(
|
119 |
'id' => array(
|
120 |
-
'label' => __( 'Token ID', 'woocommerce-
|
121 |
'editable' => false,
|
122 |
'required' => true,
|
123 |
),
|
@@ -157,7 +194,7 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
157 |
*/
|
158 |
public function tweak_payment_methods_text( $translated_text, $raw_text, $text_domain ) {
|
159 |
|
160 |
-
if ( 'woocommerce-
|
161 |
|
162 |
if ( 'Use a new bank account' === $raw_text ) {
|
163 |
|
@@ -193,6 +230,30 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
193 |
}
|
194 |
|
195 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
/**
|
197 |
* Add PayPal method specific form fields, currently:
|
198 |
*
|
@@ -226,32 +287,6 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
226 |
}
|
227 |
|
228 |
|
229 |
-
/**
|
230 |
-
* Add PayPal specific data to the order, primarily for Subscriptions support
|
231 |
-
*
|
232 |
-
* @since 3.0.0
|
233 |
-
* @param \WC_Order|int $order order
|
234 |
-
* @return \WC_Order
|
235 |
-
*/
|
236 |
-
public function get_order( $order ) {
|
237 |
-
|
238 |
-
$order = parent::get_order( $order );
|
239 |
-
|
240 |
-
if ( $this->get_plugin()->is_subscriptions_active() ) {
|
241 |
-
|
242 |
-
$order_id = WC_Braintree_Framework\SV_WC_Order_Compatibility::get_prop( $order, 'id' );
|
243 |
-
|
244 |
-
$is_renewal = WC_Braintree_Framework\SV_WC_Plugin_Compatibility::is_wc_subscriptions_version_gte_2_0() ? wcs_order_contains_renewal( $order_id ) : WC_Subscriptions_Order::order_contains_subscription( $order_id );
|
245 |
-
|
246 |
-
if ( $is_renewal ) {
|
247 |
-
$order->payment->recurring = true;
|
248 |
-
}
|
249 |
-
}
|
250 |
-
|
251 |
-
return $order;
|
252 |
-
}
|
253 |
-
|
254 |
-
|
255 |
/**
|
256 |
* Gets the PayPal checkout locale based on the WordPress locale
|
257 |
*
|
@@ -509,4 +544,25 @@ class WC_Gateway_Braintree_PayPal extends WC_Gateway_Braintree {
|
|
509 |
}
|
510 |
|
511 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
}
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/PayPal
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
38 |
const PAYMENT_TYPE_PAYPAL = 'paypal';
|
39 |
|
40 |
|
41 |
+
/** @var bool whether cart checkout is enabled */
|
42 |
+
protected $enable_cart_checkout;
|
43 |
+
|
44 |
+
|
45 |
/**
|
46 |
* Initialize the gateway
|
47 |
*
|
88 |
|
89 |
// sanitize admin options before saving
|
90 |
add_filter( 'woocommerce_settings_api_sanitized_fields_braintree_paypal', array( $this, 'filter_admin_options' ) );
|
91 |
+
|
92 |
+
// get the client token via AJAX
|
93 |
+
add_filter( 'wp_ajax_wc_' . $this->get_id() . '_get_client_token', array( $this, 'ajax_get_client_token' ) );
|
94 |
+
add_filter( 'wp_ajax_nopriv_wc_' . $this->get_id() . '_get_client_token', array( $this, 'ajax_get_client_token' ) );
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Enqueues the PayPal JS scripts
|
100 |
+
*
|
101 |
+
* @since 2.1.0
|
102 |
+
* @see SV_WC_Payment_Gateway::enqueue_gateway_assets()
|
103 |
+
*/
|
104 |
+
public function enqueue_gateway_assets() {
|
105 |
+
|
106 |
+
if ( $this->is_available() && $this->is_payment_form_page() ) {
|
107 |
+
|
108 |
+
parent::enqueue_gateway_assets();
|
109 |
+
|
110 |
+
wp_enqueue_script( 'braintree-js-paypal', 'https://www.paypalobjects.com/api/checkout.js', array(), WC_Braintree::VERSION, true );
|
111 |
+
wp_enqueue_script( 'braintree-js-paypal-checkout', 'https://js.braintreegateway.com/web/3.26.0/js/paypal-checkout.min.js', array(), WC_Braintree::VERSION, true );
|
112 |
+
}
|
113 |
}
|
114 |
|
115 |
|
124 |
$params = parent::get_gateway_js_localized_script_params();
|
125 |
|
126 |
if ( is_cart() ) {
|
|
|
127 |
$params['cart_nonce'] = wp_create_nonce( 'wc_' . $this->get_id() . '_cart_set_payment_method' );
|
128 |
$params['cart_handler_url'] = add_query_arg( 'wc-api', get_class( $this ), home_url() );
|
129 |
}
|
132 |
}
|
133 |
|
134 |
|
135 |
+
/**
|
136 |
+
* Determines if the current page contains a payment form.
|
137 |
+
*
|
138 |
+
* @since 2.1.0
|
139 |
+
* @return bool
|
140 |
+
*/
|
141 |
+
public function is_payment_form_page() {
|
142 |
+
|
143 |
+
return parent::is_payment_form_page() || is_cart();
|
144 |
+
}
|
145 |
+
|
146 |
+
|
147 |
/**
|
148 |
* Add PayPal-specific fields to the admin payment token editor
|
149 |
*
|
154 |
|
155 |
$fields = array(
|
156 |
'id' => array(
|
157 |
+
'label' => __( 'Token ID', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
158 |
'editable' => false,
|
159 |
'required' => true,
|
160 |
),
|
194 |
*/
|
195 |
public function tweak_payment_methods_text( $translated_text, $raw_text, $text_domain ) {
|
196 |
|
197 |
+
if ( 'woocommerce-gateway-paypal-powered-by-braintree' === $text_domain ) {
|
198 |
|
199 |
if ( 'Use a new bank account' === $raw_text ) {
|
200 |
|
230 |
}
|
231 |
|
232 |
|
233 |
+
/**
|
234 |
+
* Adds any credit card authorization/charge admin fields, allowing the
|
235 |
+
* administrator to choose between performing authorizations or charges.
|
236 |
+
*
|
237 |
+
* Overridden to add the Cart Checkout setting in an appropriate spot.
|
238 |
+
*
|
239 |
+
* @since 2.1.0
|
240 |
+
*
|
241 |
+
* @param array $form_fields gateway form fields
|
242 |
+
* @return array
|
243 |
+
*/
|
244 |
+
protected function add_authorization_charge_form_fields( $form_fields ) {
|
245 |
+
|
246 |
+
$form_fields['enable_cart_checkout'] = array(
|
247 |
+
'title' => __( 'Enable Cart Checkout', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
248 |
+
'type' => 'checkbox',
|
249 |
+
'label' => __( 'Allow customers to check out with PayPal from the Cart page', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
250 |
+
'default' => 'yes',
|
251 |
+
);
|
252 |
+
|
253 |
+
return parent::add_authorization_charge_form_fields( $form_fields );
|
254 |
+
}
|
255 |
+
|
256 |
+
|
257 |
/**
|
258 |
* Add PayPal method specific form fields, currently:
|
259 |
*
|
287 |
}
|
288 |
|
289 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
/**
|
291 |
* Gets the PayPal checkout locale based on the WordPress locale
|
292 |
*
|
544 |
}
|
545 |
|
546 |
|
547 |
+
/**
|
548 |
+
* Determines if cart checkout is enabled.
|
549 |
+
*
|
550 |
+
* @since 2.1.0
|
551 |
+
*
|
552 |
+
* @return bool
|
553 |
+
*/
|
554 |
+
public function cart_checkout_enabled() {
|
555 |
+
|
556 |
+
/**
|
557 |
+
* Filters whether cart checkout is enabled.
|
558 |
+
*
|
559 |
+
* @since 2.1.0
|
560 |
+
*
|
561 |
+
* @param bool $enabled whether cart checkout is enabled in the settings
|
562 |
+
* @param \WC_Gateway_Braintree_PayPal $gateway gateway object
|
563 |
+
*/
|
564 |
+
return (bool) apply_filters( 'wc_braintree_paypal_cart_checkout_enabled', 'no' !== $this->enable_cart_checkout, $this );
|
565 |
+
}
|
566 |
+
|
567 |
+
|
568 |
}
|
includes/class-wc-gateway-braintree.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -105,7 +105,7 @@ class WC_Gateway_Braintree extends WC_Braintree_Framework\SV_WC_Payment_Gateway_
|
|
105 |
if ( $this->is_available() ) {
|
106 |
|
107 |
// braintree.js library
|
108 |
-
wp_enqueue_script( 'braintree-js', 'https://js.braintreegateway.com/
|
109 |
|
110 |
parent::enqueue_gateway_assets();
|
111 |
}
|
@@ -124,10 +124,10 @@ class WC_Gateway_Braintree extends WC_Braintree_Framework\SV_WC_Payment_Gateway_
|
|
124 |
|
125 |
if ( $this->is_payment_form_page() ) {
|
126 |
|
127 |
-
$params['
|
|
|
128 |
|
129 |
-
|
130 |
-
$params['client_token'] = $this->generate_client_token();
|
131 |
}
|
132 |
|
133 |
// add a cart payment nonce if available
|
@@ -140,25 +140,29 @@ class WC_Gateway_Braintree extends WC_Braintree_Framework\SV_WC_Payment_Gateway_
|
|
140 |
|
141 |
|
142 |
/**
|
143 |
-
*
|
144 |
*
|
145 |
-
* @
|
146 |
*
|
147 |
-
* @
|
148 |
*/
|
149 |
-
|
|
|
|
|
150 |
|
151 |
try {
|
152 |
|
153 |
$result = $this->get_api()->get_client_token( array( 'merchantAccountId' => $this->get_merchant_account_id() ) );
|
154 |
|
155 |
-
|
156 |
|
157 |
} catch ( WC_Braintree_Framework\SV_WC_Plugin_Exception $e ) {
|
158 |
|
159 |
$this->add_debug_message( $e->getMessage(), 'error' );
|
160 |
|
161 |
-
|
|
|
|
|
162 |
}
|
163 |
}
|
164 |
|
@@ -221,10 +225,32 @@ class WC_Gateway_Braintree extends WC_Braintree_Framework\SV_WC_Payment_Gateway_
|
|
221 |
}
|
222 |
|
223 |
// dynamic descriptors
|
224 |
-
$order->payment->dynamic_descriptors
|
225 |
-
|
226 |
-
|
227 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
|
229 |
// test amount when in sandbox mode
|
230 |
if ( $this->is_test_environment() && ( $test_amount = WC_Braintree_Framework\SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-test-amount' ) ) ) {
|
@@ -427,7 +453,7 @@ class WC_Gateway_Braintree extends WC_Braintree_Framework\SV_WC_Payment_Gateway_
|
|
427 |
'type' => 'text',
|
428 |
'class' => 'js-dynamic-descriptor-phone',
|
429 |
'desc_tip' => __( 'The value in the phone number field of a customer\'s statement. Phone must be exactly 10 characters and can only contain numbers, dashes, parentheses and periods.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
430 |
-
'custom_attributes' => array( 'maxlength' =>
|
431 |
),
|
432 |
|
433 |
'url_dynamic_descriptor' => array(
|
@@ -1364,6 +1390,48 @@ class WC_Gateway_Braintree extends WC_Braintree_Framework\SV_WC_Payment_Gateway_
|
|
1364 |
}
|
1365 |
|
1366 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1367 |
/**
|
1368 |
* Return the name dynamic descriptor
|
1369 |
*
|
@@ -1377,6 +1445,42 @@ class WC_Gateway_Braintree extends WC_Braintree_Framework\SV_WC_Payment_Gateway_
|
|
1377 |
}
|
1378 |
|
1379 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1380 |
/**
|
1381 |
* Return the phone dynamic descriptor
|
1382 |
*
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
105 |
if ( $this->is_available() ) {
|
106 |
|
107 |
// braintree.js library
|
108 |
+
wp_enqueue_script( 'braintree-js-client', 'https://js.braintreegateway.com/web/3.26.0/js/client.min.js', array(), WC_Braintree::VERSION, true );
|
109 |
|
110 |
parent::enqueue_gateway_assets();
|
111 |
}
|
124 |
|
125 |
if ( $this->is_payment_form_page() ) {
|
126 |
|
127 |
+
$params['integration_error_message'] = __( 'Currently unavailable. Please try a different payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
128 |
+
$params['payment_error_message'] = __( 'Oops, something went wrong. Please try a different payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
129 |
|
130 |
+
$params['ajax_url'] = admin_url( 'admin-ajax.php' );
|
|
|
131 |
}
|
132 |
|
133 |
// add a cart payment nonce if available
|
140 |
|
141 |
|
142 |
/**
|
143 |
+
* Gets a client authorization token via AJAX.
|
144 |
*
|
145 |
+
* @internal
|
146 |
*
|
147 |
+
* @since 2.1.0
|
148 |
*/
|
149 |
+
public function ajax_get_client_token() {
|
150 |
+
|
151 |
+
check_ajax_referer( 'wc_' . $this->get_id() . '_get_client_token', 'nonce' );
|
152 |
|
153 |
try {
|
154 |
|
155 |
$result = $this->get_api()->get_client_token( array( 'merchantAccountId' => $this->get_merchant_account_id() ) );
|
156 |
|
157 |
+
wp_send_json_success( $result->get_client_token() );
|
158 |
|
159 |
} catch ( WC_Braintree_Framework\SV_WC_Plugin_Exception $e ) {
|
160 |
|
161 |
$this->add_debug_message( $e->getMessage(), 'error' );
|
162 |
|
163 |
+
wp_send_json_error( array(
|
164 |
+
'message' => $e->getMessage(),
|
165 |
+
) );
|
166 |
}
|
167 |
}
|
168 |
|
225 |
}
|
226 |
|
227 |
// dynamic descriptors
|
228 |
+
$order->payment->dynamic_descriptors = new stdClass();
|
229 |
+
|
230 |
+
// only set the name descriptor if it is valid
|
231 |
+
if ( $this->get_name_dynamic_descriptor() && $this->is_name_dynamic_descriptor_valid() ) {
|
232 |
+
$order->payment->dynamic_descriptors->name = $this->get_name_dynamic_descriptor();
|
233 |
+
}
|
234 |
+
|
235 |
+
// only set the phone descriptor if it is valid
|
236 |
+
if ( $this->get_phone_dynamic_descriptor() && $this->is_phone_dynamic_descriptor_valid() ) {
|
237 |
+
$order->payment->dynamic_descriptors->phone = $this->get_phone_dynamic_descriptor();
|
238 |
+
}
|
239 |
+
|
240 |
+
// the URL descriptor doesn't have any specific validation, so just truncate it if needed
|
241 |
+
$order->payment->dynamic_descriptors->url = WC_Braintree_Framework\SV_WC_Helper::str_truncate( $this->get_url_dynamic_descriptor(), 13, '' );
|
242 |
+
|
243 |
+
// add the recurring flag to Subscriptions renewal orders
|
244 |
+
if ( $this->get_plugin()->is_subscriptions_active() ) {
|
245 |
+
|
246 |
+
$order_id = WC_Braintree_Framework\SV_WC_Order_Compatibility::get_prop( $order, 'id' );
|
247 |
+
|
248 |
+
$is_renewal = WC_Braintree_Framework\SV_WC_Plugin_Compatibility::is_wc_subscriptions_version_gte_2_0() ? wcs_order_contains_renewal( $order_id ) : \WC_Subscriptions_Order::order_contains_subscription( $order_id );
|
249 |
+
|
250 |
+
if ( $is_renewal ) {
|
251 |
+
$order->payment->recurring = true;
|
252 |
+
}
|
253 |
+
}
|
254 |
|
255 |
// test amount when in sandbox mode
|
256 |
if ( $this->is_test_environment() && ( $test_amount = WC_Braintree_Framework\SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-test-amount' ) ) ) {
|
453 |
'type' => 'text',
|
454 |
'class' => 'js-dynamic-descriptor-phone',
|
455 |
'desc_tip' => __( 'The value in the phone number field of a customer\'s statement. Phone must be exactly 10 characters and can only contain numbers, dashes, parentheses and periods.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
456 |
+
'custom_attributes' => array( 'maxlength' => 14 ),
|
457 |
),
|
458 |
|
459 |
'url_dynamic_descriptor' => array(
|
1390 |
}
|
1391 |
|
1392 |
|
1393 |
+
/**
|
1394 |
+
* Determines if a dynamic descriptor name value is valid.
|
1395 |
+
*
|
1396 |
+
* @since 2.1.0
|
1397 |
+
*
|
1398 |
+
* @param string $value name to check. Defaults to the gateway's configured setting
|
1399 |
+
* @return bool
|
1400 |
+
*/
|
1401 |
+
public function is_name_dynamic_descriptor_valid( $value = '' ) {
|
1402 |
+
|
1403 |
+
if ( ! $value ) {
|
1404 |
+
$value = $this->get_name_dynamic_descriptor();
|
1405 |
+
}
|
1406 |
+
|
1407 |
+
// missing asterisk
|
1408 |
+
if ( false === strpos( $value, '*' ) ) {
|
1409 |
+
return false;
|
1410 |
+
}
|
1411 |
+
|
1412 |
+
$parts = explode( '*', $value );
|
1413 |
+
|
1414 |
+
$company = $parts[0];
|
1415 |
+
$product = $parts[1];
|
1416 |
+
|
1417 |
+
switch ( strlen( $company ) ) {
|
1418 |
+
|
1419 |
+
case 3: $product_length = 18; break;
|
1420 |
+
case 7: $product_length = 14; break;
|
1421 |
+
case 12: $product_length = 9; break;
|
1422 |
+
|
1423 |
+
// if any other length, bail
|
1424 |
+
default: return false;
|
1425 |
+
}
|
1426 |
+
|
1427 |
+
if ( $product > $product_length ) {
|
1428 |
+
return false;
|
1429 |
+
}
|
1430 |
+
|
1431 |
+
return true;
|
1432 |
+
}
|
1433 |
+
|
1434 |
+
|
1435 |
/**
|
1436 |
* Return the name dynamic descriptor
|
1437 |
*
|
1445 |
}
|
1446 |
|
1447 |
|
1448 |
+
/**
|
1449 |
+
* Determines if a phone dynamic descriptor value is valid.
|
1450 |
+
*
|
1451 |
+
* The value must be 14 characters or less, have exactly 10 digits, and
|
1452 |
+
* otherwise contain only numbers, dashes, parentheses, or periods.
|
1453 |
+
*
|
1454 |
+
* @since 2.1.0
|
1455 |
+
*
|
1456 |
+
* @param string $value value to check. Defaults to the gateway's configured setting
|
1457 |
+
* @return bool
|
1458 |
+
*/
|
1459 |
+
public function is_phone_dynamic_descriptor_valid( $value = '' ) {
|
1460 |
+
|
1461 |
+
if ( ! $value ) {
|
1462 |
+
$value = $this->get_phone_dynamic_descriptor();
|
1463 |
+
}
|
1464 |
+
|
1465 |
+
// max 14 total characters
|
1466 |
+
if ( strlen( $value ) > 14 ) {
|
1467 |
+
return false;
|
1468 |
+
}
|
1469 |
+
|
1470 |
+
// check for invalid characters
|
1471 |
+
if ( $invalid_characters = preg_replace( '/[\d-().]/', '', $value ) ) {
|
1472 |
+
return false;
|
1473 |
+
}
|
1474 |
+
|
1475 |
+
// must have exactly 10 numbers
|
1476 |
+
if ( strlen( preg_replace( '/[^0-9]/', '', $value ) ) !== 10 ) {
|
1477 |
+
return false;
|
1478 |
+
}
|
1479 |
+
|
1480 |
+
return true;
|
1481 |
+
}
|
1482 |
+
|
1483 |
+
|
1484 |
/**
|
1485 |
* Return the phone dynamic descriptor
|
1486 |
*
|
includes/payment-forms/abstract-wc-braintree-payment-form.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Form
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -101,10 +101,11 @@ abstract class WC_Braintree_Payment_Form extends WC_Braintree_Framework\SV_WC_Pa
|
|
101 |
|
102 |
// defaults for both gateways
|
103 |
$params = array_merge( array(
|
104 |
-
'id'
|
105 |
-
'id_dasherized'
|
106 |
-
'debug'
|
107 |
-
'type'
|
|
|
108 |
), $this->get_payment_form_handler_js_params() );
|
109 |
|
110 |
$handler_class = $this->get_gateway()->is_credit_card_gateway() ? 'WC_Braintree_Credit_Card_Payment_Form_Handler' : 'WC_Braintree_PayPal_Payment_Form_Handler';
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Form
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
101 |
|
102 |
// defaults for both gateways
|
103 |
$params = array_merge( array(
|
104 |
+
'id' => $this->get_gateway()->get_id(),
|
105 |
+
'id_dasherized' => $this->get_gateway()->get_id_dasherized(),
|
106 |
+
'debug' => $this->get_gateway()->debug_log(),
|
107 |
+
'type' => str_replace( '-', '_', $this->get_gateway()->get_payment_type() ),
|
108 |
+
'client_token_nonce' => wp_create_nonce( 'wc_' . $this->get_gateway()->get_id() . '_get_client_token' ),
|
109 |
), $this->get_payment_form_handler_js_params() );
|
110 |
|
111 |
$handler_class = $this->get_gateway()->is_credit_card_gateway() ? 'WC_Braintree_Credit_Card_Payment_Form_Handler' : 'WC_Braintree_PayPal_Payment_Form_Handler';
|
includes/payment-forms/class-wc-braintree-hosted-fields-payment-form.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Form/Hosted-Fields
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -101,7 +101,7 @@ class WC_Braintree_Hosted_Fields_Payment_Form extends WC_Braintree_Payment_Form
|
|
101 |
?>
|
102 |
<div class="form-row <?php echo implode( ' ', array_map( 'sanitize_html_class', $field['class'] ) ); ?>">
|
103 |
<label for="<?php echo esc_attr( $field['id'] ) . '-hosted'; ?>"><?php echo esc_html( $field['label'] ); if ( $field['required'] ) : ?><abbr class="required" title="required"> *</abbr><?php endif; ?></label>
|
104 |
-
<div id="<?php echo esc_attr( $field['id'] ) . '-hosted'; ?>" class="<?php echo implode( ' ', array_map( 'sanitize_html_class', $field['input_class'] ) ); ?>"></div>
|
105 |
</div>
|
106 |
<?php
|
107 |
}
|
@@ -124,10 +124,37 @@ class WC_Braintree_Hosted_Fields_Payment_Form extends WC_Braintree_Payment_Form
|
|
124 |
'failure_message' => __( 'We cannot process your order with the payment information that you provided. Please use an alternate payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
125 |
),
|
126 |
'hosted_fields_styles' => $this->get_hosted_fields_styles(),
|
|
|
127 |
);
|
128 |
}
|
129 |
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
/**
|
132 |
* Get the hosted fields styles in an associative array. These are used
|
133 |
* by the Braintree SDK to apply to the inputs inside the hosted field iframes.
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Form/Hosted-Fields
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
101 |
?>
|
102 |
<div class="form-row <?php echo implode( ' ', array_map( 'sanitize_html_class', $field['class'] ) ); ?>">
|
103 |
<label for="<?php echo esc_attr( $field['id'] ) . '-hosted'; ?>"><?php echo esc_html( $field['label'] ); if ( $field['required'] ) : ?><abbr class="required" title="required"> *</abbr><?php endif; ?></label>
|
104 |
+
<div id="<?php echo esc_attr( $field['id'] ) . '-hosted'; ?>" class="<?php echo implode( ' ', array_map( 'sanitize_html_class', $field['input_class'] ) ); ?>" data-placeholder="<?php echo isset( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : ''; ?>"></div>
|
105 |
</div>
|
106 |
<?php
|
107 |
}
|
124 |
'failure_message' => __( 'We cannot process your order with the payment information that you provided. Please use an alternate payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
125 |
),
|
126 |
'hosted_fields_styles' => $this->get_hosted_fields_styles(),
|
127 |
+
'enabled_card_types' => $this->get_enabled_card_types(),
|
128 |
);
|
129 |
}
|
130 |
|
131 |
|
132 |
+
/**
|
133 |
+
* Gets the enabled card types in the Braintree SDK format.
|
134 |
+
*
|
135 |
+
* @since 2.1.0
|
136 |
+
*
|
137 |
+
* @return array
|
138 |
+
*/
|
139 |
+
protected function get_enabled_card_types() {
|
140 |
+
|
141 |
+
$types = array_map( array( '\\SkyVerge\\Plugin_Framework\\SV_WC_Payment_Gateway_Helper', 'normalize_card_type' ), $this->get_gateway()->get_card_types() );
|
142 |
+
|
143 |
+
// The Braintree SDK has its own strings for a few card types that we need to match
|
144 |
+
$types = str_replace( array(
|
145 |
+
WC_Braintree_Framework\SV_WC_Payment_Gateway_Helper::CARD_TYPE_AMEX,
|
146 |
+
WC_Braintree_Framework\SV_WC_Payment_Gateway_Helper::CARD_TYPE_DINERSCLUB,
|
147 |
+
WC_Braintree_Framework\SV_WC_Payment_Gateway_Helper::CARD_TYPE_MASTERCARD,
|
148 |
+
), array(
|
149 |
+
'american-express',
|
150 |
+
'diners-club',
|
151 |
+
'master-card',
|
152 |
+
), $types );
|
153 |
+
|
154 |
+
return $types;
|
155 |
+
}
|
156 |
+
|
157 |
+
|
158 |
/**
|
159 |
* Get the hosted fields styles in an associative array. These are used
|
160 |
* by the Braintree SDK to apply to the inputs inside the hosted field iframes.
|
includes/payment-forms/class-wc-braintree-paypal-payment-form.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Form/PayPal
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
@@ -43,9 +43,35 @@ class WC_Braintree_PayPal_Payment_Form extends WC_Braintree_Payment_Form {
|
|
43 |
*/
|
44 |
protected function get_payment_form_handler_js_params() {
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
return array(
|
|
|
47 |
'must_login_message' => __( 'Please click the blue "PayPal" button below to log into your PayPal account before placing your order.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
48 |
-
'must_login_add_method_message' => __( 'Please click the blue "PayPal" button below to log into your PayPal account before adding your payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' )
|
|
|
49 |
);
|
50 |
}
|
51 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Payment-Form/PayPal
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
43 |
*/
|
44 |
protected function get_payment_form_handler_js_params() {
|
45 |
|
46 |
+
$default_button_styles = array(
|
47 |
+
'label' => 'pay',
|
48 |
+
'size' => 'responsive',
|
49 |
+
'shape' => 'pill',
|
50 |
+
'color' => 'gold',
|
51 |
+
);
|
52 |
+
|
53 |
+
// tweak the styles a bit for better display on the Add Payment Method page
|
54 |
+
if ( is_add_payment_method_page() ) {
|
55 |
+
$default_button_styles['label'] = 'paypal';
|
56 |
+
$default_button_styles['size'] = 'medium';
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Filters the PayPal button style parameters.
|
61 |
+
*
|
62 |
+
* See https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/customize-button/
|
63 |
+
*
|
64 |
+
* @since 2.1.0
|
65 |
+
*
|
66 |
+
* @param array $styles style parameters
|
67 |
+
*/
|
68 |
+
$button_styles = apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_button_styles', $default_button_styles );
|
69 |
+
|
70 |
return array(
|
71 |
+
'is_test_environment' => $this->get_gateway()->is_test_environment(),
|
72 |
'must_login_message' => __( 'Please click the blue "PayPal" button below to log into your PayPal account before placing your order.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
73 |
+
'must_login_add_method_message' => __( 'Please click the blue "PayPal" button below to log into your PayPal account before adding your payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
74 |
+
'button_styles' => wp_parse_args( $button_styles, $default_button_styles ), // ensure all expected parameters are present after filtering to avoid JS errors
|
75 |
);
|
76 |
}
|
77 |
|
includes/views/admin-html-braintree-auth.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Auth
|
20 |
* @author WooCommerce
|
21 |
-
* @copyright Copyright: (c) 2016-
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
18 |
*
|
19 |
* @package WC-Braintree/Gateway/Auth
|
20 |
* @author WooCommerce
|
21 |
+
* @copyright Copyright: (c) 2016-2018, Automattic, Inc.
|
22 |
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
|
23 |
*/
|
24 |
|
lib/Braintree.php
CHANGED
@@ -2,24 +2,24 @@
|
|
2 |
/**
|
3 |
* Braintree PHP Library
|
4 |
* Creates class_aliases for old class names replaced by PSR-4 Namespaces
|
5 |
-
*
|
6 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
7 |
*/
|
8 |
|
9 |
-
require_once('autoload.php');
|
10 |
|
11 |
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
|
12 |
throw new Braintree_Exception('PHP version >= 5.4.0 required');
|
13 |
}
|
14 |
|
|
|
15 |
|
16 |
-
function requireDependencies() {
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
21 |
}
|
22 |
}
|
23 |
}
|
24 |
|
25 |
-
requireDependencies();
|
2 |
/**
|
3 |
* Braintree PHP Library
|
4 |
* Creates class_aliases for old class names replaced by PSR-4 Namespaces
|
|
|
|
|
5 |
*/
|
6 |
|
7 |
+
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'autoload.php');
|
8 |
|
9 |
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
|
10 |
throw new Braintree_Exception('PHP version >= 5.4.0 required');
|
11 |
}
|
12 |
|
13 |
+
class Braintree {
|
14 |
|
15 |
+
public static function requireDependencies() {
|
16 |
+
$requiredExtensions = ['xmlwriter', 'openssl', 'dom', 'hash', 'curl'];
|
17 |
+
foreach ($requiredExtensions AS $ext) {
|
18 |
+
if (!extension_loaded($ext)) {
|
19 |
+
throw new Braintree_Exception('The Braintree library requires the ' . $ext . ' extension.');
|
20 |
+
}
|
21 |
}
|
22 |
}
|
23 |
}
|
24 |
|
25 |
+
Braintree::requireDependencies();
|
lib/Braintree/AccountUpdaterDailyReport.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Creates an instance of AccountUpdaterDailyReport
|
6 |
+
*
|
7 |
+
*
|
8 |
+
* @package Braintree
|
9 |
+
*
|
10 |
+
* @property-read string $reportUrl
|
11 |
+
* @property-read date $reportDate
|
12 |
+
*/
|
13 |
+
class AccountUpdaterDailyReport extends Base
|
14 |
+
{
|
15 |
+
protected $_attributes = [];
|
16 |
+
|
17 |
+
protected function _initialize($disputeAttribs)
|
18 |
+
{
|
19 |
+
$this->_attributes = $disputeAttribs;
|
20 |
+
}
|
21 |
+
|
22 |
+
public static function factory($attributes)
|
23 |
+
{
|
24 |
+
$instance = new self();
|
25 |
+
$instance->_initialize($attributes);
|
26 |
+
return $instance;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function __toString()
|
30 |
+
{
|
31 |
+
$display = [
|
32 |
+
'reportDate', 'reportUrl'
|
33 |
+
];
|
34 |
+
|
35 |
+
$displayAttributes = [];
|
36 |
+
foreach ($display AS $attrib) {
|
37 |
+
$displayAttributes[$attrib] = $this->$attrib;
|
38 |
+
}
|
39 |
+
return __CLASS__ . '[' .
|
40 |
+
Util::attributesToString($displayAttributes) .']';
|
41 |
+
}
|
42 |
+
}
|
43 |
+
class_alias('Braintree\AccountUpdaterDailyReport', 'Braintree_AccountUpdaterDailyReport');
|
lib/Braintree/AchMandate.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Braintree AchMandate module
|
6 |
+
* PHP Version 5
|
7 |
+
*
|
8 |
+
* @package Braintree
|
9 |
+
*
|
10 |
+
* @property-read string $text
|
11 |
+
* @property-read string $acceptedAt
|
12 |
+
*/
|
13 |
+
class AchMandate extends Base
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* create a printable representation of the object as:
|
17 |
+
* ClassName[property=value, property=value]
|
18 |
+
* @ignore
|
19 |
+
* @return string
|
20 |
+
*/
|
21 |
+
public function __toString()
|
22 |
+
{
|
23 |
+
return __CLASS__ . '[' .
|
24 |
+
Util::attributesToString($this->_attributes) . ']';
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* sets instance properties from an array of values
|
29 |
+
*
|
30 |
+
* @ignore
|
31 |
+
* @access protected
|
32 |
+
* @param array $achAttribs array of achMandate data
|
33 |
+
* @return void
|
34 |
+
*/
|
35 |
+
protected function _initialize($achAttribs)
|
36 |
+
{
|
37 |
+
// set the attributes
|
38 |
+
$this->_attributes = $achAttribs;
|
39 |
+
$date = new \DateTime($this->acceptedAt);
|
40 |
+
$this->_set('acceptedAt', $date);
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* factory method: returns an instance of AchMandate
|
45 |
+
* to the requesting method, with populated properties
|
46 |
+
* @ignore
|
47 |
+
* @return AchMandate
|
48 |
+
*/
|
49 |
+
public static function factory($attributes)
|
50 |
+
{
|
51 |
+
$instance = new self();
|
52 |
+
$instance->_initialize($attributes);
|
53 |
+
return $instance;
|
54 |
+
|
55 |
+
}
|
56 |
+
}
|
57 |
+
class_alias('Braintree\AchMandate', 'Braintree_Mandate');
|
lib/Braintree/Address.php
CHANGED
@@ -11,7 +11,6 @@ namespace Braintree;
|
|
11 |
* as the shipping address when creating a Transaction.
|
12 |
*
|
13 |
* @package Braintree
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*
|
16 |
* @property-read string $company
|
17 |
* @property-read string $countryName
|
11 |
* as the shipping address when creating a Transaction.
|
12 |
*
|
13 |
* @package Braintree
|
|
|
14 |
*
|
15 |
* @property-read string $company
|
16 |
* @property-read string $countryName
|
lib/Braintree/AddressGateway.php
CHANGED
@@ -13,7 +13,6 @@ use InvalidArgumentException;
|
|
13 |
* as the shipping address when creating a Transaction.
|
14 |
*
|
15 |
* @package Braintree
|
16 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
17 |
*/
|
18 |
class AddressGateway
|
19 |
{
|
@@ -64,10 +63,16 @@ class AddressGateway
|
|
64 |
|
65 |
$this->_validateCustomerId($customerId);
|
66 |
unset($attribs['customerId']);
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
/**
|
@@ -274,7 +279,6 @@ class AddressGateway
|
|
274 |
$response = $this->_http->post($fullPath, $params);
|
275 |
|
276 |
return $this->_verifyGatewayResponse($response);
|
277 |
-
|
278 |
}
|
279 |
|
280 |
/**
|
13 |
* as the shipping address when creating a Transaction.
|
14 |
*
|
15 |
* @package Braintree
|
|
|
16 |
*/
|
17 |
class AddressGateway
|
18 |
{
|
63 |
|
64 |
$this->_validateCustomerId($customerId);
|
65 |
unset($attribs['customerId']);
|
66 |
+
try {
|
67 |
+
return $this->_doCreate(
|
68 |
+
'/customers/' . $customerId . '/addresses',
|
69 |
+
['address' => $attribs]
|
70 |
+
);
|
71 |
+
} catch (Exception\NotFound $e) {
|
72 |
+
throw new Exception\NotFound(
|
73 |
+
'Customer ' . $customerId . ' not found.'
|
74 |
+
);
|
75 |
+
}
|
76 |
}
|
77 |
|
78 |
/**
|
279 |
$response = $this->_http->post($fullPath, $params);
|
280 |
|
281 |
return $this->_verifyGatewayResponse($response);
|
|
|
282 |
}
|
283 |
|
284 |
/**
|
lib/Braintree/AmexExpressCheckoutCard.php
CHANGED
@@ -11,7 +11,6 @@ namespace Braintree;
|
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*
|
16 |
* @property-read string $createdAt
|
17 |
* @property-read string $default
|
@@ -21,7 +20,6 @@ namespace Braintree;
|
|
21 |
* @property-read string $bin
|
22 |
* @property-read string $cardMemberExpiryDate
|
23 |
* @property-read string $cardMemberNumber
|
24 |
-
* @property-read string $cardType
|
25 |
* @property-read string $sourceDescription
|
26 |
* @property-read string $token
|
27 |
* @property-read string $imageUrl
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
|
|
14 |
*
|
15 |
* @property-read string $createdAt
|
16 |
* @property-read string $default
|
20 |
* @property-read string $bin
|
21 |
* @property-read string $cardMemberExpiryDate
|
22 |
* @property-read string $cardMemberNumber
|
|
|
23 |
* @property-read string $sourceDescription
|
24 |
* @property-read string $token
|
25 |
* @property-read string $imageUrl
|
lib/Braintree/AndroidPayCard.php
CHANGED
@@ -11,7 +11,6 @@ namespace Braintree;
|
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*
|
16 |
* @property-read string $bin
|
17 |
* @property-read string $cardType
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
|
|
14 |
*
|
15 |
* @property-read string $bin
|
16 |
* @property-read string $cardType
|
lib/Braintree/ApplePayCard.php
CHANGED
@@ -11,7 +11,6 @@ namespace Braintree;
|
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*
|
16 |
* @property-read string $cardType
|
17 |
* @property-read string $createdAt
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
|
|
14 |
*
|
15 |
* @property-read string $cardType
|
16 |
* @property-read string $createdAt
|
lib/Braintree/ApplePayGateway.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Braintree ApplePayGateway module
|
6 |
+
* Manages Apple Pay for Web
|
7 |
+
*
|
8 |
+
* @package Braintree
|
9 |
+
* @category Resources
|
10 |
+
*/
|
11 |
+
class ApplePayGateway
|
12 |
+
{
|
13 |
+
private $_gateway;
|
14 |
+
private $_config;
|
15 |
+
private $_http;
|
16 |
+
|
17 |
+
public function __construct($gateway)
|
18 |
+
{
|
19 |
+
$this->_gateway = $gateway;
|
20 |
+
$this->_config = $gateway->config;
|
21 |
+
$this->_config->assertHasAccessTokenOrKeys();
|
22 |
+
$this->_http = new Http($gateway->config);
|
23 |
+
}
|
24 |
+
|
25 |
+
public function registerDomain($domain)
|
26 |
+
{
|
27 |
+
$path = $this->_config->merchantPath() . '/processing/apple_pay/validate_domains';
|
28 |
+
$response = $this->_http->post($path, ['url' => $domain]);
|
29 |
+
if (array_key_exists('response', $response) && $response['response']['success'])
|
30 |
+
{
|
31 |
+
return new Result\Successful;
|
32 |
+
}
|
33 |
+
else if (array_key_exists('apiErrorResponse', $response))
|
34 |
+
{
|
35 |
+
return new Result\Error($response['apiErrorResponse']);
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
public function unregisterDomain($domain)
|
40 |
+
{
|
41 |
+
$path = $this->_config->merchantPath() . '/processing/apple_pay/unregister_domain';
|
42 |
+
$this->_http->delete($path, ['url' => $domain]);
|
43 |
+
return new Result\Successful;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function registeredDomains()
|
47 |
+
{
|
48 |
+
$path = $this->_config->merchantPath() . '/processing/apple_pay/registered_domains';
|
49 |
+
$response = $this->_http->get($path);
|
50 |
+
if (array_key_exists('response', $response) && array_key_exists('domains', $response['response']))
|
51 |
+
{
|
52 |
+
$options = ApplePayOptions::factory($response['response']);
|
53 |
+
return new Result\Successful($options, 'applePayOptions');
|
54 |
+
}
|
55 |
+
else if (array_key_exists('apiErrorResponse', $response))
|
56 |
+
{
|
57 |
+
return new Result\Error($response['apiErrorResponse']);
|
58 |
+
}
|
59 |
+
else
|
60 |
+
{
|
61 |
+
throw new Exception\Unexpected('expected response or apiErrorResponse');
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
class_alias('Braintree\ApplePayGateway', 'Braintree_ApplePayGateway');
|
lib/Braintree/ApplePayOptions.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Braintree ApplePayOptions module
|
6 |
+
* Manages configuration and options for Apple Pay
|
7 |
+
*
|
8 |
+
* @package Braintree
|
9 |
+
* @category Resources
|
10 |
+
*
|
11 |
+
* @property-read array $domains
|
12 |
+
*/
|
13 |
+
|
14 |
+
class ApplePayOptions extends Base
|
15 |
+
{
|
16 |
+
public static function factory($attributes)
|
17 |
+
{
|
18 |
+
$instance = new self();
|
19 |
+
$instance->_initialize($attributes);
|
20 |
+
return $instance;
|
21 |
+
}
|
22 |
+
|
23 |
+
protected function _initialize($attributes)
|
24 |
+
{
|
25 |
+
$this->_attributes = $attributes;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
class_alias('Braintree\ApplePayOptions', 'Braintree_ApplePayOptions');
|
lib/Braintree/AuthorizationAdjustment.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Creates an instance of AuthorizationAdjustment as returned from a transaction
|
6 |
+
*
|
7 |
+
* @package Braintree
|
8 |
+
*
|
9 |
+
* @property-read string $amount
|
10 |
+
* @property-read DateTime $timestamp
|
11 |
+
* @property-read boolean $success
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
|
15 |
+
class AuthorizationAdjustment extends Base
|
16 |
+
{
|
17 |
+
public static function factory($attributes)
|
18 |
+
{
|
19 |
+
$instance = new self();
|
20 |
+
$instance->_initialize($attributes);
|
21 |
+
|
22 |
+
return $instance;
|
23 |
+
}
|
24 |
+
|
25 |
+
protected function _initialize($authorizationAdjustmentAttribs)
|
26 |
+
{
|
27 |
+
$this->_attributes = $authorizationAdjustmentAttribs;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function __toString()
|
31 |
+
{
|
32 |
+
return __CLASS__ . '[' . Util::attributesToString($this->_attributes) . ']';
|
33 |
+
}
|
34 |
+
}
|
35 |
+
class_alias('Braintree\AuthorizationAdjustment', 'Braintree_Authorization_Adjustment');
|
lib/Braintree/Base.php
CHANGED
@@ -8,8 +8,6 @@ namespace Braintree;
|
|
8 |
* Provides methods to child classes. This class cannot be instantiated.
|
9 |
*
|
10 |
* PHP version 5
|
11 |
-
*
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*/
|
14 |
abstract class Base
|
15 |
{
|
8 |
* Provides methods to child classes. This class cannot be instantiated.
|
9 |
*
|
10 |
* PHP version 5
|
|
|
|
|
11 |
*/
|
12 |
abstract class Base
|
13 |
{
|
lib/Braintree/ClientToken.php
CHANGED
@@ -11,7 +11,7 @@ class ClientToken
|
|
11 |
/**
|
12 |
*
|
13 |
* @param array $params
|
14 |
-
* @return
|
15 |
*/
|
16 |
public static function generate($params=[])
|
17 |
{
|
11 |
/**
|
12 |
*
|
13 |
* @param array $params
|
14 |
+
* @return string
|
15 |
*/
|
16 |
public static function generate($params=[])
|
17 |
{
|
lib/Braintree/ClientTokenGateway.php
CHANGED
@@ -53,7 +53,7 @@ class ClientTokenGateway
|
|
53 |
* @ignore
|
54 |
* @param var $url
|
55 |
* @param array $params
|
56 |
-
* @return
|
57 |
*/
|
58 |
public function _doGenerate($subPath, $params)
|
59 |
{
|
53 |
* @ignore
|
54 |
* @param var $url
|
55 |
* @param array $params
|
56 |
+
* @return string
|
57 |
*/
|
58 |
public function _doGenerate($subPath, $params)
|
59 |
{
|
lib/Braintree/CoinbaseAccount.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
|
12 |
/**
|
@@ -17,7 +16,6 @@ namespace Braintree;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @category Resources
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
*
|
22 |
* @property-read string $customerId
|
23 |
* @property-read string $token
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
|
|
9 |
*/
|
10 |
|
11 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @category Resources
|
|
|
19 |
*
|
20 |
* @property-read string $customerId
|
21 |
* @property-read string $token
|
lib/Braintree/Collection.php
CHANGED
@@ -17,7 +17,6 @@ use ArrayIterator;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @subpackage Utility
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
*/
|
22 |
|
23 |
class Collection implements Countable, IteratorAggregate, ArrayAccess
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @subpackage Utility
|
|
|
20 |
*/
|
21 |
|
22 |
class Collection implements Countable, IteratorAggregate, ArrayAccess
|
lib/Braintree/Configuration.php
CHANGED
@@ -7,7 +7,6 @@ namespace Braintree;
|
|
7 |
*
|
8 |
* @package Braintree
|
9 |
* @subpackage Utility
|
10 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
11 |
*/
|
12 |
|
13 |
class Configuration
|
@@ -24,6 +23,11 @@ class Configuration
|
|
24 |
private $_proxyHost = null;
|
25 |
private $_proxyPort = null;
|
26 |
private $_proxyType = null;
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
/**
|
29 |
* Braintree API version to use
|
@@ -110,6 +114,36 @@ class Configuration
|
|
110 |
self::$global->setPrivateKey($value);
|
111 |
}
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
/**
|
114 |
* Sets or gets the proxy host to use for connecting to Braintree
|
115 |
*
|
@@ -165,6 +199,49 @@ class Configuration
|
|
165 |
return !empty($proxyHost) && !empty($proxyPort);
|
166 |
}
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
public static function assertGlobalHasAccessTokenOrKeys()
|
169 |
{
|
170 |
self::$global->assertHasAccessTokenOrKeys();
|
@@ -297,6 +374,56 @@ class Configuration
|
|
297 |
return $this->_proxyType;
|
298 |
}
|
299 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
public function getAccessToken()
|
301 |
{
|
302 |
return $this->_accessToken;
|
7 |
*
|
8 |
* @package Braintree
|
9 |
* @subpackage Utility
|
|
|
10 |
*/
|
11 |
|
12 |
class Configuration
|
23 |
private $_proxyHost = null;
|
24 |
private $_proxyPort = null;
|
25 |
private $_proxyType = null;
|
26 |
+
private $_proxyUser = null;
|
27 |
+
private $_proxyPassword = null;
|
28 |
+
private $_timeout = 60;
|
29 |
+
private $_sslVersion = null;
|
30 |
+
private $_acceptGzipEncoding = true;
|
31 |
|
32 |
/**
|
33 |
* Braintree API version to use
|
114 |
self::$global->setPrivateKey($value);
|
115 |
}
|
116 |
|
117 |
+
/**
|
118 |
+
* Sets or gets the read timeout to use for making requests.
|
119 |
+
*
|
120 |
+
* @param integer $value If provided, sets the read timeout
|
121 |
+
* @return integer The read timeout used for connecting to Braintree
|
122 |
+
*/
|
123 |
+
public static function timeout($value=null)
|
124 |
+
{
|
125 |
+
if (empty($value)) {
|
126 |
+
return self::$global->getTimeout();
|
127 |
+
}
|
128 |
+
self::$global->setTimeout($value);
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Sets or gets the SSL version to use for making requests. See
|
133 |
+
* http://php.net/manual/en/function.curl-setopt.php for possible
|
134 |
+
* CURLOPT_SSLVERSION values.
|
135 |
+
*
|
136 |
+
* @param integer $value If provided, sets the SSL version
|
137 |
+
* @return integer The SSL version used for connecting to Braintree
|
138 |
+
*/
|
139 |
+
public static function sslVersion($value=null)
|
140 |
+
{
|
141 |
+
if (empty($value)) {
|
142 |
+
return self::$global->getSslVersion();
|
143 |
+
}
|
144 |
+
self::$global->setSslVersion($value);
|
145 |
+
}
|
146 |
+
|
147 |
/**
|
148 |
* Sets or gets the proxy host to use for connecting to Braintree
|
149 |
*
|
199 |
return !empty($proxyHost) && !empty($proxyPort);
|
200 |
}
|
201 |
|
202 |
+
public static function proxyUser($value = null)
|
203 |
+
{
|
204 |
+
if (empty($value)) {
|
205 |
+
return self::$global->getProxyUser();
|
206 |
+
}
|
207 |
+
self::$global->setProxyUser($value);
|
208 |
+
}
|
209 |
+
|
210 |
+
public static function proxyPassword($value = null)
|
211 |
+
{
|
212 |
+
if (empty($value)) {
|
213 |
+
return self::$global->getProxyPassword();
|
214 |
+
}
|
215 |
+
self::$global->setProxyPassword($value);
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* Specified whether or not a username and password have been provided for
|
220 |
+
* use with an authenticated proxy
|
221 |
+
*
|
222 |
+
* @return bool true if both proxyUser and proxyPassword are present
|
223 |
+
*/
|
224 |
+
public static function isAuthenticatedProxy()
|
225 |
+
{
|
226 |
+
$proxyUser = self::$global->getProxyUser();
|
227 |
+
$proxyPwd = self::$global->getProxyPassword();
|
228 |
+
return !empty($proxyUser) && !empty($proxyPwd);
|
229 |
+
}
|
230 |
+
|
231 |
+
/**
|
232 |
+
* Specify if the HTTP client is able to decode gzipped responses.
|
233 |
+
*
|
234 |
+
* @param bool $value If true, will send an Accept-Encoding header with a gzip value. If false, will not send an Accept-Encoding header with a gzip value.
|
235 |
+
* @return bool true if an Accept-Encoding header with a gzip value will be sent, false if not
|
236 |
+
*/
|
237 |
+
public static function acceptGzipEncoding($value = null)
|
238 |
+
{
|
239 |
+
if (is_null($value)) {
|
240 |
+
return self::$global->getAcceptGzipEncoding();
|
241 |
+
}
|
242 |
+
self::$global->setAcceptGzipEncoding($value);
|
243 |
+
}
|
244 |
+
|
245 |
public static function assertGlobalHasAccessTokenOrKeys()
|
246 |
{
|
247 |
self::$global->assertHasAccessTokenOrKeys();
|
374 |
return $this->_proxyType;
|
375 |
}
|
376 |
|
377 |
+
private function setProxyUser($value)
|
378 |
+
{
|
379 |
+
$this->_proxyUser = $value;
|
380 |
+
}
|
381 |
+
|
382 |
+
public function getProxyUser()
|
383 |
+
{
|
384 |
+
return $this->_proxyUser;
|
385 |
+
}
|
386 |
+
|
387 |
+
private function setProxyPassword($value)
|
388 |
+
{
|
389 |
+
$this->_proxyPassword = $value;
|
390 |
+
}
|
391 |
+
|
392 |
+
public function getProxyPassword()
|
393 |
+
{
|
394 |
+
return $this->_proxyPassword;
|
395 |
+
}
|
396 |
+
|
397 |
+
private function setTimeout($value)
|
398 |
+
{
|
399 |
+
$this->_timeout = $value;
|
400 |
+
}
|
401 |
+
|
402 |
+
public function getTimeout()
|
403 |
+
{
|
404 |
+
return $this->_timeout;
|
405 |
+
}
|
406 |
+
|
407 |
+
private function setSslVersion($value)
|
408 |
+
{
|
409 |
+
$this->_sslVersion = $value;
|
410 |
+
}
|
411 |
+
|
412 |
+
private function getSslVersion()
|
413 |
+
{
|
414 |
+
return $this->_sslVersion;
|
415 |
+
}
|
416 |
+
|
417 |
+
private function getAcceptGzipEncoding()
|
418 |
+
{
|
419 |
+
return $this->_acceptGzipEncoding;
|
420 |
+
}
|
421 |
+
|
422 |
+
private function setAcceptGzipEncoding($value)
|
423 |
+
{
|
424 |
+
$this->_acceptGzipEncoding = $value;
|
425 |
+
}
|
426 |
+
|
427 |
public function getAccessToken()
|
428 |
{
|
429 |
return $this->_accessToken;
|
lib/Braintree/ConnectedMerchantPayPalStatusChanged.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Connected Merchant PayPal Status Changed Payload
|
6 |
+
*
|
7 |
+
* @package Braintree
|
8 |
+
*
|
9 |
+
* @property-read string $merchantPublicId
|
10 |
+
* @property-read string $action
|
11 |
+
* @property-read string $oauthApplicationClientId
|
12 |
+
*/
|
13 |
+
class ConnectedMerchantPayPalStatusChanged extends Base
|
14 |
+
{
|
15 |
+
protected $_attributes = [];
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @ignore
|
19 |
+
*/
|
20 |
+
public static function factory($attributes)
|
21 |
+
{
|
22 |
+
$instance = new self();
|
23 |
+
$instance->_initialize($attributes);
|
24 |
+
|
25 |
+
return $instance;
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @ignore
|
30 |
+
*/
|
31 |
+
protected function _initialize($attributes)
|
32 |
+
{
|
33 |
+
$this->_attributes = $attributes;
|
34 |
+
}
|
35 |
+
}
|
36 |
+
class_alias('Braintree\ConnectedMerchantPayPalStatusChanged', 'Braintree_ConnectedMerchantPayPalStatusChanged');
|
lib/Braintree/ConnectedMerchantStatusTransitioned.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Connected Merchant Status Transitioned Payload
|
6 |
+
*
|
7 |
+
* @package Braintree
|
8 |
+
*
|
9 |
+
* @property-read string $merchantPublicId
|
10 |
+
* @property-read string $status
|
11 |
+
* @property-read string $oauthApplicationClientId
|
12 |
+
*/
|
13 |
+
class ConnectedMerchantStatusTransitioned extends Base
|
14 |
+
{
|
15 |
+
protected $_attributes = [];
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @ignore
|
19 |
+
*/
|
20 |
+
public static function factory($attributes)
|
21 |
+
{
|
22 |
+
$instance = new self();
|
23 |
+
$instance->_initialize($attributes);
|
24 |
+
|
25 |
+
return $instance;
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @ignore
|
30 |
+
*/
|
31 |
+
protected function _initialize($attributes)
|
32 |
+
{
|
33 |
+
$this->_attributes = $attributes;
|
34 |
+
}
|
35 |
+
}
|
36 |
+
class_alias('Braintree\ConnectedMerchantStatusTransitioned', 'Braintree_ConnectedMerchantStatusTransitioned');
|
lib/Braintree/CredentialsParser.php
CHANGED
@@ -7,7 +7,6 @@ namespace Braintree;
|
|
7 |
*
|
8 |
* @package Braintree
|
9 |
* @subpackage Utility
|
10 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
11 |
*/
|
12 |
|
13 |
class CredentialsParser
|
7 |
*
|
8 |
* @package Braintree
|
9 |
* @subpackage Utility
|
|
|
10 |
*/
|
11 |
|
12 |
class CredentialsParser
|
lib/Braintree/CreditCard.php
CHANGED
@@ -12,7 +12,6 @@ namespace Braintree;
|
|
12 |
*
|
13 |
* @package Braintree
|
14 |
* @category Resources
|
15 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
16 |
*
|
17 |
* @property-read string $billingAddress
|
18 |
* @property-read string $bin
|
@@ -40,6 +39,7 @@ class CreditCard extends Base
|
|
40 |
const JCB = 'JCB';
|
41 |
const LASER = 'Laser';
|
42 |
const MAESTRO = 'Maestro';
|
|
|
43 |
const MASTER_CARD = 'MasterCard';
|
44 |
const SOLO = 'Solo';
|
45 |
const SWITCH_TYPE = 'Switch';
|
@@ -47,8 +47,8 @@ class CreditCard extends Base
|
|
47 |
const UNKNOWN = 'Unknown';
|
48 |
|
49 |
// Credit card origination location
|
50 |
-
|
51 |
-
|
52 |
|
53 |
const PREPAID_YES = 'Yes';
|
54 |
const PREPAID_NO = 'No';
|
@@ -76,6 +76,7 @@ class CreditCard extends Base
|
|
76 |
|
77 |
const COUNTRY_OF_ISSUANCE_UNKNOWN = "Unknown";
|
78 |
const ISSUING_BANK_UNKNOWN = "Unknown";
|
|
|
79 |
|
80 |
/* instance methods */
|
81 |
/**
|
12 |
*
|
13 |
* @package Braintree
|
14 |
* @category Resources
|
|
|
15 |
*
|
16 |
* @property-read string $billingAddress
|
17 |
* @property-read string $bin
|
39 |
const JCB = 'JCB';
|
40 |
const LASER = 'Laser';
|
41 |
const MAESTRO = 'Maestro';
|
42 |
+
const UK_MAESTRO = 'UK Maestro';
|
43 |
const MASTER_CARD = 'MasterCard';
|
44 |
const SOLO = 'Solo';
|
45 |
const SWITCH_TYPE = 'Switch';
|
47 |
const UNKNOWN = 'Unknown';
|
48 |
|
49 |
// Credit card origination location
|
50 |
+
const INTERNATIONAL = "international";
|
51 |
+
const US = "us";
|
52 |
|
53 |
const PREPAID_YES = 'Yes';
|
54 |
const PREPAID_NO = 'No';
|
76 |
|
77 |
const COUNTRY_OF_ISSUANCE_UNKNOWN = "Unknown";
|
78 |
const ISSUING_BANK_UNKNOWN = "Unknown";
|
79 |
+
const PRODUCT_ID_UNKNOWN = "Unknown";
|
80 |
|
81 |
/* instance methods */
|
82 |
/**
|
lib/Braintree/CreditCardGateway.php
CHANGED
@@ -14,7 +14,6 @@ use InvalidArgumentException;
|
|
14 |
*
|
15 |
* @package Braintree
|
16 |
* @category Resources
|
17 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
18 |
*/
|
19 |
class CreditCardGateway
|
20 |
{
|
@@ -382,23 +381,25 @@ class CreditCardGateway
|
|
382 |
|
383 |
public static function updateSignature()
|
384 |
{
|
385 |
-
|
|
|
|
|
386 |
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
|
401 |
-
|
402 |
}
|
403 |
|
404 |
/**
|
14 |
*
|
15 |
* @package Braintree
|
16 |
* @category Resources
|
|
|
17 |
*/
|
18 |
class CreditCardGateway
|
19 |
{
|
381 |
|
382 |
public static function updateSignature()
|
383 |
{
|
384 |
+
$options = self::baseOptions();
|
385 |
+
$options[] = "failOnDuplicatePaymentMethod";
|
386 |
+
$signature = self::baseSignature($options);
|
387 |
|
388 |
+
$updateExistingBillingSignature = [
|
389 |
+
[
|
390 |
+
'options' => [
|
391 |
+
'updateExisting'
|
392 |
+
]
|
393 |
+
]
|
394 |
+
];
|
395 |
|
396 |
+
foreach($signature AS $key => $value) {
|
397 |
+
if(is_array($value) and array_key_exists('billingAddress', $value)) {
|
398 |
+
$signature[$key]['billingAddress'] = array_merge_recursive($value['billingAddress'], $updateExistingBillingSignature);
|
399 |
+
}
|
400 |
+
}
|
401 |
|
402 |
+
return $signature;
|
403 |
}
|
404 |
|
405 |
/**
|
lib/Braintree/Customer.php
CHANGED
@@ -11,7 +11,6 @@ namespace Braintree;
|
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*
|
16 |
* @property-read array $addresses
|
17 |
* @property-read array $paymentMethods
|
@@ -23,6 +22,8 @@ namespace Braintree;
|
|
23 |
* @property-read array $androidPayCards
|
24 |
* @property-read array $amexExpressCheckoutCards
|
25 |
* @property-read array $venmoAccounts
|
|
|
|
|
26 |
* @property-read array $coinbaseAccounts
|
27 |
* @property-read array $customFields custom fields passed with the request
|
28 |
* @property-read string $email
|
@@ -59,7 +60,7 @@ class Customer extends Base
|
|
59 |
/**
|
60 |
*
|
61 |
* @param array $attribs
|
62 |
-
* @return
|
63 |
*/
|
64 |
public static function create($attribs = [])
|
65 |
{
|
@@ -296,6 +297,30 @@ class Customer extends Base
|
|
296 |
}
|
297 |
$this->_set('venmoAccounts', $venmoAccountArray);
|
298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
$this->_set('paymentMethods', array_merge(
|
300 |
$this->creditCards,
|
301 |
$this->paypalAccounts,
|
@@ -303,7 +328,10 @@ class Customer extends Base
|
|
303 |
$this->coinbaseAccounts,
|
304 |
$this->androidPayCards,
|
305 |
$this->amexExpressCheckoutCards,
|
306 |
-
$this->venmoAccounts
|
|
|
|
|
|
|
307 |
));
|
308 |
}
|
309 |
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
|
|
14 |
*
|
15 |
* @property-read array $addresses
|
16 |
* @property-read array $paymentMethods
|
22 |
* @property-read array $androidPayCards
|
23 |
* @property-read array $amexExpressCheckoutCards
|
24 |
* @property-read array $venmoAccounts
|
25 |
+
* @property-read array $visaCheckoutCards
|
26 |
+
* @property-read array $masterpassCards
|
27 |
* @property-read array $coinbaseAccounts
|
28 |
* @property-read array $customFields custom fields passed with the request
|
29 |
* @property-read string $email
|
60 |
/**
|
61 |
*
|
62 |
* @param array $attribs
|
63 |
+
* @return Result\Successful|Result\Error
|
64 |
*/
|
65 |
public static function create($attribs = [])
|
66 |
{
|
297 |
}
|
298 |
$this->_set('venmoAccounts', $venmoAccountArray);
|
299 |
|
300 |
+
$visaCheckoutCardArray = [];
|
301 |
+
if (isset($customerAttribs['visaCheckoutCards'])) {
|
302 |
+
foreach ($customerAttribs['visaCheckoutCards'] AS $visaCheckoutCard) {
|
303 |
+
$visaCheckoutCardArray[] = VisaCheckoutCard::factory($visaCheckoutCard);
|
304 |
+
}
|
305 |
+
}
|
306 |
+
$this->_set('visaCheckoutCards', $visaCheckoutCardArray);
|
307 |
+
|
308 |
+
$masterpassCardArray = [];
|
309 |
+
if (isset($customerAttribs['masterpassCards'])) {
|
310 |
+
foreach ($customerAttribs['masterpassCards'] AS $masterpassCard) {
|
311 |
+
$masterpassCardArray[] = MasterpassCard::factory($masterpassCard);
|
312 |
+
}
|
313 |
+
}
|
314 |
+
$this->_set('masterpassCards', $masterpassCardArray);
|
315 |
+
|
316 |
+
$usBankAccountArray = array();
|
317 |
+
if (isset($customerAttribs['usBankAccounts'])) {
|
318 |
+
foreach ($customerAttribs['usBankAccounts'] AS $usBankAccount) {
|
319 |
+
$usBankAccountArray[] = UsBankAccount::factory($usBankAccount);
|
320 |
+
}
|
321 |
+
}
|
322 |
+
$this->_set('usBankAccounts', $usBankAccountArray);
|
323 |
+
|
324 |
$this->_set('paymentMethods', array_merge(
|
325 |
$this->creditCards,
|
326 |
$this->paypalAccounts,
|
328 |
$this->coinbaseAccounts,
|
329 |
$this->androidPayCards,
|
330 |
$this->amexExpressCheckoutCards,
|
331 |
+
$this->venmoAccounts,
|
332 |
+
$this->visaCheckoutCards,
|
333 |
+
$this->masterpassCards,
|
334 |
+
$this->usBankAccounts
|
335 |
));
|
336 |
}
|
337 |
|
lib/Braintree/CustomerGateway.php
CHANGED
@@ -13,7 +13,6 @@ use InvalidArgumentException;
|
|
13 |
*
|
14 |
* @package Braintree
|
15 |
* @category Resources
|
16 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
17 |
*/
|
18 |
class CustomerGateway
|
19 |
{
|
@@ -144,16 +143,28 @@ class CustomerGateway
|
|
144 |
*/
|
145 |
public static function createSignature()
|
146 |
{
|
147 |
-
|
148 |
$creditCardSignature = CreditCardGateway::createSignature();
|
149 |
unset($creditCardSignature[array_search('customerId', $creditCardSignature)]);
|
|
|
150 |
$signature = [
|
151 |
'id', 'company', 'email', 'fax', 'firstName',
|
152 |
'lastName', 'phone', 'website', 'deviceData',
|
153 |
'deviceSessionId', 'fraudMerchantId', 'paymentMethodNonce',
|
|
|
|
|
|
|
154 |
['creditCard' => $creditCardSignature],
|
155 |
['customFields' => ['_anyKey_']],
|
156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
return $signature;
|
158 |
}
|
159 |
|
@@ -174,10 +185,13 @@ class CustomerGateway
|
|
174 |
$signature = [
|
175 |
'id', 'company', 'email', 'fax', 'firstName',
|
176 |
'lastName', 'phone', 'website', 'deviceData',
|
177 |
-
'deviceSessionId', 'fraudMerchantId', 'paymentMethodNonce',
|
178 |
['creditCard' => $creditCardSignature],
|
179 |
['customFields' => ['_anyKey_']],
|
180 |
-
|
|
|
|
|
|
|
181 |
return $signature;
|
182 |
}
|
183 |
|
13 |
*
|
14 |
* @package Braintree
|
15 |
* @category Resources
|
|
|
16 |
*/
|
17 |
class CustomerGateway
|
18 |
{
|
143 |
*/
|
144 |
public static function createSignature()
|
145 |
{
|
|
|
146 |
$creditCardSignature = CreditCardGateway::createSignature();
|
147 |
unset($creditCardSignature[array_search('customerId', $creditCardSignature)]);
|
148 |
+
|
149 |
$signature = [
|
150 |
'id', 'company', 'email', 'fax', 'firstName',
|
151 |
'lastName', 'phone', 'website', 'deviceData',
|
152 |
'deviceSessionId', 'fraudMerchantId', 'paymentMethodNonce',
|
153 |
+
['riskData' =>
|
154 |
+
['customerBrowser', 'customerIp', 'customer_browser', 'customer_ip']
|
155 |
+
],
|
156 |
['creditCard' => $creditCardSignature],
|
157 |
['customFields' => ['_anyKey_']],
|
158 |
+
['options' => [
|
159 |
+
['paypal' => [
|
160 |
+
'payee_email',
|
161 |
+
'order_id',
|
162 |
+
'custom_field',
|
163 |
+
'description',
|
164 |
+
'amount',
|
165 |
+
]]
|
166 |
+
]],
|
167 |
+
];
|
168 |
return $signature;
|
169 |
}
|
170 |
|
185 |
$signature = [
|
186 |
'id', 'company', 'email', 'fax', 'firstName',
|
187 |
'lastName', 'phone', 'website', 'deviceData',
|
188 |
+
'deviceSessionId', 'fraudMerchantId', 'paymentMethodNonce', 'defaultPaymentMethodToken',
|
189 |
['creditCard' => $creditCardSignature],
|
190 |
['customFields' => ['_anyKey_']],
|
191 |
+
['options' => [
|
192 |
+
['paypal' => ['payee_email']],
|
193 |
+
]],
|
194 |
+
];
|
195 |
return $signature;
|
196 |
}
|
197 |
|
lib/Braintree/Digest.php
CHANGED
@@ -4,8 +4,6 @@ namespace Braintree;
|
|
4 |
/**
|
5 |
* Digest encryption module
|
6 |
* Digest creates an HMAC-SHA1 hash for encrypting messages
|
7 |
-
*
|
8 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
9 |
*/
|
10 |
class Digest
|
11 |
{
|
4 |
/**
|
5 |
* Digest encryption module
|
6 |
* Digest creates an HMAC-SHA1 hash for encrypting messages
|
|
|
|
|
7 |
*/
|
8 |
class Digest
|
9 |
{
|
lib/Braintree/Disbursement.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
-
|
5 |
{
|
6 |
private $_merchantAccount;
|
7 |
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
+
class Disbursement extends Base
|
5 |
{
|
6 |
private $_merchantAccount;
|
7 |
|
lib/Braintree/DisbursementDetails.php
CHANGED
@@ -7,7 +7,6 @@ namespace Braintree;
|
|
7 |
*
|
8 |
*
|
9 |
* @package Braintree
|
10 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
11 |
*
|
12 |
* @property-read string $settlementAmount
|
13 |
* @property-read string $settlementCurrencyIsoCode
|
7 |
*
|
8 |
*
|
9 |
* @package Braintree
|
|
|
10 |
*
|
11 |
* @property-read string $settlementAmount
|
12 |
* @property-read string $settlementCurrencyIsoCode
|
lib/Braintree/Dispute.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree;
|
|
6 |
*
|
7 |
*
|
8 |
* @package Braintree
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*
|
11 |
* @property-read string $amount
|
12 |
* @property-read string $currencyIsoCode
|
@@ -16,11 +15,14 @@ namespace Braintree;
|
|
16 |
* @property-read string $disbursementDate
|
17 |
* @property-read object $transactionDetails
|
18 |
*/
|
19 |
-
|
20 |
{
|
21 |
protected $_attributes = [];
|
22 |
|
23 |
/* Dispute Status */
|
|
|
|
|
|
|
24 |
const OPEN = 'open';
|
25 |
const WON = 'won';
|
26 |
const LOST = 'lost';
|
@@ -51,7 +53,27 @@ final class Dispute extends Base
|
|
51 |
$this->_attributes = $disputeAttribs;
|
52 |
|
53 |
if (isset($disputeAttribs['transaction'])) {
|
54 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
new Dispute\TransactionDetails($disputeAttribs['transaction'])
|
56 |
);
|
57 |
}
|
@@ -78,5 +100,78 @@ final class Dispute extends Base
|
|
78 |
return __CLASS__ . '[' .
|
79 |
Util::attributesToString($displayAttributes) .']';
|
80 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
class_alias('Braintree\Dispute', 'Braintree_Dispute');
|
6 |
*
|
7 |
*
|
8 |
* @package Braintree
|
|
|
9 |
*
|
10 |
* @property-read string $amount
|
11 |
* @property-read string $currencyIsoCode
|
15 |
* @property-read string $disbursementDate
|
16 |
* @property-read object $transactionDetails
|
17 |
*/
|
18 |
+
class Dispute extends Base
|
19 |
{
|
20 |
protected $_attributes = [];
|
21 |
|
22 |
/* Dispute Status */
|
23 |
+
const ACCEPTED = 'accepted';
|
24 |
+
const DISPUTED = 'disputed';
|
25 |
+
const EXPIRED = 'expired';
|
26 |
const OPEN = 'open';
|
27 |
const WON = 'won';
|
28 |
const LOST = 'lost';
|
53 |
$this->_attributes = $disputeAttribs;
|
54 |
|
55 |
if (isset($disputeAttribs['transaction'])) {
|
56 |
+
$transactionDetails = new Dispute\TransactionDetails($disputeAttribs['transaction']);
|
57 |
+
$this->_set('transactionDetails', $transactionDetails);
|
58 |
+
$this->_set('transaction', $transactionDetails);
|
59 |
+
}
|
60 |
+
|
61 |
+
if (isset($disputeAttribs['evidence'])) {
|
62 |
+
$evidenceArray = array_map(function($evidence) {
|
63 |
+
return new Dispute\EvidenceDetails($evidence);
|
64 |
+
}, $disputeAttribs['evidence']);
|
65 |
+
$this->_set('evidence', $evidenceArray);
|
66 |
+
}
|
67 |
+
|
68 |
+
if (isset($disputeAttribs['statusHistory'])) {
|
69 |
+
$statusHistoryArray = array_map(function($statusHistory) {
|
70 |
+
return new Dispute\StatusHistoryDetails($statusHistory);
|
71 |
+
}, $disputeAttribs['statusHistory']);
|
72 |
+
$this->_set('statusHistory', $statusHistoryArray);
|
73 |
+
}
|
74 |
+
|
75 |
+
if (isset($disputeAttribs['transaction'])) {
|
76 |
+
$this->_set('transaction',
|
77 |
new Dispute\TransactionDetails($disputeAttribs['transaction'])
|
78 |
);
|
79 |
}
|
100 |
return __CLASS__ . '[' .
|
101 |
Util::attributesToString($displayAttributes) .']';
|
102 |
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Accepts a dispute, given a dispute ID
|
106 |
+
*
|
107 |
+
* @param string $id
|
108 |
+
*/
|
109 |
+
public static function accept($id)
|
110 |
+
{
|
111 |
+
return Configuration::gateway()->dispute()->accept($id);
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Adds file evidence to a dispute, given a dispute ID and a document ID
|
116 |
+
*
|
117 |
+
* @param string $disputeId
|
118 |
+
* @param string $documentId
|
119 |
+
*/
|
120 |
+
public static function addFileEvidence($disputeId, $documentId)
|
121 |
+
{
|
122 |
+
return Configuration::gateway()->dispute()->addFileEvidence($disputeId, $documentId);
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Adds text evidence to a dispute, given a dispute ID and content
|
127 |
+
*
|
128 |
+
* @param string $id
|
129 |
+
* @param string $content
|
130 |
+
*/
|
131 |
+
public static function addTextEvidence($id, $content)
|
132 |
+
{
|
133 |
+
return Configuration::gateway()->dispute()->addTextEvidence($id, $content);
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Finalize a dispute, given a dispute ID
|
138 |
+
*
|
139 |
+
* @param string $id
|
140 |
+
*/
|
141 |
+
public static function finalize($id)
|
142 |
+
{
|
143 |
+
return Configuration::gateway()->dispute()->finalize($id);
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Find a dispute, given a dispute ID
|
148 |
+
*
|
149 |
+
* @param string $id
|
150 |
+
*/
|
151 |
+
public static function find($id)
|
152 |
+
{
|
153 |
+
return Configuration::gateway()->dispute()->find($id);
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Remove evidence from a dispute, given a dispute ID and evidence ID
|
158 |
+
*
|
159 |
+
* @param string $disputeId
|
160 |
+
* @param string $evidenceId
|
161 |
+
*/
|
162 |
+
public static function removeEvidence($disputeId, $evidenceId)
|
163 |
+
{
|
164 |
+
return Configuration::gateway()->dispute()->removeEvidence($disputeId, $evidenceId);
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Search for Disputes, given a DisputeSearch query
|
169 |
+
*
|
170 |
+
* @param DisputeSearch $query
|
171 |
+
*/
|
172 |
+
public static function search($query)
|
173 |
+
{
|
174 |
+
return Configuration::gateway()->dispute()->search($query);
|
175 |
+
}
|
176 |
}
|
177 |
class_alias('Braintree\Dispute', 'Braintree_Dispute');
|
lib/Braintree/Dispute/EvidenceDetails.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree\Dispute;
|
3 |
+
|
4 |
+
use Braintree\Instance;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Evidence details for a dispute
|
8 |
+
*
|
9 |
+
* @package Braintree
|
10 |
+
*
|
11 |
+
* @property-read string $comment
|
12 |
+
* @property-read date $created_at
|
13 |
+
* @property-read string $id
|
14 |
+
* @property-read string $sent_to_processor_at
|
15 |
+
* @property-read string $url
|
16 |
+
*/
|
17 |
+
class EvidenceDetails extends Instance
|
18 |
+
{
|
19 |
+
}
|
20 |
+
|
21 |
+
class_alias('Braintree\Dispute\EvidenceDetails', 'Braintree_Dispute_EvidenceDetails');
|
lib/Braintree/Dispute/StatusHistoryDetails.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree\Dispute;
|
3 |
+
|
4 |
+
use Braintree\Instance;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Evidence details for a dispute
|
8 |
+
*
|
9 |
+
* @package Braintree
|
10 |
+
*
|
11 |
+
* @property-read string $effective_date
|
12 |
+
* @property-read string $status
|
13 |
+
* @property-read date $timestamp
|
14 |
+
*/
|
15 |
+
class StatusHistoryDetails extends Instance
|
16 |
+
{
|
17 |
+
}
|
18 |
+
|
19 |
+
class_alias('Braintree\Dispute\StatusHistoryDetails', 'Braintree_Dispute_StatusHistoryDetails');
|
lib/Braintree/Dispute/TransactionDetails.php
CHANGED
@@ -7,7 +7,6 @@ use Braintree\Instance;
|
|
7 |
* Transaction details for a dispute
|
8 |
*
|
9 |
* @package Braintree
|
10 |
-
* @copyright 2010 Braintree Payment Solutions
|
11 |
*/
|
12 |
|
13 |
/**
|
@@ -15,7 +14,6 @@ use Braintree\Instance;
|
|
15 |
*
|
16 |
*
|
17 |
* @package Braintree
|
18 |
-
* @copyright 2010 Braintree Payment Solutions
|
19 |
*
|
20 |
* @property-read string $amount
|
21 |
* @property-read string $id
|
7 |
* Transaction details for a dispute
|
8 |
*
|
9 |
* @package Braintree
|
|
|
10 |
*/
|
11 |
|
12 |
/**
|
14 |
*
|
15 |
*
|
16 |
* @package Braintree
|
|
|
17 |
*
|
18 |
* @property-read string $amount
|
19 |
* @property-read string $id
|
lib/Braintree/DisputeGateway.php
ADDED
@@ -0,0 +1,244 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
use InvalidArgumentException;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Braintree DisputeGateway module
|
8 |
+
* PHP Version 5
|
9 |
+
* Creates and manages Braintree Disputes
|
10 |
+
*
|
11 |
+
* @package Braintree
|
12 |
+
*/
|
13 |
+
class DisputeGateway
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @var Gateway
|
17 |
+
*/
|
18 |
+
private $_gateway;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var Configuration
|
22 |
+
*/
|
23 |
+
private $_config;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var Http
|
27 |
+
*/
|
28 |
+
private $_http;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @param Gateway $gateway
|
32 |
+
*/
|
33 |
+
public function __construct($gateway)
|
34 |
+
{
|
35 |
+
$this->_gateway = $gateway;
|
36 |
+
$this->_config = $gateway->config;
|
37 |
+
$this->_config->assertHasAccessTokenOrKeys();
|
38 |
+
$this->_http = new Http($gateway->config);
|
39 |
+
}
|
40 |
+
|
41 |
+
/* public class methods */
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Accepts a dispute, given a dispute ID
|
45 |
+
*
|
46 |
+
* @param string $id
|
47 |
+
*/
|
48 |
+
public function accept($id)
|
49 |
+
{
|
50 |
+
try {
|
51 |
+
if (trim($id) == "") {
|
52 |
+
throw new Exception\NotFound();
|
53 |
+
}
|
54 |
+
|
55 |
+
$path = $this->_config->merchantPath() . '/disputes/' . $id . '/accept';
|
56 |
+
$response = $this->_http->put($path);
|
57 |
+
|
58 |
+
if (isset($response['apiErrorResponse'])) {
|
59 |
+
return new Result\Error($response['apiErrorResponse']);
|
60 |
+
}
|
61 |
+
|
62 |
+
return new Result\Successful();
|
63 |
+
} catch (Exception\NotFound $e) {
|
64 |
+
throw new Exception\NotFound('dispute with id "' . $id . '" not found');
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Adds file evidence to a dispute, given a dispute ID and a document ID
|
70 |
+
*
|
71 |
+
* @param string $disputeId
|
72 |
+
* @param string $documentId
|
73 |
+
*/
|
74 |
+
public function addFileEvidence($disputeId, $documentId)
|
75 |
+
{
|
76 |
+
if (trim($disputeId) == "") {
|
77 |
+
throw new Exception\NotFound('dispute with id "' . $disputeId . '" not found');
|
78 |
+
}
|
79 |
+
|
80 |
+
if (trim($documentId) == "") {
|
81 |
+
throw new Exception\NotFound('document with id "' . $documentId . '" not found');
|
82 |
+
}
|
83 |
+
|
84 |
+
try {
|
85 |
+
if (trim($disputeId) == "") {
|
86 |
+
throw new Exception\NotFound();
|
87 |
+
}
|
88 |
+
|
89 |
+
$path = $this->_config->merchantPath() . '/disputes/' . $disputeId . '/evidence';
|
90 |
+
$response = $this->_http->post($path, [
|
91 |
+
'document_upload_id' => $documentId
|
92 |
+
]);
|
93 |
+
|
94 |
+
if (isset($response['apiErrorResponse'])) {
|
95 |
+
return new Result\Error($response['apiErrorResponse']);
|
96 |
+
}
|
97 |
+
|
98 |
+
if (isset($response['evidence'])) {
|
99 |
+
$evidence = new Dispute\EvidenceDetails($response['evidence']);
|
100 |
+
return new Result\Successful($evidence);
|
101 |
+
}
|
102 |
+
} catch (Exception\NotFound $e) {
|
103 |
+
throw new Exception\NotFound('dispute with id "' . $disputeId . '" not found');
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Adds text evidence to a dispute, given a dispute ID and content
|
109 |
+
*
|
110 |
+
* @param string $id
|
111 |
+
* @param string $content
|
112 |
+
*/
|
113 |
+
public function addTextEvidence($id, $content)
|
114 |
+
{
|
115 |
+
if (trim($content) == "") {
|
116 |
+
throw new InvalidArgumentException('content cannot be blank');
|
117 |
+
}
|
118 |
+
|
119 |
+
try {
|
120 |
+
if (trim($id) == "") {
|
121 |
+
throw new Exception\NotFound();
|
122 |
+
}
|
123 |
+
|
124 |
+
$path = $this->_config->merchantPath() . '/disputes/' . $id . '/evidence';
|
125 |
+
$response = $this->_http->post($path, [
|
126 |
+
'comments' => $content
|
127 |
+
]);
|
128 |
+
|
129 |
+
if (isset($response['apiErrorResponse'])) {
|
130 |
+
return new Result\Error($response['apiErrorResponse']);
|
131 |
+
}
|
132 |
+
|
133 |
+
if (isset($response['evidence'])) {
|
134 |
+
$evidence = new Dispute\EvidenceDetails($response['evidence']);
|
135 |
+
return new Result\Successful($evidence);
|
136 |
+
}
|
137 |
+
} catch (Exception\NotFound $e) {
|
138 |
+
throw new Exception\NotFound('dispute with id "' . $id . '" not found');
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Finalize a dispute, given a dispute ID
|
144 |
+
*
|
145 |
+
* @param string $id
|
146 |
+
*/
|
147 |
+
public function finalize($id)
|
148 |
+
{
|
149 |
+
try {
|
150 |
+
if (trim($id) == "") {
|
151 |
+
throw new Exception\NotFound();
|
152 |
+
}
|
153 |
+
|
154 |
+
$path = $this->_config->merchantPath() . '/disputes/' . $id . '/finalize';
|
155 |
+
$response = $this->_http->put($path);
|
156 |
+
|
157 |
+
if (isset($response['apiErrorResponse'])) {
|
158 |
+
return new Result\Error($response['apiErrorResponse']);
|
159 |
+
}
|
160 |
+
|
161 |
+
return new Result\Successful();
|
162 |
+
} catch (Exception\NotFound $e) {
|
163 |
+
throw new Exception\NotFound('dispute with id "' . $id . '" not found');
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Find a dispute, given a dispute ID
|
169 |
+
*
|
170 |
+
* @param string $id
|
171 |
+
*/
|
172 |
+
public function find($id)
|
173 |
+
{
|
174 |
+
if (trim($id) == "") {
|
175 |
+
throw new Exception\NotFound('dispute with id "' . $id . '" not found');
|
176 |
+
}
|
177 |
+
|
178 |
+
try {
|
179 |
+
$path = $this->_config->merchantPath() . '/disputes/' . $id;
|
180 |
+
$response = $this->_http->get($path);
|
181 |
+
return Dispute::factory($response['dispute']);
|
182 |
+
} catch (Exception\NotFound $e) {
|
183 |
+
throw new Exception\NotFound('dispute with id "' . $id . '" not found');
|
184 |
+
}
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Remove evidence from a dispute, given a dispute ID and evidence ID
|
189 |
+
*
|
190 |
+
* @param string $disputeId
|
191 |
+
* @param string $evidenceId
|
192 |
+
*/
|
193 |
+
public function removeEvidence($disputeId, $evidenceId)
|
194 |
+
{
|
195 |
+
try {
|
196 |
+
if (trim($disputeId) == "" || trim($evidenceId) == "") {
|
197 |
+
throw new Exception\NotFound();
|
198 |
+
}
|
199 |
+
|
200 |
+
$path = $this->_config->merchantPath() . '/disputes/' . $disputeId . '/evidence/' . $evidenceId;
|
201 |
+
$response = $this->_http->delete($path);
|
202 |
+
|
203 |
+
if (isset($response['apiErrorResponse'])) {
|
204 |
+
return new Result\Error($response['apiErrorResponse']);
|
205 |
+
}
|
206 |
+
|
207 |
+
return new Result\Successful();
|
208 |
+
} catch (Exception\NotFound $e) {
|
209 |
+
throw new Exception\NotFound('evidence with id "' . $evidenceId . '" for dispute with id "' . $disputeId . '" not found');
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Search for Disputes, given a DisputeSearch query
|
215 |
+
*
|
216 |
+
* @param DisputeSearch $query
|
217 |
+
*/
|
218 |
+
public function search($query)
|
219 |
+
{
|
220 |
+
$criteria = [];
|
221 |
+
foreach ($query as $term) {
|
222 |
+
$criteria[$term->name] = $term->toparam();
|
223 |
+
}
|
224 |
+
$pager = [
|
225 |
+
'object' => $this,
|
226 |
+
'method' => 'fetchDisputes',
|
227 |
+
'query' => $criteria
|
228 |
+
];
|
229 |
+
return new PaginatedCollection($pager);
|
230 |
+
}
|
231 |
+
|
232 |
+
public function fetchDisputes($query, $page)
|
233 |
+
{
|
234 |
+
$response = $this->_http->post($this->_config->merchantPath() . '/disputes/advanced_search?page=' . $page, [
|
235 |
+
'search' => $query
|
236 |
+
]);
|
237 |
+
$body = $response['disputes'];
|
238 |
+
$disputes = Util::extractattributeasarray($body, 'dispute');
|
239 |
+
$totalItems = $body['totalItems'][0];
|
240 |
+
$pageSize = $body['pageSize'][0];
|
241 |
+
return new PaginatedResult($totalItems, $pageSize, $disputes);
|
242 |
+
}
|
243 |
+
}
|
244 |
+
class_alias('Braintree\DisputeGateway', 'Braintree_DisputeGateway');
|
lib/Braintree/DisputeSearch.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
class DisputeSearch
|
5 |
+
{
|
6 |
+
public static function amountDisputed() {
|
7 |
+
return new RangeNode("amount_disputed");
|
8 |
+
}
|
9 |
+
|
10 |
+
public static function amountWon()
|
11 |
+
{
|
12 |
+
return new RangeNode("amount_won");
|
13 |
+
}
|
14 |
+
|
15 |
+
public static function caseNumber()
|
16 |
+
{
|
17 |
+
return new TextNode("case_number");
|
18 |
+
}
|
19 |
+
|
20 |
+
public static function id()
|
21 |
+
{
|
22 |
+
return new TextNode("id");
|
23 |
+
}
|
24 |
+
|
25 |
+
public static function kind()
|
26 |
+
{
|
27 |
+
return new MultipleValueNode("kind");
|
28 |
+
}
|
29 |
+
|
30 |
+
public static function merchantAccountId()
|
31 |
+
{
|
32 |
+
return new MultipleValueNode("merchant_account_id");
|
33 |
+
}
|
34 |
+
|
35 |
+
public static function reason()
|
36 |
+
{
|
37 |
+
return new MultipleValueNode("reason");
|
38 |
+
}
|
39 |
+
|
40 |
+
public static function reasonCode()
|
41 |
+
{
|
42 |
+
return new MultipleValueNode("reason_code");
|
43 |
+
}
|
44 |
+
|
45 |
+
public static function receivedDate()
|
46 |
+
{
|
47 |
+
return new RangeNode("received_date");
|
48 |
+
}
|
49 |
+
|
50 |
+
public static function referenceNumber()
|
51 |
+
{
|
52 |
+
return new TextNode("reference_number");
|
53 |
+
}
|
54 |
+
|
55 |
+
public static function replyByDate()
|
56 |
+
{
|
57 |
+
return new RangeNode("reply_by_date");
|
58 |
+
}
|
59 |
+
|
60 |
+
public static function status()
|
61 |
+
{
|
62 |
+
return new MultipleValueNode("status");
|
63 |
+
}
|
64 |
+
|
65 |
+
public static function transactionId()
|
66 |
+
{
|
67 |
+
return new TextNode("transaction_id");
|
68 |
+
}
|
69 |
+
|
70 |
+
public static function transactionSource()
|
71 |
+
{
|
72 |
+
return new MultipleValueNode("transaction_source");
|
73 |
+
}
|
74 |
+
}
|
75 |
+
class_alias('Braintree\DisputeSearch', 'Braintree_DisputeSearch');
|
lib/Braintree/DocumentUpload.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
use InvalidArgumentException;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Upload documents to Braintree in exchange for a DocumentUpload object.
|
8 |
+
*
|
9 |
+
* An example of creating a document upload with all available fields:
|
10 |
+
* $result = Braintree\DocumentUpload::create([
|
11 |
+
* "kind" => Braintree\DocumentUpload::EVIDENCE_DOCUMENT,
|
12 |
+
* "file" => $pngFile
|
13 |
+
* ]);
|
14 |
+
*
|
15 |
+
* For more information on DocumentUploads, see https://developers.braintreepayments.com/reference/request/document_upload/create
|
16 |
+
*/
|
17 |
+
class DocumentUpload extends Base
|
18 |
+
{
|
19 |
+
/* DocumentUpload Kind */
|
20 |
+
const EVIDENCE_DOCUMENT = "evidence_document";
|
21 |
+
|
22 |
+
protected function _initialize($documentUploadAttribs)
|
23 |
+
{
|
24 |
+
$this->_attributes = $documentUploadAttribs;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Creates a DocumentUpload object
|
29 |
+
* @param kind The kind of document
|
30 |
+
* @param file The open file to upload
|
31 |
+
* @throws InvalidArgumentException if the params are not expected
|
32 |
+
*/
|
33 |
+
public static function create($params)
|
34 |
+
{
|
35 |
+
return Configuration::gateway()->documentUpload()->create($params);
|
36 |
+
}
|
37 |
+
|
38 |
+
public static function factory($attributes)
|
39 |
+
{
|
40 |
+
$instance = new self();
|
41 |
+
$instance->_initialize($attributes);
|
42 |
+
return $instance;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
class_alias('Braintree\DocumentUpload', 'Braintree_DocumentUpload');
|
lib/Braintree/DocumentUploadGateway.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
use InvalidArgumentException;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Braintree DisputeGateway module
|
8 |
+
* PHP Version 5
|
9 |
+
* Creates and manages Braintree Disputes
|
10 |
+
*
|
11 |
+
* @package Braintree
|
12 |
+
*/
|
13 |
+
class DocumentUploadGateway
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @var Gateway
|
17 |
+
*/
|
18 |
+
private $_gateway;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var Configuration
|
22 |
+
*/
|
23 |
+
private $_config;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var Http
|
27 |
+
*/
|
28 |
+
private $_http;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @param Gateway $gateway
|
32 |
+
*/
|
33 |
+
public function __construct($gateway)
|
34 |
+
{
|
35 |
+
$this->_gateway = $gateway;
|
36 |
+
$this->_config = $gateway->config;
|
37 |
+
$this->_config->assertHasAccessTokenOrKeys();
|
38 |
+
$this->_http = new Http($gateway->config);
|
39 |
+
}
|
40 |
+
|
41 |
+
/* public class methods */
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Accepts a dispute, given a dispute ID
|
45 |
+
*
|
46 |
+
* @param string $id
|
47 |
+
*/
|
48 |
+
public function create($params)
|
49 |
+
{
|
50 |
+
Util::verifyKeys(self::createSignature(), $params);
|
51 |
+
|
52 |
+
$file = $params['file'];
|
53 |
+
|
54 |
+
if (!is_resource($file)) {
|
55 |
+
throw new InvalidArgumentException('file must be a stream resource');
|
56 |
+
}
|
57 |
+
|
58 |
+
$payload = [
|
59 |
+
'document_upload[kind]' => $params['kind']
|
60 |
+
];
|
61 |
+
$path = $this->_config->merchantPath() . '/document_uploads/';
|
62 |
+
$response = $this->_http->postMultipart($path, $payload, $file);
|
63 |
+
|
64 |
+
if (isset($response['apiErrorResponse'])) {
|
65 |
+
return new Result\Error($response['apiErrorResponse']);
|
66 |
+
}
|
67 |
+
|
68 |
+
if (isset($response['documentUpload'])) {
|
69 |
+
$documentUpload = DocumentUpload::factory($response['documentUpload']);
|
70 |
+
return new Result\Successful($documentUpload);
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
public static function createSignature()
|
75 |
+
{
|
76 |
+
return [
|
77 |
+
'file', 'kind'
|
78 |
+
];
|
79 |
+
}
|
80 |
+
}
|
81 |
+
class_alias('Braintree\DocumentUploadGateway', 'Braintree_DocumentUploadGateway');
|
lib/Braintree/Error/Codes.php
CHANGED
@@ -14,7 +14,6 @@ namespace Braintree\Error;
|
|
14 |
* @package Braintree
|
15 |
* @subpackage Errors
|
16 |
* @category Validation
|
17 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
18 |
*/
|
19 |
class Codes
|
20 |
{
|
@@ -85,56 +84,58 @@ class Codes
|
|
85 |
const CLIENT_TOKEN_VERIFY_CARD_REQUIRES_CUSTOMER_ID = '92802';
|
86 |
const CLIENT_TOKEN_MERCHANT_ACCOUNT_DOES_NOT_EXIST = '92807';
|
87 |
|
88 |
-
const CREDIT_CARD_BILLING_ADDRESS_CONFLICT
|
89 |
-
const CREDIT_CARD_BILLING_ADDRESS_FORMAT_IS_INVALID
|
90 |
-
const CREDIT_CARD_BILLING_ADDRESS_ID_IS_INVALID
|
91 |
-
const CREDIT_CARD_CANNOT_UPDATE_CARD_USING_PAYMENT_METHOD_NONCE
|
92 |
-
const CREDIT_CARD_CARDHOLDER_NAME_IS_TOO_LONG
|
93 |
-
const CREDIT_CARD_CREDIT_CARD_TYPE_IS_NOT_ACCEPTED
|
94 |
-
const CREDIT_CARD_CREDIT_CARD_TYPE_IS_NOT_ACCEPTED_BY_SUBSCRIPTION_MERCHANT_ACCOUNT
|
95 |
-
const CREDIT_CARD_CUSTOMER_ID_IS_INVALID
|
96 |
-
const CREDIT_CARD_CUSTOMER_ID_IS_REQUIRED
|
97 |
-
const CREDIT_CARD_CVV_IS_INVALID
|
98 |
-
const CREDIT_CARD_CVV_IS_REQUIRED
|
99 |
-
const CREDIT_CARD_CVV_VERIFICATION_FAILED
|
100 |
-
const CREDIT_CARD_DUPLICATE_CARD_EXISTS
|
101 |
-
const CREDIT_CARD_EXPIRATION_DATE_CONFLICT
|
102 |
-
const CREDIT_CARD_EXPIRATION_DATE_IS_INVALID
|
103 |
-
const CREDIT_CARD_EXPIRATION_DATE_IS_REQUIRED
|
104 |
-
const CREDIT_CARD_EXPIRATION_DATE_YEAR_IS_INVALID
|
105 |
-
const CREDIT_CARD_EXPIRATION_MONTH_IS_INVALID
|
106 |
-
const CREDIT_CARD_EXPIRATION_YEAR_IS_INVALID
|
107 |
-
const CREDIT_CARD_INVALID_PARAMS_FOR_CREDIT_CARD_UPDATE
|
108 |
-
const CREDIT_CARD_INVALID_VENMO_SDK_PAYMENT_METHOD_CODE
|
109 |
-
const CREDIT_CARD_NUMBER_INVALID_LENGTH
|
110 |
-
const CREDIT_CARD_NUMBER_IS_INVALID
|
111 |
-
const CREDIT_CARD_NUMBER_IS_PROHIBITED
|
112 |
-
const CREDIT_CARD_NUMBER_IS_REQUIRED
|
113 |
-
const CREDIT_CARD_NUMBER_LENGTH_IS_INVALID
|
114 |
-
const CREDIT_CARD_NUMBER_MUST_BE_TEST_NUMBER
|
115 |
-
const CREDIT_CARD_OPTIONS_UPDATE_EXISTING_TOKEN_IS_INVALID
|
116 |
-
const CREDIT_CARD_OPTIONS_UPDATE_EXISTING_TOKEN_NOT_ALLOWED
|
117 |
-
const CREDIT_CARD_OPTIONS_VERIFICATION_AMOUNT_CANNOT_BE_NEGATIVE
|
118 |
-
const CREDIT_CARD_OPTIONS_VERIFICATION_AMOUNT_FORMAT_IS_INVALID
|
119 |
-
const
|
120 |
-
const
|
121 |
-
const
|
122 |
-
const
|
123 |
-
const
|
124 |
-
const
|
125 |
-
const
|
126 |
-
const
|
127 |
-
const
|
128 |
-
const
|
129 |
-
const
|
130 |
-
const
|
131 |
-
const
|
132 |
-
const
|
133 |
-
const
|
134 |
-
const
|
135 |
-
const
|
136 |
-
const
|
137 |
-
const
|
|
|
|
|
138 |
|
139 |
const CUSTOMER_COMPANY_IS_TOO_LONG = '81601';
|
140 |
const CUSTOMER_CUSTOM_FIELD_IS_INVALID = '91602';
|
@@ -165,6 +166,17 @@ class Codes
|
|
165 |
const DESCRIPTOR_INTERNATIONAL_PHONE_FORMAT_IS_INVALID = '92205';
|
166 |
const DESCRIPTOR_URL_FORMAT_IS_INVALID = '92206';
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
const INDUSTRY_DATA_INDUSTRY_TYPE_IS_INVALID = '93401';
|
169 |
const INDUSTRY_DATA_LODGING_EMPTY_DATA = '93402';
|
170 |
const INDUSTRY_DATA_LODGING_FOLIO_NUMBER_IS_INVALID = '93403';
|
@@ -188,10 +200,18 @@ class Codes
|
|
188 |
const MERCHANT_COUNTRY_CODE_NUMERIC_IS_NOT_ACCEPTED = '93608';
|
189 |
const MERCHANT_COUNTRY_NAME_IS_INVALID = '93611';
|
190 |
const MERCHANT_COUNTRY_NAME_IS_NOT_ACCEPTED = '93610';
|
|
|
191 |
const MERCHANT_EMAIL_FORMAT_IS_INVALID = '93602';
|
192 |
const MERCHANT_EMAIL_IS_REQUIRED = '83601';
|
193 |
const MERCHANT_INCONSISTENT_COUNTRY = '93612';
|
194 |
const MERCHANT_ACCOUNT_PAYMENT_METHODS_ARE_INVALID = '93613';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
const MERCHANT_ACCOUNT_ID_FORMAT_IS_INVALID = '82603';
|
197 |
const MERCHANT_ACCOUNT_ID_IS_IN_USE = '82604';
|
@@ -300,6 +320,7 @@ class Codes
|
|
300 |
const PAYMENT_METHOD_PAYMENT_METHOD_NONCE_UNKNOWN = '93108';
|
301 |
const PAYMENT_METHOD_PAYMENT_METHOD_NONCE_LOCKED = '93109';
|
302 |
const PAYMENT_METHOD_PAYMENT_METHOD_PARAMS_ARE_REQUIRED = '93101';
|
|
|
303 |
|
304 |
const PAYPAL_ACCOUNT_AUTH_EXPIRED = '92911';
|
305 |
const PAYPAL_ACCOUNT_CANNOT_HAVE_BOTH_ACCESS_TOKEN_AND_CONSENT_CODE = '82903';
|
@@ -404,6 +425,7 @@ class Codes
|
|
404 |
|
405 |
const TRANSACTION_AMOUNT_CANNOT_BE_NEGATIVE = '81501';
|
406 |
const TRANSACTION_AMOUNT_DOES_NOT_MATCH3_D_SECURE_AMOUNT = '91585';
|
|
|
407 |
const TRANSACTION_AMOUNT_FORMAT_IS_INVALID = '81503';
|
408 |
const TRANSACTION_AMOUNT_IS_INVALID = '81503';
|
409 |
const TRANSACTION_AMOUNT_IS_REQUIRED = '81502';
|
@@ -413,6 +435,7 @@ class Codes
|
|
413 |
const TRANSACTION_CANNOT_BE_VOIDED = '91504';
|
414 |
const TRANSACTION_CANNOT_CANCEL_RELEASE = '91562';
|
415 |
const TRANSACTION_CANNOT_CLONE_CREDIT = '91543';
|
|
|
416 |
const TRANSACTION_CANNOT_CLONE_TRANSACTION_WITH_PAYPAL_ACCOUNT = '91573';
|
417 |
const TRANSACTION_CANNOT_CLONE_TRANSACTION_WITH_VAULT_CREDIT_CARD = '91540';
|
418 |
const TRANSACTION_CANNOT_CLONE_UNSUCCESSFUL_TRANSACTION = '91542';
|
@@ -428,6 +451,7 @@ class Codes
|
|
428 |
const TRANSACTION_CANNOT_SIMULATE_SETTLEMENT = '91575';
|
429 |
const TRANSACTION_CANNOT_SUBMIT_FOR_PARTIAL_SETTLEMENT = '915103';
|
430 |
const TRANSACTION_CANNOT_SUBMIT_FOR_SETTLEMENT = '91507';
|
|
|
431 |
const TRANSACTION_CHANNEL_IS_TOO_LONG = '91550';
|
432 |
const TRANSACTION_CREDIT_CARD_IS_REQUIRED = '91508';
|
433 |
const TRANSACTION_CUSTOMER_DEFAULT_PAYMENT_METHOD_CARD_TYPE_IS_NOT_ACCEPTED = '81509';
|
@@ -436,7 +460,10 @@ class Codes
|
|
436 |
const TRANSACTION_CUSTOM_FIELD_IS_INVALID = '91526';
|
437 |
const TRANSACTION_CUSTOM_FIELD_IS_TOO_LONG = '81527';
|
438 |
const TRANSACTION_HAS_ALREADY_BEEN_REFUNDED = '91512';
|
|
|
|
|
439 |
const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_MATCH3_D_SECURE_MERCHANT_ACCOUNT = '91584';
|
|
|
440 |
const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_SUPPORT_MOTO = '91558';
|
441 |
const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_SUPPORT_REFUNDS = '91547';
|
442 |
const TRANSACTION_MERCHANT_ACCOUNT_ID_IS_INVALID = '91513';
|
@@ -447,6 +474,8 @@ class Codes
|
|
447 |
const TRANSACTION_OPTIONS_SUBMIT_FOR_SETTLEMENT_IS_REQUIRED_FOR_PAYPAL_UNILATERAL = '91582';
|
448 |
const TRANSACTION_OPTIONS_USE_BILLING_FOR_SHIPPING_DISABLED = '91572';
|
449 |
const TRANSACTION_OPTIONS_VAULT_IS_DISABLED = '91525';
|
|
|
|
|
450 |
const TRANSACTION_ORDER_ID_IS_TOO_LONG = '91501';
|
451 |
const TRANSACTION_PAYMENT_INSTRUMENT_NOT_SUPPORTED_BY_MERCHANT_ACCOUNT = '91577';
|
452 |
const TRANSACTION_PAYMENT_INSTRUMENT_TYPE_IS_NOT_ACCEPTED = '915101';
|
@@ -471,6 +500,7 @@ class Codes
|
|
471 |
const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_PARTIAL_SETTLEMENT = '915102';
|
472 |
const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_UPDATING_ORDER_ID = '915107';
|
473 |
const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_UPDATING_DESCRIPTOR = '915108';
|
|
|
474 |
const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_VOICE_AUTHORIZATIONS = '91545';
|
475 |
const TRANSACTION_PURCHASE_ORDER_NUMBER_IS_INVALID = '91548';
|
476 |
const TRANSACTION_PURCHASE_ORDER_NUMBER_IS_TOO_LONG = '91537';
|
@@ -492,18 +522,25 @@ class Codes
|
|
492 |
const TRANSACTION_TAX_AMOUNT_FORMAT_IS_INVALID = '81535';
|
493 |
const TRANSACTION_TAX_AMOUNT_IS_TOO_LARGE = '81536';
|
494 |
|
495 |
-
const TRANSACTION_THREE_D_SECURE_AUTHENTICATION_FAILED
|
496 |
-
const TRANSACTION_THREE_D_SECURE_TOKEN_IS_INVALID
|
497 |
-
const TRANSACTION_THREE_D_SECURE_TRANSACTION_DATA_DOESNT_MATCH_VERIFY
|
498 |
-
const
|
499 |
-
const
|
500 |
-
const
|
|
|
|
|
|
|
|
|
|
|
501 |
|
502 |
-
const VERIFICATION_OPTIONS_AMOUNT_CANNOT_BE_NEGATIVE
|
503 |
-
const VERIFICATION_OPTIONS_AMOUNT_FORMAT_IS_INVALID
|
504 |
-
const
|
505 |
-
const
|
506 |
-
const
|
507 |
-
const
|
|
|
|
|
508 |
}
|
509 |
class_alias('Braintree\Error\Codes', 'Braintree_Error_Codes');
|
14 |
* @package Braintree
|
15 |
* @subpackage Errors
|
16 |
* @category Validation
|
|
|
17 |
*/
|
18 |
class Codes
|
19 |
{
|
84 |
const CLIENT_TOKEN_VERIFY_CARD_REQUIRES_CUSTOMER_ID = '92802';
|
85 |
const CLIENT_TOKEN_MERCHANT_ACCOUNT_DOES_NOT_EXIST = '92807';
|
86 |
|
87 |
+
const CREDIT_CARD_BILLING_ADDRESS_CONFLICT = '91701';
|
88 |
+
const CREDIT_CARD_BILLING_ADDRESS_FORMAT_IS_INVALID = '91744';
|
89 |
+
const CREDIT_CARD_BILLING_ADDRESS_ID_IS_INVALID = '91702';
|
90 |
+
const CREDIT_CARD_CANNOT_UPDATE_CARD_USING_PAYMENT_METHOD_NONCE = '91735';
|
91 |
+
const CREDIT_CARD_CARDHOLDER_NAME_IS_TOO_LONG = '81723';
|
92 |
+
const CREDIT_CARD_CREDIT_CARD_TYPE_IS_NOT_ACCEPTED = '81703';
|
93 |
+
const CREDIT_CARD_CREDIT_CARD_TYPE_IS_NOT_ACCEPTED_BY_SUBSCRIPTION_MERCHANT_ACCOUNT = '81718';
|
94 |
+
const CREDIT_CARD_CUSTOMER_ID_IS_INVALID = '91705';
|
95 |
+
const CREDIT_CARD_CUSTOMER_ID_IS_REQUIRED = '91704';
|
96 |
+
const CREDIT_CARD_CVV_IS_INVALID = '81707';
|
97 |
+
const CREDIT_CARD_CVV_IS_REQUIRED = '81706';
|
98 |
+
const CREDIT_CARD_CVV_VERIFICATION_FAILED = '81736';
|
99 |
+
const CREDIT_CARD_DUPLICATE_CARD_EXISTS = '81724';
|
100 |
+
const CREDIT_CARD_EXPIRATION_DATE_CONFLICT = '91708';
|
101 |
+
const CREDIT_CARD_EXPIRATION_DATE_IS_INVALID = '81710';
|
102 |
+
const CREDIT_CARD_EXPIRATION_DATE_IS_REQUIRED = '81709';
|
103 |
+
const CREDIT_CARD_EXPIRATION_DATE_YEAR_IS_INVALID = '81711';
|
104 |
+
const CREDIT_CARD_EXPIRATION_MONTH_IS_INVALID = '81712';
|
105 |
+
const CREDIT_CARD_EXPIRATION_YEAR_IS_INVALID = '81713';
|
106 |
+
const CREDIT_CARD_INVALID_PARAMS_FOR_CREDIT_CARD_UPDATE = '91745';
|
107 |
+
const CREDIT_CARD_INVALID_VENMO_SDK_PAYMENT_METHOD_CODE = '91727';
|
108 |
+
const CREDIT_CARD_NUMBER_INVALID_LENGTH = '81716';
|
109 |
+
const CREDIT_CARD_NUMBER_IS_INVALID = '81715';
|
110 |
+
const CREDIT_CARD_NUMBER_IS_PROHIBITED = '81750';
|
111 |
+
const CREDIT_CARD_NUMBER_IS_REQUIRED = '81714';
|
112 |
+
const CREDIT_CARD_NUMBER_LENGTH_IS_INVALID = '81716';
|
113 |
+
const CREDIT_CARD_NUMBER_MUST_BE_TEST_NUMBER = '81717';
|
114 |
+
const CREDIT_CARD_OPTIONS_UPDATE_EXISTING_TOKEN_IS_INVALID = '91723';
|
115 |
+
const CREDIT_CARD_OPTIONS_UPDATE_EXISTING_TOKEN_NOT_ALLOWED = '91729';
|
116 |
+
const CREDIT_CARD_OPTIONS_VERIFICATION_AMOUNT_CANNOT_BE_NEGATIVE = '91739';
|
117 |
+
const CREDIT_CARD_OPTIONS_VERIFICATION_AMOUNT_FORMAT_IS_INVALID = '91740';
|
118 |
+
const CREDIT_CARD_OPTIONS_VERIFICATION_AMOUNT_IS_TOO_LARGE = '91752';
|
119 |
+
const CREDIT_CARD_OPTIONS_VERIFICATION_AMOUNT_NOT_SUPPORTED_BY_PROCESSOR = '91741';
|
120 |
+
const CREDIT_CARD_OPTIONS_VERIFICATION_MERCHANT_ACCOUNT_ID_IS_INVALID = '91728';
|
121 |
+
const CREDIT_CARD_OPTIONS_VERIFICATION_MERCHANT_ACCOUNT_IS_FORBIDDEN = '91743';
|
122 |
+
const CREDIT_CARD_OPTIONS_VERIFICATION_MERCHANT_ACCOUNT_IS_SUSPENDED = '91742';
|
123 |
+
const CREDIT_CARD_OPTIONS_VERIFICATION_MERCHANT_ACCOUNT_CANNOT_BE_SUB_MERCHANT_ACCOUNT = '91755';
|
124 |
+
const CREDIT_CARD_PAYMENT_METHOD_CONFLICT = '81725';
|
125 |
+
const CREDIT_CARD_PAYMENT_METHOD_IS_NOT_A_CREDIT_CARD = '91738';
|
126 |
+
const CREDIT_CARD_PAYMENT_METHOD_NONCE_CARD_TYPE_IS_NOT_ACCEPTED = '91734';
|
127 |
+
const CREDIT_CARD_PAYMENT_METHOD_NONCE_CONSUMED = '91731';
|
128 |
+
const CREDIT_CARD_PAYMENT_METHOD_NONCE_LOCKED = '91733';
|
129 |
+
const CREDIT_CARD_PAYMENT_METHOD_NONCE_UNKNOWN = '91732';
|
130 |
+
const CREDIT_CARD_POSTAL_CODE_VERIFICATION_FAILED = '81737';
|
131 |
+
const CREDIT_CARD_TOKEN_FORMAT_IS_INVALID = '91718';
|
132 |
+
const CREDIT_CARD_TOKEN_INVALID = '91718';
|
133 |
+
const CREDIT_CARD_TOKEN_IS_IN_USE = '91719';
|
134 |
+
const CREDIT_CARD_TOKEN_IS_NOT_ALLOWED = '91721';
|
135 |
+
const CREDIT_CARD_TOKEN_IS_REQUIRED = '91722';
|
136 |
+
const CREDIT_CARD_TOKEN_IS_TOO_LONG = '91720';
|
137 |
+
const CREDIT_CARD_VENMO_SDK_PAYMENT_METHOD_CODE_CARD_TYPE_IS_NOT_ACCEPTED = '91726';
|
138 |
+
const CREDIT_CARD_VERIFICATION_NOT_SUPPORTED_ON_THIS_MERCHANT_ACCOUNT = '91730';
|
139 |
|
140 |
const CUSTOMER_COMPANY_IS_TOO_LONG = '81601';
|
141 |
const CUSTOMER_CUSTOM_FIELD_IS_INVALID = '91602';
|
166 |
const DESCRIPTOR_INTERNATIONAL_PHONE_FORMAT_IS_INVALID = '92205';
|
167 |
const DESCRIPTOR_URL_FORMAT_IS_INVALID = '92206';
|
168 |
|
169 |
+
const DISPUTE_CAN_ONLY_ADD_EVIDENCE_TO_OPEN_DISPUTE = '95701';
|
170 |
+
const DISPUTE_CAN_ONLY_REMOVE_EVIDENCE_FROM_OPEN_DISPUTE = '95702';
|
171 |
+
const DISPUTE_CAN_ONLY_ADD_EVIDENCE_TO_DISPUTE = '95703';
|
172 |
+
const DISPUTE_CAN_ONLY_ACCEPT_OPEN_DISPUTE = '95704';
|
173 |
+
const DISPUTE_CAN_ONLY_FINALIZE_OPEN_DISPUTE = '95705';
|
174 |
+
|
175 |
+
const DOCUMENT_UPLOAD_KIND_IS_INVALID = '84901';
|
176 |
+
const DOCUMENT_UPLOAD_FILE_IS_TOO_LARGE = '84902';
|
177 |
+
const DOCUMENT_UPLOAD_FILE_TYPE_IS_INVALID = '84903';
|
178 |
+
const DOCUMENT_UPLOAD_FILE_IS_MALFORMED_OR_ENCRYPTED = '84904';
|
179 |
+
|
180 |
const INDUSTRY_DATA_INDUSTRY_TYPE_IS_INVALID = '93401';
|
181 |
const INDUSTRY_DATA_LODGING_EMPTY_DATA = '93402';
|
182 |
const INDUSTRY_DATA_LODGING_FOLIO_NUMBER_IS_INVALID = '93403';
|
200 |
const MERCHANT_COUNTRY_CODE_NUMERIC_IS_NOT_ACCEPTED = '93608';
|
201 |
const MERCHANT_COUNTRY_NAME_IS_INVALID = '93611';
|
202 |
const MERCHANT_COUNTRY_NAME_IS_NOT_ACCEPTED = '93610';
|
203 |
+
const MERCHANT_CURRENCIES_ARE_INVALID = '93614';
|
204 |
const MERCHANT_EMAIL_FORMAT_IS_INVALID = '93602';
|
205 |
const MERCHANT_EMAIL_IS_REQUIRED = '83601';
|
206 |
const MERCHANT_INCONSISTENT_COUNTRY = '93612';
|
207 |
const MERCHANT_ACCOUNT_PAYMENT_METHODS_ARE_INVALID = '93613';
|
208 |
+
const MERCHANT_PAYMENT_METHODS_ARE_NOT_ALLOWED = '93615';
|
209 |
+
const MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_CURRENCY = '93616';
|
210 |
+
const MERCHANT_CURRENCY_IS_REQUIRED = '93617';
|
211 |
+
const MERCHANT_CURRENCY_IS_INVALID = '93618';
|
212 |
+
const MERCHANT_NO_MERCHANT_ACCOUNTS = '93619';
|
213 |
+
const MERCHANT_MERCHANT_ACCOUNT_EXISTS_FOR_ID = '93620';
|
214 |
+
const MERCHANT_MERCHANT_ACCOUNT_NOT_AUTH_ONBOARDED = '93621';
|
215 |
|
216 |
const MERCHANT_ACCOUNT_ID_FORMAT_IS_INVALID = '82603';
|
217 |
const MERCHANT_ACCOUNT_ID_IS_IN_USE = '82604';
|
320 |
const PAYMENT_METHOD_PAYMENT_METHOD_NONCE_UNKNOWN = '93108';
|
321 |
const PAYMENT_METHOD_PAYMENT_METHOD_NONCE_LOCKED = '93109';
|
322 |
const PAYMENT_METHOD_PAYMENT_METHOD_PARAMS_ARE_REQUIRED = '93101';
|
323 |
+
const PAYMENT_METHOD_NO_LONGER_SUPPORTED = '93117';
|
324 |
|
325 |
const PAYPAL_ACCOUNT_AUTH_EXPIRED = '92911';
|
326 |
const PAYPAL_ACCOUNT_CANNOT_HAVE_BOTH_ACCESS_TOKEN_AND_CONSENT_CODE = '82903';
|
425 |
|
426 |
const TRANSACTION_AMOUNT_CANNOT_BE_NEGATIVE = '81501';
|
427 |
const TRANSACTION_AMOUNT_DOES_NOT_MATCH3_D_SECURE_AMOUNT = '91585';
|
428 |
+
const TRANSACTION_AMOUNT_DOES_NOT_MATCH_IDEAL_PAYMENT_AMOUNT = '915144';
|
429 |
const TRANSACTION_AMOUNT_FORMAT_IS_INVALID = '81503';
|
430 |
const TRANSACTION_AMOUNT_IS_INVALID = '81503';
|
431 |
const TRANSACTION_AMOUNT_IS_REQUIRED = '81502';
|
435 |
const TRANSACTION_CANNOT_BE_VOIDED = '91504';
|
436 |
const TRANSACTION_CANNOT_CANCEL_RELEASE = '91562';
|
437 |
const TRANSACTION_CANNOT_CLONE_CREDIT = '91543';
|
438 |
+
const TRANSACTION_CANNOT_CLONE_MARKETPLACE_TRANSACTION = '915137';
|
439 |
const TRANSACTION_CANNOT_CLONE_TRANSACTION_WITH_PAYPAL_ACCOUNT = '91573';
|
440 |
const TRANSACTION_CANNOT_CLONE_TRANSACTION_WITH_VAULT_CREDIT_CARD = '91540';
|
441 |
const TRANSACTION_CANNOT_CLONE_UNSUCCESSFUL_TRANSACTION = '91542';
|
451 |
const TRANSACTION_CANNOT_SIMULATE_SETTLEMENT = '91575';
|
452 |
const TRANSACTION_CANNOT_SUBMIT_FOR_PARTIAL_SETTLEMENT = '915103';
|
453 |
const TRANSACTION_CANNOT_SUBMIT_FOR_SETTLEMENT = '91507';
|
454 |
+
const TRANSACTION_CANNOT_UPDATE_DETAILS_NOT_SUBMITTED_FOR_SETTLEMENT = '915129';
|
455 |
const TRANSACTION_CHANNEL_IS_TOO_LONG = '91550';
|
456 |
const TRANSACTION_CREDIT_CARD_IS_REQUIRED = '91508';
|
457 |
const TRANSACTION_CUSTOMER_DEFAULT_PAYMENT_METHOD_CARD_TYPE_IS_NOT_ACCEPTED = '81509';
|
460 |
const TRANSACTION_CUSTOM_FIELD_IS_INVALID = '91526';
|
461 |
const TRANSACTION_CUSTOM_FIELD_IS_TOO_LONG = '81527';
|
462 |
const TRANSACTION_HAS_ALREADY_BEEN_REFUNDED = '91512';
|
463 |
+
const TRANSACTION_IDEAL_PAYMENT_NOT_COMPLETE = '815141';
|
464 |
+
const TRANSACTION_IDEAL_PAYMENTS_CANNOT_BE_VAULTED = '915150';
|
465 |
const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_MATCH3_D_SECURE_MERCHANT_ACCOUNT = '91584';
|
466 |
+
const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_MATCH_IDEAL_PAYMENT_MERCHANT_ACCOUNT = '915143';
|
467 |
const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_SUPPORT_MOTO = '91558';
|
468 |
const TRANSACTION_MERCHANT_ACCOUNT_DOES_NOT_SUPPORT_REFUNDS = '91547';
|
469 |
const TRANSACTION_MERCHANT_ACCOUNT_ID_IS_INVALID = '91513';
|
474 |
const TRANSACTION_OPTIONS_SUBMIT_FOR_SETTLEMENT_IS_REQUIRED_FOR_PAYPAL_UNILATERAL = '91582';
|
475 |
const TRANSACTION_OPTIONS_USE_BILLING_FOR_SHIPPING_DISABLED = '91572';
|
476 |
const TRANSACTION_OPTIONS_VAULT_IS_DISABLED = '91525';
|
477 |
+
const TRANSACTION_ORDER_ID_DOES_NOT_MATCH_IDEAL_PAYMENT_ORDER_ID = '91503';
|
478 |
+
const TRANSACTION_ORDER_ID_IS_REQUIRED_WITH_IDEAL_PAYMENT = '91502';
|
479 |
const TRANSACTION_ORDER_ID_IS_TOO_LONG = '91501';
|
480 |
const TRANSACTION_PAYMENT_INSTRUMENT_NOT_SUPPORTED_BY_MERCHANT_ACCOUNT = '91577';
|
481 |
const TRANSACTION_PAYMENT_INSTRUMENT_TYPE_IS_NOT_ACCEPTED = '915101';
|
500 |
const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_PARTIAL_SETTLEMENT = '915102';
|
501 |
const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_UPDATING_ORDER_ID = '915107';
|
502 |
const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_UPDATING_DESCRIPTOR = '915108';
|
503 |
+
const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_UPDATING_DETAILS = '915130';
|
504 |
const TRANSACTION_PROCESSOR_DOES_NOT_SUPPORT_VOICE_AUTHORIZATIONS = '91545';
|
505 |
const TRANSACTION_PURCHASE_ORDER_NUMBER_IS_INVALID = '91548';
|
506 |
const TRANSACTION_PURCHASE_ORDER_NUMBER_IS_TOO_LONG = '91537';
|
522 |
const TRANSACTION_TAX_AMOUNT_FORMAT_IS_INVALID = '81535';
|
523 |
const TRANSACTION_TAX_AMOUNT_IS_TOO_LARGE = '81536';
|
524 |
|
525 |
+
const TRANSACTION_THREE_D_SECURE_AUTHENTICATION_FAILED = '81571';
|
526 |
+
const TRANSACTION_THREE_D_SECURE_TOKEN_IS_INVALID = '91568';
|
527 |
+
const TRANSACTION_THREE_D_SECURE_TRANSACTION_DATA_DOESNT_MATCH_VERIFY = '91570';
|
528 |
+
const TRANSACTION_THREE_D_SECURE_ECI_FLAG_IS_REQUIRED = '915113';
|
529 |
+
const TRANSACTION_THREE_D_SECURE_CAVV_IS_REQUIRED = '915116';
|
530 |
+
const TRANSACTION_THREE_D_SECURE_XID_IS_REQUIRED = '915115';
|
531 |
+
const TRANSACTION_THREE_D_SECURE_ECI_FLAG_IS_INVALID = '915114';
|
532 |
+
const TRANSACTION_THREE_D_SECURE_MERCHANT_ACCOUNT_DOES_NOT_SUPPORT_CARD_TYPE = '915131';
|
533 |
+
const TRANSACTION_TYPE_IS_INVALID = '91523';
|
534 |
+
const TRANSACTION_TYPE_IS_REQUIRED = '91524';
|
535 |
+
const TRANSACTION_UNSUPPORTED_VOICE_AUTHORIZATION = '91539';
|
536 |
|
537 |
+
const VERIFICATION_OPTIONS_AMOUNT_CANNOT_BE_NEGATIVE = '94201';
|
538 |
+
const VERIFICATION_OPTIONS_AMOUNT_FORMAT_IS_INVALID = '94202';
|
539 |
+
const VERIFICATION_OPTIONS_AMOUNT_IS_TOO_LARGE = '94207';
|
540 |
+
const VERIFICATION_OPTIONS_AMOUNT_NOT_SUPPORTED_BY_PROCESSOR = '94203';
|
541 |
+
const VERIFICATION_OPTIONS_MERCHANT_ACCOUNT_ID_IS_INVALID = '94204';
|
542 |
+
const VERIFICATION_OPTIONS_MERCHANT_ACCOUNT_IS_SUSPENDED = '94205';
|
543 |
+
const VERIFICATION_OPTIONS_MERCHANT_ACCOUNT_IS_FORBIDDEN = '94206';
|
544 |
+
const VERIFICATION_OPTIONS_MERCHANT_ACCOUNT_CANNOT_BE_SUB_MERCHANT_ACCOUNT = '94208';
|
545 |
}
|
546 |
class_alias('Braintree\Error\Codes', 'Braintree_Error_Codes');
|
lib/Braintree/Error/ErrorCollection.php
CHANGED
@@ -13,11 +13,10 @@ use Braintree\Util;
|
|
13 |
* @package Braintree
|
14 |
* @subpackage Errors
|
15 |
* @category Errors
|
16 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
17 |
*
|
18 |
* @property-read object $errors
|
19 |
*/
|
20 |
-
class ErrorCollection
|
21 |
{
|
22 |
private $_errors;
|
23 |
|
@@ -27,6 +26,16 @@ class ErrorCollection
|
|
27 |
new ValidationErrorCollection($errorData);
|
28 |
}
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
/**
|
32 |
* Returns all of the validation errors at all levels of nesting in a single, flat array.
|
13 |
* @package Braintree
|
14 |
* @subpackage Errors
|
15 |
* @category Errors
|
|
|
16 |
*
|
17 |
* @property-read object $errors
|
18 |
*/
|
19 |
+
class ErrorCollection implements \Countable
|
20 |
{
|
21 |
private $_errors;
|
22 |
|
26 |
new ValidationErrorCollection($errorData);
|
27 |
}
|
28 |
|
29 |
+
/**
|
30 |
+
* Return count of items in collection
|
31 |
+
* Implements countable
|
32 |
+
*
|
33 |
+
* @return integer
|
34 |
+
*/
|
35 |
+
public function count()
|
36 |
+
{
|
37 |
+
return $this->deepSize();
|
38 |
+
}
|
39 |
|
40 |
/**
|
41 |
* Returns all of the validation errors at all levels of nesting in a single, flat array.
|
lib/Braintree/Error/Validation.php
CHANGED
@@ -13,7 +13,6 @@ use Braintree\Util;
|
|
13 |
*
|
14 |
* @package Braintree
|
15 |
* @subpackage Error
|
16 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
17 |
*
|
18 |
* @property-read string $attribute
|
19 |
* @property-read string $code
|
13 |
*
|
14 |
* @package Braintree
|
15 |
* @subpackage Error
|
|
|
16 |
*
|
17 |
* @property-read string $attribute
|
18 |
* @property-read string $code
|
lib/Braintree/Error/ValidationErrorCollection.php
CHANGED
@@ -12,7 +12,6 @@ use Braintree\Collection;
|
|
12 |
*
|
13 |
* @package Braintree
|
14 |
* @subpackage Error
|
15 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
16 |
*
|
17 |
* @property-read array $errors
|
18 |
* @property-read array $nested
|
12 |
*
|
13 |
* @package Braintree
|
14 |
* @subpackage Error
|
|
|
15 |
*
|
16 |
* @property-read array $errors
|
17 |
* @property-read array $nested
|
lib/Braintree/EuropeBankAccount.php
CHANGED
@@ -11,7 +11,6 @@ namespace Braintree;
|
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*
|
16 |
* @property-read string $account-holder-name
|
17 |
* @property-read string $bic
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
|
|
14 |
*
|
15 |
* @property-read string $account-holder-name
|
16 |
* @property-read string $bic
|
lib/Braintree/Exception.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @subpackage Exception
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
class Exception extends \Exception
|
12 |
{
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @subpackage Exception
|
|
|
9 |
*/
|
10 |
class Exception extends \Exception
|
11 |
{
|
lib/Braintree/Exception/Authentication.php
CHANGED
@@ -9,7 +9,6 @@ use Braintree\Exception;
|
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Exception
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*/
|
14 |
class Authentication extends Exception
|
15 |
{
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Exception
|
|
|
12 |
*/
|
13 |
class Authentication extends Exception
|
14 |
{
|
lib/Braintree/Exception/Authorization.php
CHANGED
@@ -11,7 +11,6 @@ use Braintree\Exception;
|
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @subpackage Exception
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*/
|
16 |
class Authorization extends Exception
|
17 |
{
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @subpackage Exception
|
|
|
14 |
*/
|
15 |
class Authorization extends Exception
|
16 |
{
|
lib/Braintree/Exception/Connection.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree\Exception;
|
3 |
+
|
4 |
+
use Braintree\Exception;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Raised when the connection fails
|
8 |
+
*
|
9 |
+
* @package Braintree
|
10 |
+
* @subpackage Exception
|
11 |
+
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
+
*/
|
13 |
+
class Connection extends Exception
|
14 |
+
{
|
15 |
+
|
16 |
+
}
|
17 |
+
class_alias('Braintree\Exception\Connection', 'Braintree_Exception_Connection');
|
lib/Braintree/Exception/DownForMaintenance.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Exception;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
class DownForMaintenance extends Exception
|
14 |
{
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
|
|
11 |
*/
|
12 |
class DownForMaintenance extends Exception
|
13 |
{
|
lib/Braintree/Exception/ForgedQueryString.php
CHANGED
@@ -12,7 +12,6 @@ use Braintree\Exception;
|
|
12 |
*
|
13 |
* @package Braintree
|
14 |
* @subpackage Exception
|
15 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
16 |
*/
|
17 |
class ForgedQueryString extends Exception
|
18 |
{
|
12 |
*
|
13 |
* @package Braintree
|
14 |
* @subpackage Exception
|
|
|
15 |
*/
|
16 |
class ForgedQueryString extends Exception
|
17 |
{
|
lib/Braintree/Exception/NotFound.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Exception;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
class NotFound extends Exception
|
14 |
{
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
|
|
11 |
*/
|
12 |
class NotFound extends Exception
|
13 |
{
|
lib/Braintree/Exception/SSLCaFileNotFound.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Exception;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
class SSLCaFileNotFound extends Exception
|
14 |
{
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
|
|
11 |
*/
|
12 |
class SSLCaFileNotFound extends Exception
|
13 |
{
|
lib/Braintree/Exception/SSLCertificate.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Exception;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
class SSLCertificate extends Exception
|
14 |
{
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
|
|
11 |
*/
|
12 |
class SSLCertificate extends Exception
|
13 |
{
|
lib/Braintree/Exception/ServerError.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Exception;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
class ServerError extends Exception
|
14 |
{
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
|
|
11 |
*/
|
12 |
class ServerError extends Exception
|
13 |
{
|
lib/Braintree/Exception/TestOperationPerformedInProduction.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Exception;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
class TestOperationPerformedInProduction extends Exception
|
14 |
{
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
|
|
11 |
*/
|
12 |
class TestOperationPerformedInProduction extends Exception
|
13 |
{
|
lib/Braintree/Exception/Timeout.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree\Exception;
|
3 |
+
|
4 |
+
use Braintree\Exception;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Raised when a Timeout occurs
|
8 |
+
*
|
9 |
+
* @package Braintree
|
10 |
+
* @subpackage Exception
|
11 |
+
*/
|
12 |
+
class Timeout extends Exception
|
13 |
+
{
|
14 |
+
|
15 |
+
}
|
16 |
+
class_alias('Braintree\Exception\Timeout', 'Braintree_Exception_Timeout');
|
lib/Braintree/Exception/TooManyRequests.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree\Exception;
|
3 |
+
|
4 |
+
use Braintree\Exception;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Raised when the gateway request rate-limit is exceeded.
|
8 |
+
*
|
9 |
+
* @package Braintree
|
10 |
+
* @subpackage Exception
|
11 |
+
*/
|
12 |
+
class TooManyRequests extends Exception
|
13 |
+
{
|
14 |
+
|
15 |
+
}
|
16 |
+
class_alias('Braintree\Exception\TooManyRequests', 'Braintree_Exception_TooManyRequests');
|
lib/Braintree/Exception/Unexpected.php
CHANGED
@@ -9,7 +9,6 @@ use Braintree\Exception;
|
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Exception
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*/
|
14 |
class Unexpected extends Exception
|
15 |
{
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Exception
|
|
|
12 |
*/
|
13 |
class Unexpected extends Exception
|
14 |
{
|
lib/Braintree/Exception/UpgradeRequired.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Exception;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
class UpgradeRequired extends Exception
|
14 |
{
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
|
|
11 |
*/
|
12 |
class UpgradeRequired extends Exception
|
13 |
{
|
lib/Braintree/Exception/ValidationsFailed.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Exception;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
class ValidationsFailed extends Exception
|
14 |
{
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Exception
|
|
|
11 |
*/
|
12 |
class ValidationsFailed extends Exception
|
13 |
{
|
lib/Braintree/FacilitatedDetails.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
class FacilitatedDetails extends Base
|
5 |
+
{
|
6 |
+
public static function factory($attributes)
|
7 |
+
{
|
8 |
+
$instance = new self();
|
9 |
+
$instance->_initialize($attributes);
|
10 |
+
return $instance;
|
11 |
+
}
|
12 |
+
|
13 |
+
protected function _initialize($attributes)
|
14 |
+
{
|
15 |
+
$this->_attributes = $attributes;
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* returns a string representation of the facilitated details
|
20 |
+
* @return string
|
21 |
+
*/
|
22 |
+
public function __toString()
|
23 |
+
{
|
24 |
+
return __CLASS__ . '[' .
|
25 |
+
Util::attributesToString($this->_attributes) .']';
|
26 |
+
}
|
27 |
+
|
28 |
+
}
|
29 |
+
class_alias('Braintree\FacilitatedDetails', 'Braintree_FacilitatedDetails');
|
lib/Braintree/FacilitatorDetails.php
CHANGED
@@ -17,7 +17,7 @@ class FacilitatorDetails extends Base
|
|
17 |
}
|
18 |
|
19 |
/**
|
20 |
-
* returns a string representation of the
|
21 |
* @return string
|
22 |
*/
|
23 |
public function __toString()
|
17 |
}
|
18 |
|
19 |
/**
|
20 |
+
* returns a string representation of the facilitator details
|
21 |
* @return string
|
22 |
*/
|
23 |
public function __toString()
|
lib/Braintree/Gateway.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
class Gateway
|
12 |
{
|
@@ -42,6 +41,15 @@ class Gateway
|
|
42 |
return new AddressGateway($this);
|
43 |
}
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
/**
|
46 |
*
|
47 |
* @return ClientTokenGateway
|
@@ -87,6 +95,24 @@ class Gateway
|
|
87 |
return new DiscountGateway($this);
|
88 |
}
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
/**
|
91 |
*
|
92 |
* @return MerchantGateway
|
@@ -194,5 +220,32 @@ class Gateway
|
|
194 |
{
|
195 |
return new TransparentRedirectGateway($this);
|
196 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
}
|
198 |
class_alias('Braintree\Gateway', 'Braintree_Gateway');
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
|
|
9 |
*/
|
10 |
class Gateway
|
11 |
{
|
41 |
return new AddressGateway($this);
|
42 |
}
|
43 |
|
44 |
+
/**
|
45 |
+
*
|
46 |
+
* @return ApplePayGateway
|
47 |
+
*/
|
48 |
+
public function applePay()
|
49 |
+
{
|
50 |
+
return new ApplePayGateway($this);
|
51 |
+
}
|
52 |
+
|
53 |
/**
|
54 |
*
|
55 |
* @return ClientTokenGateway
|
95 |
return new DiscountGateway($this);
|
96 |
}
|
97 |
|
98 |
+
/**
|
99 |
+
*
|
100 |
+
* @return DisputeGateway
|
101 |
+
*/
|
102 |
+
public function dispute()
|
103 |
+
{
|
104 |
+
return new DisputeGateway($this);
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
*
|
109 |
+
* @return DocumentUploadGateway
|
110 |
+
*/
|
111 |
+
public function documentUpload()
|
112 |
+
{
|
113 |
+
return new DocumentUploadGateway($this);
|
114 |
+
}
|
115 |
+
|
116 |
/**
|
117 |
*
|
118 |
* @return MerchantGateway
|
220 |
{
|
221 |
return new TransparentRedirectGateway($this);
|
222 |
}
|
223 |
+
|
224 |
+
/**
|
225 |
+
*
|
226 |
+
* @return UsBankAccountGateway
|
227 |
+
*/
|
228 |
+
public function usBankAccount()
|
229 |
+
{
|
230 |
+
return new UsBankAccountGateway($this);
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
*
|
235 |
+
* @return IdealPaymentGateway
|
236 |
+
*/
|
237 |
+
public function idealPayment()
|
238 |
+
{
|
239 |
+
return new IdealPaymentGateway($this);
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
*
|
244 |
+
* @return WebhookNotificationGateway
|
245 |
+
*/
|
246 |
+
public function webhookNotification()
|
247 |
+
{
|
248 |
+
return new WebhookNotificationGateway($this);
|
249 |
+
}
|
250 |
}
|
251 |
class_alias('Braintree\Gateway', 'Braintree_Gateway');
|
lib/Braintree/Http.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
|
|
|
|
4 |
/**
|
5 |
* Braintree HTTP Client
|
6 |
* processes Http requests using curl
|
7 |
-
*
|
8 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
9 |
*/
|
10 |
class Http
|
11 |
{
|
@@ -17,11 +17,14 @@ class Http
|
|
17 |
$this->_config = $config;
|
18 |
}
|
19 |
|
20 |
-
public function delete($path)
|
21 |
{
|
22 |
-
$response = $this->_doRequest('DELETE', $path);
|
23 |
-
|
|
|
24 |
return true;
|
|
|
|
|
25 |
} else {
|
26 |
Util::throwStatusCodeException($response['status']);
|
27 |
}
|
@@ -41,7 +44,18 @@ class Http
|
|
41 |
{
|
42 |
$response = $this->_doRequest('POST', $path, $this->_buildXml($params));
|
43 |
$responseCode = $response['status'];
|
44 |
-
if($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
return Xml::buildArrayFromXml($response['body']);
|
46 |
} else {
|
47 |
Util::throwStatusCodeException($responseCode);
|
@@ -52,7 +66,7 @@ class Http
|
|
52 |
{
|
53 |
$response = $this->_doRequest('PUT', $path, $this->_buildXml($params));
|
54 |
$responseCode = $response['status'];
|
55 |
-
if($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) {
|
56 |
return Xml::buildArrayFromXml($response['body']);
|
57 |
} else {
|
58 |
Util::throwStatusCodeException($responseCode);
|
@@ -68,7 +82,6 @@ class Http
|
|
68 |
{
|
69 |
return [
|
70 |
'Accept: application/xml',
|
71 |
-
'Content-Type: application/xml',
|
72 |
];
|
73 |
}
|
74 |
|
@@ -96,18 +109,24 @@ class Http
|
|
96 |
$this->_useClientCredentials = true;
|
97 |
}
|
98 |
|
99 |
-
private function _doRequest($httpVerb, $path, $requestBody = null)
|
100 |
{
|
101 |
-
return $this->_doUrlRequest($httpVerb, $this->_config->baseUrl() . $path, $requestBody);
|
102 |
}
|
103 |
|
104 |
-
public function _doUrlRequest($httpVerb, $url, $requestBody = null)
|
105 |
{
|
106 |
$curl = curl_init();
|
107 |
-
curl_setopt($curl, CURLOPT_TIMEOUT,
|
108 |
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $httpVerb);
|
109 |
curl_setopt($curl, CURLOPT_URL, $url);
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
$headers = $this->_getHeaders($curl);
|
113 |
$headers[] = 'User-Agent: Braintree PHP Library ' . Version::get();
|
@@ -120,41 +139,103 @@ class Http
|
|
120 |
} else if (isset($authorization['token'])) {
|
121 |
$headers[] = 'Authorization: Bearer ' . $authorization['token'];
|
122 |
}
|
123 |
-
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
124 |
|
125 |
-
// curl_setopt($curl, CURLOPT_VERBOSE, true);
|
126 |
if ($this->_config->sslOn()) {
|
127 |
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
|
128 |
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
|
129 |
curl_setopt($curl, CURLOPT_CAINFO, $this->getCaFile());
|
130 |
}
|
131 |
|
132 |
-
if(!empty($
|
|
|
|
|
|
|
|
|
|
|
133 |
curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody);
|
134 |
}
|
135 |
|
136 |
-
if($this->_config->isUsingProxy()) {
|
137 |
$proxyHost = $this->_config->getProxyHost();
|
138 |
$proxyPort = $this->_config->getProxyPort();
|
139 |
$proxyType = $this->_config->getProxyType();
|
|
|
|
|
140 |
curl_setopt($curl, CURLOPT_PROXY, $proxyHost . ':' . $proxyPort);
|
141 |
-
if(!empty($proxyType)) {
|
142 |
curl_setopt($curl, CURLOPT_PROXYTYPE, $proxyType);
|
143 |
}
|
|
|
|
|
|
|
144 |
}
|
145 |
|
|
|
146 |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
147 |
$response = curl_exec($curl);
|
148 |
$httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
curl_close($curl);
|
150 |
if ($this->_config->sslOn()) {
|
151 |
if ($httpStatus == 0) {
|
152 |
-
throw new Exception\SSLCertificate();
|
153 |
}
|
|
|
|
|
154 |
}
|
|
|
155 |
return ['status' => $httpStatus, 'body' => $response];
|
156 |
}
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
private function getCaFile()
|
159 |
{
|
160 |
static $memo;
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
+
use finfo;
|
5 |
+
|
6 |
/**
|
7 |
* Braintree HTTP Client
|
8 |
* processes Http requests using curl
|
|
|
|
|
9 |
*/
|
10 |
class Http
|
11 |
{
|
17 |
$this->_config = $config;
|
18 |
}
|
19 |
|
20 |
+
public function delete($path, $params = null)
|
21 |
{
|
22 |
+
$response = $this->_doRequest('DELETE', $path, $this->_buildXml($params));
|
23 |
+
$responseCode = $response['status'];
|
24 |
+
if ($responseCode === 200 || $responseCode === 204) {
|
25 |
return true;
|
26 |
+
} else if ($responseCode === 422) {
|
27 |
+
return Xml::buildArrayFromXml($response['body']);
|
28 |
} else {
|
29 |
Util::throwStatusCodeException($response['status']);
|
30 |
}
|
44 |
{
|
45 |
$response = $this->_doRequest('POST', $path, $this->_buildXml($params));
|
46 |
$responseCode = $response['status'];
|
47 |
+
if ($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) {
|
48 |
+
return Xml::buildArrayFromXml($response['body']);
|
49 |
+
} else {
|
50 |
+
Util::throwStatusCodeException($responseCode);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
public function postMultipart($path, $params, $file)
|
55 |
+
{
|
56 |
+
$response = $this->_doRequest('POST', $path, $params, $file);
|
57 |
+
$responseCode = $response['status'];
|
58 |
+
if ($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) {
|
59 |
return Xml::buildArrayFromXml($response['body']);
|
60 |
} else {
|
61 |
Util::throwStatusCodeException($responseCode);
|
66 |
{
|
67 |
$response = $this->_doRequest('PUT', $path, $this->_buildXml($params));
|
68 |
$responseCode = $response['status'];
|
69 |
+
if ($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) {
|
70 |
return Xml::buildArrayFromXml($response['body']);
|
71 |
} else {
|
72 |
Util::throwStatusCodeException($responseCode);
|
82 |
{
|
83 |
return [
|
84 |
'Accept: application/xml',
|
|
|
85 |
];
|
86 |
}
|
87 |
|
109 |
$this->_useClientCredentials = true;
|
110 |
}
|
111 |
|
112 |
+
private function _doRequest($httpVerb, $path, $requestBody = null, $file = null)
|
113 |
{
|
114 |
+
return $this->_doUrlRequest($httpVerb, $this->_config->baseUrl() . $path, $requestBody, $file);
|
115 |
}
|
116 |
|
117 |
+
public function _doUrlRequest($httpVerb, $url, $requestBody = null, $file = null)
|
118 |
{
|
119 |
$curl = curl_init();
|
120 |
+
curl_setopt($curl, CURLOPT_TIMEOUT, $this->_config->timeout());
|
121 |
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $httpVerb);
|
122 |
curl_setopt($curl, CURLOPT_URL, $url);
|
123 |
+
|
124 |
+
if ($this->_config->acceptGzipEncoding()) {
|
125 |
+
curl_setopt($curl, CURLOPT_ENCODING, 'gzip');
|
126 |
+
}
|
127 |
+
if ($this->_config->sslVersion()) {
|
128 |
+
curl_setopt($curl, CURLOPT_SSLVERSION, $this->_config->sslVersion());
|
129 |
+
}
|
130 |
|
131 |
$headers = $this->_getHeaders($curl);
|
132 |
$headers[] = 'User-Agent: Braintree PHP Library ' . Version::get();
|
139 |
} else if (isset($authorization['token'])) {
|
140 |
$headers[] = 'Authorization: Bearer ' . $authorization['token'];
|
141 |
}
|
|
|
142 |
|
|
|
143 |
if ($this->_config->sslOn()) {
|
144 |
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
|
145 |
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
|
146 |
curl_setopt($curl, CURLOPT_CAINFO, $this->getCaFile());
|
147 |
}
|
148 |
|
149 |
+
if (!empty($file)) {
|
150 |
+
$boundary = "---------------------" . md5(mt_rand() . microtime());
|
151 |
+
$headers[] = "Content-Type: multipart/form-data; boundary={$boundary}";
|
152 |
+
$this->prepareMultipart($curl, $requestBody, $file, $boundary);
|
153 |
+
} else if (!empty($requestBody)) {
|
154 |
+
$headers[] = 'Content-Type: application/xml';
|
155 |
curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody);
|
156 |
}
|
157 |
|
158 |
+
if ($this->_config->isUsingProxy()) {
|
159 |
$proxyHost = $this->_config->getProxyHost();
|
160 |
$proxyPort = $this->_config->getProxyPort();
|
161 |
$proxyType = $this->_config->getProxyType();
|
162 |
+
$proxyUser = $this->_config->getProxyUser();
|
163 |
+
$proxyPwd= $this->_config->getProxyPassword();
|
164 |
curl_setopt($curl, CURLOPT_PROXY, $proxyHost . ':' . $proxyPort);
|
165 |
+
if (!empty($proxyType)) {
|
166 |
curl_setopt($curl, CURLOPT_PROXYTYPE, $proxyType);
|
167 |
}
|
168 |
+
if ($this->_config->isAuthenticatedProxy()) {
|
169 |
+
curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyUser . ':' . $proxyPwd);
|
170 |
+
}
|
171 |
}
|
172 |
|
173 |
+
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
174 |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
175 |
$response = curl_exec($curl);
|
176 |
$httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
177 |
+
$error_code = curl_errno($curl);
|
178 |
+
$error = curl_error($curl);
|
179 |
+
|
180 |
+
if ($error_code == 28 && $httpStatus == 0) {
|
181 |
+
throw new Exception\Timeout();
|
182 |
+
}
|
183 |
+
|
184 |
curl_close($curl);
|
185 |
if ($this->_config->sslOn()) {
|
186 |
if ($httpStatus == 0) {
|
187 |
+
throw new Exception\SSLCertificate($error, $error_code);
|
188 |
}
|
189 |
+
} else if ($error_code) {
|
190 |
+
throw new Exception\Connection($error, $error_code);
|
191 |
}
|
192 |
+
|
193 |
return ['status' => $httpStatus, 'body' => $response];
|
194 |
}
|
195 |
|
196 |
+
function prepareMultipart($ch, $requestBody, $file, $boundary) {
|
197 |
+
$disallow = ["\0", "\"", "\r", "\n"];
|
198 |
+
$fileInfo = new finfo(FILEINFO_MIME_TYPE);
|
199 |
+
$filePath = stream_get_meta_data($file)['uri'];
|
200 |
+
$data = file_get_contents($filePath);
|
201 |
+
$mimeType = $fileInfo->buffer($data);
|
202 |
+
|
203 |
+
// build normal parameters
|
204 |
+
foreach ($requestBody as $k => $v) {
|
205 |
+
$k = str_replace($disallow, "_", $k);
|
206 |
+
$body[] = implode("\r\n", [
|
207 |
+
"Content-Disposition: form-data; name=\"{$k}\"",
|
208 |
+
"",
|
209 |
+
filter_var($v),
|
210 |
+
]);
|
211 |
+
}
|
212 |
+
|
213 |
+
// build file parameter
|
214 |
+
$filePath = call_user_func("end", explode(DIRECTORY_SEPARATOR, $filePath));
|
215 |
+
$filePath = str_replace($disallow, "_", $filePath);
|
216 |
+
$body[] = implode("\r\n", [
|
217 |
+
"Content-Disposition: form-data; name=\"file\"; filename=\"{$filePath}\"",
|
218 |
+
"Content-Type: {$mimeType}",
|
219 |
+
"",
|
220 |
+
$data,
|
221 |
+
]);
|
222 |
+
|
223 |
+
// add boundary for each parameters
|
224 |
+
array_walk($body, function (&$part) use ($boundary) {
|
225 |
+
$part = "--{$boundary}\r\n{$part}";
|
226 |
+
});
|
227 |
+
|
228 |
+
// add final boundary
|
229 |
+
$body[] = "--{$boundary}--";
|
230 |
+
$body[] = "";
|
231 |
+
|
232 |
+
// set options
|
233 |
+
return curl_setopt_array($ch, [
|
234 |
+
CURLOPT_POST => true,
|
235 |
+
CURLOPT_POSTFIELDS => implode("\r\n", $body)
|
236 |
+
]);
|
237 |
+
}
|
238 |
+
|
239 |
private function getCaFile()
|
240 |
{
|
241 |
static $memo;
|
lib/Braintree/IbanBankAccount.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Braintree IbanBankAccount module
|
6 |
+
* PHP Version 5
|
7 |
+
*
|
8 |
+
* @package Braintree
|
9 |
+
*
|
10 |
+
* @property-read string $maskedIban
|
11 |
+
* @property-read string $bic
|
12 |
+
* @property-read string $ibanCountry
|
13 |
+
* @property-read string $description
|
14 |
+
* @property-read string $ibanAccountNumberLast4
|
15 |
+
*/
|
16 |
+
class IbanBankAccount extends Base
|
17 |
+
{
|
18 |
+
/**
|
19 |
+
* create a printable representation of the object as:
|
20 |
+
* ClassName[property=value, property=value]
|
21 |
+
* @ignore
|
22 |
+
* @return string
|
23 |
+
*/
|
24 |
+
public function __toString()
|
25 |
+
{
|
26 |
+
return __CLASS__ . '[' .
|
27 |
+
Util::attributesToString($this->_attributes) . ']';
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* sets instance properties from an array of values
|
32 |
+
*
|
33 |
+
* @ignore
|
34 |
+
* @access protected
|
35 |
+
* @param array $ibanAttribs array of ibanBankAccount data
|
36 |
+
* @return void
|
37 |
+
*/
|
38 |
+
protected function _initialize($ibanAttribs)
|
39 |
+
{
|
40 |
+
// set the attributes
|
41 |
+
$this->_attributes = $ibanAttribs;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* factory method: returns an instance of IbanBankAccount
|
46 |
+
* to the requesting method, with populated properties
|
47 |
+
* @ignore
|
48 |
+
* @return IbanBankAccount
|
49 |
+
*/
|
50 |
+
public static function factory($attributes)
|
51 |
+
{
|
52 |
+
$instance = new self();
|
53 |
+
$instance->_initialize($attributes);
|
54 |
+
return $instance;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
class_alias('Braintree\IbanBankAccount', 'Braintree_IbanBankAccount');
|
lib/Braintree/IdealPayment.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Braintree IdealPayment module
|
6 |
+
*
|
7 |
+
* @package Braintree
|
8 |
+
* @category Resources
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Manages Braintree IdealPayments
|
13 |
+
*
|
14 |
+
* <b>== More information ==</b>
|
15 |
+
*
|
16 |
+
*
|
17 |
+
* @package Braintree
|
18 |
+
* @category Resources
|
19 |
+
*
|
20 |
+
* @property-read string $id
|
21 |
+
* @property-read string $idealTransactionId
|
22 |
+
* @property-read string $currency
|
23 |
+
* @property-read string $amount
|
24 |
+
* @property-read string $status
|
25 |
+
* @property-read string $orderId
|
26 |
+
* @property-read string $issuer
|
27 |
+
* @property-read string $ibanBankAccount
|
28 |
+
*/
|
29 |
+
class IdealPayment extends Base
|
30 |
+
{
|
31 |
+
/**
|
32 |
+
* factory method: returns an instance of IdealPayment
|
33 |
+
* to the requesting method, with populated properties
|
34 |
+
*
|
35 |
+
* @ignore
|
36 |
+
* @return IdealPayment
|
37 |
+
*/
|
38 |
+
public static function factory($attributes)
|
39 |
+
{
|
40 |
+
$instance = new self();
|
41 |
+
$instance->_initialize($attributes);
|
42 |
+
return $instance;
|
43 |
+
}
|
44 |
+
|
45 |
+
/* instance methods */
|
46 |
+
|
47 |
+
/**
|
48 |
+
* sets instance properties from an array of values
|
49 |
+
*
|
50 |
+
* @access protected
|
51 |
+
* @param array $idealPaymentAttribs array of idealPayment data
|
52 |
+
* @return void
|
53 |
+
*/
|
54 |
+
protected function _initialize($idealPaymentAttribs)
|
55 |
+
{
|
56 |
+
// set the attributes
|
57 |
+
$this->_attributes = $idealPaymentAttribs;
|
58 |
+
|
59 |
+
$ibanBankAccount = isset($idealPaymentAttribs['ibanBankAccount']) ?
|
60 |
+
IbanBankAccount::factory($idealPaymentAttribs['ibanBankAccount']) :
|
61 |
+
null;
|
62 |
+
$this->_set('ibanBankAccount', $ibanBankAccount);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* create a printable representation of the object as:
|
67 |
+
* ClassName[property=value, property=value]
|
68 |
+
* @return string
|
69 |
+
*/
|
70 |
+
public function __toString()
|
71 |
+
{
|
72 |
+
return __CLASS__ . '[' .
|
73 |
+
Util::attributesToString($this->_attributes) . ']';
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
// static methods redirecting to gateway
|
78 |
+
|
79 |
+
public static function find($idealPaymentId)
|
80 |
+
{
|
81 |
+
return Configuration::gateway()->idealPayment()->find($idealPaymentId);
|
82 |
+
}
|
83 |
+
|
84 |
+
public static function sale($idealPaymentId, $transactionAttribs)
|
85 |
+
{
|
86 |
+
$transactionAttribs['options'] = [
|
87 |
+
'submitForSettlement' => true
|
88 |
+
];
|
89 |
+
return Configuration::gateway()->idealPayment()->sale($idealPaymentId, $transactionAttribs);
|
90 |
+
}
|
91 |
+
}
|
92 |
+
class_alias('Braintree\IdealPayment', 'Braintree_IdealPayment');
|
lib/Braintree/IdealPaymentGateway.php
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
use InvalidArgumentException;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Braintree IdealPaymentGateway module
|
8 |
+
*
|
9 |
+
* @package Braintree
|
10 |
+
* @category Resources
|
11 |
+
*/
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Manages Braintree IdealPayments
|
15 |
+
*
|
16 |
+
* <b>== More information ==</b>
|
17 |
+
*
|
18 |
+
*
|
19 |
+
* @package Braintree
|
20 |
+
* @category Resources
|
21 |
+
*/
|
22 |
+
class IdealPaymentGateway
|
23 |
+
{
|
24 |
+
private $_gateway;
|
25 |
+
private $_config;
|
26 |
+
private $_http;
|
27 |
+
|
28 |
+
public function __construct($gateway)
|
29 |
+
{
|
30 |
+
$this->_gateway = $gateway;
|
31 |
+
$this->_config = $gateway->config;
|
32 |
+
$this->_config->assertHasAccessTokenOrKeys();
|
33 |
+
$this->_http = new Http($gateway->config);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* find an IdealPayment by id
|
38 |
+
*
|
39 |
+
* @access public
|
40 |
+
* @param string $idealPaymentId
|
41 |
+
* @return IdealPayment
|
42 |
+
* @throws Exception\NotFound
|
43 |
+
*/
|
44 |
+
public function find($idealPaymentId)
|
45 |
+
{
|
46 |
+
try {
|
47 |
+
$path = $this->_config->merchantPath() . '/ideal_payments/' . $idealPaymentId;
|
48 |
+
$response = $this->_http->get($path);
|
49 |
+
return IdealPayment::factory($response['idealPayment']);
|
50 |
+
} catch (Exception\NotFound $e) {
|
51 |
+
throw new Exception\NotFound(
|
52 |
+
'iDEAL Payment with id ' . $idealPaymentId . ' not found'
|
53 |
+
);
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* create a new sale for the current IdealPayment
|
59 |
+
*
|
60 |
+
* @param string $idealPaymentId
|
61 |
+
* @param array $transactionAttribs
|
62 |
+
* @return Result\Successful|Result\Error
|
63 |
+
* @see Transaction::sale()
|
64 |
+
*/
|
65 |
+
public function sale($idealPaymentId, $transactionAttribs)
|
66 |
+
{
|
67 |
+
return Transaction::sale(
|
68 |
+
array_merge(
|
69 |
+
$transactionAttribs,
|
70 |
+
['paymentMethodNonce' => $idealPaymentId]
|
71 |
+
)
|
72 |
+
);
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* generic method for validating incoming gateway responses
|
77 |
+
*
|
78 |
+
* creates a new IdealPayment object and encapsulates
|
79 |
+
* it inside a Result\Successful object, or
|
80 |
+
* encapsulates a Errors object inside a Result\Error
|
81 |
+
* alternatively, throws an Unexpected exception if the response is invalid.
|
82 |
+
*
|
83 |
+
* @ignore
|
84 |
+
* @param array $response gateway response values
|
85 |
+
* @return Result\Successful|Result\Error
|
86 |
+
* @throws Exception\Unexpected
|
87 |
+
*/
|
88 |
+
private function _verifyGatewayResponse($response)
|
89 |
+
{
|
90 |
+
if (isset($response['idealPayment'])) {
|
91 |
+
// return a populated instance of IdealPayment
|
92 |
+
return new Result\Successful(
|
93 |
+
IdealPayment::factory($response['idealPayment'])
|
94 |
+
);
|
95 |
+
} else if (isset($response['apiErrorResponse'])) {
|
96 |
+
return new Result\Error($response['apiErrorResponse']);
|
97 |
+
} else {
|
98 |
+
throw new Exception\Unexpected(
|
99 |
+
'Expected Ideal Payment or apiErrorResponse'
|
100 |
+
);
|
101 |
+
}
|
102 |
+
}
|
103 |
+
}
|
104 |
+
class_alias('Braintree\IdealPaymentGateway', 'Braintree_IdealPaymentGateway');
|
lib/Braintree/Instance.php
CHANGED
@@ -4,7 +4,6 @@ namespace Braintree;
|
|
4 |
/**
|
5 |
* Braintree Class Instance template
|
6 |
*
|
7 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
8 |
* @abstract
|
9 |
*/
|
10 |
abstract class Instance
|
4 |
/**
|
5 |
* Braintree Class Instance template
|
6 |
*
|
|
|
7 |
* @abstract
|
8 |
*/
|
9 |
abstract class Instance
|
lib/Braintree/MasterpassCard.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Braintree MasterpassCard module
|
6 |
+
* Creates and manages Braintree MasterpassCards
|
7 |
+
*
|
8 |
+
* <b>== More information ==</b>
|
9 |
+
*
|
10 |
+
* For more detailed information on CreditCard verifications, see {@link http://www.braintreepayments.com/gateway/credit-card-verification-api http://www.braintreepaymentsolutions.com/gateway/credit-card-verification-api}
|
11 |
+
*
|
12 |
+
* @package Braintree
|
13 |
+
* @category Resources
|
14 |
+
*
|
15 |
+
* @property-read string $billingAddress
|
16 |
+
* @property-read string $bin
|
17 |
+
* @property-read string $cardType
|
18 |
+
* @property-read string $cardholderName
|
19 |
+
* @property-read string $commercial
|
20 |
+
* @property-read string $countryOfIssuance
|
21 |
+
* @property-read string $createdAt
|
22 |
+
* @property-read string $customerId
|
23 |
+
* @property-read string $customerLocation
|
24 |
+
* @property-read string $debit
|
25 |
+
* @property-read string $default
|
26 |
+
* @property-read string $durbinRegulated
|
27 |
+
* @property-read string $expirationDate
|
28 |
+
* @property-read string $expirationMonth
|
29 |
+
* @property-read string $expirationYear
|
30 |
+
* @property-read string $expired
|
31 |
+
* @property-read string $healthcare
|
32 |
+
* @property-read string $imageUrl
|
33 |
+
* @property-read string $issuingBank
|
34 |
+
* @property-read string $last4
|
35 |
+
* @property-read string $maskedNumber
|
36 |
+
* @property-read string $payroll
|
37 |
+
* @property-read string $prepaid
|
38 |
+
* @property-read string $productId
|
39 |
+
* @property-read string $subscriptions
|
40 |
+
* @property-read string $token
|
41 |
+
* @property-read string $uniqueNumberIdentifier
|
42 |
+
* @property-read string $updatedAt
|
43 |
+
*/
|
44 |
+
class MasterpassCard extends Base
|
45 |
+
{
|
46 |
+
/* instance methods */
|
47 |
+
/**
|
48 |
+
* returns false if default is null or false
|
49 |
+
*
|
50 |
+
* @return boolean
|
51 |
+
*/
|
52 |
+
public function isDefault()
|
53 |
+
{
|
54 |
+
return $this->default;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* checks whether the card is expired based on the current date
|
59 |
+
*
|
60 |
+
* @return boolean
|
61 |
+
*/
|
62 |
+
public function isExpired()
|
63 |
+
{
|
64 |
+
return $this->expired;
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* sets instance properties from an array of values
|
69 |
+
*
|
70 |
+
* @access protected
|
71 |
+
* @param array $creditCardAttribs array of creditcard data
|
72 |
+
* @return void
|
73 |
+
*/
|
74 |
+
protected function _initialize($creditCardAttribs)
|
75 |
+
{
|
76 |
+
// set the attributes
|
77 |
+
$this->_attributes = $creditCardAttribs;
|
78 |
+
|
79 |
+
// map each address into its own object
|
80 |
+
$billingAddress = isset($creditCardAttribs['billingAddress']) ?
|
81 |
+
Address::factory($creditCardAttribs['billingAddress']) :
|
82 |
+
null;
|
83 |
+
|
84 |
+
$subscriptionArray = [];
|
85 |
+
if (isset($creditCardAttribs['subscriptions'])) {
|
86 |
+
foreach ($creditCardAttribs['subscriptions'] AS $subscription) {
|
87 |
+
$subscriptionArray[] = Subscription::factory($subscription);
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
$this->_set('subscriptions', $subscriptionArray);
|
92 |
+
$this->_set('billingAddress', $billingAddress);
|
93 |
+
$this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear);
|
94 |
+
$this->_set('maskedNumber', $this->bin . '******' . $this->last4);
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* returns false if comparing object is not a CreditCard,
|
99 |
+
* or is a CreditCard with a different id
|
100 |
+
*
|
101 |
+
* @param object $otherCreditCard customer to compare against
|
102 |
+
* @return boolean
|
103 |
+
*/
|
104 |
+
public function isEqual($otherMasterpassCard)
|
105 |
+
{
|
106 |
+
return !($otherMasterpassCard instanceof self) ? false : $this->token === $otherMasterpassCard->token;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* create a printable representation of the object as:
|
111 |
+
* ClassName[property=value, property=value]
|
112 |
+
* @return string
|
113 |
+
*/
|
114 |
+
public function __toString()
|
115 |
+
{
|
116 |
+
return __CLASS__ . '[' .
|
117 |
+
Util::attributesToString($this->_attributes) .']';
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* factory method: returns an instance of CreditCard
|
122 |
+
* to the requesting method, with populated properties
|
123 |
+
*
|
124 |
+
* @ignore
|
125 |
+
* @return MasterpassCard
|
126 |
+
*/
|
127 |
+
public static function factory($attributes)
|
128 |
+
{
|
129 |
+
$defaultAttributes = [
|
130 |
+
'bin' => '',
|
131 |
+
'expirationMonth' => '',
|
132 |
+
'expirationYear' => '',
|
133 |
+
'last4' => '',
|
134 |
+
];
|
135 |
+
|
136 |
+
$instance = new self();
|
137 |
+
$instance->_initialize(array_merge($defaultAttributes, $attributes));
|
138 |
+
return $instance;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
class_alias('Braintree\MasterpassCard', 'Braintree_MasterpassCard');
|
lib/Braintree/Merchant.php
CHANGED
@@ -1,11 +1,19 @@
|
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
-
|
5 |
{
|
6 |
protected function _initialize($attribs)
|
7 |
{
|
8 |
$this->_attributes = $attribs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
|
11 |
public static function factory($attributes)
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
+
class Merchant extends Base
|
5 |
{
|
6 |
protected function _initialize($attribs)
|
7 |
{
|
8 |
$this->_attributes = $attribs;
|
9 |
+
|
10 |
+
$merchantAccountArray = [];
|
11 |
+
if (isset($attribs['merchantAccounts'])) {
|
12 |
+
foreach ($attribs['merchantAccounts'] AS $merchantAccount) {
|
13 |
+
$merchantAccountArray[] = MerchantAccount::factory($merchantAccount);
|
14 |
+
}
|
15 |
+
}
|
16 |
+
$this->_set('merchantAccounts', $merchantAccountArray);
|
17 |
}
|
18 |
|
19 |
public static function factory($attributes)
|
lib/Braintree/MerchantAccount.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
-
|
5 |
{
|
6 |
const STATUS_ACTIVE = 'active';
|
7 |
const STATUS_PENDING = 'pending';
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
+
class MerchantAccount extends Base
|
5 |
{
|
6 |
const STATUS_ACTIVE = 'active';
|
7 |
const STATUS_PENDING = 'pending';
|
lib/Braintree/MerchantAccount/AddressDetails.php
CHANGED
@@ -3,7 +3,7 @@ namespace Braintree\MerchantAccount;
|
|
3 |
|
4 |
use Braintree\Instance;
|
5 |
|
6 |
-
|
7 |
{
|
8 |
protected $_attributes = [];
|
9 |
}
|
3 |
|
4 |
use Braintree\Instance;
|
5 |
|
6 |
+
class AddressDetails extends Instance
|
7 |
{
|
8 |
protected $_attributes = [];
|
9 |
}
|
lib/Braintree/MerchantAccount/BusinessDetails.php
CHANGED
@@ -3,7 +3,7 @@ namespace Braintree\MerchantAccount;
|
|
3 |
|
4 |
use Braintree\Base;
|
5 |
|
6 |
-
|
7 |
{
|
8 |
protected function _initialize($businessAttribs)
|
9 |
{
|
3 |
|
4 |
use Braintree\Base;
|
5 |
|
6 |
+
class BusinessDetails extends Base
|
7 |
{
|
8 |
protected function _initialize($businessAttribs)
|
9 |
{
|
lib/Braintree/MerchantAccount/FundingDetails.php
CHANGED
@@ -3,7 +3,7 @@ namespace Braintree\MerchantAccount;
|
|
3 |
|
4 |
use Braintree\Instance;
|
5 |
|
6 |
-
|
7 |
{
|
8 |
protected $_attributes = [];
|
9 |
}
|
3 |
|
4 |
use Braintree\Instance;
|
5 |
|
6 |
+
class FundingDetails extends Instance
|
7 |
{
|
8 |
protected $_attributes = [];
|
9 |
}
|
lib/Braintree/MerchantAccount/IndividualDetails.php
CHANGED
@@ -3,7 +3,7 @@ namespace Braintree\MerchantAccount;
|
|
3 |
|
4 |
use Braintree\Base;
|
5 |
|
6 |
-
|
7 |
{
|
8 |
protected function _initialize($individualAttribs)
|
9 |
{
|
3 |
|
4 |
use Braintree\Base;
|
5 |
|
6 |
+
class IndividualDetails extends Base
|
7 |
{
|
8 |
protected function _initialize($individualAttribs)
|
9 |
{
|
lib/Braintree/MerchantAccountGateway.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
-
|
5 |
{
|
6 |
private $_gateway;
|
7 |
private $_config;
|
@@ -55,6 +55,31 @@ final class MerchantAccountGateway
|
|
55 |
return $signature;
|
56 |
}
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
public static function createSignature()
|
59 |
{
|
60 |
$addressSignature = ['streetAddress', 'postalCode', 'locality', 'region'];
|
@@ -137,6 +162,9 @@ final class MerchantAccountGateway
|
|
137 |
|
138 |
private function _verifyGatewayResponse($response)
|
139 |
{
|
|
|
|
|
|
|
140 |
if (isset($response['merchantAccount'])) {
|
141 |
// return a populated instance of merchantAccount
|
142 |
return new Result\Successful(
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
+
class MerchantAccountGateway
|
5 |
{
|
6 |
private $_gateway;
|
7 |
private $_config;
|
55 |
return $signature;
|
56 |
}
|
57 |
|
58 |
+
public function createForCurrency($attribs)
|
59 |
+
{
|
60 |
+
$response = $this->_http->post($this->_config->merchantPath() . '/merchant_accounts/create_for_currency', ['merchant_account' => $attribs]);
|
61 |
+
return $this->_verifyGatewayResponse($response);
|
62 |
+
}
|
63 |
+
|
64 |
+
public function all()
|
65 |
+
{
|
66 |
+
$pager = [
|
67 |
+
'object' => $this,
|
68 |
+
'method' => 'fetchMerchantAccounts',
|
69 |
+
];
|
70 |
+
return new PaginatedCollection($pager);
|
71 |
+
}
|
72 |
+
|
73 |
+
public function fetchMerchantAccounts($page)
|
74 |
+
{
|
75 |
+
$response = $this->_http->get($this->_config->merchantPath() . '/merchant_accounts?page=' . $page);
|
76 |
+
$body = $response['merchantAccounts'];
|
77 |
+
$merchantAccounts = Util::extractattributeasarray($body, 'merchantAccount');
|
78 |
+
$totalItems = $body['totalItems'][0];
|
79 |
+
$pageSize = $body['pageSize'][0];
|
80 |
+
return new PaginatedResult($totalItems, $pageSize, $merchantAccounts);
|
81 |
+
}
|
82 |
+
|
83 |
public static function createSignature()
|
84 |
{
|
85 |
$addressSignature = ['streetAddress', 'postalCode', 'locality', 'region'];
|
162 |
|
163 |
private function _verifyGatewayResponse($response)
|
164 |
{
|
165 |
+
if (isset($response['response'])) {
|
166 |
+
$response = $response['response'];
|
167 |
+
}
|
168 |
if (isset($response['merchantAccount'])) {
|
169 |
// return a populated instance of merchantAccount
|
170 |
return new Result\Successful(
|
lib/Braintree/MerchantGateway.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
-
|
5 |
{
|
6 |
private $_gateway;
|
7 |
private $_config;
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
+
class MerchantGateway
|
5 |
{
|
6 |
private $_gateway;
|
7 |
private $_config;
|
lib/Braintree/OAuthCredentials.php
CHANGED
@@ -6,8 +6,6 @@ namespace Braintree;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
-
*
|
11 |
*/
|
12 |
class OAuthCredentials extends Base
|
13 |
{
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
|
|
|
|
9 |
*/
|
10 |
class OAuthCredentials extends Base
|
11 |
{
|
lib/Braintree/OAuthGateway.php
CHANGED
@@ -7,7 +7,6 @@ namespace Braintree;
|
|
7 |
* Creates and manages Braintree Addresses
|
8 |
*
|
9 |
* @package Braintree
|
10 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
11 |
*/
|
12 |
class OAuthGateway
|
13 |
{
|
@@ -37,6 +36,13 @@ class OAuthGateway
|
|
37 |
return $this->_createToken($params);
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
private function _createToken($params)
|
41 |
{
|
42 |
$params = ['credentials' => $params];
|
@@ -51,6 +57,11 @@ class OAuthGateway
|
|
51 |
OAuthCredentials::factory($response['credentials'])
|
52 |
);
|
53 |
return $this->_mapSuccess($result);
|
|
|
|
|
|
|
|
|
|
|
54 |
} else if (isset($response['apiErrorResponse'])) {
|
55 |
$result = new Result\Error($response['apiErrorResponse']);
|
56 |
return $this->_mapError($result);
|
@@ -76,6 +87,12 @@ class OAuthGateway
|
|
76 |
return $result;
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
public function _mapSuccess($result)
|
80 |
{
|
81 |
$credentials = $result->credentials;
|
7 |
* Creates and manages Braintree Addresses
|
8 |
*
|
9 |
* @package Braintree
|
|
|
10 |
*/
|
11 |
class OAuthGateway
|
12 |
{
|
36 |
return $this->_createToken($params);
|
37 |
}
|
38 |
|
39 |
+
public function revokeAccessToken($accessToken)
|
40 |
+
{
|
41 |
+
$params = ['token' => $accessToken];
|
42 |
+
$response = $this->_http->post('/oauth/revoke_access_token', $params);
|
43 |
+
return $this->_verifyGatewayResponse($response);
|
44 |
+
}
|
45 |
+
|
46 |
private function _createToken($params)
|
47 |
{
|
48 |
$params = ['credentials' => $params];
|
57 |
OAuthCredentials::factory($response['credentials'])
|
58 |
);
|
59 |
return $this->_mapSuccess($result);
|
60 |
+
} else if (isset($response['result'])) {
|
61 |
+
$result = new Result\Successful(
|
62 |
+
OAuthResult::factory($response['result'])
|
63 |
+
);
|
64 |
+
return $this->_mapAccessTokenRevokeSuccess($result);
|
65 |
} else if (isset($response['apiErrorResponse'])) {
|
66 |
$result = new Result\Error($response['apiErrorResponse']);
|
67 |
return $this->_mapError($result);
|
87 |
return $result;
|
88 |
}
|
89 |
|
90 |
+
public function _mapAccessTokenRevokeSuccess($result)
|
91 |
+
{
|
92 |
+
$result->revocationResult = $result->success;
|
93 |
+
return $result;
|
94 |
+
}
|
95 |
+
|
96 |
public function _mapSuccess($result)
|
97 |
{
|
98 |
$credentials = $result->credentials;
|
lib/Braintree/OAuthResult.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Braintree OAuthCredentials module
|
6 |
+
*
|
7 |
+
* @package Braintree
|
8 |
+
* @category Resources
|
9 |
+
*/
|
10 |
+
class OAuthResult extends Base
|
11 |
+
{
|
12 |
+
protected function _initialize($attribs)
|
13 |
+
{
|
14 |
+
$this->_attributes = $attribs;
|
15 |
+
}
|
16 |
+
|
17 |
+
public static function factory($attributes)
|
18 |
+
{
|
19 |
+
$instance = new self();
|
20 |
+
$instance->_initialize($attributes);
|
21 |
+
return $instance;
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* returns a string representation of the result
|
26 |
+
* @return string
|
27 |
+
*/
|
28 |
+
public function __toString()
|
29 |
+
{
|
30 |
+
return __CLASS__ . '[' .
|
31 |
+
Util::attributesToString($this->_attributes) .']';
|
32 |
+
}
|
33 |
+
}
|
34 |
+
class_alias('Braintree\OAuthResult', 'Braintree_OAuthResult');
|
lib/Braintree/PaginatedCollection.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
use Iterator;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Braintree PaginatedCollection
|
8 |
+
* PaginatedCollection is a container object for paginated data
|
9 |
+
*
|
10 |
+
* retrieves and pages through large collections of results
|
11 |
+
*
|
12 |
+
* example:
|
13 |
+
* <code>
|
14 |
+
* $result = MerchantAccount::all();
|
15 |
+
*
|
16 |
+
* foreach($result as $merchantAccount) {
|
17 |
+
* print_r($merchantAccount->status);
|
18 |
+
* }
|
19 |
+
* </code>
|
20 |
+
*
|
21 |
+
* @package Braintree
|
22 |
+
* @subpackage Utility
|
23 |
+
*/
|
24 |
+
class PaginatedCollection implements Iterator
|
25 |
+
{
|
26 |
+
private $_pager;
|
27 |
+
private $_pageSize;
|
28 |
+
private $_currentPage;
|
29 |
+
private $_index;
|
30 |
+
private $_totalItems;
|
31 |
+
private $_items;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* set up the paginated collection
|
35 |
+
*
|
36 |
+
* expects an array of an object and method to call on it
|
37 |
+
*
|
38 |
+
* @param array $pager
|
39 |
+
*/
|
40 |
+
public function __construct($pager)
|
41 |
+
{
|
42 |
+
$this->_pager = $pager;
|
43 |
+
$this->_pageSize = 0;
|
44 |
+
$this->_currentPage = 0;
|
45 |
+
$this->_totalItems = 0;
|
46 |
+
$this->_index = 0;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* returns the current item when iterating with foreach
|
51 |
+
*/
|
52 |
+
public function current()
|
53 |
+
{
|
54 |
+
return $this->_items[($this->_index % $this->_pageSize)];
|
55 |
+
}
|
56 |
+
|
57 |
+
public function key()
|
58 |
+
{
|
59 |
+
return null;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* advances to the next item in the collection when iterating with foreach
|
64 |
+
*/
|
65 |
+
public function next()
|
66 |
+
{
|
67 |
+
++$this->_index;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* rewinds the collection to the first item when iterating with foreach
|
72 |
+
*/
|
73 |
+
public function rewind()
|
74 |
+
{
|
75 |
+
$this->_index = 0;
|
76 |
+
$this->_currentPage = 0;
|
77 |
+
$this->_pageSize = 0;
|
78 |
+
$this->_totalItems = 0;
|
79 |
+
$this->_items = [];
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* returns whether the current item is valid when iterating with foreach
|
84 |
+
*/
|
85 |
+
public function valid()
|
86 |
+
{
|
87 |
+
if ($this->_currentPage == 0 || $this->_index % $this->_pageSize == 0 && $this->_index < $this->_totalItems)
|
88 |
+
{
|
89 |
+
$this->_getNextPage();
|
90 |
+
}
|
91 |
+
|
92 |
+
return $this->_index < $this->_totalItems;
|
93 |
+
}
|
94 |
+
|
95 |
+
private function _getNextPage()
|
96 |
+
{
|
97 |
+
$this->_currentPage++;
|
98 |
+
$object = $this->_pager['object'];
|
99 |
+
$method = $this->_pager['method'];
|
100 |
+
|
101 |
+
if (isset($this->_pager['query'])) {
|
102 |
+
$query = $this->_pager['query'];
|
103 |
+
$result = call_user_func(
|
104 |
+
[$object, $method],
|
105 |
+
$query,
|
106 |
+
$this->_currentPage
|
107 |
+
);
|
108 |
+
} else {
|
109 |
+
$result = call_user_func(
|
110 |
+
[$object, $method],
|
111 |
+
$this->_currentPage
|
112 |
+
);
|
113 |
+
}
|
114 |
+
|
115 |
+
$this->_totalItems= $result->getTotalItems();
|
116 |
+
$this->_pageSize = $result->getPageSize();
|
117 |
+
$this->_items = $result->getCurrentPage();
|
118 |
+
}
|
119 |
+
}
|
120 |
+
class_alias('Braintree\PaginatedCollection', 'Braintree_PaginatedCollection');
|
lib/Braintree/PaginatedResult.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
class PaginatedResult
|
5 |
+
{
|
6 |
+
private $_totalItems;
|
7 |
+
private $_pageSize;
|
8 |
+
private $_currentPage;
|
9 |
+
|
10 |
+
public function __construct($totalItems, $pageSize, $currentPage)
|
11 |
+
{
|
12 |
+
$this->_totalItems = $totalItems;
|
13 |
+
$this->_pageSize = $pageSize;
|
14 |
+
$this->_currentPage = $currentPage;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function getTotalItems()
|
18 |
+
{
|
19 |
+
return $this->_totalItems;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getPageSize()
|
23 |
+
{
|
24 |
+
return $this->_pageSize;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function getCurrentPage()
|
28 |
+
{
|
29 |
+
return $this->_currentPage;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
class_alias('Braintree\PaginatedResult', 'Braintree_PaginatedResult');
|
lib/Braintree/PartnerMerchant.php
CHANGED
@@ -8,7 +8,6 @@ namespace Braintree;
|
|
8 |
* Creates an instance of PartnerMerchants
|
9 |
*
|
10 |
* @package Braintree
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*
|
13 |
* @property-read string $merchantPublicId
|
14 |
* @property-read string $publicKey
|
8 |
* Creates an instance of PartnerMerchants
|
9 |
*
|
10 |
* @package Braintree
|
|
|
11 |
*
|
12 |
* @property-read string $merchantPublicId
|
13 |
* @property-read string $publicKey
|
lib/Braintree/PayPalAccount.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
|
12 |
/**
|
@@ -17,7 +16,6 @@ namespace Braintree;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @category Resources
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
*
|
22 |
* @property-read string $customerId
|
23 |
* @property-read string $email
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
|
|
9 |
*/
|
10 |
|
11 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @category Resources
|
|
|
19 |
*
|
20 |
* @property-read string $customerId
|
21 |
* @property-read string $email
|
lib/Braintree/PayPalAccountGateway.php
CHANGED
@@ -8,7 +8,6 @@ use InvalidArgumentException;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @category Resources
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
|
14 |
/**
|
@@ -19,7 +18,6 @@ use InvalidArgumentException;
|
|
19 |
*
|
20 |
* @package Braintree
|
21 |
* @category Resources
|
22 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
23 |
*/
|
24 |
class PayPalAccountGateway
|
25 |
{
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @category Resources
|
|
|
11 |
*/
|
12 |
|
13 |
/**
|
18 |
*
|
19 |
* @package Braintree
|
20 |
* @category Resources
|
|
|
21 |
*/
|
22 |
class PayPalAccountGateway
|
23 |
{
|
lib/Braintree/PaymentInstrumentType.php
CHANGED
@@ -1,13 +1,18 @@
|
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
-
|
5 |
{
|
6 |
const PAYPAL_ACCOUNT = 'paypal_account';
|
7 |
const COINBASE_ACCOUNT = 'coinbase_account';
|
8 |
const EUROPE_BANK_ACCOUNT = 'europe_bank_account';
|
9 |
const CREDIT_CARD = 'credit_card';
|
|
|
|
|
10 |
const APPLE_PAY_CARD = 'apple_pay_card';
|
11 |
const ANDROID_PAY_CARD = 'android_pay_card';
|
|
|
|
|
|
|
12 |
}
|
13 |
class_alias('Braintree\PaymentInstrumentType', 'Braintree_PaymentInstrumentType');
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
+
class PaymentInstrumentType
|
5 |
{
|
6 |
const PAYPAL_ACCOUNT = 'paypal_account';
|
7 |
const COINBASE_ACCOUNT = 'coinbase_account';
|
8 |
const EUROPE_BANK_ACCOUNT = 'europe_bank_account';
|
9 |
const CREDIT_CARD = 'credit_card';
|
10 |
+
const VISA_CHECKOUT_CARD = 'visa_checkout_card';
|
11 |
+
const MASTERPASS_CARD = 'masterpass_card';
|
12 |
const APPLE_PAY_CARD = 'apple_pay_card';
|
13 |
const ANDROID_PAY_CARD = 'android_pay_card';
|
14 |
+
const VENMO_ACCOUNT = 'venmo_account';
|
15 |
+
const US_BANK_ACCOUNT = 'us_bank_account';
|
16 |
+
const IDEAL_PAYMENT = 'ideal_payment';
|
17 |
}
|
18 |
class_alias('Braintree\PaymentInstrumentType', 'Braintree_PaymentInstrumentType');
|
lib/Braintree/PaymentMethod.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
|
12 |
/**
|
@@ -17,8 +16,6 @@ namespace Braintree;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @category Resources
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
-
*
|
22 |
*/
|
23 |
class PaymentMethod extends Base
|
24 |
{
|
@@ -39,9 +36,9 @@ class PaymentMethod extends Base
|
|
39 |
return Configuration::gateway()->paymentMethod()->update($token, $attribs);
|
40 |
}
|
41 |
|
42 |
-
public static function delete($token)
|
43 |
{
|
44 |
-
return Configuration::gateway()->paymentMethod()->delete($token);
|
45 |
}
|
46 |
}
|
47 |
class_alias('Braintree\PaymentMethod', 'Braintree_PaymentMethod');
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
|
|
9 |
*/
|
10 |
|
11 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @category Resources
|
|
|
|
|
19 |
*/
|
20 |
class PaymentMethod extends Base
|
21 |
{
|
36 |
return Configuration::gateway()->paymentMethod()->update($token, $attribs);
|
37 |
}
|
38 |
|
39 |
+
public static function delete($token, $options=[])
|
40 |
{
|
41 |
+
return Configuration::gateway()->paymentMethod()->delete($token, $options);
|
42 |
}
|
43 |
}
|
44 |
class_alias('Braintree\PaymentMethod', 'Braintree_PaymentMethod');
|
lib/Braintree/PaymentMethodGateway.php
CHANGED
@@ -8,7 +8,6 @@ use InvalidArgumentException;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @category Resources
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
|
14 |
/**
|
@@ -19,8 +18,6 @@ use InvalidArgumentException;
|
|
19 |
*
|
20 |
* @package Braintree
|
21 |
* @category Resources
|
22 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
23 |
-
*
|
24 |
*/
|
25 |
class PaymentMethodGateway
|
26 |
{
|
@@ -70,8 +67,14 @@ class PaymentMethodGateway
|
|
70 |
return AmexExpressCheckoutCard::factory($response['amexExpressCheckoutCard']);
|
71 |
} else if (isset($response['europeBankAccount'])) {
|
72 |
return EuropeBankAccount::factory($response['europeBankAccount']);
|
|
|
|
|
73 |
} else if (isset($response['venmoAccount'])) {
|
74 |
return VenmoAccount::factory($response['venmoAccount']);
|
|
|
|
|
|
|
|
|
75 |
} else if (is_array($response)) {
|
76 |
return UnknownPaymentMethod::factory($response);
|
77 |
}
|
@@ -88,23 +91,28 @@ class PaymentMethodGateway
|
|
88 |
return $this->_doUpdate('/payment_methods/any/' . $token, ['payment_method' => $attribs]);
|
89 |
}
|
90 |
|
91 |
-
public function delete($token)
|
92 |
{
|
|
|
93 |
$this->_validateId($token);
|
94 |
-
$
|
95 |
-
|
96 |
-
|
|
|
|
|
97 |
}
|
98 |
|
99 |
-
public function grant($sharedPaymentMethodToken, $
|
100 |
{
|
|
|
|
|
|
|
|
|
|
|
101 |
return $this->_doCreate(
|
102 |
'/payment_methods/grant',
|
103 |
[
|
104 |
-
'payment_method' =>
|
105 |
-
'shared_payment_method_token' => $sharedPaymentMethodToken,
|
106 |
-
'allow_vaulting' => $allowVaulting
|
107 |
-
]
|
108 |
]
|
109 |
);
|
110 |
}
|
@@ -129,7 +137,14 @@ class PaymentMethodGateway
|
|
129 |
'makeDefault',
|
130 |
'verificationMerchantAccountId',
|
131 |
'verifyCard',
|
132 |
-
'verificationAmount'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
];
|
134 |
return [
|
135 |
'billingAddressId',
|
@@ -170,6 +185,11 @@ class PaymentMethodGateway
|
|
170 |
return $signature;
|
171 |
}
|
172 |
|
|
|
|
|
|
|
|
|
|
|
173 |
/**
|
174 |
* sends the create request to the gateway
|
175 |
*
|
@@ -202,6 +222,21 @@ class PaymentMethodGateway
|
|
202 |
return $this->_verifyGatewayResponse($response);
|
203 |
}
|
204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
/**
|
206 |
* generic method for validating incoming gateway responses
|
207 |
*
|
@@ -252,11 +287,26 @@ class PaymentMethodGateway
|
|
252 |
EuropeBankAccount::factory($response['europeBankAccount']),
|
253 |
"paymentMethod"
|
254 |
);
|
|
|
|
|
|
|
|
|
|
|
255 |
} else if (isset($response['venmoAccount'])) {
|
256 |
return new Result\Successful(
|
257 |
VenmoAccount::factory($response['venmoAccount']),
|
258 |
"paymentMethod"
|
259 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
} else if (isset($response['paymentMethodNonce'])) {
|
261 |
return new Result\Successful(
|
262 |
PaymentMethodNonce::factory($response['paymentMethodNonce']),
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @category Resources
|
|
|
11 |
*/
|
12 |
|
13 |
/**
|
18 |
*
|
19 |
* @package Braintree
|
20 |
* @category Resources
|
|
|
|
|
21 |
*/
|
22 |
class PaymentMethodGateway
|
23 |
{
|
67 |
return AmexExpressCheckoutCard::factory($response['amexExpressCheckoutCard']);
|
68 |
} else if (isset($response['europeBankAccount'])) {
|
69 |
return EuropeBankAccount::factory($response['europeBankAccount']);
|
70 |
+
} else if (isset($response['usBankAccount'])) {
|
71 |
+
return UsBankAccount::factory($response['usBankAccount']);
|
72 |
} else if (isset($response['venmoAccount'])) {
|
73 |
return VenmoAccount::factory($response['venmoAccount']);
|
74 |
+
} else if (isset($response['visaCheckoutCard'])) {
|
75 |
+
return VisaCheckoutCard::factory($response['visaCheckoutCard']);
|
76 |
+
} else if (isset($response['masterpassCard'])) {
|
77 |
+
return MasterpassCard::factory($response['masterpassCard']);
|
78 |
} else if (is_array($response)) {
|
79 |
return UnknownPaymentMethod::factory($response);
|
80 |
}
|
91 |
return $this->_doUpdate('/payment_methods/any/' . $token, ['payment_method' => $attribs]);
|
92 |
}
|
93 |
|
94 |
+
public function delete($token, $options=[])
|
95 |
{
|
96 |
+
Util::verifyKeys(self::deleteSignature(), $options);
|
97 |
$this->_validateId($token);
|
98 |
+
$queryString = "";
|
99 |
+
if (!empty($options)) {
|
100 |
+
$queryString = "?" . http_build_query(Util::camelCaseToDelimiterArray($options, '_'));
|
101 |
+
}
|
102 |
+
return $this->_doDelete('/payment_methods/any/' . $token . $queryString);
|
103 |
}
|
104 |
|
105 |
+
public function grant($sharedPaymentMethodToken, $attribs=[])
|
106 |
{
|
107 |
+
if (is_bool($attribs) === true) {
|
108 |
+
$attribs = ['allow_vaulting' => $attribs];
|
109 |
+
}
|
110 |
+
$options = [ 'shared_payment_method_token' => $sharedPaymentMethodToken ];
|
111 |
+
|
112 |
return $this->_doCreate(
|
113 |
'/payment_methods/grant',
|
114 |
[
|
115 |
+
'payment_method' => array_merge($attribs, $options)
|
|
|
|
|
|
|
116 |
]
|
117 |
);
|
118 |
}
|
137 |
'makeDefault',
|
138 |
'verificationMerchantAccountId',
|
139 |
'verifyCard',
|
140 |
+
'verificationAmount',
|
141 |
+
['paypal' => [
|
142 |
+
'payee_email',
|
143 |
+
'order_id',
|
144 |
+
'custom_field',
|
145 |
+
'description',
|
146 |
+
'amount',
|
147 |
+
]],
|
148 |
];
|
149 |
return [
|
150 |
'billingAddressId',
|
185 |
return $signature;
|
186 |
}
|
187 |
|
188 |
+
private static function deleteSignature()
|
189 |
+
{
|
190 |
+
return ['revokeAllGrants'];
|
191 |
+
}
|
192 |
+
|
193 |
/**
|
194 |
* sends the create request to the gateway
|
195 |
*
|
222 |
return $this->_verifyGatewayResponse($response);
|
223 |
}
|
224 |
|
225 |
+
|
226 |
+
/**
|
227 |
+
* sends the delete request to the gateway
|
228 |
+
*
|
229 |
+
* @ignore
|
230 |
+
* @param string $subPath
|
231 |
+
* @return mixed
|
232 |
+
*/
|
233 |
+
public function _doDelete($subPath)
|
234 |
+
{
|
235 |
+
$fullPath = $this->_config->merchantPath() . $subPath;
|
236 |
+
$this->_http->delete($fullPath);
|
237 |
+
return new Result\Successful();
|
238 |
+
}
|
239 |
+
|
240 |
/**
|
241 |
* generic method for validating incoming gateway responses
|
242 |
*
|
287 |
EuropeBankAccount::factory($response['europeBankAccount']),
|
288 |
"paymentMethod"
|
289 |
);
|
290 |
+
} else if (isset($response['usBankAccount'])) {
|
291 |
+
return new Result\Successful(
|
292 |
+
UsBankAccount::factory($response['usBankAccount']),
|
293 |
+
"paymentMethod"
|
294 |
+
);
|
295 |
} else if (isset($response['venmoAccount'])) {
|
296 |
return new Result\Successful(
|
297 |
VenmoAccount::factory($response['venmoAccount']),
|
298 |
"paymentMethod"
|
299 |
);
|
300 |
+
} else if (isset($response['visaCheckoutCard'])) {
|
301 |
+
return new Result\Successful(
|
302 |
+
VisaCheckoutCard::factory($response['visaCheckoutCard']),
|
303 |
+
"paymentMethod"
|
304 |
+
);
|
305 |
+
} else if (isset($response['masterpassCard'])) {
|
306 |
+
return new Result\Successful(
|
307 |
+
MasterpassCard::factory($response['masterpassCard']),
|
308 |
+
"paymentMethod"
|
309 |
+
);
|
310 |
} else if (isset($response['paymentMethodNonce'])) {
|
311 |
return new Result\Successful(
|
312 |
PaymentMethodNonce::factory($response['paymentMethodNonce']),
|
lib/Braintree/PaymentMethodNonce.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
|
12 |
/**
|
@@ -17,8 +16,6 @@ namespace Braintree;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @category Resources
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
-
*
|
22 |
*/
|
23 |
class PaymentMethodNonce extends Base
|
24 |
{
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
|
|
9 |
*/
|
10 |
|
11 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @category Resources
|
|
|
|
|
19 |
*/
|
20 |
class PaymentMethodNonce extends Base
|
21 |
{
|
lib/Braintree/PaymentMethodNonceGateway.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
|
12 |
/**
|
@@ -17,8 +16,6 @@ namespace Braintree;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @category Resources
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
-
*
|
22 |
*/
|
23 |
class PaymentMethodNonceGateway
|
24 |
{
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
|
|
9 |
*/
|
10 |
|
11 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @category Resources
|
|
|
|
|
19 |
*/
|
20 |
class PaymentMethodNonceGateway
|
21 |
{
|
lib/Braintree/ResourceCollection.php
CHANGED
@@ -20,12 +20,12 @@ use Iterator;
|
|
20 |
*
|
21 |
* @package Braintree
|
22 |
* @subpackage Utility
|
23 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
24 |
*/
|
25 |
class ResourceCollection implements Iterator
|
26 |
{
|
27 |
-
private $_index;
|
28 |
private $_batchIndex;
|
|
|
|
|
29 |
private $_items;
|
30 |
private $_pageSize;
|
31 |
private $_pager;
|
@@ -142,5 +142,15 @@ class ResourceCollection implements Iterator
|
|
142 |
$methodArgs
|
143 |
);
|
144 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
}
|
146 |
class_alias('Braintree\ResourceCollection', 'Braintree_ResourceCollection');
|
20 |
*
|
21 |
* @package Braintree
|
22 |
* @subpackage Utility
|
|
|
23 |
*/
|
24 |
class ResourceCollection implements Iterator
|
25 |
{
|
|
|
26 |
private $_batchIndex;
|
27 |
+
private $_ids;
|
28 |
+
private $_index;
|
29 |
private $_items;
|
30 |
private $_pageSize;
|
31 |
private $_pager;
|
142 |
$methodArgs
|
143 |
);
|
144 |
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* returns all IDs in the collection
|
148 |
+
*
|
149 |
+
* @return array
|
150 |
+
*/
|
151 |
+
public function getIds()
|
152 |
+
{
|
153 |
+
return $this->_ids;
|
154 |
+
}
|
155 |
}
|
156 |
class_alias('Braintree\ResourceCollection', 'Braintree_ResourceCollection');
|
lib/Braintree/Result/CreditCardVerification.php
CHANGED
@@ -13,7 +13,6 @@ use Braintree\Util;
|
|
13 |
*
|
14 |
* @package Braintree
|
15 |
* @subpackage Result
|
16 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
17 |
*
|
18 |
* @property-read string $avsErrorResponseCode
|
19 |
* @property-read string $avsPostalCodeResponseCode
|
@@ -31,9 +30,11 @@ class CreditCardVerification
|
|
31 |
const VERIFIED = 'verified';
|
32 |
|
33 |
private $_attributes;
|
|
|
34 |
private $_avsErrorResponseCode;
|
35 |
private $_avsPostalCodeResponseCode;
|
36 |
private $_avsStreetAddressResponseCode;
|
|
|
37 |
private $_cvvResponseCode;
|
38 |
private $_gatewayRejectionReason;
|
39 |
private $_status;
|
13 |
*
|
14 |
* @package Braintree
|
15 |
* @subpackage Result
|
|
|
16 |
*
|
17 |
* @property-read string $avsErrorResponseCode
|
18 |
* @property-read string $avsPostalCodeResponseCode
|
30 |
const VERIFIED = 'verified';
|
31 |
|
32 |
private $_attributes;
|
33 |
+
private $_amount;
|
34 |
private $_avsErrorResponseCode;
|
35 |
private $_avsPostalCodeResponseCode;
|
36 |
private $_avsStreetAddressResponseCode;
|
37 |
+
private $_currencyIsoCode;
|
38 |
private $_cvvResponseCode;
|
39 |
private $_gatewayRejectionReason;
|
40 |
private $_status;
|
lib/Braintree/Result/Error.php
CHANGED
@@ -28,11 +28,10 @@ use Braintree\Error\ErrorCollection;
|
|
28 |
*
|
29 |
* @package Braintree
|
30 |
* @subpackage Result
|
31 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
32 |
*
|
33 |
* @property-read array $params original passed params
|
34 |
-
* @property-read Braintree\Error\ErrorCollection $errors
|
35 |
-
* @property-read Braintree\Result\CreditCardVerification $creditCardVerification credit card verification data
|
36 |
*/
|
37 |
class Error extends Base
|
38 |
{
|
28 |
*
|
29 |
* @package Braintree
|
30 |
* @subpackage Result
|
|
|
31 |
*
|
32 |
* @property-read array $params original passed params
|
33 |
+
* @property-read \Braintree\Error\ErrorCollection $errors
|
34 |
+
* @property-read \Braintree\Result\CreditCardVerification $creditCardVerification credit card verification data
|
35 |
*/
|
36 |
class Error extends Base
|
37 |
{
|
lib/Braintree/Result/Successful.php
CHANGED
@@ -26,7 +26,6 @@ use Braintree\Util;
|
|
26 |
*
|
27 |
* @package Braintree
|
28 |
* @subpackage Result
|
29 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
30 |
*/
|
31 |
class Successful extends Instance
|
32 |
{
|
26 |
*
|
27 |
* @package Braintree
|
28 |
* @subpackage Result
|
|
|
29 |
*/
|
30 |
class Successful extends Instance
|
31 |
{
|
lib/Braintree/Subscription.php
CHANGED
@@ -11,7 +11,6 @@ namespace Braintree;
|
|
11 |
* PHP Version 5
|
12 |
*
|
13 |
* @package Braintree
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*/
|
16 |
class Subscription extends Base
|
17 |
{
|
@@ -128,9 +127,9 @@ class Subscription extends Base
|
|
128 |
return Configuration::gateway()->subscription()->update($subscriptionId, $attributes);
|
129 |
}
|
130 |
|
131 |
-
public static function retryCharge($subscriptionId, $amount = null)
|
132 |
{
|
133 |
-
return Configuration::gateway()->subscription()->retryCharge($subscriptionId, $amount);
|
134 |
}
|
135 |
|
136 |
public static function cancel($subscriptionId)
|
11 |
* PHP Version 5
|
12 |
*
|
13 |
* @package Braintree
|
|
|
14 |
*/
|
15 |
class Subscription extends Base
|
16 |
{
|
127 |
return Configuration::gateway()->subscription()->update($subscriptionId, $attributes);
|
128 |
}
|
129 |
|
130 |
+
public static function retryCharge($subscriptionId, $amount = null, $submitForSettlement = false)
|
131 |
{
|
132 |
+
return Configuration::gateway()->subscription()->retryCharge($subscriptionId, $amount, $submitForSettlement);
|
133 |
}
|
134 |
|
135 |
public static function cancel($subscriptionId)
|
lib/Braintree/Subscription/StatusDetails.php
CHANGED
@@ -8,9 +8,10 @@ use Braintree\Instance;
|
|
8 |
* Creates an instance of StatusDetails, as part of a subscription response
|
9 |
*
|
10 |
* @package Braintree
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*
|
13 |
* @property-read string $price
|
|
|
|
|
14 |
* @property-read string $balance
|
15 |
* @property-read string $status
|
16 |
* @property-read string $timestamp
|
8 |
* Creates an instance of StatusDetails, as part of a subscription response
|
9 |
*
|
10 |
* @package Braintree
|
|
|
11 |
*
|
12 |
* @property-read string $price
|
13 |
+
* @property-read string $currencyIsoCode
|
14 |
+
* @property-read string $planId
|
15 |
* @property-read string $balance
|
16 |
* @property-read string $status
|
17 |
* @property-read string $timestamp
|
lib/Braintree/SubscriptionGateway.php
CHANGED
@@ -13,7 +13,6 @@ use InvalidArgumentException;
|
|
13 |
* PHP Version 5
|
14 |
*
|
15 |
* @package Braintree
|
16 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
17 |
*/
|
18 |
class SubscriptionGateway
|
19 |
{
|
@@ -94,13 +93,16 @@ class SubscriptionGateway
|
|
94 |
return $this->_verifyGatewayResponse($response);
|
95 |
}
|
96 |
|
97 |
-
public function retryCharge($subscriptionId, $amount = null)
|
98 |
{
|
99 |
$transaction_params = ['type' => Transaction::SALE,
|
100 |
'subscriptionId' => $subscriptionId];
|
101 |
if (isset($amount)) {
|
102 |
$transaction_params['amount'] = $amount;
|
103 |
}
|
|
|
|
|
|
|
104 |
|
105 |
$path = $this->_config->merchantPath() . '/transactions';
|
106 |
$response = $this->_http->post($path, ['transaction' => $transaction_params]);
|
13 |
* PHP Version 5
|
14 |
*
|
15 |
* @package Braintree
|
|
|
16 |
*/
|
17 |
class SubscriptionGateway
|
18 |
{
|
93 |
return $this->_verifyGatewayResponse($response);
|
94 |
}
|
95 |
|
96 |
+
public function retryCharge($subscriptionId, $amount = null, $submitForSettlement = false)
|
97 |
{
|
98 |
$transaction_params = ['type' => Transaction::SALE,
|
99 |
'subscriptionId' => $subscriptionId];
|
100 |
if (isset($amount)) {
|
101 |
$transaction_params['amount'] = $amount;
|
102 |
}
|
103 |
+
if ($submitForSettlement) {
|
104 |
+
$transaction_params['options'] = ['submitForSettlement' => $submitForSettlement];
|
105 |
+
}
|
106 |
|
107 |
$path = $this->_config->merchantPath() . '/transactions';
|
108 |
$response = $this->_http->post($path, ['transaction' => $transaction_params]);
|
lib/Braintree/SubscriptionSearch.php
CHANGED
@@ -63,5 +63,10 @@ class SubscriptionSearch
|
|
63 |
{
|
64 |
return new MultipleValueNode('ids');
|
65 |
}
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
class_alias('Braintree\SubscriptionSearch', 'Braintree_SubscriptionSearch');
|
63 |
{
|
64 |
return new MultipleValueNode('ids');
|
65 |
}
|
66 |
+
|
67 |
+
public static function createdAt()
|
68 |
+
{
|
69 |
+
return new RangeNode('created_at');
|
70 |
+
}
|
71 |
}
|
72 |
class_alias('Braintree\SubscriptionSearch', 'Braintree_SubscriptionSearch');
|
lib/Braintree/Test/CreditCardNumbers.php
CHANGED
@@ -10,7 +10,6 @@ namespace Braintree\Test;
|
|
10 |
*
|
11 |
* @package Braintree
|
12 |
* @subpackage Test
|
13 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
14 |
*/
|
15 |
class CreditCardNumbers
|
16 |
{
|
@@ -63,6 +62,10 @@ class CreditCardNumbers
|
|
63 |
'InsufficientPoints' => "371544868764018",
|
64 |
];
|
65 |
|
|
|
|
|
|
|
|
|
66 |
public static function getAll()
|
67 |
{
|
68 |
return array_merge(
|
10 |
*
|
11 |
* @package Braintree
|
12 |
* @subpackage Test
|
|
|
13 |
*/
|
14 |
class CreditCardNumbers
|
15 |
{
|
62 |
'InsufficientPoints' => "371544868764018",
|
63 |
];
|
64 |
|
65 |
+
public static $disputes = [
|
66 |
+
'Chargeback' => '4023898493988028',
|
67 |
+
];
|
68 |
+
|
69 |
public static function getAll()
|
70 |
{
|
71 |
return array_merge(
|
lib/Braintree/Test/MerchantAccount.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree\Test;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @subpackage Test
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
class MerchantAccount
|
12 |
{
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @subpackage Test
|
|
|
9 |
*/
|
10 |
class MerchantAccount
|
11 |
{
|
lib/Braintree/Test/Nonces.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree\Test;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @subpackage Test
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
|
12 |
/**
|
@@ -17,7 +16,6 @@ namespace Braintree\Test;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @subpackage Test
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
*/
|
22 |
class Nonces
|
23 |
{
|
@@ -66,5 +64,13 @@ class Nonces
|
|
66 |
public static $sepa = "fake-sepa-bank-account-nonce";
|
67 |
public static $gatewayRejectedFraud = "fake-gateway-rejected-fraud-nonce";
|
68 |
public static $venmoAccount = "fake-venmo-account-nonce";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
class_alias('Braintree\Test\Nonces', 'Braintree_Test_Nonces');
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @subpackage Test
|
|
|
9 |
*/
|
10 |
|
11 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @subpackage Test
|
|
|
19 |
*/
|
20 |
class Nonces
|
21 |
{
|
64 |
public static $sepa = "fake-sepa-bank-account-nonce";
|
65 |
public static $gatewayRejectedFraud = "fake-gateway-rejected-fraud-nonce";
|
66 |
public static $venmoAccount = "fake-venmo-account-nonce";
|
67 |
+
public static $visaCheckoutAmEx = "fake-visa-checkout-amex-nonce";
|
68 |
+
public static $visaCheckoutDiscover = "fake-visa-checkout-discover-nonce";
|
69 |
+
public static $visaCheckoutMasterCard = "fake-visa-checkout-mastercard-nonce";
|
70 |
+
public static $visaCheckoutVisa = "fake-visa-checkout-visa-nonce";
|
71 |
+
public static $masterpassAmEx = "fake-masterpass-amex-nonce";
|
72 |
+
public static $masterpassDiscover = "fake-masterpass-discover-nonce";
|
73 |
+
public static $masterpassMasterCard = "fake-masterpass-mastercard-nonce";
|
74 |
+
public static $masterpassVisa = "fake-masterpass-visa-nonce";
|
75 |
}
|
76 |
class_alias('Braintree\Test\Nonces', 'Braintree_Test_Nonces');
|
lib/Braintree/Test/Transaction.php
CHANGED
@@ -8,10 +8,8 @@ use Braintree\Configuration;
|
|
8 |
*
|
9 |
* The constants in this class can be used to create transactions with
|
10 |
* the desired status in the sandbox environment.
|
11 |
-
*
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*/
|
14 |
-
|
15 |
{
|
16 |
/**
|
17 |
* settle a transaction by id in sandbox
|
8 |
*
|
9 |
* The constants in this class can be used to create transactions with
|
10 |
* the desired status in the sandbox environment.
|
|
|
|
|
11 |
*/
|
12 |
+
class Transaction
|
13 |
{
|
14 |
/**
|
15 |
* settle a transaction by id in sandbox
|
lib/Braintree/Test/TransactionAmounts.php
CHANGED
@@ -9,7 +9,6 @@ namespace Braintree\Test;
|
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Test
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*/
|
14 |
class TransactionAmounts
|
15 |
{
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Test
|
|
|
12 |
*/
|
13 |
class TransactionAmounts
|
14 |
{
|
lib/Braintree/Test/VenmoSdk.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree\Test;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @subpackage Test
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
class VenmoSdk
|
12 |
{
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @subpackage Test
|
|
|
9 |
*/
|
10 |
class VenmoSdk
|
11 |
{
|
lib/Braintree/TestingGateway.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
-
|
5 |
{
|
6 |
private $_gateway;
|
7 |
private $_config;
|
1 |
<?php
|
2 |
namespace Braintree;
|
3 |
|
4 |
+
class TestingGateway
|
5 |
{
|
6 |
private $_gateway;
|
7 |
private $_config;
|
lib/Braintree/Transaction.php
CHANGED
@@ -135,11 +135,10 @@ namespace Braintree;
|
|
135 |
*
|
136 |
* <b>== More information ==</b>
|
137 |
*
|
138 |
-
* For more detailed information on Transactions, see {@link
|
139 |
*
|
140 |
* @package Braintree
|
141 |
* @category Resources
|
142 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
143 |
*
|
144 |
*
|
145 |
* @property-read string $avsErrorResponseCode
|
@@ -149,15 +148,18 @@ namespace Braintree;
|
|
149 |
* @property-read string $id transaction id
|
150 |
* @property-read string $amount transaction amount
|
151 |
* @property-read Braintree\Transaction\AddressDetails $billingDetails transaction billing address
|
152 |
-
* @property-read
|
153 |
* @property-read Braintree\ApplePayCardDetails $applePayCardDetails transaction Apple Pay card info
|
154 |
* @property-read Braintree\AndroidPayCardDetails $androidPayCardDetails transaction Android Pay card info
|
155 |
* @property-read Braintree\AmexExpressCheckoutCardDetails $amexExpressCheckoutCardDetails transaction Amex Express Checkout card info
|
156 |
* @property-read Braintree\CreditCardDetails $creditCardDetails transaction credit card info
|
157 |
-
* @property-read Braintree\
|
158 |
-
* @property-read Braintree\
|
159 |
-
* @property-read Braintree\
|
|
|
160 |
* @property-read Braintree\VenmoAccount $venmoAccountDetails transaction Venmo Account info
|
|
|
|
|
161 |
* @property-read array $customFields custom fields passed with the request
|
162 |
* @property-read string $processorResponseCode gateway response code
|
163 |
* @property-read string $additionalProcessorResponse raw response from processor
|
@@ -165,13 +167,14 @@ namespace Braintree;
|
|
165 |
* @property-read string $status transaction status
|
166 |
* @property-read array $statusHistory array of StatusDetails objects
|
167 |
* @property-read string $type transaction type
|
168 |
-
* @property-read
|
169 |
* @property-read Braintree\Disbursement $disbursementDetails populated when transaction is disbursed
|
170 |
* @property-read Braintree\Dispute $disputes populated when transaction is disputed
|
|
|
171 |
*
|
172 |
*/
|
173 |
|
174 |
-
|
175 |
{
|
176 |
// Transaction Status
|
177 |
const AUTHORIZATION_EXPIRED = 'authorization_expired';
|
@@ -250,6 +253,22 @@ final class Transaction extends Base
|
|
250 |
);
|
251 |
}
|
252 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
if (isset($transactionAttribs['amexExpressCheckoutCard'])) {
|
254 |
$this->_set('amexExpressCheckoutCardDetails',
|
255 |
new Transaction\AmexExpressCheckoutCardDetails(
|
@@ -290,6 +309,22 @@ final class Transaction extends Base
|
|
290 |
);
|
291 |
}
|
292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
if (isset($transactionAttribs['paypal'])) {
|
294 |
$this->_set('paypalDetails',
|
295 |
new Transaction\PayPalDetails(
|
@@ -378,12 +413,24 @@ final class Transaction extends Base
|
|
378 |
}
|
379 |
$this->_set('discounts', $discountArray);
|
380 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
if(isset($transactionAttribs['riskData'])) {
|
382 |
$this->_set('riskData', RiskData::factory($transactionAttribs['riskData']));
|
383 |
}
|
384 |
if(isset($transactionAttribs['threeDSecureInfo'])) {
|
385 |
$this->_set('threeDSecureInfo', ThreeDSecureInfo::factory($transactionAttribs['threeDSecureInfo']));
|
386 |
}
|
|
|
|
|
|
|
387 |
if(isset($transactionAttribs['facilitatorDetails'])) {
|
388 |
$this->_set('facilitatorDetails', FacilitatorDetails::factory($transactionAttribs['facilitatorDetails']));
|
389 |
}
|
@@ -529,6 +576,11 @@ final class Transaction extends Base
|
|
529 |
return Configuration::gateway()->transaction()->submitForSettlementNoValidate($transactionId, $amount, $attribs);
|
530 |
}
|
531 |
|
|
|
|
|
|
|
|
|
|
|
532 |
public static function submitForPartialSettlement($transactionId, $amount, $attribs = [])
|
533 |
{
|
534 |
return Configuration::gateway()->transaction()->submitForPartialSettlement($transactionId, $amount, $attribs);
|
135 |
*
|
136 |
* <b>== More information ==</b>
|
137 |
*
|
138 |
+
* For more detailed information on Transactions, see {@link https://developers.braintreepayments.com/reference/response/transaction/php https://developers.braintreepayments.com/reference/response/transaction/php}
|
139 |
*
|
140 |
* @package Braintree
|
141 |
* @category Resources
|
|
|
142 |
*
|
143 |
*
|
144 |
* @property-read string $avsErrorResponseCode
|
148 |
* @property-read string $id transaction id
|
149 |
* @property-read string $amount transaction amount
|
150 |
* @property-read Braintree\Transaction\AddressDetails $billingDetails transaction billing address
|
151 |
+
* @property-read \DateTime $createdAt transaction created DateTime
|
152 |
* @property-read Braintree\ApplePayCardDetails $applePayCardDetails transaction Apple Pay card info
|
153 |
* @property-read Braintree\AndroidPayCardDetails $androidPayCardDetails transaction Android Pay card info
|
154 |
* @property-read Braintree\AmexExpressCheckoutCardDetails $amexExpressCheckoutCardDetails transaction Amex Express Checkout card info
|
155 |
* @property-read Braintree\CreditCardDetails $creditCardDetails transaction credit card info
|
156 |
+
* @property-read Braintree\CoinbaseDetails $coinbaseDetails transaction Coinbase account info
|
157 |
+
* @property-read Braintree\MasterpassCardDetails $masterpassCardDetails transaction Masterpass card info
|
158 |
+
* @property-read Braintree\PayPalDetails $paypalDetails transaction paypal account info
|
159 |
+
* @property-read Braintree\Transaction\CustomerDetails $customerDetails transaction customer info
|
160 |
* @property-read Braintree\VenmoAccount $venmoAccountDetails transaction Venmo Account info
|
161 |
+
* @property-read Braintree\IdealPayment $idealPaymentDetails transaction Ideal Payment info
|
162 |
+
* @property-read Braintree\VisaCheckoutCardDetails $visaCheckoutCardDetails transaction Visa Checkout card info
|
163 |
* @property-read array $customFields custom fields passed with the request
|
164 |
* @property-read string $processorResponseCode gateway response code
|
165 |
* @property-read string $additionalProcessorResponse raw response from processor
|
167 |
* @property-read string $status transaction status
|
168 |
* @property-read array $statusHistory array of StatusDetails objects
|
169 |
* @property-read string $type transaction type
|
170 |
+
* @property-read \DateTime $updatedAt transaction updated DateTime
|
171 |
* @property-read Braintree\Disbursement $disbursementDetails populated when transaction is disbursed
|
172 |
* @property-read Braintree\Dispute $disputes populated when transaction is disputed
|
173 |
+
* @property-read Braintree\AuthorizationAdjustment $authorizationAdjustments populated when a transaction has authorization adjustments created when submitted for settlement
|
174 |
*
|
175 |
*/
|
176 |
|
177 |
+
class Transaction extends Base
|
178 |
{
|
179 |
// Transaction Status
|
180 |
const AUTHORIZATION_EXPIRED = 'authorization_expired';
|
253 |
);
|
254 |
}
|
255 |
|
256 |
+
if (isset($transactionAttribs['masterpassCard'])) {
|
257 |
+
$this->_set('masterpassCardDetails',
|
258 |
+
new Transaction\MasterpassCardDetails(
|
259 |
+
$transactionAttribs['masterpassCard']
|
260 |
+
)
|
261 |
+
);
|
262 |
+
}
|
263 |
+
|
264 |
+
if (isset($transactionAttribs['visaCheckoutCard'])) {
|
265 |
+
$this->_set('visaCheckoutCardDetails',
|
266 |
+
new Transaction\VisaCheckoutCardDetails(
|
267 |
+
$transactionAttribs['visaCheckoutCard']
|
268 |
+
)
|
269 |
+
);
|
270 |
+
}
|
271 |
+
|
272 |
if (isset($transactionAttribs['amexExpressCheckoutCard'])) {
|
273 |
$this->_set('amexExpressCheckoutCardDetails',
|
274 |
new Transaction\AmexExpressCheckoutCardDetails(
|
309 |
);
|
310 |
}
|
311 |
|
312 |
+
if (isset($transactionAttribs['usBankAccount'])) {
|
313 |
+
$this->_set('usBankAccount',
|
314 |
+
new Transaction\UsBankAccountDetails(
|
315 |
+
$transactionAttribs['usBankAccount']
|
316 |
+
)
|
317 |
+
);
|
318 |
+
}
|
319 |
+
|
320 |
+
if (isset($transactionAttribs['idealPayment'])) {
|
321 |
+
$this->_set('idealPayment',
|
322 |
+
new Transaction\IdealPaymentDetails(
|
323 |
+
$transactionAttribs['idealPayment']
|
324 |
+
)
|
325 |
+
);
|
326 |
+
}
|
327 |
+
|
328 |
if (isset($transactionAttribs['paypal'])) {
|
329 |
$this->_set('paypalDetails',
|
330 |
new Transaction\PayPalDetails(
|
413 |
}
|
414 |
$this->_set('discounts', $discountArray);
|
415 |
|
416 |
+
$authorizationAdjustments = [];
|
417 |
+
if (isset($transactionAttribs['authorizationAdjustments'])) {
|
418 |
+
foreach ($transactionAttribs['authorizationAdjustments'] AS $authorizationAdjustment) {
|
419 |
+
$authorizationAdjustments[] = AuthorizationAdjustment::factory($authorizationAdjustment);
|
420 |
+
}
|
421 |
+
}
|
422 |
+
|
423 |
+
$this->_set('authorizationAdjustments', $authorizationAdjustments);
|
424 |
+
|
425 |
if(isset($transactionAttribs['riskData'])) {
|
426 |
$this->_set('riskData', RiskData::factory($transactionAttribs['riskData']));
|
427 |
}
|
428 |
if(isset($transactionAttribs['threeDSecureInfo'])) {
|
429 |
$this->_set('threeDSecureInfo', ThreeDSecureInfo::factory($transactionAttribs['threeDSecureInfo']));
|
430 |
}
|
431 |
+
if(isset($transactionAttribs['facilitatedDetails'])) {
|
432 |
+
$this->_set('facilitatedDetails', FacilitatedDetails::factory($transactionAttribs['facilitatedDetails']));
|
433 |
+
}
|
434 |
if(isset($transactionAttribs['facilitatorDetails'])) {
|
435 |
$this->_set('facilitatorDetails', FacilitatorDetails::factory($transactionAttribs['facilitatorDetails']));
|
436 |
}
|
576 |
return Configuration::gateway()->transaction()->submitForSettlementNoValidate($transactionId, $amount, $attribs);
|
577 |
}
|
578 |
|
579 |
+
public static function updateDetails($transactionId, $attribs = [])
|
580 |
+
{
|
581 |
+
return Configuration::gateway()->transaction()->updateDetails($transactionId, $attribs);
|
582 |
+
}
|
583 |
+
|
584 |
public static function submitForPartialSettlement($transactionId, $amount, $attribs = [])
|
585 |
{
|
586 |
return Configuration::gateway()->transaction()->submitForPartialSettlement($transactionId, $amount, $attribs);
|
lib/Braintree/Transaction/AddressDetails.php
CHANGED
@@ -9,7 +9,6 @@ use Braintree\Instance;
|
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Transaction
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*
|
14 |
* @property-read string $firstName
|
15 |
* @property-read string $lastName
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Transaction
|
|
|
12 |
*
|
13 |
* @property-read string $firstName
|
14 |
* @property-read string $lastName
|
lib/Braintree/Transaction/AmexExpressCheckoutCardDetails.php
CHANGED
@@ -7,7 +7,6 @@ use Braintree\Instance;
|
|
7 |
*
|
8 |
* @package Braintree
|
9 |
* @subpackage Transaction
|
10 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
11 |
*/
|
12 |
|
13 |
/**
|
@@ -16,7 +15,6 @@ use Braintree\Instance;
|
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @subpackage Transaction
|
19 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
20 |
*
|
21 |
* @property-read string $cardType
|
22 |
* @property-read string $bin
|
7 |
*
|
8 |
* @package Braintree
|
9 |
* @subpackage Transaction
|
|
|
10 |
*/
|
11 |
|
12 |
/**
|
15 |
*
|
16 |
* @package Braintree
|
17 |
* @subpackage Transaction
|
|
|
18 |
*
|
19 |
* @property-read string $cardType
|
20 |
* @property-read string $bin
|
lib/Braintree/Transaction/AndroidPayCardDetails.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Instance;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Transaction
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
|
14 |
/**
|
@@ -17,7 +16,6 @@ use Braintree\Instance;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @subpackage Transaction
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
*
|
22 |
* @property-read string $bin
|
23 |
* @property-read string $default
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Transaction
|
|
|
11 |
*/
|
12 |
|
13 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @subpackage Transaction
|
|
|
19 |
*
|
20 |
* @property-read string $bin
|
21 |
* @property-read string $default
|
lib/Braintree/Transaction/ApplePayCardDetails.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Instance;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Transaction
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
|
14 |
/**
|
@@ -17,7 +16,6 @@ use Braintree\Instance;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @subpackage Transaction
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
*
|
22 |
* @property-read string $cardType
|
23 |
* @property-read string $paymentInstrumentName
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Transaction
|
|
|
11 |
*/
|
12 |
|
13 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @subpackage Transaction
|
|
|
19 |
*
|
20 |
* @property-read string $cardType
|
21 |
* @property-read string $paymentInstrumentName
|
lib/Braintree/Transaction/CoinbaseDetails.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Instance;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Transaction
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
|
14 |
/**
|
@@ -17,7 +16,6 @@ use Braintree\Instance;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @subpackage Transaction
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
*
|
22 |
* @property-read string $token
|
23 |
* @property-read string $userId
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Transaction
|
|
|
11 |
*/
|
12 |
|
13 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @subpackage Transaction
|
|
|
19 |
*
|
20 |
* @property-read string $token
|
21 |
* @property-read string $userId
|
lib/Braintree/Transaction/CreditCardDetails.php
CHANGED
@@ -9,7 +9,6 @@ use Braintree\Instance;
|
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Transaction
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*
|
14 |
* @property-read string $bin
|
15 |
* @property-read string $cardType
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Transaction
|
|
|
12 |
*
|
13 |
* @property-read string $bin
|
14 |
* @property-read string $cardType
|
lib/Braintree/Transaction/CustomerDetails.php
CHANGED
@@ -9,7 +9,6 @@ use Braintree\Instance;
|
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Transaction
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*
|
14 |
* @property-read string $company
|
15 |
* @property-read string $email
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Transaction
|
|
|
12 |
*
|
13 |
* @property-read string $company
|
14 |
* @property-read string $email
|
lib/Braintree/Transaction/EuropeBankAccountDetails.php
CHANGED
@@ -9,7 +9,6 @@ use Braintree\Instance;
|
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Transaction
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*
|
14 |
* @property-read string $accountHolderName
|
15 |
* @property-read string $bic
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Transaction
|
|
|
12 |
*
|
13 |
* @property-read string $accountHolderName
|
14 |
* @property-read string $bic
|
lib/Braintree/Transaction/IdealPaymentDetails.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree\Transaction;
|
3 |
+
|
4 |
+
use Braintree\Instance;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* iDEAL payment details from a transaction
|
8 |
+
* creates an instance of IdealPaymentDetails
|
9 |
+
*
|
10 |
+
* @package Braintree
|
11 |
+
* @subpackage Transaction
|
12 |
+
*
|
13 |
+
* @property-read string $idealPaymentId
|
14 |
+
* @property-read string $idealTransactionId
|
15 |
+
* @property-read string $imageUrl
|
16 |
+
* @property-read string $maskedIban
|
17 |
+
* @property-read string $bic
|
18 |
+
*/
|
19 |
+
class IdealPaymentDetails extends Instance
|
20 |
+
{
|
21 |
+
protected $_attributes = [];
|
22 |
+
}
|
23 |
+
class_alias('Braintree\Transaction\IdealPaymentDetails', 'Braintree_Transaction_IdealPaymentDetails');
|
lib/Braintree/Transaction/MasterpassCardDetails.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree\Transaction;
|
3 |
+
|
4 |
+
use Braintree\Instance;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* MasterpassCard details from a transaction
|
8 |
+
* creates an instance of MasterpassCardDetails
|
9 |
+
*
|
10 |
+
* @package Braintree
|
11 |
+
* @subpackage Transaction
|
12 |
+
*
|
13 |
+
* @property-read string $bin
|
14 |
+
* @property-read string $callId
|
15 |
+
* @property-read string $cardholderName
|
16 |
+
* @property-read string $commercial
|
17 |
+
* @property-read string $countryOfIssuance
|
18 |
+
* @property-read string $customerId
|
19 |
+
* @property-read string $customerLocation
|
20 |
+
* @property-read string $debit
|
21 |
+
* @property-read string $durbinRegulated
|
22 |
+
* @property-read string $expirationDate
|
23 |
+
* @property-read string $expirationMonth
|
24 |
+
* @property-read string $expirationYear
|
25 |
+
* @property-read string $healthcare
|
26 |
+
* @property-read string $imageUrl
|
27 |
+
* @property-read string $issuingBank
|
28 |
+
* @property-read string $last4
|
29 |
+
* @property-read string $maskedNumber
|
30 |
+
* @property-read string $payroll
|
31 |
+
* @property-read string $prepaid
|
32 |
+
* @property-read string $productId
|
33 |
+
* @property-read string $token
|
34 |
+
* @property-read string $updatedAt
|
35 |
+
*/
|
36 |
+
class MasterpassCardDetails extends Instance
|
37 |
+
{
|
38 |
+
protected $_attributes = [];
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @ignore
|
42 |
+
*/
|
43 |
+
public function __construct($attributes)
|
44 |
+
{
|
45 |
+
parent::__construct($attributes);
|
46 |
+
$this->_attributes['expirationDate'] = $this->expirationMonth . '/' . $this->expirationYear;
|
47 |
+
$this->_attributes['maskedNumber'] = $this->bin . '******' . $this->last4;
|
48 |
+
|
49 |
+
}
|
50 |
+
}
|
51 |
+
class_alias('Braintree\Transaction\MasterpassCardDetails', 'Braintree_Transaction_MasterpassCardDetails');
|
lib/Braintree/Transaction/PayPalDetails.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Instance;
|
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Transaction
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
|
14 |
/**
|
@@ -17,7 +16,6 @@ use Braintree\Instance;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @subpackage Transaction
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
*
|
22 |
* @property-read string $payerEmail
|
23 |
* @property-read string $paymentId
|
8 |
*
|
9 |
* @package Braintree
|
10 |
* @subpackage Transaction
|
|
|
11 |
*/
|
12 |
|
13 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @subpackage Transaction
|
|
|
19 |
*
|
20 |
* @property-read string $payerEmail
|
21 |
* @property-read string $paymentId
|
lib/Braintree/Transaction/StatusDetails.php
CHANGED
@@ -8,7 +8,6 @@ use Braintree\Instance;
|
|
8 |
* Creates an instance of StatusDetails, as part of a transaction response
|
9 |
*
|
10 |
* @package Braintree
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*
|
13 |
* @property-read string $amount
|
14 |
* @property-read string $status
|
8 |
* Creates an instance of StatusDetails, as part of a transaction response
|
9 |
*
|
10 |
* @package Braintree
|
|
|
11 |
*
|
12 |
* @property-read string $amount
|
13 |
* @property-read string $status
|
lib/Braintree/Transaction/SubscriptionDetails.php
CHANGED
@@ -9,7 +9,6 @@ use Braintree\Instance;
|
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Transaction
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*
|
14 |
* @property-read string $billing_period_start_date
|
15 |
* @property-read string $billing_period_end_date
|
9 |
*
|
10 |
* @package Braintree
|
11 |
* @subpackage Transaction
|
|
|
12 |
*
|
13 |
* @property-read string $billing_period_start_date
|
14 |
* @property-read string $billing_period_end_date
|
lib/Braintree/Transaction/UsBankAccountDetails.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree\Transaction;
|
3 |
+
|
4 |
+
use Braintree\Instance;
|
5 |
+
use Braintree\AchMandate;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* US Bank Account details from a transaction
|
9 |
+
* creates an instance of UsbankAccountDetails
|
10 |
+
*
|
11 |
+
* @package Braintree
|
12 |
+
* @subpackage Transaction
|
13 |
+
*
|
14 |
+
* @property-read string $token
|
15 |
+
* @property-read string $imageUrl
|
16 |
+
* @property-read string $routingNumber
|
17 |
+
* @property-read string $accountType
|
18 |
+
* @property-read string $accountHolderName
|
19 |
+
* @property-read string $last4
|
20 |
+
* @property-read string $bankName
|
21 |
+
* @property-read string $achMandate
|
22 |
+
*/
|
23 |
+
class UsBankAccountDetails extends Instance
|
24 |
+
{
|
25 |
+
protected $_attributes = [];
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @ignore
|
29 |
+
*/
|
30 |
+
public function __construct($attributes)
|
31 |
+
{
|
32 |
+
parent::__construct($attributes);
|
33 |
+
|
34 |
+
$achMandate = isset($attributes['achMandate']) ?
|
35 |
+
AchMandate::factory($attributes['achMandate']) :
|
36 |
+
null;
|
37 |
+
$this->achMandate = $achMandate;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
class_alias('Braintree\Transaction\UsBankAccountDetails', 'Braintree_Transaction_UsBankAccountDetails');
|
lib/Braintree/Transaction/VenmoAccountDetails.php
CHANGED
@@ -7,7 +7,6 @@ use Braintree\Instance;
|
|
7 |
*
|
8 |
* @package Braintree
|
9 |
* @subpackage Transaction
|
10 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
11 |
*/
|
12 |
|
13 |
/**
|
@@ -16,7 +15,6 @@ use Braintree\Instance;
|
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @subpackage Transaction
|
19 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
20 |
*
|
21 |
* @property-read string $sourceDescription
|
22 |
* @property-read string $token
|
7 |
*
|
8 |
* @package Braintree
|
9 |
* @subpackage Transaction
|
|
|
10 |
*/
|
11 |
|
12 |
/**
|
15 |
*
|
16 |
* @package Braintree
|
17 |
* @subpackage Transaction
|
|
|
18 |
*
|
19 |
* @property-read string $sourceDescription
|
20 |
* @property-read string $token
|
lib/Braintree/Transaction/VisaCheckoutCardDetails.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree\Transaction;
|
3 |
+
|
4 |
+
use Braintree\Instance;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* VisaCheckoutCard details from a transaction
|
8 |
+
* creates an instance of VisaCheckoutCardDetails
|
9 |
+
*
|
10 |
+
* @package Braintree
|
11 |
+
* @subpackage Transaction
|
12 |
+
*
|
13 |
+
* @property-read string $bin
|
14 |
+
* @property-read string $callId
|
15 |
+
* @property-read string $cardType
|
16 |
+
* @property-read string $cardholderName
|
17 |
+
* @property-read string $commercial
|
18 |
+
* @property-read string $countryOfIssuance
|
19 |
+
* @property-read string $customerId
|
20 |
+
* @property-read string $customerLocation
|
21 |
+
* @property-read string $debit
|
22 |
+
* @property-read string $durbinRegulated
|
23 |
+
* @property-read string $expirationDate
|
24 |
+
* @property-read string $expirationMonth
|
25 |
+
* @property-read string $expirationYear
|
26 |
+
* @property-read string $healthcare
|
27 |
+
* @property-read string $imageUrl
|
28 |
+
* @property-read string $issuingBank
|
29 |
+
* @property-read string $last4
|
30 |
+
* @property-read string $maskedNumber
|
31 |
+
* @property-read string $payroll
|
32 |
+
* @property-read string $prepaid
|
33 |
+
* @property-read string $productId
|
34 |
+
* @property-read string $token
|
35 |
+
* @property-read string $updatedAt
|
36 |
+
*/
|
37 |
+
class VisaCheckoutCardDetails extends Instance
|
38 |
+
{
|
39 |
+
protected $_attributes = [];
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @ignore
|
43 |
+
*/
|
44 |
+
public function __construct($attributes)
|
45 |
+
{
|
46 |
+
parent::__construct($attributes);
|
47 |
+
$this->_attributes['expirationDate'] = $this->expirationMonth . '/' . $this->expirationYear;
|
48 |
+
$this->_attributes['maskedNumber'] = $this->bin . '******' . $this->last4;
|
49 |
+
|
50 |
+
}
|
51 |
+
}
|
52 |
+
class_alias('Braintree\Transaction\VisaCheckoutCardDetails', 'Braintree_Transaction_VisaCheckoutCardDetails');
|
lib/Braintree/TransactionGateway.php
CHANGED
@@ -14,10 +14,9 @@ use InvalidArgumentException;
|
|
14 |
*
|
15 |
* @package Braintree
|
16 |
* @category Resources
|
17 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
18 |
*/
|
19 |
|
20 |
-
|
21 |
{
|
22 |
private $_gateway;
|
23 |
private $_config;
|
@@ -41,7 +40,7 @@ final class TransactionGateway
|
|
41 |
* @ignore
|
42 |
* @access private
|
43 |
* @param array $attribs
|
44 |
-
* @return
|
45 |
*/
|
46 |
private function create($attribs)
|
47 |
{
|
@@ -127,8 +126,12 @@ final class TransactionGateway
|
|
127 |
'taxAmount',
|
128 |
'taxExempt',
|
129 |
'threeDSecureToken',
|
|
|
130 |
'type',
|
131 |
'venmoSdkPaymentMethodCode',
|
|
|
|
|
|
|
132 |
['creditCard' =>
|
133 |
['token', 'cardholderName', 'cvv', 'expirationDate', 'expirationMonth', 'expirationYear', 'number'],
|
134 |
],
|
@@ -151,6 +154,12 @@ final class TransactionGateway
|
|
151 |
'extendedAddress', 'locality', 'postalCode', 'region',
|
152 |
'streetAddress'],
|
153 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
['options' =>
|
155 |
[
|
156 |
'holdInEscrow',
|
@@ -161,6 +170,13 @@ final class TransactionGateway
|
|
161 |
'venmoSdkSession',
|
162 |
'storeShippingAddressInVault',
|
163 |
'payeeEmail',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
['three_d_secure' =>
|
165 |
['required']
|
166 |
],
|
@@ -185,7 +201,8 @@ final class TransactionGateway
|
|
185 |
['customFields' => ['_anyKey_']],
|
186 |
['descriptor' => ['name', 'phone', 'url']],
|
187 |
['paypalAccount' => ['payeeEmail']],
|
188 |
-
['apple_pay_card' => ['number', 'cardholder_name', 'cryptogram', 'expiration_month', 'expiration_year']],
|
|
|
189 |
['industry' =>
|
190 |
['industryType',
|
191 |
['data' =>
|
@@ -211,6 +228,16 @@ final class TransactionGateway
|
|
211 |
return ['orderId', ['descriptor' => ['name', 'phone', 'url']]];
|
212 |
}
|
213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
/**
|
215 |
*
|
216 |
* @access public
|
@@ -256,7 +283,7 @@ final class TransactionGateway
|
|
256 |
/**
|
257 |
* new sale
|
258 |
* @param array $attribs
|
259 |
-
* @return
|
260 |
*/
|
261 |
public function sale($attribs)
|
262 |
{
|
@@ -320,10 +347,14 @@ final class TransactionGateway
|
|
320 |
$path = $this->_config->merchantPath() . '/transactions/advanced_search';
|
321 |
$response = $this->_http->post($path, ['search' => $criteria]);
|
322 |
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
|
|
|
|
|
|
|
|
327 |
}
|
328 |
|
329 |
/**
|
@@ -366,6 +397,16 @@ final class TransactionGateway
|
|
366 |
return Util::returnObjectOrThrowException(__CLASS__, $result);
|
367 |
}
|
368 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
public function submitForPartialSettlement($transactionId, $amount, $attribs = [])
|
370 |
{
|
371 |
$this->_validateId($transactionId);
|
@@ -404,11 +445,20 @@ final class TransactionGateway
|
|
404 |
return $this->_verifyGatewayResponse($response);
|
405 |
}
|
406 |
|
407 |
-
public function refund($transactionId, $
|
408 |
{
|
409 |
self::_validateId($transactionId);
|
410 |
|
411 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
$path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/refund';
|
413 |
$response = $this->_http->post($path, $params);
|
414 |
return $this->_verifyGatewayResponse($response);
|
@@ -420,7 +470,7 @@ final class TransactionGateway
|
|
420 |
* @ignore
|
421 |
* @param var $subPath
|
422 |
* @param array $params
|
423 |
-
* @return
|
424 |
*/
|
425 |
public function _doCreate($subPath, $params)
|
426 |
{
|
14 |
*
|
15 |
* @package Braintree
|
16 |
* @category Resources
|
|
|
17 |
*/
|
18 |
|
19 |
+
class TransactionGateway
|
20 |
{
|
21 |
private $_gateway;
|
22 |
private $_config;
|
40 |
* @ignore
|
41 |
* @access private
|
42 |
* @param array $attribs
|
43 |
+
* @return Result\Successful|Result\Error
|
44 |
*/
|
45 |
private function create($attribs)
|
46 |
{
|
126 |
'taxAmount',
|
127 |
'taxExempt',
|
128 |
'threeDSecureToken',
|
129 |
+
'transactionSource',
|
130 |
'type',
|
131 |
'venmoSdkPaymentMethodCode',
|
132 |
+
['riskData' =>
|
133 |
+
['customerBrowser', 'customerIp', 'customer_browser', 'customer_ip']
|
134 |
+
],
|
135 |
['creditCard' =>
|
136 |
['token', 'cardholderName', 'cvv', 'expirationDate', 'expirationMonth', 'expirationYear', 'number'],
|
137 |
],
|
154 |
'extendedAddress', 'locality', 'postalCode', 'region',
|
155 |
'streetAddress'],
|
156 |
],
|
157 |
+
['threeDSecurePassThru' =>
|
158 |
+
[
|
159 |
+
'eciFlag',
|
160 |
+
'cavv',
|
161 |
+
'xid'],
|
162 |
+
],
|
163 |
['options' =>
|
164 |
[
|
165 |
'holdInEscrow',
|
170 |
'venmoSdkSession',
|
171 |
'storeShippingAddressInVault',
|
172 |
'payeeEmail',
|
173 |
+
'skipAdvancedFraudChecking',
|
174 |
+
'skipAvs',
|
175 |
+
'skipCvv',
|
176 |
+
['threeDSecure' =>
|
177 |
+
['required']
|
178 |
+
],
|
179 |
+
# Included for backwards compatiblity. Remove in the next major version
|
180 |
['three_d_secure' =>
|
181 |
['required']
|
182 |
],
|
201 |
['customFields' => ['_anyKey_']],
|
202 |
['descriptor' => ['name', 'phone', 'url']],
|
203 |
['paypalAccount' => ['payeeEmail']],
|
204 |
+
['apple_pay_card' => ['number', 'cardholder_name', 'cryptogram', 'expiration_month', 'expiration_year', 'eci_indicator']], #backwards compatibility
|
205 |
+
['applePayCard' => ['number', 'cardholderName', 'cryptogram', 'expirationMonth', 'expirationYear', 'eciIndicator']],
|
206 |
['industry' =>
|
207 |
['industryType',
|
208 |
['data' =>
|
228 |
return ['orderId', ['descriptor' => ['name', 'phone', 'url']]];
|
229 |
}
|
230 |
|
231 |
+
public static function updateDetailsSignature()
|
232 |
+
{
|
233 |
+
return ['amount', 'orderId', ['descriptor' => ['name', 'phone', 'url']]];
|
234 |
+
}
|
235 |
+
|
236 |
+
public static function refundSignature()
|
237 |
+
{
|
238 |
+
return ['amount', 'orderId'];
|
239 |
+
}
|
240 |
+
|
241 |
/**
|
242 |
*
|
243 |
* @access public
|
283 |
/**
|
284 |
* new sale
|
285 |
* @param array $attribs
|
286 |
+
* @return Result\Successful|Result\Error
|
287 |
*/
|
288 |
public function sale($attribs)
|
289 |
{
|
347 |
$path = $this->_config->merchantPath() . '/transactions/advanced_search';
|
348 |
$response = $this->_http->post($path, ['search' => $criteria]);
|
349 |
|
350 |
+
if (array_key_exists('creditCardTransactions', $response)) {
|
351 |
+
return Util::extractattributeasarray(
|
352 |
+
$response['creditCardTransactions'],
|
353 |
+
'transaction'
|
354 |
+
);
|
355 |
+
} else {
|
356 |
+
throw new Exception\DownForMaintenance();
|
357 |
+
}
|
358 |
}
|
359 |
|
360 |
/**
|
397 |
return Util::returnObjectOrThrowException(__CLASS__, $result);
|
398 |
}
|
399 |
|
400 |
+
public function updateDetails($transactionId, $attribs = [])
|
401 |
+
{
|
402 |
+
$this->_validateId($transactionId);
|
403 |
+
Util::verifyKeys(self::updateDetailsSignature(), $attribs);
|
404 |
+
|
405 |
+
$path = $this->_config->merchantPath() . '/transactions/'. $transactionId . '/update_details';
|
406 |
+
$response = $this->_http->put($path, ['transaction' => $attribs]);
|
407 |
+
return $this->_verifyGatewayResponse($response);
|
408 |
+
}
|
409 |
+
|
410 |
public function submitForPartialSettlement($transactionId, $amount, $attribs = [])
|
411 |
{
|
412 |
$this->_validateId($transactionId);
|
445 |
return $this->_verifyGatewayResponse($response);
|
446 |
}
|
447 |
|
448 |
+
public function refund($transactionId, $amount_or_options = null)
|
449 |
{
|
450 |
self::_validateId($transactionId);
|
451 |
|
452 |
+
if(gettype($amount_or_options) == "array") {
|
453 |
+
$options = $amount_or_options;
|
454 |
+
} else {
|
455 |
+
$options = [
|
456 |
+
"amount" => $amount_or_options
|
457 |
+
];
|
458 |
+
}
|
459 |
+
Util::verifyKeys(self::refundSignature(), $options);
|
460 |
+
|
461 |
+
$params = ['transaction' => $options];
|
462 |
$path = $this->_config->merchantPath() . '/transactions/' . $transactionId . '/refund';
|
463 |
$response = $this->_http->post($path, $params);
|
464 |
return $this->_verifyGatewayResponse($response);
|
470 |
* @ignore
|
471 |
* @param var $subPath
|
472 |
* @param array $params
|
473 |
+
* @return Result\Successful|Result\Error
|
474 |
*/
|
475 |
public function _doCreate($subPath, $params)
|
476 |
{
|
lib/Braintree/TransactionSearch.php
CHANGED
@@ -20,6 +20,7 @@ class TransactionSearch
|
|
20 |
public static function creditCardExpirationDate() { return new EqualityNode('credit_card_expiration_date'); }
|
21 |
public static function creditCardNumber() { return new PartialMatchNode('credit_card_number'); }
|
22 |
public static function creditCardUniqueIdentifier() { return new TextNode('credit_card_unique_identifier'); }
|
|
|
23 |
public static function customerCompany() { return new TextNode('customer_company'); }
|
24 |
public static function customerEmail() { return new TextNode('customer_email'); }
|
25 |
public static function customerFax() { return new TextNode('customer_fax'); }
|
20 |
public static function creditCardExpirationDate() { return new EqualityNode('credit_card_expiration_date'); }
|
21 |
public static function creditCardNumber() { return new PartialMatchNode('credit_card_number'); }
|
22 |
public static function creditCardUniqueIdentifier() { return new TextNode('credit_card_unique_identifier'); }
|
23 |
+
public static function currency() { return new TextNode('currency'); }
|
24 |
public static function customerCompany() { return new TextNode('customer_company'); }
|
25 |
public static function customerEmail() { return new TextNode('customer_email'); }
|
26 |
public static function customerFax() { return new TextNode('customer_fax'); }
|
lib/Braintree/TransparentRedirect.php
CHANGED
@@ -34,7 +34,6 @@ namespace Braintree;
|
|
34 |
*
|
35 |
* @package Braintree
|
36 |
* @category Resources
|
37 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
38 |
*/
|
39 |
class TransparentRedirect
|
40 |
{
|
34 |
*
|
35 |
* @package Braintree
|
36 |
* @category Resources
|
|
|
37 |
*/
|
38 |
class TransparentRedirect
|
39 |
{
|
lib/Braintree/TransparentRedirectGateway.php
CHANGED
@@ -11,7 +11,6 @@ use DateTimeZone;
|
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*/
|
16 |
class TransparentRedirectGateway
|
17 |
{
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
|
|
14 |
*/
|
15 |
class TransparentRedirectGateway
|
16 |
{
|
lib/Braintree/UnknownPaymentMethod.php
CHANGED
@@ -6,7 +6,6 @@ namespace Braintree;
|
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
|
12 |
/**
|
@@ -17,7 +16,6 @@ namespace Braintree;
|
|
17 |
*
|
18 |
* @package Braintree
|
19 |
* @category Resources
|
20 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
21 |
*
|
22 |
* @property-read string $token
|
23 |
* @property-read string $imageUrl
|
6 |
*
|
7 |
* @package Braintree
|
8 |
* @category Resources
|
|
|
9 |
*/
|
10 |
|
11 |
/**
|
16 |
*
|
17 |
* @package Braintree
|
18 |
* @category Resources
|
|
|
19 |
*
|
20 |
* @property-read string $token
|
21 |
* @property-read string $imageUrl
|
lib/Braintree/UsBankAccount.php
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Braintree UsBankAccount module
|
6 |
+
*
|
7 |
+
* @package Braintree
|
8 |
+
* @category Resources
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Manages Braintree UsBankAccounts
|
13 |
+
*
|
14 |
+
* <b>== More information ==</b>
|
15 |
+
*
|
16 |
+
*
|
17 |
+
* @package Braintree
|
18 |
+
* @category Resources
|
19 |
+
*
|
20 |
+
* @property-read string $customerId
|
21 |
+
* @property-read string $email
|
22 |
+
* @property-read string $token
|
23 |
+
* @property-read string $imageUrl
|
24 |
+
* @property-read string $routingNumber
|
25 |
+
* @property-read string $accountType
|
26 |
+
* @property-read string $accountHolderName
|
27 |
+
* @property-read string $last4
|
28 |
+
* @property-read string $bankName
|
29 |
+
* @property-read string $achMandate
|
30 |
+
* @property-read string $default
|
31 |
+
*/
|
32 |
+
class UsBankAccount extends Base
|
33 |
+
{
|
34 |
+
/**
|
35 |
+
* factory method: returns an instance of UsBankAccount
|
36 |
+
* to the requesting method, with populated properties
|
37 |
+
*
|
38 |
+
* @ignore
|
39 |
+
* @return UsBankAccount
|
40 |
+
*/
|
41 |
+
public static function factory($attributes)
|
42 |
+
{
|
43 |
+
$instance = new self();
|
44 |
+
$instance->_initialize($attributes);
|
45 |
+
return $instance;
|
46 |
+
}
|
47 |
+
|
48 |
+
/* instance methods */
|
49 |
+
|
50 |
+
/**
|
51 |
+
* sets instance properties from an array of values
|
52 |
+
*
|
53 |
+
* @access protected
|
54 |
+
* @param array $usBankAccountAttribs array of usBankAccount data
|
55 |
+
* @return void
|
56 |
+
*/
|
57 |
+
protected function _initialize($usBankAccountAttribs)
|
58 |
+
{
|
59 |
+
// set the attributes
|
60 |
+
$this->_attributes = $usBankAccountAttribs;
|
61 |
+
|
62 |
+
$achMandate = isset($usBankAccountAttribs['achMandate']) ?
|
63 |
+
AchMandate::factory($usBankAccountAttribs['achMandate']) :
|
64 |
+
null;
|
65 |
+
$this->_set('achMandate', $achMandate);
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* create a printable representation of the object as:
|
70 |
+
* ClassName[property=value, property=value]
|
71 |
+
* @return string
|
72 |
+
*/
|
73 |
+
public function __toString()
|
74 |
+
{
|
75 |
+
return __CLASS__ . '[' .
|
76 |
+
Util::attributesToString($this->_attributes) . ']';
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
// static methods redirecting to gateway
|
81 |
+
|
82 |
+
public static function find($token)
|
83 |
+
{
|
84 |
+
return Configuration::gateway()->usBankAccount()->find($token);
|
85 |
+
}
|
86 |
+
|
87 |
+
public static function sale($token, $transactionAttribs)
|
88 |
+
{
|
89 |
+
$transactionAttribs['options'] = [
|
90 |
+
'submitForSettlement' => true
|
91 |
+
];
|
92 |
+
return Configuration::gateway()->usBankAccount()->sale($token, $transactionAttribs);
|
93 |
+
}
|
94 |
+
}
|
95 |
+
class_alias('Braintree\UsBankAccount', 'Braintree_UsBankAccount');
|
lib/Braintree/UsBankAccountGateway.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
use InvalidArgumentException;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Braintree UsBankAccountGateway module
|
8 |
+
*
|
9 |
+
* @package Braintree
|
10 |
+
* @category Resources
|
11 |
+
*/
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Manages Braintree UsBankAccounts
|
15 |
+
*
|
16 |
+
* <b>== More information ==</b>
|
17 |
+
*
|
18 |
+
*
|
19 |
+
* @package Braintree
|
20 |
+
* @category Resources
|
21 |
+
*/
|
22 |
+
class UsBankAccountGateway
|
23 |
+
{
|
24 |
+
private $_gateway;
|
25 |
+
private $_config;
|
26 |
+
private $_http;
|
27 |
+
|
28 |
+
public function __construct($gateway)
|
29 |
+
{
|
30 |
+
$this->_gateway = $gateway;
|
31 |
+
$this->_config = $gateway->config;
|
32 |
+
$this->_config->assertHasAccessTokenOrKeys();
|
33 |
+
$this->_http = new Http($gateway->config);
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
/**
|
38 |
+
* find a usBankAccount by token
|
39 |
+
*
|
40 |
+
* @access public
|
41 |
+
* @param string $token paypal accountunique id
|
42 |
+
* @return UsBankAccount
|
43 |
+
* @throws Exception\NotFound
|
44 |
+
*/
|
45 |
+
public function find($token)
|
46 |
+
{
|
47 |
+
try {
|
48 |
+
$path = $this->_config->merchantPath() . '/payment_methods/us_bank_account/' . $token;
|
49 |
+
$response = $this->_http->get($path);
|
50 |
+
return UsBankAccount::factory($response['usBankAccount']);
|
51 |
+
} catch (Exception\NotFound $e) {
|
52 |
+
throw new Exception\NotFound(
|
53 |
+
'US bank account with token ' . $token . ' not found'
|
54 |
+
);
|
55 |
+
}
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* create a new sale for the current UsBank account
|
61 |
+
*
|
62 |
+
* @param string $token
|
63 |
+
* @param array $transactionAttribs
|
64 |
+
* @return Result\Successful|Result\Error
|
65 |
+
* @see Transaction::sale()
|
66 |
+
*/
|
67 |
+
public function sale($token, $transactionAttribs)
|
68 |
+
{
|
69 |
+
return Transaction::sale(
|
70 |
+
array_merge(
|
71 |
+
$transactionAttribs,
|
72 |
+
['paymentMethodToken' => $token]
|
73 |
+
)
|
74 |
+
);
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* generic method for validating incoming gateway responses
|
79 |
+
*
|
80 |
+
* creates a new UsBankAccount object and encapsulates
|
81 |
+
* it inside a Result\Successful object, or
|
82 |
+
* encapsulates a Errors object inside a Result\Error
|
83 |
+
* alternatively, throws an Unexpected exception if the response is invalid.
|
84 |
+
*
|
85 |
+
* @ignore
|
86 |
+
* @param array $response gateway response values
|
87 |
+
* @return Result\Successful|Result\Error
|
88 |
+
* @throws Exception\Unexpected
|
89 |
+
*/
|
90 |
+
private function _verifyGatewayResponse($response)
|
91 |
+
{
|
92 |
+
if (isset($response['usBankAccount'])) {
|
93 |
+
// return a populated instance of UsBankAccount
|
94 |
+
return new Result\Successful(
|
95 |
+
UsBankAccount::factory($response['usBankAccount'])
|
96 |
+
);
|
97 |
+
} else if (isset($response['apiErrorResponse'])) {
|
98 |
+
return new Result\Error($response['apiErrorResponse']);
|
99 |
+
} else {
|
100 |
+
throw new Exception\Unexpected(
|
101 |
+
'Expected US bank account or apiErrorResponse'
|
102 |
+
);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
106 |
+
class_alias('Braintree\UsBankAccountGateway', 'Braintree_UsBankAccountGateway');
|
lib/Braintree/Util.php
CHANGED
@@ -7,8 +7,6 @@ use InvalidArgumentException;
|
|
7 |
/**
|
8 |
* Braintree Utility methods
|
9 |
* PHP version 5
|
10 |
-
*
|
11 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
12 |
*/
|
13 |
|
14 |
class Util
|
@@ -66,6 +64,9 @@ class Util
|
|
66 |
case 426:
|
67 |
throw new Exception\UpgradeRequired();
|
68 |
break;
|
|
|
|
|
|
|
69 |
case 500:
|
70 |
throw new Exception\ServerError();
|
71 |
break;
|
@@ -132,6 +133,12 @@ class Util
|
|
132 |
'Braintree_Discount' => 'discount',
|
133 |
'Braintree\DiscountGateway' => 'discount',
|
134 |
'Braintree_DiscountGateway' => 'discount',
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
'Braintree\Plan' => 'plan',
|
136 |
'Braintree_Plan' => 'plan',
|
137 |
'Braintree\PlanGateway' => 'plan',
|
@@ -154,6 +161,8 @@ class Util
|
|
154 |
'Braintree_MerchantAccountGateway' => 'merchantAccount',
|
155 |
'Braintree\OAuthCredentials' => 'credentials',
|
156 |
'Braintree_OAuthCredentials' => 'credentials',
|
|
|
|
|
157 |
'Braintree\PayPalAccount' => 'paypalAccount',
|
158 |
'Braintree_PayPalAccount' => 'paypalAccount',
|
159 |
'Braintree\PayPalAccountGateway' => 'paypalAccount',
|
@@ -173,6 +182,8 @@ class Util
|
|
173 |
$responseKeysToClassNames = [
|
174 |
'creditCard' => 'Braintree\CreditCard',
|
175 |
'customer' => 'Braintree\Customer',
|
|
|
|
|
176 |
'subscription' => 'Braintree\Subscription',
|
177 |
'transaction' => 'Braintree\Transaction',
|
178 |
'verification' => 'Braintree\CreditCardVerification',
|
7 |
/**
|
8 |
* Braintree Utility methods
|
9 |
* PHP version 5
|
|
|
|
|
10 |
*/
|
11 |
|
12 |
class Util
|
64 |
case 426:
|
65 |
throw new Exception\UpgradeRequired();
|
66 |
break;
|
67 |
+
case 429:
|
68 |
+
throw new Exception\TooManyRequests();
|
69 |
+
break;
|
70 |
case 500:
|
71 |
throw new Exception\ServerError();
|
72 |
break;
|
133 |
'Braintree_Discount' => 'discount',
|
134 |
'Braintree\DiscountGateway' => 'discount',
|
135 |
'Braintree_DiscountGateway' => 'discount',
|
136 |
+
'Braintree\Dispute' => 'dispute',
|
137 |
+
'Braintree_Dispute' => 'dispute',
|
138 |
+
'Braintree\Dispute\EvidenceDetails' => 'evidence',
|
139 |
+
'Braintree_Dispute_EvidenceDetails' => 'evidence',
|
140 |
+
'Braintree\DocumentUpload' => 'documentUpload',
|
141 |
+
'Braintree_DocumentUpload' => 'doumentUpload',
|
142 |
'Braintree\Plan' => 'plan',
|
143 |
'Braintree_Plan' => 'plan',
|
144 |
'Braintree\PlanGateway' => 'plan',
|
161 |
'Braintree_MerchantAccountGateway' => 'merchantAccount',
|
162 |
'Braintree\OAuthCredentials' => 'credentials',
|
163 |
'Braintree_OAuthCredentials' => 'credentials',
|
164 |
+
'Braintree\OAuthResult' => 'result',
|
165 |
+
'Braintree_OAuthResult' => 'result',
|
166 |
'Braintree\PayPalAccount' => 'paypalAccount',
|
167 |
'Braintree_PayPalAccount' => 'paypalAccount',
|
168 |
'Braintree\PayPalAccountGateway' => 'paypalAccount',
|
182 |
$responseKeysToClassNames = [
|
183 |
'creditCard' => 'Braintree\CreditCard',
|
184 |
'customer' => 'Braintree\Customer',
|
185 |
+
'dispute' => 'Braintree\Dispute',
|
186 |
+
'documentUpload' => 'Braintree\DocumentUpload',
|
187 |
'subscription' => 'Braintree\Subscription',
|
188 |
'transaction' => 'Braintree\Transaction',
|
189 |
'verification' => 'Braintree\CreditCardVerification',
|
lib/Braintree/VenmoAccount.php
CHANGED
@@ -11,7 +11,6 @@ namespace Braintree;
|
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*
|
16 |
* @property-read string $createdAt
|
17 |
* @property-read string $default
|
11 |
*
|
12 |
* @package Braintree
|
13 |
* @category Resources
|
|
|
14 |
*
|
15 |
* @property-read string $createdAt
|
16 |
* @property-read string $default
|
lib/Braintree/Version.php
CHANGED
@@ -4,16 +4,14 @@ namespace Braintree;
|
|
4 |
/**
|
5 |
* Braintree Library Version
|
6 |
* stores version information about the Braintree library
|
7 |
-
*
|
8 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
9 |
*/
|
10 |
-
|
11 |
{
|
12 |
/**
|
13 |
* class constants
|
14 |
*/
|
15 |
const MAJOR = 3;
|
16 |
-
const MINOR =
|
17 |
const TINY = 0;
|
18 |
|
19 |
/**
|
4 |
/**
|
5 |
* Braintree Library Version
|
6 |
* stores version information about the Braintree library
|
|
|
|
|
7 |
*/
|
8 |
+
class Version
|
9 |
{
|
10 |
/**
|
11 |
* class constants
|
12 |
*/
|
13 |
const MAJOR = 3;
|
14 |
+
const MINOR = 25;
|
15 |
const TINY = 0;
|
16 |
|
17 |
/**
|
lib/Braintree/VisaCheckoutCard.php
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Braintree VisaCheckoutCard module
|
6 |
+
* Creates and manages Braintree VisaCheckoutCards
|
7 |
+
*
|
8 |
+
* <b>== More information ==</b>
|
9 |
+
*
|
10 |
+
* For more detailed information on CreditCard verifications, see {@link http://www.braintreepayments.com/gateway/credit-card-verification-api http://www.braintreepaymentsolutions.com/gateway/credit-card-verification-api}
|
11 |
+
*
|
12 |
+
* @package Braintree
|
13 |
+
* @category Resources
|
14 |
+
*
|
15 |
+
* @property-read string $billingAddress
|
16 |
+
* @property-read string $bin
|
17 |
+
* @property-read string $callId
|
18 |
+
* @property-read string $cardType
|
19 |
+
* @property-read string $cardholderName
|
20 |
+
* @property-read string $commercial
|
21 |
+
* @property-read string $countryOfIssuance
|
22 |
+
* @property-read string $createdAt
|
23 |
+
* @property-read string $customerId
|
24 |
+
* @property-read string $customerLocation
|
25 |
+
* @property-read string $debit
|
26 |
+
* @property-read string $default
|
27 |
+
* @property-read string $durbinRegulated
|
28 |
+
* @property-read string $expirationDate
|
29 |
+
* @property-read string $expirationMonth
|
30 |
+
* @property-read string $expirationYear
|
31 |
+
* @property-read string $expired
|
32 |
+
* @property-read string $healthcare
|
33 |
+
* @property-read string $imageUrl
|
34 |
+
* @property-read string $issuingBank
|
35 |
+
* @property-read string $last4
|
36 |
+
* @property-read string $maskedNumber
|
37 |
+
* @property-read string $payroll
|
38 |
+
* @property-read string $prepaid
|
39 |
+
* @property-read string $productId
|
40 |
+
* @property-read string $subscriptions
|
41 |
+
* @property-read string $token
|
42 |
+
* @property-read string $uniqueNumberIdentifier
|
43 |
+
* @property-read string $updatedAt
|
44 |
+
*/
|
45 |
+
class VisaCheckoutCard extends Base
|
46 |
+
{
|
47 |
+
/* instance methods */
|
48 |
+
/**
|
49 |
+
* returns false if default is null or false
|
50 |
+
*
|
51 |
+
* @return boolean
|
52 |
+
*/
|
53 |
+
public function isDefault()
|
54 |
+
{
|
55 |
+
return $this->default;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* checks whether the card is expired based on the current date
|
60 |
+
*
|
61 |
+
* @return boolean
|
62 |
+
*/
|
63 |
+
public function isExpired()
|
64 |
+
{
|
65 |
+
return $this->expired;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* sets instance properties from an array of values
|
70 |
+
*
|
71 |
+
* @access protected
|
72 |
+
* @param array $creditCardAttribs array of creditcard data
|
73 |
+
* @return void
|
74 |
+
*/
|
75 |
+
protected function _initialize($creditCardAttribs)
|
76 |
+
{
|
77 |
+
// set the attributes
|
78 |
+
$this->_attributes = $creditCardAttribs;
|
79 |
+
|
80 |
+
// map each address into its own object
|
81 |
+
$billingAddress = isset($creditCardAttribs['billingAddress']) ?
|
82 |
+
Address::factory($creditCardAttribs['billingAddress']) :
|
83 |
+
null;
|
84 |
+
|
85 |
+
$subscriptionArray = [];
|
86 |
+
if (isset($creditCardAttribs['subscriptions'])) {
|
87 |
+
foreach ($creditCardAttribs['subscriptions'] AS $subscription) {
|
88 |
+
$subscriptionArray[] = Subscription::factory($subscription);
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
$this->_set('subscriptions', $subscriptionArray);
|
93 |
+
$this->_set('billingAddress', $billingAddress);
|
94 |
+
$this->_set('expirationDate', $this->expirationMonth . '/' . $this->expirationYear);
|
95 |
+
$this->_set('maskedNumber', $this->bin . '******' . $this->last4);
|
96 |
+
|
97 |
+
if(isset($creditCardAttribs['verifications']) && count($creditCardAttribs['verifications']) > 0) {
|
98 |
+
$verifications = $creditCardAttribs['verifications'];
|
99 |
+
usort($verifications, [$this, '_compareCreatedAtOnVerifications']);
|
100 |
+
|
101 |
+
$this->_set('verification', CreditCardVerification::factory($verifications[0]));
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
private function _compareCreatedAtOnVerifications($verificationAttrib1, $verificationAttrib2)
|
106 |
+
{
|
107 |
+
return ($verificationAttrib2['createdAt'] < $verificationAttrib1['createdAt']) ? -1 : 1;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* returns false if comparing object is not a VisaCheckoutCard,
|
112 |
+
* or is a VisaCheckoutCard with a different id
|
113 |
+
*
|
114 |
+
* @param object $otherVisaCheckoutCard customer to compare against
|
115 |
+
* @return boolean
|
116 |
+
*/
|
117 |
+
public function isEqual($otherVisaCheckoutCard)
|
118 |
+
{
|
119 |
+
return !($otherVisaCheckoutCard instanceof self) ? false : $this->token === $otherVisaCheckoutCard->token;
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* create a printable representation of the object as:
|
124 |
+
* ClassName[property=value, property=value]
|
125 |
+
* @return string
|
126 |
+
*/
|
127 |
+
public function __toString()
|
128 |
+
{
|
129 |
+
return __CLASS__ . '[' .
|
130 |
+
Util::attributesToString($this->_attributes) .']';
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* factory method: returns an instance of VisaCheckoutCard
|
135 |
+
* to the requesting method, with populated properties
|
136 |
+
*
|
137 |
+
* @ignore
|
138 |
+
* @return VisaCheckoutCard
|
139 |
+
*/
|
140 |
+
public static function factory($attributes)
|
141 |
+
{
|
142 |
+
$defaultAttributes = [
|
143 |
+
'bin' => '',
|
144 |
+
'expirationMonth' => '',
|
145 |
+
'expirationYear' => '',
|
146 |
+
'last4' => '',
|
147 |
+
];
|
148 |
+
|
149 |
+
$instance = new self();
|
150 |
+
$instance->_initialize(array_merge($defaultAttributes, $attributes));
|
151 |
+
return $instance;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
class_alias('Braintree\VisaCheckoutCard', 'Braintree_VisaCheckoutCard');
|
lib/Braintree/WebhookNotification.php
CHANGED
@@ -13,6 +13,8 @@ class WebhookNotification extends Base
|
|
13 |
const SUB_MERCHANT_ACCOUNT_APPROVED = 'sub_merchant_account_approved';
|
14 |
const SUB_MERCHANT_ACCOUNT_DECLINED = 'sub_merchant_account_declined';
|
15 |
const TRANSACTION_DISBURSED = 'transaction_disbursed';
|
|
|
|
|
16 |
const DISBURSEMENT_EXCEPTION = 'disbursement_exception';
|
17 |
const DISBURSEMENT = 'disbursement';
|
18 |
const DISPUTE_OPENED = 'dispute_opened';
|
@@ -22,30 +24,18 @@ class WebhookNotification extends Base
|
|
22 |
const PARTNER_MERCHANT_DISCONNECTED = 'partner_merchant_disconnected';
|
23 |
const PARTNER_MERCHANT_DECLINED = 'partner_merchant_declined';
|
24 |
const CHECK = 'check';
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
Configuration::
|
33 |
-
self::_validateSignature($signature, $payload);
|
34 |
-
|
35 |
-
$xml = base64_decode($payload);
|
36 |
-
$attributes = Xml::buildArrayFromXml($xml);
|
37 |
-
return self::factory($attributes['notification']);
|
38 |
}
|
39 |
|
40 |
-
public static function verify($challenge)
|
41 |
-
|
42 |
-
if (!preg_match('/^[a-f0-9]{20,32}$/', $challenge)) {
|
43 |
-
throw new Exception\InvalidChallenge("challenge contains non-hex characters");
|
44 |
-
}
|
45 |
-
Configuration::assertGlobalHasAccessTokenOrKeys();
|
46 |
-
$publicKey = Configuration::publicKey();
|
47 |
-
$digest = Digest::hexDigestSha1(Configuration::privateKey(), $challenge);
|
48 |
-
return "{$publicKey}|{$digest}";
|
49 |
}
|
50 |
|
51 |
public static function factory($attributes)
|
@@ -55,38 +45,6 @@ class WebhookNotification extends Base
|
|
55 |
return $instance;
|
56 |
}
|
57 |
|
58 |
-
private static function _matchingSignature($signaturePairs)
|
59 |
-
{
|
60 |
-
foreach ($signaturePairs as $pair)
|
61 |
-
{
|
62 |
-
$components = preg_split("/\|/", $pair);
|
63 |
-
if ($components[0] == Configuration::publicKey()) {
|
64 |
-
return $components[1];
|
65 |
-
}
|
66 |
-
}
|
67 |
-
|
68 |
-
return null;
|
69 |
-
}
|
70 |
-
|
71 |
-
private static function _payloadMatches($signature, $payload)
|
72 |
-
{
|
73 |
-
$payloadSignature = Digest::hexDigestSha1(Configuration::privateKey(), $payload);
|
74 |
-
return Digest::secureCompare($signature, $payloadSignature);
|
75 |
-
}
|
76 |
-
|
77 |
-
private static function _validateSignature($signatureString, $payload)
|
78 |
-
{
|
79 |
-
$signaturePairs = preg_split("/&/", $signatureString);
|
80 |
-
$signature = self::_matchingSignature($signaturePairs);
|
81 |
-
if (!$signature) {
|
82 |
-
throw new Exception\InvalidSignature("no matching public key");
|
83 |
-
}
|
84 |
-
|
85 |
-
if (!(self::_payloadMatches($signature, $payload) || self::_payloadMatches($signature, $payload . "\n"))) {
|
86 |
-
throw new Exception\InvalidSignature("signature does not match payload - one has been modified");
|
87 |
-
}
|
88 |
-
}
|
89 |
-
|
90 |
protected function _initialize($attributes)
|
91 |
{
|
92 |
$this->_attributes = $attributes;
|
@@ -117,10 +75,26 @@ class WebhookNotification extends Base
|
|
117 |
$this->_set('partnerMerchant', PartnerMerchant::factory($wrapperNode['partnerMerchant']));
|
118 |
}
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
if (isset($wrapperNode['dispute'])) {
|
121 |
$this->_set('dispute', Dispute::factory($wrapperNode['dispute']));
|
122 |
}
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
if (isset($wrapperNode['errors'])) {
|
125 |
$this->_set('errors', new Error\ValidationErrorCollection($wrapperNode['errors']));
|
126 |
$this->_set('message', $wrapperNode['message']);
|
13 |
const SUB_MERCHANT_ACCOUNT_APPROVED = 'sub_merchant_account_approved';
|
14 |
const SUB_MERCHANT_ACCOUNT_DECLINED = 'sub_merchant_account_declined';
|
15 |
const TRANSACTION_DISBURSED = 'transaction_disbursed';
|
16 |
+
const TRANSACTION_SETTLED = 'transaction_settled';
|
17 |
+
const TRANSACTION_SETTLEMENT_DECLINED = 'transaction_settlement_declined';
|
18 |
const DISBURSEMENT_EXCEPTION = 'disbursement_exception';
|
19 |
const DISBURSEMENT = 'disbursement';
|
20 |
const DISPUTE_OPENED = 'dispute_opened';
|
24 |
const PARTNER_MERCHANT_DISCONNECTED = 'partner_merchant_disconnected';
|
25 |
const PARTNER_MERCHANT_DECLINED = 'partner_merchant_declined';
|
26 |
const CHECK = 'check';
|
27 |
+
const ACCOUNT_UPDATER_DAILY_REPORT = 'account_updater_daily_report';
|
28 |
+
const CONNECTED_MERCHANT_STATUS_TRANSITIONED = 'connected_merchant_status_transitioned';
|
29 |
+
const CONNECTED_MERCHANT_PAYPAL_STATUS_CHANGED = 'connected_merchant_paypal_status_changed';
|
30 |
+
const IDEAL_PAYMENT_COMPLETE = 'ideal_payment_complete';
|
31 |
+
const IDEAL_PAYMENT_FAILED = 'ideal_payment_failed';
|
32 |
+
|
33 |
+
public static function parse($signature, $payload) {
|
34 |
+
return Configuration::gateway()->webhookNotification()->parse($signature, $payload);
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
+
public static function verify($challenge) {
|
38 |
+
return Configuration::gateway()->webhookNotification()->verify($challenge);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
public static function factory($attributes)
|
45 |
return $instance;
|
46 |
}
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
protected function _initialize($attributes)
|
49 |
{
|
50 |
$this->_attributes = $attributes;
|
75 |
$this->_set('partnerMerchant', PartnerMerchant::factory($wrapperNode['partnerMerchant']));
|
76 |
}
|
77 |
|
78 |
+
if (isset($wrapperNode['connectedMerchantStatusTransitioned'])) {
|
79 |
+
$this->_set('connectedMerchantStatusTransitioned', ConnectedMerchantStatusTransitioned::factory($wrapperNode['connectedMerchantStatusTransitioned']));
|
80 |
+
}
|
81 |
+
|
82 |
+
if (isset($wrapperNode['connectedMerchantPaypalStatusChanged'])) {
|
83 |
+
$this->_set('connectedMerchantPayPalStatusChanged', ConnectedMerchantPayPalStatusChanged::factory($wrapperNode['connectedMerchantPaypalStatusChanged']));
|
84 |
+
}
|
85 |
+
|
86 |
if (isset($wrapperNode['dispute'])) {
|
87 |
$this->_set('dispute', Dispute::factory($wrapperNode['dispute']));
|
88 |
}
|
89 |
|
90 |
+
if (isset($wrapperNode['accountUpdaterDailyReport'])) {
|
91 |
+
$this->_set('accountUpdaterDailyReport', AccountUpdaterDailyReport::factory($wrapperNode['accountUpdaterDailyReport']));
|
92 |
+
}
|
93 |
+
|
94 |
+
if (isset($wrapperNode['idealPayment'])) {
|
95 |
+
$this->_set('idealPayment', IdealPayment::factory($wrapperNode['idealPayment']));
|
96 |
+
}
|
97 |
+
|
98 |
if (isset($wrapperNode['errors'])) {
|
99 |
$this->_set('errors', new Error\ValidationErrorCollection($wrapperNode['errors']));
|
100 |
$this->_set('message', $wrapperNode['message']);
|
lib/Braintree/WebhookNotificationGateway.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Braintree;
|
3 |
+
|
4 |
+
class WebhookNotificationGateway
|
5 |
+
{
|
6 |
+
|
7 |
+
public function __construct($gateway)
|
8 |
+
{
|
9 |
+
$this->config = $gateway->config;
|
10 |
+
$this->config->assertHasAccessTokenOrKeys();
|
11 |
+
}
|
12 |
+
|
13 |
+
public function parse($signature, $payload)
|
14 |
+
{
|
15 |
+
if (preg_match("/[^A-Za-z0-9+=\/\n]/", $payload) === 1) {
|
16 |
+
throw new Exception\InvalidSignature("payload contains illegal characters");
|
17 |
+
}
|
18 |
+
|
19 |
+
self::_validateSignature($signature, $payload);
|
20 |
+
|
21 |
+
$xml = base64_decode($payload);
|
22 |
+
$attributes = Xml::buildArrayFromXml($xml);
|
23 |
+
return WebhookNotification::factory($attributes['notification']);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function verify($challenge)
|
27 |
+
{
|
28 |
+
if (!preg_match('/^[a-f0-9]{20,32}$/', $challenge)) {
|
29 |
+
throw new Exception\InvalidChallenge("challenge contains non-hex characters");
|
30 |
+
}
|
31 |
+
$publicKey = $this->config->publicKey();
|
32 |
+
$digest = Digest::hexDigestSha1($this->config->privateKey(), $challenge);
|
33 |
+
return "{$publicKey}|{$digest}";
|
34 |
+
}
|
35 |
+
|
36 |
+
private function _payloadMatches($signature, $payload)
|
37 |
+
{
|
38 |
+
$payloadSignature = Digest::hexDigestSha1($this->config->privateKey(), $payload);
|
39 |
+
return Digest::secureCompare($signature, $payloadSignature);
|
40 |
+
}
|
41 |
+
|
42 |
+
private function _validateSignature($signatureString, $payload)
|
43 |
+
{
|
44 |
+
$signaturePairs = preg_split("/&/", $signatureString);
|
45 |
+
$signature = self::_matchingSignature($signaturePairs);
|
46 |
+
if (!$signature) {
|
47 |
+
throw new Exception\InvalidSignature("no matching public key");
|
48 |
+
}
|
49 |
+
|
50 |
+
if (!(self::_payloadMatches($signature, $payload) || self::_payloadMatches($signature, $payload . "\n"))) {
|
51 |
+
throw new Exception\InvalidSignature("signature does not match payload - one has been modified");
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
private function _matchingSignature($signaturePairs)
|
56 |
+
{
|
57 |
+
foreach ($signaturePairs as $pair)
|
58 |
+
{
|
59 |
+
$components = preg_split("/\|/", $pair);
|
60 |
+
if ($components[0] == $this->config->publicKey()) {
|
61 |
+
return $components[1];
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
return null;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
class_alias('Braintree\WebhookNotificationGateway', 'Braintree_WebhookNotificationGateway');
|
lib/Braintree/WebhookTesting.php
CHANGED
@@ -26,6 +26,12 @@ class WebhookTesting
|
|
26 |
case WebhookNotification::TRANSACTION_DISBURSED:
|
27 |
$subjectXml = self::_transactionDisbursedSampleXml($id);
|
28 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
case WebhookNotification::DISBURSEMENT_EXCEPTION:
|
30 |
$subjectXml = self::_disbursementExceptionSampleXml($id);
|
31 |
break;
|
@@ -41,6 +47,12 @@ class WebhookTesting
|
|
41 |
case WebhookNotification::PARTNER_MERCHANT_DECLINED:
|
42 |
$subjectXml = self::_partnerMerchantDeclinedSampleXml($id);
|
43 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
case WebhookNotification::DISPUTE_OPENED:
|
45 |
$subjectXml = self::_disputeOpenedSampleXml($id);
|
46 |
break;
|
@@ -56,6 +68,15 @@ class WebhookTesting
|
|
56 |
case WebhookNotification::CHECK:
|
57 |
$subjectXml = self::_checkSampleXml();
|
58 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
default:
|
60 |
$subjectXml = self::_subscriptionSampleXml($id);
|
61 |
break;
|
@@ -126,6 +147,48 @@ class WebhookTesting
|
|
126 |
";
|
127 |
}
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
private static function _disbursementExceptionSampleXml($id)
|
130 |
{
|
131 |
return "
|
@@ -212,6 +275,7 @@ class WebhookTesting
|
|
212 |
<transaction>
|
213 |
<id>${id}</id>
|
214 |
<amount>250.00</amount>
|
|
|
215 |
</transaction>
|
216 |
<date-opened type=\"date\">2014-03-21</date-opened>
|
217 |
</dispute>
|
@@ -260,6 +324,8 @@ class WebhookTesting
|
|
260 |
return "
|
261 |
<subscription>
|
262 |
<id>{$id}</id>
|
|
|
|
|
263 |
<transactions type=\"array\">
|
264 |
<transaction>
|
265 |
<status>submitted_for_settlement</status>
|
@@ -312,6 +378,72 @@ class WebhookTesting
|
|
312 |
";
|
313 |
}
|
314 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
private static function _timestamp()
|
316 |
{
|
317 |
$originalZone = date_default_timezone_get();
|
26 |
case WebhookNotification::TRANSACTION_DISBURSED:
|
27 |
$subjectXml = self::_transactionDisbursedSampleXml($id);
|
28 |
break;
|
29 |
+
case WebhookNotification::TRANSACTION_SETTLED:
|
30 |
+
$subjectXml = self::_transactionSettledSampleXml($id);
|
31 |
+
break;
|
32 |
+
case WebhookNotification::TRANSACTION_SETTLEMENT_DECLINED:
|
33 |
+
$subjectXml = self::_transactionSettlementDeclinedSampleXml($id);
|
34 |
+
break;
|
35 |
case WebhookNotification::DISBURSEMENT_EXCEPTION:
|
36 |
$subjectXml = self::_disbursementExceptionSampleXml($id);
|
37 |
break;
|
47 |
case WebhookNotification::PARTNER_MERCHANT_DECLINED:
|
48 |
$subjectXml = self::_partnerMerchantDeclinedSampleXml($id);
|
49 |
break;
|
50 |
+
case WebhookNotification::CONNECTED_MERCHANT_STATUS_TRANSITIONED:
|
51 |
+
$subjectXml = self::_connectedMerchantStatusTransitionedSampleXml($id);
|
52 |
+
break;
|
53 |
+
case WebhookNotification::CONNECTED_MERCHANT_PAYPAL_STATUS_CHANGED:
|
54 |
+
$subjectXml = self::_connectedMerchantPayPalStatusChangedSampleXml($id);
|
55 |
+
break;
|
56 |
case WebhookNotification::DISPUTE_OPENED:
|
57 |
$subjectXml = self::_disputeOpenedSampleXml($id);
|
58 |
break;
|
68 |
case WebhookNotification::CHECK:
|
69 |
$subjectXml = self::_checkSampleXml();
|
70 |
break;
|
71 |
+
case WebhookNotification::ACCOUNT_UPDATER_DAILY_REPORT:
|
72 |
+
$subjectXml = self::_accountUpdaterDailyReportSampleXml($id);
|
73 |
+
break;
|
74 |
+
case WebhookNotification::IDEAL_PAYMENT_COMPLETE:
|
75 |
+
$subjectXml = self::_idealPaymentCompleteSampleXml($id);
|
76 |
+
break;
|
77 |
+
case WebhookNotification::IDEAL_PAYMENT_FAILED:
|
78 |
+
$subjectXml = self::_idealPaymentFailedSampleXml($id);
|
79 |
+
break;
|
80 |
default:
|
81 |
$subjectXml = self::_subscriptionSampleXml($id);
|
82 |
break;
|
147 |
";
|
148 |
}
|
149 |
|
150 |
+
private static function _transactionSettledSampleXml($id)
|
151 |
+
{
|
152 |
+
return "
|
153 |
+
<transaction>
|
154 |
+
<id>${id}</id>
|
155 |
+
<status>settled</status>
|
156 |
+
<type>sale</type>
|
157 |
+
<currency-iso-code>USD</currency-iso-code>
|
158 |
+
<amount>100.00</amount>
|
159 |
+
<merchant-account-id>ogaotkivejpfayqfeaimuktty</merchant-account-id>
|
160 |
+
<payment-instrument-type>us_bank_account</payment-instrument-type>
|
161 |
+
<us-bank-account>
|
162 |
+
<routing-number>123456789</routing-number>
|
163 |
+
<last-4>1234</last-4>
|
164 |
+
<account-type>checking</account-type>
|
165 |
+
<account-holder-name>Dan Schulman</account-holder-name>
|
166 |
+
</us-bank-account>
|
167 |
+
</transaction>
|
168 |
+
";
|
169 |
+
}
|
170 |
+
|
171 |
+
private static function _transactionSettlementDeclinedSampleXml($id)
|
172 |
+
{
|
173 |
+
return "
|
174 |
+
<transaction>
|
175 |
+
<id>${id}</id>
|
176 |
+
<status>settlement_declined</status>
|
177 |
+
<type>sale</type>
|
178 |
+
<currency-iso-code>USD</currency-iso-code>
|
179 |
+
<amount>100.00</amount>
|
180 |
+
<merchant-account-id>ogaotkivejpfayqfeaimuktty</merchant-account-id>
|
181 |
+
<payment-instrument-type>us_bank_account</payment-instrument-type>
|
182 |
+
<us-bank-account>
|
183 |
+
<routing-number>123456789</routing-number>
|
184 |
+
<last-4>1234</last-4>
|
185 |
+
<account-type>checking</account-type>
|
186 |
+
<account-holder-name>Dan Schulman</account-holder-name>
|
187 |
+
</us-bank-account>
|
188 |
+
</transaction>
|
189 |
+
";
|
190 |
+
}
|
191 |
+
|
192 |
private static function _disbursementExceptionSampleXml($id)
|
193 |
{
|
194 |
return "
|
275 |
<transaction>
|
276 |
<id>${id}</id>
|
277 |
<amount>250.00</amount>
|
278 |
+
<next_billing-date type=\"date\">2020-02-10</next_billing-date>
|
279 |
</transaction>
|
280 |
<date-opened type=\"date\">2014-03-21</date-opened>
|
281 |
</dispute>
|
324 |
return "
|
325 |
<subscription>
|
326 |
<id>{$id}</id>
|
327 |
+
<billing-period-start-date type=\"date\">2016-03-21</billing-period-start-date>
|
328 |
+
<billing-period-end-date type=\"date\">2017-03-31</billing-period-end-date>
|
329 |
<transactions type=\"array\">
|
330 |
<transaction>
|
331 |
<status>submitted_for_settlement</status>
|
378 |
";
|
379 |
}
|
380 |
|
381 |
+
private static function _accountUpdaterDailyReportSampleXml($id)
|
382 |
+
{
|
383 |
+
return "
|
384 |
+
<account-updater-daily-report>
|
385 |
+
<report-date type=\"date\">2016-01-14</report-date>
|
386 |
+
<report-url>link-to-csv-report</report-url>
|
387 |
+
</account-updater-daily-report>
|
388 |
+
";
|
389 |
+
}
|
390 |
+
|
391 |
+
private static function _connectedMerchantStatusTransitionedSampleXml($id)
|
392 |
+
{
|
393 |
+
return "
|
394 |
+
<connected-merchant-status-transitioned>
|
395 |
+
<merchant-public-id>{$id}</merchant-public-id>
|
396 |
+
<status>new_status</status>
|
397 |
+
<oauth-application-client-id>oauth_application_client_id</oauth-application-client-id>
|
398 |
+
</connected-merchant-status-transitioned>
|
399 |
+
";
|
400 |
+
}
|
401 |
+
|
402 |
+
private static function _connectedMerchantPayPalStatusChangedSampleXml($id)
|
403 |
+
{
|
404 |
+
return "
|
405 |
+
<connected-merchant-paypal-status-changed>
|
406 |
+
<merchant-public-id>{$id}</merchant-public-id>
|
407 |
+
<action>link</action>
|
408 |
+
<oauth-application-client-id>oauth_application_client_id</oauth-application-client-id>
|
409 |
+
</connected-merchant-paypal-status-changed>
|
410 |
+
";
|
411 |
+
}
|
412 |
+
|
413 |
+
private static function _idealPaymentCompleteSampleXml($id)
|
414 |
+
{
|
415 |
+
return "
|
416 |
+
<ideal-payment>
|
417 |
+
<id>{$id}</id>
|
418 |
+
<status>COMPLETE</status>
|
419 |
+
<issuer>ABCISSUER</issuer>
|
420 |
+
<order-id>ORDERABC</order-id>
|
421 |
+
<currency>EUR</currency>
|
422 |
+
<amount>10.00</amount>
|
423 |
+
<created-at>2016-11-29T23:27:34.547Z</created-at>
|
424 |
+
<approval-url>https://example.com</approval-url>
|
425 |
+
<ideal-transaction-id>1234567890</ideal-transaction-id>
|
426 |
+
</ideal-payment>
|
427 |
+
";
|
428 |
+
}
|
429 |
+
|
430 |
+
private static function _idealPaymentFailedSampleXml($id)
|
431 |
+
{
|
432 |
+
return "
|
433 |
+
<ideal-payment>
|
434 |
+
<id>{$id}</id>
|
435 |
+
<status>FAILED</status>
|
436 |
+
<issuer>ABCISSUER</issuer>
|
437 |
+
<order-id>ORDERABC</order-id>
|
438 |
+
<currency>EUR</currency>
|
439 |
+
<amount>10.00</amount>
|
440 |
+
<created-at>2016-11-29T23:27:34.547Z</created-at>
|
441 |
+
<approval-url>https://example.com</approval-url>
|
442 |
+
<ideal-transaction-id>1234567890</ideal-transaction-id>
|
443 |
+
</ideal-payment>
|
444 |
+
";
|
445 |
+
}
|
446 |
+
|
447 |
private static function _timestamp()
|
448 |
{
|
449 |
$originalZone = date_default_timezone_get();
|
lib/Braintree/Xml.php
CHANGED
@@ -5,10 +5,8 @@ namespace Braintree;
|
|
5 |
* Braintree Xml parser and generator
|
6 |
* PHP version 5
|
7 |
* superclass for Braintree XML parsing and generation
|
8 |
-
*
|
9 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
10 |
*/
|
11 |
-
|
12 |
{
|
13 |
/**
|
14 |
* @ignore
|
5 |
* Braintree Xml parser and generator
|
6 |
* PHP version 5
|
7 |
* superclass for Braintree XML parsing and generation
|
|
|
|
|
8 |
*/
|
9 |
+
class Xml
|
10 |
{
|
11 |
/**
|
12 |
* @ignore
|
lib/Braintree/Xml/Generator.php
CHANGED
@@ -8,15 +8,11 @@ use Braintree\Util;
|
|
8 |
|
9 |
/**
|
10 |
* PHP version 5
|
11 |
-
*
|
12 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
13 |
*/
|
14 |
|
15 |
/**
|
16 |
* Generates XML output from arrays using PHP's
|
17 |
* built-in XMLWriter
|
18 |
-
*
|
19 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
20 |
*/
|
21 |
class Generator
|
22 |
{
|
@@ -130,8 +126,10 @@ class Generator
|
|
130 |
*/
|
131 |
private static function _dateTimeToXmlTimestamp($dateTime)
|
132 |
{
|
133 |
-
$dateTime
|
134 |
-
|
|
|
|
|
135 |
}
|
136 |
|
137 |
private static function _castDateTime($string)
|
8 |
|
9 |
/**
|
10 |
* PHP version 5
|
|
|
|
|
11 |
*/
|
12 |
|
13 |
/**
|
14 |
* Generates XML output from arrays using PHP's
|
15 |
* built-in XMLWriter
|
|
|
|
|
16 |
*/
|
17 |
class Generator
|
18 |
{
|
126 |
*/
|
127 |
private static function _dateTimeToXmlTimestamp($dateTime)
|
128 |
{
|
129 |
+
$dateTimeForUTC = clone $dateTime;
|
130 |
+
|
131 |
+
$dateTimeForUTC->setTimeZone(new DateTimeZone('UTC'));
|
132 |
+
return ($dateTimeForUTC->format('Y-m-d\TH:i:s') . 'Z');
|
133 |
}
|
134 |
|
135 |
private static function _castDateTime($string)
|
lib/Braintree/Xml/Parser.php
CHANGED
@@ -10,8 +10,6 @@ use Braintree\Util;
|
|
10 |
|
11 |
/**
|
12 |
* Braintree XML Parser
|
13 |
-
*
|
14 |
-
* @copyright 2015 Braintree, a division of PayPal, Inc.
|
15 |
*/
|
16 |
class Parser
|
17 |
{
|
10 |
|
11 |
/**
|
12 |
* Braintree XML Parser
|
|
|
|
|
13 |
*/
|
14 |
class Parser
|
15 |
{
|
lib/skyverge/woocommerce/changelog.txt
CHANGED
@@ -1,11 +1,47 @@
|
|
1 |
*** SkyVerge WooCommerce Plugin Framework Changelog ***
|
2 |
|
3 |
-
2017.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
* Tweak - Add Payment Gateway debug mode to the System Status report
|
5 |
* Tweak - Plugin "Docs" links now open in a new tab
|
6 |
* Misc - Add helper method to get normalized WooCommerce screen IDs
|
7 |
* Misc - Added support for WooCommerce 3.0
|
8 |
|
|
|
|
|
|
|
9 |
2016.11.18 - version 4.5.1
|
10 |
* Fix - Prevent a potential fatal error for plugins not using the latest JSON/XML request classes
|
11 |
|
1 |
*** SkyVerge WooCommerce Plugin Framework Changelog ***
|
2 |
|
3 |
+
2017.09.12 - version 4.7.2
|
4 |
+
* Fix - Ensure failed Pre-Orders can be paid with a new method by bypassing the failed order's stored token
|
5 |
+
* Fix - Use the parameters passed to SV_WP_Admin_Message_Handler::show_messages()
|
6 |
+
|
7 |
+
2017.08.14 - version 4.7.1
|
8 |
+
* Tweak - Refine the TLS 1.2 notice wording and appearance
|
9 |
+
|
10 |
+
2017.07.25 - version 4.7.0
|
11 |
+
* Feature - Introduce the Apple Pay framework for developers
|
12 |
+
|
13 |
+
2017.07.11 - version 4.6.6
|
14 |
+
* Fix - Ensure backwards compatibility with gateways that don't extend the SV_WC_API_Base class for their API
|
15 |
+
|
16 |
+
2017.06.26 - version 4.6.5
|
17 |
+
* Misc. - Make a TLS 1.2 admin notice available for gateways that require it
|
18 |
+
* Misc. - Ensure WooCommerce 3.1 compatibility
|
19 |
+
|
20 |
+
2017.05.20 - version 4.6.4
|
21 |
+
* Fix - Add dedicated subscriptions Change Payment handling to avoid subscription manipulation
|
22 |
+
* Fix - Ensure old payment methods can be removed after changing subscription payment to a new method
|
23 |
+
|
24 |
+
2017.05.09 - version 4.6.3
|
25 |
+
* Tweak - Add optional notice for plugins that want to require PHP 5.3+ in the future
|
26 |
+
* Tweak - Improved background process handling for certain server & cache configurations
|
27 |
+
|
28 |
+
2017.05.01 - version 4.6.2
|
29 |
+
* Fix - Ensure authorized, but not yet captured, transactions are marked "on hold" for off-site gateways
|
30 |
+
|
31 |
+
2017.04.17 - version 4.6.1
|
32 |
+
* Tweak - Load admin translations based on the user's configured language in WordPress 4.7+
|
33 |
+
* Tweak - Added the SV_WC_Order_Compatibility::has_shipping_address() method
|
34 |
+
* Fix - Prevent some deprecated notices when processing subscriptions in WooCommerce 3.0+
|
35 |
+
|
36 |
+
2017.03.27 - version 4.6.0
|
37 |
* Tweak - Add Payment Gateway debug mode to the System Status report
|
38 |
* Tweak - Plugin "Docs" links now open in a new tab
|
39 |
* Misc - Add helper method to get normalized WooCommerce screen IDs
|
40 |
* Misc - Added support for WooCommerce 3.0
|
41 |
|
42 |
+
2017.01.06 - version 4.5.2
|
43 |
+
* Fix - Include Curaçao when converting country codes
|
44 |
+
|
45 |
2016.11.18 - version 4.5.1
|
46 |
* Fix - Prevent a potential fatal error for plugins not using the latest JSON/XML request classes
|
47 |
|
lib/skyverge/woocommerce/class-sv-wc-admin-notice-handler.php
CHANGED
@@ -235,7 +235,7 @@ class SV_WC_Admin_Notice_Handler {
|
|
235 |
/* translators: this is an action that dismisses a message */
|
236 |
$dismiss_link = sprintf(
|
237 |
'<a href="#" class="js-wc-plugin-framework-notice-dismiss" style="float: right;">%s</a>',
|
238 |
-
esc_html__( 'Dismiss', 'woocommerce-
|
239 |
);
|
240 |
|
241 |
$message .= ' ' . $dismiss_link;
|
235 |
/* translators: this is an action that dismisses a message */
|
236 |
$dismiss_link = sprintf(
|
237 |
'<a href="#" class="js-wc-plugin-framework-notice-dismiss" style="float: right;">%s</a>',
|
238 |
+
esc_html__( 'Dismiss', 'woocommerce-gateway-paypal-powered-by-braintree' )
|
239 |
);
|
240 |
|
241 |
$message .= ' ' . $dismiss_link;
|
lib/skyverge/woocommerce/class-sv-wc-helper.php
CHANGED
@@ -436,23 +436,20 @@ if ( ! class_exists( '\SkyVerge\Plugin_Framework\SV_WC_Helper' ) ) :
|
|
436 |
|
437 |
$line_item = new \stdClass();
|
438 |
|
439 |
-
$product = $order->get_product_from_item( $item );
|
440 |
-
|
441 |
// TODO: remove when WC 3.0+ can be required
|
442 |
$name = $item instanceof \WC_Order_Item_Product ? $item->get_name() : $item['name'];
|
443 |
$quantity = $item instanceof \WC_Order_Item_Product ? $item->get_quantity() : $item['qty'];
|
444 |
|
445 |
$item_desc = array();
|
446 |
|
|
|
|
|
447 |
// add SKU to description if available
|
448 |
if ( is_callable( array( $product, 'get_sku' ) ) && $product->get_sku() ) {
|
449 |
$item_desc[] = sprintf( 'SKU: %s', $product->get_sku() );
|
450 |
}
|
451 |
|
452 |
-
|
453 |
-
$item_meta = new \WC_Order_Item_Meta( $item );
|
454 |
-
|
455 |
-
$item_meta = $item_meta->get_formatted();
|
456 |
|
457 |
if ( ! empty( $item_meta ) ) {
|
458 |
|
@@ -493,10 +490,14 @@ if ( ! class_exists( '\SkyVerge\Plugin_Framework\SV_WC_Helper' ) ) :
|
|
493 |
|
494 |
foreach ( $order->get_items() as $item ) {
|
495 |
|
496 |
-
|
|
|
|
|
|
|
|
|
497 |
|
498 |
// once we've found one non-virtual product we know we're done, break out of the loop
|
499 |
-
if ( ! $product->is_virtual() ) {
|
500 |
$is_virtual = false;
|
501 |
break;
|
502 |
}
|
@@ -874,7 +875,7 @@ if ( ! class_exists( '\SkyVerge\Plugin_Framework\SV_WC_Helper' ) ) :
|
|
874 |
*/
|
875 |
public static function f__( $text ) {
|
876 |
|
877 |
-
return __( $text, 'woocommerce-
|
878 |
}
|
879 |
|
880 |
|
@@ -891,7 +892,7 @@ if ( ! class_exists( '\SkyVerge\Plugin_Framework\SV_WC_Helper' ) ) :
|
|
891 |
*/
|
892 |
public static function f_e( $text ) {
|
893 |
|
894 |
-
_e( $text, 'woocommerce-
|
895 |
}
|
896 |
|
897 |
|
@@ -909,7 +910,7 @@ if ( ! class_exists( '\SkyVerge\Plugin_Framework\SV_WC_Helper' ) ) :
|
|
909 |
*/
|
910 |
public static function f_x( $text, $context ) {
|
911 |
|
912 |
-
return _x( $text, $context, 'woocommerce-
|
913 |
}
|
914 |
|
915 |
|
436 |
|
437 |
$line_item = new \stdClass();
|
438 |
|
|
|
|
|
439 |
// TODO: remove when WC 3.0+ can be required
|
440 |
$name = $item instanceof \WC_Order_Item_Product ? $item->get_name() : $item['name'];
|
441 |
$quantity = $item instanceof \WC_Order_Item_Product ? $item->get_quantity() : $item['qty'];
|
442 |
|
443 |
$item_desc = array();
|
444 |
|
445 |
+
$product = ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_1() ) ? $item->get_product() : $order->get_product_from_item( $item );
|
446 |
+
|
447 |
// add SKU to description if available
|
448 |
if ( is_callable( array( $product, 'get_sku' ) ) && $product->get_sku() ) {
|
449 |
$item_desc[] = sprintf( 'SKU: %s', $product->get_sku() );
|
450 |
}
|
451 |
|
452 |
+
$item_meta = SV_WC_Order_Compatibility::get_item_formatted_meta_data( $item, '_', true );
|
|
|
|
|
|
|
453 |
|
454 |
if ( ! empty( $item_meta ) ) {
|
455 |
|
490 |
|
491 |
foreach ( $order->get_items() as $item ) {
|
492 |
|
493 |
+
if ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {
|
494 |
+
$product = $item->get_product();
|
495 |
+
} else {
|
496 |
+
$product = $order->get_product_from_item( $item );
|
497 |
+
}
|
498 |
|
499 |
// once we've found one non-virtual product we know we're done, break out of the loop
|
500 |
+
if ( $product && ! $product->is_virtual() ) {
|
501 |
$is_virtual = false;
|
502 |
break;
|
503 |
}
|
875 |
*/
|
876 |
public static function f__( $text ) {
|
877 |
|
878 |
+
return __( $text, 'woocommerce-gateway-paypal-powered-by-braintree' );
|
879 |
}
|
880 |
|
881 |
|
892 |
*/
|
893 |
public static function f_e( $text ) {
|
894 |
|
895 |
+
_e( $text, 'woocommerce-gateway-paypal-powered-by-braintree' );
|
896 |
}
|
897 |
|
898 |
|
910 |
*/
|
911 |
public static function f_x( $text, $context ) {
|
912 |
|
913 |
+
return _x( $text, $context, 'woocommerce-gateway-paypal-powered-by-braintree' );
|
914 |
}
|
915 |
|
916 |
|
lib/skyverge/woocommerce/class-sv-wc-plugin-compatibility.php
CHANGED
@@ -123,6 +123,25 @@ class SV_WC_Plugin_Compatibility {
|
|
123 |
}
|
124 |
|
125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
/**
|
127 |
* Backports wc_help_tip() to WC 2.4.x
|
128 |
*
|
@@ -225,6 +244,29 @@ class SV_WC_Plugin_Compatibility {
|
|
225 |
return self::get_wc_version() && version_compare( self::get_wc_version(), '3.0', '<' );
|
226 |
}
|
227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
/**
|
229 |
* Returns true if the installed version of WooCommerce is greater than $version
|
230 |
*
|
@@ -248,16 +290,15 @@ class SV_WC_Plugin_Compatibility {
|
|
248 |
* TODO: Add WP version check when https://core.trac.wordpress.org/ticket/18857 is addressed {BR 2016-12-12}
|
249 |
*
|
250 |
* @since 4.6.0
|
251 |
-
* @param string $
|
252 |
* @return string normalized screen ID
|
253 |
*/
|
254 |
public static function normalize_wc_screen_id( $slug = 'wc-settings' ) {
|
255 |
|
256 |
-
//
|
257 |
-
$prefix
|
258 |
-
$screen_id = $prefix . '_page_' . $slug;
|
259 |
|
260 |
-
return $
|
261 |
}
|
262 |
|
263 |
|
123 |
}
|
124 |
|
125 |
|
126 |
+
/**
|
127 |
+
* Backports wc_shipping_enabled() to < 2.6.0
|
128 |
+
*
|
129 |
+
* @since 4.7.0
|
130 |
+
* @return bool
|
131 |
+
*/
|
132 |
+
public static function wc_shipping_enabled() {
|
133 |
+
|
134 |
+
if ( self::is_wc_version_gte_2_6() ) {
|
135 |
+
|
136 |
+
return wc_shipping_enabled();
|
137 |
+
|
138 |
+
} else {
|
139 |
+
|
140 |
+
return 'yes' === get_option( 'woocommerce_calc_shipping' );
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
|
145 |
/**
|
146 |
* Backports wc_help_tip() to WC 2.4.x
|
147 |
*
|
244 |
return self::get_wc_version() && version_compare( self::get_wc_version(), '3.0', '<' );
|
245 |
}
|
246 |
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Determines if the installed version of WooCommerce is 3.1 or greater.
|
250 |
+
*
|
251 |
+
* @since 4.6.5
|
252 |
+
* @return bool
|
253 |
+
*/
|
254 |
+
public static function is_wc_version_gte_3_1() {
|
255 |
+
return self::get_wc_version() && version_compare( self::get_wc_version(), '3.1', '>=' );
|
256 |
+
}
|
257 |
+
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Determines if the installed version of WooCommerce is less than 3.1.
|
261 |
+
*
|
262 |
+
* @since 4.6.5
|
263 |
+
* @return bool
|
264 |
+
*/
|
265 |
+
public static function is_wc_version_lt_3_1() {
|
266 |
+
return self::get_wc_version() && version_compare( self::get_wc_version(), '3.1', '<' );
|
267 |
+
}
|
268 |
+
|
269 |
+
|
270 |
/**
|
271 |
* Returns true if the installed version of WooCommerce is greater than $version
|
272 |
*
|
290 |
* TODO: Add WP version check when https://core.trac.wordpress.org/ticket/18857 is addressed {BR 2016-12-12}
|
291 |
*
|
292 |
* @since 4.6.0
|
293 |
+
* @param string $slug slug for the screen ID to normalize (minus `woocommerce_page_`)
|
294 |
* @return string normalized screen ID
|
295 |
*/
|
296 |
public static function normalize_wc_screen_id( $slug = 'wc-settings' ) {
|
297 |
|
298 |
+
// The textdomain usage is intentional here, we need to match the menu title.
|
299 |
+
$prefix = sanitize_title( __( 'WooCommerce', 'woocommerce' ) );
|
|
|
300 |
|
301 |
+
return $prefix . '_page_' . $slug;
|
302 |
}
|
303 |
|
304 |
|
lib/skyverge/woocommerce/class-sv-wc-plugin.php
CHANGED
@@ -168,7 +168,7 @@ abstract class SV_WC_Plugin {
|
|
168 |
*/
|
169 |
public function __clone() {
|
170 |
/* translators: Placeholders: %s - plugin name */
|
171 |
-
_doing_it_wrong( __FUNCTION__, sprintf( esc_html__( 'You cannot clone instances of %s.', 'woocommerce-
|
172 |
}
|
173 |
|
174 |
/**
|
@@ -178,7 +178,7 @@ abstract class SV_WC_Plugin {
|
|
178 |
*/
|
179 |
public function __wakeup() {
|
180 |
/* translators: Placeholders: %s - plugin name */
|
181 |
-
_doing_it_wrong( __FUNCTION__, sprintf( esc_html__( 'You cannot unserialize instances of %s.', 'woocommerce-
|
182 |
}
|
183 |
|
184 |
|
@@ -439,7 +439,7 @@ abstract class SV_WC_Plugin {
|
|
439 |
|
440 |
$setting_message = sprintf(
|
441 |
/** translators: Placeholders: %s - a PHP setting value */
|
442 |
-
__( '%s or higher', 'woocommerce-
|
443 |
$setting_message
|
444 |
);
|
445 |
}
|
@@ -449,7 +449,7 @@ abstract class SV_WC_Plugin {
|
|
449 |
|
450 |
$message .= '</ul>';
|
451 |
|
452 |
-
$message .= __( 'Please contact your hosting provider or server administrator to configure these settings.', 'woocommerce-
|
453 |
|
454 |
$this->get_admin_notice_handler()->add_admin_notice( $message, 'bad-php-configuration', array(
|
455 |
'notice_class' => 'error',
|
@@ -479,12 +479,12 @@ abstract class SV_WC_Plugin {
|
|
479 |
// documentation url if any
|
480 |
if ( $this->get_documentation_url() ) {
|
481 |
/* translators: Docs as in Documentation */
|
482 |
-
$custom_actions['docs'] = sprintf( '<a href="%s" target="_blank">%s</a>', $this->get_documentation_url(), esc_html__( 'Docs', 'woocommerce-
|
483 |
}
|
484 |
|
485 |
// support url if any
|
486 |
if ( $this->get_support_url() ) {
|
487 |
-
$custom_actions['support'] = sprintf( '<a href="%s">%s</a>', $this->get_support_url(), esc_html_x( 'Support', 'noun', 'woocommerce-
|
488 |
}
|
489 |
|
490 |
// add the links to the front of the actions list
|
@@ -672,7 +672,7 @@ abstract class SV_WC_Plugin {
|
|
672 |
continue;
|
673 |
}
|
674 |
|
675 |
-
$note = __( '%1$s - A minimum of %2$s is required.', 'woocommerce-
|
676 |
|
677 |
} else {
|
678 |
|
@@ -681,7 +681,7 @@ abstract class SV_WC_Plugin {
|
|
681 |
continue;
|
682 |
}
|
683 |
|
684 |
-
$note = __( 'Set as %1$s - %2$s is required.', 'woocommerce-
|
685 |
}
|
686 |
|
687 |
$note = sprintf( $note, $values['actual'], $values['expected'] );
|
@@ -918,7 +918,7 @@ abstract class SV_WC_Plugin {
|
|
918 |
$settings_url = $this->get_settings_url( $plugin_id );
|
919 |
|
920 |
if ( $settings_url ) {
|
921 |
-
return sprintf( '<a href="%s">%s</a>', $settings_url, esc_html__( 'Configure', 'woocommerce-
|
922 |
}
|
923 |
|
924 |
// no settings
|
168 |
*/
|
169 |
public function __clone() {
|
170 |
/* translators: Placeholders: %s - plugin name */
|
171 |
+
_doing_it_wrong( __FUNCTION__, sprintf( esc_html__( 'You cannot clone instances of %s.', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_plugin_name() ), '3.1.0' );
|
172 |
}
|
173 |
|
174 |
/**
|
178 |
*/
|
179 |
public function __wakeup() {
|
180 |
/* translators: Placeholders: %s - plugin name */
|
181 |
+
_doing_it_wrong( __FUNCTION__, sprintf( esc_html__( 'You cannot unserialize instances of %s.', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_plugin_name() ), '3.1.0' );
|
182 |
}
|
183 |
|
184 |
|
439 |
|
440 |
$setting_message = sprintf(
|
441 |
/** translators: Placeholders: %s - a PHP setting value */
|
442 |
+
__( '%s or higher', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
443 |
$setting_message
|
444 |
);
|
445 |
}
|
449 |
|
450 |
$message .= '</ul>';
|
451 |
|
452 |
+
$message .= __( 'Please contact your hosting provider or server administrator to configure these settings.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
453 |
|
454 |
$this->get_admin_notice_handler()->add_admin_notice( $message, 'bad-php-configuration', array(
|
455 |
'notice_class' => 'error',
|
479 |
// documentation url if any
|
480 |
if ( $this->get_documentation_url() ) {
|
481 |
/* translators: Docs as in Documentation */
|
482 |
+
$custom_actions['docs'] = sprintf( '<a href="%s" target="_blank">%s</a>', $this->get_documentation_url(), esc_html__( 'Docs', 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
483 |
}
|
484 |
|
485 |
// support url if any
|
486 |
if ( $this->get_support_url() ) {
|
487 |
+
$custom_actions['support'] = sprintf( '<a href="%s">%s</a>', $this->get_support_url(), esc_html_x( 'Support', 'noun', 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
488 |
}
|
489 |
|
490 |
// add the links to the front of the actions list
|
672 |
continue;
|
673 |
}
|
674 |
|
675 |
+
$note = __( '%1$s - A minimum of %2$s is required.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
676 |
|
677 |
} else {
|
678 |
|
681 |
continue;
|
682 |
}
|
683 |
|
684 |
+
$note = __( 'Set as %1$s - %2$s is required.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
685 |
}
|
686 |
|
687 |
$note = sprintf( $note, $values['actual'], $values['expected'] );
|
918 |
$settings_url = $this->get_settings_url( $plugin_id );
|
919 |
|
920 |
if ( $settings_url ) {
|
921 |
+
return sprintf( '<a href="%s">%s</a>', $settings_url, esc_html__( 'Configure', 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
922 |
}
|
923 |
|
924 |
// no settings
|
lib/skyverge/woocommerce/class-sv-wp-admin-message-handler.php
CHANGED
@@ -244,11 +244,11 @@ class SV_WP_Admin_Message_Handler {
|
|
244 |
*/
|
245 |
public function show_messages( $params = array() ) {
|
246 |
|
247 |
-
$params = wp_parse_args( array(
|
248 |
'capabilities' => array(
|
249 |
'manage_woocommerce',
|
250 |
),
|
251 |
-
)
|
252 |
|
253 |
$check_user_capabilities = array();
|
254 |
|
244 |
*/
|
245 |
public function show_messages( $params = array() ) {
|
246 |
|
247 |
+
$params = wp_parse_args( $params, array(
|
248 |
'capabilities' => array(
|
249 |
'manage_woocommerce',
|
250 |
),
|
251 |
+
) );
|
252 |
|
253 |
$check_user_capabilities = array();
|
254 |
|
lib/skyverge/woocommerce/compatibility/class-sv-wc-order-compatibility.php
CHANGED
@@ -282,6 +282,84 @@ class SV_WC_Order_Compatibility extends SV_WC_Data_Compatibility {
|
|
282 |
}
|
283 |
|
284 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
/**
|
286 |
* Order item CRUD compatibility method to update an order coupon.
|
287 |
*
|
@@ -411,6 +489,66 @@ class SV_WC_Order_Compatibility extends SV_WC_Data_Compatibility {
|
|
411 |
}
|
412 |
|
413 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
414 |
}
|
415 |
|
416 |
|
282 |
}
|
283 |
|
284 |
|
285 |
+
/**
|
286 |
+
* Order item CRUD compatibility method to add a shipping line to an order.
|
287 |
+
*
|
288 |
+
* @since 4.7.0
|
289 |
+
*
|
290 |
+
* @param \WC_Order $order order object
|
291 |
+
* @param \WC_Shipping_Rate $shipping_rate shipping rate to add
|
292 |
+
* @return int the order item ID
|
293 |
+
*/
|
294 |
+
public static function add_shipping( \WC_Order $order, $shipping_rate ) {
|
295 |
+
|
296 |
+
if ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {
|
297 |
+
|
298 |
+
$item = new \WC_Order_Item_Shipping();
|
299 |
+
|
300 |
+
$item->set_props( array(
|
301 |
+
'method_title' => $shipping_rate->label,
|
302 |
+
'method_id' => $shipping_rate->id,
|
303 |
+
'total' => wc_format_decimal( $shipping_rate->cost ),
|
304 |
+
'taxes' => $shipping_rate->taxes,
|
305 |
+
'order_id' => $order->get_id(),
|
306 |
+
) );
|
307 |
+
|
308 |
+
foreach ( $shipping_rate->get_meta_data() as $key => $value ) {
|
309 |
+
$item->add_meta_data( $key, $value, true );
|
310 |
+
}
|
311 |
+
|
312 |
+
$item->save();
|
313 |
+
|
314 |
+
$order->add_item( $item );
|
315 |
+
|
316 |
+
return $item->get_id();
|
317 |
+
|
318 |
+
} else {
|
319 |
+
|
320 |
+
return $order->add_shipping( $shipping_rate );
|
321 |
+
}
|
322 |
+
}
|
323 |
+
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Order item CRUD compatibility method to add a tax line to an order.
|
327 |
+
*
|
328 |
+
* @since 4.7.0
|
329 |
+
*
|
330 |
+
* @param \WC_Order $order order object
|
331 |
+
* @param int $tax_rate_id tax rate ID
|
332 |
+
* @param float $tax_amount cart tax amount
|
333 |
+
* @param float $shipping_tax_amount shipping tax amount
|
334 |
+
* @return int order item ID
|
335 |
+
*/
|
336 |
+
public static function add_tax( \WC_Order $order, $tax_rate_id, $tax_amount = 0, $shipping_tax_amount = 0 ) {
|
337 |
+
|
338 |
+
if ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {
|
339 |
+
|
340 |
+
$item = new \WC_Order_Item_Tax();
|
341 |
+
|
342 |
+
$item->set_props( array(
|
343 |
+
'rate_id' => $tax_rate_id,
|
344 |
+
'tax_total' => $tax_amount,
|
345 |
+
'shipping_tax_total' => $shipping_tax_amount,
|
346 |
+
) );
|
347 |
+
|
348 |
+
$item->set_rate( $tax_rate_id );
|
349 |
+
$item->set_order_id( $order->get_id() );
|
350 |
+
$item->save();
|
351 |
+
|
352 |
+
$order->add_item( $item );
|
353 |
+
|
354 |
+
return $item->get_id();
|
355 |
+
|
356 |
+
} else {
|
357 |
+
|
358 |
+
return $order->add_tax( $tax_rate_id, $tax_amount, $shipping_tax_amount );
|
359 |
+
}
|
360 |
+
}
|
361 |
+
|
362 |
+
|
363 |
/**
|
364 |
* Order item CRUD compatibility method to update an order coupon.
|
365 |
*
|
489 |
}
|
490 |
|
491 |
|
492 |
+
/**
|
493 |
+
* Determines if an order has an available shipping address.
|
494 |
+
*
|
495 |
+
* WooCommerce 3.0+ no longer fills the shipping address with the billing if
|
496 |
+
* a shipping address was never set by the customer at checkout, as is the
|
497 |
+
* case with virtual orders. This method is helpful for gateways that may
|
498 |
+
* reject such transactions with blank shipping information.
|
499 |
+
*
|
500 |
+
* TODO: Remove when WC 3.0.4 can be required {CW 2017-04-17}
|
501 |
+
*
|
502 |
+
* @since 4.6.1
|
503 |
+
*
|
504 |
+
* @param \WC_Order $order order object
|
505 |
+
*
|
506 |
+
* @return bool
|
507 |
+
*/
|
508 |
+
public static function has_shipping_address( \WC_Order $order ) {
|
509 |
+
|
510 |
+
return self::get_prop( $order, 'shipping_address_1' ) || self::get_prop( $order, 'shipping_address_2' );
|
511 |
+
}
|
512 |
+
|
513 |
+
|
514 |
+
/**
|
515 |
+
* Gets the formatted meta data for an order item.
|
516 |
+
*
|
517 |
+
* @since 4.6.5
|
518 |
+
*
|
519 |
+
* @param \WC_Order_Item|array $item order item object or array
|
520 |
+
* @param string $hideprefix prefix for meta that is considered hidden
|
521 |
+
* @param bool $include_all whether to include all meta (attributes, etc...), or just custom fields
|
522 |
+
* @return array $item_meta {
|
523 |
+
* @type string $label meta field label
|
524 |
+
* @type mixed $value meta value
|
525 |
+
* }
|
526 |
+
*/
|
527 |
+
public static function get_item_formatted_meta_data( $item, $hideprefix = '_', $include_all = false ) {
|
528 |
+
|
529 |
+
if ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_1() && $item instanceof \WC_Order_Item ) {
|
530 |
+
|
531 |
+
$meta_data = $item->get_formatted_meta_data( $hideprefix, $include_all );
|
532 |
+
$item_meta = array();
|
533 |
+
|
534 |
+
foreach ( $meta_data as $meta ) {
|
535 |
+
|
536 |
+
$item_meta[] = array(
|
537 |
+
'label' => $meta->display_key,
|
538 |
+
'value' => $meta->value,
|
539 |
+
);
|
540 |
+
}
|
541 |
+
|
542 |
+
} else {
|
543 |
+
|
544 |
+
$item_meta = new \WC_Order_Item_Meta( $item );
|
545 |
+
$item_meta = $item_meta->get_formatted( $hideprefix );
|
546 |
+
}
|
547 |
+
|
548 |
+
return $item_meta;
|
549 |
+
}
|
550 |
+
|
551 |
+
|
552 |
}
|
553 |
|
554 |
|
lib/skyverge/woocommerce/compatibility/class-sv-wc-product-compatibility.php
CHANGED
@@ -84,18 +84,18 @@ class SV_WC_Product_Compatibility extends SV_WC_Data_Compatibility {
|
|
84 |
|
85 |
|
86 |
/**
|
87 |
-
*
|
88 |
*
|
89 |
* @since 4.6.0
|
90 |
* @param \WC_Product $product the product object
|
91 |
-
* @return \WC_Product
|
92 |
*/
|
93 |
public static function get_parent( \WC_Product $product ) {
|
94 |
|
95 |
if ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {
|
96 |
$parent = wc_get_product( $product->get_parent_id() );
|
97 |
} else {
|
98 |
-
$parent = $product->
|
99 |
}
|
100 |
|
101 |
return $parent;
|
84 |
|
85 |
|
86 |
/**
|
87 |
+
* Gets a product's parent product.
|
88 |
*
|
89 |
* @since 4.6.0
|
90 |
* @param \WC_Product $product the product object
|
91 |
+
* @return \WC_Product|bool
|
92 |
*/
|
93 |
public static function get_parent( \WC_Product $product ) {
|
94 |
|
95 |
if ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {
|
96 |
$parent = wc_get_product( $product->get_parent_id() );
|
97 |
} else {
|
98 |
+
$parent = $product->is_type( 'variation' ) ? wc_get_product( $product->id ) : false;
|
99 |
}
|
100 |
|
101 |
return $parent;
|
lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-payment-token-editor.php
CHANGED
@@ -84,7 +84,7 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
84 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
85 |
'actions' => array(
|
86 |
'remove_token' => array(
|
87 |
-
'ays' => __( 'Are you sure you want to remove this token?', 'woocommerce-
|
88 |
'nonce' => wp_create_nonce( 'wc_payment_gateway_admin_remove_payment_token' ),
|
89 |
),
|
90 |
'add_token' => array(
|
@@ -94,7 +94,7 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
94 |
'nonce' => wp_create_nonce( 'wc_payment_gateway_admin_refresh_payment_tokens' ),
|
95 |
),
|
96 |
'save' => array(
|
97 |
-
'error' => __( 'Invalid token data', 'woocommerce-
|
98 |
),
|
99 |
),
|
100 |
) );
|
@@ -412,7 +412,7 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
412 |
|
413 |
// Append the environment name if there are multiple
|
414 |
if ( $this->get_gateway()->get_plugin()->get_admin_user_handler()->has_multiple_environments() ) {
|
415 |
-
$title .= ' ' . sprintf( __( '(%s)', 'woocommerce-
|
416 |
}
|
417 |
|
418 |
/**
|
@@ -441,7 +441,7 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
441 |
$columns[ $field_id ] = isset( $field['label'] ) ? $field['label'] : '';
|
442 |
}
|
443 |
|
444 |
-
$columns['default'] = __( 'Default', 'woocommerce-
|
445 |
$columns['actions'] = '';
|
446 |
|
447 |
/**
|
@@ -476,24 +476,24 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
476 |
// Define the credit card fields
|
477 |
$fields = array(
|
478 |
'id' => array(
|
479 |
-
'label' => __( 'Token ID', 'woocommerce-
|
480 |
'editable' => ! $this->get_gateway()->get_api()->supports_get_tokenized_payment_methods(),
|
481 |
'required' => true,
|
482 |
),
|
483 |
'card_type' => array(
|
484 |
-
'label' => __( 'Card Type', 'woocommerce-
|
485 |
'type' => 'select',
|
486 |
'options' => $this->get_card_type_options(),
|
487 |
),
|
488 |
'last_four' => array(
|
489 |
-
'label' => __( 'Last Four', 'woocommerce-
|
490 |
'attributes' => array(
|
491 |
'pattern' => '[0-9]{4}',
|
492 |
'maxlength' => 4,
|
493 |
),
|
494 |
),
|
495 |
'expiry' => array(
|
496 |
-
'label' => __( 'Expiration (MM/YY)', 'woocommerce-
|
497 |
'attributes' => array(
|
498 |
'placeholder' => 'MM/YY',
|
499 |
'pattern' => '(0[1-9]|1[012])[- /.]\d\d',
|
@@ -509,20 +509,20 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
509 |
// Define the echeck fields
|
510 |
$fields = array(
|
511 |
'id' => array(
|
512 |
-
'label' => __( 'Token ID', 'woocommerce-
|
513 |
'editable' => ! $this->get_gateway()->get_api()->supports_get_tokenized_payment_methods(),
|
514 |
'required' => true,
|
515 |
),
|
516 |
'account_type' => array(
|
517 |
-
'label' => __( 'Account Type', 'woocommerce-
|
518 |
'type' => 'select',
|
519 |
'options' => array(
|
520 |
-
'checking' => __( 'Checking', 'woocommerce-
|
521 |
-
'savings' => __( 'Savings', 'woocommerce-
|
522 |
),
|
523 |
),
|
524 |
'last_four' => array(
|
525 |
-
'label' => __( 'Last Four', 'woocommerce-
|
526 |
'attributes' => array(
|
527 |
'pattern' => '[0-9]{4}',
|
528 |
'maxlength' => 4,
|
@@ -618,12 +618,12 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
618 |
$actions = array();
|
619 |
|
620 |
if ( $this->get_gateway()->get_api()->supports_get_tokenized_payment_methods() ) {
|
621 |
-
$actions['refresh'] = __( 'Refresh', 'woocommerce-
|
622 |
} else {
|
623 |
-
$actions['add-new'] = __( 'Add New', 'woocommerce-
|
624 |
}
|
625 |
|
626 |
-
$actions['save'] = __( 'Save', 'woocommerce-
|
627 |
|
628 |
/**
|
629 |
* Filter the payment token editor actions.
|
@@ -645,7 +645,7 @@ class SV_WC_Payment_Gateway_Admin_Payment_Token_Editor {
|
|
645 |
protected function get_token_actions() {
|
646 |
|
647 |
$actions = array(
|
648 |
-
'remove' => __( 'Remove', 'woocommerce-
|
649 |
);
|
650 |
|
651 |
/**
|
84 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
85 |
'actions' => array(
|
86 |
'remove_token' => array(
|
87 |
+
'ays' => __( 'Are you sure you want to remove this token?', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
88 |
'nonce' => wp_create_nonce( 'wc_payment_gateway_admin_remove_payment_token' ),
|
89 |
),
|
90 |
'add_token' => array(
|
94 |
'nonce' => wp_create_nonce( 'wc_payment_gateway_admin_refresh_payment_tokens' ),
|
95 |
),
|
96 |
'save' => array(
|
97 |
+
'error' => __( 'Invalid token data', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
98 |
),
|
99 |
),
|
100 |
) );
|
412 |
|
413 |
// Append the environment name if there are multiple
|
414 |
if ( $this->get_gateway()->get_plugin()->get_admin_user_handler()->has_multiple_environments() ) {
|
415 |
+
$title .= ' ' . sprintf( __( '(%s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_gateway()->get_environment_name() );
|
416 |
}
|
417 |
|
418 |
/**
|
441 |
$columns[ $field_id ] = isset( $field['label'] ) ? $field['label'] : '';
|
442 |
}
|
443 |
|
444 |
+
$columns['default'] = __( 'Default', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
445 |
$columns['actions'] = '';
|
446 |
|
447 |
/**
|
476 |
// Define the credit card fields
|
477 |
$fields = array(
|
478 |
'id' => array(
|
479 |
+
'label' => __( 'Token ID', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
480 |
'editable' => ! $this->get_gateway()->get_api()->supports_get_tokenized_payment_methods(),
|
481 |
'required' => true,
|
482 |
),
|
483 |
'card_type' => array(
|
484 |
+
'label' => __( 'Card Type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
485 |
'type' => 'select',
|
486 |
'options' => $this->get_card_type_options(),
|
487 |
),
|
488 |
'last_four' => array(
|
489 |
+
'label' => __( 'Last Four', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
490 |
'attributes' => array(
|
491 |
'pattern' => '[0-9]{4}',
|
492 |
'maxlength' => 4,
|
493 |
),
|
494 |
),
|
495 |
'expiry' => array(
|
496 |
+
'label' => __( 'Expiration (MM/YY)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
497 |
'attributes' => array(
|
498 |
'placeholder' => 'MM/YY',
|
499 |
'pattern' => '(0[1-9]|1[012])[- /.]\d\d',
|
509 |
// Define the echeck fields
|
510 |
$fields = array(
|
511 |
'id' => array(
|
512 |
+
'label' => __( 'Token ID', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
513 |
'editable' => ! $this->get_gateway()->get_api()->supports_get_tokenized_payment_methods(),
|
514 |
'required' => true,
|
515 |
),
|
516 |
'account_type' => array(
|
517 |
+
'label' => __( 'Account Type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
518 |
'type' => 'select',
|
519 |
'options' => array(
|
520 |
+
'checking' => __( 'Checking', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
521 |
+
'savings' => __( 'Savings', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
522 |
),
|
523 |
),
|
524 |
'last_four' => array(
|
525 |
+
'label' => __( 'Last Four', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
526 |
'attributes' => array(
|
527 |
'pattern' => '[0-9]{4}',
|
528 |
'maxlength' => 4,
|
618 |
$actions = array();
|
619 |
|
620 |
if ( $this->get_gateway()->get_api()->supports_get_tokenized_payment_methods() ) {
|
621 |
+
$actions['refresh'] = __( 'Refresh', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
622 |
} else {
|
623 |
+
$actions['add-new'] = __( 'Add New', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
624 |
}
|
625 |
|
626 |
+
$actions['save'] = __( 'Save', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
627 |
|
628 |
/**
|
629 |
* Filter the payment token editor actions.
|
645 |
protected function get_token_actions() {
|
646 |
|
647 |
$actions = array(
|
648 |
+
'remove' => __( 'Remove', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
649 |
);
|
650 |
|
651 |
/**
|
lib/skyverge/woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-user-handler.php
CHANGED
@@ -208,7 +208,7 @@ class SV_WC_Payment_Gateway_Admin_User_Handler {
|
|
208 |
|
209 |
$plugin_title = trim( str_replace( 'WooCommerce', '', $this->get_plugin()->get_plugin_name() ) );
|
210 |
|
211 |
-
$title = sprintf( __( '%s Payment Tokens', 'woocommerce-
|
212 |
|
213 |
/**
|
214 |
* Filter the admin token editor title.
|
@@ -286,10 +286,10 @@ class SV_WC_Payment_Gateway_Admin_User_Handler {
|
|
286 |
continue;
|
287 |
}
|
288 |
|
289 |
-
$label = __( 'Customer ID', 'woocommerce-
|
290 |
|
291 |
// If the plugin has multiple gateways configured for multiple environments, append the environment name to keep things straight
|
292 |
-
$label .= ( $this->has_multiple_environments() ) ? ' ' . sprintf( __( '(%s)', 'woocommerce-
|
293 |
|
294 |
$fields[] = array(
|
295 |
'label' => $label,
|
208 |
|
209 |
$plugin_title = trim( str_replace( 'WooCommerce', '', $this->get_plugin()->get_plugin_name() ) );
|
210 |
|
211 |
+
$title = sprintf( __( '%s Payment Tokens', 'woocommerce-gateway-paypal-powered-by-braintree' ), $plugin_title );
|
212 |
|
213 |
/**
|
214 |
* Filter the admin token editor title.
|
286 |
continue;
|
287 |
}
|
288 |
|
289 |
+
$label = __( 'Customer ID', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
290 |
|
291 |
// If the plugin has multiple gateways configured for multiple environments, append the environment name to keep things straight
|
292 |
+
$label .= ( $this->has_multiple_environments() ) ? ' ' . sprintf( __( '(%s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $gateway->get_environment_name() ) : '';
|
293 |
|
294 |
$fields[] = array(
|
295 |
'label' => $label,
|
lib/skyverge/woocommerce/payment-gateway/admin/views/html-admin-gateway-status.php
CHANGED
@@ -29,7 +29,7 @@
|
|
29 |
<tr>
|
30 |
<th colspan="3" data-export-label="">
|
31 |
<?php echo esc_html( $gateway->get_method_title() ); ?>
|
32 |
-
<?php echo wc_help_tip( __( 'This section contains configuration settings for this gateway.', 'woocommerce-
|
33 |
</th>
|
34 |
</tr>
|
35 |
</thead>
|
@@ -49,16 +49,16 @@
|
|
49 |
?>
|
50 |
|
51 |
<tr>
|
52 |
-
<td data-export-label="Environment"><?php esc_html_e( 'Environment', 'woocommerce-
|
53 |
-
<td class="help"><?php echo wc_help_tip( __( 'The transaction environment for this gateway.', 'woocommerce-
|
54 |
<td><?php echo esc_html( $environment ); ?></td>
|
55 |
</tr>
|
56 |
|
57 |
<?php if ( $gateway->supports_tokenization() ) : ?>
|
58 |
|
59 |
<tr>
|
60 |
-
<td data-export-label="Tokenization Enabled"><?php esc_html_e( 'Tokenization Enabled', 'woocommerce-
|
61 |
-
<td class="help"><?php echo wc_help_tip( __( 'Displays whether or not tokenization is enabled for this gateway.', 'woocommerce-
|
62 |
<td>
|
63 |
<?php if ( $gateway->tokenization_enabled() ) : ?>
|
64 |
<mark class="yes">✔</mark>
|
@@ -71,17 +71,17 @@
|
|
71 |
<?php endif; ?>
|
72 |
|
73 |
<tr>
|
74 |
-
<td data-export-label="Debug Mode"><?php esc_html_e( 'Debug Mode', 'woocommerce-
|
75 |
-
<td class="help"><?php echo wc_help_tip( __( 'Displays whether or not debug logging is enabled for this gateway.', 'woocommerce-
|
76 |
<td>
|
77 |
<?php if ( $gateway->debug_log() && $gateway->debug_checkout() ) : ?>
|
78 |
-
<?php echo esc_html__( 'Display at Checkout & Log', 'woocommerce-
|
79 |
<?php elseif ( $gateway->debug_checkout() ) : ?>
|
80 |
-
<?php echo esc_html__( 'Display at Checkout', 'woocommerce-
|
81 |
<?php elseif ( $gateway->debug_log() ) : ?>
|
82 |
-
<?php echo esc_html__( 'Save to Log', 'woocommerce-
|
83 |
<?php else : ?>
|
84 |
-
<?php echo esc_html__( 'Off', 'woocommerce-
|
85 |
<?php endif; ?>
|
86 |
</td>
|
87 |
</tr>
|
29 |
<tr>
|
30 |
<th colspan="3" data-export-label="">
|
31 |
<?php echo esc_html( $gateway->get_method_title() ); ?>
|
32 |
+
<?php echo wc_help_tip( __( 'This section contains configuration settings for this gateway.', 'woocommerce-gateway-paypal-powered-by-braintree' ) ); ?>
|
33 |
</th>
|
34 |
</tr>
|
35 |
</thead>
|
49 |
?>
|
50 |
|
51 |
<tr>
|
52 |
+
<td data-export-label="Environment"><?php esc_html_e( 'Environment', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?>:</td>
|
53 |
+
<td class="help"><?php echo wc_help_tip( __( 'The transaction environment for this gateway.', 'woocommerce-gateway-paypal-powered-by-braintree' ) ); ?></td>
|
54 |
<td><?php echo esc_html( $environment ); ?></td>
|
55 |
</tr>
|
56 |
|
57 |
<?php if ( $gateway->supports_tokenization() ) : ?>
|
58 |
|
59 |
<tr>
|
60 |
+
<td data-export-label="Tokenization Enabled"><?php esc_html_e( 'Tokenization Enabled', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?>:</td>
|
61 |
+
<td class="help"><?php echo wc_help_tip( __( 'Displays whether or not tokenization is enabled for this gateway.', 'woocommerce-gateway-paypal-powered-by-braintree' ) ); ?></td>
|
62 |
<td>
|
63 |
<?php if ( $gateway->tokenization_enabled() ) : ?>
|
64 |
<mark class="yes">✔</mark>
|
71 |
<?php endif; ?>
|
72 |
|
73 |
<tr>
|
74 |
+
<td data-export-label="Debug Mode"><?php esc_html_e( 'Debug Mode', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?>:</td>
|
75 |
+
<td class="help"><?php echo wc_help_tip( __( 'Displays whether or not debug logging is enabled for this gateway.', 'woocommerce-gateway-paypal-powered-by-braintree' ) ); ?></td>
|
76 |
<td>
|
77 |
<?php if ( $gateway->debug_log() && $gateway->debug_checkout() ) : ?>
|
78 |
+
<?php echo esc_html__( 'Display at Checkout & Log', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?>
|
79 |
<?php elseif ( $gateway->debug_checkout() ) : ?>
|
80 |
+
<?php echo esc_html__( 'Display at Checkout', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?>
|
81 |
<?php elseif ( $gateway->debug_log() ) : ?>
|
82 |
+
<?php echo esc_html__( 'Save to Log', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?>
|
83 |
<?php else : ?>
|
84 |
+
<?php echo esc_html__( 'Off', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?>
|
85 |
<?php endif; ?>
|
86 |
</td>
|
87 |
</tr>
|
lib/skyverge/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor-token.php
CHANGED
@@ -40,7 +40,7 @@
|
|
40 |
|
41 |
<select name="<?php echo esc_attr( $token_input_name ); ?>[<?php echo esc_attr( $field_id ); ?>]">
|
42 |
|
43 |
-
<option value=""><?php esc_html_e( '-- Select an option --', 'woocommerce-
|
44 |
|
45 |
<?php foreach ( $field['options'] as $value => $label ) : ?>
|
46 |
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $token[ $field_id ] ); ?>><?php echo esc_html( $label ); ?></option>
|
40 |
|
41 |
<select name="<?php echo esc_attr( $token_input_name ); ?>[<?php echo esc_attr( $field_id ); ?>]">
|
42 |
|
43 |
+
<option value=""><?php esc_html_e( '-- Select an option --', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?></option>
|
44 |
|
45 |
<?php foreach ( $field['options'] as $value => $label ) : ?>
|
46 |
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $token[ $field_id ] ); ?>><?php echo esc_html( $label ); ?></option>
|
lib/skyverge/woocommerce/payment-gateway/admin/views/html-user-payment-token-editor.php
CHANGED
@@ -56,7 +56,7 @@
|
|
56 |
|
57 |
<tbody class="meta">
|
58 |
<tr class="no-tokens">
|
59 |
-
<td colspan="<?php echo count( $columns ); ?>"><?php esc_html_e( 'No saved payment tokens', 'woocommerce-
|
60 |
</tr>
|
61 |
</tbody>
|
62 |
|
56 |
|
57 |
<tbody class="meta">
|
58 |
<tr class="no-tokens">
|
59 |
+
<td colspan="<?php echo count( $columns ); ?>"><?php esc_html_e( 'No saved payment tokens', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?></td>
|
60 |
</tr>
|
61 |
</tbody>
|
62 |
|
lib/skyverge/woocommerce/payment-gateway/admin/views/html-user-profile-field-customer-id.php
CHANGED
@@ -27,6 +27,6 @@
|
|
27 |
<th><label for="<?php echo esc_attr( $name ); ?>"><?php echo esc_html( $label ); ?></label></th>
|
28 |
<td>
|
29 |
<input class="regular-text" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" type="text" /><br/>
|
30 |
-
<span class="description"><?php esc_html_e( 'The gateway customer ID for the user. Only edit this if necessary.', 'woocommerce-
|
31 |
</td>
|
32 |
</tr>
|
27 |
<th><label for="<?php echo esc_attr( $name ); ?>"><?php echo esc_html( $label ); ?></label></th>
|
28 |
<td>
|
29 |
<input class="regular-text" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $value ); ?>" type="text" /><br/>
|
30 |
+
<span class="description"><?php esc_html_e( 'The gateway customer ID for the user. Only edit this if necessary.', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?></span>
|
31 |
</td>
|
32 |
</tr>
|
lib/skyverge/woocommerce/payment-gateway/api/class-sv-wc-payment-gateway-api-response-message-helper.php
CHANGED
@@ -94,45 +94,45 @@ class SV_WC_Payment_Gateway_API_Response_Message_Helper {
|
|
94 |
switch ( $message_id ) {
|
95 |
|
96 |
// generic messages
|
97 |
-
case 'error': $message = esc_html__( 'An error occurred, please try again or try an alternate form of payment', 'woocommerce-
|
98 |
-
case 'decline': $message = esc_html__( 'We cannot process your order with the payment information that you provided. Please use a different payment account or an alternate payment method.', 'woocommerce-
|
99 |
-
case 'held_for_review': $message = esc_html__( 'This order is being placed on hold for review. Please contact us to complete the transaction.', 'woocommerce-
|
100 |
|
101 |
/* missing/invalid info */
|
102 |
|
103 |
// csc
|
104 |
-
case 'held_for_incorrect_csc': $message = esc_html__( 'This order is being placed on hold for review due to an incorrect card verification number. You may contact the store to complete the transaction.', 'woocommerce-
|
105 |
-
case 'csc_invalid': $message = esc_html__( 'The card verification number is invalid, please try again.', 'woocommerce-
|
106 |
-
case 'csc_missing': $message = esc_html__( 'Please enter your card verification number and try again.', 'woocommerce-
|
107 |
|
108 |
// card type
|
109 |
-
case 'card_type_not_accepted': $message = esc_html__( 'That card type is not accepted, please use an alternate card or other form of payment.', 'woocommerce-
|
110 |
-
case 'card_type_invalid': $message = esc_html__( 'The card type is invalid or does not correlate with the credit card number. Please try again or use an alternate card or other form of payment.', 'woocommerce-
|
111 |
-
case 'card_type_missing': $message = esc_html__( 'Please select the card type and try again.', 'woocommerce-
|
112 |
|
113 |
// card number
|
114 |
-
case 'card_number_type_invalid': $message = esc_html__( 'The card type is invalid or does not correlate with the credit card number. Please try again or use an alternate card or other form of payment.', 'woocommerce-
|
115 |
-
case 'card_number_invalid': $message = esc_html__( 'The card number is invalid, please re-enter and try again.', 'woocommerce-
|
116 |
-
case 'card_number_missing': $message = esc_html__( 'Please enter your card number and try again.', 'woocommerce-
|
117 |
|
118 |
// card expiry
|
119 |
-
case 'card_expiry_invalid': $message = esc_html__( 'The card expiration date is invalid, please re-enter and try again.', 'woocommerce-
|
120 |
-
case 'card_expiry_month_invalid': $message = esc_html__( 'The card expiration month is invalid, please re-enter and try again.', 'woocommerce-
|
121 |
-
case 'card_expiry_year_invalid': $message = esc_html__( 'The card expiration year is invalid, please re-enter and try again.', 'woocommerce-
|
122 |
-
case 'card_expiry_missing': $message = esc_html__( 'Please enter your card expiration date and try again.', 'woocommerce-
|
123 |
|
124 |
// bank
|
125 |
-
case 'bank_aba_invalid': $message_id = esc_html__( 'The bank routing number is invalid, please re-enter and try again.', 'woocommerce-
|
126 |
-
case 'bank_account_number_invalid': $message_id = esc_html__( 'The bank account number is invalid, please re-enter and try again.', 'woocommerce-
|
127 |
|
128 |
/* decline reasons */
|
129 |
-
case 'card_expired': $message = esc_html__( 'The provided card is expired, please use an alternate card or other form of payment.', 'woocommerce-
|
130 |
-
case 'card_declined': $message = esc_html__( 'The provided card was declined, please use an alternate card or other form of payment.', 'woocommerce-
|
131 |
-
case 'insufficient_funds': $message = esc_html__( 'Insufficient funds in account, please use an alternate card or other form of payment.', 'woocommerce-
|
132 |
-
case 'card_inactive': $message = esc_html__( 'The card is inactivate or not authorized for card-not-present transactions, please use an alternate card or other form of payment.', 'woocommerce-
|
133 |
-
case 'credit_limit_reached': $message = esc_html__( 'The credit limit for the card has been reached, please use an alternate card or other form of payment.', 'woocommerce-
|
134 |
-
case 'csc_mismatch': $message = esc_html__( 'The card verification number does not match. Please re-enter and try again.', 'woocommerce-
|
135 |
-
case 'avs_mismatch': $message = esc_html__( 'The provided address does not match the billing address for cardholder. Please verify the address and try again.', 'woocommerce-
|
136 |
}
|
137 |
|
138 |
/**
|
94 |
switch ( $message_id ) {
|
95 |
|
96 |
// generic messages
|
97 |
+
case 'error': $message = esc_html__( 'An error occurred, please try again or try an alternate form of payment', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
98 |
+
case 'decline': $message = esc_html__( 'We cannot process your order with the payment information that you provided. Please use a different payment account or an alternate payment method.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
99 |
+
case 'held_for_review': $message = esc_html__( 'This order is being placed on hold for review. Please contact us to complete the transaction.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
100 |
|
101 |
/* missing/invalid info */
|
102 |
|
103 |
// csc
|
104 |
+
case 'held_for_incorrect_csc': $message = esc_html__( 'This order is being placed on hold for review due to an incorrect card verification number. You may contact the store to complete the transaction.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
105 |
+
case 'csc_invalid': $message = esc_html__( 'The card verification number is invalid, please try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
106 |
+
case 'csc_missing': $message = esc_html__( 'Please enter your card verification number and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
107 |
|
108 |
// card type
|
109 |
+
case 'card_type_not_accepted': $message = esc_html__( 'That card type is not accepted, please use an alternate card or other form of payment.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
110 |
+
case 'card_type_invalid': $message = esc_html__( 'The card type is invalid or does not correlate with the credit card number. Please try again or use an alternate card or other form of payment.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
111 |
+
case 'card_type_missing': $message = esc_html__( 'Please select the card type and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
112 |
|
113 |
// card number
|
114 |
+
case 'card_number_type_invalid': $message = esc_html__( 'The card type is invalid or does not correlate with the credit card number. Please try again or use an alternate card or other form of payment.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
115 |
+
case 'card_number_invalid': $message = esc_html__( 'The card number is invalid, please re-enter and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
116 |
+
case 'card_number_missing': $message = esc_html__( 'Please enter your card number and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
117 |
|
118 |
// card expiry
|
119 |
+
case 'card_expiry_invalid': $message = esc_html__( 'The card expiration date is invalid, please re-enter and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
120 |
+
case 'card_expiry_month_invalid': $message = esc_html__( 'The card expiration month is invalid, please re-enter and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
121 |
+
case 'card_expiry_year_invalid': $message = esc_html__( 'The card expiration year is invalid, please re-enter and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
122 |
+
case 'card_expiry_missing': $message = esc_html__( 'Please enter your card expiration date and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
123 |
|
124 |
// bank
|
125 |
+
case 'bank_aba_invalid': $message_id = esc_html__( 'The bank routing number is invalid, please re-enter and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
126 |
+
case 'bank_account_number_invalid': $message_id = esc_html__( 'The bank account number is invalid, please re-enter and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
127 |
|
128 |
/* decline reasons */
|
129 |
+
case 'card_expired': $message = esc_html__( 'The provided card is expired, please use an alternate card or other form of payment.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
130 |
+
case 'card_declined': $message = esc_html__( 'The provided card was declined, please use an alternate card or other form of payment.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
131 |
+
case 'insufficient_funds': $message = esc_html__( 'Insufficient funds in account, please use an alternate card or other form of payment.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
132 |
+
case 'card_inactive': $message = esc_html__( 'The card is inactivate or not authorized for card-not-present transactions, please use an alternate card or other form of payment.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
133 |
+
case 'credit_limit_reached': $message = esc_html__( 'The credit limit for the card has been reached, please use an alternate card or other form of payment.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
134 |
+
case 'csc_mismatch': $message = esc_html__( 'The card verification number does not match. Please re-enter and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
135 |
+
case 'avs_mismatch': $message = esc_html__( 'The provided address does not match the billing address for cardholder. Please verify the address and try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ); break;
|
136 |
}
|
137 |
|
138 |
/**
|
lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-direct.php
CHANGED
@@ -98,7 +98,7 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
98 |
|
99 |
// unknown token?
|
100 |
if ( ! $this->get_payment_tokens_handler()->user_has_token( get_current_user_id(), SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-payment-token' ) ) ) {
|
101 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Payment error, please try another payment method or contact us to complete your transaction.', 'woocommerce-
|
102 |
$is_valid = false;
|
103 |
}
|
104 |
|
@@ -198,7 +198,7 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
198 |
( $expiration_year == $current_year && $expiration_month < $current_month ) ||
|
199 |
$expiration_year > $current_year + 20
|
200 |
) {
|
201 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Card expiration date is invalid', 'woocommerce-
|
202 |
$is_valid = false;
|
203 |
}
|
204 |
|
@@ -222,23 +222,23 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
222 |
|
223 |
if ( empty( $account_number ) ) {
|
224 |
|
225 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Card number is missing', 'woocommerce-
|
226 |
$is_valid = false;
|
227 |
|
228 |
} else {
|
229 |
|
230 |
if ( strlen( $account_number ) < 12 || strlen( $account_number ) > 19 ) {
|
231 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Card number is invalid (wrong length)', 'woocommerce-
|
232 |
$is_valid = false;
|
233 |
}
|
234 |
|
235 |
if ( ! ctype_digit( $account_number ) ) {
|
236 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Card number is invalid (only digits allowed)', 'woocommerce-
|
237 |
$is_valid = false;
|
238 |
}
|
239 |
|
240 |
if ( ! SV_WC_Payment_Gateway_Helper::luhn_check( $account_number ) ) {
|
241 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Card number is invalid', 'woocommerce-
|
242 |
$is_valid = false;
|
243 |
}
|
244 |
|
@@ -265,19 +265,19 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
265 |
|
266 |
// digit validation
|
267 |
if ( ! ctype_digit( $csc ) ) {
|
268 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Card security code is invalid (only digits are allowed)', 'woocommerce-
|
269 |
$is_valid = false;
|
270 |
}
|
271 |
|
272 |
// length validation
|
273 |
if ( strlen( $csc ) < 3 || strlen( $csc ) > 4 ) {
|
274 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Card security code is invalid (must be 3 or 4 digits)', 'woocommerce-
|
275 |
$is_valid = false;
|
276 |
}
|
277 |
|
278 |
} elseif ( $this->csc_required() ) {
|
279 |
|
280 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Card security code is missing', 'woocommerce-
|
281 |
$is_valid = false;
|
282 |
}
|
283 |
|
@@ -304,20 +304,20 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
304 |
// routing number exists?
|
305 |
if ( empty( $routing_number ) ) {
|
306 |
|
307 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Routing Number is missing', 'woocommerce-
|
308 |
$is_valid = false;
|
309 |
|
310 |
} else {
|
311 |
|
312 |
// routing number digit validation
|
313 |
if ( ! ctype_digit( $routing_number ) ) {
|
314 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Routing Number is invalid (only digits are allowed)', 'woocommerce-
|
315 |
$is_valid = false;
|
316 |
}
|
317 |
|
318 |
// routing number length validation
|
319 |
if ( 9 != strlen( $routing_number ) ) {
|
320 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Routing number is invalid (must be 9 digits)', 'woocommerce-
|
321 |
$is_valid = false;
|
322 |
}
|
323 |
|
@@ -326,33 +326,33 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
326 |
// account number exists?
|
327 |
if ( empty( $account_number ) ) {
|
328 |
|
329 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Account Number is missing', 'woocommerce-
|
330 |
$is_valid = false;
|
331 |
|
332 |
} else {
|
333 |
|
334 |
// account number digit validation
|
335 |
if ( ! ctype_digit( $account_number ) ) {
|
336 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Account Number is invalid (only digits are allowed)', 'woocommerce-
|
337 |
$is_valid = false;
|
338 |
}
|
339 |
|
340 |
// account number length validation
|
341 |
if ( strlen( $account_number ) < 5 || strlen( $account_number ) > 17 ) {
|
342 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Account number is invalid (must be between 5 and 17 digits)', 'woocommerce-
|
343 |
$is_valid = false;
|
344 |
}
|
345 |
}
|
346 |
|
347 |
// optional drivers license number validation
|
348 |
if ( ! empty( $drivers_license_number ) && preg_match( '/^[a-zA-Z0-9 -]+$/', $drivers_license_number ) ) {
|
349 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Drivers license number is invalid', 'woocommerce-
|
350 |
$is_valid = false;
|
351 |
}
|
352 |
|
353 |
// optional check number validation
|
354 |
if ( ! empty( $check_number ) && ! ctype_digit( $check_number ) ) {
|
355 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Check Number is invalid (only digits are allowed)', 'woocommerce-
|
356 |
$is_valid = false;
|
357 |
}
|
358 |
|
@@ -602,17 +602,17 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
602 |
|
603 |
// check order note. there may not be an account_type available, but that's fine
|
604 |
/* translators: Placeholders: %1$s - payment method title, %2$s - payment account type (savings/checking) (may or may not be available), %3$s - last four digits of the account */
|
605 |
-
$message = sprintf( esc_html__( '%1$s Check Transaction Approved: %2$s account ending in %3$s', 'woocommerce-
|
606 |
|
607 |
// optional check number
|
608 |
if ( ! empty( $order->payment->check_number ) ) {
|
609 |
/* translators: Placeholders: %s - check number */
|
610 |
-
$message .= '. ' . sprintf( esc_html__( 'Check number %s', 'woocommerce-
|
611 |
}
|
612 |
|
613 |
// adds the transaction id (if any) to the order note
|
614 |
if ( $response->get_transaction_id() ) {
|
615 |
-
$message .= ' ' . sprintf( esc_html__( '(Transaction ID %s)', 'woocommerce-
|
616 |
}
|
617 |
|
618 |
/**
|
@@ -675,10 +675,10 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
675 |
// credit card order note
|
676 |
$message = sprintf(
|
677 |
/* translators: Placeholders: %1$s - payment method title, %2$s - environment ("Test"), %3$s - transaction type (authorization/charge), %4$s - card type (mastercard, visa, ...), %5$s - last four digits of the card, %6$s - expiry date */
|
678 |
-
esc_html__( '%1$s %2$s %3$s Approved: %4$s ending in %5$s (expires %6$s)', 'woocommerce-
|
679 |
$this->get_method_title(),
|
680 |
-
$this->is_test_environment() ? esc_html_x( 'Test', 'noun, software environment', 'woocommerce-
|
681 |
-
$this->perform_credit_card_authorization( $order ) ? esc_html_x( 'Authorization', 'credit card transaction type', 'woocommerce-
|
682 |
SV_WC_Payment_Gateway_Helper::payment_type_to_name( $card_type ),
|
683 |
$last_four,
|
684 |
$order->payment->exp_month . '/' . substr( $order->payment->exp_year, -2 )
|
@@ -687,7 +687,7 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
687 |
// adds the transaction id (if any) to the order note
|
688 |
if ( $response->get_transaction_id() ) {
|
689 |
/* translators: Placeholders: %s - transaction ID */
|
690 |
-
$message .= ' ' . sprintf( esc_html__( '(Transaction ID %s)', 'woocommerce-
|
691 |
}
|
692 |
|
693 |
/**
|
@@ -749,7 +749,7 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
749 |
// transaction has already been successful, but we've encountered an issue with the post-tokenization, add an order note to that effect and continue on
|
750 |
$message = sprintf(
|
751 |
/* translators: Placeholders: %s - failure message */
|
752 |
-
esc_html__( 'Tokenization Request Failed: %s', 'woocommerce-
|
753 |
$e->getMessage()
|
754 |
);
|
755 |
|
@@ -760,7 +760,7 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
760 |
// transaction has already been successful, but we've encountered an issue with the post-tokenization, add an order note to that effect and continue on
|
761 |
$message = sprintf(
|
762 |
/* translators: Placeholders: %1$s - payment method title, %2$s - failure message */
|
763 |
-
esc_html__( '%1$s Tokenization Request Failed: %2$s', 'woocommerce-
|
764 |
$this->get_method_title(),
|
765 |
$e->getMessage()
|
766 |
);
|
@@ -781,7 +781,7 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
781 |
if ( $response->transaction_held() || ( $this->supports( self::FEATURE_CREDIT_CARD_AUTHORIZATION ) && $this->perform_credit_card_authorization( $order ) ) ) {
|
782 |
// TODO: need to make this more flexible, and not force the message to 'Authorization only transaction' for auth transactions (re moneris efraud handling)
|
783 |
/* translators: This is a message describing that the transaction in question only performed a credit card authorization and did not capture any funds. */
|
784 |
-
$this->mark_order_as_held( $order, $this->supports( self::FEATURE_CREDIT_CARD_AUTHORIZATION ) && $this->perform_credit_card_authorization( $order ) ? esc_html__( 'Authorization only transaction', 'woocommerce-
|
785 |
}
|
786 |
|
787 |
return true;
|
@@ -1140,7 +1140,7 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
1140 |
|
1141 |
$result = array(
|
1142 |
/* translators: Placeholders: %s - failure message. Payment method as in a specific credit card, e-check or bank account */
|
1143 |
-
'message' => sprintf( esc_html__( 'Oops, adding your new payment method failed: %s', 'woocommerce-
|
1144 |
'success' => false,
|
1145 |
);
|
1146 |
}
|
@@ -1192,7 +1192,7 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
1192 |
if ( $this->is_credit_card_gateway() ) {
|
1193 |
|
1194 |
/* translators: Payment method as in a specific credit card. Placeholders: %1$s - card type (visa, mastercard, ...), %2$s - last four digits of the card, %3$s - card expiry date */
|
1195 |
-
$message = sprintf( esc_html__( 'Nice! New payment method added: %1$s ending in %2$s (expires %3$s)', 'woocommerce-
|
1196 |
$token->get_type_full(),
|
1197 |
$token->get_last_four(),
|
1198 |
$token->get_exp_date()
|
@@ -1202,14 +1202,14 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
1202 |
|
1203 |
// account type (checking/savings) may or may not be available, which is fine
|
1204 |
/* translators: Payment method as in a specific e-check account. Placeholders: %1$s - account type (checking/savings), %2$s - last four digits of the account */
|
1205 |
-
$message = sprintf( esc_html__( 'Nice! New payment method added: %1$s account ending in %2$s', 'woocommerce-
|
1206 |
$token->get_account_type(),
|
1207 |
$token->get_last_four()
|
1208 |
);
|
1209 |
|
1210 |
} else {
|
1211 |
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
1212 |
-
$message = esc_html__( 'Nice! New payment method added.', 'woocommerce-
|
1213 |
}
|
1214 |
|
1215 |
// add transaction data to user meta
|
@@ -1316,7 +1316,7 @@ abstract class SV_WC_Payment_Gateway_Direct extends SV_WC_Payment_Gateway {
|
|
1316 |
$order->customer_id = $this->get_customer_id( $order->get_user_id() );
|
1317 |
|
1318 |
/* translators: Placeholders: %1$s - site title, %2$s - customer email. Payment method as in a specific credit card, e-check or bank account */
|
1319 |
-
$order->description = sprintf( esc_html__( '%1$s - Add Payment Method for %2$s', 'woocommerce-
|
1320 |
|
1321 |
// force zero amount
|
1322 |
$order->payment_total = '0.00';
|
98 |
|
99 |
// unknown token?
|
100 |
if ( ! $this->get_payment_tokens_handler()->user_has_token( get_current_user_id(), SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-payment-token' ) ) ) {
|
101 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Payment error, please try another payment method or contact us to complete your transaction.', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
102 |
$is_valid = false;
|
103 |
}
|
104 |
|
198 |
( $expiration_year == $current_year && $expiration_month < $current_month ) ||
|
199 |
$expiration_year > $current_year + 20
|
200 |
) {
|
201 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Card expiration date is invalid', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
202 |
$is_valid = false;
|
203 |
}
|
204 |
|
222 |
|
223 |
if ( empty( $account_number ) ) {
|
224 |
|
225 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Card number is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
226 |
$is_valid = false;
|
227 |
|
228 |
} else {
|
229 |
|
230 |
if ( strlen( $account_number ) < 12 || strlen( $account_number ) > 19 ) {
|
231 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Card number is invalid (wrong length)', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
232 |
$is_valid = false;
|
233 |
}
|
234 |
|
235 |
if ( ! ctype_digit( $account_number ) ) {
|
236 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Card number is invalid (only digits allowed)', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
237 |
$is_valid = false;
|
238 |
}
|
239 |
|
240 |
if ( ! SV_WC_Payment_Gateway_Helper::luhn_check( $account_number ) ) {
|
241 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Card number is invalid', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
242 |
$is_valid = false;
|
243 |
}
|
244 |
|
265 |
|
266 |
// digit validation
|
267 |
if ( ! ctype_digit( $csc ) ) {
|
268 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Card security code is invalid (only digits are allowed)', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
269 |
$is_valid = false;
|
270 |
}
|
271 |
|
272 |
// length validation
|
273 |
if ( strlen( $csc ) < 3 || strlen( $csc ) > 4 ) {
|
274 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Card security code is invalid (must be 3 or 4 digits)', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
275 |
$is_valid = false;
|
276 |
}
|
277 |
|
278 |
} elseif ( $this->csc_required() ) {
|
279 |
|
280 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Card security code is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
281 |
$is_valid = false;
|
282 |
}
|
283 |
|
304 |
// routing number exists?
|
305 |
if ( empty( $routing_number ) ) {
|
306 |
|
307 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Routing Number is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
308 |
$is_valid = false;
|
309 |
|
310 |
} else {
|
311 |
|
312 |
// routing number digit validation
|
313 |
if ( ! ctype_digit( $routing_number ) ) {
|
314 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Routing Number is invalid (only digits are allowed)', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
315 |
$is_valid = false;
|
316 |
}
|
317 |
|
318 |
// routing number length validation
|
319 |
if ( 9 != strlen( $routing_number ) ) {
|
320 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Routing number is invalid (must be 9 digits)', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
321 |
$is_valid = false;
|
322 |
}
|
323 |
|
326 |
// account number exists?
|
327 |
if ( empty( $account_number ) ) {
|
328 |
|
329 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Account Number is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
330 |
$is_valid = false;
|
331 |
|
332 |
} else {
|
333 |
|
334 |
// account number digit validation
|
335 |
if ( ! ctype_digit( $account_number ) ) {
|
336 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Account Number is invalid (only digits are allowed)', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
337 |
$is_valid = false;
|
338 |
}
|
339 |
|
340 |
// account number length validation
|
341 |
if ( strlen( $account_number ) < 5 || strlen( $account_number ) > 17 ) {
|
342 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Account number is invalid (must be between 5 and 17 digits)', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
343 |
$is_valid = false;
|
344 |
}
|
345 |
}
|
346 |
|
347 |
// optional drivers license number validation
|
348 |
if ( ! empty( $drivers_license_number ) && preg_match( '/^[a-zA-Z0-9 -]+$/', $drivers_license_number ) ) {
|
349 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Drivers license number is invalid', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
350 |
$is_valid = false;
|
351 |
}
|
352 |
|
353 |
// optional check number validation
|
354 |
if ( ! empty( $check_number ) && ! ctype_digit( $check_number ) ) {
|
355 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Check Number is invalid (only digits are allowed)', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
356 |
$is_valid = false;
|
357 |
}
|
358 |
|
602 |
|
603 |
// check order note. there may not be an account_type available, but that's fine
|
604 |
/* translators: Placeholders: %1$s - payment method title, %2$s - payment account type (savings/checking) (may or may not be available), %3$s - last four digits of the account */
|
605 |
+
$message = sprintf( esc_html__( '%1$s Check Transaction Approved: %2$s account ending in %3$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_method_title(), $order->payment->account_type, $last_four );
|
606 |
|
607 |
// optional check number
|
608 |
if ( ! empty( $order->payment->check_number ) ) {
|
609 |
/* translators: Placeholders: %s - check number */
|
610 |
+
$message .= '. ' . sprintf( esc_html__( 'Check number %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $order->payment->check_number );
|
611 |
}
|
612 |
|
613 |
// adds the transaction id (if any) to the order note
|
614 |
if ( $response->get_transaction_id() ) {
|
615 |
+
$message .= ' ' . sprintf( esc_html__( '(Transaction ID %s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_transaction_id() );
|
616 |
}
|
617 |
|
618 |
/**
|
675 |
// credit card order note
|
676 |
$message = sprintf(
|
677 |
/* translators: Placeholders: %1$s - payment method title, %2$s - environment ("Test"), %3$s - transaction type (authorization/charge), %4$s - card type (mastercard, visa, ...), %5$s - last four digits of the card, %6$s - expiry date */
|
678 |
+
esc_html__( '%1$s %2$s %3$s Approved: %4$s ending in %5$s (expires %6$s)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
679 |
$this->get_method_title(),
|
680 |
+
$this->is_test_environment() ? esc_html_x( 'Test', 'noun, software environment', 'woocommerce-gateway-paypal-powered-by-braintree' ) : '',
|
681 |
+
$this->perform_credit_card_authorization( $order ) ? esc_html_x( 'Authorization', 'credit card transaction type', 'woocommerce-gateway-paypal-powered-by-braintree' ) : esc_html_x( 'Charge', 'noun, credit card transaction type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
682 |
SV_WC_Payment_Gateway_Helper::payment_type_to_name( $card_type ),
|
683 |
$last_four,
|
684 |
$order->payment->exp_month . '/' . substr( $order->payment->exp_year, -2 )
|
687 |
// adds the transaction id (if any) to the order note
|
688 |
if ( $response->get_transaction_id() ) {
|
689 |
/* translators: Placeholders: %s - transaction ID */
|
690 |
+
$message .= ' ' . sprintf( esc_html__( '(Transaction ID %s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_transaction_id() );
|
691 |
}
|
692 |
|
693 |
/**
|
749 |
// transaction has already been successful, but we've encountered an issue with the post-tokenization, add an order note to that effect and continue on
|
750 |
$message = sprintf(
|
751 |
/* translators: Placeholders: %s - failure message */
|
752 |
+
esc_html__( 'Tokenization Request Failed: %s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
753 |
$e->getMessage()
|
754 |
);
|
755 |
|
760 |
// transaction has already been successful, but we've encountered an issue with the post-tokenization, add an order note to that effect and continue on
|
761 |
$message = sprintf(
|
762 |
/* translators: Placeholders: %1$s - payment method title, %2$s - failure message */
|
763 |
+
esc_html__( '%1$s Tokenization Request Failed: %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
764 |
$this->get_method_title(),
|
765 |
$e->getMessage()
|
766 |
);
|
781 |
if ( $response->transaction_held() || ( $this->supports( self::FEATURE_CREDIT_CARD_AUTHORIZATION ) && $this->perform_credit_card_authorization( $order ) ) ) {
|
782 |
// TODO: need to make this more flexible, and not force the message to 'Authorization only transaction' for auth transactions (re moneris efraud handling)
|
783 |
/* translators: This is a message describing that the transaction in question only performed a credit card authorization and did not capture any funds. */
|
784 |
+
$this->mark_order_as_held( $order, $this->supports( self::FEATURE_CREDIT_CARD_AUTHORIZATION ) && $this->perform_credit_card_authorization( $order ) ? esc_html__( 'Authorization only transaction', 'woocommerce-gateway-paypal-powered-by-braintree' ) : $response->get_status_message(), $response );
|
785 |
}
|
786 |
|
787 |
return true;
|
1140 |
|
1141 |
$result = array(
|
1142 |
/* translators: Placeholders: %s - failure message. Payment method as in a specific credit card, e-check or bank account */
|
1143 |
+
'message' => sprintf( esc_html__( 'Oops, adding your new payment method failed: %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $e->getMessage() ),
|
1144 |
'success' => false,
|
1145 |
);
|
1146 |
}
|
1192 |
if ( $this->is_credit_card_gateway() ) {
|
1193 |
|
1194 |
/* translators: Payment method as in a specific credit card. Placeholders: %1$s - card type (visa, mastercard, ...), %2$s - last four digits of the card, %3$s - card expiry date */
|
1195 |
+
$message = sprintf( esc_html__( 'Nice! New payment method added: %1$s ending in %2$s (expires %3$s)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1196 |
$token->get_type_full(),
|
1197 |
$token->get_last_four(),
|
1198 |
$token->get_exp_date()
|
1202 |
|
1203 |
// account type (checking/savings) may or may not be available, which is fine
|
1204 |
/* translators: Payment method as in a specific e-check account. Placeholders: %1$s - account type (checking/savings), %2$s - last four digits of the account */
|
1205 |
+
$message = sprintf( esc_html__( 'Nice! New payment method added: %1$s account ending in %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1206 |
$token->get_account_type(),
|
1207 |
$token->get_last_four()
|
1208 |
);
|
1209 |
|
1210 |
} else {
|
1211 |
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
1212 |
+
$message = esc_html__( 'Nice! New payment method added.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
1213 |
}
|
1214 |
|
1215 |
// add transaction data to user meta
|
1316 |
$order->customer_id = $this->get_customer_id( $order->get_user_id() );
|
1317 |
|
1318 |
/* translators: Placeholders: %1$s - site title, %2$s - customer email. Payment method as in a specific credit card, e-check or bank account */
|
1319 |
+
$order->description = sprintf( esc_html__( '%1$s - Add Payment Method for %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), sanitize_text_field( SV_WC_Helper::get_site_name() ), $properties['billing_email'] );
|
1320 |
|
1321 |
// force zero amount
|
1322 |
$order->payment_total = '0.00';
|
lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-helper.php
CHANGED
@@ -183,11 +183,11 @@ class SV_WC_Payment_Gateway_Helper {
|
|
183 |
|
184 |
// known payment type names, excluding credit cards
|
185 |
$payment_types = array(
|
186 |
-
'paypal' => esc_html__( 'PayPal', 'woocommerce-
|
187 |
-
'checking' => esc_html__( 'Checking Account', 'woocommerce-
|
188 |
-
'savings' => esc_html__( 'Savings Account', 'woocommerce-
|
189 |
-
'card' => esc_html__( 'Credit / Debit Card', 'woocommerce-
|
190 |
-
'bank' => esc_html__( 'Bank Account', 'woocommerce-
|
191 |
);
|
192 |
|
193 |
// add the credit card names
|
@@ -196,7 +196,7 @@ class SV_WC_Payment_Gateway_Helper {
|
|
196 |
if ( isset( $payment_types[ $type ] ) ) {
|
197 |
$name = $payment_types[ $type ];
|
198 |
} elseif ( '' === $type ) {
|
199 |
-
$name = esc_html_x( 'Account', 'payment method type', 'woocommerce-
|
200 |
} else {
|
201 |
$name = ucwords( str_replace( '-', ' ', $type ) );
|
202 |
}
|
@@ -231,39 +231,39 @@ class SV_WC_Payment_Gateway_Helper {
|
|
231 |
|
232 |
return array(
|
233 |
self::CARD_TYPE_VISA => array(
|
234 |
-
'name' => esc_html_x( 'Visa', 'credit card type', 'woocommerce-
|
235 |
'variations' => array(),
|
236 |
),
|
237 |
self::CARD_TYPE_MASTERCARD => array(
|
238 |
-
'name' => esc_html_x( 'MasterCard', 'credit card type', 'woocommerce-
|
239 |
'variations' => array( 'mc' ),
|
240 |
),
|
241 |
self::CARD_TYPE_AMEX => array(
|
242 |
-
'name' => esc_html_x( 'American Express', 'credit card type', 'woocommerce-
|
243 |
'variations' => array(),
|
244 |
),
|
245 |
self::CARD_TYPE_DINERSCLUB => array(
|
246 |
-
'name' => esc_html_x( 'Diners Club', 'credit card type', 'woocommerce-
|
247 |
'variations' => array( 'diners' ),
|
248 |
),
|
249 |
self::CARD_TYPE_DISCOVER => array(
|
250 |
-
'name' => esc_html_x( 'Discover', 'credit card type', 'woocommerce-
|
251 |
'variations' => array( 'disc' ),
|
252 |
),
|
253 |
self::CARD_TYPE_JCB => array(
|
254 |
-
'name' => esc_html_x( 'JCB', 'credit card type', 'woocommerce-
|
255 |
'variations' => array(),
|
256 |
),
|
257 |
self::CARD_TYPE_CARTEBLEUE => array(
|
258 |
-
'name' => esc_html_x( 'CarteBleue', 'credit card type', 'woocommerce-
|
259 |
'variations' => array(),
|
260 |
),
|
261 |
self::CARD_TYPE_MAESTRO => array(
|
262 |
-
'name' => esc_html_x( 'Maestro', 'credit card type', 'woocommerce-
|
263 |
'variations' => array(),
|
264 |
),
|
265 |
self::CARD_TYPE_LASER => array(
|
266 |
-
'name' => esc_html_x( 'Laser', 'credit card type', 'woocommerce-
|
267 |
'variations' => array(),
|
268 |
),
|
269 |
);
|
183 |
|
184 |
// known payment type names, excluding credit cards
|
185 |
$payment_types = array(
|
186 |
+
'paypal' => esc_html__( 'PayPal', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
187 |
+
'checking' => esc_html__( 'Checking Account', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
188 |
+
'savings' => esc_html__( 'Savings Account', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
189 |
+
'card' => esc_html__( 'Credit / Debit Card', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
190 |
+
'bank' => esc_html__( 'Bank Account', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
191 |
);
|
192 |
|
193 |
// add the credit card names
|
196 |
if ( isset( $payment_types[ $type ] ) ) {
|
197 |
$name = $payment_types[ $type ];
|
198 |
} elseif ( '' === $type ) {
|
199 |
+
$name = esc_html_x( 'Account', 'payment method type', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
200 |
} else {
|
201 |
$name = ucwords( str_replace( '-', ' ', $type ) );
|
202 |
}
|
231 |
|
232 |
return array(
|
233 |
self::CARD_TYPE_VISA => array(
|
234 |
+
'name' => esc_html_x( 'Visa', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
235 |
'variations' => array(),
|
236 |
),
|
237 |
self::CARD_TYPE_MASTERCARD => array(
|
238 |
+
'name' => esc_html_x( 'MasterCard', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
239 |
'variations' => array( 'mc' ),
|
240 |
),
|
241 |
self::CARD_TYPE_AMEX => array(
|
242 |
+
'name' => esc_html_x( 'American Express', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
243 |
'variations' => array(),
|
244 |
),
|
245 |
self::CARD_TYPE_DINERSCLUB => array(
|
246 |
+
'name' => esc_html_x( 'Diners Club', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
247 |
'variations' => array( 'diners' ),
|
248 |
),
|
249 |
self::CARD_TYPE_DISCOVER => array(
|
250 |
+
'name' => esc_html_x( 'Discover', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
251 |
'variations' => array( 'disc' ),
|
252 |
),
|
253 |
self::CARD_TYPE_JCB => array(
|
254 |
+
'name' => esc_html_x( 'JCB', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
255 |
'variations' => array(),
|
256 |
),
|
257 |
self::CARD_TYPE_CARTEBLEUE => array(
|
258 |
+
'name' => esc_html_x( 'CarteBleue', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
259 |
'variations' => array(),
|
260 |
),
|
261 |
self::CARD_TYPE_MAESTRO => array(
|
262 |
+
'name' => esc_html_x( 'Maestro', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
263 |
'variations' => array(),
|
264 |
),
|
265 |
self::CARD_TYPE_LASER => array(
|
266 |
+
'name' => esc_html_x( 'Laser', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
267 |
'variations' => array(),
|
268 |
),
|
269 |
);
|
lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-my-payment-methods.php
CHANGED
@@ -118,7 +118,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
118 |
$( ".wc-' . $this->get_plugin()->get_id_dasherized() . '-payment-method-actions .button.tip" ).tipTip();
|
119 |
|
120 |
$( ".wc-' . $this->get_plugin()->get_id_dasherized() . '-payment-method-actions a.delete-payment-method" ).on( "click", function( e ) {
|
121 |
-
if ( $( this ).hasClass( "disabled" ) || ! confirm( "' . esc_js( /* translators: Payment method as in a specific credit card, e-check or bank account */ esc_html__( 'Are you sure you want to delete this payment method?', 'woocommerce-
|
122 |
e.preventDefault();
|
123 |
}
|
124 |
} );
|
@@ -253,7 +253,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
253 |
* @param \SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
254 |
*/
|
255 |
/* translators: Payment method as in a specific credit card, eCheck or bank account */
|
256 |
-
$html = '<p>' . apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_no_payment_methods_text', esc_html__( 'You do not have any saved payment methods.', 'woocommerce-
|
257 |
|
258 |
/**
|
259 |
* My Payment Methods Table No Methods HTML Filter.
|
@@ -290,7 +290,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
290 |
* @param \SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
291 |
*/
|
292 |
/* translators: Payment method as in a specific credit card, eCheck or bank account */
|
293 |
-
$title = apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_title', esc_html__( 'My Payment Methods', 'woocommerce-
|
294 |
|
295 |
$html = '<div class="sv-wc-payment-gateway-my-payment-methods-table-title">';
|
296 |
|
@@ -298,7 +298,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
298 |
|
299 |
if ( $this->supports_add_payment_method() ) {
|
300 |
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
301 |
-
$html .= sprintf( '<a class="button sv-wc-payment-gateway-my-payment-methods-add-payment-method-button dashicons-before dashicons-plus-alt" href="%s">%s</a>', esc_url( wc_get_endpoint_url( 'add-payment-method' ) ), esc_html__( 'Add New Payment Method', 'woocommerce-
|
302 |
}
|
303 |
|
304 |
$html .= '</div>';
|
@@ -384,8 +384,8 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
384 |
protected function get_table_headers() {
|
385 |
|
386 |
$headers = array(
|
387 |
-
'title' => esc_html__( 'Method', 'woocommerce-
|
388 |
-
'expiry' => esc_html__( 'Expires', 'woocommerce-
|
389 |
'actions' => ' '
|
390 |
);
|
391 |
|
@@ -419,13 +419,13 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
419 |
if ( $this->credit_card_tokens && $this->echeck_tokens ) {
|
420 |
|
421 |
$html .= sprintf( '<tr class="sv-wc-payment-gateway-my-payment-methods-type-divider wc-%s-my-payment-methods-type-divider"><td colspan="%d">%s</td><tr>',
|
422 |
-
sanitize_html_class( $this->get_plugin()->get_id_dasherized() ), count( $this->get_table_headers() ), esc_html__( 'Credit/Debit Cards', 'woocommerce-
|
423 |
);
|
424 |
|
425 |
$html .= $this->get_table_body_row_html( $this->credit_card_tokens );
|
426 |
|
427 |
$html .= sprintf( '<tr class="sv-wc-payment-gateway-my-payment-methods-type-divider wc-%s-my-payment-methods-type-divider"><td colspan="%d">%s</td><tr>',
|
428 |
-
sanitize_html_class( $this->get_plugin()->get_id_dasherized() ), count( $this->get_table_headers() ), esc_html__( 'Bank Accounts', 'woocommerce-
|
429 |
);
|
430 |
|
431 |
$html .= $this->get_table_body_row_html( $this->echeck_tokens );
|
@@ -472,7 +472,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
472 |
// Display the row data in the order of the headers
|
473 |
foreach ( $headers as $attribute => $attribute_title ) {
|
474 |
|
475 |
-
$value = isset( $method[ $attribute ] ) ? $method[ $attribute ] : __( 'N/A', 'woocommerce-
|
476 |
|
477 |
$html .= sprintf(
|
478 |
'<td class="sv-wc-payment-gateway-payment-method-%1$s wc-%2$s-payment-method-%1$s" data-title="%4$s">%3$s</td>',
|
@@ -592,7 +592,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
592 |
) ), 'wc-' . $this->get_plugin()->get_id_dasherized() . '-token-action' ),
|
593 |
'class' => array( 'make-payment-method-default' ),
|
594 |
/* translators: Set a payment method as the default option */
|
595 |
-
'name' => esc_html__( 'Make Default', 'woocommerce-
|
596 |
);
|
597 |
}
|
598 |
|
@@ -603,7 +603,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
603 |
'wc-' . $this->get_plugin()->get_id_dasherized() . '-action' => 'delete'
|
604 |
) ), 'wc-' . $this->get_plugin()->get_id_dasherized() . '-token-action' ),
|
605 |
'class' => array( 'delete-payment-method' ),
|
606 |
-
'name' => esc_html__( 'Delete', 'woocommerce-
|
607 |
);
|
608 |
|
609 |
/**
|
@@ -642,25 +642,25 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
642 |
if ( $image_url ) {
|
643 |
|
644 |
// format like "<Amex logo image> American Express"
|
645 |
-
$title = sprintf( '<img src="%1$s" alt="%2$s" title="%2$s" width="40" height="25" />%3$s', esc_url( $image_url ), esc_attr__( $type, 'woocommerce-
|
646 |
|
647 |
} else {
|
648 |
|
649 |
// missing payment method image, format like "American Express"
|
650 |
-
$title = esc_html__( $type, 'woocommerce-
|
651 |
}
|
652 |
|
653 |
// add "ending in XXXX" if available
|
654 |
if ( $last_four ) {
|
655 |
|
656 |
/* translators: %s - last four digits of a card/account */
|
657 |
-
$title .= ' ' . sprintf( esc_html__( 'ending in %s', 'woocommerce-
|
658 |
}
|
659 |
|
660 |
// add "(default)" if token is set as default
|
661 |
if ( $token->is_default() ) {
|
662 |
|
663 |
-
$title .= ' ' . esc_html__( '(default)', 'woocommerce-
|
664 |
}
|
665 |
|
666 |
/**
|
@@ -701,7 +701,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
701 |
// security check
|
702 |
if ( false === wp_verify_nonce( $_GET['_wpnonce'], 'wc-' . $this->get_plugin()->get_id_dasherized() . '-token-action' ) ) {
|
703 |
|
704 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Oops, you took too long, please try again.', 'woocommerce-
|
705 |
|
706 |
$this->redirect_to_my_account();
|
707 |
}
|
@@ -714,7 +714,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
714 |
// couldn't find an associated gateway for that token
|
715 |
if ( ! is_object( $gateway ) ) {
|
716 |
|
717 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'There was an error with your request, please try again.', 'woocommerce-
|
718 |
|
719 |
$this->redirect_to_my_account();
|
720 |
}
|
@@ -727,12 +727,12 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
727 |
if ( ! $gateway->get_payment_tokens_handler()->remove_token( $user_id, $token ) ) {
|
728 |
|
729 |
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
730 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Error removing payment method', 'woocommerce-
|
731 |
|
732 |
} else {
|
733 |
|
734 |
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
735 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Payment method deleted.', 'woocommerce-
|
736 |
}
|
737 |
|
738 |
break;
|
@@ -742,7 +742,7 @@ class SV_WC_Payment_Gateway_My_Payment_Methods {
|
|
742 |
$gateway->get_payment_tokens_handler()->set_default_token( $user_id, $token );
|
743 |
|
744 |
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
745 |
-
SV_WC_Helper::wc_add_notice( esc_html__( 'Default payment method updated.', 'woocommerce-
|
746 |
break;
|
747 |
|
748 |
// custom actions
|
118 |
$( ".wc-' . $this->get_plugin()->get_id_dasherized() . '-payment-method-actions .button.tip" ).tipTip();
|
119 |
|
120 |
$( ".wc-' . $this->get_plugin()->get_id_dasherized() . '-payment-method-actions a.delete-payment-method" ).on( "click", function( e ) {
|
121 |
+
if ( $( this ).hasClass( "disabled" ) || ! confirm( "' . esc_js( /* translators: Payment method as in a specific credit card, e-check or bank account */ esc_html__( 'Are you sure you want to delete this payment method?', 'woocommerce-gateway-paypal-powered-by-braintree' ) ) . '" ) ) {
|
122 |
e.preventDefault();
|
123 |
}
|
124 |
} );
|
253 |
* @param \SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
254 |
*/
|
255 |
/* translators: Payment method as in a specific credit card, eCheck or bank account */
|
256 |
+
$html = '<p>' . apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_no_payment_methods_text', esc_html__( 'You do not have any saved payment methods.', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this ) . '</p>';
|
257 |
|
258 |
/**
|
259 |
* My Payment Methods Table No Methods HTML Filter.
|
290 |
* @param \SV_WC_Payment_Gateway_My_Payment_Methods $this instance
|
291 |
*/
|
292 |
/* translators: Payment method as in a specific credit card, eCheck or bank account */
|
293 |
+
$title = apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_my_payment_methods_table_title', esc_html__( 'My Payment Methods', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this );
|
294 |
|
295 |
$html = '<div class="sv-wc-payment-gateway-my-payment-methods-table-title">';
|
296 |
|
298 |
|
299 |
if ( $this->supports_add_payment_method() ) {
|
300 |
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
301 |
+
$html .= sprintf( '<a class="button sv-wc-payment-gateway-my-payment-methods-add-payment-method-button dashicons-before dashicons-plus-alt" href="%s">%s</a>', esc_url( wc_get_endpoint_url( 'add-payment-method' ) ), esc_html__( 'Add New Payment Method', 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
302 |
}
|
303 |
|
304 |
$html .= '</div>';
|
384 |
protected function get_table_headers() {
|
385 |
|
386 |
$headers = array(
|
387 |
+
'title' => esc_html__( 'Method', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
388 |
+
'expiry' => esc_html__( 'Expires', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
389 |
'actions' => ' '
|
390 |
);
|
391 |
|
419 |
if ( $this->credit_card_tokens && $this->echeck_tokens ) {
|
420 |
|
421 |
$html .= sprintf( '<tr class="sv-wc-payment-gateway-my-payment-methods-type-divider wc-%s-my-payment-methods-type-divider"><td colspan="%d">%s</td><tr>',
|
422 |
+
sanitize_html_class( $this->get_plugin()->get_id_dasherized() ), count( $this->get_table_headers() ), esc_html__( 'Credit/Debit Cards', 'woocommerce-gateway-paypal-powered-by-braintree' )
|
423 |
);
|
424 |
|
425 |
$html .= $this->get_table_body_row_html( $this->credit_card_tokens );
|
426 |
|
427 |
$html .= sprintf( '<tr class="sv-wc-payment-gateway-my-payment-methods-type-divider wc-%s-my-payment-methods-type-divider"><td colspan="%d">%s</td><tr>',
|
428 |
+
sanitize_html_class( $this->get_plugin()->get_id_dasherized() ), count( $this->get_table_headers() ), esc_html__( 'Bank Accounts', 'woocommerce-gateway-paypal-powered-by-braintree' )
|
429 |
);
|
430 |
|
431 |
$html .= $this->get_table_body_row_html( $this->echeck_tokens );
|
472 |
// Display the row data in the order of the headers
|
473 |
foreach ( $headers as $attribute => $attribute_title ) {
|
474 |
|
475 |
+
$value = isset( $method[ $attribute ] ) ? $method[ $attribute ] : __( 'N/A', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
476 |
|
477 |
$html .= sprintf(
|
478 |
'<td class="sv-wc-payment-gateway-payment-method-%1$s wc-%2$s-payment-method-%1$s" data-title="%4$s">%3$s</td>',
|
592 |
) ), 'wc-' . $this->get_plugin()->get_id_dasherized() . '-token-action' ),
|
593 |
'class' => array( 'make-payment-method-default' ),
|
594 |
/* translators: Set a payment method as the default option */
|
595 |
+
'name' => esc_html__( 'Make Default', 'woocommerce-gateway-paypal-powered-by-braintree' )
|
596 |
);
|
597 |
}
|
598 |
|
603 |
'wc-' . $this->get_plugin()->get_id_dasherized() . '-action' => 'delete'
|
604 |
) ), 'wc-' . $this->get_plugin()->get_id_dasherized() . '-token-action' ),
|
605 |
'class' => array( 'delete-payment-method' ),
|
606 |
+
'name' => esc_html__( 'Delete', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
607 |
);
|
608 |
|
609 |
/**
|
642 |
if ( $image_url ) {
|
643 |
|
644 |
// format like "<Amex logo image> American Express"
|
645 |
+
$title = sprintf( '<img src="%1$s" alt="%2$s" title="%2$s" width="40" height="25" />%3$s', esc_url( $image_url ), esc_attr__( $type, 'woocommerce-gateway-paypal-powered-by-braintree' ), esc_html__( $type, 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
646 |
|
647 |
} else {
|
648 |
|
649 |
// missing payment method image, format like "American Express"
|
650 |
+
$title = esc_html__( $type, 'woocommerce-gateway-paypal-powered-by-braintree' );
|
651 |
}
|
652 |
|
653 |
// add "ending in XXXX" if available
|
654 |
if ( $last_four ) {
|
655 |
|
656 |
/* translators: %s - last four digits of a card/account */
|
657 |
+
$title .= ' ' . sprintf( esc_html__( 'ending in %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $last_four );
|
658 |
}
|
659 |
|
660 |
// add "(default)" if token is set as default
|
661 |
if ( $token->is_default() ) {
|
662 |
|
663 |
+
$title .= ' ' . esc_html__( '(default)', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
664 |
}
|
665 |
|
666 |
/**
|
701 |
// security check
|
702 |
if ( false === wp_verify_nonce( $_GET['_wpnonce'], 'wc-' . $this->get_plugin()->get_id_dasherized() . '-token-action' ) ) {
|
703 |
|
704 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Oops, you took too long, please try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
705 |
|
706 |
$this->redirect_to_my_account();
|
707 |
}
|
714 |
// couldn't find an associated gateway for that token
|
715 |
if ( ! is_object( $gateway ) ) {
|
716 |
|
717 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'There was an error with your request, please try again.', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
718 |
|
719 |
$this->redirect_to_my_account();
|
720 |
}
|
727 |
if ( ! $gateway->get_payment_tokens_handler()->remove_token( $user_id, $token ) ) {
|
728 |
|
729 |
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
730 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Error removing payment method', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
731 |
|
732 |
} else {
|
733 |
|
734 |
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
735 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Payment method deleted.', 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
736 |
}
|
737 |
|
738 |
break;
|
742 |
$gateway->get_payment_tokens_handler()->set_default_token( $user_id, $token );
|
743 |
|
744 |
/* translators: Payment method as in a specific credit card, e-check or bank account */
|
745 |
+
SV_WC_Helper::wc_add_notice( esc_html__( 'Default payment method updated.', 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
746 |
break;
|
747 |
|
748 |
// custom actions
|
lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-payment-form.php
CHANGED
@@ -292,7 +292,7 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
292 |
$fields = array(
|
293 |
'card-number' => array(
|
294 |
'type' => 'tel',
|
295 |
-
'label' => esc_html__( 'Card Number', 'woocommerce-
|
296 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-number',
|
297 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-number',
|
298 |
'placeholder' => '•••• •••• •••• ••••',
|
@@ -310,10 +310,10 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
310 |
),
|
311 |
'card-expiry' => array(
|
312 |
'type' => 'text',
|
313 |
-
'label' => esc_html__( 'Expiration (MM/YY)', 'woocommerce-
|
314 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-expiry',
|
315 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-expiry',
|
316 |
-
'placeholder' => esc_html__( 'MM / YY', 'woocommerce-
|
317 |
'required' => true,
|
318 |
'class' => array( 'form-row-first' ),
|
319 |
'input_class' => array( 'js-sv-wc-payment-gateway-credit-card-form-input js-sv-wc-payment-gateway-credit-card-form-expiry' ),
|
@@ -331,10 +331,10 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
331 |
|
332 |
$fields['card-csc'] = array(
|
333 |
'type' => 'tel',
|
334 |
-
'label' => esc_html__( 'Card Security Code', 'woocommerce-
|
335 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-csc',
|
336 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-csc',
|
337 |
-
'placeholder' => esc_html__( 'CSC', 'woocommerce-
|
338 |
'required' => $this->get_gateway()->csc_required(),
|
339 |
'class' => array( 'form-row-last' ),
|
340 |
'input_class' => array( 'js-sv-wc-payment-gateway-credit-card-form-input js-sv-wc-payment-gateway-credit-card-form-csc' ),
|
@@ -373,13 +373,13 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
373 |
|
374 |
$defaults = $this->get_gateway()->get_payment_method_defaults();
|
375 |
|
376 |
-
$check_hint = sprintf( '<img title="%s" class="js-sv-wc-payment-gateway-echeck-form-check-hint" src="%s" width="16" height="16" />', esc_attr__( 'Where do I find this?', 'woocommerce-
|
377 |
|
378 |
$fields = array(
|
379 |
'routing-number' => array(
|
380 |
'type' => 'tel',
|
381 |
/* translators: e-check routing number, HTML form field label, https://en.wikipedia.org/wiki/Routing_transit_number */
|
382 |
-
'label' => esc_html__( 'Routing Number', 'woocommerce-
|
383 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-routing-number',
|
384 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-routing-number',
|
385 |
'placeholder' => '•••••••••',
|
@@ -398,7 +398,7 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
398 |
'account-number' => array(
|
399 |
'type' => 'tel',
|
400 |
/* translators: e-check account number, HTML form field label */
|
401 |
-
'label' => esc_html__( 'Account Number', 'woocommerce-
|
402 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-number',
|
403 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-number',
|
404 |
'required' => true,
|
@@ -416,7 +416,7 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
416 |
'account-type' => array(
|
417 |
'type' => 'select',
|
418 |
/* translators: e-check account type, HTML form field label */
|
419 |
-
'label' => esc_html__( 'Account Type', 'woocommerce-
|
420 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-type',
|
421 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-type',
|
422 |
'required' => true,
|
@@ -424,9 +424,9 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
424 |
'input_class' => array( 'js-sv-wc-payment-gateway-echeck-form-input js-sv-wc-payment-gateway-echeck-form-account-type' ),
|
425 |
'options' => array(
|
426 |
/* translators: http://www.investopedia.com/terms/c/checkingaccount.asp */
|
427 |
-
'checking' => esc_html_x( 'Checking', 'account type', 'woocommerce-
|
428 |
/* translators: http://www.investopedia.com/terms/s/savingsaccount.asp */
|
429 |
-
'savings' => esc_html_x( 'Savings', 'account type', 'woocommerce-
|
430 |
),
|
431 |
'custom_attributes' => array(),
|
432 |
'value' => 'checking',
|
@@ -463,7 +463,7 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
463 |
|
464 |
if ( $this->get_gateway()->is_test_environment() ) {
|
465 |
/* translators: Test mode refers to the current software environment */
|
466 |
-
echo '<p>' . esc_html__( 'TEST MODE ENABLED', 'woocommerce-
|
467 |
}
|
468 |
|
469 |
/**
|
@@ -566,7 +566,7 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
566 |
$html = sprintf( '<a class="sv-wc-payment-gateway-payment-form-manage-payment-methods button" href="%s">%s</a>',
|
567 |
esc_url( $url ),
|
568 |
/* translators: Payment method as in a specific credit card, eCheck or bank account */
|
569 |
-
wp_kses_post( apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_manage_payment_methods_text', esc_html__( 'Manage Payment Methods', 'woocommerce-
|
570 |
);
|
571 |
|
572 |
/**
|
@@ -639,26 +639,26 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
639 |
if ( $image_url ) {
|
640 |
|
641 |
// format like "<Amex logo image> American Express"
|
642 |
-
$title = sprintf( '<img src="%1$s" alt="%2$s" title="%2$s" width="30" height="20" style="width: 30px; height: 20px;" />%3$s', esc_url( $image_url ), esc_attr__( $type, 'woocommerce-
|
643 |
|
644 |
} else {
|
645 |
|
646 |
// missing payment method image, format like "American Express"
|
647 |
-
$title = esc_html__( $type, 'woocommerce-
|
648 |
}
|
649 |
|
650 |
// add "ending in XXXX" if available
|
651 |
if ( $last_four ) {
|
652 |
|
653 |
/* translators: Placeholders: %s - last four digits of card/account */
|
654 |
-
$title .= ' ' . sprintf( esc_html__( 'ending in %s', 'woocommerce-
|
655 |
}
|
656 |
|
657 |
// add "(expires MM/YY)" if available
|
658 |
if ( $token->get_exp_month() && $token->get_exp_year() ) {
|
659 |
|
660 |
/* translators: Placeholders: %s - expiry date */
|
661 |
-
$title .= ' ' . sprintf( esc_html__( '(expires %s)', 'woocommerce-
|
662 |
}
|
663 |
|
664 |
/**
|
@@ -694,7 +694,7 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
694 |
// label
|
695 |
$html .= sprintf( '<label style="display:inline;" for="wc-%s-use-new-payment-method">%s</label>',
|
696 |
esc_attr( $this->get_gateway()->get_id_dasherized() ),
|
697 |
-
$this->get_gateway()->is_credit_card_gateway() ? esc_html__( 'Use a new card', 'woocommerce-
|
698 |
);
|
699 |
|
700 |
/**
|
@@ -756,7 +756,7 @@ class SV_WC_Payment_Gateway_Payment_Form {
|
|
756 |
* @param string $checkbox_text checkbox text
|
757 |
*/
|
758 |
/* translators: account as in customer's account on the eCommerce site */
|
759 |
-
$html .= sprintf( '<label for="wc-%s-tokenize-payment-method" style="display:inline;">%s</label>', $this->get_gateway()->get_id_dasherized(), apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_tokenize_payment_method_text', esc_html__( 'Securely Save to Account', 'woocommerce-
|
760 |
$html .= '</p><div class="clear"></div>';
|
761 |
}
|
762 |
}
|
292 |
$fields = array(
|
293 |
'card-number' => array(
|
294 |
'type' => 'tel',
|
295 |
+
'label' => esc_html__( 'Card Number', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
296 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-number',
|
297 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-number',
|
298 |
'placeholder' => '•••• •••• •••• ••••',
|
310 |
),
|
311 |
'card-expiry' => array(
|
312 |
'type' => 'text',
|
313 |
+
'label' => esc_html__( 'Expiration (MM/YY)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
314 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-expiry',
|
315 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-expiry',
|
316 |
+
'placeholder' => esc_html__( 'MM / YY', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
317 |
'required' => true,
|
318 |
'class' => array( 'form-row-first' ),
|
319 |
'input_class' => array( 'js-sv-wc-payment-gateway-credit-card-form-input js-sv-wc-payment-gateway-credit-card-form-expiry' ),
|
331 |
|
332 |
$fields['card-csc'] = array(
|
333 |
'type' => 'tel',
|
334 |
+
'label' => esc_html__( 'Card Security Code', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
335 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-csc',
|
336 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-csc',
|
337 |
+
'placeholder' => esc_html__( 'CSC', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
338 |
'required' => $this->get_gateway()->csc_required(),
|
339 |
'class' => array( 'form-row-last' ),
|
340 |
'input_class' => array( 'js-sv-wc-payment-gateway-credit-card-form-input js-sv-wc-payment-gateway-credit-card-form-csc' ),
|
373 |
|
374 |
$defaults = $this->get_gateway()->get_payment_method_defaults();
|
375 |
|
376 |
+
$check_hint = sprintf( '<img title="%s" class="js-sv-wc-payment-gateway-echeck-form-check-hint" src="%s" width="16" height="16" />', esc_attr__( 'Where do I find this?', 'woocommerce-gateway-paypal-powered-by-braintree' ), esc_url( WC()->plugin_url() . '/assets/images/help.png' ) );
|
377 |
|
378 |
$fields = array(
|
379 |
'routing-number' => array(
|
380 |
'type' => 'tel',
|
381 |
/* translators: e-check routing number, HTML form field label, https://en.wikipedia.org/wiki/Routing_transit_number */
|
382 |
+
'label' => esc_html__( 'Routing Number', 'woocommerce-gateway-paypal-powered-by-braintree' ) . $check_hint,
|
383 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-routing-number',
|
384 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-routing-number',
|
385 |
'placeholder' => '•••••••••',
|
398 |
'account-number' => array(
|
399 |
'type' => 'tel',
|
400 |
/* translators: e-check account number, HTML form field label */
|
401 |
+
'label' => esc_html__( 'Account Number', 'woocommerce-gateway-paypal-powered-by-braintree' ) . $check_hint,
|
402 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-number',
|
403 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-number',
|
404 |
'required' => true,
|
416 |
'account-type' => array(
|
417 |
'type' => 'select',
|
418 |
/* translators: e-check account type, HTML form field label */
|
419 |
+
'label' => esc_html__( 'Account Type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
420 |
'id' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-type',
|
421 |
'name' => 'wc-' . $this->get_gateway()->get_id_dasherized() . '-account-type',
|
422 |
'required' => true,
|
424 |
'input_class' => array( 'js-sv-wc-payment-gateway-echeck-form-input js-sv-wc-payment-gateway-echeck-form-account-type' ),
|
425 |
'options' => array(
|
426 |
/* translators: http://www.investopedia.com/terms/c/checkingaccount.asp */
|
427 |
+
'checking' => esc_html_x( 'Checking', 'account type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
428 |
/* translators: http://www.investopedia.com/terms/s/savingsaccount.asp */
|
429 |
+
'savings' => esc_html_x( 'Savings', 'account type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
430 |
),
|
431 |
'custom_attributes' => array(),
|
432 |
'value' => 'checking',
|
463 |
|
464 |
if ( $this->get_gateway()->is_test_environment() ) {
|
465 |
/* translators: Test mode refers to the current software environment */
|
466 |
+
echo '<p>' . esc_html__( 'TEST MODE ENABLED', 'woocommerce-gateway-paypal-powered-by-braintree' ) . '</p>';
|
467 |
}
|
468 |
|
469 |
/**
|
566 |
$html = sprintf( '<a class="sv-wc-payment-gateway-payment-form-manage-payment-methods button" href="%s">%s</a>',
|
567 |
esc_url( $url ),
|
568 |
/* translators: Payment method as in a specific credit card, eCheck or bank account */
|
569 |
+
wp_kses_post( apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_manage_payment_methods_text', esc_html__( 'Manage Payment Methods', 'woocommerce-gateway-paypal-powered-by-braintree' ) ) )
|
570 |
);
|
571 |
|
572 |
/**
|
639 |
if ( $image_url ) {
|
640 |
|
641 |
// format like "<Amex logo image> American Express"
|
642 |
+
$title = sprintf( '<img src="%1$s" alt="%2$s" title="%2$s" width="30" height="20" style="width: 30px; height: 20px;" />%3$s', esc_url( $image_url ), esc_attr__( $type, 'woocommerce-gateway-paypal-powered-by-braintree' ), esc_html__( $type, 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
643 |
|
644 |
} else {
|
645 |
|
646 |
// missing payment method image, format like "American Express"
|
647 |
+
$title = esc_html__( $type, 'woocommerce-gateway-paypal-powered-by-braintree' );
|
648 |
}
|
649 |
|
650 |
// add "ending in XXXX" if available
|
651 |
if ( $last_four ) {
|
652 |
|
653 |
/* translators: Placeholders: %s - last four digits of card/account */
|
654 |
+
$title .= ' ' . sprintf( esc_html__( 'ending in %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $last_four );
|
655 |
}
|
656 |
|
657 |
// add "(expires MM/YY)" if available
|
658 |
if ( $token->get_exp_month() && $token->get_exp_year() ) {
|
659 |
|
660 |
/* translators: Placeholders: %s - expiry date */
|
661 |
+
$title .= ' ' . sprintf( esc_html__( '(expires %s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $token->get_exp_date() );
|
662 |
}
|
663 |
|
664 |
/**
|
694 |
// label
|
695 |
$html .= sprintf( '<label style="display:inline;" for="wc-%s-use-new-payment-method">%s</label>',
|
696 |
esc_attr( $this->get_gateway()->get_id_dasherized() ),
|
697 |
+
$this->get_gateway()->is_credit_card_gateway() ? esc_html__( 'Use a new card', 'woocommerce-gateway-paypal-powered-by-braintree' ) : esc_html__( 'Use a new bank account', 'woocommerce-gateway-paypal-powered-by-braintree' )
|
698 |
);
|
699 |
|
700 |
/**
|
756 |
* @param string $checkbox_text checkbox text
|
757 |
*/
|
758 |
/* translators: account as in customer's account on the eCommerce site */
|
759 |
+
$html .= sprintf( '<label for="wc-%s-tokenize-payment-method" style="display:inline;">%s</label>', $this->get_gateway()->get_id_dasherized(), apply_filters( 'wc_' . $this->get_gateway()->get_id() . '_tokenize_payment_method_text', esc_html__( 'Securely Save to Account', 'woocommerce-gateway-paypal-powered-by-braintree' ) ) );
|
760 |
$html .= '</p><div class="clear"></div>';
|
761 |
}
|
762 |
}
|
lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php
CHANGED
@@ -155,7 +155,7 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
155 |
if ( $this->is_subscriptions_active() ) {
|
156 |
|
157 |
// filter the payment gateway table on the checkout settings screen to indicate if a gateway can support Subscriptions but requires tokenization to be enabled
|
158 |
-
add_action( 'admin_print_styles
|
159 |
add_filter( 'woocommerce_payment_gateways_renewal_support_status_html', array( $this, 'subscriptions_maybe_edit_renewal_support_status' ), 10, 2 );
|
160 |
}
|
161 |
|
@@ -420,7 +420,7 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
420 |
if ( ! wc_checkout_is_https() ) {
|
421 |
|
422 |
/* translators: Placeholders: %s - plugin name */
|
423 |
-
$message = sprintf( esc_html__( "%s: WooCommerce is not being forced over SSL; your customer's payment data may be at risk.", 'woocommerce-
|
424 |
|
425 |
$this->get_admin_notice_handler()->add_admin_notice( $message, 'ssl-required', array(
|
426 |
'notice_class' => 'error',
|
@@ -521,7 +521,7 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
521 |
|
522 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag */
|
523 |
$message = sprintf(
|
524 |
-
esc_html__( '%1$s is inactive for subscription transactions. Please %2$senable tokenization%3$s to activate %1$s for Subscriptions.', 'woocommerce-
|
525 |
$gateway->get_method_title(),
|
526 |
'<a href="' . $this->get_payment_gateway_configuration_url( $gateway->get_id() ) . '">',
|
527 |
'</a>'
|
@@ -539,7 +539,7 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
539 |
|
540 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag */
|
541 |
$message = sprintf(
|
542 |
-
esc_html__( '%1$s is inactive for pre-order transactions. Please %2$senable tokenization%3$s to activate %1$s for Pre-Orders.', 'woocommerce-
|
543 |
$gateway->get_method_title(),
|
544 |
'<a href="' . $this->get_payment_gateway_configuration_url( $gateway->get_id() ) . '">',
|
545 |
'</a>'
|
@@ -575,8 +575,8 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
575 |
|
576 |
if ( $gateway->is_enabled() && $gateway->supports_tokenization() && ! $gateway->tokenization_enabled() ) {
|
577 |
|
578 |
-
$tool_tip = esc_attr__( 'You must enable tokenization for this gateway in order to support automatic renewal payments with the WooCommerce Subscriptions extension.', 'woocommerce-
|
579 |
-
$status = esc_html__( 'Inactive', 'woocommerce-
|
580 |
|
581 |
$html = sprintf( '<a href="%1$s"><span class="sv-wc-payment-gateway-renewal-status-inactive tips" data-tip="%2$s">%3$s</span></a>',
|
582 |
esc_url( $this->get_payment_gateway_configuration_url( $gateway->get_id() ) ),
|
@@ -595,7 +595,9 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
595 |
*/
|
596 |
public function subscriptions_add_renewal_support_status_inline_style() {
|
597 |
|
598 |
-
|
|
|
|
|
599 |
}
|
600 |
|
601 |
|
@@ -718,7 +720,7 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
718 |
jQuery( document ).ready( function ( $ ) {
|
719 |
if ( 0 == $( 'select[name^=action] option[value=wc_capture_charge]' ).size() ) {
|
720 |
$( 'select[name^=action]' ).append(
|
721 |
-
$( '<option>' ).val( '<?php echo esc_js( 'wc_capture_charge' ); ?>' ).text( '<?php _e( 'Capture Charge', 'woocommerce-
|
722 |
);
|
723 |
}
|
724 |
});
|
@@ -787,7 +789,7 @@ abstract class SV_WC_Payment_Gateway_Plugin extends SV_WC_Plugin {
|
|
787 |
/* translators: verb, as in "Capture credit card charge".
|
788 |
Used when an amount has been pre-authorized before, but funds have not yet been captured (taken) from the card.
|
789 |
Capturing the charge will take the money from the credit card and put it in the merchant's pockets. */
|
790 |
-
$actions[ 'wc_' . $this->get_id() . '_capture_charge' ] = esc_html__( 'Capture Charge', 'woocommerce-
|
791 |
|
792 |
return $actions;
|
793 |
}
|
155 |
if ( $this->is_subscriptions_active() ) {
|
156 |
|
157 |
// filter the payment gateway table on the checkout settings screen to indicate if a gateway can support Subscriptions but requires tokenization to be enabled
|
158 |
+
add_action( 'admin_print_styles', array( $this, 'subscriptions_add_renewal_support_status_inline_style' ) );
|
159 |
add_filter( 'woocommerce_payment_gateways_renewal_support_status_html', array( $this, 'subscriptions_maybe_edit_renewal_support_status' ), 10, 2 );
|
160 |
}
|
161 |
|
420 |
if ( ! wc_checkout_is_https() ) {
|
421 |
|
422 |
/* translators: Placeholders: %s - plugin name */
|
423 |
+
$message = sprintf( esc_html__( "%s: WooCommerce is not being forced over SSL; your customer's payment data may be at risk.", 'woocommerce-gateway-paypal-powered-by-braintree' ), '<strong>' . $this->get_plugin_name() . '</strong>' );
|
424 |
|
425 |
$this->get_admin_notice_handler()->add_admin_notice( $message, 'ssl-required', array(
|
426 |
'notice_class' => 'error',
|
521 |
|
522 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag */
|
523 |
$message = sprintf(
|
524 |
+
esc_html__( '%1$s is inactive for subscription transactions. Please %2$senable tokenization%3$s to activate %1$s for Subscriptions.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
525 |
$gateway->get_method_title(),
|
526 |
'<a href="' . $this->get_payment_gateway_configuration_url( $gateway->get_id() ) . '">',
|
527 |
'</a>'
|
539 |
|
540 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - <a> tag, %3$s - </a> tag */
|
541 |
$message = sprintf(
|
542 |
+
esc_html__( '%1$s is inactive for pre-order transactions. Please %2$senable tokenization%3$s to activate %1$s for Pre-Orders.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
543 |
$gateway->get_method_title(),
|
544 |
'<a href="' . $this->get_payment_gateway_configuration_url( $gateway->get_id() ) . '">',
|
545 |
'</a>'
|
575 |
|
576 |
if ( $gateway->is_enabled() && $gateway->supports_tokenization() && ! $gateway->tokenization_enabled() ) {
|
577 |
|
578 |
+
$tool_tip = esc_attr__( 'You must enable tokenization for this gateway in order to support automatic renewal payments with the WooCommerce Subscriptions extension.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
579 |
+
$status = esc_html__( 'Inactive', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
580 |
|
581 |
$html = sprintf( '<a href="%1$s"><span class="sv-wc-payment-gateway-renewal-status-inactive tips" data-tip="%2$s">%3$s</span></a>',
|
582 |
esc_url( $this->get_payment_gateway_configuration_url( $gateway->get_id() ) ),
|
595 |
*/
|
596 |
public function subscriptions_add_renewal_support_status_inline_style() {
|
597 |
|
598 |
+
if ( SV_WC_Plugin_Compatibility::normalize_wc_screen_id() === get_current_screen()->id ) {
|
599 |
+
wp_add_inline_style( 'woocommerce_admin_styles', '.sv-wc-payment-gateway-renewal-status-inactive{font-size:1.4em;display:block;text-indent:-9999px;position:relative;height:1em;width:1em;cursor:pointer}.sv-wc-payment-gateway-renewal-status-inactive:before{line-height:1;margin:0;position:absolute;width:100%;height:100%;content:"\e016";color:#ffba00;font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;text-indent:0;top:0;left:0;text-align:center}' );
|
600 |
+
}
|
601 |
}
|
602 |
|
603 |
|
720 |
jQuery( document ).ready( function ( $ ) {
|
721 |
if ( 0 == $( 'select[name^=action] option[value=wc_capture_charge]' ).size() ) {
|
722 |
$( 'select[name^=action]' ).append(
|
723 |
+
$( '<option>' ).val( '<?php echo esc_js( 'wc_capture_charge' ); ?>' ).text( '<?php _e( 'Capture Charge', 'woocommerce-gateway-paypal-powered-by-braintree' ); ?>' )
|
724 |
);
|
725 |
}
|
726 |
});
|
789 |
/* translators: verb, as in "Capture credit card charge".
|
790 |
Used when an amount has been pre-authorized before, but funds have not yet been captured (taken) from the card.
|
791 |
Capturing the charge will take the money from the credit card and put it in the merchant's pockets. */
|
792 |
+
$actions[ 'wc_' . $this->get_id() . '_capture_charge' ] = esc_html__( 'Capture Charge', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
793 |
|
794 |
return $actions;
|
795 |
}
|
lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway.php
CHANGED
@@ -402,25 +402,25 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
402 |
* @return array
|
403 |
*/
|
404 |
return apply_filters( 'sv_wc_payment_gateway_payment_form_js_localized_script_params', array(
|
405 |
-
'card_number_missing' => esc_html__( 'Card number is missing', 'woocommerce-
|
406 |
-
'card_number_invalid' => esc_html__( 'Card number is invalid', 'woocommerce-
|
407 |
-
'card_number_digits_invalid' => esc_html__( 'Card number is invalid (only digits allowed)', 'woocommerce-
|
408 |
-
'card_number_length_invalid' => esc_html__( 'Card number is invalid (wrong length)', 'woocommerce-
|
409 |
-
'cvv_missing' => esc_html__( 'Card security code is missing', 'woocommerce-
|
410 |
-
'cvv_digits_invalid' => esc_html__( 'Card security code is invalid (only digits are allowed)', 'woocommerce-
|
411 |
-
'cvv_length_invalid' => esc_html__( 'Card security code is invalid (must be 3 or 4 digits)', 'woocommerce-
|
412 |
-
'card_exp_date_invalid' => esc_html__( 'Card expiration date is invalid', 'woocommerce-
|
413 |
-
'check_number_digits_invalid' => esc_html__( 'Check Number is invalid (only digits are allowed)', 'woocommerce-
|
414 |
-
'check_number_missing' => esc_html__( 'Check Number is missing', 'woocommerce-
|
415 |
-
'drivers_license_state_missing' => esc_html__( 'Drivers license state is missing', 'woocommerce-
|
416 |
-
'drivers_license_number_missing' => esc_html__( 'Drivers license number is missing', 'woocommerce-
|
417 |
-
'drivers_license_number_invalid' => esc_html__( 'Drivers license number is invalid', 'woocommerce-
|
418 |
-
'account_number_missing' => esc_html__( 'Account Number is missing', 'woocommerce-
|
419 |
-
'account_number_invalid' => esc_html__( 'Account Number is invalid (only digits are allowed)', 'woocommerce-
|
420 |
-
'account_number_length_invalid' => esc_html__( 'Account number is invalid (must be between 5 and 17 digits)', 'woocommerce-
|
421 |
-
'routing_number_missing' => esc_html__( 'Routing Number is missing', 'woocommerce-
|
422 |
-
'routing_number_digits_invalid' => esc_html__( 'Routing Number is invalid (only digits are allowed)', 'woocommerce-
|
423 |
-
'routing_number_length_invalid' => esc_html__( 'Routing number is invalid (must be 9 digits)', 'woocommerce-
|
424 |
) );
|
425 |
}
|
426 |
|
@@ -490,7 +490,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
490 |
* @param $params array
|
491 |
* @return array
|
492 |
*/
|
493 |
-
$params = apply_filters( 'wc_gateway_' . $this->get_plugin()->get_id() . '_js_localize_script_params', $
|
494 |
|
495 |
$this->localize_script( $handle, $params );
|
496 |
}
|
@@ -589,7 +589,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
589 |
*/
|
590 |
protected function get_order_button_text() {
|
591 |
|
592 |
-
$text = $this->is_hosted_gateway() ? esc_html__( 'Continue', 'woocommerce-
|
593 |
|
594 |
/**
|
595 |
* Payment Gateway Place Order Button Text Filter.
|
@@ -621,7 +621,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
621 |
* @param int $order_id identifies the order
|
622 |
*/
|
623 |
public function payment_page( $order_id ) {
|
624 |
-
echo '<p>' . esc_html__( 'Thank you for your order.', 'woocommerce-
|
625 |
}
|
626 |
|
627 |
|
@@ -730,9 +730,9 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
730 |
|
731 |
// defaults for credit card and echeck, override for others
|
732 |
if ( $this->is_credit_card_gateway() ) {
|
733 |
-
return esc_html__( 'Credit Card', 'woocommerce-
|
734 |
} elseif ( $this->is_echeck_gateway() ) {
|
735 |
-
return esc_html__( 'eCheck', 'woocommerce-
|
736 |
}
|
737 |
|
738 |
return '';
|
@@ -750,9 +750,9 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
750 |
|
751 |
// defaults for credit card and echeck, override for others
|
752 |
if ( $this->is_credit_card_gateway() ) {
|
753 |
-
return esc_html__( 'Pay securely using your credit card.', 'woocommerce-
|
754 |
} elseif ( $this->is_echeck_gateway() ) {
|
755 |
-
return esc_html__( 'Pay securely using your checking account.', 'woocommerce-
|
756 |
}
|
757 |
|
758 |
return '';
|
@@ -771,23 +771,23 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
771 |
$this->form_fields = array(
|
772 |
|
773 |
'enabled' => array(
|
774 |
-
'title' => esc_html__( 'Enable / Disable', 'woocommerce-
|
775 |
-
'label' => esc_html__( 'Enable this gateway', 'woocommerce-
|
776 |
'type' => 'checkbox',
|
777 |
'default' => 'no',
|
778 |
),
|
779 |
|
780 |
'title' => array(
|
781 |
-
'title' => esc_html__( 'Title', 'woocommerce-
|
782 |
'type' => 'text',
|
783 |
-
'desc_tip' => esc_html__( 'Payment method title that the customer will see during checkout.', 'woocommerce-
|
784 |
'default' => $this->get_default_title(),
|
785 |
),
|
786 |
|
787 |
'description' => array(
|
788 |
-
'title' => esc_html__( 'Description', 'woocommerce-
|
789 |
'type' => 'textarea',
|
790 |
-
'desc_tip' => esc_html__( 'Payment method description that the customer will see during checkout.', 'woocommerce-
|
791 |
'default' => $this->get_default_description(),
|
792 |
),
|
793 |
|
@@ -816,26 +816,26 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
816 |
// add "detailed customer decline messages" option if the feature is supported
|
817 |
if ( $this->supports( self::FEATURE_DETAILED_CUSTOMER_DECLINE_MESSAGES ) ) {
|
818 |
$this->form_fields['enable_customer_decline_messages'] = array(
|
819 |
-
'title' => esc_html__( 'Detailed Decline Messages', 'woocommerce-
|
820 |
'type' => 'checkbox',
|
821 |
-
'label' => esc_html__( 'Check to enable detailed decline messages to the customer during checkout when possible, rather than a generic decline message.', 'woocommerce-
|
822 |
'default' => 'no',
|
823 |
);
|
824 |
}
|
825 |
|
826 |
// debug mode
|
827 |
$this->form_fields['debug_mode'] = array(
|
828 |
-
'title' => esc_html__( 'Debug Mode', 'woocommerce-
|
829 |
'type' => 'select',
|
830 |
/* translators: Placeholders: %1$s - <a> tag, %2$s - </a> tag */
|
831 |
-
'desc' => sprintf( esc_html__( 'Show Detailed Error Messages and API requests/responses on the checkout page and/or save them to the %1$sdebug log%2$s', 'woocommerce-
|
832 |
'default' => self::DEBUG_MODE_OFF,
|
833 |
'options' => array(
|
834 |
-
self::DEBUG_MODE_OFF => esc_html__( 'Off', 'woocommerce-
|
835 |
-
self::DEBUG_MODE_CHECKOUT => esc_html__( 'Show on Checkout Page', 'woocommerce-
|
836 |
-
self::DEBUG_MODE_LOG => esc_html__( 'Save to Log', 'woocommerce-
|
837 |
/* translators: show debugging information on both checkout page and in the log */
|
838 |
-
self::DEBUG_MODE_BOTH => esc_html__( 'Both', 'woocommerce-
|
839 |
),
|
840 |
);
|
841 |
|
@@ -895,10 +895,10 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
895 |
|
896 |
$form_fields['environment'] = array(
|
897 |
/* translators: environment as in a software environment (test/production) */
|
898 |
-
'title' => esc_html__( 'Environment', 'woocommerce-
|
899 |
'type' => 'select',
|
900 |
'default' => key( $this->get_environments() ), // default to first defined environment
|
901 |
-
'desc_tip' => esc_html__( 'Select the gateway environment to use for transactions.', 'woocommerce-
|
902 |
'options' => $this->get_environments(),
|
903 |
);
|
904 |
|
@@ -946,18 +946,18 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
946 |
}
|
947 |
|
948 |
$form_fields['connection_settings'] = array(
|
949 |
-
'title' => esc_html__( 'Connection Settings', 'woocommerce-
|
950 |
'type' => 'title',
|
951 |
);
|
952 |
|
953 |
// disable the field if the sibling gateway is already inheriting settings
|
954 |
$form_fields['inherit_settings'] = array(
|
955 |
-
'title' => esc_html__( 'Share connection settings', 'woocommerce-
|
956 |
'type' => 'checkbox',
|
957 |
-
'label' => esc_html__( 'Use connection/authentication settings from other gateway', 'woocommerce-
|
958 |
'default' => count( $configured_other_gateway_ids ) > 0 ? 'yes' : 'no',
|
959 |
'disabled' => count( $inherit_settings_other_gateway_ids ) > 0 ? true : false,
|
960 |
-
'description' => count( $inherit_settings_other_gateway_ids ) > 0 ? esc_html__( 'Disabled because the other gateway is using these settings', 'woocommerce-
|
961 |
);
|
962 |
|
963 |
return $form_fields;
|
@@ -974,8 +974,8 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
974 |
protected function add_csc_form_fields( $form_fields ) {
|
975 |
|
976 |
$form_fields['enable_csc'] = array(
|
977 |
-
'title' => esc_html__( 'Card Verification (CSC)', 'woocommerce-
|
978 |
-
'label' => esc_html__( 'Display the Card Security Code (CV2) field on checkout', 'woocommerce-
|
979 |
'type' => 'checkbox',
|
980 |
'default' => 'yes',
|
981 |
);
|
@@ -1115,8 +1115,13 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1115 |
}
|
1116 |
|
1117 |
// any required countries?
|
1118 |
-
if ( $this->countries && WC()->customer
|
1119 |
-
|
|
|
|
|
|
|
|
|
|
|
1120 |
}
|
1121 |
|
1122 |
/**
|
@@ -1275,7 +1280,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1275 |
$order->payment->type = str_replace( '-', '_', $this->get_payment_type() );
|
1276 |
|
1277 |
/* translators: Placeholders: %1$s - site title, %2$s - order number */
|
1278 |
-
$order->description = sprintf( esc_html__( '%1$s - Order %2$s', 'woocommerce-
|
1279 |
|
1280 |
$order = $this->get_order_with_unique_transaction_ref( $order );
|
1281 |
|
@@ -1315,14 +1320,14 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1315 |
|
1316 |
$message = sprintf(
|
1317 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - transaction amount. Definitions: Capture, as in capture funds from a credit card. */
|
1318 |
-
esc_html__( '%1$s Capture of %2$s Approved', 'woocommerce-
|
1319 |
$this->get_method_title(),
|
1320 |
get_woocommerce_currency_symbol() . wc_format_decimal( $order->capture_total )
|
1321 |
);
|
1322 |
|
1323 |
// adds the transaction id (if any) to the order note
|
1324 |
if ( $response->get_transaction_id() ) {
|
1325 |
-
$message .= ' ' . sprintf( esc_html__( '(Transaction ID %s)', 'woocommerce-
|
1326 |
}
|
1327 |
|
1328 |
$order->add_order_note( $message );
|
@@ -1343,7 +1348,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1343 |
|
1344 |
$message = sprintf(
|
1345 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - transaction amount, %3$s - transaction status message. Definitions: Capture, as in capture funds from a credit card. */
|
1346 |
-
esc_html__( '%1$s Capture Failed: %2$s - %3$s', 'woocommerce-
|
1347 |
$this->get_method_title(),
|
1348 |
$response->get_status_code(),
|
1349 |
$response->get_status_message()
|
@@ -1359,7 +1364,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1359 |
|
1360 |
$message = sprintf(
|
1361 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - failure message. Definitions: "capture" as in capturing funds from a credit card. */
|
1362 |
-
esc_html__( '%1$s Capture Failed: %2$s', 'woocommerce-
|
1363 |
$this->get_method_title(),
|
1364 |
$e->getMessage()
|
1365 |
);
|
@@ -1398,7 +1403,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1398 |
$order->capture = new \stdClass();
|
1399 |
$order->capture->amount = SV_WC_Helper::number_format( $order->get_total() );
|
1400 |
/* translators: Placeholders: %1$s - site title, %2$s - order number. Definitions: Capture as in capture funds from a credit card. */
|
1401 |
-
$order->capture->description = sprintf( esc_html__( '%1$s - Capture for Order %2$s', 'woocommerce-
|
1402 |
$order->capture->trans_id = $this->get_order_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), 'trans_id' );
|
1403 |
|
1404 |
// backwards compat for 4.1 and earlier
|
@@ -1562,7 +1567,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1562 |
$order->refund->amount = number_format( $amount, 2, '.', '' );
|
1563 |
|
1564 |
/* translators: Placeholders: %1$s - site title, %2$s - order number */
|
1565 |
-
$order->refund->reason = $reason ? $reason : sprintf( esc_html__( '%1$s - Refund for Order %2$s', 'woocommerce-
|
1566 |
|
1567 |
// almost all gateways require the original transaction ID, so include it by default
|
1568 |
$order->refund->trans_id = $this->get_order_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), 'trans_id' );
|
@@ -1625,14 +1630,14 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1625 |
|
1626 |
$message = sprintf(
|
1627 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - a monetary amount */
|
1628 |
-
esc_html__( '%1$s Refund in the amount of %2$s approved.', 'woocommerce-
|
1629 |
$this->get_method_title(),
|
1630 |
wc_price( $order->refund->amount, array( 'currency' => SV_WC_Order_Compatibility::get_prop( $order, 'currency', 'view' ) ) )
|
1631 |
);
|
1632 |
|
1633 |
// adds the transaction id (if any) to the order note
|
1634 |
if ( $response->get_transaction_id() ) {
|
1635 |
-
$message .= ' ' . sprintf( esc_html__( '(Transaction ID %s)', 'woocommerce-
|
1636 |
}
|
1637 |
|
1638 |
$order->add_order_note( $message );
|
@@ -1652,7 +1657,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1652 |
if ( $error_code ) {
|
1653 |
$message = sprintf(
|
1654 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - error code, %3$s - error message */
|
1655 |
-
esc_html__( '%1$s Refund Failed: %2$s - %3$s', 'woocommerce-
|
1656 |
$this->get_method_title(),
|
1657 |
$error_code,
|
1658 |
$error_message
|
@@ -1660,7 +1665,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1660 |
} else {
|
1661 |
$message = sprintf(
|
1662 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - error message */
|
1663 |
-
esc_html__( '%1$s Refund Failed: %2$s', 'woocommerce-
|
1664 |
$this->get_method_title(),
|
1665 |
$error_message
|
1666 |
);
|
@@ -1680,7 +1685,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1680 |
public function mark_order_as_refunded( $order ) {
|
1681 |
|
1682 |
/* translators: Placeholders: %s - payment gateway title (such as Authorize.net, Braintree, etc) */
|
1683 |
-
$order_note = sprintf( esc_html__( '%s Order completely refunded.', 'woocommerce-
|
1684 |
|
1685 |
// Mark order as refunded if not already set
|
1686 |
if ( ! $order->has_status( 'refunded' ) ) {
|
@@ -1733,7 +1738,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1733 |
|
1734 |
// partial voids are not supported
|
1735 |
if ( $order->refund->amount != $order->get_total() ) {
|
1736 |
-
return new \WP_Error( 'wc_' . $this->get_id() . '_void_error', esc_html__( 'Oops, you cannot partially void this order. Please use the full order amount.', 'woocommerce-
|
1737 |
}
|
1738 |
|
1739 |
try {
|
@@ -1817,7 +1822,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1817 |
if ( $error_code ) {
|
1818 |
$message = sprintf(
|
1819 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - error code, %3$s - error message. Void as in to void an order. */
|
1820 |
-
esc_html__( '%1$s Void Failed: %2$s - %3$s', 'woocommerce-
|
1821 |
$this->get_method_title(),
|
1822 |
$error_code,
|
1823 |
$error_message
|
@@ -1825,7 +1830,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1825 |
} else {
|
1826 |
$message = sprintf(
|
1827 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - error message. Void as in to void an order. */
|
1828 |
-
esc_html__( '%1$s Void Failed: %2$s', 'woocommerce-
|
1829 |
$this->get_method_title(),
|
1830 |
$error_message
|
1831 |
);
|
@@ -1846,14 +1851,14 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1846 |
|
1847 |
$message = sprintf(
|
1848 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - a monetary amount. Void as in to void an order. */
|
1849 |
-
esc_html__( '%1$s Void in the amount of %2$s approved.', 'woocommerce-
|
1850 |
$this->get_method_title(),
|
1851 |
wc_price( $order->refund->amount, array( 'currency' => SV_WC_Order_Compatibility::get_prop( $order, 'currency', 'view' ) ) )
|
1852 |
);
|
1853 |
|
1854 |
// adds the transaction id (if any) to the order note
|
1855 |
if ( $response->get_transaction_id() ) {
|
1856 |
-
$message .= ' ' . sprintf( esc_html__( '(Transaction ID %s)', 'woocommerce-
|
1857 |
}
|
1858 |
|
1859 |
// mark order as cancelled, since no money was actually transferred
|
@@ -1920,7 +1925,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1920 |
$this->update_order_meta( $order, 'retry_count', $retry_count );
|
1921 |
|
1922 |
// generate a unique transaction ref based on the order number and retry count, for gateways that require a unique identifier for every transaction request
|
1923 |
-
$order->unique_transaction_ref = ltrim( $order->get_order_number(), esc_html_x( '#', 'hash before order number', 'woocommerce-
|
1924 |
|
1925 |
return $order;
|
1926 |
}
|
@@ -1941,18 +1946,18 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
1941 |
// build the order note with what data we have
|
1942 |
if ( $response->get_status_code() && $response->get_status_message() ) {
|
1943 |
/* translators: Placeholders: %1$s - status code, %2$s - status message */
|
1944 |
-
$order_note = sprintf( esc_html__( 'Status code %1$s: %2$s', 'woocommerce-
|
1945 |
} elseif ( $response->get_status_code() ) {
|
1946 |
/* translators: Placeholders: %s - status code */
|
1947 |
-
$order_note = sprintf( esc_html__( 'Status code: %s', 'woocommerce-
|
1948 |
} elseif ( $response->get_status_message() ) {
|
1949 |
/* translators: Placeholders; %s - status message */
|
1950 |
-
$order_note = sprintf( esc_html__( 'Status message: %s', 'woocommerce-
|
1951 |
}
|
1952 |
|
1953 |
// add transaction id if there is one
|
1954 |
if ( $response->get_transaction_id() ) {
|
1955 |
-
$order_note .= ' ' . sprintf( esc_html__( 'Transaction ID %s', 'woocommerce-
|
1956 |
}
|
1957 |
|
1958 |
$this->mark_order_as_failed( $order, $order_note, $response );
|
@@ -2063,7 +2068,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
2063 |
public function mark_order_as_held( $order, $message, $response = null ) {
|
2064 |
|
2065 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - message (probably reason for the transaction being held for review) */
|
2066 |
-
$order_note = sprintf( esc_html__( '%1$s Transaction Held for Review (%2$s)', 'woocommerce-
|
2067 |
|
2068 |
/**
|
2069 |
* Held Order Status Filter.
|
@@ -2094,7 +2099,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
2094 |
}
|
2095 |
|
2096 |
if ( ! $user_message || ( $this->supports_credit_card_authorization() && $this->perform_credit_card_authorization( $order ) ) ) {
|
2097 |
-
$user_message = esc_html__( 'Your order has been received and is being reviewed. Thank you for your business.', 'woocommerce-
|
2098 |
}
|
2099 |
|
2100 |
if ( isset( WC()->session ) ) {
|
@@ -2139,7 +2144,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
2139 |
public function mark_order_as_failed( $order, $error_message, $response = null ) {
|
2140 |
|
2141 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - error message; e.g. Order Note: [Payment method] Payment failed [error] */
|
2142 |
-
$order_note = sprintf( esc_html__( '%1$s Payment Failed (%2$s)', 'woocommerce-
|
2143 |
|
2144 |
// Mark order as failed if not already set, otherwise, make sure we add the order note so we can detect when someone fails to check out multiple times
|
2145 |
if ( ! $order->has_status( 'failed' ) ) {
|
@@ -2156,7 +2161,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
2156 |
$user_message = $response->get_user_message();
|
2157 |
}
|
2158 |
if ( ! $user_message ) {
|
2159 |
-
$user_message = esc_html__( 'An error occurred, please try again or try an alternate form of payment.', 'woocommerce-
|
2160 |
}
|
2161 |
SV_WC_Helper::wc_add_notice( $user_message, 'error' );
|
2162 |
}
|
@@ -2173,7 +2178,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
2173 |
public function mark_order_as_cancelled( $order, $message, $response = null ) {
|
2174 |
|
2175 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - message/error */
|
2176 |
-
$order_note = sprintf( esc_html__( '%1$s Transaction Cancelled (%2$s)', 'woocommerce-
|
2177 |
|
2178 |
// Mark order as cancelled if not already set
|
2179 |
if ( ! $order->has_status( 'cancelled' ) ) {
|
@@ -2405,22 +2410,22 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
2405 |
assert( $this->supports_credit_card_authorization() && $this->supports_credit_card_charge() );
|
2406 |
|
2407 |
$form_fields['transaction_type'] = array(
|
2408 |
-
'title' => esc_html__( 'Transaction Type', 'woocommerce-
|
2409 |
'type' => 'select',
|
2410 |
-
'desc_tip' => esc_html__( 'Select how transactions should be processed. Charge submits all transactions for settlement, Authorization simply authorizes the order total for capture later.', 'woocommerce-
|
2411 |
'default' => self::TRANSACTION_TYPE_CHARGE,
|
2412 |
'options' => array(
|
2413 |
-
self::TRANSACTION_TYPE_CHARGE => esc_html_x( 'Charge', 'noun, credit card transaction type', 'woocommerce-
|
2414 |
-
self::TRANSACTION_TYPE_AUTHORIZATION => esc_html_x( 'Authorization', 'credit card transaction type', 'woocommerce-
|
2415 |
),
|
2416 |
);
|
2417 |
|
2418 |
if ( $this->supports_credit_card_charge_virtual() ) {
|
2419 |
|
2420 |
$form_fields['charge_virtual_orders'] = array(
|
2421 |
-
'label' => esc_html__( 'Charge Virtual-Only Orders', 'woocommerce-
|
2422 |
'type' => 'checkbox',
|
2423 |
-
'description' => esc_html__( 'If the order contains exclusively virtual items, enable this to immediately charge, rather than authorize, the transaction.', 'woocommerce-
|
2424 |
'default' => 'no',
|
2425 |
);
|
2426 |
}
|
@@ -2590,9 +2595,9 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
2590 |
assert( $this->supports_card_types() );
|
2591 |
|
2592 |
$form_fields['card_types'] = array(
|
2593 |
-
'title' => esc_html__( 'Accepted Card Types', 'woocommerce-
|
2594 |
'type' => 'multiselect',
|
2595 |
-
'desc_tip' => esc_html__( 'Select which card types you accept.', 'woocommerce-
|
2596 |
'default' => array_keys( $this->get_available_card_types() ),
|
2597 |
'class' => 'wc-enhanced-select',
|
2598 |
'css' => 'width: 350px;',
|
@@ -2617,12 +2622,12 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
2617 |
if ( ! isset( $this->available_card_types ) ) {
|
2618 |
|
2619 |
$this->available_card_types = array(
|
2620 |
-
'VISA' => esc_html_x( 'Visa', 'credit card type', 'woocommerce-
|
2621 |
-
'MC' => esc_html_x( 'MasterCard', 'credit card type', 'woocommerce-
|
2622 |
-
'AMEX' => esc_html_x( 'American Express', 'credit card type', 'woocommerce-
|
2623 |
-
'DISC' => esc_html_x( 'Discover', 'credit card type', 'woocommerce-
|
2624 |
-
'DINERS' => esc_html_x( 'Diners', 'credit card type', 'woocommerce-
|
2625 |
-
'JCB' => esc_html_x( 'JCB', 'credit card type', 'woocommerce-
|
2626 |
);
|
2627 |
|
2628 |
}
|
@@ -2680,8 +2685,8 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
2680 |
|
2681 |
$form_fields['tokenization'] = array(
|
2682 |
/* translators: http://www.cybersource.com/products/payment_security/payment_tokenization/ and https://en.wikipedia.org/wiki/Tokenization_(data_security) */
|
2683 |
-
'title' => esc_html__( 'Tokenization', 'woocommerce-
|
2684 |
-
'label' => esc_html__( 'Allow customers to securely save their payment details for future checkout.', 'woocommerce-
|
2685 |
'type' => 'checkbox',
|
2686 |
'default' => 'no',
|
2687 |
);
|
@@ -2869,7 +2874,13 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
2869 |
foreach ( $order->get_items() as $item ) {
|
2870 |
$product = $order->get_product_from_item( $item );
|
2871 |
|
2872 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
2873 |
return true;
|
2874 |
}
|
2875 |
}
|
@@ -3201,7 +3212,7 @@ abstract class SV_WC_Payment_Gateway extends \WC_Payment_Gateway {
|
|
3201 |
// default set of environments consists of 'production'
|
3202 |
if ( ! isset( $this->environments ) ) {
|
3203 |
/* translators: https://www.skyverge.com/for-translators-environments/ */
|
3204 |
-
$this->environments = array( self::ENVIRONMENT_PRODUCTION => esc_html_x( 'Production', 'software environment', 'woocommerce-
|
3205 |
}
|
3206 |
|
3207 |
return $this->environments;
|
402 |
* @return array
|
403 |
*/
|
404 |
return apply_filters( 'sv_wc_payment_gateway_payment_form_js_localized_script_params', array(
|
405 |
+
'card_number_missing' => esc_html__( 'Card number is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
406 |
+
'card_number_invalid' => esc_html__( 'Card number is invalid', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
407 |
+
'card_number_digits_invalid' => esc_html__( 'Card number is invalid (only digits allowed)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
408 |
+
'card_number_length_invalid' => esc_html__( 'Card number is invalid (wrong length)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
409 |
+
'cvv_missing' => esc_html__( 'Card security code is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
410 |
+
'cvv_digits_invalid' => esc_html__( 'Card security code is invalid (only digits are allowed)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
411 |
+
'cvv_length_invalid' => esc_html__( 'Card security code is invalid (must be 3 or 4 digits)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
412 |
+
'card_exp_date_invalid' => esc_html__( 'Card expiration date is invalid', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
413 |
+
'check_number_digits_invalid' => esc_html__( 'Check Number is invalid (only digits are allowed)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
414 |
+
'check_number_missing' => esc_html__( 'Check Number is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
415 |
+
'drivers_license_state_missing' => esc_html__( 'Drivers license state is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
416 |
+
'drivers_license_number_missing' => esc_html__( 'Drivers license number is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
417 |
+
'drivers_license_number_invalid' => esc_html__( 'Drivers license number is invalid', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
418 |
+
'account_number_missing' => esc_html__( 'Account Number is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
419 |
+
'account_number_invalid' => esc_html__( 'Account Number is invalid (only digits are allowed)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
420 |
+
'account_number_length_invalid' => esc_html__( 'Account number is invalid (must be between 5 and 17 digits)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
421 |
+
'routing_number_missing' => esc_html__( 'Routing Number is missing', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
422 |
+
'routing_number_digits_invalid' => esc_html__( 'Routing Number is invalid (only digits are allowed)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
423 |
+
'routing_number_length_invalid' => esc_html__( 'Routing number is invalid (must be 9 digits)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
424 |
) );
|
425 |
}
|
426 |
|
490 |
* @param $params array
|
491 |
* @return array
|
492 |
*/
|
493 |
+
$params = apply_filters( 'wc_gateway_' . $this->get_plugin()->get_id() . '_js_localize_script_params', $params );
|
494 |
|
495 |
$this->localize_script( $handle, $params );
|
496 |
}
|
589 |
*/
|
590 |
protected function get_order_button_text() {
|
591 |
|
592 |
+
$text = $this->is_hosted_gateway() ? esc_html__( 'Continue', 'woocommerce-gateway-paypal-powered-by-braintree' ) : '';
|
593 |
|
594 |
/**
|
595 |
* Payment Gateway Place Order Button Text Filter.
|
621 |
* @param int $order_id identifies the order
|
622 |
*/
|
623 |
public function payment_page( $order_id ) {
|
624 |
+
echo '<p>' . esc_html__( 'Thank you for your order.', 'woocommerce-gateway-paypal-powered-by-braintree' ) . '</p>';
|
625 |
}
|
626 |
|
627 |
|
730 |
|
731 |
// defaults for credit card and echeck, override for others
|
732 |
if ( $this->is_credit_card_gateway() ) {
|
733 |
+
return esc_html__( 'Credit Card', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
734 |
} elseif ( $this->is_echeck_gateway() ) {
|
735 |
+
return esc_html__( 'eCheck', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
736 |
}
|
737 |
|
738 |
return '';
|
750 |
|
751 |
// defaults for credit card and echeck, override for others
|
752 |
if ( $this->is_credit_card_gateway() ) {
|
753 |
+
return esc_html__( 'Pay securely using your credit card.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
754 |
} elseif ( $this->is_echeck_gateway() ) {
|
755 |
+
return esc_html__( 'Pay securely using your checking account.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
756 |
}
|
757 |
|
758 |
return '';
|
771 |
$this->form_fields = array(
|
772 |
|
773 |
'enabled' => array(
|
774 |
+
'title' => esc_html__( 'Enable / Disable', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
775 |
+
'label' => esc_html__( 'Enable this gateway', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
776 |
'type' => 'checkbox',
|
777 |
'default' => 'no',
|
778 |
),
|
779 |
|
780 |
'title' => array(
|
781 |
+
'title' => esc_html__( 'Title', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
782 |
'type' => 'text',
|
783 |
+
'desc_tip' => esc_html__( 'Payment method title that the customer will see during checkout.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
784 |
'default' => $this->get_default_title(),
|
785 |
),
|
786 |
|
787 |
'description' => array(
|
788 |
+
'title' => esc_html__( 'Description', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
789 |
'type' => 'textarea',
|
790 |
+
'desc_tip' => esc_html__( 'Payment method description that the customer will see during checkout.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
791 |
'default' => $this->get_default_description(),
|
792 |
),
|
793 |
|
816 |
// add "detailed customer decline messages" option if the feature is supported
|
817 |
if ( $this->supports( self::FEATURE_DETAILED_CUSTOMER_DECLINE_MESSAGES ) ) {
|
818 |
$this->form_fields['enable_customer_decline_messages'] = array(
|
819 |
+
'title' => esc_html__( 'Detailed Decline Messages', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
820 |
'type' => 'checkbox',
|
821 |
+
'label' => esc_html__( 'Check to enable detailed decline messages to the customer during checkout when possible, rather than a generic decline message.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
822 |
'default' => 'no',
|
823 |
);
|
824 |
}
|
825 |
|
826 |
// debug mode
|
827 |
$this->form_fields['debug_mode'] = array(
|
828 |
+
'title' => esc_html__( 'Debug Mode', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
829 |
'type' => 'select',
|
830 |
/* translators: Placeholders: %1$s - <a> tag, %2$s - </a> tag */
|
831 |
+
'desc' => sprintf( esc_html__( 'Show Detailed Error Messages and API requests/responses on the checkout page and/or save them to the %1$sdebug log%2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), '<a href="' . SV_WC_Helper::get_wc_log_file_url( $this->get_id() ) . '">', '</a>' ),
|
832 |
'default' => self::DEBUG_MODE_OFF,
|
833 |
'options' => array(
|
834 |
+
self::DEBUG_MODE_OFF => esc_html__( 'Off', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
835 |
+
self::DEBUG_MODE_CHECKOUT => esc_html__( 'Show on Checkout Page', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
836 |
+
self::DEBUG_MODE_LOG => esc_html__( 'Save to Log', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
837 |
/* translators: show debugging information on both checkout page and in the log */
|
838 |
+
self::DEBUG_MODE_BOTH => esc_html__( 'Both', 'woocommerce-gateway-paypal-powered-by-braintree' )
|
839 |
),
|
840 |
);
|
841 |
|
895 |
|
896 |
$form_fields['environment'] = array(
|
897 |
/* translators: environment as in a software environment (test/production) */
|
898 |
+
'title' => esc_html__( 'Environment', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
899 |
'type' => 'select',
|
900 |
'default' => key( $this->get_environments() ), // default to first defined environment
|
901 |
+
'desc_tip' => esc_html__( 'Select the gateway environment to use for transactions.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
902 |
'options' => $this->get_environments(),
|
903 |
);
|
904 |
|
946 |
}
|
947 |
|
948 |
$form_fields['connection_settings'] = array(
|
949 |
+
'title' => esc_html__( 'Connection Settings', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
950 |
'type' => 'title',
|
951 |
);
|
952 |
|
953 |
// disable the field if the sibling gateway is already inheriting settings
|
954 |
$form_fields['inherit_settings'] = array(
|
955 |
+
'title' => esc_html__( 'Share connection settings', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
956 |
'type' => 'checkbox',
|
957 |
+
'label' => esc_html__( 'Use connection/authentication settings from other gateway', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
958 |
'default' => count( $configured_other_gateway_ids ) > 0 ? 'yes' : 'no',
|
959 |
'disabled' => count( $inherit_settings_other_gateway_ids ) > 0 ? true : false,
|
960 |
+
'description' => count( $inherit_settings_other_gateway_ids ) > 0 ? esc_html__( 'Disabled because the other gateway is using these settings', 'woocommerce-gateway-paypal-powered-by-braintree' ) : '',
|
961 |
);
|
962 |
|
963 |
return $form_fields;
|
974 |
protected function add_csc_form_fields( $form_fields ) {
|
975 |
|
976 |
$form_fields['enable_csc'] = array(
|
977 |
+
'title' => esc_html__( 'Card Verification (CSC)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
978 |
+
'label' => esc_html__( 'Display the Card Security Code (CV2) field on checkout', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
979 |
'type' => 'checkbox',
|
980 |
'default' => 'yes',
|
981 |
);
|
1115 |
}
|
1116 |
|
1117 |
// any required countries?
|
1118 |
+
if ( $this->countries && WC()->customer ) {
|
1119 |
+
|
1120 |
+
$customer_country = ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) ? WC()->customer->get_billing_country() : WC()->customer->get_country();
|
1121 |
+
|
1122 |
+
if ( $customer_country && ! in_array( $customer_country, $this->countries, true ) ) {
|
1123 |
+
$is_available = false;
|
1124 |
+
}
|
1125 |
}
|
1126 |
|
1127 |
/**
|
1280 |
$order->payment->type = str_replace( '-', '_', $this->get_payment_type() );
|
1281 |
|
1282 |
/* translators: Placeholders: %1$s - site title, %2$s - order number */
|
1283 |
+
$order->description = sprintf( esc_html__( '%1$s - Order %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), wp_specialchars_decode( SV_WC_Helper::get_site_name(), ENT_QUOTES ), $order->get_order_number() );
|
1284 |
|
1285 |
$order = $this->get_order_with_unique_transaction_ref( $order );
|
1286 |
|
1320 |
|
1321 |
$message = sprintf(
|
1322 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - transaction amount. Definitions: Capture, as in capture funds from a credit card. */
|
1323 |
+
esc_html__( '%1$s Capture of %2$s Approved', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1324 |
$this->get_method_title(),
|
1325 |
get_woocommerce_currency_symbol() . wc_format_decimal( $order->capture_total )
|
1326 |
);
|
1327 |
|
1328 |
// adds the transaction id (if any) to the order note
|
1329 |
if ( $response->get_transaction_id() ) {
|
1330 |
+
$message .= ' ' . sprintf( esc_html__( '(Transaction ID %s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_transaction_id() );
|
1331 |
}
|
1332 |
|
1333 |
$order->add_order_note( $message );
|
1348 |
|
1349 |
$message = sprintf(
|
1350 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - transaction amount, %3$s - transaction status message. Definitions: Capture, as in capture funds from a credit card. */
|
1351 |
+
esc_html__( '%1$s Capture Failed: %2$s - %3$s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1352 |
$this->get_method_title(),
|
1353 |
$response->get_status_code(),
|
1354 |
$response->get_status_message()
|
1364 |
|
1365 |
$message = sprintf(
|
1366 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - failure message. Definitions: "capture" as in capturing funds from a credit card. */
|
1367 |
+
esc_html__( '%1$s Capture Failed: %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1368 |
$this->get_method_title(),
|
1369 |
$e->getMessage()
|
1370 |
);
|
1403 |
$order->capture = new \stdClass();
|
1404 |
$order->capture->amount = SV_WC_Helper::number_format( $order->get_total() );
|
1405 |
/* translators: Placeholders: %1$s - site title, %2$s - order number. Definitions: Capture as in capture funds from a credit card. */
|
1406 |
+
$order->capture->description = sprintf( esc_html__( '%1$s - Capture for Order %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), wp_specialchars_decode( SV_WC_Helper::get_site_name() ), $order->get_order_number() );
|
1407 |
$order->capture->trans_id = $this->get_order_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), 'trans_id' );
|
1408 |
|
1409 |
// backwards compat for 4.1 and earlier
|
1567 |
$order->refund->amount = number_format( $amount, 2, '.', '' );
|
1568 |
|
1569 |
/* translators: Placeholders: %1$s - site title, %2$s - order number */
|
1570 |
+
$order->refund->reason = $reason ? $reason : sprintf( esc_html__( '%1$s - Refund for Order %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), esc_html( SV_WC_Helper::get_site_name() ), $order->get_order_number() );
|
1571 |
|
1572 |
// almost all gateways require the original transaction ID, so include it by default
|
1573 |
$order->refund->trans_id = $this->get_order_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), 'trans_id' );
|
1630 |
|
1631 |
$message = sprintf(
|
1632 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - a monetary amount */
|
1633 |
+
esc_html__( '%1$s Refund in the amount of %2$s approved.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1634 |
$this->get_method_title(),
|
1635 |
wc_price( $order->refund->amount, array( 'currency' => SV_WC_Order_Compatibility::get_prop( $order, 'currency', 'view' ) ) )
|
1636 |
);
|
1637 |
|
1638 |
// adds the transaction id (if any) to the order note
|
1639 |
if ( $response->get_transaction_id() ) {
|
1640 |
+
$message .= ' ' . sprintf( esc_html__( '(Transaction ID %s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_transaction_id() );
|
1641 |
}
|
1642 |
|
1643 |
$order->add_order_note( $message );
|
1657 |
if ( $error_code ) {
|
1658 |
$message = sprintf(
|
1659 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - error code, %3$s - error message */
|
1660 |
+
esc_html__( '%1$s Refund Failed: %2$s - %3$s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1661 |
$this->get_method_title(),
|
1662 |
$error_code,
|
1663 |
$error_message
|
1665 |
} else {
|
1666 |
$message = sprintf(
|
1667 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - error message */
|
1668 |
+
esc_html__( '%1$s Refund Failed: %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1669 |
$this->get_method_title(),
|
1670 |
$error_message
|
1671 |
);
|
1685 |
public function mark_order_as_refunded( $order ) {
|
1686 |
|
1687 |
/* translators: Placeholders: %s - payment gateway title (such as Authorize.net, Braintree, etc) */
|
1688 |
+
$order_note = sprintf( esc_html__( '%s Order completely refunded.', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_method_title() );
|
1689 |
|
1690 |
// Mark order as refunded if not already set
|
1691 |
if ( ! $order->has_status( 'refunded' ) ) {
|
1738 |
|
1739 |
// partial voids are not supported
|
1740 |
if ( $order->refund->amount != $order->get_total() ) {
|
1741 |
+
return new \WP_Error( 'wc_' . $this->get_id() . '_void_error', esc_html__( 'Oops, you cannot partially void this order. Please use the full order amount.', 'woocommerce-gateway-paypal-powered-by-braintree' ), 500 );
|
1742 |
}
|
1743 |
|
1744 |
try {
|
1822 |
if ( $error_code ) {
|
1823 |
$message = sprintf(
|
1824 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - error code, %3$s - error message. Void as in to void an order. */
|
1825 |
+
esc_html__( '%1$s Void Failed: %2$s - %3$s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1826 |
$this->get_method_title(),
|
1827 |
$error_code,
|
1828 |
$error_message
|
1830 |
} else {
|
1831 |
$message = sprintf(
|
1832 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - error message. Void as in to void an order. */
|
1833 |
+
esc_html__( '%1$s Void Failed: %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1834 |
$this->get_method_title(),
|
1835 |
$error_message
|
1836 |
);
|
1851 |
|
1852 |
$message = sprintf(
|
1853 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - a monetary amount. Void as in to void an order. */
|
1854 |
+
esc_html__( '%1$s Void in the amount of %2$s approved.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
1855 |
$this->get_method_title(),
|
1856 |
wc_price( $order->refund->amount, array( 'currency' => SV_WC_Order_Compatibility::get_prop( $order, 'currency', 'view' ) ) )
|
1857 |
);
|
1858 |
|
1859 |
// adds the transaction id (if any) to the order note
|
1860 |
if ( $response->get_transaction_id() ) {
|
1861 |
+
$message .= ' ' . sprintf( esc_html__( '(Transaction ID %s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_transaction_id() );
|
1862 |
}
|
1863 |
|
1864 |
// mark order as cancelled, since no money was actually transferred
|
1925 |
$this->update_order_meta( $order, 'retry_count', $retry_count );
|
1926 |
|
1927 |
// generate a unique transaction ref based on the order number and retry count, for gateways that require a unique identifier for every transaction request
|
1928 |
+
$order->unique_transaction_ref = ltrim( $order->get_order_number(), esc_html_x( '#', 'hash before order number', 'woocommerce-gateway-paypal-powered-by-braintree' ) ) . ( $retry_count > 0 ? '-' . $retry_count : '' );
|
1929 |
|
1930 |
return $order;
|
1931 |
}
|
1946 |
// build the order note with what data we have
|
1947 |
if ( $response->get_status_code() && $response->get_status_message() ) {
|
1948 |
/* translators: Placeholders: %1$s - status code, %2$s - status message */
|
1949 |
+
$order_note = sprintf( esc_html__( 'Status code %1$s: %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_status_code(), $response->get_status_message() );
|
1950 |
} elseif ( $response->get_status_code() ) {
|
1951 |
/* translators: Placeholders: %s - status code */
|
1952 |
+
$order_note = sprintf( esc_html__( 'Status code: %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_status_code() );
|
1953 |
} elseif ( $response->get_status_message() ) {
|
1954 |
/* translators: Placeholders; %s - status message */
|
1955 |
+
$order_note = sprintf( esc_html__( 'Status message: %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_status_message() );
|
1956 |
}
|
1957 |
|
1958 |
// add transaction id if there is one
|
1959 |
if ( $response->get_transaction_id() ) {
|
1960 |
+
$order_note .= ' ' . sprintf( esc_html__( 'Transaction ID %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_transaction_id() );
|
1961 |
}
|
1962 |
|
1963 |
$this->mark_order_as_failed( $order, $order_note, $response );
|
2068 |
public function mark_order_as_held( $order, $message, $response = null ) {
|
2069 |
|
2070 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - message (probably reason for the transaction being held for review) */
|
2071 |
+
$order_note = sprintf( esc_html__( '%1$s Transaction Held for Review (%2$s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_method_title(), $message );
|
2072 |
|
2073 |
/**
|
2074 |
* Held Order Status Filter.
|
2099 |
}
|
2100 |
|
2101 |
if ( ! $user_message || ( $this->supports_credit_card_authorization() && $this->perform_credit_card_authorization( $order ) ) ) {
|
2102 |
+
$user_message = esc_html__( 'Your order has been received and is being reviewed. Thank you for your business.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
2103 |
}
|
2104 |
|
2105 |
if ( isset( WC()->session ) ) {
|
2144 |
public function mark_order_as_failed( $order, $error_message, $response = null ) {
|
2145 |
|
2146 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - error message; e.g. Order Note: [Payment method] Payment failed [error] */
|
2147 |
+
$order_note = sprintf( esc_html__( '%1$s Payment Failed (%2$s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_method_title(), $error_message );
|
2148 |
|
2149 |
// Mark order as failed if not already set, otherwise, make sure we add the order note so we can detect when someone fails to check out multiple times
|
2150 |
if ( ! $order->has_status( 'failed' ) ) {
|
2161 |
$user_message = $response->get_user_message();
|
2162 |
}
|
2163 |
if ( ! $user_message ) {
|
2164 |
+
$user_message = esc_html__( 'An error occurred, please try again or try an alternate form of payment.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
2165 |
}
|
2166 |
SV_WC_Helper::wc_add_notice( $user_message, 'error' );
|
2167 |
}
|
2178 |
public function mark_order_as_cancelled( $order, $message, $response = null ) {
|
2179 |
|
2180 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - message/error */
|
2181 |
+
$order_note = sprintf( esc_html__( '%1$s Transaction Cancelled (%2$s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_method_title(), $message );
|
2182 |
|
2183 |
// Mark order as cancelled if not already set
|
2184 |
if ( ! $order->has_status( 'cancelled' ) ) {
|
2410 |
assert( $this->supports_credit_card_authorization() && $this->supports_credit_card_charge() );
|
2411 |
|
2412 |
$form_fields['transaction_type'] = array(
|
2413 |
+
'title' => esc_html__( 'Transaction Type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2414 |
'type' => 'select',
|
2415 |
+
'desc_tip' => esc_html__( 'Select how transactions should be processed. Charge submits all transactions for settlement, Authorization simply authorizes the order total for capture later.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2416 |
'default' => self::TRANSACTION_TYPE_CHARGE,
|
2417 |
'options' => array(
|
2418 |
+
self::TRANSACTION_TYPE_CHARGE => esc_html_x( 'Charge', 'noun, credit card transaction type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2419 |
+
self::TRANSACTION_TYPE_AUTHORIZATION => esc_html_x( 'Authorization', 'credit card transaction type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2420 |
),
|
2421 |
);
|
2422 |
|
2423 |
if ( $this->supports_credit_card_charge_virtual() ) {
|
2424 |
|
2425 |
$form_fields['charge_virtual_orders'] = array(
|
2426 |
+
'label' => esc_html__( 'Charge Virtual-Only Orders', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2427 |
'type' => 'checkbox',
|
2428 |
+
'description' => esc_html__( 'If the order contains exclusively virtual items, enable this to immediately charge, rather than authorize, the transaction.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2429 |
'default' => 'no',
|
2430 |
);
|
2431 |
}
|
2595 |
assert( $this->supports_card_types() );
|
2596 |
|
2597 |
$form_fields['card_types'] = array(
|
2598 |
+
'title' => esc_html__( 'Accepted Card Types', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2599 |
'type' => 'multiselect',
|
2600 |
+
'desc_tip' => esc_html__( 'Select which card types you accept.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2601 |
'default' => array_keys( $this->get_available_card_types() ),
|
2602 |
'class' => 'wc-enhanced-select',
|
2603 |
'css' => 'width: 350px;',
|
2622 |
if ( ! isset( $this->available_card_types ) ) {
|
2623 |
|
2624 |
$this->available_card_types = array(
|
2625 |
+
'VISA' => esc_html_x( 'Visa', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2626 |
+
'MC' => esc_html_x( 'MasterCard', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2627 |
+
'AMEX' => esc_html_x( 'American Express', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2628 |
+
'DISC' => esc_html_x( 'Discover', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2629 |
+
'DINERS' => esc_html_x( 'Diners', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2630 |
+
'JCB' => esc_html_x( 'JCB', 'credit card type', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2631 |
);
|
2632 |
|
2633 |
}
|
2685 |
|
2686 |
$form_fields['tokenization'] = array(
|
2687 |
/* translators: http://www.cybersource.com/products/payment_security/payment_tokenization/ and https://en.wikipedia.org/wiki/Tokenization_(data_security) */
|
2688 |
+
'title' => esc_html__( 'Tokenization', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2689 |
+
'label' => esc_html__( 'Allow customers to securely save their payment details for future checkout.', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
2690 |
'type' => 'checkbox',
|
2691 |
'default' => 'no',
|
2692 |
);
|
2874 |
foreach ( $order->get_items() as $item ) {
|
2875 |
$product = $order->get_product_from_item( $item );
|
2876 |
|
2877 |
+
if ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {
|
2878 |
+
$product = $item->get_product();
|
2879 |
+
} else {
|
2880 |
+
$product = $order->get_product_from_item( $item );
|
2881 |
+
}
|
2882 |
+
|
2883 |
+
if ( $product && $product->needs_shipping() ) {
|
2884 |
return true;
|
2885 |
}
|
2886 |
}
|
3212 |
// default set of environments consists of 'production'
|
3213 |
if ( ! isset( $this->environments ) ) {
|
3214 |
/* translators: https://www.skyverge.com/for-translators-environments/ */
|
3215 |
+
$this->environments = array( self::ENVIRONMENT_PRODUCTION => esc_html_x( 'Production', 'software environment', 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
3216 |
}
|
3217 |
|
3218 |
return $this->environments;
|
lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-pre-orders.php
CHANGED
@@ -239,7 +239,7 @@ class SV_WC_Payment_Gateway_Integration_Pre_Orders extends SV_WC_Payment_Gateway
|
|
239 |
|
240 |
} catch( SV_WC_Payment_Gateway_Exception $e ) {
|
241 |
|
242 |
-
$this->get_gateway()->mark_order_as_failed( $order, sprintf( __( 'Pre-Order Tokenization attempt failed (%s)', 'woocommerce-
|
243 |
|
244 |
$result = array(
|
245 |
'result' => 'failure',
|
@@ -266,11 +266,11 @@ class SV_WC_Payment_Gateway_Integration_Pre_Orders extends SV_WC_Payment_Gateway
|
|
266 |
$order = $this->get_gateway()->get_order( SV_WC_Order_Compatibility::get_prop( $order, 'id' ) );
|
267 |
|
268 |
// order description
|
269 |
-
$order->description = sprintf( __( '%s - Pre-Order Release Payment for Order %s', 'woocommerce-
|
270 |
|
271 |
// token is required
|
272 |
if ( ! $order->payment->token ) {
|
273 |
-
throw new SV_WC_Payment_Gateway_Exception( __( 'Payment token missing/invalid.', 'woocommerce-
|
274 |
}
|
275 |
|
276 |
// perform the transaction
|
@@ -295,7 +295,7 @@ class SV_WC_Payment_Gateway_Integration_Pre_Orders extends SV_WC_Payment_Gateway
|
|
295 |
if ( $this->get_gateway()->is_credit_card_gateway() ) {
|
296 |
|
297 |
$message = sprintf(
|
298 |
-
__( '%s %s Pre-Order Release Payment Approved: %s ending in %s (expires %s)', 'woocommerce-
|
299 |
$this->get_gateway()->get_method_title(),
|
300 |
$this->get_gateway()->perform_credit_card_authorization( $order ) ? 'Authorization' : 'Charge',
|
301 |
SV_WC_Payment_Gateway_Helper::payment_type_to_name( ( ! empty( $order->payment->card_type ) ? $order->payment->card_type : 'card' ) ),
|
@@ -306,16 +306,16 @@ class SV_WC_Payment_Gateway_Integration_Pre_Orders extends SV_WC_Payment_Gateway
|
|
306 |
} elseif ( $this->get_gateway()->is_echeck_gateway() ) {
|
307 |
|
308 |
// account type (checking/savings) may or may not be available, which is fine
|
309 |
-
$message = sprintf( __( '%s eCheck Pre-Order Release Payment Approved: %s ending in %s', 'woocommerce-
|
310 |
|
311 |
} else {
|
312 |
|
313 |
-
$message = sprintf( __( '%s Pre-Order Release Payment Approved', 'woocommerce-
|
314 |
}
|
315 |
|
316 |
// adds the transaction id (if any) to the order note
|
317 |
if ( $response->get_transaction_id() ) {
|
318 |
-
$message .= ' ' . sprintf( __( '(Transaction ID %s)', 'woocommerce-
|
319 |
}
|
320 |
|
321 |
$order->add_order_note( $message );
|
@@ -332,7 +332,7 @@ class SV_WC_Payment_Gateway_Integration_Pre_Orders extends SV_WC_Payment_Gateway
|
|
332 |
// if the transaction was held (ie fraud validation failure) mark it as such
|
333 |
if ( $response->transaction_held() || ( $this->get_gateway()->supports( SV_WC_Payment_Gateway::FEATURE_CREDIT_CARD_AUTHORIZATION ) && $this->get_gateway()->perform_credit_card_authorization( $order ) ) ) {
|
334 |
|
335 |
-
$this->get_gateway()->mark_order_as_held( $order, $this->get_gateway()->supports( SV_WC_Payment_Gateway::FEATURE_CREDIT_CARD_AUTHORIZATION ) && $this->get_gateway()->perform_credit_card_authorization( $order ) ? __( 'Authorization only transaction', 'woocommerce-
|
336 |
|
337 |
SV_WC_Order_Compatibility::reduce_stock_levels( $order ); // reduce stock for held orders, but don't complete payment
|
338 |
|
@@ -351,7 +351,7 @@ class SV_WC_Payment_Gateway_Integration_Pre_Orders extends SV_WC_Payment_Gateway
|
|
351 |
} catch ( SV_WC_Plugin_Exception $e ) {
|
352 |
|
353 |
// Mark order as failed
|
354 |
-
$this->get_gateway()->mark_order_as_failed( $order, sprintf( __( 'Pre-Order Release Payment Failed: %s', 'woocommerce-
|
355 |
|
356 |
}
|
357 |
}
|
239 |
|
240 |
} catch( SV_WC_Payment_Gateway_Exception $e ) {
|
241 |
|
242 |
+
$this->get_gateway()->mark_order_as_failed( $order, sprintf( __( 'Pre-Order Tokenization attempt failed (%s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_gateway()->get_method_title(), $e->getMessage() ) );
|
243 |
|
244 |
$result = array(
|
245 |
'result' => 'failure',
|
266 |
$order = $this->get_gateway()->get_order( SV_WC_Order_Compatibility::get_prop( $order, 'id' ) );
|
267 |
|
268 |
// order description
|
269 |
+
$order->description = sprintf( __( '%s - Pre-Order Release Payment for Order %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), esc_html( SV_WC_Helper::get_site_name() ), $order->get_order_number() );
|
270 |
|
271 |
// token is required
|
272 |
if ( ! $order->payment->token ) {
|
273 |
+
throw new SV_WC_Payment_Gateway_Exception( __( 'Payment token missing/invalid.', 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
274 |
}
|
275 |
|
276 |
// perform the transaction
|
295 |
if ( $this->get_gateway()->is_credit_card_gateway() ) {
|
296 |
|
297 |
$message = sprintf(
|
298 |
+
__( '%s %s Pre-Order Release Payment Approved: %s ending in %s (expires %s)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
299 |
$this->get_gateway()->get_method_title(),
|
300 |
$this->get_gateway()->perform_credit_card_authorization( $order ) ? 'Authorization' : 'Charge',
|
301 |
SV_WC_Payment_Gateway_Helper::payment_type_to_name( ( ! empty( $order->payment->card_type ) ? $order->payment->card_type : 'card' ) ),
|
306 |
} elseif ( $this->get_gateway()->is_echeck_gateway() ) {
|
307 |
|
308 |
// account type (checking/savings) may or may not be available, which is fine
|
309 |
+
$message = sprintf( __( '%s eCheck Pre-Order Release Payment Approved: %s ending in %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_gateway()->get_method_title(), SV_WC_Payment_Gateway_Helper::payment_type_to_name( ( ! empty( $order->payment->account_type ) ? $order->payment->account_type : 'bank' ) ), $last_four );
|
310 |
|
311 |
} else {
|
312 |
|
313 |
+
$message = sprintf( __( '%s Pre-Order Release Payment Approved', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_gateway()->get_method_title() );
|
314 |
}
|
315 |
|
316 |
// adds the transaction id (if any) to the order note
|
317 |
if ( $response->get_transaction_id() ) {
|
318 |
+
$message .= ' ' . sprintf( __( '(Transaction ID %s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_transaction_id() );
|
319 |
}
|
320 |
|
321 |
$order->add_order_note( $message );
|
332 |
// if the transaction was held (ie fraud validation failure) mark it as such
|
333 |
if ( $response->transaction_held() || ( $this->get_gateway()->supports( SV_WC_Payment_Gateway::FEATURE_CREDIT_CARD_AUTHORIZATION ) && $this->get_gateway()->perform_credit_card_authorization( $order ) ) ) {
|
334 |
|
335 |
+
$this->get_gateway()->mark_order_as_held( $order, $this->get_gateway()->supports( SV_WC_Payment_Gateway::FEATURE_CREDIT_CARD_AUTHORIZATION ) && $this->get_gateway()->perform_credit_card_authorization( $order ) ? __( 'Authorization only transaction', 'woocommerce-gateway-paypal-powered-by-braintree' ) : $response->get_status_message(), $response );
|
336 |
|
337 |
SV_WC_Order_Compatibility::reduce_stock_levels( $order ); // reduce stock for held orders, but don't complete payment
|
338 |
|
351 |
} catch ( SV_WC_Plugin_Exception $e ) {
|
352 |
|
353 |
// Mark order as failed
|
354 |
+
$this->get_gateway()->mark_order_as_failed( $order, sprintf( __( 'Pre-Order Release Payment Failed: %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $e->getMessage() ) );
|
355 |
|
356 |
}
|
357 |
}
|
lib/skyverge/woocommerce/payment-gateway/integrations/class-sv-wc-payment-gateway-integration-subscriptions.php
CHANGED
@@ -218,7 +218,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
218 |
// payment token must be present and valid
|
219 |
if ( empty( $token ) || ! $this->get_gateway()->get_payment_tokens_handler()->user_has_token( $order->get_user_id(), $token ) ) {
|
220 |
|
221 |
-
$this->get_gateway()->mark_order_as_failed( $order, __( 'Subscription Renewal: payment token is missing/invalid.', 'woocommerce-
|
222 |
|
223 |
return;
|
224 |
}
|
@@ -244,7 +244,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
244 |
*/
|
245 |
public function get_order( $order ) {
|
246 |
|
247 |
-
$order->description = sprintf( esc_html__( '%1$s - Subscription Renewal Order %2$s', 'woocommerce-
|
248 |
|
249 |
// override the payment total with the amount to charge given by Subscriptions
|
250 |
$order->payment_total = $this->renewal_payment_total;
|
@@ -376,12 +376,12 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
376 |
} catch( SV_WC_Payment_Gateway_Exception $e ) {
|
377 |
|
378 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - error message; e.g. Order Note: [Payment method] Payment Change failed [error] */
|
379 |
-
$note = sprintf( __( '%1$s Payment Change Failed (%2$s)', 'woocommerce-
|
380 |
|
381 |
// add a subscription note to keep track of failures
|
382 |
$subscription->add_order_note( $note );
|
383 |
|
384 |
-
SV_WC_Helper::wc_add_notice( __( 'An error occurred, please try again or try an alternate form of payment.', 'woocommerce-
|
385 |
|
386 |
// this isn't used by Subscriptions, but return a failure result anyway
|
387 |
$result = array(
|
@@ -507,7 +507,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
507 |
$token = $this->get_gateway()->get_payment_tokens_handler()->get_token( $subscription->get_user_id(), $this->get_gateway()->get_order_meta( SV_WC_Order_Compatibility::get_prop( $subscription, 'id' ), 'payment_token' ) );
|
508 |
|
509 |
if ( $token instanceof SV_WC_Payment_Gateway_Payment_Token ) {
|
510 |
-
$payment_method_to_display = sprintf( __( 'Via %s ending in %s', 'woocommerce-
|
511 |
}
|
512 |
|
513 |
return $payment_method_to_display;
|
@@ -534,7 +534,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
534 |
|
535 |
// Add the header before the actions
|
536 |
if ( 'actions' === $id ) {
|
537 |
-
$new_headers['subscriptions'] = __( 'Subscriptions', 'woocommerce-
|
538 |
}
|
539 |
|
540 |
$new_headers[ $id ] = $label;
|
@@ -564,7 +564,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
564 |
|
565 |
// Build a link for each subscription
|
566 |
foreach ( $this->get_payment_token_subscriptions( get_current_user_id(), $token ) as $subscription ) {
|
567 |
-
$subscription_ids[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $subscription->get_view_order_url() ), esc_attr( sprintf( _x( '#%s', 'hash before order number', 'woocommerce-
|
568 |
}
|
569 |
|
570 |
if ( ! empty( $subscription_ids ) ) {
|
@@ -604,7 +604,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
604 |
|
605 |
if ( isset( $actions['delete'] ) ) {
|
606 |
$actions['delete']['class'][] = 'disabled';
|
607 |
-
$actions['delete']['tip'] = __( 'This payment method is tied to a subscription and cannot be deleted. Please switch the subscription to another method first.', 'woocommerce-
|
608 |
}
|
609 |
|
610 |
// If there is only one subscription, provide a handy link to view it
|
@@ -614,7 +614,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
614 |
|
615 |
$actions['view-subscription'] = array(
|
616 |
'url' => $subscription->get_view_order_url(),
|
617 |
-
'name' => __( 'View Subscription', 'woocommerce-
|
618 |
);
|
619 |
}
|
620 |
|
@@ -668,11 +668,11 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
668 |
'post_meta' => array(
|
669 |
$prefix . 'payment_token' => array(
|
670 |
'value' => $this->get_gateway()->get_order_meta( SV_WC_Order_Compatibility::get_prop( $subscription, 'id' ), 'payment_token' ),
|
671 |
-
'label' => __( 'Payment Token', 'woocommerce-
|
672 |
),
|
673 |
$prefix . 'customer_id' => array(
|
674 |
'value' => $this->get_gateway()->get_order_meta( SV_WC_Order_Compatibility::get_prop( $subscription, 'id' ), 'customer_id' ),
|
675 |
-
'label' => __( 'Customer ID', 'woocommerce-
|
676 |
),
|
677 |
)
|
678 |
);
|
@@ -696,12 +696,12 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
696 |
|
697 |
// payment token
|
698 |
if ( empty( $meta['post_meta'][ $prefix . 'payment_token' ]['value'] ) ) {
|
699 |
-
throw new \Exception( sprintf( __( '%s is required.', 'woocommerce-
|
700 |
}
|
701 |
|
702 |
// customer ID - optional for some gateways so check if it's set first
|
703 |
if ( isset( $meta['post_meta'][ $prefix . 'customer_id'] ) && empty( $meta['post_meta'][ $prefix . 'customer_id' ]['value'] ) ) {
|
704 |
-
throw new \Exception( sprintf( __( '%s is required.', 'woocommerce-
|
705 |
}
|
706 |
}
|
707 |
|
@@ -856,7 +856,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
856 |
if ( 0 == $amount_to_charge ) {
|
857 |
|
858 |
// add order note
|
859 |
-
$order->add_order_note( sprintf( __( '%s0 Subscription Renewal Approved', 'woocommerce-
|
860 |
|
861 |
// update subscription
|
862 |
\WC_Subscriptions_Manager::process_subscription_payments_on_order( $order, $product_id );
|
@@ -894,7 +894,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
894 |
// order note based on gateway type
|
895 |
if ( $this->get_gateway()->is_credit_card_gateway() ) {
|
896 |
$message = sprintf(
|
897 |
-
_x( '%s %s Subscription Renewal Payment Approved: %s ending in %s (expires %s)', 'woocommerce-
|
898 |
$this->get_gateway()->get_method_title(),
|
899 |
$this->get_gateway()->perform_credit_card_authorization( $order ) ? 'Authorization' : 'Charge',
|
900 |
$token->get_card_type() ? $token->get_type_full() : 'card',
|
@@ -904,7 +904,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
904 |
} elseif ( $this->get_gateway()->is_echeck_gateway() ) {
|
905 |
|
906 |
// there may or may not be an account type (checking/savings) available, which is fine
|
907 |
-
$message = sprintf( __( '%s Check Subscription Renewal Payment Approved: %s account ending in %s', 'woocommerce-
|
908 |
}
|
909 |
|
910 |
// add order note
|
@@ -927,7 +927,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
927 |
} catch ( SV_WC_Plugin_Exception $e ) {
|
928 |
|
929 |
// don't mark the order as failed, Subscriptions will handle marking the renewal order as failed
|
930 |
-
$order->add_order_note( sprintf( _x( '%s Renewal Payment Failed (%s)', 'woocommerce-
|
931 |
|
932 |
// update subscription
|
933 |
\WC_Subscriptions_Manager::process_subscription_payment_failure_on_order( $order, $product_id );
|
@@ -1027,7 +1027,7 @@ class SV_WC_Payment_Gateway_Integration_Subscriptions extends SV_WC_Payment_Gate
|
|
1027 |
$token = $this->get_gateway()->get_payment_tokens_handler()->get_token( $order->get_user_id(), $this->get_gateway()->get_order_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), 'payment_token' ) );
|
1028 |
|
1029 |
if ( is_object( $token ) ) {
|
1030 |
-
$payment_method_to_display = sprintf( __( 'Via %s ending in %s', 'woocommerce-
|
1031 |
}
|
1032 |
|
1033 |
return $payment_method_to_display;
|
218 |
// payment token must be present and valid
|
219 |
if ( empty( $token ) || ! $this->get_gateway()->get_payment_tokens_handler()->user_has_token( $order->get_user_id(), $token ) ) {
|
220 |
|
221 |
+
$this->get_gateway()->mark_order_as_failed( $order, __( 'Subscription Renewal: payment token is missing/invalid.', 'woocommerce-gateway-paypal-powered-by-braintree' ) );
|
222 |
|
223 |
return;
|
224 |
}
|
244 |
*/
|
245 |
public function get_order( $order ) {
|
246 |
|
247 |
+
$order->description = sprintf( esc_html__( '%1$s - Subscription Renewal Order %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), wp_specialchars_decode( SV_WC_Helper::get_site_name(), ENT_QUOTES ), $order->get_order_number() );
|
248 |
|
249 |
// override the payment total with the amount to charge given by Subscriptions
|
250 |
$order->payment_total = $this->renewal_payment_total;
|
376 |
} catch( SV_WC_Payment_Gateway_Exception $e ) {
|
377 |
|
378 |
/* translators: Placeholders: %1$s - payment gateway title, %2$s - error message; e.g. Order Note: [Payment method] Payment Change failed [error] */
|
379 |
+
$note = sprintf( __( '%1$s Payment Change Failed (%2$s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $gateway->get_method_title(), $e->getMessage() );
|
380 |
|
381 |
// add a subscription note to keep track of failures
|
382 |
$subscription->add_order_note( $note );
|
383 |
|
384 |
+
SV_WC_Helper::wc_add_notice( __( 'An error occurred, please try again or try an alternate form of payment.', 'woocommerce-gateway-paypal-powered-by-braintree' ), 'error' );
|
385 |
|
386 |
// this isn't used by Subscriptions, but return a failure result anyway
|
387 |
$result = array(
|
507 |
$token = $this->get_gateway()->get_payment_tokens_handler()->get_token( $subscription->get_user_id(), $this->get_gateway()->get_order_meta( SV_WC_Order_Compatibility::get_prop( $subscription, 'id' ), 'payment_token' ) );
|
508 |
|
509 |
if ( $token instanceof SV_WC_Payment_Gateway_Payment_Token ) {
|
510 |
+
$payment_method_to_display = sprintf( __( 'Via %s ending in %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $token->get_type_full(), $token->get_last_four() );
|
511 |
}
|
512 |
|
513 |
return $payment_method_to_display;
|
534 |
|
535 |
// Add the header before the actions
|
536 |
if ( 'actions' === $id ) {
|
537 |
+
$new_headers['subscriptions'] = __( 'Subscriptions', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
538 |
}
|
539 |
|
540 |
$new_headers[ $id ] = $label;
|
564 |
|
565 |
// Build a link for each subscription
|
566 |
foreach ( $this->get_payment_token_subscriptions( get_current_user_id(), $token ) as $subscription ) {
|
567 |
+
$subscription_ids[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $subscription->get_view_order_url() ), esc_attr( sprintf( _x( '#%s', 'hash before order number', 'woocommerce-gateway-paypal-powered-by-braintree' ), $subscription->get_order_number() ) ) );
|
568 |
}
|
569 |
|
570 |
if ( ! empty( $subscription_ids ) ) {
|
604 |
|
605 |
if ( isset( $actions['delete'] ) ) {
|
606 |
$actions['delete']['class'][] = 'disabled';
|
607 |
+
$actions['delete']['tip'] = __( 'This payment method is tied to a subscription and cannot be deleted. Please switch the subscription to another method first.', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
608 |
}
|
609 |
|
610 |
// If there is only one subscription, provide a handy link to view it
|
614 |
|
615 |
$actions['view-subscription'] = array(
|
616 |
'url' => $subscription->get_view_order_url(),
|
617 |
+
'name' => __( 'View Subscription', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
618 |
);
|
619 |
}
|
620 |
|
668 |
'post_meta' => array(
|
669 |
$prefix . 'payment_token' => array(
|
670 |
'value' => $this->get_gateway()->get_order_meta( SV_WC_Order_Compatibility::get_prop( $subscription, 'id' ), 'payment_token' ),
|
671 |
+
'label' => __( 'Payment Token', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
672 |
),
|
673 |
$prefix . 'customer_id' => array(
|
674 |
'value' => $this->get_gateway()->get_order_meta( SV_WC_Order_Compatibility::get_prop( $subscription, 'id' ), 'customer_id' ),
|
675 |
+
'label' => __( 'Customer ID', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
676 |
),
|
677 |
)
|
678 |
);
|
696 |
|
697 |
// payment token
|
698 |
if ( empty( $meta['post_meta'][ $prefix . 'payment_token' ]['value'] ) ) {
|
699 |
+
throw new \Exception( sprintf( __( '%s is required.', 'woocommerce-gateway-paypal-powered-by-braintree' ), $meta['post_meta'][ $prefix . 'payment_token' ]['label'] ) );
|
700 |
}
|
701 |
|
702 |
// customer ID - optional for some gateways so check if it's set first
|
703 |
if ( isset( $meta['post_meta'][ $prefix . 'customer_id'] ) && empty( $meta['post_meta'][ $prefix . 'customer_id' ]['value'] ) ) {
|
704 |
+
throw new \Exception( sprintf( __( '%s is required.', 'woocommerce-gateway-paypal-powered-by-braintree' ), $meta['post_meta'][ $prefix . 'customer_id' ]['label'] ) );
|
705 |
}
|
706 |
}
|
707 |
|
856 |
if ( 0 == $amount_to_charge ) {
|
857 |
|
858 |
// add order note
|
859 |
+
$order->add_order_note( sprintf( __( '%s0 Subscription Renewal Approved', 'woocommerce-gateway-paypal-powered-by-braintree' ), get_woocommerce_currency_symbol() ) );
|
860 |
|
861 |
// update subscription
|
862 |
\WC_Subscriptions_Manager::process_subscription_payments_on_order( $order, $product_id );
|
894 |
// order note based on gateway type
|
895 |
if ( $this->get_gateway()->is_credit_card_gateway() ) {
|
896 |
$message = sprintf(
|
897 |
+
_x( '%s %s Subscription Renewal Payment Approved: %s ending in %s (expires %s)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
898 |
$this->get_gateway()->get_method_title(),
|
899 |
$this->get_gateway()->perform_credit_card_authorization( $order ) ? 'Authorization' : 'Charge',
|
900 |
$token->get_card_type() ? $token->get_type_full() : 'card',
|
904 |
} elseif ( $this->get_gateway()->is_echeck_gateway() ) {
|
905 |
|
906 |
// there may or may not be an account type (checking/savings) available, which is fine
|
907 |
+
$message = sprintf( __( '%s Check Subscription Renewal Payment Approved: %s account ending in %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_gateway()->get_method_title(), $token->get_account_type(), $token->get_last_four() );
|
908 |
}
|
909 |
|
910 |
// add order note
|
927 |
} catch ( SV_WC_Plugin_Exception $e ) {
|
928 |
|
929 |
// don't mark the order as failed, Subscriptions will handle marking the renewal order as failed
|
930 |
+
$order->add_order_note( sprintf( _x( '%s Renewal Payment Failed (%s)', 'woocommerce-gateway-paypal-powered-by-braintree' ), $this->get_gateway()->get_method_title(), $e->getMessage() ) );
|
931 |
|
932 |
// update subscription
|
933 |
\WC_Subscriptions_Manager::process_subscription_payment_failure_on_order( $order, $product_id );
|
1027 |
$token = $this->get_gateway()->get_payment_tokens_handler()->get_token( $order->get_user_id(), $this->get_gateway()->get_order_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), 'payment_token' ) );
|
1028 |
|
1029 |
if ( is_object( $token ) ) {
|
1030 |
+
$payment_method_to_display = sprintf( __( 'Via %s ending in %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $token->get_type_full(), $token->get_last_four() );
|
1031 |
}
|
1032 |
|
1033 |
return $payment_method_to_display;
|
lib/skyverge/woocommerce/payment-gateway/payment-tokens/class-sv-wc-payment-gateway-payment-tokens-handler.php
CHANGED
@@ -143,20 +143,20 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
143 |
|
144 |
if ( $response->get_status_code() && $response->get_status_message() ) {
|
145 |
/* translators: Placeholders: %1$s - payment request response status code, %2$s - payment request response status message */
|
146 |
-
$message = sprintf( esc_html__( 'Status code %1$s: %2$s', 'woocommerce-
|
147 |
} elseif ( $response->get_status_code() ) {
|
148 |
/* translators: Placeholders: %s - payment request response status code */
|
149 |
-
$message = sprintf( esc_html__( 'Status code: %s', 'woocommerce-
|
150 |
} elseif ( $response->get_status_message() ) {
|
151 |
/* translators: Placeholders: %s - payment request response status message */
|
152 |
-
$message = sprintf( esc_html__( 'Status message: %s', 'woocommerce-
|
153 |
} else {
|
154 |
-
$message = esc_html__( 'Unknown Error', 'woocommerce-
|
155 |
}
|
156 |
|
157 |
// add transaction id if there is one
|
158 |
if ( $response->get_transaction_id() ) {
|
159 |
-
$message .= ' ' . sprintf( esc_html__( 'Transaction ID %s', 'woocommerce-
|
160 |
}
|
161 |
|
162 |
throw new SV_WC_Payment_Gateway_Exception( $message );
|
@@ -745,7 +745,7 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
745 |
if ( $gateway->is_credit_card_gateway() ) {
|
746 |
|
747 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - payment method name (mastercard, bank account, etc), %3$s - last four digits of the card/account, %4$s - card/account expiry date */
|
748 |
-
$message = sprintf( __( '%1$s Payment Method Saved: %2$s ending in %3$s (expires %4$s)', 'woocommerce-
|
749 |
$gateway->get_method_title(),
|
750 |
$token->get_type_full(),
|
751 |
$token->get_last_four(),
|
@@ -756,7 +756,7 @@ class SV_WC_Payment_Gateway_Payment_Tokens_Handler {
|
|
756 |
|
757 |
// account type (checking/savings) may or may not be available, which is fine
|
758 |
/* translators: Placeholders: %1$s - payment gateway title (such as CyberSouce, NETbilling, etc), %2$s - account type (checking/savings - may or may not be available), %3$s - last four digits of the account */
|
759 |
-
$message = sprintf( __( '%1$s eCheck Payment Method Saved: %2$s account ending in %3$s', 'woocommerce-
|
760 |
$gateway->get_method_title(),
|
761 |
$token->get_account_type(),
|
762 |
$token->get_last_four()
|
143 |
|
144 |
if ( $response->get_status_code() && $response->get_status_message() ) {
|
145 |
/* translators: Placeholders: %1$s - payment request response status code, %2$s - payment request response status message */
|
146 |
+
$message = sprintf( esc_html__( 'Status code %1$s: %2$s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_status_code(), $response->get_status_message() );
|
147 |
} elseif ( $response->get_status_code() ) {
|
148 |
/* translators: Placeholders: %s - payment request response status code */
|
149 |
+
$message = sprintf( esc_html__( 'Status code: %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_status_code() );
|
150 |
} elseif ( $response->get_status_message() ) {
|
151 |
/* translators: Placeholders: %s - payment request response status message */
|
152 |
+
$message = sprintf( esc_html__( 'Status message: %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_status_message() );
|
153 |
} else {
|
154 |
+
$message = esc_html__( 'Unknown Error', 'woocommerce-gateway-paypal-powered-by-braintree' );
|
155 |
}
|
156 |
|
157 |
// add transaction id if there is one
|
158 |
if ( $response->get_transaction_id() ) {
|
159 |
+
$message .= ' ' . sprintf( esc_html__( 'Transaction ID %s', 'woocommerce-gateway-paypal-powered-by-braintree' ), $response->get_transaction_id() );
|
160 |
}
|
161 |
|
162 |
throw new SV_WC_Payment_Gateway_Exception( $message );
|
745 |
if ( $gateway->is_credit_card_gateway() ) {
|
746 |
|
747 |
/* translators: Placeholders: %1$s - payment gateway title (such as Authorize.net, Braintree, etc), %2$s - payment method name (mastercard, bank account, etc), %3$s - last four digits of the card/account, %4$s - card/account expiry date */
|
748 |
+
$message = sprintf( __( '%1$s Payment Method Saved: %2$s ending in %3$s (expires %4$s)', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
749 |
$gateway->get_method_title(),
|
750 |
$token->get_type_full(),
|
751 |
$token->get_last_four(),
|
756 |
|
757 |
// account type (checking/savings) may or may not be available, which is fine
|
758 |
/* translators: Placeholders: %1$s - payment gateway title (such as CyberSouce, NETbilling, etc), %2$s - account type (checking/savings - may or may not be available), %3$s - last four digits of the account */
|
759 |
+
$message = sprintf( __( '%1$s eCheck Payment Method Saved: %2$s account ending in %3$s', 'woocommerce-gateway-paypal-powered-by-braintree' ),
|
760 |
$gateway->get_method_title(),
|
761 |
$token->get_account_type(),
|
762 |
$token->get_last_four()
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: automattic, akeda, allendav, royho, slash1andy, woosteve, spraveenitpro, mikedmoore, fernashes, shellbeezy, danieldudzic, dsmithweb, fullysupportedphil, corsonr, zandyring, skyverge
|
3 |
Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal, braintree
|
4 |
Requires at least: 4.4
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 2.0
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -122,6 +122,18 @@ New feature requests and bugs reports can be made in the plugin forum.
|
|
122 |
|
123 |
== Changelog ==
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
= 2.0.4 =
|
126 |
* Fix - Prevent a fatal error when completing pre-orders
|
127 |
* Fix - Prevent JavaScript errors when applying a 100%-off coupon at checkout
|
@@ -226,6 +238,9 @@ New feature requests and bugs reports can be made in the plugin forum.
|
|
226 |
|
227 |
== Upgrade Notice ==
|
228 |
|
|
|
|
|
|
|
229 |
= 2.0.4 =
|
230 |
* Fix - Prevent a fatal error when completing pre-orders
|
231 |
* Fix - Prevent JavaScript errors when applying a 100%-off coupon at checkout
|
2 |
Contributors: automattic, akeda, allendav, royho, slash1andy, woosteve, spraveenitpro, mikedmoore, fernashes, shellbeezy, danieldudzic, dsmithweb, fullysupportedphil, corsonr, zandyring, skyverge
|
3 |
Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal, braintree
|
4 |
Requires at least: 4.4
|
5 |
+
Tested up to: 4.9.1
|
6 |
+
Stable tag: 2.1.0
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
122 |
|
123 |
== Changelog ==
|
124 |
|
125 |
+
= 2.1.0 =
|
126 |
+
* Feature - Upgrade to the latest Braintree JavaScript SDK for improved customer experience, reliability, and error handling
|
127 |
+
* Tweak - Add placeholder text for credit card inputs
|
128 |
+
* Tweak - Add responsive sizing to the PayPal buttons and update to the recommended styling for the Cart and Checkout pages
|
129 |
+
* Tweak - Add setting and filter to disable PayPal on the cart page
|
130 |
+
* Tweak - Update all translatable strings to the same text domain
|
131 |
+
* Tweak - Hide Kount as a fraud tool option for US-based stores as it's not currently supported
|
132 |
+
* Tweak - Only load the Braintree scripts when required on payment pages
|
133 |
+
* Fix - Ensure that new customers have their billing address stored in the vault on their first transaction
|
134 |
+
* Fix - Prevent linked PayPal accounts from being cleared if there are address errors at checkout
|
135 |
+
* Fix - Fix some deprecated function notices
|
136 |
+
|
137 |
= 2.0.4 =
|
138 |
* Fix - Prevent a fatal error when completing pre-orders
|
139 |
* Fix - Prevent JavaScript errors when applying a 100%-off coupon at checkout
|
238 |
|
239 |
== Upgrade Notice ==
|
240 |
|
241 |
+
= 2.1.0 =
|
242 |
+
* Feature - Upgrade to the latest Braintree JavaScript SDK for improved customer experience, reliability, and error handling
|
243 |
+
|
244 |
= 2.0.4 =
|
245 |
* Fix - Prevent a fatal error when completing pre-orders
|
246 |
* Fix - Prevent JavaScript errors when applying a 100%-off coupon at checkout
|
woocommerce-gateway-paypal-powered-by-braintree.php
CHANGED
@@ -5,9 +5,9 @@
|
|
5 |
* Description: Receive credit card or PayPal payments using Paypal Powered by Braintree. A server with cURL, SSL support, and a valid SSL certificate is required (for security reasons) for this gateway to function. Requires PHP 5.4+
|
6 |
* Author: WooCommerce
|
7 |
* Author URI: http://woocommerce.com/
|
8 |
-
* Version: 2.0
|
9 |
*
|
10 |
-
* Copyright (c) 2016-
|
11 |
*
|
12 |
* This program is free software: you can redistribute it and/or modify
|
13 |
* it under the terms of the GNU General Public License as published by
|
@@ -114,6 +114,9 @@ class WC_PayPal_Braintree_Loader {
|
|
114 |
return;
|
115 |
}
|
116 |
|
|
|
|
|
|
|
117 |
// Required framework classes class
|
118 |
require_once( plugin_dir_path( __FILE__ ) . 'lib/skyverge/woocommerce/class-sv-wc-plugin.php' );
|
119 |
require_once( plugin_dir_path( __FILE__ ) . 'lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php' );
|
5 |
* Description: Receive credit card or PayPal payments using Paypal Powered by Braintree. A server with cURL, SSL support, and a valid SSL certificate is required (for security reasons) for this gateway to function. Requires PHP 5.4+
|
6 |
* Author: WooCommerce
|
7 |
* Author URI: http://woocommerce.com/
|
8 |
+
* Version: 2.1.0
|
9 |
*
|
10 |
+
* Copyright (c) 2016-2018, Automattic, Inc.
|
11 |
*
|
12 |
* This program is free software: you can redistribute it and/or modify
|
13 |
* it under the terms of the GNU General Public License as published by
|
114 |
return;
|
115 |
}
|
116 |
|
117 |
+
// autoload the Braintree SDK
|
118 |
+
require_once( plugin_dir_path( __FILE__ ) . 'lib/autoload.php' );
|
119 |
+
|
120 |
// Required framework classes class
|
121 |
require_once( plugin_dir_path( __FILE__ ) . 'lib/skyverge/woocommerce/class-sv-wc-plugin.php' );
|
122 |
require_once( plugin_dir_path( __FILE__ ) . 'lib/skyverge/woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php' );
|