Commit Graph

140 Commits

Author SHA1 Message Date
Sasha Weiss
4e4cb470a2
Block donations above a maximum amount via SEPA 2023-11-13 14:24:18 -08:00
Sasha Weiss
30680635f8
Prevent donation-complete sheets from popping on subscription renewal 2023-11-09 15:26:46 -08:00
Sasha Weiss
9b2722c3f2
Only use FeatureFlag to determine SEPA availability 2023-11-08 17:48:01 -08:00
Sasha Weiss
65c977f2e7
SEPA donation fixes and charge failure codes in error sheets 2023-11-08 19:33:11 -06:00
Pete Walters
082d86411d
Add remote config flag for SEPA supported regions
Co-authored-by: Elaine <elaine@signal.org>
2023-11-06 18:52:06 -06:00
Sasha Weiss
7f41ecaa8b
Support SEPA bank transfer donations 2023-11-06 13:49:40 -08:00
Elaine
9c7c54efb7
Add donation bank transfer mandate 2023-11-03 16:15:23 -06:00
Elaine
5c6e63720e
Redesign donation payment details input 2023-11-02 13:01:53 -06:00
Max Radermacher
7d94cf95e3
Remove 6 redundant methods from protocol DB 2023-10-31 00:44:09 -05:00
Sasha Weiss
696a2391b8
Fetch chargeFailure from service, rather than storing locally 2023-10-27 12:43:23 -07:00
Sasha Weiss
70ecfd5a3b
Clean up and document subscription receipt credential redemption 2023-10-24 15:32:53 -07:00
Elaine
6563addcde
Rewrite subscription request factory in Swift 2023-10-05 10:08:01 -06:00
Harry
aa0e250cb7
[Death to TSAccountManager, long live TSAccountManager][9] Migrate usages of old TSAccountManager to new 2023-10-05 08:56:08 -07:00
Sasha Weiss
6c305b12ba
Silently allow unrecognized payment method strings 2023-09-28 15:24:22 -07:00
Pete Walters
43b7f38ac9
Remove uses of sharedBackground queues. 2023-09-28 07:46:52 -05:00
Sasha Weiss
e2ee1f8660
Remove extra check before canceling subscription 2023-08-23 13:45:31 -05:00
Harry
f728457039
Update build target to iOS 13.0 2023-06-08 16:21:20 -07:00
Igor Solomennikov
7790837eb5
Remove unnecessary "@objc" in SignalMessaging. 2023-05-16 16:41:49 -07:00
Evan Hahn
ea970bbd02
Clean up "set default subscription payment method" request. 2023-04-24 15:50:26 -07:00
Sasha Weiss
c9fbc9a9ee
Migrate SSKJobRecord and subclasses to SDSCodableModel using factory init 2023-04-13 10:57:48 -07:00
Max Radermacher
b815f45f5b Populate SubscriptionManager caches earlier 2023-04-11 13:26:40 -07:00
Max Radermacher
fa7f0e98fa
Clear “display badge” when your last badge expires
Also, explicitly track “old badges” vs. “new badges” when redeeming.
2023-03-23 00:32:42 -07:00
Sasha Weiss
8047472f68
Rename SubscriptionManagerProtocol 2023-03-14 17:44:38 -07:00
Harry
a146e18aaf
Set up account state and exit registration
* Go to chat list view after registration

* sync system contacts during registration

* Use explicit local credentials for storage service operations during registration

* fix tests

* Quick hack to get through double pin confirmation

* Finishing touches

* lint

* fix build

* reload phone number discoverability after storage service sync

* fix tests again

* Take chat auth on account and contact record initializers

* Change around branches for clarity in OWSUserProfile

* pr comments

* Split ChatServiceAuth into the same and AuthedAccount

* fix tests

* merge woes
2023-03-09 21:54:51 -08:00
Harry
003cc19e62
Update SignalCoreKit. Use explicit DispatchQueue instead of relying on the implicit type on promise 'on' params
* Use explicit DispatchQueue instead of relying on the implicit type on promise 'on' params

* Update SignalCoreKit
2023-02-07 16:14:39 -08:00
Pete Walters
ac919fcf43
Update Donation UI to handle inactive/failed payments
The Donations screen doesn't currently handle backend
subscription failures well. An example of this is when
the backend encounters a repeated payment processing
failure. Currently, in these situations the donation
screens will display an active donation along with the
renewal date.

To remedy this, the UI now checks that the subscription
status is 'active' before displaying any of the
active subscription UI.
2023-02-06 13:31:07 -06:00
Evan Hahn
cc92abdc90
Clean up "delete subscriber ID" request
This is similar to 227f05e932.

This change should have no user impact.

This changes the "delete subscriber ID" request in the following ways:

- Adds tests
- Converts it to Swift
- Renames `deleteSubscriptionIDRequest` to `deleteSubscriberID`
- Serializes the data inside the method, rather than requiring callers
  to do so
2023-01-27 15:11:48 -08:00
Evan Hahn
227f05e932 Clean up "set subscriber ID" request
This change should have no user impact.

This changes the "set subscriber ID" request in the following ways:

