PATH:
home
/
lab2454c
/
equitablegold.com
/
wp-content
/
plugins
/
woocommerce-gateway-stripe
/
includes
/
admin
<?php /*** * Class WC_REST_Stripe_Tokens_Controller */ defined( 'ABSPATH' ) || exit; /** * REST controller for tokens. */ class WC_REST_Stripe_Tokens_Controller extends WC_Stripe_REST_Base_Controller { /** * Endpoint path. */ protected $rest_base = 'wc_stripe/tokens'; /** * Register REST API routes for Stripe tokens. */ public function register_routes() { register_rest_route( $this->namespace, // For more info on Stripe tokens, see the following: // https://stripe.com/docs/api/tokens/object '/' . $this->rest_base . '/(?P<token_id>[a-z]{3}_[a-zA-Z0-9]{24})', [ 'methods' => WP_REST_Server::READABLE, 'callback' => [ $this, 'get_token' ], 'permission_callback' => [ $this, 'check_permission' ], ] ); } /** * Retrieve a Stripe token, given a secret-key and token_id. * * @param WP_REST_Request $request Request object. * * @return WP_REST_Response Response object. */ public function get_token( $request ) { $token_id = $request->get_param( 'token_id' ); $secret_key = $request->get_header( 'X-WCStripe-Secret-Key' ); try { WC_Stripe_API::set_secret_key( $secret_key ); $response = WC_Stripe_API::request( [], "tokens/$token_id", 'GET' ); if ( ! empty( $response->error ) ) { return new WP_REST_Response( [ 'result' => 'bad_request' ], 400 ); } } catch ( Exception $exception ) { return new WP_REST_Response( [ 'result' => 'bad_request' ], 400 ); } return new WP_REST_Response( $response, 200 ); } }
[-] class-wc-stripe-settings-controller.php
[edit]
[-] class-wc-rest-stripe-account-keys-controller.php
[edit]
[-] class-wc-stripe-inbox-notes.php
[edit]
[-] stripe-settings.php
[edit]
[-] class-wc-rest-stripe-tokens-controller.php
[edit]
[-] class-wc-stripe-rest-upe-flag-toggle-controller.php
[edit]
[-] stripe-sepa-settings.php
[edit]
[-] class-wc-stripe-old-settings-upe-toggle-controller.php
[edit]
[+]
..
[-] stripe-multibanco-settings.php
[edit]
[-] stripe-sofort-settings.php
[edit]
[-] stripe-alipay-settings.php
[edit]
[-] class-wc-rest-stripe-payment-gateway-controller.php
[edit]
[-] class-wc-stripe-admin-notices.php
[edit]
[-] stripe-p24-settings.php
[edit]
[-] class-wc-rest-stripe-locations-controller.php
[edit]
[-] class-wc-stripe-rest-base-controller.php
[edit]
[-] class-wc-rest-stripe-settings-controller.php
[edit]
[-] stripe-oxxo-settings.php
[edit]
[-] stripe-ideal-settings.php
[edit]
[-] stripe-giropay-settings.php
[edit]
[-] stripe-eps-settings.php
[edit]
[-] class-wc-stripe-upe-compatibility-controller.php
[edit]
[-] stripe-bancontact-settings.php
[edit]
[-] stripe-boleto-settings.php
[edit]
[-] class-wc-rest-stripe-connection-tokens-controller.php
[edit]
[-] class-wc-stripe-payment-requests-controller.php
[edit]
[-] class-wc-rest-stripe-account-controller.php
[edit]
[-] class-wc-rest-stripe-orders-controller.php
[edit]
[-] class-wc-stripe-privacy.php
[edit]
[-] class-wc-stripe-payment-gateways-controller.php
[edit]