← All changes
|
app/PaymentGateways/Gateways/PayLater/PayLaterGateway.php
+12
-4
3.0.9
→
3.0.17
View file →
| @@ -122,15 +122,15 @@ | ||
| 122 | 122 | 'message' => $requireDeposit |
| 123 | 123 | ? sprintf( |
| 124 | 124 | /* translators: 1: formatted deposit amount, 2: number of days before the trip. */ |
| 125 | 125 | __('A deposit of %1$s is required to confirm your booking. Full payment is due %2$d days before your trip.', 'yatra'), |
| 126 | - number_format($depositAmount, 2), | |
| 126 | + yatra_format_price((float) $depositAmount, null, false), | |
| 127 | 127 | $deadlineDays |
| 128 | 128 | ) |
| 129 | 129 | : sprintf( |
| 130 | 130 | /* translators: 1: formatted total amount, 2: number of days before the trip. */ |
| 131 | 131 | __('Your booking is reserved! Full payment of %1$s is due %2$d days before your trip.', 'yatra'), |
| 132 | - number_format($amount, 2), | |
| 132 | + yatra_format_price((float) $amount, null, false), | |
| 133 | 133 | $deadlineDays |
| 134 | 134 | ), |
| 135 | 135 | ]; |
| 136 | 136 | } |
| @@ -136,10 +136,18 @@ | ||
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | public function verifyPayment(string $transactionId): array |
| 139 | 139 | { |
| 140 | - // Pay later doesn't need verification at checkout | |
| 141 | - 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 | + ]; | |
| 142 | 150 | } |
| 143 | 151 | |
| 144 | 152 | /** |
| 145 | 153 | * Get auto-cancel days setting |