本文整理汇总了PHP中PayPal\Validation\ArgumentValidator类的典型用法代码示例。如果您正苦于以下问题:PHP ArgumentValidator类的具体用法?PHP ArgumentValidator怎么用?PHP ArgumentValidator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArgumentValidator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: subscribedEventTypes
/**
* Retrieves the list of events-types subscribed by the given Webhook.
*
* @param string $webhookId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return WebhookEventTypeList
*/
public static function subscribedEventTypes($webhookId, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($webhookId, 'webhookId');
$payLoad = "";
$json = self::executeCall("/v1/notifications/webhooks/{$webhookId}/event-types", "GET", $payLoad, null, $apiContext, $restCall);
$ret = new WebhookEventTypeList();
$ret->fromJson($json);
return $ret;
}
示例2: refund
/**
* Refund a captured payment by passing the capture_id in the request URI. In addition, include an amount object in the body of the request JSON.
*
* @param Refund $refund
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Refund
*/
public function refund($refund, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($this->getId(), "Id");
ArgumentValidator::validate($refund, 'refund');
$payLoad = $refund->toJSON();
$json = self::executeCall("/v1/payments/capture/{$this->getId()}/refund", "POST", $payLoad, null, $apiContext, $restCall);
$ret = new Refund();
$ret->fromJson($json);
return $ret;
}
示例3: all
/**
* Retrieves a list of Credit Card resources.
*
* @param array $params
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return CreditCardList
*/
public static function all($params, $apiContext = null, $restCall = null)
{
if (is_null($params)) {
$params = array();
}
ArgumentValidator::validate($params, 'params');
$payLoad = "";
$allowedParams = array('page_size' => 1, 'page' => 1, 'start_time' => 1, 'end_time' => 1, 'sort_order' => 1, 'sort_by' => 1, 'merchant_id' => 1, 'external_card_id' => 1, 'external_customer_id' => 1, 'total_required' => 1);
$json = self::executeCall("/v1/vault/credit-cards" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
$ret = new CreditCardList();
$ret->fromJson($json);
return $ret;
}
示例4: cancel
/**
* Cancels the unclaimed payment using the items id passed in the request URI. If an unclaimed item is not claimed within 30 days, the funds will be automatically returned to the sender. This call can be used to cancel the unclaimed item prior to the automatic 30-day return.
*
* @param string $payoutItemId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return PayoutItemDetails
*/
public static function cancel($payoutItemId, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($payoutItemId, 'payoutItemId');
$payLoad = "";
$json = self::executeCall("/v1/payments/payouts-item/{$payoutItemId}/cancel", "POST", $payLoad, null, $apiContext, $restCall);
$ret = new PayoutItemDetails();
$ret->fromJson($json);
return $ret;
}
示例5: update
/**
* Update an existing template by passing the template ID to the request URI. In addition, pass a complete template object in the request JSON. Partial updates are not supported.
*
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Template
*/
public function update($apiContext = null, $restCall = null)
{
ArgumentValidator::validate($this->getTemplateId(), "Id");
$payLoad = $this->toJSON();
$json = self::executeCall("/v1/invoicing/templates/{$this->getTemplateId()}", "PUT", $payLoad, null, $apiContext, $restCall);
$this->fromJson($json);
return $this;
}
示例6: all
/**
* List payments in any state (created, approved, failed, etc.). Payments returned are the payments made to the merchant issuing the request.
*
* @param array $params
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return PaymentHistory
*/
public static function all($params, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($params, 'params');
$payLoad = "";
$allowedParams = array('count' => 1, 'start_id' => 1, 'start_index' => 1, 'start_time' => 1, 'end_time' => 1, 'payee_id' => 1, 'sort_by' => 1, 'sort_order' => 1);
$json = self::executeCall("/v1/payments/payment?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
$ret = new PaymentHistory();
$ret->fromJson($json);
return $ret;
}
示例7: authorize
/**
* Authorize an order by passing the order_id in the request URI. In addition, include an amount object in the body of the request JSON.
*
* @param Authorization $authorization Authorization Object with Amount value to be authorized
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Authorization
*/
public function authorize($authorization, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($this->getId(), "Id");
ArgumentValidator::validate($authorization, 'Authorization');
$payLoad = $authorization->toJSON();
$json = self::executeCall("/v1/payments/orders/{$this->getId()}/authorize", "POST", $payLoad, null, $apiContext, $restCall);
$ret = new Authorization();
$ret->fromJson($json);
return $ret;
}
示例8: qrCode
/**
* Generate a QR code for an invoice by passing the invoice ID to the request URI. The request generates a QR code that is 500 pixels in width and height. You can change the dimensions of the returned code by specifying optional query parameters.
*
* @param array $params
* @param string $invoiceId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return Image
*/
public static function qrCode($invoiceId, $params = array(), $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($invoiceId, 'invoiceId');
ArgumentValidator::validate($params, 'params');
$allowedParams = array('width' => 1, 'height' => 1, 'action' => 1);
$payLoad = "";
$json = self::executeCall("/v1/invoicing/invoices/{$invoiceId}/qr-code?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
$ret = new Image();
$ret->fromJson($json);
return $ret;
}
示例9: transactions
/**
* List transactions for a billing agreement by passing the ID of the agreement, as well as the start and end dates of the range of transactions to list, to the request URI.
*
* @param string $agreementId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return AgreementTransactions
*/
public static function transactions($agreementId, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($agreementId, 'agreementId');
$payLoad = "";
$json = self::executeCall("/v1/payments/billing-agreements/{$agreementId}/transactions", "GET", $payLoad, null, $apiContext, $restCall);
$ret = new AgreementTransactions();
$ret->fromJson($json);
return $ret;
}
示例10: reauthorize
/**
* Reauthorizes an expired Authorization.
*
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @return Authorization
*/
public function reauthorize($apiContext = null)
{
ArgumentValidator::validate($this->getId(), "Id");
$payLoad = $this->toJSON();
if ($apiContext == null) {
$apiContext = new ApiContext(self::$credential);
}
$call = new PayPalRestCall($apiContext);
$json = $call->execute(array('PayPal\\Handler\\RestHandler'), "/v1/payments/authorization/{$this->getId()}/reauthorize", "POST", $payLoad);
$this->fromJson($json);
return $this;
}
示例11: testInvalidDataValidate
/**
*
* @dataProvider invalidProvider
* @expectedException \InvalidArgumentException
*/
public function testInvalidDataValidate($input)
{
$this->assertTrue(ArgumentValidator::validate($input, "Name"));
}
示例12: get
/**
* Look up a particular credit financing resource by passing the financing_code in the request URI.
*
* @param string $financing_code
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return CreditFinancing
*/
public static function get($financing_code, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($financing_code, 'financing_code');
$payLoad = "";
$json = self::executeCall("/v1/credit/credit-financing/{$financing_code}", "GET", $payLoad, null, $apiContext, $restCall);
$ret = new CreditFinancing();
$ret->fromJson($json);
return $ret;
}
示例13: refund
/**
* Creates (and processes) a new Refund Transaction added as a related resource.
*
* @param Refund $refund
* @param \PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @return Refund
*/
public function refund($refund, $apiContext = null)
{
ArgumentValidator::validate($this->getId(), "Id");
ArgumentValidator::validate($refund, 'refund');
$payLoad = $refund->toJSON();
if ($apiContext == null) {
$apiContext = new ApiContext(self::$credential);
}
$call = new PayPalRestCall($apiContext);
$json = $call->execute(array('PayPal\\Handler\\RestHandler'), "/v1/payments/capture/{$this->getId()}/refund", "POST", $payLoad);
$ret = new Refund();
$ret->fromJson($json);
return $ret;
}
示例14: delete
/**
* Delete an existing web experience profile by passing the profile ID to the request URI.
*
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return bool
*/
public function delete($apiContext = null, $restCall = null)
{
ArgumentValidator::validate($this->getId(), "Id");
$payLoad = "";
self::executeCall("/v1/payment-experience/web-profiles/{$this->getId()}", "DELETE", $payLoad, null, $apiContext, $restCall);
return true;
}
示例15: searchTransactions
/**
* List transactions for a billing agreement by passing the ID of the agreement, as well as the start and end dates of the range of transactions to list, to the request URI.
*
* @param string $agreementId
* @param array $params Parameters for search string. Options: start_date, and end_date
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return AgreementTransactions
*/
public static function searchTransactions($agreementId, $params = array(), $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($agreementId, 'agreementId');
ArgumentValidator::validate($params, 'params');
$allowedParams = array('start_date' => 1, 'end_date' => 1);
$payLoad = "";
$json = self::executeCall("/v1/payments/billing-agreements/{$agreementId}/transactions?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
$ret = new AgreementTransactions();
$ret->fromJson($json);
return $ret;
}