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 Option to Select Merchant Integration Credential in Demo App #168

Merged
merged 3 commits into from
Jul 13, 2023

Conversation

KunJeongPark
Copy link
Collaborator

@KunJeongPark KunJeongPark commented Jul 10, 2023

Summary of changes

  • Add enum for Merchant Integration types
  • Add selectedMerchantIntegration property in BaseViewModel and PayPalViewModel
  • Add parameters to DemoMerchantAPI functions to add selectedMerchantIntegration into url path for request to merchant server
  • Remove processOrder functions not used anywhere
  • Remove persisting clientID in baseViewModel since user can select different credentials in single run of the app

Checklist

- [ ] Added a changelog entry

Authors

@sshropshire sshropshire marked this pull request as ready for review July 10, 2023 21:05
@sshropshire sshropshire requested a review from a team as a code owner July 10, 2023 21:05
@@ -0,0 +1,21 @@
import Foundation

enum MerchantIntegration {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will we add a UI option to toggle this setting in the future?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we are still figuring out the UI in demo app that would help us to test different scenarios.

@@ -37,18 +39,22 @@ class BaseViewModel: ObservableObject, PayPalWebCheckoutDelegate, CardDelegate {
}
}

func createOrder(amount: String?) async -> String? {
func createOrder(amount: String?, selectedMerchantIntegration: MerchantIntegration) async -> String? {
// might need to pass in payee as payee object or as auth header
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this comment for a specific merchant integration type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, Steven and I talked about having different parameters for creating order for different integration patterns. I wanted to leave a note there to remember that's the place I'd pass in the optional parameters in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would just add TODO: - syntax to it so we don't forget about it!

Copy link
Collaborator

Choose a reason for hiding this comment

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

➕ on adding a TODO

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done in commit db28708

@@ -8,6 +8,7 @@ import PayPalCheckout

/// This class is used to share the orderID across shared views, update the text of `bottomStatusLabel` in our `FeatureBaseViewController`
/// as well as share the logic of `processOrder` across our duplicate (SwiftUI and UIKit) card views.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change

We don't need this added line break

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed in commit db28708

@@ -37,18 +39,22 @@ class BaseViewModel: ObservableObject, PayPalWebCheckoutDelegate, CardDelegate {
}
}

func createOrder(amount: String?) async -> String? {
func createOrder(amount: String?, selectedMerchantIntegration: MerchantIntegration) async -> String? {
// might need to pass in payee as payee object or as auth header
Copy link
Collaborator

Choose a reason for hiding this comment

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

➕ on adding a TODO

@KunJeongPark KunJeongPark merged commit 1278f16 into main Jul 13, 2023
4 checks passed
@KunJeongPark KunJeongPark deleted the merchantIntegrationOptionsDemo branch July 13, 2023 18:07
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.

4 participants