Hello @metalinedev
There is validation on the plugin side for manual connection, and there is one scenario where it may fail.
Please check whether your Client ID falls into this category – for example if it starts with B (there are some cases like this, although they are rare). As a developer you should be able to verify this:
// Client ID: exactly 80 chars, word chars + hyphen only
if ( 1 !== preg_match( '/^[\w-]{80}$/', $client_id ) ) {
throw new RuntimeException( 'Invalid client ID provided.' );
}
// Client Secret: exactly 80 chars, word chars + hyphen only
if ( 1 !== preg_match( '/^[\w-]{80}$/', $client_secret ) ) {
throw new RuntimeException( 'Invalid client secret provided.' );
}
In short, the front-end form validation for manual connection expects the Client ID format to match specific rules (Start with A, 80 chars / format validation). If the credentials pass this validation, then the only remaining explanation would normally be incorrect credentials.
We have an open issue for this, and it will be fixed in the next plugin update, as currently, the regex is too strict.
That said, this still does not explain why the automatic connection also fails, so there may be something else involved there. But let’s start with digging into manual part first.
Kind Regards
Krystian
Yes, the problem is exactly the restrictive regex. All the credentials I create start with “B”. The setup wizard creates the credentials and then fails, and the credentials still start with the letter “B”.
If I create a script to query the APIs using credentials starting with the letter “B”, I receive a successful response. The credentials are correct; it’s your plugin that is not handling them properly.
Hello @metalinedev
Yes, that would explain it. This is something we are aware of. However, the onboarding wizard via the normal connection flow should still work.
Please reach out to us directly – we can prepare a fixing package for this. You can open a ticket with our service desk here: https://paypal.inpsyde.com/docs/request-support/
Please include this thread URL in your ticket for reference.
Kind Regards
Krystian
Is there any news regarding this patch?
Hello @metalinedev
The patch should be ready today.
GitHub is currently experiencing issues, so I’m unable to create packages right now. I will share it once its possible.
Kind regards,
Krystian