Skip to content

Commit

Permalink
Merge pull request #40 from mollie/feature/MOL-213/PICT-232
Browse files Browse the repository at this point in the history
Feature/mol 213/pict 232
  • Loading branch information
Tung-Huynh-Shopmacher authored Aug 16, 2024
2 parents 1c27f5a + c19b79c commit 448062d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ Distributed under the MIT License. See LICENSE for more information.

[Mollie's support page](https://help.mollie.com/hc/en-us)

[Project Link](https://github.com/mollie/commercetools)
[Get in touch with us](https://www.mollie.com/de/contact/merchants)

<div align="center"> <b>Happy Coding! 🚀</b> </div>
4 changes: 2 additions & 2 deletions processor/package-lock.json

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

2 changes: 1 addition & 1 deletion processor/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "shopmacher-mollie-processor",
"description": "Integration between commercetools and mollie payment service provider",
"version": "0.0.28",
"version": "0.0.29",
"main": "index.js",
"private": true,
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion processor/src/service/payment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,10 @@ export const handleGetApplePaySession = async (ctPayment: Payment): Promise<Cont

const session: ApplePaySession = await getApplePaySession(requestOptions);

const ctActions: UpdateAction[] = [setCustomFields(CustomFields.applePay.session.response, JSON.stringify(session))];
const ctActions: UpdateAction[] = [
setCustomFields(CustomFields.applePay.session.response, JSON.stringify(session)),
setCustomFields(CustomFields.applePay.session.request, ''),
];

return {
statusCode: 200,
Expand Down
2 changes: 1 addition & 1 deletion processor/src/utils/map.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const mapCommercetoolsPaymentCustomFieldsToMollieListParams = async (
const getSpecificPaymentParams = (method: PaymentMethod | CustomPaymentMethod, paymentRequest: any) => {
switch (method) {
case PaymentMethod.applepay:
return { applePayPaymentToken: paymentRequest.applePayPaymentToken ?? '' };
return { applePayPaymentToken: JSON.stringify(paymentRequest.applePayPaymentToken ?? {}) };
case PaymentMethod.banktransfer:
return {
dueDate: calculateDueDate(readConfiguration().mollie.bankTransferDueDate),
Expand Down
5 changes: 5 additions & 0 deletions processor/tests/service/payment.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,11 @@ describe('Test handleGetApplePaySession', () => {
value:
'{"domain":"pay.mywebshop.com","validationUrl":"https://apple-pay-gateway-cert.apple.com/paymentservices/paymentSession"}',
},
{
action: 'setCustomField',
name: 'sctm_apple_pay_session_request',
value: '',
},
]);
});

Expand Down
2 changes: 1 addition & 1 deletion processor/tests/utils/map.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ describe('createMollieCreatePaymentParams', () => {
redirectUrl: customFieldObject.redirectUrl,
webhookUrl: extensionUrl,
description: customFieldObject.description,
applePayPaymentToken: customFieldObject.applePayPaymentToken,
applePayPaymentToken: JSON.stringify(customFieldObject.applePayPaymentToken),
});
});

Expand Down

0 comments on commit 448062d

Please sign in to comment.