diff --git a/README.md b/README.md index 646e5fb..878767e 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,6 @@ Add your merchant credentials to `.env`: SIMPLEPAY_SANDBOX=true SIMPLEPAY_HUF_MERCHANT=your_merchant_id SIMPLEPAY_HUF_SECRET_KEY=your_secret_key -SIMPLEPAY_BACK_URL=https://yourdomain.com/payment/back ``` ## Usage @@ -528,10 +527,8 @@ Key `.env` variables: SIMPLEPAY_SANDBOX=true SIMPLEPAY_HUF_MERCHANT=your_merchant_id SIMPLEPAY_HUF_SECRET_KEY=your_secret_key -SIMPLEPAY_BACK_URL=https://yourdomain.com/payment/back SIMPLEPAY_TIMEOUT=600 SIMPLEPAY_LOG_CHANNEL=simplepay -SIMPLEPAY_AUTO_CHALLENGE=true SIMPLEPAY_GOOGLE_PAY_MERCHANT_ID=your_google_pay_merchant_id SIMPLEPAY_GOOGLE_PAY_MERCHANT_NAME="Your Shop" ``` @@ -545,6 +542,8 @@ SIMPLEPAY_USD_MERCHANT=your_usd_merchant_id SIMPLEPAY_USD_SECRET_KEY=your_usd_secret_key ``` +The config file also defines `urls.back` (`SIMPLEPAY_BACK_URL`) and `auto_challenge` (`SIMPLEPAY_AUTO_CHALLENGE`), but the package does not read them, so they have no effect. A payment only uses the `url` you pass to its request, such as `route('simplepay.back')`, and your application handles a 3DS challenge itself: see [Error Handling](#error-handling). + ## Logos and Assets The package includes the official SimplePay merchant logo pack. Publish the assets: diff --git a/config/simplepay.php b/config/simplepay.php index dac4454..b6d9b84 100644 --- a/config/simplepay.php +++ b/config/simplepay.php @@ -62,8 +62,11 @@ | URLs |-------------------------------------------------------------------------- | - | back: The URL where SimplePay redirects the customer after payment. - | ipn: The route name for the IPN webhook endpoint. + | The package does not read these values; they are here for your own use. + | + | back: A place for your own back URL. A payment only uses the URL you + | pass to its request, such as route('simplepay.back'). + | ipn: The name of the package's IPN route. | */ @@ -126,7 +129,9 @@ | Auto Challenge |-------------------------------------------------------------------------- | - | Automatically handle 3DS challenge flow for AutoPayment transactions. + | Not used: the package does not read this value, so it has no effect. + | SimplePay reports a 3DS challenge as error code 3004 with a redirectUrl, + | and your application sends the customer there. | */ diff --git a/examples/en/configuration.md b/examples/en/configuration.md index 946493f..0539f96 100644 --- a/examples/en/configuration.md +++ b/examples/en/configuration.md @@ -18,7 +18,6 @@ SIMPLEPAY_HUF_MERCHANT=your_huf_merchant_id SIMPLEPAY_HUF_SECRET_KEY=your_huf_secret_key SIMPLEPAY_EUR_MERCHANT=your_eur_merchant_id SIMPLEPAY_EUR_SECRET_KEY=your_eur_secret_key -SIMPLEPAY_BACK_URL=https://yourdomain.com/payment/back SIMPLEPAY_LOG_CHANNEL=simplepay SIMPLEPAY_TIMEOUT=600 SIMPLEPAY_GOOGLE_PAY_MERCHANT_ID=your_google_pay_merchant_id @@ -75,19 +74,26 @@ return [ | sandbox setting. You typically don't need to change these. | */ - 'api_url' => env('SIMPLEPAY_API_URL', 'https://secure.simplepay.hu/payment/v2'), - 'sandbox_api_url' => env('SIMPLEPAY_SANDBOX_API_URL', 'https://sandbox.simplepay.hu/payment/v2'), + 'api' => [ + 'live' => 'https://secure.simplepay.hu/payment', + 'sandbox' => 'https://sandbox.simplepay.hu/payment', + 'live_securepay' => 'https://securepay.simplepay.hu', + 'sandbox_securepay' => 'https://sandbox.simplepay.hu', + ], /* |-------------------------------------------------------------------------- - | Back URL + | URLs |-------------------------------------------------------------------------- | - | Default URL where customers are redirected after payment. - | Can be overridden per transaction in the PaymentRequest. + | The package does not read these values. `back` is a place for your own + | back URL; `ipn` is the name of the package's IPN route. | */ - 'back_url' => env('SIMPLEPAY_BACK_URL'), + 'urls' => [ + 'back' => env('SIMPLEPAY_BACK_URL'), + 'ipn' => 'simplepay.ipn', + ], /* |-------------------------------------------------------------------------- @@ -130,7 +136,7 @@ return [ | Auto Challenge |-------------------------------------------------------------------------- | - | When enabled, the package automatically handles 3DS challenge flows. + | Not used: the package does not read this value, so it has no effect. | */ 'auto_challenge' => env('SIMPLEPAY_AUTO_CHALLENGE', true), @@ -186,9 +192,14 @@ The `timeout` value (in seconds) controls how long a payment session remains val The default value is 600 seconds (10 minutes). -## Auto Challenge +## Unused Settings + +Two settings are in the config file, but the package does not read them, so changing them has no effect: + +- `urls.back` (`SIMPLEPAY_BACK_URL`): a place for your own back URL. A payment only uses the `url` you pass to its request, such as `route('simplepay.back')`; see [Back URL Handling](back-url.md). +- `auto_challenge` (`SIMPLEPAY_AUTO_CHALLENGE`): the package does not handle a 3DS challenge on its own. SimplePay reports a challenge as error code `3004` with a `redirectUrl`, and your application sends the customer there; see [Card Storage](card-storage.md). -When `auto_challenge` is enabled, the package automatically handles 3D Secure challenge flows during card payments. This is enabled by default and is recommended for most use cases. +Both keys stay in the config file, so an application that reads them itself (for example `config('simplepay.urls.back')`) keeps working. ## Google Pay diff --git a/examples/hu/konfiguracio.md b/examples/hu/konfiguracio.md index e7da846..9d23950 100644 --- a/examples/hu/konfiguracio.md +++ b/examples/hu/konfiguracio.md @@ -18,7 +18,6 @@ SIMPLEPAY_HUF_MERCHANT=your_huf_merchant_id SIMPLEPAY_HUF_SECRET_KEY=your_huf_secret_key SIMPLEPAY_EUR_MERCHANT=your_eur_merchant_id SIMPLEPAY_EUR_SECRET_KEY=your_eur_secret_key -SIMPLEPAY_BACK_URL=https://yourdomain.com/payment/back SIMPLEPAY_LOG_CHANNEL=simplepay SIMPLEPAY_TIMEOUT=600 SIMPLEPAY_GOOGLE_PAY_MERCHANT_ID=your_google_pay_merchant_id @@ -71,25 +70,30 @@ return [ | API URLs |-------------------------------------------------------------------------- | - | The sandbox and live API URLs of SimplePay. + | The package selects the API URL by the sandbox setting. | Usually there is no need to change them. | */ - 'urls' => [ - 'sandbox' => 'https://sandbox.simplepay.hu/payment/v2', - 'live' => 'https://secure.simplepay.hu/payment/v2', + 'api' => [ + 'live' => 'https://secure.simplepay.hu/payment', + 'sandbox' => 'https://sandbox.simplepay.hu/payment', + 'live_securepay' => 'https://securepay.simplepay.hu', + 'sandbox_securepay' => 'https://sandbox.simplepay.hu', ], /* |-------------------------------------------------------------------------- - | Back URL + | URLs |-------------------------------------------------------------------------- | - | The default back URL where the customer arrives after the - | payment. You can override it in the PaymentRequest. + | The package does not read these values. `back` is a place for your own + | back URL; `ipn` is the name of the package's IPN route. | */ - 'back_url' => env('SIMPLEPAY_BACK_URL'), + 'urls' => [ + 'back' => env('SIMPLEPAY_BACK_URL'), + 'ipn' => 'simplepay.ipn', + ], /* |-------------------------------------------------------------------------- @@ -132,7 +136,7 @@ return [ | Auto Challenge (3DS) |-------------------------------------------------------------------------- | - | Automatic 3D Secure challenge request. + | Not used: the package does not read this value, so it has no effect. | */ 'auto_challenge' => env('SIMPLEPAY_AUTO_CHALLENGE', true), @@ -206,13 +210,14 @@ SIMPLEPAY_TIMEOUT=900 # 15 minutes Ez azt jelenti, hogy a vásárlónak ennyi ideje van befejezni a fizetést a SimplePay oldalán. -## Auto challenge (3DS) +## Nem használt beállítások -Az `auto_challenge` beállítás szabályozza, hogy a package automatikusan kéri-e a 3D Secure hitelesítési kivételt. Alapértelmezetten be van kapcsolva: +Két beállítás szerepel a konfigurációs fájlban, de a package nem olvassa őket, ezért a módosításuknak nincs hatása: -```env -SIMPLEPAY_AUTO_CHALLENGE=true -``` +- `urls.back` (`SIMPLEPAY_BACK_URL`): hely a saját back URL-ednek. Egy fizetés csak azt a címet használja, amelyet a kérés `url` paraméterében átadsz, például `route('simplepay.back')`; lásd [Back URL kezelése](visszaterites.md). +- `auto_challenge` (`SIMPLEPAY_AUTO_CHALLENGE`): a package nem kezeli magától a 3DS challenge-et. A SimplePay a challenge-et `3004`-es hibakóddal és egy `redirectUrl` címmel jelzi, a vásárlót az alkalmazásod irányítja oda; lásd [Kártyatárolás](kartya-tarolas.md). + +Mindkét kulcs a konfigurációs fájlban marad, így az az alkalmazás, amelyik maga olvassa őket (például `config('simplepay.urls.back')`), továbbra is működik. ## Google Pay diff --git a/resources/boost/skills/simplepay-development/SKILL.md b/resources/boost/skills/simplepay-development/SKILL.md index 3d498ae..ae84c1c 100644 --- a/resources/boost/skills/simplepay-development/SKILL.md +++ b/resources/boost/skills/simplepay-development/SKILL.md @@ -430,16 +430,16 @@ SIMPLEPAY_HUF_MERCHANT=merchant_id SIMPLEPAY_HUF_SECRET_KEY=secret_key SIMPLEPAY_EUR_MERCHANT=eur_merchant_id SIMPLEPAY_EUR_SECRET_KEY=eur_secret_key -SIMPLEPAY_BACK_URL=https://yourdomain.com/payment/back SIMPLEPAY_TIMEOUT=600 SIMPLEPAY_LOG_CHANNEL=simplepay -SIMPLEPAY_AUTO_CHALLENGE=true SIMPLEPAY_GOOGLE_PAY_MERCHANT_ID=google_pay_merchant_id SIMPLEPAY_GOOGLE_PAY_MERCHANT_NAME="Shop name" ``` Multi-currency: configure separate merchant credentials per currency (HUF, EUR, USD). +The config file also defines `urls.back` (`SIMPLEPAY_BACK_URL`) and `auto_challenge` (`SIMPLEPAY_AUTO_CHALLENGE`), but the package does not read them: pass the back URL as `url` on each request, and handle a 3DS challenge (error code 3004, `redirectUrl`) in the application. + Publish config with: `php artisan vendor:publish --tag=simplepay-config` (or `--tag=simplepay` for config and logos). ## Logo and asset publishing