Skip to content

Conversation

@noguier
Copy link
Contributor

@noguier noguier commented Jan 22, 2026

Summary of changes

  • added the ability to receive a callback to getClientMetadataId when the submit completes
  • updated PayPalInternalClient and LocalPaymentClient call to getClientMetadataId
  • updated test coverage

Checklist

  • Added a changelog entry
  • Relevant test coverage
  • Tested and confirmed payment flows affected by this change are functioning as expected

Authors

@noguier

@noguier noguier requested a review from a team as a code owner January 22, 2026 15:14
@github-actions
Copy link

github-actions bot commented Jan 22, 2026

Dependency Review

✅ No vulnerabilities found.

Scanned Files

None

return result.paypalClientMetaDataId
) { status, clientMetadataId ->
// Callback is invoked when device data collection and submit API completes
callback(clientMetadataId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be checking that the status is a success before returning the callback here? For the timeout and error status we can instead return an empty string or an error.

Copy link
Contributor Author

@noguier noguier Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the check for the status in b52b032, let me know if it is sufficient!

CHANGELOG.md Outdated
* PayPal
* Pass `funding_source` to the app switch url link and to analytics events.


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we've got a double space here now

Copy link
Contributor

@saralvasquez saralvasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple small nits, but looks good otherwise!

}

Assert.assertTrue(result.isEmpty())
Assert.assertNotNull(receivedClientMetadataId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the extra NotNull assert here since you've got the !! below?

}

Assert.assertTrue(result.isEmpty())
Assert.assertNotNull(receivedClientMetadataId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above

@saralvasquez
Copy link
Contributor

^Although I haven't tested on physical device yet...


val sut = MagnesInternalClient(magnesSDK)
val result = sut.getClientMetadataId(context, prodConfiguration, requestWithInvalidGUID)
var receivedClientMetadataId: String? = null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var receivedClientMetadataId: String? = null
var receivedClientMetadataId: String = "non-empty"

would this work for your use-case? you could potentially remove the !! in the assert.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for this suggestion, I have updated the test not to use !! in 123ebec!

hasUserLocationConsent: Boolean
): String {
hasUserLocationConsent: Boolean,
callback: (String) -> Unit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is either this or the below changing the public interface for merchants that use the data collector directly? I am not sure how the RestrictTo logic works.

Copy link
Contributor Author

@noguier noguier Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand @RestrictTo means this function is internal to our library group - merchants shouldn't be calling it directly, the only function that merchants should call is collectDeviceData.

@saralvasquez
Copy link
Contributor

Ok I tested on emulator and physical device and paypal and local payments flows seem to be working as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants