wordpress - How to charge card on clicking accept button in stripe in PHP
I am using stripe and trying to charge card by clicking on accept button. I have already created charge and created customer. and now trying to create charge by clicking accept button.
Please suggest me the way to do it.
Thanks in advance.
<?php
function payment_show()
{
include ('config.inc');
include ('charge.inc');
?>
<?php
$code = db_query("SELECT * FROM {stripe_payment}");
?>
<table border='1'>
<th>ID</th><th>Payment ID</th><th>Customer ID</th><th>Customer Email</th><th>Payment Amount</th><th>Payment Date</th><th>Refund</th><th>Accept</th>
<?php
foreach($code as $codes)
{
//$ch = StripeCharge::retrieve($Payment_id);
$ch = \Stripe\Charge::retrieve($codes->payment_id);
?>
<tr>
<td><?php echo $codes->Id; ?></td>
<td><?php echo $codes->payment_id; ?></td>
<td><?php echo $codes->customer_id; ?></td>
<td><?php echo $codes->customer_email; ?></td>
<td><?php echo $codes->payment_amount; ?></td>
<td><?php echo $codes->payment_date; ?></td>
<td><a href="https://dashboard.stripe.com/payments/<?php echo $codes->payment_id; ?>">Refund</a></td><td><strike> <input type="button" value="Accept" onclick="document.write('<?php $ch->capture(); ?>');" /> </strike></td></tr>
<?php
}
?>
</table>
<?php
}
?>
People are also looking for solutions to the problem: call to a member function store() on null
Source
Share
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.