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

[V7] Add Encodable protocol for PayPal Checkout #1491

Merged
merged 24 commits into from
Jan 21, 2025

Conversation

richherrera
Copy link
Contributor

@richherrera richherrera commented Jan 2, 2025

Summary of changes

  • Add PayPalRequest protocol to define the contract for the base properties for BTPayPalCheckoutRequest and BTPayPalVaultRequest
  • Conform to the new protocol in the three concrete classes (BTPayPalRequest, BTPayPalCheckoutRequest and BTPayPalVaultRequest) to eliminate inheritance
  • Update docstrings for classes BTPayPalCheckoutRequest and BTPayPalVaultRequest
  • LineItems now conforms to the Encodable protocol.
  • Add encodable types for post bodies used in the PayPal Checkout flow.
  • PayPal Checkout has been tested in the Demo app to ensure the dictionaries are still constructed as expected.

Note: Since we have two different classes (PayPalCheckoutRequest and PayPalVaultRequest) used in PayPalClient, it's currently not possible to use Encodable until the same implementation is done for PayPalVaultRequest. We tested the flow, but we need to complete task DTMOBILES-1177 to be able to use Encodable.

Checklist

  • [ ] Added a changelog entry
  • Tested and confirmed payment flows affected by this change are functioning as expected

Authors

@richherrera richherrera requested a review from a team as a code owner January 2, 2025 18:21
@richherrera richherrera self-assigned this Jan 3, 2025
Copy link
Contributor

@jaxdesmarais jaxdesmarais left a comment

Choose a reason for hiding this comment

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

🚀

import BraintreeCore
#endif

/// The POST body for v1/paypal_hermes/create_payment_resource
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
/// The POST body for v1/paypal_hermes/create_payment_resource
/// The POST body for `v1/paypal_hermes/create_payment_resource`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated: f3ccfe4

Copy link
Contributor

@scannillo scannillo left a comment

Choose a reason for hiding this comment

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

A few styling nits, otherwise this is awesome!

@richherrera richherrera merged commit 9888573 into v7 Jan 21, 2025
7 checks passed
@richherrera richherrera deleted the paypal-checkout-encodable branch January 21, 2025 17:55
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.

3 participants