The Solution is to turn off auto update for the Woocommerce Paypal plugin and change the code in this directory. \woocommerce-paypal-payments\modules\ppcp-button\src\Endpoint\CreateOrderEndpoint.php ... at the beginning of this function private function create_paypal_order( \WC_Order $wc_order = null, string $payment_method = '', array $data = array() ) : Order {
// Check origin source from session
if (!isset($_COOKIE['sbjs_first'])) {
throw new RuntimeException(
__('Order creation failed: Origin source is required.', 'woocommerce-paypal-payments')
);
}
assert( $this->purchase_unit instanceof PurchaseUnit ); Note: this is a temporary fix. You can check other cookies that relate to the origin source to harden the condition.
... View more