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

[AC-1937] Server: Implement endpoint to retrieve provider payment information #4093

Conversation

cyprain-okeke
Copy link
Contributor

Type of change

- [ ] Bug fix
- [x] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Implement an Admin Console endpoint that retrieves a provider’s payment information. This endpoint should only be accessible to the ProviderAdmin.

Data Required

How much account credit the provider has

The provider’s truncated payment method information

Card type

Last 4

Expiration MM/YYYY

The provider’s tax information (same as paid organizations)

{
  "paymentMethod": {
    "type": 0,
    "description": "VISA, *4242, 04/2029",
    "cardBrand": "visa"
  },
  "taxInformation": {
    "country": "FR",
    "postalCode": "95600",
    "taxId": "FRAB123456789",
    "line1": "64 Avenue Millies Lacroix",
    "line2": null,
    "city": "Eaubonne",
    "state": "Île-de-France"
  }
}

Code changes

  • file.ext: Description of what was changed and why

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • If making database changes - make sure you also update Entity Framework queries and/or migrations
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
Copy link
Contributor

github-actions bot commented May 16, 2024

Logo
Checkmarx One – Scan Summary & Detailseed54c68-4e6f-4382-adb0-8be5cea9cad8

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 190 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 333 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 333 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationsController.cs: 169 Attack Vector
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 707 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 118 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationsController.cs: 327 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 81 Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 93 Attack Vector

}

var taxInformation = await paymentService.GetTaxInfoAsync(provider);
var billingInformation = await paymentService.GetBillingAsync(provider);
Copy link
Contributor

Choose a reason for hiding this comment

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

GetBillingAsync is the method we discussed in our Dev Sync that we determined does a little too much work for what's asked of it. We'd also like to try and phase out the StripePaymentService as much as possible. What do you think about adding two new methods to the SubscriberService?

SubscriberService.GetTaxInformation and SubscriberService.GetPaymentMethod. You could add new DTOs representing tax information and a payment method in our Core/Billing folder so we'd have ownership of them. Then, the ProviderPaymentInfoDTO could use those two new DTOs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry might have missed something, but I think I got pinged for a re-review. Did we have an update here?

cyprain-okeke and others added 3 commits May 17, 2024 12:54
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
…lement-endpoint-to-retrieve-provider-payment-information
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
@cyprain-okeke cyprain-okeke marked this pull request as ready for review May 17, 2024 16:26
@cyprain-okeke cyprain-okeke requested review from a team as code owners May 17, 2024 16:26
Signed-off-by: Cy Okeke <cokeke@bitwarden.com>
@amorask-bitwarden
Copy link
Contributor

Not sure what happened here, but it looks like a bunch of unrelated commits got pulled in.
image

@cyprain-okeke cyprain-okeke force-pushed the ac-1937-implement-endpoint-to-retrieve-provider-payment-information branch 2 times, most recently from bfc1fbf to f0ce176 Compare May 20, 2024 16:09
@cyprain-okeke cyprain-okeke force-pushed the ac-1937-implement-endpoint-to-retrieve-provider-payment-information branch from c0dfd57 to f0ce176 Compare May 20, 2024 19:03
@cyprain-okeke cyprain-okeke deleted the ac-1937-implement-endpoint-to-retrieve-provider-payment-information branch May 20, 2024 20:00
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.

None yet

2 participants