eco-grow
This commit is contained in:
parent
7a3e5046a8
commit
b200618254
28
add_to_cart.php
Normal file
28
add_to_cart.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
// Check if the product ID is provided
|
||||
if (isset($_POST['product_id'])) {
|
||||
$productId = $_POST['product_id'];
|
||||
|
||||
// Initialize the cart if it doesn't exist
|
||||
if (!isset($_SESSION['cart'])) {
|
||||
$_SESSION['cart'] = [];
|
||||
}
|
||||
|
||||
// Add the product to the cart
|
||||
// For simplicity, we just add the product ID.
|
||||
// In a real application, you might want to add quantity and other details.
|
||||
if (isset($_SESSION['cart'][$productId])) {
|
||||
// If product already in cart, increment quantity
|
||||
$_SESSION['cart'][$productId]++;
|
||||
} else {
|
||||
// Otherwise, add product to cart with quantity 1
|
||||
$_SESSION['cart'][$productId] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect back to the products page
|
||||
header('Location: products.php');
|
||||
exit();
|
||||
?>
|
||||
39
admin_dashboard.php
Normal file
39
admin_dashboard.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
// Ensure user is logged in and is an admin
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'admin') {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Admin Dashboard</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css">
|
||||
</head>
|
||||
<body>
|
||||
<?php include 'includes/header.php'; ?>
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h1>Admin Dashboard</h1>
|
||||
<a href="logout.php" class="btn btn-danger">Logout</a>
|
||||
</div>
|
||||
<hr>
|
||||
<p>Welcome, <?php echo htmlspecialchars($_SESSION['user_name']); ?>!</p>
|
||||
<p>This is the admin dashboard. You can manage users, products, and site settings from here.</p>
|
||||
|
||||
<!-- Add Admin-specific content here -->
|
||||
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
52
assets/css/custom.css
Normal file
52
assets/css/custom.css
Normal file
@ -0,0 +1,52 @@
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-family: 'Poppins', sans-serif;
|
||||
}
|
||||
|
||||
.hero {
|
||||
background: url('https://images.pexels.com/photos/1407322/pexels-photo-1407322.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1') no-repeat center center;
|
||||
background-size: cover;
|
||||
color: white;
|
||||
padding: 150px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
font-size: 4rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hero p {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
text-align: center;
|
||||
margin-bottom: 50px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.product-card, .blog-card {
|
||||
border: none;
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
|
||||
.product-card:hover, .blog-card:hover {
|
||||
transform: translateY(-10px);
|
||||
}
|
||||
|
||||
.product-card-img {
|
||||
height: 200px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.daily-tip {
|
||||
background-color: #f8f9fa;
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
1
assets/js/main.js
Normal file
1
assets/js/main.js
Normal file
@ -0,0 +1 @@
|
||||
// Add any custom JS here in the future
|
||||
120
cart.php
Normal file
120
cart.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
require_once 'products_data.php';
|
||||
|
||||
// Handle quantity updates
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['update_cart'])) {
|
||||
foreach ($_POST['quantities'] as $productId => $quantity) {
|
||||
$quantity = (int)$quantity;
|
||||
if ($quantity > 0) {
|
||||
$_SESSION['cart'][$productId] = $quantity;
|
||||
} else {
|
||||
unset($_SESSION['cart'][$productId]);
|
||||
}
|
||||
}
|
||||
header('Location: cart.php');
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Shopping Cart - EcoGrow</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&family=Roboto:wght@400;500&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php include 'includes/header.php'; ?>
|
||||
|
||||
<header class="bg-success text-white text-center py-5">
|
||||
<div class="container">
|
||||
<h1 class="display-4 fw-bold">Your Shopping Cart</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container my-5">
|
||||
<section id="cart-items">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<?php if (empty($_SESSION['cart'])): ?>
|
||||
<div class="alert alert-info text-center">
|
||||
<p class="mb-0">Your cart is empty.</p>
|
||||
<a href="products.php" class="btn btn-primary mt-3">Continue Shopping</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<form action="cart.php" method="post">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Product</th>
|
||||
<th>Price</th>
|
||||
<th style="width: 120px;">Quantity</th>
|
||||
<th>Total</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$total = 0;
|
||||
foreach ($_SESSION['cart'] as $productId => $quantity) {
|
||||
$product = null;
|
||||
foreach ($products as $p) {
|
||||
if ($p['id'] == $productId) {
|
||||
$product = $p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($product) {
|
||||
$subtotal = $product['price'] * $quantity;
|
||||
$total += $subtotal;
|
||||
echo '<tr>';
|
||||
echo '<td>' . htmlspecialchars($product['name']) . '</td>';
|
||||
echo '<td>$' . htmlspecialchars($product['price']) . '</td>';
|
||||
echo '<td>';
|
||||
echo '<input type="number" name="quantities[' . $productId . ']" value="' . htmlspecialchars($quantity) . '" class="form-control form-control-sm" min="1">';
|
||||
echo '</td>';
|
||||
echo '<td>$' . htmlspecialchars(number_format($subtotal, 2)) . '</td>';
|
||||
echo '<td><a href="remove_from_cart.php?id=' . $productId . '" class="btn btn-danger btn-sm">Remove</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="3" class="text-end">Grand Total:</th>
|
||||
<th colspan="2">$<?php echo htmlspecialchars(number_format($total, 2)); ?></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<div class="d-flex justify-content-between">
|
||||
<a href="products.php" class="btn btn-primary">Continue Shopping</a>
|
||||
<div>
|
||||
<button type="submit" name="update_cart" class="btn btn-info">Update Cart</button>
|
||||
<a href="#" class="btn btn-success">Proceed to Checkout</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="bg-dark text-white pt-5 pb-3">
|
||||
<div class="container text-center">
|
||||
<p class="mb-0">© <?php echo date("Y"); ?> EcoGrow. All Rights Reserved.</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
126
checkout.php
Normal file
126
checkout.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
// Redirect to login if user is not logged in
|
||||
if (!isset($_SESSION["user_id"])) {
|
||||
header("Location: login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
require_once 'db/config.php';
|
||||
require_once 'razorpay-config.php';
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
use Razorpay\Api\Api;
|
||||
|
||||
$product_id = isset($_GET['product_id']) ? (int)$_GET['product_id'] : 0;
|
||||
$product = null;
|
||||
$user = null;
|
||||
|
||||
if ($product_id > 0) {
|
||||
try {
|
||||
// Fetch product details
|
||||
$stmt = db()->prepare("SELECT * FROM products WHERE id = ?");
|
||||
$stmt->execute([$product_id]);
|
||||
$product = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
// Fetch user details
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION["user_id"]]);
|
||||
$user = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
} catch (PDOException $e) {
|
||||
error_log("Database error: " . $e->getMessage());
|
||||
// You might want to show a generic error page here
|
||||
die("Error fetching data. Please try again later.");
|
||||
}
|
||||
}
|
||||
|
||||
if (!$product || !$user) {
|
||||
// Handle case where product or user is not found
|
||||
die("Product or user not found.");
|
||||
}
|
||||
|
||||
$api = new Api($razorpay_key_id, $razorpay_key_secret);
|
||||
|
||||
// Create Razorpay Order
|
||||
$orderData = [
|
||||
'receipt' => 'rcptid_' . uniqid(),
|
||||
'amount' => $product['price'] * 100, // amount in paise
|
||||
'currency' => 'INR',
|
||||
'payment_capture' => 1 // auto capture
|
||||
];
|
||||
|
||||
$razorpayOrder = $api->order->create($orderData);
|
||||
$razorpayOrderId = $razorpayOrder['id'];
|
||||
|
||||
$_SESSION['razorpay_order_id'] = $razorpayOrderId;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Checkout - EcoGrow</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php include 'includes/header.php'; ?>
|
||||
|
||||
<div class="container my-5">
|
||||
<div class="row">
|
||||
<div class="col-md-6 offset-md-3">
|
||||
<div class="card">
|
||||
<div class="card-header bg-success text-white">
|
||||
<h2 class="mb-0">Order Summary</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><?php echo htmlspecialchars($product['name']); ?></h5>
|
||||
<p class="card-text"><?php echo htmlspecialchars($product['description']); ?></p>
|
||||
<p class="card-text fw-bold fs-4">Amount: $<?php echo htmlspecialchars($product['price']); ?></p>
|
||||
<hr>
|
||||
<p><strong>Billed to:</strong></p>
|
||||
<p>Name: <?php echo htmlspecialchars($user['name']); ?></p>
|
||||
<p>Email: <?php echo htmlspecialchars($user['email']); ?></p>
|
||||
<button id="rzp-button1" class="btn btn-primary w-100">Pay with Razorpay</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
|
||||
<script>
|
||||
var options = {
|
||||
"key": "<?php echo $razorpay_key_id; ?>",
|
||||
"amount": "<?php echo $product['price'] * 100; ?>",
|
||||
"currency": "INR",
|
||||
"name": "EcoGrow",
|
||||
"description": "Purchase of <?php echo htmlspecialchars($product['name']); ?>",
|
||||
"image": "https://example.com/your_logo.jpg", // Optional
|
||||
"order_id": "<?php echo $razorpayOrderId; ?>",
|
||||
"handler": function (response){
|
||||
window.location.href = `success.php?payment_id=${response.razorpay_payment_id}&order_id=${response.razorpay_order_id}&signature=${response.razorpay_signature}`;
|
||||
},
|
||||
"prefill": {
|
||||
"name": "<?php echo htmlspecialchars($user['name']); ?>",
|
||||
"email": "<?php echo htmlspecialchars($user['email']); ?>"
|
||||
},
|
||||
"theme": {
|
||||
"color": "#28a745"
|
||||
}
|
||||
};
|
||||
var rzp1 = new Razorpay(options);
|
||||
document.getElementById('rzp-button1').onclick = function(e){
|
||||
rzp1.open();
|
||||
e.preventDefault();
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
5
composer.json
Normal file
5
composer.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"require": {
|
||||
"razorpay/razorpay": "2.*"
|
||||
}
|
||||
}
|
||||
171
composer.lock
generated
Normal file
171
composer.lock
generated
Normal file
@ -0,0 +1,171 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "c03f4a4f5ecea74473fbe486d28b7b25",
|
||||
"packages": [
|
||||
{
|
||||
"name": "razorpay/razorpay",
|
||||
"version": "2.9.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/razorpay/razorpay-php.git",
|
||||
"reference": "c5cf59941eb2d888e80371328d932e6e8266d352"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/razorpay/razorpay-php/zipball/c5cf59941eb2d888e80371328d932e6e8266d352",
|
||||
"reference": "c5cf59941eb2d888e80371328d932e6e8266d352",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"php": ">=7.3",
|
||||
"rmccue/requests": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9",
|
||||
"raveren/kint": "1.*"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"Deprecated.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Razorpay\\Api\\": "src/",
|
||||
"Razorpay\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Abhay Rana",
|
||||
"email": "nemo@razorpay.com",
|
||||
"homepage": "https://captnemo.in",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Shashank Kumar",
|
||||
"email": "shashank@razorpay.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Razorpay PHP Client Library",
|
||||
"homepage": "https://docs.razorpay.com",
|
||||
"keywords": [
|
||||
"api",
|
||||
"client",
|
||||
"php",
|
||||
"razorpay"
|
||||
],
|
||||
"support": {
|
||||
"email": "contact@razorpay.com",
|
||||
"issues": "https://github.com/Razorpay/razorpay-php/issues",
|
||||
"source": "https://github.com/Razorpay/razorpay-php"
|
||||
},
|
||||
"time": "2025-08-05T07:13:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "rmccue/requests",
|
||||
"version": "v2.0.15",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/WordPress/Requests.git",
|
||||
"reference": "877cd66169755899682f1595e057334b40d9d149"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/WordPress/Requests/zipball/877cd66169755899682f1595e057334b40d9d149",
|
||||
"reference": "877cd66169755899682f1595e057334b40d9d149",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"php": ">=5.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
|
||||
"php-parallel-lint/php-console-highlighter": "^0.5.0",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.3.1",
|
||||
"phpcompatibility/php-compatibility": "^9.0",
|
||||
"requests/test-server": "dev-main",
|
||||
"roave/security-advisories": "dev-latest",
|
||||
"squizlabs/php_codesniffer": "^3.6",
|
||||
"wp-coding-standards/wpcs": "^2.0",
|
||||
"yoast/phpunit-polyfills": "^1.0.0"
|
||||
},
|
||||
"suggest": {
|
||||
"art4/requests-psr18-adapter": "For using Requests as a PSR-18 HTTP Client",
|
||||
"ext-curl": "For improved performance",
|
||||
"ext-openssl": "For secure transport support",
|
||||
"ext-zlib": "For improved performance when decompressing encoded streams"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"library/Deprecated.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"WpOrg\\Requests\\": "src/"
|
||||
},
|
||||
"classmap": [
|
||||
"library/Requests.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"ISC"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ryan McCue",
|
||||
"homepage": "https://rmccue.io/"
|
||||
},
|
||||
{
|
||||
"name": "Alain Schlesser",
|
||||
"homepage": "https://github.com/schlessera"
|
||||
},
|
||||
{
|
||||
"name": "Juliette Reinders Folmer",
|
||||
"homepage": "https://github.com/jrfnl"
|
||||
},
|
||||
{
|
||||
"name": "Contributors",
|
||||
"homepage": "https://github.com/WordPress/Requests/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A HTTP library written in PHP, for human beings.",
|
||||
"homepage": "https://requests.ryanmccue.info/",
|
||||
"keywords": [
|
||||
"curl",
|
||||
"fsockopen",
|
||||
"http",
|
||||
"idna",
|
||||
"ipv6",
|
||||
"iri",
|
||||
"sockets"
|
||||
],
|
||||
"support": {
|
||||
"docs": "https://requests.ryanmccue.info/",
|
||||
"issues": "https://github.com/WordPress/Requests/issues",
|
||||
"source": "https://github.com/WordPress/Requests"
|
||||
},
|
||||
"time": "2025-01-21T10:13:31+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
46
dashboard.php
Normal file
46
dashboard.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
// This is the CUSTOMER dashboard.
|
||||
// Only users with the 'customer' role should be here.
|
||||
|
||||
// If user is not logged in, or is not a customer, redirect them.
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'customer') {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$user_name = $_SESSION['user_name'] ?? 'Customer';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Customer Dashboard</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css">
|
||||
</head>
|
||||
<body>
|
||||
<?php include 'includes/header.php'; ?>
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Customer Dashboard</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h1>Welcome, <?php echo htmlspecialchars($user_name); ?>!</h1>
|
||||
<p>This is your personal dashboard. You can view your orders and manage your account here.</p>
|
||||
<p><a href="products.php" class="btn btn-primary">Start Shopping</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
61
db/setup.php
Normal file
61
db/setup.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
|
||||
try {
|
||||
// 1. Connect to MySQL server (without selecting a database)
|
||||
$pdo_server = new PDO('mysql:host='.DB_HOST, DB_USER, DB_PASS, [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
]);
|
||||
|
||||
// 2. Create the database if it doesn't exist
|
||||
$pdo_server->exec("CREATE DATABASE IF NOT EXISTS `".DB_NAME."`");
|
||||
echo "Database '".DB_NAME."' created or already exists.<br>";
|
||||
|
||||
// 3. Connect to the specific database
|
||||
$pdo_db = db(); // Use the original helper function which connects to the DB
|
||||
|
||||
// 4. Create the users table
|
||||
$sql = "
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
email VARCHAR(255) NOT NULL UNIQUE,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
role ENUM('admin', 'vendor', 'customer') NOT NULL DEFAULT 'customer',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
) ENGINE=INNODB;
|
||||
";
|
||||
|
||||
$pdo_db->exec($sql);
|
||||
|
||||
echo "Table 'users' created successfully (if it didn't exist).<br>";
|
||||
|
||||
// Add 'customer' role to existing tables
|
||||
try {
|
||||
$pdo_db->exec("ALTER TABLE users MODIFY COLUMN role ENUM('admin', 'vendor', 'customer') NOT NULL DEFAULT 'customer'");
|
||||
echo "Column 'role' in 'users' table updated successfully to include 'customer'.<br>";
|
||||
} catch (PDOException $e) {
|
||||
// This might fail if the column is already correct, which is fine.
|
||||
echo "Could not alter 'users' table, probably already up-to-date.<br>";
|
||||
}
|
||||
|
||||
// 5. Create the products table
|
||||
$sql_products = "
|
||||
CREATE TABLE IF NOT EXISTS products (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
description TEXT,
|
||||
price DECIMAL(10, 2) NOT NULL,
|
||||
vendor_id INT NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (vendor_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
) ENGINE=INNODB;
|
||||
";
|
||||
|
||||
$pdo_db->exec($sql_products);
|
||||
echo "Table 'products' created successfully (if it didn't exist).<br>";
|
||||
echo "<hr>Setup complete!";
|
||||
|
||||
} catch (PDOException $e) {
|
||||
die("DB SETUP ERROR: ". $e->getMessage());
|
||||
}
|
||||
75
includes/header.php
Normal file
75
includes/header.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
// Calculate cart item count
|
||||
$cart_item_count = isset($_SESSION['cart']) ? count($_SESSION['cart']) : 0;
|
||||
?>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="index.php">My Shop</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav me-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="index.php">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="products.php">Products</a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php if (isset($_SESSION['user_id'])): ?>
|
||||
<?php
|
||||
// Determine the correct dashboard link based on the user's role
|
||||
$dashboard_link = 'dashboard.php'; // Default for customers
|
||||
if (isset($_SESSION['user_role'])) {
|
||||
switch ($_SESSION['user_role']) {
|
||||
case 'admin':
|
||||
$dashboard_link = 'admin_dashboard.php';
|
||||
break;
|
||||
case 'vendor':
|
||||
$dashboard_link = 'vendor_dashboard.php';
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if ($_SESSION['user_role'] === 'customer'): ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="cart.php">
|
||||
<i class="fas fa-shopping-cart"></i> Cart
|
||||
<?php if ($cart_item_count > 0): ?>
|
||||
<span class="badge bg-primary"><?php echo $cart_item_count; ?></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo $dashboard_link; ?>">Dashboard</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="logout.php">Logout</a>
|
||||
</li>
|
||||
<?php else: ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="cart.php">
|
||||
<i class="fas fa-shopping-cart"></i> Cart
|
||||
<?php if ($cart_item_count > 0): ?>
|
||||
<span class="badge bg-primary"><?php echo $cart_item_count; ?></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="login.php">Login</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="register.php">Register</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- Font Awesome for the cart icon -->
|
||||
<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>
|
||||
261
index.php
261
index.php
@ -1,150 +1,123 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
@ini_set('display_errors', '1');
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
?>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php endif; ?>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
@keyframes bg-pan {
|
||||
0% { background-position: 0% 0%; }
|
||||
100% { background-position: 100% 100%; }
|
||||
}
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.loader {
|
||||
margin: 1.25rem auto 1.25rem;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
.hint {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap; border: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
code {
|
||||
background: rgba(0,0,0,0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>EcoGrow</title>
|
||||
<meta name="description" content="EcoGrow is a full-stack, eco-themed eCommerce and community platform.">
|
||||
<meta name="keywords" content="ecogrow, ecommerce, plants, eco-friendly, community, gardening, sustainability, green products, online store, plant-based, eco-awareness, Built with Flatlogic Generator">
|
||||
<meta property="og:title" content="EcoGrow">
|
||||
<meta property="og:description" content="EcoGrow is a full-stack, eco-themed eCommerce and community platform.">
|
||||
<meta property="og:image" content="">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="">
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Roboto:wght@400;500&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
|
||||
<?php include 'includes/header.php'; ?>
|
||||
|
||||
<header class="hero">
|
||||
<div class="container">
|
||||
<h1>Embrace a Greener Lifestyle</h1>
|
||||
<p>Discover sustainable products and join our community of eco-enthusiasts.</p>
|
||||
<a href="products.php" class="btn btn-success btn-lg">Shop Now</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container my-5">
|
||||
<section id="products" class="mb-5">
|
||||
<h2 class="section-title">Best Selling Products</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card product-card">
|
||||
<img src="https://images.pexels.com/photos/998521/pexels-photo-998521.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" class="card-img-top" alt="Product 1">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Organic Houseplant</h5>
|
||||
<p class="card-text">$25.00</p>
|
||||
<a href="#" class="btn btn-success"><i class="fas fa-shopping-cart"></i> Add to Cart</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card product-card">
|
||||
<img src="https://images.pexels.com/photos/1002703/pexels-photo-1002703.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" class="card-img-top" alt="Product 2">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Biodegradable Pots</h5>
|
||||
<p class="card-text">$15.00</p>
|
||||
<a href="#" class="btn btn-success"><i class="fas fa-shopping-cart"></i> Add to Cart</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card product-card">
|
||||
<img src="https://images.pexels.com/photos/2252584/pexels-photo-2252584.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" class="card-img-top" alt="Product 3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Compost Bin</h5>
|
||||
<p class="card-text">$50.00</p>
|
||||
<a href="#" class="btn btn-success"><i class="fas fa-shopping-cart"></i> Add to Cart</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="blog" class="mb-5">
|
||||
<h2 class="section-title">From Our Blog</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card blog-card">
|
||||
<img src="https://images.pexels.com/photos/1671650/pexels-photo-1671650.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" class="card-img-top" alt="Blog 1">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">The Ultimate Guide to Urban Gardening</h5>
|
||||
<p class="card-text">Learn how to create a thriving garden in a small space.</p>
|
||||
<a href="#" class="btn btn-outline-success">Read More</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card blog-card">
|
||||
<img src="https://images.pexels.com/photos/3094215/pexels-photo-3094215.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1" class="card-img-top" alt="Blog 2">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">5 Easy-to-Grow Herbs for Your Kitchen</h5>
|
||||
<p class="card-text">Fresh herbs are just a windowsill away. Here's how to start.</p>
|
||||
<a href="#" class="btn btn-outline-success">Read More</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="tips" class="mb-5">
|
||||
<div class="daily-tip">
|
||||
<h2 class="section-title">Daily Eco Tip</h2>
|
||||
<p class="lead">"Reduce your carbon footprint by choosing to walk or bike for short trips. It's good for you and the planet!"</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</main>
|
||||
|
||||
<footer id="contact" class="bg-dark text-white py-4">
|
||||
<div class="container text-center">
|
||||
<p>© 2025 EcoGrow. All Rights Reserved.</p>
|
||||
<p>
|
||||
<a href="#" class="text-white me-3"><i class="fab fa-facebook-f"></i></a>
|
||||
<a href="#" class="text-white me-3"><i class="fab fa-twitter"></i></a>
|
||||
<a href="#" class="text-white"><i class="fab fa-instagram"></i></a>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
98
login.php
Normal file
98
login.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
require_once 'db/config.php';
|
||||
|
||||
// If user is already logged in, redirect to dashboard
|
||||
if (isset($_SESSION['user_id'])) {
|
||||
header("Location: dashboard.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$message = '';
|
||||
|
||||
if (isset($_GET['registered'])) {
|
||||
$message = 'Registration successful! Please log in.';
|
||||
}
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$email = trim($_POST['email']);
|
||||
$password = $_POST['password'];
|
||||
|
||||
if (empty($email) || empty($password)) {
|
||||
$message = "Please enter both email and password.";
|
||||
} else {
|
||||
try {
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare("SELECT * FROM users WHERE email = ?");
|
||||
$stmt->execute([$email]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
if ($user && password_verify($password, $user['password'])) {
|
||||
// Password is correct, start a new session
|
||||
$_SESSION['user_id'] = $user['id'];
|
||||
$_SESSION['user_name'] = $user['name'];
|
||||
$_SESSION['user_role'] = $user['role'];
|
||||
|
||||
// Redirect to the appropriate dashboard
|
||||
if ($user['role'] === 'admin') {
|
||||
header("Location: admin_dashboard.php");
|
||||
} elseif ($user['role'] === 'vendor') {
|
||||
header("Location: vendor_dashboard.php");
|
||||
} else {
|
||||
header("Location: dashboard.php");
|
||||
}
|
||||
exit;
|
||||
} else {
|
||||
$message = "Invalid email or password.";
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
$message = "Database error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css">
|
||||
</head>
|
||||
<body>
|
||||
<?php include 'includes/header.php'; ?>
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Login</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if ($message): ?>
|
||||
<div class="alert alert-info"><?php echo htmlspecialchars($message); ?></div>
|
||||
<?php endif; ?>
|
||||
<form action="login.php" method="post">
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email Address</label>
|
||||
<input type="email" class="form-control" id="email" name="email" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
20
logout.php
Normal file
20
logout.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
// Unset all of the session variables
|
||||
$_SESSION = array();
|
||||
|
||||
// Destroy the session
|
||||
if (ini_get("session.use_cookies")) {
|
||||
$params = session_get_cookie_params();
|
||||
setcookie(session_name(), '', time() - 42000,
|
||||
$params["path"], $params["domain"],
|
||||
$params["secure"], $params["httponly"]
|
||||
);
|
||||
}
|
||||
|
||||
session_destroy();
|
||||
|
||||
// Redirect to login page with a message
|
||||
header("Location: login.php?logged_out=true");
|
||||
exit;
|
||||
108
products.php
Normal file
108
products.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
require_once 'db/config.php';
|
||||
|
||||
// Fetch all products with their vendor names
|
||||
$products = [];
|
||||
try {
|
||||
$sql = "SELECT p.id, p.name, p.description, p.price, p.image_url, u.name AS vendor_name
|
||||
FROM products p
|
||||
JOIN users u ON p.vendor_id = u.id
|
||||
ORDER BY p.created_at DESC";
|
||||
$stmt = db()->prepare($sql);
|
||||
$stmt->execute();
|
||||
$products = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $e) {
|
||||
// Handle database errors gracefully
|
||||
error_log("Database error: " . $e->getMessage());
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>All Products - EcoGrow</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&family=Roboto:wght@400;500&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php include 'includes/header.php'; ?>
|
||||
|
||||
<header class="bg-success text-white text-center py-5">
|
||||
<div class="container">
|
||||
<h1 class="display-4 fw-bold">Our Products</h1>
|
||||
<p class="lead">Browse our collection of eco-friendly and sustainable products from various vendors.</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container my-5">
|
||||
<section id="all-products">
|
||||
<div class="row">
|
||||
<?php if (empty($products)): ?>
|
||||
<div class="col">
|
||||
<p class="text-center">No products have been added yet. Please check back later!</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($products as $product): ?>
|
||||
<div class="col-lg-3 col-md-4 col-sm-6 mb-4">
|
||||
<div class="card product-card h-100">
|
||||
<img src="<?php echo htmlspecialchars($product['image_url']); ?>" class="card-img-top product-card-img" alt="<?php echo htmlspecialchars($product['name']); ?>">
|
||||
<div class="card-body d-flex flex-column">
|
||||
<h5 class="card-title"><?php echo htmlspecialchars($product['name']); ?></h5>
|
||||
<p class="card-text text-muted mb-2">By <?php echo htmlspecialchars($product['vendor_name']); ?></p>
|
||||
<p class="card-text text-success fw-bold fs-5 mt-auto">$<?php echo htmlspecialchars($product['price']); ?></p>
|
||||
<div class="d-grid gap-2">
|
||||
<form action="add_to_cart.php" method="post">
|
||||
<input type="hidden" name="product_id" value="<?php echo htmlspecialchars($product['id']); ?>">
|
||||
<button type="submit" class="btn btn-primary w-100">Add to Cart</button>
|
||||
</form>
|
||||
<a href="checkout.php?product_id=<?php echo htmlspecialchars($product['id']); ?>" class="btn btn-success w-100">Buy Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="bg-dark text-white pt-5 pb-3">
|
||||
<div class="container text-center">
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-4">
|
||||
<h5 class="text-uppercase">EcoGrow</h5>
|
||||
<p>Your partner in sustainable living. We provide the tools and tips to help you grow a greener future.</p>
|
||||
</div>
|
||||
<div class="col-md-4 mb-4">
|
||||
<h5 class="text-uppercase">Quick Links</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="index.php#hero" class="text-white">Home</a></li>
|
||||
<li><a href="products.php" class="text-white">Shop</a></li>
|
||||
<li><a href="index.php#blog" class="text-white">Blog</a></li>
|
||||
<li><a href="#" class="text-white">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4 mb-4">
|
||||
<h5 class="text-uppercase">Follow Us</h5>
|
||||
<a href="#" class="text-white me-3"><i class="fab fa-facebook-f"></i></a>
|
||||
<a href="#" class="text-white me-3"><i class="fab fa-twitter"></i></a>
|
||||
<a href="#" class="text-white me-3"><i class="fab fa-instagram"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<p class="mb-0">© <?php echo date("Y"); ?> EcoGrow. All Rights Reserved.</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
9
razorpay-config.php
Normal file
9
razorpay-config.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
// razorpay-config.php
|
||||
|
||||
// Replace with your Key ID and Key Secret from the Razorpay Dashboard
|
||||
$razorpay_key_id = 'YOUR_KEY_ID';
|
||||
$razorpay_key_secret = 'YOUR_KEY_SECRET';
|
||||
|
||||
?>
|
||||
92
register.php
Normal file
92
register.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
require_once 'db/config.php';
|
||||
|
||||
$message = '';
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$name = trim($_POST['name']);
|
||||
$email = trim($_POST['email']);
|
||||
$password = $_POST['password'];
|
||||
$role = 'customer'; // Default role for new users
|
||||
|
||||
if (empty($name) || empty($email) || empty($password)) {
|
||||
$message = "Please fill out all fields.";
|
||||
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
$message = "Invalid email format.";
|
||||
} else {
|
||||
try {
|
||||
$pdo = db();
|
||||
|
||||
// Check if email already exists
|
||||
$stmt = $pdo->prepare("SELECT * FROM users WHERE email = ?");
|
||||
$stmt->execute([$email]);
|
||||
if ($stmt->fetch()) {
|
||||
$message = "Email already registered.";
|
||||
} else {
|
||||
// Hash the password for security
|
||||
$password_hash = password_hash($password, PASSWORD_BCRYPT);
|
||||
|
||||
// Insert the new user into the database
|
||||
$stmt = $pdo->prepare("INSERT INTO users (name, email, password, role) VALUES (?, ?, ?, ?)");
|
||||
if ($stmt->execute([$name, $email, $password_hash, $role])) {
|
||||
header("Location: login.php?registered=true");
|
||||
exit;
|
||||
} else {
|
||||
$message = "An error occurred. Please try again.";
|
||||
}
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
// In a real app, you'd log this error, not show it to the user.
|
||||
$message = "Database error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Register</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css">
|
||||
</head>
|
||||
<body>
|
||||
<?php include 'includes/header.php'; ?>
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Register</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if ($message): ?>
|
||||
<div class="alert alert-danger"><?php echo htmlspecialchars($message); ?></div>
|
||||
<?php endif; ?>
|
||||
<form action="register.php" method="post">
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Full Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email Address</label>
|
||||
<input type="email" class="form-control" id="email" name="email" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Register</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
12
remove_from_cart.php
Normal file
12
remove_from_cart.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if (isset($_GET['id'])) {
|
||||
$productId = $_GET['id'];
|
||||
if (isset($_SESSION['cart'][$productId])) {
|
||||
unset($_SESSION['cart'][$productId]);
|
||||
}
|
||||
}
|
||||
|
||||
header('Location: cart.php');
|
||||
exit;
|
||||
80
success.php
Normal file
80
success.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
require_once 'razorpay-config.php';
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
use Razorpay\Api\Api;
|
||||
use Razorpay\Api\Errors\SignatureVerificationError;
|
||||
|
||||
$success = false;
|
||||
$error = "Payment Failed";
|
||||
|
||||
if (empty($_GET['payment_id']) === false)
|
||||
{
|
||||
$api = new Api($razorpay_key_id, $razorpay_key_secret);
|
||||
|
||||
try
|
||||
{
|
||||
// Please note that the razorpay order ID must
|
||||
// come from a trusted source (session here, but
|
||||
// could be database or something else)
|
||||
$attributes = array(
|
||||
'razorpay_order_id' => $_SESSION['razorpay_order_id'],
|
||||
'razorpay_payment_id' => $_GET['payment_id'],
|
||||
'razorpay_signature' => $_GET['signature']
|
||||
);
|
||||
|
||||
$api->utility->verifyPaymentSignature($attributes);
|
||||
$success = true;
|
||||
}
|
||||
catch(SignatureVerificationError $e)
|
||||
{
|
||||
$success = false;
|
||||
$error = 'Razorpay Error : ' . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Payment Status - EcoGrow</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php include 'includes/header.php'; ?>
|
||||
|
||||
<div class="container my-5">
|
||||
<div class="row">
|
||||
<div class="col-md-6 offset-md-3 text-center">
|
||||
<?php if ($success): ?>
|
||||
<div class="card border-success">
|
||||
<div class="card-body">
|
||||
<h1 class="text-success">Payment Successful</h1>
|
||||
<p>Thank you for your purchase!</p>
|
||||
<p><strong>Payment ID:</strong> <?php echo htmlspecialchars($_GET['payment_id']); ?></p>
|
||||
<a href="products.php" class="btn btn-success">Continue Shopping</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="card border-danger">
|
||||
<div class="card-body">
|
||||
<h1 class="text-danger">Payment Failed</h1>
|
||||
<p><?php echo htmlspecialchars($error); ?></p>
|
||||
<a href="products.php" class="btn btn-danger">Try Again</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
22
vendor/autoload.php
vendored
Normal file
22
vendor/autoload.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException($err);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitc03f4a4f5ecea74473fbe486d28b7b25::getLoader();
|
||||
579
vendor/composer/ClassLoader.php
vendored
Normal file
579
vendor/composer/ClassLoader.php
vendored
Normal file
@ -0,0 +1,579 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var string|null */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array<string, list<string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* List of PSR-0 prefixes
|
||||
*
|
||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||
*
|
||||
* @var array<string, array<string, list<string>>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
/** @var bool */
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
/** @var bool */
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var string|null */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var array<string, self>
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param string|null $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Array of classname => path
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $classMap Class to filename map
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
$paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
$paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
|
||||
if (null === $this->vendorDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($prepend) {
|
||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||
} else {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
|
||||
if (null !== $this->vendorDir) {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return true|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||
*
|
||||
* @return array<string, self>
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $ext
|
||||
* @return string|false
|
||||
*/
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath . '\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
||||
396
vendor/composer/InstalledVersions.php
vendored
Normal file
396
vendor/composer/InstalledVersions.php
vendored
Normal file
@ -0,0 +1,396 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
|
||||
* @internal
|
||||
*/
|
||||
private static $selfDir = null;
|
||||
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private static $installedIsLocalDir;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
|
||||
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
|
||||
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
|
||||
// so we have to assume it does not, and that may result in duplicate data being returned when listing
|
||||
// all installed packages for example
|
||||
self::$installedIsLocalDir = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private static function getSelfDir()
|
||||
{
|
||||
if (self::$selfDir === null) {
|
||||
self::$selfDir = strtr(__DIR__, '\\', '/');
|
||||
}
|
||||
|
||||
return self::$selfDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
$copiedLocalDir = false;
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
$selfDir = self::getSelfDir();
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
$vendorDir = strtr($vendorDir, '\\', '/');
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
self::$installedByVendor[$vendorDir] = $required;
|
||||
$installed[] = $required;
|
||||
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
|
||||
self::$installed = $required;
|
||||
self::$installedIsLocalDir = true;
|
||||
}
|
||||
}
|
||||
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
|
||||
$copiedLocalDir = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array() && !$copiedLocalDir) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
||||
21
vendor/composer/LICENSE
vendored
Normal file
21
vendor/composer/LICENSE
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
11
vendor/composer/autoload_classmap.php
vendored
Normal file
11
vendor/composer/autoload_classmap.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'Requests' => $vendorDir . '/rmccue/requests/library/Requests.php',
|
||||
);
|
||||
11
vendor/composer/autoload_files.php
vendored
Normal file
11
vendor/composer/autoload_files.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'941748b3c8cae4466c827dfb5ca9602a' => $vendorDir . '/rmccue/requests/library/Deprecated.php',
|
||||
'13906c19e3d8fcd1341b24ed4d51cf72' => $vendorDir . '/razorpay/razorpay/Deprecated.php',
|
||||
);
|
||||
9
vendor/composer/autoload_namespaces.php
vendored
Normal file
9
vendor/composer/autoload_namespaces.php
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
||||
12
vendor/composer/autoload_psr4.php
vendored
Normal file
12
vendor/composer/autoload_psr4.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'WpOrg\\Requests\\' => array($vendorDir . '/rmccue/requests/src'),
|
||||
'Razorpay\\Tests\\' => array($vendorDir . '/razorpay/razorpay/tests'),
|
||||
'Razorpay\\Api\\' => array($vendorDir . '/razorpay/razorpay/src'),
|
||||
);
|
||||
50
vendor/composer/autoload_real.php
vendored
Normal file
50
vendor/composer/autoload_real.php
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitc03f4a4f5ecea74473fbe486d28b7b25
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Composer\Autoload\ClassLoader
|
||||
*/
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
require __DIR__ . '/platform_check.php';
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc03f4a4f5ecea74473fbe486d28b7b25', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc03f4a4f5ecea74473fbe486d28b7b25', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc03f4a4f5ecea74473fbe486d28b7b25::getInitializer($loader));
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitc03f4a4f5ecea74473fbe486d28b7b25::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
||||
require $file;
|
||||
}
|
||||
}, null, null);
|
||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||
$requireFile($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
55
vendor/composer/autoload_static.php
vendored
Normal file
55
vendor/composer/autoload_static.php
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitc03f4a4f5ecea74473fbe486d28b7b25
|
||||
{
|
||||
public static $files = array (
|
||||
'941748b3c8cae4466c827dfb5ca9602a' => __DIR__ . '/..' . '/rmccue/requests/library/Deprecated.php',
|
||||
'13906c19e3d8fcd1341b24ed4d51cf72' => __DIR__ . '/..' . '/razorpay/razorpay/Deprecated.php',
|
||||
);
|
||||
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'W' =>
|
||||
array (
|
||||
'WpOrg\\Requests\\' => 15,
|
||||
),
|
||||
'R' =>
|
||||
array (
|
||||
'Razorpay\\Tests\\' => 15,
|
||||
'Razorpay\\Api\\' => 13,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'WpOrg\\Requests\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/rmccue/requests/src',
|
||||
),
|
||||
'Razorpay\\Tests\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/razorpay/razorpay/tests',
|
||||
),
|
||||
'Razorpay\\Api\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/razorpay/razorpay/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
'Requests' => __DIR__ . '/..' . '/rmccue/requests/library/Requests.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc03f4a4f5ecea74473fbe486d28b7b25::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc03f4a4f5ecea74473fbe486d28b7b25::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitc03f4a4f5ecea74473fbe486d28b7b25::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
||||
164
vendor/composer/installed.json
vendored
Normal file
164
vendor/composer/installed.json
vendored
Normal file
@ -0,0 +1,164 @@
|
||||
{
|
||||
"packages": [
|
||||
{
|
||||
"name": "razorpay/razorpay",
|
||||
"version": "2.9.2",
|
||||
"version_normalized": "2.9.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/razorpay/razorpay-php.git",
|
||||
"reference": "c5cf59941eb2d888e80371328d932e6e8266d352"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/razorpay/razorpay-php/zipball/c5cf59941eb2d888e80371328d932e6e8266d352",
|
||||
"reference": "c5cf59941eb2d888e80371328d932e6e8266d352",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"php": ">=7.3",
|
||||
"rmccue/requests": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9",
|
||||
"raveren/kint": "1.*"
|
||||
},
|
||||
"time": "2025-08-05T07:13:20+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"Deprecated.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Razorpay\\Api\\": "src/",
|
||||
"Razorpay\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Abhay Rana",
|
||||
"email": "nemo@razorpay.com",
|
||||
"homepage": "https://captnemo.in",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Shashank Kumar",
|
||||
"email": "shashank@razorpay.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "Razorpay PHP Client Library",
|
||||
"homepage": "https://docs.razorpay.com",
|
||||
"keywords": [
|
||||
"api",
|
||||
"client",
|
||||
"php",
|
||||
"razorpay"
|
||||
],
|
||||
"support": {
|
||||
"email": "contact@razorpay.com",
|
||||
"issues": "https://github.com/Razorpay/razorpay-php/issues",
|
||||
"source": "https://github.com/Razorpay/razorpay-php"
|
||||
},
|
||||
"install-path": "../razorpay/razorpay"
|
||||
},
|
||||
{
|
||||
"name": "rmccue/requests",
|
||||
"version": "v2.0.15",
|
||||
"version_normalized": "2.0.15.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/WordPress/Requests.git",
|
||||
"reference": "877cd66169755899682f1595e057334b40d9d149"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/WordPress/Requests/zipball/877cd66169755899682f1595e057334b40d9d149",
|
||||
"reference": "877cd66169755899682f1595e057334b40d9d149",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"php": ">=5.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
|
||||
"php-parallel-lint/php-console-highlighter": "^0.5.0",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.3.1",
|
||||
"phpcompatibility/php-compatibility": "^9.0",
|
||||
"requests/test-server": "dev-main",
|
||||
"roave/security-advisories": "dev-latest",
|
||||
"squizlabs/php_codesniffer": "^3.6",
|
||||
"wp-coding-standards/wpcs": "^2.0",
|
||||
"yoast/phpunit-polyfills": "^1.0.0"
|
||||
},
|
||||
"suggest": {
|
||||
"art4/requests-psr18-adapter": "For using Requests as a PSR-18 HTTP Client",
|
||||
"ext-curl": "For improved performance",
|
||||
"ext-openssl": "For secure transport support",
|
||||
"ext-zlib": "For improved performance when decompressing encoded streams"
|
||||
},
|
||||
"time": "2025-01-21T10:13:31+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"library/Deprecated.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"WpOrg\\Requests\\": "src/"
|
||||
},
|
||||
"classmap": [
|
||||
"library/Requests.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"ISC"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ryan McCue",
|
||||
"homepage": "https://rmccue.io/"
|
||||
},
|
||||
{
|
||||
"name": "Alain Schlesser",
|
||||
"homepage": "https://github.com/schlessera"
|
||||
},
|
||||
{
|
||||
"name": "Juliette Reinders Folmer",
|
||||
"homepage": "https://github.com/jrfnl"
|
||||
},
|
||||
{
|
||||
"name": "Contributors",
|
||||
"homepage": "https://github.com/WordPress/Requests/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A HTTP library written in PHP, for human beings.",
|
||||
"homepage": "https://requests.ryanmccue.info/",
|
||||
"keywords": [
|
||||
"curl",
|
||||
"fsockopen",
|
||||
"http",
|
||||
"idna",
|
||||
"ipv6",
|
||||
"iri",
|
||||
"sockets"
|
||||
],
|
||||
"support": {
|
||||
"docs": "https://requests.ryanmccue.info/",
|
||||
"issues": "https://github.com/WordPress/Requests/issues",
|
||||
"source": "https://github.com/WordPress/Requests"
|
||||
},
|
||||
"install-path": "../rmccue/requests"
|
||||
}
|
||||
],
|
||||
"dev": true,
|
||||
"dev-package-names": []
|
||||
}
|
||||
41
vendor/composer/installed.php
vendored
Normal file
41
vendor/composer/installed.php
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<?php return array(
|
||||
'root' => array(
|
||||
'name' => '__root__',
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '7a3e5046a8cb94c09ee54eb0bc75ff46e0d1d087',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev' => true,
|
||||
),
|
||||
'versions' => array(
|
||||
'__root__' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '7a3e5046a8cb94c09ee54eb0bc75ff46e0d1d087',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'razorpay/razorpay' => array(
|
||||
'pretty_version' => '2.9.2',
|
||||
'version' => '2.9.2.0',
|
||||
'reference' => 'c5cf59941eb2d888e80371328d932e6e8266d352',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../razorpay/razorpay',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'rmccue/requests' => array(
|
||||
'pretty_version' => 'v2.0.15',
|
||||
'version' => '2.0.15.0',
|
||||
'reference' => '877cd66169755899682f1595e057334b40d9d149',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../rmccue/requests',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
),
|
||||
);
|
||||
25
vendor/composer/platform_check.php
vendored
Normal file
25
vendor/composer/platform_check.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
// platform_check.php @generated by Composer
|
||||
|
||||
$issues = array();
|
||||
|
||||
if (!(PHP_VERSION_ID >= 70300)) {
|
||||
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.';
|
||||
}
|
||||
|
||||
if ($issues) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
||||
} elseif (!headers_sent()) {
|
||||
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
||||
}
|
||||
}
|
||||
throw new \RuntimeException(
|
||||
'Composer detected issues in your platform: ' . implode(' ', $issues)
|
||||
);
|
||||
}
|
||||
174
vendor/razorpay/razorpay/.cursorignore
vendored
Normal file
174
vendor/razorpay/razorpay/.cursorignore
vendored
Normal file
@ -0,0 +1,174 @@
|
||||
# Distribution and Environment
|
||||
dist/*
|
||||
build/*
|
||||
venv/*
|
||||
env/*
|
||||
*.env
|
||||
.env.*
|
||||
virtualenv/*
|
||||
.python-version
|
||||
.ruby-version
|
||||
.node-version
|
||||
|
||||
# Logs and Temporary Files
|
||||
*.log
|
||||
*.tsv
|
||||
*.csv
|
||||
*.txt
|
||||
tmp/*
|
||||
temp/*
|
||||
.tmp/*
|
||||
*.temp
|
||||
*.cache
|
||||
.cache/*
|
||||
logs/*
|
||||
|
||||
# Sensitive Data
|
||||
*.sqlite
|
||||
*.sqlite3
|
||||
*.dbsql
|
||||
secrets.*
|
||||
.npmrc
|
||||
.yarnrc
|
||||
.aws/*
|
||||
.config/*
|
||||
|
||||
# Credentials and Keys
|
||||
*.pem
|
||||
*.ppk
|
||||
*.key
|
||||
*.pub
|
||||
*.p12
|
||||
*.pfx
|
||||
*.htpasswd
|
||||
*.keystore
|
||||
*.jks
|
||||
*.truststore
|
||||
*.cer
|
||||
id_rsa*
|
||||
known_hosts
|
||||
authorized_keys
|
||||
.ssh/*
|
||||
.gnupg/*
|
||||
.pgpass
|
||||
|
||||
# Config Files
|
||||
*.conf
|
||||
*.toml
|
||||
*.ini
|
||||
.env.local
|
||||
.env.development
|
||||
.env.test
|
||||
.env.production
|
||||
config/*
|
||||
|
||||
# Database Files
|
||||
*.sql
|
||||
*.db
|
||||
*.dmp
|
||||
*.dump
|
||||
*.backup
|
||||
*.restore
|
||||
*.mdb
|
||||
*.accdb
|
||||
*.realm*
|
||||
|
||||
# Backup and Archive Files
|
||||
*.bak
|
||||
*.backup
|
||||
*.swp
|
||||
*.swo
|
||||
*.swn
|
||||
*~
|
||||
*.old
|
||||
*.orig
|
||||
*.archive
|
||||
*.gz
|
||||
*.zip
|
||||
*.tar
|
||||
*.rar
|
||||
*.7z
|
||||
|
||||
# Compiled and Binary Files
|
||||
*.pyc
|
||||
*.pyo
|
||||
**/__pycache__/**
|
||||
*.class
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
*.dll
|
||||
*.exe
|
||||
*.so
|
||||
*.dylib
|
||||
*.bin
|
||||
*.obj
|
||||
|
||||
# IDE and Editor Files
|
||||
.idea/*
|
||||
*.iml
|
||||
.vscode/*
|
||||
.project
|
||||
.classpath
|
||||
.settings/*
|
||||
*.sublime-*
|
||||
.atom/*
|
||||
.eclipse/*
|
||||
*.code-workspace
|
||||
.history/*
|
||||
|
||||
# Build and Dependency Directories
|
||||
node_modules/*
|
||||
bower_components/*
|
||||
vendor/*
|
||||
packages/*
|
||||
jspm_packages/*
|
||||
.gradle/*
|
||||
target/*
|
||||
out/*
|
||||
|
||||
# Testing and Coverage Files
|
||||
coverage/*
|
||||
.coverage
|
||||
htmlcov/*
|
||||
.pytest_cache/*
|
||||
.tox/*
|
||||
junit.xml
|
||||
test-results/*
|
||||
|
||||
# Mobile Development
|
||||
*.apk
|
||||
*.aab
|
||||
*.ipa
|
||||
*.xcarchive
|
||||
*.provisionprofile
|
||||
google-services.json
|
||||
GoogleService-Info.plist
|
||||
|
||||
# Certificate and Security Files
|
||||
*.crt
|
||||
*.csr
|
||||
*.ovpn
|
||||
*.p7b
|
||||
*.p7s
|
||||
*.pfx
|
||||
*.spc
|
||||
*.stl
|
||||
*.pem.crt
|
||||
ssl/*
|
||||
|
||||
# Container and Infrastructure
|
||||
*.tfstate
|
||||
*.tfstate.backup
|
||||
.terraform/*
|
||||
.vagrant/*
|
||||
docker-compose.override.yml
|
||||
kubernetes/*
|
||||
|
||||
# Design and Media Files (often large and binary)
|
||||
*.psd
|
||||
*.ai
|
||||
*.sketch
|
||||
*.fig
|
||||
*.xd
|
||||
assets/raw/*
|
||||
14
vendor/razorpay/razorpay/.editorconfig
vendored
Normal file
14
vendor/razorpay/razorpay/.editorconfig
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[**.php]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
39
vendor/razorpay/razorpay/.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
39
vendor/razorpay/razorpay/.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
name: feature.md
|
||||
description: Submit a proposal for a new feature
|
||||
title: '[Feature]: '
|
||||
labels: [':rocket: Feature Request']
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
### Thank you for taking the time to suggest a new feature!
|
||||
We kindly ask that you search to see if an issue [already exists](https://github.com/razorpay/razorpay-php/issues?q=is%3Aissue+sort%3Acreated-desc+) for your feature.
|
||||
We are also happy to accept contributions from our users.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: '🚀 Feature Proposal'
|
||||
description:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: solution
|
||||
attributes:
|
||||
label: Suggested Solution
|
||||
description:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: Alternatives
|
||||
description:
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: extra
|
||||
attributes:
|
||||
label: Additional Information
|
||||
description:
|
||||
validations:
|
||||
required: true
|
||||
62
vendor/razorpay/razorpay/.github/ISSUE_TEMPLATE/issue_report.yml
vendored
Normal file
62
vendor/razorpay/razorpay/.github/ISSUE_TEMPLATE/issue_report.yml
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
name: issue.md
|
||||
description: Create a report to help us improve
|
||||
labels: ["issue"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this issue report!
|
||||
- type: textarea
|
||||
id: repro-steps
|
||||
attributes:
|
||||
label: Steps to reproduce the behavior
|
||||
description:
|
||||
placeholder: |
|
||||
1. Fetch a '...'
|
||||
2. Update the '....'
|
||||
3. See error
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected-behavior
|
||||
attributes:
|
||||
label: Expected behavior
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual-behavior
|
||||
attributes:
|
||||
label: Actual behavior
|
||||
description: A clear and concise description of what actually happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: code-snippets
|
||||
attributes:
|
||||
label: Code snippets
|
||||
description: If applicable, add code snippets to help explain your problem.
|
||||
render: Php
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
id: language-version
|
||||
attributes:
|
||||
label: Php version
|
||||
placeholder: Php v7.4
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: lib-version
|
||||
attributes:
|
||||
label: Library version
|
||||
placeholder: razorpay-php v2.8.4
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: Additional Information
|
||||
description: Add any other information about the problem here.
|
||||
validations:
|
||||
required: false
|
||||
8
vendor/razorpay/razorpay/.github/dependabot.yml
vendored
Normal file
8
vendor/razorpay/razorpay/.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: composer
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "04:00"
|
||||
timezone: Asia/Calcutta
|
||||
8
vendor/razorpay/razorpay/.github/pull_request_template.md
vendored
Normal file
8
vendor/razorpay/razorpay/.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
## Note :- Please follow the below points while attaching test cases document link below:
|
||||
### - If label `Tested` is added then test cases document URL is mandatory.
|
||||
### - Link added should be a valid URL and accessible throughout the org.
|
||||
### - If the branch name contains hotfix / revert by default the BVT workflow check will pass.
|
||||
|
||||
| Test Case Document URL |
|
||||
|-----------------------------------------------|
|
||||
| Please paste test case document link here.... |
|
||||
37
vendor/razorpay/razorpay/.github/workflows/ci.yml
vendored
Normal file
37
vendor/razorpay/razorpay/.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- v[0-9]+.[0-9]+.[0-9]+*
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up php 8.0
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.0'
|
||||
- name: 'Create env file'
|
||||
run: |
|
||||
touch ${{ github.workspace }}/tests/.env
|
||||
echo RAZORPAY_API_KEY=${{ secrets.RAZORPAY_API_KEY }} >> ${{ github.workspace }}/tests/.env
|
||||
echo RAZORPAY_API_SECRET=${{ secrets.RAZORPAY_API_SECRET }} >> ${{ github.workspace }}/tests/.env
|
||||
cat ${{ github.workspace }}/tests/.env
|
||||
- name: Install dependencies
|
||||
run: composer self-update && composer install && composer require vlucas/phpdotenv && composer dump-autoload
|
||||
- name: Run tests and collect coverage
|
||||
run: vendor/bin/phpunit ./tests/CoverageTest.php --coverage-clover coverage.xml .
|
||||
env:
|
||||
RAZORPAY_API_KEY: ${{ secrets.RAZORPAY_API_KEY }}
|
||||
RAZORPAY_API_SECRET: ${{ secrets.RAZORPAY_API_SECRET }}
|
||||
RAZORPAY_PARTNER_API_KEY: ${{ secrets.RAZORPAY_PARTNER_API_KEY }}
|
||||
RAZORPAY_PARTNER_API_SECRET: ${{ secrets.RAZORPAY_PARTNER_API_SECRET }}
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
8
vendor/razorpay/razorpay/.github/workflows/genesis.yml
vendored
Normal file
8
vendor/razorpay/razorpay/.github/workflows/genesis.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
name: Quality Checks
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 17 * * *"
|
||||
jobs:
|
||||
Analysis:
|
||||
uses: razorpay/genesis/.github/workflows/quality-checks.yml@master
|
||||
secrets: inherit
|
||||
5
vendor/razorpay/razorpay/.gitignore
vendored
Normal file
5
vendor/razorpay/razorpay/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
composer.lock
|
||||
phpunit.xml
|
||||
vendor/
|
||||
reports/
|
||||
**/.DS_Store
|
||||
0
vendor/razorpay/razorpay/.semgrepignore
vendored
Normal file
0
vendor/razorpay/razorpay/.semgrepignore
vendored
Normal file
45
vendor/razorpay/razorpay/.travis.yml
vendored
Normal file
45
vendor/razorpay/razorpay/.travis.yml
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
dist: precise
|
||||
language: php
|
||||
php:
|
||||
- 7.3
|
||||
- 7.4
|
||||
- 8.0
|
||||
- 8.1
|
||||
|
||||
install: composer install
|
||||
before_script:
|
||||
- cp phpunit.xml.dist phpunit.xml
|
||||
# These two are required in the build step for non-composer-tests
|
||||
- mkdir -p libs
|
||||
- cd libs && wget https://github.com/rmccue/Requests/archive/v2.0.4.zip -O requests.zip && unzip requests.zip && rm requests.zip && cd ..
|
||||
- rm -rf libs/Requests-2.0.4/examples libs/Requests-2.0.4/docs libs/Requests-2.0.4/bin libs/Requests-2.0.4/tests
|
||||
script:
|
||||
# Run a syntax validation check on all PHP files
|
||||
- find . -path ./vendor -prune -o -iname '*.php' |xargs -n1 php -l
|
||||
- ./vendor/bin/phpunit
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
secure: ${{ secrets.TRAVIS_SLACK_NOTIFY }}
|
||||
# We are doing the releases for non-composer folks
|
||||
# So this includes the vendor directory
|
||||
before_deploy:
|
||||
- echo $TRAVIS_TAG > version.txt
|
||||
- cat release.txt |zip -r@ "razorpay-php.zip"
|
||||
deploy:
|
||||
provider: releases
|
||||
# Otherwise, we lose the vendor/ directory
|
||||
skip_cleanup: true
|
||||
api_key:
|
||||
secure: ${{ secrets.TRAVIS_DEPLOY_API_KEY }}
|
||||
# travis doesn't support multi file deployes yet, not that we need them
|
||||
file: razorpay-php.zip
|
||||
on:
|
||||
# Only do the release for one build every tag
|
||||
php: 7.3
|
||||
# GitHub refuses to accept releases that are not tagged
|
||||
tags: true
|
||||
# Allow builds for non-master branches as well
|
||||
all_branches: true
|
||||
# Only do the releases if the repo is not a fork
|
||||
repo: razorpay/razorpay-php
|
||||
270
vendor/razorpay/razorpay/CHANGELOG.md
vendored
Normal file
270
vendor/razorpay/razorpay/CHANGELOG.md
vendored
Normal file
@ -0,0 +1,270 @@
|
||||
# Change Log
|
||||
|
||||
Changelog for Razorpay-PHP SDK. Follows [keepachangelog.com](https://keepachangelog.com/en/1.0.0/) for formatting.
|
||||
|
||||
## Unreleased
|
||||
|
||||
## [2.9.2] - 2025-08-05
|
||||
- fix: Content-Type header leakage in `Order::create()` where setting application/json globally caused subsequent API calls.
|
||||
- fix: Replaced deprecated `get_class()` usage in the `ErrorCode::exists()` method with the __CLASS__ constant to resolve PHP deprecation warnings.
|
||||
|
||||
## [2.9.1] - 2025-03-20
|
||||
feat: Added support for access token based authentication mechanism
|
||||
- Added oauth APIs (getAuthURL, getAccessToken, getRefreshToken, revokeToken)
|
||||
- Added support for onboarding signature generation
|
||||
- Doc updated
|
||||
|
||||
## [2.9.0] - 2023-12-18
|
||||
feat: Added new API endpoints
|
||||
|
||||
* Added support for `addBankAccount`, `deleteBankAccount`, `requestEligibilityCheck` & `fetchEligibility` on customer
|
||||
* Added support for `uploadAccountDoc` & `fetchAccountDoc` on account
|
||||
* Added support for [Dispute](https://razorpay.com/docs/api/disputes/)
|
||||
* Added support for [Document](https://razorpay.com/docs/api/documents/)
|
||||
* Added support for fetch all IINs Supporting native otps & fetch all IINs with business sub-type using `all`
|
||||
* Added support for `viewRtoReview` & `editFulfillment` on order
|
||||
* Added support for fetch a payment (emi/ offer/ card/ upi) using `expandedDetails` on payments
|
||||
* Added support for `uploadStakeholderDoc` & `fetchStakeholderDoc` on stakeholder
|
||||
|
||||
|
||||
## [2.8.7] - 2023-09-11
|
||||
[#357](https://github.com/razorpay/razorpay-php/pull/357) [`b29754f`](https://github.com/razorpay/razorpay-php/commit/b29754f8892e0c2035055cf73fd7ab132de18e52) Chore: Changed Content-Type `application/json` for `order create` API from default `application/x-www-form-urlencoded`
|
||||
|
||||
|
||||
## [2.8.6] - 2023-06-16
|
||||
[#348](https://github.com/razorpay/razorpay-php/pull/348) [`68b2028`](https://github.com/razorpay/razorpay-php/commit/68b2028bafda49af970a098d6d11aa8e5a575d40) feat: Added new API endpoints
|
||||
|
||||
* Added account onboarding API (create, fetch, edit, delete)
|
||||
* Added stakeholders API (create, fetch, fetchAll, edit)
|
||||
* Added product configuration API (requestProductConfiguration, fetch, edit, fetchTnc)
|
||||
* Added webhooks API (create, fetch, fetchAll, edit, delete)
|
||||
* Added token sharing API (create, fetch, delete, processPaymentOnAlternatePAorPG)
|
||||
|
||||
## [2.8.5] - 2022-10-19
|
||||
|
||||
### Added
|
||||
- Update [Request](https://github.com/WordPress/Requests/tree/v2.0.4) library to v2.0.4
|
||||
|
||||
## [2.8.4] - 2022-06-28
|
||||
|
||||
- New APIs for Third party validation (createUpi, validateVpa, fetchPaymentMethods)
|
||||
- Update documentation
|
||||
|
||||
## [2.8.3] - 2022-04-29
|
||||
|
||||
- PHP v8.1 is officially supported
|
||||
- Update [Request](https://github.com/WordPress/Requests/tree/v2.0.0) library to v2.0
|
||||
- Improve documentation
|
||||
- Add PHPUnit v9
|
||||
|
||||
## [2.8.2] - 2022-03-08
|
||||
|
||||
- Change name convention to standard in Unit test
|
||||
- Removed test api key due to security concern from test cases
|
||||
|
||||
## [2.8.1] - 2021-11-08
|
||||
|
||||
### Added
|
||||
|
||||
- Added Item Api
|
||||
- Added Unit Tests
|
||||
|
||||
## [2.8.0][2.8.0] - 2021-10-07
|
||||
|
||||
### Added
|
||||
- QR code end point API [[#235](https://github.com/razorpay/razorpay-php/pull/235)]
|
||||
- Update, cancel, create subscription link,fetch details of a Pending Update,cancel, pause and resume subscription API[[#236](https://github.com/razorpay/razorpay-php/pull/236)]
|
||||
- Smart Collect(Virtual Account) TPV API's [[#238](https://github.com/razorpay/razorpay-php/pull/238)]
|
||||
- Add/Delete TPV Bank Account [[#239](https://github.com/razorpay/razorpay-php/pull/239)]
|
||||
- Card end point api [[#240](https://github.com/razorpay/razorpay-php/pull/240)]
|
||||
- Route end point api [[#241](https://github.com/razorpay/razorpay-php/pull/241)]
|
||||
- Register emandate and charge first payment together [[#245](https://github.com/razorpay/razorpay-php/pull/245)]
|
||||
- PaperNACH/Register NACH and charge first payment together [[#246](https://github.com/razorpay/razorpay-php/pull/246)]
|
||||
- Added payment and Settlements methods [[#247](https://github.com/razorpay/razorpay-php/pull/247)]
|
||||
- Added edit and notify API's for payment links [[#248](https://github.com/razorpay/razorpay-php/pull/248)]
|
||||
- Added fetch, fetch multiple refund,edit and notify API's for refunds [[#250](https://github.com/razorpay/razorpay-php/pull/250)]
|
||||
- Added edit order API [[#251](https://github.com/razorpay/razorpay-php/pull/251)]
|
||||
- Fund API's end point [[#252](https://github.com/razorpay/razorpay-php/pull/252)]
|
||||
- UPI [[#253](https://github.com/razorpay/razorpay-php/pull/253)]
|
||||
- Added payment link paymentverification [[#255](https://github.com/razorpay/razorpay-php/pull/255)]
|
||||
- Update readme file [[#254](https://github.com/razorpay/razorpay-php/pull/254)]
|
||||
|
||||
## [2.7.1][2.7.1] - 2021-09-16
|
||||
|
||||
### Added
|
||||
|
||||
- Added Payment Link end point API [[#233](https://github.com/razorpay/razorpay-php/pull/233)]
|
||||
|
||||
## [2.7.0][2.7.0] - 2021-05-07
|
||||
|
||||
### Added
|
||||
|
||||
- Adds support for payment page enity API [[#224](https://github.com/razorpay/razorpay-php/pull/224)]
|
||||
|
||||
## [2.6.1][2.6.1] - 2021-04-30
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrades [requests](https://github.com/rmccue/Requests/) to v1.8. [[#221](https://github.com/razorpay/razorpay-php/pull/221)]
|
||||
|
||||
## [2.6.0][2.6.0] - 2021-04-05
|
||||
|
||||
### Added
|
||||
|
||||
- Adds support for webhook enity API [[#212](https://github.com/razorpay/razorpay-php/pull/212)]
|
||||
|
||||
## [2.4.0-beta][2.4.0-beta] - 2018-11-28
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrades [requests](https://github.com/rmccue/Requests/) to v1.7. [[#89](https://github.com/razorpay/razorpay-php/pull/89)]
|
||||
- Enforces TLS1.1+ for all requests. Workaround for a bug in RHEL 6. [[#76](https://github.com/razorpay/razorpay-php/pull/76)]
|
||||
|
||||
## [2.3.0][2.3.0] - 2018-09-15
|
||||
|
||||
### Added
|
||||
|
||||
- Add parameters to Subscription Cancel API
|
||||
- Support for fetching Settlements
|
||||
|
||||
## [2.2.1][2.2.1] - 2018-05-28
|
||||
|
||||
### Added
|
||||
|
||||
- Support for fetching all customer entities
|
||||
|
||||
## [2.2.0][2.2.0] - 2017-10-23
|
||||
|
||||
### Added
|
||||
|
||||
- Support for VirtualAccount entity
|
||||
- Support for Subscriptions
|
||||
|
||||
## [2.1.0][2.1.0] - 2017-10-10
|
||||
|
||||
### Added
|
||||
|
||||
- Support for new actions(cancel, notifyBy, edit, issue, delete) on invoices
|
||||
- Removes PHP 5.3 from list of versions to test build against
|
||||
|
||||
## [2.0.2][2.0.2] - 2017-08-03
|
||||
|
||||
### Added
|
||||
|
||||
- Support for creating and fetching Transfers
|
||||
- Support for creating Reversals on transfers
|
||||
|
||||
## [2.0.1][2.0.1] - 2017-07-31
|
||||
|
||||
### Fixed
|
||||
|
||||
- Webhook signature verification
|
||||
- Conditional require of Request class
|
||||
|
||||
## [2.0.0][2.0.0] - 2017-03-07
|
||||
|
||||
### Added
|
||||
|
||||
- Support for custom Application header
|
||||
- Support for card entity
|
||||
- Support for Webhook and Order Signature verification
|
||||
- Support for direct refund creation via Razorpay\Api\Refund::create()
|
||||
- Support for Utility functions via Razorpay\Api\Utility::verifyPaymentSignature and Razorpay\Api\Utility::verifyWebhookSignature
|
||||
- Support for case insensitive error codes
|
||||
- Support for 2xx HTTP status codes
|
||||
|
||||
### Changed
|
||||
|
||||
- Razorpay\Api\Payment::refunds() now returns a Razorpay\Api\Collection object instead of Razorpay\Api\Refund object
|
||||
- Razorpay\Api\Api::$baseUrl, Razorpay\Api\Api::$key and Razorpay\Api\Api::$secret are now `protected` instead of `public`
|
||||
|
||||
## [1.2.9][1.2.9] - 2017-01-03
|
||||
|
||||
### Added
|
||||
|
||||
- Support for creating and fetching Invoices
|
||||
|
||||
## [1.2.8][1.2.8] - 2016-10-12
|
||||
|
||||
### Added
|
||||
|
||||
- Support for Customer and Token entities
|
||||
|
||||
## [1.2.7][1.2.7] - 2016-09-21
|
||||
|
||||
### Added
|
||||
|
||||
- Increases the request timeout to 30 seconds for all requests.
|
||||
|
||||
## [1.2.6][1.2.6] - 2016-03-28
|
||||
|
||||
### Added
|
||||
|
||||
- Adds better tracing when client is not able to recognize server response.
|
||||
|
||||
## [1.2.5][1.2.5] - 2016-03-28
|
||||
|
||||
### Added
|
||||
|
||||
- Add support for overriding request headers via setHeader
|
||||
|
||||
## [1.2.3][1.2.3] - 2016-02-24
|
||||
|
||||
### Added
|
||||
|
||||
- Add support for Orders
|
||||
|
||||
## [1.2.2][1.2.2] - 2016-02-17
|
||||
|
||||
### Changed
|
||||
|
||||
- Razorpay\Api\Request::checkErrors is now `protected` instead of `private`
|
||||
- The final build is now leaner and includes just requests, instead of entire vendor directory
|
||||
|
||||
## [1.2.1][1.2.1] - 2016-01-21
|
||||
|
||||
### Added
|
||||
|
||||
- Add version.txt in release with current git tag
|
||||
- This changelog file
|
||||
- `Api\Request::getHeaders()` method
|
||||
|
||||
## [1.2.0][1.2.0] - 2015-10-23
|
||||
|
||||
### Added
|
||||
|
||||
- Add version string to User Agent
|
||||
|
||||
### Changed
|
||||
|
||||
- New release process that pushes pre-packaged zip files to GitHub
|
||||
|
||||
## 1.0.0 - 2015-01-18
|
||||
|
||||
### Added
|
||||
|
||||
- Initial Release
|
||||
|
||||
[unreleased]: https://github.com/razorpay/razorpay-php/compare/2.5.0...HEAD
|
||||
[1.2.1]: https://github.com/razorpay/razorpay-php/compare/1.2.0...1.2.1
|
||||
[1.2.0]: https://github.com/razorpay/razorpay-php/compare/1.1.0...1.2.0
|
||||
[1.2.2]: https://github.com/razorpay/razorpay-php/compare/1.2.1...1.2.2
|
||||
[1.2.3]: https://github.com/razorpay/razorpay-php/compare/1.2.2...1.2.3
|
||||
[1.2.4]: https://github.com/razorpay/razorpay-php/compare/1.2.3...1.2.4
|
||||
[1.2.5]: https://github.com/razorpay/razorpay-php/compare/1.2.4...1.2.5
|
||||
[1.2.6]: https://github.com/razorpay/razorpay-php/compare/1.2.5...1.2.6
|
||||
[1.2.7]: https://github.com/razorpay/razorpay-php/compare/1.2.6...1.2.7
|
||||
[1.2.8]: https://github.com/razorpay/razorpay-php/compare/1.2.7...1.2.8
|
||||
[1.2.9]: https://github.com/razorpay/razorpay-php/compare/1.2.8...1.2.9
|
||||
[2.0.0]: https://github.com/razorpay/razorpay-php/compare/1.2.9...2.0.0
|
||||
[2.0.1]: https://github.com/razorpay/razorpay-php/compare/2.0.0...2.0.1
|
||||
[2.0.2]: https://github.com/razorpay/razorpay-php/compare/2.0.1...2.0.2
|
||||
[2.1.0]: https://github.com/razorpay/razorpay-php/compare/2.0.2...2.1.0
|
||||
[2.2.0]: https://github.com/razorpay/razorpay-php/compare/2.1.0...2.2.0
|
||||
[2.2.1]: https://github.com/razorpay/razorpay-php/compare/2.2.0...2.2.1
|
||||
[2.3.0]: https://github.com/razorpay/razorpay-php/compare/2.2.1...2.3.0
|
||||
[2.4.0-beta]: https://github.com/razorpay/razorpay-php/compare/2.3.0...2.4.0-beta
|
||||
[2.5.0]: https://github.com/razorpay/razorpay-php/compare/2.4.0-beta...2.5.0
|
||||
[2.8.0]: https://github.com/razorpay/razorpay-php/compare/2.7.1...2.8.0
|
||||
[2.8.1]: https://github.com/razorpay/razorpay-php/compare/2.8.0...2.8.1
|
||||
[2.8.2]: https://github.com/razorpay/razorpay-php/compare/2.8.0...2.8.2
|
||||
20
vendor/razorpay/razorpay/Deprecated.php
vendored
Normal file
20
vendor/razorpay/razorpay/Deprecated.php
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Backwards compatibility layer for Requests.
|
||||
*
|
||||
* Allows for Composer to autoload the old PSR-0 classes via the custom autoloader.
|
||||
* This prevents issues with _extending final classes_ (which was the previous solution).
|
||||
*
|
||||
* Please see the Changelog for the 2.0.4 release for upgrade notes.
|
||||
*
|
||||
* @package Requests
|
||||
*
|
||||
* @deprecated 2.0.4 Use the PSR-4 class names instead.
|
||||
*/
|
||||
define("REQUESTS_SILENCE_PSR0_DEPRECATIONS",true);
|
||||
|
||||
if (class_exists('WpOrg\Requests\Autoload') === false) {
|
||||
require_once __DIR__. 'libs/Requests-2.0.4/src/Autoload.php';
|
||||
}
|
||||
|
||||
WpOrg\Requests\Autoload::register();
|
||||
7
vendor/razorpay/razorpay/LICENSE
vendored
Normal file
7
vendor/razorpay/razorpay/LICENSE
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
Copyright 2019 Razorpay
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
116
vendor/razorpay/razorpay/README.md
vendored
Normal file
116
vendor/razorpay/razorpay/README.md
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
# razorpay-php
|
||||
|
||||
[](https://travis-ci.org/razorpay/razorpay-php) [](https://packagist.org/packages/razorpay/razorpay#2.8.0) [](https://packagist.org/packages/razorpay/razorpay)
|
||||
|
||||
Official PHP library for [Razorpay API](https://docs.razorpay.com/docs/payments).
|
||||
|
||||
Read up here for getting started and understanding the payment flow with Razorpay: <https://docs.razorpay.com/docs/getting-started>
|
||||
|
||||
### Prerequisites
|
||||
- A minimum of PHP 7.3 upto 8.1
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
- If your project using composer, run the below command
|
||||
|
||||
```
|
||||
composer require razorpay/razorpay:2.*
|
||||
```
|
||||
|
||||
- If you are not using composer, download the latest release from [the releases section](https://github.com/razorpay/razorpay-php/releases).
|
||||
**You should download the `razorpay-php.zip` file**.
|
||||
After that, include `Razorpay.php` in your application and you can use the API as usual.
|
||||
|
||||
##Note:
|
||||
This PHP library follows the following practices:
|
||||
|
||||
- Namespaced under `Razorpay\Api`
|
||||
- API throws exceptions instead of returning errors
|
||||
- Options are passed as an array instead of multiple arguments wherever possible
|
||||
- All requests and responses are communicated over JSON
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation of Razorpay's API and their usage is available at <https://docs.razorpay.com>
|
||||
|
||||
## Basic Usage
|
||||
|
||||
Instantiate the razorpay php instance with `key_id` & `key_secret`. You can obtain the keys from the dashboard app ([https://dashboard.razorpay.com/#/app/keys](https://dashboard.razorpay.com/#/app/keys))
|
||||
|
||||
```php
|
||||
use Razorpay\Api\Api;
|
||||
|
||||
$api = new Api($api_key, $api_secret);
|
||||
```
|
||||
|
||||
### Using Access Token
|
||||
Instantiate the razorpay instance with `access_token`. The `access_token` can be obtained only in case if you are a platform partner. For more information, refer page - https://razorpay.com/docs/partners/platform/.
|
||||
|
||||
```php
|
||||
use Razorpay\Api\Api;
|
||||
|
||||
$api = new Api(null, null, "<ACCESS_TOKEN>");
|
||||
```
|
||||
|
||||
The resources can be accessed via the `$api` object. All the methods invocations follows the following pattern
|
||||
|
||||
```php
|
||||
// $api->class->function() to access the API
|
||||
//Example
|
||||
$api->payment->fetch($paymentId);
|
||||
```
|
||||
## Supported Resources
|
||||
- [Account](documents/account.md)
|
||||
- [Customer](documents/customer.md)
|
||||
- [Dispute](documents/dispute.md)
|
||||
- [Document](documents/document.md)
|
||||
- [Token](documents/token.md)
|
||||
- [Order](documents/order.md)
|
||||
- [Payments](documents/payment.md)
|
||||
- [Settlements](documents/settlement.md)
|
||||
- [Refunds](documents/refund.md)
|
||||
- [Fund](documents/fund.md)
|
||||
- [Invoice](documents/invoice.md)
|
||||
- [Iin](documents/Iin.md)
|
||||
- [Plan](documents/plan.md)
|
||||
- [Item](documents/item.md)
|
||||
- [Subscriptions](documents/subscription.md)
|
||||
- [Add-on](documents/addon.md)
|
||||
- [Payment Links](documents/paymentLink.md)
|
||||
- [Product Configuration](documents/productConfiguration.md)
|
||||
- [Smart Collect](documents/virtualaccount.md)
|
||||
- [Stakeholder](documents/stakeholder.md)
|
||||
- [Transfer](documents/transfer.md)
|
||||
- [QR Code](documents/qrcode.md)
|
||||
- [Emandate](documents/emandate.md)
|
||||
- [Cards](documents/card.md)
|
||||
- [Paper NACH](documents/papernach.md)
|
||||
- [UPI](documents/upi.md)
|
||||
- [Register Emandate and Charge First Payment Together](documents/registeremandate.md)
|
||||
- [Register NACH and Charge First Payment Together](documents/registernach.md)
|
||||
- [Payment Verification](documents/paymentVerfication.md)
|
||||
- [Webhook](documents/webhook.md)
|
||||
- [OAuthTokenClient](documents/oAuthTokenClient.md)
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
See the [doc.md](doc.md) file for getting started with development.
|
||||
|
||||
## Release
|
||||
|
||||
Steps to follow for a release:
|
||||
|
||||
0. Merge the branch with the new code to master.
|
||||
1. Bump the Version in `src/Api.php`.
|
||||
2. Rename Unreleased to the new tag in `CHANGELOG.md`
|
||||
3. Add a new empty "Unreleased" section at the top of `CHANGELOG.md`
|
||||
4. Fix links at bottom in `CHANGELOG.md`
|
||||
5. Commit
|
||||
6. Tag the release and push to GitHub
|
||||
7. A release should automatically be created once the travis build passes. Edit the release to add some description.
|
||||
|
||||
## License
|
||||
|
||||
The Razorpay PHP SDK is released under the MIT License. See [LICENSE](LICENSE) file for more details.
|
||||
60
vendor/razorpay/razorpay/Razorpay.php
vendored
Normal file
60
vendor/razorpay/razorpay/Razorpay.php
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
// Include Requests only if not already defined
|
||||
if (!defined('REQUESTS_SILENCE_PSR0_DEPRECATIONS'))
|
||||
{
|
||||
define('REQUESTS_SILENCE_PSR0_DEPRECATIONS', true);
|
||||
}
|
||||
|
||||
if (class_exists('WpOrg\Requests\Autoload') === false)
|
||||
{
|
||||
require_once __DIR__.'/libs/Requests-2.0.4/src/Autoload.php';
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
WpOrg\Requests\Autoload::register();
|
||||
|
||||
if (version_compare(Requests::VERSION, '1.6.0') === -1)
|
||||
{
|
||||
throw new Exception('Requests class found but did not match');
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
throw new Exception('Requests class found but did not match');
|
||||
}
|
||||
|
||||
spl_autoload_register(function ($class)
|
||||
{
|
||||
// project-specific namespace prefix
|
||||
$prefix = 'Razorpay\Api';
|
||||
|
||||
// base directory for the namespace prefix
|
||||
$base_dir = __DIR__ . '/src/';
|
||||
|
||||
// does the class use the namespace prefix?
|
||||
$len = strlen($prefix);
|
||||
|
||||
if (strncmp($prefix, $class, $len) !== 0)
|
||||
{
|
||||
// no, move to the next registered autoloader
|
||||
return;
|
||||
}
|
||||
|
||||
// get the relative class name
|
||||
$relative_class = substr($class, $len);
|
||||
|
||||
//
|
||||
// replace the namespace prefix with the base directory,
|
||||
// replace namespace separators with directory separators
|
||||
// in the relative class name, append with .php
|
||||
//
|
||||
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
|
||||
|
||||
// if the file exists, require it
|
||||
if (file_exists($file))
|
||||
{
|
||||
require $file;
|
||||
}
|
||||
});
|
||||
41
vendor/razorpay/razorpay/composer.json
vendored
Normal file
41
vendor/razorpay/razorpay/composer.json
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "razorpay/razorpay",
|
||||
"description": "Razorpay PHP Client Library",
|
||||
"keywords": ["razorpay", "api", "php", "client"],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Abhay Rana",
|
||||
"email": "nemo@razorpay.com",
|
||||
"homepage": "https://captnemo.in",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Shashank Kumar",
|
||||
"email": "shashank@razorpay.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"email": "contact@razorpay.com",
|
||||
"issues": "https://github.com/Razorpay/razorpay-php/issues",
|
||||
"source": "https://github.com/Razorpay/razorpay-php"
|
||||
},
|
||||
"homepage": "https://docs.razorpay.com",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=7.3",
|
||||
"rmccue/requests": "^2.0",
|
||||
"ext-json": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"raveren/kint": "1.*",
|
||||
"phpunit/phpunit": "^9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Razorpay\\Api\\": "src/",
|
||||
"Razorpay\\Tests\\": "tests/"
|
||||
},
|
||||
"files" : ["Deprecated.php"]
|
||||
}
|
||||
}
|
||||
48
vendor/razorpay/razorpay/doc.md
vendored
Normal file
48
vendor/razorpay/razorpay/doc.md
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
This document talks about the implementation of the code for the Api.
|
||||
|
||||
Everything comes under namespace Razorpay\Api\.
|
||||
Namespaces put a requirement of PHP 5.3 minimum
|
||||
|
||||
```php
|
||||
namespace Razorpay\
|
||||
|
||||
class Api
|
||||
{
|
||||
|
||||
// Contains a __get function that returns the appropriate
|
||||
// class object when one tries to access them.
|
||||
}
|
||||
|
||||
|
||||
|
||||
namespace Razorpay\
|
||||
|
||||
class Client
|
||||
{
|
||||
// Handles request and response
|
||||
// Uses Composer:Requests internally
|
||||
}
|
||||
|
||||
class Payment
|
||||
{
|
||||
public function get($id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function fetch($options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function capture($id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function refund($id)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
104
vendor/razorpay/razorpay/documents/Iin.md
vendored
Normal file
104
vendor/razorpay/razorpay/documents/Iin.md
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
### Iin
|
||||
|
||||
### Token IIN API
|
||||
|
||||
```php
|
||||
$tokenIin = "412345";
|
||||
$api->iin->fetch($tokenIin);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|------------|--------|-----------------------------------|
|
||||
| tokenIin* | string | The token IIN. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"iin": "412345",
|
||||
"entity": "iin",
|
||||
"network": "Visa",
|
||||
"type": "credit",
|
||||
"sub_type": "business",
|
||||
"issuer_code": "HDFC",
|
||||
"issuer_name": "HDFC Bank Ltd",
|
||||
"international": false,
|
||||
"is_tokenized": true,
|
||||
"card_iin": "411111",
|
||||
"emi":{
|
||||
"available": true
|
||||
},
|
||||
"recurring": {
|
||||
"available": true
|
||||
},
|
||||
"authentication_types": [
|
||||
{
|
||||
"type":"3ds"
|
||||
},
|
||||
{
|
||||
"type":"otp"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch All IINs Supporting Native OTP
|
||||
|
||||
```php
|
||||
$api->iin->all(array("flow" => "otp"));
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"count": 24,
|
||||
"iins": [
|
||||
"512967",
|
||||
"180005",
|
||||
"401704",
|
||||
"401806",
|
||||
"123456",
|
||||
"411111",
|
||||
"123512967",
|
||||
"180012305",
|
||||
"401123704"
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch All IINs with Business Sub-type
|
||||
|
||||
```php
|
||||
$api->iin->all(array("sub_type" => "business"));
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"count": 24,
|
||||
"iins": [
|
||||
"512967",
|
||||
"180005",
|
||||
"401704",
|
||||
"401806",
|
||||
"607389",
|
||||
"652203",
|
||||
"414367",
|
||||
"787878",
|
||||
"123456",
|
||||
"411111",
|
||||
"123512967",
|
||||
"180012305",
|
||||
"401123704"
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/payments/cards/iin-api/#iin-entity)**
|
||||
447
vendor/razorpay/razorpay/documents/account.md
vendored
Normal file
447
vendor/razorpay/razorpay/documents/account.md
vendored
Normal file
@ -0,0 +1,447 @@
|
||||
## Account
|
||||
|
||||
### Create an Account
|
||||
```php
|
||||
$api->account->create(array(
|
||||
"email" => "gauriagain.kumar@example.org",
|
||||
"phone" => "9000090000",
|
||||
"legal_business_name" => "Acme Corp",
|
||||
"business_type" => "partnership",
|
||||
"customer_facing_business_name" => "Example",
|
||||
"profile" => array(
|
||||
"category" => "healthcare",
|
||||
"subcategory" => "clinic",
|
||||
"description" => "Healthcare E-commerce platform",
|
||||
"addresses" => array(
|
||||
"operation" => array(
|
||||
"street1" => "507, Koramangala 6th block",
|
||||
"street2" => "Kormanagala",
|
||||
"city" => "Bengaluru",
|
||||
"state" => "Karnataka",
|
||||
"postal_code" => 560047,
|
||||
"country" => "IN"
|
||||
),
|
||||
"registered" => array(
|
||||
"street1" => "507, Koramangala 1st block",
|
||||
"street2" => "MG Road",
|
||||
"city" => "Bengaluru",
|
||||
"state" => "Karnataka",
|
||||
"postal_code" => 560034,
|
||||
"country" => "IN"
|
||||
)
|
||||
),
|
||||
"business_model" => "Online Clothing ( men, women, ethnic, modern ) fashion and lifestyle, accessories, t-shirt, shirt, track pant, shoes."
|
||||
),
|
||||
"legal_info" => array(
|
||||
"pan" => "AAACL1234C",
|
||||
"gst" => "18AABCU9603R1ZM"
|
||||
),
|
||||
"brand" => array(
|
||||
"color" => "FFFFFF"
|
||||
),
|
||||
"notes" => array(
|
||||
"internal_ref_id" => "123123"
|
||||
),
|
||||
"contact_name" => "Gaurav Kumar",
|
||||
"contact_info" => array(
|
||||
"chargeback" => array(
|
||||
"email" => "cb@example.org"
|
||||
),
|
||||
"refund" => array(
|
||||
"email" => "cb@example.org"
|
||||
),
|
||||
"support" => array(
|
||||
"email" => "support@example.org",
|
||||
"phone" => "9999999998",
|
||||
"policy_url" => "https://www.google.com"
|
||||
)
|
||||
),
|
||||
"apps" => array(
|
||||
"websites" => array(
|
||||
"https://www.example.org"
|
||||
),
|
||||
"android" => array(
|
||||
array(
|
||||
"url" => "playstore.example.org",
|
||||
"name" => "Example"
|
||||
)
|
||||
),
|
||||
"ios" => array(
|
||||
array(
|
||||
"url" => "appstore.example.org",
|
||||
"name" => "Example"
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| email* | string | The sub-merchant's business email address. |
|
||||
| phone* | integer | The sub-merchant's business phone number. The minimum length is 8 characters and the maximum length is 15. |
|
||||
| legal_business_name* | string | The name of the sub-merchant's business. For example, Acme Corp. The minimum length is 4 characters and the maximum length is 200. |
|
||||
| customer_facing_business_name | string | The sub-merchant billing label as it appears on the Razorpay Dashboard. The minimum length is 1 character and the maximum length is 255. |
|
||||
| business_type | string | The type of business operated by the sub-merchant.Possible value is `proprietorship`, `partnership`, `private_limited`, `public_limited`, `llp`, `ngo`, `trust`, `society`, `not_yet_registered`, `huf` |
|
||||
| reference_id | string | Partner's external account reference id. The minimum length is 1 character and the maximum length is 512. |
|
||||
| profile | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
|
||||
| legal_info | object | All keys listed [here](hhttps://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
|
||||
| brand | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
|
||||
| notes | object | A key-value pair |
|
||||
| contact_name* | string | The name of the contact. The minimum length is 4 and the maximum length is 255 characters. |
|
||||
| contact_info | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
|
||||
| apps | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
|
||||
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "acc_GRWKk7qQsLnDjX",
|
||||
"type": "standard",
|
||||
"status": "created",
|
||||
"email": "gauriagain.kumar@example.org",
|
||||
"profile": {
|
||||
"category": "healthcare",
|
||||
"subcategory": "clinic",
|
||||
"addresses": {
|
||||
"registered": {
|
||||
"street1": "507, Koramangala 1st block",
|
||||
"street2": "MG Road",
|
||||
"city": "Bengaluru",
|
||||
"state": "KARNATAKA",
|
||||
"postal_code": 560034,
|
||||
"country": "IN"
|
||||
},
|
||||
"operation": {
|
||||
"street1": "507, Koramangala 6th block",
|
||||
"street2": "Kormanagalo",
|
||||
"city": "Bengaluru",
|
||||
"state": "KARNATAKA",
|
||||
"country": "IN",
|
||||
"postal_code": 560047
|
||||
}
|
||||
},
|
||||
"business_model": "Online Clothing ( men, women, ethnic, modern ) fashion and lifestyle, accessories, t-shirt, shirt, track pant, shoes."
|
||||
},
|
||||
"notes": {
|
||||
"internal_ref_id": "123123"
|
||||
},
|
||||
"created_at": 1611136837,
|
||||
"phone": "9000090000",
|
||||
"business_type": "partnership",
|
||||
"legal_business_name": "Acme Corp",
|
||||
"customer_facing_business_name": "Example",
|
||||
"legal_info": {
|
||||
"pan": "AAACL1234C",
|
||||
"gst": "18AABCU9603R1ZM"
|
||||
},
|
||||
"apps": {
|
||||
"websites": [
|
||||
"https://www.example.org"
|
||||
],
|
||||
"android": [
|
||||
{
|
||||
"url": "playstore.example.org",
|
||||
"name": "Example"
|
||||
}
|
||||
],
|
||||
"ios": [
|
||||
{
|
||||
"url": "appstore.example.org",
|
||||
"name": "Example"
|
||||
}
|
||||
]
|
||||
},
|
||||
"brand": {
|
||||
"color": "#FFFFFF"
|
||||
},
|
||||
"contact_info": {
|
||||
"chargeback": {
|
||||
"email": "cb@example.org",
|
||||
"phone": null,
|
||||
"policy_url": null
|
||||
},
|
||||
"refund": {
|
||||
"email": "cb@example.org",
|
||||
"phone": null,
|
||||
"policy_url": null
|
||||
},
|
||||
"support": {
|
||||
"email": "support@example.org",
|
||||
"phone": "9999999998",
|
||||
"policy_url": "https://www.google.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Edit Account
|
||||
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$api->account->edit($accountId,array(
|
||||
"customer_facing_business_name" => "ABCD Ltd"
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| phone | integer | The sub-merchant's business phone number. The minimum length is 8 characters and the maximum length is 15. |
|
||||
| legal_business_name | string | The name of the sub-merchant's business. For example, Acme Corp. The minimum length is 4 characters and the maximum length is 200. |
|
||||
| customer_facing_business_name | string | The sub-merchant billing label as it appears on the Razorpay Dashboard. The minimum length is 1 character and the maximum length is 255. |
|
||||
| profile | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#update-an-account) are supported |
|
||||
| legal_info | object | All keys listed [here](hhttps://razorpay.com/docs/api/partners/account-onboarding/#update-an-account) are supported |
|
||||
| brand | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#update-an-account) are supported |
|
||||
| notes | object | A key-value pair |
|
||||
| contact_name* | string | The name of the contact. The minimum length is 4 and the maximum length is 255 characters. |
|
||||
| contact_info | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#update-an-account) are supported |
|
||||
| apps | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#update-an-account) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "acc_GP4lfNA0iIMn5B",
|
||||
"type": "standard",
|
||||
"status": "created",
|
||||
"email": "gauri@example.org",
|
||||
"profile": {
|
||||
"category": "healthcare",
|
||||
"subcategory": "clinic",
|
||||
"addresses": {
|
||||
"registered": {
|
||||
"street1": "507, Koramangala 1st block",
|
||||
"street2": "MG Road-1",
|
||||
"city": "Bengalore",
|
||||
"state": "KARNATAKA",
|
||||
"postal_code": "560034",
|
||||
"country": "IN"
|
||||
}
|
||||
}
|
||||
},
|
||||
"notes": [],
|
||||
"created_at": 1610603081,
|
||||
"phone": "9000090000",
|
||||
"reference_id": "randomId",
|
||||
"business_type": "partnership",
|
||||
"legal_business_name": "Acme Corp",
|
||||
"customer_facing_business_name": "ABCD Ltd"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete an account
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
$api->account->delete($accountId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account that must be deleted. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "acc_GXQAkO2MrvBYg4",
|
||||
"type": "standard",
|
||||
"status": "suspended",
|
||||
"email": "gaurav.kumar@acme.org",
|
||||
"profile": {
|
||||
"category": "healthcare",
|
||||
"subcategory": "clinic",
|
||||
"addresses": {
|
||||
"registered": {
|
||||
"street1": "507, Koramangala 1st block",
|
||||
"street2": "MG Road",
|
||||
"city": "Bengaluru",
|
||||
"state": "KARNATAKA",
|
||||
"postal_code": "560034",
|
||||
"country": "IN"
|
||||
},
|
||||
"operation": {
|
||||
"street1": "507, Koramangala 1st block",
|
||||
"street2": "MG Road",
|
||||
"city": "Bengaluru",
|
||||
"state": "KARNATAKA",
|
||||
"country": "IN",
|
||||
"postal_code": "560034"
|
||||
}
|
||||
},
|
||||
"business_model": "Online Clothing ( men, women, ethnic, modern ) fashion and lifestyle, accessories, t-shirt, shirt, track pant, shoes."
|
||||
},
|
||||
"notes": {
|
||||
"internal_ref_id": "123123"
|
||||
},
|
||||
"created_at": 1612425180,
|
||||
"suspended_at": 1612425235,
|
||||
"phone": "9000090000",
|
||||
"reference_id": "account_COdeRandom",
|
||||
"business_type": "partnership",
|
||||
"legal_business_name": "Acme Corp Pvt Ltd",
|
||||
"customer_facing_business_name": "Acme",
|
||||
"legal_info": {
|
||||
"pan": "AAACL1234C",
|
||||
"gst": "18AABCU9603R1ZM"
|
||||
},
|
||||
"apps": {
|
||||
"websites": [
|
||||
"https://www.acme.org"
|
||||
],
|
||||
"android": [
|
||||
{
|
||||
"url": "playstore.acme.org",
|
||||
"name": "Acme"
|
||||
}
|
||||
],
|
||||
"ios": [
|
||||
{
|
||||
"url": "appstore.acme.org",
|
||||
"name": "Acme"
|
||||
}
|
||||
]
|
||||
},
|
||||
"brand": {
|
||||
"color": "#FFFFFF"
|
||||
},
|
||||
"contact_name": "Gaurav Kumar",
|
||||
"contact_info": {
|
||||
"chargeback": {
|
||||
"email": "cb@acme.org",
|
||||
"phone": "9000090000",
|
||||
"policy_url": "https://www.google.com"
|
||||
},
|
||||
"refund": {
|
||||
"email": "cb@acme.org",
|
||||
"phone": "9898989898",
|
||||
"policy_url": "https://www.google.com"
|
||||
},
|
||||
"support": {
|
||||
"email": "support@acme.org",
|
||||
"phone": "9898989898",
|
||||
"policy_url": "https://www.google.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch an account
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
$api->account->fetch($accountId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "acc_GP4lfNA0iIMn5B",
|
||||
"type": "standard",
|
||||
"status": "created",
|
||||
"email": "gauri@example.org",
|
||||
"profile": {
|
||||
"category": "healthcare",
|
||||
"subcategory": "clinic",
|
||||
"addresses": {
|
||||
"registered": {
|
||||
"street1": "507, Koramangala 1st block",
|
||||
"street2": "MG Road-1",
|
||||
"city": "Bengalore",
|
||||
"state": "KARNATAKA",
|
||||
"postal_code": "560034",
|
||||
"country": "IN"
|
||||
}
|
||||
}
|
||||
},
|
||||
"notes": [],
|
||||
"created_at": 1610603081,
|
||||
"phone": "9000090000",
|
||||
"reference_id": "randomId",
|
||||
"business_type": "partnership",
|
||||
"legal_business_name": "Acme Corp",
|
||||
"customer_facing_business_name": "Example Pvt. Ltd."
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Upload account documents
|
||||
```php
|
||||
|
||||
$accountId = "acc_M83Uw27KXuC7c8";
|
||||
|
||||
$payload = [
|
||||
'file'=> '/Users/your_name/Downloads/sample_uploaded.pdf'
|
||||
"document_type" => "business_proof_url"
|
||||
];
|
||||
|
||||
$api->account->fetch($accoundId)->uploadAccountDoc($payload);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
| file* | string | The URL generated once the business proof document is uploaded. |
|
||||
| document_type* | string | The documents valid for the proof type to be shared. Possible values : <br> business_proof_of_identification: `shop_establishment_certificate`, `gst_certificate`, `msme_certificate`, `business_proof_url`, `business_pan_url`, <br><br> additional_documents : `form_12_a_url`, `form_80g_url`, `cancelled_cheque` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"business_proof_of_identification": [
|
||||
{
|
||||
"type": "business_proof_url",
|
||||
"url": "<https://rzp.io/i/bzDKbNg>"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch account documents
|
||||
```php
|
||||
$accountId = "acc_M83Uw27KXuC7c8";
|
||||
|
||||
$api->account->fetch($accoundId)->fetchAccountDoc();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"business_proof_of_identification": [
|
||||
{
|
||||
"type": "business_proof_url",
|
||||
"url": "<https://rzp.io/i/bzDKbNg>"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/partners/account-onboarding/)**
|
||||
167
vendor/razorpay/razorpay/documents/addon.md
vendored
Normal file
167
vendor/razorpay/razorpay/documents/addon.md
vendored
Normal file
@ -0,0 +1,167 @@
|
||||
## Addons
|
||||
|
||||
### Create an addon
|
||||
|
||||
```php
|
||||
$api->subscription->fetch($subscriptionId)->createAddon(array('item' => array('name' => 'Extra Chair', 'amount' => 30000, 'currency' => 'INR'), 'quantity' => 2));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | boolean | The subscription ID to which the add-on is being added. |
|
||||
| items | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-an-add-on) |
|
||||
| quantity | integer | This specifies the number of units of the add-on to be charged to the customer. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"ao_00000000000001",
|
||||
"entity":"addon",
|
||||
"item":{
|
||||
"id":"item_00000000000001",
|
||||
"active":true,
|
||||
"name":"Extra appala (papadum)",
|
||||
"description":"1 extra oil fried appala with meals",
|
||||
"amount":30000,
|
||||
"unit_amount":30000,
|
||||
"currency":"INR",
|
||||
"type":"addon",
|
||||
"unit":null,
|
||||
"tax_inclusive":false,
|
||||
"hsn_code":null,
|
||||
"sac_code":null,
|
||||
"tax_rate":null,
|
||||
"tax_id":null,
|
||||
"tax_group_id":null,
|
||||
"created_at":1581597318,
|
||||
"updated_at":1581597318
|
||||
},
|
||||
"quantity":2,
|
||||
"created_at":1581597318,
|
||||
"subscription_id":"sub_00000000000001",
|
||||
"invoice_id":null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all addons
|
||||
|
||||
```php
|
||||
$api->addon->all($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the addons were created |
|
||||
| to | timestamp | timestamp before which the addons were created |
|
||||
| count | integer | number of addons to fetch (default: 10) |
|
||||
| skip | integer | number of addons to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "ao_00000000000002",
|
||||
"entity": "addon",
|
||||
"item": {
|
||||
"id": "item_00000000000002",
|
||||
"active": true,
|
||||
"name": "Extra sweet",
|
||||
"description": "1 extra sweet of the day with meals",
|
||||
"amount": 90000,
|
||||
"unit_amount": 90000,
|
||||
"currency": "INR",
|
||||
"type": "addon",
|
||||
"unit": null,
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"tax_id": null,
|
||||
"tax_group_id": null,
|
||||
"created_at": 1581597318,
|
||||
"updated_at": 1581597318
|
||||
},
|
||||
"quantity": 1,
|
||||
"created_at": 1581597318,
|
||||
"subscription_id": "sub_00000000000001",
|
||||
"invoice_id": "inv_00000000000001"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch an addon
|
||||
|
||||
```php
|
||||
$api->addon->fetch($addonId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| addonId* | string | addon id to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"ao_00000000000001",
|
||||
"entity":"addon",
|
||||
"item":{
|
||||
"id":"item_00000000000001",
|
||||
"active":true,
|
||||
"name":"Extra appala (papadum)",
|
||||
"description":"1 extra oil fried appala with meals",
|
||||
"amount":30000,
|
||||
"unit_amount":30000,
|
||||
"currency":"INR",
|
||||
"type":"addon",
|
||||
"unit":null,
|
||||
"tax_inclusive":false,
|
||||
"hsn_code":null,
|
||||
"sac_code":null,
|
||||
"tax_rate":null,
|
||||
"tax_id":null,
|
||||
"tax_group_id":null,
|
||||
"created_at":1581597318,
|
||||
"updated_at":1581597318
|
||||
},
|
||||
"quantity":2,
|
||||
"created_at":1581597318,
|
||||
"subscription_id":"sub_00000000000001",
|
||||
"invoice_id":null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete an addon
|
||||
|
||||
```php
|
||||
$api->addon->fetch($addonId)->delete();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|--------------|
|
||||
| addonId* | string | addon id to be deleted |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
[]
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/subscriptions/#add-ons)**
|
||||
590
vendor/razorpay/razorpay/documents/card.md
vendored
Normal file
590
vendor/razorpay/razorpay/documents/card.md
vendored
Normal file
@ -0,0 +1,590 @@
|
||||
## Cards
|
||||
|
||||
### Create customer
|
||||
```php
|
||||
$api->customer->create(array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'fail_existing' => "1",
|
||||
'contact'=>'9000090000',
|
||||
'notes'=> array(
|
||||
'notes_key_1'=> 'Tea, Earl Grey, Hot',
|
||||
'notes_key_2'=> 'Tea, Earl Grey... decaf'
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| name* | string | Name of the customer |
|
||||
| email | string | Email of the customer |
|
||||
| contact | string | Contact number of the customer |
|
||||
| fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `1` or `0`|
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "cust_1Aa00000000003",
|
||||
"entity": "customer",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "Gaurav.Kumar@example.com",
|
||||
"contact": "9000000000",
|
||||
"gstin": null,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1582033731
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create Order
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 100, 'currency' => 'INR', 'receipt' => '123', 'customer_id'=> $customerId, 'method'=>'card', 'token'=>array('max_amount'=>'5000', 'expire_at'=>'2709971120', 'frequency'=>'monthly'), 'notes'=> array('key1'=> 'value3','key2'=> 'value2')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| method | string | Payment method used to make the registration transaction. Possible value is `card`. |
|
||||
| token | array | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/cards/authorization-transaction/#112-create-an-order) are supported |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"order_1Aa00000000002",
|
||||
"entity":"order",
|
||||
"amount":100,
|
||||
"amount_paid":0,
|
||||
"amount_due":100,
|
||||
"currency":"INR",
|
||||
"receipt":"Receipt No. 1",
|
||||
"method":"card",
|
||||
"description":null,
|
||||
"customer_id":"cust_4xbQrmEoA5WJ01",
|
||||
"token":{
|
||||
"max_amount":5000,
|
||||
"expire_at":2709971120,
|
||||
"frequency":"monthly"
|
||||
},
|
||||
"offer_id":null,
|
||||
"status":"created",
|
||||
"attempts":0,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at":1565172642
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create registration link
|
||||
|
||||
```php
|
||||
$api->subscription->createSubscriptionRegistration(array(
|
||||
'customer' => array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9123456780'
|
||||
),
|
||||
'type' => 'link',
|
||||
'amount' => 100,
|
||||
'currency' => 'INR',
|
||||
'description' => 'Registration Link for Gaurav Kumar',
|
||||
'subscription_registration' => array(
|
||||
'method' => 'emandate',
|
||||
'max_amount' => '500',
|
||||
'expire_at' => '1634215992'
|
||||
'frequency' => 'monthly'
|
||||
),
|
||||
'receipt' => 'Receipt No. 5',
|
||||
'email_notify' => true,
|
||||
'sms_notify' => true,
|
||||
'expire_by' => 1634215992,
|
||||
'notes' => array(
|
||||
'note_key 1' => 'Beam me up Scotty',
|
||||
'note_key 2' => 'Tea. Earl Gray. Hot.'
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customer | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/cards/create-authorization-transaction/#121-create-a-registration-link) are supported |
|
||||
| type* | array | the value is `link`. |
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| description* | string | A brief description of the payment. |
|
||||
| subscription_registration | array | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/cards/authorization-transaction/#121-create-a-registration-link) are supported |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| sms_notify | boolean | SMS notifications are to be sent by Razorpay (default : true) |
|
||||
| email_notify | boolean | Email notifications are to be sent by Razorpay (default : true) |
|
||||
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_FHrXGIpd3N17DX",
|
||||
"entity": "invoice",
|
||||
"receipt": "Receipt No. 24",
|
||||
"invoice_number": "Receipt No. 24",
|
||||
"customer_id": "cust_BMB3EwbqnqZ2EI",
|
||||
"customer_details": {
|
||||
"id": "cust_BMB3EwbqnqZ2EI",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9123456780",
|
||||
"gstin": null,
|
||||
"billing_address": null,
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9123456780"
|
||||
},
|
||||
"order_id": "order_FHrXGJNngJyEAe",
|
||||
"line_items": [],
|
||||
"payment_id": null,
|
||||
"status": "issued",
|
||||
"expire_by": 4102444799,
|
||||
"issued_at": 1595491014,
|
||||
"paid_at": null,
|
||||
"cancelled_at": null,
|
||||
"expired_at": null,
|
||||
"sms_status": "pending",
|
||||
"email_status": "pending",
|
||||
"date": 1595491014,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 100,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"amount": 100,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 100,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "Registration Link for Gaurav Kumar",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/VSriCfn",
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "link",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1595491014,
|
||||
"idempotency_key": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Create an order to charge the customer
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => '100', 'currency' => 'INR', 'customer_id'=> $customerId, 'method'=>'card', 'receipt' => 'Receipt No. 1', 'token'=>array('max_amount'=>'5000', 'expire_at'=>'2709971120', 'frequency'=>'monthly'), 'notes'=> array('key1'=> 'value3','key2'=> 'value2')));
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| method | string | Payment method used to make the registration transaction. Possible value is `card`. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| token | array | All keys listed [here](https://razorpay.com/docs/api/recurring-payments/cards/subsequent-payments/#31-create-an-order-to-charge-the-customer) are supported |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"order_1Aa00000000002",
|
||||
"entity":"order",
|
||||
"amount":100,
|
||||
"amount_paid":0,
|
||||
"amount_due":100,
|
||||
"currency":"INR",
|
||||
"receipt":"Receipt No. 1",
|
||||
"method":"card",
|
||||
"description":null,
|
||||
"customer_id":"cust_4xbQrmEoA5WJ01",
|
||||
"token":{
|
||||
"max_amount":5000,
|
||||
"expire_at":2709971120,
|
||||
"frequency":"monthly"
|
||||
},
|
||||
"offer_id":null,
|
||||
"status":"created",
|
||||
"attempts":0,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at":1565172642
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Create a recurring payment
|
||||
|
||||
```php
|
||||
$api->payment->createRecurring(array(
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9000090000',
|
||||
'amount' => 100,
|
||||
'currency' => 'INR',
|
||||
'order_id' => 'order_1Aa00000000002',
|
||||
'customer_id' => 'cust_1Aa00000000001',
|
||||
'token' => 'token_1Aa00000000001',
|
||||
'recurring' => true,
|
||||
'description' => 'Creating recurring payment for Gaurav Kumar'
|
||||
));
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| email* | string | The customer's email address |
|
||||
| contact* | string | The customer's phone number |
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| orderId* | string | The id of the order to be fetched |
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
| recurring* | boolean | Possible values is `true` or `false` |
|
||||
| description | string | A brief description of the payment. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id" : "pay_1Aa00000000001",
|
||||
"razorpay_order_id" : "order_1Aa00000000001",
|
||||
"razorpay_signature" : "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an Authorization Payment
|
||||
|
||||
Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/cards/authorization-transaction/#113-create-an-authorization-payment) for authorization payment
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Send/Resend notifications
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->notifyBy($medium);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be fetched |
|
||||
| medium* | string | Possible values are `sms` or `email` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"success": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Cancel registration link
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->cancel();
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_FHrfRupD2ouKIt",
|
||||
"entity": "invoice",
|
||||
"receipt": "Receipt No. 1",
|
||||
"invoice_number": "Receipt No. 1",
|
||||
"customer_id": "cust_BMB3EwbqnqZ2EI",
|
||||
"customer_details": {
|
||||
"id": "cust_BMB3EwbqnqZ2EI",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9123456780",
|
||||
"gstin": null,
|
||||
"billing_address": null,
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9123456780"
|
||||
},
|
||||
"order_id": "order_FHrfRw4TZU5Q2L",
|
||||
"line_items": [],
|
||||
"payment_id": null,
|
||||
"status": "cancelled",
|
||||
"expire_by": 4102444799,
|
||||
"issued_at": 1595491479,
|
||||
"paid_at": null,
|
||||
"cancelled_at": 1595491488,
|
||||
"expired_at": null,
|
||||
"sms_status": "sent",
|
||||
"email_status": "sent",
|
||||
"date": 1595491479,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 100,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"amount": 100,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 100,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "Registration Link for Gaurav Kumar",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/QlfexTj",
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "link",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1595491480,
|
||||
"idempotency_key": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Fetch token by payment id
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "pay_FHfqtkRzWvxky4",
|
||||
"entity": "payment",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_FHfnswDdfu96HQ",
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "card",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": null,
|
||||
"card_id": "card_F0zoXUp4IPPGoI",
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919876543210",
|
||||
"customer_id": "cust_DtHaBuooGHTuyZ",
|
||||
"token_id": "token_FHfn3rIiM1Z8nr",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {
|
||||
"auth_code": "541898"
|
||||
},
|
||||
"created_at": 1595449871
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Fetch tokens by customer id
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->all();
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity":"collection",
|
||||
"count":1,
|
||||
"items":[
|
||||
{
|
||||
"id":"token_HouA2OQR5Z2jTL",
|
||||
"entity":"token",
|
||||
"token":"2JPRk664pZHUWG",
|
||||
"bank":null,
|
||||
"wallet":null,
|
||||
"method":"card",
|
||||
"card":{
|
||||
"entity":"card",
|
||||
"name":"Gaurav Kumar",
|
||||
"last4":"8950",
|
||||
"network":"Visa",
|
||||
"type":"credit",
|
||||
"issuer":"STCB",
|
||||
"international":false,
|
||||
"emi":false,
|
||||
"sub_type":"consumer",
|
||||
"expiry_month":12,
|
||||
"expiry_year":2021,
|
||||
"flows":{
|
||||
"otp":true,
|
||||
"recurring":true
|
||||
}
|
||||
},
|
||||
"recurring":true,
|
||||
"recurring_details":{
|
||||
"status":"confirmed",
|
||||
"failure_reason":null
|
||||
},
|
||||
"auth_type":null,
|
||||
"mrn":null,
|
||||
"used_at":1629779657,
|
||||
"created_at":1629779657,
|
||||
"expired_at":1640975399,
|
||||
"dcc_enabled":false,
|
||||
"billing_address":null
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch card
|
||||
|
||||
```php
|
||||
$api->card->fetch($cardId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| cardId* | string | card id to be fetched |
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "card_JXPULjlKqC5j0i",
|
||||
"entity": "card",
|
||||
"name": "Gaurav",
|
||||
"last4": "4366",
|
||||
"network": "Visa",
|
||||
"type": "credit",
|
||||
"issuer": "UTIB",
|
||||
"international": false,
|
||||
"emi": true,
|
||||
"sub_type": "consumer",
|
||||
"token_iin": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Delete tokens
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->delete($tokenId);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"deleted": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Using Card Number/ Tokenised Card Number
|
||||
|
||||
```php
|
||||
$api->card->requestCardReference(array("number" =>"4854980604708430"));
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|------------------------------------------------------------------------------|
|
||||
| number* | string | The card number whose PAR or network reference id should be retrieved. |
|
||||
| tokenised | string | Determines if the card is saved as a token. Possible value is `true` or `false` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"network": "Visa",
|
||||
"payment_account_reference": "V0010013819231376539033235990",
|
||||
"network_reference_id": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Using Razporpay token
|
||||
|
||||
```php
|
||||
$api->card->requestCardReference(array("token" =>"token_4lsdksD31GaZ09"));
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|------------------------------------------------------------------------------|
|
||||
| token* | string | The token whose PAR or network reference id should be retrieved.|
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"network": "Visa",
|
||||
"payment_account_reference": "V0010013819231376539033235990",
|
||||
"network_reference_id": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/recurring-payments/cards/authorization-transaction/)**
|
||||
385
vendor/razorpay/razorpay/documents/customer.md
vendored
Normal file
385
vendor/razorpay/razorpay/documents/customer.md
vendored
Normal file
@ -0,0 +1,385 @@
|
||||
## Customer
|
||||
|
||||
### Create customer
|
||||
```php
|
||||
$api->customer->create(array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'fail_existing' => "1",
|
||||
'contact'=>'9000090000',
|
||||
'notes'=> array(
|
||||
'notes_key_1'=> 'Tea, Earl Grey, Hot',
|
||||
'notes_key_2'=> 'Tea, Earl Grey... decaf'
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| name* | string | Name of the customer |
|
||||
| email | string | Email of the customer |
|
||||
| contact | string | Contact number of the customer |
|
||||
| fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `1` or `0`|
|
||||
| gstin | string | Customer's GST number, if available. For example, 29XAbbA4369J1PA |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id" : "cust_1Aa00000000004",
|
||||
"entity": "customer",
|
||||
"name" : "Gaurav Kumar",
|
||||
"email" : "gaurav.kumar@example.com",
|
||||
"contact" : "9123456780",
|
||||
"gstin": "29XAbbA4369J1PA",
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at ": 1234567890
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Edit customer
|
||||
```php
|
||||
$api->customer->fetch($customerId)->edit(array('name' => 'Razorpay User', 'email' => 'customer@razorpay.com', 'contact' => '9999999999'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be updated |
|
||||
| email | string | Email of the customer |
|
||||
| contact | string | Contact number of the customer |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "cust_1Aa00000000003",
|
||||
"entity": "customer",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "Gaurav.Kumar@example.com",
|
||||
"contact": "9000000000",
|
||||
"gstin": null,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1582033731
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all customer
|
||||
```php
|
||||
$api->customer->all($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| count | integer | number of payments to fetch (default: 10) |
|
||||
| skip | integer | number of payments to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity":"collection",
|
||||
"count":1,
|
||||
"items":[
|
||||
{
|
||||
"id":"cust_1Aa00000000001",
|
||||
"entity":"customer",
|
||||
"name":"Gaurav Kumar",
|
||||
"email":"gaurav.kumar@example.com",
|
||||
"contact":"9876543210",
|
||||
"gstin":"29XAbbA4369J1PA",
|
||||
"notes":{
|
||||
"note_key_1":"September",
|
||||
"note_key_2":"Make it so."
|
||||
},
|
||||
"created_at ":1234567890
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a customer
|
||||
```php
|
||||
$api->customer->fetch($customerId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id" : "cust_1Aa00000000001",
|
||||
"entity": "customer",
|
||||
"name" : "Saurav Kumar",
|
||||
"email" : "Saurav.kumar@example.com",
|
||||
"contact" : "+919000000000",
|
||||
"gstin":"29XAbbA4369J1PA",
|
||||
"notes" : [],
|
||||
"created_at ": 1234567890
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Add Bank Account of Customer
|
||||
|
||||
```php
|
||||
$customerId = "cust_N5mywh91sXB69O"
|
||||
|
||||
$api->customer->fetch($customerId)->addBankAccount([
|
||||
"ifsc_code" => "UTIB0000194",
|
||||
"account_number" => "919999999999",
|
||||
"beneficiary_name" => "Pratheek",
|
||||
"beneficiary_address1" => "address 1",
|
||||
"beneficiary_address2" => "address 2",
|
||||
"beneficiary_address3" => "address 3",
|
||||
"beneficiary_address4" => "address 4",
|
||||
"beneficiary_email" => "random@email.com",
|
||||
"beneficiary_mobile" => "8762489310",
|
||||
"beneficiary_city" => "Bangalore",
|
||||
"beneficiary_state" => "KA",
|
||||
"beneficiary_country" => "IN",
|
||||
]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | Customer's bank account number |
|
||||
| account_number | integer | The id of the customer to be fetched |
|
||||
| account_number | string | The name of the beneficiary associated with the bank account. |
|
||||
| beneficiary_name | string | The virtual payment address. |
|
||||
| beneficiary_address1 | string | The id of the customer to be fetched |
|
||||
| beneficiary_email | string | Email address of the beneficiary. |
|
||||
| beneficiary_mobile | integer | Mobile number of the beneficiary. |
|
||||
| beneficiary_city | string | The name of the city of the beneficiary. |
|
||||
| beneficiary_state | string | The state of the beneficiary. |
|
||||
| beneficiary_pin | interger | The pin code of the beneficiary's address. |
|
||||
| ifsc_code | string | The IFSC code of the bank branch associated with the account. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id" : "cust_1Aa00000000001",
|
||||
"entity": "customer",
|
||||
"name" : "Saurav Kumar",
|
||||
"email" : "Saurav.kumar@example.com",
|
||||
"contact" : "+919000000000",
|
||||
"gstin":"29XAbbA4369J1PA",
|
||||
"notes" : [],
|
||||
"created_at ": 1234567890
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete Bank Account of Customer
|
||||
|
||||
```php
|
||||
$customerId = "cust_N5mywh91sXB69O"
|
||||
|
||||
$bankAccountId = "ba_N6aM8uo64IzxHu"
|
||||
|
||||
$api->customer->fetch($customerId)->deleteBankAccount($bankAccountId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | Customer's bank account number |
|
||||
| bank_id | string | The bank_id that needs to be deleted. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "ba_Evg09Ll05SIPSD",
|
||||
"ifsc": "ICIC0001207",
|
||||
"bank_name": "ICICI Bank",
|
||||
"name": "Test R4zorpay",
|
||||
"account_number": "XXXXXXXXXXXXXXX0434",
|
||||
"status": "deleted"
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Eligibility Check API
|
||||
|
||||
```php
|
||||
$api->customer->requestEligibilityCheck(array(
|
||||
"inquiry" => "affordability",
|
||||
"amount" => 500000,
|
||||
"currency" => "INR",
|
||||
"customer" => array(
|
||||
"id" => "cust_MVSyUEwC4qb5sN",
|
||||
"contact" => "+918220276214",
|
||||
"ip" => "105.106.107.108",
|
||||
"referrer" => "https://merchansite.com/example/paybill",
|
||||
"user_agent" => "Mozilla/5.0",
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | Customer's bank account number |
|
||||
| bank_id | string | The bank_id that needs to be deleted. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"amount": "500000",
|
||||
"customer": {
|
||||
"id": "KkBhM9EC1Y0HTm",
|
||||
"contact": "+918220722114"
|
||||
},
|
||||
"instruments": [
|
||||
{
|
||||
"method": "emi",
|
||||
"issuer": "HDFC",
|
||||
"type": "debit",
|
||||
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
|
||||
"eligibility": {
|
||||
"status": "eligible"
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "paylater",
|
||||
"provider": "getsimpl",
|
||||
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
|
||||
"eligibility": {
|
||||
"status": "eligible"
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "paylater",
|
||||
"provider": "icic",
|
||||
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
|
||||
"eligibility": {
|
||||
"status": "eligible"
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "cardless_emi",
|
||||
"provider": "walnut369",
|
||||
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
|
||||
"eligibility": {
|
||||
"status": "ineligible",
|
||||
"error": {
|
||||
"code": "GATEWAY_ERROR",
|
||||
"description": "The customer has not been approved by the partner.",
|
||||
"source": "business",
|
||||
"step": "inquiry",
|
||||
"reason": "user_not_approved"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "cardless_emi",
|
||||
"provider": "zestmoney",
|
||||
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
|
||||
"eligibility": {
|
||||
"status": "ineligible",
|
||||
"error": {
|
||||
"code": "GATEWAY_ERROR",
|
||||
"description": "The customer has exhausted their credit limit.",
|
||||
"source": "business",
|
||||
"step": "inquiry",
|
||||
"reason": "credit_limit_exhausted"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "paylater",
|
||||
"provider": "lazypay",
|
||||
"eligibility_req_id": "elig_KkCNLzlNeMYQyZ",
|
||||
"eligibility": {
|
||||
"status": "ineligible",
|
||||
"error": {
|
||||
"code": "GATEWAY_ERROR",
|
||||
"description": "The order amount is less than the minimum transaction amount.",
|
||||
"source": "business",
|
||||
"step": "inquiry",
|
||||
"reason": "min_amt_required"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch Eligibility by id
|
||||
|
||||
```php
|
||||
$api->customer->fetchEligibility("elig_F1cxDoHWD4fkQt");
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | Customer's bank account number |
|
||||
| bank_id | string | The bank_id that needs to be deleted. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"instruments": [
|
||||
{
|
||||
"method": "paylater",
|
||||
"provider": "lazypay",
|
||||
"eligibility_req_id": "elig_LBwGKVvS2X48Lq",
|
||||
"eligibility": {
|
||||
"status": "eligible"
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "paylater",
|
||||
"provider": "getsimpl",
|
||||
"eligibility_req_id": "elig_LBwGKVvS2X48Lq",
|
||||
"eligibility": {
|
||||
"status": "ineligible",
|
||||
"error": {
|
||||
"code": "GATEWAY_ERROR",
|
||||
"description": "The customer has exhausted their credit limit",
|
||||
"source": "gateway",
|
||||
"step": "inquiry",
|
||||
"reason": "credit_limit_exhausted"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/customers/)**
|
||||
248
vendor/razorpay/razorpay/documents/dispute.md
vendored
Normal file
248
vendor/razorpay/razorpay/documents/dispute.md
vendored
Normal file
@ -0,0 +1,248 @@
|
||||
## Document
|
||||
|
||||
### Fetch All Disputes
|
||||
|
||||
```php
|
||||
$api->dispute->all();
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "disp_Esz7KAitoYM7PJ",
|
||||
"entity": "dispute",
|
||||
"payment_id": "pay_EsyWjHrfzb59eR",
|
||||
"amount": 10000,
|
||||
"currency": "INR",
|
||||
"amount_deducted": 0,
|
||||
"reason_code": "pre_arbitration",
|
||||
"respond_by": 1590604200,
|
||||
"status": "open",
|
||||
"phase": "pre_arbitration",
|
||||
"created_at": 1590059211,
|
||||
"evidence": {
|
||||
"amount": 10000,
|
||||
"summary": null,
|
||||
"shipping_proof": null,
|
||||
"billing_proof": null,
|
||||
"cancellation_proof": null,
|
||||
"customer_communication": null,
|
||||
"proof_of_service": null,
|
||||
"explanation_letter": null,
|
||||
"refund_confirmation": null,
|
||||
"access_activity_log": null,
|
||||
"refund_cancellation_policy": null,
|
||||
"term_and_conditions": null,
|
||||
"others": null,
|
||||
"submitted_at": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a Dispute
|
||||
|
||||
```php
|
||||
$disputeId = "disp_0000000000000";
|
||||
|
||||
$api->dispute->fetch($disputeId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| id* | string | The unique identifier of the dispute. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "disp_AHfqOvkldwsbqt",
|
||||
"entity": "dispute",
|
||||
"payment_id": "pay_EsyWjHrfzb59eR",
|
||||
"amount": 10000,
|
||||
"currency": "INR",
|
||||
"amount_deducted": 0,
|
||||
"reason_code": "pre_arbitration",
|
||||
"respond_by": 1590604200,
|
||||
"status": "open",
|
||||
"phase": "pre_arbitration",
|
||||
"created_at": 1590059211,
|
||||
"evidence": {
|
||||
"amount": 10000,
|
||||
"summary": "goods delivered",
|
||||
"shipping_proof": null,
|
||||
"billing_proof": null,
|
||||
"cancellation_proof": null,
|
||||
"customer_communication": null,
|
||||
"proof_of_service": null,
|
||||
"explanation_letter": null,
|
||||
"refund_confirmation": null,
|
||||
"access_activity_log": null,
|
||||
"refund_cancellation_policy": null,
|
||||
"term_and_conditions": null,
|
||||
"others": null,
|
||||
"submitted_at": null
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a Dispute
|
||||
|
||||
```php
|
||||
$disputeId = "disp_0000000000000";
|
||||
|
||||
$api->dispute->fetch($disputeId)->accept();
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "disp_AHfqOvkldwsbqt",
|
||||
"entity": "dispute",
|
||||
"payment_id": "pay_EsyWjHrfzb59eR",
|
||||
"amount": 10000,
|
||||
"currency": "INR",
|
||||
"amount_deducted": 10000,
|
||||
"reason_code": "pre_arbitration",
|
||||
"respond_by": 1590604200,
|
||||
"status": "lost",
|
||||
"phase": "pre_arbitration",
|
||||
"created_at": 1590059211,
|
||||
"evidence": {
|
||||
"amount": 10000,
|
||||
"summary": null,
|
||||
"shipping_proof": null,
|
||||
"billing_proof": null,
|
||||
"cancellation_proof": null,
|
||||
"customer_communication": null,
|
||||
"proof_of_service": null,
|
||||
"explanation_letter": null,
|
||||
"refund_confirmation": null,
|
||||
"access_activity_log": null,
|
||||
"refund_cancellation_policy": null,
|
||||
"term_and_conditions": null,
|
||||
"others": null,
|
||||
"submitted_at": null
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Contest a Dispute
|
||||
|
||||
```php
|
||||
|
||||
//Use this API sample code for draft
|
||||
|
||||
$disputeId = "disp_0000000000000";
|
||||
|
||||
$api->dispute->fetch($disputeId)->contest(array("amount" => 5000, "summary" => "goods delivered", "shipping_proof" => array("doc_EFtmUsbwpXwBH9", "doc_EFtmUsbwpXwBH8"), "others" => array(array("type" => "receipt_signed_by_customer", "document_ids" => array("doc_EFtmUsbwpXwBH1", "doc_EFtmUsbwpXwBH7"))), "action" => "draft"));
|
||||
|
||||
|
||||
//Use this API sample code for submit
|
||||
|
||||
$api->dispute->fetch($disputeId)->contest(array("billing_proof" => array("doc_EFtmUsbwpXwBG9", "doc_EFtmUsbwpXwBG8"), "action" => "submit"));
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
|
||||
// Draft
|
||||
{
|
||||
"id": "disp_AHfqOvkldwsbqt",
|
||||
"entity": "dispute",
|
||||
"payment_id": "pay_EsyWjHrfzb59eR",
|
||||
"amount": 10000,
|
||||
"currency": "INR",
|
||||
"amount_deducted": 0,
|
||||
"reason_code": "chargeback",
|
||||
"respond_by": 1590604200,
|
||||
"status": "open",
|
||||
"phase": "chargeback",
|
||||
"created_at": 1590059211,
|
||||
"evidence": {
|
||||
"amount": 5000,
|
||||
"summary": "goods delivered",
|
||||
"shipping_proof": [
|
||||
"doc_EFtmUsbwpXwBH9",
|
||||
"doc_EFtmUsbwpXwBH8"
|
||||
],
|
||||
"billing_proof": null,
|
||||
"cancellation_proof": null,
|
||||
"customer_communication": null,
|
||||
"proof_of_service": null,
|
||||
"explanation_letter": null,
|
||||
"refund_confirmation": null,
|
||||
"access_activity_log": null,
|
||||
"refund_cancellation_policy": null,
|
||||
"term_and_conditions": null,
|
||||
"others": [
|
||||
{
|
||||
"type": "receipt_signed_by_customer",
|
||||
"document_ids": [
|
||||
"doc_EFtmUsbwpXwBH1",
|
||||
"doc_EFtmUsbwpXwBH7"
|
||||
]
|
||||
}
|
||||
],
|
||||
"submitted_at": null
|
||||
}
|
||||
}
|
||||
|
||||
//Submit
|
||||
{
|
||||
"id": "disp_AHfqOvkldwsbqt",
|
||||
"entity": "dispute",
|
||||
"payment_id": "pay_EsyWjHrfzb59eR",
|
||||
"amount": 10000,
|
||||
"currency": "INR",
|
||||
"amount_deducted": 0,
|
||||
"reason_code": "chargeback",
|
||||
"respond_by": 1590604200,
|
||||
"status": "under_review",
|
||||
"phase": "chargeback",
|
||||
"created_at": 1590059211,
|
||||
"evidence": {
|
||||
"amount": 5000,
|
||||
"summary": "goods delivered",
|
||||
"shipping_proof": [
|
||||
"doc_EFtmUsbwpXwBH9",
|
||||
"doc_EFtmUsbwpXwBH8"
|
||||
],
|
||||
"billing_proof": [
|
||||
"doc_EFtmUsbwpXwBG9",
|
||||
"doc_EFtmUsbwpXwBG8"
|
||||
],
|
||||
"cancellation_proof": null,
|
||||
"customer_communication": null,
|
||||
"proof_of_service": null,
|
||||
"explanation_letter": null,
|
||||
"refund_confirmation": null,
|
||||
"access_activity_log": null,
|
||||
"refund_cancellation_policy": null,
|
||||
"term_and_conditions": null,
|
||||
"others": [
|
||||
{
|
||||
"type": "receipt_signed_by_customer",
|
||||
"document_ids": [
|
||||
"doc_EFtmUsbwpXwBH1",
|
||||
"doc_EFtmUsbwpXwBH7"
|
||||
]
|
||||
}
|
||||
],
|
||||
"submitted_at": 1590603200
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/documents)**
|
||||
71
vendor/razorpay/razorpay/documents/document.md
vendored
Normal file
71
vendor/razorpay/razorpay/documents/document.md
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
## Document
|
||||
|
||||
### Create a Document
|
||||
|
||||
```php
|
||||
|
||||
$payload = array(
|
||||
'file'=> '/Users/your_name/Downloads/sample_uploaded.pdf'
|
||||
"purpose" => "dispute_evidence"
|
||||
);
|
||||
|
||||
$api->document->create($payload);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| file* | string | The URL generated once the business proof document is uploaded. |
|
||||
| purpose | string | Possible value is `dispute_evidence` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "doc_EsyWjHrfzb59Re",
|
||||
"entity": "document",
|
||||
"purpose": "dispute_evidence",
|
||||
"name": "doc_19_12_2020.jpg",
|
||||
"mime_type": "image/png",
|
||||
"size": 2863,
|
||||
"created_at": 1590604200
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch Document Information
|
||||
|
||||
```php
|
||||
$documentId = "";
|
||||
|
||||
$api->document->fetch($documentId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the addons were created |
|
||||
| to | timestamp | timestamp before which the addons were created |
|
||||
| count | integer | number of addons to fetch (default: 10) |
|
||||
| skip | integer | number of addons to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "document",
|
||||
"id": "doc_00000000000000",
|
||||
"purpose": "dispute_evidence",
|
||||
"created_at": 1701701378,
|
||||
"mime_type": "application/pdf",
|
||||
"display_name": "ppm_00000000000000",
|
||||
"size": 404678,
|
||||
"url": ""
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/documents)**
|
||||
431
vendor/razorpay/razorpay/documents/emandate.md
vendored
Normal file
431
vendor/razorpay/razorpay/documents/emandate.md
vendored
Normal file
@ -0,0 +1,431 @@
|
||||
## Emandates
|
||||
|
||||
### Create customer
|
||||
```php
|
||||
$api->customer->create(array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'fail_existing' => "1",
|
||||
'contact'=>'9000090000',
|
||||
'notes'=> array(
|
||||
'notes_key_1'=> 'Tea, Earl Grey, Hot',
|
||||
'notes_key_2'=> 'Tea, Earl Grey... decaf'
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| name* | string | Name of the customer |
|
||||
| email | string | Email of the customer |
|
||||
| fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `1` or `0`|
|
||||
| contact | string | Contact number of the customer |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "cust_1Aa00000000003",
|
||||
"entity": "customer",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "Gaurav.Kumar@example.com",
|
||||
"contact": "9000000000",
|
||||
"gstin": null,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1582033731
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create order
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 0,'currency' => 'INR','method' => 'emandate','payment_capture' => true, 'customer_id' => 'cust_JdumbHq5F3kKu6','receipt' => 'Receipt No. #19','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'))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| method* | string | Payment method used to make the registration transaction. Possible value is `emandate`. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| payment_capture* | boolean | Indicates whether payment status should be changed to captured automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically. |
|
||||
| token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#112-create-an-order) are supported|
|
||||
| notes | object | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
Create order response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/#112-create-an-order)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an Authorization Payment
|
||||
|
||||
Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/#113-create-an-authorization-payment) for authorization payment
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create registration link
|
||||
|
||||
```php
|
||||
$api->subscription->createSubscriptionRegistration(array(
|
||||
'customer' => array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9123456780'
|
||||
),
|
||||
'type' => 'link',
|
||||
'amount' => 0,
|
||||
'currency' => 'INR',
|
||||
'description' => 'Registration Link for Gaurav Kumar',
|
||||
'subscription_registration' => array(
|
||||
'method' => 'emandate',
|
||||
'auth_type' => 'netbanking',
|
||||
'max_amount' => '500',
|
||||
'bank_account' => array(
|
||||
'beneficiary_name' => 'Gaurav Kumar',
|
||||
'account_number' => '1121431121541121',
|
||||
'account_type' => 'savings',
|
||||
'ifsc_code' => 'HDFC0001233'
|
||||
),
|
||||
'expire_at' => '1634215992'
|
||||
),
|
||||
'receipt' => 'Receipt No. 5',
|
||||
'email_notify' => true,
|
||||
'sms_notify' => true,
|
||||
'expire_by' => 1634215992,
|
||||
'notes' => array(
|
||||
'note_key 1' => 'Beam me up Scotty',
|
||||
'note_key 2' => 'Tea. Earl Gray. Hot.'
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customer* | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#121-create-a-registration-link) are supported |
|
||||
| type* | string | In this case, the value is `link`. |
|
||||
| currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
|
||||
| amount* | integer | The payment amount in the smallest currency sub-unit. |
|
||||
| description* | string | A description that appears on the hosted page. For example, `12:30 p.m. Thali meals (Gaurav Kumar`). |
|
||||
| subscription_registration | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#121-create-a-registration-link) are supported |
|
||||
| sms_notify | boolean | SMS notifications are to be sent by Razorpay (default : true) |
|
||||
| email_notify | boolean | Email notifications are to be sent by Razorpay (default : true) |
|
||||
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
Create registration link response please click [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/create-authorization-transaction/#121-create-a-registration-link)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Send/Resend notifications
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->notifyBy($medium);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be notified |
|
||||
| medium* | string | `sms`/`email`, Medium through which notification should be sent. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"success": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Cancel a registration link
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->cancel();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be cancelled |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_FHrfRupD2ouKIt",
|
||||
"entity": "invoice",
|
||||
"receipt": "Receipt No. 1",
|
||||
"invoice_number": "Receipt No. 1",
|
||||
"customer_id": "cust_BMB3EwbqnqZ2EI",
|
||||
"customer_details": {
|
||||
"id": "cust_BMB3EwbqnqZ2EI",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9123456780",
|
||||
"gstin": null,
|
||||
"billing_address": null,
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9123456780"
|
||||
},
|
||||
"order_id": "order_FHrfRw4TZU5Q2L",
|
||||
"line_items": [],
|
||||
"payment_id": null,
|
||||
"status": "cancelled",
|
||||
"expire_by": 4102444799,
|
||||
"issued_at": 1595491479,
|
||||
"paid_at": null,
|
||||
"cancelled_at": 1595491488,
|
||||
"expired_at": null,
|
||||
"sms_status": "sent",
|
||||
"email_status": "sent",
|
||||
"date": 1595491479,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 100,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"amount": 100,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 100,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "Registration Link for Gaurav Kumar",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/QlfexTj",
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "link",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1595491480,
|
||||
"idempotency_key": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch token by payment ID
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|------------|--------|-----------------------------------|
|
||||
| paymentId* | string | Id of the payment to be retrieved |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "pay_FHf9a7AO0iXM9I",
|
||||
"entity": "payment",
|
||||
"amount": 0,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_FHf9OwSeyetnKC",
|
||||
"invoice_id": "inv_FHf9P2hhXEti7i",
|
||||
"international": false,
|
||||
"method": "emandate",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": null,
|
||||
"card_id": null,
|
||||
"bank": "HDFC",
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919876543210",
|
||||
"customer_id": "cust_DtHaBuooGHTuyZ",
|
||||
"token_id": "token_FHf9aAZR9hWJkq",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {},
|
||||
"created_at": 1595447410
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch tokens by customer ID
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->all();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "token_FHf94Uym9tdYFJ",
|
||||
"entity": "token",
|
||||
"token": "2wDPM7VAlXtjAR",
|
||||
"bank": "HDFC",
|
||||
"wallet": null,
|
||||
"method": "emandate",
|
||||
"vpa": null,
|
||||
"recurring": true,
|
||||
"recurring_details": {
|
||||
"status": "confirmed",
|
||||
"failure_reason": null
|
||||
},
|
||||
"auth_type": "netbanking",
|
||||
"mrn": null,
|
||||
"used_at": 1595447381,
|
||||
"created_at": 1595447381,
|
||||
"bank_details": {
|
||||
"beneficiary_name": "Gaurav Kumar",
|
||||
"account_number": "1121431121541121",
|
||||
"ifsc": "HDFC0000001",
|
||||
"account_type": "savings"
|
||||
},
|
||||
"max_amount": 9999900,
|
||||
"expired_at": 1689971140,
|
||||
"dcc_enabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete token
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->delete($tokenId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"deleted": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an order to charge the customer
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 1000,'currency' => 'INR','payment_capture' => true,'receipt' => 'Receipt No. 1','notes'=> array('notes_key_1' => 'Tea, Earl Grey, Hot', 'notes_key_2' => 'Tea, Earl Grey… decaf.')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | Currency of the order. Currently only `INR` is supported. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| notes | array | A key-value pair |
|
||||
| payment_capture | boolean | Indicates whether payment status should be changed to captured automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"order_1Aa00000000002",
|
||||
"entity":"order",
|
||||
"amount":1000,
|
||||
"amount_paid":0,
|
||||
"amount_due":1000,
|
||||
"currency":"INR",
|
||||
"receipt":"Receipt No. 1",
|
||||
"offer_id":null,
|
||||
"status":"created",
|
||||
"attempts":0,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at":1579782776
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create a Recurring Payment
|
||||
|
||||
```php
|
||||
$api->payment->createRecurring(array(
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9000090000',
|
||||
'amount' => 100,
|
||||
'currency' => 'INR',
|
||||
'order_id' => 'order_1Aa00000000002',
|
||||
'customer_id' => 'cust_1Aa00000000001',
|
||||
'token' => 'token_1Aa00000000001',
|
||||
'recurring' => true,
|
||||
'description' => 'Creating recurring payment for Gaurav Kumar'
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| email* | string | The customer's email address. |
|
||||
| contact* | string | The customer's phone number. |
|
||||
| amount* | integer | The amount you want to charge your customer. This should be the same as the amount in the order. |
|
||||
| currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
|
||||
| order_id* | string | The unique identifier of the order created. |
|
||||
| customer_id* | string | The `customer_id` for the customer you want to charge. |
|
||||
| token* | string | The `token_id` generated when the customer successfully completes the authorization payment. Different payment instruments for the same customer have different `token_id`.|
|
||||
| recurring* | string | Determines if recurring payment is enabled or not. Possible values:<br>* `true` - Recurring is enabled.* `false` - Recurring is not enabled.|
|
||||
| description | string | A user-entered description for the payment.|
|
||||
| notes | array | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id" : "pay_1Aa00000000001",
|
||||
"razorpay_order_id" : "order_1Aa00000000001",
|
||||
"razorpay_signature" : "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/recurring-payments/emandate/authorization-transaction/)**
|
||||
79
vendor/razorpay/razorpay/documents/fund.md
vendored
Normal file
79
vendor/razorpay/razorpay/documents/fund.md
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
## Funds
|
||||
|
||||
### Create a fund account
|
||||
```php
|
||||
$api->fundAccount->create(array('customer_id'=>$customerId,'account_type'=>'bank_account','bank_account'=>array('name'=>'Gaurav Kumar', 'account_number'=>'11214311215411', 'ifsc'=>'HDFC0000053')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| account_type* | string | The bank_account to be linked to the customer ID |
|
||||
| bank_account* | array | All keys listed [here](https://razorpay.com/docs/payments/customers/customer-fund-account-api/#create-a-fund-account) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "fa_JcXaLomo4ck5IY",
|
||||
"entity": "fund_account",
|
||||
"customer_id": "cust_JZse2vlC5nK9AQ",
|
||||
"account_type": "bank_account",
|
||||
"bank_account": {
|
||||
"ifsc": "HDFC0000053",
|
||||
"bank_name": "HDFC Bank",
|
||||
"name": "Gaurav Kumar",
|
||||
"notes": [],
|
||||
"account_number": "11214311215411"
|
||||
},
|
||||
"batch_id": null,
|
||||
"active": true,
|
||||
"created_at": 1654154246
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all fund accounts
|
||||
|
||||
```php
|
||||
$api->fundAccount->all(array('customer_id'=>$customerIds));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 2,
|
||||
"items": [
|
||||
{
|
||||
"id": "fa_JcXYtecLkhW74k",
|
||||
"entity": "fund_account",
|
||||
"customer_id": "cust_JZse2vlC5nK9AQ",
|
||||
"account_type": "bank_account",
|
||||
"bank_account": {
|
||||
"ifsc": "HDFC0000053",
|
||||
"bank_name": "HDFC Bank",
|
||||
"name": "Gaurav Kumar",
|
||||
"notes": [],
|
||||
"account_number": "11214311215411"
|
||||
},
|
||||
"batch_id": null,
|
||||
"active": true,
|
||||
"created_at": 1654154163
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/payments/customers/customer-fund-account-api/)**
|
||||
540
vendor/razorpay/razorpay/documents/invoice.md
vendored
Normal file
540
vendor/razorpay/razorpay/documents/invoice.md
vendored
Normal file
@ -0,0 +1,540 @@
|
||||
## Invoices
|
||||
|
||||
### Create Invoice
|
||||
|
||||
Request #1
|
||||
In this example, an invoice is created using the customer and item details. Here, the customer and item are created while creating the invoice.
|
||||
```php
|
||||
$api->invoice->create(array ('type' => 'invoice','description' => 'Invoice for the month of January 2020','partial_payment' => true,'customer' =>array ('name' => 'Gaurav Kumar','contact' => 9999999999,'email' => 'gaurav.kumar@example.com','billing_address' => array ('line1' => 'Ground & 1st Floor, SJR Cyber Laskar','line2' => 'Hosur Road','zipcode' => '560068','city' => 'Bengaluru','state' => 'Karnataka','country' => 'in'),'shipping_address' => array ('line1' => 'Ground & 1st Floor, SJR Cyber Laskar','line2' => 'Hosur Road','zipcode' => '560068','city' => 'Bengaluru','state' => 'Karnataka','country' => 'in')),'line_items' => array (array ('name' => 'Master Cloud Computing in 30 Days','description' => 'Book by Ravena Ravenclaw','amount' => 399,'currency' => 'USD','quantity' => 1)),'sms_notify' => 1,'email_notify' => 1,'currency' => 'USD','expire_by' => 1589765167));
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|type* | string | entity type (here its invoice) |
|
||||
|description | string | A brief description of the invoice. |
|
||||
|customer_id | string | customer id for which invoice need be raised |
|
||||
|draft | string | Invoice is created in draft state when value is set to `1` |
|
||||
| customer* | array | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#create-an-invoice) are supported |
|
||||
| line_items | array | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#create-an-invoice) are supported |
|
||||
|expire_by | array | Details of the line item that is billed in the invoice. |
|
||||
|sms_notify | array | Details of the line item that is billed in the invoice. |
|
||||
|email_notify | array | Details of the line item that is billed in the invoice. |
|
||||
|partial_payment | boolean | Indicates whether customers can make partial payments on the invoice . Possible values: true - Customer can make partial payments. false (default) - Customer cannot make partial payments. |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
|
||||
|
||||
Request #2
|
||||
In this example, an invoice is created using existing `customer_id` and `item_id`
|
||||
```php
|
||||
$api->invoice->create(array ('type' => 'invoice','date' => 1589994898, 'customer_id'=> 'cust_E7q0trFqXgExmT', 'line_items'=>array(array('item_id'=>'item_DRt61i2NnL8oy6'))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|type* | string | entity type (here its invoice) |
|
||||
|description | string | A brief description of the invoice. |
|
||||
|customer_id | string | customer id for which invoice need be raised |
|
||||
| customer* | array | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#create-an-invoice) are supported |
|
||||
| line_items | array | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#create-an-invoice) are supported |
|
||||
| sms_notify | boolean | SMS notifications are to be sent by Razorpay (default : 1) |
|
||||
| currency* (conditionally mandatory) | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
|
||||
| email_notify | boolean | Email notifications are to be sent by Razorpay (default : 1) |
|
||||
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
|
||||
|
||||
**Response:**
|
||||
For create invoice response please click [here](https://razorpay.com/docs/api/invoices/#create-an-invoice)
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all invoices
|
||||
|
||||
```php
|
||||
$api->invoice->all();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|type | string | entity type (here its invoice) |
|
||||
|payment_id | string | The unique identifier of the payment made by the customer against the invoice. |
|
||||
|customer_id | string | The unique identifier of the customer. |
|
||||
|receipt | string | The unique receipt number that you entered for internal purposes. |
|
||||
|
||||
**Response:**
|
||||
For fetch all invoice response please click [here](https://razorpay.com/docs/api/invoices/#fetch-multiple-invoices)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch invoice
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"amount": 1000,
|
||||
"amount_due": 1000,
|
||||
"amount_paid": 0,
|
||||
"billing_end": null,
|
||||
"billing_start": null,
|
||||
"cancelled_at": null,
|
||||
"comment": null,
|
||||
"created_at": 1653596202,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"customer_details": {
|
||||
"billing_address": null,
|
||||
"contact": "99991111999",
|
||||
"customer_contact": "99991111999",
|
||||
"customer_email": "gauraa.kumar@example.com",
|
||||
"customer_name": "Gauravss Kumar",
|
||||
"email": "gauraa.kumar@example.com",
|
||||
"gstin": null,
|
||||
"id": "cust_JDdNazagOgg9Ig",
|
||||
"name": "Gauravss Kumar",
|
||||
"shipping_address": null
|
||||
},
|
||||
"customer_id": "cust_JDdNazagOgg9Ig",
|
||||
"date": 1589994898,
|
||||
"description": null,
|
||||
"email_status": "sent",
|
||||
"entity": "invoice",
|
||||
"expire_by": null,
|
||||
"expired_at": null,
|
||||
"first_payment_min_amount": null,
|
||||
"gross_amount": 1000,
|
||||
"group_taxes_discounts": false,
|
||||
"id": "inv_JZz7g9hSZS9IsG",
|
||||
"idempotency_key": null,
|
||||
"invoice_number": null,
|
||||
"issued_at": 1653596202,
|
||||
"line_items": [
|
||||
{
|
||||
"amount": 1000,
|
||||
"currency": "INR",
|
||||
"description": null,
|
||||
"gross_amount": 1000,
|
||||
"hsn_code": null,
|
||||
"id": "li_JZz7gAI2W3Arg2",
|
||||
"item_id": "item_J7lZCyxMVeEtYB",
|
||||
"name": "Test item",
|
||||
"net_amount": 1000,
|
||||
"quantity": 1,
|
||||
"ref_id": null,
|
||||
"ref_type": null,
|
||||
"sac_code": null,
|
||||
"tax_amount": 0,
|
||||
"tax_inclusive": false,
|
||||
"tax_rate": null,
|
||||
"taxable_amount": 1000,
|
||||
"taxes": [],
|
||||
"type": "invoice",
|
||||
"unit": null,
|
||||
"unit_amount": 1000
|
||||
}
|
||||
],
|
||||
"notes": [],
|
||||
"order_id": "order_JZz7gBTZjtUgBO",
|
||||
"paid_at": null,
|
||||
"partial_payment": false,
|
||||
"payment_id": null,
|
||||
"receipt": null,
|
||||
"reminder_status": null,
|
||||
"short_url": "https://rzp.io/i/DGpanoT",
|
||||
"sms_status": "pending",
|
||||
"status": "issued",
|
||||
"subscription_status": null,
|
||||
"supply_state_code": null,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 1000,
|
||||
"terms": null,
|
||||
"type": "invoice",
|
||||
"user_id": null,
|
||||
"view_less": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Update invoice
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->edit(array('line_items' => array(array('id' => 'li_DAweOizsysoJU6','name' => 'Book / English August - Updated name and quantity','quantity' => 1),array('name' => 'Book / A Wild Sheep Chase','amount' => 200,'currency' => 'INR','quantity' => 1)),'notes' => array('updated-key' => 'An updated note.')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be fetched |
|
||||
| line_items | array | All parameters listed [here](https://razorpay.com/docs/api/payments/invoices/#update-an-invoice) are supported |
|
||||
| notes | array | key value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_DAweOiQ7amIUVd",
|
||||
"entity": "invoice",
|
||||
"receipt": "#0961",
|
||||
"invoice_number": "#0961",
|
||||
"customer_id": "cust_DAtUWmvpktokrT",
|
||||
"customer_details": {
|
||||
"id": "cust_DAtUWmvpktokrT",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9977886633",
|
||||
"gstin": null,
|
||||
"billing_address": {
|
||||
"id": "addr_DAtUWoxgu91obl",
|
||||
"type": "billing_address",
|
||||
"primary": true,
|
||||
"line1": "318 C-Wing, Suyog Co. Housing Society Ltd.",
|
||||
"line2": "T.P.S Road, Vazira, Borivali",
|
||||
"zipcode": "400092",
|
||||
"city": "Mumbai",
|
||||
"state": "Maharashtra",
|
||||
"country": "in"
|
||||
},
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9977886633"
|
||||
},
|
||||
"order_id": null,
|
||||
"line_items": [
|
||||
{
|
||||
"id": "li_DAweOizsysoJU6",
|
||||
"item_id": null,
|
||||
"name": "Book / English August - Updated name and quantity",
|
||||
"description": "150 points in Quidditch",
|
||||
"amount": 400,
|
||||
"unit_amount": 400,
|
||||
"gross_amount": 400,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 400,
|
||||
"net_amount": 400,
|
||||
"currency": "INR",
|
||||
"type": "invoice",
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"unit": null,
|
||||
"quantity": 1,
|
||||
"taxes": []
|
||||
}
|
||||
],
|
||||
"payment_id": null,
|
||||
"status": "draft",
|
||||
"expire_by": 1567103399,
|
||||
"issued_at": null,
|
||||
"paid_at": null,
|
||||
"cancelled_at": null,
|
||||
"expired_at": null,
|
||||
"sms_status": null,
|
||||
"email_status": null,
|
||||
"date": 1566891149,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 600,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 600,
|
||||
"amount": 600,
|
||||
"amount_paid": null,
|
||||
"amount_due": null,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "This is a test invoice.",
|
||||
"notes": {
|
||||
"updated-key": "An updated note."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": null,
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "invoice",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1566906474,
|
||||
"idempotency_key": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Issue an invoice
|
||||
|
||||
Only an invoice in the `draft` state can be issued.
|
||||
```php
|
||||
|
||||
$api->invoice->fetch($invoiceId)->issue();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be issued |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_DAweOiQ7amIUVd",
|
||||
"entity": "invoice",
|
||||
"receipt": "#0961",
|
||||
"invoice_number": "#0961",
|
||||
"customer_id": "cust_DAtUWmvpktokrT",
|
||||
"customer_details": {
|
||||
"id": "cust_DAtUWmvpktokrT",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9977886633",
|
||||
"gstin": null,
|
||||
"billing_address": {
|
||||
"id": "addr_DAtUWoxgu91obl",
|
||||
"type": "billing_address",
|
||||
"primary": true,
|
||||
"line1": "318 C-Wing, Suyog Co. Housing Society Ltd.",
|
||||
"line2": "T.P.S Road, Vazira, Borivali",
|
||||
"zipcode": "400092",
|
||||
"city": "Mumbai",
|
||||
"state": "Maharashtra",
|
||||
"country": "in"
|
||||
},
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9977886633"
|
||||
},
|
||||
"order_id": "order_DBG3P8ZgDd1dsG",
|
||||
"line_items": [
|
||||
{
|
||||
"id": "li_DAweOizsysoJU6",
|
||||
"item_id": null,
|
||||
"name": "Book / English August - Updated name and quantity",
|
||||
"description": "150 points in Quidditch",
|
||||
"amount": 400,
|
||||
"unit_amount": 400,
|
||||
"gross_amount": 400,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 400,
|
||||
"net_amount": 400,
|
||||
"currency": "INR",
|
||||
"type": "invoice",
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"unit": null,
|
||||
"quantity": 1,
|
||||
"taxes": []
|
||||
},
|
||||
{
|
||||
"id": "li_DAwjWQUo07lnjF",
|
||||
"item_id": null,
|
||||
"name": "Book / A Wild Sheep Chase",
|
||||
"description": null,
|
||||
"amount": 200,
|
||||
"unit_amount": 200,
|
||||
"gross_amount": 200,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 200,
|
||||
"net_amount": 200,
|
||||
"currency": "INR",
|
||||
"type": "invoice",
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"unit": null,
|
||||
"quantity": 1,
|
||||
"taxes": []
|
||||
}
|
||||
],
|
||||
"payment_id": null,
|
||||
"status": "issued",
|
||||
"expire_by": 1567103399,
|
||||
"issued_at": 1566974805,
|
||||
"paid_at": null,
|
||||
"cancelled_at": null,
|
||||
"expired_at": null,
|
||||
"sms_status": null,
|
||||
"email_status": null,
|
||||
"date": 1566891149,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 600,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 600,
|
||||
"amount": 600,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 600,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "This is a test invoice.",
|
||||
"notes": {
|
||||
"updated-key": "An updated note."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/K8Zg72C",
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "invoice",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1566906474,
|
||||
"idempotency_key": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete an invoice
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->delete();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be deleted |
|
||||
|
||||
**Response:**
|
||||
```
|
||||
[]
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Cancel an invoice
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->cancel();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be cancelled |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"amount": 1000,
|
||||
"amount_due": 1000,
|
||||
"amount_paid": 0,
|
||||
"billing_end": null,
|
||||
"billing_start": null,
|
||||
"cancelled_at": 1654159207,
|
||||
"comment": null,
|
||||
"created_at": 1653596202,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"customer_details": {
|
||||
"billing_address": null,
|
||||
"contact": "99991111999",
|
||||
"customer_contact": "99991111999",
|
||||
"customer_email": "gauraa.kumar@example.com",
|
||||
"customer_name": "Gauravss Kumar",
|
||||
"email": "gauraa.kumar@example.com",
|
||||
"gstin": null,
|
||||
"id": "cust_JDdNazagOgg9Ig",
|
||||
"name": "Gauravss Kumar",
|
||||
"shipping_address": null
|
||||
},
|
||||
"customer_id": "cust_JDdNazagOgg9Ig",
|
||||
"date": 1589994898,
|
||||
"description": null,
|
||||
"email_status": "sent",
|
||||
"entity": "invoice",
|
||||
"expire_by": null,
|
||||
"expired_at": null,
|
||||
"first_payment_min_amount": null,
|
||||
"gross_amount": 1000,
|
||||
"group_taxes_discounts": false,
|
||||
"id": "inv_JZz7g9hSZS9IsG",
|
||||
"idempotency_key": null,
|
||||
"invoice_number": null,
|
||||
"issued_at": 1653596202,
|
||||
"line_items": [
|
||||
{
|
||||
"amount": 1000,
|
||||
"currency": "INR",
|
||||
"description": null,
|
||||
"gross_amount": 1000,
|
||||
"hsn_code": null,
|
||||
"id": "li_JZz7gAI2W3Arg2",
|
||||
"item_id": "item_J7lZCyxMVeEtYB",
|
||||
"name": "Test item",
|
||||
"net_amount": 1000,
|
||||
"quantity": 1,
|
||||
"ref_id": null,
|
||||
"ref_type": null,
|
||||
"sac_code": null,
|
||||
"tax_amount": 0,
|
||||
"tax_inclusive": false,
|
||||
"tax_rate": null,
|
||||
"taxable_amount": 1000,
|
||||
"taxes": [],
|
||||
"type": "invoice",
|
||||
"unit": null,
|
||||
"unit_amount": 1000
|
||||
}
|
||||
],
|
||||
"notes": [],
|
||||
"order_id": "order_JZz7gBTZjtUgBO",
|
||||
"paid_at": null,
|
||||
"partial_payment": false,
|
||||
"payment_id": null,
|
||||
"receipt": null,
|
||||
"reminder_status": null,
|
||||
"short_url": "https://rzp.io/i/DGpanoT",
|
||||
"sms_status": "pending",
|
||||
"status": "cancelled",
|
||||
"subscription_status": null,
|
||||
"supply_state_code": null,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 1000,
|
||||
"terms": null,
|
||||
"type": "invoice",
|
||||
"user_id": null,
|
||||
"view_less": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Send notification
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->notifyBy($medium);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be notified |
|
||||
| medium* | string | `sms`/`email`, Medium through which notification should be sent. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"success": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/invoices)**
|
||||
197
vendor/razorpay/razorpay/documents/item.md
vendored
Normal file
197
vendor/razorpay/razorpay/documents/item.md
vendored
Normal file
@ -0,0 +1,197 @@
|
||||
## items
|
||||
|
||||
### Create item
|
||||
|
||||
```php
|
||||
$api->Item->create(array("name" => "Book / English August","description" => "An indian story, Booker prize winner.","amount" => 20000,"currency" => "INR"));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| name* | string | Name of the item. |
|
||||
| description | string | A brief description of the item. |
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | Currency of the order. Currently only `INR` is supported. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "item_JInaSLODeDUQiQ",
|
||||
"active": true,
|
||||
"name": "Book / English August",
|
||||
"description": "An indian story, Booker prize winner.",
|
||||
"amount": 20000,
|
||||
"unit_amount": 20000,
|
||||
"currency": "INR",
|
||||
"type": "invoice",
|
||||
"unit": null,
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"tax_id": null,
|
||||
"tax_group_id": null,
|
||||
"created_at": 1649843796
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all items
|
||||
|
||||
```php
|
||||
$api->Item->all($options);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the item were created |
|
||||
| to | timestamp | timestamp before which the item were created |
|
||||
| count | integer | number of item to fetch (default: 10) |
|
||||
| skip | integer | number of item to be skipped (default: 0) |
|
||||
| active | boolean | Possible values is `0` or `1` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 2,
|
||||
"items": [
|
||||
{
|
||||
"id": "item_JInaSLODeDUQiQ",
|
||||
"active": true,
|
||||
"name": "Book / English August",
|
||||
"description": "An indian story, Booker prize winner.",
|
||||
"amount": 20000,
|
||||
"unit_amount": 20000,
|
||||
"currency": "INR",
|
||||
"type": "invoice",
|
||||
"unit": null,
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"tax_id": null,
|
||||
"tax_group_id": null,
|
||||
"created_at": 1649843796
|
||||
},
|
||||
{
|
||||
"id": "item_JIPSg5L06yhHie",
|
||||
"active": false,
|
||||
"name": "Book / Ignited Minds - Updated name!",
|
||||
"description": "New descirption too. :).",
|
||||
"amount": 20000,
|
||||
"unit_amount": 20000,
|
||||
"currency": "INR",
|
||||
"type": "invoice",
|
||||
"unit": null,
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"tax_id": null,
|
||||
"tax_group_id": null,
|
||||
"created_at": 1649758835
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Fetch particular item
|
||||
|
||||
```php
|
||||
$api->Item->fetch($itemId);
|
||||
```
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------|--------|-------------------------------------|
|
||||
| itemId* | string | The id of the item to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "item_JInaSLODeDUQiQ",
|
||||
"active": true,
|
||||
"name": "Book / English August",
|
||||
"description": "An indian story, Booker prize winner.",
|
||||
"amount": 20000,
|
||||
"unit_amount": 20000,
|
||||
"currency": "INR",
|
||||
"type": "invoice",
|
||||
"unit": null,
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"tax_id": null,
|
||||
"tax_group_id": null,
|
||||
"created_at": 1649843796
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Update item
|
||||
|
||||
```php
|
||||
$api->Item->fetch($itemId)->edit(array("name" => "Book / Ignited Minds - Updated name!","description" => "New descirption too. :).","amount" => 20000,"currency" => "INR","active" => true
|
||||
));
|
||||
```
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------|--------|-------------------------------------|
|
||||
| itemId* | string | The id of the item to be fetched |
|
||||
| name | string | Name of the item. |
|
||||
| description | string | A brief description of the item. |
|
||||
| amount | integer | Amount of the order to be paid |
|
||||
| currency | string | Currency of the order. Currently only `INR` is supported. |
|
||||
| active | boolean | Possible values is `0` or `1` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "item_JInaSLODeDUQiQ",
|
||||
"active": true,
|
||||
"name": "Book / Ignited Minds - Updated name!",
|
||||
"description": "New descirption too. :).",
|
||||
"amount": 20000,
|
||||
"unit_amount": 20000,
|
||||
"currency": "INR",
|
||||
"type": "invoice",
|
||||
"unit": null,
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"tax_id": null,
|
||||
"tax_group_id": null,
|
||||
"created_at": 1649843796
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Delete item
|
||||
|
||||
```php
|
||||
$api->Item->fetch($itemId)->delete();
|
||||
```
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------|--------|-------------------------------------|
|
||||
| itemId* | string | The id of the item to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
[]
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/items)**
|
||||
198
vendor/razorpay/razorpay/documents/linkedAccount.md
vendored
Normal file
198
vendor/razorpay/razorpay/documents/linkedAccount.md
vendored
Normal file
@ -0,0 +1,198 @@
|
||||
## Linked Account
|
||||
|
||||
### Create Linked Accounts for Sub-Merchants and Others
|
||||
```php
|
||||
|
||||
|
||||
$api->setHeader('X-Razorpay-Account', 'acc_sub-merchantId');
|
||||
|
||||
$api->account->create(array(
|
||||
"email" => "gauriagain.kumar@example.org",
|
||||
"phone" => "9999999999",
|
||||
"type" => "route",
|
||||
"reference_id" => "124124",
|
||||
"legal_business_name" => "Acme Corp",
|
||||
"business_type" => "partnership",
|
||||
"contact_name" => "Gaurav Kumar",
|
||||
"profile" => array(
|
||||
"category" => "healthcare",
|
||||
"subcategory" => "clinic",
|
||||
"addresses" => array(
|
||||
"registered" => array(
|
||||
"street1" => "507, Koramangala 1st block",
|
||||
"street2" => "MG Road",
|
||||
"city" => "Bengaluru",
|
||||
"state" => "Karnataka",
|
||||
"postal_code" => 560034,
|
||||
"country" => "IN"
|
||||
)
|
||||
),
|
||||
),
|
||||
"legal_info" => array(
|
||||
"pan" => "AAACL1234C",
|
||||
"gst" => "18AABCU9603R1ZM"
|
||||
),
|
||||
));
|
||||
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| email* | string | The sub-merchant's business email address. |
|
||||
| phone* | integer | The sub-merchant's business phone number. The minimum length is 8 characters and the maximum length is 15. |
|
||||
| legal_business_name* | string | The name of the sub-merchant's business. For example, Acme Corp. The minimum length is 4 characters and the maximum length is 200. |
|
||||
| customer_facing_business_name | string | The sub-merchant billing label as it appears on the Razorpay Dashboard. The minimum length is 1 character and the maximum length is 255. |
|
||||
| business_type* | string | The type of business operated by the sub-merchant.Possible value is `proprietorship`, `partnership`, `private_limited`, `public_limited`, `llp`, `ngo`, `trust`, `society`, `not_yet_registered`, `huf` |
|
||||
| reference_id | string | Partner's external account reference id. The minimum length is 1 character and the maximum length is 512. |
|
||||
| profile | object | All keys listed [here](https://razorpay.com/docs/partners/route/linked-accounts/#create-linked-accounts-for-sub-merchants-and-others) are supported |
|
||||
| legal_info | object | All keys listed [here](https://razorpay.com/docs/partners/route/linked-accounts/#create-linked-accounts-for-sub-merchants-and-others) are supported |
|
||||
| contact_info | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
|
||||
| apps | object | All keys listed [here](https://razorpay.com/docs/api/partners/account-onboarding/#create-an-account) are supported |
|
||||
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"acc_GRWKk7qQsLnDjX",
|
||||
"type":"route",
|
||||
"status":"created",
|
||||
"email":"gaurav.kumar@example.com",
|
||||
"profile":{
|
||||
"category":"healthcare",
|
||||
"subcategory":"clinic",
|
||||
"addresses":{
|
||||
"registered":{
|
||||
"street1":"507, Koramangala 1st block",
|
||||
"street2":"MG Road",
|
||||
"city":"Bengaluru",
|
||||
"state":"KARNATAKA",
|
||||
"postal_code":"560034",
|
||||
"country":"IN"
|
||||
}
|
||||
}
|
||||
},
|
||||
"notes":[
|
||||
|
||||
],
|
||||
"created_at":1611136837,
|
||||
"phone":"9999999999",
|
||||
"contact_name":"Gaurav Kumar",
|
||||
"reference_id":"124124",
|
||||
"business_type":"partnership",
|
||||
"legal_business_name":"Acme Corp",
|
||||
"customer_facing_business_name":"Acme Corp",
|
||||
"legal_info":{
|
||||
"pan":"AAACL1234C",
|
||||
"gst":"18AABCU9603R1ZM"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a Linked Account of a Sub-Merchant by id
|
||||
```php
|
||||
$api->setHeader('X-Razorpay-Account', 'acc_sub-merchantId');
|
||||
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
$api->account->fetch($accountId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"acc_GLGeLkU2JUeyDZ",
|
||||
"type":"route",
|
||||
"reference_id":"123123",
|
||||
"status":"created",
|
||||
"email":"gaurav.kumar@example.com",
|
||||
"profile":{
|
||||
"category":"healthcare",
|
||||
"subcategory":"clinic",
|
||||
"addresses":{
|
||||
"registered":{
|
||||
"street1":"507, Koramangala 1st block",
|
||||
"street2":"MG Road",
|
||||
"city":"Bengaluru",
|
||||
"state":"KARNATAKA",
|
||||
"postal_code":560034,
|
||||
"country":"IN"
|
||||
},
|
||||
"operation":{
|
||||
"street1":"507, Koramangala 6th block",
|
||||
"street2":"Kormanagala",
|
||||
"city":"Bengaluru",
|
||||
"state":"KARNATAKA",
|
||||
"country":"IN",
|
||||
"postal_code":560047
|
||||
}
|
||||
},
|
||||
"business_model":null
|
||||
},
|
||||
"notes":[
|
||||
|
||||
],
|
||||
"created_at":1611136837,
|
||||
"phone":"9999999998",
|
||||
"business_type":"partnership",
|
||||
"legal_business_name":"Acme Corp",
|
||||
"customer_facing_business_name":"Acme Corp",
|
||||
"legal_info":{
|
||||
"pan":"AAACL1234C",
|
||||
"gst":"18AABCU9603R1ZM"
|
||||
},
|
||||
"apps":{
|
||||
"websites":[
|
||||
|
||||
],
|
||||
"android":[
|
||||
{
|
||||
"url":null,
|
||||
"name":null
|
||||
}
|
||||
],
|
||||
"ios":[
|
||||
{
|
||||
"url":null,
|
||||
"name":null
|
||||
}
|
||||
]
|
||||
},
|
||||
"brand":{
|
||||
"color":null
|
||||
},
|
||||
"contact_name":"Gaurav Kumar",
|
||||
"contact_info":{
|
||||
"chargeback":{
|
||||
"email":null,
|
||||
"phone":null,
|
||||
"policy_url":null
|
||||
},
|
||||
"refund":{
|
||||
"email":null,
|
||||
"phone":null,
|
||||
"policy_url":null
|
||||
},
|
||||
"support":{
|
||||
"email":null,
|
||||
"phone":null,
|
||||
"policy_url":null
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/partners/route/linked-accounts)**
|
||||
147
vendor/razorpay/razorpay/documents/oAuthTokenClient.md
vendored
Normal file
147
vendor/razorpay/razorpay/documents/oAuthTokenClient.md
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
## OAuth Token Client
|
||||
|
||||
### Generate Authorize Url
|
||||
```php
|
||||
|
||||
use Razorpay\Api\OAuthTokenClient;
|
||||
use Razorpay\Api\Utility;
|
||||
|
||||
// Initialize client
|
||||
$oauth = new OAuthTokenClient();
|
||||
$utility = new Utility();
|
||||
|
||||
$attributes = [
|
||||
"submerchant_id" => "<SUBMERCHANT_MID>",
|
||||
"timestamp" => floor(microtime(true));
|
||||
]
|
||||
|
||||
$onboarding_signature = $utility->generateOnboardingSignature($attributes, "<YOUR_CLIENT_SECRET>");
|
||||
|
||||
// Not an promise
|
||||
$authUrl = $oauth->oauthClient->getAuthURL([
|
||||
"client_id" => "<YOUR_CLIENT_ID>",
|
||||
"response_type" => "code",
|
||||
"redirect_uri" => "https://example.com/razorpay_callback",
|
||||
"scopes" => ["read_write"],
|
||||
"state" => "NOBYtv8r6c75ex6WZ",
|
||||
"onboarding_signature" => $onboarding_signature
|
||||
]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------------------|--|---------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| client_id* | string | Unique client identifier. |
|
||||
| redirect_uri* | string | Callback URL used by Razorpay to redirect after the user approves or denies the authorisation request. The client should whitelist the 'redirect_uri'. |
|
||||
| scopes* | array | Defines what access your application is requesting from the user. You can request one or multiple scopes by adding them to an array as indicated above. |
|
||||
| state* | string | A random string generated by your service. This parameter helps prevent cross-site request forgery (CSRF) attacks. |
|
||||
| onboarding_signature | string | A cryptographic string generated by your service using generateOnboardingSignature method in Utils class. Only applicable for accounts created with pre-fill KYC |
|
||||
|
||||
**Response:**
|
||||
```
|
||||
"https://auth.razorpay.com/authorize?response_type=code&client_id=<YOUR_CLIENT_ID>&redirect_uri=https:%2F%2Fexample.com%2Frazorpay_callback&scope[]=read_only&scope[]=read_write&state=NOBYtv8r6c75ex6WZ&onboarding_signature=<GENERATED_ONBOARDING_SIGNATURE>"
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Get Access token
|
||||
```php
|
||||
$oauth->oauthClient->getAccessToken([
|
||||
"client_id" => "<YOUR_CLIENT_ID>",
|
||||
"client_secret" => "<YOUR_CLIENT_SECRET>",
|
||||
"grant_type" => "authorization_code",
|
||||
"redirect_uri" => "https://example.com",
|
||||
"code" => "def50200d844dc80cc44dce2c665d07a374d76802",
|
||||
"mode" => "test"
|
||||
]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------------|--------|------------------------------------------------------------------------------------------------------------------------------|
|
||||
| client_id* | string | Unique client identifier. |
|
||||
| client_secret* | string | Client secret string. |
|
||||
| redirect_uri* | string | Specifies the same redirect_uri used in the authorisation request. |
|
||||
| grant_type* | string | Defines the grant type for the request. Possible value are:<ul><li>authorization_code</li><li>client_credentials</li></ul> |
|
||||
| code* | string | Decoded authorisation code received in the last step. Note: Pass this parameter only when grant_type is 'authorization_code' |
|
||||
| mode | string | The type of mode. Possible values: <ul><li>test</li><li>live (default)</li></ul> |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"public_token": "rzp_test_oauth_9xu1rkZqoXlClS",
|
||||
"token_type": "Bearer",
|
||||
"expires_in": 7862400,
|
||||
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IkY1Z0NQYkhhRzRjcUpnIn0.eyJhdWQiOiJGNFNNeEgxanMxbkpPZiIsImp0aSI6IkY1Z0NQYkhhRzRjcUpnIiwiaWF0IjoxNTkyODMxMDExLCJuYmYiOjE1OTI4MzEwMTEsInN1YiI6IiIsImV4cCI6MTYwMDc3OTgxMSwidXNlcl9pZCI6IkYycVBpejJEdzRPRVFwIiwibWVyY2hhbnRfaWQiOiJGMnFQaVZ3N0lNV01GSyIsInNjb3BlcyI6WyJyZWFkX29ubHkiXX0.Wwqt5czhoWpVzP5_aoiymKXoGj-ydo-4A_X2jf_7rrSvk4pXdqzbA5BMrHxPdPbeFQWV6vsnsgbf99Q3g-W4kalHyH67LfAzc3qnJ-mkYDkFY93tkeG-MCco6GJW-Jm8xhaV9EPUak7z9J9jcdluu9rNXYMtd5qxD8auyRYhEgs",
|
||||
"refresh_token": "def50200f42e07aded65a323f6c53181d802cc797b62cc5e78dd8038d6dff253e5877da9ad32f463a4da0ad895e3de298cbce40e162202170e763754122a6cb97910a1f58e2378ee3492dc295e1525009cccc45635308cce8575bdf373606c453ebb5eb2bec062ca197ac23810cf9d6cf31fbb9fcf5b7d4de9bf524c89a4aa90599b0151c9e4e2fa08acb6d2fe17f30a6cfecdfd671f090787e821f844e5d36f5eacb7dfb33d91e83b18216ad0ebeba2bef7721e10d436c3984daafd8654ed881c581d6be0bdc9ebfaee0dc5f9374d7184d60aae5aa85385690220690e21bc93209fb8a8cc25a6abf1108d8277f7c3d38217b47744d7",
|
||||
"razorpay_account_id": "acc_Dhk2qDbmu6FwZH"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Get Access token using refresh token
|
||||
```php
|
||||
$oauth->oauthClient->getRefreshToken([
|
||||
"client_id" => "<YOUR_CLIENT_ID>",
|
||||
"client_secret" => "<YOUR_CLIENT_SECRET>",
|
||||
"grant_type" => "authorization_code",
|
||||
"refresh_token" => "def50200d844dc80cc44dce2c665d07a374d76802"
|
||||
]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------------|-----------|--------------------------------------------|
|
||||
| client_id* | string | Unique client identifier. |
|
||||
| client_secret* | string | Client secret string. |
|
||||
| grant_type* | string | Defines the grant type for the request. Possible value are:<ul><li>authorization_code</li><li>client_credentials</li></ul> |
|
||||
| refresh_token* | string | The previously-stored refresh token value. |
|
||||
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"public_token": "rzp_test_oauth_9xu1rkZqoXlClS",
|
||||
"token_type": "Bearer",
|
||||
"expires_in": 7862400,
|
||||
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijl4dTF",
|
||||
"refresh_token": "def5020096e1c470c901d34cd60fa53abdaf36620e823ffa53"
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Revoke a token
|
||||
```php
|
||||
$oauth->oauthClient->revokeToken([
|
||||
"client_id" => "<YOUR_CLIENT_ID>",
|
||||
"client_secret" => "<YOUR_CLIENT_SECRET>",
|
||||
"token" => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijl4dTF",
|
||||
"token_type_hint" => "access_token"
|
||||
]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|------------------|----------|----------------------------------------------------------------------------------------------------------|
|
||||
| client_id* | string | Unique client identifier. |
|
||||
| client_secret* | string | Client secret string. |
|
||||
| token_type_hint* | string | The type of token for the request. Possible values: <ul><li>access_token</li><li>refresh_token</li></ul> |
|
||||
| token* | string | The token whose access should be revoked. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"message": "Token Revoked"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/partners/platform/onboard-businesses/integrate-oauth/integration-steps)**
|
||||
419
vendor/razorpay/razorpay/documents/order.md
vendored
Normal file
419
vendor/razorpay/razorpay/documents/order.md
vendored
Normal file
@ -0,0 +1,419 @@
|
||||
## Orders
|
||||
|
||||
### Create order
|
||||
|
||||
```php
|
||||
$api->order->create(array('receipt' => '123', 'amount' => 100, 'currency' => 'INR', 'notes'=> array('key1'=> 'value3','key2'=> 'value2')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | Currency of the order. Currently only `INR` is supported. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| notes | array | A key-value pair |
|
||||
|partial_payment | boolean | Indicates whether customers can make partial payments on the invoice . Possible values: true - Customer can make partial payments. false (default) - Customer cannot make partial payments. |
|
||||
|
||||
**Response:**
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "order_EKwxwAgItmmXdp",
|
||||
"entity": "order",
|
||||
"amount": 50000,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 50000,
|
||||
"currency": "INR",
|
||||
"receipt": "receipt#1",
|
||||
"offer_id": null,
|
||||
"status": "created",
|
||||
"attempts": 0,
|
||||
"notes": [],
|
||||
"created_at": 1582628071
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Create order (Third party validation)
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 500, 'receipt' => 'BILL13375649', 'method' => 'netbanking', 'currency' => 'INR', 'bank_account'=> array('account_number'=> '765432123456789','name'=> 'Gaurav Kumar','ifsc'=>'HDFC0000053')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| method | string | The payment method used to make the payment. If this parameter is not passed, customers will be able to make payments using both netbanking and UPI payment methods. Possible values is `netbanking` or `upi`|
|
||||
| notes | array | A key-value pair |
|
||||
| currency* | string | Currency of the order. Currently only `INR` is supported. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| notes | array | A key-value pair |
|
||||
|bank_account | array | All keys listed [here](https://razorpay.com/docs/payments/third-party-validation/#step-2-create-an-order) are supported |
|
||||
|
||||
**Response:**
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "order_GAWN9beXgaqRyO",
|
||||
"entity": "order",
|
||||
"amount": 500,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 500,
|
||||
"currency": "INR",
|
||||
"receipt": "BILL13375649",
|
||||
"offer_id": null,
|
||||
"status": "created",
|
||||
"attempts": 0,
|
||||
"notes": [],
|
||||
"created_at": 1573044247
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all orders
|
||||
|
||||
```php
|
||||
$api->order->all($options);
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|------------|-----------|--------------------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the orders were created |
|
||||
| to | timestamp | timestamp before which the orders were created |
|
||||
| count | integer | number of orders to fetch (default: 10) |
|
||||
| skip | integer | number of orders to be skipped (default: 0) |
|
||||
| authorized | boolean | Orders for which orders are currently in authorized state. |
|
||||
| receipt | string | Orders with the provided value for receipt. |
|
||||
| expand[] | string | Used to retrieve additional information about the payment. Possible value is `payments`,`payments.card`,`transfers` or `virtual_account` |
|
||||
|
||||
**Response:**
|
||||
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "order_EKzX2WiEWbMxmx",
|
||||
"entity": "order",
|
||||
"amount": 1234,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 1234,
|
||||
"currency": "INR",
|
||||
"receipt": "Receipt No. 1",
|
||||
"offer_id": null,
|
||||
"status": "created",
|
||||
"attempts": 0,
|
||||
"notes": [],
|
||||
"created_at": 1582637108
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch particular order
|
||||
|
||||
```php
|
||||
$api->order->fetch($orderId);
|
||||
```
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------|--------|-------------------------------------|
|
||||
| orderId* | string | The id of the order to be fetched |
|
||||
|
||||
**Response:**
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "order_IXnOAMw6SSqKvN",
|
||||
"entity": "order",
|
||||
"amount": 100,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 100,
|
||||
"currency": "INR",
|
||||
"receipt": "Receipt no. 1",
|
||||
"offer_id": null,
|
||||
"status": "created",
|
||||
"attempts": 0,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1639581113
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch payments for an order
|
||||
|
||||
```php
|
||||
$api->order->fetch($orderId)->payments();
|
||||
```
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------|--------|-------------------------------------|
|
||||
| orderId* | string | The id of the order to be retrieve payment info |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity":"collection",
|
||||
"count":1,
|
||||
"items":[
|
||||
{
|
||||
"id":"pay_DaaSOvhgcOfzgR",
|
||||
"entity":"payment",
|
||||
"amount":2200,
|
||||
"currency":"INR",
|
||||
"status":"captured",
|
||||
"order_id":"order_DaaS6LOUAASb7Y",
|
||||
"invoice_id":null,
|
||||
"international":false,
|
||||
"method":"card",
|
||||
"amount_refunded":0,
|
||||
"refund_status":null,
|
||||
"captured":true,
|
||||
"description":"Beans in every imaginable flavour",
|
||||
"card_id":"card_DZon6fd8J3IcA2",
|
||||
"bank":null,
|
||||
"wallet":null,
|
||||
"vpa":null,
|
||||
"email":"gaurav.kumar@example.com",
|
||||
"contact":"+919999999988",
|
||||
"notes":[],
|
||||
"fee":44,
|
||||
"tax":0,
|
||||
"error_code":null,
|
||||
"error_description":null,
|
||||
"created_at":1572505160
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Update order
|
||||
|
||||
```php
|
||||
$api->order->fetch($orderId)->edit(array('notes'=> array('notes_key_1'=>'Beam me up Scotty. 1', 'notes_key_2'=>'Engage')));
|
||||
```
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------|--------|-------------------------------------|
|
||||
| orderId* | string | The id of the order to be retrieve payment info |
|
||||
| notes* | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"order_DaaS6LOUAASb7Y",
|
||||
"entity":"order",
|
||||
"amount":2200,
|
||||
"amount_paid":0,
|
||||
"amount_due":2200,
|
||||
"currency":"INR",
|
||||
"receipt":"Receipt #211",
|
||||
"offer_id":null,
|
||||
"status":"attempted",
|
||||
"attempts":1,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at":1572505143
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an order (Magic checkout)
|
||||
|
||||
```php
|
||||
$api->order->create(array(
|
||||
"amount" => 50000,
|
||||
"currency" => "INR",
|
||||
"receipt" => "receipt#21",
|
||||
"notes" => array(
|
||||
"key1" => "value3",
|
||||
"key2" => "value2"
|
||||
),
|
||||
"rto_review" => true,
|
||||
"line_items" =>
|
||||
array(array(
|
||||
"type" => "e-commerce",
|
||||
"sku" => "1g234",
|
||||
"variant_id" => "12r34",
|
||||
"price" => "3900",
|
||||
"offer_price" => "3800",
|
||||
"tax_amount" => 0,
|
||||
"quantity" => 1,
|
||||
"name" => "TEST",
|
||||
"description" => "TEST",
|
||||
"weight" => "1700",
|
||||
"dimensions" => array(
|
||||
"length" => "1700",
|
||||
"width" => "1700",
|
||||
"height" => "1700"
|
||||
),
|
||||
"image_url" => "https://unsplash.com/s/photos/new-wallpaper",
|
||||
"product_url" => "https://unsplash.com/s/photos/new-wallpaper",
|
||||
"notes" => array())),
|
||||
"line_items_total" => "1200",
|
||||
"shipping_fee" => 100,
|
||||
"cod_fee" => 100,
|
||||
"promotions" => array(array(
|
||||
"reference_id" => 1234,
|
||||
"type" => "coupon",
|
||||
"code" => "HDFC2000",
|
||||
"value" => "200",
|
||||
"value_type" => "fixed_amount",
|
||||
"description" => "200 discount on your order"
|
||||
)),
|
||||
"customer" => array(
|
||||
"name" => "Test Rto Order",
|
||||
"contact" => "+919000090000",
|
||||
"email" => "gaurav.kumar@example.com"
|
||||
),
|
||||
"device_details" => array(
|
||||
"ip" => "127.0.0.1",
|
||||
"user_agent" => "abc"
|
||||
),
|
||||
"shipping_details" => array(
|
||||
"shipping_address" => array(
|
||||
"line1" => "1",
|
||||
"line2" => "1",
|
||||
"zipcode" =>
|
||||
"305001",
|
||||
"contact" => "+919090909090",
|
||||
"city" => "Ajmer",
|
||||
"state" => "Rajasthan",
|
||||
"country" => "IND",
|
||||
"tag" => "home",
|
||||
"landmark" => "Hathibhata"
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
```
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------|--------|-------------------------------------|
|
||||
| amount* | integer | The transaction amount, expressed in the currency subunit, such as paise (in case of INR). |
|
||||
| currency* | string | The currency in which the transaction should be made. default value is `INR`|
|
||||
| receipt | string | Your receipt id for this order should be passed here. Maximum length of 40 characters. |
|
||||
| notes | array | Key-value pair that can be used to store additional information about the entity.|
|
||||
| rto_review | boolean | Identifier to mark the order eligible for RTO risk prediction. Possible values is `0` or `1` |
|
||||
| line_items | array | All keys listed [here](https://betasite.razorpay.com/docs/razorpay/IN/payments-magic-new-rto-intelligence/payments/magic-checkout/rto-intelligence/#11-create-an-order) are supported |
|
||||
| line_items_total | integer | Sum of offer_price for all line items added in the cart in paise. |
|
||||
| shipping_fee | integer | Shipping fee charged on the line items in paisa. |
|
||||
| cod_fee | integer | COD fee charged on the line items in paisa. |
|
||||
| promotions | array | Used to pass all offer or discount related information including coupon code discount, method discount and so on. |
|
||||
| customer | array | All keys listed [here](https://betasite.razorpay.com/docs/razorpay/IN/payments-magic-new-rto-intelligence/payments/magic-checkout/rto-intelligence/#11-create-an-order) are supported |
|
||||
| device_details | array | All keys listed [here](https://betasite.razorpay.com/docs/razorpay/IN/payments-magic-new-rto-intelligence/payments/magic-checkout/rto-intelligence/#11-create-an-order) are supported |
|
||||
| shipping_details | array | All keys listed [here](https://betasite.razorpay.com/docs/razorpay/IN/payments-magic-new-rto-intelligence/payments/magic-checkout/rto-intelligence/#11-create-an-order) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "order_MpyV7eOsTBn24z",
|
||||
"entity": "order",
|
||||
"amount": 50000,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 50000,
|
||||
"currency": "INR",
|
||||
"receipt": "receipt#22",
|
||||
"status": "created",
|
||||
"attempts": 0,
|
||||
"notes": {
|
||||
"key1": "value3",
|
||||
"key2": "value2"
|
||||
},
|
||||
"created_at": 1697698714
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### View RTO/Risk Reasons
|
||||
|
||||
```php
|
||||
$orderId = "order_DaaS6LOUAASb7Y";
|
||||
|
||||
$api->order->fetch($orderId)->viewRtoReview();
|
||||
```
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------|--------|-------------------------------------|
|
||||
| orderId* | string | The id of the order to be retrieve payment info |
|
||||
| notes* | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"risk_tier": "high",
|
||||
"rto_reasons": [
|
||||
{
|
||||
"reason": "short_shipping_address",
|
||||
"description": "Short shipping address",
|
||||
"bucket": "address"
|
||||
},
|
||||
{
|
||||
"reason": "address_pincode_state_mismatch",
|
||||
"description": "Incorrect pincode state entered",
|
||||
"bucket": "address"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
```php
|
||||
$orderId = "order_DaaS6LOUAASb7Y";
|
||||
|
||||
$api->order->fetch($orderId)->editFulfillment(array(
|
||||
'payment_method' => 'upi',
|
||||
'shipping' => array(
|
||||
'waybill' => '123456789',
|
||||
'status' => 'rto',
|
||||
'provider' => 'Bluedart'
|
||||
)
|
||||
)
|
||||
);
|
||||
```
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------|--------|-------------------------------------|
|
||||
| payment_method | string | The id of the order to be retrieve payment info |
|
||||
| shipping | array | All keys listed [here](https://betasite.razorpay.com/docs/razorpay/IN/payments-magic-new-rto-intelligence/payments/magic-checkout/rto-intelligence/#13-update-the-fulfillment-details) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "order.fulfillment",
|
||||
"order_id": "EKwxwAgItXXXX",
|
||||
"payment_method": "upi",
|
||||
"shipping": {
|
||||
"waybill": "123456789",
|
||||
"status": "rto",
|
||||
"provider": "Bluedart"
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/orders/)**
|
||||
656
vendor/razorpay/razorpay/documents/papernach.md
vendored
Normal file
656
vendor/razorpay/razorpay/documents/papernach.md
vendored
Normal file
@ -0,0 +1,656 @@
|
||||
## Paper NACH
|
||||
|
||||
### Create customer
|
||||
```php
|
||||
$api->customer->create(array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'fail_existing' => "1",
|
||||
'contact'=>'9000090000',
|
||||
'notes'=> array(
|
||||
'notes_key_1'=> 'Tea, Earl Grey, Hot',
|
||||
'notes_key_2'=> 'Tea, Earl Grey... decaf'
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| name* | string | Name of the customer |
|
||||
| email | string | Email of the customer |
|
||||
| contact | string | Contact number of the customer |
|
||||
| fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `1` or `0`|
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "cust_1Aa00000000003",
|
||||
"entity": "customer",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "Gaurav.Kumar@example.com",
|
||||
"contact": "9000000000",
|
||||
"gstin": null,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1582033731
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create order
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 0,'currency' => 'INR','method' => 'nach','customer_id' => 'cust_1Aa00000000001','receipt' => 'Receipt No. 1', 'notes' => array('notes_key_1' => 'Beam me up Scotty','notes_key_2' => 'Engage'),'token' => array('auth_type' => 'physical','max_amount' => 10000000,'expire_at' => 2709971120,'notes' => array('notes_key_1' => 'Tea, Earl Grey, Hot','notes_key_2' => 'Tea, Earl Grey… decaf.'),'bank_account' => array('account_number' => '11214311215411','ifsc_code' => 'HDFC0000001','beneficiary_name' => 'Gaurav Kumar','account_type' => 'savings'),'nach' => array('form_reference1' => 'Recurring Payment for Gaurav Kumar','form_reference2' => 'Method Paper NACH','description' => 'Paper NACH Gaurav Kumar'))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| method* | string | Payment method used to make the registration transaction. Possible value is `nach`. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/create-authorization-transaction/#112-create-an-order) are supported |
|
||||
| notes | object | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"order_1Aa00000000001",
|
||||
"entity":"order",
|
||||
"amount":0,
|
||||
"amount_paid":0,
|
||||
"amount_due":0,
|
||||
"currency":"INR",
|
||||
"receipt":"rcptid #10",
|
||||
"offer_id":null,
|
||||
"offers":{
|
||||
"entity":"collection",
|
||||
"count":0,
|
||||
"items":[
|
||||
|
||||
]
|
||||
},
|
||||
"status":"created",
|
||||
"attempts":0,
|
||||
"notes":{
|
||||
"notes_key_1":"Beam me up Scotty",
|
||||
"notes_key_2":"Engage"
|
||||
},
|
||||
"created_at":1579775420,
|
||||
"token":{
|
||||
"method":"nach",
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"recurring_status":null,
|
||||
"failure_reason":null,
|
||||
"currency":"INR",
|
||||
"max_amount":10000000,
|
||||
"auth_type":"physical",
|
||||
"expire_at":1580480689,
|
||||
"nach":{
|
||||
"create_form":true,
|
||||
"form_reference1":"Recurring Payment for Gaurav Kumar",
|
||||
"form_reference2":"Method Paper NACH",
|
||||
"prefilled_form":"https://rzp.io/i/bitw",
|
||||
"upload_form_url":"https://rzp.io/i/gts",
|
||||
"description":"Paper NACH Gaurav Kumar"
|
||||
},
|
||||
"bank_account":{
|
||||
"ifsc":"HDFC0000001",
|
||||
"bank_name":"HDFC Bank",
|
||||
"name":"Gaurav Kumar",
|
||||
"account_number":"11214311215411",
|
||||
"account_type":"savings",
|
||||
"beneficiary_email":"gaurav.kumar@example.com",
|
||||
"beneficiary_mobile":"9876543210"
|
||||
},
|
||||
"first_payment_amount":0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an Authorization Payment
|
||||
|
||||
Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/paper-nach/authorization-transaction/#113-create-an-authorization-payment) for authorization payment
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create registration link
|
||||
|
||||
```php
|
||||
$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' => 1947483647,
|
||||
'max_amount' => 50000
|
||||
),
|
||||
'receipt' => 'Receipt No. 1',
|
||||
'sms_notify' => true,
|
||||
'email_notify' => true,
|
||||
'expire_by' => 1647483647,
|
||||
'notes' => array(
|
||||
'note_key 1' => 'Beam me up Scotty',
|
||||
'note_key 2' => 'Tea. Earl Gray. Hot.'
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customer | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/create-authorization-transaction/#121-create-a-registration-link) |
|
||||
| type* | string | In this case, the value is `link`. |
|
||||
| currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
|
||||
| amount* | integer | The payment amount in the smallest currency sub-unit. |
|
||||
| description* | string | A description that appears on the hosted page. For example, `12:30 p.m. Thali meals (Gaurav Kumar`). |
|
||||
| subscription_registration | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/create-authorization-transaction/#121-create-a-registration-link) |
|
||||
| sms_notify | boolean | SMS notifications are to be sent by Razorpay (default : true) |
|
||||
| email_notify | boolean | Email notifications are to be sent by Razorpay (default : true) |
|
||||
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_FHrZiAubEzDdaq",
|
||||
"entity": "invoice",
|
||||
"receipt": "Receipt No. 27",
|
||||
"invoice_number": "Receipt No. 27",
|
||||
"customer_id": "cust_BMB3EwbqnqZ2EI",
|
||||
"customer_details": {
|
||||
"id": "cust_BMB3EwbqnqZ2EI",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9123456780",
|
||||
"gstin": null,
|
||||
"billing_address": null,
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9123456780"
|
||||
},
|
||||
"order_id": "order_FHrZiBOkWHZPOp",
|
||||
"line_items": [],
|
||||
"payment_id": null,
|
||||
"status": "issued",
|
||||
"expire_by": 1647483647,
|
||||
"issued_at": 1595491154,
|
||||
"paid_at": null,
|
||||
"cancelled_at": null,
|
||||
"expired_at": null,
|
||||
"sms_status": "sent",
|
||||
"email_status": "sent",
|
||||
"date": 1595491154,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 0,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"amount": 0,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 0,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "12 p.m. Meals",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/bzDYbNg",
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "link",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1595491154,
|
||||
"idempotency_key": null,
|
||||
"token": {
|
||||
"method": "nach",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"recurring_status": null,
|
||||
"failure_reason": null,
|
||||
"currency": "INR",
|
||||
"max_amount": 50000,
|
||||
"auth_type": "physical",
|
||||
"expire_at": 1947483647,
|
||||
"nach": {
|
||||
"create_form": true,
|
||||
"form_reference1": "Recurring Payment for Gaurav Kumar",
|
||||
"form_reference2": "Method Paper NACH",
|
||||
"prefilled_form": "https://rzp.io/i/exdIzYN",
|
||||
"upload_form_url": "https://rzp.io/i/bzDYbNg",
|
||||
"description": "12 p.m. Meals"
|
||||
},
|
||||
"bank_account": {
|
||||
"ifsc": "HDFC0001233",
|
||||
"bank_name": "HDFC Bank",
|
||||
"name": "Gaurav Kumar",
|
||||
"account_number": "11214311215411",
|
||||
"account_type": "savings",
|
||||
"beneficiary_email": "gaurav.kumar@example.com",
|
||||
"beneficiary_mobile": "9123456780"
|
||||
},
|
||||
"first_payment_amount": 0
|
||||
},
|
||||
"nach_form_url": "https://rzp.io/i/exdIzYN"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Send/Resend notifications
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->notifyBy($medium);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be notified |
|
||||
| medium* | string | `sms`/`email`, Medium through which notification should be sent. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"success": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Cancel a registration link
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->cancel();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be cancelled |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_FHrZiAubEzDdaq",
|
||||
"entity": "invoice",
|
||||
"receipt": "Receipt No. 27",
|
||||
"invoice_number": "Receipt No. 27",
|
||||
"customer_id": "cust_BMB3EwbqnqZ2EI",
|
||||
"customer_details": {
|
||||
"id": "cust_BMB3EwbqnqZ2EI",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9123456780",
|
||||
"gstin": null,
|
||||
"billing_address": null,
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9123456780"
|
||||
},
|
||||
"order_id": "order_FHrZiBOkWHZPOp",
|
||||
"line_items": [],
|
||||
"payment_id": null,
|
||||
"status": "cancelled",
|
||||
"expire_by": 1647483647,
|
||||
"issued_at": 1595491154,
|
||||
"paid_at": null,
|
||||
"cancelled_at": 1595491339,
|
||||
"expired_at": null,
|
||||
"sms_status": "sent",
|
||||
"email_status": "sent",
|
||||
"date": 1595491154,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 0,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"amount": 0,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 0,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "12 p.m. Meals",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/bzDYbNg",
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "link",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1595491154,
|
||||
"idempotency_key": null,
|
||||
"token": {
|
||||
"method": "nach",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"recurring_status": null,
|
||||
"failure_reason": null,
|
||||
"currency": "INR",
|
||||
"max_amount": 50000,
|
||||
"auth_type": "physical",
|
||||
"expire_at": 1947483647,
|
||||
"nach": {
|
||||
"create_form": true,
|
||||
"form_reference1": "Recurring Payment for Gaurav Kumar",
|
||||
"form_reference2": "Method Paper NACH",
|
||||
"prefilled_form": "https://rzp.io/i/tSYd5aV",
|
||||
"upload_form_url": "https://rzp.io/i/bzDYbNg",
|
||||
"description": "12 p.m. Meals"
|
||||
},
|
||||
"bank_account": {
|
||||
"ifsc": "HDFC0001233",
|
||||
"bank_name": "HDFC Bank",
|
||||
"name": "Gaurav Kumar",
|
||||
"account_number": "11214311215411",
|
||||
"account_type": "savings",
|
||||
"beneficiary_email": "gaurav.kumar@example.com",
|
||||
"beneficiary_mobile": "9123456780"
|
||||
},
|
||||
"first_payment_amount": 0
|
||||
},
|
||||
"nach_form_url": "https://rzp.io/i/tSYd5aV"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch Payment ID using Order ID
|
||||
|
||||
```php
|
||||
$api->order->fetch($orderId)->payments();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| orderId* | string | Order id for which payment id need to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity":"collection",
|
||||
"count":1,
|
||||
"items":[
|
||||
{
|
||||
"id":"pay_1Aa00000000003",
|
||||
"entity":"payment",
|
||||
"amount":0,
|
||||
"currency":"INR",
|
||||
"status":"captured",
|
||||
"order_id":"order_1Aa00000000003",
|
||||
"invoice_id":"inv_1Aa00000000003",
|
||||
"international":false,
|
||||
"method":"nach",
|
||||
"amount_refunded":0,
|
||||
"refund_status":null,
|
||||
"captured":true,
|
||||
"description":"12 p.m. Meals",
|
||||
"card_id":null,
|
||||
"bank":"HDFC",
|
||||
"wallet":null,
|
||||
"vpa":null,
|
||||
"email":"gaurav.kumar@example.com",
|
||||
"contact":"99876543210",
|
||||
"customer_id":"cust_1Aa00000000002",
|
||||
"token_id":"token_1Aa00000000003",
|
||||
"notes":{
|
||||
"note_key 1":"Beam me up Scotty",
|
||||
"note_key 2":"Tea. Earl Gray. Hot."
|
||||
},
|
||||
"fee":0,
|
||||
"tax":0,
|
||||
"error_code":null,
|
||||
"error_description":null,
|
||||
"created_at":1580109147
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch token by payment ID
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|------------|--------|-----------------------------------|
|
||||
| paymentId* | string | Id of the payment to be retrieved |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "pay_EnLNTjINiPkMEZ",
|
||||
"entity": "payment",
|
||||
"amount": 0,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_EnLLfglmKksr4K",
|
||||
"invoice_id": "inv_EnLLfgCzRfcMuh",
|
||||
"international": false,
|
||||
"method": "nach",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": "Invoice #inv_EnLLfgCzRfcMuh",
|
||||
"card_id": null,
|
||||
"bank": "UTIB",
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919876543210",
|
||||
"customer_id": "cust_DtHaBuooGHTuyZ",
|
||||
"token_id": "token_EnLNTnn7uyRg5V",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {},
|
||||
"created_at": 1588827564
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch tokens by customer ID
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->all();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "token_EhYgIE3pOyMQpD",
|
||||
"entity": "token",
|
||||
"token": "3mQ5Czc6APNppI",
|
||||
"bank": "HDFC",
|
||||
"wallet": null,
|
||||
"method": "nach",
|
||||
"vpa": null,
|
||||
"recurring": true,
|
||||
"recurring_details": {
|
||||
"status": "confirmed",
|
||||
"failure_reason": null
|
||||
},
|
||||
"auth_type": "physical",
|
||||
"mrn": null,
|
||||
"used_at": 1587564373,
|
||||
"created_at": 1587564373,
|
||||
"dcc_enabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete token
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->delete($tokenId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"deleted": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an order to charge the customer
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 1000,'currency' => 'INR','payment_capture' => true,'receipt' => 'Receipt No. 1','notes'=> array('notes_key_1' => 'Tea, Earl Grey, Hot', 'notes_key_2' => 'Tea, Earl Grey… decaf.')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | Currency of the order. Currently only `INR` is supported. |
|
||||
| payment_capture* | boolean | Indicates whether payment status should be changed to captured automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| notes | array | A key-value pair |
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"order_1Aa00000000002",
|
||||
"entity":"order",
|
||||
"amount":1000,
|
||||
"amount_paid":0,
|
||||
"amount_due":1000,
|
||||
"currency":"INR",
|
||||
"receipt":"Receipt No. 1",
|
||||
"offer_id":null,
|
||||
"status":"created",
|
||||
"attempts":0,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at":1579782776
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create a Recurring Payment
|
||||
|
||||
```php
|
||||
$api->payment->createRecurring(array(
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9000090000',
|
||||
'amount' => 100,
|
||||
'currency' => 'INR',
|
||||
'order_id' => 'order_1Aa00000000002',
|
||||
'customer_id' => 'cust_1Aa00000000001',
|
||||
'token' => 'token_1Aa00000000001',
|
||||
'recurring' => true,
|
||||
'description' => 'Creating recurring payment for Gaurav Kumar'
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| email* | string | The customer's email address. |
|
||||
| contact* | string | The customer's phone number. |
|
||||
| amount* | integer | The amount you want to charge your customer. This should be the same as the amount in the order. |
|
||||
| currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
|
||||
| order_id* | string | The unique identifier of the order created. |
|
||||
| customer_id* | string | The `customer_id` for the customer you want to charge. |
|
||||
| token* | string | The `token_id` generated when the customer successfully completes the authorization payment. Different payment instruments for the same customer have different `token_id`.|
|
||||
| recurring* | string | Determines if recurring payment is enabled or not. Possible values:<br>* `true` - Recurring is enabled.* `false` - Recurring is not enabled.|
|
||||
| description | string | A user-entered description for the payment.|
|
||||
| notes | array | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id" : "pay_1Aa00000000001",
|
||||
"razorpay_order_id" : "order_1Aa00000000001",
|
||||
"razorpay_signature" : "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/recurring-payments/paper-nach/authorization-transaction/)**
|
||||
928
vendor/razorpay/razorpay/documents/payment.md
vendored
Normal file
928
vendor/razorpay/razorpay/documents/payment.md
vendored
Normal file
@ -0,0 +1,928 @@
|
||||
## Payments
|
||||
|
||||
### Capture payment
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->capture(array('amount'=>$amount,'currency' => 'INR'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------|---------|--------------------------------------------------------------------------------|
|
||||
| paymentId* | string | Id of the payment to capture |
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "pay_G8VQzjPLoAvm6D",
|
||||
"entity": "payment",
|
||||
"amount": 1000,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_G8VPOayFxWEU28",
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "upi",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": "Purchase Shoes",
|
||||
"card_id": null,
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"vpa": "gaurav.kumar@exampleupi",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919999999999",
|
||||
"customer_id": "cust_DitrYCFtCIokBO",
|
||||
"notes": [],
|
||||
"fee": 24,
|
||||
"tax": 4,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {
|
||||
"rrn": "033814379298"
|
||||
},
|
||||
"created_at": 1606985209
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all payments
|
||||
|
||||
```php
|
||||
$api->payment->all($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the payments were created |
|
||||
| to | timestamp | timestamp before which the payments were created |
|
||||
| count | integer | number of payments to fetch (default: 10) |
|
||||
| skip | integer | number of payments to be skipped (default: 0) |
|
||||
| expand[] | string | Used to retrieve additional information about the payment. Possible value is `cards` or `emi`|
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 2,
|
||||
"items": [
|
||||
{
|
||||
"id": "pay_G8VaL2Z68LRtDs",
|
||||
"entity": "payment",
|
||||
"amount": 900,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_G8VXfKDWDEOHHd",
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "netbanking",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": "Purchase Shoes",
|
||||
"card_id": null,
|
||||
"bank": "KKBK",
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919999999999",
|
||||
"customer_id": "cust_DitrYCFtCIokBO",
|
||||
"notes": [],
|
||||
"fee": 22,
|
||||
"tax": 4,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {
|
||||
"bank_transaction_id": "0125836177"
|
||||
},
|
||||
"created_at": 1606985740
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a payment
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|------------|--------|-----------------------------------|
|
||||
| paymentId* | string | Id of the payment to be retrieved |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "pay_G8VQzjPLoAvm6D",
|
||||
"entity": "payment",
|
||||
"amount": 1000,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_G8VPOayFxWEU28",
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "upi",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": "Purchase Shoes",
|
||||
"card_id": null,
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"vpa": "gaurav.kumar@exampleupi",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919999999999",
|
||||
"customer_id": "cust_DitrYCFtCIokBO",
|
||||
"notes": [],
|
||||
"fee": 24,
|
||||
"tax": 4,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {
|
||||
"rrn": "033814379298"
|
||||
},
|
||||
"created_at": 1606985209
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch payments for an order
|
||||
|
||||
```php
|
||||
$api->order->fetch($orderId)->payments();
|
||||
```
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
|----------|--------|-------------------------------------|
|
||||
| orderId* | string | The id of the order to be retrieve payment info |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"count": 1,
|
||||
"entity": "collection",
|
||||
"items": [
|
||||
{
|
||||
"id": "pay_DovGQXOkPBJjjU",
|
||||
"entity": "payment",
|
||||
"amount": 600,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_DovFx48wjYEr2I",
|
||||
"method": "netbanking",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": "A Wild Sheep Chase is a novel by Japanese author Haruki Murakami",
|
||||
"card_id": null,
|
||||
"bank": "SBIN",
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9364591752",
|
||||
"fee": 70,
|
||||
"tax": 10,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"notes": [],
|
||||
"acquirer_data": {
|
||||
"bank_transaction_id": "0125836177"
|
||||
},
|
||||
"created_at": 1400826750
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Update a payment
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->edit(array('notes'=> array('key_1'=> 'value1','key_2'=> 'value2')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| paymentId* | string | Id of the payment to update |
|
||||
| notes* | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "pay_CBYy6tLmJTzn3Q",
|
||||
"entity": "payment",
|
||||
"amount": 1000,
|
||||
"currency": "INR",
|
||||
"status": "authorized",
|
||||
"order_id": null,
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "netbanking",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": false,
|
||||
"description": null,
|
||||
"card_id": null,
|
||||
"bank": "UTIB",
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "testme@acme.com",
|
||||
"customer_id": "cust_JR4BVKjKyJ7enk",
|
||||
"notes": {
|
||||
"key1": "value1",
|
||||
"key2": "value2"
|
||||
},
|
||||
"fee": null,
|
||||
"tax": null,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {
|
||||
"bank_transaction_id": "0125836177"
|
||||
},
|
||||
"created_at": 1553504328
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch expanded card or emi details for payments
|
||||
|
||||
Request #1: Card
|
||||
|
||||
```php
|
||||
$api->payment->all(array('expand[]'=>'card'));
|
||||
```
|
||||
|
||||
Request #2: EMI
|
||||
|
||||
```php
|
||||
$api->payment->all(array('expand[]'=>'emi'));
|
||||
```
|
||||
|
||||
**Response:**<br>
|
||||
For expanded card or emi details for payments response please click [here](https://razorpay.com/docs/api/payments/#fetch-expanded-card-or-emi-details-for-payments)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch card details with paymentId
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->fetchCardDetails();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| paymentId* | string | Id of the payment to update |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "card_6krZ6bcjoeqyV9",
|
||||
"entity": "card",
|
||||
"name": "Gaurav",
|
||||
"last4": "3335",
|
||||
"network": "Visa",
|
||||
"type": "debit",
|
||||
"issuer": "SBIN",
|
||||
"international": false,
|
||||
"emi": null,
|
||||
"sub_type": "business"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch Payment Downtime Details
|
||||
|
||||
```php
|
||||
$api->payment->fetchPaymentDowntime();
|
||||
```
|
||||
**Response:** <br>
|
||||
For payment downtime response please click [here](https://razorpay.com/docs/api/payments/downtime/#fetch-payment-downtime-details)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch Payment Downtime
|
||||
|
||||
```php
|
||||
$api->payment->fetchPaymentDowntimeById($downtimeId);
|
||||
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| downtimeId* | string | Id to fetch payment downtime |
|
||||
|
||||
**Response:** <br>
|
||||
For payment downtime by id response please click [here](https://razorpay.com/docs/api/payments/downtime/#fetch-payment-downtime-details-by-id)
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Payment capture settings API
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 50000,'currency' => 'INR','receipt' => 'rcptid_11','payment' => array('capture' => 'automatic','capture_options' => array('automatic_expiry_period' => 12,'manual_expiry_period' => 7200,'refund_speed' => 'optimum'))));
|
||||
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | Currency of the order. Currently only `INR` is supported. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| payment | array | please refer this [doc](https://razorpay.com/docs/payments/payments/capture-settings/api/) for params |
|
||||
|
||||
**Response:** <br>
|
||||
```json
|
||||
{
|
||||
"id": "order_DBJOWzybf0sJbb",
|
||||
"entity": "order",
|
||||
"amount": 50000,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 50000,
|
||||
"currency": "INR",
|
||||
"receipt": "rcptid_11",
|
||||
"status": "created",
|
||||
"attempts": 0,
|
||||
"notes": [],
|
||||
"created_at": 1566986570
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create Payment Json
|
||||
|
||||
```php
|
||||
$api->payment->createPaymentJson(array(
|
||||
"amount" => 100,
|
||||
"currency" => "INR",
|
||||
"contact" => "9000090000",
|
||||
"email" => "gaurav.kumar@example.com",
|
||||
"order_id" => "order_DPzFe1Q1dEOKed",
|
||||
"method" => "card",
|
||||
"card" => array(
|
||||
"number" => "4386289407660153",
|
||||
"name" => "Gaurav",
|
||||
"expiry_month" => 11,
|
||||
"expiry_year" => 30,
|
||||
"cvv" => 100
|
||||
),
|
||||
"authentication" => array(
|
||||
"authentication_channel" => "browser"
|
||||
),
|
||||
"browser" => array(
|
||||
"java_enabled" => false,
|
||||
"javascript_enabled" => false,
|
||||
"timezone_offset" => 11,
|
||||
"color_depth" => 23,
|
||||
"screen_width" => 23,
|
||||
"screen_height" => 100
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| order_id* | string | The unique identifier of the order created. |
|
||||
| email* | string | Email of the customer |
|
||||
| contact* | string | Contact number of the customer |
|
||||
| method* | string | Possible value is `card`, `netbanking`, `wallet`,`emi`, `upi`, `cardless_emi`, `paylater`. |
|
||||
| card | array | All keys listed [here](https://razorpay.com/docs/payments/payment-gateway/s2s-integration/payment-methods/#supported-payment-fields) are supported |
|
||||
| bank | string | Bank code of the bank used for the payment. Required if the method is `netbanking`.|
|
||||
| bank_account | array | All keys listed [here](https://razorpay.com/docs/payments/customers/customer-fund-account-api/#create-a-fund-account) are supported |
|
||||
| vpa | string | Virtual payment address of the customer. Required if the method is `upi`. |
|
||||
| wallet | string | Wallet code for the wallet used for the payment. Required if the method is `wallet`. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
please refer this [doc](https://razorpay.com/docs/payment-gateway/s2s-integration/payment-methods/) for params
|
||||
|
||||
**Response:** <br>
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id": "pay_FVmAstJWfsD3SO",
|
||||
"next": [
|
||||
{
|
||||
"action": "redirect",
|
||||
"url": "https://api.razorpay.com/v1/payments/FVmAtLUe9XZSGM/authorize"
|
||||
},
|
||||
{
|
||||
"action": "otp_generate",
|
||||
"url": "https://api.razorpay.com/v1/payments/pay_FVmAstJWfsD3SO/otp_generate?track_id=FVmAtLUe9XZSGM&key_id=<YOUR_KEY_ID>"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### OTP Generate
|
||||
|
||||
```php
|
||||
$api = new Api("key",""); // Use Only razorpay key
|
||||
|
||||
$api->payment->otpGenerate($paymentId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| paymentId* | integer | Unique identifier of the payment |
|
||||
|
||||
**Response:** <br>
|
||||
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id": "pay_FVmAstJWfsD3SO",
|
||||
"next": [
|
||||
{
|
||||
"action": "otp_submit",
|
||||
"url": "https://api.razorpay.com/v1/payments/pay_FVmAstJWfsD3SO/otp_submit/ac2d415a8be7595de09a24b41661729fd9028fdc?key_id=<YOUR_KEY_ID>"
|
||||
},
|
||||
{
|
||||
"action": "otp_resend",
|
||||
"url": "https://api.razorpay.com/v1/payments/pay_FVmAstJWfsD3SO/otp_resend/json?key_id=<YOUR_KEY_ID>"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"issuer": "HDFC",
|
||||
"network": "MC",
|
||||
"last4": "1111",
|
||||
"iin": "411111"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### OTP Submit
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->otpSubmit(array('otp'=> '12345'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| paymentId* | integer | Unique identifier of the payment |
|
||||
| otp* | string | The customer receives the OTP using their preferred notification medium - SMS or email |
|
||||
|
||||
**Response:** <br>
|
||||
Success
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id": "pay_D5jmY2H6vC7Cy3",
|
||||
"razorpay_order_id": "order_9A33XWu170gUtm",
|
||||
"razorpay_signature": "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d"
|
||||
}
|
||||
```
|
||||
Failure
|
||||
```json
|
||||
{
|
||||
"error": {
|
||||
"code" : "BAD_REQUEST_ERROR",
|
||||
"description": "payment processing failed because of incorrect otp"
|
||||
},
|
||||
"next": ["otp_submit", "otp_resend"]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create Payment Json (Third party validation)
|
||||
|
||||
```php
|
||||
$api->payment->createPaymentJson(array(
|
||||
'amount' => 100,
|
||||
'currency' => 'INR',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9123456789',
|
||||
'order_id' => 'order_I6LVPRQ6upW3uh',
|
||||
'method' => 'netbanking',
|
||||
'bank'=>'HDFC'
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| order_id* | string | The unique identifier of the order created. |
|
||||
| email* | string | Email of the customer |
|
||||
| contact* | string | Contact number of the customer |
|
||||
| method* | string | Possible value is `netbanking` |
|
||||
| bank* | string | The customer's bank code.For example, `HDFC`.|
|
||||
|
||||
please refer this [doc](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/netbanking#step-3-create-a-payment) for params
|
||||
|
||||
**Response:** <br>
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id": "pay_GAWOYqPlvrtPSi",
|
||||
"next": [
|
||||
{
|
||||
"action": "redirect",
|
||||
"url": "https://api.razorpay.com/v1/payments/pay_GAWOYqPlvrtPSi/authorize"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Create Payment UPI s2s / VPA token (Third party validation)
|
||||
|
||||
```php
|
||||
$api->payment->createUpi(array(
|
||||
"amount" => 200,
|
||||
"currency" => "INR",
|
||||
"order_id" => "order_Jhgp4wIVHQrg5H",
|
||||
"email" => "gaurav.kumar@example.com",
|
||||
"contact" => "9123456789",
|
||||
"method" => "upi",
|
||||
"customer_id" => "cust_EIW4T2etiweBmG",
|
||||
"save" => true,
|
||||
"ip" => "192.168.0.103",
|
||||
"referer" => "http",
|
||||
"user_agent" => "Mozilla/5.0",
|
||||
"description" => "Test flow",
|
||||
"notes" => array(
|
||||
"note_key" => "value1"
|
||||
),
|
||||
"upi" => array(
|
||||
"flow" => "collect",
|
||||
"vpa" => "gauravkumar@exampleupi",
|
||||
"expiry_time" => 5
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| order_id* | string | The unique identifier of the order created. |
|
||||
| email* | string | Email of the customer |
|
||||
| customer_id* | string | The id of the customer to be fetched |
|
||||
| contact* | string | Contact number of the customer |
|
||||
| notes | array | A key-value pair |
|
||||
| description | string | Descriptive text of the payment. |
|
||||
| save | boolean | Specifies if the VPA should be stored as tokens.Possible value is `true`, `false` |
|
||||
| callback_url | string | URL where Razorpay will submit the final payment status. |
|
||||
| ip* | string | The client's browser IP address. For example `117.217.74.98` |
|
||||
| referer* | string | Value of `referer` header passed by the client's browser. For example, `https://example.com/` |
|
||||
| user_agent* | string | Value of `user_agent` header passed by the client's browser. For example, `Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36` |
|
||||
| upi* (for Upi only) | array | All keys listed [here](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/upi/collect#step-14-initiate-a-payment) are supported |
|
||||
|
||||
**Response:** <br>
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id": "pay_EAm09NKReXi2e0"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Create Payment UPI s2s / VPA token (Third party validation)
|
||||
|
||||
```php
|
||||
$api->payment->createUpi(array(
|
||||
'amount' => 200,
|
||||
'currency' => 'INR',
|
||||
'order_id' => 'order_Jhgp4wIVHQrg5H',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9123456789',
|
||||
'method' => 'upi',
|
||||
'customer_id' => 'cust_EIW4T2etiweBmG',
|
||||
'ip' => '192.168.0.103',
|
||||
'referer' => 'http',
|
||||
'user_agent' => 'Mozilla/5.0',
|
||||
'description' => 'Test flow',
|
||||
'notes' => array(
|
||||
'note_key' => 'value1'
|
||||
),
|
||||
'upi' => array(
|
||||
'flow' => 'intent'
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| order_id* | string | The unique identifier of the order created. |
|
||||
| email* | string | Email of the customer |
|
||||
| customer_id* | string | The id of the customer to be fetched |
|
||||
| contact* | string | Contact number of the customer |
|
||||
| notes | array | A key-value pair |
|
||||
| description | string | Descriptive text of the payment. |
|
||||
| save | boolean | Specifies if the VPA should be stored as tokens.Possible value is `0`, `1` |
|
||||
| callback_url | string | URL where Razorpay will submit the final payment status. |
|
||||
| ip* | string | The client's browser IP address. For example `117.217.74.98` |
|
||||
| referer* | string | Value of `referer` header passed by the client's browser. For example, `https://example.com/` |
|
||||
| user_agent* | string | Value of `user_agent` header passed by the client's browser. For example, `Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36` |
|
||||
| upi* (for Upi only) | array | All keys listed [here](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/upi/intent/#step-2-initiate-a-payment) are supported |
|
||||
|
||||
**Response:** <br>
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id": "pay_CMeM6XvOPGFiF",
|
||||
"link": "upi://pay?pa=success@razorpay&pn=xyz&tr=xxxxxxxxxxx&tn=gourav&am=1&cu=INR&mc=xyzw"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Valid VPA (Third party validation)
|
||||
|
||||
```php
|
||||
$api->payment->validateVpa(array('vpa'=>'gauravkumar@exampleupi'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| vpa* | string | The virtual payment address (VPA) you want to validate. For example, `gauravkumar@exampleupi` |
|
||||
|
||||
please refer this [doc](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/upi/collect#step-13-validate-the-vpa) for params
|
||||
|
||||
**Response:** <br>
|
||||
```json
|
||||
{
|
||||
"vpa": "gauravkumar@exampleupi",
|
||||
"success": true,
|
||||
"customer_name": "Gaurav Kumar"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch payment methods (Third party validation)
|
||||
|
||||
```php
|
||||
$api = new Api("key",""); // // Use Only razorpay key
|
||||
|
||||
$api->payment->fetchPaymentMethods();
|
||||
```
|
||||
|
||||
**Response:** <br>
|
||||
please refer this [doc](https://razorpay.com/docs/payments/third-party-validation/s2s-integration/methods-api/#fetch-payment-methods) for response
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### OTP Resend
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->otpResend();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| paymentId* | integer | Unique identifier of the payment |
|
||||
|
||||
Doc reference [doc](https://razorpay.com/docs/payments/payment-methods/cards/authentication/native-otp/#otp-resend)
|
||||
|
||||
**Response:** <br>
|
||||
|
||||
```json
|
||||
{
|
||||
"next": [
|
||||
"otp_submit",
|
||||
"otp_resend"
|
||||
],
|
||||
"razorpay_payment_id": "pay_JWaNvYmrx75sXo"
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a Payment (With Expanded Card Details)
|
||||
|
||||
```php
|
||||
$paymentId = "pay_MLzFlOC98cJmHQ";
|
||||
|
||||
$api->payment->fetch($paymentId)->expandedDetails(["expand[]"=> "card"]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| paymentId* | integer | Unique identifier of the payment |
|
||||
| expand[] | string | Use to expand the card details when the payment method is `card`. |
|
||||
|
||||
**Response:** <br>
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "pay_H9oR0gLCaVlV6m",
|
||||
"entity": "payment",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"status": "failed",
|
||||
"order_id": "order_H9o58N6qmLYQKC",
|
||||
"invoice_id": null,
|
||||
"terminal_id": "term_G5kJnYM9GhhLYT",
|
||||
"international": false,
|
||||
"method": "card",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": false,
|
||||
"description": null,
|
||||
"card_id": "card_H9oR0ocen1cmZq",
|
||||
"card": {
|
||||
"id": "card_H9oR0ocen1cmZq",
|
||||
"entity": "card",
|
||||
"name": "Gaurav",
|
||||
"last4": "1213",
|
||||
"network": "RuPay",
|
||||
"type": "credit",
|
||||
"issuer": "UTIB",
|
||||
"international": false,
|
||||
"emi": false,
|
||||
"sub_type": "business"
|
||||
},
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919000090000",
|
||||
"notes": {
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"phone": "09000090000"
|
||||
},
|
||||
"fee": null,
|
||||
"tax": null,
|
||||
"error_code": "BAD_REQUEST_ERROR",
|
||||
"error_description": "Card issuer is invalid",
|
||||
"error_source": "customer",
|
||||
"error_step": "payment_authentication",
|
||||
"error_reason": "incorrect_card_details",
|
||||
"acquirer_data": {
|
||||
"auth_code": null,
|
||||
"authentication_reference_number": "100222021120200000000742753928"
|
||||
},
|
||||
"created_at": 1620807547
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a Payment (With Expanded Offers Details)
|
||||
|
||||
```php
|
||||
$paymentId = "pay_MLzFlOC98cJmHQ";
|
||||
|
||||
$api->payment->fetch($paymentId)->expandedDetails(["expand[]"=> "emi"]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| paymentId* | integer | Unique identifier of the payment |
|
||||
| expand[] | string | Use to expand the emi details when the payment method is emi. |
|
||||
|
||||
**Response:** <br>
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "pay_DG4ZdRK8ZnXC3k",
|
||||
"entity": "payment",
|
||||
"amount": 200000,
|
||||
"currency": "INR",
|
||||
"status": "authorized",
|
||||
"order_id": null,
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "emi",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": false,
|
||||
"description": null,
|
||||
"card_id": "card_DG4ZdUO3xABb20",
|
||||
"bank": "ICIC",
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "gaurav@example.com",
|
||||
"contact": "+919972000005",
|
||||
"notes": [],
|
||||
"fee": null,
|
||||
"tax": null,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"emi": {
|
||||
"issuer": "ICIC",
|
||||
"rate": 1300,
|
||||
"duration": 6
|
||||
},
|
||||
"acquirer_data": {
|
||||
"auth_code": "828553"
|
||||
},
|
||||
"created_at": 1568026077
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a Payment (With Expanded UPI Details)
|
||||
|
||||
```php
|
||||
$paymentId = "pay_MLzFlOC98cJmHQ";
|
||||
|
||||
$api->payment->fetch($paymentId)->expandedDetails(["expand[]"=> "upi"]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|---------|--------------------------------------|
|
||||
| paymentId* | integer | Unique identifier of the payment |
|
||||
| expand[] | string | Use to expand the UPI details when the payment method is upi. |
|
||||
|
||||
**Response:** <br>
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "pay_DG4ZdRK8ZnXC3k",
|
||||
"entity": "payment",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_GjCr5oKh4AVC51",
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "upi",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": "Payment for Adidas shoes",
|
||||
"card_id": null,
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"vpa": "gaurav.kumar@upi",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9000090000",
|
||||
"customer_id": "cust_K6fNE0WJZWGqtN",
|
||||
"token_id": "token_KOdY$DBYQOv08n",
|
||||
"notes": [],
|
||||
"fee": 1,
|
||||
"tax": 0,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {
|
||||
"rrn": "303107535132"
|
||||
},
|
||||
"created_at": 1605871409,
|
||||
"upi": {
|
||||
"payer_account_type": "credit_card",
|
||||
"vpa": "gaurav.kumar@upi",
|
||||
"flow": "in_app" // appears only for Turbo UPI Payments.
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/payments/)**
|
||||
679
vendor/razorpay/razorpay/documents/paymentLink.md
vendored
Normal file
679
vendor/razorpay/razorpay/documents/paymentLink.md
vendored
Normal file
@ -0,0 +1,679 @@
|
||||
## Payment Links
|
||||
|
||||
### Create payment link
|
||||
|
||||
Request #1
|
||||
Standard Payment Link
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>500, 'currency'=>'INR', 'accept_partial'=>true,
|
||||
'first_min_partial_amount'=>100,'expire_by' => 1691097057, 'reference_id' => 'TS1989', 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,
|
||||
'reminder_enable'=>true ,'notes'=>array('policy_name'=> 'Jeevan Bima'),'callback_url' => 'https://example-callback-url.com/',
|
||||
'callback_method'=>'get'));
|
||||
```
|
||||
|
||||
Request #2
|
||||
UPI Payment Link
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('upi_link'=>true,'amount'=>500, 'currency'=>'INR', 'expire_by' => 1691097057, 'reference_id' => 'TS1989','description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar','email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'),'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>true ,'notes'=>array('policy_name'=> 'Jeevan Bima')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|upi_link* | boolean | boolean Must be set to true // to creating UPI Payment Link only |
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
|
||||
|accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values: true - Customer can make partial payments. false (default) - Customer cannot make partial payments. // UPI Payment Link is not supported partial payment |
|
||||
|description | string | A brief description of the Payment Link |
|
||||
|first_min_partial_amount | integer |Minimum amount, in currency subunits, that must be paid by the customer as the first partial payment. // UPI Payment Link is not supported partial payment |
|
||||
|reference_id | string | AReference number tagged to a Payment Link. |
|
||||
|customer | array | name, email, contact |
|
||||
|expire_by | integer | Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. |
|
||||
|notify | object | sms or email (boolean) |
|
||||
|notes | json object | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty” |
|
||||
|
||||
**Response:**
|
||||
For create payment link response please click [here](https://razorpay.com/docs/api/payment-links/#create-payment-link)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all payment link
|
||||
|
||||
```php
|
||||
$api->paymentLink->all();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|payment_id | string | Unique identifier of the payment associated with the Payment Link. |
|
||||
|reference_id | string | The unique reference number entered by you while creating the Payment Link. |
|
||||
|
||||
**Response:**
|
||||
For fetch all payment link response please click [here](https://razorpay.com/docs/api/payment-links/#all-payment-links)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch specific payment link
|
||||
|
||||
```php
|
||||
$api->paymentLink->fetch($paymentLinkId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| paymentLinkId* | string | Unique identifier of the Payment Link. |
|
||||
|
||||
**Response:**
|
||||
For fetch specific payment link response please click [here](https://razorpay.com/docs/api/payment-links/#specific-payment-links-by-id)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Update payment link
|
||||
|
||||
```php
|
||||
$api->paymentLink->fetch($paymentLinkId)->edit(array("reference_id"=>"TS42", "expire_by"=>"1640270451" , "reminder_enable"=>0, "notes"=>["policy_name"=>"Jeevan Saral 2"]));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| paymentLinkId* | string | The unique identifier of the Payment Link that needs to be updated. |
|
||||
| accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values: true - Customer can make partial payments. false (default) - Customer cannot make partial payments. |
|
||||
| reference_id | string | Adds a unique reference number to an existing link. |
|
||||
| expire_by | integer | Timestamp, in Unix format, when the payment links should expire. |
|
||||
| notes | string | object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”. |
|
||||
|
||||
**Response:**
|
||||
For updating payment link response please click [here](https://razorpay.com/docs/api/payment-links/#update-payment-link)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Cancel a payment link
|
||||
|
||||
```php
|
||||
$api->paymentLink->fetch($paymentLinkId)->cancel();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| paymentLinkId* | string | Unique identifier of the Payment Link. |
|
||||
|
||||
**Response:**
|
||||
For canceling payment link response please click [here](https://razorpay.com/docs/api/payment-links/#cancel-payment-link)
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Send notification
|
||||
|
||||
```php
|
||||
$api->paymentLink->fetch($paymentLinkId)->notifyBy($medium);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| paymentLinkId* | string | Unique identifier of the Payment Link that should be resent. |
|
||||
| medium* | string | `sms`/`email`,Medium through which the Payment Link must be resent. Allowed values are: |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"success": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Transfer payments received using payment links
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>20000, 'currency'=>'INR', 'accept_partial'=>false, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>true , 'options'=>array('order'=>array('transfers'=>array('account'=>'acc_CPRsN1LkFccllA', 'amount'=>500, 'currency'=>'INR', 'notes'=>array('branch'=>'Acme Corp Bangalore North', 'name'=>'Bhairav Kumar' ,'linked_account_notes'=>array('branch'))), array('account'=>'acc_CNo3jSI8OkFJJJ', 'amount'=>500, 'currency'=>'INR', 'notes'=>array('branch'=>'Acme Corp Bangalore North', 'name'=>'Saurav Kumar' ,'linked_account_notes'=>array('branch')))))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|options* | array | Options to configure the transfer in the Payment Link. Parent parameter under which the order child parameter must be passed. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"accept_partial": false,
|
||||
"amount": 1500,
|
||||
"amount_paid": 0,
|
||||
"callback_method": "",
|
||||
"callback_url": "",
|
||||
"cancelled_at": 0,
|
||||
"created_at": 1596526969,
|
||||
"currency": "INR",
|
||||
"customer": {
|
||||
"contact": "+919999999999",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"name": "Gaurav Kumar"
|
||||
},
|
||||
"deleted_at": 0,
|
||||
"description": "Payment for policy no #23456",
|
||||
"expire_by": 0,
|
||||
"expired_at": 0,
|
||||
"first_min_partial_amount": 0,
|
||||
"id": "plink_FMbhpT6nqDjDei",
|
||||
"notes": null,
|
||||
"notify": {
|
||||
"email": true,
|
||||
"sms": true
|
||||
},
|
||||
"payments": null,
|
||||
"reference_id": "#aasasw8",
|
||||
"reminder_enable": true,
|
||||
"reminders": [],
|
||||
"short_url": "https://rzp.io/i/ORor1MT",
|
||||
"source": "",
|
||||
"source_id": "",
|
||||
"status": "created",
|
||||
"updated_at": 1596526969,
|
||||
"user_id": ""
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Offers on payment links
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>20000, 'currency'=>'INR', 'accept_partial'=>false, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>false , 'options'=>array('order'=>array('offers'=>array('offer_I0PqexIiTmMRnA')))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
|
||||
|description | string | A brief description of the Payment Link |
|
||||
|reference_id | string | AReference number tagged to a Payment Link. |
|
||||
|customer | array | name, email, contact |
|
||||
|expire_by | integer | Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. |
|
||||
|notify | object | sms or email (boolean) |
|
||||
|options* | array | Options to associate the offer_id with the Payment Link. Parent parameter under which the order child parameter must be passed. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"accept_partial": false,
|
||||
"amount": 3400,
|
||||
"amount_paid": 0,
|
||||
"cancelled_at": 0,
|
||||
"created_at": 1600183040,
|
||||
"currency": "INR",
|
||||
"customer": {
|
||||
"contact": "+919999999999",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"name": "Gaurav Kumar"
|
||||
},
|
||||
"description": "Payment for policy no #23456",
|
||||
"expire_by": 0,
|
||||
"expired_at": 0,
|
||||
"first_min_partial_amount": 0,
|
||||
"id": "plink_FdLt0WBldRyE5t",
|
||||
"notes": null,
|
||||
"notify": {
|
||||
"email": true,
|
||||
"sms": true
|
||||
},
|
||||
"payments": null,
|
||||
"reference_id": "#425",
|
||||
"reminder_enable": false,
|
||||
"reminders": [],
|
||||
"short_url": "https://rzp.io/i/CM5ohDC",
|
||||
"status": "created",
|
||||
"user_id": ""
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Managing reminders for payment links
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>500, 'currency'=>'INR', 'accept_partial'=>true, 'first_min_partial_amount'=>100, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>false));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
|
||||
|currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
|
||||
|description | string | A brief description of the Payment Link |
|
||||
|customer | array | name, email, contact |
|
||||
|expire_by | integer | Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. |
|
||||
|notify | object | sms or email (boolean) |
|
||||
|reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"amount": 340000,
|
||||
"amount_due": 340000,
|
||||
"amount_paid": 0,
|
||||
"billing_end": null,
|
||||
"billing_start": null,
|
||||
"cancelled_at": null,
|
||||
"comment": null,
|
||||
"created_at": 1592579126,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"customer_details": {
|
||||
"billing_address": null,
|
||||
"contact": "9900990099",
|
||||
"customer_contact": "9900990099",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"gstin": null,
|
||||
"id": "cust_F4WNtqj1xb0Duv",
|
||||
"name": "Gaurav Kumar",
|
||||
"shipping_address": null
|
||||
},
|
||||
"customer_id": "cust_F4WNtqj1xb0Duv",
|
||||
"date": 1592579126,
|
||||
"description": "Salon at Home Service",
|
||||
"email_status": null,
|
||||
"entity": "invoice",
|
||||
"expire_by": 1608390326,
|
||||
"expired_at": null,
|
||||
"first_payment_min_amount": 0,
|
||||
"gross_amount": 340000,
|
||||
"group_taxes_discounts": false,
|
||||
"id": "inv_F4WfpZLk1ct35b",
|
||||
"invoice_number": null,
|
||||
"issued_at": 1592579126,
|
||||
"line_items": [],
|
||||
"notes": [],
|
||||
"order_id": "order_F4WfpxUzWmYOTl",
|
||||
"paid_at": null,
|
||||
"partial_payment": false,
|
||||
"payment_id": null,
|
||||
"receipt": "5757",
|
||||
"reminder_enable": false,
|
||||
"short_url": "https://rzp.io/i/vitLptM",
|
||||
"sms_status": null,
|
||||
"status": "issued",
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"terms": null,
|
||||
"type": "link",
|
||||
"user_id": "",
|
||||
"view_less": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Rename labels in checkout section
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>500, 'currency'=>'INR', 'accept_partial'=>true, 'first_min_partial_amount'=>100, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>true , 'options'=>array('checkout'=>array('partial_payment'=>array('min_amount_label'=>'Minimum Money to be paid', 'partial_amount_label'=>'Pay in parts', 'partial_amount_description'=>'Pay at least ₹100', 'full_amount_label'=>'Pay the entire amount')))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
|
||||
|currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
|
||||
|description | string | A brief description of the Payment Link |
|
||||
|customer | array | name, email, contact |
|
||||
|expire_by | integer | Timestamp, in Unix, at which the Payment Link will expire. By default, a Payment Link will be valid for six months from the date of creation. |
|
||||
|notify | object | sms or email (boolean) |
|
||||
|reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
|
||||
|options* | array | Options to rename the labels for partial payment fields in the checkout form. Parent parameter under which the checkout and partial_payment child parameters must be passed. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"accept_partial": true,
|
||||
"amount": 1000,
|
||||
"amount_paid": 0,
|
||||
"callback_method": "",
|
||||
"callback_url": "",
|
||||
"cancelled_at": 0,
|
||||
"created_at": 1596193199,
|
||||
"currency": "INR",
|
||||
"customer": {
|
||||
"contact": "+919999999999",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"name": "Gaurav Kumar"
|
||||
},
|
||||
"deleted_at": 0,
|
||||
"description": "Payment for policy no #23456",
|
||||
"expire_by": 0,
|
||||
"expired_at": 0,
|
||||
"first_min_partial_amount": 100,
|
||||
"id": "plink_FL4vbXVKfW7PAz",
|
||||
"notes": null,
|
||||
"notify": {
|
||||
"email": true,
|
||||
"sms": true
|
||||
},
|
||||
"payments": null,
|
||||
"reference_id": "#42321",
|
||||
"reminder_enable": true,
|
||||
"reminders": [],
|
||||
"short_url": "https://rzp.io/i/F4GC9z1",
|
||||
"source": "",
|
||||
"source_id": "",
|
||||
"status": "created",
|
||||
"updated_at": 1596193199,
|
||||
"user_id": ""
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Change Business name
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>500, 'currency'=>'INR', 'accept_partial'=>true, 'first_min_partial_amount'=>100, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>true , 'options'=>array('checkout'=>array('name'=>'Lacme Corp'))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
|
||||
|accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
|
||||
|first_min_partial_amount | integer | |
|
||||
|description | string | A brief description of the Payment Link |
|
||||
|customer | array | name, email, contact |
|
||||
|notify | object | sms or email (boolean) |
|
||||
|reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
|
||||
|options* | array | Option to customize the business name. Parent parameter under which the checkout child parameter must be passed.|
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"accept_partial": true,
|
||||
"amount": 1000,
|
||||
"amount_paid": 0,
|
||||
"callback_method": "",
|
||||
"callback_url": "",
|
||||
"cancelled_at": 0,
|
||||
"created_at": 1596187657,
|
||||
"currency": "INR",
|
||||
"customer": {
|
||||
"contact": "+919999999999",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"name": "Gaurav Kumar"
|
||||
},
|
||||
"description": "Payment for policy no #23456",
|
||||
"expire_by": 0,
|
||||
"expired_at": 0,
|
||||
"first_min_partial_amount": 100,
|
||||
"id": "plink_FL3M2gJFs1Jkma",
|
||||
"notes": null,
|
||||
"notify": {
|
||||
"email": true,
|
||||
"sms": true
|
||||
},
|
||||
"payments": null,
|
||||
"reference_id": "#2234542",
|
||||
"reminder_enable": true,
|
||||
"reminders": [],
|
||||
"short_url": "https://rzp.io/i/at2OOsR",
|
||||
"source": "",
|
||||
"source_id": "",
|
||||
"status": "created",
|
||||
"updated_at": 1596187657,
|
||||
"user_id": ""
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Prefill checkout fields
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>500, 'currency'=>'INR', 'accept_partial'=>true, 'first_min_partial_amount'=>100, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>true , 'options'=>array('checkout'=>array('prefill'=>array('method'=>'card', 'card[name]'=>'Gaurav Kumar', 'card[number]'=>'4111111111111111', 'card[expiry]'=>'12/21', 'card[cvv]'=>'123')))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
|
||||
|accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
|
||||
|first_min_partial_amount | integer | |
|
||||
|description | string | A brief description of the Payment Link |
|
||||
|customer | array | name, email, contact |
|
||||
|notify | object | sms or email (boolean) |
|
||||
|reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
|
||||
|options* | array | Options to customize Checkout. Parent parameter under which the checkout and prefill child parameters must be passed.|
|
||||
|
||||
**Response:**
|
||||
For prefill checkout fields response please click [here](https://razorpay.com/docs/payment-links/api/new/advanced-options/customize/prefill/)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Customize payment methods
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>500, 'currency'=>'INR', 'accept_partial'=>true, 'first_min_partial_amount'=>100, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>true , 'options'=>array('checkout'=>array('method'=>array('netbanking'=>'1', 'card'=>'1', 'upi'=>'0', 'wallet'=>'0')))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
|
||||
|accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
|
||||
|first_min_partial_amount | integer | |
|
||||
|description | string | A brief description of the Payment Link |
|
||||
|customer | array | name, email, contact |
|
||||
|notify | object | sms or email (boolean) |
|
||||
|reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
|
||||
|options* | array | Options to display or hide payment methods on the Checkout section. Parent parameter under which the checkout and method child parameters must be passed.|
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"accept_partial": true,
|
||||
"amount": 1000,
|
||||
"amount_paid": 0,
|
||||
"callback_method": "",
|
||||
"callback_url": "",
|
||||
"cancelled_at": 0,
|
||||
"created_at": 1596188371,
|
||||
"currency": "INR",
|
||||
"customer": {
|
||||
"contact": "+919999999999",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"name": "Gaurav Kumar"
|
||||
},
|
||||
"deleted_at": 0,
|
||||
"description": "Payment for policy no #23456",
|
||||
"expire_by": 0,
|
||||
"expired_at": 0,
|
||||
"first_min_partial_amount": 100,
|
||||
"id": "plink_FL3YbdvN2Cj6gh",
|
||||
"notes": null,
|
||||
"notify": {
|
||||
"email": true,
|
||||
"sms": true
|
||||
},
|
||||
"payments": null,
|
||||
"reference_id": "#543422",
|
||||
"reminder_enable": true,
|
||||
"reminders": [],
|
||||
"short_url": "https://rzp.io/i/wKiXKud",
|
||||
"source": "",
|
||||
"source_id": "",
|
||||
"status": "created",
|
||||
"updated_at": 1596188371,
|
||||
"user_id": ""
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Set checkout fields as read-only
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>500, 'currency'=>'INR', 'accept_partial'=>true, 'first_min_partial_amount'=>100, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>true , 'options'=>array('checkout'=>array('readonly'=>array('email'=>'1','contact'=>'1')))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
|
||||
|accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
|
||||
|first_min_partial_amount | integer | |
|
||||
|description | string | A brief description of the Payment Link |
|
||||
|customer | array | name, email, contact |
|
||||
|notify | object | sms or email (boolean) |
|
||||
|reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
|
||||
|options* | array | Options to set contact and email as read-only fields on Checkout. Parent parameter under which the checkout and readonly child parameters must be passed.|
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"accept_partial": true,
|
||||
"amount": 1000,
|
||||
"amount_paid": 0,
|
||||
"callback_method": "",
|
||||
"callback_url": "",
|
||||
"cancelled_at": 0,
|
||||
"created_at": 1596190845,
|
||||
"currency": "INR",
|
||||
"customer": {
|
||||
"contact": "+919999999999",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"name": "Gaurav Kumar"
|
||||
},
|
||||
"deleted_at": 0,
|
||||
"description": "Payment for policy no #23456",
|
||||
"expire_by": 0,
|
||||
"expired_at": 0,
|
||||
"first_min_partial_amount": 100,
|
||||
"id": "plink_FL4GA1t6FBcaVR",
|
||||
"notes": null,
|
||||
"notify": {
|
||||
"email": true,
|
||||
"sms": true
|
||||
},
|
||||
"payments": null,
|
||||
"reference_id": "#19129",
|
||||
"reminder_enable": true,
|
||||
"reminders": [],
|
||||
"short_url": "https://rzp.io/i/QVwUglR",
|
||||
"source": "",
|
||||
"source_id": "",
|
||||
"status": "created",
|
||||
"updated_at": 1596190845,
|
||||
"user_id": ""
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Implement thematic changes in payment links checkout section
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>500, 'currency'=>'INR', 'accept_partial'=>true, 'first_min_partial_amount'=>100, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>true , 'options'=>array('checkout'=>array('theme'=>array('hide_topbar'=>'true')))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
|
||||
|accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
|
||||
|first_min_partial_amount | integer | |
|
||||
|description | string | A brief description of the Payment Link |
|
||||
|customer | array | name, email, contact |
|
||||
|notify | object | sms or email (boolean) |
|
||||
|reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
|
||||
|options* | array | Options to show or hide the top bar. Parent parameter under which the checkout and theme child parameters must be passed.|
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"accept_partial": true,
|
||||
"amount": 1000,
|
||||
"amount_paid": 0,
|
||||
"callback_method": "",
|
||||
"callback_url": "",
|
||||
"cancelled_at": 0,
|
||||
"created_at": 1596187814,
|
||||
"currency": "INR",
|
||||
"customer": {
|
||||
"contact": "+919999999999",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"name": "Gaurav Kumar"
|
||||
},
|
||||
"description": "Payment for policy no #23456",
|
||||
"expire_by": 0,
|
||||
"expired_at": 0,
|
||||
"first_min_partial_amount": 100,
|
||||
"id": "plink_FL3Oncr7XxXFf6",
|
||||
"notes": null,
|
||||
"notify": {
|
||||
"email": true,
|
||||
"sms": true
|
||||
},
|
||||
"payments": null,
|
||||
"reference_id": "#423212",
|
||||
"reminder_enable": true,
|
||||
"reminders": [],
|
||||
"short_url": "https://rzp.io/i/j45EmLE",
|
||||
"source": "",
|
||||
"source_id": "",
|
||||
"status": "created",
|
||||
"updated_at": 1596187814,
|
||||
"user_id": ""
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Rename labels in payment details section
|
||||
|
||||
```php
|
||||
$api->paymentLink->create(array('amount'=>500, 'currency'=>'INR', 'accept_partial'=>true, 'first_min_partial_amount'=>100, 'description' => 'For XYZ purpose', 'customer' => array('name'=>'Gaurav Kumar', 'email' => 'gaurav.kumar@example.com', 'contact'=>'+919999999999'), 'notify'=>array('sms'=>true, 'email'=>true) ,'reminder_enable'=>true , 'options'=>array('hosted_page'=>array('label'=>array('receipt'=>'Ref No.', 'description'=>'Course Name', 'amount_payable'=>'Course Fee Payable', 'amount_paid'=>'Course Fee Paid', 'partial_amount_due'=>'Fee Installment Due', 'partial_amount_paid'=>'Fee Installment Paid', 'expire_by'=>'Pay Before', 'expired_on'=>'1632223497','amount_due'=>'Course Fee Due'), 'show_preferences'=>array('issued_to'=>false)))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
|amount* | integer | Amount to be paid using the Payment Link. |
|
||||
|currency | string | A three-letter ISO code for the currency in which you want to accept the payment. For example, INR. |
|
||||
|accept_partial | boolean | Indicates whether customers can make partial payments using the Payment Link. Possible values:true - Customer can make partial payments.false (default) - Customer cannot make partial payments. |
|
||||
|first_min_partial_amount | integer | |
|
||||
|description | string | A brief description of the Payment Link |
|
||||
|customer | array | name, email, contact |
|
||||
|notify | object | sms or email (boolean) |
|
||||
|reminder_enable | boolean | To disable reminders for a Payment Link, pass reminder_enable as false |
|
||||
|options* | array | Parent parameter under which the hosted_page and label child parameters must be passed.|
|
||||
|
||||
**Response:**
|
||||
For rename labels in payment details section response please click [here](https://razorpay.com/docs/payment-links/api/new/advanced-options/customize/rename-payment-details-labels/)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/payment-links/)**
|
||||
68
vendor/razorpay/razorpay/documents/paymentVerfication.md
vendored
Normal file
68
vendor/razorpay/razorpay/documents/paymentVerfication.md
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
## payment verification
|
||||
|
||||
### Verify payment verification
|
||||
|
||||
```php
|
||||
$api->utility->verifyPaymentSignature(array('razorpay_order_id' => $razorpayOrderId, 'razorpay_payment_id' => $razorpayPaymentId, 'razorpay_signature' => $razorpaySignature));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| orderId* | string | The id of the order to be fetched |
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
| signature* | string | Signature returned by the Checkout. This is used to verify the payment. |
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Verify subscription verification
|
||||
|
||||
```php
|
||||
$api->utility->verifyPaymentSignature(array('razorpay_subscription_id' => $razorpaySubscriptionId, 'razorpay_payment_id' => $razorpayPaymentId, 'razorpay_signature' => $razorpaySignature));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | string | The id of the subscription to be fetched |
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
| signature* | string | Signature returned by the Checkout. This is used to verify the payment. |
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Verify paymentlink verification
|
||||
|
||||
```php
|
||||
$api->utility->verifyPaymentSignature(array('razorpay_payment_link_id' => $razorpayPaymentlinkId, 'razorpay_payment_id' => $razorpayPaymentId, 'razorpay_payment_link_reference_id' => $razorpayPaymentLinkReferenceId, 'razorpay_payment_link_status' => $razorpayPaymentLinkStatus, 'razorpay_signature' => $razorpayPaymentLinkSignature));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| razorpayPaymentlinkId* | string | The id of the paymentlink to be fetched |
|
||||
| razorpayPaymentId* | string | The id of the payment to be fetched |
|
||||
| razorpayPaymentLinkReferenceId* | string | A reference number tagged to a Payment Link |
|
||||
| razorpayPaymentLinkStatus* | string | Current status of the link |
|
||||
| razorpayPaymentLinkSignature* | string | Signature returned by the Checkout. This is used to verify the payment. |
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Verify webhook signature
|
||||
|
||||
```php
|
||||
$webhookBody = '{"entity":"event","account_id":"acc_Hn1ukn2d32Fqww","event":"payment.authorized","contains":["payment"],"payload":{"payment":{"entity":{"id":"pay_JTVtDcN1uRYb5n","entity":"payment","amount":22345,"currency":"INR","status":"authorized","order_id":"order_JTVsulofMPyzBY","invoice_id":null,"international":false,"method":"card","amount_refunded":0,"refund_status":null,"captured":false,"description":"#JT8o1jsTyzrywc","card_id":"card_JTVtDjPwZbFbTM","card":{"id":"card_JTVtDjPwZbFbTM","entity":"card","name":"gaurav","last4":"4366","network":"Visa","type":"credit","issuer":"UTIB","international":false,"emi":true,"sub_type":"consumer","token_iin":null},"bank":null,"wallet":null,"vpa":null,"email":"you@example.com","contact":"+919999999999","notes":{"policy_name":"Jeevan Saral"},"fee":null,"tax":null,"error_code":null,"error_description":null,"error_source":null,"error_step":null,"error_reason":null,"acquirer_data":{"auth_code":"472379"},"created_at":1652183214}}},"created_at":1652183218}';
|
||||
|
||||
$webhookSignature = "27209ba357bf7b7b461a4c1d7f54d5a8bb6b0b4b2f5fa4aebf1f1c861a05d18a";
|
||||
$webhookSecret = "test";
|
||||
|
||||
|
||||
$api->utility->verifyWebhookSignature($webhookBody, $webhookSignature, $webhookSecret);
|
||||
```
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
159
vendor/razorpay/razorpay/documents/plan.md
vendored
Normal file
159
vendor/razorpay/razorpay/documents/plan.md
vendored
Normal file
@ -0,0 +1,159 @@
|
||||
## Plans
|
||||
|
||||
### Create plan
|
||||
|
||||
```php
|
||||
$api->plan->create(array('period' => 'weekly', 'interval' => 1, 'item' => array('name' => 'Test Weekly 1 plan', 'description' => 'Description for the weekly 1 plan', 'amount' => 600, 'currency' => 'INR'),'notes'=> array('key1'=> 'value3','key2'=> 'value2')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| period* | string | Used together with `interval` to define how often the customer should be charged.Possible values:<br>1.`daily` <br>2.`weekly`<br>3.`monthly` <br>4.`yearly` |
|
||||
| interval* | string | Used together with `period` to define how often the customer should be charged |
|
||||
| items* | array | Details of the plan. For more details please refer [here](https://razorpay.com/docs/api/subscriptions/#create-a-plan) |
|
||||
| notes | array | Notes you can enter for the contact for future reference. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"plan_00000000000001",
|
||||
"entity":"plan",
|
||||
"interval":1,
|
||||
"period":"weekly",
|
||||
"item":{
|
||||
"id":"item_00000000000001",
|
||||
"active":true,
|
||||
"name":"Test plan - Weekly",
|
||||
"description":"Description for the test plan - Weekly",
|
||||
"amount":69900,
|
||||
"unit_amount":69900,
|
||||
"currency":"INR",
|
||||
"type":"plan",
|
||||
"unit":null,
|
||||
"tax_inclusive":false,
|
||||
"hsn_code":null,
|
||||
"sac_code":null,
|
||||
"tax_rate":null,
|
||||
"tax_id":null,
|
||||
"tax_group_id":null,
|
||||
"created_at":1580219935,
|
||||
"updated_at":1580219935
|
||||
},
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at":1580219935
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all plans
|
||||
|
||||
```php
|
||||
$api->plan->all($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the payments were created |
|
||||
| to | timestamp | timestamp before which the payments were created |
|
||||
| count | integer | number of payments to fetch (default: 10) |
|
||||
| skip | integer | number of payments to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "plan_00000000000001",
|
||||
"entity": "plan",
|
||||
"interval": 1,
|
||||
"period": "weekly",
|
||||
"item": {
|
||||
"id": "item_00000000000001",
|
||||
"active": true,
|
||||
"name": "Test plan - Weekly",
|
||||
"description": "Description for the test plan - Weekly",
|
||||
"amount": 69900,
|
||||
"unit_amount": 69900,
|
||||
"currency": "INR",
|
||||
"type": "plan",
|
||||
"unit": null,
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"tax_id": null,
|
||||
"tax_group_id": null,
|
||||
"created_at": 1580220492,
|
||||
"updated_at": 1580220492
|
||||
},
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1580220492
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch particular plan
|
||||
|
||||
```php
|
||||
$api->plan->fetch($planId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| planId* | string | The id of the plan to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"plan_00000000000001",
|
||||
"entity":"plan",
|
||||
"interval":1,
|
||||
"period":"weekly",
|
||||
"item":{
|
||||
"id":"item_00000000000001",
|
||||
"active":true,
|
||||
"name":"Test plan - Weekly",
|
||||
"description":"Description for the test plan - Weekly",
|
||||
"amount":69900,
|
||||
"unit_amount":69900,
|
||||
"currency":"INR",
|
||||
"type":"plan",
|
||||
"unit":null,
|
||||
"tax_inclusive":false,
|
||||
"hsn_code":null,
|
||||
"sac_code":null,
|
||||
"tax_rate":null,
|
||||
"tax_id":null,
|
||||
"tax_group_id":null,
|
||||
"created_at":1580220492,
|
||||
"updated_at":1580220492
|
||||
},
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at":1580220492
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/subscriptions/#plans)**
|
||||
604
vendor/razorpay/razorpay/documents/productConfiguration.md
vendored
Normal file
604
vendor/razorpay/razorpay/documents/productConfiguration.md
vendored
Normal file
@ -0,0 +1,604 @@
|
||||
## Product Configuration
|
||||
|
||||
### Request a Product Configuration
|
||||
```php
|
||||
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$api->account->fetch($accountId)->products()->requestProductConfiguration(array(
|
||||
"product_name" => "payment_gateway",
|
||||
"tnc_accepted" => true,
|
||||
"ip" => "233.233.233.234"
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| product_name* | string | The product(s) to be configured. Possible value is `payment_gateway`, `payment_links` |
|
||||
| tnc_accepted | boolean | Pass this parameter to accept terms and conditions. Send this parameter along with the ip parameter when the tnc is accepted. Possible values is `true` |
|
||||
| ip | integer | The IP address of the merchant while accepting the terms and conditions. Send this parameter along with the `tnc_accepted` parameter when the `tnc` is accepted. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"requested_configuration": {
|
||||
"payment_methods": []
|
||||
},
|
||||
"active_configuration": {
|
||||
"payment_capture": {
|
||||
"mode": "automatic",
|
||||
"refund_speed": "normal",
|
||||
"automatic_expiry_period": 7200
|
||||
},
|
||||
"settlements": {
|
||||
"account_number": null,
|
||||
"ifsc_code": null,
|
||||
"beneficiary_name": null
|
||||
},
|
||||
"checkout": {
|
||||
"theme_color": "#FFFFFF",
|
||||
"flash_checkout": true,
|
||||
"logo": "https://example.com/your_logo"
|
||||
},
|
||||
"refund": {
|
||||
"default_refund_speed": "normal"
|
||||
},
|
||||
"notifications": {
|
||||
"whatsapp": true,
|
||||
"sms": false,
|
||||
"email": [
|
||||
"b963e252-1201-45b0-9c39-c53eceb0cfd6_load@gmail.com"
|
||||
]
|
||||
},
|
||||
"payment_methods": {
|
||||
"netbanking": {
|
||||
"enabled": true,
|
||||
"instrument": [
|
||||
{
|
||||
"type": "retail",
|
||||
"bank": [
|
||||
"hdfc",
|
||||
"sbin",
|
||||
"utib",
|
||||
"icic",
|
||||
"scbl",
|
||||
"yesb"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"wallet": {
|
||||
"enabled": true,
|
||||
"instrument": [
|
||||
"airtelmoney",
|
||||
"freecharge",
|
||||
"jiomoney",
|
||||
"olamoney",
|
||||
"payzapp",
|
||||
"mobikwik"
|
||||
]
|
||||
},
|
||||
"upi": {
|
||||
"enabled": true,
|
||||
"instrument": [
|
||||
"upi"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
{
|
||||
"field_reference": "individual_proof_of_address",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
|
||||
"status": "required",
|
||||
"reason_code": "document_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "individual_proof_of_identification",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
|
||||
"status": "required",
|
||||
"reason_code": "document_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "business_proof_of_identification",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/documents",
|
||||
"status": "required",
|
||||
"reason_code": "document_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "settlements.beneficiary_name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "settlements.account_number",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "settlements.ifsc_code",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "contact_name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "customer_facing_business_name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "kyc.pan",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
}
|
||||
],
|
||||
"tnc":{
|
||||
"id": "tnc_IgohZaDBHRGjPv",
|
||||
"accepted": true,
|
||||
"accepted_at": 1641550798
|
||||
},
|
||||
"id": "acc_prd_HEgNpywUFctQ9e",
|
||||
"account_id": "acc_HQVlm3bnPmccC0",
|
||||
"product_name": "payment_gateway",
|
||||
"activation_status": "needs_clarification",
|
||||
"requested_at": 162547884
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Edit a Product Configuration
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
$productId = "acc_prd_HEgNpywUFctQ9e";
|
||||
|
||||
$api->account->fetch($accountId)->products()->edit($productId, array(
|
||||
"notifications" => array(
|
||||
"email" => array(
|
||||
"gaurav.kumar@example.com",
|
||||
"acd@gmail.com"
|
||||
)
|
||||
),
|
||||
"checkout" => array(
|
||||
"theme_color" => "#528FFF"
|
||||
),
|
||||
"refund" => array(
|
||||
"default_refund_speed" => "optimum"
|
||||
),
|
||||
"settlements" => array(
|
||||
"account_number" => "1234567890",
|
||||
"ifsc_code" => "HDFC0000317",
|
||||
"beneficiary_name" => "Gaurav Kumar"
|
||||
),
|
||||
"tnc_accepted" => true,
|
||||
"ip" => "233.233.233.234"
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| notifications | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
|
||||
| checkout | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
|
||||
| refund | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
|
||||
| settlements | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
|
||||
| tnc_accepted | boolean | Pass this parameter to accept terms and conditions. Send this parameter along with the ip parameter when the tnc is accepted. Possible value is `true` |
|
||||
| ip | string | The IP address of the merchant while accepting the terms and conditions. Send this parameter along with the tnc_accepted parameter when the `tnc` is accepted. |
|
||||
| payment_methods | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
|
||||
| type | string | Possible value is `domestic` |
|
||||
| issuer | string | The card issuer. Possible values for issuer are `amex`, `dicl`, `maestro`, `mastercard`, `rupay`, `visa`. |
|
||||
| wallet | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
|
||||
| instrument(wallet) | string | The wallet issuer. Possible values are `airtelmoney`, `amazonpay`, `freecharge`, `jiomoney`, `mobiwik`, `mpesa`, `olamoney`, `paytm`, `payzapp`, `payumoney`, `phonepe`, `phonepeswitch`, `sbibuddy` |
|
||||
| instrument(wallet) | string | The wallet issuer. Possible values are `airtelmoney`, `amazonpay`, `freecharge`, `jiomoney`, `mobiwik`, `mpesa`, `olamoney`, `paytm`, `payzapp`, `payumoney`, `phonepe`, `phonepeswitch`, `sbibuddy` |
|
||||
| upi | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
|
||||
| instrument(upi) | string | The UPI service provider. Possible values are `google_pay`, `upi`|
|
||||
| paylater | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
|
||||
| instrument(emi) | string | The Paylater service provider. Possible values are `epaylater`, `getsimpl`|
|
||||
| emi | object | All keys listed [here](https://razorpay.com/docs/api/partners/product-configuration/#update-a-product-configuration) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "acc_GP4lfNA0iIMn5B",
|
||||
"type": "standard",
|
||||
"status": "created",
|
||||
"email": "gauri@example.org",
|
||||
"profile": {
|
||||
"category": "healthcare",
|
||||
"subcategory": "clinic",
|
||||
"addresses": {
|
||||
"registered": {
|
||||
"street1": "507, Koramangala 1st block",
|
||||
"street2": "MG Road-1",
|
||||
"city": "Bengalore",
|
||||
"state": "KARNATAKA",
|
||||
"postal_code": "560034",
|
||||
"country": "IN"
|
||||
}
|
||||
}
|
||||
},
|
||||
"notes": [],
|
||||
"created_at": 1610603081,
|
||||
"phone": "9000090000",
|
||||
"reference_id": "randomId",
|
||||
"business_type": "partnership",
|
||||
"legal_business_name": "Acme Corp",
|
||||
"customer_facing_business_name": "ABCD Ltd"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a product configuration
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$productId = "acc_prd_HEgNpywUFctQ9e";
|
||||
|
||||
$api->account->fetch($accountId)->products()->fetch($productId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
| productId* | string | The unique identifier of a product generated by Razorpay. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"requested_configuration": {
|
||||
"payment_methods": []
|
||||
},
|
||||
"active_configuration": {
|
||||
"payment_capture": {
|
||||
"mode": "automatic",
|
||||
"refund_speed": "normal",
|
||||
"automatic_expiry_period": 7200
|
||||
},
|
||||
"settlements": {
|
||||
"account_number": null,
|
||||
"ifsc_code": null,
|
||||
"beneficiary_name": null
|
||||
},
|
||||
"checkout": {
|
||||
"theme_color": "#FFFFFF",
|
||||
"flash_checkout": true
|
||||
},
|
||||
"refund": {
|
||||
"default_refund_speed": "normal"
|
||||
},
|
||||
"notifications": {
|
||||
"whatsapp": true,
|
||||
"sms": false,
|
||||
"email": [
|
||||
"b963e252-1201-45b0-9c39-c53eceb0cfd6_load@gmail.com"
|
||||
]
|
||||
},
|
||||
"payment_methods": {
|
||||
"netbanking": {
|
||||
"enabled": true,
|
||||
"instrument": [
|
||||
{
|
||||
"type": "retail",
|
||||
"bank": [
|
||||
"hdfc",
|
||||
"sbin",
|
||||
"utib",
|
||||
"icic",
|
||||
"scbl",
|
||||
"yesb"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"wallet": {
|
||||
"enabled": true,
|
||||
"instrument": [
|
||||
"airtelmoney",
|
||||
"freecharge",
|
||||
"jiomoney",
|
||||
"olamoney",
|
||||
"payzapp",
|
||||
"mobikwik"
|
||||
]
|
||||
},
|
||||
"upi": {
|
||||
"enabled": true,
|
||||
"instrument": [
|
||||
"upi"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
{
|
||||
"field_reference": "individual_proof_of_address",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
|
||||
"status": "required",
|
||||
"reason_code": "document_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "individual_proof_of_identification",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
|
||||
"status": "required",
|
||||
"reason_code": "document_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "business_proof_of_identification",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/documents",
|
||||
"status": "required",
|
||||
"reason_code": "document_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "settlements.beneficiary_name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "settlements.account_number",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "settlements.ifsc_code",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "contact_name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "customer_facing_business_name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "kyc.pan",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
}
|
||||
],
|
||||
"tnc":{
|
||||
"id": "tnc_IgohZaDBHRGjPv",
|
||||
"accepted": true,
|
||||
"accepted_at": 1641550798
|
||||
},
|
||||
"id": "acc_prd_HEgNpywUFctQ9e",
|
||||
"account_id": "acc_HQVlm3bnPmccC0",
|
||||
"product_name": "payment_gateway",
|
||||
"activation_status": "needs_clarification",
|
||||
"requested_at": 1625478849
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch Terms and Conditions for a Sub-Merchant
|
||||
```php
|
||||
|
||||
$productName = "payments";
|
||||
|
||||
$api->product->fetchTnc($productName);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| productName* | string | The product family for which the relevant product to be requested for the sub-merchant. Possible value is `payments` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "tnc_map",
|
||||
"product_name": "payments",
|
||||
"id": "tnc_map_HjOVhIdpVDZ0FB",
|
||||
"tnc": {
|
||||
"terms": "https://razorpay.com/terms",
|
||||
"privacy": "https://razorpay.com/privacy",
|
||||
"agreement": "https://razorpay.com/agreement"
|
||||
},
|
||||
"last_published_at": 1640589653
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a product configuration
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$productId = "acc_prd_HEgNpywUFctQ9e";
|
||||
|
||||
$api->account->fetch($accountId)->products()->fetch($productId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
| productId* | string | The unique identifier of a product generated by Razorpay. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"requested_configuration": {
|
||||
"payment_methods": []
|
||||
},
|
||||
"active_configuration": {
|
||||
"payment_capture": {
|
||||
"mode": "automatic",
|
||||
"refund_speed": "normal",
|
||||
"automatic_expiry_period": 7200
|
||||
},
|
||||
"settlements": {
|
||||
"account_number": null,
|
||||
"ifsc_code": null,
|
||||
"beneficiary_name": null
|
||||
},
|
||||
"checkout": {
|
||||
"theme_color": "#FFFFFF",
|
||||
"flash_checkout": true
|
||||
},
|
||||
"refund": {
|
||||
"default_refund_speed": "normal"
|
||||
},
|
||||
"notifications": {
|
||||
"whatsapp": true,
|
||||
"sms": false,
|
||||
"email": [
|
||||
"b963e252-1201-45b0-9c39-c53eceb0cfd6_load@gmail.com"
|
||||
]
|
||||
},
|
||||
"payment_methods": {
|
||||
"netbanking": {
|
||||
"enabled": true,
|
||||
"instrument": [
|
||||
{
|
||||
"type": "retail",
|
||||
"bank": [
|
||||
"hdfc",
|
||||
"sbin",
|
||||
"utib",
|
||||
"icic",
|
||||
"scbl",
|
||||
"yesb"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"wallet": {
|
||||
"enabled": true,
|
||||
"instrument": [
|
||||
"airtelmoney",
|
||||
"freecharge",
|
||||
"jiomoney",
|
||||
"olamoney",
|
||||
"payzapp",
|
||||
"mobikwik"
|
||||
]
|
||||
},
|
||||
"upi": {
|
||||
"enabled": true,
|
||||
"instrument": [
|
||||
"upi"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
{
|
||||
"field_reference": "individual_proof_of_address",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
|
||||
"status": "required",
|
||||
"reason_code": "document_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "individual_proof_of_identification",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders/{stakeholderId}/documents",
|
||||
"status": "required",
|
||||
"reason_code": "document_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "business_proof_of_identification",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/documents",
|
||||
"status": "required",
|
||||
"reason_code": "document_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "settlements.beneficiary_name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "settlements.account_number",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "settlements.ifsc_code",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/products/acc_prd_HEgNpywUFctQ9e",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "contact_name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "customer_facing_business_name",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
},
|
||||
{
|
||||
"field_reference": "kyc.pan",
|
||||
"resolution_url": "/accounts/acc_HQVlm3bnPmccC0/stakeholders",
|
||||
"status": "required",
|
||||
"reason_code": "field_missing"
|
||||
}
|
||||
],
|
||||
"tnc":{
|
||||
"id": "tnc_IgohZaDBHRGjPv",
|
||||
"accepted": true,
|
||||
"accepted_at": 1641550798
|
||||
},
|
||||
"id": "acc_prd_HEgNpywUFctQ9e",
|
||||
"account_id": "acc_HQVlm3bnPmccC0",
|
||||
"product_name": "payment_gateway",
|
||||
"activation_status": "needs_clarification",
|
||||
"requested_at": 1625478849
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/partners/product-configuration/)**
|
||||
418
vendor/razorpay/razorpay/documents/qrcode.md
vendored
Normal file
418
vendor/razorpay/razorpay/documents/qrcode.md
vendored
Normal file
@ -0,0 +1,418 @@
|
||||
## Qr Codes
|
||||
|
||||
### Create Qr code
|
||||
|
||||
```php
|
||||
$api->qrCode->create(array("type" => "upi_qr","name" => "Store_1", "usage" => "single_use","fixed_amount" => 1,"payment_amount" => 300,"customer_id" => "cust_HKsR5se84c5LTO","description" => "For Store 1","close_by" => 1681615838,"notes" => array("purpose" => "Test UPI QR code notes")));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| type* | string | The type of QR code i.e, `upi_qr`/`bharat_qr` |
|
||||
| name | string | Label entered to identify the QR code. |
|
||||
| usage* | string | Indicates if the QR code should be allowed to accept single payment or multiple payments i.e, `single_use`/`multiple_use` |
|
||||
| fixed_amount | boolean | Indicates if the QR should accept payments of specific amounts or any amount. |
|
||||
| payment_amount(* mandatory if fixed_amount is true) | integer | Indicates if the QR should accept payments of specific amounts or any amount. |
|
||||
| customer_id | string | Unique identifier of the customer the QR code is linked with |
|
||||
| description | string | A brief description about the QR code. |
|
||||
| close_by | integer | UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 15 minutes after the current time. |
|
||||
| notes | array | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "qr_HMsVL8HOpbMcjU",
|
||||
"entity": "qr_code",
|
||||
"created_at": 1623660301,
|
||||
"name": "Store_1",
|
||||
"usage": "single_use",
|
||||
"type": "upi_qr",
|
||||
"image_url": "https://rzp.io/i/BWcUVrLp",
|
||||
"payment_amount": 300,
|
||||
"status": "active",
|
||||
"description": "For Store 1",
|
||||
"fixed_amount": true,
|
||||
"payments_amount_received": 0,
|
||||
"payments_count_received": 0,
|
||||
"notes": {
|
||||
"purpose": "Test UPI QR code notes"
|
||||
},
|
||||
"customer_id": "cust_HKsR5se84c5LTO",
|
||||
"close_by": 1681615838,
|
||||
"closed_at": 1623660445,
|
||||
"close_reason": "on_demand"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create Qr code with GST
|
||||
|
||||
```php
|
||||
$api->qrCode->create(array("type" => "upi_qr","name" => "Store_1", "usage" => "single_use","fixed_amount" => 1,"payment_amount" => 300,"customer_id" => "cust_HKsR5se84c5LTO","description" => "For Store 1","close_by" => 1681615838,"notes" => array("purpose" => "Test UPI QR code notes"),"tax_invoice" => array("number" => "INV001", "date" => 1589994898,"customer_name" => "Gaurav Kumar", "business_gstin"=> "06AABCU9605R1ZR","gst_amount" => 4000, "cess_amount" => 0, "supply_type" => "interstate")));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| type* | string | The type of QR code i.e, `upi_qr`/`bharat_qr` |
|
||||
| name | string | Label entered to identify the QR code. |
|
||||
| usage* | string | Indicates if the QR code should be allowed to accept single payment or multiple payments i.e, `single_use`/`multiple_use` |
|
||||
| fixed_amount | boolean | Indicates if the QR should accept payments of specific amounts or any amount. |
|
||||
| payment_amount(* mandatory if fixed_amount is true) | integer | Indicates if the QR should accept payments of specific amounts or any amount. |
|
||||
| customer_id | string | Unique identifier of the customer the QR code is linked with |
|
||||
| description | string | A brief description about the QR code. |
|
||||
| close_by | integer | UNIX timestamp at which the QR code is scheduled to be automatically closed. The time must be at least 15 minutes after the current time. |
|
||||
| notes | array | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
|
||||
| tax_invoice | array | This block contains information about the invoices. If not provided, the transaction will default to non-GST compliant UPI flow. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "qr_HMsVL8HOpbMcjU",
|
||||
"entity": "qr_code",
|
||||
"created_at": 1623660301,
|
||||
"name": "Store_1",
|
||||
"usage": "single_use",
|
||||
"type": "upi_qr",
|
||||
"image_url": "https://rzp.io/i/BWcUVrLp",
|
||||
"payment_amount": 300,
|
||||
"status": "active",
|
||||
"description": "For Store 1",
|
||||
"fixed_amount": true,
|
||||
"payments_amount_received": 0,
|
||||
"payments_count_received": 0,
|
||||
"notes": {
|
||||
"purpose": "Test UPI QR code notes"
|
||||
},
|
||||
"customer_id": "cust_HKsR5se84c5LTO",
|
||||
"close_by": 1681615838,
|
||||
"tax_invoice": {
|
||||
"number": "INV001",
|
||||
"date": 1589994898,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"business_gstin": "06AABCU9605R1ZR",
|
||||
"gst_amount": 4000,
|
||||
"cess_amount": 0,
|
||||
"supply_type": "interstate"
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all Qr code
|
||||
|
||||
```php
|
||||
$api->qrCode->all($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the payments were created |
|
||||
| to | timestamp | timestamp before which the payments were created |
|
||||
| count | integer | number of payments to fetch (default: 10) |
|
||||
| skip | integer | number of payments to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "qr_HO2jGkWReVBMNu",
|
||||
"entity": "qr_code",
|
||||
"created_at": 1623914648,
|
||||
"name": "Store_1",
|
||||
"usage": "single_use",
|
||||
"type": "upi_qr",
|
||||
"image_url": "https://rzp.io/i/w2CEwYmkAu",
|
||||
"payment_amount": 300,
|
||||
"status": "active",
|
||||
"description": "For Store 1",
|
||||
"fixed_amount": true,
|
||||
"payments_amount_received": 0,
|
||||
"payments_count_received": 0,
|
||||
"notes": {
|
||||
"purpose": "Test UPI QR code notes"
|
||||
},
|
||||
"customer_id": "cust_HKsR5se84c5LTO",
|
||||
"close_by": 1681615838,
|
||||
"closed_at": null,
|
||||
"close_reason": null
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a Qr code
|
||||
|
||||
```php
|
||||
$api->qrCode->fetch($qrCodeId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| qrCodeId | string | The id of the qr code to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "qr_HO2r1MDprYtWRT",
|
||||
"entity": "qr_code",
|
||||
"created_at": 1623915088,
|
||||
"name": "Store_1",
|
||||
"usage": "single_use",
|
||||
"type": "upi_qr",
|
||||
"image_url": "https://rzp.io/i/oCswTOcCo",
|
||||
"payment_amount": 300,
|
||||
"status": "active",
|
||||
"description": "For Store 1",
|
||||
"fixed_amount": true,
|
||||
"payments_amount_received": 0,
|
||||
"payments_count_received": 0,
|
||||
"notes": {
|
||||
"purpose": "Test UPI QR code notes"
|
||||
},
|
||||
"customer_id": "cust_HKsR5se84c5LTO",
|
||||
"close_by": 1681615838,
|
||||
"closed_at": null,
|
||||
"close_reason": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a Qr code for customer id
|
||||
|
||||
```php
|
||||
$api->qrCode->all(["customer_id" => $customerId]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customerId* | string | The id of the customer to which qr code need to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "qr_HMsgvioW64f0vh",
|
||||
"entity": "qr_code",
|
||||
"created_at": 1623660959,
|
||||
"name": "Store_1",
|
||||
"usage": "single_use",
|
||||
"type": "upi_qr",
|
||||
"image_url": "https://rzp.io/i/DTa2eQR",
|
||||
"payment_amount": 300,
|
||||
"status": "active",
|
||||
"description": "For Store 1",
|
||||
"fixed_amount": true,
|
||||
"payments_amount_received": 0,
|
||||
"payments_count_received": 0,
|
||||
"notes": {
|
||||
"purpose": "Test UPI QR code notes"
|
||||
},
|
||||
"customer_id": "cust_HKsR5se84c5LTO",
|
||||
"close_by": 1681615838
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a Qr code for payment id
|
||||
|
||||
```php
|
||||
$api->qrCode->all(["payment_id" => $paymentId]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| paymentID* | string | The id of the payment to which qr code need to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "qr_HMsqRoeVwKbwAF",
|
||||
"entity": "qr_code",
|
||||
"created_at": 1623661499,
|
||||
"name": "Fresh Groceries",
|
||||
"usage": "multiple_use",
|
||||
"type": "upi_qr",
|
||||
"image_url": "https://rzp.io/i/eI9XD54Q",
|
||||
"payment_amount": null,
|
||||
"status": "active",
|
||||
"description": "Buy fresh groceries",
|
||||
"fixed_amount": false,
|
||||
"payments_amount_received": 1000,
|
||||
"payments_count_received": 1,
|
||||
"notes": [],
|
||||
"customer_id": "cust_HKsR5se84c5LTO",
|
||||
"close_by": 1624472999,
|
||||
"close_reason": null
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch Payments for a QR Code
|
||||
|
||||
```php
|
||||
$api->qrCode->fetch($qrCodeId)->fetchAllPayments($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| qrCodeID* | string | The id of the qr code to which payment where made |
|
||||
| from | timestamp | timestamp after which the payments were created |
|
||||
| to | timestamp | timestamp before which the payments were created |
|
||||
| count | integer | number of payments to fetch (default: 10) |
|
||||
| skip | integer | number of payments to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "pay_HMtDKn3TnF4D8x",
|
||||
"entity": "payment",
|
||||
"amount": 500,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": null,
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "upi",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": "QRv2 Payment",
|
||||
"card_id": null,
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"vpa": "gauri.kumari@okhdfcbank",
|
||||
"email": "gauri.kumari@example.com",
|
||||
"contact": "+919999999999",
|
||||
"customer_id": "cust_HKsR5se84c5LTO",
|
||||
"notes": [],
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {
|
||||
"rrn": "116514257019"
|
||||
},
|
||||
"created_at": 1623662800
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Close a QR Code
|
||||
|
||||
```php
|
||||
$api->qrCode->fetch($qrCodeId)->close()
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| qrCodeID* | string | The id of the qr code to be closed |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "qr_HMsVL8HOpbMcjU",
|
||||
"entity": "qr_code",
|
||||
"created_at": 1623660301,
|
||||
"name": "Store_1",
|
||||
"usage": "single_use",
|
||||
"type": "upi_qr",
|
||||
"image_url": "https://rzp.io/i/BWcUVrLp",
|
||||
"payment_amount": 300,
|
||||
"status": "closed",
|
||||
"description": "For Store 1",
|
||||
"fixed_amount": true,
|
||||
"payments_amount_received": 0,
|
||||
"payments_count_received": 0,
|
||||
"notes": {
|
||||
"purpose": "Test UPI QR code notes"
|
||||
},
|
||||
"customer_id": "cust_HKsR5se84c5LTO",
|
||||
"close_by": 1681615838,
|
||||
"closed_at": 1623660445,
|
||||
"close_reason": "on_demand"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Refund a Payment
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->refund(array("amount"=> "100","notes"=>array("notes_key_1"=>"Beam me up Scotty.", "notes_key_2"=>"Engage")));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be refunded |
|
||||
| amount | string | Amount to be refunded |
|
||||
| notes | array | Key-value pair that can be used to store additional information about the QR code. Maximum 15 key-value pairs, 256 characters (maximum) each. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "rfnd_FP8QHiV938haTz",
|
||||
"entity": "refund",
|
||||
"amount": 500100,
|
||||
"receipt": "Receipt No. 31",
|
||||
"currency": "INR",
|
||||
"payment_id": "pay_29QQoUBi66xm2f",
|
||||
"notes": [],
|
||||
"receipt": null,
|
||||
"acquirer_data": {
|
||||
"arn": null
|
||||
},
|
||||
"created_at": 1597078866,
|
||||
"batch_id": null,
|
||||
"status": "processed",
|
||||
"speed_processed": "normal",
|
||||
"speed_requested": "normal"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/qr-codes/)**
|
||||
278
vendor/razorpay/razorpay/documents/refund.md
vendored
Normal file
278
vendor/razorpay/razorpay/documents/refund.md
vendored
Normal file
@ -0,0 +1,278 @@
|
||||
## Refunds
|
||||
|
||||
### Create a normal refund
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->refund(array("amount"=> "100", "speed"=>"normal", "notes"=>array("notes_key_1"=>"Beam me up Scotty.", "notes_key_2"=>"Engage"), "receipt"=>"Receipt No. 31"));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| paymentId* | string | The id of the payment |
|
||||
| amount | integer | The amount to be captured (should be equal to the authorized amount, in paise) | |
|
||||
| speed | string | Here, it must be normal |
|
||||
| notes | array | A key-value pair |
|
||||
| receipt | string | A unique identifier provided by you for your internal reference. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "rfnd_FP8QHiV938haTz",
|
||||
"entity": "refund",
|
||||
"amount": 500100,
|
||||
"receipt": "Receipt No. 31",
|
||||
"currency": "INR",
|
||||
"payment_id": "pay_FCXKPFtYfPXJPy",
|
||||
"notes": [],
|
||||
"acquirer_data": {
|
||||
"arn": null
|
||||
},
|
||||
"created_at": 1597078866,
|
||||
"batch_id": null,
|
||||
"status": "processed",
|
||||
"speed_processed": "normal",
|
||||
"speed_requested": "normal"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an instant refund
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->refund(array("amount"=> "100","speed"=>"optimum","receipt"=>"Receipt No. 31"));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| paymentId* | string | The id of the payment |
|
||||
| amount | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| speed* | string | Here, it must be optimum |
|
||||
| receipt | string | A unique identifier provided by you for your internal reference. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "rfnd_FP8R8EGjGbPkVb",
|
||||
"entity": "refund",
|
||||
"amount": 500100,
|
||||
"currency": "INR",
|
||||
"payment_id": "pay_FC8MmhMBZPKDHF",
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"receipt": "Receipt No. 31",
|
||||
"acquirer_data": {
|
||||
"arn": null
|
||||
},
|
||||
"created_at": 1597078914,
|
||||
"batch_id": null,
|
||||
"status": "processed",
|
||||
"speed_requested": "optimum"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch multiple refunds for a payment
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->fetchMultipleRefund($option);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| paymentId* | string | The id of the payment |
|
||||
| from | timestamp | timestamp after which the payments were created |
|
||||
| to | timestamp | timestamp before which the payments were created |
|
||||
| count | integer | number of payments to fetch (default: 10) |
|
||||
| skip | integer | number of payments to be skipped (default: 0) |
|
||||
|
||||
**Refund:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "rfnd_FP8DDKxqJif6ca",
|
||||
"entity": "refund",
|
||||
"amount": 300100,
|
||||
"currency": "INR",
|
||||
"payment_id": "pay_FIKOnlyii5QGNx",
|
||||
"notes": {
|
||||
"comment": "Comment for refund"
|
||||
},
|
||||
"receipt": null,
|
||||
"acquirer_data": {
|
||||
"arn": "10000000000000"
|
||||
},
|
||||
"created_at": 1597078124,
|
||||
"batch_id": null,
|
||||
"status": "processed",
|
||||
"speed_processed": "normal",
|
||||
"speed_requested": "optimum"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a specific refund for a payment
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->fetchRefund($refundId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
| refundId* | string | The id of the refund to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "rfnd_FP8DDKxqJif6ca",
|
||||
"entity": "refund",
|
||||
"amount": 300100,
|
||||
"currency": "INR",
|
||||
"payment_id": "pay_FIKOnlyii5QGNx",
|
||||
"notes": {
|
||||
"comment": "Comment for refund"
|
||||
},
|
||||
"receipt": null,
|
||||
"acquirer_data": {
|
||||
"arn": "10000000000000"
|
||||
},
|
||||
"created_at": 1597078124,
|
||||
"batch_id": null,
|
||||
"status": "processed",
|
||||
"speed_processed": "normal",
|
||||
"speed_requested": "optimum"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all refunds
|
||||
```php
|
||||
$options = array("count" => 2);
|
||||
|
||||
$api->refund->all($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the payments were created |
|
||||
| to | timestamp | timestamp before which the payments were created |
|
||||
| count | integer | number of payments to fetch (default: 10) |
|
||||
| skip | integer | number of payments to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 2,
|
||||
"items": [
|
||||
{
|
||||
"id": "rfnd_FFX6AnnIN3puqW",
|
||||
"entity": "refund",
|
||||
"amount": 88800,
|
||||
"currency": "INR",
|
||||
"payment_id": "pay_FFX5FdEYx8jPwA",
|
||||
"notes": {
|
||||
"comment": "Issuing an instant refund"
|
||||
},
|
||||
"receipt": null,
|
||||
"acquirer_data": {},
|
||||
"created_at": 1594982363,
|
||||
"batch_id": null,
|
||||
"status": "processed",
|
||||
"speed_processed": "optimum",
|
||||
"speed_requested": "optimum"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch particular refund
|
||||
```php
|
||||
$api->refund->fetch($refundId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| refundId* | string | The id of the refund to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "rfnd_EqWThTE7dd7utf",
|
||||
"entity": "refund",
|
||||
"amount": 6000,
|
||||
"currency": "INR",
|
||||
"payment_id": "pay_EpkFDYRirena0f",
|
||||
"notes": {
|
||||
"comment": "Issuing an instant refund"
|
||||
},
|
||||
"receipt": null,
|
||||
"acquirer_data": {
|
||||
"arn": "10000000000000"
|
||||
},
|
||||
"created_at": 1589521675,
|
||||
"batch_id": null,
|
||||
"status": "processed",
|
||||
"speed_processed": "optimum",
|
||||
"speed_requested": "optimum"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Update the refund
|
||||
```php
|
||||
$api->refund->fetch($refundId)->edit(array('notes'=> array('notes_key_1'=>'Beam me up Scotty.', 'notes_key_2'=>'Engage')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| refundId* | string | The id of the refund to be fetched |
|
||||
| notes* | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "rfnd_FP8DDKxqJif6ca",
|
||||
"entity": "refund",
|
||||
"amount": 300100,
|
||||
"currency": "INR",
|
||||
"payment_id": "pay_FIKOnlyii5QGNx",
|
||||
"notes": {
|
||||
"notes_key_1": "Beam me up Scotty.",
|
||||
"notes_key_2": "Engage"
|
||||
},
|
||||
"receipt": null,
|
||||
"acquirer_data": {
|
||||
"arn": "10000000000000"
|
||||
},
|
||||
"created_at": 1597078124,
|
||||
"batch_id": null,
|
||||
"status": "processed",
|
||||
"speed_processed": "normal",
|
||||
"speed_requested": "optimum"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/refunds/)**
|
||||
392
vendor/razorpay/razorpay/documents/registeremandate.md
vendored
Normal file
392
vendor/razorpay/razorpay/documents/registeremandate.md
vendored
Normal file
@ -0,0 +1,392 @@
|
||||
## Register emandate and charge first payment together
|
||||
|
||||
### Create customer
|
||||
```php
|
||||
$api->customer->create(array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'fail_existing' => "1",
|
||||
'contact'=>'9000090000',
|
||||
'notes'=> array(
|
||||
'notes_key_1'=> 'Tea, Earl Grey, Hot',
|
||||
'notes_key_2'=> 'Tea, Earl Grey... decaf'
|
||||
)
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| name* | string | Name of the customer |
|
||||
| email | string | Email of the customer |
|
||||
| contact | string | Contact number of the customer |
|
||||
| fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `1` or `0`|
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "cust_1Aa00000000003",
|
||||
"entity": "customer",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "Gaurav.Kumar@example.com",
|
||||
"contact": "9000000000",
|
||||
"gstin": null,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1582033731
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create order
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 0, 'currency' => 'INR', 'method'=>'emandate', 'customer_id'=>$customerId, 'receipt'=>'Receipt No. 5', 'notes'=> array('note_key 1'=> 'Beam me up Scotty','note_key 2'=> 'Engage'), 'token'=>array('first_payment_amount'=>100, 'auth_type'=>'netbanking' ,'max_amount'=>'9999900','expire_at'=>'4102444799', 'notes'=>array('note_key 1'=> 'Tea, Earl Grey… decaf.','note_key 2'=> 'Tea. Earl Gray. Hot.'), 'bank_account'=>array('beneficiary_name'=>'Gaurav Kumar', 'account_number'=>'11214311215411', 'account_type'=>'savings', 'ifsc_code'=>'HDFC0001233'))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| payment_capture* | boolean | Indicates whether payment status should be changed to `captured` automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically.|
|
||||
| method* | string | Payment method used to make the registration transaction. Possible value is `emandate`. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/auto-debit/#112-create-an-order) are supported |
|
||||
| auth_type | string | Possible values is `netbanking`, `debitcard` or `aadhaar` |
|
||||
| max_amount | integer | The maximum amount, in paise, that a customer can be charged in one transaction. The value can range from `500` - `100000000`. |
|
||||
| expire_at | integer | The timestamp, in Unix format, till when you can use the token (authorization on the payment method) to charge the customer subsequent payments. |
|
||||
| notes | object | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
For create order response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#112-create-an-order)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an Authorization Payment
|
||||
|
||||
Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#113-create-an-authorization-payment) for authorization payment
|
||||
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create registration link
|
||||
|
||||
```php
|
||||
$api->subscription->createSubscriptionRegistration(array(
|
||||
'customer' => array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9123456780'
|
||||
),
|
||||
'type' => 'link',
|
||||
'amount' => 0,
|
||||
'currency' => 'INR',
|
||||
'description' => 'Registration Link for Gaurav Kumar',
|
||||
'subscription_registration' => array(
|
||||
'first_payment_amount' => 100,
|
||||
'method' => 'emandate',
|
||||
'auth_type' => 'netbanking',
|
||||
'max_amount' => '50000',
|
||||
'expire_at' => '1634215992',
|
||||
'bank_account' => array(
|
||||
'beneficiary_name' => 'Gaurav Kumar',
|
||||
'account_number' => '11214311215411',
|
||||
'account_type' => 'savings',
|
||||
'ifsc_code' => 'HDFC0001233'
|
||||
)
|
||||
),
|
||||
'receipt' => 'Receipt No. 5',
|
||||
'email_notify' => true,
|
||||
'sms_notify' => true,
|
||||
'expire_by' => 1634215992,
|
||||
'notes' => array(
|
||||
'note_key 1' => 'Beam me up Scotty',
|
||||
'note_key 2' => 'Tea. Earl Gray. Hot.'
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|---------------------------------------------------------------|
|
||||
| customer | array | Details of the customer to whom the registration link will be sent. |
|
||||
| type* | array | the value is `link`. |
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| description* | string | A brief description of the payment. |
|
||||
| subscription_registration | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/emandate/auto-debit/#121-create-a-registration-link) are supported |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| sms_notify | boolean | SMS notifications are to be sent by Razorpay (default : true) |
|
||||
| email_notify | boolean | Email notifications are to be sent by Razorpay (default : true) |
|
||||
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
For create registration link response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#12-using-a-registration-link)
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Create an order to charge the customer
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => '100', 'currency' => 'INR', 'payment_capture' => true, 'receipt' => 'Receipt No. 1', 'notes'=> array('key1'=> 'value3','key2'=> 'value2')));
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| payment_capture* | boolean | Indicates whether payment status should be changed to `captured` automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically.|
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"order_1Aa00000000002",
|
||||
"entity":"order",
|
||||
"amount":1000,
|
||||
"amount_paid":0,
|
||||
"amount_due":1000,
|
||||
"currency":"INR",
|
||||
"receipt":"Receipt No. 1",
|
||||
"offer_id":null,
|
||||
"status":"created",
|
||||
"attempts":0,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at":1579782776
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Create a recurring payment
|
||||
|
||||
```php
|
||||
$api->payment->createRecurring(array(
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9000090000',
|
||||
'amount' => 100,
|
||||
'currency' => 'INR',
|
||||
'order_id' => 'order_1Aa00000000002',
|
||||
'customer_id' => 'cust_1Aa00000000001',
|
||||
'token' => 'token_1Aa00000000001',
|
||||
'recurring' => true,
|
||||
'description' => 'Creating recurring payment for Gaurav Kumar'
|
||||
));
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| email* | string | The customer's email address |
|
||||
| contact* | string | The customer's phone number |
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| orderId* | string | The id of the order to be fetched |
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
| recurring* | boolean | Possible values is `true` or `false` |
|
||||
| description | string | A brief description of the payment. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id" : "pay_1Aa00000000001",
|
||||
"razorpay_order_id" : "order_1Aa00000000001",
|
||||
"razorpay_signature" : "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Send/Resend notifications
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->notifyBy($medium);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be fetched |
|
||||
| medium* | string | Possible values are `sms` or `email` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"success": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Cancel registration link
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->cancel();
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_FHrfRupD2ouKIt",
|
||||
"entity": "invoice",
|
||||
"receipt": "Receipt No. 1",
|
||||
"invoice_number": "Receipt No. 1",
|
||||
"customer_id": "cust_BMB3EwbqnqZ2EI",
|
||||
"customer_details": {
|
||||
"id": "cust_BMB3EwbqnqZ2EI",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9123456780",
|
||||
"gstin": null,
|
||||
"billing_address": null,
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9123456780"
|
||||
},
|
||||
"order_id": "order_FHrfRw4TZU5Q2L",
|
||||
"line_items": [],
|
||||
"payment_id": null,
|
||||
"status": "cancelled",
|
||||
"expire_by": 4102444799,
|
||||
"issued_at": 1595491479,
|
||||
"paid_at": null,
|
||||
"cancelled_at": 1595491488,
|
||||
"expired_at": null,
|
||||
"sms_status": "sent",
|
||||
"email_status": "sent",
|
||||
"date": 1595491479,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 100,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"amount": 100,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 100,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "Registration Link for Gaurav Kumar",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/QlfexTj",
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "link",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1595491480,
|
||||
"idempotency_key": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Fetch token by payment id
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
|
||||
**Response:**
|
||||
For fetch token by payment id response please click [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/#21-fetch-token-by-payment-id)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Fetch tokens by customer id
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->all();
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "token_FHf94Uym9tdYFJ",
|
||||
"entity": "token",
|
||||
"token": "2wDPM7VAlXtjAR",
|
||||
"bank": "HDFC",
|
||||
"wallet": null,
|
||||
"method": "emandate",
|
||||
"vpa": null,
|
||||
"recurring": true,
|
||||
"recurring_details": {
|
||||
"status": "confirmed",
|
||||
"failure_reason": null
|
||||
},
|
||||
"auth_type": "netbanking",
|
||||
"mrn": null,
|
||||
"used_at": 1595447381,
|
||||
"created_at": 1595447381,
|
||||
"bank_details": {
|
||||
"beneficiary_name": "Gaurav Kumar",
|
||||
"account_number": "1121431121541121",
|
||||
"ifsc": "HDFC0000001",
|
||||
"account_type": "savings"
|
||||
},
|
||||
"max_amount": 9999900,
|
||||
"expired_at": 1689971140,
|
||||
"dcc_enabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Delete tokens
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->delete($tokenId);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"deleted": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/recurring-payments/emandate/auto-debit/)**
|
||||
591
vendor/razorpay/razorpay/documents/registernach.md
vendored
Normal file
591
vendor/razorpay/razorpay/documents/registernach.md
vendored
Normal file
@ -0,0 +1,591 @@
|
||||
## Register nach and charge first payment together
|
||||
|
||||
### Create customer
|
||||
```php
|
||||
$api->customer->create(array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'fail_existing' => "1",
|
||||
'contact'=>'9000090000',
|
||||
'notes'=> array(
|
||||
'notes_key_1'=> 'Tea, Earl Grey, Hot',
|
||||
'notes_key_2'=> 'Tea, Earl Grey... decaf'
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| name* | string | Name of the customer |
|
||||
| email | string | Email of the customer |
|
||||
| contact | string | Contact number of the customer |
|
||||
| fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `1` or `0`|
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "cust_1Aa00000000003",
|
||||
"entity": "customer",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "Gaurav.Kumar@example.com",
|
||||
"contact": "9000000000",
|
||||
"gstin": null,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1582033731
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create Order
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 0, 'currency' => 'INR', 'method'=>'nach', 'customer_id'=>$customerId, 'receipt'=>'Receipt No. 5', 'notes'=> array('note_key 1'=> 'Beam me up Scotty','note_key 2'=> 'Tea. Earl Gray. Hot.'), 'token'=>array('first_payment_amount'=>10000, 'auth_type'=>'physical' ,'max_amount'=>'50000','expire_at'=>'1634215992', 'notes'=>array('note_key 1'=> 'Tea, Earl Grey… decaf.','note_key 2'=> 'Tea. Earl Gray. Hot.'), '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', 'description'=>'Paper NACH Gaurav Kumar'))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| method* | string | Payment method used to make the registration transaction. Possible value is `nach`. |
|
||||
| token | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/auto-debit/#112-create-an-order) are supported |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"order_1Aa00000000001",
|
||||
"entity":"order",
|
||||
"amount":0,
|
||||
"amount_paid":0,
|
||||
"amount_due":0,
|
||||
"currency":"INR",
|
||||
"receipt":"rcptid #10",
|
||||
"offer_id":null,
|
||||
"offers":{
|
||||
"entity":"collection",
|
||||
"count":0,
|
||||
"items":[]
|
||||
},
|
||||
"status":"created",
|
||||
"attempts":0,
|
||||
"notes": {
|
||||
"notes_key_1": "Beam me up Scotty",
|
||||
"notes_key_2": "Engage"
|
||||
},
|
||||
"created_at":1579775420,
|
||||
"token":{
|
||||
"method":"nach",
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"recurring_status":null,
|
||||
"failure_reason":null,
|
||||
"currency":"INR",
|
||||
"max_amount":10000000,
|
||||
"auth_type":"physical",
|
||||
"expire_at":1580480689,
|
||||
"nach":{
|
||||
"create_form":true,
|
||||
"form_reference1":"Recurring Payment for Gaurav Kumar",
|
||||
"form_reference2":"Method Paper NACH",
|
||||
"prefilled_form":"https://rzp.io/i/bitw",
|
||||
"upload_form_url":"https://rzp.io/i/gts",
|
||||
"description":"Paper NACH Gaurav Kumar"
|
||||
},
|
||||
"bank_account":{
|
||||
"ifsc":"HDFC0000001",
|
||||
"bank_name":"HDFC Bank",
|
||||
"name":"Gaurav Kumar",
|
||||
"account_number":"11214311215411",
|
||||
"account_type":"savings",
|
||||
"beneficiary_email":"gaurav.kumar@example.com",
|
||||
"beneficiary_mobile":"9876543210"
|
||||
},
|
||||
"first_payment_amount":10000
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an Authorization Payment
|
||||
|
||||
Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/paper-nach/auto-debit/#113-create-an-authorization-payment) for authorization payment
|
||||
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create registration link
|
||||
|
||||
```php
|
||||
$api->subscription->createSubscriptionRegistration(array(
|
||||
'customer' => array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9123456780'
|
||||
),
|
||||
'amount' => 0,
|
||||
'type' => 'link',
|
||||
'currency' => 'INR',
|
||||
'description' => 'Registration Link for Gaurav Kumar',
|
||||
'subscription_registration' => array(
|
||||
'method' => 'nach',
|
||||
'auth_type' => 'physical',
|
||||
'max_amount' => '50000',
|
||||
'expire_at' => '1634215992',
|
||||
'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'
|
||||
)
|
||||
),
|
||||
'receipt' => 'Receipt No. 5',
|
||||
'email_notify' => true,
|
||||
'sms_notify' => true,
|
||||
'expire_by' => 1634215992,
|
||||
'notes' => array(
|
||||
'note_key 1' => 'Beam me up Scotty',
|
||||
'note_key 2' => 'Tea. Earl Gray. Hot.'
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|---------------------------------------------------------------|
|
||||
| customer | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/auto-debit/#121-create-a-registration-link) are supported |
|
||||
| type* | array | the value is `link`. |
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| description* | string | A brief description of the payment. |
|
||||
| subscription_registration | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/paper-nach/auto-debit/#121-create-a-registration-link) are supported |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| sms_notify | boolean | SMS notifications are to be sent by Razorpay (default : true) |
|
||||
| email_notify | boolean | Email notifications are to be sent by Razorpay (default : true) |
|
||||
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_FHrZiAubEzDdaq",
|
||||
"entity": "invoice",
|
||||
"receipt": "Receipt No. 27",
|
||||
"invoice_number": "Receipt No. 27",
|
||||
"customer_id": "cust_BMB3EwbqnqZ2EI",
|
||||
"customer_details": {
|
||||
"id": "cust_BMB3EwbqnqZ2EI",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9123456780",
|
||||
"gstin": null,
|
||||
"billing_address": null,
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9123456780"
|
||||
},
|
||||
"order_id": "order_FHrZiBOkWHZPOp",
|
||||
"line_items": [],
|
||||
"payment_id": null,
|
||||
"status": "issued",
|
||||
"expire_by": 1647483647,
|
||||
"issued_at": 1595491154,
|
||||
"paid_at": null,
|
||||
"cancelled_at": null,
|
||||
"expired_at": null,
|
||||
"sms_status": "sent",
|
||||
"email_status": "sent",
|
||||
"date": 1595491154,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 0,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"amount": 0,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 0,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "12 p.m. Meals",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/bzDYbNg",
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "link",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1595491154,
|
||||
"idempotency_key": null,
|
||||
"token": {
|
||||
"method": "nach",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"recurring_status": null,
|
||||
"failure_reason": null,
|
||||
"currency": "INR",
|
||||
"max_amount": 50000,
|
||||
"auth_type": "physical",
|
||||
"expire_at": 1947483647,
|
||||
"nach": {
|
||||
"create_form": true,
|
||||
"form_reference1": "Recurring Payment for Gaurav Kumar",
|
||||
"form_reference2": "Method Paper NACH",
|
||||
"prefilled_form": "https://rzp.io/i/exdIzYN",
|
||||
"upload_form_url": "https://rzp.io/i/bzDYbNg",
|
||||
"description": "12 p.m. Meals"
|
||||
},
|
||||
"bank_account": {
|
||||
"ifsc": "HDFC0001233",
|
||||
"bank_name": "HDFC Bank",
|
||||
"name": "Gaurav Kumar",
|
||||
"account_number": "11214311215411",
|
||||
"account_type": "savings",
|
||||
"beneficiary_email": "gaurav.kumar@example.com",
|
||||
"beneficiary_mobile": "9123456780"
|
||||
},
|
||||
"first_payment_amount": 0
|
||||
},
|
||||
"nach_form_url": "https://rzp.io/i/exdIzYN"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Create an order to charge the customer
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => '100', 'currency' => 'INR', 'payment_capture' => true, 'receipt' => 'Receipt No. 1', 'notes'=> array('key1'=> 'value3','key2'=> 'value2')));
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| payment_capture | boolean | Indicates whether payment status should be changed to captured automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"order_1Aa00000000002",
|
||||
"entity":"order",
|
||||
"amount":1000,
|
||||
"amount_paid":0,
|
||||
"amount_due":1000,
|
||||
"currency":"INR",
|
||||
"receipt":"Receipt No. 1",
|
||||
"offer_id":null,
|
||||
"status":"created",
|
||||
"attempts":0,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at":1579782776
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Create a recurring payment
|
||||
|
||||
```php
|
||||
$api->payment->createRecurring(array(
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9000090000',
|
||||
'amount' => 100,
|
||||
'currency' => 'INR',
|
||||
'order_id' => 'order_1Aa00000000002',
|
||||
'customer_id' => 'cust_1Aa00000000001',
|
||||
'token' => 'token_1Aa00000000001',
|
||||
'recurring' => true,
|
||||
'description' => 'Creating recurring payment for Gaurav Kumar'
|
||||
));
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| email* | string | The customer's email address |
|
||||
| contact* | string | The customer's phone number |
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| orderId* | string | The id of the order to be fetched |
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
| recurring* | boolean | Possible values is `true` or `false` |
|
||||
| description | string | A brief description of the payment. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id" : "pay_1Aa00000000001",
|
||||
"razorpay_order_id" : "order_1Aa00000000001",
|
||||
"razorpay_signature" : "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Send/Resend notifications
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->notifyBy($medium);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be fetched |
|
||||
| medium* | string | Possible values are `sms` or `email` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"success": true
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Cancel registration link
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->cancel();
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_FHrZiAubEzDdaq",
|
||||
"entity": "invoice",
|
||||
"receipt": "Receipt No. 27",
|
||||
"invoice_number": "Receipt No. 27",
|
||||
"customer_id": "cust_BMB3EwbqnqZ2EI",
|
||||
"customer_details": {
|
||||
"id": "cust_BMB3EwbqnqZ2EI",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9123456780",
|
||||
"gstin": null,
|
||||
"billing_address": null,
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9123456780"
|
||||
},
|
||||
"order_id": "order_FHrZiBOkWHZPOp",
|
||||
"line_items": [],
|
||||
"payment_id": null,
|
||||
"status": "cancelled",
|
||||
"expire_by": 1647483647,
|
||||
"issued_at": 1595491154,
|
||||
"paid_at": null,
|
||||
"cancelled_at": 1595491339,
|
||||
"expired_at": null,
|
||||
"sms_status": "sent",
|
||||
"email_status": "sent",
|
||||
"date": 1595491154,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 0,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"amount": 0,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 0,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "12 p.m. Meals",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/bzDYbNg",
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "link",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1595491154,
|
||||
"idempotency_key": null,
|
||||
"token": {
|
||||
"method": "nach",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"recurring_status": null,
|
||||
"failure_reason": null,
|
||||
"currency": "INR",
|
||||
"max_amount": 50000,
|
||||
"auth_type": "physical",
|
||||
"expire_at": 1947483647,
|
||||
"nach": {
|
||||
"create_form": true,
|
||||
"form_reference1": "Recurring Payment for Gaurav Kumar",
|
||||
"form_reference2": "Method Paper NACH",
|
||||
"prefilled_form": "https://rzp.io/i/tSYd5aV",
|
||||
"upload_form_url": "https://rzp.io/i/bzDYbNg",
|
||||
"description": "12 p.m. Meals"
|
||||
},
|
||||
"bank_account": {
|
||||
"ifsc": "HDFC0001233",
|
||||
"bank_name": "HDFC Bank",
|
||||
"name": "Gaurav Kumar",
|
||||
"account_number": "11214311215411",
|
||||
"account_type": "savings",
|
||||
"beneficiary_email": "gaurav.kumar@example.com",
|
||||
"beneficiary_mobile": "9123456780"
|
||||
},
|
||||
"first_payment_amount": 0
|
||||
},
|
||||
"nach_form_url": "https://rzp.io/i/tSYd5aV"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Fetch token by payment id
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "pay_EnLNTjINiPkMEZ",
|
||||
"entity": "payment",
|
||||
"amount": 0,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_EnLLfglmKksr4K",
|
||||
"invoice_id": "inv_EnLLfgCzRfcMuh",
|
||||
"international": false,
|
||||
"method": "nach",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": "Invoice #inv_EnLLfgCzRfcMuh",
|
||||
"card_id": null,
|
||||
"bank": "UTIB",
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919876543210",
|
||||
"customer_id": "cust_DtHaBuooGHTuyZ",
|
||||
"token_id": "token_EnLNTnn7uyRg5V",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {},
|
||||
"created_at": 1588827564
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Fetch tokens by customer id
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->all();
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "token_EhYgIE3pOyMQpD",
|
||||
"entity": "token",
|
||||
"token": "3mQ5Czc6APNppI",
|
||||
"bank": "HDFC",
|
||||
"wallet": null,
|
||||
"method": "nach",
|
||||
"vpa": null,
|
||||
"recurring": true,
|
||||
"recurring_details": {
|
||||
"status": "confirmed",
|
||||
"failure_reason": null
|
||||
},
|
||||
"auth_type": "physical",
|
||||
"mrn": null,
|
||||
"used_at": 1587564373,
|
||||
"created_at": 1587564373,
|
||||
"dcc_enabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
## Delete tokens
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->delete($tokenId);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"deleted": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/recurring-payments/paper-nach/auto-debit/)**
|
||||
570
vendor/razorpay/razorpay/documents/settlement.md
vendored
Normal file
570
vendor/razorpay/razorpay/documents/settlement.md
vendored
Normal file
@ -0,0 +1,570 @@
|
||||
## Settlements
|
||||
|
||||
### Fetch all settlements
|
||||
|
||||
```php
|
||||
$api->settlement->all($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the settlement were created |
|
||||
| to | timestamp | timestamp before which the settlement were created |
|
||||
| count | integer | number of settlements to fetch (default: 10) |
|
||||
| skip | integer | number of settlements to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 2,
|
||||
"items": [
|
||||
{
|
||||
"id": "setl_DGlQ1Rj8os78Ec",
|
||||
"entity": "settlement",
|
||||
"amount": 9973635,
|
||||
"status": "processed",
|
||||
"fees": 471699,
|
||||
"tax": 42070,
|
||||
"utr": "1568176960vxp0rj",
|
||||
"created_at": 1568176960
|
||||
},
|
||||
{
|
||||
"id": "setl_4xbSwsPABDJ8oK",
|
||||
"entity": "settlement",
|
||||
"amount": 50000,
|
||||
"status": "processed",
|
||||
"fees": 123,
|
||||
"tax": 12,
|
||||
"utr": "RZRP173069230702",
|
||||
"created_at": 1509622306
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a settlement
|
||||
|
||||
```php
|
||||
$api->settlement->fetch($settlementId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| $settlementId* | string | The id of the settlement to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "setl_DGlQ1Rj8os78Ec",
|
||||
"entity": "settlement",
|
||||
"amount": 9973635,
|
||||
"status": "processed",
|
||||
"fees": 471699,
|
||||
"tax": 42070,
|
||||
"utr": "1568176960vxp0rj",
|
||||
"created_at": 1568176960
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Settlement report for a month
|
||||
|
||||
```php
|
||||
$api->settlement->reports(array("year"=>2020,"month"=>09));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| year* | integer | The year the settlement was received in the `YYYY` format. For example, `2020` |
|
||||
| month* | integer | The month the settlement was received in the `MM` format. For example, `09` |
|
||||
| day | integer | The date the settlement was received in the `DD` format. For example, `01` |
|
||||
| count | integer | number of settlements to fetch (default: 10) |
|
||||
| skip | integer | number of settlements to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 4,
|
||||
"items": [
|
||||
{
|
||||
"entity_id": "pay_DEXrnipqTmWVGE",
|
||||
"type": "payment",
|
||||
"debit": 0,
|
||||
"credit": 97100,
|
||||
"amount": 100000,
|
||||
"currency": "INR",
|
||||
"fee": 2900,
|
||||
"tax": 0,
|
||||
"on_hold": false,
|
||||
"settled": true,
|
||||
"created_at": 1567692556,
|
||||
"settled_at": 1568176960,
|
||||
"settlement_id": "setl_DGlQ1Rj8os78Ec",
|
||||
"posted_at": null,
|
||||
"credit_type": "default",
|
||||
"description": "Recurring Payment via Subscription",
|
||||
"notes": "{}",
|
||||
"payment_id": null,
|
||||
"settlement_utr": "1568176960vxp0rj",
|
||||
"order_id": "order_DEXrnRiR3SNDHA",
|
||||
"order_receipt": null,
|
||||
"method": "card",
|
||||
"card_network": "MasterCard",
|
||||
"card_issuer": "KARB",
|
||||
"card_type": "credit",
|
||||
"dispute_id": null
|
||||
},
|
||||
{
|
||||
"entity_id": "rfnd_DGRcGzZSLyEdg1",
|
||||
"type": "refund",
|
||||
"debit": 242500,
|
||||
"credit": 0,
|
||||
"amount": 242500,
|
||||
"currency": "INR",
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"on_hold": false,
|
||||
"settled": true,
|
||||
"created_at": 1568107224,
|
||||
"settled_at": 1568176960,
|
||||
"settlement_id": "setl_DGlQ1Rj8os78Ec",
|
||||
"posted_at": null,
|
||||
"credit_type": "default",
|
||||
"description": null,
|
||||
"notes": "{}",
|
||||
"payment_id": "pay_DEXq1pACSqFxtS",
|
||||
"settlement_utr": "1568176960vxp0rj",
|
||||
"order_id": "order_DEXpmZgffXNvuI",
|
||||
"order_receipt": null,
|
||||
"method": "card",
|
||||
"card_network": "MasterCard",
|
||||
"card_issuer": "KARB",
|
||||
"card_type": "credit",
|
||||
"dispute_id": null
|
||||
},
|
||||
{
|
||||
"entity_id": "trf_DEUoCEtdsJgvl7",
|
||||
"type": "transfer",
|
||||
"debit": 100296,
|
||||
"credit": 0,
|
||||
"amount": 100000,
|
||||
"currency": "INR",
|
||||
"fee": 296,
|
||||
"tax": 46,
|
||||
"on_hold": false,
|
||||
"settled": true,
|
||||
"created_at": 1567681786,
|
||||
"settled_at": 1568176960,
|
||||
"settlement_id": "setl_DGlQ1Rj8os78Ec",
|
||||
"posted_at": null,
|
||||
"credit_type": "default",
|
||||
"description": null,
|
||||
"notes": null,
|
||||
"payment_id": "pay_DEApNNTR6xmqJy",
|
||||
"settlement_utr": "1568176960vxp0rj",
|
||||
"order_id": null,
|
||||
"order_receipt": null,
|
||||
"method": null,
|
||||
"card_network": null,
|
||||
"card_issuer": null,
|
||||
"card_type": null,
|
||||
"dispute_id": null
|
||||
},
|
||||
{
|
||||
"entity_id": "adj_EhcHONhX4ChgNC",
|
||||
"type": "adjustment",
|
||||
"debit": 0,
|
||||
"credit": 1012,
|
||||
"amount": 1012,
|
||||
"currency": "INR",
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"on_hold": false,
|
||||
"settled": true,
|
||||
"created_at": 1567681786,
|
||||
"settled_at": 1568176960,
|
||||
"settlement_id": "setl_DGlQ1Rj8os78Ec",
|
||||
"posted_at": null,
|
||||
"description": "test reason",
|
||||
"notes": null,
|
||||
"payment_id": null,
|
||||
"settlement_utr": null,
|
||||
"order_id": null,
|
||||
"order_receipt": null,
|
||||
"method": null,
|
||||
"card_network": null,
|
||||
"card_issuer": null,
|
||||
"card_type": null,
|
||||
"dispute_id": null
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Settlement recon
|
||||
|
||||
```php
|
||||
$api->settlement->settlementRecon(array('year' => 2018, 'month' => 2, 'day'=>11));
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| year* | integer | The year the settlement was received in the `YYYY` format. For example, `2020` |
|
||||
| month* | integer | The month the settlement was received in the `MM` format. For example, `09` |
|
||||
| day | integer | The day the settlement was received in the `DD` format. For example, |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 4,
|
||||
"items": [
|
||||
{
|
||||
"entity_id": "pay_DEXrnipqTmWVGE",
|
||||
"type": "payment",
|
||||
"debit": 0,
|
||||
"credit": 97100,
|
||||
"amount": 100000,
|
||||
"currency": "INR",
|
||||
"fee": 2900,
|
||||
"tax": 0,
|
||||
"on_hold": false,
|
||||
"settled": true,
|
||||
"created_at": 1567692556,
|
||||
"settled_at": 1568176960,
|
||||
"settlement_id": "setl_DGlQ1Rj8os78Ec",
|
||||
"posted_at": null,
|
||||
"credit_type": "default",
|
||||
"description": "Recurring Payment via Subscription",
|
||||
"notes": "{}",
|
||||
"payment_id": null,
|
||||
"settlement_utr": "1568176960vxp0rj",
|
||||
"order_id": "order_DEXrnRiR3SNDHA",
|
||||
"order_receipt": null,
|
||||
"method": "card",
|
||||
"card_network": "MasterCard",
|
||||
"card_issuer": "KARB",
|
||||
"card_type": "credit",
|
||||
"dispute_id": null
|
||||
},
|
||||
{
|
||||
"entity_id": "rfnd_DGRcGzZSLyEdg1",
|
||||
"type": "refund",
|
||||
"debit": 242500,
|
||||
"credit": 0,
|
||||
"amount": 242500,
|
||||
"currency": "INR",
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"on_hold": false,
|
||||
"settled": true,
|
||||
"created_at": 1568107224,
|
||||
"settled_at": 1568176960,
|
||||
"settlement_id": "setl_DGlQ1Rj8os78Ec",
|
||||
"posted_at": null,
|
||||
"credit_type": "default",
|
||||
"description": null,
|
||||
"notes": "{}",
|
||||
"payment_id": "pay_DEXq1pACSqFxtS",
|
||||
"settlement_utr": "1568176960vxp0rj",
|
||||
"order_id": "order_DEXpmZgffXNvuI",
|
||||
"order_receipt": null,
|
||||
"method": "card",
|
||||
"card_network": "MasterCard",
|
||||
"card_issuer": "KARB",
|
||||
"card_type": "credit",
|
||||
"dispute_id": null
|
||||
},
|
||||
{
|
||||
"entity_id": "trf_DEUoCEtdsJgvl7",
|
||||
"type": "transfer",
|
||||
"debit": 100296,
|
||||
"credit": 0,
|
||||
"amount": 100000,
|
||||
"currency": "INR",
|
||||
"fee": 296,
|
||||
"tax": 46,
|
||||
"on_hold": false,
|
||||
"settled": true,
|
||||
"created_at": 1567681786,
|
||||
"settled_at": 1568176960,
|
||||
"settlement_id": "setl_DGlQ1Rj8os78Ec",
|
||||
"posted_at": null,
|
||||
"credit_type": "default",
|
||||
"description": null,
|
||||
"notes": null,
|
||||
"payment_id": "pay_DEApNNTR6xmqJy",
|
||||
"settlement_utr": "1568176960vxp0rj",
|
||||
"order_id": null,
|
||||
"order_receipt": null,
|
||||
"method": null,
|
||||
"card_network": null,
|
||||
"card_issuer": null,
|
||||
"card_type": null,
|
||||
"dispute_id": null
|
||||
},
|
||||
{
|
||||
"entity_id": "adj_EhcHONhX4ChgNC",
|
||||
"type": "adjustment",
|
||||
"debit": 0,
|
||||
"credit": 1012,
|
||||
"amount": 1012,
|
||||
"currency": "INR",
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"on_hold": false,
|
||||
"settled": true,
|
||||
"created_at": 1567681786,
|
||||
"settled_at": 1568176960,
|
||||
"settlement_id": "setl_DGlQ1Rj8os78Ec",
|
||||
"posted_at": null,
|
||||
"description": "test reason",
|
||||
"notes": null,
|
||||
"payment_id": null,
|
||||
"settlement_utr": null,
|
||||
"order_id": null,
|
||||
"order_receipt": null,
|
||||
"method": null,
|
||||
"card_network": null,
|
||||
"card_issuer": null,
|
||||
"card_type": null,
|
||||
"dispute_id": null
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create on-demand settlement
|
||||
|
||||
```php
|
||||
$api->settlement->createOndemandSettlement(array("amount"=> 1221, "settle_full_balance"=> false, "description"=>"Testing","notes" => array("notes_key_1"=> "Tea, Earl Grey, Hot","notes_key_2"=> "Tea, Earl Grey… decaf.")));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| amount*| integer | Maximum amount that can be settled |
|
||||
| settle_full_balance* | boolean | true or false |
|
||||
| description | string | The description may not be greater than 30 characters |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "setlod_FNj7g2YS5J67Rz",
|
||||
"entity": "settlement.ondemand",
|
||||
"amount_requested": 200000,
|
||||
"amount_settled": 0,
|
||||
"amount_pending": 199410,
|
||||
"amount_reversed": 0,
|
||||
"fees": 590,
|
||||
"tax": 90,
|
||||
"currency": "INR",
|
||||
"settle_full_balance": false,
|
||||
"status": "initiated",
|
||||
"description": "Need this to make vendor payments.",
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1596771429,
|
||||
"ondemand_payouts": {
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "setlodp_FNj7g2cbvw8ueO",
|
||||
"entity": "settlement.ondemand_payout",
|
||||
"initiated_at": null,
|
||||
"processed_at": null,
|
||||
"reversed_at": null,
|
||||
"amount": 200000,
|
||||
"amount_settled": null,
|
||||
"fees": 590,
|
||||
"tax": 90,
|
||||
"utr": null,
|
||||
"status": "created",
|
||||
"created_at": 1596771429
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all on-demand settlements
|
||||
|
||||
```php
|
||||
$api->settlement->fetchAllOndemandSettlement($options);
|
||||
```
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the payments were created |
|
||||
| to | timestamp | timestamp before which the payments were created |
|
||||
| count | integer | number of payments to fetch (default: 10) |
|
||||
| skip | integer | number of payments to be skipped (default: 0) |
|
||||
|
||||
**Response:**<br>
|
||||
For all on-demand settlements response please click [here](https://razorpay.com/docs/api/settlements/#fetch-all-on-demand-settlements)
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch on-demand settlement by ID
|
||||
|
||||
```php
|
||||
$api->settlement->fetch($settlementId)->fetchOndemandSettlementById();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|------------|--------|-----------------------------------|
|
||||
| $settlementId* | string | Settlement Id of the On-demand settlement|
|
||||
|
||||
**Response:**<br>
|
||||
For on-demand settlement by ID response please click [here](https://razorpay.com/docs/api/settlements/#fetch-on-demand-settlements-by-id)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Fetch Instant Settlement With ID With Payout Details
|
||||
|
||||
```php
|
||||
$settlementId = "setlod_MI0c34SIRVT25W";
|
||||
|
||||
$api->settlement->fetchOndemandSettlementById($settlementId,["expand[]"=> "ondemand_payouts"]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| expand[] | string | Possible value is `ondemand_payouts` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "setlod_FNj7g2YS5J67Rz",
|
||||
"entity": "settlement.ondemand",
|
||||
"amount_requested": 200000,
|
||||
"amount_settled": 199410,
|
||||
"amount_pending": 0,
|
||||
"amount_reversed": 0,
|
||||
"fees": 590,
|
||||
"tax": 90,
|
||||
"currency": "INR",
|
||||
"settle_full_balance": false,
|
||||
"status": "processed",
|
||||
"description": "Need this to buy stock.",
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey, decaf."
|
||||
},
|
||||
"created_at": 1596771429,
|
||||
"ondemand_payouts": {
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "setlodp_FNj7g2cbvw8ueO",
|
||||
"entity": "settlement.ondemand_payout",
|
||||
"initiated_at": 1596771430,
|
||||
"processed_at": 1596778752,
|
||||
"reversed_at": null,
|
||||
"amount": 200000,
|
||||
"amount_settled": 199410,
|
||||
"fees": 590,
|
||||
"tax": 90,
|
||||
"utr": "022011173948",
|
||||
"status": "processed",
|
||||
"created_at": 1596771429
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Fetch All Instant Settlements With Payout Details
|
||||
|
||||
```php
|
||||
$api->settlement->fetchAllOndemandSettlement(["expand[]"=> "ondemand_payouts"]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| expand[] | string | Possible value is `ondemand_payouts` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 2,
|
||||
"items": [
|
||||
{
|
||||
"id": "setlod_FNj7g2YS5J67Rz",
|
||||
"entity": "settlement.ondemand",
|
||||
"amount_requested": 200000,
|
||||
"amount_settled": 199410,
|
||||
"amount_pending": 0,
|
||||
"amount_reversed": 0,
|
||||
"fees": 590,
|
||||
"tax": 90,
|
||||
"currency": "INR",
|
||||
"settle_full_balance": false,
|
||||
"status": "processed",
|
||||
"description": "Need this to make vendor payments.",
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey, decaf."
|
||||
},
|
||||
"created_at": 1596771429,
|
||||
"ondemand_payouts": {
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "setlodp_FNj7g2cbvw8ueO",
|
||||
"entity": "settlement.ondemand_payout",
|
||||
"initiated_at": 1596771430,
|
||||
"processed_at": 1596778752,
|
||||
"reversed_at": null,
|
||||
"amount": 200000,
|
||||
"amount_settled": 199410,
|
||||
"fees": 590,
|
||||
"tax": 90,
|
||||
"utr": "022011173948",
|
||||
"status": "processed",
|
||||
"created_at": 1596771429
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/settlements/)**
|
||||
345
vendor/razorpay/razorpay/documents/stakeholder.md
vendored
Normal file
345
vendor/razorpay/razorpay/documents/stakeholder.md
vendored
Normal file
@ -0,0 +1,345 @@
|
||||
## Stakeholders
|
||||
|
||||
### Create an Stakeholder
|
||||
```php
|
||||
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$api->account->fetch("acc_GP4lfNA0iIMn5B")->stakeholders()->create(array(
|
||||
"percentage_ownership" => 10,
|
||||
"name" => "Gaurav Kumar",
|
||||
"email" => "gaurav.kumar@example.com",
|
||||
"relationship" => array(
|
||||
"director" => true,
|
||||
"executive" => false
|
||||
),
|
||||
"phone" => array(
|
||||
"primary" => "7474747474",
|
||||
"secondary" => "7474747474"
|
||||
),
|
||||
"addresses" => array(
|
||||
"residential" => array(
|
||||
"street" => "506, Koramangala 1st block",
|
||||
"city" => "Bengaluru",
|
||||
"state" => "Karnataka",
|
||||
"postal_code" => "560034",
|
||||
"country" => "IN"
|
||||
)
|
||||
),
|
||||
"kyc" => array(
|
||||
"pan" => "AVOPB1111K"
|
||||
),
|
||||
"notes" => array(
|
||||
"random_key_by_partner" => "random_value"
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| email | string | The sub-merchant's business email address. |
|
||||
| name* | string | The stakeholder's name as per the PAN card. The maximum length is 255 characters. |
|
||||
| percentage_ownership | float | The stakeholder's ownership of the business in percentage. Only two decimal places are allowed. For example, `87.55`. The maximum length is 100 characters. |
|
||||
| relationship | boolean | The stakeholder's relationship with the account’s business. |
|
||||
| phone | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#create-a-stakeholder) are supported |
|
||||
| addresses | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#create-a-stakeholder) are supported |
|
||||
| kyc | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#create-a-stakeholder) are supported |
|
||||
| notes | object | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "stakeholder",
|
||||
"relationship": {
|
||||
"director": true
|
||||
},
|
||||
"phone": {
|
||||
"primary": "7474747474",
|
||||
"secondary": "7474747474"
|
||||
},
|
||||
"notes": {
|
||||
"random_key_by_partner": "random_value"
|
||||
},
|
||||
"kyc": {
|
||||
"pan": "AVOPB1111K"
|
||||
},
|
||||
"id": "sth_GLGgm8fFCKc92m",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"percentage_ownership": 10,
|
||||
"addresses": {
|
||||
"residential": {
|
||||
"street": "506, Koramangala 1st block",
|
||||
"city": "Bengaluru",
|
||||
"state": "Karnataka",
|
||||
"postal_code": "560034",
|
||||
"country": "IN"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Edit Stakeholder
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
$stakeholderId = "sth_GOQ4Eftlz62TSL";
|
||||
|
||||
$api->account->fetch($accountId)->stakeholders()->edit($stakeholderId, array(
|
||||
"percentage_ownership" => 20,
|
||||
"name" => "Gauri Kumar",
|
||||
"relationship" => array(
|
||||
"director" => false,
|
||||
"executive" => true
|
||||
),
|
||||
"phone" => array(
|
||||
"primary" => "9898989898",
|
||||
"secondary" => "9898989898"
|
||||
),
|
||||
"addresses" => array(
|
||||
"residential" => array(
|
||||
"street" => "507, Koramangala 1st block",
|
||||
"city" => "Bangalore",
|
||||
"state" => "Karnataka",
|
||||
"postal_code" => "560035",
|
||||
"country" => "IN"
|
||||
)
|
||||
),
|
||||
"kyc" => array(
|
||||
"pan" => "AVOPB1111J"
|
||||
),
|
||||
"notes" => array(
|
||||
"random_key_by_partner" => "random_value2"
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
| stakeholderId* | string | The unique identifier of the stakeholder whose details are to be fetched. |
|
||||
| name | string | The stakeholder's name as per the PAN card. The maximum length is 255 characters. |
|
||||
| percentage_ownership | float | The stakeholder's ownership of the business in percentage. Only two decimal places are allowed. For example, `87.55`. The maximum length is 100 characters. |
|
||||
| relationship | boolean | The stakeholder's relationship with the account’s business. |
|
||||
| phone | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#update-a-stakeholder) are supported |
|
||||
| addresses | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#update-a-stakeholder) are supported |
|
||||
| kyc | object | All keys listed [here](https://razorpay.com/docs/api/partners/stakeholder/#update-a-stakeholder) are supported |
|
||||
| notes | object | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "acc_GP4lfNA0iIMn5B",
|
||||
"type": "standard",
|
||||
"status": "created",
|
||||
"email": "gauri@example.org",
|
||||
"profile": {
|
||||
"category": "healthcare",
|
||||
"subcategory": "clinic",
|
||||
"addresses": {
|
||||
"registered": {
|
||||
"street1": "507, Koramangala 1st block",
|
||||
"street2": "MG Road-1",
|
||||
"city": "Bengalore",
|
||||
"state": "KARNATAKA",
|
||||
"postal_code": "560034",
|
||||
"country": "IN"
|
||||
}
|
||||
}
|
||||
},
|
||||
"notes": [],
|
||||
"created_at": 1610603081,
|
||||
"phone": "9000090000",
|
||||
"reference_id": "randomId",
|
||||
"business_type": "partnership",
|
||||
"legal_business_name": "Acme Corp",
|
||||
"customer_facing_business_name": "ABCD Ltd"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all accounts
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$api->account->fetch($accountId)->stakeholders()->all();
|
||||
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"items": [
|
||||
{
|
||||
"id": "GZ13yPHLJof9IE",
|
||||
"entity": "stakeholder",
|
||||
"relationship": {
|
||||
"director": true
|
||||
},
|
||||
"phone": {
|
||||
"primary": "9000090000",
|
||||
"secondary": "9000090000"
|
||||
},
|
||||
"notes": {
|
||||
"random_key_by_partner": "random_value"
|
||||
},
|
||||
"kyc": {
|
||||
"pan": "AVOPB1111K"
|
||||
},
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@acme.org",
|
||||
"percentage_ownership": 10,
|
||||
"addresses": {
|
||||
"residential": {
|
||||
"street": "506, Koramangala 1st block",
|
||||
"city": "Bengaluru",
|
||||
"state": "Karnataka",
|
||||
"postal_code": "560034",
|
||||
"country": "in"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"count": 1
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch an stakeholder
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$stakeholderId = "sth_GOQ4Eftlz62TSL";
|
||||
|
||||
$api->account->fetch($accountId)->stakeholders()->fetch($stakeholderId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
| stakeholderId* | string | The unique identifier of the stakeholder whose details are to be fetched. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "stakeholder",
|
||||
"relationship": {
|
||||
"director": true
|
||||
},
|
||||
"phone": {
|
||||
"primary": "9000090000",
|
||||
"secondary": "9000090000"
|
||||
},
|
||||
"notes": {
|
||||
"random_key_by_partner": "random_value2"
|
||||
},
|
||||
"kyc": {
|
||||
"pan": "AVOPB1111J"
|
||||
},
|
||||
"id": "sth_GOQ4Eftlz62TSL",
|
||||
"name": "Gauri Kumar",
|
||||
"email": "gauri@example.com",
|
||||
"percentage_ownership": 20,
|
||||
"addresses": {
|
||||
"residential": {
|
||||
"street": "507, Koramangala 1st block",
|
||||
"city": "Bangalore",
|
||||
"state": "Karnataka",
|
||||
"postal_code": "560035",
|
||||
"country": "in"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Upload stakeholders documents
|
||||
|
||||
```php
|
||||
$accountId = "acc_00000000000001";
|
||||
|
||||
$stakeholderId = "sth_00000000000001";
|
||||
|
||||
$payload = [
|
||||
'file'=> '/Users/your_name/Downloads/sample_uploaded.pdf',
|
||||
"document_type" => "aadhar_front"
|
||||
];
|
||||
|
||||
$api->account->fetch($accountId)->stakeholders()->uploadStakeholderDoc($stakeholderId, $payload);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
| stakeholderId* | string | The unique identifier of the stakeholder whose details are to be fetched. |
|
||||
| file* | string | The URL generated once the business proof document is uploaded. |
|
||||
| document_type* | string | The documents valid for the proof type to be shared. In case of individual_proof_of_address, both the front and back of a document proof must be uploaded. Possible values : <br> individual_proof_of_identification: `personal_pan` <br><br> individual_proof_of_address : `voter_id_back`, `voter_id_front`, `aadhar_front`, `aadhar_back`, `passport_front`, `passport_back` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"individual_proof_of_address": [
|
||||
{
|
||||
"type": "aadhar_front",
|
||||
"url": "https://rzp.io/i/bzDAbNg"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch stakeholders documents
|
||||
```php
|
||||
|
||||
$accountId = "acc_00000000000001";
|
||||
|
||||
$stakeholderId = "sth_00000000000001";
|
||||
|
||||
$api->account->fetch($accountId)->stakeholders()->fetchStakeholderDoc($stakeholderId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"business_proof_of_identification": [
|
||||
{
|
||||
"type": "business_proof_url",
|
||||
"url": "<https://rzp.io/i/bzDKbNg>"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/partners/stakeholder)**
|
||||
|
||||
|
||||
$result = $api->account->fetch("acc_M83Uw27KXuC7c8")->stakeholders()->fetchStakeholderDoc("sth_M83WuwmrCFa55g", $payload);
|
||||
|
||||
|
||||
$result = $api->account->fetch("acc_M83Uw27KXuC7c8")->stakeholders()->uploadStakeholderDoc("sth_M83WuwmrCFa55g", $payload);
|
||||
730
vendor/razorpay/razorpay/documents/subscription.md
vendored
Normal file
730
vendor/razorpay/razorpay/documents/subscription.md
vendored
Normal file
@ -0,0 +1,730 @@
|
||||
## Subscriptions
|
||||
|
||||
### Create subscription
|
||||
|
||||
```php
|
||||
$api->subscription->create(array(
|
||||
"plan_id" => "plan_Jc7wDk5iZX88wx",
|
||||
"total_count" => 6,
|
||||
"quantity" => 1,
|
||||
"customer_notify" => true,
|
||||
"start_at" => 1580453311,
|
||||
"expire_by" => 1580626111,
|
||||
"addons" => array(
|
||||
array(
|
||||
"item" => array(
|
||||
"name" => "Delivery charges",
|
||||
"amount" => 30000,
|
||||
"currency" => "INR"
|
||||
)
|
||||
)
|
||||
),
|
||||
"offer_id" => "offer_JCTD1XMlUmzF6Z",
|
||||
"notes" => array(
|
||||
"notes_key_1" => "Tea, Earl Grey, Hot",
|
||||
"notes_key_2" => "Tea, Earl Grey… decaf."
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| plan_id* | string | The unique identifier for a plan that should be linked to the subscription.|
|
||||
| total_count* | string | The number of billing cycles for which the customer should be charged |
|
||||
| customer_notify | boolean | Indicates whether the communication to the customer would be handled by you or us |
|
||||
| quantity | integer | The number of times the customer should be charged the plan amount per invoice |
|
||||
| start_at | integer | The timestamp, in Unix format, for when the subscription should start. If not passed, the subscription starts immediately after the authorization payment. |
|
||||
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
|
||||
| addons | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-a-subscription) are supported |
|
||||
| notes | array | Notes you can enter for the contact for future reference. |
|
||||
| offer_id | string | The unique identifier of the offer that is linked to the subscription. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "sub_00000000000001",
|
||||
"entity": "subscription",
|
||||
"plan_id": "plan_00000000000001",
|
||||
"status": "created",
|
||||
"current_start": null,
|
||||
"current_end": null,
|
||||
"ended_at": null,
|
||||
"quantity": 1,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"charge_at": 1580453311,
|
||||
"start_at": 1580626111,
|
||||
"end_at": 1583433000,
|
||||
"auth_attempts": 0,
|
||||
"total_count": 6,
|
||||
"paid_count": 0,
|
||||
"customer_notify": true,
|
||||
"created_at": 1580280581,
|
||||
"expire_by": 1580626111,
|
||||
"short_url": "https://rzp.io/i/z3b1R61A9",
|
||||
"has_scheduled_changes": false,
|
||||
"change_scheduled_at": null,
|
||||
"source": "api",
|
||||
"offer_id":"offer_JHD834hjbxzhd38d",
|
||||
"remaining_count": 5
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create subscription link
|
||||
|
||||
```php
|
||||
$api->subscription->create(array(
|
||||
"plan_id" => "plan_Jc7wDk5iZX88wx",
|
||||
"total_count" => 12,
|
||||
"quantity" => 1,
|
||||
"start_at" => 1561852800,
|
||||
"expire_by" => 1561939199,
|
||||
"customer_notify" => true,
|
||||
"addons" => array(
|
||||
array(
|
||||
"item" => array(
|
||||
"name" => "Delivery charges",
|
||||
"amount" => 30000,
|
||||
"currency" => "INR"
|
||||
)
|
||||
)
|
||||
),
|
||||
"offer_id" => "offer_JCTD1XMlUmzF6Z",
|
||||
"notes" => array(
|
||||
"notes_key_1" => "Tea, Earl Grey, Hot",
|
||||
"notes_key_2" => "Tea, Earl Grey… decaf."
|
||||
),
|
||||
"notify_info" => array(
|
||||
"notify_phone" => "9123456789",
|
||||
"notify_email" => "gaurav.kumar@example.com"
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| plan_id* | string | The unique identifier for a plan that should be linked to the subscription.|
|
||||
| total_count* | string | The number of billing cycles for which the customer should be charged |
|
||||
| customer_notify | boolean | Indicates whether the communication to the customer would be handled by you or us |
|
||||
| quantity | integer | The number of times the customer should be charged the plan amount per invoice |
|
||||
| start_at | integer | The timestamp, in Unix format, for when the subscription should start. If not passed, the subscription starts immediately after the authorization payment. |
|
||||
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
|
||||
| addons | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-a-subscription-link) are supported |
|
||||
| notes | array | Notes you can enter for the contact for future reference. |
|
||||
| notify_info | array | All parameters listed [here](https://razorpay.com/docs/api/payments/subscriptions/#create-a-subscription-link) are supported |
|
||||
| offer_id | string | The unique identifier of the offer that is linked to the subscription. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"sub_00000000000002",
|
||||
"entity":"subscription",
|
||||
"plan_id":"plan_00000000000001",
|
||||
"status":"created",
|
||||
"current_start":null,
|
||||
"current_end":null,
|
||||
"ended_at":null,
|
||||
"quantity":1,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"charge_at":1580453311,
|
||||
"start_at":1580453311,
|
||||
"end_at":1587061800,
|
||||
"auth_attempts":0,
|
||||
"total_count":12,
|
||||
"paid_count":0,
|
||||
"customer_notify":true,
|
||||
"created_at":1580283117,
|
||||
"expire_by":1581013800,
|
||||
"short_url":"https://rzp.io/i/m0y0f",
|
||||
"has_scheduled_changes":false,
|
||||
"change_scheduled_at":null,
|
||||
"source": "api",
|
||||
"offer_id":"offer_JHD834hjbxzhd38d",
|
||||
"remaining_count":12
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all subscriptions
|
||||
|
||||
```php
|
||||
$api->subscription->all($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the payments were created |
|
||||
| to | timestamp | timestamp before which the payments were created |
|
||||
| count | integer | number of subscriptions to fetch (default: 10) |
|
||||
| skip | integer | number of subscriptions to be skipped (default: 0) |
|
||||
| plan_id | string | The unique identifier of the plan for which you want to retrieve all the subscriptions |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "sub_00000000000001",
|
||||
"entity": "subscription",
|
||||
"plan_id": "plan_00000000000001",
|
||||
"customer_id": "cust_D00000000000001",
|
||||
"status": "active",
|
||||
"current_start": 1577355871,
|
||||
"current_end": 1582655400,
|
||||
"ended_at": null,
|
||||
"quantity": 1,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"charge_at": 1577385991,
|
||||
"offer_id": "offer_JHD834hjbxzhd38d",
|
||||
"start_at": 1577385991,
|
||||
"end_at": 1603737000,
|
||||
"auth_attempts": 0,
|
||||
"total_count": 6,
|
||||
"paid_count": 1,
|
||||
"customer_notify": true,
|
||||
"created_at": 1577356081,
|
||||
"expire_by": 1577485991,
|
||||
"short_url": "https://rzp.io/i/z3b1R61A9",
|
||||
"has_scheduled_changes": false,
|
||||
"change_scheduled_at": null,
|
||||
"remaining_count": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch particular subscription
|
||||
|
||||
```php
|
||||
$api->subscription->fetch($subscriptionId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | string | The id of the subscription to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "sub_00000000000001",
|
||||
"entity": "subscription",
|
||||
"plan_id": "plan_00000000000001",
|
||||
"customer_id": "cust_D00000000000001",
|
||||
"status": "active",
|
||||
"current_start": 1577355871,
|
||||
"current_end": 1582655400,
|
||||
"ended_at": null,
|
||||
"quantity": 1,
|
||||
"notes":{
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"charge_at": 1577385991,
|
||||
"start_at": 1577385991,
|
||||
"end_at": 1603737000,
|
||||
"auth_attempts": 0,
|
||||
"total_count": 6,
|
||||
"paid_count": 1,
|
||||
"customer_notify": true,
|
||||
"created_at": 1577356081,
|
||||
"expire_by": 1577485991,
|
||||
"short_url": "https://rzp.io/i/z3b1R61A9",
|
||||
"has_scheduled_changes": false,
|
||||
"change_scheduled_at": null,
|
||||
"source": "api",
|
||||
"offer_id":"offer_JHD834hjbxzhd38d",
|
||||
"remaining_count": 5
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Cancel particular subscription
|
||||
|
||||
```php
|
||||
$options = array("cancel_at_cycle_end" => true);
|
||||
$api->subscription->fetch($subscriptionId)->cancel($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | string | The id of the subscription to be cancelled |
|
||||
| cancel_at_cycle_end | boolean | Possible values:<br>false (default): Cancel the subscription immediately. <br> true: Cancel the subscription at the end of the current billing cycle. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "sub_00000000000001",
|
||||
"entity": "subscription",
|
||||
"plan_id": "plan_00000000000001",
|
||||
"customer_id": "cust_D00000000000001",
|
||||
"status": "cancelled",
|
||||
"current_start": 1580453311,
|
||||
"current_end": 1581013800,
|
||||
"ended_at": 1580288092,
|
||||
"quantity": 1,
|
||||
"notes":{
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"charge_at": 1580453311,
|
||||
"start_at": 1577385991,
|
||||
"end_at": 1603737000,
|
||||
"auth_attempts": 0,
|
||||
"total_count": 6,
|
||||
"paid_count": 1,
|
||||
"customer_notify": true,
|
||||
"created_at": 1580283117,
|
||||
"expire_by": 1581013800,
|
||||
"short_url": "https://rzp.io/i/z3b1R61A9",
|
||||
"has_scheduled_changes": false,
|
||||
"change_scheduled_at": null,
|
||||
"source": "api",
|
||||
"offer_id":"offer_JHD834hjbxzhd38d",
|
||||
"remaining_count": 5
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Update particular subscription
|
||||
|
||||
```php
|
||||
$options = array(
|
||||
'plan_id' => 'plan_00000000000002',
|
||||
'offer_id' => 'offer_JHD834hjbxzhd38d',
|
||||
'quantity' => 5,
|
||||
'remaining_count' => 5,
|
||||
'start_at' => 1496000432,
|
||||
'schedule_change_at' => 'now',
|
||||
'customer_notify' => true
|
||||
);
|
||||
|
||||
$api->subscription->fetch($subscriptionId)->update($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | string | The id of the subscription to be updated |
|
||||
| options | array | All parameters listed [here](https://razorpay.com/docs/api/subscriptions/#update-a-subscription) for update |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"sub_00000000000002",
|
||||
"entity":"subscription",
|
||||
"plan_id":"plan_00000000000002",
|
||||
"customer_id":"cust_00000000000002",
|
||||
"status":"authenticated",
|
||||
"current_start":null,
|
||||
"current_end":null,
|
||||
"ended_at":null,
|
||||
"quantity":3,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"charge_at":1580453311,
|
||||
"start_at":1580453311,
|
||||
"end_at":1606588200,
|
||||
"auth_attempts":0,
|
||||
"total_count":6,
|
||||
"paid_count":0,
|
||||
"customer_notify":true,
|
||||
"created_at":1580283807,
|
||||
"expire_by":1580626111,
|
||||
"short_url":"https://rzp.io/i/yeDkUKy",
|
||||
"has_scheduled_changes":false,
|
||||
"change_scheduled_at":null,
|
||||
"source": "api",
|
||||
"offer_id":"offer_JHD834hjbxzhd38d",
|
||||
"remaining_count":6
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch details of pending update
|
||||
|
||||
```php
|
||||
$api->subscription->fetch($subscriptionId)->pendingUpdate()
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | string | The id of the subscription to fetch pending update |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"sub_00000000000001",
|
||||
"entity":"subscription",
|
||||
"plan_id":"plan_00000000000003",
|
||||
"customer_id":"cust_00000000000001",
|
||||
"status":"active",
|
||||
"current_start":1580284732,
|
||||
"current_end":1580841000,
|
||||
"ended_at":null,
|
||||
"quantity":25,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"charge_at":1580841000,
|
||||
"start_at":1580284732,
|
||||
"end_at":1611081000,
|
||||
"auth_attempts":0,
|
||||
"total_count":6,
|
||||
"paid_count":1,
|
||||
"customer_notify":true,
|
||||
"created_at":1580284702,
|
||||
"expire_by":1580626111,
|
||||
"short_url":"https://rzp.io/i/fFWTkbf",
|
||||
"has_scheduled_changes":true,
|
||||
"change_scheduled_at":1557253800,
|
||||
"source": "api",
|
||||
"offer_id":"offer_JHD834hjbxzhd38d",
|
||||
"remaining_count":5
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Cancel a update
|
||||
|
||||
```php
|
||||
$api->subscription->fetch($subscriptionId)->cancelScheduledChanges();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | string | The id of the subscription to be cancel an update |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "sub_00000000000001",
|
||||
"entity": "subscription",
|
||||
"plan_id": "plan_00000000000003",
|
||||
"customer_id": "cust_00000000000001",
|
||||
"status": "active",
|
||||
"current_start": 1580284732,
|
||||
"current_end": 1580841000,
|
||||
"ended_at": null,
|
||||
"quantity": 1,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"charge_at": 1580841000,
|
||||
"start_at": 1580284732,
|
||||
"end_at": 1611081000,
|
||||
"auth_attempts": 0,
|
||||
"total_count": 6,
|
||||
"paid_count": 1,
|
||||
"customer_notify": true,
|
||||
"created_at": 1580284702,
|
||||
"expire_by": 1580626111,
|
||||
"short_url": "https://rzp.io/i/fFWTkbf",
|
||||
"has_scheduled_changes": false,
|
||||
"change_scheduled_at": 1527858600,
|
||||
"source": "api",
|
||||
"offer_id":"offer_JHD834hjbxzhd38d",
|
||||
"remaining_count": 5
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Pause a subscription
|
||||
|
||||
```php
|
||||
$api->subscription->fetch($subscriptionId)->pause(array('pause_at'=>'now'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | string | The id of the subscription to be paused |
|
||||
| pause_at | string | To pause the subscription, possible values: `now` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "sub_00000000000001",
|
||||
"entity": "subscription",
|
||||
"plan_id": "plan_00000000000001",
|
||||
"status": "paused",
|
||||
"current_start": null,
|
||||
"current_end": null,
|
||||
"ended_at": null,
|
||||
"quantity": 1,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"charge_at": null,
|
||||
"start_at": 1580626111,
|
||||
"end_at": 1583433000,
|
||||
"auth_attempts": 0,
|
||||
"total_count": 6,
|
||||
"paid_count": 0,
|
||||
"customer_notify": true,
|
||||
"created_at": 1580280581,
|
||||
"paused_at": 1590280581,
|
||||
"expire_by": 1580626111,
|
||||
"pause_initiated_by": "self",
|
||||
"short_url": "https://rzp.io/i/z3b1R61A9",
|
||||
"has_scheduled_changes": false,
|
||||
"change_scheduled_at": null,
|
||||
"source": "api",
|
||||
"offer_id":"offer_JHD834hjbxzhd38d",
|
||||
"remaining_count": 6
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Resume a subscription
|
||||
|
||||
```php
|
||||
$api->subscription->fetch($subscriptionId)->resume(array('resume_at'=>'now'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | string | The id of the subscription to be resumed |
|
||||
| resume_at | string | To resume the subscription, possible values: `now` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "sub_00000000000001",
|
||||
"entity": "subscription",
|
||||
"plan_id": "plan_00000000000001",
|
||||
"status": "active",
|
||||
"current_start": null,
|
||||
"current_end": null,
|
||||
"ended_at": null,
|
||||
"quantity": 1,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"charge_at": 1580453311,
|
||||
"start_at": 1580626111,
|
||||
"end_at": 1583433000,
|
||||
"auth_attempts": 0,
|
||||
"total_count": 6,
|
||||
"paid_count": 0,
|
||||
"customer_notify": true,
|
||||
"created_at": 1580280581,
|
||||
"paused_at": 1590280581,
|
||||
"expire_by": 1580626111,
|
||||
"pause_initiated_by": null,
|
||||
"short_url": "https://rzp.io/i/z3b1R61A9",
|
||||
"has_scheduled_changes": false,
|
||||
"change_scheduled_at": null,
|
||||
"source": "api",
|
||||
"offer_id":"offer_JHD834hjbxzhd38d",
|
||||
"remaining_count": 6
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all invoices for a subscription
|
||||
|
||||
```php
|
||||
$api->invoice->all(['subscription_id'=>$subscriptionId]);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | string | The id of the subscription to fetch invoices |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "inv_00000000000003",
|
||||
"entity": "invoice",
|
||||
"receipt": null,
|
||||
"invoice_number": null,
|
||||
"customer_id": "cust_00000000000001",
|
||||
"customer_details": {
|
||||
"id": "cust_00000000000001",
|
||||
"name": null,
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919876543210",
|
||||
"gstin": null,
|
||||
"billing_address": null,
|
||||
"shipping_address": null,
|
||||
"customer_name": null,
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "+919876543210"
|
||||
},
|
||||
"order_id": "order_00000000000002",
|
||||
"subscription_id": "sub_00000000000001",
|
||||
"line_items": [
|
||||
{
|
||||
"id": "li_00000000000003",
|
||||
"item_id": null,
|
||||
"ref_id": null,
|
||||
"ref_type": null,
|
||||
"name": "Monthly Plan",
|
||||
"description": null,
|
||||
"amount": 99900,
|
||||
"unit_amount": 99900,
|
||||
"gross_amount": 99900,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 99900,
|
||||
"net_amount": 99900,
|
||||
"currency": "INR",
|
||||
"type": "plan",
|
||||
"tax_inclusive": false,
|
||||
"hsn_code": null,
|
||||
"sac_code": null,
|
||||
"tax_rate": null,
|
||||
"unit": null,
|
||||
"quantity": 1,
|
||||
"taxes": []
|
||||
}
|
||||
],
|
||||
"payment_id": "pay_00000000000002",
|
||||
"status": "paid",
|
||||
"expire_by": null,
|
||||
"issued_at": 1593344888,
|
||||
"paid_at": 1593344889,
|
||||
"cancelled_at": null,
|
||||
"expired_at": null,
|
||||
"sms_status": null,
|
||||
"email_status": null,
|
||||
"date": 1593344888,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 99900,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 99900,
|
||||
"amount": 99900,
|
||||
"amount_paid": 99900,
|
||||
"amount_due": 0,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": null,
|
||||
"notes": [],
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/Ys4feGqEp",
|
||||
"view_less": true,
|
||||
"billing_start": 1594405800,
|
||||
"billing_end": 1597084200,
|
||||
"type": "invoice",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1593344888,
|
||||
"idempotency_key": null
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete offer linked to a subscription
|
||||
|
||||
```php
|
||||
$offerId = "offer_JCTD1XMlUmzF6Z";
|
||||
|
||||
$api->subscription->fetch($subscriptionId)->deleteOffer($offerId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| subscriptionId* | string | The id of the subscription to offer need to be deleted |
|
||||
| offerId* | string | The id of the offer linked to subscription |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "sub_I3GGEs7Xgmnozy",
|
||||
"entity": "subscription",
|
||||
"plan_id": "plan_HuXrfsI0ZZ3peu",
|
||||
"customer_id": "cust_I3FToKbnExwDLu",
|
||||
"status": "active",
|
||||
"current_start": 1632914901,
|
||||
"current_end": 1635445800,
|
||||
"ended_at": null,
|
||||
"quantity": 1,
|
||||
"notes": [],
|
||||
"charge_at": 1635445800,
|
||||
"start_at": 1632914901,
|
||||
"end_at": 1645986600,
|
||||
"auth_attempts": 0,
|
||||
"total_count": 6,
|
||||
"paid_count": 1,
|
||||
"customer_notify": true,
|
||||
"created_at": 1632914246,
|
||||
"expire_by": 1635532200,
|
||||
"short_url": "https://rzp.io/i/SOvRWaYP81",
|
||||
"has_scheduled_changes": false,
|
||||
"change_scheduled_at": null,
|
||||
"source": "dashboard",
|
||||
"payment_method": "card",
|
||||
"offer_id": null,
|
||||
"remaining_count": 5
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Authentication Transaction
|
||||
|
||||
Please refer this [doc](https://razorpay.com/docs/api/subscriptions/#authentication-transaction) for authentication of transaction
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Payment verification
|
||||
|
||||
```php
|
||||
$api->utility->verifyPaymentSignature($options)
|
||||
```
|
||||
|
||||
Please refer this [doc](https://razorpay.com/docs/api/subscriptions/#payment-verification) for payment verification
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/subscriptions/#subscriptions)**
|
||||
390
vendor/razorpay/razorpay/documents/token.md
vendored
Normal file
390
vendor/razorpay/razorpay/documents/token.md
vendored
Normal file
@ -0,0 +1,390 @@
|
||||
## Tokens
|
||||
|
||||
### Fetch token by payment id
|
||||
```php
|
||||
$api->payment->fetch($paymentId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "pay_FHfqtkRzWvxky4",
|
||||
"entity": "payment",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_FHfnswDdfu96HQ",
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "card",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": null,
|
||||
"card_id": "card_F0zoXUp4IPPGoI",
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919876543210",
|
||||
"customer_id": "cust_DtHaBuooGHTuyZ",
|
||||
"token_id": "token_FHfn3rIiM1Z8nr",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {
|
||||
"auth_code": "541898"
|
||||
},
|
||||
"created_at": 1595449871
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch tokens by customer id
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->all();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity":"collection",
|
||||
"count":1,
|
||||
"items":[
|
||||
{
|
||||
"id":"token_HouA2OQR5Z2jTL",
|
||||
"entity":"token",
|
||||
"token":"2JPRk664pZHUWG",
|
||||
"bank":null,
|
||||
"wallet":null,
|
||||
"method":"card",
|
||||
"card":{
|
||||
"entity":"card",
|
||||
"name":"Gaurav Kumar",
|
||||
"last4":"8950",
|
||||
"network":"Visa",
|
||||
"type":"credit",
|
||||
"issuer":"STCB",
|
||||
"international":false,
|
||||
"emi":false,
|
||||
"sub_type":"consumer",
|
||||
"expiry_month":12,
|
||||
"expiry_year":2021,
|
||||
"flows":{
|
||||
"otp":true,
|
||||
"recurring":true
|
||||
}
|
||||
},
|
||||
"recurring":true,
|
||||
"recurring_details":{
|
||||
"status":"confirmed",
|
||||
"failure_reason":null
|
||||
},
|
||||
"auth_type":null,
|
||||
"mrn":null,
|
||||
"used_at":1629779657,
|
||||
"created_at":1629779657,
|
||||
"expired_at":1640975399,
|
||||
"dcc_enabled":false,
|
||||
"billing_address":null
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch particular token
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->fetch($tokenId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "token_Hxe0skTXLeg9pF",
|
||||
"entity": "token",
|
||||
"token": "F85BgXnGVwcuqV",
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"method": "card",
|
||||
"card": {
|
||||
"entity": "card",
|
||||
"name": "ankit",
|
||||
"last4": "5449",
|
||||
"network": "MasterCard",
|
||||
"type": "credit",
|
||||
"issuer": "UTIB",
|
||||
"international": false,
|
||||
"emi": false,
|
||||
"sub_type": "consumer",
|
||||
"expiry_month": 12,
|
||||
"expiry_year": 2024,
|
||||
"flows": {
|
||||
"recurring": true
|
||||
}
|
||||
},
|
||||
"recurring": true,
|
||||
"auth_type": null,
|
||||
"mrn": null,
|
||||
"used_at": 1632976165,
|
||||
"created_at": 1631687852,
|
||||
"expired_at": 1634215992,
|
||||
"dcc_enabled": false
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete token
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->delete($tokenId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"deleted": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch VPA tokens of a customer id
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->all();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "token_EeroOjvOvorT5L",
|
||||
"entity": "token",
|
||||
"token": "4ydxm47GQjrIEx",
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"method": "card",
|
||||
"card": {
|
||||
"entity": "card",
|
||||
"name": "Gaurav Kumar",
|
||||
"last4": "8430",
|
||||
"network": "Visa",
|
||||
"type": "credit",
|
||||
"issuer": "HDFC",
|
||||
"international": false,
|
||||
"emi": true,
|
||||
"expiry_month": 12,
|
||||
"expiry_year": 2022,
|
||||
"flows": {
|
||||
"otp": true,
|
||||
"recurring": true
|
||||
}
|
||||
},
|
||||
"vpa": null,
|
||||
"recurring": false,
|
||||
"auth_type": null,
|
||||
"mrn": null,
|
||||
"used_at": 1586976724,
|
||||
"created_at": 1586976724,
|
||||
"expired_at": 1672511399,
|
||||
"dcc_enabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create a token
|
||||
|
||||
```php
|
||||
|
||||
$api->token->create(array(
|
||||
"customer_id" => "cust_1Aa00000000001",
|
||||
"method" => "card",
|
||||
"card" => array(
|
||||
"number" => "4111111111111111",
|
||||
"cvv" => "123",
|
||||
"expiry_month" => "12",
|
||||
"expiry_year" => "21",
|
||||
"name" => "Gaurav Kumar"
|
||||
),
|
||||
"authentication" => array(
|
||||
"provider" => "razorpay",
|
||||
"provider_reference_id" => "pay_123wkejnsakd",
|
||||
"authentication_reference_number" => "100222021120200000000742753928"
|
||||
),
|
||||
"notes" => array()
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| method* | string | The type of object that needs to be tokenised. Currently, `card` is the only supported value. |
|
||||
| card* | object | All keys listed [here](https://razorpay.com/docs/partners/aggregators/partner-auth/token-sharing/#create-token-on-behalf-of-a-sub-merchant) are supported
|
||||
|
|
||||
| authentication | object | All keys listed [here](https://razorpay.com/docs/partners/aggregators/partner-auth/token-sharing/#create-token-on-behalf-of-a-sub-merchant) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "token_IJmat4GwYATMtx",
|
||||
"entity": "token",
|
||||
"method": "card",
|
||||
"card": {
|
||||
"last4": "1111",
|
||||
"network": "Visa",
|
||||
"type": "credit",
|
||||
"issuer": "IDFB",
|
||||
"international": false,
|
||||
"emi": false,
|
||||
"sub_type": "consumer"
|
||||
},
|
||||
"customer": {
|
||||
"id": "cust_1Aa00000000001",
|
||||
"entity": "customer",
|
||||
"name": "Bob",
|
||||
"email": "bob@gmail.com",
|
||||
"contact": "9000090000",
|
||||
"gstin": null,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1658390470
|
||||
},
|
||||
"expired_at": 1701368999,
|
||||
"customer_id": "cust_1Aa00000000001",
|
||||
"compliant_with_tokenisation_guidelines": true,
|
||||
"status": "active",
|
||||
"notes": []
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch token
|
||||
```php
|
||||
$api->token->fetch(array("id" => "token_4lsdksD31GaZ09"));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| id* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "token_4lsdksD31GaZ09",
|
||||
"entity": "token",
|
||||
"customer_id": "cust_1Aa00000000001",
|
||||
"method": "card",
|
||||
"card": {
|
||||
"last4": "3335",
|
||||
"network": "Visa",
|
||||
"type": "debit",
|
||||
"issuer": "HDFC",
|
||||
"international": false,
|
||||
"emi": true,
|
||||
"sub_type": "consumer",
|
||||
"token_iin": "453335"
|
||||
},
|
||||
"compliant_with_tokenisation_guidelines": true,
|
||||
"expired_at": 1748716199,
|
||||
"status": "active",
|
||||
"status_reason": null,
|
||||
"notes": []
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Delete a token
|
||||
```php
|
||||
$api->token->delete(array("id" => "token_4lsdksD31GaZ09"));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| id* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
[]
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Process a Payment on another PA/PG with Token
|
||||
```php
|
||||
$api->token->processPaymentOnAlternatePAorPG(array("id"=>"spt_4lsdksD31GaZ09"));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| id* | string | The unique identifier of the token whose details are to be fetched. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"card": {
|
||||
"number": "4016981500100002",
|
||||
"expiry_month" : "12",
|
||||
"expiry_year" : 2021
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/recurring-payments/upi/tokens/)**
|
||||
805
vendor/razorpay/razorpay/documents/transfer.md
vendored
Normal file
805
vendor/razorpay/razorpay/documents/transfer.md
vendored
Normal file
@ -0,0 +1,805 @@
|
||||
## Transfers
|
||||
|
||||
### Create transfers from payment
|
||||
|
||||
```php
|
||||
|
||||
$paymentId = "pay_I7watngocuEY4P";
|
||||
|
||||
$api->payment->fetch($paymentId)->transfer(array(
|
||||
'transfers' => array(
|
||||
array(
|
||||
'account' => 'acc_I0QRP7PpvaHhpB',
|
||||
'amount' => 100,
|
||||
'currency' => 'INR',
|
||||
'notes' => array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'roll_no' => 'IEC2011025',
|
||||
),
|
||||
'linked_account_notes' => array(
|
||||
'roll_no'
|
||||
),
|
||||
'on_hold' => true,
|
||||
'on_hold_until' => 1671222870
|
||||
)
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
| transfers | array | All parameters listed [here](https://razorpay.com/docs/api/route/#create-transfers-from-payments) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "trf_Jhf4Ak94xAcyeS",
|
||||
"entity": "transfer",
|
||||
"status": "pending",
|
||||
"source": "pay_I7watngocuEY4P",
|
||||
"recipient": "acc_HjVXbtpSCIxENR",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 0,
|
||||
"notes": {
|
||||
"name": "Gaurav Kumar",
|
||||
"roll_no": "IEC2011025"
|
||||
},
|
||||
"linked_account_notes": [
|
||||
"roll_no"
|
||||
],
|
||||
"on_hold": true,
|
||||
"on_hold_until": 1671222870,
|
||||
"recipient_settlement_id": null,
|
||||
"created_at": 1655272292,
|
||||
"processed_at": null,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_Jhf4Ak94xAcyeS",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create transfers from order
|
||||
|
||||
```php
|
||||
$api->order->create(
|
||||
array(
|
||||
'amount' => 2000,
|
||||
'currency' => 'INR',
|
||||
'transfers' => array(
|
||||
array(
|
||||
'account' => 'acc_CPRsN1LkFccllA',
|
||||
'amount' => 1000,
|
||||
'currency' => 'INR',
|
||||
'notes' => array(
|
||||
'branch' => 'Acme Corp Bangalore North',
|
||||
'name' => 'Gaurav Kumar'
|
||||
),
|
||||
'linked_account_notes' => array('branch'),
|
||||
'on_hold' => true,
|
||||
'on_hold_until' => 1671222870
|
||||
),
|
||||
array(
|
||||
'account' => 'acc_CNo3jSI8OkFJJJ',
|
||||
'amount' => 1000,
|
||||
'currency' => 'INR',
|
||||
'notes' => array(
|
||||
'branch' => 'Acme Corp Bangalore South',
|
||||
'name' => 'Saurav Kumar'
|
||||
),
|
||||
'linked_account_notes' => array('branch'),
|
||||
'on_hold' => true
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| amount* | integer | The transaction amount, in paise |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
| receipt | string | A unique identifier provided by you for your internal reference. |
|
||||
| transfers | array | All parameters listed [here](https://razorpay.com/docs/api/route/#create-transfers-from-orders) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "order_Jhf1Sn06my7AUb",
|
||||
"entity": "order",
|
||||
"amount": 2000,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 2000,
|
||||
"currency": "INR",
|
||||
"receipt": null,
|
||||
"offer_id": "offer_JGQvQtvJmVDRIA",
|
||||
"offers": [
|
||||
"offer_JGQvQtvJmVDRIA"
|
||||
],
|
||||
"status": "created",
|
||||
"attempts": 0,
|
||||
"notes": [],
|
||||
"created_at": 1655272138,
|
||||
"transfers": [
|
||||
{
|
||||
"id": "trf_Jhf1SpAYVIeRoP",
|
||||
"entity": "transfer",
|
||||
"status": "created",
|
||||
"source": "order_Jhf1Sn06my7AUb",
|
||||
"recipient": "acc_HjVXbtpSCIxENR",
|
||||
"amount": 1000,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 0,
|
||||
"notes": {
|
||||
"branch": "Acme Corp Bangalore North",
|
||||
"name": "Gaurav Kumar"
|
||||
},
|
||||
"linked_account_notes": [
|
||||
"branch"
|
||||
],
|
||||
"on_hold": true,
|
||||
"on_hold_until": 1671222870,
|
||||
"recipient_settlement_id": null,
|
||||
"created_at": 1655272138,
|
||||
"processed_at": null,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_Jhf1SpAYVIeRoP",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Direct transfers
|
||||
|
||||
```php
|
||||
$api->transfer->create(array('account' => $accountId, 'amount' => 500, 'currency' => 'INR'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The id of the account to be fetched |
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| currency* | string | The currency of the payment (defaults to INR) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "trf_JhdmwXgQpEk38N",
|
||||
"entity": "transfer",
|
||||
"status": "processed",
|
||||
"source": "acc_HZbJUcl6DBDLIN",
|
||||
"recipient": "acc_HjVXbtpSCIxENR",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 0,
|
||||
"fees": 1,
|
||||
"tax": 0,
|
||||
"notes": [],
|
||||
"linked_account_notes": [],
|
||||
"on_hold": false,
|
||||
"on_hold_until": null,
|
||||
"recipient_settlement_id": null,
|
||||
"created_at": 1655267791,
|
||||
"processed_at": 1655267792,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_JhdmwXgQpEk38N",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch transfer for a payment
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->transfers();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "trf_JGQjgcy8zHFq7e",
|
||||
"entity": "transfer",
|
||||
"status": "partially_reversed",
|
||||
"source": "order_JGQjgaUikLJo8n",
|
||||
"recipient": "acc_HalyQGZh9ZyiGg",
|
||||
"amount": 500,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 100,
|
||||
"fees": 1,
|
||||
"tax": 0,
|
||||
"notes": {
|
||||
"branch": "Acme Corp Bangalore South",
|
||||
"name": "Saurav Kumar"
|
||||
},
|
||||
"linked_account_notes": [
|
||||
"branch"
|
||||
],
|
||||
"on_hold": true,
|
||||
"on_hold_until": 1679691505,
|
||||
"settlement_status": "on_hold",
|
||||
"recipient_settlement_id": null,
|
||||
"created_at": 1649326643,
|
||||
"processed_at": 1649326701,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_JGQjgcy8zHFq7e",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch transfer for an order
|
||||
|
||||
```php
|
||||
$api->order->fetch($orderId)->transfers(array('expand[]'=>'transfers'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| orderId* | string | The id of the order to be fetched |
|
||||
| expand* | string | Supported value is `transfer` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "order_JfOO8JYmAtYRL0",
|
||||
"entity": "order",
|
||||
"amount": 2000,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 2000,
|
||||
"currency": "INR",
|
||||
"receipt": null,
|
||||
"offer_id": "offer_JGQvQtvJmVDRIA",
|
||||
"offers": [
|
||||
"offer_JGQvQtvJmVDRIA"
|
||||
],
|
||||
"status": "created",
|
||||
"attempts": 0,
|
||||
"notes": [],
|
||||
"created_at": 1654776878,
|
||||
"transfers": {
|
||||
"entity": "collection",
|
||||
"count": 2,
|
||||
"items": [
|
||||
{
|
||||
"id": "trf_JfOO8LGAPdwky4",
|
||||
"entity": "transfer",
|
||||
"status": "created",
|
||||
"source": "order_JfOO8JYmAtYRL0",
|
||||
"recipient": "acc_HjVXbtpSCIxENR",
|
||||
"amount": 1000,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 0,
|
||||
"fees": 0,
|
||||
"tax": null,
|
||||
"notes": {
|
||||
"branch": "Acme Corp Bangalore North",
|
||||
"name": "Gaurav Kumar"
|
||||
},
|
||||
"linked_account_notes": [
|
||||
"branch"
|
||||
],
|
||||
"on_hold": true,
|
||||
"on_hold_until": 1671222870,
|
||||
"settlement_status": null,
|
||||
"recipient_settlement_id": null,
|
||||
"created_at": 1654776878,
|
||||
"processed_at": null,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_JfOO8LGAPdwky4",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "trf_JfOO8M4p6tQZ6g",
|
||||
"entity": "transfer",
|
||||
"status": "created",
|
||||
"source": "order_JfOO8JYmAtYRL0",
|
||||
"recipient": "acc_HalyQGZh9ZyiGg",
|
||||
"amount": 1000,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 0,
|
||||
"fees": 0,
|
||||
"tax": null,
|
||||
"notes": {
|
||||
"branch": "Acme Corp Bangalore South",
|
||||
"name": "Saurav Kumar"
|
||||
},
|
||||
"linked_account_notes": [
|
||||
"branch"
|
||||
],
|
||||
"on_hold": false,
|
||||
"on_hold_until": null,
|
||||
"settlement_status": null,
|
||||
"recipient_settlement_id": null,
|
||||
"created_at": 1654776878,
|
||||
"processed_at": null,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_JfOO8M4p6tQZ6g",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch transfer
|
||||
|
||||
```php
|
||||
$api->transfer->fetch($transferId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| transferId* | string | The id of the transfer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "trf_IJOI2DHWQYwqU3",
|
||||
"entity": "transfer",
|
||||
"status": "created",
|
||||
"source": "order_IJOI2CD6CNIywP",
|
||||
"recipient": "acc_HjVXbtpSCIxENR",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 0,
|
||||
"fees": 0,
|
||||
"tax": null,
|
||||
"notes": {
|
||||
"branch": "Acme Corp Bangalore North",
|
||||
"name": "Gaurav Kumar"
|
||||
},
|
||||
"linked_account_notes": [
|
||||
"branch"
|
||||
],
|
||||
"on_hold": true,
|
||||
"on_hold_until": 1671222870,
|
||||
"settlement_status": null,
|
||||
"recipient_settlement_id": null,
|
||||
"created_at": 1636435963,
|
||||
"processed_at": null,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_IJOI2DHWQYwqU3",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch transfers for a settlement
|
||||
|
||||
```php
|
||||
$api->transfer->all(array('recipient_settlement_id'=> $recipientSettlementId));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| recipientSettlementId* | string | The recipient settlement id obtained from the settlement.processed webhook payload. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "trf_HWjmkReRGPhguR",
|
||||
"entity": "transfer",
|
||||
"status": "processed",
|
||||
"source": "pay_HWjY9DZSMsbm5E",
|
||||
"recipient": "acc_HWjl1kqobJzf4i",
|
||||
"amount": 1000,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 0,
|
||||
"fees": 3,
|
||||
"tax": 0,
|
||||
"notes": [],
|
||||
"linked_account_notes": [],
|
||||
"on_hold": false,
|
||||
"on_hold_until": null,
|
||||
"settlement_status": "settled",
|
||||
"recipient_settlement_id": "setl_HYIIk3H0J4PYdX",
|
||||
"created_at": 1625812996,
|
||||
"processed_at": 1625812996,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_HWjmkReRGPhguR",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch settlement details
|
||||
|
||||
```php
|
||||
$api->transfer->all(array('expand[]'=> 'recipient_settlement'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| expand* | string | Supported value is `recipient_settlement` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "trf_JhdmwXgQpEk38N",
|
||||
"entity": "transfer",
|
||||
"status": "processed",
|
||||
"source": "acc_HZbJUcl6DBDLIN",
|
||||
"recipient": "acc_HjVXbtpSCIxENR",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 0,
|
||||
"fees": 1,
|
||||
"tax": 0,
|
||||
"notes": [],
|
||||
"linked_account_notes": [],
|
||||
"on_hold": false,
|
||||
"on_hold_until": null,
|
||||
"settlement_status": null,
|
||||
"recipient_settlement_id": null,
|
||||
"recipient_settlement": null,
|
||||
"created_at": 1655267791,
|
||||
"processed_at": 1655267792,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_JhdmwXgQpEk38N",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Refund payments and reverse transfer from a linked account
|
||||
|
||||
```php
|
||||
$api->payment->fetch("pay_JsPSazUg9UnOX2")->refund(array('amount'=> '100','reverse_all'=> true));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
| amount* | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
| reverse_all | boolean | Reverses transfer made to a linked account. Possible values:<br> * `true` - Reverses transfer made to a linked account.<br>* `false` - Does not reverse transfer made to a linked account.|
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "pay_JHAe1Zat55GbZB",
|
||||
"entity": "payment",
|
||||
"amount": 5000,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_IluGWxBm9U8zJ8",
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "netbanking",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": "Test Transaction",
|
||||
"card_id": null,
|
||||
"bank": "KKBK",
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919999999999",
|
||||
"notes": {
|
||||
"address": "Razorpay Corporate Office"
|
||||
},
|
||||
"fee": 118,
|
||||
"tax": 18,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {
|
||||
"bank_transaction_id": "7003347"
|
||||
},
|
||||
"created_at": 1649488316
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch payments of a linked account
|
||||
|
||||
```php
|
||||
|
||||
$api->setHeader('X-Razorpay-Account', 'acc_IRQWUleX4BqvYn');
|
||||
|
||||
$api->payment->all();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| X-Razorpay-Account | string | The linked account id to fetch the payments received by linked account |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 2,
|
||||
"items": [
|
||||
{
|
||||
"id": "pay_E9uth3WhYbh9QV",
|
||||
"entity": "payment",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": null,
|
||||
"invoice_id": null,
|
||||
"international": null,
|
||||
"method": "transfer",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": null,
|
||||
"card_id": null,
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "",
|
||||
"contact": null,
|
||||
"notes": [],
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"created_at": 1580219046
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Reverse transfers from all linked accounts
|
||||
```php
|
||||
$api->transfer->fetch($transferId)->reverse(array('amount'=>'100'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| transferId* | string | The id of the transfer to be fetched |
|
||||
| amount | integer | The amount to be captured (should be equal to the authorized amount, in paise) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "rfnd_JJFNlNXPHY640A",
|
||||
"entity": "refund",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"payment_id": "pay_JJCqynf4fQS0N1",
|
||||
"notes": [],
|
||||
"receipt": null,
|
||||
"acquirer_data": {
|
||||
"arn": null
|
||||
},
|
||||
"created_at": 1649941680,
|
||||
"batch_id": null,
|
||||
"status": "processed",
|
||||
"speed_processed": "normal",
|
||||
"speed_requested": "normal"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Hold settlements for transfers
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->transfer(array('transfers' => array(array('account' => 'acc_I0QRP7PpvaHhpB','amount' => 100,'currency' => 'INR','on_hold' => true))));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be fetched |
|
||||
| transfers | array | All parameters listed [here](https://razorpay.com/docs/api/route/#hold-settlements-for-transfers) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "trf_JhemwjNekar9Za",
|
||||
"entity": "transfer",
|
||||
"status": "pending",
|
||||
"source": "pay_I7watngocuEY4P",
|
||||
"recipient": "acc_HjVXbtpSCIxENR",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 0,
|
||||
"notes": [],
|
||||
"linked_account_notes": [],
|
||||
"on_hold": true,
|
||||
"on_hold_until": null,
|
||||
"recipient_settlement_id": null,
|
||||
"created_at": 1655271313,
|
||||
"processed_at": null,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_JhemwjNekar9Za",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Modify settlement hold for transfers
|
||||
```php
|
||||
$api->transfer->fetch($transferId)->edit(array('on_hold' => true, 'on_hold_until' => '1679691505'));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| transferId* | string | The id of the transfer to be fetched |
|
||||
| on_hold* | boolean | Possible values is `true` or `false` |
|
||||
| on_hold_until | integer | Timestamp, in Unix, that indicates until when the settlement of the transfer must be put on hold |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "trf_JOmyyZ7lsxDzwF",
|
||||
"entity": "transfer",
|
||||
"status": "reversed",
|
||||
"source": "acc_HZbJUcl6DBDLIN",
|
||||
"recipient": "acc_HjVXbtpSCIxENR",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"amount_reversed": 100,
|
||||
"fees": 1,
|
||||
"tax": 0,
|
||||
"notes": [],
|
||||
"linked_account_notes": [],
|
||||
"on_hold": true,
|
||||
"on_hold_until": null,
|
||||
"settlement_status": null,
|
||||
"recipient_settlement_id": null,
|
||||
"created_at": 1651151707,
|
||||
"processed_at": 1651151708,
|
||||
"error": {
|
||||
"code": null,
|
||||
"description": null,
|
||||
"reason": null,
|
||||
"field": null,
|
||||
"step": null,
|
||||
"id": "trf_JOmyyZ7lsxDzwF",
|
||||
"source": null,
|
||||
"metadata": null
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/route/#transfers/)**
|
||||
503
vendor/razorpay/razorpay/documents/upi.md
vendored
Normal file
503
vendor/razorpay/razorpay/documents/upi.md
vendored
Normal file
@ -0,0 +1,503 @@
|
||||
## UPI
|
||||
|
||||
### Create customer
|
||||
```php
|
||||
$api->customer->create(array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'fail_existing' => "1",
|
||||
'contact'=>'9000090000',
|
||||
'notes'=> array(
|
||||
'notes_key_1'=> 'Tea, Earl Grey, Hot',
|
||||
'notes_key_2'=> 'Tea, Earl Grey... decaf'
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| name* | string | Name of the customer |
|
||||
| email | string | Email of the customer |
|
||||
| fail_existing | string | If a customer with the same details already exists, the request throws an exception by default. Possible value is `1` or `0`|
|
||||
| contact | string | Contact number of the customer |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "cust_1Aa00000000003",
|
||||
"entity": "customer",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "Gaurav.Kumar@example.com",
|
||||
"contact": "9000000000",
|
||||
"gstin": null,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1582033731
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create order
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 0,'currency' => 'INR','method' => 'upi','customer_id' => 'cust_4xbQrmEoA5WJ01', 'token' => array('max_amount' => 200000, 'expire_at' => 2709971120, 'frequency' => 'monthly'),'receipt' => 'Receipt No. 1' ,'notes' => array('notes_key_1' => 'Beam me up Scotty','notes_key_2' => 'Engage')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | Currency of the order. Currently only `INR` is supported. |
|
||||
| method* | string | The authorization method. In this case the value will be `upi` |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| notes | array | A key-value pair |
|
||||
| token* | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/upi/create-authorization-transaction/#112-create-an-order) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "order_1Aa00000000002",
|
||||
"entity": "order",
|
||||
"amount": 100,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 100,
|
||||
"currency": "INR",
|
||||
"receipt": "Receipt No. 1",
|
||||
"offer_id": null,
|
||||
"status": "created",
|
||||
"attempts": 0,
|
||||
"notes": {
|
||||
"notes_key_1": "Tea, Earl Grey, Hot",
|
||||
"notes_key_2": "Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at": 1565172642
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an Authorization Payment
|
||||
|
||||
Please refer this [doc](https://razorpay.com/docs/api/recurring-payments/upi/authorization-transaction/#113-create-an-authorization-payment) for authorization payment
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create registration link
|
||||
|
||||
```php
|
||||
$api->subscription->createSubscriptionRegistration(array(
|
||||
'customer' => array(
|
||||
'name' => 'Gaurav Kumar',
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9123456780'
|
||||
),
|
||||
'type' => 'link',
|
||||
'amount' => 100,
|
||||
'currency' => 'INR',
|
||||
'description' => 'Registration Link for Gaurav Kumar',
|
||||
'subscription_registration' => array(
|
||||
'method' => 'upi',
|
||||
'max_amount' => '500',
|
||||
'expire_at' => '1634215992',
|
||||
'frequency' => 'monthly'
|
||||
),
|
||||
'receipt' => 'Receipt No. 5',
|
||||
'email_notify' => true,
|
||||
'sms_notify' => true,
|
||||
'expire_by' => 1634215992,
|
||||
'notes' => array(
|
||||
'note_key 1' => 'Beam me up Scotty',
|
||||
'note_key 2' => 'Tea. Earl Gray. Hot.'
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| customer | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/upi/create-authorization-transaction/#121-create-a-registration-link) are supported |
|
||||
| type* | string | In this case, the value is `link`. |
|
||||
| currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
|
||||
| amount* | integer | The payment amount in the smallest currency sub-unit. |
|
||||
| description* | string | A description that appears on the hosted page. For example, `12:30 p.m. Thali meals (Gaurav Kumar`). |
|
||||
| subscription_registration | array | All parameters listed [here](https://razorpay.com/docs/api/payments/recurring-payments/upi/create-authorization-transaction/#121-create-a-registration-link) are supported |
|
||||
| sms_notify | boolean | SMS notifications are to be sent by Razorpay (default : true) |
|
||||
| email_notify | boolean | Email notifications are to be sent by Razorpay (default : true) |
|
||||
| expire_by | integer | The timestamp, in Unix format, till when the customer can make the authorization payment. |
|
||||
| notes | array | A key-value pair |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "inv_FHr1ekX0r2VCVK",
|
||||
"entity": "invoice",
|
||||
"receipt": "Receipt No. 23",
|
||||
"invoice_number": "Receipt No. 23",
|
||||
"customer_id": "cust_BMB3EwbqnqZ2EI",
|
||||
"customer_details": {
|
||||
"id": "cust_BMB3EwbqnqZ2EI",
|
||||
"name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "9123456780",
|
||||
"gstin": null,
|
||||
"billing_address": null,
|
||||
"shipping_address": null,
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_contact": "9123456780"
|
||||
},
|
||||
"order_id": "order_FHr1ehR3nmNeXo",
|
||||
"line_items": [],
|
||||
"payment_id": null,
|
||||
"status": "issued",
|
||||
"expire_by": 4102444799,
|
||||
"issued_at": 1595489219,
|
||||
"paid_at": null,
|
||||
"cancelled_at": null,
|
||||
"expired_at": null,
|
||||
"sms_status": "pending",
|
||||
"email_status": "pending",
|
||||
"date": 1595489219,
|
||||
"terms": null,
|
||||
"partial_payment": false,
|
||||
"gross_amount": 100,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"amount": 100,
|
||||
"amount_paid": 0,
|
||||
"amount_due": 100,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"description": "Registration Link for Gaurav Kumar",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"comment": null,
|
||||
"short_url": "https://rzp.io/i/ak1WxDB",
|
||||
"view_less": true,
|
||||
"billing_start": null,
|
||||
"billing_end": null,
|
||||
"type": "link",
|
||||
"group_taxes_discounts": false,
|
||||
"created_at": 1595489219,
|
||||
"idempotency_key": null
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Send/Resend notifications
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->notifyBy($medium);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be notified |
|
||||
| medium* | string | `sms`/`email`, Medium through which notification should be sent. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"success": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Cancel a registration link
|
||||
|
||||
```php
|
||||
$api->invoice->fetch($invoiceId)->cancel();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| invoiceId* | string | The id of the invoice to be cancelled |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"amount": 100,
|
||||
"amount_due": 100,
|
||||
"amount_paid": 0,
|
||||
"auth_link_status": "cancelled",
|
||||
"billing_end": null,
|
||||
"billing_start": null,
|
||||
"cancelled_at": 1655110334,
|
||||
"comment": null,
|
||||
"created_at": 1655110315,
|
||||
"currency": "INR",
|
||||
"currency_symbol": "₹",
|
||||
"customer_details": {
|
||||
"billing_address": null,
|
||||
"contact": "9123456780",
|
||||
"customer_contact": "9123456780",
|
||||
"customer_email": "gaurav.kumar@example.com",
|
||||
"customer_name": "Gaurav Kumar",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"gstin": null,
|
||||
"id": "cust_DzYEzfJLV03rkp",
|
||||
"name": "Gaurav Kumar",
|
||||
"shipping_address": null
|
||||
},
|
||||
"customer_id": "cust_DzYEzfJLV03rkp",
|
||||
"date": 1655110315,
|
||||
"description": "Registration Link for Gaurav Kumar",
|
||||
"email_status": "sent",
|
||||
"entity": "invoice",
|
||||
"expire_by": 1657699317,
|
||||
"expired_at": null,
|
||||
"first_payment_min_amount": null,
|
||||
"gross_amount": 100,
|
||||
"group_taxes_discounts": false,
|
||||
"id": "inv_Jgv4UErmFzfrA0",
|
||||
"idempotency_key": null,
|
||||
"invoice_number": "Receipt No. #51",
|
||||
"issued_at": 1655110315,
|
||||
"line_items": [],
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"order_id": "order_Jgv4UAyqlixvOB",
|
||||
"paid_at": null,
|
||||
"partial_payment": false,
|
||||
"payment_id": null,
|
||||
"receipt": "Receipt No. #51",
|
||||
"reminder_status": null,
|
||||
"short_url": "https://rzp.io/i/VuAC1WG",
|
||||
"sms_status": "sent",
|
||||
"status": "cancelled",
|
||||
"subscription_status": null,
|
||||
"supply_state_code": null,
|
||||
"tax_amount": 0,
|
||||
"taxable_amount": 0,
|
||||
"terms": null,
|
||||
"type": "link",
|
||||
"user_id": null,
|
||||
"view_less": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch token by payment ID
|
||||
|
||||
```php
|
||||
$api->payment->fetch($paymentId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|------------|--------|-----------------------------------|
|
||||
| paymentId* | string | Id of the payment to be retrieved |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "pay_FHfAzEJ51k8NLj",
|
||||
"entity": "payment",
|
||||
"amount": 100,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": "order_FHfANdTUYeP8lb",
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "upi",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": null,
|
||||
"card_id": null,
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"vpa": "gaurav.kumar@upi",
|
||||
"email": "gaurav.kumar@example.com",
|
||||
"contact": "+919876543210",
|
||||
"customer_id": "cust_DtHaBuooGHTuyZ",
|
||||
"token_id": "token_FHfAzGzREc1ug6",
|
||||
"notes": {
|
||||
"note_key 1": "Beam me up Scotty",
|
||||
"note_key 2": "Tea. Earl Gray. Hot."
|
||||
},
|
||||
"fee": 0,
|
||||
"tax": 0,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"error_source": null,
|
||||
"error_step": null,
|
||||
"error_reason": null,
|
||||
"acquirer_data": {
|
||||
"rrn": "854977234911",
|
||||
"upi_transaction_id": "D0BED5A062ECDB3E9B3A1071C96BB273"
|
||||
},
|
||||
"created_at": 1595447490
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch tokens by customer ID
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->all();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "token_FHfAzGzREc1ug6",
|
||||
"entity": "token",
|
||||
"token": "9KHsdPaCELeQ0t",
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"method": "upi",
|
||||
"vpa": {
|
||||
"username": "gaurav.kumar",
|
||||
"handle": "upi",
|
||||
"name": null
|
||||
},
|
||||
"recurring": true,
|
||||
"recurring_details": {
|
||||
"status": "confirmed",
|
||||
"failure_reason": null
|
||||
},
|
||||
"auth_type": null,
|
||||
"mrn": null,
|
||||
"used_at": 1595447490,
|
||||
"created_at": 1595447490,
|
||||
"start_time": 1595447455,
|
||||
"dcc_enabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete token
|
||||
|
||||
```php
|
||||
$api->customer->fetch($customerId)->tokens()->delete($tokenId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| customerId* | string | The id of the customer to be fetched |
|
||||
| tokenId* | string | The id of the token to be fetched |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"deleted": true
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create an order to charge the customer
|
||||
|
||||
```php
|
||||
$api->order->create(array('amount' => 1000,'currency' => 'INR','payment_capture' => true,'receipt' => 'Receipt No. 1','notes'=> array('notes_key_1' => 'Tea, Earl Grey, Hot', 'notes_key_2' => 'Tea, Earl Grey… decaf.')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| amount* | integer | Amount of the order to be paid |
|
||||
| currency* | string | Currency of the order. Currently only `INR` is supported. |
|
||||
| receipt | string | Your system order reference id. |
|
||||
| notes | array | A key-value pair |
|
||||
| payment_capture | boolean | Indicates whether payment status should be changed to captured automatically or not. Possible values: true - Payments are captured automatically. false - Payments are not captured automatically. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"order_1Aa00000000002",
|
||||
"entity":"order",
|
||||
"amount":1000,
|
||||
"amount_paid":0,
|
||||
"amount_due":1000,
|
||||
"currency":"INR",
|
||||
"receipt":"Receipt No. 1",
|
||||
"offer_id":null,
|
||||
"status":"created",
|
||||
"attempts":0,
|
||||
"notes":{
|
||||
"notes_key_1":"Tea, Earl Grey, Hot",
|
||||
"notes_key_2":"Tea, Earl Grey… decaf."
|
||||
},
|
||||
"created_at":1579782776
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create a recurring payment
|
||||
|
||||
```php
|
||||
$api->payment->createRecurring(array(
|
||||
'email' => 'gaurav.kumar@example.com',
|
||||
'contact' => '9000090000',
|
||||
'amount' => 100,
|
||||
'currency' => 'INR',
|
||||
'order_id' => 'order_1Aa00000000002',
|
||||
'customer_id' => 'cust_1Aa00000000001',
|
||||
'token' => 'token_1Aa00000000001',
|
||||
'recurring' => true,
|
||||
'description' => 'Creating recurring payment for Gaurav Kumar'
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------------|---------|------------------------------------------------------------------------------|
|
||||
| email* | string | The customer's email address. |
|
||||
| contact* | string | The customer's phone number. |
|
||||
| amount* | integer | The amount you want to charge your customer. This should be the same as the amount in the order. |
|
||||
| currency* | string | The 3-letter ISO currency code for the payment. Currently, only `INR` is supported. |
|
||||
| order_id* | string | The unique identifier of the order created. |
|
||||
| customer_id* | string | The `customer_id` for the customer you want to charge. |
|
||||
| token* | string | The `token_id` generated when the customer successfully completes the authorization payment. Different payment instruments for the same customer have different `token_id`.|
|
||||
| recurring* | string | Determines if recurring payment is enabled or not. Possible values:<br>* `true` - Recurring is enabled.* `false` - Recurring is not enabled.|
|
||||
| description | string | A user-entered description for the payment.|
|
||||
| notes | array | Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"razorpay_payment_id" : "pay_1Aa00000000001",
|
||||
"razorpay_order_id" : "order_1Aa00000000001",
|
||||
"razorpay_signature" : "9ef4dffbfd84f1318f6739a3ce19f9d85851857ae648f114332d8401e0949a3d"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/recurring-payments/upi/authorization-transaction/)**
|
||||
509
vendor/razorpay/razorpay/documents/virtualaccount.md
vendored
Normal file
509
vendor/razorpay/razorpay/documents/virtualaccount.md
vendored
Normal file
@ -0,0 +1,509 @@
|
||||
## Virtual account
|
||||
|
||||
### Create a virtual account
|
||||
```php
|
||||
$api->virtualAccount->create(array('receivers' => array('types' => array('bank_account')),'description' => 'Virtual Account created for Raftar Soft','customer_id' => 'cust_CaVDm8eDRSXYME','close_by' => 1681615838,'notes' => array('project_name' => 'Banking Software')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| receivers* | array | Array that defines what receivers are available for this Virtual Account |
|
||||
| description | string | A brief description of the virtual account. |
|
||||
| customer_id | string | Unique identifier of the customer to whom the virtual account must be tagged. |
|
||||
| close_by | integer | UNIX timestamp at which the virtual account is scheduled to be automatically closed. |
|
||||
| notes | integer | Any custom notes you might want to add to the virtual account can be entered here. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"va_DlGmm7jInLudH9",
|
||||
"name":"Acme Corp",
|
||||
"entity":"virtual_account",
|
||||
"status":"active",
|
||||
"description":"Virtual Account created for Raftar Soft",
|
||||
"amount_expected":null,
|
||||
"notes":{
|
||||
"project_name":"Banking Software"
|
||||
},
|
||||
"amount_paid":0,
|
||||
"customer_id":"cust_CaVDm8eDRSXYME",
|
||||
"receivers":[
|
||||
{
|
||||
"id":"ba_DlGmm9mSj8fjRM",
|
||||
"entity":"bank_account",
|
||||
"ifsc":"RATN0VAAPIS",
|
||||
"bank_name": "RBL Bank",
|
||||
"name":"Acme Corp",
|
||||
"notes":[],
|
||||
"account_number":"2223330099089860"
|
||||
}
|
||||
],
|
||||
"close_by":1681615838,
|
||||
"closed_at":null,
|
||||
"created_at":1574837626
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create a virtual account with TPV
|
||||
```php
|
||||
$api->virtualAccount->create(array('receivers' => array('types'=> array('bank_account')),'allowed_payers' => array(array('type'=>'bank_account','bank_account'=>array('ifsc'=>'RATN0VAAPIS','account_number'=>'2223330027558515'))),'description' => 'Virtual Account created for Raftar Soft','customer_id' => 'cust_HssUOFiOd2b1TJ', 'notes' => array('project_name' => 'Banking Software')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| receivers* | array | Array that defines what receivers are available for this Virtual Account |
|
||||
| allowed_payers* | array | All parameters listed [here](https://razorpay.com/docs/api/smart-collect-tpv/#create-virtual-account) are supported
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"va_DlGmm7jInLudH9",
|
||||
"name":"Acme Corp",
|
||||
"entity":"virtual_account",
|
||||
"status":"active",
|
||||
"description":"Virtual Account created for Raftar Soft",
|
||||
"amount_expected":null,
|
||||
"notes":{
|
||||
"project_name":"Banking Software"
|
||||
},
|
||||
"amount_paid":0,
|
||||
"customer_id":"cust_CaVDm8eDRSXYME",
|
||||
"receivers":[
|
||||
{
|
||||
"id":"ba_DlGmm9mSj8fjRM",
|
||||
"entity":"bank_account",
|
||||
"ifsc":"RATN0VAAPIS",
|
||||
"bank_name": "RBL Bank",
|
||||
"name":"Acme Corp",
|
||||
"notes":[],
|
||||
"account_number":"2223330099089860"
|
||||
}
|
||||
],
|
||||
"allowed_payers": [
|
||||
{
|
||||
"type": "bank_account",
|
||||
"id":"ba_DlGmm9mSj8fjRM",
|
||||
"bank_account": {
|
||||
"ifsc": "UTIB0000013",
|
||||
"account_number": "914010012345679"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "bank_account",
|
||||
"id":"ba_Cmtnm5tSj6agUW",
|
||||
"bank_account": {
|
||||
"ifsc": "UTIB0000014",
|
||||
"account_number": "914010012345680"
|
||||
}
|
||||
}
|
||||
],
|
||||
"close_by":1681615838,
|
||||
"closed_at":null,
|
||||
"created_at":1574837626
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Create static/dynamic qr
|
||||
```php
|
||||
$api->virtualAccount->create(array('receivers' => array('types' => array('qr_code')), 'description' => 'First QR code','customer_id'=> 'cust_IOyIY3JvbVny9o', 'amount_expected' => 100, 'notes' => array('receiver_key' => 'receiver_value')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| receivers* | array | Array that defines what receivers are available for this Virtual Account |
|
||||
| description | string | A brief description of the payment. |
|
||||
| amount_expected | integer | The maximum amount you expect to receive in this virtual account. Pass `69999` for ₹699.99. |
|
||||
| customer_id | string | Unique identifier of the customer to whom the virtual account must be tagged. |
|
||||
| notes | object | All keys listed [here](https://razorpay.com/docs/payments/payments/payment-methods/bharatqr/api/#create) are supported |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "va_4xbQrmEoA5WJ0G",
|
||||
"name": "Acme Corp",
|
||||
"entity": "virtual_account",
|
||||
"status": "active",
|
||||
"description": "First Payment by BharatQR",
|
||||
"amount_expected": null,
|
||||
"notes": {
|
||||
"reference_key": "reference_value"
|
||||
},
|
||||
"amount_paid": 0,
|
||||
"customer_id": "cust_805c8oBQdBGPwS",
|
||||
"receivers": [
|
||||
{
|
||||
"id": "qr_4lsdkfldlteskf",
|
||||
"entity": "qr_code",
|
||||
"reference": "AgdeP8aBgZGckl",
|
||||
"short_url": "https://rzp.io/i/PLs03pOc"
|
||||
}
|
||||
],
|
||||
"close_by": null,
|
||||
"closed_at": null,
|
||||
"created_at": 1607938184
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch virtual account by id
|
||||
```php
|
||||
$api->virtualAccount->fetch($virtualId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| virtualId* | string | The id of the virtual to be updated |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "va_JccTXwXA6UG4Gi",
|
||||
"name": "ankit",
|
||||
"entity": "virtual_account",
|
||||
"status": "active",
|
||||
"description": null,
|
||||
"amount_expected": null,
|
||||
"notes": [],
|
||||
"amount_paid": 0,
|
||||
"customer_id": null,
|
||||
"receivers": [
|
||||
{
|
||||
"id": "ba_JccTY5ZkO3ZGHQ",
|
||||
"entity": "bank_account",
|
||||
"ifsc": "RAZR0000001",
|
||||
"bank_name": null,
|
||||
"name": "ankit",
|
||||
"notes": [],
|
||||
"account_number": "1112220057339365"
|
||||
}
|
||||
],
|
||||
"close_by": null,
|
||||
"closed_at": null,
|
||||
"created_at": 1654171468
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all virtual account
|
||||
```php
|
||||
$api->virtualAccount->all($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| from | timestamp | timestamp after which the payments were created |
|
||||
| to | timestamp | timestamp before which the payments were created |
|
||||
| count | integer | number of virtual accounts to fetch (default: 10) |
|
||||
| skip | integer | number of virtual accounts to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "va_Di5gbNptcWV8fQ",
|
||||
"name": "Acme Corp",
|
||||
"entity": "virtual_account",
|
||||
"status": "closed",
|
||||
"description": "Virtual Account created for M/S ABC Exports",
|
||||
"amount_expected": 2300,
|
||||
"notes": {
|
||||
"material": "teakwood"
|
||||
},
|
||||
"amount_paid": 239000,
|
||||
"customer_id": "cust_DOMUFFiGdCaCUJ",
|
||||
"receivers": [
|
||||
{
|
||||
"id": "ba_Di5gbQsGn0QSz3",
|
||||
"entity": "bank_account",
|
||||
"ifsc": "RATN0VAAPIS",
|
||||
"bank_name": "RBL Bank",
|
||||
"name": "Acme Corp",
|
||||
"notes": [],
|
||||
"account_number": "1112220061746877"
|
||||
}
|
||||
],
|
||||
"close_by": 1574427237,
|
||||
"closed_at": 1574164078,
|
||||
"created_at": 1574143517
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch payments for a virtual account
|
||||
```php
|
||||
$api->virtualAccount->fetch($virtualId)->payments($options);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| virtualId* | string | The id of the virtual to be updated |
|
||||
| from | timestamp | timestamp after which the payments were created |
|
||||
| to | timestamp | timestamp before which the payments were created |
|
||||
| count | integer | number of virtual accounts to fetch (default: 10) |
|
||||
| skip | integer | number of virtual accounts to be skipped (default: 0) |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"entity": "collection",
|
||||
"count": 1,
|
||||
"items": [
|
||||
{
|
||||
"id": "pay_Di5iqCqA1WEHq6",
|
||||
"entity": "payment",
|
||||
"amount": 239000,
|
||||
"currency": "INR",
|
||||
"status": "captured",
|
||||
"order_id": null,
|
||||
"invoice_id": null,
|
||||
"international": false,
|
||||
"method": "bank_transfer",
|
||||
"amount_refunded": 0,
|
||||
"refund_status": null,
|
||||
"captured": true,
|
||||
"description": "",
|
||||
"card_id": null,
|
||||
"bank": null,
|
||||
"wallet": null,
|
||||
"vpa": null,
|
||||
"email": "saurav.kumar@example.com",
|
||||
"contact": "+919972139994",
|
||||
"customer_id": "cust_DOMUFFiGdCaCUJ",
|
||||
"notes": [],
|
||||
"fee": 2820,
|
||||
"tax": 430,
|
||||
"error_code": null,
|
||||
"error_description": null,
|
||||
"created_at": 1574143644
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch payment details using id and transfer method
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->bankTransfer();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be updated |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "bt_Di5iqCElVyRlCb",
|
||||
"entity": "bank_transfer",
|
||||
"payment_id": "pay_Di5iqCqA1WEHq6",
|
||||
"mode": "NEFT",
|
||||
"bank_reference": "157414364471",
|
||||
"amount": 239000,
|
||||
"payer_bank_account": {
|
||||
"id": "ba_Di5iqSxtYrTzPU",
|
||||
"entity": "bank_account",
|
||||
"ifsc": "UTIB0003198",
|
||||
"bank_name": "Axis Bank",
|
||||
"name": "Acme Corp",
|
||||
"notes": [],
|
||||
"account_number": "765432123456789"
|
||||
},
|
||||
"virtual_account_id": "va_Di5gbNptcWV8fQ",
|
||||
"virtual_account": {
|
||||
"id": "va_Di5gbNptcWV8fQ",
|
||||
"name": "Acme Corp",
|
||||
"entity": "virtual_account",
|
||||
"status": "closed",
|
||||
"description": "Virtual Account created for M/S ABC Exports",
|
||||
"amount_expected": 2300,
|
||||
"notes": {
|
||||
"material": "teakwood"
|
||||
},
|
||||
"amount_paid": 239000,
|
||||
"customer_id": "cust_DOMUFFiGdCaCUJ",
|
||||
"receivers": [
|
||||
{
|
||||
"id": "ba_Di5gbQsGn0QSz3",
|
||||
"entity": "bank_account",
|
||||
"ifsc": "RATN0VAAPIS",
|
||||
"bank_name": "RBL Bank",
|
||||
"name": "Acme Corp",
|
||||
"notes": [],
|
||||
"account_number": "1112220061746877"
|
||||
}
|
||||
],
|
||||
"close_by": 1574427237,
|
||||
"closed_at": 1574164078,
|
||||
"created_at": 1574143517
|
||||
}
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Refund payments made to a virtual account
|
||||
```php
|
||||
$api->payment->fetch($paymentId)->refunds();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| paymentId* | string | The id of the payment to be updated |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "rfnd_FP8QHiV938haTz",
|
||||
"entity": "refund",
|
||||
"amount": 500100,
|
||||
"receipt": "Receipt No. 31",
|
||||
"currency": "INR",
|
||||
"payment_id": "pay_FCXKPFtYfPXJPy",
|
||||
"notes": []
|
||||
"receipt": null,
|
||||
"acquirer_data": {
|
||||
"arn": null
|
||||
},
|
||||
"created_at": 1597078866,
|
||||
"batch_id": null,
|
||||
"status": "processed",
|
||||
"speed_processed": "normal",
|
||||
"speed_requested": "normal"
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Add receiver to an existing virtual account
|
||||
```php
|
||||
$api->virtualAccount->fetch($virtualId)->addReceiver(array('types' => array('vpa'),'vpa' => array('descriptor'=>'gauravkumar')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| virtualId* | string | The id of the virtual to be updated |
|
||||
| types* | array | The receiver type to be added to the virtual account. Possible values are `vpa` or `bank_account` |
|
||||
| vpa["descriptor"] | string | This is a unique identifier provided by you to identify the customer. For example, `gaurikumar` and `akashkumar` are the descriptors |
|
||||
|
||||
**Response:**
|
||||
For add receiver to an existing virtual account response please click [here](https://razorpay.com/docs/api/smart-collect/#add-receiver-to-an-existing-virtual-account)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Add an Allowed Payer Account
|
||||
```php
|
||||
$api->virtualAccount->fetch($virtualId)->addAllowedPayer(array('type' => 'bank_account','bank_account' => array('ifsc'=>'UTIB0000013','account_number'=>'914010012345679')));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| virtualId* | string | The id of the virtual to be updated |
|
||||
| type* | string | Possible value is `bank_account` |
|
||||
| bank_account* | array | Indicates the bank account details such as `ifsc` and `account_number` |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id":"va_DlGmm7jInLudH9",
|
||||
"name":"Acme Corp",
|
||||
"entity":"virtual_account",
|
||||
"status":"active",
|
||||
"description":"Virtual Account created for Raftar Soft",
|
||||
"amount_expected":null,
|
||||
"notes":{
|
||||
"project_name":"Banking Software"
|
||||
},
|
||||
"amount_paid":0,
|
||||
"customer_id":"cust_CaVDm8eDRSXYME",
|
||||
"receivers":[
|
||||
{
|
||||
"id":"ba_DlGmm9mSj8fjRM",
|
||||
"entity":"bank_account",
|
||||
"ifsc":"RATN0VAAPIS",
|
||||
"bank_name": "RBL Bank",
|
||||
"name":"Acme Corp",
|
||||
"notes":[],
|
||||
"account_number":"2223330099089860"
|
||||
}
|
||||
],
|
||||
"allowed_payers": [
|
||||
{
|
||||
"type": "bank_account",
|
||||
"id":"ba_DlGmm9mSj8fjRM",
|
||||
"bank_account": {
|
||||
"ifsc": "UTIB0000013",
|
||||
"account_number": "914010012345679"
|
||||
}
|
||||
}
|
||||
],
|
||||
"close_by":1681615838,
|
||||
"closed_at":null,
|
||||
"created_at":1574837626
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete an Allowed Payer Account
|
||||
```php
|
||||
$api->virtualAccount->fetch($virtualId)->deleteAllowedPayer($allowedPayersId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| virtualId* | string | The id of the virtual to be updated |
|
||||
| allowedPayersId* | string | The id of the allowed payers to be updated |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
null
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
### Close virtual account
|
||||
```php
|
||||
$api->virtualAccount->fetch($virtualId)->close();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------|-----------|--------------------------------------------------|
|
||||
| virtualId* | string | The id of the virtual to be updated |
|
||||
|
||||
**Response:**
|
||||
For close virtual account response please click [here](https://razorpay.com/docs/api/smart-collect/#close-a-virtual-account)
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/smart-collect/api/)**
|
||||
223
vendor/razorpay/razorpay/documents/webhook.md
vendored
Normal file
223
vendor/razorpay/razorpay/documents/webhook.md
vendored
Normal file
@ -0,0 +1,223 @@
|
||||
## Webhook
|
||||
|
||||
### Create a Webhook
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$api->account->fetch($accountId)->webhooks()->create(array(
|
||||
"url" => "https://google.com",
|
||||
"alert_email" => "gaurav.kumar@example.com",
|
||||
"secret" => "12345",
|
||||
"events" => array(
|
||||
"payment.authorized",
|
||||
"payment.failed",
|
||||
"payment.captured",
|
||||
"payment.dispute.created",
|
||||
"refund.failed",
|
||||
"refund.created"
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
| url* | string | The URL where you receive the webhook payload when an event is triggered. The maximum length is 255 characters. |
|
||||
| alert_email | string | This is the email address to which notifications must be sent in case of webhook failure. |
|
||||
| secret | string | A secret for the webhook endpoint that is used to validate that the webhook is from Razorpay. |
|
||||
| events | string | The required events from the list of Active Events. For example `payment.authorized`, `payment.captured`, `payment.failed`, `payment.dispute.created`, `refund.failed`, `refund.created` and so on. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "JebiXkKGYwua5L",
|
||||
"created_at": 1654605478,
|
||||
"updated_at": 1654605478,
|
||||
"service": "beta-api-live",
|
||||
"owner_id": "JOGUdtKu3dB03d",
|
||||
"owner_type": "merchant",
|
||||
"context": [],
|
||||
"disabled_at": 0,
|
||||
"url": "https://google.com",
|
||||
"alert_email": "gaurav.kumar@example.com",
|
||||
"secret_exists": true,
|
||||
"entity": "webhook",
|
||||
"active": true,
|
||||
"events": [
|
||||
"payment.authorized",
|
||||
"payment.failed",
|
||||
"payment.captured",
|
||||
"payment.dispute.created",
|
||||
"refund.failed",
|
||||
"refund.created"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Edit Webhook
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$webhookId = "HK890egfiItP3H";
|
||||
|
||||
$api->account->fetch($accountId)->webhooks()->edit($webhookId, array(
|
||||
"url" => "https://www.linkedin.com",
|
||||
"events" => array(
|
||||
"refund.created"
|
||||
)
|
||||
));
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
| webhookId* | string | The unique identifier of the webhook whose details are to be updated |
|
||||
| url | string | The URL where you receive the webhook payload when an event is triggered. The maximum length is 255 characters. |
|
||||
| events | string | The required events from the list of Active Events. For example `payment.authorized`, `payment.captured`, `payment.failed`, `payment.dispute.created`, `refund.failed`, `refund.created` and so on. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "HK890egfiItP3H",
|
||||
"created_at": 1623060358,
|
||||
"updated_at": 1623067148,
|
||||
"service": "beta-api-test",
|
||||
"owner_id": "H3kYHQ635sBwXG",
|
||||
"owner_type": "merchant",
|
||||
"context": [],
|
||||
"disabled_at": 0,
|
||||
"url": "https://www.linkedin.com",
|
||||
"alert_email": "gaurav.kumar@example.com",
|
||||
"secret_exists": true,
|
||||
"entity": "webhook",
|
||||
"active": true,
|
||||
"events": [
|
||||
"refund.created"
|
||||
]
|
||||
}
|
||||
```
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Delete an account
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$webhookId = "HK890egfiItP3H";
|
||||
|
||||
$api->account->fetch($accountId)->webhooks()->delete($webhookId);
|
||||
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account that must be deleted. |
|
||||
| webhookId* | string | The unique identifier of the webhook whose details are to be updated |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
[]
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch a webhook
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$webhookId = "HK890egfiItP3H";
|
||||
|
||||
$api->account->fetch($accountId)->webhooks()->fetch($webhookId);
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
| webhookId* | string | The unique identifier of the webhook whose details are to be updated |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "HK890egfiItP3H",
|
||||
"created_at": 1623060358,
|
||||
"updated_at": 1623060358,
|
||||
"owner_id": "H3kYHQ635sBwXG",
|
||||
"owner_type": "merchant",
|
||||
"context": [],
|
||||
"disabled_at": 0,
|
||||
"url": "https://en1mwkqo5ioct.x.pipedream.net",
|
||||
"alert_email": "gaurav.kumar@example.com",
|
||||
"secret_exists": true,
|
||||
"entity": "webhook",
|
||||
"active": true,
|
||||
"events": [
|
||||
"payment.authorized",
|
||||
"payment.failed",
|
||||
"payment.captured",
|
||||
"payment.dispute.created",
|
||||
"refund.failed",
|
||||
"refund.created"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
### Fetch all Webhooks
|
||||
```php
|
||||
$accountId = "acc_GP4lfNA0iIMn5B";
|
||||
|
||||
$api->account->fetch($accountId)->webhooks()->all();
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|-------------|---------------------------------------------|
|
||||
| accountId* | string | The unique identifier of a sub-merchant account generated by Razorpay. |
|
||||
| from | integer | Timestamp, in seconds, from when the webhooks are to be fetched. |
|
||||
| to | integer | Timestamp, in seconds, till when the webhooks are to be fetched. |
|
||||
| count | integer | Number of webhooks to be fetched. The default value is `10` and the maximum value is `100`. This can be used for pagination, in combination with `skip`. |
|
||||
| skip | integer | Number of records to be skipped while fetching the webhooks. This can be used for pagination, in combination with `count`. |
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"id": "HK890egfiItP3H",
|
||||
"created_at": 1623060358,
|
||||
"updated_at": 1623060358,
|
||||
"owner_id": "H3kYHQ635sBwXG",
|
||||
"owner_type": "merchant",
|
||||
"context": [],
|
||||
"disabled_at": 0,
|
||||
"url": "https://en1mwkqo5ioct.x.pipedream.net",
|
||||
"alert_email": "gaurav.kumar@example.com",
|
||||
"secret_exists": true,
|
||||
"entity": "webhook",
|
||||
"active": true,
|
||||
"events": [
|
||||
"payment.authorized",
|
||||
"payment.failed",
|
||||
"payment.captured",
|
||||
"payment.dispute.created",
|
||||
"refund.failed",
|
||||
"refund.created"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
**PN: * indicates mandatory fields**
|
||||
<br>
|
||||
<br>
|
||||
**For reference click [here](https://razorpay.com/docs/api/partners/webhooks)**
|
||||
15
vendor/razorpay/razorpay/libs/Requests-2.0.4/.editorconfig
vendored
Normal file
15
vendor/razorpay/razorpay/libs/Requests-2.0.4/.editorconfig
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = tab
|
||||
|
||||
[{*.json,*.yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
1002
vendor/razorpay/razorpay/libs/Requests-2.0.4/CHANGELOG.md
vendored
Normal file
1002
vendor/razorpay/razorpay/libs/Requests-2.0.4/CHANGELOG.md
vendored
Normal file
File diff suppressed because it is too large
Load Diff
49
vendor/razorpay/razorpay/libs/Requests-2.0.4/LICENSE
vendored
Normal file
49
vendor/razorpay/razorpay/libs/Requests-2.0.4/LICENSE
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
Requests
|
||||
========
|
||||
|
||||
Copyright (c) 2010-2012 Ryan McCue and contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
ComplexPie IRI Parser
|
||||
=====================
|
||||
|
||||
Copyright (c) 2007-2010, Geoffrey Sneddon and Steve Minutillo.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the SimplePie Team nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
168
vendor/razorpay/razorpay/libs/Requests-2.0.4/README.md
vendored
Normal file
168
vendor/razorpay/razorpay/libs/Requests-2.0.4/README.md
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
Requests for PHP
|
||||
================
|
||||
|
||||
[](https://github.com/WordPress/Requests/actions/workflows/cs.yml)
|
||||
[](https://github.com/WordPress/Requests/actions/workflows/lint.yml)
|
||||
[](https://github.com/WordPress/Requests/actions/workflows/test.yml)
|
||||
[](https://codecov.io/gh/WordPress/Requests?branch=stable)
|
||||
|
||||
Requests is a HTTP library written in PHP, for human beings. It is roughly
|
||||
based on the API from the excellent [Requests Python
|
||||
library](http://python-requests.org/). Requests is [ISC
|
||||
Licensed](https://github.com/WordPress/Requests/blob/stable/LICENSE) (similar to
|
||||
the new BSD license) and has no dependencies, except for PHP 5.6+.
|
||||
|
||||
Despite PHP's use as a language for the web, its tools for sending HTTP requests
|
||||
are severely lacking. cURL has an
|
||||
[interesting API](https://www.php.net/curl-setopt), to say the
|
||||
least, and you can't always rely on it being available. Sockets provide only low
|
||||
level access, and require you to build most of the HTTP response parsing
|
||||
yourself.
|
||||
|
||||
We all have better things to do. That's why Requests was born.
|
||||
|
||||
```php
|
||||
$headers = array('Accept' => 'application/json');
|
||||
$options = array('auth' => array('user', 'pass'));
|
||||
$request = WpOrg\Requests\Requests::get('https://api.github.com/gists', $headers, $options);
|
||||
|
||||
var_dump($request->status_code);
|
||||
// int(200)
|
||||
|
||||
var_dump($request->headers['content-type']);
|
||||
// string(31) "application/json; charset=utf-8"
|
||||
|
||||
var_dump($request->body);
|
||||
// string(26891) "[...]"
|
||||
```
|
||||
|
||||
Requests allows you to send **HEAD**, **GET**, **POST**, **PUT**, **DELETE**,
|
||||
and **PATCH** HTTP requests. You can add headers, form data, multipart files,
|
||||
and parameters with basic arrays, and access the response data in the same way.
|
||||
Requests uses cURL and fsockopen, depending on what your system has available,
|
||||
but abstracts all the nasty stuff out of your way, providing a consistent API.
|
||||
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
- International Domains and URLs
|
||||
- Browser-style SSL Verification
|
||||
- Basic/Digest Authentication
|
||||
- Automatic Decompression
|
||||
- Connection Timeouts
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
### Install with Composer
|
||||
If you're using [Composer](https://getcomposer.org/) to manage
|
||||
dependencies, you can add Requests with it.
|
||||
|
||||
```sh
|
||||
composer require rmccue/requests
|
||||
```
|
||||
|
||||
or
|
||||
```json
|
||||
{
|
||||
"require": {
|
||||
"rmccue/requests": "^2.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Install source from GitHub
|
||||
To install the source code:
|
||||
```bash
|
||||
$ git clone git://github.com/WordPress/Requests.git
|
||||
```
|
||||
|
||||
Next, include the autoloader in your scripts:
|
||||
```php
|
||||
require_once '/path/to/Requests/src/Autoload.php';
|
||||
```
|
||||
|
||||
You'll probably also want to register the autoloader:
|
||||
```php
|
||||
WpOrg\Requests\Autoload::register();
|
||||
```
|
||||
|
||||
### Install source from zip/tarball
|
||||
Alternatively, you can fetch a [tarball][] or [zipball][]:
|
||||
|
||||
```bash
|
||||
$ curl -L https://github.com/WordPress/Requests/tarball/stable | tar xzv
|
||||
(or)
|
||||
$ wget https://github.com/WordPress/Requests/tarball/stable -O - | tar xzv
|
||||
```
|
||||
|
||||
[tarball]: https://github.com/WordPress/Requests/tarball/stable
|
||||
[zipball]: https://github.com/WordPress/Requests/zipball/stable
|
||||
|
||||
|
||||
### Using a Class Loader
|
||||
If you're using a class loader (e.g., [Symfony Class Loader][]) for
|
||||
[PSR-4][]-style class loading:
|
||||
```php
|
||||
$loader = new Psr4ClassLoader();
|
||||
$loader->addPrefix('WpOrg\\Requests\\', 'path/to/vendor/Requests/src');
|
||||
$loader->register();
|
||||
```
|
||||
|
||||
[Symfony Class Loader]: https://github.com/symfony/ClassLoader
|
||||
[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4.md
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
The best place to start is our [prose-based documentation][], which will guide
|
||||
you through using Requests.
|
||||
|
||||
After that, take a look at [the documentation for
|
||||
`\WpOrg\Requests\Requests::request()`][request_method], where all the parameters are fully
|
||||
documented.
|
||||
|
||||
Requests is [100% documented with PHPDoc](https://requests.ryanmccue.info/api-2.x/).
|
||||
If you find any problems with it, [create a new
|
||||
issue](https://github.com/WordPress/Requests/issues/new)!
|
||||
|
||||
[prose-based documentation]: https://github.com/WordPress/Requests/blob/stable/docs/README.md
|
||||
[request_method]: https://requests.ryanmccue.info/api-2.x/classes/WpOrg-Requests-Requests.html#method_request
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
Requests strives to have 100% code-coverage of the library with an extensive
|
||||
set of tests. We're not quite there yet, but [we're getting close][codecov].
|
||||
|
||||
[codecov]: https://codecov.io/github/WordPress/Requests/
|
||||
|
||||
To run the test suite, first check that you have the [PHP
|
||||
JSON extension ](https://www.php.net/book.json) enabled. Then
|
||||
simply:
|
||||
```bash
|
||||
$ phpunit
|
||||
```
|
||||
|
||||
If you'd like to run a single set of tests, specify just the name:
|
||||
```bash
|
||||
$ phpunit Transport/cURL
|
||||
```
|
||||
|
||||
Contribute
|
||||
----------
|
||||
|
||||
1. Check for open issues or open a new issue for a feature request or a bug.
|
||||
2. Fork [the repository][] on Github to start making your changes to the
|
||||
`develop` branch (or branch off of it).
|
||||
3. Write one or more tests which show that the bug was fixed or that the feature works as expected.
|
||||
4. Send in a pull request.
|
||||
|
||||
If you have questions while working on your contribution and you use Slack, there is
|
||||
a [#core-http-api] channel available in the [WordPress Slack] in which contributions can be discussed.
|
||||
|
||||
[the repository]: https://github.com/WordPress/Requests
|
||||
[#core-http-api]: https://wordpress.slack.com/archives/C02BBE29V42
|
||||
[WordPress Slack]: https://make.wordpress.org/chat/
|
||||
3460
vendor/razorpay/razorpay/libs/Requests-2.0.4/certificates/cacert.pem
vendored
Normal file
3460
vendor/razorpay/razorpay/libs/Requests-2.0.4/certificates/cacert.pem
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
vendor/razorpay/razorpay/libs/Requests-2.0.4/certificates/cacert.pem.sha256
vendored
Normal file
1
vendor/razorpay/razorpay/libs/Requests-2.0.4/certificates/cacert.pem.sha256
vendored
Normal file
@ -0,0 +1 @@
|
||||
6ed95025fba2aef0ce7b647607225745624497f876d74ef6ec22b26e73e9de77 cacert.pem
|
||||
88
vendor/razorpay/razorpay/libs/Requests-2.0.4/composer.json
vendored
Normal file
88
vendor/razorpay/razorpay/libs/Requests-2.0.4/composer.json
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
{
|
||||
"name": "rmccue/requests",
|
||||
"description": "A HTTP library written in PHP, for human beings.",
|
||||
"homepage": "https://requests.ryanmccue.info/",
|
||||
"license": "ISC",
|
||||
"type": "library",
|
||||
"keywords": [
|
||||
"http",
|
||||
"idna",
|
||||
"iri",
|
||||
"ipv6",
|
||||
"curl",
|
||||
"sockets",
|
||||
"fsockopen"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ryan McCue",
|
||||
"homepage": "https://rmccue.io/"
|
||||
},
|
||||
{
|
||||
"name": "Alain Schlesser",
|
||||
"homepage": "https://github.com/schlessera"
|
||||
},
|
||||
{
|
||||
"name": "Juliette Reinders Folmer",
|
||||
"homepage": "https://github.com/jrfnl"
|
||||
},
|
||||
{
|
||||
"name": "Contributors",
|
||||
"homepage": "https://github.com/WordPress/Requests/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/WordPress/Requests/issues",
|
||||
"source": "https://github.com/WordPress/Requests",
|
||||
"docs": "https://requests.ryanmccue.info/"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"ext-json": "*"
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"requests/test-server": "dev-main",
|
||||
"squizlabs/php_codesniffer": "^3.6",
|
||||
"phpcompatibility/php-compatibility": "^9.0",
|
||||
"wp-coding-standards/wpcs": "^2.0",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.3.1",
|
||||
"php-parallel-lint/php-console-highlighter": "^0.5.0",
|
||||
"yoast/phpunit-polyfills": "^1.0.0",
|
||||
"roave/security-advisories": "dev-latest"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"WpOrg\\Requests\\": "src/"
|
||||
},
|
||||
"classmap": ["library/Requests.php"],
|
||||
"files": ["library/Deprecated.php"]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"WpOrg\\Requests\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"lint": [
|
||||
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git"
|
||||
],
|
||||
"checkcs": [
|
||||
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs"
|
||||
],
|
||||
"fixcs": [
|
||||
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf"
|
||||
],
|
||||
"test": [
|
||||
"@php ./vendor/phpunit/phpunit/phpunit --no-coverage"
|
||||
],
|
||||
"coverage": [
|
||||
"@php ./vendor/phpunit/phpunit/phpunit"
|
||||
]
|
||||
}
|
||||
}
|
||||
19
vendor/razorpay/razorpay/libs/Requests-2.0.4/library/Deprecated.php
vendored
Normal file
19
vendor/razorpay/razorpay/libs/Requests-2.0.4/library/Deprecated.php
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Backwards compatibility layer for Requests.
|
||||
*
|
||||
* Allows for Composer to autoload the old PSR-0 classes via the custom autoloader.
|
||||
* This prevents issues with _extending final classes_ (which was the previous solution).
|
||||
*
|
||||
* Please see the Changelog for the 2.0.0 release for upgrade notes.
|
||||
*
|
||||
* @package Requests
|
||||
*
|
||||
* @deprecated 2.0.0 Use the PSR-4 class names instead.
|
||||
*/
|
||||
|
||||
if (class_exists('WpOrg\Requests\Autoload') === false) {
|
||||
require_once dirname(__DIR__) . '/src/Autoload.php'; // nosemgrep : https://semgrep.dev/s/e5El
|
||||
}
|
||||
|
||||
WpOrg\Requests\Autoload::register();
|
||||
6
vendor/razorpay/razorpay/libs/Requests-2.0.4/library/README.md
vendored
Normal file
6
vendor/razorpay/razorpay/libs/Requests-2.0.4/library/README.md
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
## The Library directory is deprecated.
|
||||
|
||||
The files in this directory are only still in place to provide backward compatibility with Requests 1.x.
|
||||
Please see the release notes of Requests 2.0.0 on how to upgrade.
|
||||
|
||||
This directory will be removed in Requests v 4.0.0.
|
||||
78
vendor/razorpay/razorpay/libs/Requests-2.0.4/library/Requests.php
vendored
Normal file
78
vendor/razorpay/razorpay/libs/Requests-2.0.4/library/Requests.php
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Requests for PHP
|
||||
*
|
||||
* Inspired by Requests for Python.
|
||||
*
|
||||
* Based on concepts from SimplePie_File, RequestCore and WP_Http.
|
||||
*
|
||||
* @package Requests
|
||||
*
|
||||
* @deprecated 2.0.0
|
||||
*/
|
||||
|
||||
/*
|
||||
* Integrators who cannot yet upgrade to the PSR-4 class names can silence deprecations
|
||||
* by defining a `REQUESTS_SILENCE_PSR0_DEPRECATIONS` constant and setting it to `true`.
|
||||
* The constant needs to be defined before this class is required.
|
||||
*/
|
||||
if (!defined('REQUESTS_SILENCE_PSR0_DEPRECATIONS') || REQUESTS_SILENCE_PSR0_DEPRECATIONS !== true) {
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
|
||||
trigger_error(
|
||||
'The PSR-0 `Requests_...` class names in the Request library are deprecated.'
|
||||
. ' Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
|
||||
// Prevent the deprecation notice from being thrown twice.
|
||||
if (!defined('REQUESTS_SILENCE_PSR0_DEPRECATIONS')) {
|
||||
define('REQUESTS_SILENCE_PSR0_DEPRECATIONS', true);
|
||||
}
|
||||
}
|
||||
|
||||
require_once dirname(__DIR__) . '/src/Requests.php'; // nosemgrep : https://semgrep.dev/s/e5El
|
||||
|
||||
/**
|
||||
* Requests for PHP
|
||||
*
|
||||
* Inspired by Requests for Python.
|
||||
*
|
||||
* Based on concepts from SimplePie_File, RequestCore and WP_Http.
|
||||
*
|
||||
* @package Requests
|
||||
*
|
||||
* @deprecated 2.0.0 Use `WpOrg\Requests\Requests` instead for the actual functionality and
|
||||
* use `WpOrg\Requests\Autoload` for the autoloading.
|
||||
*/
|
||||
class Requests extends WpOrg\Requests\Requests {
|
||||
|
||||
/**
|
||||
* Deprecated autoloader for Requests.
|
||||
*
|
||||
* @deprecated 2.0.0 Use the `WpOrg\Requests\Autoload::load()` method instead.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $class Class name to load
|
||||
*/
|
||||
public static function autoloader($class) {
|
||||
if (class_exists('WpOrg\Requests\Autoload') === false) {
|
||||
require_once dirname(__DIR__) . '/src/Autoload.php'; // nosemgrep : https://semgrep.dev/s/e5El
|
||||
}
|
||||
|
||||
return WpOrg\Requests\Autoload::load($class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the built-in autoloader
|
||||
*
|
||||
* @deprecated 2.0.0 Include the `WpOrg\Requests\Autoload` class and
|
||||
* call `WpOrg\Requests\Autoload::register()` instead.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public static function register_autoloader() {
|
||||
require_once dirname(__DIR__) . '/src/Autoload.php'; // nosemgrep : https://semgrep.dev/s/e5El
|
||||
WpOrg\Requests\Autoload::register();
|
||||
}
|
||||
}
|
||||
36
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Auth.php
vendored
Normal file
36
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Auth.php
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Authentication provider interface
|
||||
*
|
||||
* @package Requests\Authentication
|
||||
*/
|
||||
|
||||
namespace WpOrg\Requests;
|
||||
|
||||
use WpOrg\Requests\Hooks;
|
||||
|
||||
/**
|
||||
* Authentication provider interface
|
||||
*
|
||||
* Implement this interface to act as an authentication provider.
|
||||
*
|
||||
* Parameters should be passed via the constructor where possible, as this
|
||||
* makes it much easier for users to use your provider.
|
||||
*
|
||||
* @see \WpOrg\Requests\Hooks
|
||||
*
|
||||
* @package Requests\Authentication
|
||||
*/
|
||||
interface Auth {
|
||||
/**
|
||||
* Register hooks as needed
|
||||
*
|
||||
* This method is called in {@see \WpOrg\Requests\Requests::request()} when the user
|
||||
* has set an instance as the 'auth' option. Use this callback to register all the
|
||||
* hooks you'll need.
|
||||
*
|
||||
* @see \WpOrg\Requests\Hooks::register()
|
||||
* @param \WpOrg\Requests\Hooks $hooks Hook system
|
||||
*/
|
||||
public function register(Hooks $hooks);
|
||||
}
|
||||
103
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Auth/Basic.php
vendored
Normal file
103
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Auth/Basic.php
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* Basic Authentication provider
|
||||
*
|
||||
* @package Requests\Authentication
|
||||
*/
|
||||
|
||||
namespace WpOrg\Requests\Auth;
|
||||
|
||||
use WpOrg\Requests\Auth;
|
||||
use WpOrg\Requests\Exception\ArgumentCount;
|
||||
use WpOrg\Requests\Exception\InvalidArgument;
|
||||
use WpOrg\Requests\Hooks;
|
||||
|
||||
/**
|
||||
* Basic Authentication provider
|
||||
*
|
||||
* Provides a handler for Basic HTTP authentication via the Authorization
|
||||
* header.
|
||||
*
|
||||
* @package Requests\Authentication
|
||||
*/
|
||||
class Basic implements Auth {
|
||||
/**
|
||||
* Username
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Password
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $pass;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 2.0 Throws an `InvalidArgument` exception.
|
||||
* @since 2.0 Throws an `ArgumentCount` exception instead of the Requests base `Exception.
|
||||
*
|
||||
* @param array|null $args Array of user and password. Must have exactly two elements
|
||||
*
|
||||
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not an array or null.
|
||||
* @throws \WpOrg\Requests\Exception\ArgumentCount On incorrect number of array elements (`authbasicbadargs`).
|
||||
*/
|
||||
public function __construct($args = null) {
|
||||
if (is_array($args)) {
|
||||
if (count($args) !== 2) {
|
||||
throw ArgumentCount::create('an array with exactly two elements', count($args), 'authbasicbadargs');
|
||||
}
|
||||
|
||||
list($this->user, $this->pass) = $args;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($args !== null) {
|
||||
throw InvalidArgument::create(1, '$args', 'array|null', gettype($args));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the necessary callbacks
|
||||
*
|
||||
* @see \WpOrg\Requests\Auth\Basic::curl_before_send()
|
||||
* @see \WpOrg\Requests\Auth\Basic::fsockopen_header()
|
||||
* @param \WpOrg\Requests\Hooks $hooks Hook system
|
||||
*/
|
||||
public function register(Hooks $hooks) {
|
||||
$hooks->register('curl.before_send', [$this, 'curl_before_send']);
|
||||
$hooks->register('fsockopen.after_headers', [$this, 'fsockopen_header']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cURL parameters before the data is sent
|
||||
*
|
||||
* @param resource|\CurlHandle $handle cURL handle
|
||||
*/
|
||||
public function curl_before_send(&$handle) {
|
||||
curl_setopt($handle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
||||
curl_setopt($handle, CURLOPT_USERPWD, $this->getAuthString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Add extra headers to the request before sending
|
||||
*
|
||||
* @param string $out HTTP header string
|
||||
*/
|
||||
public function fsockopen_header(&$out) {
|
||||
$out .= sprintf("Authorization: Basic %s\r\n", base64_encode($this->getAuthString()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the authentication string (user:pass)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAuthString() {
|
||||
return $this->user . ':' . $this->pass;
|
||||
}
|
||||
}
|
||||
187
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Autoload.php
vendored
Normal file
187
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Autoload.php
vendored
Normal file
@ -0,0 +1,187 @@
|
||||
<?php
|
||||
/**
|
||||
* Autoloader for Requests for PHP.
|
||||
*
|
||||
* Include this file if you'd like to avoid having to create your own autoloader.
|
||||
*
|
||||
* @package Requests
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
|
||||
namespace WpOrg\Requests;
|
||||
|
||||
/*
|
||||
* Ensure the autoloader is only declared once.
|
||||
* This safeguard is in place as this is the typical entry point for this library
|
||||
* and this file being required unconditionally could easily cause
|
||||
* fatal "Class already declared" errors.
|
||||
*/
|
||||
if (class_exists('WpOrg\Requests\Autoload') === false) {
|
||||
|
||||
/**
|
||||
* Autoloader for Requests for PHP.
|
||||
*
|
||||
* This autoloader supports the PSR-4 based Requests 2.0.0 classes in a case-sensitive manner
|
||||
* as the most common server OS-es are case-sensitive and the file names are in mixed case.
|
||||
*
|
||||
* For the PSR-0 Requests 1.x BC-layer, requested classes will be treated case-insensitively.
|
||||
*
|
||||
* @package Requests
|
||||
*/
|
||||
final class Autoload {
|
||||
|
||||
/**
|
||||
* List of the old PSR-0 class names in lowercase as keys with their PSR-4 case-sensitive name as a value.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $deprecated_classes = [
|
||||
// Interfaces.
|
||||
'requests_auth' => '\WpOrg\Requests\Auth',
|
||||
'requests_hooker' => '\WpOrg\Requests\HookManager',
|
||||
'requests_proxy' => '\WpOrg\Requests\Proxy',
|
||||
'requests_transport' => '\WpOrg\Requests\Transport',
|
||||
|
||||
// Classes.
|
||||
'requests_cookie' => '\WpOrg\Requests\Cookie',
|
||||
'requests_exception' => '\WpOrg\Requests\Exception',
|
||||
'requests_hooks' => '\WpOrg\Requests\Hooks',
|
||||
'requests_idnaencoder' => '\WpOrg\Requests\IdnaEncoder',
|
||||
'requests_ipv6' => '\WpOrg\Requests\Ipv6',
|
||||
'requests_iri' => '\WpOrg\Requests\Iri',
|
||||
'requests_response' => '\WpOrg\Requests\Response',
|
||||
'requests_session' => '\WpOrg\Requests\Session',
|
||||
'requests_ssl' => '\WpOrg\Requests\Ssl',
|
||||
'requests_auth_basic' => '\WpOrg\Requests\Auth\Basic',
|
||||
'requests_cookie_jar' => '\WpOrg\Requests\Cookie\Jar',
|
||||
'requests_proxy_http' => '\WpOrg\Requests\Proxy\Http',
|
||||
'requests_response_headers' => '\WpOrg\Requests\Response\Headers',
|
||||
'requests_transport_curl' => '\WpOrg\Requests\Transport\Curl',
|
||||
'requests_transport_fsockopen' => '\WpOrg\Requests\Transport\Fsockopen',
|
||||
'requests_utility_caseinsensitivedictionary' => '\WpOrg\Requests\Utility\CaseInsensitiveDictionary',
|
||||
'requests_utility_filterediterator' => '\WpOrg\Requests\Utility\FilteredIterator',
|
||||
'requests_exception_http' => '\WpOrg\Requests\Exception\Http',
|
||||
'requests_exception_transport' => '\WpOrg\Requests\Exception\Transport',
|
||||
'requests_exception_transport_curl' => '\WpOrg\Requests\Exception\Transport\Curl',
|
||||
'requests_exception_http_304' => '\WpOrg\Requests\Exception\Http\Status304',
|
||||
'requests_exception_http_305' => '\WpOrg\Requests\Exception\Http\Status305',
|
||||
'requests_exception_http_306' => '\WpOrg\Requests\Exception\Http\Status306',
|
||||
'requests_exception_http_400' => '\WpOrg\Requests\Exception\Http\Status400',
|
||||
'requests_exception_http_401' => '\WpOrg\Requests\Exception\Http\Status401',
|
||||
'requests_exception_http_402' => '\WpOrg\Requests\Exception\Http\Status402',
|
||||
'requests_exception_http_403' => '\WpOrg\Requests\Exception\Http\Status403',
|
||||
'requests_exception_http_404' => '\WpOrg\Requests\Exception\Http\Status404',
|
||||
'requests_exception_http_405' => '\WpOrg\Requests\Exception\Http\Status405',
|
||||
'requests_exception_http_406' => '\WpOrg\Requests\Exception\Http\Status406',
|
||||
'requests_exception_http_407' => '\WpOrg\Requests\Exception\Http\Status407',
|
||||
'requests_exception_http_408' => '\WpOrg\Requests\Exception\Http\Status408',
|
||||
'requests_exception_http_409' => '\WpOrg\Requests\Exception\Http\Status409',
|
||||
'requests_exception_http_410' => '\WpOrg\Requests\Exception\Http\Status410',
|
||||
'requests_exception_http_411' => '\WpOrg\Requests\Exception\Http\Status411',
|
||||
'requests_exception_http_412' => '\WpOrg\Requests\Exception\Http\Status412',
|
||||
'requests_exception_http_413' => '\WpOrg\Requests\Exception\Http\Status413',
|
||||
'requests_exception_http_414' => '\WpOrg\Requests\Exception\Http\Status414',
|
||||
'requests_exception_http_415' => '\WpOrg\Requests\Exception\Http\Status415',
|
||||
'requests_exception_http_416' => '\WpOrg\Requests\Exception\Http\Status416',
|
||||
'requests_exception_http_417' => '\WpOrg\Requests\Exception\Http\Status417',
|
||||
'requests_exception_http_418' => '\WpOrg\Requests\Exception\Http\Status418',
|
||||
'requests_exception_http_428' => '\WpOrg\Requests\Exception\Http\Status428',
|
||||
'requests_exception_http_429' => '\WpOrg\Requests\Exception\Http\Status429',
|
||||
'requests_exception_http_431' => '\WpOrg\Requests\Exception\Http\Status431',
|
||||
'requests_exception_http_500' => '\WpOrg\Requests\Exception\Http\Status500',
|
||||
'requests_exception_http_501' => '\WpOrg\Requests\Exception\Http\Status501',
|
||||
'requests_exception_http_502' => '\WpOrg\Requests\Exception\Http\Status502',
|
||||
'requests_exception_http_503' => '\WpOrg\Requests\Exception\Http\Status503',
|
||||
'requests_exception_http_504' => '\WpOrg\Requests\Exception\Http\Status504',
|
||||
'requests_exception_http_505' => '\WpOrg\Requests\Exception\Http\Status505',
|
||||
'requests_exception_http_511' => '\WpOrg\Requests\Exception\Http\Status511',
|
||||
'requests_exception_http_unknown' => '\WpOrg\Requests\Exception\Http\StatusUnknown',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register the autoloader.
|
||||
*
|
||||
* Note: the autoloader is *prepended* in the autoload queue.
|
||||
* This is done to ensure that the Requests 2.0 autoloader takes precedence
|
||||
* over a potentially (dependency-registered) Requests 1.x autoloader.
|
||||
*
|
||||
* @internal This method contains a safeguard against the autoloader being
|
||||
* registered multiple times. This safeguard uses a global constant to
|
||||
* (hopefully/in most cases) still function correctly, even if the
|
||||
* class would be renamed.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function register() {
|
||||
if (defined('REQUESTS_AUTOLOAD_REGISTERED') === false) {
|
||||
spl_autoload_register([self::class, 'load'], true);
|
||||
define('REQUESTS_AUTOLOAD_REGISTERED', true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Autoloader.
|
||||
*
|
||||
* @param string $class_name Name of the class name to load.
|
||||
*
|
||||
* @return bool Whether a class was loaded or not.
|
||||
*/
|
||||
public static function load($class_name) {
|
||||
// Check that the class starts with "Requests" (PSR-0) or "WpOrg\Requests" (PSR-4).
|
||||
$psr_4_prefix_pos = strpos($class_name, 'WpOrg\\Requests\\');
|
||||
|
||||
if (stripos($class_name, 'Requests') !== 0 && $psr_4_prefix_pos !== 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$class_lower = strtolower($class_name);
|
||||
|
||||
if ($class_lower === 'requests') {
|
||||
// Reference to the original PSR-0 Requests class.
|
||||
$file = dirname(__DIR__) . '/library/Requests.php';
|
||||
} elseif ($psr_4_prefix_pos === 0) {
|
||||
// PSR-4 classname.
|
||||
$file = __DIR__ . '/' . strtr(substr($class_name, 15), '\\', '/') . '.php';
|
||||
}
|
||||
|
||||
if (isset($file) && file_exists($file)) {
|
||||
include $file; // nosemgrep : https://semgrep.dev/s/e5El
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Okay, so the class starts with "Requests", but we couldn't find the file.
|
||||
* If this is one of the deprecated/renamed PSR-0 classes being requested,
|
||||
* let's alias it to the new name and throw a deprecation notice.
|
||||
*/
|
||||
if (isset(self::$deprecated_classes[$class_lower])) {
|
||||
/*
|
||||
* Integrators who cannot yet upgrade to the PSR-4 class names can silence deprecations
|
||||
* by defining a `REQUESTS_SILENCE_PSR0_DEPRECATIONS` constant and setting it to `true`.
|
||||
* The constant needs to be defined before the first deprecated class is requested
|
||||
* via this autoloader.
|
||||
*/
|
||||
if (!defined('REQUESTS_SILENCE_PSR0_DEPRECATIONS') || REQUESTS_SILENCE_PSR0_DEPRECATIONS !== true) {
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
|
||||
trigger_error(
|
||||
'The PSR-0 `Requests_...` class names in the Request library are deprecated.'
|
||||
. ' Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
|
||||
// Prevent the deprecation notice from being thrown twice.
|
||||
if (!defined('REQUESTS_SILENCE_PSR0_DEPRECATIONS')) {
|
||||
define('REQUESTS_SILENCE_PSR0_DEPRECATIONS', true);
|
||||
}
|
||||
}
|
||||
|
||||
// Create an alias and let the autoloader recursively kick in to load the PSR-4 class.
|
||||
return class_alias(self::$deprecated_classes[$class_lower], $class_name, true);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
36
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Capability.php
vendored
Normal file
36
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Capability.php
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Capability interface declaring the known capabilities.
|
||||
*
|
||||
* @package Requests\Utilities
|
||||
*/
|
||||
|
||||
namespace WpOrg\Requests;
|
||||
|
||||
/**
|
||||
* Capability interface declaring the known capabilities.
|
||||
*
|
||||
* This is used as the authoritative source for which capabilities can be queried.
|
||||
*
|
||||
* @package Requests\Utilities
|
||||
*/
|
||||
interface Capability {
|
||||
|
||||
/**
|
||||
* Support for SSL.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const SSL = 'ssl';
|
||||
|
||||
/**
|
||||
* Collection of all capabilities supported in Requests.
|
||||
*
|
||||
* Note: this does not automatically mean that the capability will be supported for your chosen transport!
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
const ALL = [
|
||||
self::SSL,
|
||||
];
|
||||
}
|
||||
522
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Cookie.php
vendored
Normal file
522
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Cookie.php
vendored
Normal file
@ -0,0 +1,522 @@
|
||||
<?php
|
||||
/**
|
||||
* Cookie storage object
|
||||
*
|
||||
* @package Requests\Cookies
|
||||
*/
|
||||
|
||||
namespace WpOrg\Requests;
|
||||
|
||||
use WpOrg\Requests\Exception\InvalidArgument;
|
||||
use WpOrg\Requests\Iri;
|
||||
use WpOrg\Requests\Response\Headers;
|
||||
use WpOrg\Requests\Utility\CaseInsensitiveDictionary;
|
||||
use WpOrg\Requests\Utility\InputValidator;
|
||||
|
||||
/**
|
||||
* Cookie storage object
|
||||
*
|
||||
* @package Requests\Cookies
|
||||
*/
|
||||
class Cookie {
|
||||
/**
|
||||
* Cookie name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* Cookie value.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $value;
|
||||
|
||||
/**
|
||||
* Cookie attributes
|
||||
*
|
||||
* Valid keys are (currently) path, domain, expires, max-age, secure and
|
||||
* httponly.
|
||||
*
|
||||
* @var \WpOrg\Requests\Utility\CaseInsensitiveDictionary|array Array-like object
|
||||
*/
|
||||
public $attributes = [];
|
||||
|
||||
/**
|
||||
* Cookie flags
|
||||
*
|
||||
* Valid keys are (currently) creation, last-access, persistent and
|
||||
* host-only.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $flags = [];
|
||||
|
||||
/**
|
||||
* Reference time for relative calculations
|
||||
*
|
||||
* This is used in place of `time()` when calculating Max-Age expiration and
|
||||
* checking time validity.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $reference_time = 0;
|
||||
|
||||
/**
|
||||
* Create a new cookie object
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
* @param array|\WpOrg\Requests\Utility\CaseInsensitiveDictionary $attributes Associative array of attribute data
|
||||
* @param array $flags
|
||||
* @param int|null $reference_time
|
||||
*
|
||||
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $name argument is not a string.
|
||||
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $value argument is not a string.
|
||||
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $attributes argument is not an array or iterable object with array access.
|
||||
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $flags argument is not an array.
|
||||
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $reference_time argument is not an integer or null.
|
||||
*/
|
||||
public function __construct($name, $value, $attributes = [], $flags = [], $reference_time = null) {
|
||||
if (is_string($name) === false) {
|
||||
throw InvalidArgument::create(1, '$name', 'string', gettype($name));
|
||||
}
|
||||
|
||||
if (is_string($value) === false) {
|
||||
throw InvalidArgument::create(2, '$value', 'string', gettype($value));
|
||||
}
|
||||
|
||||
if (InputValidator::has_array_access($attributes) === false || InputValidator::is_iterable($attributes) === false) {
|
||||
throw InvalidArgument::create(3, '$attributes', 'array|ArrayAccess&Traversable', gettype($attributes));
|
||||
}
|
||||
|
||||
if (is_array($flags) === false) {
|
||||
throw InvalidArgument::create(4, '$flags', 'array', gettype($flags));
|
||||
}
|
||||
|
||||
if ($reference_time !== null && is_int($reference_time) === false) {
|
||||
throw InvalidArgument::create(5, '$reference_time', 'integer|null', gettype($reference_time));
|
||||
}
|
||||
|
||||
$this->name = $name;
|
||||
$this->value = $value;
|
||||
$this->attributes = $attributes;
|
||||
$default_flags = [
|
||||
'creation' => time(),
|
||||
'last-access' => time(),
|
||||
'persistent' => false,
|
||||
'host-only' => true,
|
||||
];
|
||||
$this->flags = array_merge($default_flags, $flags);
|
||||
|
||||
$this->reference_time = time();
|
||||
if ($reference_time !== null) {
|
||||
$this->reference_time = $reference_time;
|
||||
}
|
||||
|
||||
$this->normalize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cookie value
|
||||
*
|
||||
* Attributes and other data can be accessed via methods.
|
||||
*/
|
||||
public function __toString() {
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a cookie is expired.
|
||||
*
|
||||
* Checks the age against $this->reference_time to determine if the cookie
|
||||
* is expired.
|
||||
*
|
||||
* @return boolean True if expired, false if time is valid.
|
||||
*/
|
||||
public function is_expired() {
|
||||
// RFC6265, s. 4.1.2.2:
|
||||
// If a cookie has both the Max-Age and the Expires attribute, the Max-
|
||||
// Age attribute has precedence and controls the expiration date of the
|
||||
// cookie.
|
||||
if (isset($this->attributes['max-age'])) {
|
||||
$max_age = $this->attributes['max-age'];
|
||||
return $max_age < $this->reference_time;
|
||||
}
|
||||
|
||||
if (isset($this->attributes['expires'])) {
|
||||
$expires = $this->attributes['expires'];
|
||||
return $expires < $this->reference_time;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a cookie is valid for a given URI
|
||||
*
|
||||
* @param \WpOrg\Requests\Iri $uri URI to check
|
||||
* @return boolean Whether the cookie is valid for the given URI
|
||||
*/
|
||||
public function uri_matches(Iri $uri) {
|
||||
if (!$this->domain_matches($uri->host)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$this->path_matches($uri->path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return empty($this->attributes['secure']) || $uri->scheme === 'https';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a cookie is valid for a given domain
|
||||
*
|
||||
* @param string $domain Domain to check
|
||||
* @return boolean Whether the cookie is valid for the given domain
|
||||
*/
|
||||
public function domain_matches($domain) {
|
||||
if (is_string($domain) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isset($this->attributes['domain'])) {
|
||||
// Cookies created manually; cookies created by Requests will set
|
||||
// the domain to the requested domain
|
||||
return true;
|
||||
}
|
||||
|
||||
$cookie_domain = $this->attributes['domain'];
|
||||
if ($cookie_domain === $domain) {
|
||||
// The cookie domain and the passed domain are identical.
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the cookie is marked as host-only and we don't have an exact
|
||||
// match, reject the cookie
|
||||
if ($this->flags['host-only'] === true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (strlen($domain) <= strlen($cookie_domain)) {
|
||||
// For obvious reasons, the cookie domain cannot be a suffix if the passed domain
|
||||
// is shorter than the cookie domain
|
||||
return false;
|
||||
}
|
||||
|
||||
if (substr($domain, -1 * strlen($cookie_domain)) !== $cookie_domain) {
|
||||
// The cookie domain should be a suffix of the passed domain.
|
||||
return false;
|
||||
}
|
||||
|
||||
$prefix = substr($domain, 0, strlen($domain) - strlen($cookie_domain));
|
||||
if (substr($prefix, -1) !== '.') {
|
||||
// The last character of the passed domain that is not included in the
|
||||
// domain string should be a %x2E (".") character.
|
||||
return false;
|
||||
}
|
||||
|
||||
// The passed domain should be a host name (i.e., not an IP address).
|
||||
return !preg_match('#^(.+\.)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a cookie is valid for a given path
|
||||
*
|
||||
* From the path-match check in RFC 6265 section 5.1.4
|
||||
*
|
||||
* @param string $request_path Path to check
|
||||
* @return boolean Whether the cookie is valid for the given path
|
||||
*/
|
||||
public function path_matches($request_path) {
|
||||
if (empty($request_path)) {
|
||||
// Normalize empty path to root
|
||||
$request_path = '/';
|
||||
}
|
||||
|
||||
if (!isset($this->attributes['path'])) {
|
||||
// Cookies created manually; cookies created by Requests will set
|
||||
// the path to the requested path
|
||||
return true;
|
||||
}
|
||||
|
||||
if (is_scalar($request_path) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$cookie_path = $this->attributes['path'];
|
||||
|
||||
if ($cookie_path === $request_path) {
|
||||
// The cookie-path and the request-path are identical.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (strlen($request_path) > strlen($cookie_path) && substr($request_path, 0, strlen($cookie_path)) === $cookie_path) {
|
||||
if (substr($cookie_path, -1) === '/') {
|
||||
// The cookie-path is a prefix of the request-path, and the last
|
||||
// character of the cookie-path is %x2F ("/").
|
||||
return true;
|
||||
}
|
||||
|
||||
if (substr($request_path, strlen($cookie_path), 1) === '/') {
|
||||
// The cookie-path is a prefix of the request-path, and the
|
||||
// first character of the request-path that is not included in
|
||||
// the cookie-path is a %x2F ("/") character.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize cookie and attributes
|
||||
*
|
||||
* @return boolean Whether the cookie was successfully normalized
|
||||
*/
|
||||
public function normalize() {
|
||||
foreach ($this->attributes as $key => $value) {
|
||||
$orig_value = $value;
|
||||
$value = $this->normalize_attribute($key, $value);
|
||||
if ($value === null) {
|
||||
unset($this->attributes[$key]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($value !== $orig_value) {
|
||||
$this->attributes[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an individual cookie attribute
|
||||
*
|
||||
* Handles parsing individual attributes from the cookie values.
|
||||
*
|
||||
* @param string $name Attribute name
|
||||
* @param string|boolean $value Attribute value (string value, or true if empty/flag)
|
||||
* @return mixed Value if available, or null if the attribute value is invalid (and should be skipped)
|
||||
*/
|
||||
protected function normalize_attribute($name, $value) {
|
||||
switch (strtolower($name)) {
|
||||
case 'expires':
|
||||
// Expiration parsing, as per RFC 6265 section 5.2.1
|
||||
if (is_int($value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
$expiry_time = strtotime($value);
|
||||
if ($expiry_time === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $expiry_time;
|
||||
|
||||
case 'max-age':
|
||||
// Expiration parsing, as per RFC 6265 section 5.2.2
|
||||
if (is_int($value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
// Check that we have a valid age
|
||||
if (!preg_match('/^-?\d+$/', $value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$delta_seconds = (int) $value;
|
||||
if ($delta_seconds <= 0) {
|
||||
$expiry_time = 0;
|
||||
} else {
|
||||
$expiry_time = $this->reference_time + $delta_seconds;
|
||||
}
|
||||
|
||||
return $expiry_time;
|
||||
|
||||
case 'domain':
|
||||
// Domains are not required as per RFC 6265 section 5.2.3
|
||||
if (empty($value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Domain normalization, as per RFC 6265 section 5.2.3
|
||||
if ($value[0] === '.') {
|
||||
$value = substr($value, 1);
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
||||
default:
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a cookie for a Cookie header
|
||||
*
|
||||
* This is used when sending cookies to a server.
|
||||
*
|
||||
* @return string Cookie formatted for Cookie header
|
||||
*/
|
||||
public function format_for_header() {
|
||||
return sprintf('%s=%s', $this->name, $this->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a cookie for a Set-Cookie header
|
||||
*
|
||||
* This is used when sending cookies to clients. This isn't really
|
||||
* applicable to client-side usage, but might be handy for debugging.
|
||||
*
|
||||
* @return string Cookie formatted for Set-Cookie header
|
||||
*/
|
||||
public function format_for_set_cookie() {
|
||||
$header_value = $this->format_for_header();
|
||||
if (!empty($this->attributes)) {
|
||||
$parts = [];
|
||||
foreach ($this->attributes as $key => $value) {
|
||||
// Ignore non-associative attributes
|
||||
if (is_numeric($key)) {
|
||||
$parts[] = $value;
|
||||
} else {
|
||||
$parts[] = sprintf('%s=%s', $key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
$header_value .= '; ' . implode('; ', $parts);
|
||||
}
|
||||
|
||||
return $header_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a cookie string into a cookie object
|
||||
*
|
||||
* Based on Mozilla's parsing code in Firefox and related projects, which
|
||||
* is an intentional deviation from RFC 2109 and RFC 2616. RFC 6265
|
||||
* specifies some of this handling, but not in a thorough manner.
|
||||
*
|
||||
* @param string $cookie_header Cookie header value (from a Set-Cookie header)
|
||||
* @param string $name
|
||||
* @param int|null $reference_time
|
||||
* @return \WpOrg\Requests\Cookie Parsed cookie object
|
||||
*
|
||||
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $cookie_header argument is not a string.
|
||||
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $name argument is not a string.
|
||||
*/
|
||||
public static function parse($cookie_header, $name = '', $reference_time = null) {
|
||||
if (is_string($cookie_header) === false) {
|
||||
throw InvalidArgument::create(1, '$cookie_header', 'string', gettype($cookie_header));
|
||||
}
|
||||
|
||||
if (is_string($name) === false) {
|
||||
throw InvalidArgument::create(2, '$name', 'string', gettype($name));
|
||||
}
|
||||
|
||||
$parts = explode(';', $cookie_header);
|
||||
$kvparts = array_shift($parts);
|
||||
|
||||
if (!empty($name)) {
|
||||
$value = $cookie_header;
|
||||
} elseif (strpos($kvparts, '=') === false) {
|
||||
// Some sites might only have a value without the equals separator.
|
||||
// Deviate from RFC 6265 and pretend it was actually a blank name
|
||||
// (`=foo`)
|
||||
//
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=169091
|
||||
$name = '';
|
||||
$value = $kvparts;
|
||||
} else {
|
||||
list($name, $value) = explode('=', $kvparts, 2);
|
||||
}
|
||||
|
||||
$name = trim($name);
|
||||
$value = trim($value);
|
||||
|
||||
// Attribute keys are handled case-insensitively
|
||||
$attributes = new CaseInsensitiveDictionary();
|
||||
|
||||
if (!empty($parts)) {
|
||||
foreach ($parts as $part) {
|
||||
if (strpos($part, '=') === false) {
|
||||
$part_key = $part;
|
||||
$part_value = true;
|
||||
} else {
|
||||
list($part_key, $part_value) = explode('=', $part, 2);
|
||||
$part_value = trim($part_value);
|
||||
}
|
||||
|
||||
$part_key = trim($part_key);
|
||||
$attributes[$part_key] = $part_value;
|
||||
}
|
||||
}
|
||||
|
||||
return new static($name, $value, $attributes, [], $reference_time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse all Set-Cookie headers from request headers
|
||||
*
|
||||
* @param \WpOrg\Requests\Response\Headers $headers Headers to parse from
|
||||
* @param \WpOrg\Requests\Iri|null $origin URI for comparing cookie origins
|
||||
* @param int|null $time Reference time for expiration calculation
|
||||
* @return array
|
||||
*/
|
||||
public static function parse_from_headers(Headers $headers, Iri $origin = null, $time = null) {
|
||||
$cookie_headers = $headers->getValues('Set-Cookie');
|
||||
if (empty($cookie_headers)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$cookies = [];
|
||||
foreach ($cookie_headers as $header) {
|
||||
$parsed = self::parse($header, '', $time);
|
||||
|
||||
// Default domain/path attributes
|
||||
if (empty($parsed->attributes['domain']) && !empty($origin)) {
|
||||
$parsed->attributes['domain'] = $origin->host;
|
||||
$parsed->flags['host-only'] = true;
|
||||
} else {
|
||||
$parsed->flags['host-only'] = false;
|
||||
}
|
||||
|
||||
$path_is_valid = (!empty($parsed->attributes['path']) && $parsed->attributes['path'][0] === '/');
|
||||
if (!$path_is_valid && !empty($origin)) {
|
||||
$path = $origin->path;
|
||||
|
||||
// Default path normalization as per RFC 6265 section 5.1.4
|
||||
if (substr($path, 0, 1) !== '/') {
|
||||
// If the uri-path is empty or if the first character of
|
||||
// the uri-path is not a %x2F ("/") character, output
|
||||
// %x2F ("/") and skip the remaining steps.
|
||||
$path = '/';
|
||||
} elseif (substr_count($path, '/') === 1) {
|
||||
// If the uri-path contains no more than one %x2F ("/")
|
||||
// character, output %x2F ("/") and skip the remaining
|
||||
// step.
|
||||
$path = '/';
|
||||
} else {
|
||||
// Output the characters of the uri-path from the first
|
||||
// character up to, but not including, the right-most
|
||||
// %x2F ("/").
|
||||
$path = substr($path, 0, strrpos($path, '/'));
|
||||
}
|
||||
|
||||
$parsed->attributes['path'] = $path;
|
||||
}
|
||||
|
||||
// Reject invalid cookie domains
|
||||
if (!empty($origin) && !$parsed->domain_matches($origin->host)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$cookies[$parsed->name] = $parsed;
|
||||
}
|
||||
|
||||
return $cookies;
|
||||
}
|
||||
}
|
||||
186
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Cookie/Jar.php
vendored
Normal file
186
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Cookie/Jar.php
vendored
Normal file
@ -0,0 +1,186 @@
|
||||
<?php
|
||||
/**
|
||||
* Cookie holder object
|
||||
*
|
||||
* @package Requests\Cookies
|
||||
*/
|
||||
|
||||
namespace WpOrg\Requests\Cookie;
|
||||
|
||||
use ArrayAccess;
|
||||
use ArrayIterator;
|
||||
use IteratorAggregate;
|
||||
use ReturnTypeWillChange;
|
||||
use WpOrg\Requests\Cookie;
|
||||
use WpOrg\Requests\Exception;
|
||||
use WpOrg\Requests\Exception\InvalidArgument;
|
||||
use WpOrg\Requests\HookManager;
|
||||
use WpOrg\Requests\Iri;
|
||||
use WpOrg\Requests\Response;
|
||||
|
||||
/**
|
||||
* Cookie holder object
|
||||
*
|
||||
* @package Requests\Cookies
|
||||
*/
|
||||
class Jar implements ArrayAccess, IteratorAggregate {
|
||||
/**
|
||||
* Actual item data
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $cookies = [];
|
||||
|
||||
/**
|
||||
* Create a new jar
|
||||
*
|
||||
* @param array $cookies Existing cookie values
|
||||
*
|
||||
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not an array.
|
||||
*/
|
||||
public function __construct($cookies = []) {
|
||||
if (is_array($cookies) === false) {
|
||||
throw InvalidArgument::create(1, '$cookies', 'array', gettype($cookies));
|
||||
}
|
||||
|
||||
$this->cookies = $cookies;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalise cookie data into a \WpOrg\Requests\Cookie
|
||||
*
|
||||
* @param string|\WpOrg\Requests\Cookie $cookie
|
||||
* @return \WpOrg\Requests\Cookie
|
||||
*/
|
||||
public function normalize_cookie($cookie, $key = '') {
|
||||
if ($cookie instanceof Cookie) {
|
||||
return $cookie;
|
||||
}
|
||||
|
||||
return Cookie::parse($cookie, $key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given item exists
|
||||
*
|
||||
* @param string $offset Item key
|
||||
* @return boolean Does the item exist?
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetExists($offset) {
|
||||
return isset($this->cookies[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value for the item
|
||||
*
|
||||
* @param string $offset Item key
|
||||
* @return string|null Item value (null if offsetExists is false)
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet($offset) {
|
||||
if (!isset($this->cookies[$offset])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->cookies[$offset];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the given item
|
||||
*
|
||||
* @param string $offset Item name
|
||||
* @param string $value Item value
|
||||
*
|
||||
* @throws \WpOrg\Requests\Exception On attempting to use dictionary as list (`invalidset`)
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetSet($offset, $value) {
|
||||
if ($offset === null) {
|
||||
throw new Exception('Object is a dictionary, not a list', 'invalidset');
|
||||
}
|
||||
|
||||
$this->cookies[$offset] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unset the given header
|
||||
*
|
||||
* @param string $offset
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetUnset($offset) {
|
||||
unset($this->cookies[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an iterator for the data
|
||||
*
|
||||
* @return \ArrayIterator
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function getIterator() {
|
||||
return new ArrayIterator($this->cookies);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the cookie handler with the request's hooking system
|
||||
*
|
||||
* @param \WpOrg\Requests\HookManager $hooks Hooking system
|
||||
*/
|
||||
public function register(HookManager $hooks) {
|
||||
$hooks->register('requests.before_request', [$this, 'before_request']);
|
||||
$hooks->register('requests.before_redirect_check', [$this, 'before_redirect_check']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Cookie header to a request if we have any
|
||||
*
|
||||
* As per RFC 6265, cookies are separated by '; '
|
||||
*
|
||||
* @param string $url
|
||||
* @param array $headers
|
||||
* @param array $data
|
||||
* @param string $type
|
||||
* @param array $options
|
||||
*/
|
||||
public function before_request($url, &$headers, &$data, &$type, &$options) {
|
||||
if (!$url instanceof Iri) {
|
||||
$url = new Iri($url);
|
||||
}
|
||||
|
||||
if (!empty($this->cookies)) {
|
||||
$cookies = [];
|
||||
foreach ($this->cookies as $key => $cookie) {
|
||||
$cookie = $this->normalize_cookie($cookie, $key);
|
||||
|
||||
// Skip expired cookies
|
||||
if ($cookie->is_expired()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($cookie->domain_matches($url->host)) {
|
||||
$cookies[] = $cookie->format_for_header();
|
||||
}
|
||||
}
|
||||
|
||||
$headers['Cookie'] = implode('; ', $cookies);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse all cookies from a response and attach them to the response
|
||||
*
|
||||
* @param \WpOrg\Requests\Response $response
|
||||
*/
|
||||
public function before_redirect_check(Response $response) {
|
||||
$url = $response->url;
|
||||
if (!$url instanceof Iri) {
|
||||
$url = new Iri($url);
|
||||
}
|
||||
|
||||
$cookies = Cookie::parse_from_headers($response->headers, $url);
|
||||
$this->cookies = array_merge($this->cookies, $cookies);
|
||||
$response->cookies = $this;
|
||||
}
|
||||
}
|
||||
66
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Exception.php
vendored
Normal file
66
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Exception.php
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Exception for HTTP requests
|
||||
*
|
||||
* @package Requests\Exceptions
|
||||
*/
|
||||
|
||||
namespace WpOrg\Requests;
|
||||
|
||||
use Exception as PHPException;
|
||||
|
||||
/**
|
||||
* Exception for HTTP requests
|
||||
*
|
||||
* @package Requests\Exceptions
|
||||
*/
|
||||
class Exception extends PHPException {
|
||||
/**
|
||||
* Type of exception
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* Data associated with the exception
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $data;
|
||||
|
||||
/**
|
||||
* Create a new exception
|
||||
*
|
||||
* @param string $message Exception message
|
||||
* @param string $type Exception type
|
||||
* @param mixed $data Associated data
|
||||
* @param integer $code Exception numerical code, if applicable
|
||||
*/
|
||||
public function __construct($message, $type, $data = null, $code = 0) {
|
||||
parent::__construct($message, $code);
|
||||
|
||||
$this->type = $type;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Like {@see \Exception::getCode()}, but a string code.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @return string
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gives any relevant data
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @return mixed
|
||||
*/
|
||||
public function getData() {
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
47
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Exception/ArgumentCount.php
vendored
Normal file
47
vendor/razorpay/razorpay/libs/Requests-2.0.4/src/Exception/ArgumentCount.php
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace WpOrg\Requests\Exception;
|
||||
|
||||
use WpOrg\Requests\Exception;
|
||||
|
||||
/**
|
||||
* Exception for when an incorrect number of arguments are passed to a method.
|
||||
*
|
||||
* Typically, this exception is used when all arguments for a method are optional,
|
||||
* but certain arguments need to be passed together, i.e. a method which can be called
|
||||
* with no arguments or with two arguments, but not with one argument.
|
||||
*
|
||||
* Along the same lines, this exception is also used if a method expects an array
|
||||
* with a certain number of elements and the provided number of elements does not comply.
|
||||
*
|
||||
* @package Requests\Exceptions
|
||||
* @since 2.0.0
|
||||
*/
|
||||
final class ArgumentCount extends Exception {
|
||||
|
||||
/**
|
||||
* Create a new argument count exception with a standardized text.
|
||||
*
|
||||
* @param string $expected The argument count expected as a phrase.
|
||||
* For example: `at least 2 arguments` or `exactly 1 argument`.
|
||||
* @param int $received The actual argument count received.
|
||||
* @param string $type Exception type.
|
||||
*
|
||||
* @return \WpOrg\Requests\Exception\ArgumentCount
|
||||
*/
|
||||
public static function create($expected, $received, $type) {
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace
|
||||
$stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
|
||||
|
||||
return new self(
|
||||
sprintf(
|
||||
'%s::%s() expects %s, %d given',
|
||||
$stack[1]['class'],
|
||||
$stack[1]['function'],
|
||||
$expected,
|
||||
$received
|
||||
),
|
||||
$type
|
||||
);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user