Skip to content

Add checkout page#536

Open
Vladyslav-Kuksiuk wants to merge 47 commits intomasterfrom
checkout-page
Open

Add checkout page#536
Vladyslav-Kuksiuk wants to merge 47 commits intomasterfrom
checkout-page

Conversation

@Vladyslav-Kuksiuk
Copy link
Copy Markdown

@Vladyslav-Kuksiuk Vladyslav-Kuksiuk commented Apr 23, 2026

This PR adds checkout page .../checkout?product={product-id}.

Predefined test Paygate products:
spine-support-50h, spine-support-100h

⚠️Current implementation is facing staging Paygate backend

Page view:

image image

Server Error view (when something is broken in the middle of checkout):

image

Product not found page (when Paygate is available, but answers 404):

image

Thank you page (.../checkout-completed)

image

Ooops page

image

@Vladyslav-Kuksiuk Vladyslav-Kuksiuk self-assigned this Apr 23, 2026
@Vladyslav-Kuksiuk Vladyslav-Kuksiuk marked this pull request as ready for review April 23, 2026 11:47
@MykytaPimonovTD
Copy link
Copy Markdown
Contributor

I propose delete circle with '!' from this view. @JuliaEvseeva what do you think?

Screenshot 2026-04-27 at 14 35 51

@JuliaEvseeva
Copy link
Copy Markdown
Collaborator

I propose delete circle with '!' from this view.

Yes, we don’t need this circle here. Also, there is an extra space before the period in the message.

Copy link
Copy Markdown
Contributor

@MykytaPimonovTD MykytaPimonovTD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vladyslav-Kuksiuk see the first bunch of comments. 12/22.

Comment thread site/assets/js/pages/checkout/index.js
Comment thread site/assets/js/pages/checkout/index.js Outdated
Comment thread site/assets/js/pages/checkout/phone-codes.js
Comment thread site/content/checkout-completed/index.md
Comment thread site/content/checkout-completed/index.md Outdated
return postJson(`${baseUrl}/purchases/calculate-charges`, payload);
},
submitBillingInfo(payload) {
return postJson(`${baseUrl}/purchases/submit-billing-info`, payload);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return postJson(`${baseUrl}/purchases/submit-billing-info`, payload);
return postJson(`${baseUrl}/purchases/provide-billing-info`, payload);

Comment thread site/assets/js/modules/paygate/purchases.js Outdated
Comment thread site/assets/js/modules/paygate/purchases.js Outdated
/**
* Debounces charge recalculation while the user types a VAT ID.
*/
function schedule() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send request on changing focus.

Screen.Recording.2026-04-27.at.15.22.56.mov

Comment thread site/assets/js/pages/checkout/view-controller.js Outdated
* @param {string} value phone-number value to sanitize
* @return {string} sanitized phone-number value
*/
export function sanitizePhoneNumberInput(value) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method used anywhere? Doesn't the above one help us to skip this one?

* @return {PaygatePurchaseClient} paygate purchase endpoint methods
*/
export function createPurchaseClient(serverUrl) {
const baseUrl = normalizeServerUrl(serverUrl);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this call? Can't the server URL be normalized manually since it's a config value? If for some reason Hugo adds some noise to the string, can we look for the way to remove those noise from the Hugo side?

Comment on lines +209 to +211
if (response.status === 204) {
return null;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This an below response - to - null conversion should be documented in the doc now it's unclear how we handle response.
Maybe the method above should be updated somehow as well.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file currently unites two big parts of logic:

  1. Request - Reponse to the server.
  2. Complicated service that manages request queue.

Lets divide this on two parts, the simpliest way to do this is imaging that there is, for example, some other input that requires the same input - request logic but with totally different endpoints and requests.

Comment on lines +225 to +229
if (error.status >= 500) {
return false;
}

view.showErrorModal();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this.
But why we do not view.showErrorModal() on 500? Maybe document that not all errors shows modal.

Comment on lines +209 to +211
} else {
console.log('Billing info response:', response);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this code? If after submit there is no redirect maybe something should be done? Not simply write to log.

Copy link
Copy Markdown
Collaborator

@dmytro-kashcheiev dmytro-kashcheiev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants