Skip to content

Commit

Permalink
Merge pull request #18 from wirecard/consumerMerchandCrmIdIntegration
Browse files Browse the repository at this point in the history
#17 Add parameter consumerMerchantCrmId
  • Loading branch information
jakubpolomsky authored Nov 25, 2016
2 parents f61574e + f118cf5 commit 37ff240
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
19 changes: 19 additions & 0 deletions library/WirecardCEE/QMore/FrontendClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ class WirecardCEE_QMore_FrontendClient extends WirecardCEE_Stdlib_Client_ClientA
*/
const PLUGIN_VERSION = 'pluginVersion';

/**
* Field name: customerMerchantCrmId
*
* @var string
*/
const CONSUMER_MERCHANT_CRM_ID = 'consumerMerchantCrmId';

/**
* Field name: financialInstitution
*
Expand Down Expand Up @@ -691,6 +698,18 @@ public function setPluginVersion($sPluginVersion)
return $this;
}

/**
* setter for the customer merchant crm id
* @param $userEmail
*
* @return $this
*/
public function createConsumerMerchantCrmId($userEmail)
{
$this->_setField(self::CONSUMER_MERCHANT_CRM_ID, md5($userEmail));
return $this;
}

/**
* Getter for response object
*
Expand Down
13 changes: 13 additions & 0 deletions tests/WirecardCEE/QMore/FrontendClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,19 @@ public function testSetCustomerStatement()
$this->assertAttributeEquals($expected, '_requestData', $this->object);
}

/**
* Tests WirecardCEE_QMore_FrontendClient->createConsumerMerchantCrmId()
*/
public function testCreateConsumerMerchantCrmId()
{
$email = '[email protected]';
$this->object->createConsumerMerchantCrmId($email);

$expected = array_merge($this->aExpectedRequestData, array(
WirecardCEE_QMore_FrontendClient::CONSUMER_MERCHANT_CRM_ID => md5($email)));
$this->assertAttributeEquals($expected, '_requestData', $this->object);
}

/**
* Tests WirecardCEE_QMore_FrontendClient->setOrderReference()
*/
Expand Down

0 comments on commit 37ff240

Please sign in to comment.