Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes to enable mollie support #16

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CRM/Core/Payment/OmnipayMultiProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public function doDirectPayment(&$params, $component = 'contribute') {
return $params;
}
elseif ($response->isRedirect()) {
require_once 'CRM/Core/Session.php';
CRM_Core_Session::storeSessionObjects();
if ($response->isTransparentRedirect() || !empty($this->gateway->transparentRedirect)) {
$this->storeTransparentRedirectFormData($params['qfKey'], $response->getRedirectData() + array(
Expand Down Expand Up @@ -382,7 +383,7 @@ private function getCreditCardOptions($params, $component) {
'description' => $this->getPaymentDescription($params),
'transactionId' => $this->transaction_id,
'clientIp' => CRM_Utils_System::ipAddress(),
'returnUrl' => $this->getNotifyUrl(TRUE),
'returnUrl' => $this->getReturnSuccessUrl($params['qfKey']),
'cancelUrl' => $this->getCancelUrl($params['qfKey'], CRM_Utils_Array::value('participantID', $params)),
'notifyUrl' => $this->getNotifyUrl(),
'card' => $this->getCreditCardObjectParams($params),
Expand Down
4 changes: 2 additions & 2 deletions CRM/Core/Payment/processors.mgd.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@
'payment_type' => 1,
),
),
/*
5 =>
5 =>
array(
'name' => 'OmniPay - Mollie',
'entity' => 'payment_processor_type',
Expand All @@ -163,6 +162,7 @@
'payment_type' => 1,
),
),
/*
6 =>
array(
'name' => 'OmniPay - PayPal Standard',
Expand Down
10 changes: 10 additions & 0 deletions vendor/omnipay/mollie/src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ public function setApiKey($value)
return $this->setParameter('apiKey', $value);
}

public function setTransactionId($value)
{
return $this->setParameter('transactionId', $value);
}

public function getTransactionId()
{
return $this->getParameter('transactionId');
}

protected function sendRequest($method, $endpoint, $data = null)
{
$this->httpClient->getEventDispatcher()->addListener('request.error', function (Event $event) {
Expand Down
19 changes: 19 additions & 0 deletions vendor/omnipay/mollie/src/Message/FetchTransactionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ public function getTransactionReference()
}
}

/**
* @return mixed
*/
public function getTransactionId()
{
if (isset($this->data['metadata']['transactionId'])) {
return $this->data['metadata']['transactionId'];
}
}

/**
* @return mixed
*/
Expand All @@ -117,4 +127,13 @@ public function getAmount()
return $this->data['amount'];
}
}
/**
* @return mixed
*/
public function getMetadata()
{
if (isset($this->data['metadata'])) {
return $this->data['metadata'];
}
}
}
3 changes: 3 additions & 0 deletions vendor/omnipay/mollie/src/Message/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public function getData()
$data['redirectUrl'] = $this->getReturnUrl();
$data['method'] = $this->getPaymentMethod();
$data['metadata'] = $this->getMetadata();
if ($this->getTransactionId()) {
$data['metadata']['transactionId'] = $this->getTransactionId();
}
$data['issuer'] = $this->getIssuer();

$webhookUrl = $this->getNotifyUrl();
Expand Down