Last active
July 23, 2024 17:03
-
-
Save InpsydeNiklas/ebdf6179c1e39428ae75fc7adf17063e to your computer and use it in GitHub Desktop.
PayPal Payments - set empty strings as product description in API request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('ppcp_create_order_request_body_data', static function (array $data): array { | |
if (isset($data['purchase_units'][0]['items'][0]['description'])) { | |
$data['purchase_units'][0]['items'][0]['description'] = ''; | |
} | |
return $data; | |
}); | |
add_filter('ppcp_patch_order_request_body_data', function($patches_array) { | |
if (isset($patches_array[0]['value']['items'][0])) { | |
$patches_array[0]['value']['items'][0]['description'] = ''; | |
} | |
return $patches_array; | |
}, 10); |
I used this code, but on PayPal recipe is an information "Order Item #1698" instead empty description. This number in description doesn't corespond with an order number. Can you help me?
Its the product id which is different to the order id.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I used this code, but on PayPal recipe is an information "Order Item #1698" instead empty description. This number in description doesn't corespond with an order number. Can you help me?