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

local changes #42

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports.getAuthenticationStatus = function () {
var strAuth = request.getHttpHeaders().get('x-bolt-hmac-sha256');
var httpParameterMap = request.getHttpParameterMap();
var requestBody = httpParameterMap.get('requestBodyAsString') ? httpParameterMap.requestBodyAsString : null;
var boltSigningSecret = Site.getCurrent().getCustomPreferenceValue('boltSigningSecret') || '';
var boltSigningSecret = '47a5f8ccac54692f3bfc110d826033586d3c7bf2eb88ad2e369624c7d6fa0d96';

if (!strAuth) {
log.error('Missing authorization key on request header');
Expand Down Expand Up @@ -181,8 +181,8 @@ function serviceParseResponse(_service, httpClient) {
*/
function getConfiguration() {
var site = Site.getCurrent();
var boltSigningSecret = site.getCustomPreferenceValue('boltSigningSecret') || '';
var boltAPIKey = site.getCustomPreferenceValue('boltAPIKey') || '';
var boltSigningSecret = '47a5f8ccac54692f3bfc110d826033586d3c7bf2eb88ad2e369624c7d6fa0d96';
var boltAPIKey = 'd737c0af74d2188576f29c4dc54759ea7aa2b319f9bb427570afd30e3d40be76';
var boltPartnerMerchant = site.getCustomPreferenceValue('boltPartnerMerchant').valueOf() || '';

if (boltAPIKey === '' || boltSigningSecret === '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports.BOLT_CARTRIDGE_VERSION = '2.1.0';
exports.getSitePreferences = function () {
var site = Site.getCurrent();

var boltMultiPublishableKey = site.getCustomPreferenceValue('boltMultiPublishableKeyOCAPI') || '';
var boltMultiPublishableKey = 'xucIhuC7kR07.FljG3LVceZat.4e91eb678c187f0820a3ce27fc87b684f0d2797bf3439d5b34da164ff4e27771';
var blockedCharactersList = site.getCustomPreferenceValue('blockedCharactersList') || null;

if (boltMultiPublishableKey === '') {
Expand Down Expand Up @@ -47,39 +47,15 @@ exports.getSitePreferences = function () {
* @returns {string} API URL to load connect from
*/
exports.getBoltApiServiceURL = function boltApiURL() {
var boltEnv = Site.getCurrent().getCustomPreferenceValue('boltEnvironmentOCAPI').valueOf();

switch (boltEnv) {
case 'sandbox':
return 'https://api-sandbox.bolt.com';

case 'staging':
return 'https://api-staging.bolt.com';

case 'production':
default:
return 'https://api.bolt.com';
}
return 'https://api.ayang.dev.bolt.me';
};

/**
* Return CDN URL
* @returns {string} CDN URL to load connect from
*/
function boltConnectURL() {
var boltEnv = Site.getCurrent().getCustomPreferenceValue('boltEnvironmentOCAPI').valueOf();

switch (boltEnv) {
case 'sandbox':
return 'https://connect-sandbox.bolt.com';

case 'staging':
return 'https://connect-staging.bolt.com';

case 'production':
default:
return 'https://connect.bolt.com';
}
return 'https://connect.ayang.dev.bolt.me';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ exports.initBoltButton = function () {
var boltButtonExist = setInterval(function () {
var checkoutBoltButton = $('[data-tid="instant-bolt-checkout-button"]'); // @ts-ignore
// have to check if child of this dom is svg, otherwise bolt button is not fully rendered (it's the object)
var boltButtonLoaded = checkoutBoltButton && window.BoltCheckout && checkoutBoltButton.children()[0].nodeName === 'svg';
var boltButtonLoaded = checkoutBoltButton;
if (boltButtonLoaded) {
clearInterval(boltButtonExist);

Expand Down

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<isif condition="${pdict.config && pdict.config.boltEnable && pdict.config.boltEnableCartPage && pdict.boltVersion && pdict.boltVersion == 'V2' && (pdict.isPPC || (pdict.items.length !== 0 || pdict.giftCertificateItems.length !== 0))}">
<isif condition="${pdict.config && pdict.config.boltEnable && pdict.config.boltEnableCartPage && pdict.boltVersion && pdict.boltVersion ==
'V2' && (pdict.items.length !== 0 || pdict.giftCertificateItems.length !== 0)}">
<input type="hidden" class="create-bolt-order-url" value="${URLUtils.https('Bolt-GetOrderReference')}" />
<input type="hidden" id="sfccBaseVersion" name="sfccBaseVersion" value="${pdict.config.sfccBaseVersion}" />
<input type="hidden" id="successRedirect" name="successRedirect" value="${URLUtils.url('Order-Confirm')}" />
Expand All @@ -12,8 +13,9 @@
<iscomment>Bolt checkout button</iscomment>
<div class="col-12 checkout-continue">
<div class="mb-sm-3 clearfix">
<div data-tid="instant-bolt-checkout-button">
<object data="${boltCdnUrl}/v1/checkout_button?publishable_key=${boltPublishableKey}"></object>
<div data-tid="instant-bolt-checkout-button" class="bolt-checkout-button">
<script id="bolt-connect" type="text/javascript" src="${boltCdnUrl}"
data-publishable-key="${boltPublishableKey}"></script>
</div>
</div>
</div>
Expand Down
Loading