woo-razorpay
Last commit date
css
4 years ago
images
5 years ago
includes
11 months ago
js
4 years ago
public
10 months ago
razorpay-sdk
1 year ago
templates
3 years ago
tests
11 months ago
.editorconfig
9 years ago
LICENSE
10 years ago
btn-1cc-checkout.js
3 years ago
checkout-block.php
2 years ago
checkout_block.js
2 years ago
composer.json
3 years ago
composer.wp-install.json
3 years ago
debug.md
11 months ago
phpunit.xml
3 years ago
readme.txt
10 months ago
script.js
3 years ago
woo-razorpay.php
10 months ago
checkout-block.php
46 lines
| 1 | <?php |
| 2 | |
| 3 | use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType; |
| 4 | |
| 5 | final class WC_Razorpay_Blocks extends AbstractPaymentMethodType |
| 6 | { |
| 7 | protected $name = 'razorpay'; |
| 8 | |
| 9 | public function initialize() |
| 10 | { |
| 11 | $this->settings = get_option('woocommerce_razorpay_settings', []); |
| 12 | } |
| 13 | |
| 14 | public function get_payment_method_script_handles() |
| 15 | { |
| 16 | wp_register_script( |
| 17 | 'razorpay-blocks-integration', |
| 18 | plugin_dir_url(__FILE__) . 'checkout_block.js', |
| 19 | [ |
| 20 | 'wc-blocks-registry', |
| 21 | 'wc-settings', |
| 22 | 'wp-element', |
| 23 | 'wp-html-entities', |
| 24 | 'wp-i18n', |
| 25 | ], |
| 26 | null, |
| 27 | true |
| 28 | ); |
| 29 | |
| 30 | if (function_exists('wp_set_script_translations')) |
| 31 | { |
| 32 | wp_set_script_translations('razorpay-blocks-integration'); |
| 33 | } |
| 34 | |
| 35 | return ['razorpay-blocks-integration']; |
| 36 | } |
| 37 | |
| 38 | public function get_payment_method_data() |
| 39 | { |
| 40 | return [ |
| 41 | 'title' => 'Pay by Razorpay', |
| 42 | 'description' => $this->settings['description'], |
| 43 | ]; |
| 44 | } |
| 45 | } |
| 46 |