New in Chargebee: Explore Reveal and understand your payment performance end-to-end.Try Now

Docschargebeedocs

HomeBillingPaymentsRevRecGrowthReveal
Support

Product Updates


  • Release Notes

Getting Started


  • Overview
  • Chargebee Billing Data Centers
  • Object Relationship Model
  • Understanding Sites
  • Developer Resources
  • Chargebee Tech Glossary
  • Articles and FAQ

Implementing Chargebee


  • Implementation Guide
  • Go-live Checklist
  • Articles and FAQ

AI in Chargebee


  • Chargebee Agents
  • Chargebee Copilot
  • Chargebee MCP Server (Model context protocol)

Product Catalog


  • Product Catalog Overview
  • Coupons
  • Articles and FAQ

Subscriptions


  • Working with Subscriptions
  • Billing
  • Orders
  • Articles and FAQ

Customers


  • Managing Customers
  • Account Hierarchy
  • Email Notifications
  • Branding
  • Configure Multiple Languages
  • Articles and FAQ

Invoices, Credit Notes and Quotes


  • Invoices
  • Credit Notes
  • Quotes [Legacy]
  • Transactions
  • Articles and FAQ

Taxes


  • Overview
  • Configuring Taxes
  • Country-specific Taxes
  • Articles and FAQ

Hosted Capabilities


  • Overview
  • Hosted Checkout
  • Hosted Self-Serve Portal
  • Hosted Pages Features
  • Additional Hosted Pages
  • Payment Components
  • Managing payments with ChargebeeJS
  • Mobile-Optimized Hosted Pages
  • Articles and FAQ

Site Configuration


  • Users & Roles
  • Custom Fields & Metadata
  • Mandatory Fields
  • File Attachments & Comments
  • Advanced Filter Options
  • Multicurrency Pricing
  • Multi-decimal Support
  • Configuring Reason Codes
  • Events and Webhooks
  • API Keys
  • Time Zone
  • Time Machine
  • Transfer Configurations
  • Articles and FAQ

Reports and Analytics


  • RevenueStory
  • Home Dashboard
  • Frequently Asked Questions
  • FAQs for Classic Reports Sunset
  • Articles and FAQ

Integrations


  • Sales
  • Customer Support and Success
  • Finance
  • Tax
  • Marketing
  • Stitch
  • Collaboration
  • Contract Management
  • Order Management
  • Mobile Subscriptions (Legacy)
  • Other Integrations
  • Articles and FAQ

Data Privacy & Security


  • Two Factor Authentication
  • SAML Single Sign-On
  • System for Cross-Domain Identity Management (SCIM)
  • EU-GDPR
  • Consent Management
  • Personal Data Management
  • Compliance Certificates
  • HIPAA Guidelines
  • PCI Recommendations and Integration Types
  • Articles and FAQ

Data Operations


  • Bulk Operations
  • Migration
  • Articles and FAQ
  1. Billing
  2. Site Configuration
  3. Articles and FAQ
  4. Events & Webhooks
  1. Billing
  2. Site Configuration
  3. Articles and FAQ
  4. Events & Webhooks

TLS 1.2 Handshake - Testing Code

PHP:

  {/*?php
require 'Chargebee.php';
ChargeBee_Environment::configure("tls12", "__test__key");
try {
    $all = ChargeBee_Subscription::all(array(
        "limit" =*/} 1
      ));
  }
  catch (ChargeBee_APIError $e) {
      $jsonObj = $e->getJsonObject();
      if ($jsonObj['api_error_code'] == "api_authentication_failed") {
          echo "Connection to TLS1.2 works.\\n";
      } else {
          echo "Please contact [support](/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team) with the below msg:\\n";
          print_r($jsonObj);
      }
  }
  catch (Exception $e) {
      echo "Contact your technical team / hosting provider for TLS1.2 support.\\n";
      print_r($e->getMessage());
  }
  ?>

RUBY:

  require 'chargebee';
  Chargebee.configure(:site => "tls12", :api_key => "__test__key")
  begin
  list = Chargebee::Subscription.list(:limit => 1)
  rescue Chargebee::APIError=> ex
  if ex.api_error_code == "api_authentication_failed"
  puts "Connection to TLS1.2 works\\n"
  else
  puts "Please contact [support](/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team) with the below msg:\\n"
  puts ex.json_obj
  end
  rescue Exception => ex
  puts "Contact your technical team / hosting provider for TLS1.2 support.\\n"
  puts ex.message
  end

PYTHON:

  import chargebee
  from chargebee.main import Environment
  chargebee.configure('__test__key', 'tls12')
  try:
      list = chargebee.Subscription.list({'limit': 1})
  except chargebee.APIError, ex:
      if ex.api_error_code == 'api_authentication_failed':
          print 'Connection to TLS1.2 works'
      else:
          print 'Please contact [support](/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team) with the below msg : '
          print ex.json_obj
  except Exception, ex:
      print 'Contact your technical team / hosting provider for TLS1.2 support.'
      print str(ex)

.NET:

  ApiConfig.Configure("tls12", "__test__key");
              try{
                ListResult result = Subscription.List()
                  .Limit(1).Request();
              }catch(ApiException e){
                  if (e.ApiErrorCode == "api_authentication_failed") {
                      Console.WriteLine ("Connection to TLS1.2 works");
                  } else {
                      Console.WriteLine ("Please contact [support](/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team) with the below msg");
                      Console.WriteLine (e.ApiErrorCode);
                      Console.WriteLine (e.Message);
                  }
              } catch(Exception e) {
                  Console.WriteLine ("Contact your technical team / hosting provider for TLS1.2 support.");
                  Console.WriteLine (e.Message);
              }

JAVA:

  public static void main(String[] args) {
          Environment.configure("tls12", "__test__key");
          try{
              ListResult result = Subscription.list()
                        .limit(1).request();
          } catch(APIException e){
              if( "api_authentication_failed".equals(e.apiErrorCode)){
                  System.out.println("Connection to TLS1.2 works");
              } else {
                  System.out.println("Please contact [support](/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team) with the below msg :");
                  System.out.println(e.jsonObj);
              }
          } catch(Exception e){
              System.out.println("Contact your technical team / hosting provider for TLS1.2 support.");
              System.out.println(e.getMessage());
          }
  }

NODE:

  var chargebee = require("chargebee");
  chargebee.configure({'site': 'tls12','api_key': '__test__key'});
  chargebee.subscription.list({limit : 1}).request(
  function(error,result){
  if( error) {
    if( error.api_error_code == "api_authentication_failed") {
         console.log("Connection to TLS1.2 works");
    } else {
         console.log("Contact your technical team / hosting provider for TLS1.2 support.");
         console.log(error)
    }
  }
  })

Related Articles

Accepted SSL certificates
How to create events for subscriptions?
My test webhooks events are not getting delivered. What should I do?
Can I filter events for a specific customer using API?
How can I be notified of only certain events using webhooks?
How to download Event logs?
Webhooks - SSL Communication Error
My SSL certificate is not supported?
How would I know if the configured webhook URL in my Chargebee site is failing?
I received a webhook failure email from Chargebee. How to fix this?
How do I find failed webhooks and resend them?
301 or 302 Redirection error for Webhooks URL
Delay in webhooks notifications
How to do bulk Webhook Re-submit?
How to test webhooks on staging which requires VPN?
At which rate can we expect the webhook calls in Chargebee & Will there be any performance disruption?
Unable to view Webhook Failures from the email received from Chargebee
Meaning of 'optional' in Webhook events

Show more

Was this article helpful?