duandu5846 2014-09-06 15:13
浏览 21

如何获得使用“条形支付”的付款细节?

I am using stripe for payment using php. I have a system like subscription payment where client are made to be paid every month. After implementing subscription payment i am confused that how will i know the subscribed amount or that re-billed amount is added in my stripe account? Don't stripe has such mechanism to post rebill info in my server after it is deducted from the card? For normal payment i used following code to retrieve payment info, but again its showing error.

<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<?php 
echo '<script type="text/javascript">Stripe.setPublishableKey("' . STRIPE_PUBLIC_KEY . '");</script>';
require_once('lib/Stripe.php');
Stripe::setApiKey(STRIPE_PRIVATE_KEY);
Stripe_BalanceTransaction::retrieve("card_14ZJGLIv1**********");
?>

And my last question is, in my stripe account i can see 'name' field which is empty but when i add input with 'name' it is showing error. How to set that name field. Stripe provide only following code for payment which doesn't include card holder name:

$charge = Stripe_Charge::create(array(
                "amount" => 5000, // amount in cents
                "currency" => "usd",
                "card" => $token,
                "description" => $desc
                )
            );
  • 写回答

1条回答 默认 最新

  • doujie9882 2014-09-06 15:23
    关注

    Retrieving a customer's subscription

    By default, you can see the 10 most recent active subscriptions stored on a customer directly on the customer object, but you can also retrieve details about a specific active subscription for a customer.

    Arguments

    id: required ID of subscription to retrieve.
    customer: required

    Returns

    Returns the subscription object. [That includes amount]

    Via Stripe Documentation

    $customer = Stripe_Customer::retrieve({CUSTOMER_ID});   
    $subscription = $customer->subscriptions->retrieve({SUBSCRIPTION_ID}));
    
    评论

报告相同问题?