0
votes

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

1 Answers

0
votes

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}));