Skip to content

Conversation

eileenmcnaughton
Copy link
Contributor

When setting up a paypal rest Authorize request there are a few possibilities

  1. we have a payment token
  2. we have a credit card number & cvv & expiry
  3. we have neither of the above and should be redirected to paypal for us to log in and authorize the payment.

Currently the code understands the difference as

  1. cardReference is present
  2. 'card' object is present
  3. neither of the above.

However, the card object also holds other information - email, address, phone etc. Even if these are not used by Paypal Rest the calling code should not need to know that it can't set these under a specific combination of circumstances.

This fix looks more deeply into the passed card parameter for the presence of the actual card fields - ie.card number, expiry - and otherwise concludes this is not a card-present transations and allows the redirect to proceed

When setting up a paypal rest Authorize request there are a few possibilities

we have a payment token
we have a credit card number & cvv & expiry
we have neither of the above and should be redirected to paypal for us to log in and authorize the payment.
Currently the code understands the difference as

cardReference is present
'card' object is present
neither of the above.
However, the card object also holds other information - email, address, phone etc. Even if these are not used by Paypal Rest the calling code should not need to know that it can't set these under a specific combination of circumstances.

This fix looks more deeply into the passed card parameter for the presence of the actual card fields - ie.card number, expiry - and otherwise concludes this is not a card-present transations and allows the redirect to proceed
…ntegrations.

In a generic integration the card parameter might exist to hold billing address details even when
the card number is not provided. We don't expect the integration to hold knowledge that 'paypal rest won't work
if you pass a 'card' paramter when you are pre-authorizing a token' so we should
look more deeply into the passed card parameter for the presence of the actual card fields - ie.
card number, expiry ,cvv
Error is caused by changes in dependencies & version change on psr parse function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant