[{"data":1,"prerenderedAt":2776},["ShallowReactive",2],{"navigation":3,"\u002Fapi\u002Fcheckout":72,"\u002Fapi\u002Fcheckout-surround":2771},[4,42,55],{"title":5,"path":6,"stem":7,"children":8,"page":41},"Api","\u002Fapi","api",[9,13,17,21,25,29,33,37],{"title":10,"path":11,"stem":12},"Cart API","\u002Fapi\u002Fcart","api\u002Fcart",{"title":14,"path":15,"stem":16},"Category API","\u002Fapi\u002Fcategory","api\u002Fcategory",{"title":18,"path":19,"stem":20},"Checkout API","\u002Fapi\u002Fcheckout","api\u002Fcheckout",{"title":22,"path":23,"stem":24},"Inventory","\u002Fapi\u002Finventory","api\u002Finventory",{"title":26,"path":27,"stem":28},"Order Numbers","\u002Fapi\u002Forder-numbers","api\u002Forder-numbers",{"title":30,"path":31,"stem":32},"Product API","\u002Fapi\u002Fproduct","api\u002Fproduct",{"title":34,"path":35,"stem":36},"Promotions API","\u002Fapi\u002Fpromotions","api\u002Fpromotions",{"title":38,"path":39,"stem":40},"Taxes","\u002Fapi\u002Ftaxes","api\u002Ftaxes",false,{"title":43,"path":44,"stem":45,"children":46,"page":41},"Getting Started","\u002Fgetting-started","getting-started",[47,51],{"title":48,"path":49,"stem":50},"Admin panel","\u002Fgetting-started\u002Fadmin-panel","getting-started\u002Fadmin-panel",{"title":52,"path":53,"stem":54},"Installation","\u002Fgetting-started\u002Finstallation","getting-started\u002Finstallation",{"title":56,"path":57,"stem":58,"children":59,"page":41},"Tasks","\u002Ftasks","tasks",[60,64,68],{"title":61,"path":62,"stem":63},"Building A Navigation","\u002Ftasks\u002Fbuilding-a-navigation","tasks\u002Fbuilding-a-navigation",{"title":65,"path":66,"stem":67},"Product Detail Page","\u002Ftasks\u002Fproduct-detail-page","tasks\u002Fproduct-detail-page",{"title":69,"path":70,"stem":71},"Product Listing Page","\u002Ftasks\u002Fproduct-listing-page","tasks\u002Fproduct-listing-page",{"id":73,"title":18,"body":74,"description":2765,"extension":2766,"links":2767,"meta":2768,"navigation":199,"path":19,"seo":2769,"stem":20,"__hash__":2770},"docs\u002Fapi\u002Fcheckout.md",{"type":75,"value":76,"toc":2755},"minimark",[77,81,85,88,91,813,818,821,934,937,944,947,964,971,977,1026,1032,1077,1081,1088,1125,1128,1182,1186,1195,1240,1254,1257,1454,1458,1461,1527,1541,1551,1555,1558,1638,1644,1673,1688,1692,1695,1713,1720,1745,1748,1752,1755,1817,1832,1931,1945,1949,1956,2023,2037,2040,2043,2496,2499,2618,2632,2687,2690,2721,2725,2728,2751],[78,79,18],"h1",{"id":80},"checkout-api",[82,83,84],"p",{},"Checkout creates an order from a cart, snapshots its customer, address,\nproduct, price, and applied discount data, reserves finite stock, and asks the\nconfigured payment provider to initiate payment for the total.",[82,86,87],{},"The cart's currency becomes the order currency and is passed to the payment\nprovider alongside the currency-independent price amount.",[82,89,90],{},"Call the checkout action from your application's controller after validating\nthe request:",[92,93,98],"pre",{"className":94,"code":95,"language":96,"meta":97,"style":97},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use Illuminate\\Http\\Request;\nuse Larasell\\Larasell\\Address;\nuse Larasell\\Larasell\\Checkout\\Checkout;\nuse Larasell\\Larasell\\Models\\Cart;\n\nclass CheckoutController\n{\n    public function __construct(private Checkout $checkout) {}\n\n    public function __invoke(Request $request, Cart $cart)\n    {\n        $result = $this->checkout->create($cart, [\n            'customer_email' => $request->string('email')->toString(),\n            'customer_name' => $request->string('name')->toString(),\n            'billing_address' => new Address(\n                country: $request->string('billing_address.country')->toString(),\n                firstName: $request->string('billing_address.first_name')->toString(),\n                lastName: $request->string('billing_address.last_name')->toString(),\n                street: $request->array('billing_address.street'),\n                city: $request->string('billing_address.city')->toString(),\n                postcode: $request->string('billing_address.postcode')->toString(),\n            ),\n            'shipping_address' => $request->array('shipping_address'),\n            'customer_id' => $request->user()?->customer?->getKey(),\n        ], paymentMethod: 'bank_transfer');\n\n        if ($result->requiresRedirect()) {\n            return $result->redirect();\n        }\n\n        return redirect()->route('orders.show', $result->order);\n    }\n}\n","php","",[99,100,101,129,149,171,194,201,212,218,252,257,290,296,329,372,407,428,460,491,522,551,582,613,619,649,684,706,711,735,753,759,764,801,807],"code",{"__ignoreMap":97},[102,103,106,110,114,118,121,123,126],"span",{"class":104,"line":105},"line",1,[102,107,109],{"class":108},"sbssI","use",[102,111,113],{"class":112},"sTEyZ"," Illuminate",[102,115,117],{"class":116},"sMK4o","\\",[102,119,120],{"class":112},"Http",[102,122,117],{"class":116},[102,124,125],{"class":112},"Request",[102,127,128],{"class":116},";\n",[102,130,132,134,137,139,142,144,147],{"class":104,"line":131},2,[102,133,109],{"class":108},[102,135,136],{"class":112}," Larasell",[102,138,117],{"class":116},[102,140,141],{"class":112},"Larasell",[102,143,117],{"class":116},[102,145,146],{"class":112},"Address",[102,148,128],{"class":116},[102,150,152,154,156,158,160,162,165,167,169],{"class":104,"line":151},3,[102,153,109],{"class":108},[102,155,136],{"class":112},[102,157,117],{"class":116},[102,159,141],{"class":112},[102,161,117],{"class":116},[102,163,164],{"class":112},"Checkout",[102,166,117],{"class":116},[102,168,164],{"class":112},[102,170,128],{"class":116},[102,172,174,176,178,180,182,184,187,189,192],{"class":104,"line":173},4,[102,175,109],{"class":108},[102,177,136],{"class":112},[102,179,117],{"class":116},[102,181,141],{"class":112},[102,183,117],{"class":116},[102,185,186],{"class":112},"Models",[102,188,117],{"class":116},[102,190,191],{"class":112},"Cart",[102,193,128],{"class":116},[102,195,197],{"class":104,"line":196},5,[102,198,200],{"emptyLinePlaceholder":199},true,"\n",[102,202,204,208],{"class":104,"line":203},6,[102,205,207],{"class":206},"spNyl","class",[102,209,211],{"class":210},"sBMFI"," CheckoutController\n",[102,213,215],{"class":104,"line":214},7,[102,216,217],{"class":116},"{\n",[102,219,221,224,227,231,234,237,240,243,246,249],{"class":104,"line":220},8,[102,222,223],{"class":206},"    public",[102,225,226],{"class":206}," function",[102,228,230],{"class":229},"s2Zo4"," __construct",[102,232,233],{"class":116},"(",[102,235,236],{"class":206},"private",[102,238,239],{"class":210}," Checkout",[102,241,242],{"class":116}," $",[102,244,245],{"class":112},"checkout",[102,247,248],{"class":116},")",[102,250,251],{"class":116}," {}\n",[102,253,255],{"class":104,"line":254},9,[102,256,200],{"emptyLinePlaceholder":199},[102,258,260,262,264,267,269,271,273,276,279,282,284,287],{"class":104,"line":259},10,[102,261,223],{"class":206},[102,263,226],{"class":206},[102,265,266],{"class":229}," __invoke",[102,268,233],{"class":116},[102,270,125],{"class":210},[102,272,242],{"class":116},[102,274,275],{"class":112},"request",[102,277,278],{"class":116},",",[102,280,281],{"class":210}," Cart",[102,283,242],{"class":116},[102,285,286],{"class":112},"cart",[102,288,289],{"class":116},")\n",[102,291,293],{"class":104,"line":292},11,[102,294,295],{"class":116},"    {\n",[102,297,299,302,305,308,311,313,316,319,322,324,326],{"class":104,"line":298},12,[102,300,301],{"class":116},"        $",[102,303,304],{"class":112},"result ",[102,306,307],{"class":116},"=",[102,309,310],{"class":116}," $this->",[102,312,245],{"class":112},[102,314,315],{"class":116},"->",[102,317,318],{"class":229},"create",[102,320,321],{"class":116},"($",[102,323,286],{"class":112},[102,325,278],{"class":116},[102,327,328],{"class":116}," [\n",[102,330,332,335,339,342,345,347,349,351,354,356,358,361,363,366,369],{"class":104,"line":331},13,[102,333,334],{"class":116},"            '",[102,336,338],{"class":337},"sfazB","customer_email",[102,340,341],{"class":116},"'",[102,343,344],{"class":116}," =>",[102,346,242],{"class":116},[102,348,275],{"class":112},[102,350,315],{"class":116},[102,352,353],{"class":229},"string",[102,355,233],{"class":116},[102,357,341],{"class":116},[102,359,360],{"class":337},"email",[102,362,341],{"class":116},[102,364,365],{"class":116},")->",[102,367,368],{"class":229},"toString",[102,370,371],{"class":116},"(),\n",[102,373,375,377,380,382,384,386,388,390,392,394,396,399,401,403,405],{"class":104,"line":374},14,[102,376,334],{"class":116},[102,378,379],{"class":337},"customer_name",[102,381,341],{"class":116},[102,383,344],{"class":116},[102,385,242],{"class":116},[102,387,275],{"class":112},[102,389,315],{"class":116},[102,391,353],{"class":229},[102,393,233],{"class":116},[102,395,341],{"class":116},[102,397,398],{"class":337},"name",[102,400,341],{"class":116},[102,402,365],{"class":116},[102,404,368],{"class":229},[102,406,371],{"class":116},[102,408,410,412,415,417,419,422,425],{"class":104,"line":409},15,[102,411,334],{"class":116},[102,413,414],{"class":337},"billing_address",[102,416,341],{"class":116},[102,418,344],{"class":116},[102,420,421],{"class":108}," new",[102,423,424],{"class":210}," Address",[102,426,427],{"class":116},"(\n",[102,429,431,434,437,439,441,443,445,447,449,452,454,456,458],{"class":104,"line":430},16,[102,432,433],{"class":210},"                country",[102,435,436],{"class":116},":",[102,438,242],{"class":116},[102,440,275],{"class":112},[102,442,315],{"class":116},[102,444,353],{"class":229},[102,446,233],{"class":116},[102,448,341],{"class":116},[102,450,451],{"class":337},"billing_address.country",[102,453,341],{"class":116},[102,455,365],{"class":116},[102,457,368],{"class":229},[102,459,371],{"class":116},[102,461,463,466,468,470,472,474,476,478,480,483,485,487,489],{"class":104,"line":462},17,[102,464,465],{"class":210},"                firstName",[102,467,436],{"class":116},[102,469,242],{"class":116},[102,471,275],{"class":112},[102,473,315],{"class":116},[102,475,353],{"class":229},[102,477,233],{"class":116},[102,479,341],{"class":116},[102,481,482],{"class":337},"billing_address.first_name",[102,484,341],{"class":116},[102,486,365],{"class":116},[102,488,368],{"class":229},[102,490,371],{"class":116},[102,492,494,497,499,501,503,505,507,509,511,514,516,518,520],{"class":104,"line":493},18,[102,495,496],{"class":210},"                lastName",[102,498,436],{"class":116},[102,500,242],{"class":116},[102,502,275],{"class":112},[102,504,315],{"class":116},[102,506,353],{"class":229},[102,508,233],{"class":116},[102,510,341],{"class":116},[102,512,513],{"class":337},"billing_address.last_name",[102,515,341],{"class":116},[102,517,365],{"class":116},[102,519,368],{"class":229},[102,521,371],{"class":116},[102,523,525,528,530,532,534,536,539,541,543,546,548],{"class":104,"line":524},19,[102,526,527],{"class":210},"                street",[102,529,436],{"class":116},[102,531,242],{"class":116},[102,533,275],{"class":112},[102,535,315],{"class":116},[102,537,538],{"class":229},"array",[102,540,233],{"class":116},[102,542,341],{"class":116},[102,544,545],{"class":337},"billing_address.street",[102,547,341],{"class":116},[102,549,550],{"class":116},"),\n",[102,552,554,557,559,561,563,565,567,569,571,574,576,578,580],{"class":104,"line":553},20,[102,555,556],{"class":210},"                city",[102,558,436],{"class":116},[102,560,242],{"class":116},[102,562,275],{"class":112},[102,564,315],{"class":116},[102,566,353],{"class":229},[102,568,233],{"class":116},[102,570,341],{"class":116},[102,572,573],{"class":337},"billing_address.city",[102,575,341],{"class":116},[102,577,365],{"class":116},[102,579,368],{"class":229},[102,581,371],{"class":116},[102,583,585,588,590,592,594,596,598,600,602,605,607,609,611],{"class":104,"line":584},21,[102,586,587],{"class":210},"                postcode",[102,589,436],{"class":116},[102,591,242],{"class":116},[102,593,275],{"class":112},[102,595,315],{"class":116},[102,597,353],{"class":229},[102,599,233],{"class":116},[102,601,341],{"class":116},[102,603,604],{"class":337},"billing_address.postcode",[102,606,341],{"class":116},[102,608,365],{"class":116},[102,610,368],{"class":229},[102,612,371],{"class":116},[102,614,616],{"class":104,"line":615},22,[102,617,618],{"class":116},"            ),\n",[102,620,622,624,627,629,631,633,635,637,639,641,643,645,647],{"class":104,"line":621},23,[102,623,334],{"class":116},[102,625,626],{"class":337},"shipping_address",[102,628,341],{"class":116},[102,630,344],{"class":116},[102,632,242],{"class":116},[102,634,275],{"class":112},[102,636,315],{"class":116},[102,638,538],{"class":229},[102,640,233],{"class":116},[102,642,341],{"class":116},[102,644,626],{"class":337},[102,646,341],{"class":116},[102,648,550],{"class":116},[102,650,652,654,657,659,661,663,665,667,670,673,676,679,682],{"class":104,"line":651},24,[102,653,334],{"class":116},[102,655,656],{"class":337},"customer_id",[102,658,341],{"class":116},[102,660,344],{"class":116},[102,662,242],{"class":116},[102,664,275],{"class":112},[102,666,315],{"class":116},[102,668,669],{"class":229},"user",[102,671,672],{"class":116},"()?->",[102,674,675],{"class":112},"customer",[102,677,678],{"class":116},"?->",[102,680,681],{"class":229},"getKey",[102,683,371],{"class":116},[102,685,687,690,693,695,698,701,703],{"class":104,"line":686},25,[102,688,689],{"class":116},"        ],",[102,691,692],{"class":210}," paymentMethod",[102,694,436],{"class":116},[102,696,697],{"class":116}," '",[102,699,700],{"class":337},"bank_transfer",[102,702,341],{"class":116},[102,704,705],{"class":116},");\n",[102,707,709],{"class":104,"line":708},26,[102,710,200],{"emptyLinePlaceholder":199},[102,712,714,718,721,724,726,729,732],{"class":104,"line":713},27,[102,715,717],{"class":716},"s7zQu","        if",[102,719,720],{"class":116}," ($",[102,722,723],{"class":112},"result",[102,725,315],{"class":116},[102,727,728],{"class":229},"requiresRedirect",[102,730,731],{"class":116},"())",[102,733,734],{"class":116}," {\n",[102,736,738,741,743,745,747,750],{"class":104,"line":737},28,[102,739,740],{"class":716},"            return",[102,742,242],{"class":116},[102,744,723],{"class":112},[102,746,315],{"class":116},[102,748,749],{"class":229},"redirect",[102,751,752],{"class":116},"();\n",[102,754,756],{"class":104,"line":755},29,[102,757,758],{"class":116},"        }\n",[102,760,762],{"class":104,"line":761},30,[102,763,200],{"emptyLinePlaceholder":199},[102,765,767,770,773,776,779,781,783,786,788,790,792,794,796,799],{"class":104,"line":766},31,[102,768,769],{"class":716},"        return",[102,771,772],{"class":229}," redirect",[102,774,775],{"class":116},"()->",[102,777,778],{"class":229},"route",[102,780,233],{"class":116},[102,782,341],{"class":116},[102,784,785],{"class":337},"orders.show",[102,787,341],{"class":116},[102,789,278],{"class":116},[102,791,242],{"class":116},[102,793,723],{"class":112},[102,795,315],{"class":116},[102,797,798],{"class":112},"order",[102,800,705],{"class":116},[102,802,804],{"class":104,"line":803},32,[102,805,806],{"class":116},"    }\n",[102,808,810],{"class":104,"line":809},33,[102,811,812],{"class":116},"}\n",[814,815,817],"h2",{"id":816},"idempotent-checkout","Idempotent checkout",[82,819,820],{},"Pass a unique key generated for the customer's checkout submission to make\nretries return the original order and payment instead of creating duplicates:",[92,822,824],{"className":94,"code":823,"language":96,"meta":97,"style":97},"$result = $checkout->create(\n    cart: $cart,\n    data: $data,\n    paymentMethod: 'stripe',\n    paymentOptions: $paymentOptions,\n    idempotencyKey: $request->header('Idempotency-Key'),\n);\n",[99,825,826,845,859,873,889,903,930],{"__ignoreMap":97},[102,827,828,831,833,835,837,839,841,843],{"class":104,"line":105},[102,829,830],{"class":116},"$",[102,832,304],{"class":112},[102,834,307],{"class":116},[102,836,242],{"class":116},[102,838,245],{"class":112},[102,840,315],{"class":116},[102,842,318],{"class":229},[102,844,427],{"class":116},[102,846,847,850,852,854,856],{"class":104,"line":131},[102,848,849],{"class":210},"    cart",[102,851,436],{"class":116},[102,853,242],{"class":116},[102,855,286],{"class":112},[102,857,858],{"class":116},",\n",[102,860,861,864,866,868,871],{"class":104,"line":151},[102,862,863],{"class":210},"    data",[102,865,436],{"class":116},[102,867,242],{"class":116},[102,869,870],{"class":112},"data",[102,872,858],{"class":116},[102,874,875,878,880,882,885,887],{"class":104,"line":173},[102,876,877],{"class":210},"    paymentMethod",[102,879,436],{"class":116},[102,881,697],{"class":116},[102,883,884],{"class":337},"stripe",[102,886,341],{"class":116},[102,888,858],{"class":116},[102,890,891,894,896,898,901],{"class":104,"line":196},[102,892,893],{"class":210},"    paymentOptions",[102,895,436],{"class":116},[102,897,242],{"class":116},[102,899,900],{"class":112},"paymentOptions",[102,902,858],{"class":116},[102,904,905,908,910,912,914,916,919,921,923,926,928],{"class":104,"line":203},[102,906,907],{"class":210},"    idempotencyKey",[102,909,436],{"class":116},[102,911,242],{"class":116},[102,913,275],{"class":112},[102,915,315],{"class":116},[102,917,918],{"class":229},"header",[102,920,233],{"class":116},[102,922,341],{"class":116},[102,924,925],{"class":337},"Idempotency-Key",[102,927,341],{"class":116},[102,929,550],{"class":116},[102,931,932],{"class":104,"line":214},[102,933,705],{"class":116},[82,935,936],{},"Keys must be non-empty strings of at most 255 characters. Generate a new key\nfor each intentional checkout submission and retain it when retrying a request\nafter a timeout or lost response. Do not derive it from the cart ID, because a\ncart may be used for more than one intentional checkout over its lifetime.",[82,938,939,940,943],{},"Larasell stores a fingerprint of the cart, customer input, payment method, and\npayment options. Reusing a key with different input throws an\n",[99,941,942],{},"InvalidArgumentException",". Concurrent requests using the same key and input\nresolve to the same order and payment.",[82,945,946],{},"Payment providers may be called again with the same persisted payment when an\nidempotent checkout is retried. Providers must therefore use the payment ID as\ntheir provider-side idempotency identity. If provider communication throws,\nLarasell keeps the local payment pending because its remote outcome is unknown\nand rethrows the exception. Retry checkout with the same key to recover the\nprovider operation.",[82,948,949,951,952,955,956,959,960,963],{},[99,950,656],{}," is optional. Leave it ",[99,953,954],{},"null"," for guest checkout. When the buyer\nis signed in, pass the related ",[99,957,958],{},"Customer"," id (",[99,961,962],{},"$user->customer","), not\nthe Laravel user id. The email,\nname, addresses, product name, slug, SKU, barcode, and prices are always copied\nto the order, so later changes to customer or product records do not rewrite\norder history.",[82,965,966,967,970],{},"Applicable promotions are recalculated during checkout. Their identifiers,\nnames, totals, and product or shipping allocations are stored on the order.\nSee the ",[968,969,34],"a",{"href":35}," for the snapshot structure.",[82,972,973,974,976],{},"Taxes are recalculated authoritatively during checkout. Provisional or\nunavailable tax stops checkout, while successful calculations are stored on the\norder, its items, and shipping. See ",[968,975,38],{"href":39}," for configuration,\nestimate handling, and tax snapshot fields.",[82,978,979,980,982,983,986,987,986,990,986,993,986,996,999,1000,1003,1004,1006,1007,858,1010,986,1013,986,1015,986,1018,1021,1022,1025],{},"Both addresses accept an ",[99,981,146],{}," value object or an associative array. An\naddress requires ",[99,984,985],{},"country",", ",[99,988,989],{},"first_name",[99,991,992],{},"last_name",[99,994,995],{},"street",[99,997,998],{},"city",", and\n",[99,1001,1002],{},"postcode",". ",[99,1005,995],{}," may be a string or an ordered array of lines. ",[99,1008,1009],{},"title",[99,1011,1012],{},"state",[99,1014,360],{},[99,1016,1017],{},"phone",[99,1019,1020],{},"company",", and ",[99,1023,1024],{},"tax_id"," are optional. All values are\nstored in the order snapshot.",[82,1027,1028,1029,1031],{},"Order addresses always return ",[99,1030,146],{}," value objects, regardless of which input form\nwas used:",[92,1033,1035],{"className":94,"code":1034,"language":96,"meta":97,"style":97},"$result->order->shipping_address->street;\n$result->order->shipping_address->country;\n",[99,1036,1037,1057],{"__ignoreMap":97},[102,1038,1039,1041,1043,1045,1047,1049,1051,1053,1055],{"class":104,"line":105},[102,1040,830],{"class":116},[102,1042,723],{"class":112},[102,1044,315],{"class":116},[102,1046,798],{"class":112},[102,1048,315],{"class":116},[102,1050,626],{"class":112},[102,1052,315],{"class":116},[102,1054,995],{"class":112},[102,1056,128],{"class":116},[102,1058,1059,1061,1063,1065,1067,1069,1071,1073,1075],{"class":104,"line":131},[102,1060,830],{"class":116},[102,1062,723],{"class":112},[102,1064,315],{"class":116},[102,1066,798],{"class":112},[102,1068,315],{"class":116},[102,1070,626],{"class":112},[102,1072,315],{"class":116},[102,1074,985],{"class":112},[102,1076,128],{"class":116},[814,1078,1080],{"id":1079},"order-status","Order status",[82,1082,1083,1084,1087],{},"New orders start as ",[99,1085,1086],{},"pending_payment",". The built-in cash and bank transfer\nmethods remain pending until payment is recorded manually. Supported order\ntransitions are:",[1089,1090,1091,1107,1116],"ul",{},[1092,1093,1094,1096,1097,986,1100,1103,1104],"li",{},[99,1095,1086],{}," to ",[99,1098,1099],{},"paid",[99,1101,1102],{},"payment_failed",", or ",[99,1105,1106],{},"cancelled",[1092,1108,1109,1096,1111,1113,1114],{},[99,1110,1102],{},[99,1112,1086],{}," or ",[99,1115,1106],{},[1092,1117,1118,1096,1120,1113,1123],{},[99,1119,1099],{},[99,1121,1122],{},"fulfilled",[99,1124,1106],{},[82,1126,1127],{},"Use the model method to enforce these transitions:",[92,1129,1131],{"className":94,"code":1130,"language":96,"meta":97,"style":97},"use Larasell\\Larasell\\Enums\\OrderStatus;\n\n$order->transitionTo(OrderStatus::Fulfilled);\n",[99,1132,1133,1155,1159],{"__ignoreMap":97},[102,1134,1135,1137,1139,1141,1143,1145,1148,1150,1153],{"class":104,"line":105},[102,1136,109],{"class":108},[102,1138,136],{"class":112},[102,1140,117],{"class":116},[102,1142,141],{"class":112},[102,1144,117],{"class":116},[102,1146,1147],{"class":112},"Enums",[102,1149,117],{"class":116},[102,1151,1152],{"class":112},"OrderStatus",[102,1154,128],{"class":116},[102,1156,1157],{"class":104,"line":131},[102,1158,200],{"emptyLinePlaceholder":199},[102,1160,1161,1163,1165,1167,1170,1172,1174,1177,1180],{"class":104,"line":151},[102,1162,830],{"class":116},[102,1164,798],{"class":112},[102,1166,315],{"class":116},[102,1168,1169],{"class":229},"transitionTo",[102,1171,233],{"class":116},[102,1173,1152],{"class":210},[102,1175,1176],{"class":116},"::",[102,1178,1179],{"class":112},"Fulfilled",[102,1181,705],{"class":116},[814,1183,1185],{"id":1184},"payment-methods","Payment methods",[82,1187,1188,1189,1113,1192,1194],{},"Cash is the default method. Pass ",[99,1190,1191],{},"cash",[99,1193,700],{}," as the third checkout\nargument to select a method explicitly:",[92,1196,1198],{"className":94,"code":1197,"language":96,"meta":97,"style":97},"$result = $checkout->create($cart, $data, paymentMethod: 'cash');\n",[99,1199,1200],{"__ignoreMap":97},[102,1201,1202,1204,1206,1208,1210,1212,1214,1216,1218,1220,1222,1224,1226,1228,1230,1232,1234,1236,1238],{"class":104,"line":105},[102,1203,830],{"class":116},[102,1205,304],{"class":112},[102,1207,307],{"class":116},[102,1209,242],{"class":116},[102,1211,245],{"class":112},[102,1213,315],{"class":116},[102,1215,318],{"class":229},[102,1217,321],{"class":116},[102,1219,286],{"class":112},[102,1221,278],{"class":116},[102,1223,242],{"class":116},[102,1225,870],{"class":112},[102,1227,278],{"class":116},[102,1229,692],{"class":210},[102,1231,436],{"class":116},[102,1233,697],{"class":116},[102,1235,1191],{"class":337},[102,1237,341],{"class":116},[102,1239,705],{"class":116},[82,1241,1242,1243,986,1246,1249,1250,1253],{},"Both built-in methods use the offline driver and create a pending payment. They\ndo not collect money or expose customer-facing payment instructions. The result\ncontains the created ",[99,1244,1245],{},"$result->order",[99,1247,1248],{},"$result->payment",", and an optional\n",[99,1251,1252],{},"$result->action",".",[82,1255,1256],{},"The available methods and default can be changed in the published configuration:",[92,1258,1260],{"className":94,"code":1259,"language":96,"meta":97,"style":97},"use Larasell\\Larasell\\Payments\\OfflinePaymentProvider;\n\n'payments' => [\n    'default' => 'cash',\n    'methods' => [\n        'cash' => [\n            'driver' => 'offline',\n            'provider' => OfflinePaymentProvider::class,\n        ],\n        'bank_transfer' => [\n            'driver' => 'offline',\n            'provider' => OfflinePaymentProvider::class,\n        ],\n    ],\n],\n",[99,1261,1262,1284,1288,1301,1321,1334,1347,1367,1387,1392,1404,1422,1440,1444,1449],{"__ignoreMap":97},[102,1263,1264,1266,1268,1270,1272,1274,1277,1279,1282],{"class":104,"line":105},[102,1265,109],{"class":108},[102,1267,136],{"class":112},[102,1269,117],{"class":116},[102,1271,141],{"class":112},[102,1273,117],{"class":116},[102,1275,1276],{"class":112},"Payments",[102,1278,117],{"class":116},[102,1280,1281],{"class":112},"OfflinePaymentProvider",[102,1283,128],{"class":116},[102,1285,1286],{"class":104,"line":131},[102,1287,200],{"emptyLinePlaceholder":199},[102,1289,1290,1292,1295,1297,1299],{"class":104,"line":151},[102,1291,341],{"class":116},[102,1293,1294],{"class":337},"payments",[102,1296,341],{"class":116},[102,1298,344],{"class":116},[102,1300,328],{"class":116},[102,1302,1303,1306,1309,1311,1313,1315,1317,1319],{"class":104,"line":173},[102,1304,1305],{"class":116},"    '",[102,1307,1308],{"class":337},"default",[102,1310,341],{"class":116},[102,1312,344],{"class":116},[102,1314,697],{"class":116},[102,1316,1191],{"class":337},[102,1318,341],{"class":116},[102,1320,858],{"class":116},[102,1322,1323,1325,1328,1330,1332],{"class":104,"line":196},[102,1324,1305],{"class":116},[102,1326,1327],{"class":337},"methods",[102,1329,341],{"class":116},[102,1331,344],{"class":116},[102,1333,328],{"class":116},[102,1335,1336,1339,1341,1343,1345],{"class":104,"line":203},[102,1337,1338],{"class":116},"        '",[102,1340,1191],{"class":337},[102,1342,341],{"class":116},[102,1344,344],{"class":116},[102,1346,328],{"class":116},[102,1348,1349,1351,1354,1356,1358,1360,1363,1365],{"class":104,"line":214},[102,1350,334],{"class":116},[102,1352,1353],{"class":337},"driver",[102,1355,341],{"class":116},[102,1357,344],{"class":116},[102,1359,697],{"class":116},[102,1361,1362],{"class":337},"offline",[102,1364,341],{"class":116},[102,1366,858],{"class":116},[102,1368,1369,1371,1374,1376,1378,1381,1383,1385],{"class":104,"line":220},[102,1370,334],{"class":116},[102,1372,1373],{"class":337},"provider",[102,1375,341],{"class":116},[102,1377,344],{"class":116},[102,1379,1380],{"class":210}," OfflinePaymentProvider",[102,1382,1176],{"class":116},[102,1384,207],{"class":108},[102,1386,858],{"class":116},[102,1388,1389],{"class":104,"line":254},[102,1390,1391],{"class":116},"        ],\n",[102,1393,1394,1396,1398,1400,1402],{"class":104,"line":259},[102,1395,1338],{"class":116},[102,1397,700],{"class":337},[102,1399,341],{"class":116},[102,1401,344],{"class":116},[102,1403,328],{"class":116},[102,1405,1406,1408,1410,1412,1414,1416,1418,1420],{"class":104,"line":292},[102,1407,334],{"class":116},[102,1409,1353],{"class":337},[102,1411,341],{"class":116},[102,1413,344],{"class":116},[102,1415,697],{"class":116},[102,1417,1362],{"class":337},[102,1419,341],{"class":116},[102,1421,858],{"class":116},[102,1423,1424,1426,1428,1430,1432,1434,1436,1438],{"class":104,"line":298},[102,1425,334],{"class":116},[102,1427,1373],{"class":337},[102,1429,341],{"class":116},[102,1431,344],{"class":116},[102,1433,1380],{"class":210},[102,1435,1176],{"class":116},[102,1437,207],{"class":108},[102,1439,858],{"class":116},[102,1441,1442],{"class":104,"line":331},[102,1443,1391],{"class":116},[102,1445,1446],{"class":104,"line":374},[102,1447,1448],{"class":116},"    ],\n",[102,1450,1451],{"class":104,"line":409},[102,1452,1453],{"class":116},"],\n",[814,1455,1457],{"id":1456},"recording-payment","Recording payment",[82,1459,1460],{},"Use the payment model when an offline payment is received:",[92,1462,1464],{"className":94,"code":1463,"language":96,"meta":97,"style":97},"$payment = $order->payments()->where('status', 'pending')->firstOrFail();\n$payment->markAsPaid();\n",[99,1465,1466,1513],{"__ignoreMap":97},[102,1467,1468,1470,1473,1475,1477,1479,1481,1483,1485,1488,1490,1492,1495,1497,1499,1501,1504,1506,1508,1511],{"class":104,"line":105},[102,1469,830],{"class":116},[102,1471,1472],{"class":112},"payment ",[102,1474,307],{"class":116},[102,1476,242],{"class":116},[102,1478,798],{"class":112},[102,1480,315],{"class":116},[102,1482,1294],{"class":229},[102,1484,775],{"class":116},[102,1486,1487],{"class":229},"where",[102,1489,233],{"class":116},[102,1491,341],{"class":116},[102,1493,1494],{"class":337},"status",[102,1496,341],{"class":116},[102,1498,278],{"class":116},[102,1500,697],{"class":116},[102,1502,1503],{"class":337},"pending",[102,1505,341],{"class":116},[102,1507,365],{"class":116},[102,1509,1510],{"class":229},"firstOrFail",[102,1512,752],{"class":116},[102,1514,1515,1517,1520,1522,1525],{"class":104,"line":131},[102,1516,830],{"class":116},[102,1518,1519],{"class":112},"payment",[102,1521,315],{"class":116},[102,1523,1524],{"class":229},"markAsPaid",[102,1526,752],{"class":116},[82,1528,1529,1530,1533,1534,1537,1538,1540],{},"This atomically marks the payment as ",[99,1531,1532],{},"succeeded",", records ",[99,1535,1536],{},"paid_at",", and moves\nthe order to ",[99,1539,1099],{},". Repeating the action is safe and does not replace the\noriginal payment timestamp. The Larasell admin order page exposes the same\noperation for pending payments.",[82,1542,1543,1544,1547,1548,1550],{},"A pending attempt can instead be cancelled with ",[99,1545,1546],{},"$payment->cancel()",". Cancellation\nonly changes the payment to ",[99,1549,1106],{},"; it does not cancel the order or restore\nstock.",[814,1552,1554],{"id":1553},"refunds","Refunds",[82,1556,1557],{},"Successful payments can be refunded in full or in part. Omitting the amount\nrefunds the remaining amount that is not already refunded or reserved by a\npending refund:",[92,1559,1561],{"className":94,"code":1560,"language":96,"meta":97,"style":97},"use Larasell\\Larasell\\Price;\n\n$refund = $payment->refund();\n$partialRefund = $payment->refund(Price::of(2500));\n",[99,1562,1563,1580,1584,1604],{"__ignoreMap":97},[102,1564,1565,1567,1569,1571,1573,1575,1578],{"class":104,"line":105},[102,1566,109],{"class":108},[102,1568,136],{"class":112},[102,1570,117],{"class":116},[102,1572,141],{"class":112},[102,1574,117],{"class":116},[102,1576,1577],{"class":112},"Price",[102,1579,128],{"class":116},[102,1581,1582],{"class":104,"line":131},[102,1583,200],{"emptyLinePlaceholder":199},[102,1585,1586,1588,1591,1593,1595,1597,1599,1602],{"class":104,"line":151},[102,1587,830],{"class":116},[102,1589,1590],{"class":112},"refund ",[102,1592,307],{"class":116},[102,1594,242],{"class":116},[102,1596,1519],{"class":112},[102,1598,315],{"class":116},[102,1600,1601],{"class":229},"refund",[102,1603,752],{"class":116},[102,1605,1606,1608,1611,1613,1615,1617,1619,1621,1623,1625,1627,1630,1632,1635],{"class":104,"line":173},[102,1607,830],{"class":116},[102,1609,1610],{"class":112},"partialRefund ",[102,1612,307],{"class":116},[102,1614,242],{"class":116},[102,1616,1519],{"class":112},[102,1618,315],{"class":116},[102,1620,1601],{"class":229},[102,1622,233],{"class":116},[102,1624,1577],{"class":210},[102,1626,1176],{"class":116},[102,1628,1629],{"class":229},"of",[102,1631,233],{"class":116},[102,1633,1634],{"class":108},"2500",[102,1636,1637],{"class":116},"));\n",[82,1639,1640,1641,1643],{},"Cash and bank transfer refunds remain ",[99,1642,1503],{}," until their real-world transfer\nis confirmed manually:",[92,1645,1647],{"className":94,"code":1646,"language":96,"meta":97,"style":97},"$refund->markAsSucceeded();\n\u002F\u002F or: $refund->markAsFailed($message);\n\u002F\u002F or: $refund->cancel();\n",[99,1648,1649,1662,1668],{"__ignoreMap":97},[102,1650,1651,1653,1655,1657,1660],{"class":104,"line":105},[102,1652,830],{"class":116},[102,1654,1601],{"class":112},[102,1656,315],{"class":116},[102,1658,1659],{"class":229},"markAsSucceeded",[102,1661,752],{"class":116},[102,1663,1664],{"class":104,"line":131},[102,1665,1667],{"class":1666},"sHwdD","\u002F\u002F or: $refund->markAsFailed($message);\n",[102,1669,1670],{"class":104,"line":151},[102,1671,1672],{"class":1666},"\u002F\u002F or: $refund->cancel();\n",[82,1674,1675,986,1678,999,1681,1684,1685,1687],{},[99,1676,1677],{},"$payment->refundedAmount()",[99,1679,1680],{},"$payment->pendingRefundAmount()",[99,1682,1683],{},"$payment->refundableAmount()"," expose the financial totals. Pending refunds\nreserve their amount so concurrent attempts cannot exceed the successful\npayment. The original payment remains ",[99,1686,1532],{},"; refund records preserve the\nseparate money movement and its history.",[814,1689,1691],{"id":1690},"cancelling-an-order","Cancelling an order",[82,1693,1694],{},"Unpaid orders can be cancelled directly. Pending payments are cancelled and\ninventory deducted during checkout is restored by default.",[92,1696,1698],{"className":94,"code":1697,"language":96,"meta":97,"style":97},"$order->cancel();\n",[99,1699,1700],{"__ignoreMap":97},[102,1701,1702,1704,1706,1708,1711],{"class":104,"line":105},[102,1703,830],{"class":116},[102,1705,798],{"class":112},[102,1707,315],{"class":116},[102,1709,1710],{"class":229},"cancel",[102,1712,752],{"class":116},[82,1714,1715,1716,1719],{},"Pass ",[99,1717,1718],{},"restock: false"," when the inventory should remain deducted:",[92,1721,1723],{"className":94,"code":1722,"language":96,"meta":97,"style":97},"$order->cancel(restock: false);\n",[99,1724,1725],{"__ignoreMap":97},[102,1726,1727,1729,1731,1733,1735,1737,1740,1742],{"class":104,"line":105},[102,1728,830],{"class":116},[102,1730,798],{"class":112},[102,1732,315],{"class":116},[102,1734,1710],{"class":229},[102,1736,233],{"class":116},[102,1738,1739],{"class":210},"restock",[102,1741,436],{"class":116},[102,1743,1744],{"class":116}," false);\n",[82,1746,1747],{},"Paid orders can only be cancelled after every successful payment has been fully\nrefunded. A refund never cancels an order automatically, and fulfilled orders\ncannot be cancelled even after a full refund.\nOrder items store the quantity actually deducted from finite inventory, so\ncancellation does not infer restocking from the product's current settings.",[814,1749,1751],{"id":1750},"lifecycle-events","Lifecycle events",[82,1753,1754],{},"Larasell dispatches dedicated events after their database transaction commits:",[1089,1756,1757,1762,1767,1772,1777,1782,1787,1792,1797,1802,1807,1812],{},[1092,1758,1759],{},[99,1760,1761],{},"Larasell\\Larasell\\Events\\OrderPlaced",[1092,1763,1764],{},[99,1765,1766],{},"Larasell\\Larasell\\Events\\OrderPaid",[1092,1768,1769],{},[99,1770,1771],{},"Larasell\\Larasell\\Events\\OrderFulfilled",[1092,1773,1774],{},[99,1775,1776],{},"Larasell\\Larasell\\Events\\OrderCancelled",[1092,1778,1779],{},[99,1780,1781],{},"Larasell\\Larasell\\Events\\PaymentPending",[1092,1783,1784],{},[99,1785,1786],{},"Larasell\\Larasell\\Events\\PaymentSucceeded",[1092,1788,1789],{},[99,1790,1791],{},"Larasell\\Larasell\\Events\\PaymentFailed",[1092,1793,1794],{},[99,1795,1796],{},"Larasell\\Larasell\\Events\\PaymentCancelled",[1092,1798,1799],{},[99,1800,1801],{},"Larasell\\Larasell\\Events\\RefundPending",[1092,1803,1804],{},[99,1805,1806],{},"Larasell\\Larasell\\Events\\RefundSucceeded",[1092,1808,1809],{},[99,1810,1811],{},"Larasell\\Larasell\\Events\\RefundFailed",[1092,1813,1814],{},[99,1815,1816],{},"Larasell\\Larasell\\Events\\RefundCancelled",[82,1818,1819,1820,1823,1824,1827,1828,1831],{},"Each order event exposes an ",[99,1821,1822],{},"$order"," property and each payment event exposes a\n",[99,1825,1826],{},"$payment"," property. Refund events expose a ",[99,1829,1830],{},"$refund"," property. Idempotent\noperations do not dispatch duplicate events.",[92,1833,1835],{"className":94,"code":1834,"language":96,"meta":97,"style":97},"use Illuminate\\Support\\Facades\\Event;\nuse Larasell\\Larasell\\Events\\OrderPaid;\n\nEvent::listen(OrderPaid::class, function (OrderPaid $event) {\n    \u002F\u002F Handle the paid order through $event->order.\n});\n",[99,1836,1837,1860,1882,1886,1921,1926],{"__ignoreMap":97},[102,1838,1839,1841,1843,1845,1848,1850,1853,1855,1858],{"class":104,"line":105},[102,1840,109],{"class":108},[102,1842,113],{"class":112},[102,1844,117],{"class":116},[102,1846,1847],{"class":112},"Support",[102,1849,117],{"class":116},[102,1851,1852],{"class":112},"Facades",[102,1854,117],{"class":116},[102,1856,1857],{"class":112},"Event",[102,1859,128],{"class":116},[102,1861,1862,1864,1866,1868,1870,1872,1875,1877,1880],{"class":104,"line":131},[102,1863,109],{"class":108},[102,1865,136],{"class":112},[102,1867,117],{"class":116},[102,1869,141],{"class":112},[102,1871,117],{"class":116},[102,1873,1874],{"class":112},"Events",[102,1876,117],{"class":116},[102,1878,1879],{"class":112},"OrderPaid",[102,1881,128],{"class":116},[102,1883,1884],{"class":104,"line":151},[102,1885,200],{"emptyLinePlaceholder":199},[102,1887,1888,1890,1892,1895,1897,1899,1901,1903,1905,1907,1910,1912,1914,1917,1919],{"class":104,"line":173},[102,1889,1857],{"class":210},[102,1891,1176],{"class":116},[102,1893,1894],{"class":229},"listen",[102,1896,233],{"class":116},[102,1898,1879],{"class":210},[102,1900,1176],{"class":116},[102,1902,207],{"class":108},[102,1904,278],{"class":116},[102,1906,226],{"class":206},[102,1908,1909],{"class":116}," (",[102,1911,1879],{"class":210},[102,1913,242],{"class":116},[102,1915,1916],{"class":112},"event",[102,1918,248],{"class":116},[102,1920,734],{"class":116},[102,1922,1923],{"class":104,"line":196},[102,1924,1925],{"class":1666},"    \u002F\u002F Handle the paid order through $event->order.\n",[102,1927,1928],{"class":104,"line":203},[102,1929,1930],{"class":116},"});\n",[82,1932,1933,1934,1937,1938,1941,1942,1253],{},"Custom providers must implement ",[99,1935,1936],{},"Larasell\\Larasell\\Contracts\\PaymentProvider","\nand return a ",[99,1939,1940],{},"Larasell\\Larasell\\Payments\\PaymentResult"," from ",[99,1943,1944],{},"initiate()",[814,1946,1948],{"id":1947},"custom-payment-providers","Custom payment providers",[82,1950,1951,1952,1955],{},"Checkout creates the local order and pending payment before invoking a provider.\nThe provider therefore receives stable models that can be included in provider\nmetadata and idempotency keys. The request's ",[99,1953,1954],{},"$breakdown"," contains final product\nand shipping amounts after discounts, tax, and rounding:",[92,1957,1959],{"className":94,"code":1958,"language":96,"meta":97,"style":97},"$request->breakdown->lines;    \u002F\u002F list of PaymentLine\n$request->breakdown->shipping; \u002F\u002F PaymentLine|null\n$request->breakdown->total;    \u002F\u002F equals $request->payment->amount\n",[99,1960,1961,1983,2003],{"__ignoreMap":97},[102,1962,1963,1965,1967,1969,1972,1974,1977,1980],{"class":104,"line":105},[102,1964,830],{"class":116},[102,1966,275],{"class":112},[102,1968,315],{"class":116},[102,1970,1971],{"class":112},"breakdown",[102,1973,315],{"class":116},[102,1975,1976],{"class":112},"lines",[102,1978,1979],{"class":116},";",[102,1981,1982],{"class":1666},"    \u002F\u002F list of PaymentLine\n",[102,1984,1985,1987,1989,1991,1993,1995,1998,2000],{"class":104,"line":131},[102,1986,830],{"class":116},[102,1988,275],{"class":112},[102,1990,315],{"class":116},[102,1992,1971],{"class":112},[102,1994,315],{"class":116},[102,1996,1997],{"class":112},"shipping",[102,1999,1979],{"class":116},[102,2001,2002],{"class":1666}," \u002F\u002F PaymentLine|null\n",[102,2004,2005,2007,2009,2011,2013,2015,2018,2020],{"class":104,"line":151},[102,2006,830],{"class":116},[102,2008,275],{"class":112},[102,2010,315],{"class":116},[102,2012,1971],{"class":112},[102,2014,315],{"class":116},[102,2016,2017],{"class":112},"total",[102,2019,1979],{"class":116},[102,2021,2022],{"class":1666},"    \u002F\u002F equals $request->payment->amount\n",[82,2024,2025,2028,2029,2032,2033,2036],{},[99,2026,2027],{},"PaymentLine::$amount"," is the final amount for the complete order line, not a\nunit price. Its ",[99,2030,2031],{},"quantity"," preserves the purchased quantity for display and\nmetadata. A provider that multiplies unit prices by quantity should submit the\nline with provider quantity ",[99,2034,2035],{},"1",", using Larasell's line amount directly, and\ninclude the purchased quantity in its label or description. This avoids\nfractional-cent errors when a discount or tax allocation cannot be divided\nevenly across the purchased quantity.",[82,2038,2039],{},"The breakdown constructor validates that all product and shipping amounts add\nup exactly to the persisted payment amount. Providers must not recalculate\ndiscounts or taxes from catalog prices.",[82,2041,2042],{},"The complete request can then be used to create a provider payment:",[92,2044,2046],{"className":94,"code":2045,"language":96,"meta":97,"style":97},"use Larasell\\Larasell\\Contracts\\PaymentProvider;\nuse Larasell\\Larasell\\Models\\Payment;\nuse Larasell\\Larasell\\Payments\\PaymentRequest;\nuse Larasell\\Larasell\\Payments\\PaymentResult;\nuse Larasell\\Larasell\\Payments\\RedirectPaymentAction;\n\nfinal class HostedPaymentProvider implements PaymentProvider\n{\n    public function initiate(PaymentRequest $request): PaymentResult\n    {\n        $session = $this->client->createSession([\n            'amount' => $request->payment->amount->amount(),\n            'currency' => $request->order->currency->value,\n            'success_url' => $request->option('success_url'),\n            'metadata' => [\n                'order_id' => $request->order->getKey(),\n                'payment_id' => $request->payment->getKey(),\n            ],\n            'idempotency_key' => 'payment-'.$request->payment->getKey(),\n        ]);\n\n        return PaymentResult::pending(\n            reference: $session->id,\n            action: new RedirectPaymentAction($session->url),\n        );\n    }\n}\n",[99,2047,2048,2070,2091,2112,2133,2154,2158,2175,2179,2202,2206,2228,2257,2287,2317,2330,2356,2381,2386,2419,2424,2428,2441,2460,2483,2488,2492],{"__ignoreMap":97},[102,2049,2050,2052,2054,2056,2058,2060,2063,2065,2068],{"class":104,"line":105},[102,2051,109],{"class":108},[102,2053,136],{"class":112},[102,2055,117],{"class":116},[102,2057,141],{"class":112},[102,2059,117],{"class":116},[102,2061,2062],{"class":112},"Contracts",[102,2064,117],{"class":116},[102,2066,2067],{"class":112},"PaymentProvider",[102,2069,128],{"class":116},[102,2071,2072,2074,2076,2078,2080,2082,2084,2086,2089],{"class":104,"line":131},[102,2073,109],{"class":108},[102,2075,136],{"class":112},[102,2077,117],{"class":116},[102,2079,141],{"class":112},[102,2081,117],{"class":116},[102,2083,186],{"class":112},[102,2085,117],{"class":116},[102,2087,2088],{"class":112},"Payment",[102,2090,128],{"class":116},[102,2092,2093,2095,2097,2099,2101,2103,2105,2107,2110],{"class":104,"line":151},[102,2094,109],{"class":108},[102,2096,136],{"class":112},[102,2098,117],{"class":116},[102,2100,141],{"class":112},[102,2102,117],{"class":116},[102,2104,1276],{"class":112},[102,2106,117],{"class":116},[102,2108,2109],{"class":112},"PaymentRequest",[102,2111,128],{"class":116},[102,2113,2114,2116,2118,2120,2122,2124,2126,2128,2131],{"class":104,"line":173},[102,2115,109],{"class":108},[102,2117,136],{"class":112},[102,2119,117],{"class":116},[102,2121,141],{"class":112},[102,2123,117],{"class":116},[102,2125,1276],{"class":112},[102,2127,117],{"class":116},[102,2129,2130],{"class":112},"PaymentResult",[102,2132,128],{"class":116},[102,2134,2135,2137,2139,2141,2143,2145,2147,2149,2152],{"class":104,"line":196},[102,2136,109],{"class":108},[102,2138,136],{"class":112},[102,2140,117],{"class":116},[102,2142,141],{"class":112},[102,2144,117],{"class":116},[102,2146,1276],{"class":112},[102,2148,117],{"class":116},[102,2150,2151],{"class":112},"RedirectPaymentAction",[102,2153,128],{"class":116},[102,2155,2156],{"class":104,"line":203},[102,2157,200],{"emptyLinePlaceholder":199},[102,2159,2160,2163,2166,2169,2172],{"class":104,"line":214},[102,2161,2162],{"class":206},"final",[102,2164,2165],{"class":206}," class",[102,2167,2168],{"class":210}," HostedPaymentProvider",[102,2170,2171],{"class":206}," implements",[102,2173,2174],{"class":210}," PaymentProvider\n",[102,2176,2177],{"class":104,"line":220},[102,2178,217],{"class":116},[102,2180,2181,2183,2185,2188,2190,2192,2194,2196,2199],{"class":104,"line":254},[102,2182,223],{"class":206},[102,2184,226],{"class":206},[102,2186,2187],{"class":229}," initiate",[102,2189,233],{"class":116},[102,2191,2109],{"class":210},[102,2193,242],{"class":116},[102,2195,275],{"class":112},[102,2197,2198],{"class":116},"):",[102,2200,2201],{"class":210}," PaymentResult\n",[102,2203,2204],{"class":104,"line":259},[102,2205,295],{"class":116},[102,2207,2208,2210,2213,2215,2217,2220,2222,2225],{"class":104,"line":292},[102,2209,301],{"class":116},[102,2211,2212],{"class":112},"session ",[102,2214,307],{"class":116},[102,2216,310],{"class":116},[102,2218,2219],{"class":112},"client",[102,2221,315],{"class":116},[102,2223,2224],{"class":229},"createSession",[102,2226,2227],{"class":116},"([\n",[102,2229,2230,2232,2235,2237,2239,2241,2243,2245,2247,2249,2251,2253,2255],{"class":104,"line":298},[102,2231,334],{"class":116},[102,2233,2234],{"class":337},"amount",[102,2236,341],{"class":116},[102,2238,344],{"class":116},[102,2240,242],{"class":116},[102,2242,275],{"class":112},[102,2244,315],{"class":116},[102,2246,1519],{"class":112},[102,2248,315],{"class":116},[102,2250,2234],{"class":112},[102,2252,315],{"class":116},[102,2254,2234],{"class":229},[102,2256,371],{"class":116},[102,2258,2259,2261,2264,2266,2268,2270,2272,2274,2276,2278,2280,2282,2285],{"class":104,"line":331},[102,2260,334],{"class":116},[102,2262,2263],{"class":337},"currency",[102,2265,341],{"class":116},[102,2267,344],{"class":116},[102,2269,242],{"class":116},[102,2271,275],{"class":112},[102,2273,315],{"class":116},[102,2275,798],{"class":112},[102,2277,315],{"class":116},[102,2279,2263],{"class":112},[102,2281,315],{"class":116},[102,2283,2284],{"class":112},"value",[102,2286,858],{"class":116},[102,2288,2289,2291,2294,2296,2298,2300,2302,2304,2307,2309,2311,2313,2315],{"class":104,"line":374},[102,2290,334],{"class":116},[102,2292,2293],{"class":337},"success_url",[102,2295,341],{"class":116},[102,2297,344],{"class":116},[102,2299,242],{"class":116},[102,2301,275],{"class":112},[102,2303,315],{"class":116},[102,2305,2306],{"class":229},"option",[102,2308,233],{"class":116},[102,2310,341],{"class":116},[102,2312,2293],{"class":337},[102,2314,341],{"class":116},[102,2316,550],{"class":116},[102,2318,2319,2321,2324,2326,2328],{"class":104,"line":409},[102,2320,334],{"class":116},[102,2322,2323],{"class":337},"metadata",[102,2325,341],{"class":116},[102,2327,344],{"class":116},[102,2329,328],{"class":116},[102,2331,2332,2335,2338,2340,2342,2344,2346,2348,2350,2352,2354],{"class":104,"line":430},[102,2333,2334],{"class":116},"                '",[102,2336,2337],{"class":337},"order_id",[102,2339,341],{"class":116},[102,2341,344],{"class":116},[102,2343,242],{"class":116},[102,2345,275],{"class":112},[102,2347,315],{"class":116},[102,2349,798],{"class":112},[102,2351,315],{"class":116},[102,2353,681],{"class":229},[102,2355,371],{"class":116},[102,2357,2358,2360,2363,2365,2367,2369,2371,2373,2375,2377,2379],{"class":104,"line":462},[102,2359,2334],{"class":116},[102,2361,2362],{"class":337},"payment_id",[102,2364,341],{"class":116},[102,2366,344],{"class":116},[102,2368,242],{"class":116},[102,2370,275],{"class":112},[102,2372,315],{"class":116},[102,2374,1519],{"class":112},[102,2376,315],{"class":116},[102,2378,681],{"class":229},[102,2380,371],{"class":116},[102,2382,2383],{"class":104,"line":493},[102,2384,2385],{"class":116},"            ],\n",[102,2387,2388,2390,2393,2395,2397,2399,2402,2405,2407,2409,2411,2413,2415,2417],{"class":104,"line":524},[102,2389,334],{"class":116},[102,2391,2392],{"class":337},"idempotency_key",[102,2394,341],{"class":116},[102,2396,344],{"class":116},[102,2398,697],{"class":116},[102,2400,2401],{"class":337},"payment-",[102,2403,2404],{"class":116},"'.",[102,2406,830],{"class":116},[102,2408,275],{"class":112},[102,2410,315],{"class":116},[102,2412,1519],{"class":112},[102,2414,315],{"class":116},[102,2416,681],{"class":229},[102,2418,371],{"class":116},[102,2420,2421],{"class":104,"line":553},[102,2422,2423],{"class":116},"        ]);\n",[102,2425,2426],{"class":104,"line":584},[102,2427,200],{"emptyLinePlaceholder":199},[102,2429,2430,2432,2435,2437,2439],{"class":104,"line":615},[102,2431,769],{"class":716},[102,2433,2434],{"class":210}," PaymentResult",[102,2436,1176],{"class":116},[102,2438,1503],{"class":229},[102,2440,427],{"class":116},[102,2442,2443,2446,2448,2450,2453,2455,2458],{"class":104,"line":621},[102,2444,2445],{"class":210},"            reference",[102,2447,436],{"class":116},[102,2449,242],{"class":116},[102,2451,2452],{"class":112},"session",[102,2454,315],{"class":116},[102,2456,2457],{"class":112},"id",[102,2459,858],{"class":116},[102,2461,2462,2465,2467,2469,2472,2474,2476,2478,2481],{"class":104,"line":651},[102,2463,2464],{"class":210},"            action",[102,2466,436],{"class":116},[102,2468,421],{"class":108},[102,2470,2471],{"class":210}," RedirectPaymentAction",[102,2473,321],{"class":116},[102,2475,2452],{"class":112},[102,2477,315],{"class":116},[102,2479,2480],{"class":112},"url",[102,2482,550],{"class":116},[102,2484,2485],{"class":104,"line":686},[102,2486,2487],{"class":116},"        );\n",[102,2489,2490],{"class":104,"line":708},[102,2491,806],{"class":116},[102,2493,2494],{"class":104,"line":713},[102,2495,812],{"class":116},[82,2497,2498],{},"Provider-specific checkout values can be passed as the fourth argument:",[92,2500,2502],{"className":94,"code":2501,"language":96,"meta":97,"style":97},"$result = $checkout->create(\n    $cart,\n    $data,\n    paymentMethod: 'hosted',\n    paymentOptions: [\n        'success_url' => route('checkout.success'),\n        'cancel_url' => route('checkout.cancel'),\n    ],\n);\n",[99,2503,2504,2522,2531,2539,2554,2562,2586,2610,2614],{"__ignoreMap":97},[102,2505,2506,2508,2510,2512,2514,2516,2518,2520],{"class":104,"line":105},[102,2507,830],{"class":116},[102,2509,304],{"class":112},[102,2511,307],{"class":116},[102,2513,242],{"class":116},[102,2515,245],{"class":112},[102,2517,315],{"class":116},[102,2519,318],{"class":229},[102,2521,427],{"class":116},[102,2523,2524,2527,2529],{"class":104,"line":131},[102,2525,2526],{"class":116},"    $",[102,2528,286],{"class":112},[102,2530,858],{"class":116},[102,2532,2533,2535,2537],{"class":104,"line":151},[102,2534,2526],{"class":116},[102,2536,870],{"class":112},[102,2538,858],{"class":116},[102,2540,2541,2543,2545,2547,2550,2552],{"class":104,"line":173},[102,2542,877],{"class":210},[102,2544,436],{"class":116},[102,2546,697],{"class":116},[102,2548,2549],{"class":337},"hosted",[102,2551,341],{"class":116},[102,2553,858],{"class":116},[102,2555,2556,2558,2560],{"class":104,"line":196},[102,2557,893],{"class":210},[102,2559,436],{"class":116},[102,2561,328],{"class":116},[102,2563,2564,2566,2568,2570,2572,2575,2577,2579,2582,2584],{"class":104,"line":203},[102,2565,1338],{"class":116},[102,2567,2293],{"class":337},[102,2569,341],{"class":116},[102,2571,344],{"class":116},[102,2573,2574],{"class":229}," route",[102,2576,233],{"class":116},[102,2578,341],{"class":116},[102,2580,2581],{"class":337},"checkout.success",[102,2583,341],{"class":116},[102,2585,550],{"class":116},[102,2587,2588,2590,2593,2595,2597,2599,2601,2603,2606,2608],{"class":104,"line":214},[102,2589,1338],{"class":116},[102,2591,2592],{"class":337},"cancel_url",[102,2594,341],{"class":116},[102,2596,344],{"class":116},[102,2598,2574],{"class":229},[102,2600,233],{"class":116},[102,2602,341],{"class":116},[102,2604,2605],{"class":337},"checkout.cancel",[102,2607,341],{"class":116},[102,2609,550],{"class":116},[102,2611,2612],{"class":104,"line":220},[102,2613,1448],{"class":116},[102,2615,2616],{"class":104,"line":254},[102,2617,705],{"class":116},[82,2619,2620,2621,986,2624,2627,2628,2631],{},"Providers return ",[99,2622,2623],{},"PaymentResult::pending()",[99,2625,2626],{},"PaymentResult::succeeded()",", or\n",[99,2629,2630],{},"PaymentResult::failed()",". Provider exceptions are recorded as failed payments.\nFor asynchronous providers, use the provider reference from a verified webhook:",[92,2633,2635],{"className":94,"code":2634,"language":96,"meta":97,"style":97},"$payment = Payment::findByProviderReference('hosted', $providerReference);\n$payment->markAsPaid();\n\u002F\u002F or: $payment->markAsFailed($message);\n",[99,2636,2637,2670,2682],{"__ignoreMap":97},[102,2638,2639,2641,2643,2645,2648,2650,2653,2655,2657,2659,2661,2663,2665,2668],{"class":104,"line":105},[102,2640,830],{"class":116},[102,2642,1472],{"class":112},[102,2644,307],{"class":116},[102,2646,2647],{"class":210}," Payment",[102,2649,1176],{"class":116},[102,2651,2652],{"class":229},"findByProviderReference",[102,2654,233],{"class":116},[102,2656,341],{"class":116},[102,2658,2549],{"class":337},[102,2660,341],{"class":116},[102,2662,278],{"class":116},[102,2664,242],{"class":116},[102,2666,2667],{"class":112},"providerReference",[102,2669,705],{"class":116},[102,2671,2672,2674,2676,2678,2680],{"class":104,"line":131},[102,2673,830],{"class":116},[102,2675,1519],{"class":112},[102,2677,315],{"class":116},[102,2679,1524],{"class":229},[102,2681,752],{"class":116},[102,2683,2684],{"class":104,"line":151},[102,2685,2686],{"class":1666},"\u002F\u002F or: $payment->markAsFailed($message);\n",[82,2688,2689],{},"Return and cancellation URLs are storefront navigation only. They must not mark\na payment as paid; asynchronous provider webhooks are authoritative.",[82,2691,2692,2693,2696,2697,2700,2701,2704,2705,986,2708,986,2711,1103,2714,2717,2718,2720],{},"Providers that support refunds additionally implement\n",[99,2694,2695],{},"Larasell\\Larasell\\Contracts\\RefundProvider",". Its ",[99,2698,2699],{},"refund()"," method receives a\npersisted payment and refund through ",[99,2702,2703],{},"RefundRequest"," and returns\n",[99,2706,2707],{},"RefundResult::pending()",[99,2709,2710],{},"succeeded()",[99,2712,2713],{},"failed()",[99,2715,2716],{},"cancelled()",". Providers\nthat only implement ",[99,2719,2067],{}," continue to work, but their payments\ncannot be refunded through Larasell.",[78,2722,2724],{"id":2723},"variant-order-history","Variant order history",[82,2726,2727],{},"Cart lines are checked out against their concrete variant. Checkout locks and\nrevalidates variant availability and stock before creating the order.",[82,2729,2730,2731,2734,2735,986,2738,986,2741,858,2744,1021,2747,2750],{},"Each order item stores a nullable current ",[99,2732,2733],{},"variant()"," relation and immutable\ntransaction data in ",[99,2736,2737],{},"product_sku",[99,2739,2740],{},"product_barcode",[99,2742,2743],{},"unit_price",[99,2745,2746],{},"variant_name",[99,2748,2749],{},"variant_options",". The option snapshot contains stable IDs\nand slugs plus the customer-facing labels used at checkout. Deleting or\nrenaming catalog variants therefore does not rewrite historical orders.",[2752,2753,2754],"style",{},"html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}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 .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":97,"searchDepth":105,"depth":131,"links":2756},[2757,2758,2759,2760,2761,2762,2763,2764],{"id":816,"depth":131,"text":817},{"id":1079,"depth":131,"text":1080},{"id":1184,"depth":131,"text":1185},{"id":1456,"depth":131,"text":1457},{"id":1553,"depth":131,"text":1554},{"id":1690,"depth":131,"text":1691},{"id":1750,"depth":131,"text":1751},{"id":1947,"depth":131,"text":1948},"Turn a cart into an immutable order and collect payment.","md",null,{},{"title":18,"description":2765},"h1mcELyw51uYVF0X2DQJOwJVoPPJj4CB3Kht19aeSPI",[2772,2774],{"title":14,"path":15,"stem":16,"description":2773,"children":-1},"Fetch sibling categories, child categories, descendants, and products from a category.",{"title":22,"path":23,"stem":24,"description":2775,"children":-1},"Reserve, consume, release, and expire product inventory.",1789114878354]