Sparrow Client (Front-end) API

Similar documents
Monetra Payment Software

Design Document V2 ThingLink Startup

Secure Payment Processing - New Interface To Element Express

Monetra Payment Software

Inline Checkout Implementation Guide

Frequently Asked Questions

PCI DSS. Compliance and Validation Guide VERSION PCI DSS. Compliance and Validation Guide

Checkout by Amazon Widget Reference Guide - Inline Checkout

COURSE OUTLINE MOC 20480: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

CHECKOUT INTEGRATION GUIDE - LIGHTBOX 1. Checkout Integration Guide Lightbox VERSION 1.0.0

EWAY RAPID SETUP GUIDE FOR

Read the Docs Template Documentation

Merchant e-solutions Payment Acceptance User Guide for Magento version 2.x ( M2 )

Checkout by Amazon Widget Reference Guide - Inline Checkout

grabattention The jquery Plug-in

New Option For PASS (Payment Account Secure Storage) Using The ELEMENT Express Interface

Configuring Hotspots

Documentation for the new Self Admin

Discovery Service Infrastructure for Test- bädden

Paythru Remote Fields

20480B - Version: 1. Programming in HTML5 with JavaScript and CSS3

Implementation Guide. The essentials

KonaKart Shopping Widgets. 3rd January DS Data Systems (UK) Ltd., 9 Little Meadow Loughton, Milton Keynes Bucks MK5 8EH UK

Checkout by Amazon Widget Reference Guide

PayPlug. The payment solution that increases your sales PAYPLUG EXTENSION FOR MAGENTO V1

ekashu Frequently Asked Questions

ThingLink User Guide. Andy Chen Eric Ouyang Giovanni Tenorio Ashton Yon

Using echoice Affiliate Tools

Alert. In [ ]: %%javascript alert("hello");

UNIVERSITY OF TORONTO Faculty of Arts and Science DECEMBER 2015 EXAMINATIONS. CSC309H1 F Programming on the Web Instructor: Ahmed Shah Mashiyat

X-Payments:FAQ. X-Payments user manual

Developing ASP.NET MVC 5 Web Applications

User Guide Netaxept Administration Module. Version 1.50

Varargs Training & Software Development Centre Private Limited, Module: HTML5, CSS3 & JavaScript

Course 20480: Programming in HTML5 with JavaScript and CSS3

COURSE 20480B: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Developing ASP.NET MVC 5 Web Applications. Course Outline

Administration Guide

Programming in HTML5 with JavaScript and CSS3

CIW 1D CIW JavaScript Specialist.

Administration Guide

Full Stack Web Developer

OU Mashup V2. Display Page

Web Development 20480: Programming in HTML5 with JavaScript and CSS3. Upcoming Dates. Course Description. Course Outline

FlexPay Purchase One Click

Payment iframe User Guide

Inline Checkout Implementation Guide

20486: Developing ASP.NET MVC 4 Web Applications

Web applications Developing Android/Iphone Applications using WebGUI

User Guide Netaxept Administration Module

Checkout by Amazon Widget Reference Guide - Standard Checkout

Full Stack Web Developer

Static Webpage Development

Virtual Terminal User Guide

Jquery Manually Set Checkbox Checked Or Not

Contents. Demos folder: Demos\14-Ajax. 1. Overview of Ajax. 2. Using Ajax directly. 3. jquery and Ajax. 4. Consuming RESTful services

JavaScript Introduction

Fullestop Case Study for Dr. Hahnz

Course 20486B: Developing ASP.NET MVC 4 Web Applications

Stamp Builder. Documentation. v1.0.0

Developing ASP.NET MVC 4 Web Applications

Visual Studio Course Developing ASP.NET MVC 5 Web Applications

Programming in HTML5 with JavaScript and CSS3

20486-Developing ASP.NET MVC 4 Web Applications

WebGL Seminar: O3D. Alexander Lokhman Tampere University of Technology

TIME SCHEDULE MODULE TOPICS PERIODS. HTML Document Object Model (DOM) and javascript Object Notation (JSON)

ENRICHING PRIMO RECORDS WITH INFORMATION FROM WORDPRESS. Karsten Kryger Hansen Aalborg University Library

User Guide for Direct Post Method Direct Redirect

ASP.NET MVC Training

Developing ASP.NET MVC 5 Web Applications

Microsoft Programming in HTML5 with JavaScript and CSS3

Helpline No WhatsApp No.:

Serverless Single Page Web Apps, Part Four. CSCI 5828: Foundations of Software Engineering Lecture 24 11/10/2016

20480C: Programming in HTML5 with JavaScript and CSS3. Course Code: 20480C; Duration: 5 days; Instructor-led. JavaScript code.

Merchant e-solutions Payment Acceptance User Guide for Magento (M1)

B2B Portal User Guide

HTML5. HTML5 Introduction. Form Input Types. Semantic Elements. Form Attributes. Form Elements. Month Number Range Search Tel Url Time Week

WEBSITE INSTRUCTIONS. Table of Contents

Purchasing as an existing ArtCAM customer

Developing ASP.Net MVC 4 Web Application

Standard 1 The student will author web pages using the HyperText Markup Language (HTML)

20486 Developing ASP.NET MVC 5 Web Applications

Introduction. Part I: jquery API 1. Chapter 1: Introduction to jquery 3

Schenker AB. Interface documentation Map integration

Frontend UI Training. Whats App :

PayPal Merchant Account Toolkit For Small Online Business

PHP & My SQL Duration-4-6 Months

AngularJS Fundamentals

PHP / MYSQL DURATION: 2 MONTHS

Valitor Salesforce Commerce Cloud SFRA Module

COURSE 20486B: DEVELOPING ASP.NET MVC 4 WEB APPLICATIONS

CORE PHP CURRICULUM. Introductory Session Web Architecture Overview of PHP Platform Origins of PHP in the open source community

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang

20486: Developing ASP.NET MVC 4 Web Applications (5 Days)

City of Mobile GIS Web Mapping Applications: New Technology, New Expectations

SPARROW Gateway. Custom Payment Redirect. Version (Build 7373)

Django Leaflet Documentation

Int_altapay. Version

User Interaction: jquery

Sliding PayPal Shopping Cart 2 DMXzone

Transcription:

Sparrow Client (Front-end) API Service API Version 3.6.0 (Build 8062) Released May 2017

Revision History Date Revision Comments Author 2017-05-22 1.0 Initial document Ilya Tretyakov 2

Table of Contents Revision History... 2 Vocabulary... 4 Overview... 4 Interaction Scheme... 5 Embedded Form (EF)... 6 Custom Form (CF)... 6 Using Embedded Form (EF)... 6 Using Custom Form (CF)... 9 3D Secure Verification... 10 API description... 11 EF popup settings... 11 EF tag attributes description... 12 gettoken function description (CF)... 12 3

Vocabulary SCA TT EF CF Sparrow Client (Front-end) API Initial document Payment's temporary token Embedded Form Custom Form Overview This guide was made for technical staff and other specialists who maintain sites, online shops and other sources, which provide payment opportunity through the "Sparrow global payment solution". The Sparrow Client (Front-end) API (hereinafter referred to SCA) allows merchants to receive payments without storing payment information on their servers (PCI DSS license is not required) as well as without using "Payment Redirect". Therefore, this possibility suggests using JavaScript at the sales resource (merchant's site). Important! At the current version, SCA provides only the simple credit card payment, which includes such fields as Credit Card Number, Cardholder, Expiration Date and CVV (CVC). 4

Interaction Scheme The interaction scheme consists of two consecutive requests, each of which is directed into the same server "Sparrow". The first request: 'POST' from merchant's site front-end using JavaScript, the second request - 'POST' from merchant's server-side. Sends payment information (credit card number, cardholder name, CVV etc.) and receives payment temporary token (hereinafter referred to TT). The second request: 'POST' from merchant's server-side. Makes a payment using TT and other special info. The following scheme shows this interaction: : 5

How does it work There are two different ways to use it: Embedded Form (hereinafter referred EF) and Custom Form (hereinafter referred CF). Embedded Form (EF) SCA allows you not to think about html-layout of payment forms and JS-logic of receiving TT. If your task is to draw one or more payment buttons for each good (for example) and you do not want to spend your time on custom form layout - EF is your choice. SCA provides mechanism of drawing payment form based on its own JavaScript code and CSS "from the box". Your duties will by only add SCA CSS file on your page besides SCA JS, rendering particular tags with "data-" attributes as well and making an AJAX function for back-end logic of payment. You can also redefine our CSS styles in accordance with your site s theme. Custom Form (CF) In this case, you have to write all clients and servers logic independently. To obtain a TT you use SCA function gettoken (see API description section). Using Embedded Form (EF) 1. Add following JS- and CSS-files at the head of your page (data-name="sparrowapi" attribute is necessary!): <link href="https://secure.5thdl.com/clientapi/sparrow-api.css?v=1.1" rel="stylesheet" /> <script src="https://secure.5thdl.com/clientapi/sparrow-api.js?v=1.1" type="text/javascript" data-name="sparrowapi"></script> Make sure these files are loaded successful. 2. Configure payment buttons at the body section of your page: 6

