Skip to content

Http 403 error #13

@Napster2210

Description

@Napster2210

Hello @jesperjohansson @mortend

After selecting the "Credit Card" payment method, I am filling the card details and when I press on "Pay" button it got failed and stopped the process with just this message: "Http 403 error". I have debug the code and it goes in rejectCallback:

AdyenDropInModule.start(
          cleanedPaymentMethodsResponse,
          resolveCallback,
          rejectCallback
        );

My implementation:

import AdyenDropIn, { isCancelledError, isSuccessResult, PaymentResult, } from '@ancon/react-native-adyen-dropin';

 const adyenDropIn = AdyenDropIn.setModuleConfig({
        // Required
        baseUrl: "API_BASE_URL",
        // Optional
        debug: true,
        // Optional
        // headers: {
        //   Authorization: 'Bearer 123',
        // },
        // // Optional
        endpoints: {
          makePayment: '/makePayment',
          makeDetailsCall: '/details',
          disableStoredPaymentMethod: '/disable',
        },
      }).setDropInConfig({
        // Required
        clientKey: ADYEN_CLIENT_KEY,
        // Required
        environment: ADYEN_ENV,
        // Required
        countryCode: COUNTRY_CODE,
        // Required
        amount: {
          value: payableAmount,
          currencyCode:
            _.get(paymentDetails, "currency", DEFAULT_CURRENCY_CODE) ||
            DEFAULT_CURRENCY_CODE,
        },
        // Optional
        // applePay: {
        //   label: 'Example Company',
        //   amount: { value: 1, currencyCode: 'SEK' },
        //   configuration: {
        //     merchantId: config.applePay?.configuration?.merchantId,
        //   },
        // },
        // // Optional
        // showRemovePaymentMethodButton: config.showRemovePaymentMethodButton,
        // // Optional, required for recurring payments/saved payment method
        // shopperReference: config.shopperReference,
      });
      
     const tempMethods = await getPaymentMethods();

      adyenDropIn
        .start(tempMethods)
        .then((res: PaymentResult) => {
          console.log('result:');
          console.log(res);
          if (isSuccessResult(res)) {
            console.log('Success', `Payment success: ${res.resultCode}`);
          } else {
            console.log('Refused', `Payment refused: ${res.refusalReason}`);
          }
        })
        .catch((err: Error) => {
          if (isCancelledError(err)) {
            console.log('Cancelled');
          } else {
            console.log('Error', `Payment error: ${err.message}`, JSON.stringify(err));
            console.error(err);
          }
        })
        .finally(() => {
          setIsLoading(false);
        });

Can you please help me with this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions