Merge pull request #714 from woocommerce/PCP-735-1.9.0-test5---missing-paypal-fee

Missing PayPal fee in WC order details for PUI purchase (735)
This commit is contained in:
Emili Castells 2022-07-08 10:31:49 +02:00 committed by GitHub
commit 9dd23f3ccf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 10 deletions

View file

@ -11,6 +11,7 @@ namespace WooCommerce\PayPalCommerce\ApiClient\Endpoint;
use Psr\Log\LoggerInterface;
use RuntimeException;
use stdClass;
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\RequestTrait;
use WooCommerce\PayPalCommerce\ApiClient\Entity\Order;
@ -162,14 +163,14 @@ class PayUponInvoiceOrderEndpoint {
}
/**
* Get Ratepay payment instructions from PayPal order.
* Get PayPal order as object.
*
* @param string $id The PayPal order ID.
* @return array
* @return stdClass
* @throws RuntimeException When there is a problem getting the order.
* @throws PayPalApiException When there is a problem getting the order.
*/
public function order_payment_instructions( string $id ): array {
public function order( string $id ): stdClass {
$bearer = $this->bearer->bearer();
$url = trailingslashit( $this->host ) . 'v2/checkout/orders/' . $id;
$args = array(
@ -191,10 +192,7 @@ class PayUponInvoiceOrderEndpoint {
throw new PayPalApiException( $json, $status_code );
}
return array(
$json->payment_source->pay_upon_invoice->payment_reference,
$json->payment_source->pay_upon_invoice->deposit_bank_details,
);
return $json;
}
/**