コード例 #1
0
ファイル: donate.php プロジェクト: WarmHouseProject/WarmHouse
require_once ABSPATH . WPINC . '/lib/utils/db/class-child-db-utils.php';
require_once ABSPATH . WPINC . '/lib/utils/db/class-orphanage-db-utils.php';
require_once ABSPATH . WPINC . '/lib/helper/class-request-helper.php';
require_once ABSPATH . WPINC . '/lib/utils/class-donation-utils.php';
$childId = RequestHelper::getParameter("child_id");
$orphanageId = RequestHelper::getParameter("orphanage_id");
$child = null;
$orphanage = null;
if ($childId) {
    $child = ChildDBUtils::getChildById($childId);
}
if ($orphanageId) {
    $orphanage = OrphanageDBUtils::getOrphanageById($orphanageId);
}
$paymentPurpose = DonationUtils::createPaymentPurpose($child, $orphanage);
$paymentPurposeTranslit = DonationUtils::createTransliteratedPaymentPurpose($child, $orphanage);
get_header();
?>
<div class="donate-form">
    <div class="container">
        <div class="form-group">
            <label><?php 
echo $paymentPurpose;
?>
</label>
            <div class="input-block">
                <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
                    <input type="hidden" name="cmd" value="_donations">
                    <input type="hidden" name="business" value="Q8CHD2XYLYDQJ">
                    <input type="hidden" name="return" value="http://www.luchik12.ru//thank-you/">
                    <input type="hidden" name="cancel_return" value="http://www.luchik12.ru/">
コード例 #2
0
 static function createTransliteratedPaymentPurpose($child, $orphanage)
 {
     return DonationUtils::transliterate(DonationUtils::createPaymentPurpose($child, $orphanage));
 }