PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.17
Yatra – Travel Booking & Tour Operator Software v3.0.17
3.0.17 3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 All 85 releases
← All changes | app/PaymentGateways/Gateways/PayLater/PayLaterGateway.php +42 -7 3.0.4 → 3.0.17 View file →
@@ -14,8 +14,27 @@
14 14 protected string $icon = 'pay-later.svg';
15 15 protected bool $isOffline = true;
16 16 protected array $supports = ['pay_later', 'reservation'];
17 17
18 + /**
19 + * Translatable display title. The raw `$title` property can't carry a
20 + * `__()` call (PHP property defaults must be constant), so the customer-
21 + * facing label is translated here. An admin-set custom title (via gateway
22 + * config) still takes precedence in PaymentGatewayRegistry::getForCheckout().
23 + */
24 + public function getTitle(): string
25 + {
26 + return __('Book Now, Pay Later', 'yatra');
27 + }
28 +
29 + /**
30 + * Translatable description shown under the gateway option at checkout.
31 + */
32 + public function getDescription(): string
33 + {
34 + return __('Reserve now and pay before the trip', 'yatra');
35 + }
36 +
18 37 public function getConfigFields(): array
19 38 {
20 39 return [
21 40 [
@@ -99,20 +118,36 @@
99 118 'deposit_amount' => $depositAmount,
100 119 'remaining_amount' => $amount - $depositAmount,
101 120 'payment_deadline' => $paymentDeadline,
102 121 'deadline_days' => $deadlineDays,
103 - 'message' => $requireDeposit
104 - ? sprintf(__('A deposit of %s is required to confirm your booking. Full payment is due %d days before your trip.', 'yatra'),
105 - number_format($depositAmount, 2), $deadlineDays)
106 - : sprintf(__('Your booking is reserved! Full payment of %s is due %d days before your trip.', 'yatra'),
107 - number_format($amount, 2), $deadlineDays),
122 + 'message' => $requireDeposit
123 + ? sprintf(
124 + /* translators: 1: formatted deposit amount, 2: number of days before the trip. */
125 + __('A deposit of %1$s is required to confirm your booking. Full payment is due %2$d days before your trip.', 'yatra'),
126 + yatra_format_price((float) $depositAmount, null, false),
127 + $deadlineDays
128 + )
129 + : sprintf(
130 + /* translators: 1: formatted total amount, 2: number of days before the trip. */
131 + __('Your booking is reserved! Full payment of %1$s is due %2$d days before your trip.', 'yatra'),
132 + yatra_format_price((float) $amount, null, false),
133 + $deadlineDays
134 + ),
108 135 ];
109 136 }
110 137
111 138 public function verifyPayment(string $transactionId): array
112 139 {
113 - // Pay later doesn't need verification at checkout
114 - return ['success' => true, 'status' => 'reserved'];
140 + // Pay Later takes no money at checkout — the balance is settled offline
141 + // later. There is nothing to verify online, so this MUST NOT report
142 + // success: callers such as confirm_payment() / handle_callback() treat a
143 + // successful verify as a captured payment and would otherwise mark the
144 + // booking paid + completed before any money has arrived.
145 + return [
146 + 'success' => false,
147 + 'status' => 'reserved',
148 + 'error' => __('Pay Later bookings are settled offline; there is no online payment to verify.', 'yatra'),
149 + ];
115 150 }
116 151
117 152 /**
118 153 * Get auto-cancel days setting