Example #1
0
 public function getTime()
 {
     if (self::$_tm) {
         return self::$_tm;
     }
     return parent::getTime();
 }
Example #2
0
 public function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $transactionId, $amount = null)
 {
     $this->transactionId = $transactionId;
     $this->amount = $amount > 0 ? $amount : null;
     $request = new Am_HttpRequest(Am_Paysystem_Paymill::API_ENDPOINT . 'refunds/' . $transactionId, 'POST');
     $request->setAuth($plugin->getConfig('private_key'), '');
     if ($this->amount > 0) {
         $request->addPostParameter('amount', sprintf('%.02f', $amount) * 100)->addPostParameter('description', 'Refund from aMember script. Username: '******', invoice: ' . $invoice->public_id);
     }
     parent::__construct($plugin, $invoice, $request, true);
 }
Example #3
0
 public function run(Am_Paysystem_Result $result)
 {
     $reqId = sha1(serialize($this->request->getPostParams()));
     // unique id of request
     $this->request->setHeader('X-VPS-REQUEST-ID', $reqId);
     $this->request->setHeader('X-VPS-CLIENT-TIMEOUT', 60);
     $this->request->setHeader('X-VPS-VIT-INTEGRATION-PRODUCT', 'aMember Pro');
     // $this->request->setHeader('Content-Type', 'text/namevalue');
     $this->request->addPostParameter('VERBOSITY', 'HIGH');
     return parent::run($result);
 }
Example #4
0
 public function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $charge_id, $amount = null)
 {
     $this->charge_id = $charge_id;
     $this->amount = $amount > 0 ? $amount : null;
     $request = new Am_HttpRequest('https://api.stripe.com/v1/charges/' . $this->charge_id . '/refund', 'POST');
     $request->setAuth($plugin->getConfig('secret_key'), '');
     if ($this->amount > 0) {
         $request->addPostParameter('amount', sprintf('%.2f', $this->amount) * 100);
     }
     parent::__construct($plugin, $invoice, $request, true);
 }
Example #5
0
 public function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $doFirst = true)
 {
     parent::__construct($plugin, $invoice, $plugin->createHttpRequest(), $doFirst);
     $this->request->setHeader("Content-Type", "application/json");
     $this->request->setHeader("Authorization", "Bearer " . $this->plugin->getConfig('token'));
     $this->request->setBody(json_encode((array) $this->createParams()));
     $this->request->setMethod(Am_HttpRequest::METHOD_POST);
     $this->request->setUrl(!$this->plugin->getConfig('testing') ? Am_Paysystem_WepayOnsite::LIVE_URL : Am_Paysystem_WepayOnsite::SANDBOX_URL);
 }
Example #6
0
 public function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $doFirst, $dpsBillingId)
 {
     $xmlOut = '';
     $xmlOut .= '<Txn>';
     $xmlOut .= '<PostUsername>' . $plugin->getConfig('PostUsername') . '</PostUsername>';
     $xmlOut .= '<PostPassword>' . $plugin->getConfig('PostPassword') . '</PostPassword>';
     $xmlOut .= '<Amount>' . $invoice->second_total . '</Amount>';
     $xmlOut .= '<InputCurrency>' . $invoice->currency . '</InputCurrency>';
     $xmlOut .= '<MerchantReference>' . $invoice->getLineDescription() . '</MerchantReference>';
     $xmlOut .= '<TxnType>' . $this->txnType . '</TxnType>';
     $xmlOut .= '<TxnId>' . $invoice->public_id . '</TxnId>';
     $xmlOut .= '<BillingId></BillingId>';
     $xmlOut .= '<DpsBillingId>' . $dpsBillingId . '</DpsBillingId>';
     $xmlOut .= '</Txn>';
     $request = new Am_HttpRequest_PaymentExpress($xmlOut, $this->requestType, (bool) $plugin->getConfig('debugMode'));
     $request->setUrl(Am_Paysystem_PaymentExpress::URL_RECURRING);
     parent::__construct($plugin, $invoice, $request, $doFirst);
 }
 public function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $doFirst)
 {
     $request = new Am_HttpRequest(Am_Paysystem_Paymentsystemsworldwide::URL, Am_HttpRequest::METHOD_POST);
     parent::__construct($plugin, $invoice, $request, $doFirst);
     $this->addRequestParams();
 }
Example #8
0
 public function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $doFirst = true)
 {
     parent::__construct($plugin, $invoice, $plugin->createHttpRequest(), $doFirst);
     $this->request->setHeader('Content-type', 'text/xml');
     $this->request->setBody($this->createXml());
     $this->request->setMethod(Am_HttpRequest::METHOD_POST);
     $this->request->setUrl(!$this->plugin->getConfig('testing') ? Am_Paysystem_Securepaycomau::LIVE_URL : Am_Paysystem_Securepaycomau::SANDBOX_URL);
 }
Example #9
0
 public function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $billNumber, $amount)
 {
     parent::__construct($plugin, $invoice, $plugin->createHttpRequest(), true);
     $this->amount = $amount;
     $this->orig_id = $billNumber;
     $header[] = "Authorization: Basic " . base64_encode($plugin->getConfig('apikey') . ':' . $plugin->getConfig('password'));
     $header[] = "Content-Type: text/xml";
     $this->request->setHeader($header);
     $this->request->setBody($this->createXml($invoice));
     $this->request->setMethod(Am_HttpRequest::METHOD_POST);
     $this->request->setUrl($this->plugin->getConfig('testing') ? Am_Paysystem_EwayRapid3::REFUND_SANDBOX_URL : Am_Paysystem_EwayRapid3::REFUND_URL);
 }
Example #10
0
 public function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $request, $doFirst = true)
 {
     parent::__construct($plugin, $invoice, $request, $doFirst);
 }
Example #11
0
 public function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $doFirst)
 {
     $request = new Am_HttpRequest($plugin->getGatewayURL(), Am_HttpRequest::METHOD_POST);
     parent::__construct($plugin, $invoice, $request, $doFirst);
     $this->addRequestParams();
 }
Example #12
0
 function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $doFirst, $soapData)
 {
     $this->soapData = $soapData;
     parent::__construct($plugin, $invoice, new Am_Request(), $doFirst);
 }
Example #13
0
 public function __construct(Am_Paysystem_Abstract $plugin, Invoice $invoice, $request, $doFirst, CcRecord $cc)
 {
     $this->cc = $cc;
     parent::__construct($plugin, $invoice, $request, $doFirst);
 }