<div data-pkey="[your public key]" data-buttontext="pay $200.4" data-title="one thing by $200.4" data-tokencallback="embeddedformcode.gettokencallback" data-purchasebuttontext="purchase $200.4" data-amount="200.4"> </div> <br /> <div data-pkey="[your public key]" data-buttontext="pay 3.45" data-tokencallback="embeddedformcode.gettokencallback2" data-amount="3.45"> </div> The assignment of the attributes see at the API description section. embeddedformcode.gettokencallback and embeddedformcode.gettokencallback2 are defined below. 3. Now let s write some JS-code (with comments along the text). Be careful, your custom Ajax function for payment should return "Promise" object (such as "iquery.deferred"). Deferred object has to involve either done or then methods. It's necessary for right "loadinganimation" behavior EF: <script type="text/javascript"> // Configure EF if it is necessary (see API description section) Sparrow.modals.disableClose = false;... 7

// Embedded form code example7 var embeddedformcode = (function () { var embeddedformcallback = function (response) { }, Sparrow.closePopups(); // you may close popup window after purchase // use response here // User purchase function should returns Deferred object (jquery Deferred for example) embeddedpurchase = function (token, amount) { } return [Your Purchase function](token, amount).done(embeddedformcallback); // callbacks which you use at 'data-tokencallback' attributes return { gettokencallback: function (token) { return embeddedpurchase(token, 200.4); 8

Using Custom Form (CF) The example involves only Sparrow.getToken function call. Do it where you want. Then use callback for further payment operation. Sparrow.getToken([Your pkey], { cardnum: [Buyer Card Number], cardholder: [Cardholder], cardexp: [Month + Year], // Format string MMYY cvv: [CVC], amount: [Amount] // Required for 3D secure verification 9

3D Secure Verification 3-D Secure is an authenticated payment system to improve online transaction security and encourage the growth of e-commerce payments. The interaction scheme with credit card verification consist of following steps: 1. Merchant sends the POST request from merchant s site using JavaScript. 2. Sparrow sends to merchant response with redirect URL for 3D secure verification. 3. Sparrow API redirects consumer to the 3D secure verification page, which will open in the popup window. 4. Consumer pass 3D secure verification and card issues send to Sparrow 3D secure authentication data. 5. Sparrow generate and send to merchant site TT. 6. Merchant sends to sparrow sale request with TT. 7. Sparrow sends to merchant response with sale operation result. 10

Notes: Please, contact administrator to enable 3D secure verification feature The field amount is required for 3D secure verification. Don t forget to add data-amount attribute to Embedded form (example on page 7), or amount parameter to data object for Custom Form (example on page 9) To avoid caching, please, use postfix with Client API current version for JS- and CSS-files at the head of your page (example on page6). API description EF popup settings Property Description Values Default Sparrow.modals Object, which stores popup window behavior JSON Sparrow.modals.disableClose Allows/forbids closing the popup if the target control is disabled true / false false Sparrow.modals.bgClose Allows/forbids closing the popup onto background (overlay) click true / false false Sparrow.modals.escapeClose Allows/forbids closing the popup using Escape button true / false false Sparrow.modals.fadeOutOpen Switch on / off the simple animation during the popup window opening true / false true 11

EF tag attributes description Attribute Description Default Required data-pkey Merchant Public Key yes data-buttontext Caption on the button which opens popup window Purchase no data-title The title of the popup window Purchase no data-purchasebuttontext Caption on the purchase button Purchase no data-amount data-tokencallback Purchase amount, required for 3D secure verification Callback function that will be called after receiving the token. Has to return Promise (jquery.deferred for example) Only for 3D secure verification yes gettoken function description (CF) Parameter Description Required pkey Merchant Public Key string yes data success JSON object data which will be required for payment holding Success function that will be called after receiving the token yes yes error Error function that will be called if the error appears no complete Complete function. It will be called after the ajax request finish anyway no 12