Recurly.js集成:如何覆盖订阅值?

时间:2013-07-25 11:39:33

标签: paypal subscription recurring-billing recurring recurly

我正在努力实现以下目标:

?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>

在前端呈现表单时,它不会反映符号对象中给出的价格。它显示Recurly计划中设置的计划的原始值。

我做错了吗?或者无法在唱歌功能中覆盖订阅值?

谢谢, 纳雷什

0 个答案:

没有答案