spree_emerchantpay_genesis 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +109 -10
  4. data/app/assets/javascripts/spree/frontend/card.min.js +3 -3
  5. data/app/controllers/spree/api/v2/storefront/checkout_controller_decorator.rb +45 -16
  6. data/app/controllers/spree/api/v2/storefront/emerchantpay_notification_controller.rb +5 -3
  7. data/app/helpers/spree/admin/payment_methods_helper.rb +20 -13
  8. data/app/helpers/spree_emerchantpay_genesis/mappers/genesis.rb +51 -163
  9. data/app/helpers/spree_emerchantpay_genesis/mappers/threeds_attributes.rb +227 -0
  10. data/app/helpers/spree_emerchantpay_genesis/payment_method_helper.rb +34 -0
  11. data/app/helpers/spree_emerchantpay_genesis/threeds_helper.rb +2 -1
  12. data/app/helpers/spree_emerchantpay_genesis/transaction_helper.rb +9 -5
  13. data/app/models/spree/emerchantpay_checkout_source.rb +37 -0
  14. data/app/models/spree/gateway/emerchantpay_checkout.rb +52 -0
  15. data/app/models/spree/gateway/emerchantpay_direct.rb +4 -19
  16. data/app/models/spree/payment_decorator.rb +31 -0
  17. data/app/models/spree_emerchantpay_genesis/base/gateway.rb +18 -1
  18. data/app/models/spree_emerchantpay_genesis/genesis_provider.rb +74 -18
  19. data/app/repositories/spree_emerchantpay_genesis/emerchantpay_payments_repository.rb +6 -5
  20. data/app/repositories/spree_emerchantpay_genesis/spree_payments_repository.rb +4 -8
  21. data/app/serializers/spree/api/v2/platform/emerchantpay_checkout_source_serializer.rb +17 -0
  22. data/app/services/spree/payments/create_decorator.rb +13 -1
  23. data/app/services/spree_emerchantpay_genesis/base/payment_service.rb +28 -2
  24. data/app/services/spree_emerchantpay_genesis/sources/create_checkout.rb +40 -0
  25. data/app/views/partials/_gateway_messages.html.erb +21 -0
  26. data/app/views/partials/_transaction_table.html.erb +34 -0
  27. data/app/views/spree/admin/payments/source_views/_emerchantpay_checkout.html.erb +23 -0
  28. data/app/views/spree/admin/payments/source_views/_emerchantpay_direct.html.erb +2 -55
  29. data/app/views/spree/checkout/payment/_emerchantpay_checkout.html.erb +3 -0
  30. data/config/initializers/extend_spree_permitted_checkout_attributes.rb +13 -0
  31. data/config/locales/en.yml +67 -0
  32. data/db/migrate/20240306152438_add_checkout_source.rb +22 -0
  33. data/lib/spree_emerchantpay_genesis/engine.rb +3 -1
  34. data/lib/spree_emerchantpay_genesis/version.rb +1 -1
  35. metadata +18 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3f946f18fcb121abeb5227927b4d8480f73aedfd549cca1eae4a069a322b34b
4
- data.tar.gz: 675f4efd4755f39eca482ef49dcb4c75555eb98e8cd89217cd2b713f90074d59
3
+ metadata.gz: 9deca475addd04cfdc51f7185d69c3d6fd031b8ee69becf096905f883f34ef5b
4
+ data.tar.gz: 3543891820d71bf926c0d33d9ef4b9dd2b960a320ac1475d9a80aed3d73ffb3b
5
5
  SHA512:
6
- metadata.gz: eda4500c230e18a04b44eb67613c7911666e27730dd8f9eafc19fe6e43d636673479b3f47c9762465ee839ccbff026acb2e4b6dad5cde36f0b7fd07c2fff216f
7
- data.tar.gz: 958cdcf91ac6ce0cd617e14d17c8cc09bde302fb829197e1b74c77ff9829f8e961b5847c419710b2372149baf1b1e72eb4956b0ce7ffaaa7e94121304af46895
6
+ metadata.gz: 4ea32ec52afa0ad5c3189381d87f18bfed25478ab2cca31e967e6f7d67baf4f83d4275477e2a8b20a564ac572d63f466400774e8f8b2ce2b72b15e3834c99efa
7
+ data.tar.gz: ed907c1c11536ca5ec89980e1535f91a9638b84db018cb8fe7c01a87c6047f855bc31611863eb9493f6ce40f59cf0a164ab7a375699beb7ef7995560aefbff15
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ 0.1.4
2
+ -----
3
+ **Features**:
4
+
5
+ * Added `EmerchantpayCheckout` payment method
6
+ * Updated Genesis Ruby SDK to version 0.1.5
7
+ * Update Card JS to the latest version
8
+
9
+ **Fixes**:
10
+
11
+ * Fixed project's URLs listed on RubyGems
12
+
1
13
  0.1.3
