Overview
This page shows you how to run and customize various Simply Connect examples using the JSFiddle demonstration environment.
To accept a payment, first perform the steps to initiate a session.
Initiating a Session
- Before you can submit a payment with our client-side Simply Connect, you need to send the /openOrder API call, which has two main functions:
- Authenticates you as our merchant using your given credentials. You can find your credentials here.
- Sets up an order in the Nuvei system to contain the transaction details, and returns a
sessionToken
, which is referenced later in thecheckout()
method.
Editing Sample Code in JSFiddle
Each scenario contains example-code that you can edit.
-
- To edit, press Edit in JSFiddle in the top right corner.
This redirects you to a page where you run and test the code. - On the JSFiddle page, set your credentials in the section at the top of the page:
var sfc = SafeCharge({ env: 'int', // Nuvei API environment - 'int' (integration) or 'prod' (production - default if omitted) merchantId: '', //as assigned by Nuvei merchantSiteId: '' // your Merchant Site ID provided by Nuvei });
- To edit, press Edit in JSFiddle in the top right corner.
Feel free to change your code, including the HTML and CSS.