Skip to content
This repository was archived by the owner on Mar 21, 2020. It is now read-only.

Commit 37dbd7e

Browse files
committed
build for v3.2.0
1 parent b51767d commit 37dbd7e

File tree

4 files changed

+4654
-5549
lines changed

4 files changed

+4654
-5549
lines changed

dist/vue-paypal-checkout.common.js

Lines changed: 19 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
55
var _slicedToArray = _interopDefault(require('babel-runtime/helpers/slicedToArray'));
66
var _Object$assign = _interopDefault(require('babel-runtime/core-js/object/assign'));
77
var paypal = _interopDefault(require('paypal-checkout'));
8-
require('babel-runtime/core-js/json/stringify');
98
var _Object$keys = _interopDefault(require('babel-runtime/core-js/object/keys'));
109

1110
var requiredProps = [['amount'], ['currency', 'USD']];
@@ -157,7 +156,7 @@ function assignToPropertyObject(props) {
157156
};
158157
}
159158

160-
// TODO: add item validator thanks
159+
// TODO: add item validator
161160
var itemsPayPalProp = new paypalProp({
162161
name: 'items',
163162
paypalName: 'item_list',
@@ -169,6 +168,13 @@ itemsPayPalProp.addChangeTransform(function (items) {
169168
return { items: items };
170169
});
171170

171+
var shippingAddressProp = new paypalProp({
172+
name: 'shippingAddress',
173+
paypalName: 'shipping_address',
174+
type: Object,
175+
injection: propTypes.TRANSACTION
176+
});
177+
172178
var props = [
173179
// Button Props
174180
new paypalProp({ name: 'buttonStyle', paypalName: 'style', injection: propTypes.BUTTON }), new paypalProp({ name: 'braintree', injection: propTypes.BUTTON }), new paypalProp({ name: 'locale', type: String, injection: propTypes.BUTTON }),
@@ -191,7 +197,7 @@ new paypalProp({
191197
);
192198
},
193199
injection: propTypes.TRANSACTION
194-
}), itemsPayPalProp];
200+
}), itemsPayPalProp, shippingAddressProp];
195201

196202
function vmProps() {
197203
var vm = {};
@@ -230,6 +236,12 @@ var script = {
230236
}
231237
}, assignTo(vue, propTypes.TRANSACTION));
232238

239+
// TODO: clean this up
240+
if (transaction.shipping_address && transaction.item_list) {
241+
transaction.item_list.shipping_address = transaction.shipping_address;
242+
delete transaction.shipping_address;
243+
}
244+
233245
var payment = {
234246
transactions: [transaction]
235247
};
@@ -281,6 +293,7 @@ var script = {
281293
}
282294
};
283295

296+
/* script */
284297
var __vue_script__ = script;
285298

