/* GetMerchantAccountStatus API call - Returns the status of the Merchant Account.
@see TODO

@param requestParameters['merchant_id'] - [String]
@optional requestParameters['mws_auth_token'] - [String]
169783
public function getMerchantAccountStatus($requestParameters = array())
    {
        $parameters           = array();
        $parameters['Action'] = 'GetMerchantAccountStatus';
        $requestParameters    = array_change_key_case($requestParameters, CASE_LOWER);

        $fieldMappings = array(
            'merchant_id'         => 'SellerId',
            'mws_auth_token'      => 'MWSAuthToken'
        );

        $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters);
        return ($responseObject);
    }
596674
public function getMerchantInfo()
    {
        $url = "https://api.weixin.qq.com/scan/merchantinfo/get?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpGetForJson($url);
    }
1005706
public static function get(
        int $mastercardActionId,
        int $noteTextMasterCardActionId,
        int $monetaryAccountId = null,
        array $customHeaders = []
    ): BunqResponseNoteTextMasterCardAction {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [
                    static::determineUserId(),
                    static::determineMonetaryAccountId($monetaryAccountId),
                    $mastercardActionId,
                    $noteTextMasterCardActionId,
                ]
            ),
            [],
            $customHeaders
        );

        return BunqResponseNoteTextMasterCardAction::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
975737
private static String getClientId(Map<String, Object> params, RequestOptions options)
      throws AuthenticationException {
    String clientId = Stripe.clientId;
    if ((options != null) && (options.getClientId() != null)) {
      clientId = options.getClientId();
    }
    if ((params != null) && (params.get("client_id") != null)) {
      clientId = (String) params.get("client_id");
    }

    if (clientId == null) {
      throw new AuthenticationException(
          "No client_id provided. (HINT: set client_id key using 'Stripe.clientId = <CLIENT-ID>'. "
              + "You can find your client_ids in your Stripe dashboard at "
              + "https://dashboard.stripe.com/account/applications/settings, "
              + "after registering your account as a platform. See "
              + "https://stripe.com/docs/connect/standard-accounts for details, "
              + "or email support@stripe.com if you have any questions.",
          null, null, 0);
    }

    return clientId;
  }
1117981
@Override
    public OrderableTransaction poll() {
        OrderableTransaction retval = null;
        updateQueueState();
        if (m_state == QueueState.UNBLOCKED) {
            retval = super.peek();
            super.poll();
            // not BLOCKED_EMPTY
            assert(retval != null);
        }
        return retval;
    }
1334495
@Restricted(NoExternalUse.class)
    public @Nullable ApiTokenProperty.TokenInfoAndStats getLegacyStatsOf(@Nonnull User user, @Nullable ApiTokenStore.HashedToken legacyToken) {
        ApiTokenProperty apiTokenProperty = user.getProperty(ApiTokenProperty.class);
        if (legacyToken != null) {
            ApiTokenStats.SingleTokenStats legacyStats = apiTokenProperty.getTokenStats().findTokenStatsById(legacyToken.getUuid());
            return new ApiTokenProperty.TokenInfoAndStats(legacyToken, legacyStats);
        }
        
        // in case the legacy token was revoked during the request
        return null;
    }
510950
def transaction_request_object(amount, creditcard, gateway_options)
     {  'AccountHolder' => creditcard.name,
        'ClientIP' => gateway_options[:ip],
        'Details' => transaction_details(amount, creditcard, gateway_options),
        'BillingAddress' => address_hash(creditcard, gateway_options, :billing_address),
        'ShippingAddress' => address_hash(creditcard, gateway_options, :shipping_address),
        'CreditCardData' => {
          'CardNumber' => creditcard.number,
          'CardExpiration' => expiration_date(creditcard),
          'AvsStreet' => gateway_options[:billing_address][:address1],
          'AvsZip' => gateway_options[:billing_address][:zip],
          'CardCode' => creditcard.verification_value } }
    end
561410
private TransactionStatus computeNewTransactionStatusFromPaymentTransactionInfoPlugin(final PaymentTransactionInfoPlugin input, final TransactionStatus currentTransactionStatus) {
        final TransactionStatus newTransactionStatus = PaymentTransactionInfoPluginConverter.toTransactionStatus(input);
        return (newTransactionStatus != TransactionStatus.UNKNOWN) ? newTransactionStatus : currentTransactionStatus;
    }
477322
@RequestMapping(value = "/findByUsername", method = RequestMethod.GET)
	public @ResponseBody
	ResponseAccount findByUsername(
			@RequestParam(value = "username", required = true) String username) {
		logger.debug("Received request to get account by username");

		ResponseAccount acconut = accountService.getAccountByUsername(username);

		return acconut;

	}
997076
def get_tokens(self, *, payer_id, credit_card_token_id, start_date, end_date):
        
        payload = {
            "language": self.client.language.value,
            "command": PaymentCommand.GET_TOKENS.value,
            "merchant": {
                "apiLogin": self.client.api_login,
                "apiKey": self.client.api_key
            },
            "creditCardTokenInformation": {
                "payerId": payer_id,
                "creditCardTokenId": credit_card_token_id,
                "startDate": start_date.strftime('%Y-%m-%dT%H:%M:%S'),
                "endDate": end_date.strftime('%Y-%m-%dT%H:%M:%S')
            },
            "test": self.client.is_test
        }
        return self.client._post(self.url, json=payload)
432645
public int getHTTPStatus() throws InterruptedException, BOSHException {
        if (toThrow != null) {
            throw(toThrow);
        }
        lock.lock();
        try {
            if (!sent) {
                awaitResponse();
            }
        } finally {
            lock.unlock();
        }
        return statusCode;
    }
513803
@Override
    public AuthenticationStatus authenticate(HttpServletRequest req, HttpServletResponse res, AuthenticationParameters params) {
        AuthenticationStatus authStatus = AuthenticationStatus.SEND_FAILURE;
        req.setAttribute(JavaEESecConstants.SECURITY_CONTEXT_AUTH_PARAMS, params);
        try {
            boolean result = req.authenticate(res);
            if (result) {
                authStatus = AuthenticationStatus.SUCCESS;
            } else {
//TODO some error handling.
            }
        } catch (Exception e) {
//TODO need to handle error.
            e.printStackTrace();
        }
        return authStatus;
    }
894586
public static String getPasswordResetToken(final RequestContext requestContext) {
        val flowScope = requestContext.getFlowScope();
        return flowScope.getString(FLOWSCOPE_PARAMETER_NAME_TOKEN);
    }
1333706
public final function getServerAuthStatus(ClientAuth $clientAuth = null) {
		$serverAuthStatus = new ServerAuthStatus();
		$serverAuthStatus->publicKey = $this->getPublicKey();
		$serverAuthStatus->isSuccess = $clientAuth && $this->isValidAuth($clientAuth);
		return $serverAuthStatus;
	}
1224688
@Nullable
    PaymentIntent retrievePaymentIntent(
            @NonNull PaymentIntentParams paymentIntentParams,
            @NonNull String publishableKey,
            @Nullable String stripeAccount)
            throws AuthenticationException,
            InvalidRequestException,
            APIConnectionException,
            APIException {
        final Map<String, Object> paramMap = paymentIntentParams.toParamMap();
        final RequestOptions options = RequestOptions.builder(publishableKey, stripeAccount,
                RequestOptions.TYPE_QUERY).build();

        try {
            final String apiKey = options.getPublishableApiKey();
            if (StripeTextUtils.isBlank(apiKey)) {
                return null;
            }

            logTelemetryData();
            final Map<String, Object> loggingParams = mLoggingUtils
                    .getPaymentIntentRetrieveParams(null, apiKey);
            final RequestOptions loggingOptions = RequestOptions.builder(publishableKey).build();
            logApiCall(loggingParams, loggingOptions);
            final String paymentIntentId = PaymentIntent.parseIdFromClientSecret(
                    paymentIntentParams.getClientSecret());
            final StripeResponse response = requestData(RequestExecutor.RestMethod.GET,
                    getRetrievePaymentIntentUrl(paymentIntentId), paramMap, options);
            return PaymentIntent.fromString(response.getResponseBody());
        } catch (CardException unexpected) {
            // This particular kind of exception should not be possible from a PaymentI API endpoint
            throw new APIException(unexpected.getMessage(), unexpected.getRequestId(),
                    unexpected.getStatusCode(), null, unexpected);
        }
    }
1148462
@POST
  @Path("{id}/account/confirm")
  @PermitAll
  public Response confirmAccount(@PathParam("id") Long userId, AccountRequest request) {
    checkNotNull(userId);
    checkNotNull(request.getToken());

    boolean isSuccess = userService.confirmAccountUsingToken(userId, request.getToken());
    return isSuccess ? Response.noContent().build() : Response.status(Response.Status.BAD_REQUEST).build();
  }
596218
@SuppressWarnings("unchecked")
	public QueryResponse getAllBankAccounts(String customerId, int count) throws BaseException {

		logger.debug("Enter BankAccountService::getAllBankAccounts");
		
		if (StringUtils.isBlank(customerId)) {
			logger.error("IllegalArgumentException {}", customerId);
			throw new IllegalArgumentException("customerId cannot be empty or null");
		}

		// prepare API url
		String apiUrl = requestContext.getBaseUrl().replaceAll("payments", "customers") + "{id}/bank-accounts"
				.replaceAll("\\{format\\}", "json").replaceAll("\\{" + "id" + "\\}", customerId.toString());
		if(count > 0 ) {
			apiUrl = apiUrl + "?count="+ count;
		}
		logger.info("apiUrl - " + apiUrl);
		
		// assign TypeReference for deserialization
		TypeReference<List<BankAccount>> typeReference = new TypeReference<List<BankAccount>>() {
		};

		// prepare service request
		Request request = new Request.RequestBuilder(MethodType.GET, apiUrl).typeReference(typeReference)
				.context(requestContext).build();

		// make API call
		Response response = sendRequest(request);

		// retrieve response
		List<BankAccount> bankAccounts = (List<BankAccount>) response.getResponseObject();
		QueryResponse queryResponse = new QueryResponse.Builder().bankAccounts(bankAccounts).build();

		// set additional attributes
		prepareResponse(request, response, queryResponse);
		return queryResponse;
	}