The Fees parameter type has changed from Money to CustomFees for instant conversions and conversion quotes.Before (v3.49.x and earlier):
use MangoPay\Money;$conversion = new \MangoPay\CreateInstantConversion();$conversion->DebitedFunds = new Money();$conversion->DebitedFunds->Currency = 'EUR';$conversion->DebitedFunds->Amount = 1000;// Fees as Money object$conversion->Fees = new Money();$conversion->Fees->Currency = 'EUR';$conversion->Fees->Amount = 10;$result = $api->Conversions->CreateInstantConversion($conversion);
After (v3.50.0+):
use MangoPay\Money;use MangoPay\CustomFees;$conversion = new \MangoPay\CreateInstantConversion();$conversion->DebitedFunds = new Money();$conversion->DebitedFunds->Currency = 'EUR';$conversion->DebitedFunds->Amount = 1000;// Fees as CustomFees object$conversion->Fees = new CustomFees();$conversion->Fees->Type = 'FIXED'; // or 'PERCENTAGE'$conversion->Fees->Value = 10; // Fixed amount or percentage value$result = $api->Conversions->CreateInstantConversion($conversion);
UserMargin on CreateInstantConversion and ConversionQuote
MarginsResponse on Conversion and ConversionQuote
Example with User Margin:
$conversion = new \MangoPay\CreateInstantConversion();$conversion->DebitedFunds = new Money();$conversion->DebitedFunds->Currency = 'EUR';$conversion->DebitedFunds->Amount = 1000;// Set custom user margin (in basis points)$conversion->UserMargin = 50; // 0.5%$result = $api->Conversions->CreateInstantConversion($conversion);
// Direct upload method$api->Settlements->upload($settlementId, $filePath);// Direct update method$api->Settlements->update($settlementId, $settlement);
After (v3.50.0+):
// Step 1: Generate upload URL$uploadUrl = $api->Settlements->GenerateUploadUrl($settlementId, 'filename.csv');// Step 2: Upload file to the URL (using your preferred HTTP client)// Example with cURL:$ch = curl_init($uploadUrl->UploadUrl);curl_setopt($ch, CURLOPT_PUT, true);curl_setopt($ch, CURLOPT_INFILE, fopen($filePath, 'r'));curl_setopt($ch, CURLOPT_INFILESIZE, filesize($filePath));curl_exec($ch);curl_close($ch);// For generating a new upload URL:$newUploadUrl = $api->Settlements->GenerateNewUploadUrl($settlementId, 'new-filename.csv');
Version 3.45.0 introduced type casting changes in the GetSchema method.
This may be a breaking change if your integration relies on the stdClass returned previously.
Before (v3.44.x and earlier):
// GetSchema returned stdClass objects$schema = $api->Recipients->GetSchema('GB');// $schema properties were stdClass instances
After (v3.45.0+):
// GetSchema now returns properly typed arrays$schema = $api->Recipients->GetSchema('GB');// $schema properties are now typed arrays instead of stdClass
Migration Strategy:If your code depends on stdClass behavior:
// Beforeif ($schema->someProperty instanceof \stdClass) { // Handle stdClass}// After - check for array insteadif (is_array($schema->someProperty)) { // Handle array}