adyen-ruby-api-library 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.travis.yml +14 -0
  4. data/Gemfile +12 -0
  5. data/LICENSE +21 -0
  6. data/README.md +140 -0
  7. data/Rakefile +6 -0
  8. data/adyen-ruby-api-library.gemspec +28 -0
  9. data/bin/console +13 -0
  10. data/bin/setup +8 -0
  11. data/docs/checkout.html +111 -0
  12. data/docs/index.html +50 -0
  13. data/docs/install-library.html +61 -0
  14. data/docs/javascripts/prism.js +5 -0
  15. data/docs/javascripts/scale.fix.js +17 -0
  16. data/docs/marketpay.html +169 -0
  17. data/docs/params.json +1 -0
  18. data/docs/payment.html +106 -0
  19. data/docs/payout.html +135 -0
  20. data/docs/recurring.html +113 -0
  21. data/docs/stylesheets/github-light.css +115 -0
  22. data/docs/stylesheets/prism.css +140 -0
  23. data/docs/stylesheets/styles.css +324 -0
  24. data/docs/using-library.html +67 -0
  25. data/lib/adyen-ruby-api-library.rb +21 -0
  26. data/lib/adyen/client.rb +174 -0
  27. data/lib/adyen/errors.rb +76 -0
  28. data/lib/adyen/services/checkout.rb +50 -0
  29. data/lib/adyen/services/checkout_utility.rb +16 -0
  30. data/lib/adyen/services/marketpay.rb +92 -0
  31. data/lib/adyen/services/payments.rb +23 -0
  32. data/lib/adyen/services/payouts.rb +21 -0
  33. data/lib/adyen/services/recurring.rb +19 -0
  34. data/lib/adyen/services/service.rb +19 -0
  35. data/lib/adyen/version.rb +4 -0
  36. data/spec/account_spec.rb +27 -0
  37. data/spec/checkout_spec.rb +94 -0
  38. data/spec/checkout_utility_spec.rb +27 -0
  39. data/spec/client_spec.rb +40 -0
  40. data/spec/fund_spec.rb +19 -0
  41. data/spec/mocks/requests/Account/close_account.json +3 -0
  42. data/spec/mocks/requests/Account/close_account_holder.json +3 -0
  43. data/spec/mocks/requests/Account/create_account.json +3 -0
  44. data/spec/mocks/requests/Account/create_account_holder.json +15 -0
  45. data/spec/mocks/requests/Account/delete_bank_accounts.json +6 -0
  46. data/spec/mocks/requests/Account/delete_shareholders.json +6 -0
  47. data/spec/mocks/requests/Account/get_account_holder.json +3 -0
  48. data/spec/mocks/requests/Account/get_uploaded_documents.json +4 -0
  49. data/spec/mocks/requests/Account/suspend_account_holder.json +3 -0
  50. data/spec/mocks/requests/Account/un_suspend_account_holder.json +3 -0
  51. data/spec/mocks/requests/Account/update_account.json +7 -0
  52. data/spec/mocks/requests/Account/update_account_holder.json +33 -0
  53. data/spec/mocks/requests/Account/update_account_holder_state.json +6 -0
  54. data/spec/mocks/requests/Account/upload_document.json +9 -0
  55. data/spec/mocks/requests/Checkout/payment-details.json +18 -0
  56. data/spec/mocks/requests/Checkout/payment-result.json +3 -0
  57. data/spec/mocks/requests/Checkout/payment_methods.json +3 -0
  58. data/spec/mocks/requests/Checkout/payment_session.json +15 -0
  59. data/spec/mocks/requests/Checkout/payments.json +17 -0
  60. data/spec/mocks/requests/Checkout/verify.json +3 -0
  61. data/spec/mocks/requests/CheckoutUtility/origin_keys.json +7 -0
  62. data/spec/mocks/requests/Fund/account_holder_balance.json +3 -0
  63. data/spec/mocks/requests/Fund/account_holder_transaction_list.json +16 -0
  64. data/spec/mocks/requests/Fund/payout_account_holder.json +10 -0
  65. data/spec/mocks/requests/Fund/refund_not_paid_out_transfers.json +4 -0
  66. data/spec/mocks/requests/Fund/setup_beneficiary.json +5 -0
  67. data/spec/mocks/requests/Fund/transfer_funds.json +9 -0
  68. data/spec/mocks/requests/Notification/create_notification_configuration.json +20 -0
  69. data/spec/mocks/requests/Notification/delete_notification_configurations.json +6 -0
  70. data/spec/mocks/requests/Notification/get_notification_configuration.json +3 -0
  71. data/spec/mocks/requests/Notification/get_notification_configuration_list.json +1 -0
  72. data/spec/mocks/requests/Notification/test_notification_configuration.json +4 -0
  73. data/spec/mocks/requests/Notification/update_notification_configuration.json +26 -0
  74. data/spec/mocks/requests/Payment/adjust_authorisation.json +12 -0
  75. data/spec/mocks/requests/Payment/authorise.json +28 -0
  76. data/spec/mocks/requests/Payment/authorise3d.json +6 -0
  77. data/spec/mocks/requests/Payment/cancel.json +4 -0
  78. data/spec/mocks/requests/Payment/cancel_or_refund.json +4 -0
  79. data/spec/mocks/requests/Payment/capture.json +8 -0
  80. data/spec/mocks/requests/Payment/refund.json +8 -0
  81. data/spec/mocks/requests/Payout/confirm_third_party.json +4 -0
  82. data/spec/mocks/requests/Payout/decline_third_party.json +4 -0
  83. data/spec/mocks/requests/Payout/store_detail.json +33 -0
  84. data/spec/mocks/requests/Payout/store_detail_and_submit_third_party.json +33 -0
  85. data/spec/mocks/requests/Payout/submit_third_party.json +22 -0
  86. data/spec/mocks/requests/Recurring/disable.json +5 -0
  87. data/spec/mocks/requests/Recurring/list_recurring_details.json +4 -0
  88. data/spec/mocks/requests/Recurring/store_token.json +15 -0
  89. data/spec/mocks/responses/Account/close_account.json +5 -0
  90. data/spec/mocks/responses/Account/close_account_holder.json +7 -0
  91. data/spec/mocks/responses/Account/create_account.json +7 -0
  92. data/spec/mocks/responses/Account/create_account_holder.json +116 -0
  93. data/spec/mocks/responses/Account/delete_bank_accounts.json +4 -0
  94. data/spec/mocks/responses/Account/delete_shareholders.json +4 -0
  95. data/spec/mocks/responses/Account/get_account_holder.json +71 -0
  96. data/spec/mocks/responses/Account/get_uploaded_documents.json +16 -0
  97. data/spec/mocks/responses/Account/suspend_account_holder.json +24 -0
  98. data/spec/mocks/responses/Account/un_suspend_account_holder.json +24 -0
  99. data/spec/mocks/responses/Account/update_account.json +9 -0
  100. data/spec/mocks/responses/Account/update_account_holder.json +95 -0
  101. data/spec/mocks/responses/Account/update_account_holder_state.json +27 -0
  102. data/spec/mocks/responses/Account/upload_document.json +77 -0
  103. data/spec/mocks/responses/Checkout/payment-details.json +14 -0
  104. data/spec/mocks/responses/Checkout/payment-result.json +4 -0
  105. data/spec/mocks/responses/Checkout/payment_methods.json +66 -0
  106. data/spec/mocks/responses/Checkout/payment_session.json +572 -0
  107. data/spec/mocks/responses/Checkout/payments.json +95 -0
  108. data/spec/mocks/responses/Checkout/verify.json +121 -0
  109. data/spec/mocks/responses/CheckoutUtility/origin_keys.json +7 -0
  110. data/spec/mocks/responses/Fund/account_holder_balance.json +47 -0
  111. data/spec/mocks/responses/Fund/account_holder_transaction_list.json +73 -0
  112. data/spec/mocks/responses/Fund/payout_account_holder.json +6 -0
  113. data/spec/mocks/responses/Fund/refund_not_paid_out_transfers.json +5 -0
  114. data/spec/mocks/responses/Fund/setup_beneficiary.json +5 -0
  115. data/spec/mocks/responses/Fund/transfer_funds.json +6 -0
  116. data/spec/mocks/responses/Notification/create_notification_configuration.json +41 -0
  117. data/spec/mocks/responses/Notification/delete_notification_configurations.json +23 -0
  118. data/spec/mocks/responses/Notification/get_notification_configuration.json +41 -0
  119. data/spec/mocks/responses/Notification/get_notification_configuration_list.json +65 -0
  120. data/spec/mocks/responses/Notification/test_notification_configuration.json +49 -0
  121. data/spec/mocks/responses/Notification/update_notification_configuration.json +47 -0
  122. data/spec/mocks/responses/Payment/adjust_authorisation.json +4 -0
  123. data/spec/mocks/responses/Payment/authorise.json +95 -0
  124. data/spec/mocks/responses/Payment/authorise3d.json +30 -0
  125. data/spec/mocks/responses/Payment/cancel.json +4 -0
  126. data/spec/mocks/responses/Payment/cancel_or_refund.json +4 -0
  127. data/spec/mocks/responses/Payment/capture.json +4 -0
  128. data/spec/mocks/responses/Payment/refund.json +4 -0
  129. data/spec/mocks/responses/Payout/confirm_third_party.json +4 -0
  130. data/spec/mocks/responses/Payout/decline_third_party.json +4 -0
  131. data/spec/mocks/responses/Payout/store_detail.json +5 -0
  132. data/spec/mocks/responses/Payout/store_detail_and_submit_third_party.json +8 -0
  133. data/spec/mocks/responses/Payout/submit_third_party.json +8 -0
  134. data/spec/mocks/responses/Recurring/disable.json +30 -0
  135. data/spec/mocks/responses/Recurring/list_recurring_details.json +62 -0
  136. data/spec/mocks/responses/Recurring/store_token.json +7 -0
  137. data/spec/notification_spec.rb +19 -0
  138. data/spec/payments_spec.rb +20 -0
  139. data/spec/payouts_spec.rb +18 -0
  140. data/spec/recurring_spec.rb +17 -0
  141. data/spec/spec_helper.rb +94 -0
  142. metadata +246 -0
