/** * Constructor */ public function __construct(Invoice $invoice, array $wallets) { $this->invoice = $invoice; $this->wallets = $wallets; $defaults = array('LMI_SIM_MODE' => sfConfig::get('app_webmoney_sim_mode'), 'LMI_PAYMENT_NO' => $invoice->getId(), 'LMI_PAYMENT_DESC_BASE64' => base64_encode($invoice->getDescription())); parent::__construct($defaults); }
/** * Constructor */ public function __construct(Invoice $invoice) { sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'Date')); $resultUrl = 'https://' . sfContext::getInstance()->getRequest()->getHost() . url_for('payment_liqpay_result'); $defaults = array('version' => '1.1', 'merchant_id' => sfConfig::get('app_liqpay_merchant'), 'amount' => $invoice->getAmount(), 'currency' => 'UAH', 'order_id' => $invoice->getId(), 'description' => $invoice->getDescription(), 'result_url' => $resultUrl, 'server_url' => $resultUrl); parent::__construct($defaults); }
/** * Constructor */ public function __construct(Invoice $invoice) { sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'Date')); $resultUrl = 'https://' . sfContext::getInstance()->getRequest()->getHost() . url_for('payment_privat24_result'); $defaults = array('amt' => $invoice->getAmount(), 'ccy' => 'UAH', 'merchant' => sfConfig::get('app_privat24_merchant'), 'order' => $invoice->getTransactionId(), 'details' => $invoice->getDescription(), 'pay_way' => 'privat24', 'return_url' => $resultUrl, 'server_url' => $resultUrl); parent::__construct($defaults); }
public function encodeInvoice(Invoice $invoice) { $data = ['id' => $invoice->getId(), 'number' => $invoice->getNumber(), 'name' => $invoice->getName(), 'created' => $invoice->getCreated(), 'delivered' => $invoice->getDelivered(), 'due' => $invoice->getDue(), 'status' => $invoice->getStatus(), 'variable_symbol' => $invoice->getVariableSymbol(), 'constant_symbol' => $invoice->getConstantSymbol(), 'description' => $invoice->getDescription(), 'items' => $this->encodeItems($invoice->getItems()), 'price' => $invoice->getPrice(), 'price_total' => $invoice->getPriceTotal(), 'currency' => $invoice->getCurrency()]; if ($invoice->getClient()) { $data['client'] = $this->encodeClient($invoice->getClient()); } if ($invoice->getShippingAddress()) { $data['shipping_address'] = $this->encodeAddress($invoice->getShippingAddress()); } if ($invoice->getDiscount() && $invoice->getDiscount()->getType() != 'none') { $data['discount'] = ['type' => $invoice->getDiscount()->getType(), 'value' => $invoice->getDiscount()->getValue()]; } return json_encode(['invoice' => $data]); }