Javascript Disabled!

Please Enable Javascript if you disabled it, or use another browser we preferred Google Chrome. Please Refresh Page After EnablePowered By UnCopy Plugin.

How to Integrate Cashfree Payment Gateway || Add Cashfree  Payment Gateway In Website.

How to Integrate Cashfree Payment Gateway || Add Cashfree  Payment Gateway In Website.

Sandbox and Production End Point

Sandbox End Point – https://sandbox.cashfree.com/pg
Make sure you generate credentials in the test dashboard.

Production End Point – https://api.cashfree.com/pg
To process live payments, make sure you use credentials from the live dashboard. Do not share your secret key with anyone.

				
					
$randomNumber = uniqid();
$amount = 456;
$custMobileno = 'Customer Mobile no';
$custEmailID = 'info@codewithcode.com'; 


				
			
				
					
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => "https://sandbox.cashfree.com/pg/links",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "Define Method",
  CURLOPT_POSTFIELDS => json_encode([
    'customer_details' => [
        'customer_phone' => $custMobileno,
        'customer_email' => $custEmailID
    ],
    'link_notify' => [
        'send_sms' => true,
        'send_email' => true
    ],
    'link_id' => $randomNumber,
    'link_amount' => $amount,
    'link_currency' => 'INR',
    'link_purpose' => 'Payment for PlayStation 11'
  ]),
  CURLOPT_HTTPHEADER => [
    "accept: application/json",
    "content-type: application/json",
    "x-api-version: 2022-09-01",
    "x-client-id: Your Client ID",
    "x-client-secret: Your Secret Key"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  // echo $response;
    $result = json_decode($response);
    // print_r($result);
    header('Location: '.$result->link_url);
}

				
			

Payment Request Response With Payment Gateway URL

{“cf_link_id”:2141759,”link_id”:”64efbd900db3d”,”link_status”:”ACTIVE”,”link_currency”:”INR”,”link_amount”:456,”link_amount_paid”:0,”link_partial_payments”:false,”link_minimum_partial_amount”:null,”link_purpose”:”Payment for PlayStation 11″,”link_created_at”:”2023-08-31T03:37:15+05:30″,”customer_details”:{“customer_name”:””,”country_code”:”+91″,”customer_phone”:”9631116311″,”customer_email”:”[email protected]”},”link_meta”:{“payment_methods”:””,”upi_intent”:”false”},”link_url”:”https://payments-test.cashfree.com/links/c5e11o3lgup0″,”link_expiry_time”:”2023-09-30T03:37:15+05:30″,”link_notes”:{},”link_auto_reminders”:false,”link_notify”:{“send_email”:true,”send_sms”:true}}

Official Website = https://docs.cashfree.com/reference/createpaymentlink

If you want any help from my side please Email me on [email protected] OR WhatsApp Me On 6267465901

stdClass Object Response 

stdClass Object ( [cf_link_id] => 2141760 [link_id] => 64efbf1bf1f02 [link_status] => ACTIVE [link_currency] => INR [link_amount] => 456 [link_amount_paid] => 0 [link_partial_payments] => [link_minimum_partial_amount] => [link_purpose] => Payment for PlayStation 11 [link_created_at] => 2023-08-31T03:43:50+05:30 [customer_details] => stdClass Object ( [customer_name] => [country_code] => +91 [customer_phone] => 9631116311 [customer_email] => [email protected] ) [link_meta] => stdClass Object ( [payment_methods] => [upi_intent] => false ) [link_url] => https://payments-test.cashfree.com/links/N5e12g70qup0 [link_expiry_time] => 2023-09-30T03:43:50+05:30 [link_notes] => stdClass Object ( ) [link_auto_reminders] => [link_notify] => stdClass Object ( [send_email] => 1 [send_sms] => 1 ) )

Cashfree Payment Gateway, Website Payments, Cashfree Integration, Online Payment Processing, How to Add Payment Gateway, E-commerce Payments, Payment API, Cashfree Tutorial, Secure Transactions, Website Development, Accept Online Payments, User-Friendly Checkout, Step-by-Step Guide, Payment Options, Boost Online Business, Web Development Tutorial. Cashfree Payment Gateway, Integration, Website Payments, Online Payments, How to Add Cashfree Payment Gateway, Step-by-Step Tutorial, E-commerce, Online Business, Payment Processing, Secure Transactions, Web Development, Payment Options, Accept Payments Online, User Experience, Checkout Page, API Integration.

4 Comments

  1. I have been surfing online greater than 3 hours as of late, yet I
    by no means discovered any fascinating article like yours.
    It is lovely value enough for me. In my opinion,
    if all web owners and bloggers made just right content as you probably
    did, the web will probably be much more useful than ever before.

  2. best gold ira companiessays:

    Hello colleagues, how is all, and what you
    would like to say about this paragraph, in my view its really amazing designed for me.

  3. Men dating men participation out of, connection, and the stunner of relationships in their own unexcelled way.
    In a superb that embraces diversity and inclusivity, same-sex relationships have develop their place. Men who ancient men navigate the joys and challenges of edifice substantial connections based on authenticity and mutual understanding. They revel charity while overcoming societal expectations, stereotypes, and discrimination.
    Communication and fervent intimacy pleasure a essential place in their relationships, fostering positiveness and deepening their bond. As people progresses close to conformity, it is significant to approve and particular the love shared between men dating men, embracing their unequalled experiences and contributions to the tapestry of kind-hearted connections.

  4. Jump to search
    Speculate on market Forex?
    Best exclusive offer 2024 for common speculators, software developers, traders, trading signal sellers, trading advisor sellers, trading account managers, investment companies, large brokerage firms , as well as for everyone who dreams of opening their own business on the Forex market with minimal investments.
    We will be happy to Give away MetaTrader4 Server for 0Give away MetaTrader4 Server for 0/en/products.html
    More in detail watch here:

Leave a Reply

Your email address will not be published. Required fields are marked *

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
100% Free SEO Tools - Tool Kits PRO