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

Feature/new pay pal parameters #638

Merged
merged 4 commits into from
Apr 2, 2024
Merged
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
2 changes: 1 addition & 1 deletion MangoPay/ApiCards.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function GetTransactions($cardId, & $pagination = null, $filter = null, $
/**
* Validate a card
* @param $cardId
* @return \MangoPay\Card
* @return \MangoPay\CardValidation
* @throws Libraries\Exception
*/
public function ValidateCard($cardId, $cardValidation)
Expand Down
5 changes: 5 additions & 0 deletions MangoPay/ApiPayIns.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,9 @@ public function GetPaymentMethodMetadata(PaymentMethodMetadata $paymentMethodMet
{
return $this->CreateObject('payment_method-metadata', $paymentMethodMetadata, '\MangoPay\PaymentMethodMetadata', null, null, $idempotencyKey);
}

public function AddPayPalTrackingInformation($payId, PayPalWebTracking $palWebTracking)
{
return $this->SaveObject('add_tracking_info', $palWebTracking, '\MangoPay\PayIn', $payId);
}
}
6 changes: 6 additions & 0 deletions MangoPay/CardValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ class CardValidation extends Libraries\EntityBase
*/
public $SecureModeNeeded;

/**
* The mode applied for the 3DS2 protocol for CB, Visa, and Mastercard
* @var string
*/
public $SecureMode;

/**
* Ip Address
* @var string
Expand Down
1 change: 1 addition & 0 deletions MangoPay/Libraries/ApiBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ protected function getLogger()
'payins_klarna-web_create' => ['/payins/payment-methods/klarna', RequestType::POST],
'payins_ideal-web_create' => ['/payins/payment-methods/ideal', RequestType::POST],
'payins_giropay-web_create' => ['/payins/payment-methods/giropay', RequestType::POST],
'add_tracking_info' => ['/payins/%s/trackings', RequestType::PUT],

'payment_method-metadata' => ['/payment-methods/metadata', RequestType::POST],

Expand Down
9 changes: 9 additions & 0 deletions MangoPay/Libraries/ResponseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,13 @@ public function GetErrorDetails()
{
return $this->_errorInfo;
}

/**
* Get Error code returned by REST API
* @return int
*/
public function GetErrorCode()
{
return $this->_code;
}
}
5 changes: 5 additions & 0 deletions MangoPay/LineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ class LineItem extends Libraries\Dto
* @var string
*/
public $Description;

/**
* @var string
*/
public $Category;
}
49 changes: 44 additions & 5 deletions MangoPay/PayInPaymentDetailsPaypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ class PayInPaymentDetailsPaypal extends Libraries\Dto implements PayInPaymentDet
*/
public $ShippingAddress;


/// V2 ///

/**
* PayPal buyer's email account
* @var string
* @deprecated This property will be removed in the future due to the introduction of a new way to create PayPal PayIns
*/
public $PaypalBuyerAccountEmail;



/// V2 ///

/**
* Custom description of the payment shown to the consumer when making payments and on the bank statement
* @var string
Expand Down Expand Up @@ -54,6 +52,47 @@ class PayInPaymentDetailsPaypal extends Libraries\Dto implements PayInPaymentDet
*/
public $Reference;

/**
* @var string
*/
public $CancelURL;

/**
* @var string
*/
public $PaypalPayerID;

/**
* @var string
*/
public $BuyerCountry;

/**
* @var string
*/
public $BuyerFirstname;

/**
* @var string
*/
public $BuyerLastname;

/**
* @var string
*/
public $BuyerPhone;

/**
* @var string
*/
public $PaypalOrderID;

/**
* @var array
*/
public $Trackings;


public function GetSubObjects()
{
$subObjects = parent::GetSubObjects();
Expand Down
24 changes: 24 additions & 0 deletions MangoPay/PayPalWebTracking.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace MangoPay;

class PayPalWebTracking extends Libraries\Dto
{
/**
* Item name
* @var string
*/
public $TrackingNumber;

/**
* Quantity of item bought
* @var string
*/
public $Carrier;

/**
* The item cost
* @var bool
*/
public $NotifyBuyer;
}
13 changes: 0 additions & 13 deletions demos/api/config.php

This file was deleted.

25 changes: 0 additions & 25 deletions demos/api/demo.css

This file was deleted.

5 changes: 0 additions & 5 deletions demos/api/demo.js

This file was deleted.

Loading
Loading