Skip to content

Commit

Permalink
making Getting Started demo simple
Browse files Browse the repository at this point in the history
  • Loading branch information
n4ss1m committed Oct 26, 2024
1 parent 4849e86 commit 9ab5403
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,41 +59,14 @@ try{
*/
$chargily = new ChargilyPay($credentials);

/**
* Create a new product
*/
$product = $chargily_pay
->products()
->create([
'name' => "My product name",
'description' => "My product description",
]);

/**
* Create a price for the product
*/
$price = $chargily_pay->prices()
->create([
'product_id' => $product->getId(),
'amount' => 2500,
'currency' => 'dzd',
]);

/**
* Create a new checkout for the priced product
*/
$checkout = $chargily_pay->checkouts()
->create([
'locale' => 'en',
'description' => 'This description for checkout or product',
'items' => [
[
'price' => $price->getId(),
'quantity' => 1,
],
],
'amount' => 2500,
'currency' => 'dzd',
'success_url' => "https://example.com/success",
'failure_url' => "https://example.com/failure",
]);

/**
Expand Down

0 comments on commit 9ab5403

Please sign in to comment.