Skip to content

Commit 3c5e681

Browse files
Merge pull request #26 from razorpay/sdk-update-2.9.0
PO-328 SDK update to 2.9.0
2 parents bd88261 + 2846b90 commit 3c5e681

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1069
-374
lines changed

razorpay-sdk/Razorpay.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
if (class_exists('WpOrg\Requests\Autoload') === false)
1010
{
11-
require_once __DIR__.'/libs/Requests-2.0.0/src/Autoload.php';
11+
require_once __DIR__.'/libs/Requests-2.0.4/src/Autoload.php';
1212
}
1313

1414
try

razorpay-sdk/libs/Requests-2.0.0/CHANGELOG.md razorpay-sdk/libs/Requests-2.0.4/CHANGELOG.md

+56

razorpay-sdk/libs/Requests-2.0.0/certificates/cacert.pem razorpay-sdk/libs/Requests-2.0.4/certificates/cacert.pem

+433-205
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6ed95025fba2aef0ce7b647607225745624497f876d74ef6ec22b26e73e9de77 cacert.pem

razorpay-sdk/libs/Requests-2.0.0/composer.json razorpay-sdk/libs/Requests-2.0.4/composer.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "A HTTP library written in PHP, for human beings.",
44
"homepage": "https://requests.ryanmccue.info/",
55
"license": "ISC",
6+
"type": "library",
67
"keywords": [
78
"http",
89
"idna",
@@ -39,8 +40,13 @@
3940
"php": ">=5.6",
4041
"ext-json": "*"
4142
},
43+
"config": {
44+
"allow-plugins": {
45+
"dealerdirect/phpcodesniffer-composer-installer": true
46+
}
47+
},
4248
"require-dev": {
43-
"requests/test-server": "dev-master",
49+
"requests/test-server": "dev-main",
4450
"squizlabs/php_codesniffer": "^3.6",
4551
"phpcompatibility/php-compatibility": "^9.0",
4652
"wp-coding-standards/wpcs": "^2.0",
@@ -50,7 +56,6 @@
5056
"yoast/phpunit-polyfills": "^1.0.0",
5157
"roave/security-advisories": "dev-latest"
5258
},
53-
"type": "library",
5459
"autoload": {
5560
"psr-4": {
5661
"WpOrg\\Requests\\": "src/"

razorpay-sdk/libs/Requests-2.0.0/library/Deprecated.php razorpay-sdk/libs/Requests-2.0.4/library/Deprecated.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515
if (class_exists('WpOrg\Requests\Autoload') === false) {
16-
require_once dirname(__DIR__) . '/src/Autoload.php'; // nosemgrep : https://semgrep.dev/s/e5El
16+
require_once dirname(__DIR__) . '/src/Autoload.php'; // nosemgrep : https://semgrep.dev/s/e5El
1717
}
1818

1919
WpOrg\Requests\Autoload::register();

razorpay-sdk/libs/Requests-2.0.0/library/Requests.php razorpay-sdk/libs/Requests-2.0.4/library/Requests.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131
}
3232

33-
require_once dirname(__DIR__) . '/src/Requests.php'; // nosemgrep : https://semgrep.dev/s/e5El
33+
require_once dirname(__DIR__) . '/src/Requests.php'; // nosemgrep : https://semgrep.dev/s/e5El
3434

3535
/**
3636
* Requests for PHP
@@ -57,7 +57,7 @@ class Requests extends WpOrg\Requests\Requests {
5757
*/
5858
public static function autoloader($class) {
5959
if (class_exists('WpOrg\Requests\Autoload') === false) {
60-
require_once dirname(__DIR__) . '/src/Autoload.php'; // nosemgrep : https://semgrep.dev/s/e5El
60+
require_once dirname(__DIR__) . '/src/Autoload.php'; // nosemgrep : https://semgrep.dev/s/e5El
6161
}
6262

6363
return WpOrg\Requests\Autoload::load($class);
@@ -72,7 +72,7 @@ public static function autoloader($class) {
7272
* @codeCoverageIgnore
7373
*/
7474
public static function register_autoloader() {
75-
require_once dirname(__DIR__) . '/src/Autoload.php'; // nosemgrep : https://semgrep.dev/s/e5El
75+
require_once dirname(__DIR__) . '/src/Autoload.php'; // nosemgrep : https://semgrep.dev/s/e5El
7676
WpOrg\Requests\Autoload::register();
7777
}
7878
}

razorpay-sdk/libs/Requests-2.0.0/src/Cookie.php razorpay-sdk/libs/Requests-2.0.4/src/Cookie.php

+11-16
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,7 @@ protected function normalize_attribute($name, $value) {
331331
$delta_seconds = (int) $value;
332332
if ($delta_seconds <= 0) {
333333
$expiry_time = 0;
334-
}
335-
else {
334+
} else {
336335
$expiry_time = $this->reference_time + $delta_seconds;
337336
}
338337

@@ -383,14 +382,14 @@ public function format_for_set_cookie() {
383382
// Ignore non-associative attributes
384383
if (is_numeric($key)) {
385384
$parts[] = $value;
386-
}
387-
else {
385+
} else {
388386
$parts[] = sprintf('%s=%s', $key, $value);
389387
}
390388
}
391389

392390
$header_value .= '; ' . implode('; ', $parts);
393391
}
392+
394393
return $header_value;
395394
}
396395

@@ -423,19 +422,18 @@ public static function parse($cookie_header, $name = '', $reference_time = null)
423422

424423
if (!empty($name)) {
425424
$value = $cookie_header;
426-
}
427-
elseif (strpos($kvparts, '=') === false) {
425+
} elseif (strpos($kvparts, '=') === false) {
428426
// Some sites might only have a value without the equals separator.
429427
// Deviate from RFC 6265 and pretend it was actually a blank name
430428
// (`=foo`)
431429
//
432430
// https://bugzilla.mozilla.org/show_bug.cgi?id=169091
433431
$name = '';
434432
$value = $kvparts;
435-
}
436-
else {
433+
} else {
437434
list($name, $value) = explode('=', $kvparts, 2);
438435
}
436+
439437
$name = trim($name);
440438
$value = trim($value);
441439

@@ -447,8 +445,7 @@ public static function parse($cookie_header, $name = '', $reference_time = null)
447445
if (strpos($part, '=') === false) {
448446
$part_key = $part;
449447
$part_value = true;
450-
}
451-
else {
448+
} else {
452449
list($part_key, $part_value) = explode('=', $part, 2);
453450
$part_value = trim($part_value);
454451
}
@@ -483,8 +480,7 @@ public static function parse_from_headers(Headers $headers, Iri $origin = null,
483480
if (empty($parsed->attributes['domain']) && !empty($origin)) {
484481
$parsed->attributes['domain'] = $origin->host;
485482
$parsed->flags['host-only'] = true;
486-
}
487-
else {
483+
} else {
488484
$parsed->flags['host-only'] = false;
489485
}
490486

@@ -498,19 +494,18 @@ public static function parse_from_headers(Headers $headers, Iri $origin = null,
498494
// the uri-path is not a %x2F ("/") character, output
499495
// %x2F ("/") and skip the remaining steps.
500496
$path = '/';
501-
}
502-
elseif (substr_count($path, '/') === 1) {
497+
} elseif (substr_count($path, '/') === 1) {
503498
// If the uri-path contains no more than one %x2F ("/")
504499
// character, output %x2F ("/") and skip the remaining
505500
// step.
506501
$path = '/';
507-
}
508-
else {
502+
} else {
509503
// Output the characters of the uri-path from the first
510504
// character up to, but not including, the right-most
511505
// %x2F ("/").
512506
$path = substr($path, 0, strrpos($path, '/'));
513507
}
508+
514509
$parsed->attributes['path'] = $path;
515510
}
516511

razorpay-sdk/libs/Requests-2.0.0/src/Hooks.php razorpay-sdk/libs/Requests-2.0.4/src/Hooks.php

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ public function dispatch($hook, $parameters = []) {
8686
$parameters = array_values($parameters);
8787
}
8888

89+
ksort($this->hooks[$hook]);
90+
8991
foreach ($this->hooks[$hook] as $priority => $hooked) {
9092
foreach ($hooked as $callback) {
9193
$callback(...$parameters);

0 commit comments

Comments
 (0)