0

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

?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 计划中设置的计划的原始值。

有什么我做错了吗?还是无法覆盖 sing 函数中的订阅值?

谢谢,纳雷什

4

0 回答 0