Skip to content

Commit 7cd7261

Browse files
authored
Merge pull request #649 from Mangopay/feature/payment-category-param
added PaymentCategory param
2 parents 9b22072 + 7ac022a commit 7cd7261

File tree

5 files changed

+27
-0
lines changed

5 files changed

+27
-0
lines changed

MangoPay/CardPreAuthorization.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ class CardPreAuthorization extends Libraries\EntityBase
178178
*/
179179
public $CardInfo;
180180

181+
/**
182+
* Allowed values: ECommerce (default), TelephoneOrder
183+
*
184+
* The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments.
185+
* @var string
186+
*/
187+
public $PaymentCategory;
188+
181189
/**
182190
* Get array with mapping which property is object and what type of object
183191
* @return array

MangoPay/CardValidation.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ class CardValidation extends Libraries\EntityBase
109109
* Get array with mapping which property is object and what type of object
110110
* @return array
111111
*/
112+
113+
/**
114+
* Allowed values: ECommerce (default), TelephoneOrder
115+
*
116+
* The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments.
117+
* @var string
118+
*/
119+
public $PaymentCategory;
120+
112121
public function GetSubObjects()
113122
{
114123
$subObjects = parent::GetSubObjects();

MangoPay/PayIn.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ class PayIn extends Transaction
4343
*/
4444
public $RecurringPayinRegistrationId;
4545

46+
/**
47+
* Allowed values: ECommerce (default), TelephoneOrder
48+
*
49+
* The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments.
50+
* @var string
51+
*/
52+
public $PaymentCategory;
53+
4654
/**
4755
* Get array with mapping which property depends on other property
4856
* @return array

tests/Cases/Base.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ protected function getNewPayInCardDirect($userId = null)
655655
$payIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect();
656656
$payIn->ExecutionDetails->SecureModeReturnURL = 'http://test.com';
657657
$payIn->ExecutionDetails->Culture = 'FR';
658+
$payIn->PaymentCategory = 'TelephoneOrder';
658659

659660
$address = new Address();
660661
$address->AddressLine1 = 'Main Street no 5';

tests/Cases/PayInsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function test_PayIns_Create_CardDirect()
6969
$this->assertEquals($wallet->Balance->Amount, $beforeWallet->Balance->Amount + $payIn->CreditedFunds->Amount);
7070
$this->assertEquals(PayInStatus::Succeeded, $payIn->Status);
7171
$this->assertEquals('PAYIN', $payIn->Type);
72+
$this->assertEquals('TelephoneOrder', $payIn->PaymentCategory);
7273

7374
$this->assertNotNull($payIn->PaymentDetails->CardInfo);
7475
$this->assertNotNull($payIn->PaymentDetails->CardInfo->BIN);

0 commit comments

Comments
 (0)