commercetools / commercetools-paypal-plus-integration

Integration between commercetools API and PayPal Plus API
Apache License 2.0
7 stars 1 forks source link

Incompatibility with /me/payments endpoint #148

Open ase-dcexpert opened 4 years ago

ase-dcexpert commented 4 years ago

Dear commercetools team,

it seems, that this implementation of the paypal plus integration is incompatible with the /me/payments endpoint.

The integration server code (springboot application) of this repository requires the field "interfaceId" to be filled when creating the Payment. Otherwise the payment will not be found when calling " http://paypal-plus-integration-server.com/${tenantName}/commercetools/create/payments/${ctpPaymentId}", because of this condition in your code (PaymentHandler.java):

if (cartOpt.isPresent() && ctpPaymentOpt.isPresent() && ctpPaymentOpt.get().getInterfaceId() != null) {
   return patchAddress(cartOpt.get(), ctpPaymentOpt.get().getInterfaceId());
} 
else {
  return completedFuture(PaymentHandleResponse.of400BadRequest(format("Payment payment=[%s] does not exists or does not have a connected cart.", ctpPaymentId)));
}

Since we are using the Me-Payments endpoints from our SPA, it is not possible to set the interfaceId in the payment draft. So we are unable to integrate Paypal plus with this code here. :-(

This issue is quite similar to this one: https://github.com/commercetools/commercetools-adyen-integration/issues/62

I think all your payment integrations need to be tested for compatibility with the me-Endpoints.... These problems are currently blocking us currently from going live.

Kind regards,

Alexander