diff --git a/README.md b/README.md index ba490d47..0759e95e 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ composer require razorpay/razorpay:2.* # Usage ```php +require_once $_SERVER["DOCUMENT_ROOT"]."/vendor/autoload.php"; use Razorpay\Api\Api; $api = new Api($api_key, $api_secret); @@ -37,6 +38,9 @@ $order = $api->order->fetch($orderId); $orders = $api->order->all($options); // Returns array of order objects $payments = $api->order->fetch($orderId)->payments(); // Returns array of payment objects against an order +// Checkout +$api->checkout->init($orderId) + // Payments $payments = $api->payment->all($options); // Returns array of payment objects $payment = $api->payment->fetch($id); // Returns a particular payment diff --git a/src/Checkout.php b/src/Checkout.php new file mode 100644 index 00000000..136fba7b --- /dev/null +++ b/src/Checkout.php @@ -0,0 +1,81 @@ + $orderId, + "name" => "DJ Tiesto", + "description" => "Tron Legacy", + "image" => "https://s29.postimg.org/r6dj1g85z/daft_punk.jpg", + "prefill" => [ + "name" => "Daft Punk", + "email" => "customer@merchant.com", + "contact" => "9999999999", + ], + "notes" => [ + "address" => "Hello World", + "merchant_order_id" => "12312321", + ], + "theme" => ["color" => "#F37254"], + ]; + + $json = json_encode($data); + $this->getCheckoutHtml($json); + + } + private function getCheckoutHtml($json) { + $html = ' + + +
+ '; + echo $html; + } + +} +