mollie-es6
Advanced tools
+1
-1
| { | ||
| "name": "mollie-es6", | ||
| "version": "1.0.2", | ||
| "version": "1.1.0", | ||
| "description": "Mollie module ready for ES6 usage", | ||
@@ -5,0 +5,0 @@ "main": "app.js", |
+97
-11
@@ -168,19 +168,105 @@ # Mollie ES6 API client for Node.js # | ||
| ``` | ||
| ### Issuers ### | ||
| ### Issuer ### | ||
| This part is iDEAL only. | ||
| Using issuers makes it possible to integrate the bank choice in your own system. | ||
| | Functionality |Implemented | | ||
| |:-------------:|:-------------:| | ||
| | List | Yes | | ||
| | Get | Yes | | ||
| #### List #### | ||
| ```ES6 | ||
| const options = { | ||
| count: 20, | ||
| offset: 2 | ||
| } | ||
| try { | ||
| const issuers_list = yield mollie.issuers.list(options); | ||
| /* | ||
| issuers_list = { | ||
| totalCount: Number, | ||
| offset: Number, | ||
| count: Number, | ||
| data: [Issuers], | ||
| links: { | ||
| first: String(url), | ||
| previous: String(url), | ||
| next: String(url), | ||
| last: String(url) | ||
| } | ||
| } | ||
| */ | ||
| } catch (e) { | ||
| // Handle error | ||
| } | ||
| ``` | ||
| #### Get #### | ||
| ```ES6 | ||
| const issuer_id = 'ideal_ABNANL2A'; | ||
| try { | ||
| const issuer = yield mollie.issuers.get(issuer_id); | ||
| // Do something with this issuer | ||
| } catch (e) { | ||
| // Handle error | ||
| } | ||
| ``` | ||
| ### Refunds ### | ||
| | Functionality |Implemented | | ||
| |:-------------:|:-------------:| | ||
| | Create | Yes | | ||
| | Get | Yes | | ||
| | List | Yes | | ||
| | Cancel | Yes | | ||
| #### Create #### | ||
| ```ES6 | ||
| try { | ||
| const refund_id = 'some_id'; | ||
| const amount = 5.00; // This is optional, if omitted, | ||
| // the full amount will be refunded | ||
| const refund = yield mollie.refunds.create(refund_id, amount); | ||
| } catch (e) { | ||
| // Handle error | ||
| } | ||
| ``` | ||
| #### Get #### | ||
| ```ES6 | ||
| const payment_id = 'payment_id'; | ||
| const refund_id = 'refund_id' | ||
| try { | ||
| const refund = yield mollie.refunds.get(payment_id, refund_id); | ||
| if(refund.payment.isFullyRefunded()) { | ||
| console.log('Payment is fully refunded'); | ||
| } | ||
| } catch (e) { | ||
| // Handle error | ||
| } | ||
| ``` | ||
| #### List #### | ||
| ```ES6 | ||
| const payment_id = 'payment_id'; | ||
| const options = { | ||
| count: 10, | ||
| offset: 2 | ||
| } | ||
| try { | ||
| const payments_list = yield mollie.refunds.list(payment_id, options); | ||
| } catch (e) { | ||
| // Handle error | ||
| } | ||
| ``` | ||
| #### Cancel #### | ||
| ```ES6 | ||
| const payment_id = 'payment_id'; | ||
| const refund_id = 'refund_id' | ||
| try { | ||
| const refund = yield mollie.refunds.cancel(payment_id, refund_id); | ||
| } catch (e) { | ||
| // Handle error | ||
| } | ||
| ``` | ||
53810
3.37%272
46.24%