← All changes
|
app/PaymentGateways/Gateways/PayLater/PayLaterGateway.php
+10
-2
3.0.11
→
3.0.17
View file →
| @@ -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 |