{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":"Samples","path":"Samples","contentType":"directory"},{"name":"Scripts","path":"Scripts","contentType":"directory"},{"name":"Sources","path":"Sources","contentType":"directory"},{"name":"Tests","path":"Tests","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".ruby-version","path":".ruby-version","contentType":"file"},{"name":".swiftlint.yml","path":".swiftlint.yml","contentType":"file"},{"name":"CHANGELOG.md","path":"CHANGELOG.md","contentType":"file"},{"name":"Gemfile","path":"Gemfile","contentType":"file"},{"name":"Gemfile.lock","path":"Gemfile.lock","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"Package.resolved","path":"Package.resolved","contentType":"file"},{"name":"Package.swift","path":"Package.swift","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"ShopifyCheckoutKit.podspec","path":"ShopifyCheckoutKit.podspec","contentType":"file"}],"totalCount":16}},"fileTreeProcessingTime":1.880794,"foldersToFetch":[],"reducedMotionEnabled":null,"repo":{"id":687512015,"defaultBranch":"main","name":"checkout-kit-swift","ownerLogin":"Shopify","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2023-09-05T14:03:03.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/8085?v=4","public":true,"private":false,"isOrgOwned":true},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"main","listCacheKey":"v0:1700518320.0","canEdit":false,"refType":"branch","currentOid":"e6fd696197b0fcadec37c4c5447dd60b528e28c1"},"path":"README.md","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/Shopify/checkout-kit-swift/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null,"repoAlertsPath":"/Shopify/checkout-kit-swift/security/dependabot","repoSecurityAndAnalysisPath":"/Shopify/checkout-kit-swift/settings/security_analysis","repoOwnerIsOrg":true,"currentUserCanAdminRepo":false},"displayName":"README.md","displayUrl":"https://github.com/Shopify/checkout-kit-swift/blob/main/README.md?raw=true","headerInfo":{"blobSize":"12.2 KB","deleteInfo":{"deleteTooltip":"您必须登录才能进行或提议更改操作"},"editInfo":{"editTooltip":"您必须登录才能进行或提议更改操作"},"ghDesktopPath":"https://desktop.github.com","gitLfsPath":null,"onBranch":true,"shortPath":"d863261","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FShopify%2Fcheckout-kit-swift%2Fblob%2Fmain%2FREADME.md","isCSV":false,"isRichtext":true,"toc":[{"level":1,"text":"Shopify Checkout Kit - Swift","anchor":"shopify-checkout-kit---swift","htmlText":"Shopify Checkout Kit - Swift"},{"level":3,"text":"要求","anchor":"requirements","htmlText":"要求"},{"level":3,"text":"入门","anchor":"getting-started","htmlText":"入门"},{"level":4,"text":"Package.swift","anchor":"packageswift","htmlText":"Package.swift"},{"level":4,"text":"Xcode","anchor":"xcode","htmlText":"Xcode"},{"level":4,"text":"Cocoapods","anchor":"cocoapods","htmlText":"Cocoapods"},{"level":3,"text":"基本使用","anchor":"basic-usage","htmlText":"基本使用"},{"level":3,"text":"配置","anchor":"configuration","htmlText":"配置"},{"level":4,"text":"颜色方案","anchor":"colorscheme","htmlText":"颜色方案"},{"level":4,"text":"加载器颜色","anchor":"sp","htmlText":"加载器颜色"},{"level":4,"text":"背景颜色","anchor":"backgroundcolor","htmlText":"背景颜色"},{"level":3,"text":"预加载","anchor":"preloading","htmlText":"预加载"},{"level":3,"text":"监控结账会话的生命周期","anchor":"monitoring-the-lifecycle-of-a-checkout-session","htmlText":"监控结账会话的生命周期"},{"level":4,"text":"与Web像素集成,监控行为数据","anchor":"integrating-with-web-pixels-monitoring-behavioral-data","htmlText":"与Web像素集成,监控行为数据"},{"level":3,"text":"集成身份和客户账户","anchor":"integrating-identity--customer-accounts","htmlText":"集成身份和客户账户"},{"level":4,"text":"购物车:买家包、身份和偏好设置","anchor":"cart-buyer-bag-identity-and-preferences","htmlText":"购物车:买家包、身份和偏好设置"},{"level":4,"text":"多路径","anchor":"multipass","htmlText":"多路径"},{"level":4,"text":"Shop Pay","anchor":"shop-pay","htmlText":"Shop Pay"},{"level":4,"text":"客户账户API","anchor":"customer-account-api","htmlText":"客户账户API"},{"level":3,"text":"贡献","anchor":"contributing","htmlText":"贡献"},{"level":3,"text":"许可协议","anchor":"license","htmlText":"许可协议"}],"lineInfo":{"truncatedLoc":"254","truncatedSloc":"173"}}},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplateHelpUrl":"https://githubdocs.cn/articles/about-issue-and-pull-request-templates","issueTemplate":null,"discussionTemplate":null,"language":"Markdown","languageID":222,"large":false,"loggedIn":false,"newDiscussionPath":"/Shopify/checkout-kit-swift/discussions/new","newIssuePath":"/Shopify/checkout-kit-swift/issues/new","planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/Shopify/checkout-kit-swift/blob/main/README.md","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","dismissStackNoticePath":"/settings/dismiss-notice/publish_stack_from_file","releasePath":"/Shopify/checkout-kit-swift/releases/new?marketplace=true","showPublishActionBanner":false,"showPublishStackBanner":false},"rawBlobUrl":"https://github.com/Shopify/checkout-kit-swift/raw/main/README.md","renderImageOrRaw":false,"richText":"
Shopify付款组件是一个Swift包库,是Shopify原生软件开发工具包的部分,它允许Swift应用程序在应用内提供世界最高转换率的、可定制的、单页付款体验。所呈现的体验是一个功能齐全的付款体验,保留了所有店铺自定义内容:付款UI扩展、函数、品牌化以及更多。它还提供了平台特有的默认选项,如支持浅色和深色模式,以及方便的开发者API来嵌入、自定义和跟踪付款体验的生命周期。查看我们的博客了解为何我们要构建付款组件以及如何使用它。
\nSDK是一个开源的Swift包库。作为快速开始,请参阅示例项目或使用以下方式之一将SDK集成到项目中
\ndependencies: [\n .package(url: \"https://github.com/Shopify/checkout-kit-swift class=\"pl-pds\">\", from: \"0.7.0\")\n]
文件
> 添加包依赖...
https://github.com/Shopify/checkout-kit-swift
关于如何在Xcode中管理Swift Package依赖的更多细节,请参阅Apple的文档。
\n一旦将SDK添加为依赖项,您就可以导入该库
\n要向买家展示结账窗口,您的应用程序必须首先获取结账URL。最常见的方法是使用Storefront GraphQL API通过(-4C和相关更新突变)组装购物车并查询checkoutUrl。您可以使用任何GraphQL客户端来完成此操作,并推荐使用 Shopify 的Mobile Buy SDK for iOS以简化开发工作流程
\n(-5C)对象是一个标准网页结账URL,可以在任何浏览器中打开。要在您的应用程序中显示原生结账表单,请将(-6C)以及可选的运行时配置设置一起提供给 SDK 提供的(-7C)函数
\n为了帮助优化并传递最佳体验,SDK 还提供了一个 预加载API,可以用于在后台和事先初始化结账会话。
\nSDK通过(-8C)对象提供了一种定制结账体验的方法。
\n默认情况下,SDK会匹配用户的设备颜色表现。此行为的自定义可以通过(-10C)属性进行
\n如果结账会话尚未准备好即将初始化,则将显示加载旋转器,并且可以通过廿二C属性进行自定义
\n廿四C
\n结账会话初始化期间,可以通过廿六C属性自定义视图的背景色
\n初始化结账会话需要与Shopify服务器进行通信,并且根据网络状况和买家的连接质量,可能会导致买家不希望的等待时间。为了帮助优化并提供最佳体验,SDK提供预加载提示,允许应用开发者标记后台提前初始化结账会话。
\n预加载是一个高级功能,可以通过运行时标志禁用
\n启用后,预加载结账会话就像下文简述的一样简单
\n卅一C
\n\n 监控结账会话的生命周期
应用开发者可以使用生命周期事件来监控和记录 checkout 会话的状态。Web Pixel 事件目前在渲染的 checkout 中不执行。对客户事件和行为分析的支待正在开发中,将在 SDK 通用可用之前提供。
\n买家意识强的 checkout 体验减少了摩擦并提高了转化率。根据买家的上下文(游客或登录用户),了解买家的偏好或账户/身份系统,应用可以使用以下方法之一初始化个性化且符合上下文的买家体验。
\n除了指定行项目之外,购物车还可以包括买家身份(名称、电子邮件、地址等),以及配送和支付偏好:请参阅指南。包含的信息将用于在 checkout 中向买家呈现预填充和预选择的选项。
\nShopify Plus 商户使用 经典顾客账户 可以使用 Multipass (API 文档)来集成外部身份系统并初始化一个对买家身份了解的结账会话。
\n¨C69C
\n要初始化加速的 Shop Pay 结账流程,购物车可以设置 钱包偏好 为 'shop_pay'。买家的登录状态为应用本地。买家将在首次结账时被提示登录到他们的 Shop 账户,并且他们的登录状态将保存在未来的结账会话中。
\n我们正在开发一个库来提供由 新的顾客账户 API 提供的买家登录和身份验证功能——请耐心等待。
\n我们欢迎代码贡献、特性请求和问题报告。请参阅 指南和说明。
\nCheckout Kit 遵循 MIT 许可协议。
\ncolorScheme
","kind":"section_4","identStart":4214,"identEnd":4227,"extentStart":4209,"extentEnd":4837,"fullyQualifiedName":"colorScheme
","identUtf16":{"start":{"lineNumber":91,"utf16Col":5},"end":{"lineNumber":91,"utf16Col":18}},"extentUtf16":{"start":{"lineNumber":91,"utf16Col":0},"end":{"lineNumber":109,"utf16Col":0}}},{"name":"spinnerColor
","kind":"section_4","identStart":4842,"identEnd":4856,"extentStart":4837,"extentEnd":5305,"fullyQualifiedName":"spinnerColor
","identUtf16":{"start":{"lineNumber":109,"utf16Col":5},"end":{"lineNumber":109,"utf16Col":19}},"extentUtf16":{"start":{"lineNumber":109,"utf16Col":0},"end":{"lineNumber":123,"utf16Col":0}}},{"name":"backgroundColor
","kind":"section_4","identStart":5310,"identEnd":5327,"extentStart":5305,"extentEnd":5705,"fullyQualifiedName":"backgroundColor
","identUtf16":{"start":{"lineNumber":123,"utf16Col":5},"end":{"lineNumber":123,"utf16Col":22}},"extentUtf16":{"start":{"lineNumber":123,"utf16Col":0},"end":{"lineNumber":135,"utf16Col":0}}},{"name":"Preloading","kind":"section_3","identStart":5709,"identEnd":5719,"extentStart":5705,"extentEnd":7292,"fullyQualifiedName":"Preloading","identUtf16":{"start":{"lineNumber":135,"utf16Col":4},"end":{"lineNumber":135,"utf16Col":14}},"extentUtf16":{"start":{"lineNumber":135,"utf16Col":0},"end":{"lineNumber":159,"utf16Col":0}}},{"name":"Monitoring the lifecycle of a checkout session","kind":"section_3","identStart":7296,"identEnd":7342,"extentStart":7292,"extentEnd":9639,"fullyQualifiedName":"Monitoring the lifecycle of a checkout session","identUtf16":{"start":{"lineNumber":159,"utf16Col":4},"end":{"lineNumber":159,"utf16Col":50}},"extentUtf16":{"start":{"lineNumber":159,"utf16Col":0},"end":{"lineNumber":210,"utf16Col":0}}},{"name":"Integrating with Web Pixels, monitoring behavioral data","kind":"section_4","identStart":9229,"identEnd":9284,"extentStart":9224,"extentEnd":9639,"fullyQualifiedName":"Integrating with Web Pixels, monitoring behavioral data","identUtf16":{"start":{"lineNumber":206,"utf16Col":5},"end":{"lineNumber":206,"utf16Col":60}},"extentUtf16":{"start":{"lineNumber":206,"utf16Col":0},"end":{"lineNumber":210,"utf16Col":0}}},{"name":"Integrating identity & customer accounts","kind":"section_3","identStart":9643,"identEnd":9683,"extentStart":9639,"extentEnd":12222,"fullyQualifiedName":"Integrating identity & customer accounts","identUtf16":{"start":{"lineNumber":210,"utf16Col":4},"end":{"lineNumber":210,"utf16Col":44}},"extentUtf16":{"start":{"lineNumber":210,"utf16Col":0},"end":{"lineNumber":247,"utf16Col":0}}},{"name":"Cart: buyer bag, identity, and preferences","kind":"section_4","identStart":10005,"identEnd":10047,"extentStart":10000,"extentEnd":10419,"fullyQualifiedName":"Cart: buyer bag, identity, and preferences","identUtf16":{"start":{"lineNumber":214,"utf16Col":5},"end":{"lineNumber":214,"utf16Col":47}},"extentUtf16":{"start":{"lineNumber":214,"utf16Col":0},"end":{"lineNumber":218,"utf16Col":0}}},{"name":"Multipass","kind":"section_4","identStart":10424,"identEnd":10433,"extentStart":10419,"extentEnd":11523,"fullyQualifiedName":"Multipass","identUtf16":{"start":{"lineNumber":218,"utf16Col":5},"end":{"lineNumber":218,"utf16Col":14}},"extentUtf16":{"start":{"lineNumber":218,"utf16Col":0},"end":{"lineNumber":237,"utf16Col":0}}},{"name":"Shop Pay","kind":"section_4","identStart":11528,"identEnd":11536,"extentStart":11523,"extentEnd":11969,"fullyQualifiedName":"Shop Pay","identUtf16":{"start":{"lineNumber":237,"utf16Col":5},"end":{"lineNumber":237,"utf16Col":13}},"extentUtf16":{"start":{"lineNumber":237,"utf16Col":0},"end":{"lineNumber":241,"utf16Col":0}}},{"name":"Customer Account API","kind":"section_4","identStart":11974,"identEnd":11994,"extentStart":11969,"extentEnd":12222,"fullyQualifiedName":"Customer Account API","identUtf16":{"start":{"lineNumber":241,"utf16Col":5},"end":{"lineNumber":241,"utf16Col":25}},"extentUtf16":{"start":{"lineNumber":241,"utf16Col":0},"end":{"lineNumber":247,"utf16Col":0}}},{"name":"Contributing","kind":"section_3","identStart":12226,"identEnd":12238,"extentStart":12222,"extentEnd":12382,"fullyQualifiedName":"Contributing","identUtf16":{"start":{"lineNumber":247,"utf16Col":4},"end":{"lineNumber":247,"utf16Col":16}},"extentUtf16":{"start":{"lineNumber":247,"utf16Col":0},"end":{"lineNumber":251,"utf16Col":0}}},{"name":"License","kind":"section_3","identStart":12386,"identEnd":12393,"extentStart":12382,"extentEnd":12453,"fullyQualifiedName":"License","identUtf16":{"start":{"lineNumber":251,"utf16Col":4},"end":{"lineNumber":251,"utf16Col":11}},"extentUtf16":{"start":{"lineNumber":251,"utf16Col":0},"end":{"lineNumber":254,"utf16Col":0}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"csrf_tokens":{"/Shopify/checkout-kit-swift/branches":{"post":"7SajLe_225Ki8yS4Qg4UUV_xJtM_HoD3g__31vP-Zg5S81mc4DbXKAnLAcwf0g9ls-X80la4zcgtRzYNDzv3gQ"},"/repos/preferences":{"post":"0DF0SZt058QTbNZNW-Ej5bIfQt-2OmBe5mp6_Pgak7pbolsMAV2E5vn4kWyD3jZA2wEGHYVL5kpnWOBmLGj7eg"}}},"title":"checkout-kit-swift/README.md at main · Shopify/checkout-kit-swift"}