Skip to content

Instantly share code, notes, and snippets.

View deepu105's full-sized avatar
🏠
Working from home

Deepu K Sasidharan deepu105

🏠
Working from home
View GitHub Profile
# If you come from bash you might have to change your $PATH.
export SHELL=/usr/bin/zsh
# Path to your oh-my-zsh installation.
export ZSH="/home/deepu/.oh-my-zsh"
# Lines configured by zsh-newuser-install
HISTFILE=~/.zsh_history
HISTSIZE=5000
SAVEHIST=5000
setopt autocd
@deepu105
deepu105 / Istio-jh.json
Created March 25, 2022 08:10
JDL -> JSON
{
"applications": [
{
"config": {
"baseName": "store",
"applicationType": "gateway",
"packageName": "com.jhipster.demo.store",
"packageFolder": "com/jhipster/demo/store",
"serviceDiscoveryType": "no",
"authenticationType": "jwt",
@deepu105
deepu105 / Istio-jh.jdl
Created November 13, 2021 11:53
Istio-jh.jdl
application {
config {
baseName store
applicationType gateway
packageName com.jhipster.demo.store
serviceDiscoveryType no
authenticationType jwt
prodDatabaseType postgresql
cacheProvider hazelcast
buildTool gradle
const payment = await request.show();
// This payment method handles everything and returns a final result
if (payment.details.bobpay_token_id) {
await payment.complete("success");
window.location.href = "/result/success";
return false;
}
# Clone this repo
$ git clone https://github.com/deepu105/payment-request-api-example
$ cd payment-request-api-example
# Install dependencies
$ npm install
# create a file named `.env` with values `API_KEY="your_Adyen_API_key"` and `MERCHANT_ACCOUNT="your_Adyen_merchant_account"`
$ vi .env
# start application
$ npm start
@deepu105
deepu105 / payment-api-payment.js
Created March 5, 2021 13:12
payment-api-payment.js
async function checkout() {
try {
const adyenPaymentMethods = await callServer("/api/getPaymentMethods");
// create a new payment request
const request = new PaymentRequest(buildSupportedPaymentMethodData(adyenPaymentMethods), buildShoppingCartDetails());
// show payment sheet
const payment = await request.show();
// Here we would process the payment.
const response = await callServer("/api/initiatePayment", {
// This works only for PCI compliant credit card payments.
@deepu105
deepu105 / payment-api-checkout.js
Created March 5, 2021 13:10
payment-api-checkout.js
async function checkout() {
try {
const adyenPaymentMethods = await callServer("/api/getPaymentMethods");
// create a new payment request
const request = new PaymentRequest(buildSupportedPaymentMethodData(adyenPaymentMethods), buildShoppingCartDetails());
// payment logic goes here
} catch (error) {
console.error(error);
alert(`Error occurred: ${error.message}`);
@deepu105
deepu105 / payment-api-button.html
Last active March 5, 2021 13:09
payment-api-button.html
<a onclick="checkout()">
<p class="button">Checkout</p>
</a>
@deepu105
deepu105 / MdToHtml.html
Created July 7, 2020 14:55
MdToHtml.html
<p>E-commerce applications are the backbone of today&#39;s online shopping world. In this post, we will see how to build an e-commerce application easily using Java, JHipster, Spring Boot, and React. Since we will be scaffolding the application, the post will focus on how to build a shopping cart and payment integration rather than how to build a Java web application.</p>
<h2 id="tools-and-technology-we-will-use">Tools and technology we will use</h2>
<p>We will use the below tools and technology to build this application:</p>
<ul>
<li><a href="https://www.jhipster.tech/"><strong>JHipster</strong></a>: JHipster is a rapid application development platform. It can quickly create web applications and microservices with production-grade code. Head over to the <a href="https://www.jhipster.tech/installation/">installation instructions</a> to set it up. JHipster can scaffold applications with a wide variety of languages, frameworks, and configurations. For this tutorial, we will stick with the following major option
export ADYEN_API_KEY=yourAdyenApiKey
export ADYEN_MERCHANT_ACCOUNT=yourAdyenMerchantAccount
export ADYEN_ORIGIN_KEY=yourAdyenOriginKeyForCorrectDomain