• Matt Lunkes
  • NEWBIE
  • 0 Points
  • Member since 2014
  • Business Operations Director


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 1
    Replies
I'm trying to integrate Recurly subscription management with an application I am running on force.com. I'd like to host the payment and billing pages with VisualForce but use Recurly servers to process the transactions.

In order to do this I am using the Recurly.js files (https://docs.recurly.com/recurlyjs) However, I need a signature to be created - I have tried all of the different ways (Crypto.sign, Apex, doing a canvas app leveraging the prebuilt PHP libraries, etc) but I am wondering if there is an easier way to do this:

Here is the code from the php page that works leveraging the PHP libraries. Does anyone know how to do this in salesforce without having to have a completly different environment host the PHP/Ruby/Python libraries?

<?php
require_once('lib/recurly.php');

// Required for the API
Recurly_Client::$subdomain = 'subdomain';
Recurly_Client::$apiKey = '111111111111111111111111111';
Recurly_js::$privateKey = 'a111111111111111111111111111111';
$planCode = 'innovator-yearly';
$currency = 'USD';
$signature = Recurly_js::sign(array($planCode));   
?>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Innovator Yearly Subscription</title>
<html>
  <head>
  <link rel="stylesheet" href="css/recurly.css" type="text/css" />
<script src="js/jquery.js"></script>
<script src="js/recurly.js"></script>
    <script>
    $(function(){
      Recurly.config({
        subdomain: 'subdomain'
        , currency: 'USD' // GBP | CAD | EUR, etc...
      });

      Recurly.buildSubscriptionForm({
        target: '#recurly-subscribe',
        planCode: 'innovator-yearly',
        successURL: 'success.php',
        signature: '<?php echo $signature;?>',
distinguishContactFromBillingInfo: false,
    collectCompany: false,
    collectContact: true,
    termsOfServiceURL: 'http://subdomain.com/contact/terms-of-use/',
    acceptPaypal: false,
    acceptedCards: ['mastercard',
                    'discover',
                    'american_express',
                    'visa'],
      });

    });
    </script>
</head>
  <body>
   
    <div id="recurly-subscribe">
    </div>
  </body>
</html>
</apex:page>

keywords: digital signature, crypto, PHP, Recurly, Subscription service
I'm trying to integrate Recurly subscription management with an application I am running on force.com. I'd like to host the payment and billing pages with VisualForce but use Recurly servers to process the transactions.

In order to do this I am using the Recurly.js files (https://docs.recurly.com/recurlyjs) However, I need a signature to be created - I have tried all of the different ways (Crypto.sign, Apex, doing a canvas app leveraging the prebuilt PHP libraries, etc) but I am wondering if there is an easier way to do this:

Here is the code from the php page that works leveraging the PHP libraries. Does anyone know how to do this in salesforce without having to have a completly different environment host the PHP/Ruby/Python libraries?

<?php
require_once('lib/recurly.php');

// Required for the API
Recurly_Client::$subdomain = 'subdomain';
Recurly_Client::$apiKey = '111111111111111111111111111';
Recurly_js::$privateKey = 'a111111111111111111111111111111';
$planCode = 'innovator-yearly';
$currency = 'USD';
$signature = Recurly_js::sign(array($planCode));   
?>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Innovator Yearly Subscription</title>
<html>
  <head>
  <link rel="stylesheet" href="css/recurly.css" type="text/css" />
<script src="js/jquery.js"></script>
<script src="js/recurly.js"></script>
    <script>
    $(function(){
      Recurly.config({
        subdomain: 'subdomain'
        , currency: 'USD' // GBP | CAD | EUR, etc...
      });

      Recurly.buildSubscriptionForm({
        target: '#recurly-subscribe',
        planCode: 'innovator-yearly',
        successURL: 'success.php',
        signature: '<?php echo $signature;?>',
distinguishContactFromBillingInfo: false,
    collectCompany: false,
    collectContact: true,
    termsOfServiceURL: 'http://subdomain.com/contact/terms-of-use/',
    acceptPaypal: false,
    acceptedCards: ['mastercard',
                    'discover',
                    'american_express',
                    'visa'],
      });

    });
    </script>
</head>
  <body>
   
    <div id="recurly-subscribe">
    </div>
  </body>
</html>
</apex:page>

keywords: digital signature, crypto, PHP, Recurly, Subscription service