コード例 #1
0
<?php

payment_pro_cart_drop();
/*    if(Params::getParam('cm')!='') {
        $data = Params::getParam('cm');
    } else if(Params::getParam('custom')!='') {
        $data = Params::getParam('custom');
    } else {
        $data = Params::getParam('extra');
    }
    $data = json_decode(base64_decode($data), true);
*/
// GET TX ID
$tx = Params::getParam('tx') != '' ? Params::getParam('tx') : Params::getParam('txn_id');
$payment = ModelPaymentPro::newInstance()->getPaymentByCode($tx, 'PAYPAL');
if (isset($payment['pk_i_id'])) {
    osc_add_flash_ok_message(__('Payment processed correctly', 'payment_pro'));
} else {
    osc_add_flash_info_message(__('We are processing your payment, if we did not finish in a few seconds, please contact us', 'payment_pro'));
}
payment_pro_js_redirect_to(osc_route_url('payment-pro-done', array('tx' => $tx)));
コード例 #2
0
 public static function ajaxPayment()
 {
     $status = AuthorizePayment::processPayment();
     if ($status == PAYMENT_PRO_COMPLETED) {
         payment_pro_cart_drop();
         osc_add_flash_ok_message(sprintf(__('Success! Please write down this transaction ID in case you have any problem: %s', 'payment_pro'), Params::getParam('braintree_transaction_id')));
         payment_pro_js_redirect_to(osc_route_url('payment-pro-done', array('tx' => Params::getParam('braintree_transaction_id'))));
     } else {
         if ($status == PAYMENT_PRO_ALREADY_PAID) {
             payment_pro_cart_drop();
             osc_add_flash_warning_message(__('Warning! This payment was already paid', 'payment_pro'));
             payment_pro_js_redirect_to(osc_route_url('payment-pro-done', array('tx' => Params::getParam('authorize_transaction_id'))));
         } else {
             printf(__('There were an error processing your payment: %s', 'payment_pro'), Params::getParam('authorize_error'));
         }
     }
 }
コード例 #3
0
<?php

$id = Params::getParam('id');
payment_pro_cart_drop($id);
// IF removed publish fee, remove too the premium fee so a user is not able to pay just the premium but not the publish fee
if (substr($id, 0, 3) == 'PUB') {
    payment_pro_cart_drop('PRM' . substr($id, 3));
}
payment_pro_js_redirect_to(osc_route_url('payment-pro-checkout'));