Skip to content

Commit

Permalink
Sync from pro
Browse files Browse the repository at this point in the history
  • Loading branch information
prappo committed Aug 7, 2024
1 parent 5cd9654 commit bbc3bb8
Show file tree
Hide file tree
Showing 18 changed files with 5,032 additions and 5 deletions.
211 changes: 206 additions & 5 deletions languages/stripe.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-08-07T11:33:34+00:00\n"
"POT-Creation-Date: 2024-08-07T11:40:25+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.10.0\n"
"X-Domain: stripe\n"
Expand Down Expand Up @@ -10343,6 +10343,7 @@ msgid ""
msgstr ""

#: includes/core/payments/customer.php:213
#: src/RestApi/Internal/Payment/Traits/CustomerTrait.php:219
msgid "Please select a valid Tax ID type."
msgstr ""

Expand Down Expand Up @@ -11695,6 +11696,7 @@ msgid "Disabling CAPTCHA will make your site more vulnerable to spam and fraudul
msgstr ""

#: includes/core/rest-api/class-controller.php:104
#: src/RestApi/Internal/Payment/LitePaymentCreateRoute.php:72
msgid "Sorry, you have made too many requests. Please try again later."
msgstr ""

Expand All @@ -11704,6 +11706,8 @@ msgstr ""
#: includes/core/rest-api/v2/class-paymentintent-controller.php:143
#: src/AntiSpam/EmailVerification.php:578
#: src/AntiSpam/EmailVerification.php:672
#: src/RestApi/Internal/Payment/Traits/PaymentIntentTrait.php:142
#: src/RestApi/Internal/Payment/Utils/CouponUtils.php:119
msgid "Invalid request. Please try again."
msgstr ""

Expand Down Expand Up @@ -12832,6 +12836,7 @@ msgid "Request failed."
msgstr ""

#: src/Block/ManageSubscriptionsBlock.php:63
#: src/RestApi/Internal/Payment/LitePaymentCreateRoute.php:82
#: src/RestApi/Internal/SubscriptionsManagement/SendSubscriptions.php:146
msgid "Invalid CAPTCHA. Please try again."
msgstr ""
Expand Down Expand Up @@ -13275,6 +13280,206 @@ msgstr ""
msgid "Counting results via a query is not allowed. Use the ::count() method."
msgstr ""

#: src/RestApi/Internal/Payment/Traits/InvoiceTrait.php:138
#: views/smart-tag-receipt.php:159
msgid "Processing fee"
msgstr ""

#: src/RestApi/Internal/Payment/Traits/SubscriptionTrait.php:518
msgid "Plan Setup Fee"
msgstr ""

#: src/RestApi/Internal/Payment/Traits/SubscriptionTrait.php:519
msgid "Initial Setup Fee"
msgstr ""

#: src/RestApi/Internal/Payment/Utils/CouponUtils.php:58
#: src/RestApi/Internal/Payment/Utils/CouponUtils.php:68
#: src/RestApi/Internal/Payment/Utils/CouponUtils.php:85
msgid "Sorry, this coupon not valid."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/CouponUtils.php:105
msgid "Sorry, this coupon not valid for the selected currency."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/CouponUtils.php:133
#: src/RestApi/Internal/Payment/Utils/CouponUtils.php:143
msgid "Sorry, this coupon puts the total below the required minimum amount."
msgstr ""

#. translators: %1$s Coupon code. %2$s discount amount.
#: src/RestApi/Internal/Payment/Utils/CouponUtils.php:155
msgid "%1$s: %2$s off"
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:35
msgid "The payment form ID to use for the payment."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:62
msgid "The payment form values to use for the payment."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:92
msgid "A security token (usually from a CAPTCHA service) to verify the payment request."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:117
msgid "The ID of the price to use for the payment."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:145
msgid "The purchase quantity for the payment."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:172
msgid "The custom amount for the payment."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:203
msgid "The currency for the payment."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:232
msgid "If the user has opted in to a recurring payment."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:256
msgid "If the user has opted in to pay processing fees."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:280
msgid "The coupon code to apply to the payment."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:310
msgid "The subtotal of the payment."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:334
msgid "The customers's billing address."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:341
msgid "Name."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:367
msgid "The customers's shipping address."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:374
msgid "Recipient name."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:378
msgid "Recipient phone number."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:404
msgid "The payment method type used to make a payment."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:431
msgid "The payment's customer."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:455
msgid "The payment's subscription ID."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:479
msgid "The payment's SetupIntent ID."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:503
msgid "The payment method's ID."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:527
msgid "The payment's subscription key."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:551
msgid "The payment object to update."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:575
msgid "The payment's tax calculation."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:595
msgid "Address."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:599
msgid "Apartment, suite, etc."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:603
msgid "City."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:607
msgid "State/County code, or name of the state, county, province, or district."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:611
msgid "Postal code."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaUtils.php:615
msgid "Country/Region code in ISO 3166-1 alpha-2 format."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaValidationUtils.php:382
msgid "The provided form ID is invalid."
msgstr ""

#. translators: %s is replaced with the required field.
#: src/RestApi/Internal/Payment/Utils/SchemaValidationUtils.php:410
msgid "The required field \"%s\" is missing."
msgstr ""

#. translators: %s is replaced with the required field.
#: src/RestApi/Internal/Payment/Utils/SchemaValidationUtils.php:416
msgid "The required field \"%s\" cannot be empty."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaValidationUtils.php:424
msgid "Tax ID and Tax ID Type are required fields."
msgstr ""

#: src/RestApi/Internal/Payment/Utils/SchemaValidationUtils.php:435
msgid "Tax ID and Tax ID Type cannot be empty."
msgstr ""

#. translators: %s is replaced with the address type (billing or shipping).
#: src/RestApi/Internal/Payment/Utils/SchemaValidationUtils.php:446
msgid "The %s address name is required."
msgstr ""

#. translators: %s is replaced with the address type (billing or shipping).
#: src/RestApi/Internal/Payment/Utils/SchemaValidationUtils.php:451
msgid "The %s address country is required."
msgstr ""

#. translators: %s is replaced with the address type (billing or shipping).
#: src/RestApi/Internal/Payment/Utils/SchemaValidationUtils.php:456
msgid "The %s address postal code is required."
msgstr ""

#. translators: %s is replaced with the field type (email, customer_name, or telephone).
#: src/RestApi/Internal/Payment/Utils/SchemaValidationUtils.php:466
msgid "The %s field is required."
msgstr ""

#. translators: %s is replaced with the field type (email, customer_name, or telephone).
#: src/RestApi/Internal/Payment/Utils/SchemaValidationUtils.php:475
msgid "The %s field can not be empty."
msgstr ""

#: src/RestApi/Internal/Report/GrossVolumePeriodOverPeriodReport.php:152
#: src/RestApi/Internal/Report/SuccessfulPaymentsPeriodOverPeriodReport.php:142
msgid "Current period"
Expand Down Expand Up @@ -14054,10 +14259,6 @@ msgstr ""
msgid "Discount"
msgstr ""

#: views/smart-tag-receipt.php:159
msgid "Processing fee"
msgstr ""

#: views/smart-tag-receipt.php:179
msgid "Tax"
msgstr ""
Expand Down
77 changes: 77 additions & 0 deletions src/RestApi/Internal/Payment/AbstractPaymentCreateRoute.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
/**
* Payment creation route
*
* Utilized by both Lite and Pro.
*
* @package SimplePay
* @subpackage Core
* @copyright Copyright (c) 2023, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 4.7.0
*/

namespace SimplePay\Core\RestApi\Internal\Payment;

/**
* AbstractPaymentCreateRoute class.
*
* @since 4.7.0
*/
abstract class AbstractPaymentCreateRoute extends AbstractPaymentRoute {

/**
* The payment create route.
*
* @since 4.7.0
*
* @var string
*/
protected $route = 'payment/create';

/**
* Application fee handling.
*
* @since 4.7.0
*
* @var \SimplePay\Core\StripeConnect\ApplicationFee
*/
protected $application_fee;

/**
* AbstractPaymentCreateRoute.
*
* @since 4.7.0
*
* @param \SimplePay\Core\StripeConnect\ApplicationFee $application_fee Application fee service.
*/
public function __construct( $application_fee ) {
$this->application_fee = $application_fee;
}

/**
* Determines if the current request should be able to create a payment.
*
* This occurs _before_ argument validation is done. This should be where
* user authentication permission checks are done.
*
* @since 4.7.0
*
* @param \WP_REST_Request $request The payment request.
* @return bool
*/
public function create_payment_permissions_check( $request ) {
return true;
}

/**
* Creates a payment for the given request.
*
* @since 4.7.0
*
* @param \WP_REST_Request $request The payment request.
* @return \WP_REST_Response
*/
abstract public function create_payment( $request );

}
Loading

0 comments on commit bbc3bb8

Please sign in to comment.