I am trying to achieve following:
?php
require_once('recurly/lib/recurly.php');
// Required for the API
Recurly_Client::$subdomain = 'xxxxxx';
Recurly_Client::$apiKey = 'xxxxxxxxxxxxxxxxxxx';
Recurly_js::$privateKey = 'xxxxxxxxxxxxxxxxxxx';
$signature = Recurly_js::sign(
array(
'subscription' => array(
'plan_code' => 'testplan1',
'unit_amount_in_cents' => 5000,
'currency' => 'USD'
)
)
);
?>
<html>
<head>
<link href="recurly-js/themes/default/recurly.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="recurly-js/build/recurly.js"></script>
<script>
$(function(){
Recurly.config({
subdomain: 'xxxxxxxxxx'
, currency: 'USD' //USD | GBP | CAD | EUR, etc...
, unit_amount_in_cents: '5000'
});
/**/
Recurly.buildSubscriptionForm({
target: '#recurly-form'
, planCode: 'testplan1'
, successURL: 'success.php'
, signature: '<?php echo $signature;?>'
, unit_amount_in_cents: '5000'
});
});
</script>
</head>
<body>
<h1>Test Form</h1>
<div id="recurly-form"></div>
</body>
</html>
When a form is rendered on front end, it does not reflect the price given in sign object. It displays the original value of plan set in the Recurly plan.
Is there something I am doing wrong? Or it is not possible to override the subscription value in sing function?
Thanks, Naresh