當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Payment::all方法代碼示例

本文整理匯總了PHP中PayPal\Api\Payment::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Payment::all方法的具體用法?PHP Payment::all怎麽用?PHP Payment::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PayPal\Api\Payment的用法示例。


在下文中一共展示了Payment::all方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getList

 public function getList($count = 10, $index = 0)
 {
     $apiContext = $this->connectionService->getApiContext();
     $dispatcher = $this->connectionService->getDispatcher();
     $dispatcher->dispatch(PaymentEvent::GET_ALL_START);
     $params = array('count' => $count, 'start_index' => $index);
     $payments = Payment::all($params, $apiContext);
     $dispatcher->dispatch(PaymentEvent::GET_ALL_END);
     return $payments->getPayments();
 }
開發者ID:DDFranky22,項目名稱:DDFPayPalBundle,代碼行數:10,代碼來源:PaymentService.php

示例2: testOperations

 public function testOperations()
 {
     $p1 = $this->payments['new'];
     $p1->create();
     $this->assertNotNull($p1->getId());
     $p2 = Payment::get($p1->getId());
     $this->assertNotNull($p2);
     $paymentHistory = Payment::all(array('count' => '10'));
     $this->assertNotNull($paymentHistory);
 }
開發者ID:Lucerin,項目名稱:Yii-projects,代碼行數:10,代碼來源:PaymentTest.php

示例3: all

 public static function all($param, $apiContext = null)
 {
     if (isset($apiContext)) {
         return Payment::all($param, $apiContext);
     }
     return Payment::all($param);
 }
開發者ID:elijan,項目名稱:payments,代碼行數:7,代碼來源:PaypalPayment.php

示例4: catch

// you've created using the Payments API.
// Note various query parameters that you can
// use to filter, and paginate through the
// payments list.
// API used: GET /v1/payments/payments
require __DIR__ . '/../bootstrap.php';
use PayPal\Api\Payment;
// ### Retrieve payment
// Retrieve the PaymentHistory object by calling the
// static `get` method on the Payment class,
// and pass a Map object that contains
// query parameters for paginations and filtering.
// Refer the method doc for valid values for keys
// (See bootstrap.php for more on `ApiContext`)
try {
    $payments = Payment::all(array('count' => 10, 'start_index' => 5), $apiContext);
} catch (PayPal\Exception\PPConnectionException $ex) {
    echo "Exception:" . $ex->getMessage() . PHP_EOL;
    var_dump($ex->getData());
    exit(1);
}
?>
<html>
<head>
	<title>Lookup payment history</title>
</head>
<body>
	<div>Got <?php 
echo $payments->getCount();
?>
 matching payments </div>
開發者ID:ewwgit,項目名稱:eptri,代碼行數:31,代碼來源:ListPayments.php

示例5: array

<?php

// #GetPaymentList
// This sample code demonstrate how you can
// retrieve a list of all Payment resources
// you've created using the Payments API.
// Note various query parameters that you can
// use to filter, and paginate through the
// payments list.
// API used: GET /v1/payments/payments
require 'CreatePayment.php';
use PayPal\Api\Payment;
// ### Retrieve payment
// Retrieve the PaymentHistory object by calling the
// static `get` method on the Payment class,
// and pass a Map object that contains
// query parameters for paginations and filtering.
// Refer the method doc for valid values for keys
// (See bootstrap.php for more on `ApiContext`)
try {
    $params = array('count' => 10, 'start_index' => 5);
    $payments = Payment::all($params, $apiContext);
} catch (Exception $ex) {
    ResultPrinter::printError("List Payments", "Payment", null, $params, $ex);
    exit(1);
}
ResultPrinter::printResult("List Payments", "Payment", null, $params, $payments);
開發者ID:maherelgamil,項目名稱:Small-store-for-books-with-Laravel-5.1,代碼行數:27,代碼來源:ListPayments.php

示例6: testList

 /**
  * @dataProvider mockProvider
  * @param Payment $obj
  */
 public function testList($obj, $mockApiContext)
 {
     $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(PaymentHistoryTest::getJson()));
     $params = array();
     $result = $obj->all($params, $mockApiContext, $mockPPRestCall);
     $this->assertNotNull($result);
 }
開發者ID:Roc4rdho,項目名稱:app,代碼行數:12,代碼來源:PaymentTest.php

示例7: getPaymentList

 /**
  * Get payment list
  *
  * @param int $limit Limit number payment
  * @param int $offset Start index payment
  * @return mixed Object payment list
  */
 public function getPaymentList($limit = 10, $offset = 0)
 {
     $params = ['count' => $limit, 'start_index' => $offset];
     try {
         $payments = Payment::all($params, $this->apiContext);
     } catch (\PayPal\Exception\PPConnectionException $paypalException) {
         throw new \Exception($paypalException->getMessage());
     }
     return $payments;
 }
開發者ID:namnv609,項目名稱:laravel5-services,代碼行數:17,代碼來源:PayPalService.php

示例8: catch

require __DIR__ . '/../bootstrap.php';
use PayPal\Api\Payment;
// ### Authentication
// Pass in a `OAuthTokenCredential` object
// explicilty to authenticate the call.
// If you skip this step, the client id/secret
// set in the config file will be used.
Payment::setCredential($cred);
// ### Retrieve payment
// Retrieve the PaymentHistory object by calling the
// static `get` method on the Payment class,
// and pass a Map object that contains
// query parameters for paginations and filtering.
// Refer the method doc for valid values for keys
try {
    $payments = Payment::all(array('count' => 10, 'start_index' => 5));
} catch (\PPConnectionException $ex) {
    echo "Exception:" . $ex->getMessage() . PHP_EOL;
    var_dump($ex->getData());
    exit(1);
}
?>
<html>
<body>
	<div>Got <?php 
echo $payments->getCount();
?>
 matching payments </div>
	<pre><?php 
var_dump($payments->toArray());
?>
開發者ID:mayoalexander,項目名稱:fl-two,代碼行數:31,代碼來源:ListPayments.php

示例9: array

 function get_payments($count, $offset)
 {
     // auth
     $apiContext = $this->apiContext();
     $params = array('count' => $count, 'start_index' => $offset);
     try {
         // Get the payment Object by passing paymentId
         $PaymentHistory = Payment::all($params, $apiContext);
         $valid = true;
     } catch (Exception $ex) {
         $this->LoggingManager->log(print_r($ex, true), 'DEBUG');
         $valid = false;
     }
     $payment_array = array();
     if ($valid === true) {
         $payments = $PaymentHistory->getPayments();
         for ($p = 0, $x = count($payments); $p < $x; $p++) {
             $payment_array[$p] = $this->get_payment_details($payments[$p], true);
         }
     }
     return $payment_array;
 }
開發者ID:shophelfer,項目名稱:shophelfer.com-shop,代碼行數:22,代碼來源:PayPalInfo.php


注:本文中的PayPal\Api\Payment::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。