コード例 #1
0
 /** Calls the AssignCardsToDisposition web service method.
  * 
  * @param username
  *          Username to use for the web service call.
  * @param password
  *          Password to use for the web service call.
  * @param mtid
  *          Merchant transaction id to use for the web service call. It must
  *          be unique for each invocation.
  * @param subId
  *          SubId to use for the web service call. The parameter is optional
  *          and can be <code>null</code>.
  * @param amount
  *          Amount to use for the web service call.
  * @param currency
  *          Currency to use for the web service call. It must contain a 3
  *          letter ISO 4217 currency code.
  * @param cards
  *          Card information (pin, password) to use for the web service call.
  *          At least one (1) card and at most ten (10) cards can be present in
  *          the request. Card passwords are optional and should be
  *          <code>null</code> if no password is specified for the given card.
  * @param locale
  *          Locale to use for the web service call. The parameter is optional
  *          and can be <code>null</code>.
  * @param acceptingTerms
  *          Integer value indicating if the user accepts Paysafecard's terms
  *          of use. Value should be 1 if user accepts terms of use.
  * @return Response of the AssignCardToDisposition web service call. The call
  *         was successful if resultCode and errorCode of the response are 0.
  *         For list of possible error codes refer to merchant documentation.
  * @throws InvalidArgumentException
  *           If required parameters are null or empty.
  */
 public function assignCardsToDisposition($username, $password, $mtid, $subId, $amount, $currency, $locale, $acceptingTerms, $cards)
 {
     Validators::validateStringNotNull($username, 'username');
     Validators::validateStringNotNull($password, 'password');
     Validators::validateStringNotNull($mtid, 'mtid');
     Validators::validateCurrency($currency);
     Validators::validateCards($cards);
     $params = array('username' => $username, 'password' => $password, 'mtid' => $mtid, 'subid' => $subId, 'amount' => $amount, 'currency' => strtoupper($currency), 'locale' => $locale, 'acceptingTerms' => $acceptingTerms, 'cards' => $cards);
     $response = $this->client->assignCardsToDisposition($params);
     return $response->assignCardsToDispositionReturn;
 }