我正在使用Stripe构建一个相对简单的基于订阅的应用程序。
目前,我唯一真正遇到的麻烦是订阅需要支付初始安装费,而我确实很难受。
示例:
新用户注册Subscription-A;订阅A的月度间隔价格为10美元。注册后,新用户将被收取一次性费用1美元和10美元的订阅费用,随后的几个月仅需支付10美元。
目前,我的代码是:
// Stripe New customer
$customer = \Stripe\Customer::create(array(
"email" => $customer_email,
"source" => $token,
),
array("stripe_account" => $connected_account)
);
// Stripe Subscription
$sub = \Stripe\Subscription::create(array(
"customer" => $customer['id'],
"items" => array(
array(
"plan" => $plan_id,
),
),
),
array("stripe_account" => $connected_account)
);
Run Code Online (Sandbox Code Playgroud)
任何的想法?谢谢
我构建了一个模板,我想在 Shopify 上将日期转换为时间戳。
我知道我可以使用这个将时间戳转换为日期:
{{ '1560523384' | date: "%d-%m-%Y" }} // result is 14-06-2019
Run Code Online (Sandbox Code Playgroud)
但我想做相反的事情
{{ '14-06-2019' | timestamp }} // do not work
Run Code Online (Sandbox Code Playgroud)
无论如何要使用 Shopify Liquid 做到这一点?
我正在尝试使用自定义模板为我的Wordpress设置自定义静态首页.
我创造landingpage.php的wp-content/themes/my_theme,我在我的模型的LandingPage WordPress管理中选择创建一个新的页面.
如果我去my_website.com/landing-page/我的自定义页面工作和'Hello World!' 出现了,但如果我将自定义页面设置为静态首页并转到my_website.com/我的"Hello World!" 消息不显示.
我的landingpage.php代码:
<?php /* Template Name: LandingPage */ ?>
<?php get_header(); ?>
<div class="wrap">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/page/content', 'page' );
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile;
?>
<h1>Hello World!</h1>
</main>
</div>
</div>
<?php get_footer();
Run Code Online (Sandbox Code Playgroud)
任何的想法?谢谢