286299
/* template */
@@ -293,7 +306,6 @@ var __vue_render__ = function __vue_render__() {
293306
var __vue_staticRenderFns__ = [];
294307
__vue_render__._withStripped = true;
295308

296-
var __vue_template__ = typeof __vue_render__ !== 'undefined' ? { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ } : {};
297309
/* style */
298310
var __vue_inject_styles__ = undefined;
299311
/* scoped */
@@ -306,9 +318,8 @@ var __vue_is_functional_template__ = false;
306318
function __vue_normalize__(template, style, script$$1, scope, functional, moduleIdentifier, createInjector, createInjectorSSR) {
307319
var component = (typeof script$$1 === 'function' ? script$$1.options : script$$1) || {};
308320

309-
{
310-
component.__file = "/home/khoa/Code/paypal/src/components/PayPalCheckout.vue";
311-
}
321+
// For security concerns, we use only base name in production mode.
322+
component.__file = "/home/khoa/src/github.com/khoanguyen96/paypal/src/components/PayPalCheckout.vue";
312323

313324
if (!component.render) {
314325
component.render = template.render;
@@ -323,60 +334,10 @@ function __vue_normalize__(template, style, script$$1, scope, functional, module
323334
return component;
324335
}
325336
/* style inject */
326-
function __vue_create_injector__() {
327-
var head = document.head || document.getElementsByTagName('head')[0];
328-
var styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {});
329-
var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
330-
331-
return function addStyle(id, css) {
332-
if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) return; // SSR styles are present.
333-
334-
var group = isOldIE ? css.media || 'default' : id;
335-
var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined });
336-
337-
if (!style.ids.includes(id)) {
338-
var code = css.source;
339-
var index = style.ids.length;
340-
341-
style.ids.push(id);
342-
343-
if (isOldIE) {
344-
style.element = style.element || document.querySelector('style[data-group=' + group + ']');
345-
}
346-
347-
if (!style.element) {
348-
var el = style.element = document.createElement('style');
349-
el.type = 'text/css';
350-
351-
if (css.media) el.setAttribute('media', css.media);
352-
if (isOldIE) {
353-
el.setAttribute('data-group', group);
354-
el.setAttribute('data-next-index', '0');
355-
}
356-
357-
head.appendChild(el);
358-
}
359337

360-
if (isOldIE) {
361-
index = parseInt(style.element.getAttribute('data-next-index'));
362-
style.element.setAttribute('data-next-index', index + 1);
363-
}
364-
365-
if (style.element.styleSheet) {
366-
style.parts.push(code);
367-
style.element.styleSheet.cssText = style.parts.filter(Boolean).join('\n');
368-
} else {
369-
var textNode = document.createTextNode(code);
370-
var nodes = style.element.childNodes;
371-
if (nodes[index]) style.element.removeChild(nodes[index]);
372-
if (nodes.length) style.element.insertBefore(textNode, nodes[index]);else style.element.appendChild(textNode);
373-
}
374-
}
375-
};
376-
}
377338
/* style inject SSR */
378339

379-
var PayPalCheckout = __vue_normalize__(__vue_template__, __vue_inject_styles__, typeof __vue_script__ === 'undefined' ? {} : __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, typeof __vue_create_injector__ !== 'undefined' ? __vue_create_injector__ : function () {}, typeof __vue_create_injector_ssr__ !== 'undefined' ? __vue_create_injector_ssr__ : function () {});
340+
var PayPalCheckout = __vue_normalize__({ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined);
380341

381342
var components = {
382343
'paypal-checkout': PayPalCheckout

dist/vue-paypal-checkout.esm.js

Lines changed: 19 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import _slicedToArray from 'babel-runtime/helpers/slicedToArray';
22
import _Object$assign from 'babel-runtime/core-js/object/assign';
33
import paypal from 'paypal-checkout';
4-
import 'babel-runtime/core-js/json/stringify';
54
import _Object$keys from 'babel-runtime/core-js/object/keys';
65

76
var requiredProps = [['amount'], ['currency', 'USD']];
@@ -153,7 +152,7 @@ function assignToPropertyObject(props) {
153152
};
154153
}
155154

156-
// TODO: add item validator thanks
155+
// TODO: add item validator
157156
var itemsPayPalProp = new paypalProp({
158157
name: 'items',
159158
paypalName: 'item_list',
@@ -165,6 +164,13 @@ itemsPayPalProp.addChangeTransform(function (items) {
165164
return { items: items };
166165
});
167166

167+
var shippingAddressProp = new paypalProp({
168+
name: 'shippingAddress',
169+
paypalName: 'shipping_address',
170+
type: Object,
171+
injection: propTypes.TRANSACTION
172+
});
173+
168174
var props = [
169175
// Button Props
170176
new paypalProp({ name: 'buttonStyle', paypalName: 'style', injection: propTypes.BUTTON }), new paypalProp({ name: 'braintree', injection: propTypes.BUTTON }), new paypalProp({ name: 'locale', type: String, injection: propTypes.BUTTON }),
@@ -187,7 +193,7 @@ new paypalProp({
187193
);
188194
},
189195
injection: propTypes.TRANSACTION
190-
}), itemsPayPalProp];
196+
}), itemsPayPalProp, shippingAddressProp];
191197

192198
function vmProps() {
193199
var vm = {};
@@ -226,6 +232,12 @@ var script = {
226232
}
227233
}, assignTo(vue, propTypes.TRANSACTION));
228234

