我们如何在条带php中执行并行付款和退款?

时间:2015-03-04 05:04:41

标签: php stripe-payments

使用以下代码可以向一个帐户付款,但并行付款方式看似含糊不清。

退款流程如何运作?为此,我们必须保存用户的信用卡详细信息,该用户必须在其帐户中进行退款。

        <!DOCTYPE html>
        <html lang="en">
        <head>
          <title>Wilde Things</title>
          <link rel="stylesheet" href="../public/css/normalize.css">
          <link rel="stylesheet" href="../public/css/style.css">
        </head>
        <body>
          <div id="container">
            <?php
            require_once('../stripe/lib/Stripe.php');
            $stripe = array(
              'secret_key'      => 'sk_test_gRNo5PZ1TVjxRv9crUhw92lu',
              'publishable_key' => 'pk_test_lsE6QUL6t2mDTJ64S9EXL5Nh'
              );

            Stripe::setApiKey($stripe['secret_key']);

            if ($_POST) {
              $charge = Stripe_Charge::create(array(
                'card'     => $_POST['stripeToken'],
                'amount'   => 53500,
                'currency' => 'usd'
                ));

              $wildeQuotes = array(
                "A little sincerity is a dangerous thing, and a great deal of it is absolutely fatal.",
                );
            }
            else
              { ?>
            <h2>Wilde Things</h2>
            <h3>Purchase a quote by Oscar Wilde today! Only $535! Limited supply and going fast, buy now!!</h3>

            <form action="index.php" method="post">
              <script src="https://button.stripe.com/v1/button.js" class="stripe-button"
              data-key="<?php echo $stripe['publishable_key']; ?>"
              data-amount=53500
              data-description="One Wilde quote"
              data-label="Buy"></script>
            </form>
            <?php
          }
          ?>
        </div><!-- #container -->
      </body>
      </html>

0 个答案:

没有答案