- Adds tests
- Converts it to Swift
- Renames `setSubscriptionIDRequest` to `setSubscriberID`
- Serializes the data inside the method, rather than requiring callers
  to do so

Tested this with automated tests and manually starting a subscription in
staging.
2023-01-26 13:45:25 -06:00
Evan Hahn
35c314bde5
Clean up donation configuration request
This change should have no user impact.

This changes a few things about
`OWSRequestFactory.donationConfigurationRequest()`:

- Adds tests
- Converts it to Swift
- Renames it to `donationConfiguration()`
- Makes it an unauthenticated request

I'm most concerned about that last thing, because it's a behavior
change. However, I think this is safe because:

1. I tested it in a simulator and it works

2. [Android appears to do the same thing][0]

3. A normal `curl` works just fine:

   ```
   curl --insecure 'https://chat.signal.org/v1/subscription/configuration'
   ```

[0]: 657c5d2bce/libsignal/service/src/main/java/org/whispersystems/signalservice/internal/push/PushServiceSocket.java (L1074)
2023-01-25 13:10:22 -06:00
Evan Hahn
43cea3fa7c Remove unused parameter from subscription method
This change should have no user impact.

This argument was never used so we can remove it.

I also fixed a doc comment. It wasn't exactly wrong, but it wasn't
parsed as intended.
2023-01-21 16:13:41 -06:00
Evan Hahn
bdbb13e03f
Donations: enqueue storage syncs outside database writes
This change should have no user impact except a *very* small speedup.

Previously, we were inconsistent in this file. Now, we always call
`recordPendingLocalAccountUpdates()` outside of a write transaction.
2023-01-20 18:27:21 -08:00
Evan Hahn
ac3e0a67c1 Fix compilation errors for PayPal code
We merged 6e97ff3c8f and
bcbf52101e in rapid succession, which
caused compilation errors.

This fixes those.
2023-01-18 17:49:30 -06:00
Sasha Weiss
bcbf52101e
PayPal recurring donations
Co-Authored-By: Evan Hahn <evanhahn@signal.org>
2023-01-18 14:48:50 -08:00
Evan Hahn
6e97ff3c8f
Gifting: add PayPal support 2023-01-18 16:38:57 -06:00
Evan Hahn
aa8bb0d892
Remove unnecessary throws from Stripe method
`Stripe.confirmPaymentIntent` was marked `throws` unnecessarily. This
removes it to simplify the code slightly.
2023-01-17 13:57:32 -06:00
Sasha Weiss
818e7b5d8f
Remove SubscriptionManager.terminateTransactionIfPossible 2022-12-22 14:39:53 -08:00
Evan Hahn
8c7c35b887 Show better errors for credit/debit card failures
For example, if we get the `expired_card` error code back from Stripe,
we should show a specific error to the user.

This introduces some TODOs around error messages in a couple of spots.
We will revisit this when implementing PayPal monthly donations, as is
explained in the comments.

I tested this by using some of [Stripe's test numbers][0] (as well as
automated tests).

[0]: https://stripe.com/docs/testing#declined-payments
2022-12-13 15:45:24 -06:00
Evan Hahn
9f292a91cd Change error string for minimum donation amount
Before, the error said "Select a larger amount to donate."

Now the error says something like "The minimum amount you can donate is
$3."
2022-12-12 15:46:32 -06:00
Sasha Weiss
e8a4a7588f
Hold a reference to an in-progress ASWebAuthenticationSession 2022-12-06 16:56:24 -08:00
Sasha Weiss
7be776dd68
Use a custom scheme to complete the PayPal auth flow 2022-12-06 13:41:24 -08:00
Evan Hahn
e44da4bae9 Add "Donations" to PayPal errors and log messages
I also added a few log messages (which can replace some comments).
2022-12-02 15:50:45 -06:00
sashaweiss-signal
dc3e588f64 Users must confirm PayPal donation before donating
Co-authored-by: Evan Hahn <evanhahn@signal.org>
2022-12-02 15:27:03 -06:00
sashaweiss-signal
eea184165d Disable PayPal for iOS 13- 2022-12-02 15:01:29 -06:00
Sasha Weiss
67143d376d Add remote-config kill switch for all donation types and methods 2022-12-01 14:39:03 -08:00
Sasha Weiss
ee4799b506 One-time donations via PayPal 2022-12-01 14:39:03 -08:00
Sasha Weiss
40e765fa4f Integrate the /v1/subscription/configuration API 2022-12-01 14:39:03 -08:00
Sasha Weiss
b143e585d9 Only allow PayPal for one-time and gift donations 2022-12-01 14:39:03 -08:00
Sasha Weiss
da63036758 Move money amounts to DonationUtilities instead of Stripe 2022-12-01 14:39:03 -08:00
Sasha Weiss
3e75273150 Add a no-op PayPal donations button 2022-12-01 14:39:03 -08:00
Evan Hahn
f4e83f6bcb Enable card donations for external users
This enables credit/debit card donations for external users.

It also adds a kill switch, just in case.
2022-11-30 12:54:18 -06:00