Ejemplo n.º 1
0
 /**
  * Removes a credit card token
  * @param parameters The parameters to be sent to the server
  * @param string $lang language of request see SupportedLanguages class
  * @return The transaction response to the request sent
  * @throws PayUException
  * @throws InvalidArgumentException
  */
 public static function remove($parameters, $lang = null)
 {
     $required = array(PayUParameters::TOKEN_ID, PayUParameters::PAYER_ID);
     CommonRequestUtil::validateParameters($parameters, $required);
     $request = PayUTokensRequestUtil::buildRemoveTokenRequest($parameters, $lang);
     $payUHttpRequestInfo = new PayUHttpRequestInfo(Environment::PAYMENTS_API, RequestMethod::POST);
     return PayUApiServiceUtil::sendRequest($request, $payUHttpRequestInfo);
 }
Ejemplo n.º 2
0
 /**
  * Builds a create credit card token request
  *
  * @param parameters The parameters to be sent to the server
  * @param string $lang language of request see SupportedLanguages class
  * @return the request built
  * 
  */
 public static function buildCreateTokenRequest($parameters, $lang = null)
 {
     if (!isset($lang)) {
         $lang = PayU::$language;
     }
     $request = CommonRequestUtil::buildCommonRequest($lang, PayUCommands::CREATE_TOKEN);
     $request->creditCardToken = PayUTokensRequestUtil::buildCreditCardToken($parameters);
     return $request;
 }