Exemplo n.º 1
0
 /**
  * @expectedException HpsCreditException
  */
 public function test022RecurringBillingVisa()
 {
     $this->creditService->recurring(10.08)->withPaymentMethodKey(self::$paymentMethodKeyVisa)->withOneTime(true)->execute();
 }
Exemplo n.º 2
0
    $logger = HpsLogger::getInstance();
    $logger->useLogger(new SimpleLogger());
    print '<pre><code>';
    print_r($_GET);
    print '</code></pre>';
    $config = new HpsServicesConfig();
    $config->secretApiKey = 'skapi_cert_MT2PAQB-9VQA5Z1mOXQbzZcH6O5PpdhjWtFhMBoL4A';
    $token = new HpsTokenData();
    $token->tokenValue = $_GET['heartlandToken'];
    $secureEcommerce = new HpsSecureEcommerce();
    $secureEcommerce->dataSource = 'Visa 3DSecure';
    $secureEcommerce->type = '3DSecure';
    $secureEcommerce->data = $_GET['cavv'];
    $secureEcommerce->eciFlag = substr($_GET['eciflag'], 1);
    $secureEcommerce->xid = $_GET['xid'];
    $creditService = new HpsFluentCreditService($config);
    $response = $creditService->charge()->withAmount('1.00')->withCurrency('usd')->withToken($token)->withSecureEcommerce($secureEcommerce)->execute();
    print '<pre><code>';
    print_r($response);
    print '</code></pre>';
} else {
    $orderNumber = str_shuffle('abcdefghijklmnopqrstuvwxyz');
    //$apiIdentifier = 'Merchant-uatmerchant-Key';
    //$orgUnitId = '55ef3e43f723aa431c9969ae';
    //$apiKey = 'ac848959-f878-4f62-a0a2-4b2a648446c3';
    $apiIdentifier = '579bc985da529378f0ec7d0e';
    $orgUnitId = '5799c3c433fadd4cf427d01a';
    $apiKey = 'a32ed153-3759-4302-a314-546811590b43';
    $data = array('jti' => str_shuffle('abcdefghijklmnopqrstuvwxyz'), 'iat' => time(), 'iss' => $apiIdentifier, 'OrgUnitId' => $orgUnitId, 'Payload' => array('OrderDetails' => array('OrderNumber' => $orderNumber, 'Amount' => '1500', 'CurrencyCode' => '840')));
    $jwt = JWT::encode($apiKey, $data);
    ?>
Exemplo n.º 3
0
 public function test041VoidGsb()
 {
     $voidResponse = $this->service->void(self::$transactionId39)->execute();
     $this->assertEquals(true, $voidResponse != null);
     $this->assertEquals('00', $voidResponse->responseCode);
 }