refactor(odeme): update environment variable usage and documentation
All checks were successful
Deploy / deploy (push) Successful in 8m39s
All checks were successful
Deploy / deploy (push) Successful in 8m39s
Replaced `NEXT_PUBLIC_APP_URL` with `APP_URL` in the payment processing logic to ensure proper runtime access. Updated related documentation to clarify the distinction between build-time and runtime environment variables, emphasizing the importance of using `APP_URL` for callback and webhook URLs. Adjusted references in the codebase to reflect this change, enhancing clarity and functionality in the payment flow.
This commit is contained in:
@@ -10,14 +10,20 @@ zaman bize ulaşmaz, kullanıcı iyzico'nun barındırdığı ödeme sayfasına
|
||||
| `IYZICO_API_KEY` | Merchant Portal → Ayarlar → API anahtarları |
|
||||
| `IYZICO_SECRET_KEY` | Aynı ekran. İmza doğrulamasında da kullanılır |
|
||||
| `IYZICO_BASE_URL` | Sandbox: `https://sandbox-api.iyzipay.com` · Canlı: `https://api.iyzipay.com` |
|
||||
| `NEXT_PUBLIC_APP_URL` | callback ve webhook URL'lerinin kökü; **https ve geçerli SSL şart** |
|
||||
| `APP_URL` | callback ve yönlendirme URL'lerinin kökü; **https ve geçerli SSL şart**. Verilmezse `BETTER_AUTH_URL`'e düşer |
|
||||
|
||||
`IYZICO_BASE_URL` verilmezse sandbox'a düşülür. Prod'da bu durum log'a uyarı
|
||||
basar — canlıya çıkarken bu satır mutlaka ayarlanmalı.
|
||||
|
||||
Kök adres `NEXT_PUBLIC_APP_URL` ile **verilemez**: `NEXT_PUBLIC_*` değişkenleri
|
||||
build sırasında koda gömülür, Docker build'i ise `.env.production`'ı görmez
|
||||
(`.dockerignore` `.env*`'i dışlar). Sonuç, env doğru girilmiş olsa bile imaja
|
||||
`http://localhost:3000` çakılması ve iyzico'nun initialize'ı reddetmesiydi.
|
||||
Ayrıntı: `src/lib/app-url.ts`.
|
||||
|
||||
> Lokal `http://localhost:3000` ile uçtan uca test edilemez: iyzico callback
|
||||
> adresinden geçerli SSL ister. Sandbox testinde tünel (cloudflared/ngrok) açıp
|
||||
> `NEXT_PUBLIC_APP_URL`'i o https adrese ayarla.
|
||||
> `APP_URL`'i o https adrese ayarla.
|
||||
|
||||
## Akış
|
||||
|
||||
|
||||
Reference in New Issue
Block a user