https://github.com/ethercreative/commerce-paybear
PayBear.io integration with Craft Commerce
https://github.com/ethercreative/commerce-paybear
Last synced: 6 months ago
JSON representation
PayBear.io integration with Craft Commerce
- Host: GitHub
- URL: https://github.com/ethercreative/commerce-paybear
- Owner: ethercreative
- License: mit
- Created: 2018-03-05T15:46:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-12T15:43:08.000Z (about 8 years ago)
- Last Synced: 2025-02-22T12:34:07.772Z (about 1 year ago)
- Language: JavaScript
- Size: 56.6 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Craft Commerce - PayBear.io
PayBear.io integration with Craft Commerce.
## Usage
1. Install
2. Create a PayBear payment method in Commerce
3. Put the ID of the payment method in `craft/config/commercepaybear.php` (copy from [`config.php`](https://github.com/ethercreative/commerce-paybear/blob/master/commercepaybear/config.php) in the plugins folder).
4. Add the following code into your checkout payment page:
```twig
{{ craft.commercepaybear.embed({
button: '#idOfButton',
modal: true,
redirect: 'URL to redirect to on completion',
timer: 15 * 60,
}) }}
```
See https://github.com/Paybear/paybear-samples/tree/master/form#advanced-usage for more options.
Disable CSRF for the callback URL:
```php
(
!isset($_SERVER['REQUEST_URI']) ||
(
!strpos($_SERVER['REQUEST_URI'], 'CommercePayBear/callback')
)
),
];
```