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-sofort

v0.1.1

Published

sofort.com gateway for node.js and io.js

Downloads

25

Readme

node-sofort

Module to use sofort.com "sofort gateway" with node.js and iojs.

Installation

Install with npm

npm install node-sofort

Example

'use strict';
var util = require('util');
var Sofort = new (require('./lib/sofort'))({
		configKey : '12345:12345:0082483e03f368a0f89be9b6d381822d'
	});

try {
	Sofort.createPayment(10.00, 'EUR', ['Demo1'], {}, function (err, data) {
		console.log(data);
	});
} catch (e) {
	console.log(e);
}


try {
	Sofort.parseNotification('<?xml version="1.0" encoding="UTF-8" ?><status_notification><transaction>27276-146697-55E48EAD-A3EB</transaction><time>2015-08-30T22:30:29+02:00</time></status_notification>',function(err,result){
		console.log(util.inspect(result, {showHidden: false, depth: null}));
	});
} catch (e) {
	console.log(e);
}

createPayment(amount,currency,[reason1,reason2], options, callback)

amount

Decimal (8.2) Please note that if the currency_code is "HUF" and a float value has been assigned in API-step 1 the returned amount is rounded to the nearest integer value. (e.g. 1000.50 > 1001 and 1000.49 > 1000).


currency

supported (At this time, only EUR, GBP, CHF, PLN, HUF, and CZK are accepted.)


reason1/reason2

Reason; please transfer a unique value (e.g. order ID and customer ID, "OID018293 CID00131"), only the following characters are allowed: '0-9', 'a-z', 'A-Z', ' ', '+', ',', '-', '.'. Umlauts are replaced, e.g. ä -> ae. Other characters will be removed for the display on our payment page and for notifications. Therefore, a modified string for reason may be transmitted for redirections (success and abort link and notifications). If the transaction ID of SOFORT Banking should be used as reason, the parameter '-TRANSACTION-' can be inserted in the reason String.

Important: Some banks do not display the entire characters of both reasons, e.g. on the account statements the last characters are cut off. Therefore, the important data should be inserted at the beginning of the first reason field.

  • Banks of Great Britain (GB) only support 18 digits per reason so we encourage to consider this for integrations that are used in this market.

Options

See https://www.sofort.com/integrationCenter-eng-DE/content/view/full/2513 6.1.2

user_variable - String (255)

{ user_variables: ['variable1','variable2'...'variable20'] }

email_customer - String (255)

{ email_customer: '[email protected]' }

phone_customer - String (255)

Phone number of your customer (begins with "+"; possible characters: "0-9 , - / ( )", no letters! )

{ phone_customer: '+49....' }

success_url - String (255)

Success link, overwrites the default value from the project settings. Is called when your customer successfully executed SOFORT Banking and the transfer has been listed in the customer's online banking. If the transaction ID of SOFORT Banking should be used as part of the URL, the parameter '-TRANSACTION-' can be inserted in the URL String.

  • If no success link is defined in the project settings this parameter becomes mandatory

{ success_url: 'https://www.example.com/sofort/success' }

success_link_redirect - Boolean

Automatic redirection to success page. If this has not been activated, a summary page of SOFORT GmbH will be displayed to the customer. Overwrites project settings.

{ success_link_redirect: true }

abort_url - String (255)

Abort link, overwrites the default value from the project settings. Is called when SOFORT Banking could not be completed successfully (e.g. upon cancellation by the customer or insufficient funds). If the transaction ID of SOFORT Banking should be used as part of the URL, the parameter '-TRANSACTION-' can be inserted in the URL String.

  • If no abort link is defined in the project settings this parameter becomes mandatory

{ abort_url: 'https://www.example.com/sofort/abort' }

timeout_url - String (255)

Timeout link, overwrites the default value from the project settings. Is called when the timeout value stored in the project settings has been expired on the payment wizard. If the transaction ID of SOFORT Banking should be used as part of the URL, the parameter '-TRANSACTION-' can be inserted in the URL String.

{ timeout_url: 'https://www.example.com/sofort/timeout' }

notification_url - String (255) - max 5 items

Notification link. If the transaction ID of SOFORT Banking should be used as part of the URL, the parameter '-TRANSACTION-' can be inserted in the URL String.

{ notification_urls: ['https://www.example.com/sofort/notify1', ... , 'https://www.example.com/sofort/notify5'] }

or

{ notification_urls: [{_:'https://www.example.com/sofort/notify1',_notify_on:'pending, loss'}, {_:'https://www.example.com/sofort/notify2',_notify_on:'received'}, ... , 'https://www.example.com/sofort/notify5'] }

Notification link; by replacing the part "xyz" by a special status, only this URL is used for notifications with this status. It is possible to enter several statuses separated by commas, e.g <notification_url notify_on="pending, loss">. Possible statuses are "received", "loss", "refunded", and "pending" (whereupon "pending" matches the equivalent status "pending - not_credited_yet" and "untraceable - sofort_bank_account_needed". Details can also be found in the corresponding section. (see DOCUMENTATION)

notification_email - String (255) - max 5 items

same as before but with email addresses

{ notification_emails: ['[email protected]', ... , '[email protected]'] }

customer_protection - Boolean

1 = buyer protection active; should only be used if the additional SOFORT Banking feature "buyer protection" has been agreed between merchant and SOFORT.

{ su: {customer_protection: 1 } }

To use some options at ones give a json object like:

{ 
	user_variables: ['variable1','variable2'...'variable20'],
	success_url: 'https://www.example.com/sofort/success',
	success_link_redirect: true,
	abort_url: 'https://www.example.com/sofort/abort',
	notification_urls: ['https://www.example.com/sofort/notify1', ... , 'https://www.example.com/sofort/notify5'],
	su: {customer_protection: 1 }
}

License

MIT