-
Notifications
You must be signed in to change notification settings - Fork 292
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
base: contact-information-feature
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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
func testParametersWithConfiguration_whenContactInformationNotSet_doesNotSetPayerEmailInRequest() { | |
func testParametersWithConfiguration_whenContactInformationNotSet_doesNotSetPayerEmailAndPhoneNumberInRequest() { |
There was a problem hiding this 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
Summary of changes
Introduces support for passing recipient contact information in the
BTPayPalCheckoutRequest
BTContactInformation
was created to encapsulate the recipient's contact information for the order.Properties:
recipientEmail
andrecipientPhoneNumber
contactInformation
of typeBTContactInformation
.contactInformation.recipientEmail
andcontactInformation.recipientPhoneNumber
are passed to thecreate_payment_resource
endpoint as therecipient_email
andinternational_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
Authors