2
14
  -----
3
15
  **Features**
data/README.md CHANGED
@@ -7,7 +7,7 @@ This is a Payment Module for Spree eCommerce that gives you the ability to proce
7
7
  * Spree FrontEnd - Optional (Tested up to 4.4.0)
8
8
  * Ruby >= 2.7
9
9
  * Ruby on Rails >= 6.1.4
10
- * [GenesisRuby v0.1.3](https://github.com/GenesisGateway/genesis_ruby/releases/tag/0.1.3)
10
+ * [GenesisRuby v0.1.5](https://github.com/GenesisGateway/genesis_ruby/releases/tag/0.1.5)
11
11
  * PCI-certified server in order to use emerchantpay Direct
12
12
 
13
13
  ## Installation
@@ -37,14 +37,14 @@ Restart your server
37
37
  ## Create Payment Method
38
38
  * Sign in to Spree Admin BackEnd
39
39
  * Navigate to Configurations -> Payment Methods -> New Payment Method
40
- * For Provider `Choose Spree::Gateway::Emerchantpay*`
40
+ * For Provider choose `Spree::Gateway::EmerchantpayDirect` or `Spree:Gateway::EmerchantpayCheckout`
41
41
  * Fill in Name, Description and Stores
42
42
  * Click Create
43
43
 
44
44
  # Usage
45
45
 
46
46
  ## Configuration
47
- * Navigate to the `Spree::Gateway::Emerchantpay*` payment method in the Configurations
47
+ * Navigate to the `Spree::Gateway::EmerchantpayDirect` or `Spree:Gateway::EmerchantpayCheckout` payment method in the Configurations
48
48
  * Fill in Username, Password and Token
49
49
  * Fill in `hostname` used for the generation of the notification webhook. In most cases, the hostname should be the hostname of the Spree backend.
50
50
  * Fill in `return_success_url` and `return_failure_url`. Those endpoints will be returned to the `create_payment` response
@@ -128,6 +128,7 @@ curl --request 'PATCH' \
128
128
  ```
129
129
 
130
130
  4. Update Order
131
+ <a id="payment-point-4"></a>
131
132
  ```bash
132
133
  curl --request 'PATCH' \
133
134
  --header 'Accept: application/vnd.api+json' \
@@ -175,10 +176,15 @@ curl --request 'PATCH' \
175
176
  }
176
177
  }'
177
178
  ```
178
- 5. Create Payment
179
+
180
+ ### Create Payment
181
+
182
+ #### Create Direct Payment
183
+
179
184
  **CAUTION** Create Payment endpoint will Complete the order! Call this endpoint in order to finish the order!
180
- Accept Header, Java Enabled, Language, Color Depth, Screen height, Screen Width, Time Zone Offset, User Agent parameters must be retrieved from the customer browser. More info [here](https://emerchantpay.github.io/gateway-api-docs/?shell#3ds-v2-request-params).
181
185
 
186
+ Accept Header, Java Enabled, Language, Color Depth, Screen height, Screen Width, Time Zone Offset, User Agent parameters must be retrieved from the customer browser. More info [here](https://emerchantpay.github.io/gateway-api-docs/?shell#3ds-v2-request-params).
187
+
182
188
  ```bash
183
189
  curl --request 'POST' \
184
190
  --header 'Accept: application/vnd.api+json' \
@@ -206,9 +212,26 @@ curl --request 'POST' \
206
212
  }'
