• Hello,

    I am having an issue with one renewal order, it keeps generating the error: Recurring payment failed. Reason: Request is not well-formed, syntactically incorrect, or violates schema.

    In the logs I have the following message:

    2025-01-23T16:52:29+00:00 Error API error: Array
    (
    [url] => https://api-m.paypal.com/v2/checkout/orders/7B665706WM850635A/capture
    [method] => POST
    [http_status] => 400
    [request] => Array
    (
    [payment_source] => PaymentPlugins\PayPalSDK\PaymentSource Object
    (
    [_values:protected] => Array
    (
    [token] => PaymentPlugins\PayPalSDK\Token Object
    (
    [_values:protected] => Array
    (
    [id] =>
    [type] => BILLING_AGREEMENT
    )

    [mappings:protected] => Array
    (
    )

    [index:PaymentPlugins\PayPalSDK\AbstractObject:private] =>
    [patchRequest:PaymentPlugins\PayPalSDK\AbstractObject:private] =>
    )

    )

    [mappings:protected] => Array
    (
    )

    [index:PaymentPlugins\PayPalSDK\AbstractObject:private] =>
    [patchRequest:PaymentPlugins\PayPalSDK\AbstractObject:private] =>
    )

    )

    [error] => Array
    (
    [name] => INVALID_REQUEST
    [message] => Request is not well-formed, syntactically incorrect, or violates schema.
    [debug_id] => 7984621e78663
    [details] => Array
    (
    [0] => Array
    (
    [field] => /payment_source/token/id
    [value] =>
    [location] => body
    [issue] => INVALID_STRING_LENGTH
    [description] => The value of a field is either too short or too long.
    )

    )

    [links] => Array
    (
    [0] => Array
    (
    [href] => https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH
    [rel] => information_link
    [encType] => application/json
    )

    )

    )

    )

    Best regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @luismotv77

    Was this subscription created using another plugin? The payment is failing because the billing agreement ID is empty.

    Kind Regards

    Thread Starter luismotv77

    (@luismotv77)

    Hello,

    Thank you for your answer.

    The subscription was created using another plugin (WooCommerce PayPal Payments). Is there anything I can do to solve this error?

    It seems that more subscriptions were paid using the other plugin. Is it possible that the other subscriptions will have the same issue?

    Kind regards.

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @luismotv77

    Is there anything I can do to solve this error?

    Yes, please check the order meta table for the subscription and see if there is a meta key called payment_token_id or _paypal_subscription_id. Can you confirm which of those two keys exists?

    If the _paypal_subscription_id key exists, simply copy and paste that value into the Edit Subscriptions page by clicking the pencil icon above the billing details.

    We’re releasing an update in a few days which will handle this error. It looks like the data structure that your old PayPal plugin used has changed recently so we need to update our code to accommodate that.

    You can send us a support request via the plugin’s help widget if you would like to test that now instead of waiting.

    Kind Regards

    Thread Starter luismotv77

    (@luismotv77)

    Hello,

    Thank you for your answer.

    I tried to search for the meta keys using these MySQL commands:

    SELECT * FROM wp_postmeta WHERE post_id = 121135 AND meta_key = '_paypal_subscription_id';
    SELECT * FROM wp_postmeta WHERE post_id = 121135 AND meta_key = 'payment_token_id';

    Unfortunately, the searches did not return any results. There are other subscriptions that have the ‘_paypal_subscription_id’, but not the one that failed.

    Sorry to bother you again, is there anything else it can be done to solve the issue? Could I search for the value I need in the business PayPal account?

    Kind regards.

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @luismotv77

    Are you using the posts table for orders or the new orders table? If you’re using the new orders table, you will want to search in the ordermeta table.

    Could I search for the value I need in the business PayPal account

    I don’t believe the agreement ID’s are visible in your PayPal business account so you may need to have your customer update their payment information. If the value doesn’t exist in your ordermeta table then it’s possible it never existed or the customer deleted their payment method.

    Kind Regards

    Thread Starter luismotv77

    (@luismotv77)

    Hello,

    I’m using the posts table order. I got another subscription with the same error. The only field in the database is one related with the parent order, the ‘ppcp_previous_transaction_reference’.

    Could I use this to fix the error, or to recover the agreement ID?

    If the customer pay the failed renewal order, would that update the Billing Agreement ID of PayPal?

    Kind regards

    • This reply was modified 1 month, 1 week ago by luismotv77.
    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @luismotv77

    Could I use this to fix the error, or to recover the agreement ID?

    I don’t believe so, it sounds like that is referring to a transaction ID used by your other plugin.

    If the customer pay the failed renewal order, would that update the Billing Agreement ID of PayPal?

    Yes, that will update the billing agreement ID.

    I would try using phpmyadmin to search one of the subscription ID’s and pull up all the metadata. You can send us a support request via the help widget in the plugin if you would like us to review that metadata.

    Kind Regards

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.