1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-27 07:42:15 -05:00

155 Commits

Author SHA1 Message Date
Justin Baur
bb34de74cb
Freshsales integration (#1782)
* Add FreshsalesController

* Add better errors

* Fix formatting issues

* Add comments

* Add Billing.Test to solution files

* Fix unit test

* Format code

* Address PR feedback
2021-12-22 13:27:52 -05:00
Jake Fink
11aafac915
remove re-throws of exceptions, which clear the stack trace (#1760)
* remove re-throws of exceptions, which clear the stack trace

* remove whitespace
2021-12-16 15:35:07 -05:00
Oscar Hinton
23b0a1f9df
Run dotnet format (#1764) 2021-12-16 15:35:09 +01:00
Vince Grassia
2ec10cfd2a
Standardize '/version' endpoint on all services (#1755) 2021-12-09 15:45:45 -05:00
Matt Gibson
33edc8eba0
Families for Enterprise (#1714)
* Create common test infrastructure project

* Add helpers to further type PlanTypes

* Enable testing of ASP.net MVC controllers

Controller properties have all kinds of validations in the background.
In general, we don't user properties on our Controllers, so the easiest
way to allow for Autofixture-based testing of our Controllers is to just
omit setting all properties on them.

* Workaround for broken MemberAutoDataAttribute

https://github.com/AutoFixture/AutoFixture/pull/1164 shows that only
the first test case is pulled for this attribute.

This is a workaround that populates the provided parameters, left to
right, using AutoFixture to populate any remaining.

* WIP: Organization sponsorship flow

* Add Attribute to use the Bit Autodata dependency chain

BitAutoDataAttribute is used to mark a Theory as autopopulating
parameters.

Extract common attribute methods to to a helper class. Cannot
inherit a common base, since both require inheriting from different
Xunit base classes to work.

* WIP: scaffolding for families for enterprise sponsorship flow

* Fix broken tests

* Create sponsorship offer (#1688)

* Initial db work (#1687)

* Add organization sponsorship databases to all providers

* Generalize create and update for database, specialize in code

* Add PlanSponsorshipType to db model

* Write valid json for test entries

* Initial scaffolding of emails (#1686)

* Initial scaffolding of emails

* Work on adding models for FamilyForEnterprise emails

* Switch verbage

* Put preliminary copy in emails

* Skip test

* Families for enterprise/stripe integrations (#1699)

* Add PlanSponsorshipType to static store

* Add sponsorship type to token and creates sponsorship

* PascalCase properties

* Require sponsorship for remove

* Create subscription sponsorship helper class

* Handle Sponsored subscription changes

* Add sponsorship id to subscription metadata

* Make sponsoring references nullable

This state indicates that a sponsorship has lapsed, but was not able to
be reverted for billing reasons

* WIP: Validate and remove subscriptions

* Update sponsorships on organization and org user delete

* Add friendly name to organization sponsorship

* Add sponsorship available boolean to orgDetails

* Add sponsorship service to DI

* Use userId to find org users

* Send f4e offer email

* Simplify names of f4e mail messages

* Fix Stripe org default tax rates

* Universal sponsorship redeem api

* Populate user in current context

* Add product type to organization details

* Use upgrade path to change sponsorship

Sponsorships need to be annual to match the GB add-on charge rate

* Use organization and auth to find organization sponsorship

* Add resend sponsorship offer api endpoint

* Fix double email send

* Fix sponsorship upgrade options

* Add is sponsored item to subscription response

* Add sponsorship validation to upcoming invoice webhook

* Add sponsorship validation to upcoming invoice webhook

* Fix organization delete sponsorship hooks

* Test org sponsorship service

* Fix sproc

* Create common test infrastructure project

* Add helpers to further type PlanTypes

* Enable testing of ASP.net MVC controllers

Controller properties have all kinds of validations in the background.
In general, we don't user properties on our Controllers, so the easiest
way to allow for Autofixture-based testing of our Controllers is to just
omit setting all properties on them.

* Workaround for broken MemberAutoDataAttribute

https://github.com/AutoFixture/AutoFixture/pull/1164 shows that only
the first test case is pulled for this attribute.

This is a workaround that populates the provided parameters, left to
right, using AutoFixture to populate any remaining.

* WIP: Organization sponsorship flow

* Add Attribute to use the Bit Autodata dependency chain

BitAutoDataAttribute is used to mark a Theory as autopopulating
parameters.

Extract common attribute methods to to a helper class. Cannot
inherit a common base, since both require inheriting from different
Xunit base classes to work.

* WIP: scaffolding for families for enterprise sponsorship flow

* Fix broken tests

* Create sponsorship offer (#1688)

* Initial db work (#1687)

* Add organization sponsorship databases to all providers

* Generalize create and update for database, specialize in code

* Add PlanSponsorshipType to db model

* Write valid json for test entries

* Initial scaffolding of emails (#1686)

* Initial scaffolding of emails

* Work on adding models for FamilyForEnterprise emails

* Switch verbage

* Put preliminary copy in emails

* Skip test

* Families for enterprise/stripe integrations (#1699)

* Add PlanSponsorshipType to static store

* Add sponsorship type to token and creates sponsorship

* PascalCase properties

* Require sponsorship for remove

* Create subscription sponsorship helper class

* Handle Sponsored subscription changes

* Add sponsorship id to subscription metadata

* Make sponsoring references nullable

This state indicates that a sponsorship has lapsed, but was not able to
be reverted for billing reasons

* WIP: Validate and remove subscriptions

* Update sponsorships on organization and org user delete

* Add friendly name to organization sponsorship

* Add sponsorship available boolean to orgDetails

* Add sponsorship service to DI

* Use userId to find org users

* Send f4e offer email

* Simplify names of f4e mail messages

* Fix Stripe org default tax rates

* Universal sponsorship redeem api

* Populate user in current context

* Add product type to organization details

* Use upgrade path to change sponsorship

Sponsorships need to be annual to match the GB add-on charge rate

* Use organization and auth to find organization sponsorship

* Add resend sponsorship offer api endpoint

* Fix double email send

* Fix sponsorship upgrade options

* Add is sponsored item to subscription response

* Add sponsorship validation to upcoming invoice webhook

* Add sponsorship validation to upcoming invoice webhook

* Fix organization delete sponsorship hooks

* Test org sponsorship service

* Fix sproc

* Fix build error

* Update emails

* Fix tests

* Skip local test

* Add newline

* Fix stripe subscription update

* Finish emails

* Skip test

* Fix unit tests

* Remove unused variable

* Fix unit tests

* Switch to handlebars ifs

* Remove ending email

* Remove reconfirmation template

* Switch naming convention

* Switch naming convention

* Fix migration

* Update copy and links

* Switch to using Guid in the method

* Remove unneeded css styles

* Add sql files to Sql.sqlproj

* Removed old comments

* Made name more verbose

* Fix SQL error

* Move unit tests to service

* Fix sp

* Revert "Move unit tests to service"

This reverts commit 1185bf3ec8ca36ccd75717ed2463adf8885159a6.

* Do repository validation in service layer

* Fix tests

* Fix merge conflicts and remove TODO

* Remove unneeded models

* Fix spacing and formatting

* Switch Org -> Organization

* Remove single use variables

* Switch method name

* Fix Controller

* Switch to obfuscating email

* Fix unit tests

Co-authored-by: Justin Baur <admin@justinbaur.com>
2021-11-19 17:25:06 -05:00
Kyle Spearrin
7cc7b84eaf
use fixed-time comparison of secrets (#1698) 2021-11-08 15:55:42 -05:00
Joseph Flinn
d07a68e3cc
Add configuration support for QA cloud environment (#1572)
* Adding a QA environment specific configuration

* separating the bitwarden environment and stripe environment checks

* adding a logging statement for the PayPal webhook key check

* adding more logging

* switched logging type

* Changing the log level on the PayPal webhook. Removing the debugging log from the Stripe Controller
2021-09-08 13:09:54 -07:00
Chad Scharf
c09ae5f906
ReferenceEvent Rebilled missing data (#1240) 2021-03-24 15:27:16 -04:00
Matt Gibson
5537470703
Use sas token for attachment downloads (#1153)
* Get limited life attachment download URL

This change limits url download to a 1min lifetime.
This requires moving to a new container to allow for non-public blob
access.

Clients will have to call GetAttachmentData api function to receive the download
URL. For backwards compatibility, attachment URLs are still present, but will not
work for attachments stored in non-public access blobs.

* Make GlobalSettings interface for testing

* Test LocalAttachmentStorageService equivalence

* Remove comment

* Add missing globalSettings using

* Simplify default attachment container

* Default to attachments containe for existing methods

A new upload method will be made for uploading to attachments-v2.
For compatibility for clients which don't use these new methods, we need
to still use the old container. The new container will be used only for
new uploads

* Remove Default MetaData fixture.

* Keep attachments container blob-level security for all instances

* Close unclosed FileStream

* Favor default value for noop services
2021-02-22 15:35:16 -06:00
Addison Beck
fee5c932db
started charging sales tax on seat/storage upgrades and auto renewals (#1034)
* started charging sales tax on seat/storage upgrades and auto renewals

* Code review fixes for auto-renewing subscriptions charging sales tax
2020-12-09 14:04:46 -05:00
Kyle Spearrin
7cc9ce7bd5
check bitpay invoice status of complete (#892) 2020-08-26 11:35:38 -04:00
Chad Scharf
2742b414fd
reference event changes and cleanup (#823) 2020-07-15 12:38:45 -04:00
Chad Scharf
cdfde692a6 Fixed SDK reference issue in Billing proj 2020-05-13 09:58:17 -04:00
Chad Scharf
9800b752c0 Changed all C# control flow block statements to include space between keyword and open paren 2020-03-27 14:36:37 -04:00
Kyle Spearrin
57b246df20 preserve existing tags 2020-02-10 22:32:25 -05:00
Kyle Spearrin
ee18933fd1 fixes to freshdesk hook 2020-02-10 15:30:17 -05:00
Kyle Spearrin
16f718f2be freshdesk updates 2020-02-06 22:25:02 -05:00
Kyle Spearrin
abe624b739 leave a note on new tickets 2020-02-06 16:45:14 -05:00
Kyle Spearrin
726ce2510f freshdesk webhook improvements 2020-02-06 16:32:48 -05:00
Kyle Spearrin
b679c2b2db fixes for freshdesk endpoint 2020-02-06 16:28:44 -05:00
Kyle Spearrin
7dddf9fd8b freshdesk webhook endpoint 2020-02-06 16:03:02 -05:00
Kyle Spearrin
c5ae1b8283 prevent duplicate paypal charges 2020-01-17 21:16:26 -05:00
Kyle Spearrin
7fd6e4359d fix warnings 2020-01-10 08:47:58 -05:00
Kyle Spearrin
e2d65e5b08 switch to official bitpay light library 2019-12-19 10:27:06 -05:00
Kyle Spearrin
5bd43478c7 handle reversed transactions 2019-10-01 08:19:01 -04:00
Kyle Spearrin
091d6d318c fix info logger for apple iap 2019-09-23 14:30:04 -04:00
Kyle Spearrin
d04d92bb89 AttemptToPayInvoiceWithAppleReceipt 2019-09-23 09:03:18 -04:00
Kyle Spearrin
8d29eefb3a log json formatted 2019-09-19 16:43:06 -04:00
Kyle Spearrin
e1e147b78f log apple status update 2019-09-13 10:00:20 -04:00
Kyle Spearrin
a370dd1149 apple webhook key 2019-09-13 09:58:30 -04:00
Kyle Spearrin
2f7cd3ee95 stub out apple iap webhook 2019-09-13 09:56:01 -04:00
Kyle Spearrin
920debf2c9 upper card brand 2019-09-05 20:45:01 -04:00
Kyle Spearrin
cf9c8d8fe9 support PaymentMethodDetails in stripe webhook 2019-09-03 17:00:05 -04:00
Kyle Spearrin
ed86a5f9d5 add a delay to invoice.payment_succeeded hook 2019-09-02 08:41:06 -04:00
Kyle Spearrin
669a7c00d8 load fresh sub and invoices on webhooks 2019-08-20 11:09:02 -04:00
Kyle Spearrin
18e6149329 handle incomplete status in webhook 2019-08-12 10:45:05 -04:00
Kyle Spearrin
00e808d731 payment intent/method support for incomplete status 2019-08-09 23:56:26 -04:00
Kyle Spearrin
48ec345702 update stripe SDK 2019-08-08 17:36:41 -04:00
Kyle Spearrin
f78b212aa8 health checks for docker 2019-07-26 11:59:42 -04:00
Kyle Spearrin
e242539b84 check if already paid 2019-06-17 08:19:26 -04:00
Kyle Spearrin
377e6ff697 handle invoice already paid error 2019-06-17 08:15:56 -04:00
Kyle Spearrin
4b6edace09 handle refund echecks 2019-04-01 09:46:02 -04:00
Kyle Spearrin
9916668a7a more stripe logging 2019-02-28 20:49:39 -05:00
Kyle Spearrin
4084a01d7a replace paypal webhook with ipn 2019-02-27 14:55:23 -05:00
Kyle Spearrin
25ea96f1bd support for sources in webhooks 2019-02-27 10:11:45 -05:00
Kyle Spearrin
b028696891 assign credit type for account credit 2019-02-23 20:24:34 -05:00
Kyle Spearrin
2f5410de28 GetTransactionDate 2019-02-23 13:57:59 -05:00
Kyle Spearrin
b4f026a946 add transaction currency to details 2019-02-23 10:21:06 -05:00
Kyle Spearrin
bc3e6f349c no hash 2019-02-23 08:01:23 -05:00
Kyle Spearrin
71667628f9 bitpay invoice id 2019-02-23 08:00:25 -05:00