Beta in Progress – The beta version is under active development and coming soon to our platform.
Pesaswap is designed to facilitate the integration and management of payment-related functionalities in a decoupled or headless architecture with flexibility to customize your checkout UI.
Customize the Payment Experience Using Headless Functions
1. Initialize the Pesaswap SDK
Initialize Pesaswap Headless SDK onto your app with your publishable key. To get a Publishable Key please find it here.
// Source Hyperloader on your HTML file using the <script /> taghyper = Hyper.init("YOUR_PUBLISHABLE_KEY", { customBackendUrl: "YOUR_BACKEND_URL", // You can configure this as an endpoint for all the API calls such as session, payments, confirm call.});
// Android implementation exampleimport io.Pesaswap.payments.paymentlauncher.PaymentLauncher;// Initialize the SDKPaymentLauncher paymentLauncher = new PaymentLauncher(this, "YOUR_PUBLISHABLE_KEY");
// Flutter implementation exampleimport 'package:Pesaswap_sdk/Pesaswap_sdk.dart';// Initialize the SDKPesaswapSDK.init("YOUR_PUBLISHABLE_KEY");
// React Native implementation exampleimport { PesaswapSDK } from '@Pesaswap/react-native-sdk';// Initialize the SDKPesaswapSDK.init("YOUR_PUBLISHABLE_KEY");
2. Create a Payment Intent
Make a request to the endpoint on your server to create a new payment. The clientSecret returned by your endpoint is used to initialize the payment session.
Make sure to never share your API key with your client application as this could potentially compromise your security.
3. Initialize your Payment Session
Initialize a payment session by passing the clientSecret to the initPaymentSession.
Using the paymentSession object, you can fetch the customer’s default payment method data and confirm the payment using confirmWithCustomerDefaultPaymentMethod.
// Get customer saved payment methodsList<PaymentMethod> paymentMethods = await PesaswapSDK.getCustomerSavedPaymentMethods();// Get default payment methodPaymentMethod defaultPaymentMethod = await PesaswapSDK.getCustomerDefaultSavedPaymentMethodData();
// Get customer saved payment methodsconst paymentMethods = await PesaswapSDK.getCustomerSavedPaymentMethods();// Get default payment methodconst defaultPaymentMethod = await PesaswapSDK.getCustomerDefaultSavedPaymentMethodData();
Payload for confirmWithCustomerDefaultPaymentMethod(payload)
Options (Required)
Parameter
Description
confirmParams
Object containing parameters that will be passed to the Hyper API.
redirect
(web only) Can be either 'always' or 'if_required'. If set to 'always', user is redirected after confirmation. 'if_required' only redirects if needed.
ConfirmParams Object
Parameter
Description
return_url
(web only) URL your customer will be directed to after payment.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Pesaswap","description":"The complete digital payments platform for businesses of all sizes. Accept payments, manage transactions, and scale your business with Pesaswap - your best option for handling digital payments seamlessly.","colors":{"primary":"#02555B","light":"#2A7A7F","dark":"#013E42"},"logo":{"light":"https://mintcdn.com/pesaswap/gF_mzxFkI4qLgyPO/logo/light.svg?fit=max\u0026auto=format\u0026n=gF_mzxFkI4qLgyPO\u0026q=85\u0026s=3ab49bf4de03976de57a8f434e021b91","dark":"https://mintcdn.com/pesaswap/gF_mzxFkI4qLgyPO/logo/dark.svg?fit=max\u0026auto=format\u0026n=gF_mzxFkI4qLgyPO\u0026q=85\u0026s=da8704c755b4bdd989f354eafa16683c","href":"https://pesaswap.io"},"favicon":"https://mintcdn.com/pesaswap/9QnEDG_16mHRPjKR/favicon.png?fit=max\u0026auto=format\u0026n=9QnEDG_16mHRPjKR\u0026q=85\u0026s=d0c620d74c2cf12df449218d52c6b24d","api":{"openapi":["openapi_spec.json"],"playground":{"display":"simple"},"examples":{"languages":["curl","javascript","python","php"]},"mdx":{"auth":{"method":"bearer"},"server":"https://api.pesaswap.io"}},"background":{"decoration":"grid","color":{"light":"#F5FFFE","dark":"#1A2E2F"}},"navbar":{"links":[{"href":"mailto:support@pesaswap.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.pesaswap.io"}},"search":{"prompt":"Search Pesaswap documentation..."},"fonts":{"heading":{"family":"Inter","weight":400},"body":{"family":"Inter","weight":400}},"icons":{"library":"lucide"},"styling":{"codeblocks":"system","latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"pesaswap","hasAudioNarration":false,"actualSubdomain":"pesaswap","customDomains":["docs.pesaswap.io"],"gitSource":{"type":"github","owner":"pesaswap","repo":"pesaswap-api","deployBranch":"mpesa","contentDirectory":"api-reference","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b07e7e615c0c13290f8e044","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"Explore","count":81},{"language":"default","tag":"API Reference","count":57},{"language":"default","tag":"Explore Pesaswap","count":51},{"language":"default","tag":"Operations","count":35},{"language":"default","tag":"Checkout Experience","count":19},{"language":"default","tag":"Payment Orchestration","count":18},{"language":"default","tag":"Customizable and Native Integrations","count":17},{"language":"default","tag":"Admin APIs","count":13},{"language":"default","tag":"Payments","count":11},{"language":"default","tag":"Accept Payments","count":11}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"public/css/custom.css","content":""}]}
{"page":{"pagePath":"essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk","slug":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk","pageMetadata":{"title":"Headless SDK","icon":"grid-2x2","description":null,"href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(Warning,{children:[_jsx(_components.strong,{children:`Beta in Progress`}),` – The beta version is under active development and coming soon to our platform. `]}),`\n`,_jsx(_components.p,{children:`Pesaswap is designed to facilitate the integration and management of payment-related functionalities in a decoupled or headless architecture with flexibility to customize your checkout UI.`}),`\n`,_jsx(Heading,{level:`2`,id:`customize-the-payment-experience-using-headless-functions`,children:`Customize the Payment Experience Using Headless Functions`}),`\n`,_jsx(Heading,{level:`3`,id:`1-initialize-the-pesaswap-sdk`,children:`1. Initialize the Pesaswap SDK`}),`\n`,_jsx(_components.p,{children:`Initialize Pesaswap Headless SDK onto your app with your publishable key. To get a Publishable Key please find it here.`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`HTML + JavaScript`,numberOfLines:`5`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Source Hyperloader on your HTML file using the \u003cscript /> tag`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`hyper`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Hyper`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`init`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"YOUR_PUBLISHABLE_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` customBackendUrl:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"YOUR_BACKEND_URL\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // You can configure this as an endpoint for all the API calls such as session, payments, confirm call.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`iOS`,numberOfLines:`5`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// iOS implementation example`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` PesaswapSDK`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Initialize the SDK`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`let`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Pesaswap `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Pesaswap.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`init`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"YOUR_PUBLISHABLE_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Android`,numberOfLines:`5`,language:`java`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`java`,children:_jsxs(_components.code,{language:`java`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Android implementation example`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` io.Pesaswap.payments.paymentlauncher.PaymentLauncher;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Initialize the SDK`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#4EC9B0`},children:`PaymentLauncher`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` paymentLauncher`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` PaymentLauncher`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"YOUR_PUBLISHABLE_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Flutter`,numberOfLines:`5`,language:`dart`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`dart`,children:_jsxs(_components.code,{language:`dart`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Flutter implementation example`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'package:Pesaswap_sdk/Pesaswap_sdk.dart'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Initialize the SDK`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`PesaswapSDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`init`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"YOUR_PUBLISHABLE_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`React Native (Beta)`,numberOfLines:`5`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// React Native implementation example`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`PesaswapSDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@Pesaswap/react-native-sdk'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Initialize the SDK`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`PesaswapSDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`init`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"YOUR_PUBLISHABLE_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`2-create-a-payment-intent`,children:`2. Create a Payment Intent`}),`\n`,_jsxs(_components.p,{children:[`Make a request to the endpoint on your server to create a new payment. The `,_jsx(_components.code,{children:`clientSecret`}),` returned by your endpoint is used to initialize the payment session.`]}),`\n`,_jsx(Warning,{children:`Make sure to never share your API key with your client application as this could potentially compromise your security.`}),`\n`,_jsx(Heading,{level:`3`,id:`3-initialize-your-payment-session`,children:`3. Initialize your Payment Session`}),`\n`,_jsxs(_components.p,{children:[`Initialize a payment session by passing the `,_jsx(_components.code,{children:`clientSecret`}),` to the `,_jsx(_components.code,{children:`initPaymentSession`}),`.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`iOS`,numberOfLines:`1`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`paymentSession`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`initPaymentSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`paymentIntentClientSecret`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: paymentIntentClientSecret)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Android`,numberOfLines:`2`,language:`java`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`java`,children:_jsxs(_components.code,{language:`java`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Initialize payment session`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`paymentSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`initPaymentSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(paymentIntentClientSecret);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`4`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Initialize payment session`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`hyper`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`initPaymentSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` clientSecret:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` paymentIntentClientSecret`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Flutter`,numberOfLines:`2`,language:`dart`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`dart`,children:_jsxs(_components.code,{language:`dart`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Initialize payment session`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`PesaswapSDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`initPaymentSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(paymentIntentClientSecret);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`React Native (Beta)`,numberOfLines:`4`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Initialize payment session`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`PesaswapSDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`initPaymentSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` clientSecret:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` paymentIntentClientSecret`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`4`,id:`options-required`,children:`Options (Required)`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Description`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`clientSecret`})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Required.`}),` Identifier of the payment (string).`]})]})})]}),`\n`,_jsx(Heading,{level:`3`,id:`4-craft-a-customized-payments-experience`,children:`4. Craft a Customized Payments Experience`}),`\n`,_jsxs(_components.p,{children:[`Using the `,_jsx(_components.code,{children:`paymentSession`}),` object, you can fetch the customer’s default payment method data and confirm the payment using `,_jsx(_components.code,{children:`confirmWithCustomerDefaultPaymentMethod`}),`.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`iOS`,numberOfLines:`16`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`private`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` handler: PaymentSessionHandler`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`func`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` initSavedPaymentMethodSessionCallback`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`handler`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: PaymentSessionHandler) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` self`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`handler`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` handler`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@objc`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` func`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` launchHeadless`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`_`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sender`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Any`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` hyperViewModel.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`paymentSession`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`getCustomerSavedPaymentMethods`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(initSavedPaymentMethodSessionCallback)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getDefault.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`isEnabled`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getLast.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`isEnabled`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` getData.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`isEnabled`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@objc`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` func`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` getCustomerDefaultSavedPaymentMethodData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`_`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sender`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Any`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` paymentMethod `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` self`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`handler`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`getCustomerDefaultSavedPaymentMethodData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Android`,numberOfLines:`10`,language:`java`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`java`,children:_jsxs(_components.code,{language:`java`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Get customer saved payment methods`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`paymentSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getCustomerSavedPaymentMethods`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` PaymentSessionHandler`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` @`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:`Override`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` public`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#4EC9B0`},children:` void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#4EC9B0`},children:`PaymentMethodData`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` paymentMethodData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Handle payment method data`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Get default payment method`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#4EC9B0`},children:`PaymentMethod`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` defaultPaymentMethod`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` paymentSession`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getCustomerDefaultSavedPaymentMethodData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`8`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Get customer saved payment methods`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`hyper`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getCustomerSavedPaymentMethods`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`then`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`((`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`paymentMethods`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Handle payment methods`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Get default payment method`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` defaultPaymentMethod`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` hyper`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getCustomerDefaultSavedPaymentMethodData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Flutter`,numberOfLines:`5`,language:`dart`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`dart`,children:_jsxs(_components.code,{language:`dart`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Get customer saved payment methods`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`List`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`PaymentMethod`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> paymentMethods `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` PesaswapSDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getCustomerSavedPaymentMethods`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Get default payment method`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`PaymentMethod`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` defaultPaymentMethod `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` PesaswapSDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getCustomerDefaultSavedPaymentMethodData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`React Native (Beta)`,numberOfLines:`5`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Get customer saved payment methods`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` paymentMethods`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` PesaswapSDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getCustomerSavedPaymentMethods`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Get default payment method`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` defaultPaymentMethod`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` PesaswapSDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getCustomerDefaultSavedPaymentMethodData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})})]}),`\n`,_jsxs(Heading,{level:`2`,id:`payload-for-confirmwithcustomerdefaultpaymentmethod-payload`,children:[`Payload for `,_jsx(_components.code,{children:`confirmWithCustomerDefaultPaymentMethod(payload)`})]}),`\n`,_jsx(Heading,{level:`3`,id:`options-required-2`,children:`Options (Required)`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`confirmParams`})}),_jsx(_components.td,{children:`Object containing parameters that will be passed to the Hyper API.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`redirect`})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`(web only)`}),` Can be either `,_jsx(_components.code,{children:`'always'`}),` or `,_jsx(_components.code,{children:`'if_required'`}),`. If set to `,_jsx(_components.code,{children:`'always'`}),`, user is redirected after confirmation. `,_jsx(_components.code,{children:`'if_required'`}),` only redirects if needed.`]})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`confirmparams-object`,children:`ConfirmParams Object`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Description`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`return_url`})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`(web only)`}),` URL your customer will be directed to after payment.`]})]})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"system","config":{},"pageMetadata":{"title":"Headless SDK","icon":"grid-2x2","description":null,"href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Customize the Payment Experience Using Headless Functions","slug":"customize-the-payment-experience-using-headless-functions","depth":2,"children":[{"title":"1. Initialize the Pesaswap SDK","slug":"1-initialize-the-pesaswap-sdk","depth":3,"children":[]},{"title":"2. Create a Payment Intent","slug":"2-create-a-payment-intent","depth":3,"children":[]},{"title":"3. Initialize your Payment Session","slug":"3-initialize-your-payment-session","depth":3,"children":[]},{"title":"Options (Required)","slug":"options-required","depth":4,"children":[]},{"title":"4. Craft a Customized Payments Experience","slug":"4-craft-a-customized-payments-experience","depth":3,"children":[]}]},{"title":"Payload for confirmWithCustomerDefaultPaymentMethod(payload)","slug":"payload-for-confirmwithcustomerdefaultpaymentmethod-payload","depth":2,"children":[{"title":"Options (Required)","slug":"options-required-2","depth":3,"children":[]},{"title":"ConfirmParams Object","slug":"confirmparams-object","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"pesaswap","siteName":"Pesaswap","title":"Headless SDK - Pesaswap","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-13T15:41:25.318Z","originalFileLocation":"essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Pesaswap\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pesaswap/IiYabl-bWQCc0wDY/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/pesaswap/IiYabl-bWQCc0wDY/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pesaswap/IiYabl-bWQCc0wDY/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pesaswap/IiYabl-bWQCc0wDY/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pesaswap/IiYabl-bWQCc0wDY/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pesaswap/IiYabl-bWQCc0wDY/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pesaswap/IiYabl-bWQCc0wDY/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pesaswap/IiYabl-bWQCc0wDY/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pesaswap/IiYabl-bWQCc0wDY/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Headless SDK - Pesaswap\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Pesaswap\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://pesaswap.mintlify.site/_mintlify/api/og/v2?division=Customizable+and+Native+Integrations\u0026amp;title=Headless+SDK\u0026amp;theme=31fc1f05d1dd30c1a7dcf5ff\u0026amp;signature=095a8cf0890b267bc4b28c30f7bf7b97b4921fef06e908a395c003eca436e4f3\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Headless SDK - Pesaswap\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://pesaswap.mintlify.site/_mintlify/api/og/v2?division=Customizable+and+Native+Integrations\u0026amp;title=Headless+SDK\u0026amp;theme=31fc1f05d1dd30c1a7dcf5ff\u0026amp;signature=095a8cf0890b267bc4b28c30f7bf7b97b4921fef06e908a395c003eca436e4f3\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/pesaswap/IiYabl-bWQCc0wDY/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Pesaswap\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#02555B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.pesaswap.io/#organization\",\"name\":\"Pesaswap\",\"url\":\"https://docs.pesaswap.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/pesaswap/gF_mzxFkI4qLgyPO/logo/light.svg?fit=max\u0026auto=format\u0026n=gF_mzxFkI4qLgyPO\u0026q=85\u0026s=3ab49bf4de03976de57a8f434e021b91\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.pesaswap.io#website\",\"name\":\"Pesaswap\",\"url\":\"https://docs.pesaswap.io\",\"publisher\":{\"@id\":\"https://docs.pesaswap.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk#webpage\",\"url\":\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk\",\"name\":\"Headless SDK\",\"dateModified\":\"2026-10-13T15:41:25.318Z\",\"isPartOf\":{\"@id\":\"https://docs.pesaswap.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Explore Pesaswap\",\"item\":\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/payment-method-management\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Checkout Experience\",\"item\":\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/payment-method-management\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Headless SDK\",\"item\":\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk#article\",\"headline\":\"Headless SDK\",\"name\":\"Headless SDK\",\"url\":\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk\",\"mainEntityOfPage\":{\"@id\":\"https://docs.pesaswap.io/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk#webpage\"},\"dateModified\":\"2026-10-13T15:41:25.318Z\",\"publisher\":{\"@id\":\"https://docs.pesaswap.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.pesaswap.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Pesaswap\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Pesaswap\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk.md","siteName":"Pesaswap","nav":{"global":null,"tabs":[{"tab":"Overview","icon":"house","pages":[{"title":"Overview","href":"/introduction"}]},{"tab":"Explore","icon":"book","groups":[{"group":"About Pesaswap","icon":"star","pages":[{"title":"Exploration Guide","icon":"compass","href":"/essentials/ExplorationGuide"},{"title":"Roadmap","icon":"map","href":"/essentials/roadmap"},{"group":"Payment Modules","icon":"cpu","pages":[{"group":"Cost Observability","icon":"brain","pages":[{"title":"Cost","icon":"hand-coins","href":"/essentials/paymentmodules/cost-observability"}]},{"group":"Revenue Recovery","icon":"rotate-ccw","pages":[{"title":"Revenue Recovery","icon":"arrow-right-left","href":"/essentials/paymentmodules/revenue-recovery"}]},{"group":"Intelligent Routing","icon":"shuffle","pages":[{"title":"Auth Rate Based Routing","icon":"binoculars","href":"/essentials/paymentmodules/intelligent-routing/auth-rate-based-routing"}]},{"group":"Alternate Payment Method Widgets","icon":"layout-dashboard","pages":[{"title":"Pesaswapwidget Integration Guide","icon":"plug-zap","href":"/essentials/paymentmodules/alternate-payment-method-widgets/pesaswapwidget-integration-guide"}]}]}]},{"group":"Payments Guide","icon":"credit-card","pages":[{"title":"Payments guide","icon":"book-open","href":"/essentials/payments-guide/overview"},{"title":"Accept your first payment","icon":"rocket","href":"/essentials/payments-guide/quickstart"},{"title":"Wallet payments","icon":"wallet","href":"/essentials/payments-guide/wallet-payments"},{"title":"Card payments and 3DS","icon":"credit-card","href":"/essentials/payments-guide/card-payments"},{"title":"Mandates and recurring payments","icon":"repeat","href":"/essentials/payments-guide/mandates-and-recurring"},{"title":"Refunds","icon":"undo","href":"/essentials/payments-guide/refunds"},{"title":"Payouts","icon":"banknote","href":"/essentials/payments-guide/payouts"},{"title":"Validate an account","icon":"user-check","href":"/essentials/payments-guide/validate-account"},{"title":"Wallet balance","icon":"piggy-bank","href":"/essentials/payments-guide/wallet-balance"},{"title":"Legacy API (migrated merchants)","icon":"history","href":"/essentials/payments-guide/legacy-api-migrated-merchants"}]},{"group":"Integrations","icon":"plug","pages":[{"title":"Accept payments with WooCommerce","icon":"shopping-cart","href":"/essentials/integrations/woocommerce"}]},{"group":"Foreign Exchange","icon":"arrow-right-left","pages":[{"title":"Foreign exchange (FX)","icon":"arrow-right-left","href":"/essentials/foreign-exchange/overview"}]},{"group":"Account Setup","icon":"computer","pages":[{"title":"Using Pesaswap Control Center","icon":"monitor-cog","href":"/essentials/Account_setup/using pesaswap control setup"},{"title":"Test a payment","icon":"banknote","href":"/essentials/Account_setup/test a payment"},{"title":"Using postman","icon":"rocket","href":"/essentials/Account_setup/using postman"}]},{"group":"Use Cases","icon":"computer","pages":[{"title":"Use Cases for E-Commerce Businesses","icon":"building-2","href":"/essentials/use-cases/e-commerce-businesses"},{"title":"For B2B SaaS Businesses","icon":"computer","href":"/essentials/use-cases/for-b2b-saas-businesses"},{"title":"Marketplace/Platforms","icon":"computer","href":"/essentials/use-cases/for-marketplace-platforms"},{"title":"Use Cases for SaaS Businesses","icon":"pc-case","href":"/essentials/use-cases/for-saas-businesses"}]},{"group":"Explore Pesaswap","icon":"star","pages":[{"group":"Checkout Experience","icon":"credit-card","pages":[{"title":"Payment Method Management","icon":"square-kanban","href":"/essentials/explore-pesaswap/checkout-experience/payment-method-management"},{"title":"Customers","icon":"person-standing","description":null,"href":"/essentials/explore-pesaswap/checkout-experience/customer"},{"group":"Customizable and Native Integrations","icon":"cog","pages":[{"title":"Headless SDK","icon":"grid-2x2","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/headless-sdk"},{"title":"Server Setup","icon":"server","description":null,"href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/server-setup"},{"group":"Android","icon":"tablet-smartphone","pages":[{"title":"Customization","icon":"cog","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/android/customization"},{"title":"Features","icon":"file-box","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/android/features"},{"title":"Kotlin with Node Backend","icon":"proportions","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/android/kotlin-with-node-backend"}]},{"group":"Flutter","icon":"terminal","pages":[{"title":"Customization","icon":"cog","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/flutter/customization"},{"title":"Flutter with Node Backend","icon":"backpack","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/flutter/flutter-with-node-backend"}]},{"group":"IOS","icon":"apple","pages":[{"title":"Customization","icon":"cog","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/ios/customization"},{"title":"Features","icon":"component","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/ios/features"},{"title":"Swift with Node Backend","icon":"switch-camera","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/ios/swift-with-node-backend"}]},{"group":"React native","icon":"react","pages":[{"title":"Card Widget","icon":"club","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/react-native/card-widget"},{"title":"React Native Customization","icon":"combine","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/react-native/customization"},{"title":"React Native with Node Backend","icon":"chevrons-left-right-ellipsis","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/react-native/react-native-with-node-backend"}]},{"group":"Web","icon":"globe","pages":[{"title":"Customization","icon":"settings-2","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/web/customization"},{"title":"Error Codes","icon":"bug","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/web/error-codes"},{"title":"Node and HTML","icon":"code","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/web/node-and-html"},{"title":"Vanilla JS and REST API Integration","icon":"braces","href":"/essentials/explore-pesaswap/checkout-experience/customizable-and-native-integrations/web/vanilla-js-and-rest-api-integration"}]}]}]},{"group":"Payment Operations","icon":"circle-fading-plus","pages":[{"title":"Reconciliation","icon":"scale","href":"/essentials/explore-pesaswap/payment-operations/reconciliation/overview"},{"group":"Analytics \u0026 Operations","icon":"chart-column","pages":[{"title":"Exporting Payments Data","icon":"folder-up","href":"/essentials/explore-pesaswap/payment-operations/analytics-and-operations/exporting-payments-data"}]},{"group":"Data Migration","icon":"database","pages":[{"title":"Import Data to Pesaswap","icon":"download","href":"/essentials/explore-pesaswap/payment-operations/data-migration/import-data-to-pesaswap"}]},{"group":"Managing Accounts and Profiles","icon":"user","pages":[{"title":"Organization, Merchant and Profile Setup","icon":"square-user-round","href":"/essentials/explore-pesaswap/payment-operations/managing-accounts-and-profiles/managing-accounts-and-profiles"},{"title":"Pesaswap account structure","icon":"user-cog","href":"/essentials/explore-pesaswap/payment-operations/managing-accounts-and-profiles/pesaswap-account-structure"},{"icon":"users","title":null,"href":"/essentials/explore-pesaswap/payment-operations/managing-accounts-and-profiles/seamless-client-onboarding"}]},{"group":"Surcharge","icon":"plug-zap","pages":[{"title":"Surcharge setup guide","href":"/essentials/explore-pesaswap/payment-operations/surcharge/surcharge-setup-guide"}]},{"group":"Users and roles","icon":"users-round","pages":[{"icon":"notebook-tabs","title":null,"href":"/essentials/explore-pesaswap/payment-operations/users and roles/business-details"},{"icon":"user","title":null,"href":"/essentials/explore-pesaswap/payment-operations/users and roles/users-and-roles"}]},{"group":"Disputes Chargebacks","icon":"triangle-alert","pages":[{"title":"Disputes/Chargebacks","icon":"battery-plus","href":"/essentials/explore-pesaswap/payment-operations/disputes-chargebacks"}]},{"title":"Manage Your Team","icon":"square-dashed-kanban","href":"/essentials/explore-pesaswap/payment-operations/manage-your-team"}]},{"group":"Payment Orchestration","icon":"credit-card","pages":[{"group":"Accept Payments","icon":"wallet","pages":[{"group":"Connectors","icon":"plug","pages":[{"title":"Supported connectors","icon":"plug","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/connectors/supported-connectors"},{"title":"Activate-connector-on-pesaswap","icon":"chevrons-left-right-ellipsis","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/connectors/activate-connector-on-pesaswap"},{"title":"Try a Payment","icon":"banknote","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/connectors/try-a-payment"}]},{"group":"Payment Links","icon":"link","pages":[{"title":"Configurations","icon":"bolt","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/payment-links/configurations"},{"title":"Create Payment Links","icon":"link-2","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/payment-links/create-payment-links"},{"title":"Secure Payment Links","icon":"globe-lock","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/payment-links/secure-payment-links"},{"title":"Setup Custom Domain","icon":"globe","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/payment-links/setup-custom-domain"}]},{"title":"Incremental Authorization","icon":"hand-platter","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/incremental-authorization"},{"title":"Save a Payment Method","icon":"hard-drive-download","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/save-a-payment-method"},{"title":"Supported Payment Workflows","icon":"life-buoy","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/supported-payment-workflows"},{"title":"Webhooks","icon":"webhook","href":"/essentials/explore-pesaswap/payment-orchestration/accept-payments/webhooks"}]},{"group":"Process Payouts","icon":"grip-vertical","pages":[{"title":"Getting Started with Payouts","icon":"land-plot","href":"/essentials/explore-pesaswap/payment-orchestration/process-payouts/getting-started-with-payouts"},{"title":"Smart Retries","icon":"rotate-ccw","href":"/essentials/explore-pesaswap/payment-orchestration/process-payouts/smart-retries-in-payout"},{"title":"Smart Router for Payouts","icon":"router","href":"/essentials/explore-pesaswap/payment-orchestration/process-payouts/smart-router-for-payouts"},{"title":"Using Saved Payment Methods","icon":"save","href":"/essentials/explore-pesaswap/payment-orchestration/process-payouts/using-saved-payment-methods"}]},{"group":"Smart Retries","icon":"refresh-ccw","pages":[{"title":"3DS Step up Retries","icon":"chevron-up","href":"/essentials/explore-pesaswap/payment-orchestration/smart-retries/3ds-step-up-retries"}]},{"group":"Smart Routing","icon":"ethernet-port","pages":[{"title":"Default Fall Back Routing","icon":"square-arrow-down","href":"/essentials/explore-pesaswap/payment-orchestration/smart-routing/default-fallback-routing"},{"title":"Rule-Based Routing","icon":"diamond-minus","href":"/essentials/explore-pesaswap/payment-orchestration/smart-routing/rule-based-routing"}]}]},{"group":"Security and Compliance","icon":"shield-check","pages":[{"title":"Data Security","icon":"key","href":"/essentials/explore-pesaswap/security-and-compliance/data-security"},{"title":"GDPR Compliance","icon":"memory-stick","href":"/essentials/explore-pesaswap/security-and-compliance/gdpr-complince"},{"title":"Identity and Access Management","icon":"fingerprint","href":"/essentials/explore-pesaswap/security-and-compliance/identity-and-access-management"},{"title":"PCI Compliance","icon":"hard-drive","href":"/essentials/explore-pesaswap/security-and-compliance/pci-compliance"}]}]},{"group":"Checklist for Production","icon":"rocket","pages":[{"group":"Going Live","icon":"radio","pages":[{"title":"SaaS","icon":"component","href":"/essentials/check-list-for-production/going-live/for-saas-setup"}]},{"group":"For-On-Prem Setup","icon":"settings-2","pages":[{"group":"PCI Compliance","icon":"pc-case","pages":[{"title":"Get Started","icon":"sparkle","href":"/essentials/check-list-for-production/for-on-prem-setup/pci-compliance/get-started"}]},{"title":"Data Security","icon":"shield","href":"/essentials/check-list-for-production/for-on-prem-setup/data-security"},{"title":"Updates","icon":"circle-fading-arrow-up","href":"/essentials/check-list-for-production/for-on-prem-setup/updates"}]}]},{"group":"FAQ","icon":"messages-square","pages":[{"title":null,"href":"/essentials/faq"}]}]},{"tab":"API Reference","icon":"terminal","pages":[{"title":"API Reference","href":"/api-reference/payments/payments--create"}]}]},"basePath":"","title":"Headless SDK - Pesaswap","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":[],"chunks":[]}