Socket
Socket
Sign inDemoInstall

wmer

Package Overview
Dependencies
93
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    wmer

Payment client for wmer.ru


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

wmer

Payment client for wmer.ru

Installation

$ npm wmer express --save

Usage

var Wmer = require('wmer'),
    wmer = new Wmer({
            login   : 'account login',
            password: 'account apassword',
            key     : 'API key',
            proxy   : 'http://proxy' // optional for test and scalability purpose
        });

wmer.rate('WMR', 'account_rur', 100).then(function(result) {
    console.log(result);
    // { rates:
    //    { error: '0',
    //      result_currency: 'account_rur',
    //      result_cnt: '100.00',
    //      date: '2014-08-23 06:39:03',
    //      ratelist: { rate: [Object] }
    //     }
    // }
});

API

Client's methods return Bluebird Promises.

.merchant()

has not implemented yet

.currency()

Getting currencies list

    wmer.currency().then(function(result) {
        console.log(result);
        // { currencylist:
        //     {
        //         currecy: [
        //             { code: '24au_rur', name: '24au рубли' },
        //             { code: 'account_rur', name: 'Account RUR' },
        //             { code: 'astron_rur', name: 'Астрон рубли' },
        //             { code: 'atllantv_rur', name: 'Атлантик рубли' },
        //             { code: 'atllan_rur', name: 'Атлантик рубли' },
        //             { code: 'averstelecom_rur', name: 'Аверс-Телеком рубли' },
        //             { code: 'cablecity_rur', name: 'CableCity рубли' },
        //             { code: 'cifromig_rur', name: 'Цифромиг рубли' }
        //             ...
        //         ]
        //     }
        // }
    });
.rate(sourceCurrency, resultCurrency, resultCount)

Getting current rate for exchange

wmer.rate('WMR', 'account_rur', 100).then(function(result) {
    console.log(result);
    // { rates:
    //    { error: '0',
    //      result_currency: 'account_rur',
    //      result_cnt: '100.00',
    //      date: '2014-08-23 06:39:03',
    //      ratelist: { rate: [Object] }
    //     }
    // }
});
.rpistateop(orderId, operationPassworMD5)

Getting payment iperation state

.balance()

Getting account balance

.getProviderByPhone(phone)

Get mobile Provider Id By Phone number, undocumented API method

.operation(orderId, currency, purse, amount, description)

Send Payment Interface (Интерфейс отправки платежа). Sending money to client account.

.operationMobile(orderId, phone, amount, description)

Shortcut method for .opration() method for mobile payment operation. Does automatic lookup for providerId

Testing

For testing you need to run test form production envirement or set up simple proxy server, because wmer.ru requires to specify static IP for API calls. I created simple node.js based proxy server https://github.com/RomanMinkin/simple-proxy-server, feel free to use it.

Before testig you you need to create config file in the root folderon this project .config.json:

{
    "login"   : "account login",
    "password": "account password",
    "key"     : "AIP service key",
    "proxy"   : "http//:proxy-url"
}

Runing tests

$ npm test

Runing tests with debug on

DEBUG=wmer npm test

Keywords

FAQs

Last updated on 10 Sep 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc