Skip to content

Commit

Permalink
Add ct project details hardcoded for testing connector
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenkumarct committed Feb 1, 2024
1 parent 3ebf3e0 commit 5676a37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 0 additions & 5 deletions processor/.env.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Server configuration
NODE_ENV=development
SERVER_HOST=0.0.0.0
SERVER_PORT=8080

# CoCo credentials
CTP_AUTH_URL=https://auth.[region].commercetools.com
CTP_API_URL=https://api.[region].commercetools.com
Expand Down
6 changes: 3 additions & 3 deletions processor/src/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const config = {
// Required by Payment SDK
projectKey: process.env.CTP_PROJECT_KEY || 'test',
clientId: process.env.CTP_CLIENT_ID || 'clientId',
clientSecret: process.env.CTP_CLIENT_SECRET || 'clientSecret',
projectKey: process.env.CTP_PROJECT_KEY || 'payment-integration',
clientId: process.env.CTP_CLIENT_ID || 'ejswbLthFjvOgjMoD0oAY1l3',
clientSecret: process.env.CTP_CLIENT_SECRET || 'v4H0KksThCCeV7Y8vtRgOutNm0O7zoYL',
authUrl: process.env.CTP_AUTH_URL || 'https://auth.europe-west1.gcp.commercetools.com',
apiUrl: process.env.CTP_API_URL || 'https://api.europe-west1.gcp.commercetools.com',
sessionUrl: process.env.CTP_SESSION_URL || 'https://session-dev.europe-west1.gcp.commercetools.com/',
Expand Down
4 changes: 3 additions & 1 deletion processor/src/services/payment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export class DefaultPaymentService implements PaymentService {
public async createPayment(opts: CreatePayment): Promise<PaymentResponseSchemaDTO> {
let ctCart;
ctCart = await this.ctCartService.getCart({
id: getSessionContext().cartId,
//id: getSessionContext().cartId,
// TODO: Implement Session API , For testing purpose using hardcoded cart value.
id: "861502ae-c719-4762-a262-d04f68063d4b"
});

const ctPayment = await this.ctPaymentService.createPayment({
Expand Down

0 comments on commit 5676a37

Please sign in to comment.