This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AESCrypto | |
# @!attribute cipher | |
# @return [OpenSSL::Cipher] the cipher object used to encrypt and decrypt | |
# @!attribute iv | |
# @return [String] the initialization vector used for the cipher object | |
# @!attribute key | |
# @return [String] the key used for the cipher object | |
require 'openssl' | |
require 'base64' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if transaction.entity.present? | |
entity = transaction.entity | |
if entity.type == 4 | |
data_link[:datos_adicionales] = { 'Oferta' => entity.name, 'Descripción' => entity.description } | |
else | |
data_link[:datos_adicionales] = { 'Descripción' => Pay::PaymentezAdapter.format_charge_description(customer) } | |
end | |
data_link | |
else | |
data_link[:datos_adicionales] = { 'Descripción' => Pay::PaymentezAdapter.format_charge_description(customer) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MapIsoToCountryAndIoc = { | |
AF: ['Afghanistan', 'AFG'], | |
AL: ['Albania', 'ALB'], | |
DZ: ['Algeria', 'ALG'], | |
AS: ['American Samoa', 'ASA'], | |
AD: ['Andorra', 'AND'], | |
AO: ['Angola', 'ANG'], | |
AG: ['Antigua and Barbuda', 'ANT'], | |
AR: ['Argentina', 'ARG'], | |
AM: ['Armenia', 'ARM'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import momentPropTypes from 'react-moment-proptypes'; | |
import moment from 'moment'; | |
import omit from 'lodash/omit'; | |
import 'react-dates/initialize'; | |
import 'react-dates/lib/css/_datepicker.css'; | |
import { withStyles, withStylesPropTypes, css } from 'react-with-styles'; | |
import DateRangePickerShape from 'react-dates/src/shapes/DateRangePickerShape'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.get('/task/:id', async (ctx) => { | |
await Task.findOne({ | |
where: { | |
id: ctx.params.id | |
} | |
}) | |
.then(tasks => { | |
if (tasks === null){ | |
Object.assign(ctx, { status: 404, body: { errors: [{ msg: 'Task does not exist' }] } }); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useCallback } from 'react'; | |
import { BackHandler } from 'react-native'; | |
import PropTypes from 'prop-types'; | |
import { useFocusEffect } from '@react-navigation/native'; | |
const AndroidBackHandlerWrapper = (props) => { | |
useFocusEffect( | |
useCallback(() => { | |
const { onBackPress } = props; | |
BackHandler.addEventListener('hardwareBackPress', onBackPress); |