FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScriptButtons/dist/paypal-button.min.js at master · willCode2Surf/JavaScriptButtons · GitHub
willCode2Surf
/
JavaScriptButtons
Public
forked from
jbillimoria/JavaScriptButtons
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScriptButtons
/
dist
/
paypal-button.min.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
7 lines (7 loc) · 9.32 KB
Breadcrumbs
JavaScriptButtons
/
dist
/
paypal-button.min.js
Copy path
File metadata and controls
7 lines (7 loc) · 9.32 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
/*!
* PayPalJSButtons
* JavaScript integration for PayPal's payment buttons
*
@version
1.0.1 - 2013-07-20
*
@author
Jeff Harrell <https://github.com/jeffharrell/>
*/
if
(
"undefined"
==
typeof
PAYPAL
||
!
PAYPAL
)
var
PAYPAL
=
{
}
;
PAYPAL
.
apps
=
PAYPAL
.
apps
||
{
}
,
function
(
a
)
{
"use strict"
;
function
b
(
)
{
var
b
,
c
,
d
,
e
;
a
.
getElementById
(
"paypal-button"
)
||
(
b
=
""
,
c
=
a
.
createElement
(
"style"
)
,
d
=
".paypal-button"
,
e
=
d
+
" button"
,
b
+=
d
+
" { white-space: nowrap; }"
,
b
+=
e
+
' { white-space: nowrap; overflow: hidden; border-radius: 13px; font-family: "Arial", bold, italic; font-weight: bold; font-style: italic; border: 1px solid #ffa823; color: #0E3168; background: #ffa823; position: relative; text-shadow: 0 1px 0 rgba(255,255,255,.5); cursor: pointer; z-index: 0; }'
,
b
+=
e
+
':before { content: " "; position: absolute; width: 100%; height: 100%; border-radius: 11px; top: 0; left: 0; background: #ffa823; background: -webkit-linear-gradient(top, #FFAA00 0%,#FFAA00 80%,#FFF8FC 100%); background: -moz-linear-gradient(top, #FFAA00 0%,#FFAA00 80%,#FFF8FC 100%); background: -ms-linear-gradient(top, #FFAA00 0%,#FFAA00 80%,#FFF8FC 100%); background: linear-gradient(top, #FFAA00 0%,#FFAA00 80%,#FFF8FC 100%); z-index: -2; }'
,
b
+=
e
+
':after { content: " "; position: absolute; width: 98%; height: 60%; border-radius: 40px 40px 38px 38px; top: 0; left: 0; background: -webkit-linear-gradient(top, #fefefe 0%, #fed994 100%); background: -moz-linear-gradient(top, #fefefe 0%, #fed994 100%); background: -ms-linear-gradient(top, #fefefe 0%, #fed994 100%); background: linear-gradient(top, #fefefe 0%, #fed994 100%); z-index: -1; -webkit-transform: translateX(1%);-moz-transform: translateX(1%); -ms-transform: translateX(1%); transform: translateX(1%); }'
,
b
+=
e
+
".small { padding: 3px 15px; font-size: 12px; }"
,
b
+=
e
+
".large { padding: 4px 19px; font-size: 14px; }"
,
c
.
type
=
"text/css"
,
c
.
id
=
"paypal-button"
,
c
.
styleSheet
?
c
.
styleSheet
.
cssText
=
b
:
c
.
appendChild
(
a
.
createTextNode
(
b
)
)
,
a
.
getElementsByTagName
(
"head"
)
[
0
]
.
appendChild
(
c
)
)
}
function
c
(
b
,
c
)
{
var
d
,
e
,
f
,
i
,
j
,
k
,
m
,
n
,
o
,
p
=
a
.
createElement
(
"form"
)
,
q
=
a
.
createElement
(
"button"
)
,
r
=
a
.
createElement
(
"input"
)
,
s
=
b
.
items
;
p
.
method
=
"post"
,
p
.
action
=
h
.
replace
(
"{env}"
,
b
.
items
.
env
.
value
)
,
p
.
className
=
"paypal-button"
,
p
.
target
=
"_top"
,
r
.
type
=
"hidden"
,
k
=
s
.
size
&&
s
.
size
.
value
||
"large"
,
m
=
s
.
lc
&&
s
.
lc
.
value
||
"en_US"
,
n
=
l
[
m
]
||
l
.
en_US
;
for
(
j
in
s
)
d
=
s
[
j
]
,
d
.
isEditable
?
(
i
=
a
.
createElement
(
"input"
)
,
i
.
type
=
"text"
,
i
.
className
=
"paypal-input"
,
i
.
name
=
d
.
key
,
i
.
value
=
d
.
value
,
f
=
a
.
createElement
(
"label"
)
,
f
.
className
=
"paypal-label"
,
f
.
appendChild
(
a
.
createTextNode
(
g
.
config
.
labels
[
d
.
key
]
||
n
[
d
.
key
]
)
)
,
f
.
appendChild
(
i
)
,
e
=
a
.
createElement
(
"p"
)
,
e
.
className
=
"paypal-group"
,
e
.
appendChild
(
f
)
)
:
(
i
=
e
=
r
.
cloneNode
(
!
0
)
,
i
.
name
=
d
.
key
,
i
.
value
=
d
.
value
)
,
p
.
appendChild
(
e
)
;
try
{
q
.
type
=
"submit"
}
catch
(
t
)
{
q
.
setAttribute
(
"type"
,
"submit"
)
}
return
q
.
className
=
"paypal-button "
+
k
,
q
.
appendChild
(
a
.
createTextNode
(
n
[
c
]
)
)
,
p
.
appendChild
(
q
)
,
(
o
=
PAYPAL
.
apps
.
MiniCart
)
&&
"_cart"
===
b
.
items
.
cmd
.
value
&&
(
o
.
UI
.
itemList
||
o
.
render
(
)
,
o
.
bindForm
(
p
)
)
,
p
}
function
d
(
b
,
c
)
{
var
d
,
e
,
f
=
h
.
replace
(
"{env}"
,
b
.
items
.
env
.
value
)
,
g
=
a
.
createElement
(
"img"
)
,
j
=
f
+
"?"
,
k
=
13
,
l
=
b
.
items
;
c
=
c
&&
c
.
value
||
250
;
for
(
e
in
l
)
d
=
l
[
e
]
,
j
+=
d
.
key
+
"="
+
encodeURIComponent
(
d
.
value
)
+
"&"
;
return
j
=
encodeURIComponent
(
j
)
,
g
.
src
=
i
.
replace
(
"{env}"
,
b
.
items
.
env
.
value
)
.
replace
(
"{url}"
,
j
)
.
replace
(
"{pattern}"
,
k
)
.
replace
(
"{size}"
,
c
)
,
g
}
function
e
(
a
)
{
var
b
,
c
,
d
,
e
,
f
,
g
=
{
}
;
if
(
b
=
a
.
attributes
)
for
(
f
=
0
,
e
=
b
.
length
;
e
>
f
;
f
++
)
c
=
b
[
f
]
,
(
d
=
c
.
name
.
match
(
/
^
d
a
t
a
-
(
[
a
-
z
0
-
9
_
]
+
)
(
-
e
d
i
t
a
b
l
e
)
?
/
i
)
)
&&
(
g
[
d
[
1
]
]
=
{
value
:
c
.
value
,
isEditable
:
!
!
d
[
2
]
}
)
;
return
g
}
function
f
(
)
{
this
.
items
=
{
}
,
this
.
add
=
function
(
a
,
b
,
c
)
{
this
.
items
[
a
]
=
{
key
:
a
,
value
:
b
,
isEditable
:
c
}
}
,
this
.
remove
=
function
(
a
)
{
delete
this
.
items
[
a
]
}
}
var
g
=
{
}
,
h
=
"https://{env}.paypal.com/cgi-bin/webscr"
,
i
=
"https://{env}.paypal.com/webapps/ppint/qrcode?data={url}&pattern={pattern}&height={size}"
,
j
=
"JavaScriptButton_{type}"
,
k
=
{
name
:
"item_name"
,
number
:
"item_number"
,
locale
:
"lc"
,
currency
:
"currency_code"
,
recurrence
:
"p3"
,
period
:
"t3"
,
callback
:
"notify_url"
}
,
l
=
{
da_DK
:
{
buynow
:
"Køb nu"
,
cart
:
"Læg i indkøbsvogn"
,
donate
:
"Doner"
,
subscribe
:
"Abonner"
,
item_name
:
"Vare"
,
number
:
"Nummer"
,
amount
:
"Pris"
,
quantity
:
"Antal"
}
,
de_DE
:
{
buynow
:
"Jetzt kaufen"
,
cart
:
"In den Warenkorb"
,
donate
:
"Spenden"
,
subscribe
:
"Abonnieren"
,
item_name
:
"Artikel"
,
number
:
"Nummer"
,
amount
:
"Betrag"
,
quantity
:
"Menge"
},en_AU:{buynow:"Buy Now",cart:"Add to Cart",donate:"Donate",subscribe:"Subscribe",item_name:"Item",number:"Number",amount:"Amount",quantity:"Quantity"},en_GB:{buynow:"Buy Now",cart:"Add to Cart",donate:"Donate",subscribe:"Subscribe",item_name:"Item",number:"Number",amount:"Amount",quantity:"Quantity"},en_US:{buynow:"Buy Now",cart:"Add to Cart",donate:"Donate",subscribe:"Subscribe",item_name:"Item",number:"Number",amount:"Amount",quantity:"Quantity"},es_ES:{buynow:"Comprar ahora",cart:"Añadir al carro",donate:"Donar",subscribe:"Suscribirse",item_name:"Artículo",number:"Número",amount:"Importe",quantity:"Cantidad"},es_XC:{buynow:"Comprar ahora",cart:"Añadir al carrito",donate:"Donar",subscribe:"Suscribirse",item_name:"Artículo",number:"Número",amount:"Importe",quantity:"Cantidad"},fr_CA:{buynow:"Acheter",cart:"Ajouter au panier",donate:"Faire un don",subscribe:"Souscrire",item_name:"Objet",number:"Numéro",amount:"Montant",quantity:"Quantité"},fr_FR:{buynow:"Acheter",cart:"Ajouter au panier",donate:"Faire un don",subscribe:"Souscrire",item_name:"Objet",number:"Numéro",amount:"Montant",quantity:"Quantité"},fr_XC:{buynow:"Acheter",cart:"Ajouter au panier",donate:"Faire un don",subscribe:"Souscrire",item_name:"Objet",number:"Numéro",amount:"Montant",quantity:"Quantité"},he_IL:{buynow:"וישכע הנק",cart:"תוינקה לסל ףסוה",donate:"םורת",subscribe:"יונמכ ףרטצה",item_name:"טירפ",number:"רפסמ",amount:"םוכס",quantity:"מותכ"},id_ID:{buynow:"Beli Sekarang",cart:"Tambah ke Keranjang",donate:"Donasikan",subscribe:"Berlangganan",item_name:"Barang",number:"Nomor",amount:"Harga",quantity:"Kuantitas"},it_IT:{buynow:"Paga adesso",cart:"Aggiungi al carrello",donate:"Donazione",subscribe:"Iscriviti",item_name:"Oggetto",number:"Numero",amount:"Importo",quantity:"Quantità"},ja_JP:{buynow:"今すぐ購入",cart:"カートに追加",donate:"寄付",subscribe:"購読",item_name:"商品",number:"番号",amount:"価格",quantity:"数量"},nl_NL:{buynow:"Nu kopen",cart:"Aan winkelwagentje toevoegen",donate:"Doneren",subscribe:"Abonneren",item_name:"Item",number:"Nummer",amount:"Bedrag",quantity:"Hoeveelheid"},no_NO:{buynow:"Kjøp nå",cart:"Legg til i kurv",donate:"Doner",subscribe:"Abonner",item_name:"Vare",number:"Nummer",amount:"Beløp",quantity:"Antall"},pl_PL:{buynow:"Kup teraz",cart:"Dodaj do koszyka",donate:"Przekaż darowiznę",subscribe:"Subskrybuj",item_name:"Przedmiot",number:"Numer",amount:"Kwota",quantity:"Ilość"},pt_BR:{buynow:"Comprar agora",cart:"Adicionar ao carrinho",donate:"Doar",subscribe:"Assinar",item_name:"Produto",number:"Número",amount:"Valor",quantity:"Quantidade"},ru_RU:{buynow:"Купить сейчас",cart:"Добавить в корзину",donate:"Пожертвовать",subscribe:"Подписаться",item_name:"Товар",number:"Номер",amount:"Сумма",quantity:"Количество"},sv_SE:{buynow:"Köp nu",cart:"Lägg till i kundvagn",donate:"Donera",subscribe:"Abonnera",item_name:"Objekt",number:"Nummer",amount:"Belopp",quantity:"Antal"},th_TH:{buynow:"ซื้อทันที",cart:"เพิ่มลงตะกร้า",donate:"บริจาค",subscribe:"บอกรับสมาชิก",item_name:"ชื่อสินค้า",number:"รหัสสินค้า",amount:"ราคา",quantity:"จำนวน"},tr_TR:{buynow:"Hemen Alın",cart:"Sepete Ekleyin",donate:"Bağış Yapın",subscribe:"Abone Olun",item_name:"Ürün",number:"Numara",amount:"Tutar",quantity:"Miktar"},zh_CN:{buynow:"立即购买",cart:"添加到购物车",donate:"捐赠",subscribe:"租用",item_name:"物品",number:"编号",amount:"金额",quantity:"数量"},zh_HK:{buynow:"立即買",cart:"加入購物車",donate:"捐款",subscribe:"訂用",item_name:"項目",number:"號碼",amount:"金額",quantity:"數量"},zh_TW:{buynow:"立即購",cart:"加到購物車",donate:"捐款",subscribe:"訂閱",item_name:"商品",number:"商品編號",amount:"單價",quantity:"數量"},zh_XC:{buynow:"立即购买",cart:"添加到购物车",donate:"捐赠",subscribe:"租用",item_name:"物品",number:"编号",amount:"金额",quantity:"数量"}};if(PAYPAL.apps.ButtonFactory||(g.config={labels:{}},g.buttons={buynow:0,cart:0,donate:0,qr:0,subscribe:0},g.create=function(a,e,g,h){var i,l,m,n=new f;if(!a)return!1;for(l in e)n.add(k[l]||l,e[l].value,e[l].isEditable);return g=g||"buynow",m="www",n.items.env&&n.items.env.value&&(m+="."+n.items.env.value),"cart"===g?(n.add("cmd","_cart"),n.add("add",!0)):"donate"===g?n.add("cmd","_donations"):"subscribe"===g?(n.add("cmd","_xclick-subscriptions"),n.items.amount&&!n.items.a3&&n.add("a3",n.items.amount.value)):n.add("cmd","_xclick"),n.add("business",a),n.add("bn",j.replace(/\{type\}/,g)),n.add("env",m),"qr"===g?(i=d(n,n.items.size),n.remove("size")):i=c(n,g),b(),this.buttons[g]+=1,h&&h.appendChild(i),i},PAYPAL.apps.ButtonFactory=g),"undefined"!=typeof a){var m,n,o,p,q,r,s=PAYPAL.apps.ButtonFactory,t=a.getElementsByTagName("script");for(q=0,r=t.length;r>q;q++)m=t[q],m&&m.src&&(n=m&&e(m),o=n&&n.button&&n.button.value,p=m.src.split("?merchant=")[1],p&&(s.create(p,n,o,m.parentNode),m.parentNode.removeChild(m)))}}(document),"object"==typeof module&&"object"==typeof module.exports&&(module.exports=PAYPAL);
Back
|
FazBrowse Home
|
New Git URL