Skip to content

Instantly share code, notes, and snippets.

View meetdave3's full-sized avatar

Meet Dave meetdave3

View GitHub Profile
<form
id="nonseamless"
method="post"
name="redirect"
action="https://test.ccavenue.com/transaction/transaction.do?command=initiateTransaction"
/>
<input type="hidden" id="encRequest" name="encRequest" value="' + encRequest + '">
<input type="hidden" name="access_code" id="access_code" value="' + accessCode + '">
</form>
<div class="container">
<div class="row">
<h1>Proceed to Pay</h1>
<button (click)="pay()"></button>
</div>
</div>
<form #form ngNoForm
id="nonseamless"
import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
@Component({
selector: '...',
templateUrl: '...',
styleUrls: [...],
providers: [...]
})
export class PaymentComponent implements OnInit {
const nodeCCAvenue = require('node-ccavenue');
const ccav = new nodeCCAvenue.Configure({
merchant_id: process.env.test_merchant_id || process.env.prod_merchant_id,
working_key: process.env.test_working_key || process.env.prod_working_key
});
router.post('/handleccavenueresponse', (req,res) => {
const { encResp } = req.body;
const output = ccav.redirectResponseToJson(encResp);
@meetdave3
meetdave3 / styles.js
Created February 14, 2019 10:59
Using styled-components to conditionally update style of the React Component
import styled from 'styled-components';
import is from 'styled-is';
export const CollapsedView = styled.div`
height: ${minimizedH};
... other styles
${is('isOver')`
animation: ${transitionToWhite} 0.7s forwards;
animation-timing-function: cubic-bezier(0,1.28,.74,.7);
import {AfterViewInit, Component, Inject, PLATFORM_ID} from '@angular/core';
import {isPlatformBrowser} from '@angular/common';
import {NavigationEnd, Router} from '@angular/router';
declare let ga: Function;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
var cheerio = require('cheerio');
var request = require('request');
function htmlScraper(url, callback){
request(url,function(error,response,html) {
console.log(url);
var $ =cheerio.load(html);
$(' #primaryCollectionContainer').each(function(i,element){
var data = $(this);
var parsedHTML = data.children().first().html();
# --------------------------------------------
# --------------------------------------------
# anchors/fragments used throughout this file
.deploy: &deployment_spec
stage: deploy
image: garland/aws-cli-docker
dependencies:
- build app
script:
- aws s3 sync --acl public-read dist/ s3://${S3_BUCKET_NAME}