Swish
No edit summary
(Automatically adding template at the end of the page.)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Swish is a mobile payment solution backed by a number of Swedish banks. If you want to support this in your application, you need a special agreement with your bank, but they offer a Swish simulator useful for development purposes.  
Swish is a mobile payment solution backed by several Swedish banks. To support this in your application, you need a special agreement with your bank - but they offer a Swish simulator useful for development purposes.  


Go to Swish for merchants at [[https://www.swish.nu/developer#swish-for-merchants]] and download the Simulator guide (zipfile) containing both a PDF with instructions and a number of certificates.  
Go to Swish for merchants at [[https://www.swish.nu/developer#swish-for-merchants]] and download the Simulator guide (zip file) containing both a PDF with instructions and a number of certificates.  


In principle is the payment (for merchants) started by a PUT operation using a Json PAYMENT OBJECT using a certificate. The user pays using a mobile and the Swish server issues a callback to your server with the result using a POST containing the result.
In principle, the payment (for merchants) is started by a PUT operation using a Json PAYMENT OBJECT using a certificate. The user pays using a mobile and the Swish server issues a callback to your server with the result using a POST containing the result.


[[File:Swish1.png|frameless|839x839px]]
[[File:Swish1.png|frameless|839x839px]]


Using a web app on Azure, install the .pfx certificates (in the zip) for merchants as '''Private Key Certificates'''. Also, install the corresponding '''Public Key Certificates'''. I did this by importing the .pfx to the windows key store on my developer machine and then exporting the public key (for import to Azure).
Using a web app on Azure, install the .pfx certificates (in the zip) for merchants as '''Private Key Certificates'''. Also, install the corresponding '''Public Key Certificates'''. I did this by importing the .pfx to the Windows key store on my developer machine and then exporting the public key (for import to Azure).


Gotchas: When importing the cert to the local machine, use double-click on the certificate to start the import. I had some issues with getting it to work locally before I did that.  
'''Gotchas:''' When importing the cert to the local machine, use double-click on the certificate to start the import. I had some issues with getting it to work locally before I did that.  


The certificate needs to be installed in the machine initiating the call, server, or others. Run it using the debugger - your machine will log if the certificate thumbprint is found in the logging part of the debugger.
The certificate should be installed in the machine initiating the call, server, or others. Run it using the debugger - your machine will log if the certificate thumbprint is found in the logging part of the debugger.


Also, I added the ''application setting'': WEBSITE_LOAD_CERTIFICATES with the value "*" in order to ensure that the web app has access to the certificate.
Also, I added the ''application setting'': WEBSITE_LOAD_CERTIFICATES with the value "*" to ensure that the web app has access to the certificate.


The SWISH-server callback is a POST using a JSON raw body as described here [[https://wiki.mdriven.net/index.php/Rest_Services_In_MDriven]] '''Receive string content'''
The SWISH-server callback is a POST using a JSON raw body as described here [[https://wiki.mdriven.net/index.php/Rest_Services_In_MDriven]] '''Receive string content'''
[[Category:Payments]]
[[Category:Payments]]
{{Edited|July|12|2024}}

Latest revision as of 15:47, 10 February 2024

Swish is a mobile payment solution backed by several Swedish banks. To support this in your application, you need a special agreement with your bank - but they offer a Swish simulator useful for development purposes.

Go to Swish for merchants at [[1]] and download the Simulator guide (zip file) containing both a PDF with instructions and a number of certificates.

In principle, the payment (for merchants) is started by a PUT operation using a Json PAYMENT OBJECT using a certificate. The user pays using a mobile and the Swish server issues a callback to your server with the result using a POST containing the result.

Swish1.png

Using a web app on Azure, install the .pfx certificates (in the zip) for merchants as Private Key Certificates. Also, install the corresponding Public Key Certificates. I did this by importing the .pfx to the Windows key store on my developer machine and then exporting the public key (for import to Azure).

Gotchas: When importing the cert to the local machine, use double-click on the certificate to start the import. I had some issues with getting it to work locally before I did that.

The certificate should be installed in the machine initiating the call, server, or others. Run it using the debugger - your machine will log if the certificate thumbprint is found in the logging part of the debugger.

Also, I added the application setting: WEBSITE_LOAD_CERTIFICATES with the value "*" to ensure that the web app has access to the certificate.

The SWISH-server callback is a POST using a JSON raw body as described here [[2]] Receive string content

This page was edited 89 days ago on 02/10/2024. What links here