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: TransferTest.php
Close
<?php namespace Razorpay\Tests; use Razorpay\Api\Request; class TransferTest extends TestCase { /** * Specify unique transfer id, account id & payment id * for example trf_IEn4KYFgfD7q3F, acc_HjVXbtpSCIxENR & * pay_I7watngocuEY4P */ private $transferId = "trf_JtBI1uAaDdKkpJ"; private $accountId = "acc_HjVXbtpSCIxENR"; private $paymentId = "pay_LdarHRbodWJeXO"; public function setUp(): void { parent::setUp(); } /** * Direct transfers */ public function testDirectTransfer() { $data = $this->api->transfer->create(array('account' => $this->accountId, 'amount' => 500, 'currency' => 'INR')); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('collection',$data->toArray())); } /** * Create transfers from payment */ public function testCreateTransferPayment() { $data = $this->api->payment->fetch($this->paymentId)->transfer(array('transfers' => array(array('account'=> $this->accountId, 'amount'=> '100', 'currency'=>'INR', 'notes'=> array('name'=>'Gaurav Kumar', 'roll_no'=>'IEC2011025'), 'linked_account_notes'=>array('branch'), 'on_hold'=>'1', 'on_hold_until'=>'1671222870')))); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('collection',$data->toArray())); } /** * Create transfers from order */ public function testCreateTransferOrder() { $data = $this->api->order->create(array('amount' => 100,'currency' => 'INR','transfers' => array(array('account' =>$this->accountId,'amount' => 100,'currency' => 'INR','notes' => array('branch' => 'Acme Corp Bangalore North','name' => 'Gaurav Kumar'),'linked_account_notes' => array('branch'),'on_hold' => 1,'on_hold_until' => 1671222870)))); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('transfer',$data->toArray())); } /** * Fetch transfer for a payment */ public function testFetchTransferPayment() { $data = $this->api->payment->fetch($this->paymentId)->transfers(); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('collection',$data->toArray())); } /** * Fetch transfer for an order */ public function testFetchTransferOrder() { $order = $this->api->order->all(); if($order['count'] !== 0){ $data = $this->api->order->fetch($order['items'][0]['id'])->transfers(array('expand[]'=>'transfers')); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('order',$data->toArray())); } } /** * Fetch transfer */ public function testFetchTransfer() { $data = $this->api->transfer->fetch($this->transferId); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('order',$data->toArray())); } /** * Fetch transfers for a settlement */ public function testFetchSettlement() { $settlement = $this->api->transfer->all(array('expand[]'=> 'recipient_settlement')); if($settlement['count'] !== 0){ $data = $this->api->transfer->all(array('recipient_settlement_id'=> $settlement['items'][0]['recipient_settlement_id'])); $this->assertTrue(is_array($data->toArray())); } } /** * Fetch settlement details */ public function testFetchSettlementDetails() { $data = $this->api->transfer->all(array('expand[]'=> 'recipient_settlement')); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('collection',$data->toArray())); } /** * Refund payments and reverse transfer from a linked account */ public function testRefundPayment() { $data = $this->api->payment->fetch($this->paymentId)->refund(array('amount'=> '100')); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('refund',$data->toArray())); } /** * Fetch payments of a linked account */ public function testFetchPaymentsLinkedAccounts() { $data = $this->api->payment->fetch($this->paymentId)->refund(array('amount'=> '100')); $this->assertTrue(is_array($data->toArray())); } /** * Reverse transfers from all linked accounts */ public function testReverseLinkedAccount() { $transfer = $this->api->transfer->create(array('account' => $this->accountId, 'amount' => 100, 'currency' => 'INR')); $data = $this->api->transfer->fetch($transfer->id)->reverse(array('amount'=>100)); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('refund',$data->toArray())); } /** * Hold settlements for transfers */ public function testHoldSettlements() { $data = $this->api->payment->fetch($this->paymentId)->transfer(array('transfers' => array(array('account' => $this->accountId, 'amount' => '100', 'currency' => 'INR', 'on_hold'=>'1')))); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('collection',$data->toArray())); } /** * Modify settlement hold for transfers */ public function testModifySettlements() { $data = $this->api->transfer->fetch($this->transferId)->edit(array('on_hold'=>1)); $this->assertTrue(is_array($data->toArray())); $this->assertTrue(in_array('transfer',$data->toArray())); } }