⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.239
Server IP:
13.127.59.50
Server:
Linux ip-172-31-46-210 5.15.0-1033-aws #37~20.04.1-Ubuntu SMP Fri Mar 17 11:39:30 UTC 2023 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.3-4ubuntu2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
ubuntu
/
vendor
/
razorpay
/
razorpay
/
tests
/
View File Name :
OrdersTest.php
<?php namespace Razorpay\Tests; use Razorpay\Api\Request; class OrdersTest extends TestCase { private $orderId = 'order_IEfF1OrQbqxYJq'; public function setUp() { parent::setUp(); } /** * Create order */ public function testCreateOrder() { $data = $this->api->order->create(array('receipt' => '123', 'amount' => 100, 'currency' => 'INR', 'notes'=> array('key1'=> 'value3','key2'=> 'value2'))); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('id',$data->toArray())); } /** * Fetch all orders */ public function testAllOrders() { $data = $this->api->order->all(); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(is_array($data['items'])); } /** * Fetch particular order */ public function testFetchOrder() { $data = $this->api->order->fetch($this->orderId); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('order',$data->toArray())); } /** * Fetch payments for an order */ public function testOrderFetchById() { $data = $this->api->order->fetch($this->orderId)->payments(); $this->assertTrue(is_array($data->toArray())); } /** * Update Order */ public function testUpdateOrder() { $data = $this->api->order->fetch($this->orderId)->edit(array('notes'=> array('notes_key_1'=>'Beam me up Scotty. 1', 'notes_key_2'=>'Engage'))); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('entitiy',$data->toArray())); } }