Skip to content

Commit

Permalink
Release 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rootpd committed Jun 24, 2022
1 parent 7e6619c commit 9d00d15
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 21 deletions.
53 changes: 34 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# CRM Wallet Pay module

This module provides integration of the Apple Pay and Google Pay payment gateways into sales funnels.
This module provides integration of the Apple Pay and Google Pay payment gateways into the sales funnels.

Currently the module supports _gateway_ implementation using Tatrabanka provider. This provider currently does not support recurrent payments.

Currently, only non-recurrent payments are supported, since Tatra banka (merchant processing actual payments) do not support recurrent payments.
## Installation

To install the module, run:


```bash
composer require remp/crm-wallet-pay-module
```
Expand All @@ -20,31 +20,27 @@ extensions:
- Crm\WalletPayModule\DI\WalletPayModuleExtension
```

To have the module functionality available in sales funnels, follow the steps:
To have the module functionality available in sales funnels, copy assets by running this command in the application root folder (or run `composer install`, which install assets as well):

1. Go to the module root folder and build JS library:
```bash
# run in WalletPayModule
make js
```
2. Copy built assets by running this command in the application root folder (or run `composer install`, which install assets as well):
```bash
# run in CRM root folder
php bin/command.php application:install_assets
```

## Apple Pay button
## Integration

### Configuration
### Apple Pay button

In CRM settings (`crm.press/admin/config-admin/`) `Payments` section, set up Apple Pay configuration values. These include paths to Apple Pay merchant ID certificate and key (including password, if encrypted).
#### Configuration

In CRM settings (`crm.press/admin/config-admin/`) _Payments_ section, configure Apple Pay options. These include paths to Apple Pay merchant ID certificate and key (including password, if encrypted).
For more information, consult the official documentation on how to [Set Up Apple Pay](https://developer.apple.com/documentation/passkit/apple_pay/setting_up_apple_pay).

#### Requirements

Apple Pay requires HTTPS webpage with valid TLS certificate.

### Usage in sales funnel
#### Usage in sales funnel

First, add "ApplePay Wallet" payment gateway to the list of allowed gateways in the sales funnel settings in CRM admin.

Expand Down Expand Up @@ -76,7 +72,8 @@ RempWalletPay.checkApplePayAvailability(MERCHANT_ID, function () {
document.getElementsByTagName('apple-pay-button')[0].classList.remove('hidden');
});
```
To initialize the button, run the `initApplePayButton`. The most basic configuration:
To initialize the button, run the `initApplePayButton`. The most basic configuration:

```js
const config = {
totalPrice: '0.10',
Expand All @@ -95,7 +92,8 @@ const config = {
RempWalletPay.initApplePayButton(config);
```

Alternatively, can provide `onSuccess` callback, which gives control of processing of the Apple Pay token issued during the payment:
Alternatively, you can provide `onSuccess` callback, which gives you control of processing of the Apple Pay token issued during the payment:

```js
const config = {
totalPrice: '0.10',
Expand Down Expand Up @@ -139,17 +137,17 @@ RempWalletPay.updateApplePayButton({
});
```

## Google Pay
### Google Pay

### Configuration
#### Configuration

To set up Google Pay and obtain required credentials, please follow the official documentation on [Google Pay for web](https://developers.google.com/pay/api/web/guides/setup).

#### Requirements

Google Pay requires HTTPS webpage with valid TLS certificate.

### Usage in sales funnel
#### Usage in sales funnel

First, add "GooglePay Wallet" payment gateway to the list of allowed gateways in the sales funnel settings in CRM admin.

Expand Down Expand Up @@ -260,6 +258,23 @@ RempWalletPay.updateGooglePayButton({
});
```

## Extension

If you want to use your own gateway provider (instead of Tatrabanka), you can extend this module with your own implementation. Please note that this module does not provide support for _direct_ wallet pay payments.

First, you need to implement the integration by providing the implementation of the Google/Apple pay interfaces:

- `Crm\WalletPayModule\Model\GooglePayWalletInterface`
- `Crm\WalletPayModule\Model\ApplePayWalletInterface`

When they're ready, register them in your `config.neon` file and override the default implementation provided by this module:

```neon
services:
applePayWallet: Crm\FooModule\Model\YourProviderApplePayWallet
googlePayWallet: Crm\FooModule\Model\YourProviderGooglePayWallet
```

## API documentation

All examples use `http://crm.press` as a base domain. Please change the host to the one you use
Expand Down
4 changes: 2 additions & 2 deletions src/config/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ services:
- Crm\WalletPayModule\Api\ApplePayMerchantValidationHandler
- Crm\WalletPayModule\Gateways\ApplePayWallet
- Crm\WalletPayModule\Gateways\GooglePayWallet
applePayWallet: Crm\WalletPayModule\Model\TatraBankaApplePayWallet
googlePayWallet: Crm\WalletPayModule\Model\TatraBankaGooglePayWallet
- Crm\WalletPayModule\Seeders\ConfigsSeeder
- Crm\WalletPayModule\Seeders\PaymentGatewaysSeeder
- Crm\WalletPayModule\Model\TatraBankaGooglePayWallet
- Crm\WalletPayModule\DataProviders\WalletPayTokensDataProvider
- Crm\WalletPayModule\Repositories\WalletPayTokensRepository
- Crm\WalletPayModule\Model\TatraBankaApplePayWallet

0 comments on commit 9d00d15

Please sign in to comment.