diff --git a/cmd/vaults_help.go b/cmd/vaults_help.go index 31b3d125..fbe77a21 100644 --- a/cmd/vaults_help.go +++ b/cmd/vaults_help.go @@ -70,7 +70,7 @@ type LinkCardSpec = { provider: "link"; wallet: string; // wallet item key payment_method_id: string; // from wallets payment-methods - amount: number; // integer minor units; 1..500000; a virtual card allows at most 50000 + amount: number; // integer minor units; 1..50000 currency: string; // three letters merchant_name: string; // 1..255 characters merchant_url: string; // uri; a virtual card authorized without a checkout fills only this origin diff --git a/cmd/vaults_link.go b/cmd/vaults_link.go index 6d7f65ef..1caf901b 100644 --- a/cmd/vaults_link.go +++ b/cmd/vaults_link.go @@ -39,10 +39,9 @@ checkout is open in exactly one tab at page_url, then authorize again. if checko keeps failing, authorize without --browser-id and --page-url to issue a virtual card that fills any page on the merchant_url origin. once a card is authorized at a checkout, cards update returns 409: delete the card and create a new one. if authorization is declined or expires, -read status_reason, then delete the card and create a new one. if the amount exceeds the -50000 minor-unit virtual card limit on a checkout without Link Pay Token support, delete the -card and tell the user. if the result of submitting payment is unclear, check the merchant's -order confirmation or order history before paying again.` +read status_reason, then delete the card and create a new one. if the result of submitting +payment is unclear, check the merchant's order confirmation or order history before paying +again.` const linkAuthorizeBrowserGuidance = "no payment request was made. make sure the checkout is open in exactly one tab at page_url in a browser with this vault attached, then authorize again. if checkout inspection keeps failing, authorize without --browser-id and --page-url to issue a virtual card that fills any page on the merchant_url origin" @@ -110,7 +109,7 @@ func linkAuthorizeError(err error, checkout bool) error { case checkout && apiErr.StatusCode >= 500: guidance = linkAuthorizeServerErrorGuidance case body.Code == "invalid_request": - guidance = "fix the reported input, then authorize again. if it reports that the amount exceeds the Link virtual card limit, delete this card and tell the user this checkout cannot be paid with a Link virtual card" + guidance = "fix the reported input, then authorize again" default: guidance = "re-get the item and follow its advertised operations" } diff --git a/cmd/vaults_link_test.go b/cmd/vaults_link_test.go index 91390f67..7e7d09eb 100644 --- a/cmd/vaults_link_test.go +++ b/cmd/vaults_link_test.go @@ -47,7 +47,6 @@ func TestLinkCardFlowHelpOrder(t *testing.T) { "make sure the checkout is open in exactly one tab at page_url, then authorize again", "authorize without --browser-id and --page-url to issue a virtual card", "cards update returns 409: delete the card and create a new one", - "50000 minor-unit virtual card limit", "check the merchant's order confirmation or order history before paying again", "failed or unknown fills are safe to retry, but only after checking the page and not in an automatic loop", } { @@ -150,7 +149,7 @@ func TestVaultLinkAuthorizeErrorGuidance(t *testing.T) { {403, "destination_denied", "checkout destination is not authorized", linkAuthorizeBrowserGuidance, "", false}, {400, "timeout", "checkout inspection failed", linkAuthorizeBrowserGuidance, "", false}, {500, "browser_error", "checkout inspection failed", linkAuthorizeBrowserGuidance, "", false}, - {400, "invalid_request", "amount exceeds the Link virtual card limit", "fix the reported input, then authorize again. if it reports that the amount exceeds the Link virtual card limit, delete this card and tell the user this checkout cannot be paid with a Link virtual card", "", false}, + {400, "invalid_request", "spec.payment_method_id was not found in the wallet", "fix the reported input, then authorize again", "", false}, {429, "rate_limited", "too many requests", "wait for the rate limit to clear, then authorize again", "", false}, {429, "rate_limited", "too many requests", "wait until Retry-After (30) has elapsed, then authorize again", "30", false}, {500, "provider_error", "failed to perform item operation", linkAuthorizeServerErrorGuidance, "", false},