Creating an order with the actual PayPal payment method is not possible, since you'll need to do an actual payment. That is why PayPal is rejecting the request; you'll also need to send a token (to initiate the request) to PayPal so they can verify it.
Since you don't actually need a second payment but need it for record-keeping (as far as I can read) it might be wise to create a fake PayPal payment method for the other Magento instance and set that as a payment method when transferring the order.
As Inchoo already explained this in detail (it's not as hard as it sounds since you'll only need to implement the Magento part) I won't copy/paste it here but only give you the link; http://inchoo.net/magento/how-to-create-magento-payment-module/
Just call it 'paypal_proxy_payment' or something and use that method and you're good to go!
As far as I know, in Magento 2.0.2 - 2.1 version, we cannot create an order without any payment methods.
Magento sets payment for order: vendor/magento/module-quote/Model/QuoteManagement.php
$order->setPayment($this->quotePaymentToOrderPayment->convert($quote->getPayment()));
Convert payment from quote object:
vendor/magento/module-quote/Model/Quote/Payment/ToOrderPayment.php
$orderPayment->setAdditionalInformation(
array_merge(
$object->getAdditionalInformation(),
[Substitution::INFO_KEY_TITLE => $object->getMethodInstance()->getTitle()]
)
);
And then getting method instance:
vendor/magento/module-payment/Model/Info.php
public function getMethodInstance()
{
if (!$this->hasMethodInstance()) {
if (!$this->getMethod()) {
throw new \Magento\Framework\Exception\LocalizedException(
__('The payment method you requested is not available.')
);
}
try {
$instance = $this->_paymentData->getMethodInstance($this->getMethod());
} catch (\UnexpectedValueException $e) {
$instance = $this->_paymentData->getMethodInstance(Method\Substitution::CODE);
}
$instance->setInfoInstance($this);
$this->setMethodInstance($instance);
}
return $this->_getData('method_instance');
}
In cases, Magento will check the available payment methods. If it doesn't have any payment methods, it will throw exceptions.
A Substitution payment method is assigned if non-existing payments: vendor/magento/module-payment/Model/Method/Substitution.php
Best Answer
The above answer is correct but the standard way is not to create the
Customer
in case ofGuest Checkout
.Also, the best place to check the sample code for anything to do
programmatically
is in Magento Integration test cases present indev/tests/integration/testsuite/
.https://github.com/magento/magento2/tree/2.3-develop/dev/tests/integration/testsuite/Magento/Sales/_files