Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/workarea-commerce/workarea-afterpay
Workarea Afterpay Integration.
https://github.com/workarea-commerce/workarea-afterpay
Last synced: about 1 month ago
JSON representation
Workarea Afterpay Integration.
- Host: GitHub
- URL: https://github.com/workarea-commerce/workarea-afterpay
- Owner: workarea-commerce
- License: other
- Created: 2019-08-20T21:13:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-06T12:28:28.000Z (over 4 years ago)
- Last Synced: 2024-10-31T14:40:30.733Z (about 2 months ago)
- Language: Ruby
- Size: 215 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Workarea Afterpay
================================================================================Afterpay is a pay-by-installments solution. If a user selects afterpay as a payment
option they are taken to the afterpay site where they enter their payment details.
After confirming and placing the order the payment is then captured by the Workarea platform.Both the US and Australian API endpoints are supported in this implementation. See the **Secrets** section for setting up credentials.
An orders currency code will determine what API endpoints will be used when placing an order. Orders in a non supported currency will not
have Afterpay as an option when checking out.Refunds are supported in the Workarea Platform.
Workarea Afterpay orders use the following flow:
1. An API call is made on the Checkout Payment step to see if the order is eligible for Afterpay.
2. If eligible an option for Afterpay is displayed.
3. User clicks place order button - an api call is made to get a token.
4. If token creation is successful the token is injected into the DOM and the user is redirected to the Afterpay site.
5. User enters payment details and submits payment.
6. User is taken back to Workarea and payment is authorized or captured.
7. Order confirmation page is displayed.Afterpay API documentation can be found here: https://docs.afterpay.com/online-api-v2-b857508478e7.html
Implementation Notes
--------------------------------------------------------------------------------**Product Detail Pages**
This integration makes use of the ```storefront.product_pricing_details``` append point to display the Afterpay pricing on the product detail page. Some custom PDP templates may not have this append point.
If you wish for the Afterpay pricing to appear on your custom PDP template simply add the append point manually by adding the following:
```ruby
= append_partials('storefront.product_pricing_details', product: product)
```**Testing**
The test API endpoints will be used by default. Production mode can be triggered by setting the ***test*** configuration value in an initializer to ***false***.
```ruby
config.afterpay.test = false
```**Proxy**
Be sure to whitelist the sandbox and production API endpoints to the Proxy in your hosting environment. Workarea environments running Kubernetes can add this via the command line interface tool.
**Certification Process**
Afterpay has a rigorous certification process that must be completed before using Afterpay in a production environment. This plugin can not guarantee compliance with this process because most of the certification process is branding and marketing specific and is beyond the scope of this integration.
Configuration
--------------------------------------------------------------------------------
The display of Afterpay can be controlled via the ***Afterpay Configuration*** control panel in the Workarea Admin.The following can be controlled
- Global Display: Turn on/off the display on the entire site, including checkout.
- PDP Display: Turn on/off display on the product detail page.
- Cart Display: Turn on/off display on the cart pageSecrets
--------------------------------------------------------------------------------The regional US and Australian API endpoints require separate credentials. You can omit regions that are not relevant to your business needs.
afterpay:
us:
merchant_id: YOUR_US_MERCHANT_ID
secret_key: YOUR_US_SECRET_KEY
au:
merchant_id: YOUR_AU_MERCHANT_ID
secret_key: YOUR_AU_SECRET_KEYGetting Started
--------------------------------------------------------------------------------Add the gem to your application's Gemfile:
```ruby
# ...
gem 'workarea-afterpay'
# ...
```Update your application's bundle.
```bash
cd path/to/application
bundle
```Workarea Commerce Documentation
--------------------------------------------------------------------------------See [https://developer.workarea.com](https://developer.workarea.com) for Workarea Commerce documentation.
License
--------------------------------------------------------------------------------Workarea Afterpay is released under the [Business Software License](LICENSE)