Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Variable Type Mistake in 3DS Example #102

Open
TheoKouzelis opened this issue May 25, 2022 · 2 comments
Open

Possible Variable Type Mistake in 3DS Example #102

TheoKouzelis opened this issue May 25, 2022 · 2 comments

Comments

@TheoKouzelis
Copy link

In the 3DS example the code suggests that the "enrolled" property will be a boolean

if ($secureEcom->enrolled === true) {

But I believe the response variable, mapped to enrolled by the GpApiMapping class, will be a string of either ENROLLED, NOT_ENROLLED, NOT_ENROLLED_ATTEMPT or UNABLE_TO_VERIFY

$threeDSecure->enrolled = !empty($response->three_ds->enrolled_status) ?

Which means line 72 in the example will always equal false.

Response values for enrolled_status are being sourced from the docs here https://developer.globalpay.com/api/authentications#/Check%20Availability/check3DSAvailability

@TheoKouzelis
Copy link
Author

Maybe it should be rewritten to use the GlobalPayments\Api\Entities\Enums\Secure3dStatus values. Such as:
if ($secureEcom->enrolled === Secure3dStatus::ENROLLED) {

@TheoKouzelis
Copy link
Author

Other SDK's further downstream, such as the 3DS2 SDK seem to expect the parameter to be a boolean https://github.com/globalpayments/globalpayments-js/blob/master/packages/globalpayments-3ds/src/index.ts#L133:L135

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

No branches or pull requests

1 participant