235+
// TODO: clean this up
236+
if (transaction.shipping_address && transaction.item_list) {
237+
transaction.item_list.shipping_address = transaction.shipping_address;
238+
delete transaction.shipping_address;
239+
}
240+
229241
var payment = {
230242
transactions: [transaction]
231243
};
@@ -277,6 +289,7 @@ var script = {
277289
}
278290
};
279291

292+
/* script */
280293
var __vue_script__ = script;
281294

282295
/* template */
@@ -289,7 +302,6 @@ var __vue_render__ = function __vue_render__() {
289302
var __vue_staticRenderFns__ = [];
290303
__vue_render__._withStripped = true;
291304

292-
var __vue_template__ = typeof __vue_render__ !== 'undefined' ? { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ } : {};
293305
/* style */
294306
var __vue_inject_styles__ = undefined;
295307
/* scoped */
@@ -302,9 +314,8 @@ var __vue_is_functional_template__ = false;
302314
function __vue_normalize__(template, style, script$$1, scope, functional, moduleIdentifier, createInjector, createInjectorSSR) {
303315
var component = (typeof script$$1 === 'function' ? script$$1.options : script$$1) || {};
304316

305-
{
306-
component.__file = "/home/khoa/Code/paypal/src/components/PayPalCheckout.vue";
307-
}
317+
// For security concerns, we use only base name in production mode.
318+
component.__file = "/home/khoa/src/github.com/khoanguyen96/paypal/src/components/PayPalCheckout.vue";
308319

309320
if (!component.render) {
310321
component.render = template.render;
@@ -319,60 +330,10 @@ function __vue_normalize__(template, style, script$$1, scope, functional, module
319330
return component;
320331
}
321332
/* style inject */
322-
function __vue_create_injector__() {
323-
var head = document.head || document.getElementsByTagName('head')[0];
324-
var styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {});
325-
var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
326-
327-
return function addStyle(id, css) {
328-
if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) return; // SSR styles are present.
329-
330-
var group = isOldIE ? css.media || 'default' : id;
331-
var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined });
332-
333-
if (!style.ids.includes(id)) {
334-
var code = css.source;
335-
var index = style.ids.length;
336-
337-
style.ids.push(id);
338-
339-
if (isOldIE) {
340-
style.element = style.element || document.querySelector('style[data-group=' + group + ']');
341-
}
342-
343-
if (!style.element) {
344-
var el = style.element = document.createElement('style');
345-
el.type = 'text/css';
346-
347-
if (css.media) el.setAttribute('media', css.media);
348-
if (isOldIE) {
349-
el.setAttribute('data-group', group);
350-
el.setAttribute('data-next-index', '0');
351-
}
352-
353-
head.appendChild(el);
354-
}
355333

356-
if (isOldIE) {
357-
index = parseInt(style.element.getAttribute('data-next-index'));
358-
style.element.setAttribute('data-next-index', index + 1);
359-
}
360-
361-
if (style.element.styleSheet) {
362-
style.parts.push(code);
363-
style.element.styleSheet.cssText = style.parts.filter(Boolean).join('\n');
364-
} else {
365-
var textNode = document.createTextNode(code);
366-
var nodes = style.element.childNodes;
367-
if (nodes[index]) style.element.removeChild(nodes[index]);
368-
if (nodes.length) style.element.insertBefore(textNode, nodes[index]);else style.element.appendChild(textNode);
369-
}
370-
}
371-
};
372-
}
373334
/* style inject SSR */
374335

375-
var PayPalCheckout = __vue_normalize__(__vue_template__, __vue_inject_styles__, typeof __vue_script__ === 'undefined' ? {} : __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, typeof __vue_create_injector__ !== 'undefined' ? __vue_create_injector__ : function () {}, typeof __vue_create_injector_ssr__ !== 'undefined' ? __vue_create_injector_ssr__ : function () {});
336+
var PayPalCheckout = __vue_normalize__({ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined);
376337

377338
var components = {
378339
'paypal-checkout': PayPalCheckout

dist/vue-paypal-checkout.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)