ShopeeProvider mengimplementasikan MerchantProvider<ShopeeSession>. Otentikasi sepenuhnya fetch-only (tanpa browser), dengan cookie jar internal, laporan device-risk, pemilihan merchant/store, dan renewal sesi tanpa OTP baru.
ShopeeProviderConfig
Objek
payment menerima pollIntervalMs, defaultExpiryMs, clockSkewMs, transactionPageSize, dan maxUniqueOffset.
Login
requestOtp -> verifyOtp -> completeLogin. deviceReport default diambil dari config bila tidak dilewatkan di options. options OTP mendukung channel (1=SMS, 2=telepon, 3=WhatsApp) dan password.
loginWithOtp menggabungkan verify + complete. Bila akun punya lebih dari satu merchant usable dan merchantId tidak diberikan, ia tidak melempar, melainkan mengembalikan ShopeeLoginOutcome:
verification, tampilkan merchants, lalu selesaikan dengan completeLogin({ verification, merchantId }) - tanpa OTP kedua. Lihat Login Shopee.
Merchant dan store
selectMerchant memutar ulang login token exchange (login_toc -> /account/login/tob/auth) memakai switchCredential; SwitchMerchant langsung ditolak API (200020) di luar browser. Berpindah merchant/store diblokir bila store aktif masih punya pembayaran aktif. Lihat Merchant dan store Shopee.
Sesi
refreshSession bertanya langsung ke Shopee (login_status); selama account session hidup, ia me-remint token merchant aktif via SSO exchange. Bila mati, melempar AUTH_REQUIRED - hanya OTP baru yang memulihkan. Sesi tanpa switchCredential (dibuat sebelum dukungan renewal) menolak refreshSession dan selectMerchant. exp cookie ~1000 hari bukan sinyal liveness. Lihat Sesi Shopee.
QRIS
QRIS Shopee terikat ke pemilik (
{ merchantId, storeId }); store lain tidak mewarisinya. setStaticQris(undefined) melepas ikatan. Lihat Pembayaran Shopee.
Pembayaran
PaymentService di-cache per scope pembayaran (satu per kombinasi merchant/store). Berpindah store/merchant menonaktifkan komposisi lama dan mengaktifkan yang sesuai store baru. Lihat Pembayaran Shopee dan PaymentService.
Client aliased
Shopee di-reexport bersama:ShopeeAuthClient, ShopeeMerchantClient, ShopeeTransactionFeed, ShopeeCookieJar, ShopeeHttpClient, parseShopeeAmount, md5Hex/sha256Hex/hashShopeePassword, dan konstanta SHOPEE_PROVIDER_ID/SHOPEE_DEVICE_RISK_BLOB.