Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Orders Upsert Support #153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
dw.json
node_modules/
cartridges/*/cartridge/static/default/fonts/
cartridges/app_storefront_base/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</p>

## The latest version
The latest version of this cartridge is v2022_08
The latest version of this cartridge is v2024_04


## Company Overview
Expand Down
2 changes: 1 addition & 1 deletion cartridges/int_extend/cartridge/scripts/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function getLineItems(order) {
for (var k = 0; k < productLi.quantity.value; k++) {
pliObj = {};
pliObj.product = product;
pliObj.lineItemTransactionID = productLi.getUUID();
pliObj.lineItemTransactionId = productLi.getUUID();

if (productLi.custom.isWarrantable && !productLi.custom.persistentUUID) {
pliObj.quantity = productLi.quantity.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ function createShippingProtectionContractLine(order) {

shippingProtectionLineItem.type = 'shipments';

shippingProtectionLineItem.type = 'shipments';

var extendShippingQuoteId = extendShippingProtectionLineItem.custom.extendShippingQuoteId;
shippingProtectionLineItem.quoteId = extendShippingQuoteId;

Expand Down
2 changes: 1 addition & 1 deletion cartridges/int_extend_sfra/cartridge/scripts/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function getLineItems(order) {
for (var k = 0; k < productLi.quantity.value; k++) {
pliObj = {};
pliObj.product = product;
pliObj.lineItemTransactionID = productLi.getUUID();
pliObj.lineItemTransactionId = productLi.getUUID();

if (productLi.custom.isWarrantable && !productLi.custom.persistentUUID) {
pliObj.quantity = productLi.quantity.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ function createShippingProtectionContractLine(order) {

shippingProtectionLineItem.type = 'shipments';

shippingProtectionLineItem.lineItemTransactionId = 'shipping';

var extendShippingQuoteId = extendShippingProtectionLineItem.custom.extendShippingQuoteId;
shippingProtectionLineItem.quoteId = extendShippingQuoteId;

Expand Down
4 changes: 2 additions & 2 deletions cartridges/int_extend_sfra/cartridge/scripts/services/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function createServiceCall(configObj) {
var orderApiMethod = (extendAPIMethod === 'ordersAPIonOrderCreate') || (extendAPIMethod === 'ordersAPIonSchedule');

if (orderApiMethod) {
API_VERSION = '2022-02-01';
API_VERSION = 'latest';
} else {
// used '2021-04-01' API version in case of contracts API
API_VERSION = '2021-04-01';
Expand Down Expand Up @@ -133,7 +133,7 @@ function createRequestConfiguration(endpoint, requestObject) {

case 'orders':
configObj.endpoint = 'orders';
configObj.method = 'POST';
configObj.method = 'PUT';
configObj.extendMethod = 'orders';
configObj.XIdempotencyKey = UUIDUtils.createUUID();
configObj.mock = mocks.ordersResponseMock;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "int_extend_sfra",
"version": "22.1.0",
"version": "23.0.0",
"description": "Extend SFRA cartridge",
"devDependencies": {
"@babel/core": "^7.6.3",
Expand Down Expand Up @@ -39,6 +39,6 @@
"compile:scss": "sgmf-scripts --compile css"
},
"paths": {
"base": "../helloextend/cartridges/app_storefront_base/"
"base": "./cartridges/app_storefront_base/"
}
}
Loading