npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-adyen-cse

v0.1.2

Published

adyen client side encryption for Node.js.

Downloads

4

Readme

node-adyen-cse

adyen client side encryption for Node.js.

Installing

npm install node-adyen-cse --save

For ubuntu users

sudo apt-get install libcurl3-dev
npm install node-adyen-cse --save

Usage

var adyen = require('node-adyen-cse');
adyen.test(user, pwd, opts, callback);

Example

Client-side

Include adyen.encrypt.js library as described here: https://github.com/Adyen/php/blob/master/2.API/httppost/create-payment-cse.php

HTML Form
```

<form method="POST" action="/api/payment" id="adyen-encrypted-form">
  <div class="form-group">
    <label for="adyen-encrypted-form-number">Card Number</label>
    <input type="text" class="form-control" id="adyen-encrypted-form-number" value="5555444433331111" size="20" autocomplete="off" data-encrypted-name="number">
  </div>
  <div class="form-group">
    <label for="adyen-encrypted-form-holder-name">Card Holder Name</label>
    <input type="text" class="form-control" id="adyen-encrypted-form-holder-name" value="John Doe" size="20" autocomplete="off" data-encrypted-name="holderName">
  </div>
  <div class="form-group">
    <label for="adyen-encrypted-form-cvc">CVC</label>
    <input type="text" class="form-control" id="adyen-encrypted-form-cvc" value="737" size="4" autocomplete="off" data-encrypted-name="cvc">
  </div>
  <div class="form-group col-xs-6">
    <label for="adyen-encrypted-form-expiry-month">Expiration Month (MM)</label>
    <input type="text" class="form-control" value="06" id="adyen-encrypted-form-expiry-month" size="2"  autocomplete="off" data-encrypted-name="expiryMonth">
  </div>
  <div class="form-group col-xs-6">
    <label for="adyen-encrypted-form-expiry-year">Expiration Year (YYYY)</label>
    <input type="text" class="form-control" value="2016" id="adyen-encrypted-form-expiry-year"  size="4"  autocomplete="off" data-encrypted-name="expiryYear">
  </div>
  
  <input type="hidden" id="adyen-encrypted-form-expiry-generationtime" data-encrypted-name="generationtime" />
  <button type="submit" class="btn btn-default">Create payment</button>
</form>

Server-side

var adyen = require('node-adyen-cse');
app.post('/api/payment', function (req, res) {
	var adyenRequestBody = {
		"action" : "Payment.authorise",
		"paymentRequest.merchantAccount" : "Hic2hMerchant",    
		"paymentRequest.amount.currency" : "EUR",
		"paymentRequest.amount.value" : "199",
		"paymentRequest.reference" : "TEST-PAYMENT-" + moment().format(),
		"paymentRequest.shopperIP" : "11.111.111.111",
		"paymentRequest.shopperEmail" : "[email protected]",
		"paymentRequest.shopperReference" : "test-hic2h", 
		"paymentRequest.fraudOffset" : "0",
		"paymentRequest.additionalData.card.encrypted.json" : req.body['adyen-encrypted-data']
	};

	adyen.test("[email protected]", "XXXXXXXXXXXXXXXXX", adyenRequestBody, function(err, response){
		res.json({err: err, response: response});
	});
});