mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge remote-tracking branch 'origin/trunk' into modularity-module-migration
# Conflicts: # modules/ppcp-admin-notices/src/AdminNotices.php # modules/ppcp-save-payment-methods/src/SavePaymentMethodsModule.php # modules/ppcp-wc-gateway/src/WCGatewayModule.php # modules/ppcp-wc-subscriptions/src/WcSubscriptionsModule.php # tests/PHPUnit/WcSubscriptions/RenewalHandlerTest.php
This commit is contained in:
commit
392d27f08b
163 changed files with 13687 additions and 1746 deletions
|
@ -202,7 +202,7 @@ class PayPalSubscriptionsModule implements ServiceModule, ExtendingModule, Execu
|
|||
*
|
||||
* @psalm-suppress MissingClosureParamType
|
||||
*/
|
||||
function( $actions, $subscription ): array {
|
||||
function( $actions, $subscription = null ): array {
|
||||
if ( ! is_array( $actions ) || ! is_a( $subscription, WC_Subscription::class ) ) {
|
||||
return $actions;
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ class SubscriptionsApiHandler {
|
|||
*/
|
||||
public function create_product( WC_Product $product ) {
|
||||
try {
|
||||
$subscription_product = $this->products_endpoint->create( $product->get_title(), $this->prepare_description( $product->get_description() ) );
|
||||
$subscription_product = $this->products_endpoint->create( $this->prepare_item_string( $product->get_title() ), $this->prepare_item_string( $product->get_description() ) );
|
||||
$product->update_meta_data( 'ppcp_subscription_product', $subscription_product->to_array() );
|
||||
$product->save();
|
||||
} catch ( RuntimeException $exception ) {
|
||||
|
@ -169,7 +169,7 @@ class SubscriptionsApiHandler {
|
|||
$catalog_product_name = $catalog_product->name() ?: '';
|
||||
$catalog_product_description = $catalog_product->description() ?: '';
|
||||
|
||||
$wc_product_description = $this->prepare_description( $product->get_description() ) ?: $product->get_title();
|
||||
$wc_product_description = $this->prepare_item_string( $product->get_description() ) ?: $this->prepare_item_string( $product->get_title() );
|
||||
|
||||
if ( $catalog_product_name !== $product->get_title() || $catalog_product_description !== $wc_product_description ) {
|
||||
$data = array();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue