Login   Register  
PHP Classes
elePHPant
Icontem

File: lib/UI/jquery/js/paypal-button.min.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Muhammad Mengrani  >  PHP-MVC  >  lib/UI/jquery/js/paypal-button.min.js  >  Download  
File: lib/UI/jquery/js/paypal-button.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP-MVC
Library that implements the MVC design pattern
Author: By
Last change:
Date: 1 year ago
Size: 3,560 bytes
 

Contents

Class file image Download
/*!
 * PayPalJSButtons
 * JavaScript integration for PayPal's payment buttons
 * @version 1.0.1 - 2013-03-26
 * @author Jeff Harrell <https://github.com/jeffharrell/>
 */
if(PAYPAL===void 0||!PAYPAL)var PAYPAL={};PAYPAL.apps=PAYPAL.apps||{},function(){"use strict";function e(e,t){var n,i,r,l,p,s,u,d=document.createElement("form"),m=document.createElement("input"),b=document.createElement("input"),y=e.items;m.type="image",b.type="hidden",d.method="post",d.action=o,d.className="paypal-button",d.target="_top";for(p in y)n=y[p],n.isEditable?(l=document.createElement("input"),l.type="text",l.className="paypal-input",l.name=n.key,l.value=n.value,r=document.createElement("label"),r.className="paypal-label",r.appendChild(document.createTextNode(c.config.labels[n.key]+" "||"")),r.appendChild(l),i=document.createElement("p"),i.className="paypal-group",i.appendChild(r)):(l=i=b.cloneNode(!0),l.name=n.key,l.value=n.value),d.appendChild(i);if(s=y.size&&y.size.value,u=y.lc&&y.lc.value,d.appendChild(m),m.src=a(t,s,u),PAYPAL.apps.MiniCart&&"_cart"===e.items.cmd.value){var f=PAYPAL.apps.MiniCart;f.UI.itemList||f.render(),f.bindForm(d)}return d}function t(e,t){var a,n,i=document.createElement("img"),c=o+"?",l=13,p=e.items;t=t&&t.value||250;for(n in p)a=p[n],c+=a.key+"="+encodeURIComponent(a.value)+"&";return c=encodeURIComponent(c),i.src=r.replace("{url}",c).replace("{pattern}",l).replace("{size}",t),i}function a(e,t,a){var n=s[e]||s.buynow;return a=a||"en_US",t="small"===t?"SM":"LG",n.replace(/\{locale\}/,a).replace(/\{size\}/,t)}function n(e){var t,a,n,i,c,o={};if(t=e.attributes)for(c=0,i=t.length;i>c;c++)a=t[c],(n=/^data-([a-z0-9_]+)(-editable)?/i.exec(a.name))&&(o[n[1]]={value:a.value,isEditable:!!n[2]});return o}function i(){this.items={},this.add=function(e,t,a){this.items[e]={key:e,value:t,isEditable:a}},this.remove=function(e){delete this.items[e]}}var c={},o="https://www.paypal.com/cgi-bin/webscr",r="https://www.paypal.com/webapps/ppint/qrcode?data={url}&pattern={pattern}&height={size}",l="JavaScriptButton_{type}",p={name:"item_name",number:"item_number",locale:"lc",currency:"currency_code",recurrence:"p3",period:"t3",callback:"notify_url"},s={buynow:"//www.paypalobjects.com/{locale}/i/btn/btn_buynow_{size}.gif",cart:"//www.paypalobjects.com/{locale}/i/btn/btn_cart_{size}.gif",donate:"//www.paypalobjects.com/{locale}/i/btn/btn_donate_{size}.gif",subscribe:"//www.paypalobjects.com/{locale}/i/btn/btn_subscribe_{size}.gif"};if(PAYPAL.apps.ButtonFactory||(c.config={labels:{item_name:"Item",item_number:"Number",amount:"Amount",quantity:"Quantity"}},c.buttons={buynow:0,cart:0,donate:0,qr:0,subscribe:0},c.create=function(a,n,c,o){var r,s,u=new i;if(!a)return!1;for(s in n)u.add(p[s]||s,n[s].value,n[s].isEditable);return c=c||"buynow","cart"===c?(u.add("cmd","_cart"),u.add("add",!0)):"donate"===c?u.add("cmd","_donations"):"subscribe"===c?(u.add("cmd","_xclick-subscriptions"),u.items.amount&&!u.items.a3&&u.add("a3",u.items.amount.value)):u.add("cmd","_xclick"),u.add("business",a),u.add("bn",l.replace(/\{type\}/,c)),"qr"===c?(r=t(u,u.items.size),u.remove("size")):r=e(u,c),this.buttons[c]+=1,o&&o.appendChild(r),r},PAYPAL.apps.ButtonFactory=c),"undefined"!=typeof document){var u,d,m,b,y,f,v=PAYPAL.apps.ButtonFactory,w=document.getElementsByTagName("script");for(y=0,f=w.length;f>y;y++)u=w[y],u&&u.src&&(d=u&&n(u),m=d&&d.button&&d.button.value,b=u.src.split("?merchant=")[1],b&&(v.create(b,d,m,u.parentNode),u.parentNode.removeChild(u)))}}(),"object"==typeof module&&"object"==typeof module.exports&&(module.exports=PAYPAL);