Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 1.47 KB

Checkouts.md

File metadata and controls

77 lines (56 loc) · 1.47 KB

Checkouts

List of All

/**
* @var Chargily\ChargilyPay\Elements\PaginationElement|null
*/
$items = $chargily_pay->checkouts()->all();

Retrieve

/**
* @var Chargily\ChargilyPay\Elements\CheckoutElement|null
*/
$checkout = $chargily_pay->checkouts()->get("checkout_id");

Create

/**
* @var Chargily\ChargilyPay\Elements\CheckoutElement|null
*/
$checkout = $chargily_pay->checkouts()->create([
    "locale" => "en",//this is language en,ar,fr
    "description" => "This description for checkout",
    "items" => [
        [
            "price" => "price_id",
            "quantity" => 1,
        ],
    ],
    "metadata" => [],
    "success_url" => "Redirect URL after payment completed",
    "failure_url" => "Redirect URL after payment failure",
    "webhook_endpoint" => "Webhook URL TO Recieve payment status",
]);

Expire

  • Change checkout status to expired
/**
* @var Chargily\ChargilyPay\Elements\CheckoutElement|null
*/
$checkout = $chargily_pay->checkouts()->expire("checkout_id");

Retrieve Prices

/**
* @var Chargily\ChargilyPay\Elements\PaginationElement|null
*/
$prices = $chargily_pay->checkouts()->prices("checkout_id");

Chargily\ChargilyPay\Elements\CheckoutElement Relations

  • You can access the checkout prices list directly from Chargily\ChargilyPay\Elements\CheckoutElement
$checkout = $chargily_pay->checkouts()->get("checkout_id");

$prices = $checkout->prices()->all();