Uname: Linux peekpos.com 6.8.0-1060-aws #63~22.04.1-Ubuntu SMP Tue Jun 30 02:32:53 UTC 2026 x86_64
Software: Apache
PHP version: 8.3.25 [ PHP INFO ] PHP os: Linux
Server Ip: 47.130.192.226
Your Ip: 10.3.134.78
User: www (1001) | Group: www (1001)
Safe Mode: OFF
Disable Function:
passthru,putenv,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv

name : RestCompletePurchaseRequest.php
<?php
/**
 * PayPal REST Complete Purchase Request
 */

namespace Omnipay\PayPal\Message;

/**
 * PayPal REST Complete Purchase Request
 *
 * Use this message to execute (complete) a PayPal payment that has been
 * approved by the payer. You can optionally update transaction information
 * when executing the payment by passing in one or more transactions.
 *
 * This call only works after a buyer has approved the payment using the
 * provided PayPal approval URL.
 *
 * ### Example
 *
 * The payer ID and the payment ID returned from the callback after the purchase
 * will be passed to the return URL as GET parameters payerId and paymentId
 * respectively.
 *
 * See RestPurchaseRequest for the first part of this example transaction:
 *
 * <code>
 *   $paymentId = $_GET['paymentId'];
 *   $payerId = $_GET['payerId'];
 *
 *   // Once the transaction has been approved, we need to complete it.
 *   $transaction = $gateway->completePurchase(array(
 *       'payer_id'             => $payerId,
 *       'transactionReference' => $paymentId,
 *   ));
 *   $response = $transaction->send();
 *   if ($response->isSuccessful()) {
 *       // The customer has successfully paid.
 *   } else {
 *       // There was an error returned by completePurchase().  You should
 *       // check the error code and message from PayPal, which may be something
 *       // like "card declined", etc.
 *   }
 * </code>
 *
 * @see RestPurchaseRequest
 * @link https://developer.paypal.com/docs/api/#execute-an-approved-paypal-payment
 */
class RestCompletePurchaseRequest extends AbstractRestRequest
{
    /**
     * Get the raw data array for this message. The format of this varies from gateway to
     * gateway, but will usually be either an associative array, or a SimpleXMLElement.
     *
     * @return mixed
     */
    public function getData()
    {
        $this->validate('transactionReference', 'payerId');

        $data = array(
            'payer_id' => $this->getPayerId()
        );

        return $data;
    }

    public function getEndpoint()
    {
        return parent::getEndpoint() . '/payments/payment/' . $this->getTransactionReference() . '/execute';
    }
}
© 2026 GrazzMean