Skip to content

Commit a29eaf2

Browse files
authored
Merge pull request #4 from PatronBase/default-merchant-reference-to-description
Use description for merchant reference if not set
2 parents 19313de + 559411d commit a29eaf2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Message/PurchaseRequest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ public function getData()
5757
$data['metaData'] = $this->getMetadata();
5858
}
5959

60-
if ( $this->getMerchantReference() ) {
61-
$data['merchantReference'] = $this->getMerchantReference();
60+
$merchantReference = $this->getMerchantReference() ?? $this->getDescription();
61+
62+
if ( $merchantReference ) {
63+
$data['merchantReference'] = $merchantReference;
6264
}
6365

6466
if ( $this->getReturnUrl() ) {

0 commit comments

Comments
 (0)