Skip to content

Commit

Permalink
Merge pull request #33 from Adyen/feature/AD-390
Browse files Browse the repository at this point in the history
AD-390: Removing session
  • Loading branch information
kpieloch authored Jan 8, 2025
2 parents 5895ceb + ebf5e4f commit 7c596c2
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('CheckoutAdyenPaymentMethodComponent', () => {
adyenClientKey: 'mockClientKey',
adyenPaypalMerchantId: 'mockPaypalMerchantId',
deviceFingerPrintUrl: 'mockDeviceFingerPrintUrl',
sessionData: { id: 'mockSessionId', sessionData: 'mockSessionData' },

selectedPaymentMethod: 'mockPaymentMethod',
showRememberTheseDetails: true,
checkoutShopperHost: 'mockShopperHost',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,10 @@ export class CheckoutAdyenPaymentMethodComponent implements OnInit, OnDestroy {
storedPaymentMethods: adyenConfig.storedPaymentMethodList
},
locale: adyenConfig.shopperLocale,
countryCode: adyenConfig.countryCode,
environment: this.castToEnvironment(adyenConfig.environmentMode),
clientKey: adyenConfig.adyenClientKey,
session: {
id: adyenConfig.sessionData.id,
sessionData: adyenConfig.sessionData.sessionData
},
amount: adyenConfig.amount,
analytics: {
enabled: false
},
Expand Down Expand Up @@ -232,11 +230,11 @@ export class CheckoutAdyenPaymentMethodComponent implements OnInit, OnDestroy {
private handleResponse(response: PlaceOrderResponse | void, actions: SubmitActions) {
if (!!response) {
if (response.success) {
if (response.executeAction && response.paymentsAction !== undefined) {
if (response.executeAction === true && !!response.paymentsAction) {
this.dropIn.handleAction(response.paymentsAction)
} else {
} else if (!!response.paymentsResponse) {
actions.resolve({
resultCode: 'Authorised'
resultCode: response.paymentsResponse.resultCode
});
this.onSuccess();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export interface AdyenConfigData {
adyenClientKey: string;
adyenPaypalMerchantId: string;
deviceFingerPrintUrl: string;
sessionData: SessionData;
selectedPaymentMethod: string;
showRememberTheseDetails: boolean;
checkoutShopperHost: string;
Expand Down Expand Up @@ -60,11 +59,6 @@ interface ExpressPaymentConfig {
amazonPayExpressEnabledOnProduct: boolean
}

interface SessionData {
id: string,
sessionData: string
}

interface StoredPaymentMethodData {
brand: string;
expiryMonth: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PaymentAction } from "@adyen/adyen-web";
import { PaymentAction,PaymentResponseData } from "@adyen/adyen-web";
import { Order } from '@spartacus/order/root';

export interface ApplePayExpressRequest {
Expand All @@ -25,6 +25,7 @@ export interface PlaceOrderResponse {
success: boolean,
executeAction?: boolean,
paymentsAction?: PaymentAction,
paymentsResponse?: PaymentResponseData,
error?: string,
errorFieldCodes?: string[]
orderNumber?: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ describe('OccCheckoutConfigAdapter', () => {
adyenClientKey: 'mockClientKey',
adyenPaypalMerchantId: 'mockPaypalMerchantId',
deviceFingerPrintUrl: 'https://mock.device.fingerprint.url',
sessionData: {
id: 'mockSessionId',
sessionData: 'mockSessionData'
},
selectedPaymentMethod: 'mockPaymentMethod',
showRememberTheseDetails: true,
checkoutShopperHost: 'https://mock.checkout.shopper.host',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('AppleExpressPaymentComponent', () => {
adyenClientKey: 'mockClientKey',
adyenPaypalMerchantId: 'mockPaypalMerchantId',
deviceFingerPrintUrl: 'mockDeviceFingerPrintUrl',
sessionData: { id: 'mockSessionId', sessionData: 'mockSessionData' },
selectedPaymentMethod: 'mockPaymentMethod',
showRememberTheseDetails: true,
checkoutShopperHost: 'mockShopperHost',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ describe('GoogleExpressPaymentComponent', () => {
adyenClientKey: 'mockClientKey',
adyenPaypalMerchantId: 'mockPaypalMerchantId',
deviceFingerPrintUrl: 'mockDeviceFingerPrintUrl',
sessionData: { id: 'mockSessionId', sessionData: 'mockSessionData' },
selectedPaymentMethod: 'mockPaymentMethod',
showRememberTheseDetails: true,
checkoutShopperHost: 'mockShopperHost',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ describe('CheckoutAdyenConfigurationService', () => {
adyenClientKey: 'testClientKey',
adyenPaypalMerchantId: 'testPaypalMerchantId',
deviceFingerPrintUrl: 'https://example.com/fingerprint',
sessionData: { id: 'sessionId', sessionData: 'sessionData' },
selectedPaymentMethod: 'visa',
showRememberTheseDetails: true,
checkoutShopperHost: 'https://example.com/shopper',
Expand Down

0 comments on commit 7c596c2

Please sign in to comment.