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: EmandateTest.php
Close
<?php namespace Razorpay\Tests; use Razorpay\Api\Request; class EmandateTest extends TestCase { /** * Specify unique customer id, invoice id & token id * for example cust_IEfAt3ruD4OEzo, inv_IF37M4q6SdOpjT & token_IF1ThOcFC9J7pU */ private $customerId = "cust_IEfAt3ruD4OEzo"; private $invoiceId = "inv_JM5rC3ddYKVWgy"; private $tokenId = "token_IF1ThOcFC9J7pU"; public function setUp(): void { parent::setUp(); } /** * Create customer */ public function testCreateCustomerEmandate() { $data = $this->api->customer->create(array('name' => 'Razorpay User 71', 'email' => 'customer71@razorpay.com', 'contact'=> 9999999999, 'fail_existing'=>'0')); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('customer',$data->toArray())); } /** * Create Order */ public function testCreateOrderEmandate() { $data = $this->api->order->create(array('amount' => 100,'currency' => 'INR','method' => 'emandate','customer_id' => $this->customerId,'receipt' => 'Receipt No. '.time(), 'notes' => array('notes_key_1' => 'Beam me up Scotty','notes_key_2' => 'Engage'),'token' => array('auth_type' => 'netbanking','max_amount' => 9999900,'expire_at' => 4102444799,'notes' => array('notes_key_1' => 'Tea, Earl Grey, Hot','notes_key_2' => 'Tea, Earl Grey⦠decaf.'),'bank_account' => array('beneficiary_name' => 'Gaurav Kumar','account_number' => '1121431121541121','account_type' => 'savings','ifsc_code' => 'HDFC0000001')))); $this->assertTrue(is_array($data->toArray())); $this->assertArrayHasKey('id',$data->toArray()); } /** * Create registration link */ public function testCreateSubscriptionRegistrationEmandate() { $data = $this->api->subscription->createSubscriptionRegistration(array('customer'=>array('name'=>'Gaurav Kumar','email'=>'gaurav.kumar@example.com','contact'=>'9999999999'),'type'=>'link','amount'=>100,'currency'=>'INR','description'=>'Registration Link for Gaurav Kumar','subscription_registration'=>array('method'=>'card','max_amount'=>'500','expire_at'=> strtotime("+1 month") ),'receipt'=>'Receipt No. '.time(),'email_notify'=>1,'sms_notify'=>1,'expire_by'=>strtotime("+1 month"),'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('customer',$data->toArray())); } /** * Send/Resend notifications */ public function testSendNotification() { $data = $this->api->invoice->fetch($this->invoiceId)->notifyBy('sms'); $this->assertTrue(is_array($data)); $this->assertArrayHasKey('success',$data); } /** * Fetch token by payment ID */ public function testFetchTokenByPaymentId() { $payment = $this->api->payment->all(); $data = $this->api->payment->fetch($payment['items'][0]['id']); $this->assertTrue(is_array($data->toArray())); $this->assertArrayHasKey('id',$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())); } }