Skip to content

Commit

Permalink
Merge pull request #649 from Mangopay/feature/payment-category-param
Browse files Browse the repository at this point in the history
added PaymentCategory param
  • Loading branch information
iulian03 authored Jul 30, 2024
2 parents 9b22072 + 7ac022a commit 7cd7261
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions MangoPay/CardPreAuthorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ class CardPreAuthorization extends Libraries\EntityBase
*/
public $CardInfo;

/**
* Allowed values: ECommerce (default), TelephoneOrder
*
* The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments.
* @var string
*/
public $PaymentCategory;

/**
* Get array with mapping which property is object and what type of object
* @return array
Expand Down
9 changes: 9 additions & 0 deletions MangoPay/CardValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ class CardValidation extends Libraries\EntityBase
* Get array with mapping which property is object and what type of object
* @return array
*/

/**
* Allowed values: ECommerce (default), TelephoneOrder
*
* The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments.
* @var string
*/
public $PaymentCategory;

public function GetSubObjects()
{
$subObjects = parent::GetSubObjects();
Expand Down
8 changes: 8 additions & 0 deletions MangoPay/PayIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ class PayIn extends Transaction
*/
public $RecurringPayinRegistrationId;

/**
* Allowed values: ECommerce (default), TelephoneOrder
*
* The channel through which the user provided their card details, used to indicate mail-order and telephone-order (MOTO) payments.
* @var string
*/
public $PaymentCategory;

/**
* Get array with mapping which property depends on other property
* @return array
Expand Down
1 change: 1 addition & 0 deletions tests/Cases/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ protected function getNewPayInCardDirect($userId = null)
$payIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect();
$payIn->ExecutionDetails->SecureModeReturnURL = 'http://test.com';
$payIn->ExecutionDetails->Culture = 'FR';
$payIn->PaymentCategory = 'TelephoneOrder';

$address = new Address();
$address->AddressLine1 = 'Main Street no 5';
Expand Down
1 change: 1 addition & 0 deletions tests/Cases/PayInsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function test_PayIns_Create_CardDirect()
$this->assertEquals($wallet->Balance->Amount, $beforeWallet->Balance->Amount + $payIn->CreditedFunds->Amount);
$this->assertEquals(PayInStatus::Succeeded, $payIn->Status);
$this->assertEquals('PAYIN', $payIn->Type);
$this->assertEquals('TelephoneOrder', $payIn->PaymentCategory);

$this->assertNotNull($payIn->PaymentDetails->CardInfo);
$this->assertNotNull($payIn->PaymentDetails->CardInfo->BIN);
Expand Down

0 comments on commit 7cd7261

Please sign in to comment.