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

Feat: add affiliate to create order endpoint #11

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Robertbaelde
Copy link

This PR adds the ability to add Affiliate data to the create order endpoint in order to create split payments.

It requires to add PARTNER_ACCOUNT_ID to the .env.php in order to make the Functional test work.

@Robertbaelde
Copy link
Author

@danielcivit can someone of MultisafePay look at this PR?

@danielcivit
Copy link
Member

Hi @Robertbaelde

use MultiSafepay\Api\Transactions\OrderRequest; 

$orderRequest = new OrderRequest();

$affiliate = [
  "split_payments" => [
      [
        "merchant" => "1001001", 
        "fixed" => 100, 
        "description" => "€1 fixed-amount split" 
      ], 
      [
        "merchant" => "1001002", 
        "percentage" => 20, 
        "description" => "20% split" 
      ] 
    ] 
];

$orderRequest->addData( 
  array( 'affiliate' => $affiliate ) 
);
  • Just to be clear, we fully agree that a better approach will be adding an explicit interface to provide support for such property of the order request; like your PR suggests. We are just sharing this to let you know this approach could be something that you can immediately adopt without the need to fork the SDK; while we find the time to work on this new feature.

We will get back to you in the upcoming days to provide you an update; and once again, thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants