Searching 916 files for "Samurai"

/home/evaleto/nodejs/git/node-postfinance/GETTING_STARTED.mkd:
    1  ## Getting started
    2  
    3: Fee Figters' [Samurai](http://feefighters.com/samurai) payment gateway is
    4  currently in beta. Before joining the beta program and getting an account, it
    5  is highly recommended that you get your merchant account first. After signing
    6: up with Samurai, you will receive three HEX tokens:
    7  
    8:  + Merchant key - used to identify your account on Samurai
    9:  + API password - password for you Samurai account
   10   + Processor ID - the ID of the gateway that you will use for transactions
   11  
   ..
   17  ### Overview
   18  
   19: When using the Samurai payment gateway, you basically deal with two separate
   20  concepts: payment methods (cards) and transactions (making/loosing money).
   21  Daimyo's API reflects this dualism. It provides two main constructors that you
   ..
   25  
   26   + `card.create()`: cretes a new payment methods
   27:  + `card.load()`: fetches payment method data from the Samurai vault
   28   + `card.update()`: updates the payment method details
   29:  + `card.retain()`: instructs Samurai to permanently save the payment method
   30:  + `card.redact()`: instructs Samurai to remove the payment method from vault
   31  
   32  (See notes about PCI compliance before you start using some of these methods.)
   ..
   42  ### Notes on PCI compliance
   43  
   44: There are two ways you can use the Samurai gateway with Daimyo in terms of
   45  payment methods management. One is server-to-server, where you handle the 
   46  cardholder data, and pass them on to the gateway. Another method is transparent
   ..
  105      });
  106  
  107: Samurai gatway uses transparent redirect method to process credit card
  108  information. The way it works is, user submits the card and billing data
  109: directly to Samurai, and it redirects the user back to your site attaching a
  110  payment method token to the request. You have to access to credit card data in
  111  any part of the work flow. Daimyo provides a `create` method, which allows you
  ...
  235  
  236  The card, when initilized, is still not a valid _payment method_. You have to
  237: actually create in on Samurai gateway in order to make purchases. You can do 
  238  that like so:
  239  
  ...
  254  
  255   + 'Error making create payment method request': Daimyo is not properly
  256:    configured (e.g., missing Samurai gateway credentials), or the request
  257:    failed for some reason and the response was unreadable (e.g., Samurai was
  258     offline)
  259   + 'Gateway responded with non-302 status': This is rare, but means that
  260:    Samurai received malformed data. If this happens, please report it as a bug.
  261:  + 'Gateway failed to send the location header': This is a Samurai bug, but
  262     report it to us anyway.
  263  
  ...
  276  payment token, either when doing the transparent redirect, or after you created
  277  the payment method using the `create` method. You can now use the `load` method
  278: to fetch payment method details from Samurai server.
  279  
  280      var myToken = 'xxxxxxxxxxxxxxxxxxxxxxxx';
  ...
  286  The card object has all the fields populated. There are also two new fields:
  287  
  288:  + messages: contains any Samurai gateway messages about the card
  289   + method: contains meta-information about the payment method
  290  
  ...
  327  ### Retention and redaction
  328  
  329: Samurai has a built-in vault that can safely store your payment methods. Well,
  330  they aren't yours, but... you know what I mean. :) Usage of this vault is
  331  pretty much automatic. As soon as you create a new card, it is stored in the
  ...
  335  wish to keep the payment methods stored for longer periods, you can use the
  336  `retain()` method. Let's say you have a newly created card. To retain it,
  337: simply instruct the Samurai to do so:
  338  
  339      card.retain(function(err) {
  ...
  347  
  348  When your user supplies you a new card, or simply wants you to remove their 
  349: records, use the `redact()` method to have the card removed from the Samurai
  350  vault.
  351  
  ...
  370  transaction objects.
  371  
  372: There are currenly 5 transaction types supported by Samurai: 
  373  
  374   + _purchase_: make immediate authorization and capture of the funds

/home/evaleto/nodejs/git/node-postfinance/README.mkd:
    1: # Daimyo: Samurai payment gateway integration library
    2  
    3  v0.1.5
    .
   14  
   15  Daimyo (pronounced as _dah-e-myoh_) is a client library for the 
   16: [Samurai payment gateway](http://samurai.feefighters.com/) from
   17  [Fee Fighters](http://feefighters.com/). By the time 1.0 release is made,
   18: Daimyo will support all of Samurai's API, but the current immediate goal is to
   19  support the sale transactions and provide robust error reporting facilities.
   20  
   21: ## Daimyo vs samurai-client-nodejs
   22  
   23: Daimyo is an _unofficial_ client library for the Samurai gateway. Fee Fighters
   24  maintain a fork of Daimyo that is called
   25: [samurai-client-nodejs](https://github.com/FeeFighters/samurai-client-nodejs).
   26  While the latter is meant to address every possible scenario required by all
   27: Samurai users, Daimyo was written for the sole purpose of catering the needs of
   28  [Herd Hound](http://www.herdhound.com/). While I tried to cover the whole
   29: Samurai API with Daimyo, not all parts of the API will get equal attention, as
   30: Herd Hound itself doesn't use all Samurai functionality.
   31  
   32  Of course, this does not mean that Daimyo's developer will not respond to bug
   ..
   34  to help you out. 
   35  
   36: This also doesn't mean that we don't keep an eye on the samurai-client-nodejs.
   37  We will merge or copy anything and everything that can benefit Daimyo users
   38  (ourselves included). What we _won't_ do is break the Daimyo API for the sake
   39: of synchornizing with samurai-client-nodejs, because that would break software
   40  that already uses Daimyo.
   41  
   ..
   63  ### 0.1.2
   64  
   65:  + Prevent Daimyo from crashing when Samurai responds with HTTP 500.
   66  
   67  ### 0.1.1
   ..
   73  
   74   + Fixed issue where ``_check`` token verification would fail for credit and
   75:    void transaction because Samurai does not honor custom data for those
   76     transaction types.
   77  
   78  ### 0.0.9
   79  
   80:  + samurai/developers/api_reference#processing-payments-complex
   81  
   82  ### 0.0.8
   ..
  129   + Custom fields are implemented in both `daimyo.Card` and
  130     `transaction.Transaction` objects. They can store any JSON-serializable
  131:    object, and that will be stored in Samurai gateway, and restored later with
  132     methods like ``card.load()`` or when transaction is completed.
  133   + All transaction requests embed a SHA1 hexdigest of 100-character random

/home/evaleto/nodejs/git/node-postfinance/package.json:
    1  {
    2      "name": "daimyo",
    3:     "description": "Samurai payment gateway API client library for Node.js",
    4      "version": "0.1.5",
    5      "author" : "Herd Hound <branko@herdhound.com>",
    .
   31      },
   32      "engine": [ "node >=0.4.0" ],
   33:     "keywords": ["payment gateway", "payment processing", "samurai", "feefighters"]
   34  }
   35  

/home/evaleto/nodejs/git/node-postfinance/lib/authpost.js:
    4   * Copyright (c)2011, by Branko Vukelic
    5   *
    6:  * This library contains low-level methods for communicating with the Samurai
    7   * payment gateway. You should never need to access these methods directly.
    8   *
    .
   21  var DaimyoError = require('./error');
   22  var API_VER = config.option('apiVersion');
   23: var API_HOST = 'api.samurai.feefighters.com';
   24  var API_URL = '/v' + API_VER;
   25  var DEFAULT_PATH = '/payment_methods';
   ..
   42   * *Parse error messages and return a DaimyoError object*
   43   * 
   44:  * This function extracts the error block from the Samurai's response XML, and
   45   * parses the error messages into DaimyoError object with individual messages
   46   * attached. It is a job of the caller to determine what the messages mean.

/home/evaleto/nodejs/git/node-postfinance/lib/check.js:
  143   *
  144   * Since we have no access to valid test numbers for China UnionPay cards, we
  145:  * don't know if Samurai gateway itself will accept them.
  146   *
  147   * Example:

/home/evaleto/nodejs/git/node-postfinance/lib/config.js:
   28   * 
   29   * The `settings` object contains all the core configuration options that 
   30:  * affect the way certain things work (or not), and the Samurai gateway 
   31   * credentials. You should _not_ access this object directly. The correct way
   32   * to access and set the settings is through either ``configure()`` or 
   ..
   35   * Settings are expected to contain following keys with their default values:
   36   *
   37:  *  + _merchantKey_: Samurai gateway Merchant Key (default: `''`)
   38:  *  + _apiPassword_: Samurai gateway API Password (default: `''`)
   39   *  + _processorId_: Processor (gateway) ID; be sure to set this to a sandbox
   40   *    ID for testing (default: `''`)
   ..
  111    debug('Configuring Daimyo with: \n' + util.inspect(opts));
  112    if (!opts.merchantKey || !opts.apiPassword || !opts.processorId) {
  113:     throw new DaimyoError('system', 'Incomplete Samurai API credentials', opts);
  114    }
  115    Object.keys(opts).forEach(function(key) {
  ...
  135   * is set to `false` it can no longer be set to true.
  136   *
  137:  * Samurai API credentials are additionally checked for consistency. If they 
  138   * do not appear to be valid keys, an error will be thrown.
  139   *

/home/evaleto/nodejs/git/node-postfinance/lib/daimyo.js:
   62  /**
   63   * ## MAPPINGS
   64:  * *Mappings between between Daimyo field names and Samurai node names*
   65   *
   66   * @private
   ..
  294   *
  295   * Note that the card may still fail to clear for any number of reasons. The
  296:  * same check as this one is performed in the Samurai gateway, as well, however
  297   * if you create payment methods using server-to-server requests, rather than
  298:  * letting Samurai create payment methods by submitting the payment form 
  299:  * directly to Samurai, then this can speed up processing as you can trap
  300:  * some common errors without sending a request to Samurai.
  301   *
  302   * @returns {Boolean} Validation result
  ...
  328   * transaction succeeding.
  329   *
  330:  * Note that the same check will be performed in Samurai gateway, but it is 
  331   * more efficient to do it yourself if you are not using the transparent 
  332   * redirect method as it saves at least one request.
  ...
  351   * *Sends a request to create a new payment method*
  352   *
  353:  * Creates a new payment method in the Samurai vault, and sets the `token` 
  354   * property to the received payment method token.
  355   *
  ...
  589  /**
  590   * ## daimyo.Card.load(callback)
  591:  * *Load payment method data from Samurai server*
  592   *
  593   * This method is used to load a created/retained payment method from the 
  594:  * Samurai gateway. The returned data immediately updates the fields in the
  595   * card instance, and also creates a new `method` property, which contains 
  596   * metadata about the payment method.
  ...
  598   * The `method` property has the following properties:
  599   *
  600:  *  + _valid_: Whether the card has passed Samurai's validation (this is the 
  601   *    same type of validation as those used in `isValid()` method.
  602   *  + _updatedAt_: The timestamp of payment method's last modification
  ...
  638   *
  639   * After changing the properties of a card object, you can call this method
  640:  * to sync the data with the Samurai gateway. This method is 'smart' enough
  641   * to not waste bandwidth when there are no changed properties, so if the 
  642   * if you allow users to edit the data, you don't need to check if they have
  ...
  649   * Example:
  650   *
  651:  *     // You load the card from Samurai using the load() method
  652   *     var loadedCard;
  653   *     // User makes modification to data
  ...
  679  
  680    // We have to rename a few fields
  681:   updatedFields = xmlutils.toSamurai(updatedFields, daimyo.MAPPINGS);
  682  
  683    // Construct the XML payload
  ...
  694  /**
  695   * ## daimyo.Card.retain()
  696:  * *Instructs Samurai to ratain (save permanently) the payment method*
  697   *
  698   * This is simple method that makes the payment method permanent on the 
  ...
  701   *
  702   * By default, payment method that hasn't been retained will be deleted after
  703:  * 48 hours. You can delete a payment method (redact in Samurai parlance) at 
  704   * any time by calling the `redact()` method.
  705   *
  ...
  720  /**
  721   * ## daimyo.Card.redact()
  722:  * *Instructs Samurai to redact (delete) the payment method*
  723   *
  724   * When a user wants to use a new card, you should always redact (delete) the

/home/evaleto/nodejs/git/node-postfinance/lib/messages.js:
    6   * Translation of various gateway error messages to human-readable format.
    7   *
    8:  * All error messages generated by Samurai gateway are translated using the
    9   * `messages.translateAll` and `messages.translate` methods. The former 
   10   * translates all messages returned by `authpost.makeRequest` method, and the
   ..
   72  /**
   73   * #messages.mappings
   74:  * *Maps Samurai error messages to human-readable strings*
   75   *
   76   * This mapping maps class, context, and key to an object that contains the 

/home/evaleto/nodejs/git/node-postfinance/lib/transaction.js:
   21  /**
   22   * ## MAPPINGS
   23:  * *Mappings between Daimyo fields and Samurai node names*
   24   */
   25  transaction.MAPPINGS = {
   ..
   31   * *Recipes for parsing XML data*
   32   *
   33:  * Recipes are used to parse XML data returned by the Samurai gateway. For more
   34   * infomration on parsing recipes, see `xmlutils` documentation.
   35   *
   ..
  351    }
  352  
  353:   transactionData = xmlutils.toSamurai(transactionData, transaction.MAPPINGS);
  354  
  355    authpost.makeRequest({

/home/evaleto/nodejs/git/node-postfinance/lib/xmlutils.js:
    4   * Copyright (c)2011, by Branko Vukelic <branko@herdhound.com>
    5   *
    6:  * Utitilities for parsing Samurai XML responses. These utilities are not 
    7   * general-purpose XML parsers and generators. Some of them can be quite useful
    8   * outside the Daimyo context, but there's no guarantee of that.
    .
  354  
  355  /**
  356:  * ## xmlutils.toSamurai(o, mappings)
  357:  * *Remaps the Daimyo field names to Samurai node names in an object*
  358   *
  359   * Given an object with Daimyo field names, this method converts only the 
  360:  * fields found in MAPPINGS and renames the fields to Samurai node names 
  361   * returning a new object with the renamed fields.
  362   *
  ...
  368   *        year: 2012
  369   *     }
  370:  *     xmlutils.toSamurai(daimyoObj, daimyo.MAPPINGS);
  371   *     // returns: 
  372   *     //   {
  ...
  380   * @returns {Object} Object with remapped fields
  381   */
  382: xmlutils.toSamurai = function(o, mappings) {
  383    var remapped = {};
  384  

/home/evaleto/nodejs/git/node-postfinance/support/ashigaru.js:
    4   * Copyright (c)2011, by Branko Vukelic <branko@herdhound.com>
    5   *
    6:  * jQuery plugin for making requests to Samurai payment gateway via a hidden 
    7   * iframe.
    8   *
    .
   20   *
   21   * Before you can use this plugin, you must make sure that a valid redirect URL
   22:  * is handled on your server. Once Samurai gateway receives data from this 
   23   * plugin, it will redirect the user to the redirect URL. The redirect URL will
   24   * have an URL parameter called `payment_method_token` which should be a 
   ..
   91  
   92    var originalDomain = window.document.domain;
   93:   var samuraiURI = 'https://api.samurai.feefighters.com/v1/payment_methods';
   94    var timeoutLabel;
   95    var timedOut = false;
   ..
  101     */
  102    function removeForm() {
  103:     $('#samurai-form').remove();
  104      removeIframe();
  105    }
  ...
  155     */
  156    function createIframe(callback) {
  157:     var iFrame = $('<iframe src="" name="samurai-iframe" '+
  158                     'style="display:none">' +
  159                     '</iframe>');
  ...
  187    function removeIframe() {
  188      setTimeout(function() {
  189:       $('iframe[name=samurai-iframe]').remove();
  190      }, 1);
  191    }
  ...
  216     *
  217     * @param {Object} data Object containing the data for the form
  218:    * @param {String} merchantKey Samurai gateway merchant key
  219     * @param {String} redirectURI URI of the transparent redirect handler
  220     * @param {Function} callback Called with error and results
  ...
  252      } catch(e) { /* Fail silently */ }
  253  
  254:     var formHTML = '<form id="samurai-form" style="display:none" ' +
  255:       'action="$requestURI" method="POST" target="samurai-iframe">' + 
  256        '<input type="hidden" name="merchant_key" value="$merchantkey">'+
  257        '<input type="hidden" name="redirect_url" value="$redirecturl">' +
  ...
  273  
  274      // Replace non-data field placeholders and form attribute placeholders
  275:     formHTML = formHTML.replace('$requestURI', samuraiURI);
  276      formHTML = formHTML.replace('$merchantkey', merchantKey);
  277      formHTML = formHTML.replace('$redirecturl', redirectURI);

89 matches across 11 files
