Skip to content

Commit c51bd27

Browse files
committed
Include eps_sale
1 parent 4f9b7ae commit c51bd27

4 files changed

Lines changed: 26 additions & 1 deletion

File tree

lib/Hypercharge/Curl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private function init() {
4040
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
4141
curl_setopt($ch, CURLOPT_USERPWD, $this->user.':'.$this->passw);
4242
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
43-
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
43+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
4444
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
4545
}
4646

lib/Hypercharge/Transaction.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,16 @@ static function pay_safe_card_sale($channelToken, $request) {
434434
return self::_call('pay_safe_card_sale', $request, $channelToken);
435435
}
436436

437+
/**
438+
* @param string $channelToken
439+
* @param mixed $request array or Hypercharge\TransactionRequest
440+
* @return Hypercharge\Transaction
441+
* @throws Hypercharge\Errors\Error if no transaction created on hypercharge server
442+
*/
443+
static function eps_sale($channelToken, $request) {
444+
return self::_call('eps_sale', $request, $channelToken);
445+
}
446+
437447
/**
438448
* called "Reconcile" "Single Transaction" in API doc
439449
* @param string $channelToken

lib/Hypercharge/TransactionRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class TransactionRequest implements IRequest {
3636
,'recurring_debit_sale'
3737
,'recurring_sepa_debit_sale'
3838
,'recurring_gtd_sepa_debit_sale'
39+
, 'eps_sale'
3940
);
4041

4142
function __construct($data) {

test/integration/TransactionIntegrationTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,20 @@ function testPaySafeCardSale() {
715715
$this->assertTrue($trx->shouldRedirect());
716716
}
717717

718+
function testEpsSale() {
719+
$data = $this->fixture('eps_sale.json');
720+
$data['currency'] = 'EUR';
721+
$trx = Transaction::giro_pay_sale($this->credentials->channelTokens->EUR, $data);
722+
$this->assertNull($trx->error, "error %s , uid: $trx->unique_id, error:".$trx->error);
723+
$this->assertPattern('/^[0-9a-f]{32}$/', $trx->unique_id);
724+
$this->assertTrue($trx->isPendingAsync(), 'isPendingAsync() %s');
725+
$this->assertEqual($trx->transaction_type, 'eps_sale');
726+
$this->assertEqual($trx->amount , $data['amount']);
727+
$this->assertEqual($trx->currency, $data['currency']);
728+
$this->assertPattern('/\/redirect\/to_acquirer\//', $trx->redirect_url);
729+
$this->assertTrue($trx->shouldRedirect());
730+
}
731+
718732
function testFind() {
719733
$sale = $this->testSale();
720734
$trx = Transaction::find($this->channelToken, $sale->unique_id);

0 commit comments

Comments
 (0)