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

Specify Amazon eGift Card country #5117

Merged
merged 2 commits into from Feb 12, 2021
Merged

Specify Amazon eGift Card country #5117

merged 2 commits into from Feb 12, 2021

Conversation

ghost
Copy link

@ghost ghost commented Jan 26, 2021

Fixes #5098

  • Adds countryCode to AmazonGiftCardAccountPayload
  • Prompts the user to upgrade their old AmazonGiftCard account where necessary (due to new field).
  • Trade buyer step 2 prompts use of the appropriate Amazon website for buying gift card.

[update] Changed implementation per suggestion from @chimp1984. Now it upgrades the existing accounts at startup the same way that the upgrade to Revolut was done. Accounts that are non-EUR are upgraded automatically, EUR accounts prompt the user to choose the Eurozone country:

image


Example: A French person buying BTC from German person.


image


image

image


image

image

@pazza83
Copy link

pazza83 commented Jan 27, 2021

Thanks for this, I think the payment info screen at the bottom of the trade window makes this really clear for users.

@chimp1984
Copy link
Contributor

Maybe it need also a comment that the trader can remove the payment account only if there is no open trade or offer with it.
Alternatively we could do it similar like in Revolut account update at startup: Detecting if there is an old account and if so require the user to add the missing data and adding that to the existing account instead of removing and adding a new one. That would avoid the issues with open trades/offers and has less hassle for the user. Only issue is that the country dropdown should be added to that popup, so a custom window will be needed.

@ripcurlx ripcurlx added this to the v1.6.0 milestone Jan 29, 2021
@ghost ghost marked this pull request as draft February 1, 2021 17:10
@ghost
Copy link
Author

ghost commented Feb 1, 2021

Moved to draft while I implement suggestion from @chimp1984. Using #4481 as reference.

Also noticed that the new field has to be excluded from trade contract, e.g.

// For backward compatibility we need to exclude the new field for the contract json.
// We can remove that after a while when risk that users with pre 1.3.8 version trade with updated
// users is very low.
@JsonExclude
@Getter

@ghost
Copy link
Author

ghost commented Feb 3, 2021

@chimp1984 I don't know how to make this change compatible with prior versions.

When both clients are new:

  • Alice creates an offer to sell BTC for Amazon.
  • Bob takes the offer and is instructed to buy the Amazon GC from Alice's country of residence.

Here's the problem:

  • Alice is running old Bisq (1.5.4) and creates an offer to sell BTC for Amazon. Her account does not include country.
  • Bob is running new Bisq version that includes this feature.
  • Bob takes the offer, but gets a failed trade because Alice (old version) did not supply the country in the contract -> An error occurred at task: TakerVerifyAndSignContract Contracts are not matching

What's the best way to resolve this?

@chimp1984
Copy link
Contributor

Hm... that is always tricky. I think with Revolut it was similar but there was some solution. I would need to dig deeper to figure it out. I think excluding it from json was the solution...It is not a critivcal field so I don't see any problem to not have that in the contract.

From RevolutAccountPayload:

 // For backward compatibility we need to exclude the new field for the contract json.
    // We can remove that after a while when risk that users with pre 1.3.8 version trade with updated
    // users is very low.
    @JsonExclude
    @Getter
    private String userName = "";

@chimp1984
Copy link
Contributor

Account age is another area to take care of, but that data should not be part of the hash anyway.

@ghost
Copy link
Author

ghost commented Feb 3, 2021

If the field is excluded from contract, the functionality does not work. The buyer needs to be shown the seller's country so that they buy the amazon eGift from the appropriate country-based website.

@chimp1984
Copy link
Contributor

The payment account data are exchanged in the trade messages so the peer gets all data. We use a hash of the contract as json and that causes the problems when adding a new field, but with json exclude that is fixed.

@ghost
Copy link
Author

ghost commented Feb 3, 2021

Thanks @chimp1984, excluding the field from JSON resolved it again. For some reason during testing I thought it was missing on new-new clients but now its fine so I'll just chalk it off to me getting confused. 😕

Adds countryCode to AmazonGiftCardAccountPayload
Account upgrade done at startup => Eurozone accounts will prompt for country.
Trade buyer step 2 prompts use of the appropriate Amazon website for buying gift card.
@ghost
Copy link
Author

ghost commented Feb 3, 2021

Testing summary:

Check that old Bisq can trade with new Bisq.

  • Run two instances, 1.5.4 (old) and this PR (new) Bisq. Set up Amazon EUR accounts in each.
  • In old Bisq, create one Buy and one Sell offer.
  • In new Bisq, create one Buy and one Sell offer.
  • Take all offers from each side, resulting in 4 trades.
  • Generate/wait for a blockchain confirmation.
  • Note that when trading with an old counterparty they do not provide the country information, so it will be blank.
  • Initiate payment on each trade and verify that the counterparty screen looks good.
  • Mark payment accepted on each trade and complete the trades.

Check that account upgrade works for each possible currency:

  • Using old Bisq version (1.5.4), create 11 AmazonGiftCard accounts, one for each currency:
  • EUR, AUD, CAD, GBP, INR, JPY, SAR, SEK, SGD, TRY, USD.
  • Close the app, upgrade to this PR (new) Bisq.
  • Start up the app and verify that all the accounts are upgraded. In the case of EUR, verify that you are prompted to choose the Eurozone country for that account.

Check that new Bisq can trade with new Bisq.

Same procedure as first test, but with both instances running this PR (new) Bisq.

@ghost ghost marked this pull request as ready for review February 3, 2021 21:53
Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

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

NACK - Trading does work across versions and also the upgrading does work as expected. The only thing I noticed is that if you are establishing a trade between an old an a new Amazon account the current client is seeing two empty fields which might leave the user confused what to do (see buy giftcard at and country). I think in that case we should advise the user to contact the peer in the trader chat to discuss on which country store the egift card has to be purchased at.

Bildschirmfoto 2021-02-12 um 10 44 32

@ghost
Copy link
Author

ghost commented Feb 12, 2021

@ripcurlx requested change made. When seller is old, buyer will be prompted to use Trader Chat:

image

@ghost ghost requested a review from ripcurlx February 12, 2021 18:43
@ripcurlx ripcurlx merged commit 31b7292 into bisq-network:master Feb 12, 2021
@ghost ghost mentioned this pull request Feb 28, 2021
@ghost ghost deleted the add_country_amazon_account branch May 29, 2022 22:49
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.

Specify Amazon eGift Card country
3 participants