"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getPaymentData = void 0;
const getPaymentData = function () {
  let {
    amount = 0,
    configuration = {},
    googlePayId
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  const baseRequest = {
    apiVersion: 2,
    apiVersionMinor: 0
  };
  const tokenizationSpecification = {
    type: 'PAYMENT_GATEWAY',
    parameters: {
      gateway: 'globalpayments',
      gatewayMerchantId: configuration.MERCHANT_ID
    }
  };
  const allowedPaymentMethods = [{
    type: 'CARD',
    parameters: {
      allowedAuthMethods: ['CRYPTOGRAM_3DS'],
      allowedCardNetworks: ['AMEX', 'DISCOVER', 'JCB', 'MASTERCARD', 'VISA']
    },
    tokenizationSpecification
  }];
  const merchantInfo = {
    merchantId: googlePayId
  };
  const transactionInfo = {
    totalPriceStatus: 'FINAL',
    totalPrice: amount.toString(),
    currencyCode: configuration.CURRENCY,
    countryCode: configuration.HPP_CUSTOMER_COUNTRY
  };
  return {
    allowedPaymentMethods,
    baseRequest,
    merchantInfo,
    transactionInfo
  };
};
exports.getPaymentData = getPaymentData;
//# sourceMappingURL=getPaymentData.js.map