forked from LiveCarta/PayPal-PHP-SDK
Updates to Payment API Samples
- Added Item Number in Items - Resolves #299
This commit is contained in:
@@ -962,7 +962,93 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
|||||||
"pageTitle": "payments/CreatePayment",
|
"pageTitle": "payments/CreatePayment",
|
||||||
"title": "CreatePayment"
|
"title": "CreatePayment"
|
||||||
},
|
},
|
||||||
"depth": 2
|
"depth": 2,
|
||||||
|
"outline": [
|
||||||
|
{
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 1,
|
||||||
|
"title": "CreatePaymentSample",
|
||||||
|
"slug": "createpaymentsample"
|
||||||
|
},
|
||||||
|
"depth": 1,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "CreditCard",
|
||||||
|
"slug": "creditcard"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "FundingInstrument",
|
||||||
|
"slug": "fundinginstrument"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Payer",
|
||||||
|
"slug": "payer"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Itemized information",
|
||||||
|
"slug": "itemized-information"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Additional payment details",
|
||||||
|
"slug": "additional-payment-details"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Amount",
|
||||||
|
"slug": "amount"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Transaction",
|
||||||
|
"slug": "transaction"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Payment",
|
||||||
|
"slug": "payment"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Create Payment",
|
||||||
|
"slug": "create-payment"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}, {
|
}, {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -980,7 +1066,93 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
|||||||
"pageTitle": "payments/CreatePaymentUsingPayPal",
|
"pageTitle": "payments/CreatePaymentUsingPayPal",
|
||||||
"title": "CreatePaymentUsingPayPal"
|
"title": "CreatePaymentUsingPayPal"
|
||||||
},
|
},
|
||||||
"depth": 2
|
"depth": 2,
|
||||||
|
"outline": [
|
||||||
|
{
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 1,
|
||||||
|
"title": "Create Payment using PayPal as payment method",
|
||||||
|
"slug": "create-payment-using-paypal-as-payment-method"
|
||||||
|
},
|
||||||
|
"depth": 1,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Payer",
|
||||||
|
"slug": "payer"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Itemized information",
|
||||||
|
"slug": "itemized-information"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Additional payment details",
|
||||||
|
"slug": "additional-payment-details"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Amount",
|
||||||
|
"slug": "amount"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Transaction",
|
||||||
|
"slug": "transaction"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Redirect urls",
|
||||||
|
"slug": "redirect-urls"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Payment",
|
||||||
|
"slug": "payment"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Create Payment",
|
||||||
|
"slug": "create-payment"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}, {
|
||||||
|
"type": "heading",
|
||||||
|
"data": {
|
||||||
|
"level": 3,
|
||||||
|
"title": "Get redirect url",
|
||||||
|
"slug": "get-redirect-url"
|
||||||
|
},
|
||||||
|
"depth": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}, {
|
}, {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"data": {
|
"data": {
|
||||||
@@ -1651,15 +1823,15 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
|||||||
};
|
};
|
||||||
|
|
||||||
selectNodeByDocumentPath = function(documentPath, headerSlug) {
|
selectNodeByDocumentPath = function(documentPath, headerSlug) {
|
||||||
var link, urlChunks, _i, _len, _ref;
|
var j, len, link, ref, urlChunks;
|
||||||
if (headerSlug == null) {
|
if (headerSlug == null) {
|
||||||
headerSlug = null;
|
headerSlug = null;
|
||||||
}
|
}
|
||||||
currentNode$ = fileMap[documentPath];
|
currentNode$ = fileMap[documentPath];
|
||||||
if (headerSlug) {
|
if (headerSlug) {
|
||||||
_ref = currentNode$.find('.outline a');
|
ref = currentNode$.find('.outline a');
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (j = 0, len = ref.length; j < len; j++) {
|
||||||
link = _ref[_i];
|
link = ref[j];
|
||||||
urlChunks = $(link).attr('href').split('#');
|
urlChunks = $(link).attr('href').split('#');
|
||||||
if (urlChunks[1] === headerSlug) {
|
if (urlChunks[1] === headerSlug) {
|
||||||
currentNode$ = $(link).parents('li').first();
|
currentNode$ = $(link).parents('li').first();
|
||||||
@@ -1673,10 +1845,10 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
|||||||
};
|
};
|
||||||
|
|
||||||
moveCurrentNode = function(up) {
|
moveCurrentNode = function(up) {
|
||||||
var i, newIndex, node, visibleNodes$, _i, _len;
|
var i, j, len, newIndex, node, visibleNodes$;
|
||||||
visibleNodes$ = toc$.find('li:visible:not(.filtered)');
|
visibleNodes$ = toc$.find('li:visible:not(.filtered)');
|
||||||
newIndex = 0;
|
newIndex = 0;
|
||||||
for (i = _i = 0, _len = visibleNodes$.length; _i < _len; i = ++_i) {
|
for (i = j = 0, len = visibleNodes$.length; j < len; i = ++j) {
|
||||||
node = visibleNodes$[i];
|
node = visibleNodes$[i];
|
||||||
if (node === currentNode$[0]) {
|
if (node === currentNode$[0]) {
|
||||||
newIndex = up ? i - 1 : i + 1;
|
newIndex = up ? i - 1 : i + 1;
|
||||||
@@ -1713,7 +1885,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
|||||||
currentQuery = '';
|
currentQuery = '';
|
||||||
|
|
||||||
searchNodes = function(queryString) {
|
searchNodes = function(queryString) {
|
||||||
var c, filtered, matched, matcher, nodeInfo, p, _i, _j, _k, _len, _len1, _len2, _results;
|
var c, filtered, j, k, l, len, len1, len2, matched, matcher, nodeInfo, p, results;
|
||||||
queryString = queryString.toLowerCase().replace(/\s+/, '');
|
queryString = queryString.toLowerCase().replace(/\s+/, '');
|
||||||
if (queryString === currentQuery) {
|
if (queryString === currentQuery) {
|
||||||
return;
|
return;
|
||||||
@@ -1723,18 +1895,18 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
|||||||
return clearFilter();
|
return clearFilter();
|
||||||
}
|
}
|
||||||
matcher = new RegExp(((function() {
|
matcher = new RegExp(((function() {
|
||||||
var _i, _len, _results;
|
var j, len, results;
|
||||||
_results = [];
|
results = [];
|
||||||
for (_i = 0, _len = queryString.length; _i < _len; _i++) {
|
for (j = 0, len = queryString.length; j < len; j++) {
|
||||||
c = queryString[_i];
|
c = queryString[j];
|
||||||
_results.push(c.replace(/[-[\]{}()*+?.,\\^$|#\s]/, "\\$&"));
|
results.push(c.replace(/[-[\]{}()*+?.,\\^$|#\s]/, "\\$&"));
|
||||||
}
|
}
|
||||||
return _results;
|
return results;
|
||||||
})()).join('.*'));
|
})()).join('.*'));
|
||||||
matched = [];
|
matched = [];
|
||||||
filtered = [];
|
filtered = [];
|
||||||
for (_i = 0, _len = searchableNodes.length; _i < _len; _i++) {
|
for (j = 0, len = searchableNodes.length; j < len; j++) {
|
||||||
nodeInfo = searchableNodes[_i];
|
nodeInfo = searchableNodes[j];
|
||||||
if (matcher.test(nodeInfo[0])) {
|
if (matcher.test(nodeInfo[0])) {
|
||||||
matched.push(nodeInfo);
|
matched.push(nodeInfo);
|
||||||
} else {
|
} else {
|
||||||
@@ -1745,53 +1917,53 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
|||||||
return clearFilter();
|
return clearFilter();
|
||||||
}
|
}
|
||||||
nav$.addClass('searching');
|
nav$.addClass('searching');
|
||||||
for (_j = 0, _len1 = filtered.length; _j < _len1; _j++) {
|
for (k = 0, len1 = filtered.length; k < len1; k++) {
|
||||||
nodeInfo = filtered[_j];
|
nodeInfo = filtered[k];
|
||||||
nodeInfo[1].removeClass('matched-child');
|
nodeInfo[1].removeClass('matched-child');
|
||||||
nodeInfo[1].addClass('filtered');
|
nodeInfo[1].addClass('filtered');
|
||||||
clearHighlight(nodeInfo[2]);
|
clearHighlight(nodeInfo[2]);
|
||||||
}
|
}
|
||||||
_results = [];
|
results = [];
|
||||||
for (_k = 0, _len2 = matched.length; _k < _len2; _k++) {
|
for (l = 0, len2 = matched.length; l < len2; l++) {
|
||||||
nodeInfo = matched[_k];
|
nodeInfo = matched[l];
|
||||||
nodeInfo[1].removeClass('filtered matched-child');
|
nodeInfo[1].removeClass('filtered matched-child');
|
||||||
nodeInfo[1].addClass('matched');
|
nodeInfo[1].addClass('matched');
|
||||||
highlightMatch(nodeInfo[2], queryString);
|
highlightMatch(nodeInfo[2], queryString);
|
||||||
_results.push((function() {
|
results.push((function() {
|
||||||
var _l, _len3, _ref, _results1;
|
var len3, m, ref, results1;
|
||||||
_ref = nodeInfo[1].parents('li');
|
ref = nodeInfo[1].parents('li');
|
||||||
_results1 = [];
|
results1 = [];
|
||||||
for (_l = 0, _len3 = _ref.length; _l < _len3; _l++) {
|
for (m = 0, len3 = ref.length; m < len3; m++) {
|
||||||
p = _ref[_l];
|
p = ref[m];
|
||||||
_results1.push($(p).addClass('matched-child'));
|
results1.push($(p).addClass('matched-child'));
|
||||||
}
|
}
|
||||||
return _results1;
|
return results1;
|
||||||
})());
|
})());
|
||||||
}
|
}
|
||||||
return _results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
clearFilter = function() {
|
clearFilter = function() {
|
||||||
var nodeInfo, _i, _len, _results;
|
var j, len, nodeInfo, results;
|
||||||
nav$.removeClass('searching');
|
nav$.removeClass('searching');
|
||||||
currentQuery = '';
|
currentQuery = '';
|
||||||
_results = [];
|
results = [];
|
||||||
for (_i = 0, _len = searchableNodes.length; _i < _len; _i++) {
|
for (j = 0, len = searchableNodes.length; j < len; j++) {
|
||||||
nodeInfo = searchableNodes[_i];
|
nodeInfo = searchableNodes[j];
|
||||||
nodeInfo[1].removeClass('filtered matched-child');
|
nodeInfo[1].removeClass('filtered matched-child');
|
||||||
_results.push(clearHighlight(nodeInfo[2]));
|
results.push(clearHighlight(nodeInfo[2]));
|
||||||
}
|
}
|
||||||
return _results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
highlightMatch = function(text$, queryString) {
|
highlightMatch = function(text$, queryString) {
|
||||||
var char, foundIndex, furthestIndex, lowerText, markedText, nodeText, _i, _len;
|
var char, foundIndex, furthestIndex, j, len, lowerText, markedText, nodeText;
|
||||||
nodeText = text$.text();
|
nodeText = text$.text();
|
||||||
lowerText = nodeText.toLowerCase();
|
lowerText = nodeText.toLowerCase();
|
||||||
markedText = '';
|
markedText = '';
|
||||||
furthestIndex = 0;
|
furthestIndex = 0;
|
||||||
for (_i = 0, _len = queryString.length; _i < _len; _i++) {
|
for (j = 0, len = queryString.length; j < len; j++) {
|
||||||
char = queryString[_i];
|
char = queryString[j];
|
||||||
foundIndex = lowerText.indexOf(char, furthestIndex);
|
foundIndex = lowerText.indexOf(char, furthestIndex);
|
||||||
markedText += nodeText.slice(furthestIndex, foundIndex) + ("<em>" + nodeText[foundIndex] + "</em>");
|
markedText += nodeText.slice(furthestIndex, foundIndex) + ("<em>" + nodeText[foundIndex] + "</em>");
|
||||||
furthestIndex = foundIndex + 1;
|
furthestIndex = foundIndex + 1;
|
||||||
@@ -1806,26 +1978,26 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
|||||||
fileMap = {};
|
fileMap = {};
|
||||||
|
|
||||||
buildNav = function(metaInfo) {
|
buildNav = function(metaInfo) {
|
||||||
var node, sourceURL, _i, _len;
|
var j, len, node, sourceURL;
|
||||||
nav$ = $("<nav>\n <ul class=\"tools\">\n <li class=\"toggle\">Table of Contents</li>\n <li class=\"search\">\n <input id=\"search\" type=\"search\" autocomplete=\"off\"/>\n </li>\n </ul>\n <ol class=\"toc\"/>\n </div>\n</nav>").appendTo($('body'));
|
nav$ = $("<nav>\n <ul class=\"tools\">\n <li class=\"toggle\">Table of Contents</li>\n <li class=\"search\">\n <input id=\"search\" type=\"search\" autocomplete=\"off\"/>\n </li>\n </ul>\n <ol class=\"toc\"/>\n </div>\n</nav>").appendTo($('body'));
|
||||||
toc$ = nav$.find('.toc');
|
toc$ = nav$.find('.toc');
|
||||||
if (metaInfo.githubURL) {
|
if (metaInfo.githubURL) {
|
||||||
if (metaInfo.documentPath === 'index') {
|
if (metaInfo.documentPath === 'index') {
|
||||||
sourceURL = metaInfo.githubURL;
|
sourceURL = metaInfo.githubURL;
|
||||||
} else {
|
} else {
|
||||||
sourceURL = "" + metaInfo.githubURL + "/blob/master/" + metaInfo.projectPath;
|
sourceURL = metaInfo.githubURL + "/blob/master/" + metaInfo.projectPath;
|
||||||
}
|
}
|
||||||
nav$.find('.tools').prepend("<li class=\"github\">\n <a href=\"" + sourceURL + "\" title=\"View source on GitHub\">\n View source on GitHub\n </a>\n</li>");
|
nav$.find('.tools').prepend("<li class=\"github\">\n <a href=\"" + sourceURL + "\" title=\"View source on GitHub\">\n View source on GitHub\n </a>\n</li>");
|
||||||
}
|
}
|
||||||
for (_i = 0, _len = tableOfContents.length; _i < _len; _i++) {
|
for (j = 0, len = tableOfContents.length; j < len; j++) {
|
||||||
node = tableOfContents[_i];
|
node = tableOfContents[j];
|
||||||
toc$.append(buildTOCNode(node, metaInfo));
|
toc$.append(buildTOCNode(node, metaInfo));
|
||||||
}
|
}
|
||||||
return nav$;
|
return nav$;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildTOCNode = function(node, metaInfo) {
|
buildTOCNode = function(node, metaInfo) {
|
||||||
var c, children$, clickLabel, discloser, discloser$, label$, node$, _i, _len, _ref, _ref1, _ref2;
|
var c, children$, clickLabel, discloser, discloser$, j, label$, len, node$, ref, ref1, ref2;
|
||||||
node$ = $("<li class=\"" + node.type + "\"/>");
|
node$ = $("<li class=\"" + node.type + "\"/>");
|
||||||
discloser = null;
|
discloser = null;
|
||||||
switch (node.type) {
|
switch (node.type) {
|
||||||
@@ -1849,11 +2021,11 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (((_ref = node.children) != null ? _ref.length : void 0) > 0) {
|
if (((ref = node.children) != null ? ref.length : void 0) > 0) {
|
||||||
children$ = $('<ol class="children"/>');
|
children$ = $('<ol class="children"/>');
|
||||||
_ref1 = node.children;
|
ref1 = node.children;
|
||||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
for (j = 0, len = ref1.length; j < len; j++) {
|
||||||
c = _ref1[_i];
|
c = ref1[j];
|
||||||
children$.append(buildTOCNode(c, metaInfo));
|
children$.append(buildTOCNode(c, metaInfo));
|
||||||
}
|
}
|
||||||
node$.append(children$);
|
node$.append(children$);
|
||||||
@@ -1861,7 +2033,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
|||||||
label$ = node$.find('> .label');
|
label$ = node$.find('> .label');
|
||||||
label$.click(clickLabel);
|
label$.click(clickLabel);
|
||||||
discloser$ = $('<span class="discloser"/>').prependTo(label$);
|
discloser$ = $('<span class="discloser"/>').prependTo(label$);
|
||||||
if (!(((_ref2 = node.children) != null ? _ref2.length : void 0) > 0)) {
|
if (!(((ref2 = node.children) != null ? ref2.length : void 0) > 0)) {
|
||||||
discloser$.addClass('placeholder');
|
discloser$.addClass('placeholder');
|
||||||
}
|
}
|
||||||
discloser = discloser$.get(0);
|
discloser = discloser$.get(0);
|
||||||
|
|||||||
@@ -19,11 +19,13 @@ information</p></div></div><div class="code"><div class="wrapper"><span class="h
|
|||||||
<span class="hljs-variable">$item1</span>->setName(<span class="hljs-string">'Ground Coffee 40 oz'</span>)
|
<span class="hljs-variable">$item1</span>->setName(<span class="hljs-string">'Ground Coffee 40 oz'</span>)
|
||||||
->setCurrency(<span class="hljs-string">'USD'</span>)
|
->setCurrency(<span class="hljs-string">'USD'</span>)
|
||||||
->setQuantity(<span class="hljs-number">1</span>)
|
->setQuantity(<span class="hljs-number">1</span>)
|
||||||
|
->setSku(<span class="hljs-string">"123123"</span>) <span class="hljs-comment">// Similar to `item_number` in Classic API</span>
|
||||||
->setPrice(<span class="hljs-number">7.5</span>);
|
->setPrice(<span class="hljs-number">7.5</span>);
|
||||||
<span class="hljs-variable">$item2</span> = <span class="hljs-keyword">new</span> Item();
|
<span class="hljs-variable">$item2</span> = <span class="hljs-keyword">new</span> Item();
|
||||||
<span class="hljs-variable">$item2</span>->setName(<span class="hljs-string">'Granola bars'</span>)
|
<span class="hljs-variable">$item2</span>->setName(<span class="hljs-string">'Granola bars'</span>)
|
||||||
->setCurrency(<span class="hljs-string">'USD'</span>)
|
->setCurrency(<span class="hljs-string">'USD'</span>)
|
||||||
->setQuantity(<span class="hljs-number">5</span>)
|
->setQuantity(<span class="hljs-number">5</span>)
|
||||||
|
->setSku(<span class="hljs-string">"321321"</span>) <span class="hljs-comment">// Similar to `item_number` in Classic API</span>
|
||||||
->setPrice(<span class="hljs-number">2</span>);
|
->setPrice(<span class="hljs-number">2</span>);
|
||||||
|
|
||||||
<span class="hljs-variable">$itemList</span> = <span class="hljs-keyword">new</span> ItemList();
|
<span class="hljs-variable">$itemList</span> = <span class="hljs-keyword">new</span> ItemList();
|
||||||
|
|||||||
@@ -29,11 +29,13 @@ $item1 = new Item();
|
|||||||
$item1->setName('Ground Coffee 40 oz')
|
$item1->setName('Ground Coffee 40 oz')
|
||||||
->setCurrency('USD')
|
->setCurrency('USD')
|
||||||
->setQuantity(1)
|
->setQuantity(1)
|
||||||
|
->setSku("123123") // Similar to `item_number` in Classic API
|
||||||
->setPrice(7.5);
|
->setPrice(7.5);
|
||||||
$item2 = new Item();
|
$item2 = new Item();
|
||||||
$item2->setName('Granola bars')
|
$item2->setName('Granola bars')
|
||||||
->setCurrency('USD')
|
->setCurrency('USD')
|
||||||
->setQuantity(5)
|
->setQuantity(5)
|
||||||
|
->setSku("321321") // Similar to `item_number` in Classic API
|
||||||
->setPrice(2);
|
->setPrice(2);
|
||||||
|
|
||||||
$itemList = new ItemList();
|
$itemList = new ItemList();
|
||||||
|
|||||||
Reference in New Issue
Block a user