@@ -0,0 +1,5 @@
1
+ /* PrismJS 1.14.0
2
+ http://prismjs.com/download.html#themes=prism&languages=clike+ruby */
3
+ var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-([\w-]+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof r?new r(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function(e,t){var r=n.util.type(e);switch(t=t||{},r){case"Object":if(t[n.util.objId(e)])return t[n.util.objId(e)];var a={};t[n.util.objId(e)]=a;for(var l in e)e.hasOwnProperty(l)&&(a[l]=n.util.clone(e[l],t));return a;case"Array":if(t[n.util.objId(e)])return t[n.util.objId(e)];var a=[];return t[n.util.objId(e)]=a,e.forEach(function(e,r){a[r]=n.util.clone(e,t)}),a}return e}},languages:{extend:function(e,t){var r=n.util.clone(n.languages[e]);for(var a in t)r[a]=t[a];return r},insertBefore:function(e,t,r,a){a=a||n.languages;var l=a[e];if(2==arguments.length){r=arguments[1];for(var i in r)r.hasOwnProperty(i)&&(l[i]=r[i]);return l}var o={};for(var s in l)if(l.hasOwnProperty(s)){if(s==t)for(var i in r)r.hasOwnProperty(i)&&(o[i]=r[i]);o[s]=l[s]}return n.languages.DFS(n.languages,function(t,n){n===a[e]&&t!=e&&(this[t]=o)}),a[e]=o},DFS:function(e,t,r,a){a=a||{};for(var l in e)e.hasOwnProperty(l)&&(t.call(e,l,e[l],r||l),"Object"!==n.util.type(e[l])||a[n.util.objId(e[l])]?"Array"!==n.util.type(e[l])||a[n.util.objId(e[l])]||(a[n.util.objId(e[l])]=!0,n.languages.DFS(e[l],t,l,a)):(a[n.util.objId(e[l])]=!0,n.languages.DFS(e[l],t,null,a)))}},plugins:{},highlightAll:function(e,t){n.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,r){var a={callback:r,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};n.hooks.run("before-highlightall",a);for(var l,i=a.elements||e.querySelectorAll(a.selector),o=0;l=i[o++];)n.highlightElement(l,t===!0,a.callback)},highlightElement:function(t,r,a){for(var l,i,o=t;o&&!e.test(o.className);)o=o.parentNode;o&&(l=(o.className.match(e)||[,""])[1].toLowerCase(),i=n.languages[l]),t.className=t.className.replace(e,"").replace(/\s+/g," ")+" language-"+l,t.parentNode&&(o=t.parentNode,/pre/i.test(o.nodeName)&&(o.className=o.className.replace(e,"").replace(/\s+/g," ")+" language-"+l));var s=t.textContent,u={element:t,language:l,grammar:i,code:s};if(n.hooks.run("before-sanity-check",u),!u.code||!u.grammar)return u.code&&(n.hooks.run("before-highlight",u),u.element.textContent=u.code,n.hooks.run("after-highlight",u)),n.hooks.run("complete",u),void 0;if(n.hooks.run("before-highlight",u),r&&_self.Worker){var g=new Worker(n.filename);g.onmessage=function(e){u.highlightedCode=e.data,n.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,a&&a.call(u.element),n.hooks.run("after-highlight",u),n.hooks.run("complete",u)},g.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else u.highlightedCode=n.highlight(u.code,u.grammar,u.language),n.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,a&&a.call(t),n.hooks.run("after-highlight",u),n.hooks.run("complete",u)},highlight:function(e,t,a){var l={code:e,grammar:t,language:a};return n.hooks.run("before-tokenize",l),l.tokens=n.tokenize(l.code,l.grammar),n.hooks.run("after-tokenize",l),r.stringify(n.util.encode(l.tokens),l.language)},matchGrammar:function(e,t,r,a,l,i,o){var s=n.Token;for(var u in r)if(r.hasOwnProperty(u)&&r[u]){if(u==o)return;var g=r[u];g="Array"===n.util.type(g)?g:[g];for(var c=0;c<g.length;++c){var h=g[c],f=h.inside,d=!!h.lookbehind,m=!!h.greedy,p=0,y=h.alias;if(m&&!h.pattern.global){var v=h.pattern.toString().match(/[imuy]*$/)[0];h.pattern=RegExp(h.pattern.source,v+"g")}h=h.pattern||h;for(var b=a,k=l;b<t.length;k+=t[b].length,++b){var w=t[b];if(t.length>e.length)return;if(!(w instanceof s)){if(m&&b!=t.length-1){h.lastIndex=k;var _=h.exec(e);if(!_)break;for(var j=_.index+(d?_[1].length:0),P=_.index+_[0].length,A=b,x=k,O=t.length;O>A&&(P>x||!t[A].type&&!t[A-1].greedy);++A)x+=t[A].length,j>=x&&(++b,k=x);if(t[b]instanceof s)continue;I=A-b,w=e.slice(k,x),_.index-=k}else{h.lastIndex=0;var _=h.exec(w),I=1}if(_){d&&(p=_[1]?_[1].length:0);var j=_.index+p,_=_[0].slice(p),P=j+_.length,N=w.slice(0,j),S=w.slice(P),C=[b,I];N&&(++b,k+=N.length,C.push(N));var E=new s(u,f?n.tokenize(_,f):_,y,_,m);if(C.push(E),S&&C.push(S),Array.prototype.splice.apply(t,C),1!=I&&n.matchGrammar(e,t,r,b,k,!0,u),i)break}else if(i)break}}}}},tokenize:function(e,t){var r=[e],a=t.rest;if(a){for(var l in a)t[l]=a[l];delete t.rest}return n.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){var r=n.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){var r=n.hooks.all[e];if(r&&r.length)for(var a,l=0;a=r[l++];)a(t)}}},r=n.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!a};if(r.stringify=function(e,t,a){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return r.stringify(n,t,e)}).join("");var l={type:e.type,content:r.stringify(e.content,t,a),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:a};if(e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,"&quot;")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+"</"+l.tag+">"},!_self.document)return _self.addEventListener?(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),r=t.language,a=t.code,l=t.immediateClose;_self.postMessage(n.highlight(a,n.languages[r],r)),l&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(n.filename=a.src,n.manual||a.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
4
+ Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(?:true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};
5
+ !function(e){e.languages.ruby=e.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?=end/m,greedy:!0}],keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var n={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.languages.ruby}};e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:{pattern:/(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,lookbehind:!0}}),e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z]\w*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,greedy:!0,inside:{interpolation:n}},{pattern:/("|')(?:#\{[^}]+\}|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:n}}]}(Prism);
@@ -0,0 +1,17 @@
1
+ var metas = document.getElementsByTagName('meta');
2
+ var i;
3
+ if (navigator.userAgent.match(/iPhone/i)) {
4
+ for (i=0; i<metas.length; i++) {
5
+ if (metas[i].name == "viewport") {
6
+ metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
7
+ }
8
+ }
9
+ document.addEventListener("gesturestart", gestureStart, false);
10
+ }
11
+ function gestureStart() {
12
+ for (i=0; i<metas.length; i++) {
13
+ if (metas[i].name == "viewport") {
14
+ metas[i].content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,169 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="chrome=1">
6
+ <title>Adyen-ruby-api-library by Adyen</title>
7
+
8
+ <link rel="stylesheet" href="stylesheets/styles.css">
9
+ <link rel="stylesheet" href="stylesheets/github-light.css">
10
+ <meta name="viewport" content="width=device-width">
11
+
12
+ <link rel="stylesheet" href="stylesheets/prism.css">
13
+ <script src="javascripts/prism.js"></script>
14
+ <!--[if lt IE 9]>
15
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
16
+ <![endif]-->
17
+ </head>
18
+ <body>
19
+ <div class="wrapper">
20
+ <header>
21
+ <h1>Adyen-ruby-api-library</h1>
22
+ <p>Adyen API Library for ruby</p>
23
+
24
+ <p class="view"><a href="https://github.com/Adyen/adyen-ruby-api-library">View the Project on GitHub <small>Adyen/adyen-ruby-api-library</small></a></p>
25
+ <ul>
26
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library/zipball/master">Download <strong>ZIP File</strong></a></li>
27
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library/tarball/master">Download <strong>TAR Ball</strong></a></li>
28
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library">View On <strong>GitHub</strong></a></li>
29
+ </ul>
30
+ </header>
31
+ <section>
32
+ <h2 id="availablemethods">Available methods</h2>
33
+
34
+ <h4 id="marketpayaccount">marketpay.account:</h4>
35
+
36
+ <ul>
37
+ <li>create_account_holder</li>
38
+
39
+ <li>get_account_holder</li>
40
+
41
+ <li>update_account_holder</li>
42
+
43
+ <li>update_account_holder_state</li>
44
+
45
+ <li>suspend_account_holder</li>
46
+
47
+ <li>un_suspend_account_holder</li>
48
+
49
+ <li>close_account_holder</li>
50
+
51
+ <li>create_account</li>
52
+
53
+ <li>update_account</li>
54
+
55
+ <li>close_account</li>
56
+
57
+ <li>upload_document</li>
58
+
59
+ <li>get_uploaded_documents</li>
60
+
61
+ <li>delete_bank_accounts</li>
62
+
63
+ <li>delete_shareholders</li>
64
+ </ul>
65
+
66
+ <h4 id="marketpayfund">marketpay.fund:</h4>
67
+
68
+ <ul>
69
+ <li>account_holder_balance</li>
70
+
71
+ <li>account_holder_transaction_list</li>
72
+
73
+ <li>payout_account_holder</li>
74
+
75
+ <li>transfer_funds</li>
76
+
77
+ <li>setup_beneficiary</li>
78
+
79
+ <li>refund_not_paid_out_transfers</li>
80
+ </ul>
81
+
82
+ <h4 id="marketpaynotification">marketpay.notification:</h4>
83
+
84
+ <ul>
85
+ <li>create_notification_configuration</li>
86
+
87
+ <li>get_notification_configuration</li>
88
+
89
+ <li>get_notification_configuration_list</li>
90
+
91
+ <li>test_notification_configuration</li>
92
+
93
+ <li>update_notification_configuration</li>
94
+
95
+ <li>delete_notification_configurations</li>
96
+ </ul>
97
+
98
+ <h2 id="overview">Overview</h2>
99
+
100
+ <p>Use Adyen MarketPay to power your marketplace with onboarding, payment processing, and payouts.</p>
101
+
102
+ <p>Adyen MarketPay is an end-to-end payment solution for platforms and marketplaces. MarketPay's extensive API powers many types of platforms, such as crowdfunding platforms, peer-to-peer marketplaces, and on-demand services.</p>
103
+
104
+ <p>MarketPay enables you to onboard sellers, service providers or contractors as sub-merchants and accept payments on their behalf. You can also split payments, transfer funds, and pay out to sub-merchants.</p>
105
+
106
+ <p>From a technical perspective, MarketPay is broken down into 3 separate services:</p>
107
+
108
+ <ul>
109
+ <li>Account</li>
110
+
111
+ <li>Fund</li>
112
+
113
+ <li>Notification</li>
114
+ </ul>
115
+
116
+ <h2 id="authentication">Authentication</h2>
117
+
118
+ <p>MarketPay is authenticated via webservice username and password.</p>
119
+
120
+ <pre><code class="ruby language-ruby">adyen.ws_user = "ws@Company.TestCompany"
121
+ adyen.ws_passord = "super_secure_password123"</code></pre></p>
122
+
123
+ <h2 id="account">Account</h2>
124
+
125
+ <p>The Account service is used for onboarding and KYC for people on both sides of your marketplace.</p>
126
+
127
+ <p>To create an account holder, use the create_account_holder method:</p>
128
+
129
+ <pre><code class="ruby language-ruby">response = adyen.marketpay.account('{
130
+ "accountHolderCode":"GENERATE_CODE", // Your unique ID
131
+ "accountHolderDetails":{
132
+ "email":"tim@green.com",
133
+ "individualDetails":{
134
+ "name":{
135
+ "firstName":"Tim",
136
+ "gender": "MALE",
137
+ "lastName":"Green"
138
+ }
139
+ }
140
+ },
141
+ "legalEntity":"Individual"
142
+ }')</code></pre>
143
+
144
+ <p>To enable payouts to an account, send required KYC information and docuemnts to the update_account_holder and upload_documents methods. Required KYC can be found in our docs <a href="https://docs.adyen.com/developers/marketpay/onboarding-and-verification#step2step2enablepayouts">here</a>.</p>
145
+
146
+ <p>You can disable / delete account holders in the same way.</p>
147
+
148
+ <h2 id="fund">Fund</h2>
149
+
150
+ <p>The MarketPay Funding API provides endpoints for managing the funds in MarketPay accounts. These management operations include actions such as the transfer of funds from one account to another, the payout of funds to an account holder, and the retrieval of balances in an account.</p>
151
+
152
+ <p>For further information on MarketPay fund management, please visit the <a href="https://docs.adyen.com/developers/marketpay/marketpay-overview">MarketPay documentation</a>.</p>
153
+
154
+ <h2 id="notification">Notification</h2>
155
+
156
+ <p>The Adyen MarketPay system can send you notifications for a set of events during the flow, such as creating new accounts or account holders, performing KYC checks, making payouts, and so on. </p>
157
+
158
+ <p>These notifications are sent as webhooks to the corresponding URLs configured on your server. Refer to the <a href="https://docs.adyen.com/developers/marketpay/marketpay-notifications/configure-notifications">Configure notifications</a> section to learn how you can set up and test MarketPay notifications, and to <a href="Receive notifications">Receive notifications</a> to explore notification types and see the examples.</p>
159
+
160
+ </section>
161
+ <footer>
162
+ <p>This project is maintained by <a href="https://github.com/Adyen">Adyen</a></p>
163
+ <p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
164
+ </footer>
165
+ </div>
166
+ <script src="javascripts/scale.fix.js"></script>
167
+
168
+ </body>
169
+ </html>
@@ -0,0 +1 @@
1
+ {"name":"Adyen-ruby-api-library","tagline":"Adyen API Library for ruby","body":"# Adyen APIs Library for ruby\r\n\r\n## Description ##\r\nThe Adyen API Library for ruby enables you to work with Adyen APIs.\r\n\r\n## Getting Started ##\r\n\r\nMake sure you have an Adyen account. If you don't have this you can request it <a href=\"https://www.adyen.com/home/discover/test-account-signup#form\" target=\"_blank\">here</a>\r\nTo make the automatice testing cases working for your account change the credentials in the config/test.ini file.\r\n\r\n## Beta ##\r\nThis library is in Beta. We're comfortable enough with the stability and features of the library that we want you to build real production applications on it. We are using this Libary in our Magento plugins. We will make an effort to support the public and protected surface of the library and maintain backwards compatibility in the future. While we are still in Beta, we reserve the right to make incompatible changes. If we do remove some functionality (typically because better functionality exists or if the feature proved infeasible), we will release a new version of the application.\r\n\r\n## Documentation ##\r\nhttps://docs.adyen.com/manuals/adyen-apis-library-for-ruby\r\n\r\n## Installation ##\r\nYou can use Composer or simply Download the Release\r\n\r\n## Composer ##\r\n\r\nThe preferred method is via [composer](https://getcomposer.org). Follow the\r\n[installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have\r\ncomposer installed.\r\n\r\n\r\nOnce composer is installed, execute the following command in your project root to install this library:\r\n\r\n```sh\r\ncomposer require adyen/ruby-api-library\r\n```\r\n\r\n## Examples ##\r\n\r\nCreate Payment Request on Test:\r\n```ruby\r\n\r\n$client = new \\Adyen\\Client();\r\n$client->setApplicationName(\"Adyen ruby Api Library Example\");\r\n$client->setUsername(\"YOUR USERNAME\");\r\n$client->setPassword(\"YOUR PASSWORD\");\r\n$client->setEnvironment(\\Adyen\\Environment::TEST);\r\n\r\n$service = new Service\\Payment($client);\r\n\r\n$json = '{\r\n \"card\": {\r\n \"number\": \"4111111111111111\",\r\n \"expiryMonth\": \"6\",\r\n \"expiryYear\": \"2016\",\r\n \"cvc\": \"737\",\r\n \"holderName\": \"John Smith\"\r\n },\r\n \"amount\": {\r\n \"value\": 1500,\r\n \"currency\": \"EUR\"\r\n },\r\n \"reference\": \"payment-test\",\r\n \"merchantAccount\": \"YOUR MERCHANT ACCOUNT\"\r\n}';\r\n\r\n$params = json_decode($json, true);\r\n\r\n$result = $service->authorise($params);\r\n\r\n```\r\n\r\nFor CSE use\r\n\r\n```ruby\r\n{\r\n \"amount\": {\r\n \"value\": 1499,\r\n \"currency\": \"GBP\"\r\n },\r\n \"reference\": \"payment-test\",\r\n \"merchantAccount\": \"YOUR MERCHANT ACCOUNT\",\r\n \"additionalData\": {\r\n \"card.encrypted.json\": \"THE ENCRYPTED DATA\"\r\n }\r\n}\r\n```\r\n\r\nRefund example:\r\n\r\n```ruby\r\n\r\n$client = new \\Adyen\\Client();\r\n$client->setApplicationName(\"Adyen ruby Api Library Example\");\r\n$client->setUsername(\"YOUR USERNAME\");\r\n$client->setPassword(\"YOUR PASSWORD\");\r\n$client->setEnvironment(\\Adyen\\Environment::TEST);\r\n\r\n// intialize modification service\r\n$service = new Service\\Modification($client);\r\n\r\n// set the amount you want to refund\r\n$modificationAmount = array('currency' => 'CURRENCY', 'value' => 'VALUE');\r\n\r\n// required are merchantAccount, ModificationAmount(currency,value), reference and originalReference\r\n$params = array(\r\n \"merchantAccount\" => 'YOUR MERCHANT ACCOUNT',\r\n \"modificationAmount\" => $modificationAmount,\r\n \"reference\" => 'YOUR OWN REFERENCE',\r\n \"originalReference\" => 'PSPREFERENCE OF THE PAYMENT YOU WANT TO REFUND'\r\n);\r\n\r\n$result = $service->refund($params);\r\n\r\n// $result['response'] = [refund-received]\r\n\r\n```\r\n\r\n## Tests ##\r\nFor the test cases you need the PCI permission enabled on you account. There are no test cases for CSE because credit card data is encrypted through our javascript library.\r\nBy default the test will then be skipped. If you have these permissions fill in your account details in the config/test.ini file to let the test work.\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
@@ -0,0 +1,106 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="chrome=1">
6
+ <title>Adyen-ruby-api-library by Adyen</title>
7
+
8
+ <link rel="stylesheet" href="stylesheets/styles.css">
9
+ <link rel="stylesheet" href="stylesheets/github-light.css">
10
+ <meta name="viewport" content="width=device-width">
11
+ <meta name="viewport" content="width=device-width">
12
+
13
+ <link rel="stylesheet" href="stylesheets/prism.css">
14
+ <script src="javascripts/prism.js"></script>
15
+ <!--[if lt IE 9]>
16
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
17
+ <![endif]-->
18
+ </head>
19
+ <body>
20
+ <div class="wrapper">
21
+ <header>
22
+ <h1>Adyen-ruby-api-library</h1>
23
+ <p>Adyen API Library for ruby</p>
24
+
25
+ <p class="view"><a href="https://github.com/Adyen/adyen-ruby-api-library">View the Project on GitHub <small>Adyen/adyen-ruby-api-library</small></a></p>
26
+ <ul>
27
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library/zipball/master">Download <strong>ZIP File</strong></a></li>
28
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library/tarball/master">Download <strong>TAR Ball</strong></a></li>
29
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library">View On <strong>GitHub</strong></a></li>
30
+ </ul>
31
+ </header>
32
+ <section>
33
+ <h2 id="availablemethods">Available methods</h2>
34
+
35
+ <ul>
36
+ <li>authorise</li>
37
+
38
+ <li>authorise3d</li>
39
+
40
+ <li>capture</li>
41
+
42
+ <li>cancel</li>
43
+
44
+ <li>refund</li>
45
+
46
+ <li>cancel_or_refund</li>
47
+
48
+ <li>adjust_authorisation</li>
49
+ </ul>
50
+
51
+ <h2 id="authentication">Authentication</h2>
52
+
53
+ <p>Payments are authenticated via webservice username and password.</p>
54
+
55
+ <pre><code class="ruby language-ruby">adyen.ws_user = "ws@Company.TestCompany"
56
+ adyen.ws_passord = "super_secure_password123"</code></pre></p>
57
+
58
+ <h2 id="usage">Usage</h2>
59
+
60
+ <p>The Payments service can be used to authorise and modify payments by sending data directly to Adyen's servers.</p>
61
+
62
+ <p>The simplest example is an authorise call with raw card data:</p>
63
+
64
+ <pre><code class="ruby language-ruby">response = adyen.payments.authorise('{
65
+ "card": {
66
+ "number": "4111111111111111",
67
+ "expiryMonth": "08",
68
+ "expiryYear": "2018",
69
+ "holderName": "Test Person",
70
+ "cvc": "737"
71
+ },
72
+ "amount": {
73
+ "value": 1500,
74
+ "currency": "USD"
75
+ },
76
+ "reference": "YOUR_REFERENCE",
77
+ "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
78
+ }')
79
+ </code></pre>
80
+
81
+ <p>You can then capture the payment with a subsequent call to the capture method:</p>
82
+
83
+ <pre><code class="ruby language-ruby">response = adyen.payments.capture('{
84
+ "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
85
+ "originalReference": "&lt;PSP reference from authorise response&gt;",
86
+ "modificationAmount": {
87
+ "value": 1500,
88
+ "currency": "USD"
89
+ }
90
+ }')
91
+ </code></pre>
92
+
93
+ <p>Refunds and cancellations work in the same way.</p>
94
+
95
+ <p>The adjust_authorisation method can be used to change the amount of an authorisation after the initial submission. However this is only available for certain MCC's, so please contact support@adyen.com before sending your own requests.</p>
96
+
97
+ </section>
98
+ <footer>
99
+ <p>This project is maintained by <a href="https://github.com/Adyen">Adyen</a></p>
100
+ <p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
101
+ </footer>
102
+ </div>
103
+ <script src="javascripts/scale.fix.js"></script>
104
+
105
+ </body>
106
+ </html>
@@ -0,0 +1,135 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="chrome=1">
6
+ <title>Adyen-ruby-api-library by Adyen</title>
7
+
8
+ <link rel="stylesheet" href="stylesheets/styles.css">
9
+ <link rel="stylesheet" href="stylesheets/github-light.css">
10
+ <meta name="viewport" content="width=device-width">
11
+
12
+ <link rel="stylesheet" href="stylesheets/prism.css">
13
+ <script src="javascripts/prism.js"></script>
14
+ <!--[if lt IE 9]>
15
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
16
+ <![endif]-->
17
+ </head>
18
+ <body>
19
+ <div class="wrapper">
20
+ <header>
21
+ <h1>Adyen-ruby-api-library</h1>
22
+ <p>Adyen API Library for ruby</p>
23
+
24
+ <p class="view"><a href="https://github.com/Adyen/adyen-ruby-api-library">View the Project on GitHub <small>Adyen/adyen-ruby-api-library</small></a></p>
25
+ <ul>
26
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library/zipball/master">Download <strong>ZIP File</strong></a></li>
27
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library/tarball/master">Download <strong>TAR Ball</strong></a></li>
28
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library">View On <strong>GitHub</strong></a></li>
29
+ </ul>
30
+ </header>
31
+ <section>
32
+ <h2 id="availablemethods">Available methods</h2>
33
+
34
+ <ul>
35
+ <li>store_detail</li>
36
+
37
+ <li>submit_third_party</li>
38
+
39
+ <li>store_detail_and_submit_third_party</li>
40
+
41
+ <li>confirm_third_party</li>
42
+
43
+ <li>decline_third_party</li>
44
+ </ul>
45
+
46
+ <h2 id="authentication">Authentication</h2>
47
+
48
+ <p>Payouts are authenticated via webservice username and password.</p>
49
+
50
+ <pre><code class="ruby language-ruby">adyen.ws_user = "ws@Company.TestCompany"
51
+ adyen.ws_passord = "super_secure_password123"</code></pre></p>
52
+
53
+ <h2 id="usage">Usage</h2>
54
+
55
+ <p>Merchants can send funds to a third-party's eligible credit card, bank account or digital wallet for payments such as insurance claims, rebates, affiliate and contractor payouts, expense reimbursements, or gaming winnings.</p>
56
+
57
+ <p>Each payout requires a 4-eye policy check, where one user submits a payout, before it is confirmed and executed by another user. </p>
58
+
59
+ <p>To set up third-party payouts, you need to:</p>
60
+
61
+ <ol>
62
+ <li>Store the payout details</li>
63
+
64
+ <li>Submit the payout</li>
65
+
66
+ <li>Confirm or decline the payout</li>
67
+ </ol>
68
+
69
+ <h3 id="storepayoutdetails">Store payout details</h3>
70
+
71
+ <p>To store details to payout to, use the store_details method:</p>
72
+
73
+ <pre><code class="ruby language-ruby">response = adyen.payouts.store_detail('{
74
+ "recurring" : {
75
+ "contract" : "PAYOUT"
76
+ },
77
+ "bank": {
78
+ "bankName": "AbnAmro",
79
+ "bic": "ABNANL2A",
80
+ "countryCode": "NL",
81
+ "iban": "NL32ABNA0515071439",
82
+ "ownerName": "Adyen",
83
+ "bankCity": "Amsterdam",
84
+ "taxId":"bankTaxId"
85
+ },
86
+ "merchantAccount" : "YOUR_MERCHANT_ACCOUNT",
87
+ "shopperEmail" : "shopper@email.com",
88
+ "shopperReference" : "&lt;ShopperReference&gt;",
89
+ "dateOfBirth" : "1990-01-01",
90
+ "entityType" : "Company",
91
+ "nationality" : "NL",
92
+ }')</code></pre>
93
+
94
+ <h3 id="submitapayout">Submit a payout</h3>
95
+
96
+ <p>After you've stored the payout details, call the submit_third_party method to request a payout:</p>
97
+
98
+ <pre><code class="ruby language-ruby">response = adyen.payouts.submit_third_party('{
99
+ "amount": {
100
+ "currency": "EUR",
101
+ "value": "1000"
102
+ },
103
+ "recurring": {
104
+ "contract": "PAYOUT"
105
+ },
106
+ "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
107
+ "reference": "YOUR_REFERENCE",
108
+ "shopperEmail": "shopper@email.com",
109
+ "shopperReference": "TheShopperReference",
110
+ "selectedRecurringDetailReference": "LATEST"
111
+ }')</code></pre>
112
+
113
+ <p>Note that you can combine these steps with the store_detail_and_submit_third_party method, by including the amount object in the original store_detail call.</p>
114
+
115
+ <h3 id="confirmordeclineapayout">Confirm or decline a payout</h3>
116
+
117
+ <p>Once you've stored the payout account details and submitted a payout request, you must confirm the payout to initialize the transfer of funds:</p>
118
+
119
+ <pre><code class="ruby language-ruby">response = adyen.payouts.confirm_third_party('{
120
+ "merchantAccount" : "YOUR_MERCHANT_ACCOUNT",
121
+ "originalReference" : "&lt;PSP reference in response from submit_third_party&gt;"
122
+ }')</code></pre>
123
+
124
+ <p>If you decide to decline the payout, you can make the same call to the decline_third_party method to cancel it.</p>
125
+
126
+ </section>
127
+ <footer>
128
+ <p>This project is maintained by <a href="https://github.com/Adyen">Adyen</a></p>
129
+ <p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
130
+ </footer>
131
+ </div>
132
+ <script src="javascripts/scale.fix.js"></script>
133
+
134
+ </body>
135
+ </html>
@@ -0,0 +1,113 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="chrome=1">
6
+ <title>Adyen-ruby-api-library by Adyen</title>
7
+
8
+ <link rel="stylesheet" href="stylesheets/styles.css">
9
+ <link rel="stylesheet" href="stylesheets/github-light.css">
10
+ <meta name="viewport" content="width=device-width">
11
+
12
+ <link rel="stylesheet" href="stylesheets/prism.css">
13
+ <script src="javascripts/prism.js"></script>
14
+ <!--[if lt IE 9]>
15
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
16
+ <![endif]-->
17
+ </head>
18
+ <body>
19
+ <div class="wrapper">
20
+ <header>
21
+ <h1>Adyen-ruby-api-library</h1>
22
+ <p>Adyen API Library for ruby</p>
23
+
24
+ <p class="view"><a href="https://github.com/Adyen/adyen-ruby-api-library">View the Project on GitHub <small>Adyen/adyen-ruby-api-library</small></a></p>
25
+ <ul>
26
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library/zipball/master">Download <strong>ZIP File</strong></a></li>
27
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library/tarball/master">Download <strong>TAR Ball</strong></a></li>
28
+ <li><a href="https://github.com/Adyen/adyen-ruby-api-library">View On <strong>GitHub</strong></a></li>
29
+ </ul>
30
+ </header>
31
+ <section>
32
+ <h2 id="availablemethods">Available methods</h2>
33
+
34
+ <ul>
35
+ <li>store_token</li>
36
+
37
+ <li>list_recurring_details</li>
38
+
39
+ <li>disable</li>
40
+ </ul>
41
+
42
+ <h2 id="authentication">Authentication</h2>
43
+
44
+ <p>Recurring is authenticated via webservice username and password.</p>
45
+
46
+ <pre><code class="ruby language-ruby">adyen.ws_user = "ws@Company.TestCompany"
47
+ adyen.ws_passord = "super_secure_password123"</code></pre></p>
48
+
49
+ <h2 id="usage">Usage</h2>
50
+
51
+ <p>The Recurring service is used to store and manage payment method details on the Adyen server.</p>
52
+
53
+ <p>To store details, make a call to the store_token method:</p>
54
+
55
+ <pre><code class="ruby language-ruby">response = adyen.recurring.store_token('{
56
+ "card": {
57
+ "number": "4111111111111111",
58
+ "expiryMonth": "8",
59
+ "expiryYear": "2018",
60
+ "cvc": "737",
61
+ "holderName": "John Smith"
62
+ },
63
+ "reference": "YOUR_REFERENCE",
64
+ "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
65
+ "shopperReference": "&lt;shopperReference&gt;",
66
+ "recurring": {
67
+ "contract": "RECURRING,ONECLICK"
68
+ }
69
+ }')</code></pre>
70
+
71
+ <p>In the response you will receive a recurringDetailReference which can later be used in conjunction with the shopperReference to create a card on file charge for the shopper:</p>
72
+
73
+ <pre><code class="ruby language-ruby">response = adyen.payments.authorise('{
74
+ "amount":{
75
+ "value":2000,
76
+ "currency":"EUR"
77
+ },
78
+ "reference":"YOUR_REFERENCE",
79
+ "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
80
+ "shopperReference":"&lt;shopperReference&gt;",
81
+ "selectedRecurringDetailReference":"&lt;recurringDetailReference from store_token response&gt;",
82
+ "recurring":{
83
+ "contract":"RECURRING"
84
+ },
85
+ "shopperInteraction":"ContAuth"
86
+ }')</code></pre>
87
+
88
+ <p>To retrieve a list of payment methods associated with a shopper, use the list<em>recurring</em>details method:</p>
89
+
90
+ <pre><code class="ruby language-ruby">response = adyen.recurring.list_recurring_details('{
91
+ "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
92
+ "shopperReference": "&lt;shopperReference&gt;"
93
+ }')</code></pre>
94
+
95
+ <p>If you no longer wish to associate a certain payment detail with a shopper, send a call to the disable method:</p>
96
+
97
+ <pre><code class="ruby language-ruby">response = adyen.recurring.disable('{
98
+ "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
99
+ "shopperReference": "&lt;shopperReference&gt;",
100
+ "recurringDetailReference": "&lt;recurringDetailReference&gt;"
101
+ }')</code></pre>
102
+
103
+
104
+ </section>
105
+ <footer>
106
+ <p>This project is maintained by <a href="https://github.com/Adyen">Adyen</a></p>
107
+ <p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
108
+ </footer>
109
+ </div>
110
+ <script src="javascripts/scale.fix.js"></script>
111
+
112
+ </body>
113
+ </html>