diff --git a/CHANGELOG.MD b/CHANGELOG.MD
new file mode 100644
index 0000000..e69de29
diff --git a/README.md b/README.md
index bae2409..c98cc01 100644
--- a/README.md
+++ b/README.md
@@ -15,11 +15,16 @@ Please go to the [signup page](https://www.mollie.com/signup) to create a new Mo
3. [Installation](#installation)
4. [Configuring Mollie Gateway](#configuring-mollie-gateway)
5. [API endpoints](#api-endpoints)
+6. [Upgrading](#upgrading)
+6. [API documentation](#api-documentation)
+6. [Want to help us make our API client even better?](#want-to-help-us-make-our-api-client-even-better)
6. [License](#license)
+7. [Support](#support)
## Features
* Support for all available Mollie payment methods.
+* Multicurrency payments
* Support for [one-click payments](https://www.mollie.com/en/features/checkout).
* Fast in-house support. You will always be helped by someone who knows our products intimately.
* Multiple translations: English and Dutch.
@@ -60,13 +65,40 @@ bundle exec rails g spree_mollie_gateway:install
7. Save and you're done!
## API endpoints
-This gateway comes with a couple of API endpoints which seamlessly integrate with the Spree API.
+This gateway comes with a couple of API endpoints which seamlessly integrate with the [Spree API](https://guides.spreecommerce.org/api/).
- Overview of available API endpoints.
## Upgrading
-- Migration from v1.x
+- Migration from v1.x
+
+## API documentation
+
+If you wish to learn more about our API, please visit the [Mollie API Documentation](https://docs.mollie.com).
+
+## Want to help us make our API client even better?
+
+Want to help us make our API client even better? We take [pull requests](https://github.com/mollie/mollie-api-ruby/pulls?utf8=%E2%9C%93&q=is%3Apr), sure. But how would you like to contribute to a technology oriented organization? Mollie is hiring developers and system engineers. [Check out our vacancies](https://jobs.mollie.com/) or [get in touch](mailto:recruitment@mollie.com).
## License
-BSD (Berkeley Software Distribution) License. Copyright (c) 2014-2018, Mollie B.V.
\ No newline at end of file
+[BSD (Berkeley Software Distribution) License](https://opensource.org/licenses/bsd-license.php). Copyright (c) 2014-2018, Mollie B.V.
+
+## Support
+Contact: [www.mollie.com](https://www.mollie.com) — info@mollie.com — +31 20-612 88 55
+
++ [More information about iDEAL via Mollie](https://www.mollie.com/en/payments/ideal/)
++ [More information about Credit card via Mollie](https://www.mollie.com/en/payments/credit-card/)
++ [More information about Bancontact via Mollie](https://www.mollie.com/en/payments/bancontact/)
++ [More information about SOFORT Banking via Mollie](https://www.mollie.com/en/payments/sofort/)
++ [More information about SEPA Bank transfer via Mollie](https://www.mollie.com/en/payments/bank-transfer/)
++ [More information about SEPA Direct debit via Mollie](https://www.mollie.com/en/payments/direct-debit/)
++ [More information about Bitcoin via Mollie](https://www.mollie.com/en/payments/bitcoin/)
++ [More information about PayPal via Mollie](https://www.mollie.com/en/payments/paypal/)
++ [More information about KBC/CBC Payment Button via Mollie](https://www.mollie.com/en/payments/kbc-cbc/)
++ [More information about Belfius Direct Net via Mollie](https://www.mollie.com/en/payments/belfius)
++ [More information about paysafecard via Mollie](https://www.mollie.com/en/payments/paysafecard/)
++ [More information about ING Home’Pay via Mollie](https://www.mollie.com/en/payments/ing-homepay/)
++ [More information about Gift cards via Mollie](https://www.mollie.com/en/payments/gift-cards)
++ [More information about EPS via Mollie](https://www.mollie.com/en/payments/eps)
++ [More information about Giropay via Mollie](https://www.mollie.com/en/payments/giropay)
\ No newline at end of file
diff --git a/app/controllers/spree/api/v1/mollie_controller.rb b/app/controllers/spree/api/v1/mollie_controller.rb
index 9f9dabf..f3a70d1 100644
--- a/app/controllers/spree/api/v1/mollie_controller.rb
+++ b/app/controllers/spree/api/v1/mollie_controller.rb
@@ -4,7 +4,9 @@ module V1
class MollieController < BaseController
def methods
mollie = Spree::PaymentMethod.find_by_type 'Spree::Gateway::MollieGateway'
- payment_methods = mollie.available_methods methods_params
+ payment_methods = mollie.available_methods(methods_params).map {
+ |method| method.attributes
+ }
render json: payment_methods
end
diff --git a/docs/api/methods.md b/docs/api/methods.md
index 25178b5..775a114 100644
--- a/docs/api/methods.md
+++ b/docs/api/methods.md
@@ -2,8 +2,18 @@
Returns a list of Mollie payment methods (and its issuers) which are enabled for your website profile.
+## Headers
+
+This endpoint behaves just like very other Spree API endpoint. If your endpoints require authentication, make sure you send the `X-Spree-Token` header.
+
## Parameters
-This endpoint behaves just like very other Spree API endpoint. If your endpoints require authentication, make sure you sent the `X-Spree-Token` header.
+
+If you would like to obtain a list of payment methods for a specific currency, you should send an `amount` object containing value and currency. Only methods that support the `amount` and `currency` are returned.
+
+| URL Parameter | Required? |
+| -------------------- | ----------:|
+| amount[currency] | No |
+| amount[value] | No |
## Example request
@@ -20,40 +30,274 @@ Content-Type: application/json; charset=utf-8
[
{
- "attributes": {
- "resource": "method",
- "id": "ideal",
- "description": "iDEAL",
- "amount": {
- "minimum": "0.01",
- "maximum": "50000.00"
- },
- "image": {
- "normal": "https://www.mollie.com/images/payscreen/methods/ideal.png",
- "bigger": "https://www.mollie.com/images/payscreen/methods/ideal%402x.png"
- },
- "issuers": [
- {
- "resource": "issuer",
- "id": "ideal_TESTNL99",
- "name": "TBM Bank",
- "method": "ideal",
- "image": {
- "normal": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/TESTNL99.png",
- "bigger": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/TESTNL99%402x.png"
- }
- }
- ]
- },
+ "resource": "method",
"id": "ideal",
"description": "iDEAL",
- "amount": {
- "minimum": "0.01",
- "maximum": "50000.00"
+ "image": {
+ "size1x": "https://www.mollie.com/images/payscreen/methods/ideal.png",
+ "size2x": "https://www.mollie.com/images/payscreen/methods/ideal%402x.png"
},
+ "issuers": [
+ {
+ "resource": "issuer",
+ "id": "ideal_ABNANL2A",
+ "name": "ABN AMRO",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ABNANL2A.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ABNANL2A.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "ideal_ASNBNL21",
+ "name": "ASN Bank",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ASNBNL21.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/ASNBNL21.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "ideal_BUNQNL2A",
+ "name": "bunq",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/BUNQNL2A.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/BUNQNL2A.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "ideal_INGBNL2A",
+ "name": "ING",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/INGBNL2A.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/INGBNL2A.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "ideal_KNABNL2H",
+ "name": "Knab",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/KNABNL2H.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/KNABNL2H.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "ideal_MOYONL21",
+ "name": "Moneyou",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/MOYONL21.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/MOYONL21.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "ideal_RABONL2U",
+ "name": "Rabobank",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/RABONL2U.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/RABONL2U.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "ideal_RBRBNL21",
+ "name": "RegioBank",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/RBRBNL21.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/RBRBNL21.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "ideal_SNSBNL2A",
+ "name": "SNS Bank",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/SNSBNL2A.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/SNSBNL2A.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "ideal_TRIONL2U",
+ "name": "Triodos Bank",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/TRIONL2U.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/TRIONL2U.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "ideal_FVLBNL22",
+ "name": "van Lanschot",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/FVLBNL22.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/ideal-issuer-icons/FVLBNL22.png"
+ }
+ }
+ ],
+ "_links": {
+ "self": {
+ "href": "https://api.mollie.com/v2/methods/ideal",
+ "type": "application/hal+json"
+ }
+ }
+ },
+ {
+ "resource": "method",
+ "id": "creditcard",
+ "description": "Credit card",
+ "image": {
+ "size1x": "https://www.mollie.com/images/payscreen/methods/creditcard.png",
+ "size2x": "https://www.mollie.com/images/payscreen/methods/creditcard%402x.png"
+ },
+ "_links": {
+ "self": {
+ "href": "https://api.mollie.com/v2/methods/creditcard",
+ "type": "application/hal+json"
+ }
+ }
+ },
+ {
+ "resource": "method",
+ "id": "paypal",
+ "description": "PayPal",
"image": {
- "normal": "https://www.mollie.com/images/payscreen/methods/ideal.png",
- "bigger": "https://www.mollie.com/images/payscreen/methods/ideal%402x.png"
+ "size1x": "https://www.mollie.com/images/payscreen/methods/paypal.png",
+ "size2x": "https://www.mollie.com/images/payscreen/methods/paypal%402x.png"
+ },
+ "_links": {
+ "self": {
+ "href": "https://api.mollie.com/v2/methods/paypal",
+ "type": "application/hal+json"
+ }
+ }
+ },
+ {
+ "resource": "method",
+ "id": "bancontact",
+ "description": "Bancontact",
+ "image": {
+ "size1x": "https://www.mollie.com/images/payscreen/methods/mistercash.png",
+ "size2x": "https://www.mollie.com/images/payscreen/methods/mistercash%402x.png"
+ },
+ "_links": {
+ "self": {
+ "href": "https://api.mollie.com/v2/methods/mistercash",
+ "type": "application/hal+json"
+ }
+ }
+ },
+ {
+ "resource": "method",
+ "id": "banktransfer",
+ "description": "Bank transfer",
+ "image": {
+ "size1x": "https://www.mollie.com/images/payscreen/methods/banktransfer.png",
+ "size2x": "https://www.mollie.com/images/payscreen/methods/banktransfer%402x.png"
+ },
+ "_links": {
+ "self": {
+ "href": "https://api.mollie.com/v2/methods/banktransfer",
+ "type": "application/hal+json"
+ }
+ }
+ },
+ {
+ "resource": "method",
+ "id": "sofort",
+ "description": "SOFORT Banking",
+ "image": {
+ "size1x": "https://www.mollie.com/images/payscreen/methods/sofort.png",
+ "size2x": "https://www.mollie.com/images/payscreen/methods/sofort%402x.png"
+ },
+ "_links": {
+ "self": {
+ "href": "https://api.mollie.com/v2/methods/sofort",
+ "type": "application/hal+json"
+ }
+ }
+ },
+ {
+ "resource": "method",
+ "id": "kbc",
+ "description": "KBC/CBC Payment Button",
+ "image": {
+ "size1x": "https://www.mollie.com/images/payscreen/methods/kbc.png",
+ "size2x": "https://www.mollie.com/images/payscreen/methods/kbc%402x.png"
+ },
+ "issuers": [
+ {
+ "resource": "issuer",
+ "id": "cbc",
+ "name": "CBC",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/kbc-issuer-icons/cbc.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/kbc-issuer-icons/cbc.png"
+ }
+ },
+ {
+ "resource": "issuer",
+ "id": "kbc",
+ "name": "KBC",
+ "image": {
+ "size1x": "https://www.mollie.com/images/checkout/v2/kbc-issuer-icons/kbc.png",
+ "size2x": "https://www.mollie.com/images/checkout/v2/kbc-issuer-icons/kbc.png"
+ }
+ }
+ ],
+ "_links": {
+ "self": {
+ "href": "https://api.mollie.com/v2/methods/kbc",
+ "type": "application/hal+json"
+ }
+ }
+ },
+ {
+ "resource": "method",
+ "id": "belfius",
+ "description": "Belfius Pay Button",
+ "image": {
+ "size1x": "https://www.mollie.com/images/payscreen/methods/belfius.png",
+ "size2x": "https://www.mollie.com/images/payscreen/methods/belfius%402x.png"
+ },
+ "_links": {
+ "self": {
+ "href": "https://api.mollie.com/v2/methods/belfius",
+ "type": "application/hal+json"
+ }
+ }
+ },
+ {
+ "resource": "method",
+ "id": "inghomepay",
+ "description": "ING Home'Pay",
+ "image": {
+ "size1x": "https://www.mollie.com/images/payscreen/methods/inghomepay.png",
+ "size2x": "https://www.mollie.com/images/payscreen/methods/inghomepay%402x.png"
+ },
+ "_links": {
+ "self": {
+ "href": "https://api.mollie.com/v2/methods/inghomepay",
+ "type": "application/hal+json"
+ }
+ }
+ },
+ {
+ "resource": "method",
+ "id": "bitcoin",
+ "description": "Bitcoin",
+ "image": {
+ "size1x": "https://www.mollie.com/images/payscreen/methods/bitcoin.png",
+ "size2x": "https://www.mollie.com/images/payscreen/methods/bitcoin%402x.png"
+ },
+ "_links": {
+ "self": {
+ "href": "https://api.mollie.com/v2/methods/bitcoin",
+ "type": "application/hal+json"
+ }
}
}
]
diff --git a/lib/spree_mollie_gateway/version.rb b/lib/spree_mollie_gateway/version.rb
index d7bcb7d..9bfb115 100644
--- a/lib/spree_mollie_gateway/version.rb
+++ b/lib/spree_mollie_gateway/version.rb
@@ -1,3 +1,3 @@
module SpreeMollieGateway
- VERSION = '2.0.0-alpha.1'
+ VERSION = '2.0.0'
end