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

Add Contact Information request object #1469

Open
wants to merge 6 commits into
base: contact-information-feature
Choose a base branch
from

Conversation

richherrera
Copy link
Contributor

@richherrera richherrera commented Nov 22, 2024

Summary of changes

Introduces support for passing recipient contact information in the BTPayPalCheckoutRequest

  • A new class BTContactInformation was created to encapsulate the recipient's contact information for the order.
    Properties: recipientEmail andrecipientPhoneNumber
  • Updated BTPayPalCheckoutRequest: Added a new optional property contactInformation of type BTContactInformation.
  • The contactInformation.recipientEmail and contactInformation.recipientPhoneNumber are passed to the create_payment_resource endpoint as the recipient_email and international_phone parameters when present.

Note: When the new parameters (recipient_email and international_phone) are included, the gateway returns an error. I will follow up with updates once I gather more information or implement any necessary fixes.

Checklist

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

Authors

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.

One small docstring comment but overall looks great!

/// Phone number of the recipient
let recipientPhoneNumber: BTPayPalPhoneNumber?

public init(recipientEmail: String? = nil, recipientPhoneNumber: BTPayPalPhoneNumber? = nil) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets add docstrings here instead of on the internal properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, updated: fcd5c15

XCTAssertEqual(internationalPhone, ["country_code": "US", "national_number": "123456789"])
}

func testParametersWithConfiguration_whenContactInformationNotSet_doesNotSetPayerEmailInRequest() {
Copy link
Contributor

Choose a reason for hiding this comment

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

small nit: take it or leave it

Suggested change
func testParametersWithConfiguration_whenContactInformationNotSet_doesNotSetPayerEmailInRequest() {
func testParametersWithConfiguration_whenContactInformationNotSet_doesNotSetPayerEmailAndPhoneNumberInRequest() {

Copy link
Contributor

@agedd agedd left a comment

Choose a reason for hiding this comment

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

lgtm! 🚀 just left one small comment

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.

3 participants