-
Notifications
You must be signed in to change notification settings - Fork 116
DemoShop
DemoShop is an example web app implementing direct and card payments. It can be found in the DemoShop/DemoShop.Web solution directory.
Note: All types of payments require the CentralApi to be set up and running
On the home page, users can purchase products and create new ones.
When the Buy now button on the home page is clicked, a dialog box appears, where the user can choose a payment type or cancel the order.
After a payment type has been selected, an order is created and the user is redirected to a page where they can complete their payment.
On the My orders page, users can view their orders. Orders whose payment has been cancelled are listed as pending and buttons to complete the payment are displayed.
Settings are located in the appsettings.json configuration file of the DemoShop.Web project.
As both direct and card payments execute global transfers, valid information about the destination bank account (where money from all purchases on the DemoShop will be sent) has to be entered.
To do that, please modify the values in the DestinationBankAccountConfiguration section in appsettings.json.
Example:
"DestinationBankAccountConfiguration": {
"DestinationBankName": "Sample bank",
"DestinationBankCountry": "Germany",
"DestinationBankSwiftCode": "SAB",
"DestinationBankAccountUniqueId": "SABK54125796",
"RecipientName": "Hans Mueller"
}
In the DirectPaymentsConfiguration section in appsettings.json, there are several configuration options.
- SiteKey - The private key of the DemoShop website. This should be changed to prevent payment spoofing.
- CentralApiPublicKey - The public key of the CentralApi. It has to correspond to the one configured when setting up the CentralApi (if the private key of the CentralApi has not been changed, the default key will work).
-
SiteUrl - The base URL leading to the DemoShop (example:
https://www.demoshop.com/
) -
CentralApiPaymentUrl - The full CentralApi URL for processing direct payments (example:
https://centralapi.banksystem.com/pay
). This is where the user will be redirected after clicking on the Direct payment button.
The value of CentralApiCardPaymentsUrl is the complete URL where payment details are sent for processing (example: https://centralapi.banksystem.com/api/cardpayments
)