コード例 #1
0
ファイル: refund.php プロジェクト: asaokamei/payjp
<?php

require_once __DIR__ . '/demo.inc.php';
$service = new PayService();
$factory = $service->getFactory();
$isOK = true;
$message = '';
if ($id = getIdInPost()) {
    $charge = $factory->retrieve($id);
    if ($refund = getAmountInPost('refund')) {
        $charge->refund($refund);
        $message = 'refunded';
    } else {
        $charge->cancel();
        $message = 'canceled';
    }
} else {
    $isOK = false;
    $message = 'not id or refund amount found.';
}
?>
<h1><a href="index.php" >top</a> &gt; Refund</h1>
<?php 
echo showMessage($message, $isOK);
?>
<a href="list-pay.php">back to list</a>
コード例 #2
0
ファイル: new-pay.php プロジェクト: asaokamei/payjp
<?php

require_once __DIR__ . '/demo.inc.php';
$service = new PayService();
if (isset($_POST) && ($amount = getAmountInPost())) {
    createPayment($service, $_POST, $amount);
}
?>
<h1><a href="index.php" >top</a> &gt; Create New Payment</h1>

<?php 
if ($service->service === PayService::PAY_JP) {
    ?>

    <form action="" method="post">
        <input type="text" name="amount" value="2345" />
        <input type="checkbox" name="authorize" value="auth" />
        <script src="https://checkout.pay.jp/" class="payjp-button" data-key="<?php 
    echo $service->pub;
    ?>
"></script>
    </form>
    
<?php 
} elseif ($service->service === PayService::WEB_PAY) {
    ?>

    <form action="" method="post">
        <input type="text" name="amount" value="2345" />
        <input type="checkbox" name="authorize" value="auth" />
        <script src="https://checkout.webpay.jp/v3/" class="webpay-button" data-key="<?php