无法理解如何与Laravel Cashier JS一起使用

时间:2019-09-07 21:42:16

标签: laravel laravel-cashier

我正在使用带条纹的laravel收银机10.2。 但是,我第一次被它的JavaScript卡住了。花了两天,但听不懂。

这将创建CC表单字段

url='https://example.com'
filepath="$(mktemp)"  # random path, only readable by current user
printf "Username: "
read username
printf "Password: "
stty -echo  # disables echoing user input, POSIX equivalent for 'read -s'
$(perl -e '
    my $val=<STDIN>;
    chomp $val;
    open(my $fh, ">", $ARGV[0]) or die "Could not open file \"$ARGV[0]\" $\!";
    print $fh $val;
    close $fh;
' "$filepath")
printf "\n" # we need to move the line ahead
stty echo   # re-enable echoing user input

cat "${filepath}" | sed -e "s/^/-u ${username}:/" | curl --url "${url}" -K-

rm "${filepath}"  # don't forget to delete the file when done!!
unset username

但是我不知道该放在哪里并获得付款方式的东西似乎并不是完整的代码。一旦我获得了paymentMethod id,我就可以处理laravel中的其他所有内容。

<script>
    const stripe = Stripe('stripe-public-key');

    const elements = stripe.elements();
    const cardElement = elements.create('card');

    cardElement.mount('#card-element');
</script>

1 个答案:

答案 0 :(得分:-1)

没关系,我降级为收银员7,而且工作正常,没有问题。