コード例 #1
0
         name="TermUrl"
         value="http://<?php 
    echo $_SERVER['SERVER_NAME'];
    ?>
/examples/payment_card.php"
         >
  <input type="submit" value="Test 3DS"><br>
</form>
<?php 
}
// Refresh payment from API, to be sure
$oPayment = Payment::get($order);
/* 3. After 3DS - Confirmation */
if (isset($_POST['PaRes']) and $oPayment->status == 'W_3DS') {
    echo '<h2>Finalization 3DS</h2>';
    $oPayment->finalize_3DS($_POST['PaRes'], $_POST['MD']);
    echo '<p> Result: </p>';
    echo _toHTML($oPayment = Payment::get($order));
}
/* 4. Payment - END */
if ($oPayment->status == 'C_WAITING') {
    echo '<h2>Payment confirmation</h2>';
    $oPayment->confirm();
    echo '<p> Result: </p>';
    echo _toHTML($oPayment = Payment::get($order));
}
?>

</body>
</html>
コード例 #2
0
    // Via payment
    $oCredit = Payment::get($order)->credit($oNewCredit->hash);
    echo '<strong>Credit got (via payment):</strong>' . "\n";
    echo _toHTML($oCredit);
} catch (\Payname\Exception $e) {
    echo $e . "\n";
}
/* Get credit list */
echo '<h2>Get credit list</h2>' . "\n";
try {
    // Directly
    $aCredits = Credit::getAll($order);
    echo '<strong>Credit list (directly):</strong>' . "\n";
    echo _toHTML($aCredits);
    // Via payment
    $aCredits = Payment::get($order)->credit();
    echo '<strong>Credit list (via payment):</strong>' . "\n";
    echo _toHTML($aCredits);
} catch (\Payname\Exception $e) {
    echo $e . "\n";
}
/* Update credit */
echo '<h2>Update credit</h2>' . "\n";
try {
    $oCredit = Credit::get($order, $oNewCredit->hash);
    $oCredit->amount = 1337;
    $oCredit->due_at = '2015-09-01';
    $oCredit->update();
    echo '<strong>Updated credit:</strong>' . "\n";
    echo _toHTML($oCredit);
} catch (\Payname\Exception $e) {
コード例 #3
0
    // Via payment
    $oDebit = Payment::get($order)->debit($oNewDebit->hash);
    echo '<strong>Debit got (via payment):</strong>' . "\n";
    echo _toHTML($oDebit);
} catch (\Payname\Exception $e) {
    echo $e . "\n";
}
/* Get debit list */
echo '<h2>Get debit list</h2>' . "\n";
try {
    // Directly
    $aDebits = Debit::getAll($order);
    echo '<strong>Debit list (directly):</strong>' . "\n";
    echo _toHTML($aDebits);
    // Via payment
    $aDebits = Payment::get($order)->debit();
    echo '<strong>Debit list (via payment):</strong>' . "\n";
    echo _toHTML($aDebits);
} catch (\Payname\Exception $e) {
    echo $e . "\n";
}
/* Update debit */
echo '<h2>Update debit</h2>' . "\n";
try {
    $oDebit = Debit::get($order, $oNewDebit->hash);
    $oDebit->amount = 1337;
    $oDebit->due_at = '2015-09-01';
    $oDebit->update();
    echo '<strong>Updated debit:</strong>' . "\n";
    echo _toHTML($oDebit);
} catch (\Payname\Exception $e) {
コード例 #4
0
echo '<h2>Get payment list</h2>' . "\n";
try {
    $aPayments = Payment::getAll();
    echo '<strong>Payment list:</strong>' . "\n";
    echo _toHTML($aPayments);
} catch (\Payname\Exception $e) {
    echo $e . "\n";
}
/* Update payment */
echo '<h2>Update payment</h2>' . "\n";
try {
    $oPayment = Payment::get($order);
    $oPayment->confirmation = 'double';
    $oPayment->target_amount = 120;
    $oPayment->due_at = null;
    $oPayment->update();
    echo '<strong>Updated payment:</strong>' . "\n";
    echo _toHTML($oPayment);
} catch (\Payname\Exception $e) {
    echo $e . "\n";
}
/* Delete payment */
echo '<h2>Delete payment</h2>' . "\n";
try {
    $oPayment = Payment::get($order);
    $oPayment->delete();
    echo '<strong>Deleted payment:</strong>' . "\n";
    echo _toHTML($oPayment);
} catch (\Payname\Exception $e) {
    echo $e . "\n";
}