public static function ajaxPayment() { $status = BraintreePayment::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'))); } else { if ($status == PAYMENT_PRO_ALREADY_PAID) { payment_pro_cart_drop(); osc_add_flash_warning_message(__('Warning! This payment was already paid', 'payment_pro')); } else { osc_add_flash_error_message(__('There were an error processing your payment', 'payment_pro')); } } payment_pro_js_redirect_to(osc_route_url('payment-pro-done', array('tx' => Params::getParam('braintree_transaction_id')))); }
public static function ajaxPayment() { $status = BraintreePayment::processPayment(); if ($status == PAYMENT_COMPLETED) { printf(__('Success! Please write down this transaction ID in case you have any problem: %s', 'payment'), Params::getParam('braintree_transaction_id')); } else { if ($status == PAYMENT_ALREADY_PAID) { _e('Warning! This payment was already paid', 'payment'); } else { _e('There were an error processing your payment', 'payment'); } } }
<?php $status = BraintreePayment::processPayment(); if ($status == PAYMENT_COMPLETED) { echo "<h1>Success! Transaction ID: " . Params::getParam('braintree_transaction_id') . "</h1>"; } else { if ($status == PAYMENT_ALREADY_PAID) { echo "<h1>Warning! This payment was already paid</h1>"; } else { echo "<h1>Error: " . $result->message . "</h1>"; } }