APP ID
Secret Key
CofeaBrew
UPI PhonePe, Gpay, Paytm

CofeaBrew

₹100.00

CofeaBrew is a harmonious fusion that marries the aromatic richness of coffee beans with the delicate nuances of hand-picked tea leaves. From the first sip, you'll be captivated by its enchanting medley of robust coffee undertones and the subtle, refreshing notes of your favorite tea. It's a symphony of flavors that dances on your palate, inviting you to indulge in the perfect balance of taste sensations.

Only works on Phone.

You will need a payment_session_id to try out this code. Search for yourPaymentSession and replace with yours.

1
<!DOCTYPE html>
2
<html lang="en">
3
	
4
	<head>
5
		<meta charset="UTF-8">
6
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
7
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
8
		<title>Document</title>
9
		<script src="https://sdk.cashfree.com/js/v3/cashfree.js"></script>
10
	</head>
11

12
	<body>
13
	<div id="upiAppComponent"></div>
14
	<input type="button" id="payBtn" value="Pay" />
15
	<script>
16
		
17
		const cashfree = await load({ 
18
			mode: "sandbox", //or production
19
		});
20

21
		const upiAppComponent = cashfree.create("upiApp", {
22
			values: {
23
				upiApp: "phonepe",
24
				buttonText: "PhonePe,
25
				buttonIcon: true
26
			}
27
		});
28
		upiAppComponent.mount("#upiAppComponent");
29

30
		const showError = function(e){
31
			alert(e.message)
32
		}
33

34
		document.querySelector("#payBtn").addEventListener("click", async () => {
35
			cashfree.pay({
36
				paymentMethod: upiAppComponent,
37
				paymentSessionId: "yourPaymentSession",
38
				returnUrl: "https://merchantsite.com/return?order_id={order_id}",
39
				redirect: "if_required"
40
			}).then(function (data) {
41
				if (data != null && data.error) {
42
					return showError(data.error)
43
				}
44
				if(!!data.paymentDetails){
45
					alert(data.paymentDetails.paymentMessage)
46
				}
47
			});
48
		})
49
		</script>
50
	</body>
51
</html>
52

The site is built using the Brutopia theme. Get it for free here