207
213
  ```
208
214
 
209
- Response:
210
- **CAUTION** If a redirect URL exists in the response object you MUST redirect the customer for payment completion
215
+ **CAUTION** If a redirect URL exists in the response object you MUST redirect the customer for payment completion. Check [Response](#payment-response).
216
+
217
+ #### Create Checkout Payment
218
+
219
+ The Checkout Gateway doesn't require `source_attributes` (see [p.4 Update Order](#payment-point-4)). Upon Order Update or Payment Create the only required parameter is `payment_method_id`.
220
+
221
+ The payment can be finished and a request to the Gateway will be sent with one of the Order Next or Complete endpoints.
211
222
 
223
+ * Order complete:
224
+ ```bash
225
+ curl --request 'PATCH' \
226
+ --header 'Accept: application/vnd.api+json' \
227
+ --header 'X-Spree-Order-Token: EsDjq1oXEgKI6kuujgfvFw1694531383712' \
228
+ --header 'Content-Type: application/vnd.api+json' \
229
+ --url 'http://localhost:4000/api/v2/storefront/checkout/complete'
230
+ ```
231
+ In the JSON Response document you will find a `redirect_url` where the customer must be redirected for completing the payment. Check [Response](#payment-response).
232
+
233
+ ## Response:
234
+ <a id="payment-response"></a>
212
235
  Create Payment response will contain `emerchantpay_payment` object. It will contain the current status of the payment.
213
236
  Redirect URL will give you the next step.
214
237
 
@@ -216,6 +239,7 @@ States:
216
239
  * error or declined - redirect URL will be the Failure URL filled in plugin settings
217
240
  * approved - redirect URL will be the Success URL filled in the plugin settings
218
241
  * pending_async - redirect URL will be the 3DSecure Method Continue endpoint for the next step of the payment
242
+ * new - redirect URL will be the Web Payment Form URL where the customer must finish the payment
219
243
 
220
244
  ```json
221
245
  {
@@ -238,8 +262,81 @@ States:
238
262
  * Refund
239
263
  * Void
240
264
 
241
- ## Contributing
242
- Contribution directions go here.
265
+ ## Supported Transactions
266
+
267
+ * ```emerchantpay Direct``` Payment Method
268
+ * __Authorize__
269
+ * __Authorize (3D-Secure)__
270
+ * __Sale__
271
+ * __Sale (3D-Secure)__
272
+
273
+ * ```emerchantpay Checkout``` Payment Method
274
+ * __Apple Pay__
275
+ * __Argencard__
276
+ * __Aura__
277
+ * __Authorize__
278
+ * __Authorize (3D-Secure)__
279
+ * __Baloto__
280
+ * __Bancomer__
281
+ * __Bancontact__
282
+ * __Banco de Occidente__
283
+ * __Banco do Brasil__
284
+ * __BitPay__
285
+ * __Boleto__
286
+ * __Bradesco__
287
+ * __Cabal__
288
+ * __CashU__
289
+ * __Cencosud__
290
+ * __Davivienda__
291
+ * __Efecty__
292
+ * __Elo__
293
+ * __eps__
294
+ * __eZeeWallet__
295
+ * __Fashioncheque__
296
+ * __GiroPay__
297
+ * __Google Pay__
298
+ * __iDeal__
299
+ * __iDebit__
300
+ * __InstaDebit__
301
+ * __Intersolve__
302
+ * __Itau__
303
+ * __Klarna__
304
+ * __Multibanco__
305
+ * __MyBank__
306
+ * __Naranja__
307
+ * __Nativa__
308
+ * __Neosurf__
309
+ * __Neteller__
310
+ * __Online Banking__
311
+ * __OXXO__
312
+ * __P24__
313
+ * __Pago Facil__
314
+ * __PayPal__
315
+ * __PaySafeCard__
316
+ * __PayU__
317
+ * __Pix__
318
+ * __POLi__
319
+ * __Post Finance__
320
+ * __PPRO__
321
+ * __PSE__
322
+ * __RapiPago__
323
+ * __Redpagos__
324
+ * __SafetyPay__
325
+ * __Sale__
326
+ * __Sale (3D-Secure)__
327
+ * __Santander__
328
+ * __Sepa Direct Debit__
329
+ * __SOFORT__
330
+ * __Tarjeta Shopping__
331
+ * __TCS__
332
+ * __Trustly__
333
+ * __TrustPay__
334
+ * __UPI__
335
+ * __WebMoney__
336
+ * __WebPay__
337
+ * __WeChat__
338
+
339
+ _Note_: If you have trouble with your credentials or terminal configuration, get in touch with our [support] team
243
340
 
244
341
  ## Development
245
342
 
@@ -266,4 +363,6 @@ Contribution directions go here.
266
363
  `bundle exec appraisal install`
267
364
 
268
365
  ## License
269
- The gem is available as open source under the terms of the [GPL-2.0 License](https://opensource.org/license/gpl-2-0/).
366
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/license/mit).
367
+
368
+ [support]: mailto:tech-support@emerchantpay.net