Skip to content

Commit

Permalink
Document Nets Easy payment method config. (#1801)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorntore authored Sep 25, 2024
1 parent 6281c70 commit 9b5d234
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ hidden: true
1. [Get your secret key from Nets.](https://developer.nexigroup.com/nexi-checkout/en-EU/docs/access-your-integration-keys/). Make sure you use the test key during development.
2. Make your app ready for use of Azure Key Vault as a config provider, if this has not been done before. See [relevant documentation](/altinn-studio/reference/configuration/secrets/).
3. Add your secret key to Key Vault, with the variable name `NetsPaymentSettings--SecretApiKey`. This way it will override `SecretApiKey` in `appsettings.json`.
4. Add `NetsPaymentSettings` to your `appsettings.json`. Remember to set the correct `baseUrl` in production. The field `MerchantHandlesConsumerData` is optional, and controls whether you are going to supply details about the payer, or if that should be filled out in the Nets Easy payment page.
4. Add `NetsPaymentSettings` to your `appsettings.json`.

```json
{
"NetsPaymentSettings": {
Expand All @@ -16,10 +17,17 @@ hidden: true
"TermsUrl": "https://www.yourwebsite.com/terms",
"ShowOrderSummary": true,
"ShowMerchantName": true,
"MerchantHandlesConsumerData": true
"MerchantHandlesConsumerData": true,
"PaymentMethodsConfiguration": [
{ "Name": "Visa", "Enabled": true },
{ "Name": "MasterCard", "Enabled": true }
]
}
}
```
- Remember to set the correct `baseUrl` in production using `appsettings.Production.json`. The example above contains the test api URL.
- The field `MerchantHandlesConsumerData` is optional, and controls whether you are going to supply details about the payer, or if that should be filled out in the Nets Easy payment page.
- PaymentMethodsConfiguration works just like explained in the Nets documentation [here](https://developer.nexigroup.com/nexi-checkout/en-EU/api/payment-v1/#v1-payments-post-body-paymentmethodsconfiguration-name).
5. Local mocking of `SecretApiKey` can be done with the use of [user secrets](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-8.0&tabs=windows).
```
dotnet user-secrets init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ hidden: true
1. [Hent din hemmelige nøkkel fra Nets.](https://developer.nexigroup.com/nexi-checkout/en-EU/docs/access-your-integration-keys/). Pass på at du bruker testnøkkelen under utvikling.
2. Gjør appen din klar for bruk av Azure Key Vault som konfigurasjonkilde, om dette ikke allerede er gjort tidligere. Se [relevant dokumentasjon](/nb/altinn-studio/reference/configuration/secrets/).
3. Legg til din hemmelige nøkkel i Key Vault, med variabelnavnet `NetsPaymentSettings--SecretApiKey`. På denne måten vil den overstyre `SecretApiKey` i `appsettings.json`.
4. Legg til `NetsPaymentSettings` i din `appsettings.json`. Husk å sette riktig `baseUrl` i `appsettings.Production.json`. Feltet `MerchantHandlesConsumerData` er frivillig, og styrer hvorvidt du skal sende med detaljer om betaler, eller om det skal fylles ut i Nets Easy sin betalingsside.
4. Legg til `NetsPaymentSettings` i din `appsettings.json`.
```json
{
"NetsPaymentSettings":
Expand All @@ -17,10 +17,17 @@ hidden: true
"TermsUrl": "https://www.yourwebsite.com/terms",
"ShowOrderSummary": true,
"ShowMerchantName": true,
"MerchantHandlesConsumerData": true
"MerchantHandlesConsumerData": true,
"PaymentMethodsConfiguration": [
{ "Name": "Visa", "Enabled": true },
{ "Name": "MasterCard", "Enabled": true }
]
}
}
```
- Husk å sette riktig `baseUrl` i `appsettings.Production.json`. Eksempelet ovenfor inneholder URL til test API-et.
- Feltet `MerchantHandlesConsumerData` er frivillig, og styrer hvorvidt du skal sende med detaljer om betaler, eller om det skal fylles ut i Nets Easy sin betalingsside.
- PaymentMethodsConfiguration fungerer likt som beskrevet i Nets sin dokumentasjon [her](https://developer.nexigroup.com/nexi-checkout/en-EU/api/payment-v1/#v1-payments-post-body-paymentmethodsconfiguration-name).
5. Lokal mocking av `SecretApiKey` kan gjøres ved hjelp av [user secrets](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-8.0&tabs=windows).
```
dotnet user-secrets init
Expand Down

0 comments on commit 9b5d234

Please sign in to comment.