brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.58k stars 2.28k forks source link

Rewards client should accept 2xx as success from Uphold endpoints #35834

Closed zenparsing closed 7 months ago

zenparsing commented 7 months ago

Subtask of https://github.com/brave/brave-browser/issues/35542

Since Uphold will be updating their endpoints, we need to update our client implementation to accept any 2xx status code as successful.

LaurenWags commented 6 months ago

Discussed with @GeetaSarvadnya - Will divide the testing from https://github.com/brave/brave-core/pull/21926 on Windows and macOS as follows:

On Linux we can just do the regression testing of Uphold connection (existing account only, not new account) and tipping flows as mentioned via https://github.com/brave/brave-core/pull/21926.

LaurenWags commented 6 months ago

Verified with

Brave | 1.64.90 Chromium: 122.0.6261.94 (Official Build) beta (x86_64)
-- | --
Revision | 726c6970a1e9c057c69d80e03ad95a7c561fbfe7
OS | macOS Version 13.6.4 (Build 22G513)

Note, confirmed with @zenparsing that the below (from the Connect flow) are hidden from logs, so if general regression testing is successful (connecting existing account, connecting new account, tipping, etc), then these can be considered working as expected:

Connect existing Uphold account ("Brave Browser" card already created) - PASSED 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect existing Uphold sandbox account ("Brave Browser" card already exists on Uphold) 4. Watch logs 5. Confirm successful connection to Uphold `GET https://api-sandbox.uphold.com/v0/me/capabilities` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/cards/{wallet address}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16........ > Method: GET [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16........ > Method: GET ``` Screenshot 2024-02-29 at 12 53 18 PM
Connect new Uphold account ("Brave Browser" card not already created) - PASSED 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect a newly created Uphold sandbox account ("Brave Browser" card does not already exist on Uphold) - note, may need to reach out to the team for help verifying new acct. 4. Watch logs 5. Confirm successful connection to Uphold `GET https://api-sandbox.uphold.com/v0/me/capabilities` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Result: Success > HTTP Code: 200 > Body: [] [33959:259:0229/141633.332940:VERBOSE1:uphold_card.cc(40)] Couldn't get BAT card ID ``` `PATCH https://api-sandbox.uphold.com/v0/me/cards` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/df........ > Method: PATCH > Content: {"settings":{"position":1,"starred":true}} > Content Type: application/json; charset=utf-8 [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/df......... > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/cards/{wallet_address}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/df....... > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/df........ > Result: Success > HTTP Code: 200 ``` Screenshot 2024-02-29 at 2 29 16 PM
One-time tip with Uphold - PASSED 1. Continue from "existing account" case above 2. Navigate to a site that is verified with Uphold 3. Do a one-time tip for this site 4. Watch the logs 5. Ensure tip is successful `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions` ``` [33348:259:0229/132748.013243:VERBOSE1:contribution.cc(513)] Creating contribution for wallet type uphold (amount: 0.5, type: ONE_TIME_TIP) [33348:259:0229/132748.017071:VERBOSE1:contribution.cc(137)] Queue timer set for 2 s [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16............./transactions > Method: POST > Content: {"denomination":{"amount":"0.475","currency":"BAT"},"destination":"abf1ff79-a239-42af-abff-20eb121edd1c"} > Content Type: application/json; charset=utf-8 [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16.........../transactions > Result: Success > HTTP Code: 202 ``` `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions/{transaction-id}/commit` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16........../transactions/72cbf6c5-a4aa-4026-9cf7-4beb734380e6/commit > Method: POST [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16.........../transactions/72cbf6c5-a4aa-4026-9cf7-4beb734380e6/commit > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/transactions/{transaction-id}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/72cbf6c5-a4aa-4026-9cf7-4beb734380e6 > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/72cbf6c5-a4aa-4026-9cf7-4beb734380e6 > Result: Success > HTTP Code: 200 ``` Note - I didn't post the logs for the 5% fee portion of the tip as they make the same calls as above. I did confirm that they were successful. Example | Example | Example --- | --- | --- Screenshot 2024-02-29 at 1 38 06 PM | Screenshot 2024-02-29 at 1 38 16 PM | Screenshot 2024-02-29 at 1 38 37 PM
Recurring tip with Uphold - PASSED Note, depending on how long you spend on the verified site, you may also be able to combine this test with the AutoContribution test. Although for the AC test, please do use multiple sites in the list, not just one. I separated the recurring tip and AC checks though, I did not combine them. 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect an Uphold account 4. Navigate to a site that is verified with Uphold 5. Add a recurring tip for this site 6. Watch the logs 7. Confirm tip is successful and a tip is set up for next month `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions` ``` [36285:259:0301/081131.684131:VERBOSE1:contribution.cc(513)] Creating contribution for wallet type uphold (amount: 0.5, type: ONE_TIME_TIP) [36285:259:0301/081131.687970:VERBOSE1:contribution.cc(137)] Queue timer set for 4 s [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16................./transactions > Method: POST > Content: {"denomination":{"amount":"0.475","currency":"BAT"},"destination":"abf1ff79-a239-42af-abff-20eb121edd1c"} > Content Type: application/json; charset=utf-8 [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16.............../transactions > Result: Success > HTTP Code: 202 ``` `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions/{transaction-id}/commit` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16......../transactions/464ede9d-bf12-4c67-b96a-5f7aa290bca9/commit > Method: POST [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16......../transactions/464ede9d-bf12-4c67-b96a-5f7aa290bca9/commit > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/transactions/{transaction-id}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/464ede9d-bf12-4c67-b96a-5f7aa290bca9 > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/464ede9d-bf12-4c67-b96a-5f7aa290bca9 > Result: Success > HTTP Code: 200 ``` Note - I didn't post the logs for the 5% fee portion of the tip as they make the same calls as above. I did confirm that they were successful. Example | Example | Example --- | --- | --- Screenshot 2024-03-01 at 8 18 58 AM | Screenshot 2024-03-01 at 8 19 21 AM | Screenshot 2024-03-01 at 8 19 42 AM 8. Close browser 9. Advance computer clock so next month's tip gets triggered 10. Confirm recurring tip is sent and a tip is set up for the following month `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions` ``` [37879:259:0331/112712.493747:VERBOSE1:contribution.cc(513)] Creating contribution for wallet type uphold (amount: 0.5, type: RECURRING_TIP) [37879:259:0331/112712.496596:VERBOSE1:contribution.cc(137)] Queue timer set for 7 s [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16.........../transactions > Method: POST > Content: {"denomination":{"amount":"0.475","currency":"BAT"},"destination":"abf1ff79-a239-42af-abff-20eb121edd1c"} > Content Type: application/json; charset=utf-8 [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16.........../transactions > Result: Success > HTTP Code: 202 ``` `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions/{transaction-id}/commit` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16.........../transactions/cf49dfc4-8a92-4253-82cd-306f30488783/commit > Method: POST [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16.........../transactions/cf49dfc4-8a92-4253-82cd-306f30488783/commit > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/transactions/{transaction-id}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/cf49dfc4-8a92-4253-82cd-306f30488783 > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/cf49dfc4-8a92-4253-82cd-306f30488783 > Result: Success > HTTP Code: 200 ``` Note - I didn't post the logs for the 5% fee portion of the tip as they make the same calls as above. I did confirm that they were successful. Also confirmed that another recurring tip is scheduled for the following month (April in this case) Example | Example | Example --- | --- | --- Screenshot 2024-03-31 at 11 30 55 AM | Screenshot 2024-03-31 at 11 31 02 AM | Screenshot 2024-03-31 at 11 31 38 AM
AutoContribution with Uphold - PASSED 1. Launch a fresh profile, close and relaunch to pull griffin (note, launch with appropriate command line flags to trigger AC, else you will have to do system clock manipulation) 2. Join rewards (staging env) 3. Connect an Uphold account 4. Visit several verified sites (3-6) so that your AC list populates 5. Adjust monthly budget value for AC so multiple sites will get contributions Screenshot 2024-03-01 at 12 11 35 PM 6. Wait for AC to occur (or adjust system clock depending on how you started this test) - Note, without shortening retries, this can take awhile. Logs will tell you how long each retry attempt will take. `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions` ``` [38614:259:0301/121358.828466:VERBOSE1:contribution.cc(513)] Creating contribution for wallet type uphold (amount: 3, type: AUTO_CONTRIBUTE) [38614:259:0301/121358.832007:VERBOSE1:contribution.cc(137)] Queue timer set for 18 s [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16................/transactions > Method: POST > Content: {"denomination":{"amount":"3","currency":"BAT"},"destination":"6654ecb0-6079-4f6c-ba58-791cc890a561"} > Content Type: application/json; charset=utf-8 [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16................/transactions > Result: Success > HTTP Code: 202 ``` `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions/{transaction-id}/commit` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16........../transactions/2b9b6df6-6cf0-40fb-a660-d3454e0eb07c/commit > Method: POST [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16........../transactions/2b9b6df6-6cf0-40fb-a660-d3454e0eb07c/commit > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/transactions/{transaction-id}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/2b9b6df6-6cf0-40fb-a660-d3454e0eb07c > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/2b9b6df6-6cf0-40fb-a660-d3454e0eb07c > Result: Success > HTTP Code: 200 ``` I am not posting all of the voting logs for AC as they are all on the Brave side and only the Uphold specific logs were needed to confirm the above, but I did wait until they all completed to confirm AC processed successfully. Example | Example | Example | Example --- | --- | --- | --- Screenshot 2024-03-01 at 12 53 11 PM | Screenshot 2024-03-01 at 12 53 22 PM | Screenshot 2024-03-01 at 12 53 35 PM | Screenshot 2024-03-01 at 12 54 05 PM
Connect Flow - Proxy select endpoints - PASSED Create a re-write rule using Charles Proxy (or similar) for each of the below individually so that the response is changed to `206`.
GET https://api-sandbox.uphold.com/v0/me/capabilities - PASSED Re-write rule: 1 | Screenshot 2024-03-01 at 1 59 24 PM --- | --- 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect to Uphold 4. Watch logs 5. Confirm successful connection to Uphold `GET https://api-sandbox.uphold.com/v0/me/capabilities` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Result: Success > HTTP Code: 206 ``` Example | Example --- | --- Screenshot 2024-03-01 at 1 59 35 PM | Screenshot 2024-03-01 at 2 00 34 PM
GET https://api-sandbox.uphold.com/v0/me/cards/{wallet_address} - PASSED Re-write rule: 2 | Screenshot 2024-03-01 at 2 04 56 PM --- | --- 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect to Uphold 4. Watch logs 5. Confirm successful connection to Uphold `GET https://api-sandbox.uphold.com/v0/me/cards/{wallet_address}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16........... > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/16............ > Result: Success > HTTP Code: 206 ``` Example | Example --- | --- Screenshot 2024-03-01 at 2 12 27 PM | Screenshot 2024-03-01 at 2 12 38 PM
GET https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT - PASSED Re-write rule: Screenshot 2024-03-01 at 2 52 51 PM | Screenshot 2024-03-01 at 2 49 32 PM --- | --- 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect to Uphold 4. Watch logs 5. Confirm successful connection to Uphold `GET https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Result: Success > HTTP Code: 206 ``` Example | Example --- | --- Screenshot 2024-03-01 at 2 51 38 PM | Screenshot 2024-03-01 at 2 51 48 PM
GET https://api-sandbox.uphold.com/v0/me - PASSED Re-write rule: Screenshot 2024-03-01 at 3 01 10 PM | Screenshot 2024-03-01 at 3 01 19 PM --- | --- 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect to Uphold 4. Watch logs 5. Confirm successful connection to Uphold Note - no logs as this information was stripped from them. Example | Example --- | --- Screenshot 2024-03-01 at 3 00 31 PM | Screenshot 2024-03-01 at 3 00 51 PM
Tip Flow - Proxy select endpoints - PASSED Create a re-write rule using Charles Proxy (or similar) so that the response is changed to `206`.
GET https://api-sandbox.uphold.com/v0/me/transactions/{transaction-id} - PASSED Re-write rule: Screenshot 2024-03-01 at 3 11 07 PM | Screenshot 2024-03-01 at 3 11 16 PM --- | --- 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect to Uphold 4. Confirm successful connection to Uphold 5. Tip an Uphold verified creator 6. Watch logs 7. Confirm tip is successful `GET https://api-sandbox.uphold.com/v0/me/transactions/{transaction-id}` 95% of tip amount: ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/5f110a8b-1557-4c61-b0ab-0b1b7cec379e > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/5f110a8b-1557-4c61-b0ab-0b1b7cec379e > Result: Success > HTTP Code: 206 ``` 5% of tip amount (fee): ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/e7f55ee2-28b7-45c7-83ea-3c44b0d66f62 > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/e7f55ee2-28b7-45c7-83ea-3c44b0d66f62 > Result: Success > HTTP Code: 206 ``` Example | Example | Example | Example --- | --- | --- | --- Screenshot 2024-03-01 at 3 20 58 PM | Screenshot 2024-03-01 at 3 21 05 PM | Screenshot 2024-03-01 at 3 21 34 PM | Screenshot 2024-03-01 at 3 22 03 PM
btlechowski commented 6 months ago

Verified with

Brave 1.64.91 Chromium: 122.0.6261.94 (Official Build) beta (64-bit)
Revision 939586e20d208404b83713ea05cf5f6fa7fe3dd5
OS Linux

Per internal discussion only limited number of test cases were performed

Connect existing Uphold account ("Brave Browser" card already created) - PASSED 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect existing Uphold sandbox account ("Brave Browser" card already exists on Uphold) 4. Watch logs 5. Confirm successful connection to Uphold `GET https://api-sandbox.uphold.com/v0/me/capabilities` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Method: GET [10998:10998:0304/185420.066344:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Result: Success > HTTP Code: 200 > Body: [{"category":"features","enabled":true,"key":"change_phone","name":"Change Phone","requirements":[],"restrictions":[]},{"category":"features","enabled":true,"key":"change_pii","name":"ChangePII","requirements":["user-must-enable-two-factor-authentication"],"restrictions":[]},{"category":"features","enabled":true,"key":"credit_card","name":"Credit Card","requirements":["user-must-submit-phone-number"],"restrictions":[]},{"category":"features","enabled":false,"key":"equities","name":"Equities","requirements":[],"restrictions":["temporarily-disabled"]},{"category":"features","enabled":true,"key":"google_pay","name":"Google Pay","requirements":[],"restrictions":[]},{"category":"features","enabled":true,"key":"limit_orders","name":"Limit Orders","requirements":[],"restrictions":[]},{"category":"features","enabled":false,"key":"physical_card","name":"Physical Card","requirements":[],"restrictions":["user-country-not-supported"]},{"category":"features","enabled":false,"key":"physical_card_eea","name":"Physical Card EEA","requirements":[],"restrictions":["user-country-not-supported"]},{"category":"features","enabled":false,"key":"physical_card_uk","name":"Physical Card UK","requirements":[],"restrictions":["user-country-not-supported"]},{"category":"features","enabled":false,"key":"physical_card_us","name":"Physical Card US","requirements":[],"restrictions":["user-country-not-supported"]},{"category":"features","enabled":true,"key":"referrals","name":"Referrals","requirements":[],"restrictions":[]},{"category":"features","enabled":true,"key":"sms_2fa","name":"SMS 2FA","requirements":["user-must-submit-phone-number"],"restrictions":[]},{"category":"features","enabled":true,"key":"staking","name":"Staking","requirements":[],"restrictions":[]},{"category":"features","enabled":true,"key":"vault","name":"Vault","requirements":[],"restrictions":[]},{"category":"features","enabled":true,"key":"virtual_iban","name":"Virtual IBAN","requirements":["user-must-accept-virtual-iban-terms-of-services"],"restrictions":[]},{"category":"permissions","enabled":true,"key":"deposits","name":"Deposits","requirements":[],"restrictions":[]},{"category":"permissions","enabled":true,"key":"invites","name":"Invites","requirements":[],"restrictions":[]},{"category":"permissions","enabled":true,"key":"receives","name":"Receives","requirements":[],"restrictions":[]},{"category":"permissions","enabled":true,"key":"sends","name":"Sends","requirements":[],"restrictions":[]},{"category":"permissions","enabled":true,"key":"trades","name":"Trades","requirements":[],"restrictions":[]},{"category":"permissions","enabled":true,"key":"bank_withdrawals","name":"Withdraw to bank","requirements":[],"restrictions":[]},{"category":"permissions","enabled":false,"key":"credit_card_withdrawals","name":"Withdraw to credit card","requirements":[],"restrictions":["user-country-not-supported"]},{"category":"permissions","enabled":true,"key":"crypto_withdrawals","name":"Withdraw to crypto networks","requirements":[],"restrictions":[]}] [10998:10998:0304/185420.077096:VERBOSE2:ads_service_impl.cc(1140)] Canceled timeout for notification ad with placement id 9e03451a-a72b-4a22-84ea-b2dc791b96b2 [10998:10998:0304/185420.082834:VERBOSE1:url_loader.cc(72)] ``` `GET https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Result: Success > HTTP Code: 200 > Body: [{"CreatedByApplicationId":"193a77cf-02e8-4e10-8127-8a1b5a8bfece","address":{"ethereum":"0x2389D6cCA77f595C87F6542BE097515932570C51","wire":"UH3C41037A"},"available":"10.1","balance":"10.1","currency":"BAT","id":"fbd1546c-6706-4267-9e6c-3eda44945283","label":"Brave Browser","lastTransactionAt":"2023-02-23T15:15:59.602Z","normalized":[{"available":"2.96","balance":"2.96","currency":"EUR"}],"settings":{"position":1,"protected":false,"starred":false},"wire":[{"accountName":"Uphold Europe Limited","address":{"line1":"Tartu mnt 2","line2":"10145 Tallinn, Estonia"},"bic":"LHVBEE22","currency":"EUR","iban":"EE76 7700 7710 0159 0178","name":"AS LHV Pank"},{"accountName":"Uphold Europe Limited","accountNumber":"00000083","address":{"line1":"1 Angel Court","line2":"London, United Kingdom, EC2R 7HJ"},"bic":"LHVBEE22","currency":"GBP","iban":"EE76 7700 7710 0159 0178","name":"LHV BANK LIMITED","sortCode":"040300"}]}] [10998:10998:0304/185420.883766:VERBOSE1:url_loader.cc(72)] ``` `GET https://api-sandbox.uphold.com/v0/me/cards/{wallet address}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/fbd > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/fbd > Result: Success > HTTP Code: 200 > Body: {"CreatedByApplicationId":"193a77cf-02e8-4e10-8127-8a1b5a8bfece","address":{"ethereum":"0x2389D6cCA77f595C87F6542BE097515932570C51","wire":"UH3C41037A"},"available":"10.1","balance":"10.1","currency":"BAT","id":"fbd1546c-6706-4267-9e6c-3eda44945283","label":"Brave Browser","lastTransactionAt":"2023-02-23T15:15:59.602Z","normalized":[{"available":"2.96","balance":"2.96","currency":"EUR"}],"settings":{"position":1,"protected":false,"starred":false},"wire":[{"accountName":"Uphold Europe Limited","address":{"line1":"Tartu mnt 2","line2":"10145 Tallinn, Estonia"},"bic":"LHVBEE22","currency":"EUR","iban":"EE76 7700 7710 0159 0178","name":"AS LHV Pank"},{"accountName":"Uphold Europe Limited","accountNumber":"00000083","address":{"line1":"1 Angel Court","line2":"London, United Kingdom, EC2R 7HJ"},"bic":"LHVBEE22","currency":"GBP","iban":"EE76 7700 7710 0159 0178","name":"LHV BANK LIMITED","sortCode":"040300"}]} [10998:10998:0304/185423.445675:VERBOSE1:url_loader.cc(111)] ``` ![image](https://github.com/brave/brave-browser/assets/34715963/56ec54aa-db54-457b-aade-4e6f82428f5c)
One-time tip with Uphold - PASSED 1. Continue from "existing account" case above 2. Navigate to a site that is verified with Uphold 3. Do a one-time tip for this site 4. Watch the logs 5. Ensure tip is successful `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions` ``` [10998:10998:0304/190617.727884:VERBOSE1:contribution.cc(513)] Creating contribution for wallet type uphold (amount: 0.25, type: ONE_TIME_TIP) [10998:10998:0304/190617.772776:VERBOSE1:contribution.cc(137)] Queue timer set for 5 s [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/fbd1546c-6706-4267-9e6c-3eda44945283/transactions > Method: POST > Content: {"denomination":{"amount":"0.2375","currency":"BAT"},"destination":"abf1ff79-a239-42af-abff-20eb121edd1c"} > Content Type: application/json; charset=utf-8 [10998:10998:0304/190618.506518:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/fbd1546c-6706-4267-9e6c-3eda44945283/transactions > Result: Success > HTTP Code: 202 > Body: {"application":{"clientId":"4c2b665ca060d912fec5c735c734859a06118cc8","name":"Brave Browser"},"createdAt":"2024-03-04T18:06:18.184Z","denomination":{"amount":"0.2375","currency":"BAT","pair":"BATBAT","rate":"1.00","target":"origin"},"destination":{"amount":"0.2375","base":"0.2375","commission":"0.00","currency":"BAT","description":"Uphold Member","fee":"0.00","node":{"type":"anonymous"},"rate":"1.00","type":"anonymous"},"fees":[],"id":"b1d0d73a-14ce-4a2b-b5bd-8f0da7a6307b","network":"uphold","normalized":[{"amount":"0.08","commission":"0.00","currency":"USD","fee":"0.00","rate":"0.32139565340000000000","target":"origin"}],"origin":{"CardId":"fbd1546c-6706-4267-9e6c-3eda44945283","amount":"0.2375","base":"0.2375","commission":"0.00","currency":"BAT","description":"Bartlomiej Lechowski","fee":"0.00","isMember":true,"node":{"id":"fbd1546c-6706-4267-9e6c-3eda44945283","type":"card","user":{"id":"2cd89356-c8f6-46f0-b8f5-0d524d9b03cf"}},"rate":"1.00","sources":[],"type":"card"},"params":{"currency":"BAT","pair":"BATBAT","rate":"1.00","ttl":3599997,"type":"internal"},"priority":"normal","status":"pending","type":"transfer"} [10998:10998:0304/190618.547702:VERBOSE1:url_loader.cc(72)] ``` `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions/{transaction-id}/commit` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/fbd1546c-6706-4267-9e6c-3eda44945283/transactions/b1d0d73a-14ce-4a2b-b5bd-8f0da7a6307b/commit > Method: POST [10998:10998:0304/190619.871535:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/fbd1546c-6706-4267-9e6c-3eda44945283/transactions/b1d0d73a-14ce-4a2b-b5bd-8f0da7a6307b/commit > Result: Success > HTTP Code: 200 > Body: {"application":{"clientId":"4c2b665ca060d912fec5c735c734859a06118cc8","name":"Brave Browser"},"createdAt":"2024-03-04T18:06:19.134Z","denomination":{"amount":"0.2375","currency":"BAT","pair":"BATBAT","rate":"1.00","target":"origin"},"destination":{"amount":"0.2375","base":"0.2375","commission":"0.00","currency":"BAT","description":"Uphold Member","fee":"0.00","node":{"type":"anonymous"},"rate":"1.00","type":"anonymous"},"fees":[],"id":"b1d0d73a-14ce-4a2b-b5bd-8f0da7a6307b","message":null,"network":"uphold","normalized":[{"amount":"0.08","commission":"0.00","currency":"USD","fee":"0.00","rate":"0.32139565340000000000","target":"origin"}],"order":null,"origin":{"CardId":"fbd1546c-6706-4267-9e6c-3eda44945283","amount":"0.2375","base":"0.2375","commission":"0.00","currency":"BAT","description":"Bartlomiej Lechowski","fee":"0.00","isMember":true,"node":{"id":"fbd1546c-6706-4267-9e6c-3eda44945283","type":"card","user":{"id":"2cd89356-c8f6-46f0-b8f5-0d524d9b03cf"}},"rate":"1.00","sources":[{"amount":"0.2375","id":"6fe88024-cfb0-4cac-a95f-4d5cc0115225"}],"type":"card"},"params":{"currency":"BAT","pair":"BATBAT","progress":"0","rate":"1.00","ttl":3599997,"type":"internal"},"priority":"normal","reference":null,"status":"processing","type":"transfer"} ``` `GET https://api-sandbox.uphold.com/v0/me/transactions/{transaction-id}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/b1d0d73a-14ce-4a2b-b5bd-8f0da7a6307b > Method: GET [10998:10998:0304/190631.101107:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/b1d0d73a-14ce-4a2b-b5bd-8f0da7a6307b > Result: Success > HTTP Code: 200 > Body: {"application":{"clientId":"4c2b665ca060d912fec5c735c734859a06118cc8","name":"Brave Browser"},"createdAt":"2024-03-04T18:06:19.134Z","denomination":{"amount":"0.2375","currency":"BAT","pair":"BATBAT","rate":"1.00","target":"origin"},"destination":{"amount":"0.2375","base":"0.2375","commission":"0.00","currency":"BAT","description":"Uphold Member","fee":"0.00","node":{"type":"anonymous"},"rate":"1.00","type":"anonymous"},"fees":[],"id":"b1d0d73a-14ce-4a2b-b5bd-8f0da7a6307b","message":null,"network":"uphold","normalized":[{"amount":"0.08","commission":"0.00","currency":"USD","fee":"0.00","rate":"0.32139565340000000000","target":"origin"}],"order":null,"origin":{"CardId":"fbd1546c-6706-4267-9e6c-3eda44945283","amount":"0.2375","base":"0.2375","commission":"0.00","currency":"BAT","description":"Bartlomiej Lechowski","fee":"0.00","isMember":true,"node":{"id":"fbd1546c-6706-4267-9e6c-3eda44945283","type":"card","user":{"id":"2cd89356-c8f6-46f0-b8f5-0d524d9b03cf"}},"rate":"1.00","sources":[{"amount":"0.2375","id":"6fe88024-cfb0-4cac-a95f-4d5cc0115225"}],"type":"card"},"params":{"currency":"BAT","pair":"BATBAT","progress":"1","rate":"1.00","ttl":3599997,"type":"internal"},"priority":"normal","reference":null,"status":"completed","type":"transfer"} ``` Note - I didn't post the logs for the 5% fee portion of the tip as they make the same calls as above. I did confirm that they were successful. ![image](https://github.com/brave/brave-browser/assets/34715963/1861c279-25fd-4bd9-a28e-b57f6f3ca0ce)|![image](https://github.com/brave/brave-browser/assets/34715963/d02550fb-7336-4c1e-8ab1-fe1ad9ee18ae) --|--
GeetaSarvadnya commented 6 months ago

Verification PASSED on

Brave | 1.64.104 Chromium: 123.0.6312.46 (Official Build) (64-bit)
-- | --
Revision | 0ca3d372cf8aab96fafdd75f5c5c8d2012bc0cc6
OS | Windows 10 Version 22H2 (Build 19045.4046)

As mentioned https://github.com/brave/brave-browser/issues/35834#issuecomment-1969228753 verified the following scenarios

Connect existing Uphold account ("Brave Browser" card already created) - PASSED 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect existing Uphold sandbox account ("Brave Browser" card already exists on Uphold) 4. Watch logs 5. Confirm successful connection to Uphold `GET https://api-sandbox.uphold.com/v0/me/capabilities` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Method: GET [26888:12212:0315/142717.754:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Method: GET [26888:12212:0315/142718.564:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/cards/{wallet address}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/a93...... > Method: GET [26888:12212:0315/143021.863:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/a93..... > Result: Success > HTTP Code: 200 ``` ![image](https://github.com/brave/brave-browser/assets/38657976/4972162e-66c2-4b30-9014-83dd406e5a15)
One-time tip with Uphold - PASSED 1. Continue from "existing account" case above 2. Navigate to a site that is verified with Uphold 3. Do a one-time tip for this site 4. Watch the logs 5. Ensure tip is successful `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions` ``` [26888:12212:0315/144801.697:VERBOSE1:contribution.cc(513)] Creating contribution for wallet type uphold (amount: 1, type: ONE_TIME_TIP) [26888:12212:0315/144801.721:VERBOSE1:contribution.cc(137)] Queue timer set for 16 s [26888:12212:0315/144801.724:VERBOSE1:url_loader.cc(72)] [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/a93.../transactions > Method: POST > Content: {"denomination":{"amount":"0.95","currency":"BAT"},"destination":"abf1ff79-a239-42af-abff-20eb121edd1c"} > Content Type: application/json; charset=utf-8 [26888:12212:0315/144802.695:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/a93.../transactions > Result: Success > HTTP Code: 202 ``` `POST https://api-sandbox.uphold.com/v0/me/cards/:card-id/transactions/{transaction-id}/commit` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/a93.../transactions/f301183d-9f12-4178-9726-520c0f07d784/commit > Method: POST [26888:12212:0315/144835.931:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/a93.../transactions/f301183d-9f12-4178-9726-520c0f07d784/commit > Result: Success > HTTP Code: 200 ``` `GET https://api-sandbox.uphold.com/v0/me/transactions/{transaction-id}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/f301183d-9f12-4178-9726-520c0f07d784 > Method: GET [26888:12212:0315/145012.389:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/f301183d-9f12-4178-9726-520c0f07d784 > Result: Success > HTTP Code: 200 ``` Note - I didn't post the logs for the 5% fee portion of the tip as they make the same calls as above. I did confirm that they were successful. Example | Example | Example --- | --- | --- ![image](https://github.com/brave/brave-browser/assets/38657976/dba204da-e288-447e-938f-6526f34eabf7) | ![image](https://github.com/brave/brave-browser/assets/38657976/781acacb-8365-4a20-8d4d-11c8b0a9568b) | ![image](https://github.com/brave/brave-browser/assets/38657976/e629a4af-ec5a-4392-ab76-a9e6f3623667)
Connect Flow - Proxy select endpoints - PASSED Create a re-write rule using Charles Proxy (or similar) for each of the below individually so that the response is changed to `206`.
GET https://api-sandbox.uphold.com/v0/me/capabilities - PASSED Re-write rule: ![image](https://github.com/brave/brave-browser/assets/38657976/105fb516-b9fb-45e6-85eb-c70cb9e2a296) | ![image](https://github.com/brave/brave-browser/assets/38657976/3c895eee-d24d-47c7-93ea-7ffb9cf3dac4) --- | --- 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect to Uphold 4. Watch logs 5. Confirm successful connection to Uphold `GET https://api-sandbox.uphold.com/v0/me/capabilities` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Method: GET [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/capabilities > Result: Success > HTTP Code: 206 ``` Example | Example --- | --- ![image](https://github.com/brave/brave-browser/assets/38657976/e8d0eb64-b53c-4867-a749-e597d39fd8d2) | ![image](https://github.com/brave/brave-browser/assets/38657976/730ae2a9-90be-4033-9997-6943977aa896)
GET https://api-sandbox.uphold.com/v0/me/cards/{wallet_address} - PASSED Re-write rule: ![image](https://github.com/brave/brave-browser/assets/38657976/665d18c5-a958-4102-be1a-94e98b588fe0) | ![image](https://github.com/brave/brave-browser/assets/38657976/f46ed297-4da2-4109-a004-db3c9f3f9339) --- | --- 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect to Uphold 4. Watch logs 5. Confirm successful connection to Uphold `GET https://api-sandbox.uphold.com/v0/me/cards/{wallet_address}` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards/a93.... > Method: GET [14260:9736:0315/151420.757:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards/a93.... > Result: Success > HTTP Code: 206 ``` Example | Example --- | --- ![image](https://github.com/brave/brave-browser/assets/38657976/f17eb6b9-15b9-4022-afc1-c291ee80452d) | ![image](https://github.com/brave/brave-browser/assets/38657976/5cfabcf4-3da0-4039-8686-a5b5f7308254)
GET https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT - PASSED Re-write rule: ![image](https://github.com/brave/brave-browser/assets/38657976/d64b8f9a-2e73-4825-9b13-c606bc0c7eaf) | ![image](https://github.com/brave/brave-browser/assets/38657976/791787cd-daff-4787-83d5-9c0d519eb2a3) --- | --- 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect to Uphold 4. Watch logs 5. Confirm successful connection to Uphold `GET https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT` ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Method: GET [2268:4676:0315/152941.953:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/cards?q=currency:BAT > Result: Success > HTTP Code: 206 ``` Example | Example --- | --- ![image](https://github.com/brave/brave-browser/assets/38657976/3fb275d5-93dc-45a6-b5c7-226600982f62) | ![image](https://github.com/brave/brave-browser/assets/38657976/2cb1e221-bc14-4191-8595-68edd31e32b5)
GET https://api-sandbox.uphold.com/v0/me - PASSED Re-write rule: ![image](https://github.com/brave/brave-browser/assets/38657976/430e3a16-a3c2-4098-8e41-1e74918e9414) | ![image](https://github.com/brave/brave-browser/assets/38657976/b0a2f41f-f3df-4bb8-af84-84be96f99510) --- | --- 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect to Uphold 4. Watch logs 5. Confirm successful connection to Uphold Note - no logs as this information was stripped from them. Example | Example --- | --- ![image](https://github.com/brave/brave-browser/assets/38657976/4f8d7a4c-0307-4d63-af9e-d714ea7d8a72) | ![image](https://github.com/brave/brave-browser/assets/38657976/2cfe10fe-7aa6-4987-bd82-8d55ee0e3f39)
Tip Flow - Proxy select endpoints - PASSED Create a re-write rule using Charles Proxy (or similar) so that the response is changed to `206`.
GET https://api-sandbox.uphold.com/v0/me/transactions/{transaction-id} - PASSED Re-write rule: ![image](https://github.com/brave/brave-browser/assets/38657976/b331ea1e-b121-4366-9afa-03beaeac16b2) | ![image](https://github.com/brave/brave-browser/assets/38657976/7e662b36-9d10-4be8-92ee-350821481fd8) --- | --- 1. Launch a fresh profile, close and relaunch to pull griffin 2. Join rewards (staging env) 3. Connect to Uphold 4. Confirm successful connection to Uphold 5. Tip an Uphold verified creator 6. Watch logs 7. Confirm tip is successful `GET https://api-sandbox.uphold.com/v0/me/transactions/{transaction-id}` 95% of tip amount: ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/a7f4f3b6-40e6-4282-8f95-58648a2dcec6 > Method: GET [8956:22816:0315/154231.759:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/a7f4f3b6-40e6-4282-8f95-58648a2dcec6 > Result: Success > HTTP Code: 206 > Body: {"application":{"clientId":"4c2b...","name":"Brave Browser"},"createdAt":"2024-03-15T10:12:20.668Z","denomination":{"amount":"0.95", ``` 5% of tip amount (fee): ``` [ REQUEST ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/636c76d7-651d-4e71-b8a5-fae94b9cd708 > Method: GET [8956:22816:0315/154418.227:VERBOSE1:url_loader.cc(111)] [ RESPONSE ] > URL: https://api-sandbox.uphold.com/v0/me/transactions/636c76d7-651d-4e71-b8a5-fae94b9cd708 > Result: Success > HTTP Code: 206 > Body: {"application":{"clientId":"4c2b...","name":"Brave Browser"},"createdAt":"2024-03-15T10:13:08.942Z","denomination":{"amount":"0.05", ``` Example | Example | Example | Example --- | --- | --- | --- ![image](https://github.com/brave/brave-browser/assets/38657976/a62c4f31-ecb5-4ae2-ace8-d5128388a8ef) | ![image](https://github.com/brave/brave-browser/assets/38657976/76a18241-50c9-4f12-a8a0-ed9ad03b81d7) | ![image](https://github.com/brave/brave-browser/assets/38657976/d10e130f-794b-45a4-a14c-969b68ba9ad5) | ![image](https://github.com/brave/brave-browser/assets/38657976/54c61367-5b5f-4d32-aa14-6a516c1be8b1)