Developers

Integrate mobile payments and monetize with Mocopay

Our developer center provides all the details for a simple and smooth integration so you could easily add mobile payments with Mocopay.

Calculating signature

When WEB SDK is used in advanced mode signature is self calculated and sent in data-spgw-signature parameter of payment button DIV.

Content of signature parameter  is constructed in following form:

<api-key>:<base64(MD5(signaturestring))>

Guide for preparing 

signaturestring

which needs to be MD5 coded:

  • sort all DIV parameters in a form of their API names in initPayment API method together with their values, sorting is done based on the first character in parameter name (by character code in strict ASCII order e.g. a parameter name that begins with the uppercase letter F (ASCII code 70) precedes a parameter name that begins with a lowercase letter b (ASCII code 98).)
  • append sorted parameters to request URI: /v1/payment/initPayment/?
  • append request URI with sorted parameters to API secret given from MoCoPay for your service

Example:

API key: app1

API secret: this.is.a.secret

URI with sorted parameters: /v1/payment/initPayment/?mcc=228&mnc=01&pid=12000&userId=123456789

Signaturestring: this.is.a.secret/v1/payment/initPayment/?mcc=228&mnc=01&pid=12000&userId=123456789

Produced signature content (<api-key>:<base64(MD5(signaturestring))>):

app1:WETDyNQLx0+8BJ16vDgiVg==