[{"data":1,"prerenderedAt":5602},["ShallowReactive",2],{"docs-navigation":3,"page-\u002Fdeveloper-tools\u002Fintegration\u002Fwebhooks":787},[4,20,48,169,226,273,326,330,370,442,641,738],{"title":5,"path":6,"stem":7,"children":8,"page":19},"Shared","\u002F_shared","_shared",[9],{"title":10,"path":11,"stem":12,"children":13,"page":19},"Payments","\u002F_shared\u002Fpayments","_shared\u002Fpayments",[14],{"title":15,"path":16,"stem":17,"markets":18},"Webhook confirmation","\u002F_shared\u002Fpayments\u002F_webhook-note","_shared\u002Fpayments\u002F_webhook-note",null,false,{"title":21,"path":22,"stem":23,"children":24},"Api","\u002Fapi","api",[25,28,32,36,40,44],{"title":26,"path":22,"stem":27,"markets":18},"API Reference","api\u002Findex",{"title":29,"path":30,"stem":31,"markets":18},"Authentication","\u002Fapi\u002Fauthentication","api\u002Fauthentication",{"title":33,"path":34,"stem":35,"markets":18},"Errors","\u002Fapi\u002Ferrors","api\u002Ferrors",{"title":37,"path":38,"stem":39,"markets":18},"Pagination","\u002Fapi\u002Fpagination","api\u002Fpagination",{"title":41,"path":42,"stem":43,"markets":18},"Rate Limits","\u002Fapi\u002Frate-limits","api\u002Frate-limits",{"title":45,"path":46,"stem":47,"markets":18},"Supported Currencies","\u002Fapi\u002Fsupported-currencies","api\u002Fsupported-currencies",{"title":49,"path":50,"stem":51,"children":52},"Commerce","\u002Fcommerce","commerce",[53,56,64,85,108,122,132,151],{"title":49,"path":50,"stem":54,"markets":18,"order":55},"commerce\u002Findex",0,{"title":57,"path":58,"stem":59,"children":60,"markets":18,"order":63},"Get started","\u002Fcommerce\u002Fget-started","commerce\u002F1.get-started\u002Findex",[61],{"title":62,"path":58,"stem":59,"markets":18,"order":55},"Build Your First Store",1,{"title":65,"markets":18,"order":66,"path":67,"stem":68,"children":69},"Payment Pages",2,"\u002Fcommerce\u002Fpayment-pages","commerce\u002F2.payment-pages\u002Findex",[70,71,76,80],{"title":65,"path":67,"stem":68,"markets":18,"order":55},{"title":72,"path":73,"stem":74,"markets":18,"order":75},"Add Products to a Page","\u002Fcommerce\u002Fpayment-pages\u002Fadd-products","commerce\u002F2.payment-pages\u002Fadd-products",4,{"title":77,"path":78,"stem":79,"markets":18,"order":66},"Create a Payment Page","\u002Fcommerce\u002Fpayment-pages\u002Fcreate","commerce\u002F2.payment-pages\u002Fcreate",{"title":81,"path":82,"stem":83,"markets":18,"order":84},"Manage Payment Pages","\u002Fcommerce\u002Fpayment-pages\u002Fmanage","commerce\u002F2.payment-pages\u002Fmanage",3,{"title":86,"markets":18,"order":84,"path":87,"stem":88,"children":89},"Payment Requests","\u002Fcommerce\u002Fpayment-requests","commerce\u002F3.payment-requests\u002Findex",[90,91,95,99,103],{"title":86,"path":87,"stem":88,"markets":18,"order":55},{"title":92,"path":93,"stem":94,"markets":18,"order":66},"Create a Payment Request","\u002Fcommerce\u002Fpayment-requests\u002Fcreate","commerce\u002F3.payment-requests\u002Fcreate",{"title":96,"path":97,"stem":98,"markets":18,"order":75},"Manage Payment Requests","\u002Fcommerce\u002Fpayment-requests\u002Fmanage","commerce\u002F3.payment-requests\u002Fmanage",{"title":100,"path":101,"stem":102,"markets":18,"order":84},"Notify and Finalize Requests","\u002Fcommerce\u002Fpayment-requests\u002Fnotify-and-finalize","commerce\u002F3.payment-requests\u002Fnotify-and-finalize",{"title":104,"path":105,"stem":106,"markets":18,"order":107},"Verify a Payment Request","\u002Fcommerce\u002Fpayment-requests\u002Fverify","commerce\u002F3.payment-requests\u002Fverify",5,{"title":109,"markets":18,"order":75,"path":110,"stem":111,"children":112},"Products","\u002Fcommerce\u002Fproducts","commerce\u002F4.products\u002Findex",[113,114,118],{"title":109,"path":110,"stem":111,"markets":18,"order":55},{"title":115,"path":116,"stem":117,"markets":18,"order":66},"Create a Product","\u002Fcommerce\u002Fproducts\u002Fcreate","commerce\u002F4.products\u002Fcreate",{"title":119,"path":120,"stem":121,"markets":18,"order":84},"Manage Products","\u002Fcommerce\u002Fproducts\u002Fmanage","commerce\u002F4.products\u002Fmanage",{"title":123,"path":124,"stem":125,"children":126,"markets":18,"order":107},"Orders","\u002Fcommerce\u002Forders","commerce\u002F5.orders\u002Findex",[127,128],{"title":123,"path":124,"stem":125,"markets":18,"order":55},{"title":129,"path":130,"stem":131,"markets":18,"order":66},"Manage Orders","\u002Fcommerce\u002Forders\u002Fmanage","commerce\u002F5.orders\u002Fmanage",{"title":133,"markets":18,"order":134,"path":135,"stem":136,"children":137},"Storefronts",6,"\u002Fcommerce\u002Fstorefronts","commerce\u002F6.storefronts\u002Findex",[138,139,143,147],{"title":133,"path":135,"stem":136,"markets":18,"order":55},{"title":140,"path":141,"stem":142,"markets":18,"order":66},"Create a Storefront","\u002Fcommerce\u002Fstorefronts\u002Fcreate","commerce\u002F6.storefronts\u002Fcreate",{"title":144,"path":145,"stem":146,"markets":18,"order":84},"Publish and Manage Storefronts","\u002Fcommerce\u002Fstorefronts\u002Fmanage","commerce\u002F6.storefronts\u002Fmanage",{"title":148,"path":149,"stem":150,"markets":18,"order":75},"Products and Orders","\u002Fcommerce\u002Fstorefronts\u002Fproducts-and-orders","commerce\u002F6.storefronts\u002Fproducts-and-orders",{"title":152,"markets":18,"order":153,"path":154,"stem":155,"children":156,"page":19},"Concepts",7,"\u002Fcommerce\u002Fconcepts","commerce\u002F7.concepts",[157,161,165],{"title":158,"path":159,"stem":160,"markets":18,"order":84},"No-code Builder vs API Approach","\u002Fcommerce\u002Fconcepts\u002Fnocode-vs-api","commerce\u002F7.concepts\u002Fnocode-vs-api",{"title":162,"path":163,"stem":164,"markets":18,"order":66},"Commerce Order Lifecycle","\u002Fcommerce\u002Fconcepts\u002Forder-lifecycle","commerce\u002F7.concepts\u002Forder-lifecycle",{"title":166,"path":167,"stem":168,"markets":18,"order":63},"Payment Pages vs Payment Requests","\u002Fcommerce\u002Fconcepts\u002Fpayment-pages-vs-requests","commerce\u002F7.concepts\u002Fpayment-pages-vs-requests",{"title":170,"path":171,"stem":172,"children":173},"Developer Tools","\u002Fdeveloper-tools","developer-tools",[174,176,193,197,214,218,222],{"title":170,"path":171,"stem":175,"markets":18,"order":55},"developer-tools\u002Findex",{"title":177,"markets":18,"order":63,"path":178,"stem":179,"children":180,"page":19},"Integration toolkit","\u002Fdeveloper-tools\u002Fintegration","developer-tools\u002F1.integration",[181,185,189],{"title":182,"path":183,"stem":184,"markets":18,"order":63},"API keys","\u002Fdeveloper-tools\u002Fintegration\u002Fapi-keys","developer-tools\u002F1.integration\u002Fapi-keys",{"title":186,"path":187,"stem":188,"markets":18,"order":84},"Test payments","\u002Fdeveloper-tools\u002Fintegration\u002Ftest-payments","developer-tools\u002F1.integration\u002Ftest-payments",{"title":190,"path":191,"stem":192,"markets":18,"order":66},"Webhooks","\u002Fdeveloper-tools\u002Fintegration\u002Fwebhooks","developer-tools\u002F1.integration\u002Fwebhooks",{"title":194,"path":195,"stem":196,"markets":18,"order":66},"InlineJS","\u002Fdeveloper-tools\u002Finline-js","developer-tools\u002F2.inline-js",{"title":198,"markets":18,"order":84,"path":199,"stem":200,"children":201,"page":19},"Mobile SDKs","\u002Fdeveloper-tools\u002Fmobile-sdks","developer-tools\u002F3.mobile-sdks",[202,206,210],{"title":203,"path":204,"stem":205,"markets":18,"order":63},"Android SDK","\u002Fdeveloper-tools\u002Fmobile-sdks\u002Fandroid","developer-tools\u002F3.mobile-sdks\u002Fandroid",{"title":207,"path":208,"stem":209,"markets":18,"order":84},"Flutter SDK","\u002Fdeveloper-tools\u002Fmobile-sdks\u002Fflutter","developer-tools\u002F3.mobile-sdks\u002Fflutter",{"title":211,"path":212,"stem":213,"markets":18,"order":66},"iOS SDK","\u002Fdeveloper-tools\u002Fmobile-sdks\u002Fios","developer-tools\u002F3.mobile-sdks\u002Fios",{"title":215,"path":216,"stem":217,"markets":18,"order":75},"Server SDKs","\u002Fdeveloper-tools\u002Fserver-sdks","developer-tools\u002F4.server-sdks",{"title":219,"path":220,"stem":221,"markets":18,"order":107},"Plugins","\u002Fdeveloper-tools\u002Fplugins","developer-tools\u002F5.plugins",{"title":223,"path":224,"stem":225,"markets":18,"order":134},"MCP Server","\u002Fdeveloper-tools\u002Fmcp-server","developer-tools\u002F6.mcp-server",{"title":227,"path":228,"stem":229,"children":230},"Disbursements","\u002Fdisbursements","disbursements",[231,233,236],{"title":227,"path":228,"stem":232,"markets":18,"order":55},"disbursements\u002Findex",{"title":57,"path":234,"stem":235,"markets":18,"order":63},"\u002Fdisbursements\u002Fget-started","disbursements\u002F1.get-started",{"title":237,"markets":18,"order":66,"path":238,"stem":239,"children":240,"page":19},"Transfers","\u002Fdisbursements\u002Ftransfers","disbursements\u002Ftransfers",[241,245,253,257,261,265,269],{"title":242,"path":243,"stem":244,"markets":18},"Transfer recipients","\u002Fdisbursements\u002Ftransfers\u002Frecipients","disbursements\u002Ftransfers\u002F01.recipients",{"title":246,"path":247,"stem":248,"markets":249},"Verify an account number","\u002Fdisbursements\u002Ftransfers\u002Fverify-account","disbursements\u002Ftransfers\u002F02.verify-account",[250,251,252],"ng","gh","za",{"title":254,"path":255,"stem":256,"markets":18},"Send money to a single recipient","\u002Fdisbursements\u002Ftransfers\u002Fsingle-transfers","disbursements\u002Ftransfers\u002F03.single-transfers",{"title":258,"path":259,"stem":260,"markets":18},"Send money to multiple recipients","\u002Fdisbursements\u002Ftransfers\u002Fbulk-transfers","disbursements\u002Ftransfers\u002F04.bulk-transfers",{"title":262,"path":263,"stem":264,"markets":18},"Check your balance","\u002Fdisbursements\u002Ftransfers\u002Fbalance-management","disbursements\u002Ftransfers\u002F05.balance-management",{"title":266,"path":267,"stem":268,"markets":18},"Transfer approval","\u002Fdisbursements\u002Ftransfers\u002Ftransfer-approval","disbursements\u002Ftransfers\u002F06.transfer-approval",{"title":270,"path":271,"stem":272,"markets":18},"How transfers work","\u002Fdisbursements\u002Ftransfers\u002Fhow-transfers-work","disbursements\u002Ftransfers\u002F07.how-transfers-work",{"title":274,"path":275,"stem":251,"children":276,"page":19},"Gh","\u002Fgh",[277],{"title":10,"path":278,"stem":279,"children":280,"markets":18,"order":55},"\u002Fgh\u002Fpayments","gh\u002Fpayments\u002Findex",[281,282,316],{"title":10,"path":278,"stem":279,"markets":18,"order":55},{"title":283,"markets":18,"order":66,"path":284,"stem":285,"children":286},"Payment channels","\u002Fgh\u002Fpayments\u002Fchannels","gh\u002Fpayments\u002Fchannels\u002Findex",[287,289,294,298,308,312],{"title":288,"path":284,"stem":285,"markets":18,"order":55},"Overview",{"title":290,"path":291,"stem":292,"markets":18,"order":293},"Apple Pay","\u002Fgh\u002Fpayments\u002Fchannels\u002Fapple-pay","gh\u002Fpayments\u002Fchannels\u002Fapple-pay",98,{"title":295,"path":296,"stem":297,"markets":18,"order":66},"Cards","\u002Fgh\u002Fpayments\u002Fchannels\u002Fcards","gh\u002Fpayments\u002Fchannels\u002Fcards",{"title":299,"markets":18,"order":75,"path":300,"stem":301,"children":302},"Dedicated Virtual Accounts","\u002Fgh\u002Fpayments\u002Fchannels\u002Fdedicated-virtual-accounts","gh\u002Fpayments\u002Fchannels\u002Fdedicated-virtual-accounts\u002Findex",[303,304],{"title":299,"path":300,"stem":301,"markets":18},{"title":305,"path":306,"stem":307,"markets":18},"Create and Assign Dedicated Virtual Accounts","\u002Fgh\u002Fpayments\u002Fchannels\u002Fdedicated-virtual-accounts\u002Fcreate-and-assign-dedicated-virtual-accounts","gh\u002Fpayments\u002Fchannels\u002Fdedicated-virtual-accounts\u002Fcreate-and-assign-dedicated-virtual-accounts",{"title":309,"path":310,"stem":311,"markets":18,"order":63},"Mobile Money","\u002Fgh\u002Fpayments\u002Fchannels\u002Fmobile-money","gh\u002Fpayments\u002Fchannels\u002Fmobile-money",{"title":313,"path":314,"stem":315,"markets":18,"order":84},"Pay with Transfer","\u002Fgh\u002Fpayments\u002Fchannels\u002Fpwt","gh\u002Fpayments\u002Fchannels\u002Fpwt",{"title":317,"path":318,"stem":319,"children":320,"markets":18,"order":107},"In-person","\u002Fgh\u002Fpayments\u002Fin-person","gh\u002Fpayments\u002Fin-person\u002Findex",[321,322],{"title":288,"path":318,"stem":319,"markets":18,"order":55},{"title":323,"path":324,"stem":325,"markets":18,"order":63},"Virtual Terminal","\u002Fgh\u002Fpayments\u002Fin-person\u002Fvirtual-terminal","gh\u002Fpayments\u002Fin-person\u002Fvirtual-terminal",{"title":327,"path":328,"stem":329,"markets":18},"Home","\u002F","index",{"title":331,"path":332,"stem":333,"children":334,"page":19},"Ke","\u002Fke","ke",[335],{"title":10,"path":336,"stem":337,"children":338,"markets":18,"order":55},"\u002Fke\u002Fpayments","ke\u002Fpayments\u002Findex",[339,340,362],{"title":10,"path":336,"stem":337,"markets":18,"order":55},{"title":283,"markets":18,"order":66,"path":341,"stem":342,"children":343},"\u002Fke\u002Fpayments\u002Fchannels","ke\u002Fpayments\u002Fchannels\u002Findex",[344,345,348,351,354,358],{"title":288,"path":341,"stem":342,"markets":18,"order":55},{"title":290,"path":346,"stem":347,"markets":18,"order":293},"\u002Fke\u002Fpayments\u002Fchannels\u002Fapple-pay","ke\u002Fpayments\u002Fchannels\u002Fapple-pay",{"title":295,"path":349,"stem":350,"markets":18,"order":84},"\u002Fke\u002Fpayments\u002Fchannels\u002Fcards","ke\u002Fpayments\u002Fchannels\u002Fcards",{"title":309,"path":352,"stem":353,"markets":18,"order":66},"\u002Fke\u002Fpayments\u002Fchannels\u002Fmobile-money","ke\u002Fpayments\u002Fchannels\u002Fmobile-money",{"title":355,"path":356,"stem":357,"markets":18,"order":63},"M-PESA","\u002Fke\u002Fpayments\u002Fchannels\u002Fmpesa","ke\u002Fpayments\u002Fchannels\u002Fmpesa",{"title":359,"path":360,"stem":361,"markets":18,"order":75},"PesaLink","\u002Fke\u002Fpayments\u002Fchannels\u002Fpesalink","ke\u002Fpayments\u002Fchannels\u002Fpesalink",{"title":317,"path":363,"stem":364,"children":365,"markets":18,"order":107},"\u002Fke\u002Fpayments\u002Fin-person","ke\u002Fpayments\u002Fin-person\u002Findex",[366,367],{"title":288,"path":363,"stem":364,"markets":18,"order":55},{"title":323,"path":368,"stem":369,"markets":18,"order":63},"\u002Fke\u002Fpayments\u002Fin-person\u002Fvirtual-terminal","ke\u002Fpayments\u002Fin-person\u002Fvirtual-terminal",{"title":371,"path":372,"stem":373,"children":374},"Operations","\u002Foperations","operations",[375,377,386,395,404,421],{"title":371,"path":372,"stem":376,"markets":18,"order":55},"operations\u002Findex",{"title":378,"markets":18,"order":84,"path":379,"stem":380,"children":381,"page":19},"Refunds","\u002Foperations\u002Frefunds","operations\u002F3.refunds",[382],{"title":383,"path":384,"stem":385,"markets":18},"How to issue a refund","\u002Foperations\u002Frefunds\u002Fprocess-a-refund","operations\u002F3.refunds\u002Fprocess-a-refund",{"title":387,"markets":18,"order":75,"path":388,"stem":389,"children":390,"page":19},"Disputes","\u002Foperations\u002Fdisputes","operations\u002F4.disputes",[391],{"title":392,"path":393,"stem":394,"markets":18},"How to manage disputes","\u002Foperations\u002Fdisputes\u002Fmanage-disputes","operations\u002F4.disputes\u002Fmanage-disputes",{"title":396,"markets":18,"order":107,"path":397,"stem":398,"children":399,"page":19},"Settlements","\u002Foperations\u002Fsettlements","operations\u002F5.settlements",[400],{"title":401,"path":402,"stem":403,"markets":18},"Settlements reference","\u002Foperations\u002Fsettlements\u002Fview-settlements","operations\u002F5.settlements\u002Fview-settlements",{"title":405,"markets":18,"order":134,"path":406,"stem":407,"children":408,"page":19},"Verification","\u002Foperations\u002Fverification","operations\u002F6.verification",[409,413,417],{"title":410,"path":411,"stem":412,"markets":18,"order":84},"Resolve BVN","\u002Foperations\u002Fverification\u002Fresolve-bvn","operations\u002F6.verification\u002Fresolve-bvn",{"title":414,"path":415,"stem":416,"markets":18,"order":66},"Resolve Card BIN","\u002Foperations\u002Fverification\u002Fresolve-card-bin","operations\u002F6.verification\u002Fresolve-card-bin",{"title":418,"path":419,"stem":420,"markets":18,"order":75},"Verify BVN Match","\u002Foperations\u002Fverification\u002Fverify-bvn-match","operations\u002F6.verification\u002Fverify-bvn-match",{"title":152,"markets":18,"order":422,"path":423,"stem":424,"children":425,"page":19},8,"\u002Foperations\u002Fconcepts","operations\u002F8.concepts",[426,430,434,438],{"title":427,"path":428,"stem":429,"markets":18,"order":75},"Customer Lifecycle in Paystack","\u002Foperations\u002Fconcepts\u002Fcustomer-lifecycle","operations\u002F8.concepts\u002Fcustomer-lifecycle",{"title":431,"path":432,"stem":433,"markets":18,"order":66},"The Dispute Resolution Process","\u002Foperations\u002Fconcepts\u002Fdispute-resolution","operations\u002F8.concepts\u002Fdispute-resolution",{"title":435,"path":436,"stem":437,"markets":18,"order":63},"How Settlements Work","\u002Foperations\u002Fconcepts\u002Fhow-settlements-work","operations\u002F8.concepts\u002Fhow-settlements-work",{"title":439,"path":440,"stem":441,"markets":18,"order":84},"Refund Timelines by Channel","\u002Foperations\u002Fconcepts\u002Frefund-timelines","operations\u002F8.concepts\u002Frefund-timelines",{"title":10,"path":443,"stem":444,"children":445},"\u002Fpayments","payments",[446,448,486,538,576,607,625],{"title":10,"path":443,"stem":447,"markets":18,"order":55},"payments\u002Findex",{"title":283,"markets":18,"order":66,"path":449,"stem":450,"children":451},"\u002Fpayments\u002Fchannels","payments\u002F2.channels\u002Findex",[452,454,457,461,464,479,482],{"title":453,"path":449,"stem":450,"markets":18,"order":55},"Payment Channels",{"title":290,"path":455,"stem":456,"markets":18,"order":293},"\u002Fpayments\u002Fchannels\u002Fapple-pay","payments\u002F2.channels\u002Fapple-pay",{"title":458,"path":459,"stem":460,"markets":18,"order":75},"Bank Accounts","\u002Fpayments\u002Fchannels\u002Fbank","payments\u002F2.channels\u002Fbank",{"title":295,"path":462,"stem":463,"markets":18,"order":63},"\u002Fpayments\u002Fchannels\u002Fcards","payments\u002F2.channels\u002Fcards",{"title":299,"markets":18,"order":84,"path":465,"stem":466,"children":467},"\u002Fpayments\u002Fchannels\u002Fdedicated-virtual-accounts","payments\u002F2.channels\u002Fdedicated-virtual-accounts\u002Findex",[468,470,474],{"title":299,"path":465,"stem":466,"markets":469},[250,251],{"title":305,"path":471,"stem":472,"markets":473},"\u002Fpayments\u002Fchannels\u002Fdedicated-virtual-accounts\u002Fcreate-and-assign-dedicated-virtual-accounts","payments\u002F2.channels\u002Fdedicated-virtual-accounts\u002Fcreate-and-assign-dedicated-virtual-accounts",[250,251],{"title":475,"path":476,"stem":477,"markets":478},"Validate Customer","\u002Fpayments\u002Fchannels\u002Fdedicated-virtual-accounts\u002Fvalidate-customer","payments\u002F2.channels\u002Fdedicated-virtual-accounts\u002Fvalidate-customer",[250],{"title":313,"path":480,"stem":481,"markets":18,"order":66},"\u002Fpayments\u002Fchannels\u002Fpwt","payments\u002F2.channels\u002Fpwt",{"title":483,"path":484,"stem":485,"markets":18,"order":107},"USSD","\u002Fpayments\u002Fchannels\u002Fussd","payments\u002F2.channels\u002Fussd",{"title":487,"markets":18,"order":84,"path":488,"stem":489,"children":490},"Online","\u002Fpayments\u002Fonline","payments\u002F3.online\u002Findex",[491,493,507,526,530,534],{"title":492,"path":488,"stem":489,"markets":18,"order":55},"Online payments",{"title":494,"path":495,"stem":496,"children":497,"markets":18,"order":66},"Checkout","\u002Fpayments\u002Fonline\u002Fcheckout","payments\u002F3.online\u002F1.checkout\u002Findex",[498,499,503],{"title":494,"path":495,"stem":496,"markets":18,"order":55},{"title":500,"path":501,"stem":502,"markets":18},"How to integrate Popup Checkout","\u002Fpayments\u002Fonline\u002Fcheckout\u002Fpopup","payments\u002F3.online\u002F1.checkout\u002Fpopup",{"title":504,"path":505,"stem":506,"markets":18},"How to integrate Redirect Checkout","\u002Fpayments\u002Fonline\u002Fcheckout\u002Fredirect","payments\u002F3.online\u002F1.checkout\u002Fredirect",{"title":508,"markets":18,"order":84,"path":509,"stem":510,"children":511},"Charge API","\u002Fpayments\u002Fonline\u002Fcharge-api","payments\u002F3.online\u002F2.charge-api\u002Findex",[512,513,518,522],{"title":508,"path":509,"stem":510,"markets":18,"order":55},{"title":514,"path":515,"stem":516,"markets":517},"How to charge via bank transfer","\u002Fpayments\u002Fonline\u002Fcharge-api\u002Fbank-transfers","payments\u002F3.online\u002F2.charge-api\u002Fbank-transfers",[250,251],{"title":519,"path":520,"stem":521,"markets":18},"How to charge a card","\u002Fpayments\u002Fonline\u002Fcharge-api\u002Fcards","payments\u002F3.online\u002F2.charge-api\u002Fcards",{"title":523,"path":524,"stem":525,"markets":18},"Charge your first card in 10 minutes","\u002Fpayments\u002Fonline\u002Fcharge-api\u002Fquickstart","payments\u002F3.online\u002F2.charge-api\u002Fquickstart",{"title":527,"path":528,"stem":529,"markets":18},"Metadata reference","\u002Fpayments\u002Fonline\u002Fmetadata","payments\u002F3.online\u002Fmetadata",{"title":531,"path":532,"stem":533,"markets":18,"order":63},"Build your first checkout","\u002Fpayments\u002Fonline\u002Fquickstart","payments\u002F3.online\u002Fquickstart",{"title":535,"path":536,"stem":537,"markets":18},"Verify a payment","\u002Fpayments\u002Fonline\u002Fverify-payments","payments\u002F3.online\u002Fverify-payments",{"title":539,"markets":18,"order":75,"path":540,"stem":541,"children":542},"Recurring","\u002Fpayments\u002Frecurring","payments\u002F4.recurring\u002Findex",[543,545,561,565],{"title":544,"path":540,"stem":541,"markets":18,"order":55},"Recurring payments",{"title":546,"markets":18,"order":63,"path":547,"stem":548,"children":549},"Charge authorization","\u002Fpayments\u002Frecurring\u002Fcharge-authorization","payments\u002F4.recurring\u002F1.charge-authorization\u002Findex",[550,552,557],{"title":551,"path":547,"stem":548,"markets":18,"order":55},"How to set up recurring charges",{"title":553,"path":554,"stem":555,"markets":556,"order":66},"Direct Debit","\u002Fpayments\u002Frecurring\u002Fcharge-authorization\u002Fdirect-debit","payments\u002F4.recurring\u002F1.charge-authorization\u002Fdirect-debit",[250],{"title":558,"path":559,"stem":560,"markets":18,"order":63},"How to use partial debits","\u002Fpayments\u002Frecurring\u002Fcharge-authorization\u002Fpartial-debits","payments\u002F4.recurring\u002F1.charge-authorization\u002Fpartial-debits",{"title":562,"path":563,"stem":564,"markets":18,"order":66},"How to run bulk charges","\u002Fpayments\u002Frecurring\u002Fbulk-charge","payments\u002F4.recurring\u002F2.bulk-charge",{"title":566,"path":567,"stem":568,"children":569,"markets":18,"order":84},"Subscriptions","\u002Fpayments\u002Frecurring\u002Fsubscriptions","payments\u002F4.recurring\u002F3.subscriptions\u002Findex",[570,572],{"title":571,"path":567,"stem":568,"markets":18},"How subscriptions work",{"title":573,"path":574,"stem":575,"markets":18},"Set up your first subscription in 15 minutes","\u002Fpayments\u002Frecurring\u002Fsubscriptions\u002Fquickstart","payments\u002F4.recurring\u002F3.subscriptions\u002Fquickstart",{"title":317,"markets":18,"order":107,"path":577,"stem":578,"children":579},"\u002Fpayments\u002Fin-person","payments\u002F5.in-person\u002Findex",[580,582,604],{"title":581,"path":577,"stem":578,"markets":18,"order":55},"In-person payments",{"title":583,"markets":18,"order":63,"path":584,"stem":585,"children":586},"Physical Terminal","\u002Fpayments\u002Fin-person\u002Fphysical-terminal","payments\u002F5.in-person\u002F1.physical-terminal\u002Findex",[587,588,592,596,600],{"title":583,"path":584,"stem":585,"markets":18,"order":55},{"title":589,"path":590,"stem":591,"markets":18},"Custom Terminal apps","\u002Fpayments\u002Fin-person\u002Fphysical-terminal\u002Fcustom-apps","payments\u002F5.in-person\u002F1.physical-terminal\u002Fcustom-apps",{"title":593,"path":594,"stem":595,"markets":18,"order":63},"Your First Terminal Integration","\u002Fpayments\u002Fin-person\u002Fphysical-terminal\u002Fget-started","payments\u002F5.in-person\u002F1.physical-terminal\u002Fget-started",{"title":597,"path":598,"stem":599,"markets":18},"Invoice payments on Terminal","\u002Fpayments\u002Fin-person\u002Fphysical-terminal\u002Finvoice-payments","payments\u002F5.in-person\u002F1.physical-terminal\u002Finvoice-payments",{"title":601,"path":602,"stem":603,"markets":18},"Push payment requests","\u002Fpayments\u002Fin-person\u002Fphysical-terminal\u002Fpush-payment-requests","payments\u002F5.in-person\u002F1.physical-terminal\u002Fpush-payment-requests",{"title":323,"path":605,"stem":606,"markets":18,"order":66},"\u002Fpayments\u002Fin-person\u002Fvirtual-terminal","payments\u002F5.in-person\u002Fvirtual-terminal",{"title":608,"markets":18,"order":134,"path":609,"stem":610,"children":611},"Split payments","\u002Fpayments\u002Fsplit-payments","payments\u002F6.split-payments\u002Findex",[612,613,617,621],{"title":608,"path":609,"stem":610,"markets":18,"order":55},{"title":614,"path":615,"stem":616,"markets":18,"order":63},"Create a subaccount","\u002Fpayments\u002Fsplit-payments\u002Fsubaccounts","payments\u002F6.split-payments\u002F1.subaccounts",{"title":618,"path":619,"stem":620,"markets":18,"order":66},"Split a payment with a subaccount","\u002Fpayments\u002Fsplit-payments\u002Fsingle-split","payments\u002F6.split-payments\u002F2.single-split",{"title":622,"path":623,"stem":624,"markets":18,"order":84},"Split a payment across multiple subaccounts","\u002Fpayments\u002Fsplit-payments\u002Fmulti-split","payments\u002F6.split-payments\u002F3.multi-split",{"title":152,"markets":18,"order":153,"path":626,"stem":627,"children":628,"page":19},"\u002Fpayments\u002Fconcepts","payments\u002F7.concepts",[629,633,637],{"title":630,"path":631,"stem":632,"markets":18,"order":63},"Payment flow","\u002Fpayments\u002Fconcepts\u002Fpayment-flow","payments\u002F7.concepts\u002Fpayment-flow",{"title":634,"path":635,"stem":636,"markets":18,"order":84},"Transaction statuses","\u002Fpayments\u002Fconcepts\u002Ftransaction-statuses","payments\u002F7.concepts\u002Ftransaction-statuses",{"title":638,"path":639,"stem":640,"markets":18,"order":66},"Webhooks vs polling","\u002Fpayments\u002Fconcepts\u002Fwebhooks-vs-polling","payments\u002F7.concepts\u002Fwebhooks-vs-polling",{"title":642,"path":643,"stem":644,"children":645},"Use Cases","\u002Fuse-cases","use-cases",[646,649,670,687,704,721],{"title":647,"path":643,"stem":648,"markets":18,"order":55},"Use-cases","use-cases\u002Findex",{"title":650,"markets":18,"order":63,"path":651,"stem":652,"children":653,"page":19},"Fintech","\u002Fuse-cases\u002Ffintech","use-cases\u002F1.fintech",[654,658,662,666],{"title":655,"path":656,"stem":657,"markets":18},"Fund a Wallet with Paystack","\u002Fuse-cases\u002Ffintech\u002Fwallet-funding","use-cases\u002F1.fintech\u002F1.wallet-funding",{"title":659,"path":660,"stem":661,"markets":18},"Send Money Between Users","\u002Fuse-cases\u002Ffintech\u002Fpeer-to-peer-transfers","use-cases\u002F1.fintech\u002F2.peer-to-peer-transfers",{"title":663,"path":664,"stem":665,"markets":18},"Set Up Recurring Savings Contributions","\u002Fuse-cases\u002Ffintech\u002Fsavings-investment-apps","use-cases\u002F1.fintech\u002F3.savings-investment-apps",{"title":667,"path":668,"stem":669,"markets":18},"Automate Loan Repayment Collection","\u002Fuse-cases\u002Ffintech\u002Flending-loan-repayments","use-cases\u002F1.fintech\u002F4.lending-loan-repayments",{"title":671,"markets":18,"order":66,"path":672,"stem":673,"children":674,"page":19},"E-commerce","\u002Fuse-cases\u002Fecommerce","use-cases\u002F2.ecommerce",[675,679,683],{"title":676,"path":677,"stem":678,"markets":18},"Split Payments Between a Platform and Vendors","\u002Fuse-cases\u002Fecommerce\u002Fmarketplace-split-payments","use-cases\u002F2.ecommerce\u002F1.marketplace-split-payments",{"title":680,"path":681,"stem":682,"markets":18},"Charge Customers on a Monthly Subscription","\u002Fuse-cases\u002Fecommerce\u002Fsubscription-box-store","use-cases\u002F2.ecommerce\u002F2.subscription-box-store",{"title":684,"path":685,"stem":686,"markets":18},"Sell and Deliver Digital Products","\u002Fuse-cases\u002Fecommerce\u002Fdigital-downloads","use-cases\u002F2.ecommerce\u002F3.digital-downloads",{"title":688,"markets":18,"order":84,"path":689,"stem":690,"children":691,"page":19},"Gaming & entertainment","\u002Fuse-cases\u002Fgaming","use-cases\u002F3.gaming",[692,696,700],{"title":693,"path":694,"stem":695,"markets":18},"Accept In-app Purchases on Mobile","\u002Fuse-cases\u002Fgaming\u002Fin-app-purchases","use-cases\u002F3.gaming\u002F1.in-app-purchases",{"title":697,"path":698,"stem":699,"markets":18},"Offer Premium Membership Tiers","\u002Fuse-cases\u002Fgaming\u002Fsubscription-memberships","use-cases\u002F3.gaming\u002F2.subscription-memberships",{"title":701,"path":702,"stem":703,"markets":18},"Sell Virtual Currency (Coins\u002FGems)","\u002Fuse-cases\u002Fgaming\u002Fvirtual-currency-top-ups","use-cases\u002F3.gaming\u002F3.virtual-currency-top-ups",{"title":705,"markets":18,"order":75,"path":706,"stem":707,"children":708,"page":19},"Transportation","\u002Fuse-cases\u002Ftransportation","use-cases\u002F4.transportation",[709,713,717],{"title":710,"path":711,"stem":712,"markets":18},"Capture and Charge Rides with Preauthorization","\u002Fuse-cases\u002Ftransportation\u002Fride-hailing-payment-flow","use-cases\u002F4.transportation\u002F1.ride-hailing-payment-flow",{"title":714,"path":715,"stem":716,"markets":18},"Pay Drivers in Bulk After Each Shift","\u002Fuse-cases\u002Ftransportation\u002Ffleet-driver-payouts","use-cases\u002F4.transportation\u002F2.fleet-driver-payouts",{"title":718,"path":719,"stem":720,"markets":18},"Accept Toll and Ticket Payments Online","\u002Fuse-cases\u002Ftransportation\u002Ftoll-ticketing","use-cases\u002F4.transportation\u002F3.toll-ticketing",{"title":722,"markets":18,"order":107,"path":723,"stem":724,"children":725,"page":19},"Travel & hospitality","\u002Fuse-cases\u002Ftravel","use-cases\u002F5.travel",[726,730,734],{"title":727,"path":728,"stem":729,"markets":18},"Hold a Deposit on Hotel Booking","\u002Fuse-cases\u002Ftravel\u002Fhotel-booking-preauthorization","use-cases\u002F5.travel\u002F1.hotel-booking-preauthorization",{"title":731,"path":732,"stem":733,"markets":18},"Sell Flight Tickets and Process Refunds","\u002Fuse-cases\u002Ftravel\u002Fflight-ticketing-refunds","use-cases\u002F5.travel\u002F2.flight-ticketing-refunds",{"title":735,"path":736,"stem":737,"markets":18},"Sell Tour Experiences with Split Revenue","\u002Fuse-cases\u002Ftravel\u002Ftour-experience-bookings","use-cases\u002F5.travel\u002F3.tour-experience-bookings",{"title":739,"path":740,"stem":252,"children":741,"page":19},"Za","\u002Fza",[742],{"title":10,"path":743,"stem":744,"children":745,"markets":18,"order":55},"\u002Fza\u002Fpayments","za\u002Fpayments\u002Findex",[746,747,779],{"title":10,"path":743,"stem":744,"markets":18,"order":55},{"title":283,"markets":18,"order":66,"path":748,"stem":749,"children":750},"\u002Fza\u002Fpayments\u002Fchannels","za\u002Fpayments\u002Fchannels\u002Findex",[751,752,755,759,763,766,771,775],{"title":288,"path":748,"stem":749,"markets":18,"order":55},{"title":290,"path":753,"stem":754,"markets":18,"order":293},"\u002Fza\u002Fpayments\u002Fchannels\u002Fapple-pay","za\u002Fpayments\u002Fchannels\u002Fapple-pay",{"title":756,"path":757,"stem":758,"markets":18,"order":84},"Capitec Pay","\u002Fza\u002Fpayments\u002Fchannels\u002Fcapitec-pay","za\u002Fpayments\u002Fchannels\u002Fcapitec-pay",{"title":760,"path":761,"stem":762,"markets":18,"order":107},"Card Preauthorization","\u002Fza\u002Fpayments\u002Fchannels\u002Fcard-preauthorization","za\u002Fpayments\u002Fchannels\u002Fcard-preauthorization",{"title":295,"path":764,"stem":765,"markets":18,"order":63},"\u002Fza\u002Fpayments\u002Fchannels\u002Fcards","za\u002Fpayments\u002Fchannels\u002Fcards",{"title":767,"path":768,"stem":769,"markets":18,"order":770},"Google Pay","\u002Fza\u002Fpayments\u002Fchannels\u002Fgoogle-pay","za\u002Fpayments\u002Fchannels\u002Fgoogle-pay",99,{"title":772,"path":773,"stem":774,"markets":18,"order":66},"Instant EFT","\u002Fza\u002Fpayments\u002Fchannels\u002Finstant-eft","za\u002Fpayments\u002Fchannels\u002Finstant-eft",{"title":776,"path":777,"stem":778,"markets":18,"order":75},"QR code payments","\u002Fza\u002Fpayments\u002Fchannels\u002Fqr-codes","za\u002Fpayments\u002Fchannels\u002Fqr-codes",{"title":317,"path":780,"stem":781,"children":782,"markets":18,"order":107},"\u002Fza\u002Fpayments\u002Fin-person","za\u002Fpayments\u002Fin-person\u002Findex",[783,784],{"title":288,"path":780,"stem":781,"markets":18,"order":55},{"title":323,"path":785,"stem":786,"markets":18,"order":63},"\u002Fza\u002Fpayments\u002Fin-person\u002Fvirtual-terminal","za\u002Fpayments\u002Fin-person\u002Fvirtual-terminal",{"id":788,"title":190,"body":789,"description":5595,"extension":5596,"markets":18,"meta":5597,"navigation":5598,"path":191,"seo":5599,"stem":192,"type":5600,"whats_next":18,"__hash__":5601},"content\u002Fdeveloper-tools\u002F1.integration\u002Fwebhooks.md",{"type":790,"value":791,"toc":5584},"minimark",[792,796,805,812,816,819,884,938,942,1085,1089,1093,1103,1106,1114,1143,1150,1154,1212,1219,1225,1228,1238,4699,4703,4709,4713,4721,4724,4727,4739,4755,4760,5124,5128,5166,5169,5186,5244,5247,5251,5254,5271,5274,5278,5529,5533,5541,5577,5580],[793,794,288],"h2",{"id":795},"overview",[797,798,799,800,804],"p",{},"Paystack webhooks are ",[801,802,803],"code",{},"POST"," requests sent to your server when the status of an API request changes. They are the recommended way to keep your backend synchronized with asynchronous payment activity because callbacks and client-side flows can fail when the customer’s device goes offline or the network is interrupted.",[797,806,807,808,811],{},"Your webhook endpoint should parse a JSON request body and return ",[801,809,810],{},"200 OK",". In live mode, failed webhook deliveries are retried every 3 minutes for the first 4 tries, then hourly for up to 72 hours. In test mode, failed deliveries are retried hourly for 10 hours, with a 30-second timeout per attempt.",[793,813,815],{"id":814},"event-object-structure","Event object structure",[797,817,818],{},"Webhook payloads are JSON objects with this top-level shape:",[820,821,826],"pre",{"className":822,"code":823,"language":824,"meta":825,"style":825},"language-json shiki shiki-themes material-theme-lighter github-light github-dark-dimmed","{\n  \"event\": \"charge.success\",\n  \"data\": {}\n}\n","json","",[801,827,828,836,865,879],{"__ignoreMap":825},[829,830,832],"span",{"class":831,"line":63},"line",[829,833,835],{"class":834},"s7Vxm","{\n",[829,837,838,842,846,849,852,856,860,862],{"class":831,"line":66},[829,839,841],{"class":840},"sLsO-","  \"",[829,843,845],{"class":844},"sO5ea","event",[829,847,848],{"class":840},"\"",[829,850,851],{"class":834},":",[829,853,855],{"class":854},"sO3A-"," \"",[829,857,859],{"class":858},"sOv1k","charge.success",[829,861,848],{"class":854},[829,863,864],{"class":834},",\n",[829,866,867,869,872,874,876],{"class":831,"line":84},[829,868,841],{"class":840},[829,870,871],{"class":844},"data",[829,873,848],{"class":840},[829,875,851],{"class":834},[829,877,878],{"class":834}," {}\n",[829,880,881],{"class":831,"line":75},[829,882,883],{"class":834},"}\n",[885,886,887,903],"table",{},[888,889,890],"thead",{},[891,892,893,897,900],"tr",{},[894,895,896],"th",{},"Field",[894,898,899],{},"Type",[894,901,902],{},"Description",[904,905,906,926],"tbody",{},[891,907,908,913,916],{},[909,910,911],"td",{},[801,912,845],{},[909,914,915],{},"string",[909,917,918,919,921,922,925],{},"Event name, such as ",[801,920,859],{}," or ",[801,923,924],{},"refund.processed",".",[891,927,928,932,935],{},[909,929,930],{},[801,931,871],{},[909,933,934],{},"object",[909,936,937],{},"Event-specific resource payload. Its structure depends on the event type.",[793,939,941],{"id":940},"how-to-set-up-and-verify-webhooks","How to set up and verify webhooks",[943,944,945,962,979,1012,1020,1031,1044,1054],"ol",{},[946,947,948,955,958,959,961],"li",{},[949,950,951,952,954],"strong",{},"Create a public ",[801,953,803],{}," endpoint",[956,957],"br",{},"Add a server endpoint that accepts JSON and returns ",[801,960,810],{}," quickly.",[946,963,964,967,969,970,978],{},[949,965,966],{},"Add the endpoint in the Paystack Dashboard",[956,968],{},"Go to ",[971,972,977],"a",{"href":973,"rel":974,"target":976},"https:\u002F\u002Fdashboard.paystack.com\u002Fv2\u002Fdevelopers\u002Fapi-configuration",[975],"nofollow","_blank","Developers > API configuration"," and save your webhook URL.",[946,980,981,984,986,987,990,991,925,995,997,998,1001,1002,1004,1005,1007,1008,925],{},[949,982,983],{},"Verify the signature before processing the event",[956,985],{},"Webhooks signed with a signing secret carry a ",[801,988,989],{},"Paystack-Signature"," header. Check it on the raw request body before you trust the event. See ",[971,992,994],{"href":993},"#verify-webhook-signatures","Verify webhook signatures",[956,996],{},"While your integration has a secret key, webhooks also carry the ",[801,999,1000],{},"X-Paystack-Signature"," header. This header is deprecated. If your webhooks don't carry ",[801,1003,989],{}," yet, generate a signing secret on the Dashboard and keep verifying ",[801,1006,1000],{}," until they do. See ",[971,1009,1011],{"href":1010},"#x-paystack-signature-deprecated","X-Paystack-Signature (deprecated)",[946,1013,1014,1017,1019],{},[949,1015,1016],{},"Allowlist Paystack IP addresses if required by your infrastructure",[956,1018],{},"Restrict access to the three published webhook IP addresses where possible.",[946,1021,1022,1025,1027,1028,1030],{},[949,1023,1024],{},"Acknowledge immediately",[956,1026],{},"Return ",[801,1029,810],{}," before starting long-running work such as database updates, emails, or provisioning.",[946,1032,1033,1036,1038,1039,1041,1042,925],{},[949,1034,1035],{},"Process the event by event name",[956,1037],{},"Switch on ",[801,1040,845],{}," and handle the resource inside ",[801,1043,871],{},[946,1045,1046,1049,1051,1052,925],{},[949,1047,1048],{},"Test delivery",[956,1050],{},"Trigger test payments and confirm that your endpoint receives JSON correctly, verifies the signature, and returns ",[801,1053,810],{},[946,1055,1056,1059],{},[949,1057,1058],{},"Check common deployment requirements",[1060,1061,1062,1065,1072,1079],"ul",{},[946,1063,1064],{},"Use a publicly reachable URL.",[946,1066,1067,1068,925],{},"Do not use localhost. To test on your machine, see ",[971,1069,1071],{"href":1070},"#receive-webhooks-locally","Receive webhooks locally",[946,1073,1074,1075,1078],{},"If you use ",[801,1076,1077],{},".htaccess",", keep the expected trailing slash behavior consistent.",[946,1080,1081,1082,1084],{},"If Paystack does not receive ",[801,1083,810],{},", retries continue according to the environment schedule.",[1086,1087,994],"h3",{"id":1088},"verify-webhook-signatures",[1090,1091,989],"h4",{"id":1092},"paystack-signature",[797,1094,1095,1096,1099,1100,925],{},"Paystack signs test and live webhooks with separate signing secrets. Your webhooks carry this header once your integration has an active signing secret for that mode. The secret starts with ",[801,1097,1098],{},"whsec_",". You generate, show, rotate, and revoke it on the Paystack Dashboard under ",[949,1101,1102],{},"Developers > API configuration > Webhook signing secret",[797,1104,1105],{},"The header looks like this:",[820,1107,1112],{"className":1108,"code":1110,"language":1111,"meta":825},[1109],"language-text","Paystack-Signature: t=1760270400,v1=whk_3f9a1c2e:9d1b...e47a\n","text",[801,1113,1110],{"__ignoreMap":825},[1060,1115,1116,1122,1137],{},[946,1117,1118,1121],{},[801,1119,1120],{},"t"," is the time Paystack signed the webhook, in unix seconds.",[946,1123,1124,1125,1128,1129,1132,1133,1136],{},"Each ",[801,1126,1127],{},"v1"," is ",[801,1130,1131],{},"\u003Ckey id>:\u003Csignature>",". The key id starts with ",[801,1134,1135],{},"whk_",". The signature is a lower-case hex HMAC-SHA512, 128 characters long.",[946,1138,1139,1140,1142],{},"There is usually one ",[801,1141,1127],{},". While you rotate your secret there are two, one per secret. Other fields may be added later, so ignore any you don't recognise.",[797,1144,1145,1146,925],{},"If your webhooks don't carry this header, your integration has no active signing secret for this mode. Generate one on the Dashboard. Until the header appears, keep your secret key and verify ",[971,1147,1148],{"href":1010},[801,1149,1000],{},[1090,1151,1153],{"id":1152},"how-to-verify-it","How to verify it",[943,1155,1156,1159,1178,1184,1196,1202],{},[946,1157,1158],{},"Read the raw request body as bytes, before any JSON parsing.",[946,1160,1161,1162,1165,1166,1168,1169,1171,1172,1174,1175,1177],{},"Split the header on ",[801,1163,1164],{},",",". Take the one ",[801,1167,1120],{}," value and every ",[801,1170,1127],{}," value. Split each ",[801,1173,1127],{}," value on its first ",[801,1176,851],{}," into the key id and the signature.",[946,1179,1180,1181,1183],{},"Reject the webhook if ",[801,1182,1120],{}," is more than 300 seconds before or after your server's time. This stops an old webhook from being replayed.",[946,1185,1186,1187,1189,1190,1192,1193,1195],{},"Compute HMAC-SHA512 over ",[801,1188,1120],{},", then ",[801,1191,925],{},", then the raw body, using your whole signing secret (",[801,1194,1098],{}," included) as the key.",[946,1197,1198,1199,1201],{},"Compare your result with each ",[801,1200,1127],{}," signature using a constant-time comparison. The webhook is genuine if any of them matches.",[946,1203,1027,1204,1207,1208,1211],{},[801,1205,1206],{},"401"," if nothing matches. If it matches, return ",[801,1209,1210],{},"200"," quickly, then process the event.",[797,1213,1214,1215,1218],{},"Use the body exactly as received. If your framework parses the JSON and you serialise it again, spacing, number formats such as ",[801,1216,1217],{},"1.50",", and escaped characters can change, and the signature no longer matches.",[797,1220,1221,1222,1224],{},"A retried or resent webhook is signed again with a new ",[801,1223,1120],{},", so the 300-second window doesn't reject legitimate retries.",[1090,1226,1227],{"id":801},"Code",[797,1229,1230,1231,1233,1234,1237],{},"Each example reads the raw body, checks every ",[801,1232,1127],{},", compares in constant time and allows 300 seconds of clock difference. ",[801,1235,1236],{},"secrets"," is a list so you can hold your old and new secret while you rotate.",[1239,1240,1241,2571,3640],"code-tabs",{},[1242,1243,1244],"template",{"v-slot:nodejs":825},[820,1245,1249],{"className":1246,"code":1247,"language":1248,"meta":825,"style":825},"language-js shiki shiki-themes material-theme-lighter github-light github-dark-dimmed","const crypto = require('crypto');\nconst express = require('express');\n\nconst TOLERANCE_SECONDS = 300;\n\n\u002F\u002F Returns the key id (kid) of the signature that matched, or null.\nfunction verifyPaystackSignature(rawBody, header, secrets, now = Math.floor(Date.now() \u002F 1000)) {\n  if (!Buffer.isBuffer(rawBody) || typeof header !== 'string') return null;\n\n  let t = null;\n  const entries = [];\n  for (const part of header.split(',')) {\n    const i = part.indexOf('=');\n    if (i === -1) continue;\n    const key = part.slice(0, i).trim();\n    const value = part.slice(i + 1).trim();\n    if (key === 't') {\n      if (t !== null || !\u002F^[0-9]+$\u002F.test(value)) return null;\n      t = Number(value);\n    } else if (key === 'v1') {\n      const j = value.indexOf(':');\n      if (j !== -1) entries.push({ kid: value.slice(0, j), hex: value.slice(j + 1) });\n    }\n  }\n  if (t === null || entries.length === 0) return null;\n  if (Math.abs(now - t) > TOLERANCE_SECONDS) return null;\n\n  for (const secret of secrets) {\n    const expected = crypto.createHmac('sha512', secret).update(`${t}.`).update(rawBody).digest();\n    for (const { kid, hex } of entries) {\n      if (!\u002F^[0-9a-f]{128}$\u002F.test(hex)) continue;\n      if (crypto.timingSafeEqual(expected, Buffer.from(hex, 'hex'))) return kid;\n    }\n  }\n  return null;\n}\n\nconst app = express();\n\n\u002F\u002F express.raw keeps req.body as the exact bytes Paystack sent. Register this route before any\n\u002F\u002F app.use(express.json()): a JSON parser that runs first consumes the body and every check fails.\napp.post('\u002Fwebhooks\u002Fpaystack', express.raw({ type: 'application\u002Fjson' }), (req, res) => {\n  const secret = process.env.PAYSTACK_WEBHOOK_SECRET; \u002F\u002F whsec_...\n  if (!secret) return res.sendStatus(500);\n\n  const kid = verifyPaystackSignature(req.body, req.get('paystack-signature'), [secret]);\n  if (!kid) return res.sendStatus(401);\n\n  res.sendStatus(200);\n  const event = JSON.parse(req.body.toString('utf8'));\n  \u002F\u002F handle event.event and event.data\n});\n","js",[801,1250,1251,1287,1311,1317,1332,1336,1342,1404,1461,1466,1481,1497,1533,1564,1591,1629,1665,1687,1748,1767,1795,1824,1906,1912,1918,1953,1991,1996,2016,2088,2118,2160,2210,2215,2220,2230,2235,2240,2256,2261,2267,2273,2341,2369,2401,2406,2458,2488,2493,2511,2556,2562],{"__ignoreMap":825},[829,1252,1253,1257,1261,1265,1269,1273,1276,1279,1281,1284],{"class":831,"line":63},[829,1254,1256],{"class":1255},"sAeZB","const",[829,1258,1260],{"class":1259},"s1fxI"," crypto",[829,1262,1264],{"class":1263},"s6LNo"," =",[829,1266,1268],{"class":1267},"sENpr"," require",[829,1270,1272],{"class":1271},"swCDk","(",[829,1274,1275],{"class":854},"'",[829,1277,1278],{"class":858},"crypto",[829,1280,1275],{"class":854},[829,1282,1283],{"class":1271},")",[829,1285,1286],{"class":834},";\n",[829,1288,1289,1291,1294,1296,1298,1300,1302,1305,1307,1309],{"class":831,"line":66},[829,1290,1256],{"class":1255},[829,1292,1293],{"class":1259}," express",[829,1295,1264],{"class":1263},[829,1297,1268],{"class":1267},[829,1299,1272],{"class":1271},[829,1301,1275],{"class":854},[829,1303,1304],{"class":858},"express",[829,1306,1275],{"class":854},[829,1308,1283],{"class":1271},[829,1310,1286],{"class":834},[829,1312,1313],{"class":831,"line":84},[829,1314,1316],{"emptyLinePlaceholder":1315},true,"\n",[829,1318,1319,1321,1324,1326,1330],{"class":831,"line":75},[829,1320,1256],{"class":1255},[829,1322,1323],{"class":1259}," TOLERANCE_SECONDS",[829,1325,1264],{"class":1263},[829,1327,1329],{"class":1328},"sCI7e"," 300",[829,1331,1286],{"class":834},[829,1333,1334],{"class":831,"line":107},[829,1335,1316],{"emptyLinePlaceholder":1315},[829,1337,1338],{"class":831,"line":134},[829,1339,1341],{"class":1340},"sCqSu","\u002F\u002F Returns the key id (kid) of the signature that matched, or null.\n",[829,1343,1344,1347,1350,1352,1356,1358,1361,1363,1366,1368,1371,1373,1376,1378,1381,1384,1386,1389,1392,1394,1397,1399,1401],{"class":831,"line":153},[829,1345,1346],{"class":1255},"function",[829,1348,1349],{"class":1267}," verifyPaystackSignature",[829,1351,1272],{"class":834},[829,1353,1355],{"class":1354},"semhU","rawBody",[829,1357,1164],{"class":834},[829,1359,1360],{"class":1354}," header",[829,1362,1164],{"class":834},[829,1364,1365],{"class":1354}," secrets",[829,1367,1164],{"class":834},[829,1369,1370],{"class":1354}," now",[829,1372,1264],{"class":1263},[829,1374,1375],{"class":1271}," Math",[829,1377,925],{"class":834},[829,1379,1380],{"class":1267},"floor",[829,1382,1383],{"class":1271},"(Date",[829,1385,925],{"class":834},[829,1387,1388],{"class":1267},"now",[829,1390,1391],{"class":1271},"() ",[829,1393,328],{"class":1263},[829,1395,1396],{"class":1328}," 1000",[829,1398,1283],{"class":1271},[829,1400,1283],{"class":834},[829,1402,1403],{"class":834}," {\n",[829,1405,1406,1410,1414,1417,1420,1422,1425,1427,1429,1432,1435,1438,1440,1443,1446,1448,1450,1452,1455,1459],{"class":831,"line":422},[829,1407,1409],{"class":1408},"sb9E3","  if",[829,1411,1413],{"class":1412},"sOnBC"," (",[829,1415,1416],{"class":1263},"!",[829,1418,1419],{"class":1271},"Buffer",[829,1421,925],{"class":834},[829,1423,1424],{"class":1267},"isBuffer",[829,1426,1272],{"class":1412},[829,1428,1355],{"class":1271},[829,1430,1431],{"class":1412},") ",[829,1433,1434],{"class":1263},"||",[829,1436,1437],{"class":1263}," typeof",[829,1439,1360],{"class":1271},[829,1441,1442],{"class":1263}," !==",[829,1444,1445],{"class":854}," '",[829,1447,915],{"class":858},[829,1449,1275],{"class":854},[829,1451,1431],{"class":1412},[829,1453,1454],{"class":1408},"return",[829,1456,1458],{"class":1457},"sNG8c"," null",[829,1460,1286],{"class":834},[829,1462,1464],{"class":831,"line":1463},9,[829,1465,1316],{"emptyLinePlaceholder":1315},[829,1467,1469,1472,1475,1477,1479],{"class":831,"line":1468},10,[829,1470,1471],{"class":1255},"  let",[829,1473,1474],{"class":1271}," t",[829,1476,1264],{"class":1263},[829,1478,1458],{"class":1457},[829,1480,1286],{"class":834},[829,1482,1484,1487,1490,1492,1495],{"class":831,"line":1483},11,[829,1485,1486],{"class":1255},"  const",[829,1488,1489],{"class":1259}," entries",[829,1491,1264],{"class":1263},[829,1493,1494],{"class":1412}," []",[829,1496,1286],{"class":834},[829,1498,1500,1503,1505,1507,1510,1513,1515,1517,1520,1522,1524,1526,1528,1531],{"class":831,"line":1499},12,[829,1501,1502],{"class":1408},"  for",[829,1504,1413],{"class":1412},[829,1506,1256],{"class":1255},[829,1508,1509],{"class":1259}," part",[829,1511,1512],{"class":1263}," of",[829,1514,1360],{"class":1271},[829,1516,925],{"class":834},[829,1518,1519],{"class":1267},"split",[829,1521,1272],{"class":1412},[829,1523,1275],{"class":854},[829,1525,1164],{"class":858},[829,1527,1275],{"class":854},[829,1529,1530],{"class":1412},")) ",[829,1532,835],{"class":834},[829,1534,1536,1539,1542,1544,1546,1548,1551,1553,1555,1558,1560,1562],{"class":831,"line":1535},13,[829,1537,1538],{"class":1255},"    const",[829,1540,1541],{"class":1259}," i",[829,1543,1264],{"class":1263},[829,1545,1509],{"class":1271},[829,1547,925],{"class":834},[829,1549,1550],{"class":1267},"indexOf",[829,1552,1272],{"class":1412},[829,1554,1275],{"class":854},[829,1556,1557],{"class":858},"=",[829,1559,1275],{"class":854},[829,1561,1283],{"class":1412},[829,1563,1286],{"class":834},[829,1565,1567,1570,1572,1575,1578,1581,1584,1586,1589],{"class":831,"line":1566},14,[829,1568,1569],{"class":1408},"    if",[829,1571,1413],{"class":1412},[829,1573,1574],{"class":1271},"i",[829,1576,1577],{"class":1263}," ===",[829,1579,1580],{"class":1263}," -",[829,1582,1583],{"class":1328},"1",[829,1585,1431],{"class":1412},[829,1587,1588],{"class":1408},"continue",[829,1590,1286],{"class":834},[829,1592,1594,1596,1599,1601,1603,1605,1608,1610,1613,1615,1617,1619,1621,1624,1627],{"class":831,"line":1593},15,[829,1595,1538],{"class":1255},[829,1597,1598],{"class":1259}," key",[829,1600,1264],{"class":1263},[829,1602,1509],{"class":1271},[829,1604,925],{"class":834},[829,1606,1607],{"class":1267},"slice",[829,1609,1272],{"class":1412},[829,1611,1612],{"class":1328},"0",[829,1614,1164],{"class":834},[829,1616,1541],{"class":1271},[829,1618,1283],{"class":1412},[829,1620,925],{"class":834},[829,1622,1623],{"class":1267},"trim",[829,1625,1626],{"class":1412},"()",[829,1628,1286],{"class":834},[829,1630,1632,1634,1637,1639,1641,1643,1645,1647,1649,1652,1655,1657,1659,1661,1663],{"class":831,"line":1631},16,[829,1633,1538],{"class":1255},[829,1635,1636],{"class":1259}," value",[829,1638,1264],{"class":1263},[829,1640,1509],{"class":1271},[829,1642,925],{"class":834},[829,1644,1607],{"class":1267},[829,1646,1272],{"class":1412},[829,1648,1574],{"class":1271},[829,1650,1651],{"class":1263}," +",[829,1653,1654],{"class":1328}," 1",[829,1656,1283],{"class":1412},[829,1658,925],{"class":834},[829,1660,1623],{"class":1267},[829,1662,1626],{"class":1412},[829,1664,1286],{"class":834},[829,1666,1668,1670,1672,1675,1677,1679,1681,1683,1685],{"class":831,"line":1667},17,[829,1669,1569],{"class":1408},[829,1671,1413],{"class":1412},[829,1673,1674],{"class":1271},"key",[829,1676,1577],{"class":1263},[829,1678,1445],{"class":854},[829,1680,1120],{"class":858},[829,1682,1275],{"class":854},[829,1684,1431],{"class":1412},[829,1686,835],{"class":834},[829,1688,1690,1693,1695,1697,1699,1701,1704,1707,1709,1712,1715,1719,1722,1725,1728,1730,1732,1735,1737,1740,1742,1744,1746],{"class":831,"line":1689},18,[829,1691,1692],{"class":1408},"      if",[829,1694,1413],{"class":1412},[829,1696,1120],{"class":1271},[829,1698,1442],{"class":1263},[829,1700,1458],{"class":1457},[829,1702,1703],{"class":1263}," ||",[829,1705,1706],{"class":1263}," !",[829,1708,328],{"class":854},[829,1710,1711],{"class":1408},"^",[829,1713,1714],{"class":1457},"[",[829,1716,1718],{"class":1717},"scI3H","0-9",[829,1720,1721],{"class":1457},"]",[829,1723,1724],{"class":1263},"+",[829,1726,1727],{"class":1408},"$",[829,1729,328],{"class":854},[829,1731,925],{"class":834},[829,1733,1734],{"class":1267},"test",[829,1736,1272],{"class":1412},[829,1738,1739],{"class":1271},"value",[829,1741,1530],{"class":1412},[829,1743,1454],{"class":1408},[829,1745,1458],{"class":1457},[829,1747,1286],{"class":834},[829,1749,1751,1754,1756,1759,1761,1763,1765],{"class":831,"line":1750},19,[829,1752,1753],{"class":1271},"      t",[829,1755,1264],{"class":1263},[829,1757,1758],{"class":1267}," Number",[829,1760,1272],{"class":1412},[829,1762,1739],{"class":1271},[829,1764,1283],{"class":1412},[829,1766,1286],{"class":834},[829,1768,1770,1773,1776,1779,1781,1783,1785,1787,1789,1791,1793],{"class":831,"line":1769},20,[829,1771,1772],{"class":834},"    }",[829,1774,1775],{"class":1408}," else",[829,1777,1778],{"class":1408}," if",[829,1780,1413],{"class":1412},[829,1782,1674],{"class":1271},[829,1784,1577],{"class":1263},[829,1786,1445],{"class":854},[829,1788,1127],{"class":858},[829,1790,1275],{"class":854},[829,1792,1431],{"class":1412},[829,1794,835],{"class":834},[829,1796,1798,1801,1804,1806,1808,1810,1812,1814,1816,1818,1820,1822],{"class":831,"line":1797},21,[829,1799,1800],{"class":1255},"      const",[829,1802,1803],{"class":1259}," j",[829,1805,1264],{"class":1263},[829,1807,1636],{"class":1271},[829,1809,925],{"class":834},[829,1811,1550],{"class":1267},[829,1813,1272],{"class":1412},[829,1815,1275],{"class":854},[829,1817,851],{"class":858},[829,1819,1275],{"class":854},[829,1821,1283],{"class":1412},[829,1823,1286],{"class":834},[829,1825,1827,1829,1831,1834,1836,1838,1840,1842,1845,1847,1850,1852,1855,1858,1860,1862,1864,1866,1868,1870,1872,1874,1876,1878,1881,1883,1885,1887,1889,1891,1893,1895,1897,1899,1902,1904],{"class":831,"line":1826},22,[829,1828,1692],{"class":1408},[829,1830,1413],{"class":1412},[829,1832,1833],{"class":1271},"j",[829,1835,1442],{"class":1263},[829,1837,1580],{"class":1263},[829,1839,1583],{"class":1328},[829,1841,1431],{"class":1412},[829,1843,1844],{"class":1271},"entries",[829,1846,925],{"class":834},[829,1848,1849],{"class":1267},"push",[829,1851,1272],{"class":1412},[829,1853,1854],{"class":834},"{",[829,1856,1857],{"class":1412}," kid",[829,1859,851],{"class":834},[829,1861,1636],{"class":1271},[829,1863,925],{"class":834},[829,1865,1607],{"class":1267},[829,1867,1272],{"class":1412},[829,1869,1612],{"class":1328},[829,1871,1164],{"class":834},[829,1873,1803],{"class":1271},[829,1875,1283],{"class":1412},[829,1877,1164],{"class":834},[829,1879,1880],{"class":1412}," hex",[829,1882,851],{"class":834},[829,1884,1636],{"class":1271},[829,1886,925],{"class":834},[829,1888,1607],{"class":1267},[829,1890,1272],{"class":1412},[829,1892,1833],{"class":1271},[829,1894,1651],{"class":1263},[829,1896,1654],{"class":1328},[829,1898,1431],{"class":1412},[829,1900,1901],{"class":834},"}",[829,1903,1283],{"class":1412},[829,1905,1286],{"class":834},[829,1907,1909],{"class":831,"line":1908},23,[829,1910,1911],{"class":834},"    }\n",[829,1913,1915],{"class":831,"line":1914},24,[829,1916,1917],{"class":834},"  }\n",[829,1919,1921,1923,1925,1927,1929,1931,1933,1935,1937,1940,1942,1945,1947,1949,1951],{"class":831,"line":1920},25,[829,1922,1409],{"class":1408},[829,1924,1413],{"class":1412},[829,1926,1120],{"class":1271},[829,1928,1577],{"class":1263},[829,1930,1458],{"class":1457},[829,1932,1703],{"class":1263},[829,1934,1489],{"class":1271},[829,1936,925],{"class":834},[829,1938,1939],{"class":1259},"length",[829,1941,1577],{"class":1263},[829,1943,1944],{"class":1328}," 0",[829,1946,1431],{"class":1412},[829,1948,1454],{"class":1408},[829,1950,1458],{"class":1457},[829,1952,1286],{"class":834},[829,1954,1956,1958,1960,1963,1965,1968,1970,1972,1974,1976,1978,1981,1983,1985,1987,1989],{"class":831,"line":1955},26,[829,1957,1409],{"class":1408},[829,1959,1413],{"class":1412},[829,1961,1962],{"class":1271},"Math",[829,1964,925],{"class":834},[829,1966,1967],{"class":1267},"abs",[829,1969,1272],{"class":1412},[829,1971,1388],{"class":1271},[829,1973,1580],{"class":1263},[829,1975,1474],{"class":1271},[829,1977,1431],{"class":1412},[829,1979,1980],{"class":1263},">",[829,1982,1323],{"class":1259},[829,1984,1431],{"class":1412},[829,1986,1454],{"class":1408},[829,1988,1458],{"class":1457},[829,1990,1286],{"class":834},[829,1992,1994],{"class":831,"line":1993},27,[829,1995,1316],{"emptyLinePlaceholder":1315},[829,1997,1999,2001,2003,2005,2008,2010,2012,2014],{"class":831,"line":1998},28,[829,2000,1502],{"class":1408},[829,2002,1413],{"class":1412},[829,2004,1256],{"class":1255},[829,2006,2007],{"class":1259}," secret",[829,2009,1512],{"class":1263},[829,2011,1365],{"class":1271},[829,2013,1431],{"class":1412},[829,2015,835],{"class":834},[829,2017,2019,2021,2024,2026,2028,2030,2033,2035,2037,2040,2042,2044,2046,2048,2050,2053,2055,2058,2060,2062,2064,2067,2069,2071,2073,2075,2077,2079,2081,2084,2086],{"class":831,"line":2018},29,[829,2020,1538],{"class":1255},[829,2022,2023],{"class":1259}," expected",[829,2025,1264],{"class":1263},[829,2027,1260],{"class":1271},[829,2029,925],{"class":834},[829,2031,2032],{"class":1267},"createHmac",[829,2034,1272],{"class":1412},[829,2036,1275],{"class":854},[829,2038,2039],{"class":858},"sha512",[829,2041,1275],{"class":854},[829,2043,1164],{"class":834},[829,2045,2007],{"class":1271},[829,2047,1283],{"class":1412},[829,2049,925],{"class":834},[829,2051,2052],{"class":1267},"update",[829,2054,1272],{"class":1412},[829,2056,2057],{"class":854},"`${",[829,2059,1120],{"class":1271},[829,2061,1901],{"class":854},[829,2063,925],{"class":858},[829,2065,2066],{"class":854},"`",[829,2068,1283],{"class":1412},[829,2070,925],{"class":834},[829,2072,2052],{"class":1267},[829,2074,1272],{"class":1412},[829,2076,1355],{"class":1271},[829,2078,1283],{"class":1412},[829,2080,925],{"class":834},[829,2082,2083],{"class":1267},"digest",[829,2085,1626],{"class":1412},[829,2087,1286],{"class":834},[829,2089,2091,2094,2096,2098,2101,2103,2105,2107,2110,2112,2114,2116],{"class":831,"line":2090},30,[829,2092,2093],{"class":1408},"    for",[829,2095,1413],{"class":1412},[829,2097,1256],{"class":1255},[829,2099,2100],{"class":834}," {",[829,2102,1857],{"class":1259},[829,2104,1164],{"class":834},[829,2106,1880],{"class":1259},[829,2108,2109],{"class":834}," }",[829,2111,1512],{"class":1263},[829,2113,1489],{"class":1271},[829,2115,1431],{"class":1412},[829,2117,835],{"class":834},[829,2119,2121,2123,2125,2127,2129,2131,2133,2136,2138,2141,2143,2145,2147,2149,2151,2154,2156,2158],{"class":831,"line":2120},31,[829,2122,1692],{"class":1408},[829,2124,1413],{"class":1412},[829,2126,1416],{"class":1263},[829,2128,328],{"class":854},[829,2130,1711],{"class":1408},[829,2132,1714],{"class":1457},[829,2134,2135],{"class":1717},"0-9a-f",[829,2137,1721],{"class":1457},[829,2139,2140],{"class":1263},"{128}",[829,2142,1727],{"class":1408},[829,2144,328],{"class":854},[829,2146,925],{"class":834},[829,2148,1734],{"class":1267},[829,2150,1272],{"class":1412},[829,2152,2153],{"class":1271},"hex",[829,2155,1530],{"class":1412},[829,2157,1588],{"class":1408},[829,2159,1286],{"class":834},[829,2161,2163,2165,2167,2169,2171,2174,2176,2179,2181,2184,2186,2189,2191,2193,2195,2197,2199,2201,2204,2206,2208],{"class":831,"line":2162},32,[829,2164,1692],{"class":1408},[829,2166,1413],{"class":1412},[829,2168,1278],{"class":1271},[829,2170,925],{"class":834},[829,2172,2173],{"class":1267},"timingSafeEqual",[829,2175,1272],{"class":1412},[829,2177,2178],{"class":1271},"expected",[829,2180,1164],{"class":834},[829,2182,2183],{"class":1271}," Buffer",[829,2185,925],{"class":834},[829,2187,2188],{"class":1267},"from",[829,2190,1272],{"class":1412},[829,2192,2153],{"class":1271},[829,2194,1164],{"class":834},[829,2196,1445],{"class":854},[829,2198,2153],{"class":858},[829,2200,1275],{"class":854},[829,2202,2203],{"class":1412},"))) ",[829,2205,1454],{"class":1408},[829,2207,1857],{"class":1271},[829,2209,1286],{"class":834},[829,2211,2213],{"class":831,"line":2212},33,[829,2214,1911],{"class":834},[829,2216,2218],{"class":831,"line":2217},34,[829,2219,1917],{"class":834},[829,2221,2223,2226,2228],{"class":831,"line":2222},35,[829,2224,2225],{"class":1408},"  return",[829,2227,1458],{"class":1457},[829,2229,1286],{"class":834},[829,2231,2233],{"class":831,"line":2232},36,[829,2234,883],{"class":834},[829,2236,2238],{"class":831,"line":2237},37,[829,2239,1316],{"emptyLinePlaceholder":1315},[829,2241,2243,2245,2248,2250,2252,2254],{"class":831,"line":2242},38,[829,2244,1256],{"class":1255},[829,2246,2247],{"class":1259}," app",[829,2249,1264],{"class":1263},[829,2251,1293],{"class":1267},[829,2253,1626],{"class":1271},[829,2255,1286],{"class":834},[829,2257,2259],{"class":831,"line":2258},39,[829,2260,1316],{"emptyLinePlaceholder":1315},[829,2262,2264],{"class":831,"line":2263},40,[829,2265,2266],{"class":1340},"\u002F\u002F express.raw keeps req.body as the exact bytes Paystack sent. Register this route before any\n",[829,2268,2270],{"class":831,"line":2269},41,[829,2271,2272],{"class":1340},"\u002F\u002F app.use(express.json()): a JSON parser that runs first consumes the body and every check fails.\n",[829,2274,2276,2279,2281,2284,2286,2288,2291,2293,2295,2297,2299,2302,2304,2306,2309,2311,2313,2316,2318,2320,2322,2324,2326,2329,2331,2334,2336,2339],{"class":831,"line":2275},42,[829,2277,2278],{"class":1271},"app",[829,2280,925],{"class":834},[829,2282,2283],{"class":1267},"post",[829,2285,1272],{"class":1271},[829,2287,1275],{"class":854},[829,2289,2290],{"class":858},"\u002Fwebhooks\u002Fpaystack",[829,2292,1275],{"class":854},[829,2294,1164],{"class":834},[829,2296,1293],{"class":1271},[829,2298,925],{"class":834},[829,2300,2301],{"class":1267},"raw",[829,2303,1272],{"class":1271},[829,2305,1854],{"class":834},[829,2307,2308],{"class":1412}," type",[829,2310,851],{"class":834},[829,2312,1445],{"class":854},[829,2314,2315],{"class":858},"application\u002Fjson",[829,2317,1275],{"class":854},[829,2319,2109],{"class":834},[829,2321,1283],{"class":1271},[829,2323,1164],{"class":834},[829,2325,1413],{"class":834},[829,2327,2328],{"class":1354},"req",[829,2330,1164],{"class":834},[829,2332,2333],{"class":1354}," res",[829,2335,1283],{"class":834},[829,2337,2338],{"class":1255}," =>",[829,2340,1403],{"class":834},[829,2342,2344,2346,2348,2350,2353,2355,2358,2360,2363,2366],{"class":831,"line":2343},43,[829,2345,1486],{"class":1255},[829,2347,2007],{"class":1259},[829,2349,1264],{"class":1263},[829,2351,2352],{"class":1271}," process",[829,2354,925],{"class":834},[829,2356,2357],{"class":1271},"env",[829,2359,925],{"class":834},[829,2361,2362],{"class":1259},"PAYSTACK_WEBHOOK_SECRET",[829,2364,2365],{"class":834},";",[829,2367,2368],{"class":1340}," \u002F\u002F whsec_...\n",[829,2370,2372,2374,2376,2378,2381,2383,2385,2387,2389,2392,2394,2397,2399],{"class":831,"line":2371},44,[829,2373,1409],{"class":1408},[829,2375,1413],{"class":1412},[829,2377,1416],{"class":1263},[829,2379,2380],{"class":1271},"secret",[829,2382,1431],{"class":1412},[829,2384,1454],{"class":1408},[829,2386,2333],{"class":1271},[829,2388,925],{"class":834},[829,2390,2391],{"class":1267},"sendStatus",[829,2393,1272],{"class":1412},[829,2395,2396],{"class":1328},"500",[829,2398,1283],{"class":1412},[829,2400,1286],{"class":834},[829,2402,2404],{"class":831,"line":2403},45,[829,2405,1316],{"emptyLinePlaceholder":1315},[829,2407,2409,2411,2413,2415,2417,2419,2421,2423,2426,2428,2431,2433,2436,2438,2440,2442,2444,2446,2448,2451,2453,2456],{"class":831,"line":2408},46,[829,2410,1486],{"class":1255},[829,2412,1857],{"class":1259},[829,2414,1264],{"class":1263},[829,2416,1349],{"class":1267},[829,2418,1272],{"class":1412},[829,2420,2328],{"class":1271},[829,2422,925],{"class":834},[829,2424,2425],{"class":1271},"body",[829,2427,1164],{"class":834},[829,2429,2430],{"class":1271}," req",[829,2432,925],{"class":834},[829,2434,2435],{"class":1267},"get",[829,2437,1272],{"class":1412},[829,2439,1275],{"class":854},[829,2441,1092],{"class":858},[829,2443,1275],{"class":854},[829,2445,1283],{"class":1412},[829,2447,1164],{"class":834},[829,2449,2450],{"class":1412}," [",[829,2452,2380],{"class":1271},[829,2454,2455],{"class":1412},"])",[829,2457,1286],{"class":834},[829,2459,2461,2463,2465,2467,2470,2472,2474,2476,2478,2480,2482,2484,2486],{"class":831,"line":2460},47,[829,2462,1409],{"class":1408},[829,2464,1413],{"class":1412},[829,2466,1416],{"class":1263},[829,2468,2469],{"class":1271},"kid",[829,2471,1431],{"class":1412},[829,2473,1454],{"class":1408},[829,2475,2333],{"class":1271},[829,2477,925],{"class":834},[829,2479,2391],{"class":1267},[829,2481,1272],{"class":1412},[829,2483,1206],{"class":1328},[829,2485,1283],{"class":1412},[829,2487,1286],{"class":834},[829,2489,2491],{"class":831,"line":2490},48,[829,2492,1316],{"emptyLinePlaceholder":1315},[829,2494,2496,2499,2501,2503,2505,2507,2509],{"class":831,"line":2495},49,[829,2497,2498],{"class":1271},"  res",[829,2500,925],{"class":834},[829,2502,2391],{"class":1267},[829,2504,1272],{"class":1412},[829,2506,1210],{"class":1328},[829,2508,1283],{"class":1412},[829,2510,1286],{"class":834},[829,2512,2514,2516,2519,2521,2524,2526,2529,2531,2533,2535,2537,2539,2542,2544,2546,2549,2551,2554],{"class":831,"line":2513},50,[829,2515,1486],{"class":1255},[829,2517,2518],{"class":1259}," event",[829,2520,1264],{"class":1263},[829,2522,2523],{"class":1259}," JSON",[829,2525,925],{"class":834},[829,2527,2528],{"class":1267},"parse",[829,2530,1272],{"class":1412},[829,2532,2328],{"class":1271},[829,2534,925],{"class":834},[829,2536,2425],{"class":1271},[829,2538,925],{"class":834},[829,2540,2541],{"class":1267},"toString",[829,2543,1272],{"class":1412},[829,2545,1275],{"class":854},[829,2547,2548],{"class":858},"utf8",[829,2550,1275],{"class":854},[829,2552,2553],{"class":1412},"))",[829,2555,1286],{"class":834},[829,2557,2559],{"class":831,"line":2558},51,[829,2560,2561],{"class":1340},"  \u002F\u002F handle event.event and event.data\n",[829,2563,2565,2567,2569],{"class":831,"line":2564},52,[829,2566,1901],{"class":834},[829,2568,1283],{"class":1271},[829,2570,1286],{"class":834},[1242,2572,2573],{"v-slot:python":825},[820,2574,2578],{"className":2575,"code":2576,"language":2577,"meta":825,"style":825},"language-python shiki shiki-themes material-theme-lighter github-light github-dark-dimmed","import hashlib\nimport hmac\nimport json\nimport os\nimport re\nimport time\n\nfrom flask import Flask, abort, request\n\nTOLERANCE_SECONDS = 300\nDIGITS = re.compile(r'[0-9]+')\nHEX_SHA512 = re.compile(r'[0-9a-f]{128}')\n\n\ndef verify_paystack_signature(raw_body, header, secrets, now=None):\n    \"\"\"Return the key id (kid) of the signature that matched, or None.\"\"\"\n    if not isinstance(raw_body, bytes) or not header:\n        return None\n\n    t = None\n    entries = []\n    for part in header.split(','):\n        key, sep, value = part.partition('=')\n        if not sep:\n            continue\n        key, value = key.strip(), value.strip()\n        if key == 't':\n            if t is not None or not DIGITS.fullmatch(value):\n                return None\n            t = int(value)\n        elif key == 'v1':\n            kid, sep, hex_sig = value.partition(':')\n            if sep:\n                entries.append((kid, hex_sig))\n    if t is None or not entries:\n        return None\n    now = int(time.time()) if now is None else now\n    if abs(now - t) > TOLERANCE_SECONDS:\n        return None\n\n    for secret in secrets:\n        message = str(t).encode('ascii') + b'.' + raw_body\n        expected = hmac.new(secret.encode('utf-8'), message, hashlib.sha512).hexdigest()\n        for kid, hex_sig in entries:\n            if HEX_SHA512.fullmatch(hex_sig) and hmac.compare_digest(expected, hex_sig):\n                return kid\n    return None\n\n\napp = Flask(__name__)\n\n\n@app.post('\u002Fwebhooks\u002Fpaystack')\ndef paystack_webhook():\n    raw_body = request.get_data()  # the exact bytes Paystack sent\n    secret = os.environ.get('PAYSTACK_WEBHOOK_SECRET')  # whsec_...\n    if not secret:\n        abort(500)\n\n    if verify_paystack_signature(raw_body, request.headers.get('Paystack-Signature'), [secret]) is None:\n        abort(401)\n\n    event = json.loads(raw_body)\n    # handle event['event'] and event['data']\n    return '', 200\n","python",[801,2579,2580,2588,2595,2602,2609,2616,2623,2627,2649,2653,2663,2700,2731,2735,2739,2773,2786,2819,2827,2831,2840,2850,2876,2910,2921,2926,2955,2973,3007,3014,3030,3047,3079,3087,3110,3128,3134,3169,3195,3201,3205,3218,3265,3319,3336,3374,3381,3388,3392,3396,3412,3416,3420,3443,3454,3475,3508,3519,3531,3536,3583,3594,3599,3621,3627],{"__ignoreMap":825},[829,2581,2582,2585],{"class":831,"line":63},[829,2583,2584],{"class":1408},"import",[829,2586,2587],{"class":1271}," hashlib\n",[829,2589,2590,2592],{"class":831,"line":66},[829,2591,2584],{"class":1408},[829,2593,2594],{"class":1271}," hmac\n",[829,2596,2597,2599],{"class":831,"line":84},[829,2598,2584],{"class":1408},[829,2600,2601],{"class":1271}," json\n",[829,2603,2604,2606],{"class":831,"line":75},[829,2605,2584],{"class":1408},[829,2607,2608],{"class":1271}," os\n",[829,2610,2611,2613],{"class":831,"line":107},[829,2612,2584],{"class":1408},[829,2614,2615],{"class":1271}," re\n",[829,2617,2618,2620],{"class":831,"line":134},[829,2619,2584],{"class":1408},[829,2621,2622],{"class":1271}," time\n",[829,2624,2625],{"class":831,"line":153},[829,2626,1316],{"emptyLinePlaceholder":1315},[829,2628,2629,2631,2634,2636,2639,2641,2644,2646],{"class":831,"line":422},[829,2630,2188],{"class":1408},[829,2632,2633],{"class":1271}," flask ",[829,2635,2584],{"class":1408},[829,2637,2638],{"class":1271}," Flask",[829,2640,1164],{"class":834},[829,2642,2643],{"class":1271}," abort",[829,2645,1164],{"class":834},[829,2647,2648],{"class":1271}," request\n",[829,2650,2651],{"class":831,"line":1463},[829,2652,1316],{"emptyLinePlaceholder":1315},[829,2654,2655,2658,2660],{"class":831,"line":1468},[829,2656,2657],{"class":1259},"TOLERANCE_SECONDS",[829,2659,1264],{"class":1263},[829,2661,2662],{"class":1328}," 300\n",[829,2664,2665,2668,2670,2673,2675,2679,2681,2684,2686,2688,2691,2693,2695,2697],{"class":831,"line":1483},[829,2666,2667],{"class":1259},"DIGITS",[829,2669,1264],{"class":1263},[829,2671,2672],{"class":1271}," re",[829,2674,925],{"class":834},[829,2676,2678],{"class":2677},"sddFs","compile",[829,2680,1272],{"class":834},[829,2682,2683],{"class":1255},"r",[829,2685,1275],{"class":854},[829,2687,1714],{"class":1457},[829,2689,1718],{"class":2690},"sl75J",[829,2692,1721],{"class":1457},[829,2694,1724],{"class":1263},[829,2696,1275],{"class":854},[829,2698,2699],{"class":834},")\n",[829,2701,2702,2705,2707,2709,2711,2713,2715,2717,2719,2721,2723,2725,2727,2729],{"class":831,"line":1499},[829,2703,2704],{"class":1259},"HEX_SHA512",[829,2706,1264],{"class":1263},[829,2708,2672],{"class":1271},[829,2710,925],{"class":834},[829,2712,2678],{"class":2677},[829,2714,1272],{"class":834},[829,2716,2683],{"class":1255},[829,2718,1275],{"class":854},[829,2720,1714],{"class":1457},[829,2722,2135],{"class":2690},[829,2724,1721],{"class":1457},[829,2726,2140],{"class":1263},[829,2728,1275],{"class":854},[829,2730,2699],{"class":834},[829,2732,2733],{"class":831,"line":1535},[829,2734,1316],{"emptyLinePlaceholder":1315},[829,2736,2737],{"class":831,"line":1566},[829,2738,1316],{"emptyLinePlaceholder":1315},[829,2740,2741,2744,2747,2749,2753,2755,2757,2759,2761,2763,2765,2767,2770],{"class":831,"line":1593},[829,2742,2743],{"class":1255},"def",[829,2745,2746],{"class":1267}," verify_paystack_signature",[829,2748,1272],{"class":834},[829,2750,2752],{"class":2751},"sRnYG","raw_body",[829,2754,1164],{"class":834},[829,2756,1360],{"class":2751},[829,2758,1164],{"class":834},[829,2760,1365],{"class":2751},[829,2762,1164],{"class":834},[829,2764,1370],{"class":2751},[829,2766,1557],{"class":1263},[829,2768,2769],{"class":1457},"None",[829,2771,2772],{"class":834},"):\n",[829,2774,2775,2779,2783],{"class":831,"line":1631},[829,2776,2778],{"class":2777},"sEzAc","    \"\"\"",[829,2780,2782],{"class":2781},"sH5AN","Return the key id (kid) of the signature that matched, or None.",[829,2784,2785],{"class":2777},"\"\"\"\n",[829,2787,2788,2790,2793,2797,2799,2801,2803,2807,2809,2812,2814,2816],{"class":831,"line":1667},[829,2789,1569],{"class":1408},[829,2791,2792],{"class":1263}," not",[829,2794,2796],{"class":2795},"slzs_"," isinstance",[829,2798,1272],{"class":834},[829,2800,2752],{"class":2677},[829,2802,1164],{"class":834},[829,2804,2806],{"class":2805},"s61-6"," bytes",[829,2808,1283],{"class":834},[829,2810,2811],{"class":1263}," or",[829,2813,2792],{"class":1263},[829,2815,1360],{"class":1271},[829,2817,2818],{"class":834},":\n",[829,2820,2821,2824],{"class":831,"line":1689},[829,2822,2823],{"class":1408},"        return",[829,2825,2826],{"class":1457}," None\n",[829,2828,2829],{"class":831,"line":1750},[829,2830,1316],{"emptyLinePlaceholder":1315},[829,2832,2833,2836,2838],{"class":831,"line":1769},[829,2834,2835],{"class":1271},"    t ",[829,2837,1557],{"class":1263},[829,2839,2826],{"class":1457},[829,2841,2842,2845,2847],{"class":831,"line":1797},[829,2843,2844],{"class":1271},"    entries ",[829,2846,1557],{"class":1263},[829,2848,2849],{"class":834}," []\n",[829,2851,2852,2854,2857,2860,2862,2864,2866,2868,2870,2872,2874],{"class":831,"line":1826},[829,2853,2093],{"class":1408},[829,2855,2856],{"class":1271}," part ",[829,2858,2859],{"class":1408},"in",[829,2861,1360],{"class":1271},[829,2863,925],{"class":834},[829,2865,1519],{"class":2677},[829,2867,1272],{"class":834},[829,2869,1275],{"class":854},[829,2871,1164],{"class":858},[829,2873,1275],{"class":854},[829,2875,2772],{"class":834},[829,2877,2878,2881,2883,2886,2888,2891,2893,2895,2897,2900,2902,2904,2906,2908],{"class":831,"line":1908},[829,2879,2880],{"class":1271},"        key",[829,2882,1164],{"class":834},[829,2884,2885],{"class":1271}," sep",[829,2887,1164],{"class":834},[829,2889,2890],{"class":1271}," value ",[829,2892,1557],{"class":1263},[829,2894,1509],{"class":1271},[829,2896,925],{"class":834},[829,2898,2899],{"class":2677},"partition",[829,2901,1272],{"class":834},[829,2903,1275],{"class":854},[829,2905,1557],{"class":858},[829,2907,1275],{"class":854},[829,2909,2699],{"class":834},[829,2911,2912,2915,2917,2919],{"class":831,"line":1914},[829,2913,2914],{"class":1408},"        if",[829,2916,2792],{"class":1263},[829,2918,2885],{"class":1271},[829,2920,2818],{"class":834},[829,2922,2923],{"class":831,"line":1920},[829,2924,2925],{"class":1408},"            continue\n",[829,2927,2928,2930,2932,2934,2936,2938,2940,2943,2946,2948,2950,2952],{"class":831,"line":1955},[829,2929,2880],{"class":1271},[829,2931,1164],{"class":834},[829,2933,2890],{"class":1271},[829,2935,1557],{"class":1263},[829,2937,1598],{"class":1271},[829,2939,925],{"class":834},[829,2941,2942],{"class":2677},"strip",[829,2944,2945],{"class":834},"(),",[829,2947,1636],{"class":1271},[829,2949,925],{"class":834},[829,2951,2942],{"class":2677},[829,2953,2954],{"class":834},"()\n",[829,2956,2957,2959,2962,2965,2967,2969,2971],{"class":831,"line":1993},[829,2958,2914],{"class":1408},[829,2960,2961],{"class":1271}," key ",[829,2963,2964],{"class":1263},"==",[829,2966,1445],{"class":854},[829,2968,1120],{"class":858},[829,2970,1275],{"class":854},[829,2972,2818],{"class":834},[829,2974,2975,2978,2981,2984,2986,2989,2991,2993,2996,2998,3001,3003,3005],{"class":831,"line":1998},[829,2976,2977],{"class":1408},"            if",[829,2979,2980],{"class":1271}," t ",[829,2982,2983],{"class":1263},"is",[829,2985,2792],{"class":1263},[829,2987,2988],{"class":1457}," None",[829,2990,2811],{"class":1263},[829,2992,2792],{"class":1263},[829,2994,2995],{"class":1259}," DIGITS",[829,2997,925],{"class":834},[829,2999,3000],{"class":2677},"fullmatch",[829,3002,1272],{"class":834},[829,3004,1739],{"class":2677},[829,3006,2772],{"class":834},[829,3008,3009,3012],{"class":831,"line":2018},[829,3010,3011],{"class":1408},"                return",[829,3013,2826],{"class":1457},[829,3015,3016,3019,3021,3024,3026,3028],{"class":831,"line":2090},[829,3017,3018],{"class":1271},"            t ",[829,3020,1557],{"class":1263},[829,3022,3023],{"class":2805}," int",[829,3025,1272],{"class":834},[829,3027,1739],{"class":2677},[829,3029,2699],{"class":834},[829,3031,3032,3035,3037,3039,3041,3043,3045],{"class":831,"line":2120},[829,3033,3034],{"class":1408},"        elif",[829,3036,2961],{"class":1271},[829,3038,2964],{"class":1263},[829,3040,1445],{"class":854},[829,3042,1127],{"class":858},[829,3044,1275],{"class":854},[829,3046,2818],{"class":834},[829,3048,3049,3052,3054,3056,3058,3061,3063,3065,3067,3069,3071,3073,3075,3077],{"class":831,"line":2162},[829,3050,3051],{"class":1271},"            kid",[829,3053,1164],{"class":834},[829,3055,2885],{"class":1271},[829,3057,1164],{"class":834},[829,3059,3060],{"class":1271}," hex_sig ",[829,3062,1557],{"class":1263},[829,3064,1636],{"class":1271},[829,3066,925],{"class":834},[829,3068,2899],{"class":2677},[829,3070,1272],{"class":834},[829,3072,1275],{"class":854},[829,3074,851],{"class":858},[829,3076,1275],{"class":854},[829,3078,2699],{"class":834},[829,3080,3081,3083,3085],{"class":831,"line":2212},[829,3082,2977],{"class":1408},[829,3084,2885],{"class":1271},[829,3086,2818],{"class":834},[829,3088,3089,3092,3094,3097,3100,3102,3104,3107],{"class":831,"line":2217},[829,3090,3091],{"class":1271},"                entries",[829,3093,925],{"class":834},[829,3095,3096],{"class":2677},"append",[829,3098,3099],{"class":834},"((",[829,3101,2469],{"class":2677},[829,3103,1164],{"class":834},[829,3105,3106],{"class":2677}," hex_sig",[829,3108,3109],{"class":834},"))\n",[829,3111,3112,3114,3116,3118,3120,3122,3124,3126],{"class":831,"line":2222},[829,3113,1569],{"class":1408},[829,3115,2980],{"class":1271},[829,3117,2983],{"class":1263},[829,3119,2988],{"class":1457},[829,3121,2811],{"class":1263},[829,3123,2792],{"class":1263},[829,3125,1489],{"class":1271},[829,3127,2818],{"class":834},[829,3129,3130,3132],{"class":831,"line":2232},[829,3131,2823],{"class":1408},[829,3133,2826],{"class":1457},[829,3135,3136,3139,3141,3143,3145,3148,3150,3152,3155,3157,3160,3162,3164,3166],{"class":831,"line":2237},[829,3137,3138],{"class":1271},"    now ",[829,3140,1557],{"class":1263},[829,3142,3023],{"class":2805},[829,3144,1272],{"class":834},[829,3146,3147],{"class":2677},"time",[829,3149,925],{"class":834},[829,3151,3147],{"class":2677},[829,3153,3154],{"class":834},"())",[829,3156,1778],{"class":1408},[829,3158,3159],{"class":1271}," now ",[829,3161,2983],{"class":1263},[829,3163,2988],{"class":1457},[829,3165,1775],{"class":1408},[829,3167,3168],{"class":1271}," now\n",[829,3170,3171,3173,3176,3178,3181,3184,3186,3188,3191,3193],{"class":831,"line":2242},[829,3172,1569],{"class":1408},[829,3174,3175],{"class":2795}," abs",[829,3177,1272],{"class":834},[829,3179,3180],{"class":2677},"now ",[829,3182,3183],{"class":1263},"-",[829,3185,1474],{"class":2677},[829,3187,1283],{"class":834},[829,3189,3190],{"class":1263}," >",[829,3192,1323],{"class":1259},[829,3194,2818],{"class":834},[829,3196,3197,3199],{"class":831,"line":2258},[829,3198,2823],{"class":1408},[829,3200,2826],{"class":1457},[829,3202,3203],{"class":831,"line":2263},[829,3204,1316],{"emptyLinePlaceholder":1315},[829,3206,3207,3209,3212,3214,3216],{"class":831,"line":2269},[829,3208,2093],{"class":1408},[829,3210,3211],{"class":1271}," secret ",[829,3213,2859],{"class":1408},[829,3215,1365],{"class":1271},[829,3217,2818],{"class":834},[829,3219,3220,3223,3225,3228,3230,3232,3235,3238,3240,3242,3245,3247,3249,3251,3254,3256,3258,3260,3262],{"class":831,"line":2275},[829,3221,3222],{"class":1271},"        message ",[829,3224,1557],{"class":1263},[829,3226,3227],{"class":2805}," str",[829,3229,1272],{"class":834},[829,3231,1120],{"class":2677},[829,3233,3234],{"class":834},").",[829,3236,3237],{"class":2677},"encode",[829,3239,1272],{"class":834},[829,3241,1275],{"class":854},[829,3243,3244],{"class":858},"ascii",[829,3246,1275],{"class":854},[829,3248,1283],{"class":834},[829,3250,1651],{"class":1263},[829,3252,3253],{"class":1255}," b",[829,3255,1275],{"class":854},[829,3257,925],{"class":858},[829,3259,1275],{"class":854},[829,3261,1651],{"class":1263},[829,3263,3264],{"class":1271}," raw_body\n",[829,3266,3267,3270,3272,3275,3277,3280,3282,3284,3286,3288,3290,3292,3295,3297,3300,3303,3305,3308,3310,3312,3314,3317],{"class":831,"line":2343},[829,3268,3269],{"class":1271},"        expected ",[829,3271,1557],{"class":1263},[829,3273,3274],{"class":1271}," hmac",[829,3276,925],{"class":834},[829,3278,3279],{"class":2677},"new",[829,3281,1272],{"class":834},[829,3283,2380],{"class":2677},[829,3285,925],{"class":834},[829,3287,3237],{"class":2677},[829,3289,1272],{"class":834},[829,3291,1275],{"class":854},[829,3293,3294],{"class":858},"utf-8",[829,3296,1275],{"class":854},[829,3298,3299],{"class":834},"),",[829,3301,3302],{"class":2677}," message",[829,3304,1164],{"class":834},[829,3306,3307],{"class":2677}," hashlib",[829,3309,925],{"class":834},[829,3311,2039],{"class":1412},[829,3313,3234],{"class":834},[829,3315,3316],{"class":2677},"hexdigest",[829,3318,2954],{"class":834},[829,3320,3321,3324,3326,3328,3330,3332,3334],{"class":831,"line":2371},[829,3322,3323],{"class":1408},"        for",[829,3325,1857],{"class":1271},[829,3327,1164],{"class":834},[829,3329,3060],{"class":1271},[829,3331,2859],{"class":1408},[829,3333,1489],{"class":1271},[829,3335,2818],{"class":834},[829,3337,3338,3340,3343,3345,3347,3349,3352,3354,3357,3359,3361,3364,3366,3368,3370,3372],{"class":831,"line":2403},[829,3339,2977],{"class":1408},[829,3341,3342],{"class":1259}," HEX_SHA512",[829,3344,925],{"class":834},[829,3346,3000],{"class":2677},[829,3348,1272],{"class":834},[829,3350,3351],{"class":2677},"hex_sig",[829,3353,1283],{"class":834},[829,3355,3356],{"class":1263}," and",[829,3358,3274],{"class":1271},[829,3360,925],{"class":834},[829,3362,3363],{"class":2677},"compare_digest",[829,3365,1272],{"class":834},[829,3367,2178],{"class":2677},[829,3369,1164],{"class":834},[829,3371,3106],{"class":2677},[829,3373,2772],{"class":834},[829,3375,3376,3378],{"class":831,"line":2408},[829,3377,3011],{"class":1408},[829,3379,3380],{"class":1271}," kid\n",[829,3382,3383,3386],{"class":831,"line":2460},[829,3384,3385],{"class":1408},"    return",[829,3387,2826],{"class":1457},[829,3389,3390],{"class":831,"line":2490},[829,3391,1316],{"emptyLinePlaceholder":1315},[829,3393,3394],{"class":831,"line":2495},[829,3395,1316],{"emptyLinePlaceholder":1315},[829,3397,3398,3401,3403,3405,3407,3410],{"class":831,"line":2513},[829,3399,3400],{"class":1271},"app ",[829,3402,1557],{"class":1263},[829,3404,2638],{"class":2677},[829,3406,1272],{"class":834},[829,3408,3409],{"class":1259},"__name__",[829,3411,2699],{"class":834},[829,3413,3414],{"class":831,"line":2558},[829,3415,1316],{"emptyLinePlaceholder":1315},[829,3417,3418],{"class":831,"line":2564},[829,3419,1316],{"emptyLinePlaceholder":1315},[829,3421,3423,3427,3429,3431,3433,3435,3437,3439,3441],{"class":831,"line":3422},53,[829,3424,3426],{"class":3425},"sXQcW","@",[829,3428,2278],{"class":1267},[829,3430,925],{"class":3425},[829,3432,2283],{"class":1267},[829,3434,1272],{"class":834},[829,3436,1275],{"class":854},[829,3438,2290],{"class":858},[829,3440,1275],{"class":854},[829,3442,2699],{"class":834},[829,3444,3446,3448,3451],{"class":831,"line":3445},54,[829,3447,2743],{"class":1255},[829,3449,3450],{"class":1267}," paystack_webhook",[829,3452,3453],{"class":834},"():\n",[829,3455,3457,3460,3462,3465,3467,3470,3472],{"class":831,"line":3456},55,[829,3458,3459],{"class":1271},"    raw_body ",[829,3461,1557],{"class":1263},[829,3463,3464],{"class":1271}," request",[829,3466,925],{"class":834},[829,3468,3469],{"class":2677},"get_data",[829,3471,1626],{"class":834},[829,3473,3474],{"class":1340},"  # the exact bytes Paystack sent\n",[829,3476,3478,3481,3483,3486,3488,3491,3493,3495,3497,3499,3501,3503,3505],{"class":831,"line":3477},56,[829,3479,3480],{"class":1271},"    secret ",[829,3482,1557],{"class":1263},[829,3484,3485],{"class":1271}," os",[829,3487,925],{"class":834},[829,3489,3490],{"class":1412},"environ",[829,3492,925],{"class":834},[829,3494,2435],{"class":2677},[829,3496,1272],{"class":834},[829,3498,1275],{"class":854},[829,3500,2362],{"class":858},[829,3502,1275],{"class":854},[829,3504,1283],{"class":834},[829,3506,3507],{"class":1340},"  # whsec_...\n",[829,3509,3511,3513,3515,3517],{"class":831,"line":3510},57,[829,3512,1569],{"class":1408},[829,3514,2792],{"class":1263},[829,3516,2007],{"class":1271},[829,3518,2818],{"class":834},[829,3520,3522,3525,3527,3529],{"class":831,"line":3521},58,[829,3523,3524],{"class":2677},"        abort",[829,3526,1272],{"class":834},[829,3528,2396],{"class":1328},[829,3530,2699],{"class":834},[829,3532,3534],{"class":831,"line":3533},59,[829,3535,1316],{"emptyLinePlaceholder":1315},[829,3537,3539,3541,3543,3545,3547,3549,3551,3553,3556,3558,3560,3562,3564,3566,3568,3570,3572,3574,3576,3579,3581],{"class":831,"line":3538},60,[829,3540,1569],{"class":1408},[829,3542,2746],{"class":2677},[829,3544,1272],{"class":834},[829,3546,2752],{"class":2677},[829,3548,1164],{"class":834},[829,3550,3464],{"class":2677},[829,3552,925],{"class":834},[829,3554,3555],{"class":1412},"headers",[829,3557,925],{"class":834},[829,3559,2435],{"class":2677},[829,3561,1272],{"class":834},[829,3563,1275],{"class":854},[829,3565,989],{"class":858},[829,3567,1275],{"class":854},[829,3569,3299],{"class":834},[829,3571,2450],{"class":834},[829,3573,2380],{"class":2677},[829,3575,2455],{"class":834},[829,3577,3578],{"class":1263}," is",[829,3580,2988],{"class":1457},[829,3582,2818],{"class":834},[829,3584,3586,3588,3590,3592],{"class":831,"line":3585},61,[829,3587,3524],{"class":2677},[829,3589,1272],{"class":834},[829,3591,1206],{"class":1328},[829,3593,2699],{"class":834},[829,3595,3597],{"class":831,"line":3596},62,[829,3598,1316],{"emptyLinePlaceholder":1315},[829,3600,3602,3605,3607,3610,3612,3615,3617,3619],{"class":831,"line":3601},63,[829,3603,3604],{"class":1271},"    event ",[829,3606,1557],{"class":1263},[829,3608,3609],{"class":1271}," json",[829,3611,925],{"class":834},[829,3613,3614],{"class":2677},"loads",[829,3616,1272],{"class":834},[829,3618,2752],{"class":2677},[829,3620,2699],{"class":834},[829,3622,3624],{"class":831,"line":3623},64,[829,3625,3626],{"class":1340},"    # handle event['event'] and event['data']\n",[829,3628,3630,3632,3635,3637],{"class":831,"line":3629},65,[829,3631,3385],{"class":1408},[829,3633,3634],{"class":854}," ''",[829,3636,1164],{"class":834},[829,3638,3639],{"class":1328}," 200\n",[1242,3641,3642],{"v-slot:php":825},[820,3643,3647],{"className":3644,"code":3645,"language":3646,"meta":825,"style":825},"language-php shiki shiki-themes material-theme-lighter github-light github-dark-dimmed","\u003C?php\nconst PAYSTACK_TOLERANCE_SECONDS = 300;\n\n\u002F\u002F Returns the key id (kid) of the signature that matched, or null.\nfunction verifyPaystackSignature(string $rawBody, ?string $header, array $secrets, ?int $now = null): ?string\n{\n    if ($header === null || $header === '') {\n        return null;\n    }\n\n    $t = null;\n    $entries = [];\n    foreach (explode(',', $header) as $part) {\n        $pair = explode('=', $part, 2);\n        if (count($pair) !== 2) {\n            continue;\n        }\n        [$key, $value] = array_map('trim', $pair);\n        if ($key === 't') {\n            if ($t !== null || !preg_match('\u002F^[0-9]+$\u002FD', $value)) {\n                return null;\n            }\n            $t = (int) $value;\n        } elseif ($key === 'v1') {\n            $kidAndHex = explode(':', $value, 2);\n            if (count($kidAndHex) === 2) {\n                $entries[] = $kidAndHex;\n            }\n        }\n    }\n    if ($t === null || count($entries) === 0) {\n        return null;\n    }\n    $now = $now ?? time();\n    if (abs($now - $t) > PAYSTACK_TOLERANCE_SECONDS) {\n        return null;\n    }\n\n    foreach ($secrets as $secret) {\n        $expected = hash_hmac('sha512', $t . '.' . $rawBody, $secret);\n        foreach ($entries as [$kid, $hex]) {\n            if (preg_match('\u002F^[0-9a-f]{128}$\u002FD', $hex) && hash_equals($expected, $hex)) {\n                return $kid;\n            }\n        }\n    }\n    return null;\n}\n\n$rawBody = file_get_contents('php:\u002F\u002Finput'); \u002F\u002F the exact bytes Paystack sent\n$secret = getenv('PAYSTACK_WEBHOOK_SECRET'); \u002F\u002F whsec_...\n$header = $_SERVER['HTTP_PAYSTACK_SIGNATURE'] ?? null;\n\nif (!$secret) {\n    http_response_code(500);\n    exit;\n}\n\nif (verifyPaystackSignature($rawBody, $header, [$secret]) === null) {\n    http_response_code(401);\n    exit;\n}\n\nhttp_response_code(200);\n$event = json_decode($rawBody, true);\n\u002F\u002F handle $event['event'] and $event['data']\n","php",[801,3648,3649,3657,3670,3674,3678,3739,3743,3772,3780,3784,3788,3802,3814,3852,3887,3912,3919,3924,3960,3981,4030,4038,4043,4064,4088,4119,4142,4160,4164,4168,4172,4203,4211,4215,4236,4264,4272,4276,4280,4300,4349,4375,4433,4443,4447,4451,4455,4463,4467,4471,4498,4522,4553,4557,4574,4585,4592,4596,4600,4635,4645,4651,4655,4659,4670,4693],{"__ignoreMap":825},[829,3650,3651,3654],{"class":831,"line":63},[829,3652,3653],{"class":1263},"\u003C?",[829,3655,3656],{"class":1259},"php\n",[829,3658,3659,3661,3664,3666,3668],{"class":831,"line":66},[829,3660,1256],{"class":1255},[829,3662,3663],{"class":1259}," PAYSTACK_TOLERANCE_SECONDS",[829,3665,1264],{"class":1263},[829,3667,1329],{"class":1328},[829,3669,1286],{"class":834},[829,3671,3672],{"class":831,"line":84},[829,3673,1316],{"emptyLinePlaceholder":1315},[829,3675,3676],{"class":831,"line":75},[829,3677,1341],{"class":1340},[829,3679,3680,3682,3684,3686,3689,3692,3694,3696,3699,3701,3703,3706,3708,3711,3713,3715,3717,3719,3722,3724,3726,3728,3730,3732,3734,3736],{"class":831,"line":107},[829,3681,1346],{"class":1255},[829,3683,1349],{"class":1267},[829,3685,1272],{"class":834},[829,3687,915],{"class":3688},"sixiX",[829,3690,3691],{"class":834}," $",[829,3693,1355],{"class":1271},[829,3695,1164],{"class":834},[829,3697,3698],{"class":1263}," ?",[829,3700,915],{"class":3688},[829,3702,3691],{"class":834},[829,3704,3705],{"class":1271},"header",[829,3707,1164],{"class":834},[829,3709,3710],{"class":3688}," array",[829,3712,3691],{"class":834},[829,3714,1236],{"class":1271},[829,3716,1164],{"class":834},[829,3718,3698],{"class":1263},[829,3720,3721],{"class":3688},"int",[829,3723,3691],{"class":834},[829,3725,3180],{"class":1271},[829,3727,1557],{"class":1263},[829,3729,1458],{"class":1457},[829,3731,1283],{"class":834},[829,3733,851],{"class":1263},[829,3735,3698],{"class":1263},[829,3737,3738],{"class":3688},"string\n",[829,3740,3741],{"class":831,"line":134},[829,3742,835],{"class":834},[829,3744,3745,3747,3750,3753,3756,3758,3760,3762,3764,3766,3768,3770],{"class":831,"line":153},[829,3746,1569],{"class":1408},[829,3748,3749],{"class":834}," ($",[829,3751,3752],{"class":1271},"header ",[829,3754,3755],{"class":1263},"===",[829,3757,1458],{"class":1457},[829,3759,1703],{"class":1263},[829,3761,3691],{"class":834},[829,3763,3752],{"class":1271},[829,3765,3755],{"class":1263},[829,3767,3634],{"class":854},[829,3769,1283],{"class":834},[829,3771,1403],{"class":834},[829,3773,3774,3776,3778],{"class":831,"line":422},[829,3775,2823],{"class":1408},[829,3777,1458],{"class":1457},[829,3779,1286],{"class":834},[829,3781,3782],{"class":831,"line":1463},[829,3783,1911],{"class":834},[829,3785,3786],{"class":831,"line":1468},[829,3787,1316],{"emptyLinePlaceholder":1315},[829,3789,3790,3793,3796,3798,3800],{"class":831,"line":1483},[829,3791,3792],{"class":834},"    $",[829,3794,3795],{"class":1271},"t ",[829,3797,1557],{"class":1263},[829,3799,1458],{"class":1457},[829,3801,1286],{"class":834},[829,3803,3804,3806,3809,3811],{"class":831,"line":1499},[829,3805,3792],{"class":834},[829,3807,3808],{"class":1271},"entries ",[829,3810,1557],{"class":1263},[829,3812,3813],{"class":834}," [];\n",[829,3815,3816,3819,3821,3824,3826,3828,3830,3832,3834,3836,3838,3840,3843,3845,3848,3850],{"class":831,"line":1535},[829,3817,3818],{"class":1408},"    foreach",[829,3820,1413],{"class":834},[829,3822,3823],{"class":2795},"explode",[829,3825,1272],{"class":834},[829,3827,1275],{"class":854},[829,3829,1164],{"class":858},[829,3831,1275],{"class":854},[829,3833,1164],{"class":834},[829,3835,3691],{"class":834},[829,3837,3705],{"class":1271},[829,3839,1283],{"class":834},[829,3841,3842],{"class":1263}," as",[829,3844,3691],{"class":834},[829,3846,3847],{"class":1271},"part",[829,3849,1283],{"class":834},[829,3851,1403],{"class":834},[829,3853,3854,3857,3860,3862,3865,3867,3869,3871,3873,3875,3877,3879,3881,3884],{"class":831,"line":1566},[829,3855,3856],{"class":834},"        $",[829,3858,3859],{"class":1271},"pair ",[829,3861,1557],{"class":1263},[829,3863,3864],{"class":2795}," explode",[829,3866,1272],{"class":834},[829,3868,1275],{"class":854},[829,3870,1557],{"class":858},[829,3872,1275],{"class":854},[829,3874,1164],{"class":834},[829,3876,3691],{"class":834},[829,3878,3847],{"class":1271},[829,3880,1164],{"class":834},[829,3882,3883],{"class":1328}," 2",[829,3885,3886],{"class":834},");\n",[829,3888,3889,3891,3893,3896,3899,3902,3904,3906,3908,3910],{"class":831,"line":1593},[829,3890,2914],{"class":1408},[829,3892,1413],{"class":834},[829,3894,3895],{"class":2795},"count",[829,3897,3898],{"class":834},"($",[829,3900,3901],{"class":1271},"pair",[829,3903,1283],{"class":834},[829,3905,1442],{"class":1263},[829,3907,3883],{"class":1328},[829,3909,1283],{"class":834},[829,3911,1403],{"class":834},[829,3913,3914,3917],{"class":831,"line":1631},[829,3915,3916],{"class":1408},"            continue",[829,3918,1286],{"class":834},[829,3920,3921],{"class":831,"line":1667},[829,3922,3923],{"class":834},"        }\n",[829,3925,3926,3929,3931,3933,3935,3937,3939,3941,3944,3946,3948,3950,3952,3954,3956,3958],{"class":831,"line":1689},[829,3927,3928],{"class":834},"        [$",[829,3930,1674],{"class":1271},[829,3932,1164],{"class":834},[829,3934,3691],{"class":834},[829,3936,1739],{"class":1271},[829,3938,1721],{"class":834},[829,3940,1264],{"class":1263},[829,3942,3943],{"class":2795}," array_map",[829,3945,1272],{"class":834},[829,3947,1275],{"class":854},[829,3949,1623],{"class":858},[829,3951,1275],{"class":854},[829,3953,1164],{"class":834},[829,3955,3691],{"class":834},[829,3957,3901],{"class":1271},[829,3959,3886],{"class":834},[829,3961,3962,3964,3966,3969,3971,3973,3975,3977,3979],{"class":831,"line":1750},[829,3963,2914],{"class":1408},[829,3965,3749],{"class":834},[829,3967,3968],{"class":1271},"key ",[829,3970,3755],{"class":1263},[829,3972,1445],{"class":854},[829,3974,1120],{"class":858},[829,3976,1275],{"class":854},[829,3978,1283],{"class":834},[829,3980,1403],{"class":834},[829,3982,3983,3985,3987,3989,3992,3994,3996,3998,4001,4003,4006,4008,4010,4012,4014,4017,4020,4022,4024,4026,4028],{"class":831,"line":1769},[829,3984,2977],{"class":1408},[829,3986,3749],{"class":834},[829,3988,3795],{"class":1271},[829,3990,3991],{"class":1263},"!==",[829,3993,1458],{"class":1457},[829,3995,1703],{"class":1263},[829,3997,1706],{"class":1263},[829,3999,4000],{"class":2795},"preg_match",[829,4002,1272],{"class":834},[829,4004,4005],{"class":854},"'\u002F",[829,4007,1711],{"class":1263},[829,4009,1714],{"class":854},[829,4011,1718],{"class":858},[829,4013,1721],{"class":854},[829,4015,4016],{"class":1263},"+$",[829,4018,4019],{"class":854},"\u002FD'",[829,4021,1164],{"class":834},[829,4023,3691],{"class":834},[829,4025,1739],{"class":1271},[829,4027,2553],{"class":834},[829,4029,1403],{"class":834},[829,4031,4032,4034,4036],{"class":831,"line":1797},[829,4033,3011],{"class":1408},[829,4035,1458],{"class":1457},[829,4037,1286],{"class":834},[829,4039,4040],{"class":831,"line":1826},[829,4041,4042],{"class":834},"            }\n",[829,4044,4045,4048,4050,4052,4054,4056,4058,4060,4062],{"class":831,"line":1908},[829,4046,4047],{"class":834},"            $",[829,4049,3795],{"class":1271},[829,4051,1557],{"class":1263},[829,4053,1413],{"class":834},[829,4055,3721],{"class":1255},[829,4057,1283],{"class":834},[829,4059,3691],{"class":834},[829,4061,1739],{"class":1271},[829,4063,1286],{"class":834},[829,4065,4066,4069,4072,4074,4076,4078,4080,4082,4084,4086],{"class":831,"line":1914},[829,4067,4068],{"class":834},"        }",[829,4070,4071],{"class":1408}," elseif",[829,4073,3749],{"class":834},[829,4075,3968],{"class":1271},[829,4077,3755],{"class":1263},[829,4079,1445],{"class":854},[829,4081,1127],{"class":858},[829,4083,1275],{"class":854},[829,4085,1283],{"class":834},[829,4087,1403],{"class":834},[829,4089,4090,4092,4095,4097,4099,4101,4103,4105,4107,4109,4111,4113,4115,4117],{"class":831,"line":1920},[829,4091,4047],{"class":834},[829,4093,4094],{"class":1271},"kidAndHex ",[829,4096,1557],{"class":1263},[829,4098,3864],{"class":2795},[829,4100,1272],{"class":834},[829,4102,1275],{"class":854},[829,4104,851],{"class":858},[829,4106,1275],{"class":854},[829,4108,1164],{"class":834},[829,4110,3691],{"class":834},[829,4112,1739],{"class":1271},[829,4114,1164],{"class":834},[829,4116,3883],{"class":1328},[829,4118,3886],{"class":834},[829,4120,4121,4123,4125,4127,4129,4132,4134,4136,4138,4140],{"class":831,"line":1955},[829,4122,2977],{"class":1408},[829,4124,1413],{"class":834},[829,4126,3895],{"class":2795},[829,4128,3898],{"class":834},[829,4130,4131],{"class":1271},"kidAndHex",[829,4133,1283],{"class":834},[829,4135,1577],{"class":1263},[829,4137,3883],{"class":1328},[829,4139,1283],{"class":834},[829,4141,1403],{"class":834},[829,4143,4144,4147,4149,4152,4154,4156,4158],{"class":831,"line":1993},[829,4145,4146],{"class":834},"                $",[829,4148,1844],{"class":1271},[829,4150,4151],{"class":834},"[]",[829,4153,1264],{"class":1263},[829,4155,3691],{"class":834},[829,4157,4131],{"class":1271},[829,4159,1286],{"class":834},[829,4161,4162],{"class":831,"line":1998},[829,4163,4042],{"class":834},[829,4165,4166],{"class":831,"line":2018},[829,4167,3923],{"class":834},[829,4169,4170],{"class":831,"line":2090},[829,4171,1911],{"class":834},[829,4173,4174,4176,4178,4180,4182,4184,4186,4189,4191,4193,4195,4197,4199,4201],{"class":831,"line":2120},[829,4175,1569],{"class":1408},[829,4177,3749],{"class":834},[829,4179,3795],{"class":1271},[829,4181,3755],{"class":1263},[829,4183,1458],{"class":1457},[829,4185,1703],{"class":1263},[829,4187,4188],{"class":2795}," count",[829,4190,3898],{"class":834},[829,4192,1844],{"class":1271},[829,4194,1283],{"class":834},[829,4196,1577],{"class":1263},[829,4198,1944],{"class":1328},[829,4200,1283],{"class":834},[829,4202,1403],{"class":834},[829,4204,4205,4207,4209],{"class":831,"line":2162},[829,4206,2823],{"class":1408},[829,4208,1458],{"class":1457},[829,4210,1286],{"class":834},[829,4212,4213],{"class":831,"line":2212},[829,4214,1911],{"class":834},[829,4216,4217,4219,4221,4223,4225,4227,4230,4233],{"class":831,"line":2217},[829,4218,3792],{"class":834},[829,4220,3180],{"class":1271},[829,4222,1557],{"class":1263},[829,4224,3691],{"class":834},[829,4226,3180],{"class":1271},[829,4228,4229],{"class":1263},"??",[829,4231,4232],{"class":2795}," time",[829,4234,4235],{"class":834},"();\n",[829,4237,4238,4240,4242,4244,4246,4248,4250,4252,4254,4256,4258,4260,4262],{"class":831,"line":2222},[829,4239,1569],{"class":1408},[829,4241,1413],{"class":834},[829,4243,1967],{"class":2795},[829,4245,3898],{"class":834},[829,4247,3180],{"class":1271},[829,4249,3183],{"class":1263},[829,4251,3691],{"class":834},[829,4253,1120],{"class":1271},[829,4255,1283],{"class":834},[829,4257,3190],{"class":1263},[829,4259,3663],{"class":1259},[829,4261,1283],{"class":834},[829,4263,1403],{"class":834},[829,4265,4266,4268,4270],{"class":831,"line":2232},[829,4267,2823],{"class":1408},[829,4269,1458],{"class":1457},[829,4271,1286],{"class":834},[829,4273,4274],{"class":831,"line":2237},[829,4275,1911],{"class":834},[829,4277,4278],{"class":831,"line":2242},[829,4279,1316],{"emptyLinePlaceholder":1315},[829,4281,4282,4284,4286,4289,4292,4294,4296,4298],{"class":831,"line":2258},[829,4283,3818],{"class":1408},[829,4285,3749],{"class":834},[829,4287,4288],{"class":1271},"secrets ",[829,4290,4291],{"class":1263},"as",[829,4293,3691],{"class":834},[829,4295,2380],{"class":1271},[829,4297,1283],{"class":834},[829,4299,1403],{"class":834},[829,4301,4302,4304,4307,4309,4312,4314,4316,4318,4320,4322,4324,4326,4328,4330,4332,4334,4337,4339,4341,4343,4345,4347],{"class":831,"line":2263},[829,4303,3856],{"class":834},[829,4305,4306],{"class":1271},"expected ",[829,4308,1557],{"class":1263},[829,4310,4311],{"class":2795}," hash_hmac",[829,4313,1272],{"class":834},[829,4315,1275],{"class":854},[829,4317,2039],{"class":858},[829,4319,1275],{"class":854},[829,4321,1164],{"class":834},[829,4323,3691],{"class":834},[829,4325,3795],{"class":1271},[829,4327,925],{"class":1263},[829,4329,1445],{"class":854},[829,4331,925],{"class":858},[829,4333,1275],{"class":854},[829,4335,4336],{"class":1263}," .",[829,4338,3691],{"class":834},[829,4340,1355],{"class":1271},[829,4342,1164],{"class":834},[829,4344,3691],{"class":834},[829,4346,2380],{"class":1271},[829,4348,3886],{"class":834},[829,4350,4351,4354,4356,4358,4360,4363,4365,4367,4369,4371,4373],{"class":831,"line":2269},[829,4352,4353],{"class":1408},"        foreach",[829,4355,3749],{"class":834},[829,4357,3808],{"class":1271},[829,4359,4291],{"class":1263},[829,4361,4362],{"class":834}," [$",[829,4364,2469],{"class":1271},[829,4366,1164],{"class":834},[829,4368,3691],{"class":834},[829,4370,2153],{"class":1271},[829,4372,2455],{"class":834},[829,4374,1403],{"class":834},[829,4376,4377,4379,4381,4383,4385,4387,4389,4391,4393,4396,4399,4401,4403,4405,4407,4409,4411,4413,4416,4419,4421,4423,4425,4427,4429,4431],{"class":831,"line":2275},[829,4378,2977],{"class":1408},[829,4380,1413],{"class":834},[829,4382,4000],{"class":2795},[829,4384,1272],{"class":834},[829,4386,4005],{"class":854},[829,4388,1711],{"class":1263},[829,4390,1714],{"class":854},[829,4392,2135],{"class":858},[829,4394,4395],{"class":854},"]{",[829,4397,4398],{"class":858},"128",[829,4400,1901],{"class":854},[829,4402,1727],{"class":1263},[829,4404,4019],{"class":854},[829,4406,1164],{"class":834},[829,4408,3691],{"class":834},[829,4410,2153],{"class":1271},[829,4412,1283],{"class":834},[829,4414,4415],{"class":1263}," &&",[829,4417,4418],{"class":2795}," hash_equals",[829,4420,3898],{"class":834},[829,4422,2178],{"class":1271},[829,4424,1164],{"class":834},[829,4426,3691],{"class":834},[829,4428,2153],{"class":1271},[829,4430,2553],{"class":834},[829,4432,1403],{"class":834},[829,4434,4435,4437,4439,4441],{"class":831,"line":2343},[829,4436,3011],{"class":1408},[829,4438,3691],{"class":834},[829,4440,2469],{"class":1271},[829,4442,1286],{"class":834},[829,4444,4445],{"class":831,"line":2371},[829,4446,4042],{"class":834},[829,4448,4449],{"class":831,"line":2403},[829,4450,3923],{"class":834},[829,4452,4453],{"class":831,"line":2408},[829,4454,1911],{"class":834},[829,4456,4457,4459,4461],{"class":831,"line":2460},[829,4458,3385],{"class":1408},[829,4460,1458],{"class":1457},[829,4462,1286],{"class":834},[829,4464,4465],{"class":831,"line":2490},[829,4466,883],{"class":834},[829,4468,4469],{"class":831,"line":2495},[829,4470,1316],{"emptyLinePlaceholder":1315},[829,4472,4473,4475,4478,4480,4483,4485,4487,4490,4492,4495],{"class":831,"line":2513},[829,4474,1727],{"class":834},[829,4476,4477],{"class":1271},"rawBody ",[829,4479,1557],{"class":1263},[829,4481,4482],{"class":2795}," file_get_contents",[829,4484,1272],{"class":834},[829,4486,1275],{"class":854},[829,4488,4489],{"class":858},"php:\u002F\u002Finput",[829,4491,1275],{"class":854},[829,4493,4494],{"class":834},");",[829,4496,4497],{"class":1340}," \u002F\u002F the exact bytes Paystack sent\n",[829,4499,4500,4502,4505,4507,4510,4512,4514,4516,4518,4520],{"class":831,"line":2558},[829,4501,1727],{"class":834},[829,4503,4504],{"class":1271},"secret ",[829,4506,1557],{"class":1263},[829,4508,4509],{"class":2795}," getenv",[829,4511,1272],{"class":834},[829,4513,1275],{"class":854},[829,4515,2362],{"class":858},[829,4517,1275],{"class":854},[829,4519,4494],{"class":834},[829,4521,2368],{"class":1340},[829,4523,4524,4526,4528,4530,4532,4535,4537,4539,4542,4544,4546,4549,4551],{"class":831,"line":2564},[829,4525,1727],{"class":834},[829,4527,3752],{"class":1271},[829,4529,1557],{"class":1263},[829,4531,3691],{"class":834},[829,4533,4534],{"class":1271},"_SERVER",[829,4536,1714],{"class":834},[829,4538,1275],{"class":854},[829,4540,4541],{"class":858},"HTTP_PAYSTACK_SIGNATURE",[829,4543,1275],{"class":854},[829,4545,1721],{"class":834},[829,4547,4548],{"class":1263}," ??",[829,4550,1458],{"class":1457},[829,4552,1286],{"class":834},[829,4554,4555],{"class":831,"line":3422},[829,4556,1316],{"emptyLinePlaceholder":1315},[829,4558,4559,4562,4564,4566,4568,4570,4572],{"class":831,"line":3445},[829,4560,4561],{"class":1408},"if",[829,4563,1413],{"class":834},[829,4565,1416],{"class":1263},[829,4567,1727],{"class":834},[829,4569,2380],{"class":1271},[829,4571,1283],{"class":834},[829,4573,1403],{"class":834},[829,4575,4576,4579,4581,4583],{"class":831,"line":3456},[829,4577,4578],{"class":2795},"    http_response_code",[829,4580,1272],{"class":834},[829,4582,2396],{"class":1328},[829,4584,3886],{"class":834},[829,4586,4587,4590],{"class":831,"line":3477},[829,4588,4589],{"class":1408},"    exit",[829,4591,1286],{"class":834},[829,4593,4594],{"class":831,"line":3510},[829,4595,883],{"class":834},[829,4597,4598],{"class":831,"line":3521},[829,4599,1316],{"emptyLinePlaceholder":1315},[829,4601,4602,4604,4606,4609,4611,4613,4615,4617,4619,4621,4623,4625,4627,4629,4631,4633],{"class":831,"line":3533},[829,4603,4561],{"class":1408},[829,4605,1413],{"class":834},[829,4607,4608],{"class":1267},"verifyPaystackSignature",[829,4610,3898],{"class":834},[829,4612,1355],{"class":1271},[829,4614,1164],{"class":834},[829,4616,3691],{"class":834},[829,4618,3705],{"class":1271},[829,4620,1164],{"class":834},[829,4622,4362],{"class":834},[829,4624,2380],{"class":1271},[829,4626,2455],{"class":834},[829,4628,1577],{"class":1263},[829,4630,1458],{"class":1457},[829,4632,1283],{"class":834},[829,4634,1403],{"class":834},[829,4636,4637,4639,4641,4643],{"class":831,"line":3538},[829,4638,4578],{"class":2795},[829,4640,1272],{"class":834},[829,4642,1206],{"class":1328},[829,4644,3886],{"class":834},[829,4646,4647,4649],{"class":831,"line":3585},[829,4648,4589],{"class":1408},[829,4650,1286],{"class":834},[829,4652,4653],{"class":831,"line":3596},[829,4654,883],{"class":834},[829,4656,4657],{"class":831,"line":3601},[829,4658,1316],{"emptyLinePlaceholder":1315},[829,4660,4661,4664,4666,4668],{"class":831,"line":3623},[829,4662,4663],{"class":2795},"http_response_code",[829,4665,1272],{"class":834},[829,4667,1210],{"class":1328},[829,4669,3886],{"class":834},[829,4671,4672,4674,4677,4679,4682,4684,4686,4688,4691],{"class":831,"line":3629},[829,4673,1727],{"class":834},[829,4675,4676],{"class":1271},"event ",[829,4678,1557],{"class":1263},[829,4680,4681],{"class":2795}," json_decode",[829,4683,3898],{"class":834},[829,4685,1355],{"class":1271},[829,4687,1164],{"class":834},[829,4689,4690],{"class":1457}," true",[829,4692,3886],{"class":834},[829,4694,4696],{"class":831,"line":4695},66,[829,4697,4698],{"class":1340},"\u002F\u002F handle $event['event'] and $event['data']\n",[1090,4700,4702],{"id":4701},"rotating-your-signing-secret","Rotating your signing secret",[797,4704,4705,4706,4708],{},"To replace your signing secret, rotate it on the Dashboard and choose how long the current secret keeps working: 1 hour, 24 hours, 3 days, or 7 days. During that overlap, every webhook carries two ",[801,4707,1127],{}," signatures, one for each secret. Deploy the new secret to your server before the overlap ends.",[1090,4710,4712],{"id":4711},"if-your-signing-secret-leaks","If your signing secret leaks",[943,4714,4715,4718],{},[946,4716,4717],{},"Revoke it on the Dashboard. It stops signing within a minute, with no overlap.",[946,4719,4720],{},"Generate a new secret and deploy it to your server. Remove the leaked secret from your server.",[797,4722,4723],{},"Webhooks that fail your check in between are retried, and each retry is signed with the new secret.",[1090,4725,1011],{"id":4726},"x-paystack-signature-deprecated",[797,4728,4729,4730,4732,4733,4735,4736,4738],{},"While your integration has a secret key, webhooks also carry ",[801,4731,1000],{},". This header is deprecated: use ",[801,4734,989],{}," once your webhooks carry it. If you keep your secret key, you can keep verifying ",[801,4737,1000],{}," as you do today.",[4740,4741,4743],"callout",{"type":4742},"warning",[797,4744,4745,4746,4748,4749,4751,4752,4754],{},"If your webhooks don't carry ",[801,4747,989],{}," yet, don't delete your secret key: Paystack will stop sending you webhooks. Before you delete it, confirm that your webhooks carry ",[801,4750,989],{}," and that your endpoint verifies it. After you delete your secret key, ",[801,4753,1000],{}," is no longer sent.",[797,4756,4757,4759],{},[801,4758,1000],{}," is a hex HMAC-SHA512 of the raw request body, keyed with your secret key. It has no timestamp. To verify it:",[820,4761,4763],{"className":1246,"code":4762,"language":1248,"meta":825,"style":825},"const crypto = require('crypto');\nconst express = require('express');\n\nconst app = express();\n\n\u002F\u002F express.raw keeps req.body as the exact bytes Paystack sent.\napp.post('\u002Fwebhooks\u002Fpaystack', express.raw({ type: 'application\u002Fjson' }), (req, res) => {\n  const expected = crypto.createHmac('sha512', process.env.PAYSTACK_SECRET_KEY).update(req.body).digest();\n  const received = req.get('x-paystack-signature') || '';\n  const valid =\n    \u002F^[0-9a-f]{128}$\u002F.test(received) && crypto.timingSafeEqual(expected, Buffer.from(received, 'hex'));\n  if (!valid) return res.sendStatus(401);\n\n  res.sendStatus(200);\n  \u002F\u002F handle JSON.parse(req.body.toString('utf8'))\n});\n",[801,4764,4765,4787,4809,4813,4827,4831,4836,4894,4953,4985,4995,5062,5091,5095,5111,5116],{"__ignoreMap":825},[829,4766,4767,4769,4771,4773,4775,4777,4779,4781,4783,4785],{"class":831,"line":63},[829,4768,1256],{"class":1255},[829,4770,1260],{"class":1259},[829,4772,1264],{"class":1263},[829,4774,1268],{"class":1267},[829,4776,1272],{"class":1271},[829,4778,1275],{"class":854},[829,4780,1278],{"class":858},[829,4782,1275],{"class":854},[829,4784,1283],{"class":1271},[829,4786,1286],{"class":834},[829,4788,4789,4791,4793,4795,4797,4799,4801,4803,4805,4807],{"class":831,"line":66},[829,4790,1256],{"class":1255},[829,4792,1293],{"class":1259},[829,4794,1264],{"class":1263},[829,4796,1268],{"class":1267},[829,4798,1272],{"class":1271},[829,4800,1275],{"class":854},[829,4802,1304],{"class":858},[829,4804,1275],{"class":854},[829,4806,1283],{"class":1271},[829,4808,1286],{"class":834},[829,4810,4811],{"class":831,"line":84},[829,4812,1316],{"emptyLinePlaceholder":1315},[829,4814,4815,4817,4819,4821,4823,4825],{"class":831,"line":75},[829,4816,1256],{"class":1255},[829,4818,2247],{"class":1259},[829,4820,1264],{"class":1263},[829,4822,1293],{"class":1267},[829,4824,1626],{"class":1271},[829,4826,1286],{"class":834},[829,4828,4829],{"class":831,"line":107},[829,4830,1316],{"emptyLinePlaceholder":1315},[829,4832,4833],{"class":831,"line":134},[829,4834,4835],{"class":1340},"\u002F\u002F express.raw keeps req.body as the exact bytes Paystack sent.\n",[829,4837,4838,4840,4842,4844,4846,4848,4850,4852,4854,4856,4858,4860,4862,4864,4866,4868,4870,4872,4874,4876,4878,4880,4882,4884,4886,4888,4890,4892],{"class":831,"line":153},[829,4839,2278],{"class":1271},[829,4841,925],{"class":834},[829,4843,2283],{"class":1267},[829,4845,1272],{"class":1271},[829,4847,1275],{"class":854},[829,4849,2290],{"class":858},[829,4851,1275],{"class":854},[829,4853,1164],{"class":834},[829,4855,1293],{"class":1271},[829,4857,925],{"class":834},[829,4859,2301],{"class":1267},[829,4861,1272],{"class":1271},[829,4863,1854],{"class":834},[829,4865,2308],{"class":1412},[829,4867,851],{"class":834},[829,4869,1445],{"class":854},[829,4871,2315],{"class":858},[829,4873,1275],{"class":854},[829,4875,2109],{"class":834},[829,4877,1283],{"class":1271},[829,4879,1164],{"class":834},[829,4881,1413],{"class":834},[829,4883,2328],{"class":1354},[829,4885,1164],{"class":834},[829,4887,2333],{"class":1354},[829,4889,1283],{"class":834},[829,4891,2338],{"class":1255},[829,4893,1403],{"class":834},[829,4895,4896,4898,4900,4902,4904,4906,4908,4910,4912,4914,4916,4918,4920,4922,4924,4926,4929,4931,4933,4935,4937,4939,4941,4943,4945,4947,4949,4951],{"class":831,"line":422},[829,4897,1486],{"class":1255},[829,4899,2023],{"class":1259},[829,4901,1264],{"class":1263},[829,4903,1260],{"class":1271},[829,4905,925],{"class":834},[829,4907,2032],{"class":1267},[829,4909,1272],{"class":1412},[829,4911,1275],{"class":854},[829,4913,2039],{"class":858},[829,4915,1275],{"class":854},[829,4917,1164],{"class":834},[829,4919,2352],{"class":1271},[829,4921,925],{"class":834},[829,4923,2357],{"class":1271},[829,4925,925],{"class":834},[829,4927,4928],{"class":1259},"PAYSTACK_SECRET_KEY",[829,4930,1283],{"class":1412},[829,4932,925],{"class":834},[829,4934,2052],{"class":1267},[829,4936,1272],{"class":1412},[829,4938,2328],{"class":1271},[829,4940,925],{"class":834},[829,4942,2425],{"class":1271},[829,4944,1283],{"class":1412},[829,4946,925],{"class":834},[829,4948,2083],{"class":1267},[829,4950,1626],{"class":1412},[829,4952,1286],{"class":834},[829,4954,4955,4957,4960,4962,4964,4966,4968,4970,4972,4975,4977,4979,4981,4983],{"class":831,"line":1463},[829,4956,1486],{"class":1255},[829,4958,4959],{"class":1259}," received",[829,4961,1264],{"class":1263},[829,4963,2430],{"class":1271},[829,4965,925],{"class":834},[829,4967,2435],{"class":1267},[829,4969,1272],{"class":1412},[829,4971,1275],{"class":854},[829,4973,4974],{"class":858},"x-paystack-signature",[829,4976,1275],{"class":854},[829,4978,1431],{"class":1412},[829,4980,1434],{"class":1263},[829,4982,3634],{"class":854},[829,4984,1286],{"class":834},[829,4986,4987,4989,4992],{"class":831,"line":1468},[829,4988,1486],{"class":1255},[829,4990,4991],{"class":1259}," valid",[829,4993,4994],{"class":1263}," =\n",[829,4996,4997,5000,5002,5004,5006,5008,5010,5012,5014,5016,5018,5020,5023,5025,5028,5030,5032,5034,5036,5038,5040,5042,5044,5046,5048,5050,5052,5054,5056,5058,5060],{"class":831,"line":1483},[829,4998,4999],{"class":854},"    \u002F",[829,5001,1711],{"class":1408},[829,5003,1714],{"class":1457},[829,5005,2135],{"class":1717},[829,5007,1721],{"class":1457},[829,5009,2140],{"class":1263},[829,5011,1727],{"class":1408},[829,5013,328],{"class":854},[829,5015,925],{"class":834},[829,5017,1734],{"class":1267},[829,5019,1272],{"class":1412},[829,5021,5022],{"class":1271},"received",[829,5024,1431],{"class":1412},[829,5026,5027],{"class":1263},"&&",[829,5029,1260],{"class":1271},[829,5031,925],{"class":834},[829,5033,2173],{"class":1267},[829,5035,1272],{"class":1412},[829,5037,2178],{"class":1271},[829,5039,1164],{"class":834},[829,5041,2183],{"class":1271},[829,5043,925],{"class":834},[829,5045,2188],{"class":1267},[829,5047,1272],{"class":1412},[829,5049,5022],{"class":1271},[829,5051,1164],{"class":834},[829,5053,1445],{"class":854},[829,5055,2153],{"class":858},[829,5057,1275],{"class":854},[829,5059,2553],{"class":1412},[829,5061,1286],{"class":834},[829,5063,5064,5066,5068,5070,5073,5075,5077,5079,5081,5083,5085,5087,5089],{"class":831,"line":1499},[829,5065,1409],{"class":1408},[829,5067,1413],{"class":1412},[829,5069,1416],{"class":1263},[829,5071,5072],{"class":1271},"valid",[829,5074,1431],{"class":1412},[829,5076,1454],{"class":1408},[829,5078,2333],{"class":1271},[829,5080,925],{"class":834},[829,5082,2391],{"class":1267},[829,5084,1272],{"class":1412},[829,5086,1206],{"class":1328},[829,5088,1283],{"class":1412},[829,5090,1286],{"class":834},[829,5092,5093],{"class":831,"line":1535},[829,5094,1316],{"emptyLinePlaceholder":1315},[829,5096,5097,5099,5101,5103,5105,5107,5109],{"class":831,"line":1566},[829,5098,2498],{"class":1271},[829,5100,925],{"class":834},[829,5102,2391],{"class":1267},[829,5104,1272],{"class":1412},[829,5106,1210],{"class":1328},[829,5108,1283],{"class":1412},[829,5110,1286],{"class":834},[829,5112,5113],{"class":831,"line":1593},[829,5114,5115],{"class":1340},"  \u002F\u002F handle JSON.parse(req.body.toString('utf8'))\n",[829,5117,5118,5120,5122],{"class":831,"line":1631},[829,5119,1901],{"class":834},[829,5121,1283],{"class":1271},[829,5123,1286],{"class":834},[1090,5125,5127],{"id":5126},"troubleshooting","Troubleshooting",[1060,5129,5130,5149,5155],{},[946,5131,5132,5135,5136,5139,5140,5139,5143,5145,5146,5148],{},[949,5133,5134],{},"The signature never matches."," You're probably hashing a parsed and re-serialised body. Use the raw bytes (",[801,5137,5138],{},"express.raw",", ",[801,5141,5142],{},"request.get_data()",[801,5144,4489],{},"). Use the whole secret, ",[801,5147,1098],{}," included, and the test secret for test webhooks.",[946,5150,5151,5154],{},[949,5152,5153],{},"The timestamp is too old."," Check that your server clock is synced (NTP).",[946,5156,5157,5163,5164,925],{},[949,5158,5159,5160,5162],{},"There's no ",[801,5161,989],{}," header."," Your integration has no active signing secret for this mode. Generate one on the Dashboard. Until the header appears, verify ",[801,5165,1000],{},[793,5167,1071],{"id":5168},"receive-webhooks-locally",[797,5170,5171,5172,5175,5176,921,5181,925],{},"Paystack can't send webhooks to ",[801,5173,5174],{},"localhost",". To test your webhook handler on your machine, expose your local server through a tunnel such as ",[971,5177,5180],{"href":5178,"rel":5179,"target":976},"https:\u002F\u002Fngrok.com\u002Fdocs",[975],"ngrok",[971,5182,5185],{"href":5183,"rel":5184,"target":976},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fcloudflare-one\u002Fconnections\u002Fconnect-networks\u002F",[975],"cloudflared",[943,5187,5188,5191,5212,5218,5226,5233],{},[946,5189,5190],{},"Start your server. This example assumes it listens on port 8080.",[946,5192,5193,5194],{},"Start the tunnel:",[820,5195,5199],{"className":5196,"code":5197,"language":5198,"meta":825,"style":825},"language-bash shiki shiki-themes material-theme-lighter github-light github-dark-dimmed","ngrok http 8080\n","bash",[801,5200,5201],{"__ignoreMap":825},[829,5202,5203,5206,5209],{"class":831,"line":63},[829,5204,5180],{"class":5205},"s0zq4",[829,5207,5208],{"class":858}," http",[829,5210,5211],{"class":1328}," 8080\n",[946,5213,5214,5215,925],{},"Copy the HTTPS forwarding URL the tunnel prints and add your webhook route, for example ",[801,5216,5217],{},"https:\u002F\u002F\u003Cyour-subdomain>.ngrok-free.app\u002Fwebhooks\u002Fpaystack",[946,5219,5220,5221,5225],{},"Save that URL as your test webhook URL on the ",[971,5222,5224],{"href":973,"rel":5223,"target":976},[975],"API configuration"," page.",[946,5227,5228,5229,5232],{},"Make a payment with your test keys and the ",[971,5230,5231],{"href":187},"test payment details"," for your market.",[946,5234,5235,5236,5238,5239,5243],{},"Check that your handler verifies the signature and returns ",[801,5237,810],{},". Then call ",[971,5240,5242],{"href":5241},"\u002Fapi\u002Ftransaction#verify","Verify Transaction"," for the same reference and confirm it matches the event you received.",[797,5245,5246],{},"Most tunnel URLs change each time you restart the tunnel, so update your test webhook URL when that happens. Your live webhook URL is a separate setting, so this doesn't affect live webhooks.",[793,5248,5250],{"id":5249},"ip-allowlist","IP allowlist",[797,5252,5253],{},"Paystack sends webhook requests from these IP addresses:",[1060,5255,5256,5261,5266],{},[946,5257,5258],{},[801,5259,5260],{},"52.31.139.75",[946,5262,5263],{},[801,5264,5265],{},"52.49.173.169",[946,5267,5268],{},[801,5269,5270],{},"52.214.14.220",[797,5272,5273],{},"These IP addresses apply to both test and live environments.",[793,5275,5277],{"id":5276},"event-types","Event types",[885,5279,5280,5289],{},[888,5281,5282],{},[891,5283,5284,5287],{},[894,5285,5286],{},"Event",[894,5288,902],{},[904,5290,5291,5301,5311,5321,5330,5340,5350,5360,5370,5380,5390,5400,5410,5420,5430,5440,5450,5459,5469,5479,5489,5499,5509,5519],{},[891,5292,5293,5298],{},[909,5294,5295],{},[801,5296,5297],{},"charge.dispute.create",[909,5299,5300],{},"A dispute was logged against your business.",[891,5302,5303,5308],{},[909,5304,5305],{},[801,5306,5307],{},"charge.dispute.remind",[909,5309,5310],{},"A logged dispute has not been resolved.",[891,5312,5313,5318],{},[909,5314,5315],{},[801,5316,5317],{},"charge.dispute.resolve",[909,5319,5320],{},"A dispute has been resolved.",[891,5322,5323,5327],{},[909,5324,5325],{},[801,5326,859],{},[909,5328,5329],{},"A successful charge was made.",[891,5331,5332,5337],{},[909,5333,5334],{},[801,5335,5336],{},"customeridentification.failed",[909,5338,5339],{},"Customer ID validation failed.",[891,5341,5342,5347],{},[909,5343,5344],{},[801,5345,5346],{},"customeridentification.success",[909,5348,5349],{},"Customer ID validation succeeded.",[891,5351,5352,5357],{},[909,5353,5354],{},[801,5355,5356],{},"dedicatedaccount.assign.failed",[909,5358,5359],{},"A Dedicated Virtual Account could not be assigned.",[891,5361,5362,5367],{},[909,5363,5364],{},[801,5365,5366],{},"dedicatedaccount.assign.success",[909,5368,5369],{},"A Dedicated Virtual Account was successfully assigned.",[891,5371,5372,5377],{},[909,5373,5374],{},[801,5375,5376],{},"invoice.create",[909,5378,5379],{},"An invoice was created for a subscription.",[891,5381,5382,5387],{},[909,5383,5384],{},[801,5385,5386],{},"invoice.payment_failed",[909,5388,5389],{},"An invoice payment failed.",[891,5391,5392,5397],{},[909,5393,5394],{},[801,5395,5396],{},"invoice.update",[909,5398,5399],{},"An invoice was updated after a charge attempt.",[891,5401,5402,5407],{},[909,5403,5404],{},[801,5405,5406],{},"paymentrequest.pending",[909,5408,5409],{},"A payment request was sent to a customer.",[891,5411,5412,5417],{},[909,5413,5414],{},[801,5415,5416],{},"paymentrequest.success",[909,5418,5419],{},"A payment request was paid.",[891,5421,5422,5427],{},[909,5423,5424],{},[801,5425,5426],{},"refund.failed",[909,5428,5429],{},"A refund could not be processed.",[891,5431,5432,5437],{},[909,5433,5434],{},[801,5435,5436],{},"refund.pending",[909,5438,5439],{},"A refund was initiated and is waiting for processor response.",[891,5441,5442,5447],{},[909,5443,5444],{},[801,5445,5446],{},"refund.processing",[909,5448,5449],{},"A refund has been received by the processor.",[891,5451,5452,5456],{},[909,5453,5454],{},[801,5455,924],{},[909,5457,5458],{},"A refund has been processed successfully.",[891,5460,5461,5466],{},[909,5462,5463],{},[801,5464,5465],{},"subscription.create",[909,5467,5468],{},"A subscription was created.",[891,5470,5471,5476],{},[909,5472,5473],{},[801,5474,5475],{},"subscription.disable",[909,5477,5478],{},"A subscription was disabled.",[891,5480,5481,5486],{},[909,5482,5483],{},[801,5484,5485],{},"subscription.expiring_cards",[909,5487,5488],{},"Information about subscriptions with cards expiring that month.",[891,5490,5491,5496],{},[909,5492,5493],{},[801,5494,5495],{},"subscription.not_renew",[909,5497,5498],{},"A subscription changed to non-renewing.",[891,5500,5501,5506],{},[909,5502,5503],{},[801,5504,5505],{},"transfer.failed",[909,5507,5508],{},"A transfer failed.",[891,5510,5511,5516],{},[909,5512,5513],{},[801,5514,5515],{},"transfer.success",[909,5517,5518],{},"A transfer completed successfully.",[891,5520,5521,5526],{},[909,5522,5523],{},[801,5524,5525],{},"transfer.reversed",[909,5527,5528],{},"A transfer was reversed.",[793,5530,5532],{"id":5531},"inspecting-and-resending-events","Inspecting and resending events",[797,5534,5535,5536,5540],{},"Every webhook delivery Paystack sends is logged as an event you can look up later. Use the ",[971,5537,5539],{"href":5538},"\u002Fapi\u002Fwebhook-events","Webhook Events API"," to check what was sent, confirm your endpoint's response, or recover from a delivery your server missed:",[1060,5542,5543,5549,5555,5561,5567],{},[946,5544,5545,5548],{},[949,5546,5547],{},"List events"," to see recent deliveries, filtered by category, event type, status, resource id, or date.",[946,5550,5551,5554],{},[949,5552,5553],{},"Look up an event"," by transaction id or event id when a customer reports a payment that didn't reach your webhook.",[946,5556,5557,5560],{},[949,5558,5559],{},"Fetch a single event"," to see its full payload and the response your endpoint returned.",[946,5562,5563,5566],{},[949,5564,5565],{},"Resend events"," by id, once you've fixed the issue on your end.",[946,5568,5569,5572,5573,5576],{},[949,5570,5571],{},"Resend matching events"," to recover in bulk. Pass ",[801,5574,5575],{},"preview=true"," first to confirm how many events match your filter before you resend them.",[797,5578,5579],{},"Resending isn't idempotent. If your endpoint already processed an event, resending it delivers a duplicate, so your handler must be able to ignore repeats.",[5581,5582,5583],"style",{},"html pre.shiki code .s7Vxm, html code.shiki .s7Vxm{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#ADBAC7}html pre.shiki code .sLsO-, html code.shiki .sLsO-{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#8DDB8C}html pre.shiki code .sO5ea, html code.shiki .sO5ea{--shiki-light:#9C3EDA;--shiki-default:#005CC5;--shiki-dark:#8DDB8C}html pre.shiki code .sO3A-, html code.shiki .sO3A-{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#96D0FF}html pre.shiki code .sOv1k, html code.shiki .sOv1k{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#96D0FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sAeZB, html code.shiki .sAeZB{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F47067}html pre.shiki code .s1fxI, html code.shiki .s1fxI{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#6CB6FF}html pre.shiki code .s6LNo, html code.shiki .s6LNo{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F47067}html pre.shiki code .sENpr, html code.shiki .sENpr{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#DCBDFB}html pre.shiki code .swCDk, html code.shiki .swCDk{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#ADBAC7}html pre.shiki code .sCI7e, html code.shiki .sCI7e{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#6CB6FF}html pre.shiki code .sCqSu, html code.shiki .sCqSu{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#768390;--shiki-dark-font-style:inherit}html pre.shiki code .semhU, html code.shiki .semhU{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#F69D50;--shiki-dark-font-style:inherit}html pre.shiki code .sb9E3, html code.shiki .sb9E3{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F47067;--shiki-dark-font-style:inherit}html pre.shiki code .sOnBC, html code.shiki .sOnBC{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#ADBAC7}html pre.shiki code .sNG8c, html code.shiki .sNG8c{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#6CB6FF}html pre.shiki code .scI3H, html code.shiki .scI3H{--shiki-light:#91B859;--shiki-default:#005CC5;--shiki-dark:#6CB6FF}html pre.shiki code .sddFs, html code.shiki .sddFs{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#ADBAC7}html pre.shiki code .sl75J, html code.shiki .sl75J{--shiki-light:#91B859;--shiki-default:#005CC5;--shiki-dark:#F47067}html pre.shiki code .sRnYG, html code.shiki .sRnYG{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#24292E;--shiki-default-font-style:inherit;--shiki-dark:#ADBAC7;--shiki-dark-font-style:inherit}html pre.shiki code .sEzAc, html code.shiki .sEzAc{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#032F62;--shiki-default-font-style:inherit;--shiki-dark:#96D0FF;--shiki-dark-font-style:inherit}html pre.shiki code .sH5AN, html code.shiki .sH5AN{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#032F62;--shiki-default-font-style:inherit;--shiki-dark:#96D0FF;--shiki-dark-font-style:inherit}html pre.shiki code .slzs_, html code.shiki .slzs_{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#6CB6FF}html pre.shiki code .s61-6, html code.shiki .s61-6{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#6CB6FF}html pre.shiki code .sXQcW, html code.shiki .sXQcW{--shiki-light:#39ADB5;--shiki-default:#6F42C1;--shiki-dark:#DCBDFB}html pre.shiki code .sixiX, html code.shiki .sixiX{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F47067}html pre.shiki code .s0zq4, html code.shiki .s0zq4{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#F69D50}",{"title":825,"searchDepth":66,"depth":66,"links":5585},[5586,5587,5588,5591,5592,5593,5594],{"id":795,"depth":66,"text":288},{"id":814,"depth":66,"text":815},{"id":940,"depth":66,"text":941,"children":5589},[5590],{"id":1088,"depth":84,"text":994},{"id":5168,"depth":66,"text":1071},{"id":5249,"depth":66,"text":5250},{"id":5276,"depth":66,"text":5277},{"id":5531,"depth":66,"text":5532},"Webhook event types, payload structure, allowlisted IPs, and the steps required to set up and verify Paystack webhooks.","md",{},{"order":66},{"title":190,"description":5595},"reference","-o_9iemLdvxuPMykl-OjaMvfSdnTkcE9oWKU2C9GnoI",1794998077257]