Javascript 自定义Ecwid应用程序未出现在签出页面
我是Ecwid平台的新手,我正在为dropshipping构建一个定制的courier应用程序。我使用的是1.2.8版的Ecwid SDK JS文件Javascript 自定义Ecwid应用程序未出现在签出页面,javascript,Javascript,我是Ecwid平台的新手,我正在为dropshipping构建一个定制的courier应用程序。我使用的是1.2.8版的Ecwid SDK JS文件https://djqizrxa6f10j.cloudfront.net/ecwid-sdk/js/1.2.8/ecwid-app.js。现在的问题是,当我进入店面结帐页面时,正如Ecwid开发者API文档所指出的,应该会有一个回调发送到我的URL,而我没有收到这个回调 EcwidApp.init({ app_id: "app_id
https://djqizrxa6f10j.cloudfront.net/ecwid-sdk/js/1.2.8/ecwid-app.js
。现在的问题是,当我进入店面结帐页面时,正如Ecwid开发者API文档所指出的,应该会有一个回调发送到我的URL,而我没有收到这个回调
EcwidApp.init({
app_id: "app_id",
autoloadedflag: true,
autoheight: true
});
EcwidApp.ready();
window.localStorage.setItem("show_ec_logs", "true");
let storeData = EcwidApp.getPayload();
let storeId = storeData.store_id;
let accessToken = storeData.access_token;
let language = storeData.lang;
let viewMode = storeData.view_mode;
if (storeData.app_state !== undefined) {
var appState = storeData.app_state;
}
const initialConfig = {
private: {
merchantId: "app_id",
APIsecret: "app_secret_token",
endpointUrl: "https://ecwid-droppa-shipping.herokuapp.com",
instructionTitle: "Droppa Instruction Title",
globalShippingRate: "true",
freeShippingRate: "true",
installed: "yes"
},
profile: this.storeProfileInformation(storeId, accessToken)
};
EcwidApp.setAppStorage(initialConfig.profile, function (value) {
console.log('Private User Preferences Saved:', value);
});
EcwidApp.getAppStorage('installed', function (value) {
console.log(`Installed Application: ${value}`);
});
/**
* @description - Display the Ecwid User's Store's information
* @param {*} store_id
* @param {*} private_token ?
* @returns
*/
async function storeProfileInformation(store_id, private_token) {
return await fetch(`https://app.ecwid.com/api/v3/${store_id}/profile?token=${private_token}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept-Encoding': 'gzi'
},
mode: 'cors',
})
.then((res) => res.json())
.then((response) => response)
.catch((errors) => console.log(errors));
}
有没有办法让应用程序出现在结帐页面?我在Ecwid仪表板中加载了我的应用程序中的所有作用域。这是Ecwid API团队的Harvel 我是Ecwid平台的新手,我正在构建一个定制的courier应用程序 用于运输。有没有办法让应用程序出现在 结帐页面 您发送的代码是商户应用程序设置的代码,它加载在Ecwid管理员中 为了开发定制courier应用程序并在结帐页面显示其运费,您应该拥有自己的服务器,该服务器将接收来自Ecwid的请求,将请求发送到第三方服务,然后返回Ecwid。
一旦Ecwid从您的应用程序收到运费,这些运费将显示在结帐页面,客户将能够选择它们 那么,一步一步地以及它将如何工作:
哈维尔R.
Ecwid API团队Hey@Harvel,感谢您的回复。现在我使用Heroku来托管我的应用程序。现在,当我使用Eciwd js文件并将我的storeId添加到其中时,每次我去我的店面,我都会得到一个404状态码。现在的问题是Heroku没有抛出成功200状态,还是可能还有另一个问题?!或者我应该切换我的主机服务器。