Go to file
Vitaly 9cb9649bf2
Merge pull request #1 from YenePay/master
Secure the order token using the client secret
2020-06-15 09:40:25 +04:00
.gitignore Update Ecwid CSS Framework to 1.3.6 and remove header 2019-04-18 18:13:02 +04:00
CssFw.css Initial commit 2018-08-28 15:46:55 +04:00
functions.js Update merchant interface template; bugfixes 2018-11-19 11:57:49 +04:00
index.html Update CSS framework version 2020-06-11 18:02:12 +04:00
LICENSE Initial commit 2018-08-28 15:37:52 +04:00
payment-request.php encrypt the order token (i.e. which is used to modify the order status ) with the client_secret. 2020-06-12 23:24:17 +03:00
README.md Initial commit 2018-08-28 15:46:55 +04:00

Payment Gateway Integration Template

This is a sample code for creating a native payment integration for Ecwid.

It has the following features:

  • automated read/save of user's settings
  • up-to-date elements for user interface
  • basic initialization and interaction with Ecwid JS SDK

Files' descriptions

  • payment-request.php payment URL for the integration. Customers will be directed to that URL at the checkout to make the payment for order. It will also be used to update order status when callback is received from payment

  • index.html, functions.js, CssFw.css files for merchant settings in Ecwid Control Panel

How to use automated functions to read/save user's settings:

  1. Assign data-* elements to user input elements

These functions support various user inputs:

  • inputs: radio, checkbox, text
  • select
  • textarea

Start by marking user inputs with data-* elements with these names:

Name Type Description
data-visibility string Field visibility - where to save the value: to private or public application storage
data-name string Field key to be used to save to application storage

Possible values of data-visibility: "public", "private"

Possible values of data-name: any value, except for "public"

  1. Set default values for new users

In functions.js find the initialConfig object. It contains default user settings map the keys and values with the ones you've set in the HTML for user inputs.


After that, use functions: setValuesForPage() and readValuesFromPage() to work with the page when you need to save or set values for the page.