Skip to content

Re-fetch hcpatcha token after expiration#12298

Merged
toluo-stripe merged 3 commits intomasterfrom
tolu/challenge/retries
Feb 4, 2026
Merged

Re-fetch hcpatcha token after expiration#12298
toluo-stripe merged 3 commits intomasterfrom
tolu/challenge/retries

Conversation

@toluo-stripe
Copy link
Contributor

@toluo-stripe toluo-stripe commented Feb 3, 2026

Summary

Re-fetch hcpatcha token after expiration

https://git.corp.stripe.com/stripe-internal/pay-server/pull/1331160
https://git.corp.stripe.com/stripe-internal/pay-server/pull/1334793

Motivation

The hCaptcha token has an timeout defined on pay-server. We should re-fetch the token if our cache is expired.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Changelog

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │             compressed             │          uncompressed          
          ├─────────────┬─────────────┬────────┼───────────┬───────────┬────────
 APK      │ old         │ new         │ diff   │ old       │ new       │ diff   
──────────┼─────────────┼─────────────┼────────┼───────────┼───────────┼────────
      dex │       5 MiB │       5 MiB │ +565 B │  11.1 MiB │  11.1 MiB │ +708 B 
     arsc │     3.6 MiB │     3.6 MiB │    0 B │   3.6 MiB │   3.6 MiB │    0 B 
 manifest │     5.7 KiB │     5.7 KiB │    0 B │  30.2 KiB │  30.2 KiB │    0 B 
      res │ 1,006.4 KiB │ 1,006.4 KiB │    0 B │   1.7 MiB │   1.7 MiB │    0 B 
   native │   949.9 KiB │   949.9 KiB │    0 B │   2.5 MiB │   2.5 MiB │    0 B 
    asset │    27.1 KiB │    27.1 KiB │  +43 B │  47.7 KiB │  47.8 KiB │  +43 B 
    other │   222.3 KiB │   222.3 KiB │  -12 B │ 448.6 KiB │ 448.6 KiB │    0 B 
──────────┼─────────────┼─────────────┼────────┼───────────┼───────────┼────────
    total │    10.7 MiB │    10.7 MiB │ +596 B │  19.3 MiB │  19.3 MiB │ +751 B 

         │         raw          │           unique           
         ├───────┬───────┬──────┼───────┬───────┬────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff       
─────────┼───────┼───────┼──────┼───────┼───────┼────────────
   files │     2 │     2 │    0 │       │       │            
 strings │ 58673 │ 58676 │   +3 │ 52415 │ 52418 │ +3 (+5 -2) 
   types │ 20703 │ 20703 │    0 │ 17552 │ 17552 │  0 (+0 -0) 
 classes │ 14736 │ 14736 │    0 │ 14736 │ 14736 │  0 (+0 -0) 
 methods │ 78470 │ 78471 │   +1 │ 73784 │ 73785 │ +1 (+8 -7) 
  fields │ 51543 │ 51547 │   +4 │ 49297 │ 49301 │ +4 (+4 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  325 │  325 │  0   
 entries │ 6978 │ 6978 │  0
APK
    compressed     │    uncompressed    │                               
──────────┬────────┼───────────┬────────┤                               
 size     │ diff   │ size      │ diff   │ path                          
──────────┼────────┼───────────┼────────┼───────────────────────────────
  4.2 MiB │ +562 B │   9.3 MiB │ +708 B │ ∆ classes.dex                 
 10.6 KiB │  +43 B │  10.5 KiB │  +43 B │ ∆ assets/dexopt/baseline.prof 
 58.1 KiB │  -11 B │ 128.7 KiB │    0 B │ ∆ META-INF/CERT.SF            
  783 KiB │   +3 B │   1.8 MiB │    0 B │ ∆ classes2.dex                
  1.2 KiB │   -3 B │   1.2 KiB │    0 B │ ∆ META-INF/CERT.RSA           
 54.7 KiB │   +2 B │ 128.7 KiB │    0 B │ ∆ META-INF/MANIFEST.MF        
──────────┼────────┼───────────┼────────┼───────────────────────────────
  5.1 MiB │ +596 B │  11.4 MiB │ +751 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   52415 │ 52418 │ +3 (+5 -2) 
  
  + , createdAt=
  + , tokenTimeoutSeconds=
  + r8-map-id-1960b61b54bba140bc341c8da6386f079168ebfd441db8f579445bac1e09161b
  + token_timeout_seconds
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"1960b61b54bba140bc341c8da6386f079168ebfd441db8f579445bac1e09161b","r8-mode":"full","version":"8.13.17"}
  
  - r8-map-id-162cc8dd05b2423369050f32dff0ae63acec53648fad0e727f8ae81cddb85b20
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"162cc8dd05b2423369050f32dff0ae63acec53648fad0e727f8ae81cddb85b20","r8-mode":"full","version":"8.13.17"}
  

METHODS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   73784 │ 73785 │ +1 (+8 -7) 
  
  + c1.g2 i(Object) → Object
  + ch.a5 <init>(Integer, String, String)
  + nc.w <init>(Integer, String, String)
  + xd.i <init>(Object, c, f1, f1, Continuation)
  + xf.d <init>(String, long)
  + xf.l <init>(j, o, p0, String, String, int)
  + xf.m <init>(l1, o, p0, String, String, int)
  + xf.o a(p0, String, String, Integer, ContinuationImpl) → Object
  
  - ch.a5 <init>(String, String)
  - nc.w <init>(String, Integer, String)
  - xd.i <init>(Object, Object, Object, Object, Continuation, int)
  - xf.d <init>(String)
  - xf.l <init>(j, o, p0, String, String)
  - xf.m <init>(l1, o, p0, String, String)
  - xf.o a(p0, String, String, ContinuationImpl) → Object
  

FIELDS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   49297 │ 49301 │ +4 (+4 -0) 
  
  + ch.a5 m: Integer
  + xf.d b: long
  + xf.l p: int
  + xf.m p: int

@toluo-stripe toluo-stripe marked this pull request as ready for review February 3, 2026 22:49
@toluo-stripe toluo-stripe requested review from a team as code owners February 3, 2026 22:49
@toluo-stripe toluo-stripe merged commit 10bdd04 into master Feb 4, 2026
22 checks passed
@toluo-stripe toluo-stripe deleted the tolu/challenge/retries branch February 4, 2026 21:09
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.

2 participants