php - Searching for Paypal records by paymentId at Paypal account -


i have site uses paypal rest api sdk , capture paymentid after transaction.

i capture return_url's $_server['query_string'] using php.

i hoping client able go paypal account , search records using these paymentid's. doesn't seem case. there transactionid not match paymentid.

any idea how either:

  1. search record in paypal account using paymentid (using paypal account interface record tools - not api programming)
  2. grab transactionid after transaction (the return url gives me paymentid, token, , payerid.)

i've realized need take paymentid , use sdk retrieve more detailed payment information.

$apicontext = $this->getapicontext();

        $payment = new payment();         $payment = $payment->get( $paymentid, $apicontext );          $execution = new paymentexecution();         $execution->setpayerid( $_get['payerid'] );          // ### retrieve payment         // retrieve payment object calling         // static `get` method         // on payment class passing valid         // payment id         // (see bootstrap.php more on `apicontext`)         try {              $payment->execute( $execution, $apicontext );              if ( $payment ) {                  $obj               = json_decode( $payment );                 //get stuff                  $paypal_payment_id = $obj->{'id'};                 $status            = $obj->{'state'};                 //do              }          } catch ( exception $ex ) {             // note: please not use resultprinter class in original code. sample             //resultprinter::printerror("get payment", "payment", null, null, $ex);             log_message( 'error', 'error=' . $ex );             //exit(1);         } 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -