OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
assets
/
payment
/
vendor
/
razorpay
/
razorpay
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:15 AM
rwxr-xr-x
📄
AddonTest.php
1.64 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
ApiTest.php
1.46 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
CardTest.php
495 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
CoverageTest.php
12.77 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
CustomerTest.php
2.89 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
EmandateTest.php
3.36 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
ExceptionTest.php
2.05 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
FundTest.php
1.04 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
IinTest.php
245 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
InvoiceTest.php
3.36 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
ItemTest.php
2.38 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
OrdersTest.php
1.74 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
PaperNachTest.php
4.52 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
PartnerTest.php
10.28 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
PaymentLinkTest.php
9.43 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
PaymentTest.php
3.63 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
PlanTest.php
1.37 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
QrCodeTest.php
2.5 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
RefundTest.php
2.23 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
RegisterEmandateTest.php
4.78 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
RegisterNachTest.php
4.8 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
RequestTest.php
1.47 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
SettlementTest.php
2.52 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
SignatureVerificationTest.php
1.99 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
SubscriptionTest.php
3.68 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
TestCase.php
625 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
TokenTest.php
3.79 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
TransferTest.php
5.51 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
UpiTest.php
4.92 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
VirtualAccountTest.php
2.98 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
bootstrap.php
70 bytes
05/19/2025 10:07:15 AM
rw-r--r--
Editing: UpiTest.php
Close
<?php namespace Razorpay\Tests; use Razorpay\Api\Request; class UpiTest extends TestCase { /** * Specify unique customer id, invoice id & order id * for example cust_IEfAt3ruD4OEzo, inv_IEfS5mBV49bIQY & * order_IEgBdwYACpMLxd */ private $customerId = "cust_IEfAt3ruD4OEzo"; private $invoiceId = "inv_IEfS5mBV49bIQY"; private $orderId = "order_IEgBdwYACpMLxd"; public function setUp(): void { parent::setUp(); } /** * Create customer */ public function testCreateCustomer() { $data = $this->api->customer->create(array('name' => 'Razorpay User 21', 'email' => 'customer21@razorpay.com','fail_existing'=>'0')); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('customer',$data->toArray())); } /** * 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->assertArrayHasKey('id',$data->toArray()); } /** * Send/Resend notifications */ public function testSendNotification() { $data = $this->api->invoice->fetch($this->invoiceId)->notifyBy('email'); $this->assertTrue(in_array('success',$data)); } /** * Create registration link */ public function testCreateSubscriptionRegistration() { $data = $this->api->subscription->createSubscriptionRegistration(array('customer' => array('name' => 'Gaurav Kumar','email' => 'gaurav.kumar@example.com','contact' => '9123456780'),'amount' => 0,'currency' => 'INR','type' => 'link','description' => '12 p.m. Meals','subscription_registration' => array('method' => 'nach','auth_type' => 'physical','bank_account' => array('beneficiary_name' => 'Gaurav Kumar','account_number' => '11214311215411','account_type' => 'savings','ifsc_code' => 'HDFC0001233'),'nach' => array('form_reference1' => 'Recurring Payment for Gaurav Kumar','form_reference2' => 'Method Paper NACH'),'expire_at' => 1636772800,'max_amount' => 50000),'receipt' => 'Receipt No. '.time(),'sms_notify' => 1,'email_notify' => 1,'expire_by' => 1636772800,'notes' => array('note_key 1' => 'Beam me up Scotty','note_key 2' => 'Tea. Earl Gray. Hot.'))); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('id',$data->toArray())); } /** * Cancel a registration link */ public function testCancelRegistrationLink() { $data = $this->api->subscription->createSubscriptionRegistration(array('customer' => array('name' => 'Gaurav Kumar','email' => 'gaurav.kumar@example.com','contact' => '9123456780'),'amount' => 0,'currency' => 'INR','type' => 'link','description' => '12 p.m. Meals','subscription_registration' => array('method' => 'nach','auth_type' => 'physical','bank_account' => array('beneficiary_name' => 'Gaurav Kumar','account_number' => '11214311215411','account_type' => 'savings','ifsc_code' => 'HDFC0001233'),'nach' => array('form_reference1' => 'Recurring Payment for Gaurav Kumar','form_reference2' => 'Method Paper NACH'),'expire_at' => 1636772800,'max_amount' => 50000),'receipt' => 'Receipt No. '.time(),'sms_notify' => 1,'email_notify' => 1,'expire_by' => 1636772800,'notes' => array('note_key 1' => 'Beam me up Scotty','note_key 2' => 'Tea. Earl Gray. Hot.'))); $data = $this->api->invoice->fetch($data->id)->cancel(); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('invoice_number',$data->toArray())); } /** * Fetch Payment ID using Order ID */ public function testFetchPaymentByorderId() { $data = $this->api->order->fetch($this->orderId)->payments(); $this->assertTrue(is_array($data->toArray())); } /** * Fetch tokens by customer id */ public function testFetchTokenByCustomerId() { $data = $this->api->customer->fetch($this->customerId)->tokens()->all(); $this->assertTrue(is_array($data->toArray())); } /** * Fetch token by payment ID */ public function testFetchTokenByPaymentId() { $payment = $this->api->payment->all(); if(!empty($payment)){ $data = $this->api->payment->fetch($payment['items'][0]['id']); $this->assertTrue(is_array($data->toArray())); $this->assertArrayHasKey('id',$data->toArray()); } } /** * Create an order to charge the customer */ public function testCreateOrderCharge() { $data = $this->api->order->create(array('receipt' => '122', 'amount' => 100, 'currency' => 'INR', 'notes'=> array('key1'=> 'value3','key2'=> 'value2'))); $this->assertTrue(is_array($data->toArray())); $this->assertArrayHasKey('id',$data->toArray()); } }