Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117753599
D1948.1775195062.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D1948.1775195062.diff
View Options
diff --git a/src/app/Http/Controllers/API/V4/PaymentsController.php b/src/app/Http/Controllers/API/V4/PaymentsController.php
--- a/src/app/Http/Controllers/API/V4/PaymentsController.php
+++ b/src/app/Http/Controllers/API/V4/PaymentsController.php
@@ -156,7 +156,7 @@
// TODO: allow comma as a decimal point?
if ($v->fails()) {
- return $v->errors();
+ return $v->errors()->toArray();
}
$amount = (int) ($request->amount * 100);
diff --git a/src/app/OpenVidu/Room.php b/src/app/OpenVidu/Room.php
--- a/src/app/OpenVidu/Room.php
+++ b/src/app/OpenVidu/Room.php
@@ -170,24 +170,32 @@
* Create a OpenVidu session (connection) token
*
* @return array|null Token data on success, NULL otherwise
+ * @throws \Exception if session does not exist
*/
public function getSessionToken($role = self::ROLE_PUBLISHER): ?array
{
- $response = $this->client()->request(
- 'POST',
- 'tokens',
- [
- 'json' => [
- 'session' => $this->session_id,
- 'role' => $role
- ]
+ if (!$this->session_id) {
+ throw new \Exception("The room session does not exist");
+ }
+
+ $url = 'sessions/' . $this->session_id . '/connection';
+ $post = [
+ 'json' => [
+ 'role' => $role
]
- );
+ ];
+
+ $response = $this->client()->request('POST', $url, $post);
if ($response->getStatusCode() == 200) {
$json = json_decode($response->getBody(), true);
- return $json;
+ return [
+ 'session' => $this->session_id,
+ 'token' => $json['token'],
+ 'role' => $json['role'],
+ 'connectionId' => $json['id'],
+ ];
}
return null;
diff --git a/src/app/Providers/Payment/Stripe.php b/src/app/Providers/Payment/Stripe.php
--- a/src/app/Providers/Payment/Stripe.php
+++ b/src/app/Providers/Payment/Stripe.php
@@ -357,7 +357,7 @@
if ($status == self::STATUS_PAID) {
$payment->wallet->setSetting('stripe_mandate_id', $intent->id);
- $threshold = intval($payment->wallet->getSetting('mandate_balance') * 100);
+ $threshold = intval((float) $payment->wallet->getSetting('mandate_balance') * 100);
// Top-up the wallet if balance is below the threshold
if ($payment->wallet->balance < $threshold && $payment->status != self::STATUS_PAID) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 5:44 AM (2 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18822741
Default Alt Text
D1948.1775195062.diff (2 KB)
Attached To
Mode
D1948: OpenVidu: Replace deprecated API use
Attached
Detach File
Event Timeline