Skip to content

initial sample app changes for ppcp - #91

Open
ragarwal-spreedly wants to merge 8 commits into
mainfrom
feat/ppcp-example
Open

initial sample app changes for ppcp#91
ragarwal-spreedly wants to merge 8 commits into
mainfrom
feat/ppcp-example

Conversation

@ragarwal-spreedly

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/routes.ts Fixed
Comment thread src/routes.ts
* 500:
* description: Error minting client token
*/
router.get('/ppcp/client-token', getPPCPClientToken);
Comment on lines +36 to +39
list.innerHTML = rows
.filter(([, value]) => value !== undefined && value !== null && value !== '')
.map(([key, value]) => `<dt>${key}</dt><dd>${value}</dd>`)
.join('');
Comment on lines +158 to +181
const transactionResponse = await axios.post(
`${config.spreedlyUrl}/v1/gateways/${config.ppcpGatewayToken}/${transactionType}.json`,
{
transaction: {
payment_method_token: paymentMethodToken,
amount: toMinorUnits(amount),
currency_code,
// Dedicated return page — with presentationMode 'redirect' the buyer lands here
// rather than back on the checkout page, and it captures using the
// ?transaction_token= Spreedly appends. See src/static/ppcp/return/.
redirect_url: `${origin}/ppcp/return/`,
// Required by Spreedly, but its v6 semantics are UNVERIFIED — the gateway doc says only
// that offsite transactions need one. (Spreedly's public offsite-callbacks page
// describes the PayPal v5 / Braintree-era flow, so it is not a source of truth here.)
// Pointed at a real route rather than a static page because a POST is the plausible
// shape and a route can at least answer one. Empirically NOT load-bearing: a checkout
// completed end-to-end while this pointed at a static HTML page — the redirect leg is
// what finalizes the authorization. Open question for the Gateway team.
callback_url: `${origin}/api/v1/offsite-callback`,
retain_on_success: true,
},
},
{ headers: spreedlyHeaders() }
);
@omkar-joshi
omkar-joshi temporarily deployed to checkout-web-sample-app August 13, 2026 09:41 Inactive
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.

3 participants